From 28e4800283c6a8129e70b5840d3aee2c11a18b26 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 23 Dec 2020 00:31:27 +0000 Subject: [PATCH] Add HBP Options (RPTO) handling --- bridge_master.py | 2 ++ hblink.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/bridge_master.py b/bridge_master.py index aae8ce8..2fe606f 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -475,6 +475,8 @@ def ident(): if CONFIG['SYSTEMS'][system]['MODE'] != 'MASTER': continue if CONFIG['SYSTEMS'][system]['VOICE_IDENT'] == True: + # if CONFIG['SYSTEMS'][system]['PEERS'] == False: + # logger.debug('(%s) System has no peers, not sending ident',system) #We only care about slot 2 - idents go out on slot 2 _slot = systems[system].STATUS[2] #If slot is idle for RX and TX diff --git a/hblink.py b/hblink.py index 8333179..fa766b1 100755 --- a/hblink.py +++ b/hblink.py @@ -506,6 +506,14 @@ class HBSYSTEM(DatagramProtocol): self.transport.write(b''.join([MSTNAK, _peer_id]), _sockaddr) logger.warning('(%s) Peer info from Radio ID that has 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]['SOCKADDR'] == _sockaddr: + _this_peer = self._peers[_peer_id] + _this_peer['OPTIONS'] = _data[8:] + self.send_peer(_peer_id, b''.join([RPTACK, _peer_id])) + logger.info('(%s) Peer %s has sent options %s', self._system, _this_peer['CALLSIGN'], _this_peer['OPTIONS']) + elif _command == RPTP: # RPTPing -- peer is pinging us _peer_id = _data[7:11] if _peer_id in self._peers \