From 3729a5ef256172558876e021175fcce66b4c5846 Mon Sep 17 00:00:00 2001 From: Robin Mueller <robin.mueller.m@gmail.com> Date: Wed, 11 Mar 2020 18:30:36 +0100 Subject: [PATCH] slight adaptions --- OBSW_TmTcClient.py | 10 ++++++---- config/OBSW_Config.py | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/OBSW_TmTcClient.py b/OBSW_TmTcClient.py index 7313cf0..a930fc4 100644 --- a/OBSW_TmTcClient.py +++ b/OBSW_TmTcClient.py @@ -154,21 +154,23 @@ def setCommunicationInterface(tmtcPrinter: TmTcPrinterT) -> ComIF_T: :param tmtcPrinter: TmTcPrinter object. :return: CommunicationInterface object """ + communicationInterface = None try: - if g.comIF == 0 and g.modeId != "OBSWUnitTest": + if g.comIF == 0 and g.modeId != g.modeList.UnitTest: communicationInterface = EthernetComIF(tmtcPrinter, g.tmTimeout, g.tcSendTimeoutFactor, g.sockSend, g.sockReceive, g.sendAddress) - elif g.modeId != "OBSWUnitTest": + elif g.modeId != g.modeList.UnitTest: comPort = g.comPort baudRate = 115200 g.serialTimeout = 0.05 communicationInterface = SerialComIF(tmtcPrinter, comPort, baudRate, g.serialTimeout) else: - communicationInterface = 0 + print("Could not set up communication interface !") + exit() return communicationInterface except (IOError, OSError): print("Error setting up communication interface") - logging.exception("Error: ") + logging.exception("Error") exit() diff --git a/config/OBSW_Config.py b/config/OBSW_Config.py index a6f3246..06f4c01 100644 --- a/config/OBSW_Config.py +++ b/config/OBSW_Config.py @@ -112,3 +112,4 @@ def setGlobals(args): def setGlobalsUnitTest(): global sockReceive sockReceive = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + -- GitLab