Something went wrong on our end
Forked from an inaccessible project.
-
Robin.Mueller authored
TMTC receiver bugfixes
Robin.Mueller authoredTMTC receiver bugfixes
OBSW_TcService8.py 2.55 KiB
# -*- coding: utf-8 -*-
"""
Program: OBSW_UnitTest.py
Date: 01.11.2019
Description: PUS Custom Service 8: Function Management, High-Level Commanding
@author: R. Mueller
"""
import struct
from tc.OBSW_TcPacket import *
from tc.OBSW_TcService200 import packModeData
def packService8TestInto(tcQueue, calledExternally=False):
if calledExternally is False:
tcQueue.put(("print", "Testing Service 8"))
objectId = bytearray([0x44, 0x00, 0xAF, 0xFE])
# set mode on
tcQueue.put(("print", "\r\nTesting Service 8: Set Normal Mode"))
modeData = packModeData(objectId, 1, 0)
command = PUSTelecommand(service=200, subservice=1, SSC=800, data=modeData)
tcQueue.put(command.packCommandTuple())
# set mode normal
tcQueue.put(("print", "\r\nTesting Service 8: Set Normal Mode"))
modeData = packModeData(objectId, 2, 0)
command = PUSTelecommand(service=200, subservice=1, SSC=810, data=modeData)
tcQueue.put(command.packCommandTuple())
# Direct command which triggers completion reply
tcQueue.put(("print", "\r\nTesting Service 8: Trigger Completion Reply"))
actionId = struct.pack(">I", 666)
directCommand = objectId + actionId
command = PUSTelecommand(service=8, subservice=128, SSC=820, data=directCommand)
tcQueue.put(command.packCommandTuple())
# Direct command which triggers data reply
tcQueue.put(("print", "\r\nTesting Service 8: Trigger Data Reply"))
actionId = bytearray([0xC0, 0xC0, 0xBA, 0xBE])
commandParam1 = bytearray([0xBA, 0xB0])
commandParam2 = bytearray([0x00, 0x00, 0x00, 0x52, 0x4F, 0x42, 0x49, 0x4E])
directCommand = objectId + actionId + commandParam1 + commandParam2
command = PUSTelecommand(service=8, subservice=128, SSC=830, data=directCommand)
tcQueue.put(command.packCommandTuple())
# Direct command which triggers an additional step reply and one completion reply
tcQueue.put(("print", "\r\nTesting Service 8: Trigger Step and Completion Reply"))
actionId = bytearray([0xBA, 0xDE, 0xAF, 0xFE])
directCommand = objectId + actionId
command = PUSTelecommand(service=8, subservice=128, SSC=840, data=directCommand)
tcQueue.put(command.packCommandTuple())
tcQueue.put(("wait", 2))
tcQueue.put(("print", "\r"))
if calledExternally is False:
tcQueue.put(("export", "log/tmtc_log_service8.txt"))
return tcQueue
def packSpecificService8TestInto(tcQueue, objectIdList, actionIdList, dataList,
sscList, printStringList, calledExternally=False):
pass