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

printData for tm receive adapted

parent 0e527c8a
No related branches found
No related tags found
No related merge requests found
......@@ -120,10 +120,11 @@ def main():
# Prepare command for single command testing
def commandPreparation():
# Direct command which triggers an additional step reply and one completion reply
objectId = bytearray([0x44, 0x00, 0xAF, 0xFE])
actionId = bytearray([0xBA, 0xDE, 0xAF, 0xFE])
directCommand = objectId + actionId
command = PUSTelecommand(service=8, subservice=128, SSC=840, data=directCommand)
# Single Command Testing
# command = PUSTelecommand(service=17, subservice=1, SSC=21)
file = bytearray([1, 2, 3, 4, 5])
command = PUSTelecommand(service=23, subservice=1, SSC=21, data=file)
command.packCommandTuple()
return command.packCommandTuple()
......
......@@ -135,11 +135,14 @@ class OBSWPusPacket:
return self.PUSHeader.sourceSequenceCount
def printData(self):
print(self.returnDataString())
def returnDataString(self):
strToPrint = "["
for byte in self.data:
strToPrint += str(hex(byte)) + " , "
strToPrint = strToPrint.rstrip(' , ')
strToPrint += ']'
strToPrint = strToPrint.rstrip(' , ')
strToPrint += ']'
return strToPrint
# Structure of a PUS Packet :
......
......@@ -30,6 +30,7 @@ class Service1TM(PUSTelemetry):
self.errorParam1 = struct.unpack('>I', self.byteArrayData[7:11])[0]
self.errorParam2 = struct.unpack('>I', self.byteArrayData[11:15])[0]
else:
# self.printData()
self.ErrCode = struct.unpack('>H', self.byteArrayData[4:6])[0]
self.errorParam1 = struct.unpack('>I', self.byteArrayData[6:10])[0]
self.errorParam2 = struct.unpack('>I', self.byteArrayData[10:14])[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