Something went wrong on our end
Forked from an inaccessible project.
-
Robin.Mueller authored
in serial mode
Robin.Mueller authoredin serial mode
OBSW_TcService200.py 2.03 KiB
# -*- coding: utf-8 -*-
"""
Program: OBSW_TcService200.py
Date: 01.11.2019
Description: PUS Custom Service 200: Mode Commanding
Manual:
Contains a service select factory which returns specific service or device tests.
Also contains an all service and all device tc queue packer.
Run script with -s <Service or Device> -m 3 with optional -p parameter for file output inside the log folder
@author: R. Mueller
"""
from tc.OBSW_TcPacket import *
import struct
def packService200TestInto(tcQueue):
tcQueue.put(("print", "Testing Service 200"))
# Object ID: Dummy Device
objectId = bytearray([0x44, 0x00, 0xAF, 0xFE])
# Set On Mode
tcQueue.put(("print", "\r\nTesting Service 200: Set Mode On"))
modeData = packModeData(objectId, 1, 0)
command = PUSTelecommand(service=200, subservice=1, SSC=2000, data=modeData)
tcQueue.put(command.packCommandTuple())
# Set Normal mode
tcQueue.put(("print", "\r\nTesting Service 200: Set Mode Normal"))
modeData = packModeData(objectId, 2, 0)
command = PUSTelecommand(service=200, subservice=1, SSC=2010, data=modeData)
tcQueue.put(command.packCommandTuple())
# Set Raw Mode
tcQueue.put(("print", "\r\nTesting Service 200: Set Mode Raw"))
modeData = packModeData(objectId, 3, 0)
command = PUSTelecommand(service=200, subservice=1, SSC=2020, data=modeData)
tcQueue.put(command.packCommandTuple())
# Set Off Mode
tcQueue.put(("print", "\r\nTesting Service 200: Set Mode Off"))
modeData = packModeData(objectId, 0, 0)
command = PUSTelecommand(service=200, subservice=1, SSC=2030, data=modeData)
tcQueue.put(command.packCommandTuple())
tcQueue.put(("export", "log/tmtc_log_service200.txt"))
return tcQueue
# Mode 0: Off, Mode 1: Mode On, Mode 2: Mode Normal, Mode 3: Mode Raw
def packModeData(objectId, mode_, submode_):
# Normal mode
mode = struct.pack(">I", mode_)
# Submode default
submode = struct.pack('B', submode_)
modeData = objectId + mode + submode
return modeData