change UNIT to EXCLUDE_FROM_UNIT

This commit is contained in:
KF7EEL 2021-04-28 15:07:26 -07:00
parent dd2879a1a9
commit 7f4844299d
2 changed files with 24 additions and 21 deletions

View File

@ -943,6 +943,23 @@ try:
except:
UNIT_MAP = {}
def build_unit(CONFIG):
# Edit these 2
#config_file = '/tmp/hblink-SAMPLE.cfg'
#EXCLUDE_FROM_UNIT = ['OBP-1', 'PEER-1']
######################################
#import config
#CONFIG = config.build_config(config_file)
#exclude = rules_module.EXCLUDE_FROM_UNIT
UNIT = []
for i in CONFIG['SYSTEMS'].items():
if i[1]['ENABLED'] == True and i[1]['MODE'] != 'XLXPEER' and i[0] not in exclude:
UNIT.append(i[0])
return UNIT
#UNIT = build_unit()
# Timed loop used for reporting HBP status
#
# REPORT BASED ON THE TYPE SELECTED IN THE MAIN CONFIG FILE
@ -2630,9 +2647,11 @@ if __name__ == '__main__':
# Build the routing rules file
BRIDGES = make_bridges(rules_module.BRIDGES)
exclude = rules_module.EXCLUDE_FROM_UNIT
# Get rule parameter for private calls
UNIT = rules_module.UNIT
#UNIT = rules_module.UNIT
UNIT = build_unit(CONFIG)
# INITIALIZE THE REPORTING LOOP
if CONFIG['REPORTS']['REPORT']:
@ -2676,5 +2695,5 @@ if __name__ == '__main__':
aprs_thread = threading.Thread(target=aprs_rx, args=(aprs_callsign, aprs_passcode, aprs_server, aprs_port, aprs_filter, user_ssid,))
aprs_thread.daemon = True
aprs_thread.start()
print(UNIT)
reactor.run()

View File

@ -44,27 +44,11 @@ BRIDGES = {
}
'''
list the names of each system that should bridge unit to unit (individual) calls.
list the names of each system that should NOT be bridged unit to unit (individual) calls.
'''
UNIT = ['MASTER-1', 'PEER-1']
# Leave commented out, unless you want all SYSTEMS to receive UNIT calls
##def build_unit():
##
## # Edit these 2
## config_file = '/tmp/hblink-SAMPLE.cfg'
## EXCLUDE_FROM_UNIT = ['OBP-1', 'PEER-1']
## ######################################
## import config
## CONFIG = config.build_config(config_file)
## UNIT = []
## for i in CONFIG['SYSTEMS'].items():
## if i[1]['ENABLED'] == True and i[1]['MODE'] != 'XLXPEER':
## UNIT.append(i[0])
## return UNIT
##
##UNIT = build_unit()
#UNIT = ['MASTER-1', 'PEER-1']
EXCLUDE_FROM_UNIT = ['OBP-1', 'PEER-1']
'''
Unit Call flood timeout: