command to set arbitrary bitrates #32
2
.idea/runConfigurations/ccsds_handler.xml
generated
2
.idea/runConfigurations/ccsds_handler.xml
generated
@ -12,7 +12,7 @@
|
|||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
||||||
<option name="PARAMETERS" value="-s ccsds_handler -l -t 8 --hk" />
|
<option name="PARAMETERS" value="-s ccsds_handler -l -t 8 --hk" />
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
|
2
.idea/runConfigurations/tmtcc_Service_17.xml
generated
2
.idea/runConfigurations/tmtcc_Service_17.xml
generated
@ -12,7 +12,7 @@
|
|||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
||||||
<option name="PARAMETERS" value="-s 17 -o 0 -t 3 -l" />
|
<option name="PARAMETERS" value="-s 17 -o 0 -t 3 -l" />
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="true" />
|
<option name="EMULATE_TERMINAL" value="true" />
|
||||||
|
@ -338,6 +338,7 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
|||||||
"1": ("CCSDS Handler: Set high rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"1": ("CCSDS Handler: Set high rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"2": ("CCSDS Handler: Enable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"2": ("CCSDS Handler: Enable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"3": ("CCSDS Handler: Disable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"3": ("CCSDS Handler: Disable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
|
"4": ("CCSDS Handler: Set arbitrary bitrate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
}
|
}
|
||||||
service_ccsds_handler_tuple = ("CCSDS Handler", op_code_dict_srv_ccsds_handler)
|
service_ccsds_handler_tuple = ("CCSDS Handler", op_code_dict_srv_ccsds_handler)
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
@author J. Meier
|
@author J. Meier
|
||||||
@date 20.11.2021
|
@date 20.11.2021
|
||||||
"""
|
"""
|
||||||
|
import struct
|
||||||
|
|
||||||
from tmtccmd.config.definitions import QueueCommands
|
from tmtccmd.config.definitions import QueueCommands
|
||||||
from tmtccmd.tc.packer import TcQueueT
|
from tmtccmd.tc.packer import TcQueueT
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
@ -19,36 +21,41 @@ class CommandIds:
|
|||||||
EN_TRANSMITTER = bytearray([0x0, 0x0, 0x0, 0x2])
|
EN_TRANSMITTER = bytearray([0x0, 0x0, 0x0, 0x2])
|
||||||
# Disables the syrlinks transmitter (by using RS485 enables lines)
|
# Disables the syrlinks transmitter (by using RS485 enables lines)
|
||||||
DIS_TRANSMITTER = bytearray([0x0, 0x0, 0x0, 0x3])
|
DIS_TRANSMITTER = bytearray([0x0, 0x0, 0x0, 0x3])
|
||||||
|
# Sets an arbitrary bitrate. Normally only set low and set high rate commands should be
|
||||||
|
# required
|
||||||
|
ARBITRARY_BITRATE = bytearray([0x0, 0x0, 0x0, 0x4])
|
||||||
|
|
||||||
|
|
||||||
def pack_ccsds_handler_test(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
|
def pack_ccsds_handler_test(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
|
||||||
tc_queue.appendleft(
|
tc_queue.appendleft(
|
||||||
(QueueCommands.PRINT,
|
(QueueCommands.PRINT,
|
||||||
"Testing ccsds handler with object id: 0x" + object_id.hex())
|
"Testing CCSDS handler with object id: 0x" + object_id.hex())
|
||||||
)
|
)
|
||||||
|
|
||||||
if op_code == "0":
|
if op_code == "0":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set low rate"))
|
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set low rate"))
|
||||||
command = object_id + CommandIds.SET_LOW_RATE
|
command = object_id + CommandIds.SET_LOW_RATE
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
|
||||||
if op_code == "1":
|
if op_code == "1":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set high rate"))
|
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set high rate"))
|
||||||
command = object_id + CommandIds.SET_HIGH_RATE
|
command = object_id + CommandIds.SET_HIGH_RATE
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
|
||||||
if op_code == "2":
|
if op_code == "2":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Enables the transmitter"))
|
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Enables the transmitter"))
|
||||||
command = object_id + CommandIds.EN_TRANSMITTER
|
command = object_id + CommandIds.EN_TRANSMITTER
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
|
||||||
if op_code == "3":
|
if op_code == "3":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Disables the transmitter"))
|
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Disables the transmitter"))
|
||||||
command = object_id + CommandIds.DIS_TRANSMITTER
|
command = object_id + CommandIds.DIS_TRANSMITTER
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
|
||||||
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
if op_code == "4":
|
||||||
|
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set arbitrary bitrate"))
|
||||||
|
bitrate = int(input("Specify bit rate (bps): "))
|
||||||
|
command = object_id + CommandIds.ARBITRARY_BITRATE + struct.pack('!I', bitrate)
|
||||||
|
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
|
||||||
return tc_queue
|
return tc_queue
|
||||||
|
Loading…
Reference in New Issue
Block a user