From dccbe86fd3596fe6c28b9917aa00ed3819b3f685 Mon Sep 17 00:00:00 2001 From: Michael Zingman Date: Sun, 10 Dec 2017 18:09:56 -0500 Subject: [PATCH] Add mask because sequence numbers are 8 bits long --- dmr_utils/ambe_bridge.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 dmr_utils/ambe_bridge.py diff --git a/dmr_utils/ambe_bridge.py b/dmr_utils/ambe_bridge.py old mode 100644 new mode 100755 index bc141f6..61867ea --- a/dmr_utils/ambe_bridge.py +++ b/dmr_utils/ambe_bridge.py @@ -355,7 +355,7 @@ class AMBE_BASE: # Export voice frame to partner (actually done in sub classes for 49 or 72 bits) def export_voice(self, _tx_slot, _seq, _ambe): - if _seq != (_tx_slot.lastSeq+1): + if _seq != ((_tx_slot.lastSeq+1) & 0xff): _tx_slot.lostFrame += 1 _tx_slot.lastSeq = _seq @@ -515,7 +515,8 @@ class AMBE_HB(AMBE_BASE): return self.__encode_voice_header( _rx_slot, DMR_DATA_SYNC_MS, 2 ) # data_type=Voice_LC_Terminator def export_voice(self, _tx_slot, _seq, _ambe): self.send_tlv(TAG_AMBE_72, struct.pack("b",_tx_slot.slot) + _ambe) # send AMBE - if _seq != (_tx_slot.lastSeq+1): + if _seq != ((_tx_slot.lastSeq+1) & 0xff): + self._logger.info('(%s) Seq number not found. got %d expected %d', self._system, _seq, _tx_slot.lastSeq+1) _tx_slot.lostFrame += 1 _tx_slot.lastSeq = _seq @@ -654,7 +655,7 @@ class AMBE_IPSC(AMBE_BASE): self._logger.debug('IPSC templates loaded') def export_voice(self, _tx_slot, _seq, _ambe): self.send_tlv(TAG_AMBE_49, struct.pack("b",_tx_slot.slot) + _ambe) # send AMBE - if _seq != (_tx_slot.lastSeq+1): + if _seq != ((_tx_slot.lastSeq+1) & 0xff): _tx_slot.lostFrame += 1 _tx_slot.lastSeq = _seq