split up in store file and stream file
EIVE/-/pipeline/head This commit looks good Details

This commit is contained in:
Robin Müller 2024-04-17 14:43:15 +02:00
parent 18860ec2c6
commit 05d5955236
Signed by: muellerr
GPG Key ID: A649FB78196E3849
1 changed files with 23 additions and 8 deletions

View File

@ -82,12 +82,14 @@ class ActionId(enum.IntEnum):
SET_UART_TX_TRISTATE = 20
RELEASE_UART_TX = 21
TC_CAM_TAKE_PIC = 22
TC_SIMPLEX_SEND_FILE = 23
TC_SIMPLEX_STREAM_FILE = 23
TC_DOWNLINK_DATA_MODULATE = 24
TC_MODE_SNAPSHOT = 25
TC_FLASH_DIR_GET_CONTENT = 28
TM_FLASH_DIRECTORY_CONTENT = 29
TC_FLASH_READ_FULL_FILE = 30
TC_SIMPLEX_STORE_FILE = 31
TC_VERIFY_BOOT = 32
class Submode(enum.IntEnum):
@ -118,7 +120,8 @@ class OpCode:
REPLAY_START = "replay_start"
CAM_CMD_SEND = "cam_cmd_send"
CAM_TAKE_PIC = "cam_take_pic"
SIMPLEX_SEND_FILE = "simplex_send_file"
SIMPLEX_STREAM_FILE = "simplex_stream_file"
SIMPLEX_STORE_FILE = "simplex_store_file"
DOWNLINK_DATA_MODULATE = "downlink_data_modulate"
ENABLE_PLOC_SUPV_COMMANDING_TO_ON = "enable_ploc_supv_cmd_to_on"
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = "disable_ploc_supv_cmd_to_on"
@ -143,7 +146,8 @@ class Info:
REPLAY_START = "Replay Start"
CAM_TAKE_PIC = "Cam Take Picture"
CAM_CMD_SEND = "Send Camera Command"
SIMPLEX_SEND_FILE = "Simplex Send File"
SIMPLEX_STREAM_FILE = "Simplex Stream File with E-Band"
SIMPLEX_STORE_FILE = "Simplex Store File on MPSoC"
FLASH_READ_FILE = "Copy file from MPSoC to OBC"
FLASH_WRITE_FILE = "Copy file from OBC to MPSoC"
FLASH_DELETE_FILE = "Delete file on MPSoC"
@ -285,9 +289,9 @@ def pack_ploc_mpsoc_commands(
q.add_log_cmd("PLOC MPSoC: Cam take picture")
data = prepare_cam_take_pic_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.SIMPLEX_SEND_FILE:
q.add_log_cmd("PLOC MPSoC: Simplex send file")
data = prepare_simplex_send_file_cmd(object_id.as_bytes)
if cmd_str == OpCode.SIMPLEX_STREAM_FILE:
q.add_log_cmd(Info.SIMPLEX_STREAM_FILE)
data = prepare_simplex_stream_file_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.DOWNLINK_DATA_MODULATE:
q.add_log_cmd("PLOC MPSoC: Downlink data modulate")
@ -482,14 +486,25 @@ def prepare_cam_take_pic_cmd(object_id: bytes) -> bytearray:
return bytearray(command)
def prepare_simplex_send_file_cmd(object_id: bytes) -> bytes:
def prepare_simplex_stream_file_cmd(object_id: bytes) -> bytes:
filename = input("Specify filename: ")
command = (
object_id
+ struct.pack("!I", ActionId.TC_SIMPLEX_STREAM_FILE)
+ bytearray(filename, "utf-8")
+ bytes([0])
)
return command
def prepare_simplex_store_file_cmd(object_id: bytes) -> bytes:
num_of_chunks = int(input("Please specify the number of chunks: "))
assert num_of_chunks >= 0
filename = input("Specify filename: ")
command = (
object_id
+ struct.pack("!I", ActionId.TC_SIMPLEX_STORE_FILE)
+ struct.pack("!I", num_of_chunks)
+ struct.pack("!I", ActionId.TC_SIMPLEX_SEND_FILE)
+ bytearray(filename, "utf-8")
+ bytes([0])
)