Fix bcka
This commit is contained in:
parent
f7759dcce9
commit
b096d5dfa5
1
const.py
1
const.py
|
@ -70,6 +70,7 @@ RPTO = b'RPTO'
|
||||||
DMRA = b'DMRA'
|
DMRA = b'DMRA'
|
||||||
|
|
||||||
#Bridge Control commands
|
#Bridge Control commands
|
||||||
|
BC = b'BC'
|
||||||
BCKA = b'BCKA'
|
BCKA = b'BCKA'
|
||||||
|
|
||||||
# Higheset peer ID permitted by HBP
|
# Higheset peer ID permitted by HBP
|
||||||
|
|
|
@ -112,6 +112,10 @@ class OPENBRIDGE(DatagramProtocol):
|
||||||
self._report = _report
|
self._report = _report
|
||||||
self._config = self._CONFIG['SYSTEMS'][self._system]
|
self._config = self._CONFIG['SYSTEMS'][self._system]
|
||||||
self._laststrid = deque([], 20)
|
self._laststrid = deque([], 20)
|
||||||
|
|
||||||
|
def startProtocol(self):
|
||||||
|
self._bcka = task.LoopingCall(self.send_bcka)
|
||||||
|
self._bcka = self._bcka.start(10)
|
||||||
|
|
||||||
def dereg(self):
|
def dereg(self):
|
||||||
logger.info('(%s) is mode OPENBRIDGE. No De-Registration required, continuing shutdown', self._system)
|
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)
|
logger.error('(%s) OpenBridge system was asked to send non DMRD packet: %s', self._system, _packet)
|
||||||
|
|
||||||
def send_bcka(self):
|
def send_bcka(self):
|
||||||
_packet= b'KA'
|
_packet= BCKA
|
||||||
_packet = b''.join([_packet, (hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest())])
|
_packet = b''.join([_packet, (hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest())])
|
||||||
self.transport.write(_packet, (self._config['TARGET_IP'], self._config['TARGET_PORT']))
|
self.transport.write(_packet, (self._config['TARGET_IP'], self._config['TARGET_PORT']))
|
||||||
logger.debug('(%s) Sent Bridge Control Keep Alive',self._system)
|
logger.debug('(%s) Sent Bridge Control Keep Alive',self._system)
|
||||||
|
|
Loading…
Reference in New Issue