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

TC printer added

parent a31ea1d6
No related branches found
No related tags found
No related merge requests found
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="MIB_Objects" type="PythonConfigurationType" factoryName="Python" folderName="MIB">
<module name="generators" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/../generators/objects" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/../generators/objects/MIB_Objects.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="OBSW_TmTc Client Service 17 Test Serial" type="PythonConfigurationType" factoryName="Python" folderName="Serial Communication">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/OBSW_TmTcClient.py" />
<option name="PARAMETERS" value="-m 3 -s 17 -c 1 -p" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
...@@ -119,11 +119,12 @@ def main(): ...@@ -119,11 +119,12 @@ def main():
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
# Single Command Testing # Single Command Testing
#command = PUSTelecommand(service=17, subservice=1, SSC=21) command = PUSTelecommand(service=17, subservice=1, SSC=21)
file = bytearray([1, 2, 3, 4, 5]) command.print()
command = PUSTelecommand(service=23, subservice=1, SSC=21, data=file) # file = bytearray([1, 2, 3, 4, 5])
command.packCommandTuple() # command = PUSTelecommand(service=23, subservice=1, SSC=21, data=file)
return command.packCommandTuple() # command.packCommandTuple()
# return command.packCommandTuple()
def setUpSocket(): def setUpSocket():
......
...@@ -18,7 +18,11 @@ class SingleCommandSenderReceiver(CommandSenderReceiver): ...@@ -18,7 +18,11 @@ class SingleCommandSenderReceiver(CommandSenderReceiver):
def __init__(self, comInterface, displayMode, pusPacketTuple, tmTimeout, tcTimeoutFactor, doPrintToFile): def __init__(self, comInterface, displayMode, pusPacketTuple, tmTimeout, tcTimeoutFactor, doPrintToFile):
super().__init__(comInterface, displayMode, tmTimeout, tcTimeoutFactor, doPrintToFile) super().__init__(comInterface, displayMode, tmTimeout, tcTimeoutFactor, doPrintToFile)
self.pusPacketTuple = pusPacketTuple self.pusPacketTuple = pusPacketTuple
(self.pusPacketInfo, self.pusPacket) = self.pusPacketTuple try:
(self.pusPacketInfo, self.pusPacket) = self.pusPacketTuple
except TypeError:
print("Invalid queue entry detected")
exit()
def sendSingleTcAndReceiveTm(self): def sendSingleTcAndReceiveTm(self):
print("Starting listener thread") print("Starting listener thread")
......
...@@ -65,6 +65,16 @@ class PUSTelecommand: ...@@ -65,6 +65,16 @@ class PUSTelecommand:
commandTuple = (self.packInformation(), self.pack()) commandTuple = (self.packInformation(), self.pack())
return commandTuple return commandTuple
def print(self):
packet = self.pack()
print("Command in Hexadecimal: [", end="")
for counter in range(len(packet)):
if counter == len(packet) - 1:
print(str(hex(packet[counter])), end="")
else:
print(str(hex(packet[counter])) + ", ", end="")
print("]")
# Takes pusPackets, removes current Packet Error Control, calculates new CRC (16 bits at packet end) and # Takes pusPackets, removes current Packet Error Control, calculates new CRC (16 bits at packet end) and
# adds it as correct Packet Error Control Code. Reference: ECSS-E70-41A p. 207-212 # adds it as correct Packet Error Control Code. Reference: ECSS-E70-41A p. 207-212
......
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