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

service 3 testing first custom definition added

parent b8052826
No related branches found
No related tags found
No related merge requests found
......@@ -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
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