From faf01c5ab04df97b168aad84aa128f28cf6379af Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" <robin.mueller.m@gmail.com> Date: Mon, 30 Dec 2019 20:55:36 +0100 Subject: [PATCH] service 3 testing first custom definition added --- tc/OBSW_TcService3.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tc/OBSW_TcService3.py b/tc/OBSW_TcService3.py index d55d7f9..1e96a21 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 -- GitLab