def __init__(self, _name, _config, _logger, report_server): HBSYSTEM.__init__(self, _name, _config, _logger, report_server) self._ambeRxPort = 31003 # Port to listen on for AMBE frames to transmit to all peers self._gateway = "127.0.0.1" # IP address of Analog_Bridge app self._gateway_port = 31000 # Port Analog_Bridge is listening on for AMBE frames to decode self.load_configuration(cli_args.BRIDGE_CONFIG_FILE) self.hb_ambe = AMBE_HB(self, _name, _config, _logger, self._ambeRxPort) self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def __init__(self, _name, _config, _report): HBSYSTEM.__init__(self, _name, _config, _report) # Status information for the system, TS1 & TS2 # 1 & 2 are "timeslot" # In TX_EMB_LC, 2-5 are burst B-E self.STATUS = { 1: { 'RX_START': time(), 'RX_SEQ': '\x00', 'RX_RFS': '\x00', 'TX_RFS': '\x00', 'RX_STREAM_ID': '\x00', 'TX_STREAM_ID': '\x00', 'RX_TGID': '\x00\x00\x00', 'TX_TGID': '\x00\x00\x00', 'RX_TIME': time(), 'TX_TIME': time(), 'RX_TYPE': const.HBPF_SLT_VTERM, 'RX_LC': '\x00', 'TX_H_LC': '\x00', 'TX_T_LC': '\x00', 'TX_EMB_LC': { 1: '\x00', 2: '\x00', 3: '\x00', 4: '\x00', } }, 2: { 'RX_START': time(), 'RX_SEQ': '\x00', 'RX_RFS': '\x00', 'TX_RFS': '\x00', 'RX_STREAM_ID': '\x00', 'TX_STREAM_ID': '\x00', 'RX_TGID': '\x00\x00\x00', 'TX_TGID': '\x00\x00\x00', 'RX_TIME': time(), 'TX_TIME': time(), 'RX_TYPE': const.HBPF_SLT_VTERM, 'RX_LC': '\x00', 'TX_H_LC': '\x00', 'TX_T_LC': '\x00', 'TX_EMB_LC': { 1: '\x00', 2: '\x00', 3: '\x00', 4: '\x00', } } } self.CALL_DATA = []
def __init__(self, _name, _config, _report): HBSYSTEM.__init__(self, _name, _config, _report) # Status information for the system, TS1 & TS2 # 1 & 2 are "timeslot" # In TX_EMB_LC, 2-5 are burst B-E self.STATUS = { 1: { 'RX_START': time(), 'RX_SEQ': '\x00', 'RX_RFS': '\x00', 'TX_RFS': '\x00', 'RX_STREAM_ID': '\x00', 'TX_STREAM_ID': '\x00', 'RX_TGID': '\x00\x00\x00', 'TX_TGID': '\x00\x00\x00', 'RX_TIME': time(), 'TX_TIME': time(), 'RX_TYPE': hb_const.HBPF_SLT_VTERM, 'RX_LC': '\x00', 'TX_H_LC': '\x00', 'TX_T_LC': '\x00', 'TX_EMB_LC': { 1: '\x00', 2: '\x00', 3: '\x00', 4: '\x00', } }, 2: { 'RX_START': time(), 'RX_SEQ': '\x00', 'RX_RFS': '\x00', 'TX_RFS': '\x00', 'RX_STREAM_ID': '\x00', 'TX_STREAM_ID': '\x00', 'RX_TGID': '\x00\x00\x00', 'TX_TGID': '\x00\x00\x00', 'RX_TIME': time(), 'TX_TIME': time(), 'RX_TYPE': hb_const.HBPF_SLT_VTERM, 'RX_LC': '\x00', 'TX_H_LC': '\x00', 'TX_T_LC': '\x00', 'TX_EMB_LC': { 1: '\x00', 2: '\x00', 3: '\x00', 4: '\x00', } } } self.CALL_DATA = []
def __init__(self, _name, _config, _report): HBSYSTEM.__init__(self, _name, _config, _report) self._laststrid = '' # Status information for the system, TS1 & TS2 # 1 & 2 are "timeslot" self.STATUS = { 1: { 'RX_START': time(), 'RX_LOSS': 0, 'RX_SEQ': 0, 'RX_RFS': b'\x00', 'TX_RFS': b'\x00', 'RX_STREAM_ID': b'\x00', 'TX_STREAM_ID': b'\x00', 'RX_TGID': b'\x00\x00\x00', 'TX_TGID': b'\x00\x00\x00', 'RX_TIME': time(), 'TX_TIME': time(), 'RX_TYPE': const.HBPF_SLT_VTERM, }, 2: { 'RX_START': time(), 'RX:LOSS': 0, 'RX_SEQ': 0, 'RX_RFS': b'\x00', 'TX_RFS': b'\x00', 'RX_STREAM_ID': b'\x00', 'TX_STREAM_ID': b'\x00', 'RX_TGID': b'\x00\x00\x00', 'TX_TGID': b'\x00\x00\x00', 'RX_TIME': time(), 'TX_TIME': time(), 'RX_TYPE': const.HBPF_SLT_VTERM, } }
def __init__(self, _name, _config): HBSYSTEM.__init__(self, _name, _config)
def __init__(self, _name, _config, _report): HBSYSTEM.__init__(self, _name, _config, _report) self.last_stream = b'\x00'
def __init__(self, _name, _config, _report): HBSYSTEM.__init__(self, _name, _config, _report)
for sig in [signal.SIGTERM, signal.SIGINT]: signal.signal(sig, sig_handler) # Create the name-number mapping dictionaries peer_ids, subscriber_ids, talkgroup_ids = mk_aliases(CONFIG) # INITIALIZE THE REPORTING LOOP if CONFIG['REPORTS']['REPORT']: report_server = config_reports(CONFIG, reportFactory) else: report_server = None logger.info('(REPORT) TCP Socket reporting not configured') # HBlink instance creation logger.info('HBlink \'blank_app.py\' -- SYSTEM STARTING...') for system in CONFIG['SYSTEMS']: if CONFIG['SYSTEMS'][system]['ENABLED']: if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE': systems[system] = OPENBRIDGE(system, CONFIG, report_server) else: systems[system] = HBSYSTEM(system, CONFIG, report_server) reactor.listenUDP(CONFIG['SYSTEMS'][system]['PORT'], systems[system], interface=CONFIG['SYSTEMS'][system]['IP']) logger.debug('%s instance created: %s, %s', CONFIG['SYSTEMS'][system]['MODE'], system, systems[system]) reactor.run()
def send_clients(self, _packet): mutex.acquire() HBSYSTEM.send_clients(self, _packet) mutex.release()
def send_master(self, _packet): mutex.acquire() HBSYSTEM.send_master(self, _packet) mutex.release()