Add HBP Options (RPTO) handling

This commit is contained in:
Simon 2020-12-23 00:31:27 +00:00
parent 6612bc9955
commit 28e4800283
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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 \