def __init__(self, host, port, mode): ReconnectingConnection.__init__(self, host, port) self.coordinator = None self.last_data_received = None self.mode = mode # set up filters # this set gets put into specific_filter in # multiple places, so we can just add an address # to this set when we want mlat data. self.interested_mlat = set() self.default_filter = [False] * 32 self.specific_filter = [None] * 32 # specific filters for mlat for df in (0, 4, 5, 11, 16, 20, 21): self.specific_filter[df] = self.interested_mlat # we want all DF17 messages so we can report position rates # and distinguish ADS-B from Mode-S-only aircraft self.default_filter[17] = True self.modeac_filter = set() self.reset_connection()
def heartbeat(self, now): ReconnectingConnection.heartbeat(self, now) if self.state == 'ready' and (now - self.last_data_received) > self.inactivity_timeout: self.disconnect('No data (not even keepalives) received for {0:.0f} seconds'.format( self.inactivity_timeout)) self.reconnect()
def heartbeat(self, now): ReconnectingConnection.heartbeat(self, now) if self.state == 'connected' and (now - self.last_data_received) > self.inactivity_timeout: self.disconnect('No data (not even keepalives) received for {0:.0f} seconds'.format( self.inactivity_timeout)) self.reconnect()
def __init__(self, host, port, connection_type): ReconnectingConnection.__init__(self, host, port) self.coordinator = None self.last_data_received = None self.last_timestamp = 0 if connection_type == 'radarcape': self.packetize = packetize_radarcape_input elif connection_type == 'beast': self.packetize = packetize_beast_input elif connection_type == 'sbs': self.packetize = self.find_sbs_stream_start else: raise NotImplementedError("no support for conn_type=" + connection_type)
def __init__(self, host, port): ReconnectingConnection.__init__(self, host, port) self.reset_connection()