updated globals

This commit is contained in:
Robin Müller 2020-12-17 18:09:00 +01:00
parent 673a3e8ba4
commit 264a4a791e
1 changed files with 6 additions and 11 deletions

View File

@ -55,7 +55,7 @@ def add_globals_pre_args_parsing(gui: bool = False):
from tmtc_core.core.tmtcc_globals_manager import update_global
import pprint
update_global(GlobalIds.APID, 0xef)
update_global(GlobalIds.APID, 0x65)
update_global(GlobalIds.COM_IF, ComInterfaces.EthernetUDP)
update_global(GlobalIds.TC_SEND_TIMEOUT_FACTOR, 2)
update_global(GlobalIds.TM_TIMEOUT, 4)
@ -206,17 +206,12 @@ def set_up_ethernet_cfg():
update_global(GlobalIds.USE_ETHERNET, True)
from tmtc_core.core.tmtcc_globals_manager import get_global
from config.tmtcc_definitions import EthernetConfig
from tmtc_core.com_if.tmtcc_ethernet_utilities import determine_ip_addresses
ethernet_cfg_dict = get_global(GlobalIds.ETHERNET_CONFIG)
# Local host and unused port as default config
default_send_ip = "127.0.0.1"
default_send_port = 7301
send_address = (default_send_ip, default_send_port)
ethernet_cfg_dict.update({EthernetConfig.SEND_ADDRESS: send_address})
# Bind to all interfaces (might be insecure!)
default_rcv_ip = ''
default_rcv_port = 7302
recv_address = (default_rcv_ip, default_rcv_port)
ethernet_cfg_dict.update({EthernetConfig.RECV_ADDRESS: recv_address})
# This will either load the addresses from a JSON file or prompt them from the user.
send_addr, rcv_addr = determine_ip_addresses()
ethernet_cfg_dict.update({EthernetConfig.SEND_ADDRESS: send_addr})
ethernet_cfg_dict.update({EthernetConfig.RECV_ADDRESS: rcv_addr})
update_global(GlobalIds.ETHERNET_CONFIG, ethernet_cfg_dict)