This commit is contained in:
Simon 2021-04-04 17:44:29 +01:00
parent f7759dcce9
commit b096d5dfa5
2 changed files with 6 additions and 1 deletions

View File

@ -70,6 +70,7 @@ RPTO = b'RPTO'
DMRA = b'DMRA'
#Bridge Control commands
BC = b'BC'
BCKA = b'BCKA'
# Higheset peer ID permitted by HBP

View File

@ -112,6 +112,10 @@ class OPENBRIDGE(DatagramProtocol):
self._report = _report
self._config = self._CONFIG['SYSTEMS'][self._system]
self._laststrid = deque([], 20)
def startProtocol(self):
self._bcka = task.LoopingCall(self.send_bcka)
self._bcka = self._bcka.start(10)
def dereg(self):
logger.info('(%s) is mode OPENBRIDGE. No De-Registration required, continuing shutdown', self._system)
@ -129,7 +133,7 @@ class OPENBRIDGE(DatagramProtocol):
logger.error('(%s) OpenBridge system was asked to send non DMRD packet: %s', self._system, _packet)
def send_bcka(self):
_packet= b'KA'
_packet= BCKA
_packet = b''.join([_packet, (hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest())])
self.transport.write(_packet, (self._config['TARGET_IP'], self._config['TARGET_PORT']))
logger.debug('(%s) Sent Bridge Control Keep Alive',self._system)