From a12b144c7c88f560389d1549d365c46261b09224 Mon Sep 17 00:00:00 2001 From: n0mjs710 Date: Mon, 12 Oct 2020 08:27:03 -0500 Subject: [PATCH] Options added --- config.py | 2 +- hblink.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index f86628c..3913a33 100755 --- a/config.py +++ b/config.py @@ -182,7 +182,7 @@ def build_config(_config_file): 'SOFTWARE_ID': bytes(config.get(section, 'SOFTWARE_ID').ljust(40)[:40], 'utf-8'), 'PACKAGE_ID': bytes(config.get(section, 'PACKAGE_ID').ljust(40)[:40], 'utf-8'), 'GROUP_HANGTIME': config.getint(section, 'GROUP_HANGTIME'), - 'OPTIONS': bytes(config.get(section, 'OPTIONS'), 'utf-8'), + 'OPTIONS': b''.join([b'Type=HBlink;', bytes(config.get(section, 'OPTIONS'), 'utf-8')]), 'USE_ACL': config.getboolean(section, 'USE_ACL'), 'SUB_ACL': config.get(section, 'SUB_ACL'), 'TG1_ACL': config.get(section, 'TGID_TS1_ACL'), diff --git a/hblink.py b/hblink.py index 83b67ad..273fe3e 100755 --- a/hblink.py +++ b/hblink.py @@ -519,6 +519,14 @@ class HBSYSTEM(DatagramProtocol): self.transport.write(b''.join([MSTNAK, _peer_id]), _sockaddr) logger.warning('(%s) Ping from Radio ID that is not logged in: %s', self._system, int_id(_peer_id)) + elif _command == RPTO: + _peer_id = _data[4:8] + if _peer_id in self._peers \ + and self._peers[_peer_id]['CONNECTION'] == 'YES' \ + and self._peers[_peer_id]['SOCKADDR'] == _sockaddr: + logger.info('(%s) Peer %s (%s) has send options: %s', self._system, self._peers[_peer_id]['CALLSIGN'], int_id(_peer_id), _data[8:]) + self.transport.write(b''.join([RPTACK, _peer_id]), _sockaddr) + else: logger.error('(%s) Unrecognized command. Raw HBP PDU: %s', self._system, ahex(_data))