From 264a4a791e955ce7c4d8ea97d4ac89dd39dabc13 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 17 Dec 2020 18:09:00 +0100 Subject: [PATCH] updated globals --- config/tmtcc_globals.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/config/tmtcc_globals.py b/config/tmtcc_globals.py index 08ae2ac..af522ab 100644 --- a/config/tmtcc_globals.py +++ b/config/tmtcc_globals.py @@ -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)