convert seq from bytes to int so we can actually use it

This commit is contained in:
Cort Buffington 2019-09-11 09:24:54 -05:00
parent d3a5ee2221
commit 99d0b49559

View File

@ -113,6 +113,7 @@ class bridgeallSYSTEM(HBSYSTEM):
pkt_time = time()
dmrpkt = _data[20:53]
_bits = _data[15]
seq = int.from_bytes(_seq, byteorder='big')
if _call_type == 'group':
@ -122,14 +123,14 @@ class bridgeallSYSTEM(HBSYSTEM):
if new_stream:
self.STATUS[_slot]['RX_START'] = pkt_time
self.STATUS[_slot]['RX_LOSS'] = 0
self.STATUS[_slot]['RX_SEQ'] = _seq
self.STATUS[_slot]['RX_SEQ'] = seq
logger.info('(%s) *CALL START* STREAM ID: %s SUB: %s (%s) PEER: %s (%s) TGID %s (%s), TS %s', \
self._system, int_id(_stream_id), get_alias(_rf_src, subscriber_ids), int_id(_rf_src), get_alias(_peer_id, peer_ids), int_id(_peer_id), get_alias(_dst_id, talkgroup_ids), int_id(_dst_id), _slot)
else:
# This could be much better, it will have errors during roll-over
if _seq > (self.STATUS[_slot]['RX_SEQ'] + 1):
print(_seq, self.STATUS[_slot]['RX_SEQ'])
self.STATUS[_slot]['RX_LOSS'] += _seq - (self.STATUS[_slot]['RX_SEQ'] + 1)
if seq > (self.STATUS[_slot]['RX_SEQ'] + 1):
print(seq, self.STATUS[_slot]['RX_SEQ'])
self.STATUS[_slot]['RX_LOSS'] += seq - (self.STATUS[_slot]['RX_SEQ'] + 1)
# Final actions - Is this a voice terminator?
if (_frame_type == const.HBPF_DATA_SYNC) and (_dtype_vseq == const.HBPF_SLT_VTERM) and (self.STATUS[_slot]['RX_TYPE'] != const.HBPF_SLT_VTERM):
@ -222,7 +223,7 @@ class bridgeallSYSTEM(HBSYSTEM):
# Mark status variables for use later
self.STATUS[_slot]['RX_RFS'] = _rf_src
self.STATUS[_slot]['RX_SEQ'] = _seq
self.STATUS[_slot]['RX_SEQ'] = seq
self.STATUS[_slot]['RX_TYPE'] = _dtype_vseq
self.STATUS[_slot]['RX_TGID'] = _dst_id
self.STATUS[_slot]['RX_TIME'] = pkt_time