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

tmtc script service 3 init

parent c9b71479
Branches
Tags
No related merge requests found
......@@ -134,6 +134,14 @@ class OBSWPusPacket:
def getSSC(self):
return self.PUSHeader.sourceSequenceCount
def printData(self):
strToPrint = "["
for byte in self.data:
strToPrint += str(hex(byte)) + " , "
strToPrint = strToPrint.rstrip(' , ')
strToPrint += ']'
return strToPrint
# Structure of a PUS Packet :
# A PUS packet consists of consecutive bits, the allocation and structure is standardised.
# Extended information can be found in ECSS-E-70-41A on p.42
......
......@@ -133,13 +133,22 @@ class Service2TM(PUSTelemetry):
class Service3TM(PUSTelemetry):
def __init__(self, byteArray):
super().__init__(byteArray)
self.sid = struct.unpack('>I', self.byteArrayData[0:4])[0]
if self.getSubservice() == 25:
self.paramLength = len(self.byteArrayData) - 4
if self.sid == 0x1f00:
pass
def printTelemetryHeader(self, array):
super().printTelemetryHeader(array)
array.append(hex(self.sid))
array.append(int(self.paramLength))
return
def printTelemetryColumnHeaders(self, array):
super().printTelemetryColumnHeaders(array)
array.append("SID")
array.append("Number of Parameters")
return
......
......@@ -13,7 +13,7 @@ import OBSW_Config as g
# TODO: Print everything in a file
class TmtcPrinter:
def __init__(self, displayMode, doPrintToFile, printTc):
def __init__(self, displayMode="long", doPrintToFile=False, printTc=True):
self.printBuffer = ""
# global print buffer which will be useful to print something to file
self.fileBuffer = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment