Skip to content
Snippets Groups Projects
Commit e849f5e5 authored by Robin Mueller's avatar Robin Mueller
Browse files

single command bugfix

parent adee1471
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ Mission/Device specific information. ...@@ -40,6 +40,7 @@ Mission/Device specific information.
# Object IDs # Object IDs
GPS0_ObjectId = bytearray([0x44, 0x10, 0x1F, 0x00]) GPS0_ObjectId = bytearray([0x44, 0x10, 0x1F, 0x00])
GPS1_ObjectId = bytearray([0x44, 0x20, 0x20, 0x00]) GPS1_ObjectId = bytearray([0x44, 0x20, 0x20, 0x00])
DUMMY_DEVICE_ID = bytearray([0x44, 0x00, 0xAF, 0xFE])
# SIDs # SIDs
GPS0_SID = bytearray([0x00, 0x00, 0x1f, 0x00]) GPS0_SID = bytearray([0x00, 0x00, 0x1f, 0x00])
......
...@@ -59,6 +59,7 @@ import logging ...@@ -59,6 +59,7 @@ import logging
import sys import sys
from collections import deque from collections import deque
from OBSW_TcService200 import packModeData
from test import OBSW_PusServiceTest from test import OBSW_PusServiceTest
from config import OBSW_Config as g from config import OBSW_Config as g
from config.OBSW_Config import setGlobals from config.OBSW_Config import setGlobals
...@@ -111,7 +112,7 @@ def main(): ...@@ -111,7 +112,7 @@ def main():
sender_and_receiver = SingleCommandSenderReceiver( sender_and_receiver = SingleCommandSenderReceiver(
comInterface=communication_interface, tmtcPrinter=tmtc_printer, tmListener=tm_listener, comInterface=communication_interface, tmtcPrinter=tmtc_printer, tmListener=tm_listener,
pusPacketTuple=pus_packet_tuple, tmTimeout=g.tmTimeout, 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() sender_and_receiver.send_single_tc_and_receive_tm()
elif g.modeId == g.ModeList.ServiceTestMode: elif g.modeId == g.ModeList.ServiceTestMode:
...@@ -156,10 +157,11 @@ def command_preparation(): ...@@ -156,10 +157,11 @@ def command_preparation():
# Direct command which triggers an additional step reply and one completion reply # Direct command which triggers an additional step reply and one completion reply
# Single Command Testing # Single Command Testing
command = PUSTelecommand(service=17, subservice=1, SSC=21) command = PUSTelecommand(service=17, subservice=1, SSC=21)
# command.print() # Object ID: Dummy Device
# file = bytearray([1, 2, 3, 4, 5]) objectId = g.DUMMY_DEVICE_ID
# command = PUSTelecommand(service=23, subservice=1, SSC=21, data=file) # Set On Mode
# command.packCommandTuple() modeData = packModeData(objectId, 1, 0)
command = PUSTelecommand(service=200, subservice=1, SSC=2000, data=modeData)
return command.packCommandTuple() return command.packCommandTuple()
......
...@@ -22,8 +22,7 @@ class SingleCommandSenderReceiver(CommandSenderReceiver): ...@@ -22,8 +22,7 @@ class SingleCommandSenderReceiver(CommandSenderReceiver):
This object can be used by instantiating it and calling sendSingleTcAndReceiveTm() This object can be used by instantiating it and calling sendSingleTcAndReceiveTm()
""" """
def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tmListener: TmListenerT, def __init__(self, comInterface: ComIF_T, tmtcPrinter: TmTcPrinterT, tmListener: TmListenerT,
pusPacketTuple: tuple, tmTimeout: float, tcTimeoutFactor: float, pusPacketTuple: tuple, tmTimeout: float, tcTimeoutFactor: float):
doPrintToFile: bool):
""" """
:param comInterface: CommunicationInterface object, passed on to CommandSenderReceiver :param comInterface: CommunicationInterface object, passed on to CommandSenderReceiver
:param tmListener: TmListener object which runs in the background and receives all TM :param tmListener: TmListener object which runs in the background and receives all TM
...@@ -35,8 +34,8 @@ class SingleCommandSenderReceiver(CommandSenderReceiver): ...@@ -35,8 +34,8 @@ class SingleCommandSenderReceiver(CommandSenderReceiver):
:param doPrintToFile: Specify whether output is also printed to a file :param doPrintToFile: Specify whether output is also printed to a file
""" """
super().__init__(comInterface=comInterface, tmListener=tmListener, tmtcPrinter=tmtcPrinter, super().__init__(comInterface=comInterface, tmListener=tmListener, tmtcPrinter=tmtcPrinter,
tmTimeout=tmTimeout, tcSendTimeoutFactor=tcTimeoutFactor, tmTimeout=tmTimeout, tcSendTimeoutFactor=tcTimeoutFactor)
doPrintToFile=doPrintToFile) self.faulty_input = False
try: try:
self.pus_packet, self.pus_packet_info = pusPacketTuple self.pus_packet, self.pus_packet_info = pusPacketTuple
except TypeError: except TypeError:
......
...@@ -13,13 +13,14 @@ Run script with -s <Service or Device> -m 3 with optional -p parameter for file ...@@ -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_TcPacket import PUSTelecommand
from tc.OBSW_TcPacker import tcQueueT from tc.OBSW_TcPacker import tcQueueT
import config.OBSW_Config as g
import struct import struct
def packService200TestInto(tcQueue: tcQueueT) -> tcQueueT: def packService200TestInto(tcQueue: tcQueueT) -> tcQueueT:
tcQueue.appendleft(("print", "Testing Service 200")) tcQueue.appendleft(("print", "Testing Service 200"))
# Object ID: Dummy Device # Object ID: Dummy Device
objectId = bytearray([0x44, 0x00, 0xAF, 0xFE]) objectId = g.DUMMY_DEVICE_ID
# Set On Mode # Set On Mode
tcQueue.appendleft(("print", "\r\nTesting Service 200: Set Mode On")) tcQueue.appendleft(("print", "\r\nTesting Service 200: Set Mode On"))
modeData = packModeData(objectId, 1, 0) modeData = packModeData(objectId, 1, 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment