Match 'client' login from MMDVMHost

This commit is contained in:
root 2016-11-18 09:27:57 -05:00
parent 447ee1fdc2
commit 02fda0e31d
2 changed files with 16 additions and 15 deletions

View File

@ -79,14 +79,14 @@ def build_config(_config_file):
'MASTER_IP': gethostbyname(config.get(section, 'MASTER_IP')), 'MASTER_IP': gethostbyname(config.get(section, 'MASTER_IP')),
'MASTER_PORT': config.getint(section, 'MASTER_PORT'), 'MASTER_PORT': config.getint(section, 'MASTER_PORT'),
'PASSPHRASE': config.get(section, 'PASSPHRASE'), 'PASSPHRASE': config.get(section, 'PASSPHRASE'),
'CALLSIGN': config.get(section, 'CALLSIGN').ljust(8), 'CALLSIGN': config.get(section, 'CALLSIGN').ljust(8)[:8],
'RADIO_ID': hex(int(config.get(section, 'RADIO_ID')))[2:].rjust(8,'0').decode('hex'), 'RADIO_ID': hex(int(config.get(section, 'RADIO_ID')))[2:].rjust(8,'0').decode('hex'),
'RX_FREQ': config.get(section, 'RX_FREQ').ljust(9), 'RX_FREQ': config.get(section, 'RX_FREQ').ljust(9)[:9],
'TX_FREQ': config.get(section, 'TX_FREQ').ljust(9), 'TX_FREQ': config.get(section, 'TX_FREQ').ljust(9)[:9],
'TX_POWER': config.get(section, 'TX_POWER').rjust(2,'0'), 'TX_POWER': config.get(section, 'TX_POWER').rjust(2,'0'),
'COLORCODE': config.get(section, 'COLORCODE').rjust(2,'0'), 'COLORCODE': config.get(section, 'COLORCODE').rjust(2,'0'),
'LATITUDE': config.get(section, 'LATITUDE').ljust(9), 'LATITUDE': config.get(section, 'LATITUDE').ljust(8)[:8],
'LONGITUDE': config.get(section, 'LONGITUDE').ljust(10), 'LONGITUDE': config.get(section, 'LONGITUDE').ljust(9)[:9],
'HEIGHT': config.get(section, 'HEIGHT').rjust(3,'0'), 'HEIGHT': config.get(section, 'HEIGHT').rjust(3,'0'),
'LOCATION': config.get(section, 'LOCATION').ljust(20)[:20], 'LOCATION': config.get(section, 'LOCATION').ljust(20)[:20],
'DESCRIPTION': config.get(section, 'DESCRIPTION').ljust(19)[:19], 'DESCRIPTION': config.get(section, 'DESCRIPTION').ljust(19)[:19],
@ -148,4 +148,4 @@ if __name__ == '__main__':
cli_args.CONFIG_FILE = os.path.dirname(os.path.abspath(__file__))+'/hblink.cfg' cli_args.CONFIG_FILE = os.path.dirname(os.path.abspath(__file__))+'/hblink.cfg'
pprint(build_config(cli_args.CONFIG_FILE)) pprint(build_config(cli_args.CONFIG_FILE))

View File

@ -400,6 +400,7 @@ class HBSYSTEM(DatagramProtocol):
logger.info('(%s) Client is closing down: %s (%s)', self._system, self._clients[_radio_id]['CALLSIGN'], int_id(_radio_id)) logger.info('(%s) Client is closing down: %s (%s)', self._system, self._clients[_radio_id]['CALLSIGN'], int_id(_radio_id))
self.transport.write('MSTNAK'+_radio_id, (_host, _port)) self.transport.write('MSTNAK'+_radio_id, (_host, _port))
del self._clients[_radio_id] del self._clients[_radio_id]
else: else:
_radio_id = _data[4:8] # Configure Command _radio_id = _data[4:8] # Configure Command
if _radio_id in self._clients \ if _radio_id in self._clients \
@ -414,15 +415,15 @@ class HBSYSTEM(DatagramProtocol):
_this_client['TX_FREQ'] = _data[25:34] _this_client['TX_FREQ'] = _data[25:34]
_this_client['TX_POWER'] = _data[34:36] _this_client['TX_POWER'] = _data[34:36]
_this_client['COLORCODE'] = _data[36:38] _this_client['COLORCODE'] = _data[36:38]
_this_client['LATITUDE'] = _data[38:47] _this_client['LATITUDE'] = _data[38:46]
_this_client['LONGITUDE'] = _data[47:57] _this_client['LONGITUDE'] = _data[46:55]
_this_client['HEIGHT'] = _data[57:60] _this_client['HEIGHT'] = _data[55:58]
_this_client['LOCATION'] = _data[60:80] _this_client['LOCATION'] = _data[58:78]
_this_client['DESCRIPTION'] = _data[80:99] _this_client['DESCRIPTION'] = _data[78:97]
_this_client['SLOTS'] = _data[99:100] _this_client['SLOTS'] = _data[97:98]
_this_client['URL'] = _data[100:224] _this_client['URL'] = _data[98:222]
_this_client['SOFTWARE_ID'] = _data[224:264] _this_client['SOFTWARE_ID'] = _data[222:262]
_this_client['PACKAGE_ID'] = _data[264:304] _this_client['PACKAGE_ID'] = _data[262:302]
self.send_client(_radio_id, 'RPTACK'+_radio_id) self.send_client(_radio_id, 'RPTACK'+_radio_id)
logger.info('(%s) Client %s (%s) has sent repeater configuration', self._system, _this_client['CALLSIGN'], _this_client['RADIO_ID']) logger.info('(%s) Client %s (%s) has sent repeater configuration', self._system, _this_client['CALLSIGN'], _this_client['RADIO_ID'])