From 73e69e63f071643cf3de783ad7b927d6b2998ab8 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" <robin.mueller.m@gmail.com> Date: Sun, 18 Oct 2020 23:50:24 +0200 Subject: [PATCH] command appears to work --- .../tmtcclient_Hamming_from_FRAM.xml | 24 +++++++++++++++++++ .../tmtcclient_Hamming_from_SD.xml | 24 +++++++++++++++++++ tc/obsw_image_handler.py | 4 +++- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .idea/runConfigurations/tmtcclient_Hamming_from_FRAM.xml create mode 100644 .idea/runConfigurations/tmtcclient_Hamming_from_SD.xml diff --git a/.idea/runConfigurations/tmtcclient_Hamming_from_FRAM.xml b/.idea/runConfigurations/tmtcclient_Hamming_from_FRAM.xml new file mode 100644 index 0000000..d32540b --- /dev/null +++ b/.idea/runConfigurations/tmtcclient_Hamming_from_FRAM.xml @@ -0,0 +1,24 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="tmtcclient Hamming from FRAM" type="PythonConfigurationType" factoryName="Python" folderName="Serial SD-Card and Image"> + <module name="tmtc" /> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs> + <env name="PYTHONUNBUFFERED" value="1" /> + </envs> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> + <option name="IS_MODULE_SDK" value="true" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/obsw_tmtc_client.py" /> + <option name="PARAMETERS" value="-m 3 -s Img -o P1 -t 3" /> + <option name="SHOW_COMMAND_LINE" value="false" /> + <option name="EMULATE_TERMINAL" value="true" /> + <option name="MODULE_MODE" value="false" /> + <option name="REDIRECT_INPUT" value="false" /> + <option name="INPUT_FILE" value="" /> + <method v="2" /> + </configuration> +</component> \ No newline at end of file diff --git a/.idea/runConfigurations/tmtcclient_Hamming_from_SD.xml b/.idea/runConfigurations/tmtcclient_Hamming_from_SD.xml new file mode 100644 index 0000000..43c2bce --- /dev/null +++ b/.idea/runConfigurations/tmtcclient_Hamming_from_SD.xml @@ -0,0 +1,24 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="tmtcclient Hamming from SD" type="PythonConfigurationType" factoryName="Python" folderName="Serial SD-Card and Image"> + <module name="tmtc" /> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <envs> + <env name="PYTHONUNBUFFERED" value="1" /> + </envs> + <option name="SDK_HOME" value="" /> + <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> + <option name="IS_MODULE_SDK" value="true" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> + <option name="SCRIPT_NAME" value="$PROJECT_DIR$/obsw_tmtc_client.py" /> + <option name="PARAMETERS" value="-m 3 -c 1 -s Img -o P0 -t 3" /> + <option name="SHOW_COMMAND_LINE" value="false" /> + <option name="EMULATE_TERMINAL" value="true" /> + <option name="MODULE_MODE" value="false" /> + <option name="REDIRECT_INPUT" value="false" /> + <option name="INPUT_FILE" value="" /> + <method v="2" /> + </configuration> +</component> \ No newline at end of file diff --git a/tc/obsw_image_handler.py b/tc/obsw_image_handler.py index 59be975..00e4236 100644 --- a/tc/obsw_image_handler.py +++ b/tc/obsw_image_handler.py @@ -23,11 +23,13 @@ def generate_copy_obsw_sdc_to_flash_packet(ssc: int, slot: int, app_data.append(slot) return PusTelecommand(service=8, subservice=128, ssc=ssc, app_data=app_data) + def generate_param_packet_hamming_from_sdcard(enable: bool, ssc: int, object_id: bytearray = SW_IMAGE_HANDLER_ID): return pack_boolean_parameter_setting(object_id=object_id, domain_id=0, unique_id=0, parameter=enable, ssc=ssc) + def generate_img_handler_packet(service_queue: Deque, op_code: int): # Action ID 4 (Copy SDC to Flash, Software Update Image) if op_code == "A4U": @@ -44,7 +46,7 @@ def generate_img_handler_packet(service_queue: Deque, op_code: int): command = generate_param_packet_hamming_from_sdcard(enable=True, ssc=0) service_queue.appendleft(command.pack_command_tuple()) elif op_code == "P1": - service_queue.appendleft(("print", "Configrung hamming code to be taken from FRAM")) + service_queue.appendleft(("print", "Configuring hamming code to be taken from FRAM")) command = generate_param_packet_hamming_from_sdcard(enable=False, ssc=0) service_queue.appendleft(command.pack_command_tuple()) -- GitLab