diff --git a/tc/OBSW_TcService3.py b/tc/OBSW_TcService3.py index d55d7f913a42f38dda524afb6c9ddb507dd7cb4e..1e96a21f5239dc05e100f1d28f206afba21307b8 100644 --- a/tc/OBSW_TcService3.py +++ b/tc/OBSW_TcService3.py @@ -6,12 +6,28 @@ Description: PUS Custom Service 8: Device Access, Native low-level commanding @author: R. Mueller """ +import struct +from tc.OBSW_TcPacket import PUSTelecommand def packService3TestInto(tcQueue): tcQueue.put(("print", "Testing Service 3")) # adding custom defintion to hk using test pool variables + tcQueue.put(("print", "\r\nTesting Service 3: Adding custom definition")) + sid = bytearray([0x00, 0x00, 0x42, 0x00]) + collectionInterval = struct.pack('>f', 3) + numberOfParameters = struct.pack('B', 5) + p1 = bytearray([0x01, 0x01, 0x01, 0x01]) + p2 = bytearray([0x02, 0x02, 0x02, 0x02]) + p3 = bytearray([0x03, 0x03, 0x03, 0x03]) + p4 = bytearray([0x04, 0x04, 0x04, 0x04]) + p5 = bytearray([0x05, 0x05, 0x05, 0x05]) + hkDefinition = sid + collectionInterval + numberOfParameters + p1 + p2 + p3 + p4 + p5 + command = PUSTelecommand(service=3, subservice=1, SSC=3010, data=hkDefinition) + tcQueue.put(command.packCommandTuple()) # adding custom definition to diagnostics using test pool variables + command = PUSTelecommand(service=3, subservice=2, SSC=3010, data=hkDefinition) + tcQueue.put(command.packCommandTuple()) # enable custom hk definition # enable custom diag definition # disable custom hk definition @@ -32,3 +48,5 @@ def packService3TestInto(tcQueue): # delete custom diag definition # do some basic testing on predefined structs too # e.g. add one variable, change interval, report them.... + tcQueue.put(("export", "log/tmtc_log_service3.txt")) + return tcQueue