mirror of
https://github.com/ShaYmez/hblink3.git
synced 2024-11-22 07:54:50 -05:00
Merge branch 'private-call-dev' of https://github.com/n0mjs710/hblink3 into private-call-dev
This commit is contained in:
commit
ece48f3a50
40
bridge.py
40
bridge.py
@ -781,25 +781,33 @@ class routerHBP(HBSYSTEM):
|
|||||||
if CONFIG['REPORTS']['REPORT']:
|
if CONFIG['REPORTS']['REPORT']:
|
||||||
self._report.send_bridgeEvent('UNIT VOICE,START,RX,{},{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), _target_route).encode(encoding='utf-8', errors='ignore'))
|
self._report.send_bridgeEvent('UNIT VOICE,START,RX,{},{},{},{},{},{},{}'.format(self._system, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id), _target_route).encode(encoding='utf-8', errors='ignore'))
|
||||||
|
|
||||||
''' LC CREATION NOT NECESSARY, SINCE WE'RE NOT TRANSCODING
|
|
||||||
# If we can, use the LC from the voice header as to keep all options intact
|
|
||||||
if _frame_type == HBPF_DATA_SYNC and _dtype_vseq == HBPF_SLT_VHEAD:
|
|
||||||
decoded = decode.voice_head_term(dmrpkt)
|
|
||||||
self.STATUS[_slot]['RX_LC'] = decoded['LC']
|
|
||||||
|
|
||||||
# If we don't have a voice header then don't wait to decode it from the Embedded LC
|
|
||||||
# just make a new one from the HBP header. This is good enough, and it saves lots of time
|
|
||||||
else:
|
|
||||||
self.STATUS[_slot]['RX_LC'] = LC_OPT + _dst_id + _rf_src
|
|
||||||
'''
|
|
||||||
|
|
||||||
for _target in self._targets:
|
for _target in self._targets:
|
||||||
_target_status = systems[_target].STATUS
|
_target_status = systems[_target].STATUS
|
||||||
_target_system = self._CONFIG['SYSTEMS'][_target]
|
_target_system = self._CONFIG['SYSTEMS'][_target]
|
||||||
|
|
||||||
if self._CONFIG['SYSTEMS'][_target]['MODE'] == 'OPENBRIDGE':
|
if self._CONFIG['SYSTEMS'][_target]['MODE'] == 'OPENBRIDGE':
|
||||||
# THIS IS ONLY UNTIL OPENBRIDGE IS SUPPORTED
|
if (_stream_id not in _target_status):
|
||||||
continue
|
# This is a new call stream on the target
|
||||||
|
_target_status[_stream_id] = {
|
||||||
|
'START': pkt_time,
|
||||||
|
'CONTENTION':False,
|
||||||
|
'RFS': _rf_src,
|
||||||
|
'TGID': _dst_id,
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info('(%s) Unit call bridged to OBP System: %s TS: %s, TGID: %s', self._system, _target, _slot, int_id(_dst_id))
|
||||||
|
if CONFIG['REPORTS']['REPORT']:
|
||||||
|
systems[_target]._report.send_bridgeEvent('UNIT VOICE,START,TX,{},{},{},{},{},{}'.format(_target, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id).encode(encoding='utf-8', errors='ignore'))
|
||||||
|
|
||||||
|
# Record the time of this packet so we can later identify a stale stream
|
||||||
|
_target_status[_stream_id]['LAST'] = pkt_time
|
||||||
|
# Clear the TS bit -- all OpenBridge streams are effectively on TS1
|
||||||
|
_tmp_bits = _bits & ~(1 << 7)
|
||||||
|
|
||||||
|
# Assemble transmit HBP packet
|
||||||
|
_tmp_data = b''.join([_data[:15], _tmp_bits.to_bytes(1, 'big'), _data[16:20]])
|
||||||
|
_tmp_data = b''.join([_tmp_data, dmrpkt])
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# BEGIN STANDARD CONTENTION HANDLING
|
# BEGIN STANDARD CONTENTION HANDLING
|
||||||
@ -837,6 +845,10 @@ class routerHBP(HBSYSTEM):
|
|||||||
_target_status[_slot]['TX_RFS'] = _rf_src
|
_target_status[_slot]['TX_RFS'] = _rf_src
|
||||||
_target_status[_slot]['TX_PEER'] = _peer_id
|
_target_status[_slot]['TX_PEER'] = _peer_id
|
||||||
|
|
||||||
|
logger.info('(%s) Unit call bridged to HBP System: %s TS: %s, UNIT: %s', self._system, _target, _slot, int_id(_dst_id))
|
||||||
|
if CONFIG['REPORTS']['REPORT']:
|
||||||
|
systems[_target]._report.send_bridgeEvent('UNIT VOICE,START,TX,{},{},{},{},{},{}'.format(_target['SYSTEM'], int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), _slot, int_id(_dst_id)).encode(encoding='utf-8', errors='ignore'))
|
||||||
|
|
||||||
# Set other values for the contention handler to test next time there is a frame to forward
|
# Set other values for the contention handler to test next time there is a frame to forward
|
||||||
_target_status[_slot]['TX_TIME'] = pkt_time
|
_target_status[_slot]['TX_TIME'] = pkt_time
|
||||||
_target_status[_slot]['TX_TYPE'] = _dtype_vseq
|
_target_status[_slot]['TX_TYPE'] = _dtype_vseq
|
||||||
|
Loading…
Reference in New Issue
Block a user