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