|
|
|
@ -308,8 +308,8 @@ class OPENBRIDGE(DatagramProtocol):
|
|
|
|
_seq = _data[4]
|
|
|
|
_seq = _data[4]
|
|
|
|
_rf_src = _data[5:8]
|
|
|
|
_rf_src = _data[5:8]
|
|
|
|
_dst_id = _data[8:11]
|
|
|
|
_dst_id = _data[8:11]
|
|
|
|
_timestamp = _data[15:23]
|
|
|
|
_timestamp = _data[12:20]
|
|
|
|
_bits = _data[23]
|
|
|
|
_bits = _data[21]
|
|
|
|
_slot = 2 if (_bits & 0x80) else 1
|
|
|
|
_slot = 2 if (_bits & 0x80) else 1
|
|
|
|
#_call_type = 'unit' if (_bits & 0x40) else 'group'
|
|
|
|
#_call_type = 'unit' if (_bits & 0x40) else 'group'
|
|
|
|
if _bits & 0x40:
|
|
|
|
if _bits & 0x40:
|
|
|
|
@ -320,7 +320,7 @@ class OPENBRIDGE(DatagramProtocol):
|
|
|
|
_call_type = 'group'
|
|
|
|
_call_type = 'group'
|
|
|
|
_frame_type = (_bits & 0x30) >> 4
|
|
|
|
_frame_type = (_bits & 0x30) >> 4
|
|
|
|
_dtype_vseq = (_bits & 0xF) # data, 1=voice header, 2=voice terminator; voice, 0=burst A ... 5=burst F
|
|
|
|
_dtype_vseq = (_bits & 0xF) # data, 1=voice header, 2=voice terminator; voice, 0=burst A ... 5=burst F
|
|
|
|
_stream_id = _data[25:29]
|
|
|
|
_stream_id = _data[24:28]
|
|
|
|
#logger.debug('(%s) DMRD - Seqence: %s, RF Source: %s, Destination ID: %s', self._system, int_id(_seq), int_id(_rf_src), int_id(_dst_id))
|
|
|
|
#logger.debug('(%s) DMRD - Seqence: %s, RF Source: %s, Destination ID: %s', self._system, int_id(_seq), int_id(_rf_src), int_id(_dst_id))
|
|
|
|
# Sanity check for OpenBridge -- all calls must be on Slot 1
|
|
|
|
# Sanity check for OpenBridge -- all calls must be on Slot 1
|
|
|
|
if _slot != 1:
|
|
|
|
if _slot != 1:
|
|
|
|
@ -375,7 +375,7 @@ class OPENBRIDGE(DatagramProtocol):
|
|
|
|
|
|
|
|
|
|
|
|
#Remove timestamp from data. For now dmrd_received does not expect it
|
|
|
|
#Remove timestamp from data. For now dmrd_received does not expect it
|
|
|
|
#Leaving it in screws up the AMBE data
|
|
|
|
#Leaving it in screws up the AMBE data
|
|
|
|
_data = b''.join([_data[:15],_data[24:]])
|
|
|
|
_data = b''.join([_data[:15],_data[21:]])
|
|
|
|
# Userland actions -- typically this is the function you subclass for an application
|
|
|
|
# Userland actions -- typically this is the function you subclass for an application
|
|
|
|
self.dmrd_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash)
|
|
|
|
self.dmrd_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash)
|
|
|
|
#Silently treat a DMRD packet like a keepalive - this is because it's traffic and the
|
|
|
|
#Silently treat a DMRD packet like a keepalive - this is because it's traffic and the
|
|
|
|
|