fix typo, mirror GPS branch changes
This commit is contained in:
parent
3ce8326209
commit
9c2a1f5b2b
21
bridge.py
21
bridge.py
@ -77,11 +77,13 @@ __email__ = 'n0mjs@me.com'
|
|||||||
UNIT_MAP = {}
|
UNIT_MAP = {}
|
||||||
|
|
||||||
# UNIX time for end of year 2060. This is used to keep subscribers in UNIT_MAP indefinitely to accomplish static routes for unit calls
|
# UNIX time for end of year 2060. This is used to keep subscribers in UNIT_MAP indefinitely to accomplish static routes for unit calls
|
||||||
time_2060 = 2871763199.0000000
|
#time_2060 = 2871763199.0000000
|
||||||
|
# 20 years in seconds. added to current at time of start to keep static units from being trimmed.
|
||||||
|
time_20 = 630720000
|
||||||
|
|
||||||
# Build a UNIT_MAP based on values in STATIC_MAP.
|
# Build a UNIT_MAP based on values in STATIC_MAP.
|
||||||
for i in STATIC_UNIT:
|
for i in STATIC_UNIT:
|
||||||
UNIT_MAP[bytes_3(i[0])] = i[1], time_2060
|
UNIT_MAP[bytes_3(i[0])] = i[1], time() + time_20
|
||||||
|
|
||||||
# Timed loop used for reporting HBP status
|
# Timed loop used for reporting HBP status
|
||||||
#
|
#
|
||||||
@ -163,7 +165,7 @@ def rule_timer_loop():
|
|||||||
|
|
||||||
_then = _now - 60 * UNIT_TIME
|
_then = _now - 60 * UNIT_TIME
|
||||||
remove_list = []
|
remove_list = []
|
||||||
#logger.info(UNIT_MAP)
|
logger.info(UNIT_MAP)
|
||||||
for unit in UNIT_MAP:
|
for unit in UNIT_MAP:
|
||||||
if UNIT_MAP[unit][1] < (_then):
|
if UNIT_MAP[unit][1] < (_then):
|
||||||
remove_list.append(unit)
|
remove_list.append(unit)
|
||||||
@ -438,7 +440,12 @@ class routerOBP(OPENBRIDGE):
|
|||||||
dmrpkt = _data[20:53]
|
dmrpkt = _data[20:53]
|
||||||
_bits = _data[15]
|
_bits = _data[15]
|
||||||
|
|
||||||
|
if time_20 == UNIT_MAP[_rf_src][1]:
|
||||||
|
logger.info('Static Unit, no change in UNIT_MAP')
|
||||||
|
pass
|
||||||
|
else:
|
||||||
# Make/update this unit in the UNIT_MAP cache
|
# Make/update this unit in the UNIT_MAP cache
|
||||||
|
logger.ingo('Updated subscriber system')
|
||||||
UNIT_MAP[_rf_src] = (self.name, pkt_time)
|
UNIT_MAP[_rf_src] = (self.name, pkt_time)
|
||||||
|
|
||||||
|
|
||||||
@ -587,7 +594,6 @@ class routerOBP(OPENBRIDGE):
|
|||||||
self.unit_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
|
self.unit_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
|
||||||
elif _call_type == 'vcsbk':
|
elif _call_type == 'vcsbk':
|
||||||
# Route CSBK packets to destination TG. Necessary for group data to work with GPS/Data decoder.
|
# Route CSBK packets to destination TG. Necessary for group data to work with GPS/Data decoder.
|
||||||
logger.debug('CSBK recieved, but HBlink does not process them currently')
|
|
||||||
self.group_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
|
self.group_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
|
||||||
logger.debug('CSBK recieved, but HBlink does not process them currently. Packets routed to talkgroup.')
|
logger.debug('CSBK recieved, but HBlink does not process them currently. Packets routed to talkgroup.')
|
||||||
|
|
||||||
@ -921,7 +927,13 @@ class routerHBP(HBSYSTEM):
|
|||||||
dmrpkt = _data[20:53]
|
dmrpkt = _data[20:53]
|
||||||
_bits = _data[15]
|
_bits = _data[15]
|
||||||
|
|
||||||
|
# If time matches time in static units, do not update.
|
||||||
|
if time_20 == UNIT_MAP[_rf_src][1]:
|
||||||
|
logger.info('Static Unit, no change in UNIT_MAP')
|
||||||
|
pass
|
||||||
|
else:
|
||||||
# Make/update this unit in the UNIT_MAP cache
|
# Make/update this unit in the UNIT_MAP cache
|
||||||
|
logger.ingo('Updated subscriber system')
|
||||||
UNIT_MAP[_rf_src] = (self.name, pkt_time)
|
UNIT_MAP[_rf_src] = (self.name, pkt_time)
|
||||||
|
|
||||||
|
|
||||||
@ -1066,7 +1078,6 @@ class routerHBP(HBSYSTEM):
|
|||||||
self.unit_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
|
self.unit_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
|
||||||
elif _call_type == 'vcsbk':
|
elif _call_type == 'vcsbk':
|
||||||
# Route CSBK packets to destination TG. Necessary for group data to work with GPS/Data decoder.
|
# Route CSBK packets to destination TG. Necessary for group data to work with GPS/Data decoder.
|
||||||
logger.debug('CSBK recieved, but HBlink does not process them currently')
|
|
||||||
self.group_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
|
self.group_received(_peer_id, _rf_src, _dst_id, _seq, _slot, _frame_type, _dtype_vseq, _stream_id, _data)
|
||||||
logger.debug('CSBK recieved, but HBlink does not process them currently. Packets routed to talkgroup.')
|
logger.debug('CSBK recieved, but HBlink does not process them currently. Packets routed to talkgroup.')
|
||||||
else:
|
else:
|
||||||
|
@ -63,7 +63,7 @@ Input the DMR ID and SYSTEM of a subscriber that you would like to have always h
|
|||||||
'''
|
'''
|
||||||
STATIC_UNIT = [
|
STATIC_UNIT = [
|
||||||
[ 123, 'CLIENT-1'],
|
[ 123, 'CLIENT-1'],
|
||||||
[ 456 'CLIENT-1'],
|
[ 456, 'CLIENT-1'],
|
||||||
[ 789, 'MASTER-1']
|
[ 789, 'MASTER-1']
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user