diff --git a/.idea/runConfigurations/OBSW_UdpClient_Single_Command.xml b/.idea/runConfigurations/OBSW_UdpClient_Single_Command.xml index 9a5d03efc63e324b4c47daf795354d2dd5ad41bd..eefb361c0bb927928f87948bcf859170678923a7 100644 --- a/.idea/runConfigurations/OBSW_UdpClient_Single_Command.xml +++ b/.idea/runConfigurations/OBSW_UdpClient_Single_Command.xml @@ -12,8 +12,8 @@ <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> - <option name="SCRIPT_NAME" value="C:\Users\Robin\NoSyncDokumente\sourceobsw\tmtc\obsw_tmtc_client.py" /> - <option name="PARAMETERS" value="-m 2 -p" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/obsw_tmtc_client.py" /> + <option name="PARAMETERS" value="-m 2 --boardIP=169.254.86.53" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> <option name="MODULE_MODE" value="false" /> diff --git a/comIF/obsw_ethernet_com_if.py b/comIF/obsw_ethernet_com_if.py index 21b833cd641dfc6beb231f4119545aab48c4327a..a9516abf680cd48df24056f485e8bb127fa8b59b 100644 --- a/comIF/obsw_ethernet_com_if.py +++ b/comIF/obsw_ethernet_com_if.py @@ -45,9 +45,9 @@ class EthernetComIF(CommunicationInterface): def data_available(self, timeout: float = 0) -> bool: ready = select.select([self.sock_receive], [], [], timeout) - if ready is None: - return False - return ready + if ready[0]: + return True + return False def poll_interface(self, pollTimeout: float = 0) -> Tuple[bool, PusTmListT]: ready = self.data_available(pollTimeout) @@ -97,7 +97,7 @@ class EthernetComIF(CommunicationInterface): """ try: self.sock_receive.bind(self.receive_address) - self.sock_receive.setblocking(False) + self.sock_receive.setblocking(0) except OSError: print("Socket already set-up.") # print("Socket Receive Address: " + str(g.G_REC_ADDRESS)) diff --git a/sendreceive/obsw_single_command_sender_receiver.py b/sendreceive/obsw_single_command_sender_receiver.py index 4bb1674db51f535892f0215c84f19948767e94e6..8fd8b3d9b969f664aecc5e5a2ab54bc8e9d2fbb2 100644 --- a/sendreceive/obsw_single_command_sender_receiver.py +++ b/sendreceive/obsw_single_command_sender_receiver.py @@ -28,7 +28,8 @@ class SingleCommandSenderReceiver(CommandSenderReceiver): :param tm_listener: TmListener object which runs in the background and receives all TM :param tmtc_printer: TmTcPrinter object, passed on to CommandSenderReceiver """ - super().__init__(com_interface=com_interface, tm_listener=tm_listener, tmtc_printer=tmtc_printer) + super().__init__(com_interface=com_interface, tm_listener=tm_listener, + tmtc_printer=tmtc_printer) self.faulty_input = False try: self.pus_packet, self.pus_packet_info = pusPacketTuple diff --git a/sendreceive/obsw_tm_listener.py b/sendreceive/obsw_tm_listener.py index 391dab0c990620bfc4595884ace60b273669f4dd..8954462651acdcedc5de2544cde4d442ea5d0312 100644 --- a/sendreceive/obsw_tm_listener.py +++ b/sendreceive/obsw_tm_listener.py @@ -14,7 +14,7 @@ import threading from collections import deque from typing import TypeVar -from comIF.obsw_com_interface import ComIfT +from comIF.obsw_com_interface import CommunicationInterface import config.obsw_config as g TmListenerT = TypeVar('TmListenerT', bound='TmListener') @@ -27,7 +27,8 @@ class TmListener: and changing the mode to do special mode operations. The mode operation ends as soon the modeOpFinished Event is set() ! """ - def __init__(self, comInterface: ComIfT, tmTimeout: float, tcTimeoutFactor: float): + def __init__(self, comInterface: CommunicationInterface, tmTimeout: float, + tcTimeoutFactor: float): self.tmTimeout = tmTimeout self.tcTimeoutFactor = tcTimeoutFactor self.comInterface = comInterface diff --git a/utility/obsw_tmtc_printer.py b/utility/obsw_tmtc_printer.py index 477a9dc21af7de9b639824c0a4fe0a3fc1d0bedc..ec06146610163d22e3f13f444375c3cee18b50f2 100644 --- a/utility/obsw_tmtc_printer.py +++ b/utility/obsw_tmtc_printer.py @@ -264,10 +264,10 @@ class TmTcPrinter: """ if self.print_tc: if len(tc_packet) == 0: - print("TMTC Printer: Empty wiretapping_packet was sent, configuration error") + print("TMTC Printer: Empty packet was sent, configuration error") sys.exit() if tc_packet_info is None: - print("TMTC Printer: No wiretapping_packet info supplied to print") + print("TMTC Printer: No packet info supplied to print") return if self.display_mode == "short": self.__handle_short_tc_print(tc_packet_info)