mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
ssid list fix when using config file
This commit is contained in:
parent
ab44e18e3e
commit
4ddfe52db9
1 changed files with 9 additions and 1 deletions
10
tnc/main.py
10
tnc/main.py
|
@ -31,6 +31,7 @@ import modem
|
||||||
import static
|
import static
|
||||||
import structlog
|
import structlog
|
||||||
import explorer
|
import explorer
|
||||||
|
import json
|
||||||
|
|
||||||
log = structlog.get_logger("main")
|
log = structlog.get_logger("main")
|
||||||
|
|
||||||
|
@ -348,7 +349,9 @@ if __name__ == "__main__":
|
||||||
static.MYCALLSIGN = helpers.bytes_to_callsign(mycallsign)
|
static.MYCALLSIGN = helpers.bytes_to_callsign(mycallsign)
|
||||||
static.MYCALLSIGN_CRC = helpers.get_crc_24(static.MYCALLSIGN)
|
static.MYCALLSIGN_CRC = helpers.get_crc_24(static.MYCALLSIGN)
|
||||||
|
|
||||||
static.SSID_LIST = config['STATION']['ssid_list']
|
#json.loads = for converting str list to list
|
||||||
|
static.SSID_LIST = json.loads(config['STATION']['ssid_list'])
|
||||||
|
|
||||||
static.MYGRID = bytes(config['STATION']['mygrid'], "utf-8")
|
static.MYGRID = bytes(config['STATION']['mygrid'], "utf-8")
|
||||||
# check if we have an int or str as device name
|
# check if we have an int or str as device name
|
||||||
try:
|
try:
|
||||||
|
@ -389,6 +392,11 @@ if __name__ == "__main__":
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning("[CFG] Error", e=e)
|
log.warning("[CFG] Error", e=e)
|
||||||
|
|
||||||
|
# make sure the own ssid is always part of the ssid list
|
||||||
|
my_ssid = int(static.MYCALLSIGN.split(b'-')[1])
|
||||||
|
if my_ssid not in static.SSID_LIST:
|
||||||
|
static.SSID_LIST.append(my_ssid)
|
||||||
|
|
||||||
# we need to wait until we got all parameters from argparse first before we can load the other modules
|
# we need to wait until we got all parameters from argparse first before we can load the other modules
|
||||||
import sock
|
import sock
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue