split up in store file and stream file
All checks were successful
EIVE/-/pipeline/head This commit looks good

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

View File

@ -82,12 +82,14 @@ class ActionId(enum.IntEnum):
SET_UART_TX_TRISTATE = 20 SET_UART_TX_TRISTATE = 20
RELEASE_UART_TX = 21 RELEASE_UART_TX = 21
TC_CAM_TAKE_PIC = 22 TC_CAM_TAKE_PIC = 22
TC_SIMPLEX_SEND_FILE = 23 TC_SIMPLEX_STREAM_FILE = 23
TC_DOWNLINK_DATA_MODULATE = 24 TC_DOWNLINK_DATA_MODULATE = 24
TC_MODE_SNAPSHOT = 25 TC_MODE_SNAPSHOT = 25
TC_FLASH_DIR_GET_CONTENT = 28 TC_FLASH_DIR_GET_CONTENT = 28
TM_FLASH_DIRECTORY_CONTENT = 29 TM_FLASH_DIRECTORY_CONTENT = 29
TC_FLASH_READ_FULL_FILE = 30 TC_FLASH_READ_FULL_FILE = 30
TC_SIMPLEX_STORE_FILE = 31
TC_VERIFY_BOOT = 32
class Submode(enum.IntEnum): class Submode(enum.IntEnum):
@ -118,7 +120,8 @@ class OpCode:
REPLAY_START = "replay_start" REPLAY_START = "replay_start"
CAM_CMD_SEND = "cam_cmd_send" CAM_CMD_SEND = "cam_cmd_send"
CAM_TAKE_PIC = "cam_take_pic" 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" DOWNLINK_DATA_MODULATE = "downlink_data_modulate"
ENABLE_PLOC_SUPV_COMMANDING_TO_ON = "enable_ploc_supv_cmd_to_on" ENABLE_PLOC_SUPV_COMMANDING_TO_ON = "enable_ploc_supv_cmd_to_on"
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = "disable_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" REPLAY_START = "Replay Start"
CAM_TAKE_PIC = "Cam Take Picture" CAM_TAKE_PIC = "Cam Take Picture"
CAM_CMD_SEND = "Send Camera Command" 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_READ_FILE = "Copy file from MPSoC to OBC"
FLASH_WRITE_FILE = "Copy file from OBC to MPSoC" FLASH_WRITE_FILE = "Copy file from OBC to MPSoC"
FLASH_DELETE_FILE = "Delete file on 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") q.add_log_cmd("PLOC MPSoC: Cam take picture")
data = prepare_cam_take_pic_cmd(object_id.as_bytes) data = prepare_cam_take_pic_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data)) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.SIMPLEX_SEND_FILE: if cmd_str == OpCode.SIMPLEX_STREAM_FILE:
q.add_log_cmd("PLOC MPSoC: Simplex send file") q.add_log_cmd(Info.SIMPLEX_STREAM_FILE)
data = prepare_simplex_send_file_cmd(object_id.as_bytes) data = prepare_simplex_stream_file_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data)) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.DOWNLINK_DATA_MODULATE: if cmd_str == OpCode.DOWNLINK_DATA_MODULATE:
q.add_log_cmd("PLOC MPSoC: 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) 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: ")) num_of_chunks = int(input("Please specify the number of chunks: "))
assert num_of_chunks >= 0 assert num_of_chunks >= 0
filename = input("Specify filename: ") filename = input("Specify filename: ")
command = ( command = (
object_id object_id
+ struct.pack("!I", ActionId.TC_SIMPLEX_STORE_FILE)
+ struct.pack("!I", num_of_chunks) + struct.pack("!I", num_of_chunks)
+ struct.pack("!I", ActionId.TC_SIMPLEX_SEND_FILE)
+ bytearray(filename, "utf-8") + bytearray(filename, "utf-8")
+ bytes([0]) + bytes([0])
) )