diff --git a/config/OBSW_Config.py b/config/OBSW_Config.py index 622fba063852befa4fa75448bf46b58c1b7e8b91..a45651b1901a28cbeadb4209219029232a964257 100644 --- a/config/OBSW_Config.py +++ b/config/OBSW_Config.py @@ -40,6 +40,7 @@ Mission/Device specific information. # Object IDs GPS0_ObjectId = bytearray([0x44, 0x10, 0x1F, 0x00]) GPS1_ObjectId = bytearray([0x44, 0x20, 0x20, 0x00]) +DUMMY_DEVICE_ID = bytearray([0x44, 0x00, 0xAF, 0xFE]) # SIDs GPS0_SID = bytearray([0x00, 0x00, 0x1f, 0x00]) diff --git a/obsw_tmtc_client.py b/obsw_tmtc_client.py index b87a27fa7bae48c8e780924c3ffa4abed8a8fff4..b1ef278422b29bb4878d116b1e3ea5e9b2ae8297 100644 --- a/obsw_tmtc_client.py +++ b/obsw_tmtc_client.py @@ -59,6 +59,7 @@ import logging import sys from collections import deque +from OBSW_TcService200 import packModeData from test import OBSW_PusServiceTest from config import OBSW_Config as g from config.OBSW_Config import setGlobals @@ -111,7 +112,7 @@ def main(): sender_and_receiver = SingleCommandSenderReceiver( comInterface=communication_interface, tmtcPrinter=tmtc_printer, tmListener=tm_listener, pusPacketTuple=pus_packet_tuple, tmTimeout=g.tmTimeout, - tcTimeoutFactor=g.tcSendTimeoutFactor, doPrintToFile=g.G_PRINT_TO_FILE) + tcTimeoutFactor=g.tcSendTimeoutFactor) sender_and_receiver.send_single_tc_and_receive_tm() elif g.modeId == g.ModeList.ServiceTestMode: @@ -156,10 +157,11 @@ def command_preparation(): # Direct command which triggers an additional step reply and one completion reply # Single Command Testing command = PUSTelecommand(service=17, subservice=1, SSC=21) - # command.print() - # file = bytearray([1, 2, 3, 4, 5]) - # command = PUSTelecommand(service=23, subservice=1, SSC=21, data=file) - # command.packCommandTuple() + # Object ID: Dummy Device + objectId = g.DUMMY_DEVICE_ID + # Set On Mode + modeData = packModeData(objectId, 1, 0) + command = PUSTelecommand(service=200, subservice=1, SSC=2000, data=modeData) return command.packCommandTuple() diff --git a/sendreceive/obsw_single_command_sender_receiver.py b/sendreceive/obsw_single_command_sender_receiver.py index 27be3c18ce50c958fa70e856d60ddff168043a11..8ea94f14008e43598b610c072c5f35ef0d49b7ff 100644 --- a/sendreceive/obsw_single_command_sender_receiver.py +++ b/sendreceive/obsw_single_command_sender_receiver.py @@ -22,8 +22,7 @@ class SingleCommandSenderReceiver(CommandSenderReceiver): This object can be used by instantiating it and calling sendSingleTcAndReceiveTm() """ def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tmListener: TmListenerT, - pusPacketTuple: tuple, tmTimeout: float, tcTimeoutFactor: float, - doPrintToFile: bool): + pusPacketTuple: tuple, tmTimeout: float, tcTimeoutFactor: float): """ :param comInterface: CommunicationInterface object, passed on to CommandSenderReceiver :param tmListener: TmListener object which runs in the background and receives all TM @@ -35,8 +34,8 @@ class SingleCommandSenderReceiver(CommandSenderReceiver): :param doPrintToFile: Specify whether output is also printed to a file """ super().__init__(comInterface=comInterface, tmListener=tmListener, tmtcPrinter=tmtcPrinter, - tmTimeout=tmTimeout, tcSendTimeoutFactor=tcTimeoutFactor, - doPrintToFile=doPrintToFile) + tmTimeout=tmTimeout, tcSendTimeoutFactor=tcTimeoutFactor) + self.faulty_input = False try: self.pus_packet, self.pus_packet_info = pusPacketTuple except TypeError: diff --git a/tc/OBSW_TcService200.py b/tc/OBSW_TcService200.py index 3abc8e9634485e1df489c6ef34616409594b6194..9ebb0dad3f64b279d27b76eda21f9b005bb4539a 100644 --- a/tc/OBSW_TcService200.py +++ b/tc/OBSW_TcService200.py @@ -13,13 +13,14 @@ Run script with -s <Service or Device> -m 3 with optional -p parameter for file """ from tc.OBSW_TcPacket import PUSTelecommand from tc.OBSW_TcPacker import tcQueueT +import config.OBSW_Config as g import struct def packService200TestInto(tcQueue: tcQueueT) -> tcQueueT: tcQueue.appendleft(("print", "Testing Service 200")) # Object ID: Dummy Device - objectId = bytearray([0x44, 0x00, 0xAF, 0xFE]) + objectId = g.DUMMY_DEVICE_ID # Set On Mode tcQueue.appendleft(("print", "\r\nTesting Service 200: Set Mode On")) modeData = packModeData(objectId, 1, 0)