From a6a1215ac983f24bb28663fa657f4d540e1b6675 Mon Sep 17 00:00:00 2001 From: chutaro <35984595+chutaro@users.noreply.github.com> Date: Fri, 22 Sep 2023 23:10:28 +0900 Subject: [PATCH 01/87] record PL_BC_LIST_CLEARED as EL_high --- applications/timeline_command_dispatcher.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/applications/timeline_command_dispatcher.c b/applications/timeline_command_dispatcher.c index f97c75191..599719dd6 100644 --- a/applications/timeline_command_dispatcher.c +++ b/applications/timeline_command_dispatcher.c @@ -276,7 +276,15 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet) ack = PL_deploy_block_cmd(&(PH_tl_cmd_list[id]), block_no, TMGR_get_master_total_cycle()); - if (ack != PL_SUCCESS) + if (ack == PL_BC_LIST_CLEARED) + { + EL_record_event((EL_GROUP)EL_CORE_GROUP_TLCD_DEPLOY_BLOCK, + (uint32_t)PL_BC_LIST_CLEARED, + EL_ERROR_LEVEL_HIGH, + (uint32_t)( ((0x000000ff & id) << 24) | (0x00ffffff & block_no) )); + return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_CONTEXT, (uint32_t)ack); + } + else if (ack != PL_SUCCESS) { EL_record_event((EL_GROUP)EL_CORE_GROUP_TLCD_DEPLOY_BLOCK, (uint32_t)ack, From c0e8afd399f21228256b833abae40c7c5dcc0cc3 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 8 Nov 2023 18:21:52 +0900 Subject: [PATCH 02/87] group note --- applications/timeline_command_dispatcher.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/timeline_command_dispatcher.c b/applications/timeline_command_dispatcher.c index 599719dd6..fed7c7c38 100644 --- a/applications/timeline_command_dispatcher.c +++ b/applications/timeline_command_dispatcher.c @@ -254,6 +254,7 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet) TLCD_ID id = (TLCD_ID)CCP_get_param_from_packet(packet, 0, uint8_t); bct_id_t block_no = CCP_get_param_from_packet(packet, 1, bct_id_t); PL_ACK ack; + const uint32_t note = ((0x000000ff & id) << 24) | (0x00ffffff & block_no); if (CCP_get_param_len(packet) != (1 + SIZE_OF_BCT_ID_T)) { @@ -281,7 +282,7 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet) EL_record_event((EL_GROUP)EL_CORE_GROUP_TLCD_DEPLOY_BLOCK, (uint32_t)PL_BC_LIST_CLEARED, EL_ERROR_LEVEL_HIGH, - (uint32_t)( ((0x000000ff & id) << 24) | (0x00ffffff & block_no) )); + note); return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_CONTEXT, (uint32_t)ack); } else if (ack != PL_SUCCESS) @@ -289,7 +290,7 @@ CCP_CmdRet Cmd_TLCD_DEPLOY_BLOCK(const CommonCmdPacket* packet) EL_record_event((EL_GROUP)EL_CORE_GROUP_TLCD_DEPLOY_BLOCK, (uint32_t)ack, EL_ERROR_LEVEL_LOW, - (uint32_t)( ((0x000000ff & id) << 24) | (0x00ffffff & block_no) )); + note); if (ack == PL_BC_TIME_ADJUSTED) { return CCP_make_cmd_ret(CCP_EXEC_SUCCESS, (uint32_t)ack); From 206966b36d2d8b3cae1244cd44ba88f6ba15890e Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 8 Nov 2023 19:12:00 +0900 Subject: [PATCH 03/87] rename filename from vcdu to aos_transfer_frame --- examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt | 2 +- .../src/src_user/tlm_cmd/ccsds/{vcdu.c => aos_transfer_frame.c} | 0 .../src/src_user/tlm_cmd/ccsds/{vcdu.h => aos_transfer_frame.h} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename examples/mobc/src/src_user/tlm_cmd/ccsds/{vcdu.c => aos_transfer_frame.c} (100%) rename examples/mobc/src/src_user/tlm_cmd/ccsds/{vcdu.h => aos_transfer_frame.h} (100%) diff --git a/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt b/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt index c7cd1b936..a88e26e87 100644 --- a/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt +++ b/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt @@ -14,11 +14,11 @@ set(C2A_SRCS normal_block_command_definition/nbc_start_hk_tlm.c normal_block_command_definition/nbc_respond_eh_for_test.c normal_block_command_definition/nbc_test_bcl.c + ccsds/aos_transfer_frame.c ccsds/m_pdu.c ccsds/tc_transfer_frame.c ccsds/tcp_to_m_pdu.c ccsds/tc_segment.c - ccsds/vcdu.c ) if(C2A_BUILD_AS_CXX) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/vcdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/vcdu.c rename to examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/vcdu.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/vcdu.h rename to examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h From 2ea7e2f268e04608c8e03a44347b5e741d91b5e6 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 8 Nov 2023 19:22:46 +0900 Subject: [PATCH 04/87] sed VCDU to AOSTF --- applications/memory_dump.c | 6 +- .../applications/component_service/csrv_gs.c | 20 ++-- .../applications/component_service/csrv_gs.h | 4 +- .../src/src_user/component_driver/com/gs.c | 22 ++-- .../src/src_user/component_driver/com/gs.h | 12 +- .../tlm_cmd/ccsds/aos_transfer_frame.c | 110 +++++++++--------- .../tlm_cmd/ccsds/aos_transfer_frame.h | 92 +++++++-------- .../src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c | 2 +- .../CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv | 4 +- .../TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv | 16 +-- .../TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv | 4 +- .../calced_data/SAMPLE_MOBC_TLM_DB_GS.csv | 16 +-- .../calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv | 4 +- tlm_cmd/ccsds/space_packet_typedef.h | 2 +- tlm_cmd/telemetry_generator.c | 4 +- 15 files changed, 159 insertions(+), 159 deletions(-) diff --git a/applications/memory_dump.c b/applications/memory_dump.c index 4063eacf1..d1187abc5 100644 --- a/applications/memory_dump.c +++ b/applications/memory_dump.c @@ -110,7 +110,7 @@ CCP_CmdRet Cmd_MEM_DUMP_REGION_SEQ(const CommonCmdPacket* packet) if (num_dumps >= 8) { // パケット生成回数の上限は8回とする。 - // 32kbpsでのDL時に8VCDU/secで1秒分の通信量。 + // 32kbpsでのDL時に8AOSTF/secで1秒分の通信量。 // これを超える場合は複数回コマンドを送信して対応する。 return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); } @@ -132,7 +132,7 @@ CCP_CmdRet Cmd_MEM_DUMP_REGION_RND(const CommonCmdPacket* packet) if (num_dumps >= 8) { // パケット生成回数の上限は8回とする。 - // 32kbpsでのDL時に8VCDU/secで1秒分の通信量。 + // 32kbpsでのDL時に8AOSTF/secで1秒分の通信量。 // これを超える場合は複数回コマンドを送信して対応する。 return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); } @@ -170,7 +170,7 @@ CCP_CmdRet Cmd_MEM_DUMP_SINGLE(const CommonCmdPacket* packet) if (num_dumps >= 8) { // パケット生成回数の上限は8回とする。 - // 32kbpsでのDL時に8VCDU/secで1秒分の通信量。 + // 32kbpsでのDL時に8AOSTF/secで1秒分の通信量。 // これを超える場合は複数回コマンドを送信して対応する。 return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); } diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.c b/examples/mobc/src/src_user/applications/component_service/csrv_gs.c index 40a9e6171..d4bda3267 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.c +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.c @@ -126,17 +126,17 @@ static RESULT CSRV_GS_rt_tlm_packet_handler_app_(void) &CSRV_GS_rt_tlm_packet_handler_.vcdu.m_pdu); if (ack != T2M_SUCCESS) return RESULT_OK; - // Realtime VCDU カウンタの設定 - VCDU_setup_realtime_vcdu_hdr(&CSRV_GS_rt_tlm_packet_handler_.vcdu, CSRV_GS_rt_tlm_packet_handler_.vcdu_counter); - CSRV_GS_rt_tlm_packet_handler_.vcdu_counter = VCDU_calc_next_counter(CSRV_GS_rt_tlm_packet_handler_.vcdu_counter); + // Realtime AOSTF カウンタの設定 + AOSTF_setup_realtime_vcdu_hdr(&CSRV_GS_rt_tlm_packet_handler_.vcdu, CSRV_GS_rt_tlm_packet_handler_.vcdu_counter); + CSRV_GS_rt_tlm_packet_handler_.vcdu_counter = AOSTF_calc_next_counter(CSRV_GS_rt_tlm_packet_handler_.vcdu_counter); // CLCW の設定 // CMD の VCID と TLM の VCID は独立で関係がない // TLM の VCID 種別(Realtime, Replay)によらず CLCW を設定して良い // CLCW が対応する CMD の VCID は CLCW の内部で指定される - VCDU_set_clcw(&CSRV_GS_rt_tlm_packet_handler_.vcdu, GS_form_clcw()); + AOSTF_set_clcw(&CSRV_GS_rt_tlm_packet_handler_.vcdu, GS_form_clcw()); - // 完成した VCDU を RT VCDU として送出 + // 完成した AOSTF を RT AOSTF として送出 GS_send_vcdu(&gs_driver_, &CSRV_GS_rt_tlm_packet_handler_.vcdu); } @@ -161,17 +161,17 @@ static RESULT CSRV_GS_rp_tlm_packet_handler_app_(void) &CSRV_GS_rp_tlm_packet_handler_.vcdu.m_pdu); if (ack != T2M_SUCCESS) return RESULT_OK; - // Replay VCDU カウンタの設定 - VCDU_setup_replay_vcdu_hdr(&CSRV_GS_rp_tlm_packet_handler_.vcdu, CSRV_GS_rp_tlm_packet_handler_.vcdu_counter); - CSRV_GS_rp_tlm_packet_handler_.vcdu_counter = VCDU_calc_next_counter(CSRV_GS_rp_tlm_packet_handler_.vcdu_counter); + // Replay AOSTF カウンタの設定 + AOSTF_setup_replay_vcdu_hdr(&CSRV_GS_rp_tlm_packet_handler_.vcdu, CSRV_GS_rp_tlm_packet_handler_.vcdu_counter); + CSRV_GS_rp_tlm_packet_handler_.vcdu_counter = AOSTF_calc_next_counter(CSRV_GS_rp_tlm_packet_handler_.vcdu_counter); // CLCW の設定 // CMD の VCIDと TLM の VCID は独立で関係がない // TLM の VCID 種別(Realtime, Replay) によらず CLCW を設定して良い // CLCW が対応する CMD の VCID は CLCW の内部で指定される - VCDU_set_clcw(&CSRV_GS_rp_tlm_packet_handler_.vcdu, GS_form_clcw()); + AOSTF_set_clcw(&CSRV_GS_rp_tlm_packet_handler_.vcdu, GS_form_clcw()); - // 完成した VCDU を RP VCDU として送出 + // 完成した AOSTF を RP AOSTF として送出 GS_send_vcdu(&gs_driver_, &CSRV_GS_rp_tlm_packet_handler_.vcdu); } diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h index 448103eec..249783b5a 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h @@ -19,8 +19,8 @@ typedef struct { TcpToMPdu tc_packet_to_m_pdu; //!< PL から取り出した tc_packet を M_PDU に変換する - VCDU vcdu; //!< 送信するVCDU - uint32_t vcdu_counter; //!< VCDU counter + AOSTF vcdu; //!< 送信するAOSTF + uint32_t vcdu_counter; //!< AOSTF counter } CSRV_GS_TlmPacketHandler; extern const GS_Driver* const gs_driver; diff --git a/examples/mobc/src/src_user/component_driver/com/gs.c b/examples/mobc/src/src_user/component_driver/com/gs.c index 52bdcdb03..14a0bd867 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.c +++ b/examples/mobc/src/src_user/component_driver/com/gs.c @@ -26,7 +26,7 @@ // それぞれ AD, BD, BC static uint8_t GS_rx_header_[GS_RX_HEADER_NUM][GS_RX_HEADER_SIZE]; -static uint8_t GS_tx_frame_[VCDU_LEN]; +static uint8_t GS_tx_frame_[AOSTF_LEN]; /** * @brief CCSDS 側 Driver の DS 上での初期化設定 @@ -114,7 +114,7 @@ CDS_INIT_ERR_CODE GS_init(GS_Driver* gs_driver, gs_driver->info[i].rx.tctf.bd_rec_status = GS_VALIDATE_ERR_OK; gs_driver->info[i].tx.send_cycle = 0; - gs_driver->info[i].tx.vcid = VCDU_VCID_UNKNOWN; + gs_driver->info[i].tx.vcid = AOSTF_VCID_UNKNOWN; gs_driver->info[i].tx.vcdu_counter = 0; } @@ -152,7 +152,7 @@ static void GS_load_default_driver_super_init_settings_(ComponentDriverSuper* p_ CDSSC_enable_strict_frame_search(p_stream_config); // 複数ストリームがあり,かつ論理的な受信漏れを0にするため. CDSSC_set_tx_frame(p_stream_config, GS_tx_frame_); // 全 stream, uart, ccsds に関わらず共通 - CDSSC_set_tx_frame_size(p_stream_config, VCDU_LEN); // VCDU を送信 + CDSSC_set_tx_frame_size(p_stream_config, AOSTF_LEN); // AOSTF を送信 CDSSC_set_rx_header(p_stream_config, GS_rx_header_[stream], GS_RX_HEADER_SIZE); CDSSC_set_rx_frame_size(p_stream_config, -1); // 可変長 @@ -254,21 +254,21 @@ static CDS_ERR_CODE GS_analyze_rec_data_(CDS_StreamConfig* p_stream_config, void return CDS_ERR_CODE_OK; } -CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const VCDU* vcdu) +CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const AOSTF* vcdu) { CDS_ERR_CODE ret_ccsds = CDS_ERR_CODE_OK; CDS_ERR_CODE ret_uart = CDS_ERR_CODE_OK; - size_t vcdu_size = sizeof(VCDU); + size_t vcdu_size = sizeof(AOSTF); // パディングが無ければ元を GS_tx_frame_ にコピーさせる (444Byte) のコピーが無駄 - if (vcdu_size == VCDU_LEN) + if (vcdu_size == AOSTF_LEN) { CDSSC_set_tx_frame(&gs_driver->driver_ccsds.super.stream_config[GS_TX_STREAM], (uint8_t*)vcdu); CDSSC_set_tx_frame(&gs_driver->driver_uart.super.stream_config[GS_TX_STREAM], (uint8_t*)vcdu); } else { - VCDU_generate_byte_stream(vcdu, GS_tx_frame_); // 送信元にセット 消したいなぁ... + AOSTF_generate_byte_stream(vcdu, GS_tx_frame_); // 送信元にセット 消したいなぁ... CDSSC_set_tx_frame(&gs_driver->driver_ccsds.super.stream_config[GS_TX_STREAM], GS_tx_frame_); CDSSC_set_tx_frame(&gs_driver->driver_uart.super.stream_config[GS_TX_STREAM], GS_tx_frame_); } @@ -278,8 +278,8 @@ CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const VCDU* vcdu) if (gs_driver->ccsds_info.buffer_num) { gs_driver->info[GS_PORT_TYPE_CCSDS].tx.send_cycle = TMGR_get_master_total_cycle(); - gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcid = VCDU_get_vcid(vcdu); - gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcdu_counter = VCDU_get_vcdu_counter(vcdu); + gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcid = AOSTF_get_vcid(vcdu); + gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcdu_counter = AOSTF_get_vcdu_counter(vcdu); // DS 側の名称が cmd なだけで送信しているのは TLM ret_ccsds = CDS_send_general_cmd(&gs_driver->driver_ccsds.super, GS_TX_STREAM); @@ -289,8 +289,8 @@ CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const VCDU* vcdu) if (gs_driver->driver_uart.is_tlm_on) { gs_driver->info[GS_PORT_TYPE_UART].tx.send_cycle = TMGR_get_master_total_cycle(); - gs_driver->info[GS_PORT_TYPE_UART].tx.vcid = VCDU_get_vcid(vcdu); - gs_driver->info[GS_PORT_TYPE_UART].tx.vcdu_counter = VCDU_get_vcdu_counter(vcdu); + gs_driver->info[GS_PORT_TYPE_UART].tx.vcid = AOSTF_get_vcid(vcdu); + gs_driver->info[GS_PORT_TYPE_UART].tx.vcdu_counter = AOSTF_get_vcdu_counter(vcdu); // DS 側の名称が cmd なだけで送信しているのは TLM ret_uart = CDS_send_general_cmd(&gs_driver->driver_uart.super, GS_TX_STREAM); diff --git a/examples/mobc/src/src_user/component_driver/com/gs.h b/examples/mobc/src/src_user/component_driver/com/gs.h index 614e3877e..fa4c7b697 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.h +++ b/examples/mobc/src/src_user/component_driver/com/gs.h @@ -53,8 +53,8 @@ typedef struct struct { cycle_t send_cycle; //!< 最後に送信したときの時刻 - VCDU_VCID vcid; //!< 送信した TLM のタイプ - uint32_t vcdu_counter; //!< VCDU counter + AOSTF_VCID vcid; //!< 送信した TLM のタイプ + uint32_t vcdu_counter; //!< AOSTF counter } tx; } GS_Info; @@ -106,13 +106,13 @@ CDS_INIT_ERR_CODE GS_init(GS_Driver* gs_driver, CDS_REC_ERR_CODE GS_rec_tctf(GS_Driver* gs_driver); /** - * @brief 地上に向けて TLM を送信. 形式は VCDU + * @brief 地上に向けて TLM を送信. 形式は AOSTF * @note CDS_send_general_cmd が使われているが, これは DS は MOBC コンポ間を想定しているため, MOBC から見るとコンポに cmd を送信している様に見える, が 今回は MOBC から地上に TLM を送信している - * @note TLM 送信, 形式は VCDU + * @note TLM 送信, 形式は AOSTF * @param[in] gs_driver: ドライバー - * @param[in] vcdu: 送信する VCDU. 場合によってはそのまま DS に渡すので, local変数ではなくstaticな変数を渡すこと + * @param[in] vcdu: 送信する AOSTF. 場合によってはそのまま DS に渡すので, local変数ではなくstaticな変数を渡すこと * @return CDS_CMD_ERR_CODE: 送信結果 */ -CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const VCDU* vcdu); +CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const AOSTF* vcdu); #endif diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c index f50924980..7d63e00af 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c @@ -3,54 +3,54 @@ #include // for memcpy -static void VCDU_set_common_hdr_(VCDU* vcdu); -static void VCDU_clear_spare_(VCDU* vcdu); +static void AOSTF_set_common_hdr_(AOSTF* vcdu); +static void AOSTF_clear_spare_(AOSTF* vcdu); -void VCDU_generate_byte_stream(const VCDU* vcdu, - uint8_t byte_stream[VCDU_LEN]) +void AOSTF_generate_byte_stream(const AOSTF* vcdu, + uint8_t byte_stream[AOSTF_LEN]) { - memcpy(byte_stream, vcdu->header, VCDU_HEADER_SIZE); - byte_stream += VCDU_HEADER_SIZE; + memcpy(byte_stream, vcdu->header, AOSTF_HEADER_SIZE); + byte_stream += AOSTF_HEADER_SIZE; M_PDU_generate_byte_stream(&(vcdu->m_pdu), byte_stream); byte_stream += M_PDU_LEN; - memcpy(byte_stream, vcdu->trailer, VCDU_TRAILER_SIZE); + memcpy(byte_stream, vcdu->trailer, AOSTF_TRAILER_SIZE); } -void VCDU_setup_fill_vcdu(VCDU* vcdu) +void AOSTF_setup_fill_vcdu(AOSTF* vcdu) { - VCDU_set_common_hdr_(vcdu); - VCDU_set_vcid(vcdu, VCDU_VCID_FILL); + AOSTF_set_common_hdr_(vcdu); + AOSTF_set_vcid(vcdu, AOSTF_VCID_FILL); M_PDU_setup_idle_m_pdu(&(vcdu->m_pdu)); } -void VCDU_setup_realtime_vcdu_hdr(VCDU* vcdu, +void AOSTF_setup_realtime_vcdu_hdr(AOSTF* vcdu, uint32_t counter) { - VCDU_set_common_hdr_(vcdu); - VCDU_set_vcid(vcdu, VCDU_VCID_REALTIME); - VCDU_set_vcdu_counter(vcdu, counter); + AOSTF_set_common_hdr_(vcdu); + AOSTF_set_vcid(vcdu, AOSTF_VCID_REALTIME); + AOSTF_set_vcdu_counter(vcdu, counter); } -void VCDU_setup_replay_vcdu_hdr(VCDU* vcdu, +void AOSTF_setup_replay_vcdu_hdr(AOSTF* vcdu, uint32_t counter) { - VCDU_set_common_hdr_(vcdu); - VCDU_set_replay_flag(vcdu, VCDU_REPLAY_TRUE); - VCDU_set_vcid(vcdu, VCDU_VCID_REPLAY); - VCDU_set_vcdu_counter(vcdu, counter); + AOSTF_set_common_hdr_(vcdu); + AOSTF_set_replay_flag(vcdu, AOSTF_REPLAY_TRUE); + AOSTF_set_vcid(vcdu, AOSTF_VCID_REPLAY); + AOSTF_set_vcdu_counter(vcdu, counter); } -static void VCDU_set_common_hdr_(VCDU* vcdu) +static void AOSTF_set_common_hdr_(AOSTF* vcdu) { - VCDU_set_ver(vcdu, VCDU_VER_2); - VCDU_set_scid(vcdu, VCDU_SCID_SAMPLE_SATELLITE); // FIXME: 仮 - VCDU_set_replay_flag(vcdu, VCDU_REPLAY_FALSE); - VCDU_clear_spare_(vcdu); + AOSTF_set_ver(vcdu, AOSTF_VER_2); + AOSTF_set_scid(vcdu, AOSTF_SCID_SAMPLE_SATELLITE); // FIXME: 仮 + AOSTF_set_replay_flag(vcdu, AOSTF_REPLAY_FALSE); + AOSTF_clear_spare_(vcdu); } -static void VCDU_clear_spare_(VCDU* vcdu) +static void AOSTF_clear_spare_(AOSTF* vcdu) { unsigned int pos = 5; uint8_t mask = 0x7f; // 01111111b @@ -58,25 +58,25 @@ static void VCDU_clear_spare_(VCDU* vcdu) vcdu->header[pos] &= (uint8_t)(~mask); } -VCDU_VER VCDU_get_ver(const VCDU* vcdu) +AOSTF_VER AOSTF_get_ver(const AOSTF* vcdu) { unsigned int pos = 0; uint8_t mask = 0xc0; // 11000000b - VCDU_VER ver = (VCDU_VER)((vcdu->header[pos] & mask) >> 6); + AOSTF_VER ver = (AOSTF_VER)((vcdu->header[pos] & mask) >> 6); switch (ver) { - case VCDU_VER_2: + case AOSTF_VER_2: return ver; default: - return VCDU_VER_UNKNOWN; + return AOSTF_VER_UNKNOWN; } } -void VCDU_set_ver(VCDU* vcdu, - VCDU_VER ver) +void AOSTF_set_ver(AOSTF* vcdu, + AOSTF_VER ver) { unsigned int pos = 0; uint8_t mask = 0xc0; // 11000000b @@ -86,7 +86,7 @@ void VCDU_set_ver(VCDU* vcdu, vcdu->header[pos] |= val; } -VCDU_SCID VCDU_get_scdi(const VCDU* vcdu) +AOSTF_SCID AOSTF_get_scdi(const AOSTF* vcdu) { unsigned int pos = 0; uint8_t mask1 = 0x3f; // 00111111b @@ -98,16 +98,16 @@ VCDU_SCID VCDU_get_scdi(const VCDU* vcdu) switch (scid) { - case VCDU_SCID_SAMPLE_SATELLITE: - return (VCDU_SCID)scid; + case AOSTF_SCID_SAMPLE_SATELLITE: + return (AOSTF_SCID)scid; default: - return VCDU_SCID_UNKNOWN; + return AOSTF_SCID_UNKNOWN; } } -void VCDU_set_scid(VCDU* vcdu, - VCDU_SCID scid) +void AOSTF_set_scid(AOSTF* vcdu, + AOSTF_SCID scid) { unsigned int pos = 0; uint8_t mask1 = 0x3f; // 00111111b @@ -119,27 +119,27 @@ void VCDU_set_scid(VCDU* vcdu, vcdu->header[pos + 1] |= (uint8_t)((scid << 6) & mask2); } -VCDU_VCID VCDU_get_vcid(const VCDU* vcdu) +AOSTF_VCID AOSTF_get_vcid(const AOSTF* vcdu) { unsigned int pos = 1; uint8_t mask = 0x3f; // 00111111b - VCDU_VCID vcid = (VCDU_VCID)(vcdu->header[pos] & mask); + AOSTF_VCID vcid = (AOSTF_VCID)(vcdu->header[pos] & mask); switch (vcid) { - case VCDU_VCID_REALTIME: // FALLTHROUGH - case VCDU_VCID_REPLAY: // FALLTHROUGH - case VCDU_VCID_FILL: // FALLTHROUGH + case AOSTF_VCID_REALTIME: // FALLTHROUGH + case AOSTF_VCID_REPLAY: // FALLTHROUGH + case AOSTF_VCID_FILL: // FALLTHROUGH return vcid; default: - return VCDU_VCID_UNKNOWN; + return AOSTF_VCID_UNKNOWN; } } -void VCDU_set_vcid(VCDU* vcdu, - VCDU_VCID vcid) +void AOSTF_set_vcid(AOSTF* vcdu, + AOSTF_VCID vcid) { unsigned int pos = 1; uint8_t mask = 0x3f; // 00111111b @@ -148,7 +148,7 @@ void VCDU_set_vcid(VCDU* vcdu, vcdu->header[pos] |= (uint8_t)(vcid & mask); } -uint32_t VCDU_get_vcdu_counter(const VCDU* vcdu) +uint32_t AOSTF_get_vcdu_counter(const AOSTF* vcdu) { unsigned int pos = 2; @@ -161,7 +161,7 @@ uint32_t VCDU_get_vcdu_counter(const VCDU* vcdu) return counter; } -void VCDU_set_vcdu_counter(VCDU* vcdu, +void AOSTF_set_vcdu_counter(AOSTF* vcdu, uint32_t counter) { unsigned int pos = 2; @@ -171,16 +171,16 @@ void VCDU_set_vcdu_counter(VCDU* vcdu, vcdu->header[pos + 2] = (uint8_t)(counter & 0xff); } -VCDU_REPLAY_FLAG VCDU_get_replay_flag(const VCDU* vcdu) +AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* vcdu) { unsigned int pos = 5; uint8_t mask = 0x80; // 10000000b - return (VCDU_REPLAY_FLAG)((vcdu->header[pos] & mask) >> 7); + return (AOSTF_REPLAY_FLAG)((vcdu->header[pos] & mask) >> 7); } -void VCDU_set_replay_flag(VCDU* vcdu, - VCDU_REPLAY_FLAG flag) +void AOSTF_set_replay_flag(AOSTF* vcdu, + AOSTF_REPLAY_FLAG flag) { unsigned int pos = 5; uint8_t mask = 0x80; // 10000000b @@ -189,7 +189,7 @@ void VCDU_set_replay_flag(VCDU* vcdu, vcdu->header[pos] |= (uint8_t)((flag << 7) & mask); } -uint32_t VCDU_get_clcw(const VCDU* vcdu) +uint32_t AOSTF_get_clcw(const AOSTF* vcdu) { unsigned int pos = 0; @@ -204,7 +204,7 @@ uint32_t VCDU_get_clcw(const VCDU* vcdu) return clcw; } -void VCDU_set_clcw(VCDU* vcdu, +void AOSTF_set_clcw(AOSTF* vcdu, uint32_t clcw) { unsigned int pos = 0; @@ -215,8 +215,8 @@ void VCDU_set_clcw(VCDU* vcdu, vcdu->trailer[pos + 3] = (uint8_t)(clcw & 0xff); } -uint32_t VCDU_calc_next_counter(uint32_t prev) +uint32_t AOSTF_calc_next_counter(uint32_t prev) { - return (prev + 1) % VCDU_COUNTER_MAX; + return (prev + 1) % AOSTF_COUNTER_MAX; } #pragma section diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h index 701da1c4d..ae8be6332 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h @@ -1,87 +1,87 @@ -#ifndef VCDU_H_ -#define VCDU_H_ +#ifndef AOSTF_H_ +#define AOSTF_H_ #include "m_pdu.h" -#define VCDU_HEADER_SIZE (6u) -#define VCDU_TRAILER_SIZE (4u) -#define VCDU_LEN (VCDU_HEADER_SIZE + M_PDU_LEN + VCDU_TRAILER_SIZE) -#define VCDU_COUNTER_MAX (0x01000000) // 24bit長 +#define AOSTF_HEADER_SIZE (6u) +#define AOSTF_TRAILER_SIZE (4u) +#define AOSTF_LEN (AOSTF_HEADER_SIZE + M_PDU_LEN + AOSTF_TRAILER_SIZE) +#define AOSTF_COUNTER_MAX (0x01000000) // 24bit長 typedef struct { - uint8_t header[VCDU_HEADER_SIZE]; + uint8_t header[AOSTF_HEADER_SIZE]; M_PDU m_pdu; - uint8_t trailer[VCDU_TRAILER_SIZE]; -} VCDU; + uint8_t trailer[AOSTF_TRAILER_SIZE]; +} AOSTF; typedef enum { - VCDU_VER_2 = 1, // 01b: Version2 - VCDU_VER_UNKNOWN -} VCDU_VER; + AOSTF_VER_2 = 1, // 01b: Version2 + AOSTF_VER_UNKNOWN +} AOSTF_VER; typedef enum { - VCDU_SCID_SAMPLE_SATELLITE = 0x00, - VCDU_SCID_UNKNOWN -} VCDU_SCID; + AOSTF_SCID_SAMPLE_SATELLITE = 0x00, + AOSTF_SCID_UNKNOWN +} AOSTF_SCID; typedef enum { - VCDU_VCID_REALTIME = 0x01, // 000001b: Realtime Transfer Frame - VCDU_VCID_REPLAY = 0x02, // 000010b: Stored Transfer Frame - VCDU_VCID_FILL = 0x3f, // 111111b: Fill Transfer Frame - VCDU_VCID_UNKNOWN -} VCDU_VCID; + AOSTF_VCID_REALTIME = 0x01, // 000001b: Realtime Transfer Frame + AOSTF_VCID_REPLAY = 0x02, // 000010b: Stored Transfer Frame + AOSTF_VCID_FILL = 0x3f, // 111111b: Fill Transfer Frame + AOSTF_VCID_UNKNOWN +} AOSTF_VCID; typedef enum { - VCDU_REPLAY_FALSE = 0, // 0b: Realtime Transfer Frame - VCDU_REPLAY_TRUE = 1 // 1b: Replay Transfer Frame -} VCDU_REPLAY_FLAG; + AOSTF_REPLAY_FALSE = 0, // 0b: Realtime Transfer Frame + AOSTF_REPLAY_TRUE = 1 // 1b: Replay Transfer Frame +} AOSTF_REPLAY_FLAG; -void VCDU_generate_byte_stream(const VCDU* vcdu, - uint8_t byte_stream[VCDU_LEN]); +void AOSTF_generate_byte_stream(const AOSTF* vcdu, + uint8_t byte_stream[AOSTF_LEN]); -void VCDU_setup_fill_vcdu(VCDU* vcdu); +void AOSTF_setup_fill_vcdu(AOSTF* vcdu); -void VCDU_setup_realtime_vcdu_hdr(VCDU* vcdu, +void AOSTF_setup_realtime_vcdu_hdr(AOSTF* vcdu, uint32_t counter); -void VCDU_setup_replay_vcdu_hdr(VCDU* vcdu, +void AOSTF_setup_replay_vcdu_hdr(AOSTF* vcdu, uint32_t counter); -VCDU_VER VCDU_get_ver(const VCDU* vcdu); +AOSTF_VER AOSTF_get_ver(const AOSTF* vcdu); -void VCDU_set_ver(VCDU* vcdu, - VCDU_VER ver); +void AOSTF_set_ver(AOSTF* vcdu, + AOSTF_VER ver); -VCDU_SCID VCDU_get_scdi(const VCDU* vcdu); +AOSTF_SCID AOSTF_get_scdi(const AOSTF* vcdu); -void VCDU_set_scid(VCDU* vcdu, - VCDU_SCID scid); +void AOSTF_set_scid(AOSTF* vcdu, + AOSTF_SCID scid); -VCDU_VCID VCDU_get_vcid(const VCDU* vcdu); +AOSTF_VCID AOSTF_get_vcid(const AOSTF* vcdu); -void VCDU_set_vcid(VCDU* vcdu, - VCDU_VCID vcid); +void AOSTF_set_vcid(AOSTF* vcdu, + AOSTF_VCID vcid); -uint32_t VCDU_get_vcdu_counter(const VCDU* vcdu); +uint32_t AOSTF_get_vcdu_counter(const AOSTF* vcdu); -void VCDU_set_vcdu_counter(VCDU* vcdu, +void AOSTF_set_vcdu_counter(AOSTF* vcdu, uint32_t counter); -VCDU_REPLAY_FLAG VCDU_get_replay_flag(const VCDU* vcdu); +AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* vcdu); -void VCDU_set_replay_flag(VCDU* vcdu, - VCDU_REPLAY_FLAG flag); +void AOSTF_set_replay_flag(AOSTF* vcdu, + AOSTF_REPLAY_FLAG flag); -uint32_t VCDU_get_clcw(const VCDU* vcdu); +uint32_t AOSTF_get_clcw(const AOSTF* vcdu); -void VCDU_set_clcw(VCDU* vcdu, +void AOSTF_set_clcw(AOSTF* vcdu, uint32_t clcw); -uint32_t VCDU_calc_next_counter(uint32_t prev); +uint32_t AOSTF_calc_next_counter(uint32_t prev); -#endif // VCDU_H_ +#endif // AOSTF_H_ diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c index 2622c61c7..d2fccd9c9 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c @@ -15,7 +15,7 @@ void T2M_initialize(TcpToMPdu* tcp_to_m_pdu) tcp_to_m_pdu->m_pdu_wp = 0; tcp_to_m_pdu->fhp_valid = 0; // 強制送出待ち時間の初期値は10秒 - // 32kbpsなら8VCDU/secの送信能力 + // 32kbpsなら8AOSTF/secの送信能力 tcp_to_m_pdu->flush_interval = OBCT_sec2cycle(10); // 最終更新時刻は現在時刻に設定 tcp_to_m_pdu->last_updated = TMGR_get_master_total_cycle(); diff --git a/examples/mobc/tlm-cmd-db/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv b/examples/mobc/tlm-cmd-db/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv index 6e275f424..225a128d0 100644 --- a/examples/mobc/tlm-cmd-db/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv +++ b/examples/mobc/tlm-cmd-db/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv @@ -160,8 +160,8 @@ Comment,,,,,Type,Description,Type,Description,Type,Description,Type,Description, **,,,,,,,,,,,,,,,,,,,, * CDH,GS用,,,,,,,,,,,,,,,,,,, ,CSRV_GS_DRIVER_RESET,OBC,0x0100,0,,,,,,,,,,,,,,,GS ドライバの初期化, -,CSRV_GS_SET_RT_FLUSH_INTERVAL,OBC,0x0101,1,uint32_t,排出間隔,,,,,,,,,,,,,RT VCDUの排出間隔設定, -,CSRV_GS_SET_RP_FLUSH_INTERVAL,OBC,0x0102,1,uint32_t,排出間隔,,,,,,,,,,,,,RP VCDUの排出間隔設定, +,CSRV_GS_SET_RT_FLUSH_INTERVAL,OBC,0x0101,1,uint32_t,排出間隔,,,,,,,,,,,,,RT AOSTFの排出間隔設定, +,CSRV_GS_SET_RP_FLUSH_INTERVAL,OBC,0x0102,1,uint32_t,排出間隔,,,,,,,,,,,,,RP AOSTFの排出間隔設定, ,CSRV_GS_SET_FARM_PW,OBC,0x0103,1,uint8_t,positive_window_width,,,,,,,,,,,,,FARM-1のPositive Window Width設定, ,CSRV_GS_SET_INFO,OBC,0x0104,1,uint8_t,TLM選択,,,,,,,,,,,,,GS送信TLMが0ならCCSDSに@@ 1ならUARTの情報が出てくる, ,CSRV_GS_CCSDS_GET_BUFFER,OBC,0x0105,0,,,,,,,,,,,,,,,, diff --git a/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv b/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv index 766d8c619..13e4e7400 100644 --- a/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv +++ b/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv @@ -31,7 +31,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,CCSDS.TCTF.BD_REC_STATUS,uint8_t,(uint8_t)gs_driver->info[0].rx.tctf.bd_rec_status,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,0=SUCCESS@@ 1=TCTF_VER@@ 2=TCTF_SCID@@ 3=TCTF_VCID@@ 4=TCTF_TYPE@@ 5=LOCKOUT@@ 6=TCTF_SEQ_FLAG@@ 7=TCP_VER@@ 8=TCP_2ND_HDR_FLAG@@ 9=APID@@ 10=TCP_TYPE_IS_NOT_CMD@@ 11=TCP_SEQ_IS_NOTE_SINGLE@@ 12=FECW_MISSMATCH@@ 13=FARM1_PWA@@ 14=FARM1_NWA@@ 15=FARM1_LOCKOUT_AREA@@ 16=FARM1_SAME_NUMBER@@ 17=INVALID_BC_CMD,, ,CCSDS.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[0].tx.send_cycle,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,CCSDS.TX.VCID,uint8_t,(uint8_t)gs_driver->info[0].tx.vcid,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, -,CCSDS.TX.VCDU_COUNTER,uint32_t,gs_driver->info[0].tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,CCSDS.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[0].tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,CCSDS.TX.BUFFER_NUM,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.CH,uint8_t,gs_driver->driver_uart.uart_config.ch,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.BAUDRATE,uint32_t,gs_driver->driver_uart.uart_config.baudrate,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, @@ -49,19 +49,19 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,UART.TCTF.BD_REC_STATUS,uint8_t,(uint8_t)gs_driver->info[1].rx.tctf.bd_rec_status,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,0=SUCCESS@@ 1=TCTF_VER@@ 2=TCTF_SCID@@ 3=TCTF_VCID@@ 4=TCTF_TYPE@@ 5=LOCKOUT@@ 6=TCTF_SEQ_FLAG@@ 7=TCP_VER@@ 8=TCP_2ND_HDR_FLAG@@ 9=APID@@ 10=TCP_TYPE_IS_NOT_CMD@@ 11=TCP_SEQ_IS_NOTE_SINGLE@@ 12=FECW_MISSMATCH@@ 13=FARM1_PWA@@ 14=FARM1_NWA@@ 15=FARM1_LOCKOUT_AREA@@ 16=FARM1_SAME_NUMBER@@ 17=INVALID_BC_CMD,, ,UART.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[1].tx.send_cycle,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.TX.VCID,uint8_t,(uint8_t)gs_driver->info[1].tx.vcid,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, -,UART.TX.VCDU_COUNTER,uint32_t,gs_driver->info[1].tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,UART.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[1].tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.IS_TLM_ON,uint8_t,gs_driver->driver_uart.is_tlm_on,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,0=OFF@@ 1=ON,, ,COP-1.TYPE_A_COUNTER,uint8_t,gs_validate_info->type_a_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,COP-1.TYPE_B_COUNTER,uint8_t,gs_validate_info->type_b_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,COP-1.LOCKOUT_FLAG,uint8_t,gs_validate_info->lockout_flag,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,COP-1.RETRANSMIT_FLAG,uint8_t,gs_validate_info->retransmit_flag,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,COP-1.POSITIVE_WINDOW_WIDTH,uint8_t,gs_validate_info->positive_window_width,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,RT_TLM.VCDU.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,RT_TLM.VCDU.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,RT_TLM.VCDU.COUNTER,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,RP_TLM.VCDU.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,RP_TLM.VCDU.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,RP_TLM.VCDU.COUNTER,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,RT_TLM.AOSTF.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,RT_TLM.AOSTF.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,RT_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,RP_TLM.AOSTF.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,RP_TLM.AOSTF.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,RP_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv b/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv index 635ee25af..bded556cf 100644 --- a/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv +++ b/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv @@ -122,7 +122,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,BCT_CMD_PTR,uint8_t,(uint8_t)(block_command_table->pos.cmd),PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,BCT コマンドポインタ, ,BCT_REGD_TIME,uint32_t,((block_command_table->pos.cmd == 0) ? 0 : (uint32_t)BCT_get_ti(block_command_table->pos.block@@ (uint8_t)(block_command_table->pos.cmd-1))),PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,BCT 登録コマンド時刻,変数指定が大変なことに… ,BCT_REGD_ID,uint16_t,(uint16_t)((block_command_table->pos.cmd == 0) ? 0 : BCT_get_id(block_command_table->pos.block@@ (uint8_t)(block_command_table->pos.cmd-1))),PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,BCT 登録コマンドID,変数指定が大変なことに… -,RT_BUFFER_AVAILABLE,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,CCSDS RT VCDU 使用量, +,RT_BUFFER_AVAILABLE,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,CCSDS RT AOSTF 使用量, ,RT_T2M_FLUSH_INTERVAL,uint32_t,(uint32_t)(CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval),PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,TL0コマンドカウンタ, ,RP_T2M_FLUSH_INTERVAL,uint32_t,(uint32_t)(CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval),PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,TL0コマンドカウンタ, ,RT_TLM_COUNTER,uint32_t,PL_count_executed_nodes(&PH_rt_tlm_list),PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,TL0コマンドカウンタ, @@ -134,7 +134,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,TCI_TX_CYCLE,uint32_t,(uint32_t)gs_driver->latest_info->tx.send_cycle,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻校正情報::送出サイクル, ,TCI_TX_BITRATE,uint32_t,gs_driver->driver_ccsds.ccsds_config.bitrate,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻校正情報::送出ビットレート, ,TCI_VCID,uint8_t,(uint8_t)gs_driver->latest_info->tx.vcid,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻構成情報::送出VCID, -,TCI_VCDU_COUNTER,uint32_t,gs_driver->latest_info->tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻校正情報::送出VCDUカウンタ, +,TCI_AOSTF_COUNTER,uint32_t,gs_driver->latest_info->tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻校正情報::送出AOSTFカウンタ, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv b/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv index 6419ed366..ea3410554 100644 --- a/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv +++ b/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv @@ -31,7 +31,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,CCSDS.TCTF.BD_REC_STATUS,uint8_t,(uint8_t)gs_driver->info[0].rx.tctf.bd_rec_status,PACKET,40,0,8,STATUS,,,,,,,0=SUCCESS@@ 1=TCTF_VER@@ 2=TCTF_SCID@@ 3=TCTF_VCID@@ 4=TCTF_TYPE@@ 5=LOCKOUT@@ 6=TCTF_SEQ_FLAG@@ 7=TCP_VER@@ 8=TCP_2ND_HDR_FLAG@@ 9=APID@@ 10=TCP_TYPE_IS_NOT_CMD@@ 11=TCP_SEQ_IS_NOTE_SINGLE@@ 12=FECW_MISSMATCH@@ 13=FARM1_PWA@@ 14=FARM1_NWA@@ 15=FARM1_LOCKOUT_AREA@@ 16=FARM1_SAME_NUMBER@@ 17=INVALID_BC_CMD,, ,CCSDS.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[0].tx.send_cycle,PACKET,41,0,32,NONE,,,,,,,,, ,CCSDS.TX.VCID,uint8_t,(uint8_t)gs_driver->info[0].tx.vcid,PACKET,45,0,8,STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, -,CCSDS.TX.VCDU_COUNTER,uint32_t,gs_driver->info[0].tx.vcdu_counter,PACKET,46,0,32,NONE,,,,,,,,, +,CCSDS.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[0].tx.vcdu_counter,PACKET,46,0,32,NONE,,,,,,,,, ,CCSDS.TX.BUFFER_NUM,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,50,0,8,NONE,,,,,,,,, ,UART.CH,uint8_t,gs_driver->driver_uart.uart_config.ch,PACKET,51,0,8,NONE,,,,,,,,, ,UART.BAUDRATE,uint32_t,gs_driver->driver_uart.uart_config.baudrate,PACKET,52,0,32,NONE,,,,,,,,, @@ -49,19 +49,19 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,UART.TCTF.BD_REC_STATUS,uint8_t,(uint8_t)gs_driver->info[1].rx.tctf.bd_rec_status,PACKET,73,0,8,STATUS,,,,,,,0=SUCCESS@@ 1=TCTF_VER@@ 2=TCTF_SCID@@ 3=TCTF_VCID@@ 4=TCTF_TYPE@@ 5=LOCKOUT@@ 6=TCTF_SEQ_FLAG@@ 7=TCP_VER@@ 8=TCP_2ND_HDR_FLAG@@ 9=APID@@ 10=TCP_TYPE_IS_NOT_CMD@@ 11=TCP_SEQ_IS_NOTE_SINGLE@@ 12=FECW_MISSMATCH@@ 13=FARM1_PWA@@ 14=FARM1_NWA@@ 15=FARM1_LOCKOUT_AREA@@ 16=FARM1_SAME_NUMBER@@ 17=INVALID_BC_CMD,, ,UART.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[1].tx.send_cycle,PACKET,74,0,32,NONE,,,,,,,,, ,UART.TX.VCID,uint8_t,(uint8_t)gs_driver->info[1].tx.vcid,PACKET,78,0,8,STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, -,UART.TX.VCDU_COUNTER,uint32_t,gs_driver->info[1].tx.vcdu_counter,PACKET,79,0,32,NONE,,,,,,,,, +,UART.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[1].tx.vcdu_counter,PACKET,79,0,32,NONE,,,,,,,,, ,UART.IS_TLM_ON,uint8_t,gs_driver->driver_uart.is_tlm_on,PACKET,83,0,8,STATUS,,,,,,,0=OFF@@ 1=ON,, ,COP-1.TYPE_A_COUNTER,uint8_t,gs_validate_info->type_a_counter,PACKET,84,0,8,NONE,,,,,,,,, ,COP-1.TYPE_B_COUNTER,uint8_t,gs_validate_info->type_b_counter,PACKET,85,0,8,NONE,,,,,,,,, ,COP-1.LOCKOUT_FLAG,uint8_t,gs_validate_info->lockout_flag,PACKET,86,0,8,NONE,,,,,,,,, ,COP-1.RETRANSMIT_FLAG,uint8_t,gs_validate_info->retransmit_flag,PACKET,87,0,8,NONE,,,,,,,,, ,COP-1.POSITIVE_WINDOW_WIDTH,uint8_t,gs_validate_info->positive_window_width,PACKET,88,0,8,NONE,,,,,,,,, -,RT_TLM.VCDU.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,89,0,32,NONE,,,,,,,,, -,RT_TLM.VCDU.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,93,0,32,NONE,,,,,,,,, -,RT_TLM.VCDU.COUNTER,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->vcdu_counter,PACKET,97,0,32,NONE,,,,,,,,, -,RP_TLM.VCDU.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,101,0,32,NONE,,,,,,,,, -,RP_TLM.VCDU.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,105,0,32,NONE,,,,,,,,, -,RP_TLM.VCDU.COUNTER,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->vcdu_counter,PACKET,109,0,32,NONE,,,,,,,,, +,RT_TLM.AOSTF.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,89,0,32,NONE,,,,,,,,, +,RT_TLM.AOSTF.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,93,0,32,NONE,,,,,,,,, +,RT_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->vcdu_counter,PACKET,97,0,32,NONE,,,,,,,,, +,RP_TLM.AOSTF.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,101,0,32,NONE,,,,,,,,, +,RP_TLM.AOSTF.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,105,0,32,NONE,,,,,,,,, +,RP_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->vcdu_counter,PACKET,109,0,32,NONE,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv b/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv index 2794564b0..0118ee27d 100644 --- a/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv +++ b/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv @@ -122,7 +122,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,BCT_CMD_PTR,uint8_t,(uint8_t)(block_command_table->pos.cmd),PACKET,291,0,8,NONE,,,,,,,,BCT コマンドポインタ, ,BCT_REGD_TIME,uint32_t,((block_command_table->pos.cmd == 0) ? 0 : (uint32_t)BCT_get_ti(block_command_table->pos.block@@ (uint8_t)(block_command_table->pos.cmd-1))),PACKET,292,0,32,NONE,,,,,,,,BCT 登録コマンド時刻,変数指定が大変なことに… ,BCT_REGD_ID,uint16_t,(uint16_t)((block_command_table->pos.cmd == 0) ? 0 : BCT_get_id(block_command_table->pos.block@@ (uint8_t)(block_command_table->pos.cmd-1))),PACKET,296,0,16,NONE,,,,,,,,BCT 登録コマンドID,変数指定が大変なことに… -,RT_BUFFER_AVAILABLE,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,298,0,8,NONE,,,,,,,,CCSDS RT VCDU 使用量, +,RT_BUFFER_AVAILABLE,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,298,0,8,NONE,,,,,,,,CCSDS RT AOSTF 使用量, ,RT_T2M_FLUSH_INTERVAL,uint32_t,(uint32_t)(CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval),PACKET,299,0,32,NONE,,,,,,,,TL0コマンドカウンタ, ,RP_T2M_FLUSH_INTERVAL,uint32_t,(uint32_t)(CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval),PACKET,303,0,32,NONE,,,,,,,,TL0コマンドカウンタ, ,RT_TLM_COUNTER,uint32_t,PL_count_executed_nodes(&PH_rt_tlm_list),PACKET,307,0,32,NONE,,,,,,,,TL0コマンドカウンタ, @@ -134,7 +134,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,TCI_TX_CYCLE,uint32_t,(uint32_t)gs_driver->latest_info->tx.send_cycle,PACKET,322,0,32,NONE,,,,,,,,時刻校正情報::送出サイクル, ,TCI_TX_BITRATE,uint32_t,gs_driver->driver_ccsds.ccsds_config.bitrate,PACKET,326,0,32,NONE,,,,,,,,時刻校正情報::送出ビットレート, ,TCI_VCID,uint8_t,(uint8_t)gs_driver->latest_info->tx.vcid,PACKET,330,0,8,NONE,,,,,,,,時刻構成情報::送出VCID, -,TCI_VCDU_COUNTER,uint32_t,gs_driver->latest_info->tx.vcdu_counter,PACKET,331,0,32,NONE,,,,,,,,時刻校正情報::送出VCDUカウンタ, +,TCI_AOSTF_COUNTER,uint32_t,gs_driver->latest_info->tx.vcdu_counter,PACKET,331,0,32,NONE,,,,,,,,時刻校正情報::送出AOSTFカウンタ, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/tlm_cmd/ccsds/space_packet_typedef.h b/tlm_cmd/ccsds/space_packet_typedef.h index 5832bc674..621c136d1 100644 --- a/tlm_cmd/ccsds/space_packet_typedef.h +++ b/tlm_cmd/ccsds/space_packet_typedef.h @@ -8,7 +8,7 @@ #include -#define TSP_MAX_LEN (432) //!< TlmSpacePacket の最大パケット長.VCDU 分割しないならこれが最大値 +#define TSP_MAX_LEN (432) //!< TlmSpacePacket の最大パケット長.AOSTF 分割しないならこれが最大値 #define CSP_MAX_LEN (128) //!< CmdSpacePacket の最大パケット長.値は適当においている // TSP_MAX_LEN, CSP_MAX_LEN を再定義 diff --git a/tlm_cmd/telemetry_generator.c b/tlm_cmd/telemetry_generator.c index f7a55853a..ab92656f4 100644 --- a/tlm_cmd/telemetry_generator.c +++ b/tlm_cmd/telemetry_generator.c @@ -72,7 +72,7 @@ CCP_CmdRet Cmd_GENERATE_TLM(const CommonCmdPacket* packet) if (num_dumps >= 8) { // パケット生成回数の上限は8回とする。 - // 32kbpsでのDL時に8VCDU/secで1秒分の通信量。 + // 32kbpsでのDL時に8AOSTF/secで1秒分の通信量。 // これを超える場合は複数回コマンドを送信して対応する。 return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); } @@ -224,7 +224,7 @@ static CCP_CmdRet TG_generate_tlm_(TLM_CODE tlm_id, { // FIXME: 要検討? // パケット生成回数の上限は 8 回とする。 - // 32 kbpsでの DL 時に 8 VCDU / sec で 1 秒分の通信量。 + // 32 kbpsでの DL 時に 8 AOSTF / sec で 1 秒分の通信量。 // これを超える場合は複数回コマンドを送信して対応する。 return CCP_make_cmd_ret(CCP_EXEC_ILLEGAL_PARAMETER, TLM_CODE_MAX); } From 56c0502ad54caac8d6a9065dcb6fdbd6e913f3e9 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 8 Nov 2023 21:51:30 +0900 Subject: [PATCH 05/87] sed vcdu to aostf --- .../applications/component_service/csrv_gs.c | 20 +-- .../applications/component_service/csrv_gs.h | 6 +- .../src/src_user/component_driver/com/gs.c | 22 +-- .../src/src_user/component_driver/com/gs.h | 8 +- .../tlm_cmd/ccsds/aos_transfer_frame.c | 136 +++++++++--------- .../tlm_cmd/ccsds/aos_transfer_frame.h | 32 ++--- .../mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c | 4 +- .../src_user/tlm_cmd/telemetry_definitions.c | 10 +- .../TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv | 8 +- .../TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv | 2 +- .../calced_data/SAMPLE_MOBC_TLM_DB_GS.csv | 8 +- .../calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv | 2 +- 12 files changed, 129 insertions(+), 129 deletions(-) diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.c b/examples/mobc/src/src_user/applications/component_service/csrv_gs.c index d4bda3267..1b06015ed 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.c +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.c @@ -123,21 +123,21 @@ static RESULT CSRV_GS_rt_tlm_packet_handler_app_(void) { T2M_ACK ack = T2M_form_m_pdu(&CSRV_GS_rt_tlm_packet_handler_.tc_packet_to_m_pdu, &PH_rt_tlm_list, - &CSRV_GS_rt_tlm_packet_handler_.vcdu.m_pdu); + &CSRV_GS_rt_tlm_packet_handler_.aostf.m_pdu); if (ack != T2M_SUCCESS) return RESULT_OK; // Realtime AOSTF カウンタの設定 - AOSTF_setup_realtime_vcdu_hdr(&CSRV_GS_rt_tlm_packet_handler_.vcdu, CSRV_GS_rt_tlm_packet_handler_.vcdu_counter); - CSRV_GS_rt_tlm_packet_handler_.vcdu_counter = AOSTF_calc_next_counter(CSRV_GS_rt_tlm_packet_handler_.vcdu_counter); + AOSTF_setup_realtime_aostf_hdr(&CSRV_GS_rt_tlm_packet_handler_.aostf, CSRV_GS_rt_tlm_packet_handler_.aostf_counter); + CSRV_GS_rt_tlm_packet_handler_.aostf_counter = AOSTF_calc_next_counter(CSRV_GS_rt_tlm_packet_handler_.aostf_counter); // CLCW の設定 // CMD の VCID と TLM の VCID は独立で関係がない // TLM の VCID 種別(Realtime, Replay)によらず CLCW を設定して良い // CLCW が対応する CMD の VCID は CLCW の内部で指定される - AOSTF_set_clcw(&CSRV_GS_rt_tlm_packet_handler_.vcdu, GS_form_clcw()); + AOSTF_set_clcw(&CSRV_GS_rt_tlm_packet_handler_.aostf, GS_form_clcw()); // 完成した AOSTF を RT AOSTF として送出 - GS_send_vcdu(&gs_driver_, &CSRV_GS_rt_tlm_packet_handler_.vcdu); + GS_send_aostf(&gs_driver_, &CSRV_GS_rt_tlm_packet_handler_.aostf); } return RESULT_OK; @@ -158,21 +158,21 @@ static RESULT CSRV_GS_rp_tlm_packet_handler_app_(void) { T2M_ACK ack = T2M_form_m_pdu(&CSRV_GS_rp_tlm_packet_handler_.tc_packet_to_m_pdu, &PH_rp_tlm_list, - &CSRV_GS_rp_tlm_packet_handler_.vcdu.m_pdu); + &CSRV_GS_rp_tlm_packet_handler_.aostf.m_pdu); if (ack != T2M_SUCCESS) return RESULT_OK; // Replay AOSTF カウンタの設定 - AOSTF_setup_replay_vcdu_hdr(&CSRV_GS_rp_tlm_packet_handler_.vcdu, CSRV_GS_rp_tlm_packet_handler_.vcdu_counter); - CSRV_GS_rp_tlm_packet_handler_.vcdu_counter = AOSTF_calc_next_counter(CSRV_GS_rp_tlm_packet_handler_.vcdu_counter); + AOSTF_setup_replay_aostf_hdr(&CSRV_GS_rp_tlm_packet_handler_.aostf, CSRV_GS_rp_tlm_packet_handler_.aostf_counter); + CSRV_GS_rp_tlm_packet_handler_.aostf_counter = AOSTF_calc_next_counter(CSRV_GS_rp_tlm_packet_handler_.aostf_counter); // CLCW の設定 // CMD の VCIDと TLM の VCID は独立で関係がない // TLM の VCID 種別(Realtime, Replay) によらず CLCW を設定して良い // CLCW が対応する CMD の VCID は CLCW の内部で指定される - AOSTF_set_clcw(&CSRV_GS_rp_tlm_packet_handler_.vcdu, GS_form_clcw()); + AOSTF_set_clcw(&CSRV_GS_rp_tlm_packet_handler_.aostf, GS_form_clcw()); // 完成した AOSTF を RP AOSTF として送出 - GS_send_vcdu(&gs_driver_, &CSRV_GS_rp_tlm_packet_handler_.vcdu); + GS_send_aostf(&gs_driver_, &CSRV_GS_rp_tlm_packet_handler_.aostf); } return RESULT_OK; diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h index 249783b5a..c1b684bd3 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h @@ -9,7 +9,7 @@ #include "../../component_driver/com/gs.h" #include "../../tlm_cmd/ccsds/tcp_to_m_pdu.h" -#include "../../tlm_cmd/ccsds/vcdu.h" +#include "../../tlm_cmd/ccsds/aostf.h" #include /** @@ -19,8 +19,8 @@ typedef struct { TcpToMPdu tc_packet_to_m_pdu; //!< PL から取り出した tc_packet を M_PDU に変換する - AOSTF vcdu; //!< 送信するAOSTF - uint32_t vcdu_counter; //!< AOSTF counter + AOSTF aostf; //!< 送信するAOSTF + uint32_t aostf_counter; //!< AOSTF counter } CSRV_GS_TlmPacketHandler; extern const GS_Driver* const gs_driver; diff --git a/examples/mobc/src/src_user/component_driver/com/gs.c b/examples/mobc/src/src_user/component_driver/com/gs.c index 14a0bd867..ede3aeba9 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.c +++ b/examples/mobc/src/src_user/component_driver/com/gs.c @@ -115,7 +115,7 @@ CDS_INIT_ERR_CODE GS_init(GS_Driver* gs_driver, gs_driver->info[i].tx.send_cycle = 0; gs_driver->info[i].tx.vcid = AOSTF_VCID_UNKNOWN; - gs_driver->info[i].tx.vcdu_counter = 0; + gs_driver->info[i].tx.aostf_counter = 0; } gs_driver->ccsds_info.buffer_num = 8; @@ -254,21 +254,21 @@ static CDS_ERR_CODE GS_analyze_rec_data_(CDS_StreamConfig* p_stream_config, void return CDS_ERR_CODE_OK; } -CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const AOSTF* vcdu) +CDS_CMD_ERR_CODE GS_send_aostf(GS_Driver* gs_driver, const AOSTF* aostf) { CDS_ERR_CODE ret_ccsds = CDS_ERR_CODE_OK; CDS_ERR_CODE ret_uart = CDS_ERR_CODE_OK; - size_t vcdu_size = sizeof(AOSTF); + size_t aostf_size = sizeof(AOSTF); // パディングが無ければ元を GS_tx_frame_ にコピーさせる (444Byte) のコピーが無駄 - if (vcdu_size == AOSTF_LEN) + if (aostf_size == AOSTF_LEN) { - CDSSC_set_tx_frame(&gs_driver->driver_ccsds.super.stream_config[GS_TX_STREAM], (uint8_t*)vcdu); - CDSSC_set_tx_frame(&gs_driver->driver_uart.super.stream_config[GS_TX_STREAM], (uint8_t*)vcdu); + CDSSC_set_tx_frame(&gs_driver->driver_ccsds.super.stream_config[GS_TX_STREAM], (uint8_t*)aostf); + CDSSC_set_tx_frame(&gs_driver->driver_uart.super.stream_config[GS_TX_STREAM], (uint8_t*)aostf); } else { - AOSTF_generate_byte_stream(vcdu, GS_tx_frame_); // 送信元にセット 消したいなぁ... + AOSTF_generate_byte_stream(aostf, GS_tx_frame_); // 送信元にセット 消したいなぁ... CDSSC_set_tx_frame(&gs_driver->driver_ccsds.super.stream_config[GS_TX_STREAM], GS_tx_frame_); CDSSC_set_tx_frame(&gs_driver->driver_uart.super.stream_config[GS_TX_STREAM], GS_tx_frame_); } @@ -278,8 +278,8 @@ CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const AOSTF* vcdu) if (gs_driver->ccsds_info.buffer_num) { gs_driver->info[GS_PORT_TYPE_CCSDS].tx.send_cycle = TMGR_get_master_total_cycle(); - gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcid = AOSTF_get_vcid(vcdu); - gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcdu_counter = AOSTF_get_vcdu_counter(vcdu); + gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcid = AOSTF_get_vcid(aostf); + gs_driver->info[GS_PORT_TYPE_CCSDS].tx.aostf_counter = AOSTF_get_aostf_counter(aostf); // DS 側の名称が cmd なだけで送信しているのは TLM ret_ccsds = CDS_send_general_cmd(&gs_driver->driver_ccsds.super, GS_TX_STREAM); @@ -289,8 +289,8 @@ CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const AOSTF* vcdu) if (gs_driver->driver_uart.is_tlm_on) { gs_driver->info[GS_PORT_TYPE_UART].tx.send_cycle = TMGR_get_master_total_cycle(); - gs_driver->info[GS_PORT_TYPE_UART].tx.vcid = AOSTF_get_vcid(vcdu); - gs_driver->info[GS_PORT_TYPE_UART].tx.vcdu_counter = AOSTF_get_vcdu_counter(vcdu); + gs_driver->info[GS_PORT_TYPE_UART].tx.vcid = AOSTF_get_vcid(aostf); + gs_driver->info[GS_PORT_TYPE_UART].tx.aostf_counter = AOSTF_get_aostf_counter(aostf); // DS 側の名称が cmd なだけで送信しているのは TLM ret_uart = CDS_send_general_cmd(&gs_driver->driver_uart.super, GS_TX_STREAM); diff --git a/examples/mobc/src/src_user/component_driver/com/gs.h b/examples/mobc/src/src_user/component_driver/com/gs.h index fa4c7b697..c58929247 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.h +++ b/examples/mobc/src/src_user/component_driver/com/gs.h @@ -10,7 +10,7 @@ #include #include #include "../../hal/ccsds_user.h" -#include "../../tlm_cmd/ccsds/vcdu.h" +#include "../../tlm_cmd/ccsds/aostf.h" #include "gs_validate.h" #define GS_RX_HEADER_NUM (3) @@ -54,7 +54,7 @@ typedef struct { cycle_t send_cycle; //!< 最後に送信したときの時刻 AOSTF_VCID vcid; //!< 送信した TLM のタイプ - uint32_t vcdu_counter; //!< AOSTF counter + uint32_t aostf_counter; //!< AOSTF counter } tx; } GS_Info; @@ -110,9 +110,9 @@ CDS_REC_ERR_CODE GS_rec_tctf(GS_Driver* gs_driver); * @note CDS_send_general_cmd が使われているが, これは DS は MOBC コンポ間を想定しているため, MOBC から見るとコンポに cmd を送信している様に見える, が 今回は MOBC から地上に TLM を送信している * @note TLM 送信, 形式は AOSTF * @param[in] gs_driver: ドライバー - * @param[in] vcdu: 送信する AOSTF. 場合によってはそのまま DS に渡すので, local変数ではなくstaticな変数を渡すこと + * @param[in] aostf: 送信する AOSTF. 場合によってはそのまま DS に渡すので, local変数ではなくstaticな変数を渡すこと * @return CDS_CMD_ERR_CODE: 送信結果 */ -CDS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const AOSTF* vcdu); +CDS_CMD_ERR_CODE GS_send_aostf(GS_Driver* gs_driver, const AOSTF* aostf); #endif diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c index 7d63e00af..479001548 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c @@ -1,69 +1,69 @@ #pragma section REPRO -#include "vcdu.h" +#include "aostf.h" #include // for memcpy -static void AOSTF_set_common_hdr_(AOSTF* vcdu); -static void AOSTF_clear_spare_(AOSTF* vcdu); +static void AOSTF_set_common_hdr_(AOSTF* aostf); +static void AOSTF_clear_spare_(AOSTF* aostf); -void AOSTF_generate_byte_stream(const AOSTF* vcdu, +void AOSTF_generate_byte_stream(const AOSTF* aostf, uint8_t byte_stream[AOSTF_LEN]) { - memcpy(byte_stream, vcdu->header, AOSTF_HEADER_SIZE); + memcpy(byte_stream, aostf->header, AOSTF_HEADER_SIZE); byte_stream += AOSTF_HEADER_SIZE; - M_PDU_generate_byte_stream(&(vcdu->m_pdu), byte_stream); + M_PDU_generate_byte_stream(&(aostf->m_pdu), byte_stream); byte_stream += M_PDU_LEN; - memcpy(byte_stream, vcdu->trailer, AOSTF_TRAILER_SIZE); + memcpy(byte_stream, aostf->trailer, AOSTF_TRAILER_SIZE); } -void AOSTF_setup_fill_vcdu(AOSTF* vcdu) +void AOSTF_setup_fill_aostf(AOSTF* aostf) { - AOSTF_set_common_hdr_(vcdu); - AOSTF_set_vcid(vcdu, AOSTF_VCID_FILL); - M_PDU_setup_idle_m_pdu(&(vcdu->m_pdu)); + AOSTF_set_common_hdr_(aostf); + AOSTF_set_vcid(aostf, AOSTF_VCID_FILL); + M_PDU_setup_idle_m_pdu(&(aostf->m_pdu)); } -void AOSTF_setup_realtime_vcdu_hdr(AOSTF* vcdu, +void AOSTF_setup_realtime_aostf_hdr(AOSTF* aostf, uint32_t counter) { - AOSTF_set_common_hdr_(vcdu); - AOSTF_set_vcid(vcdu, AOSTF_VCID_REALTIME); - AOSTF_set_vcdu_counter(vcdu, counter); + AOSTF_set_common_hdr_(aostf); + AOSTF_set_vcid(aostf, AOSTF_VCID_REALTIME); + AOSTF_set_aostf_counter(aostf, counter); } -void AOSTF_setup_replay_vcdu_hdr(AOSTF* vcdu, +void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, uint32_t counter) { - AOSTF_set_common_hdr_(vcdu); - AOSTF_set_replay_flag(vcdu, AOSTF_REPLAY_TRUE); - AOSTF_set_vcid(vcdu, AOSTF_VCID_REPLAY); - AOSTF_set_vcdu_counter(vcdu, counter); + AOSTF_set_common_hdr_(aostf); + AOSTF_set_replay_flag(aostf, AOSTF_REPLAY_TRUE); + AOSTF_set_vcid(aostf, AOSTF_VCID_REPLAY); + AOSTF_set_aostf_counter(aostf, counter); } -static void AOSTF_set_common_hdr_(AOSTF* vcdu) +static void AOSTF_set_common_hdr_(AOSTF* aostf) { - AOSTF_set_ver(vcdu, AOSTF_VER_2); - AOSTF_set_scid(vcdu, AOSTF_SCID_SAMPLE_SATELLITE); // FIXME: 仮 - AOSTF_set_replay_flag(vcdu, AOSTF_REPLAY_FALSE); - AOSTF_clear_spare_(vcdu); + AOSTF_set_ver(aostf, AOSTF_VER_2); + AOSTF_set_scid(aostf, AOSTF_SCID_SAMPLE_SATELLITE); // FIXME: 仮 + AOSTF_set_replay_flag(aostf, AOSTF_REPLAY_FALSE); + AOSTF_clear_spare_(aostf); } -static void AOSTF_clear_spare_(AOSTF* vcdu) +static void AOSTF_clear_spare_(AOSTF* aostf) { unsigned int pos = 5; uint8_t mask = 0x7f; // 01111111b - vcdu->header[pos] &= (uint8_t)(~mask); + aostf->header[pos] &= (uint8_t)(~mask); } -AOSTF_VER AOSTF_get_ver(const AOSTF* vcdu) +AOSTF_VER AOSTF_get_ver(const AOSTF* aostf) { unsigned int pos = 0; uint8_t mask = 0xc0; // 11000000b - AOSTF_VER ver = (AOSTF_VER)((vcdu->header[pos] & mask) >> 6); + AOSTF_VER ver = (AOSTF_VER)((aostf->header[pos] & mask) >> 6); switch (ver) { @@ -75,26 +75,26 @@ AOSTF_VER AOSTF_get_ver(const AOSTF* vcdu) } } -void AOSTF_set_ver(AOSTF* vcdu, +void AOSTF_set_ver(AOSTF* aostf, AOSTF_VER ver) { unsigned int pos = 0; uint8_t mask = 0xc0; // 11000000b uint8_t val = (uint8_t)((ver << 6) & mask); - vcdu->header[pos] &= (uint8_t)(~mask); - vcdu->header[pos] |= val; + aostf->header[pos] &= (uint8_t)(~mask); + aostf->header[pos] |= val; } -AOSTF_SCID AOSTF_get_scdi(const AOSTF* vcdu) +AOSTF_SCID AOSTF_get_scdi(const AOSTF* aostf) { unsigned int pos = 0; uint8_t mask1 = 0x3f; // 00111111b uint8_t mask2 = 0xc0; // 11000000b - int scid = (vcdu->header[pos] & mask1); + int scid = (aostf->header[pos] & mask1); scid <<= 2; - scid |= ((vcdu->header[pos + 1] & mask2) >> 6); + scid |= ((aostf->header[pos + 1] & mask2) >> 6); switch (scid) { @@ -106,25 +106,25 @@ AOSTF_SCID AOSTF_get_scdi(const AOSTF* vcdu) } } -void AOSTF_set_scid(AOSTF* vcdu, +void AOSTF_set_scid(AOSTF* aostf, AOSTF_SCID scid) { unsigned int pos = 0; uint8_t mask1 = 0x3f; // 00111111b uint8_t mask2 = 0xc0; // 11000000b - vcdu->header[pos] &= (uint8_t)(~mask1); - vcdu->header[pos] |= (uint8_t)((scid >> 2) & mask1); - vcdu->header[pos + 1] &= (uint8_t)(~mask2); - vcdu->header[pos + 1] |= (uint8_t)((scid << 6) & mask2); + aostf->header[pos] &= (uint8_t)(~mask1); + aostf->header[pos] |= (uint8_t)((scid >> 2) & mask1); + aostf->header[pos + 1] &= (uint8_t)(~mask2); + aostf->header[pos + 1] |= (uint8_t)((scid << 6) & mask2); } -AOSTF_VCID AOSTF_get_vcid(const AOSTF* vcdu) +AOSTF_VCID AOSTF_get_vcid(const AOSTF* aostf) { unsigned int pos = 1; uint8_t mask = 0x3f; // 00111111b - AOSTF_VCID vcid = (AOSTF_VCID)(vcdu->header[pos] & mask); + AOSTF_VCID vcid = (AOSTF_VCID)(aostf->header[pos] & mask); switch (vcid) { @@ -138,81 +138,81 @@ AOSTF_VCID AOSTF_get_vcid(const AOSTF* vcdu) } } -void AOSTF_set_vcid(AOSTF* vcdu, +void AOSTF_set_vcid(AOSTF* aostf, AOSTF_VCID vcid) { unsigned int pos = 1; uint8_t mask = 0x3f; // 00111111b - vcdu->header[pos] &= (uint8_t)(~mask); - vcdu->header[pos] |= (uint8_t)(vcid & mask); + aostf->header[pos] &= (uint8_t)(~mask); + aostf->header[pos] |= (uint8_t)(vcid & mask); } -uint32_t AOSTF_get_vcdu_counter(const AOSTF* vcdu) +uint32_t AOSTF_get_aostf_counter(const AOSTF* aostf) { unsigned int pos = 2; - uint32_t counter = vcdu->header[pos]; + uint32_t counter = aostf->header[pos]; counter <<= 8; - counter |= vcdu->header[pos + 1]; + counter |= aostf->header[pos + 1]; counter <<= 8; - counter |= vcdu->header[pos + 2]; + counter |= aostf->header[pos + 2]; return counter; } -void AOSTF_set_vcdu_counter(AOSTF* vcdu, +void AOSTF_set_aostf_counter(AOSTF* aostf, uint32_t counter) { unsigned int pos = 2; - vcdu->header[pos] = (uint8_t)((counter >> 16) & 0xff); - vcdu->header[pos + 1] = (uint8_t)((counter >> 8) & 0xff); - vcdu->header[pos + 2] = (uint8_t)(counter & 0xff); + aostf->header[pos] = (uint8_t)((counter >> 16) & 0xff); + aostf->header[pos + 1] = (uint8_t)((counter >> 8) & 0xff); + aostf->header[pos + 2] = (uint8_t)(counter & 0xff); } -AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* vcdu) +AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* aostf) { unsigned int pos = 5; uint8_t mask = 0x80; // 10000000b - return (AOSTF_REPLAY_FLAG)((vcdu->header[pos] & mask) >> 7); + return (AOSTF_REPLAY_FLAG)((aostf->header[pos] & mask) >> 7); } -void AOSTF_set_replay_flag(AOSTF* vcdu, +void AOSTF_set_replay_flag(AOSTF* aostf, AOSTF_REPLAY_FLAG flag) { unsigned int pos = 5; uint8_t mask = 0x80; // 10000000b - vcdu->header[pos] &= (uint8_t)(~mask); - vcdu->header[pos] |= (uint8_t)((flag << 7) & mask); + aostf->header[pos] &= (uint8_t)(~mask); + aostf->header[pos] |= (uint8_t)((flag << 7) & mask); } -uint32_t AOSTF_get_clcw(const AOSTF* vcdu) +uint32_t AOSTF_get_clcw(const AOSTF* aostf) { unsigned int pos = 0; - uint32_t clcw = vcdu->trailer[pos]; + uint32_t clcw = aostf->trailer[pos]; clcw <<= 8; - clcw |= vcdu->trailer[pos + 1]; + clcw |= aostf->trailer[pos + 1]; clcw <<= 8; - clcw |= vcdu->trailer[pos + 2]; + clcw |= aostf->trailer[pos + 2]; clcw <<= 8; - clcw |= vcdu->trailer[pos + 3]; + clcw |= aostf->trailer[pos + 3]; return clcw; } -void AOSTF_set_clcw(AOSTF* vcdu, +void AOSTF_set_clcw(AOSTF* aostf, uint32_t clcw) { unsigned int pos = 0; - vcdu->trailer[pos] = (uint8_t)((clcw >> 24) & 0xff); - vcdu->trailer[pos + 1] = (uint8_t)((clcw >> 16) & 0xff); - vcdu->trailer[pos + 2] = (uint8_t)((clcw >> 8) & 0xff); - vcdu->trailer[pos + 3] = (uint8_t)(clcw & 0xff); + aostf->trailer[pos] = (uint8_t)((clcw >> 24) & 0xff); + aostf->trailer[pos + 1] = (uint8_t)((clcw >> 16) & 0xff); + aostf->trailer[pos + 2] = (uint8_t)((clcw >> 8) & 0xff); + aostf->trailer[pos + 3] = (uint8_t)(clcw & 0xff); } uint32_t AOSTF_calc_next_counter(uint32_t prev) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h index ae8be6332..6b00b2612 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h @@ -41,45 +41,45 @@ typedef enum AOSTF_REPLAY_TRUE = 1 // 1b: Replay Transfer Frame } AOSTF_REPLAY_FLAG; -void AOSTF_generate_byte_stream(const AOSTF* vcdu, +void AOSTF_generate_byte_stream(const AOSTF* aostf, uint8_t byte_stream[AOSTF_LEN]); -void AOSTF_setup_fill_vcdu(AOSTF* vcdu); +void AOSTF_setup_fill_aostf(AOSTF* aostf); -void AOSTF_setup_realtime_vcdu_hdr(AOSTF* vcdu, +void AOSTF_setup_realtime_aostf_hdr(AOSTF* aostf, uint32_t counter); -void AOSTF_setup_replay_vcdu_hdr(AOSTF* vcdu, +void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, uint32_t counter); -AOSTF_VER AOSTF_get_ver(const AOSTF* vcdu); +AOSTF_VER AOSTF_get_ver(const AOSTF* aostf); -void AOSTF_set_ver(AOSTF* vcdu, +void AOSTF_set_ver(AOSTF* aostf, AOSTF_VER ver); -AOSTF_SCID AOSTF_get_scdi(const AOSTF* vcdu); +AOSTF_SCID AOSTF_get_scdi(const AOSTF* aostf); -void AOSTF_set_scid(AOSTF* vcdu, +void AOSTF_set_scid(AOSTF* aostf, AOSTF_SCID scid); -AOSTF_VCID AOSTF_get_vcid(const AOSTF* vcdu); +AOSTF_VCID AOSTF_get_vcid(const AOSTF* aostf); -void AOSTF_set_vcid(AOSTF* vcdu, +void AOSTF_set_vcid(AOSTF* aostf, AOSTF_VCID vcid); -uint32_t AOSTF_get_vcdu_counter(const AOSTF* vcdu); +uint32_t AOSTF_get_aostf_counter(const AOSTF* aostf); -void AOSTF_set_vcdu_counter(AOSTF* vcdu, +void AOSTF_set_aostf_counter(AOSTF* aostf, uint32_t counter); -AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* vcdu); +AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* aostf); -void AOSTF_set_replay_flag(AOSTF* vcdu, +void AOSTF_set_replay_flag(AOSTF* aostf, AOSTF_REPLAY_FLAG flag); -uint32_t AOSTF_get_clcw(const AOSTF* vcdu); +uint32_t AOSTF_get_clcw(const AOSTF* aostf); -void AOSTF_set_clcw(AOSTF* vcdu, +void AOSTF_set_clcw(AOSTF* aostf, uint32_t clcw); uint32_t AOSTF_calc_next_counter(uint32_t prev); diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c index 2d809741f..348c77494 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c @@ -16,7 +16,7 @@ void M_PDU_generate_byte_stream(const M_PDU* m_pdu, void M_PDU_setup_idle_m_pdu(M_PDU* m_pdu) { - static uint8_t temp_fill_vcdu_data[432] = { + static uint8_t temp_fill_aostf_data[432] = { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -47,7 +47,7 @@ void M_PDU_setup_idle_m_pdu(M_PDU* m_pdu) M_PDU_clear_spare_(m_pdu); M_PDU_set_1st_hdr_ptr(m_pdu, M_PDU_PTR_IDLE); - memcpy(&m_pdu->data[0], &temp_fill_vcdu_data[0], 432); + memcpy(&m_pdu->data[0], &temp_fill_aostf_data[0], 432); } static void M_PDU_clear_spare_(M_PDU* m_pdu) diff --git a/examples/mobc/src/src_user/tlm_cmd/telemetry_definitions.c b/examples/mobc/src/src_user/tlm_cmd/telemetry_definitions.c index 9eda2f3e2..d5e1c3b9f 100644 --- a/examples/mobc/src/src_user/tlm_cmd/telemetry_definitions.c +++ b/examples/mobc/src/src_user/tlm_cmd/telemetry_definitions.c @@ -180,7 +180,7 @@ static TF_TLM_FUNC_ACK Tlm_MOBC_(uint8_t* packet, uint16_t* len, uint16_t max_le TF_copy_u32(&packet[322], (uint32_t)gs_driver->latest_info->tx.send_cycle); TF_copy_u32(&packet[326], gs_driver->driver_ccsds.ccsds_config.bitrate); TF_copy_u8(&packet[330], (uint8_t)gs_driver->latest_info->tx.vcid); - TF_copy_u32(&packet[331], gs_driver->latest_info->tx.vcdu_counter); + TF_copy_u32(&packet[331], gs_driver->latest_info->tx.aostf_counter); #endif *len = 335; @@ -3564,7 +3564,7 @@ static TF_TLM_FUNC_ACK Tlm_GS_(uint8_t* packet, uint16_t* len, uint16_t max_len) TF_copy_u8(&packet[40], (uint8_t)gs_driver->info[0].rx.tctf.bd_rec_status); TF_copy_u32(&packet[41], (uint32_t)gs_driver->info[0].tx.send_cycle); TF_copy_u8(&packet[45], (uint8_t)gs_driver->info[0].tx.vcid); - TF_copy_u32(&packet[46], gs_driver->info[0].tx.vcdu_counter); + TF_copy_u32(&packet[46], gs_driver->info[0].tx.aostf_counter); TF_copy_u8(&packet[50], gs_driver->ccsds_info.buffer_num); TF_copy_u8(&packet[51], gs_driver->driver_uart.uart_config.ch); TF_copy_u32(&packet[52], gs_driver->driver_uart.uart_config.baudrate); @@ -3582,7 +3582,7 @@ static TF_TLM_FUNC_ACK Tlm_GS_(uint8_t* packet, uint16_t* len, uint16_t max_len) TF_copy_u8(&packet[73], (uint8_t)gs_driver->info[1].rx.tctf.bd_rec_status); TF_copy_u32(&packet[74], (uint32_t)gs_driver->info[1].tx.send_cycle); TF_copy_u8(&packet[78], (uint8_t)gs_driver->info[1].tx.vcid); - TF_copy_u32(&packet[79], gs_driver->info[1].tx.vcdu_counter); + TF_copy_u32(&packet[79], gs_driver->info[1].tx.aostf_counter); TF_copy_u8(&packet[83], gs_driver->driver_uart.is_tlm_on); TF_copy_u8(&packet[84], gs_validate_info->type_a_counter); TF_copy_u8(&packet[85], gs_validate_info->type_b_counter); @@ -3591,10 +3591,10 @@ static TF_TLM_FUNC_ACK Tlm_GS_(uint8_t* packet, uint16_t* len, uint16_t max_len) TF_copy_u8(&packet[88], gs_validate_info->positive_window_width); TF_copy_u32(&packet[89], (uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval); TF_copy_u32(&packet[93], (uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.last_updated); - TF_copy_u32(&packet[97], (uint32_t)CSRV_GS_rt_tlm_packet_handler->vcdu_counter); + TF_copy_u32(&packet[97], (uint32_t)CSRV_GS_rt_tlm_packet_handler->aostf_counter); TF_copy_u32(&packet[101], (uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval); TF_copy_u32(&packet[105], (uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated); - TF_copy_u32(&packet[109], (uint32_t)CSRV_GS_rp_tlm_packet_handler->vcdu_counter); + TF_copy_u32(&packet[109], (uint32_t)CSRV_GS_rp_tlm_packet_handler->aostf_counter); #endif *len = 113; diff --git a/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv b/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv index 13e4e7400..c4ab7b154 100644 --- a/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv +++ b/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv @@ -31,7 +31,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,CCSDS.TCTF.BD_REC_STATUS,uint8_t,(uint8_t)gs_driver->info[0].rx.tctf.bd_rec_status,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,0=SUCCESS@@ 1=TCTF_VER@@ 2=TCTF_SCID@@ 3=TCTF_VCID@@ 4=TCTF_TYPE@@ 5=LOCKOUT@@ 6=TCTF_SEQ_FLAG@@ 7=TCP_VER@@ 8=TCP_2ND_HDR_FLAG@@ 9=APID@@ 10=TCP_TYPE_IS_NOT_CMD@@ 11=TCP_SEQ_IS_NOTE_SINGLE@@ 12=FECW_MISSMATCH@@ 13=FARM1_PWA@@ 14=FARM1_NWA@@ 15=FARM1_LOCKOUT_AREA@@ 16=FARM1_SAME_NUMBER@@ 17=INVALID_BC_CMD,, ,CCSDS.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[0].tx.send_cycle,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,CCSDS.TX.VCID,uint8_t,(uint8_t)gs_driver->info[0].tx.vcid,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, -,CCSDS.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[0].tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,CCSDS.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[0].tx.aostf_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,CCSDS.TX.BUFFER_NUM,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.CH,uint8_t,gs_driver->driver_uart.uart_config.ch,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.BAUDRATE,uint32_t,gs_driver->driver_uart.uart_config.baudrate,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, @@ -49,7 +49,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,UART.TCTF.BD_REC_STATUS,uint8_t,(uint8_t)gs_driver->info[1].rx.tctf.bd_rec_status,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,0=SUCCESS@@ 1=TCTF_VER@@ 2=TCTF_SCID@@ 3=TCTF_VCID@@ 4=TCTF_TYPE@@ 5=LOCKOUT@@ 6=TCTF_SEQ_FLAG@@ 7=TCP_VER@@ 8=TCP_2ND_HDR_FLAG@@ 9=APID@@ 10=TCP_TYPE_IS_NOT_CMD@@ 11=TCP_SEQ_IS_NOTE_SINGLE@@ 12=FECW_MISSMATCH@@ 13=FARM1_PWA@@ 14=FARM1_NWA@@ 15=FARM1_LOCKOUT_AREA@@ 16=FARM1_SAME_NUMBER@@ 17=INVALID_BC_CMD,, ,UART.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[1].tx.send_cycle,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.TX.VCID,uint8_t,(uint8_t)gs_driver->info[1].tx.vcid,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, -,UART.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[1].tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,UART.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[1].tx.aostf_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.IS_TLM_ON,uint8_t,gs_driver->driver_uart.is_tlm_on,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,0=OFF@@ 1=ON,, ,COP-1.TYPE_A_COUNTER,uint8_t,gs_validate_info->type_a_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,COP-1.TYPE_B_COUNTER,uint8_t,gs_validate_info->type_b_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, @@ -58,10 +58,10 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,COP-1.POSITIVE_WINDOW_WIDTH,uint8_t,gs_validate_info->positive_window_width,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,RT_TLM.AOSTF.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,RT_TLM.AOSTF.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,RT_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,RT_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->aostf_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,RP_TLM.AOSTF.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,RP_TLM.AOSTF.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,RP_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,RP_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->aostf_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv b/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv index bded556cf..b337f273c 100644 --- a/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv +++ b/examples/mobc/tlm-cmd-db/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv @@ -134,7 +134,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,TCI_TX_CYCLE,uint32_t,(uint32_t)gs_driver->latest_info->tx.send_cycle,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻校正情報::送出サイクル, ,TCI_TX_BITRATE,uint32_t,gs_driver->driver_ccsds.ccsds_config.bitrate,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻校正情報::送出ビットレート, ,TCI_VCID,uint8_t,(uint8_t)gs_driver->latest_info->tx.vcid,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻構成情報::送出VCID, -,TCI_AOSTF_COUNTER,uint32_t,gs_driver->latest_info->tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻校正情報::送出AOSTFカウンタ, +,TCI_AOSTF_COUNTER,uint32_t,gs_driver->latest_info->tx.aostf_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,時刻校正情報::送出AOSTFカウンタ, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv b/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv index ea3410554..69424a6a9 100644 --- a/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv +++ b/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv @@ -31,7 +31,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,CCSDS.TCTF.BD_REC_STATUS,uint8_t,(uint8_t)gs_driver->info[0].rx.tctf.bd_rec_status,PACKET,40,0,8,STATUS,,,,,,,0=SUCCESS@@ 1=TCTF_VER@@ 2=TCTF_SCID@@ 3=TCTF_VCID@@ 4=TCTF_TYPE@@ 5=LOCKOUT@@ 6=TCTF_SEQ_FLAG@@ 7=TCP_VER@@ 8=TCP_2ND_HDR_FLAG@@ 9=APID@@ 10=TCP_TYPE_IS_NOT_CMD@@ 11=TCP_SEQ_IS_NOTE_SINGLE@@ 12=FECW_MISSMATCH@@ 13=FARM1_PWA@@ 14=FARM1_NWA@@ 15=FARM1_LOCKOUT_AREA@@ 16=FARM1_SAME_NUMBER@@ 17=INVALID_BC_CMD,, ,CCSDS.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[0].tx.send_cycle,PACKET,41,0,32,NONE,,,,,,,,, ,CCSDS.TX.VCID,uint8_t,(uint8_t)gs_driver->info[0].tx.vcid,PACKET,45,0,8,STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, -,CCSDS.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[0].tx.vcdu_counter,PACKET,46,0,32,NONE,,,,,,,,, +,CCSDS.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[0].tx.aostf_counter,PACKET,46,0,32,NONE,,,,,,,,, ,CCSDS.TX.BUFFER_NUM,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,50,0,8,NONE,,,,,,,,, ,UART.CH,uint8_t,gs_driver->driver_uart.uart_config.ch,PACKET,51,0,8,NONE,,,,,,,,, ,UART.BAUDRATE,uint32_t,gs_driver->driver_uart.uart_config.baudrate,PACKET,52,0,32,NONE,,,,,,,,, @@ -49,7 +49,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,UART.TCTF.BD_REC_STATUS,uint8_t,(uint8_t)gs_driver->info[1].rx.tctf.bd_rec_status,PACKET,73,0,8,STATUS,,,,,,,0=SUCCESS@@ 1=TCTF_VER@@ 2=TCTF_SCID@@ 3=TCTF_VCID@@ 4=TCTF_TYPE@@ 5=LOCKOUT@@ 6=TCTF_SEQ_FLAG@@ 7=TCP_VER@@ 8=TCP_2ND_HDR_FLAG@@ 9=APID@@ 10=TCP_TYPE_IS_NOT_CMD@@ 11=TCP_SEQ_IS_NOTE_SINGLE@@ 12=FECW_MISSMATCH@@ 13=FARM1_PWA@@ 14=FARM1_NWA@@ 15=FARM1_LOCKOUT_AREA@@ 16=FARM1_SAME_NUMBER@@ 17=INVALID_BC_CMD,, ,UART.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[1].tx.send_cycle,PACKET,74,0,32,NONE,,,,,,,,, ,UART.TX.VCID,uint8_t,(uint8_t)gs_driver->info[1].tx.vcid,PACKET,78,0,8,STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, -,UART.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[1].tx.vcdu_counter,PACKET,79,0,32,NONE,,,,,,,,, +,UART.TX.AOSTF_COUNTER,uint32_t,gs_driver->info[1].tx.aostf_counter,PACKET,79,0,32,NONE,,,,,,,,, ,UART.IS_TLM_ON,uint8_t,gs_driver->driver_uart.is_tlm_on,PACKET,83,0,8,STATUS,,,,,,,0=OFF@@ 1=ON,, ,COP-1.TYPE_A_COUNTER,uint8_t,gs_validate_info->type_a_counter,PACKET,84,0,8,NONE,,,,,,,,, ,COP-1.TYPE_B_COUNTER,uint8_t,gs_validate_info->type_b_counter,PACKET,85,0,8,NONE,,,,,,,,, @@ -58,10 +58,10 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,COP-1.POSITIVE_WINDOW_WIDTH,uint8_t,gs_validate_info->positive_window_width,PACKET,88,0,8,NONE,,,,,,,,, ,RT_TLM.AOSTF.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,89,0,32,NONE,,,,,,,,, ,RT_TLM.AOSTF.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,93,0,32,NONE,,,,,,,,, -,RT_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->vcdu_counter,PACKET,97,0,32,NONE,,,,,,,,, +,RT_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rt_tlm_packet_handler->aostf_counter,PACKET,97,0,32,NONE,,,,,,,,, ,RP_TLM.AOSTF.FLUSH_INTERVAL,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,101,0,32,NONE,,,,,,,,, ,RP_TLM.AOSTF.LAST_UPDATED,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,105,0,32,NONE,,,,,,,,, -,RP_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->vcdu_counter,PACKET,109,0,32,NONE,,,,,,,,, +,RP_TLM.AOSTF.COUNTER,uint32_t,(uint32_t)CSRV_GS_rp_tlm_packet_handler->aostf_counter,PACKET,109,0,32,NONE,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv b/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv index 0118ee27d..5a42da589 100644 --- a/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv +++ b/examples/mobc/tlm-cmd-db/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv @@ -134,7 +134,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,TCI_TX_CYCLE,uint32_t,(uint32_t)gs_driver->latest_info->tx.send_cycle,PACKET,322,0,32,NONE,,,,,,,,時刻校正情報::送出サイクル, ,TCI_TX_BITRATE,uint32_t,gs_driver->driver_ccsds.ccsds_config.bitrate,PACKET,326,0,32,NONE,,,,,,,,時刻校正情報::送出ビットレート, ,TCI_VCID,uint8_t,(uint8_t)gs_driver->latest_info->tx.vcid,PACKET,330,0,8,NONE,,,,,,,,時刻構成情報::送出VCID, -,TCI_AOSTF_COUNTER,uint32_t,gs_driver->latest_info->tx.vcdu_counter,PACKET,331,0,32,NONE,,,,,,,,時刻校正情報::送出AOSTFカウンタ, +,TCI_AOSTF_COUNTER,uint32_t,gs_driver->latest_info->tx.aostf_counter,PACKET,331,0,32,NONE,,,,,,,,時刻校正情報::送出AOSTFカウンタ, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, From ba28311f9ce41a4ebd121a3959d9cd556709bcc8 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 8 Nov 2023 21:56:02 +0900 Subject: [PATCH 06/87] aos_transfer_frame --- .../applications/component_service/csrv_gs.h | 2 +- .../src/src_user/component_driver/com/gs.h | 2 +- .../tlm_cmd/ccsds/aos_transfer_frame.c | 30 +++++--------- .../tlm_cmd/ccsds/aos_transfer_frame.h | 41 ++++++++----------- 4 files changed, 29 insertions(+), 46 deletions(-) diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h index c1b684bd3..bde51b4d4 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h @@ -9,7 +9,7 @@ #include "../../component_driver/com/gs.h" #include "../../tlm_cmd/ccsds/tcp_to_m_pdu.h" -#include "../../tlm_cmd/ccsds/aostf.h" +#include "../../tlm_cmd/ccsds/aos_transfer_frame.h" #include /** diff --git a/examples/mobc/src/src_user/component_driver/com/gs.h b/examples/mobc/src/src_user/component_driver/com/gs.h index c58929247..73a293753 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.h +++ b/examples/mobc/src/src_user/component_driver/com/gs.h @@ -10,7 +10,7 @@ #include #include #include "../../hal/ccsds_user.h" -#include "../../tlm_cmd/ccsds/aostf.h" +#include "../../tlm_cmd/ccsds/aos_transfer_frame.h" #include "gs_validate.h" #define GS_RX_HEADER_NUM (3) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c index 479001548..1183ad343 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c @@ -1,13 +1,12 @@ #pragma section REPRO -#include "aostf.h" +#include "aos_transfer_frame.h" #include // for memcpy static void AOSTF_set_common_hdr_(AOSTF* aostf); static void AOSTF_clear_spare_(AOSTF* aostf); -void AOSTF_generate_byte_stream(const AOSTF* aostf, - uint8_t byte_stream[AOSTF_LEN]) +void AOSTF_generate_byte_stream(const AOSTF* aostf, uint8_t byte_stream[AOSTF_LEN]) { memcpy(byte_stream, aostf->header, AOSTF_HEADER_SIZE); byte_stream += AOSTF_HEADER_SIZE; @@ -25,16 +24,14 @@ void AOSTF_setup_fill_aostf(AOSTF* aostf) M_PDU_setup_idle_m_pdu(&(aostf->m_pdu)); } -void AOSTF_setup_realtime_aostf_hdr(AOSTF* aostf, - uint32_t counter) +void AOSTF_setup_realtime_aostf_hdr(AOSTF* aostf, uint32_t counter) { AOSTF_set_common_hdr_(aostf); AOSTF_set_vcid(aostf, AOSTF_VCID_REALTIME); AOSTF_set_aostf_counter(aostf, counter); } -void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, - uint32_t counter) +void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, uint32_t counter) { AOSTF_set_common_hdr_(aostf); AOSTF_set_replay_flag(aostf, AOSTF_REPLAY_TRUE); @@ -75,8 +72,7 @@ AOSTF_VER AOSTF_get_ver(const AOSTF* aostf) } } -void AOSTF_set_ver(AOSTF* aostf, - AOSTF_VER ver) +void AOSTF_set_ver(AOSTF* aostf, AOSTF_VER ver) { unsigned int pos = 0; uint8_t mask = 0xc0; // 11000000b @@ -106,8 +102,7 @@ AOSTF_SCID AOSTF_get_scdi(const AOSTF* aostf) } } -void AOSTF_set_scid(AOSTF* aostf, - AOSTF_SCID scid) +void AOSTF_set_scid(AOSTF* aostf, AOSTF_SCID scid) { unsigned int pos = 0; uint8_t mask1 = 0x3f; // 00111111b @@ -138,8 +133,7 @@ AOSTF_VCID AOSTF_get_vcid(const AOSTF* aostf) } } -void AOSTF_set_vcid(AOSTF* aostf, - AOSTF_VCID vcid) +void AOSTF_set_vcid(AOSTF* aostf, AOSTF_VCID vcid) { unsigned int pos = 1; uint8_t mask = 0x3f; // 00111111b @@ -161,8 +155,7 @@ uint32_t AOSTF_get_aostf_counter(const AOSTF* aostf) return counter; } -void AOSTF_set_aostf_counter(AOSTF* aostf, - uint32_t counter) +void AOSTF_set_aostf_counter(AOSTF* aostf, uint32_t counter) { unsigned int pos = 2; @@ -179,8 +172,7 @@ AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* aostf) return (AOSTF_REPLAY_FLAG)((aostf->header[pos] & mask) >> 7); } -void AOSTF_set_replay_flag(AOSTF* aostf, - AOSTF_REPLAY_FLAG flag) +void AOSTF_set_replay_flag(AOSTF* aostf, AOSTF_REPLAY_FLAG flag) { unsigned int pos = 5; uint8_t mask = 0x80; // 10000000b @@ -204,8 +196,7 @@ uint32_t AOSTF_get_clcw(const AOSTF* aostf) return clcw; } -void AOSTF_set_clcw(AOSTF* aostf, - uint32_t clcw) +void AOSTF_set_clcw(AOSTF* aostf, uint32_t clcw) { unsigned int pos = 0; @@ -219,4 +210,5 @@ uint32_t AOSTF_calc_next_counter(uint32_t prev) { return (prev + 1) % AOSTF_COUNTER_MAX; } + #pragma section diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h index 6b00b2612..d491a9b81 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h @@ -1,12 +1,12 @@ -#ifndef AOSTF_H_ -#define AOSTF_H_ +#ifndef AOS_TRANSFER_FRAME_H_ +#define AOS_TRANSFER_FRAME_H_ #include "m_pdu.h" -#define AOSTF_HEADER_SIZE (6u) -#define AOSTF_TRAILER_SIZE (4u) -#define AOSTF_LEN (AOSTF_HEADER_SIZE + M_PDU_LEN + AOSTF_TRAILER_SIZE) -#define AOSTF_COUNTER_MAX (0x01000000) // 24bit長 +#define AOSTF_HEADER_SIZE (6u) +#define AOSTF_TRAILER_SIZE (4u) +#define AOSTF_LEN (AOSTF_HEADER_SIZE + M_PDU_LEN + AOSTF_TRAILER_SIZE) +#define AOSTF_COUNTER_MAX (0x01000000) // 24bit長 typedef struct { @@ -41,47 +41,38 @@ typedef enum AOSTF_REPLAY_TRUE = 1 // 1b: Replay Transfer Frame } AOSTF_REPLAY_FLAG; -void AOSTF_generate_byte_stream(const AOSTF* aostf, - uint8_t byte_stream[AOSTF_LEN]); +void AOSTF_generate_byte_stream(const AOSTF* aostf, uint8_t byte_stream[AOSTF_LEN]); void AOSTF_setup_fill_aostf(AOSTF* aostf); -void AOSTF_setup_realtime_aostf_hdr(AOSTF* aostf, - uint32_t counter); +void AOSTF_setup_realtime_aostf_hdr(AOSTF* aostf, uint32_t counter); -void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, - uint32_t counter); +void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, uint32_t counter); AOSTF_VER AOSTF_get_ver(const AOSTF* aostf); -void AOSTF_set_ver(AOSTF* aostf, - AOSTF_VER ver); +void AOSTF_set_ver(AOSTF* aostf, AOSTF_VER ver); AOSTF_SCID AOSTF_get_scdi(const AOSTF* aostf); -void AOSTF_set_scid(AOSTF* aostf, - AOSTF_SCID scid); +void AOSTF_set_scid(AOSTF* aostf, AOSTF_SCID scid); AOSTF_VCID AOSTF_get_vcid(const AOSTF* aostf); -void AOSTF_set_vcid(AOSTF* aostf, - AOSTF_VCID vcid); +void AOSTF_set_vcid(AOSTF* aostf, AOSTF_VCID vcid); uint32_t AOSTF_get_aostf_counter(const AOSTF* aostf); -void AOSTF_set_aostf_counter(AOSTF* aostf, - uint32_t counter); +void AOSTF_set_aostf_counter(AOSTF* aostf, uint32_t counter); AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* aostf); -void AOSTF_set_replay_flag(AOSTF* aostf, - AOSTF_REPLAY_FLAG flag); +void AOSTF_set_replay_flag(AOSTF* aostf, AOSTF_REPLAY_FLAG flag); uint32_t AOSTF_get_clcw(const AOSTF* aostf); -void AOSTF_set_clcw(AOSTF* aostf, - uint32_t clcw); +void AOSTF_set_clcw(AOSTF* aostf, uint32_t clcw); uint32_t AOSTF_calc_next_counter(uint32_t prev); -#endif // AOSTF_H_ +#endif From 5600f60bdd998f6f5602ecffa3d7a7e008b2d519 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 8 Nov 2023 22:01:56 +0900 Subject: [PATCH 07/87] sed AOSTF to AosTransferFrame --- .../applications/component_service/csrv_gs.h | 2 +- .../src/src_user/component_driver/com/gs.c | 4 +- .../src/src_user/component_driver/com/gs.h | 2 +- .../tlm_cmd/ccsds/aos_transfer_frame.c | 40 +++++++++---------- .../tlm_cmd/ccsds/aos_transfer_frame.h | 34 ++++++++-------- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h index bde51b4d4..6886cef1b 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h @@ -19,7 +19,7 @@ typedef struct { TcpToMPdu tc_packet_to_m_pdu; //!< PL から取り出した tc_packet を M_PDU に変換する - AOSTF aostf; //!< 送信するAOSTF + AosTransferFrame aostf; //!< 送信するAOSTF uint32_t aostf_counter; //!< AOSTF counter } CSRV_GS_TlmPacketHandler; diff --git a/examples/mobc/src/src_user/component_driver/com/gs.c b/examples/mobc/src/src_user/component_driver/com/gs.c index ede3aeba9..084c13fa4 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.c +++ b/examples/mobc/src/src_user/component_driver/com/gs.c @@ -254,11 +254,11 @@ static CDS_ERR_CODE GS_analyze_rec_data_(CDS_StreamConfig* p_stream_config, void return CDS_ERR_CODE_OK; } -CDS_CMD_ERR_CODE GS_send_aostf(GS_Driver* gs_driver, const AOSTF* aostf) +CDS_CMD_ERR_CODE GS_send_aostf(GS_Driver* gs_driver, const AosTransferFrame* aostf) { CDS_ERR_CODE ret_ccsds = CDS_ERR_CODE_OK; CDS_ERR_CODE ret_uart = CDS_ERR_CODE_OK; - size_t aostf_size = sizeof(AOSTF); + size_t aostf_size = sizeof(AosTransferFrame); // パディングが無ければ元を GS_tx_frame_ にコピーさせる (444Byte) のコピーが無駄 if (aostf_size == AOSTF_LEN) diff --git a/examples/mobc/src/src_user/component_driver/com/gs.h b/examples/mobc/src/src_user/component_driver/com/gs.h index 73a293753..b35a0e2b1 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.h +++ b/examples/mobc/src/src_user/component_driver/com/gs.h @@ -113,6 +113,6 @@ CDS_REC_ERR_CODE GS_rec_tctf(GS_Driver* gs_driver); * @param[in] aostf: 送信する AOSTF. 場合によってはそのまま DS に渡すので, local変数ではなくstaticな変数を渡すこと * @return CDS_CMD_ERR_CODE: 送信結果 */ -CDS_CMD_ERR_CODE GS_send_aostf(GS_Driver* gs_driver, const AOSTF* aostf); +CDS_CMD_ERR_CODE GS_send_aostf(GS_Driver* gs_driver, const AosTransferFrame* aostf); #endif diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c index 1183ad343..57810ad8f 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c @@ -3,10 +3,10 @@ #include // for memcpy -static void AOSTF_set_common_hdr_(AOSTF* aostf); -static void AOSTF_clear_spare_(AOSTF* aostf); +static void AOSTF_set_common_hdr_(AosTransferFrame* aostf); +static void AOSTF_clear_spare_(AosTransferFrame* aostf); -void AOSTF_generate_byte_stream(const AOSTF* aostf, uint8_t byte_stream[AOSTF_LEN]) +void AOSTF_generate_byte_stream(const AosTransferFrame* aostf, uint8_t byte_stream[AOSTF_LEN]) { memcpy(byte_stream, aostf->header, AOSTF_HEADER_SIZE); byte_stream += AOSTF_HEADER_SIZE; @@ -17,21 +17,21 @@ void AOSTF_generate_byte_stream(const AOSTF* aostf, uint8_t byte_stream[AOSTF_LE memcpy(byte_stream, aostf->trailer, AOSTF_TRAILER_SIZE); } -void AOSTF_setup_fill_aostf(AOSTF* aostf) +void AOSTF_setup_fill_aostf(AosTransferFrame* aostf) { AOSTF_set_common_hdr_(aostf); AOSTF_set_vcid(aostf, AOSTF_VCID_FILL); M_PDU_setup_idle_m_pdu(&(aostf->m_pdu)); } -void AOSTF_setup_realtime_aostf_hdr(AOSTF* aostf, uint32_t counter) +void AOSTF_setup_realtime_aostf_hdr(AosTransferFrame* aostf, uint32_t counter) { AOSTF_set_common_hdr_(aostf); AOSTF_set_vcid(aostf, AOSTF_VCID_REALTIME); AOSTF_set_aostf_counter(aostf, counter); } -void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, uint32_t counter) +void AOSTF_setup_replay_aostf_hdr(AosTransferFrame* aostf, uint32_t counter) { AOSTF_set_common_hdr_(aostf); AOSTF_set_replay_flag(aostf, AOSTF_REPLAY_TRUE); @@ -39,7 +39,7 @@ void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, uint32_t counter) AOSTF_set_aostf_counter(aostf, counter); } -static void AOSTF_set_common_hdr_(AOSTF* aostf) +static void AOSTF_set_common_hdr_(AosTransferFrame* aostf) { AOSTF_set_ver(aostf, AOSTF_VER_2); AOSTF_set_scid(aostf, AOSTF_SCID_SAMPLE_SATELLITE); // FIXME: 仮 @@ -47,7 +47,7 @@ static void AOSTF_set_common_hdr_(AOSTF* aostf) AOSTF_clear_spare_(aostf); } -static void AOSTF_clear_spare_(AOSTF* aostf) +static void AOSTF_clear_spare_(AosTransferFrame* aostf) { unsigned int pos = 5; uint8_t mask = 0x7f; // 01111111b @@ -55,7 +55,7 @@ static void AOSTF_clear_spare_(AOSTF* aostf) aostf->header[pos] &= (uint8_t)(~mask); } -AOSTF_VER AOSTF_get_ver(const AOSTF* aostf) +AOSTF_VER AOSTF_get_ver(const AosTransferFrame* aostf) { unsigned int pos = 0; uint8_t mask = 0xc0; // 11000000b @@ -72,7 +72,7 @@ AOSTF_VER AOSTF_get_ver(const AOSTF* aostf) } } -void AOSTF_set_ver(AOSTF* aostf, AOSTF_VER ver) +void AOSTF_set_ver(AosTransferFrame* aostf, AOSTF_VER ver) { unsigned int pos = 0; uint8_t mask = 0xc0; // 11000000b @@ -82,7 +82,7 @@ void AOSTF_set_ver(AOSTF* aostf, AOSTF_VER ver) aostf->header[pos] |= val; } -AOSTF_SCID AOSTF_get_scdi(const AOSTF* aostf) +AOSTF_SCID AOSTF_get_scdi(const AosTransferFrame* aostf) { unsigned int pos = 0; uint8_t mask1 = 0x3f; // 00111111b @@ -102,7 +102,7 @@ AOSTF_SCID AOSTF_get_scdi(const AOSTF* aostf) } } -void AOSTF_set_scid(AOSTF* aostf, AOSTF_SCID scid) +void AOSTF_set_scid(AosTransferFrame* aostf, AOSTF_SCID scid) { unsigned int pos = 0; uint8_t mask1 = 0x3f; // 00111111b @@ -114,7 +114,7 @@ void AOSTF_set_scid(AOSTF* aostf, AOSTF_SCID scid) aostf->header[pos + 1] |= (uint8_t)((scid << 6) & mask2); } -AOSTF_VCID AOSTF_get_vcid(const AOSTF* aostf) +AOSTF_VCID AOSTF_get_vcid(const AosTransferFrame* aostf) { unsigned int pos = 1; uint8_t mask = 0x3f; // 00111111b @@ -133,7 +133,7 @@ AOSTF_VCID AOSTF_get_vcid(const AOSTF* aostf) } } -void AOSTF_set_vcid(AOSTF* aostf, AOSTF_VCID vcid) +void AOSTF_set_vcid(AosTransferFrame* aostf, AOSTF_VCID vcid) { unsigned int pos = 1; uint8_t mask = 0x3f; // 00111111b @@ -142,7 +142,7 @@ void AOSTF_set_vcid(AOSTF* aostf, AOSTF_VCID vcid) aostf->header[pos] |= (uint8_t)(vcid & mask); } -uint32_t AOSTF_get_aostf_counter(const AOSTF* aostf) +uint32_t AOSTF_get_aostf_counter(const AosTransferFrame* aostf) { unsigned int pos = 2; @@ -155,7 +155,7 @@ uint32_t AOSTF_get_aostf_counter(const AOSTF* aostf) return counter; } -void AOSTF_set_aostf_counter(AOSTF* aostf, uint32_t counter) +void AOSTF_set_aostf_counter(AosTransferFrame* aostf, uint32_t counter) { unsigned int pos = 2; @@ -164,7 +164,7 @@ void AOSTF_set_aostf_counter(AOSTF* aostf, uint32_t counter) aostf->header[pos + 2] = (uint8_t)(counter & 0xff); } -AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* aostf) +AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AosTransferFrame* aostf) { unsigned int pos = 5; uint8_t mask = 0x80; // 10000000b @@ -172,7 +172,7 @@ AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* aostf) return (AOSTF_REPLAY_FLAG)((aostf->header[pos] & mask) >> 7); } -void AOSTF_set_replay_flag(AOSTF* aostf, AOSTF_REPLAY_FLAG flag) +void AOSTF_set_replay_flag(AosTransferFrame* aostf, AOSTF_REPLAY_FLAG flag) { unsigned int pos = 5; uint8_t mask = 0x80; // 10000000b @@ -181,7 +181,7 @@ void AOSTF_set_replay_flag(AOSTF* aostf, AOSTF_REPLAY_FLAG flag) aostf->header[pos] |= (uint8_t)((flag << 7) & mask); } -uint32_t AOSTF_get_clcw(const AOSTF* aostf) +uint32_t AOSTF_get_clcw(const AosTransferFrame* aostf) { unsigned int pos = 0; @@ -196,7 +196,7 @@ uint32_t AOSTF_get_clcw(const AOSTF* aostf) return clcw; } -void AOSTF_set_clcw(AOSTF* aostf, uint32_t clcw) +void AOSTF_set_clcw(AosTransferFrame* aostf, uint32_t clcw) { unsigned int pos = 0; diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h index d491a9b81..24eddefae 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h @@ -13,7 +13,7 @@ typedef struct uint8_t header[AOSTF_HEADER_SIZE]; M_PDU m_pdu; uint8_t trailer[AOSTF_TRAILER_SIZE]; -} AOSTF; +} AosTransferFrame; typedef enum { @@ -41,37 +41,37 @@ typedef enum AOSTF_REPLAY_TRUE = 1 // 1b: Replay Transfer Frame } AOSTF_REPLAY_FLAG; -void AOSTF_generate_byte_stream(const AOSTF* aostf, uint8_t byte_stream[AOSTF_LEN]); +void AOSTF_generate_byte_stream(const AosTransferFrame* aostf, uint8_t byte_stream[AOSTF_LEN]); -void AOSTF_setup_fill_aostf(AOSTF* aostf); +void AOSTF_setup_fill_aostf(AosTransferFrame* aostf); -void AOSTF_setup_realtime_aostf_hdr(AOSTF* aostf, uint32_t counter); +void AOSTF_setup_realtime_aostf_hdr(AosTransferFrame* aostf, uint32_t counter); -void AOSTF_setup_replay_aostf_hdr(AOSTF* aostf, uint32_t counter); +void AOSTF_setup_replay_aostf_hdr(AosTransferFrame* aostf, uint32_t counter); -AOSTF_VER AOSTF_get_ver(const AOSTF* aostf); +AOSTF_VER AOSTF_get_ver(const AosTransferFrame* aostf); -void AOSTF_set_ver(AOSTF* aostf, AOSTF_VER ver); +void AOSTF_set_ver(AosTransferFrame* aostf, AOSTF_VER ver); -AOSTF_SCID AOSTF_get_scdi(const AOSTF* aostf); +AOSTF_SCID AOSTF_get_scdi(const AosTransferFrame* aostf); -void AOSTF_set_scid(AOSTF* aostf, AOSTF_SCID scid); +void AOSTF_set_scid(AosTransferFrame* aostf, AOSTF_SCID scid); -AOSTF_VCID AOSTF_get_vcid(const AOSTF* aostf); +AOSTF_VCID AOSTF_get_vcid(const AosTransferFrame* aostf); -void AOSTF_set_vcid(AOSTF* aostf, AOSTF_VCID vcid); +void AOSTF_set_vcid(AosTransferFrame* aostf, AOSTF_VCID vcid); -uint32_t AOSTF_get_aostf_counter(const AOSTF* aostf); +uint32_t AOSTF_get_aostf_counter(const AosTransferFrame* aostf); -void AOSTF_set_aostf_counter(AOSTF* aostf, uint32_t counter); +void AOSTF_set_aostf_counter(AosTransferFrame* aostf, uint32_t counter); -AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AOSTF* aostf); +AOSTF_REPLAY_FLAG AOSTF_get_replay_flag(const AosTransferFrame* aostf); -void AOSTF_set_replay_flag(AOSTF* aostf, AOSTF_REPLAY_FLAG flag); +void AOSTF_set_replay_flag(AosTransferFrame* aostf, AOSTF_REPLAY_FLAG flag); -uint32_t AOSTF_get_clcw(const AOSTF* aostf); +uint32_t AOSTF_get_clcw(const AosTransferFrame* aostf); -void AOSTF_set_clcw(AOSTF* aostf, uint32_t clcw); +void AOSTF_set_clcw(AosTransferFrame* aostf, uint32_t clcw); uint32_t AOSTF_calc_next_counter(uint32_t prev); From 6c90fc24bcd8545cfb45c47d6a242dc4860543cc Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 8 Nov 2023 22:35:30 +0900 Subject: [PATCH 08/87] add definition of AOS TF --- .../tlm_cmd/ccsds/aos_transfer_frame.c | 12 +++-- .../tlm_cmd/ccsds/aos_transfer_frame.h | 47 +++++++++++++++++-- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c index 57810ad8f..f177e4227 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c @@ -1,4 +1,9 @@ #pragma section REPRO +/** + * @file + * @brief CCSDS で規定される AOS Transfer Frame の実装 + * @note 詳細は aos_transfer_frame.h を参照 + */ #include "aos_transfer_frame.h" #include // for memcpy @@ -66,7 +71,6 @@ AOSTF_VER AOSTF_get_ver(const AosTransferFrame* aostf) { case AOSTF_VER_2: return ver; - default: return AOSTF_VER_UNKNOWN; } @@ -96,7 +100,6 @@ AOSTF_SCID AOSTF_get_scdi(const AosTransferFrame* aostf) { case AOSTF_SCID_SAMPLE_SATELLITE: return (AOSTF_SCID)scid; - default: return AOSTF_SCID_UNKNOWN; } @@ -124,10 +127,9 @@ AOSTF_VCID AOSTF_get_vcid(const AosTransferFrame* aostf) switch (vcid) { case AOSTF_VCID_REALTIME: // FALLTHROUGH - case AOSTF_VCID_REPLAY: // FALLTHROUGH - case AOSTF_VCID_FILL: // FALLTHROUGH + case AOSTF_VCID_REPLAY: // FALLTHROUGH + case AOSTF_VCID_FILL: // FALLTHROUGH return vcid; - default: return AOSTF_VCID_UNKNOWN; } diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h index 24eddefae..6fd03cee7 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h @@ -1,3 +1,42 @@ +/** + * @file + * @brief CCSDS で規定される AOS Transfer Frame の実装 + * @note packet 構造 + * |---------+-------+-------+--------------------------| + * | Pos | Pos | Size | Name | + * | [octet] | [bit] | [bit] | | + * |---------+-------+-------+--------------------------| + * | === Primary Header ================================| + * |---------+-------+-------+--------------------------| + * | 0 | 0 | 2 | Version Number | + * | 0 | 2 | 8 | Spacecraft ID | + * | 1 | 2 | 6 | Virtual Channel ID | + * | 2 | 0 | 24 | Virtual Channel | + * | | | | Frame Count | + * | 5 | 0 | 1 | Replay Flag | + * | 5 | 1 | 1 | VC Frame Count | + * | | | | Usage Flag | + * | 5 | 2 | 2 | Reserved Spare | + * | 5 | 4 | 4 | VC Frame Count Cycle | + * |---------+-------+-------+--------------------------| + * | === User Data Field ===============================| + * |---------+-------+-------+--------------------------| + * | 6 | 0 | * | M_PDU など | + * |---------+-------+-------+--------------------------| + * | === Trailer =======================================| + * |---------+-------+-------+--------------------------| + * | N - 4 | 0 | 32 | CLCW | + * |---------+-------+-------+--------------------------| + * + * Primary Header: + * Version Number と Spacecraft ID をまとめて Master Channel ID と呼ぶ + * 以下をまとめて Signaling Field と呼ぶ + * Frame Header Error Control がある Option もある + * Transfer Frame Insert Zone: + * Primary Header の後に Transfer Frame Insert Zone がある Option もある + * Trailer: + * ここでの定義以外にさまざまな Option がある + */ #ifndef AOS_TRANSFER_FRAME_H_ #define AOS_TRANSFER_FRAME_H_ @@ -11,7 +50,7 @@ typedef struct { uint8_t header[AOSTF_HEADER_SIZE]; - M_PDU m_pdu; + M_PDU m_pdu; uint8_t trailer[AOSTF_TRAILER_SIZE]; } AosTransferFrame; @@ -30,15 +69,15 @@ typedef enum typedef enum { AOSTF_VCID_REALTIME = 0x01, // 000001b: Realtime Transfer Frame - AOSTF_VCID_REPLAY = 0x02, // 000010b: Stored Transfer Frame - AOSTF_VCID_FILL = 0x3f, // 111111b: Fill Transfer Frame + AOSTF_VCID_REPLAY = 0x02, // 000010b: Stored Transfer Frame + AOSTF_VCID_FILL = 0x3f, // 111111b: Fill Transfer Frame AOSTF_VCID_UNKNOWN } AOSTF_VCID; typedef enum { AOSTF_REPLAY_FALSE = 0, // 0b: Realtime Transfer Frame - AOSTF_REPLAY_TRUE = 1 // 1b: Replay Transfer Frame + AOSTF_REPLAY_TRUE = 1 // 1b: Replay Transfer Frame } AOSTF_REPLAY_FLAG; void AOSTF_generate_byte_stream(const AosTransferFrame* aostf, uint8_t byte_stream[AOSTF_LEN]); From aaee9f4ff89e9953ebdaa8c1cafc1f5b997b791c Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 8 Nov 2023 22:49:42 +0900 Subject: [PATCH 09/87] fix small --- .../src/src_user/applications/component_service/csrv_gs.h | 4 ++-- examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h index 6886cef1b..594e2900a 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h @@ -19,8 +19,8 @@ typedef struct { TcpToMPdu tc_packet_to_m_pdu; //!< PL から取り出した tc_packet を M_PDU に変換する - AosTransferFrame aostf; //!< 送信するAOSTF - uint32_t aostf_counter; //!< AOSTF counter + AosTransferFrame aostf; //!< 送信するAOSTF + uint32_t aostf_counter; //!< AOSTF counter } CSRV_GS_TlmPacketHandler; extern const GS_Driver* const gs_driver; diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c index 348c77494..da6fe0133 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c @@ -16,7 +16,7 @@ void M_PDU_generate_byte_stream(const M_PDU* m_pdu, void M_PDU_setup_idle_m_pdu(M_PDU* m_pdu) { - static uint8_t temp_fill_aostf_data[432] = { + static uint8_t temp_fill_aostf_data_[432] = { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -47,7 +47,7 @@ void M_PDU_setup_idle_m_pdu(M_PDU* m_pdu) M_PDU_clear_spare_(m_pdu); M_PDU_set_1st_hdr_ptr(m_pdu, M_PDU_PTR_IDLE); - memcpy(&m_pdu->data[0], &temp_fill_aostf_data[0], 432); + memcpy(&m_pdu->data[0], &temp_fill_aostf_data_[0], 432); } static void M_PDU_clear_spare_(M_PDU* m_pdu) From 26cad74158c4d7f882441081a1f82a198c787151 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 18:19:16 +0900 Subject: [PATCH 10/87] Update CHANGELOG.md --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca2fbc433..c8ccbd729 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ 注意: これは既存の C2A core update の「リリースの間の Pull Request を眺めてなんとなく察する」という曖昧な操作を緩和していくための試みであり,C2A user に対するお知らせを行う場として使っていくことを意図しています.初めから c2a-core の全変更を取り扱うと不必要に煩雑になるだけになってしまうため,完全な変更内容の一覧についてはこれまで通り [GitHub Releases](https://github.com/arkedge/c2a-core/releases) などから参照してください. +## v4.1.0 (Unreleased) + +### Fixed + +- [#193](https://github.com/arkedge/c2a-core/pull/193): VCDU を AOS transfer frame に rename する + +### Migration Guide +- [#193](https://github.com/arkedge/c2a-core/pull/193): 影響範囲は MOBC のみ + 1. vcdu.c/h を消し,aos_transfer_frame.c/h をコピーする.CMakeLists.txt も修正する + 1. `VCDU` を `AOSTF` に置換する(TLM DB の csv なども) + 1. `vcdu` を `aostf` に置換する(TLM DB の csv なども) + 1. `vcdu.h` を `aos_transfer_frame.h` に置換する(include の修正) + 1. コンパイルが通らないところを直す.想定されるものは以下 + - VCDU 構造体 が AosTransferFrame 構造体に変わったので,変数定義の型名が変わっているはず + ## v4.0.1 (2023-11-09) ### Fixed From 1de745ef74c63d19a1f658fc70d375067afefefc Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 18:30:21 +0900 Subject: [PATCH 11/87] Update CHANGELOG.md --- CHANGELOG.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8ccbd729..338b1093b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,12 @@ ### Migration Guide - [#193](https://github.com/arkedge/c2a-core/pull/193): 影響範囲は MOBC のみ - 1. vcdu.c/h を消し,aos_transfer_frame.c/h をコピーする.CMakeLists.txt も修正する - 1. `VCDU` を `AOSTF` に置換する(TLM DB の csv なども) - 1. `vcdu` を `aostf` に置換する(TLM DB の csv なども) - 1. `vcdu.h` を `aos_transfer_frame.h` に置換する(include の修正) - 1. コンパイルが通らないところを直す.想定されるものは以下 - - VCDU 構造体 が AosTransferFrame 構造体に変わったので,変数定義の型名が変わっているはず + 1. `src_user/tlm_cmd/ccsds/vcdu.{c,h}` を消し,`src_user/tlm_cmd/ccsds/aos_transfer_frame.{c,h}` を `examples/mobc` からコピーする.CMakeLists.txt も修正する. + 1. `VCDU` を `AOSTF` に置換する(TLM DB の csv なども). + 1. `vcdu` を `aostf` に置換する(TLM DB の csv なども). + 1. `vcdu.h` を `aos_transfer_frame.h` に置換する(include の修正). + 1. コンパイルが通らないところを直す.想定されるものは以下. + - `VCDU` 構造体 が `AosTransferFrame` 構造体に変わったので,変数定義の型名が変わっているはず. ## v4.0.1 (2023-11-09) From 2edfb6968667a4a4c740c30da233caf1e67d3f0e Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 00:17:51 +0900 Subject: [PATCH 12/87] add definition of M_PDU --- .../mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c | 19 +++++------ .../mobc/src/src_user/tlm_cmd/ccsds/m_pdu.h | 33 ++++++++++++------- .../src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c | 1 + .../src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h | 1 + 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c index da6fe0133..2cf05733f 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c @@ -1,16 +1,18 @@ #pragma section REPRO +/** + * @file + * @brief CCSDS で規定される M_PDU (Multiplexing Protocol Data Unit) の実装 + * @note 詳細は m_pdu.h を参照 + */ #include "m_pdu.h" - #include "string.h" // for memcpy static void M_PDU_clear_spare_(M_PDU* m_pdu); -void M_PDU_generate_byte_stream(const M_PDU* m_pdu, - uint8_t byte_stream[M_PDU_LEN]) +void M_PDU_generate_byte_stream(const M_PDU* m_pdu, uint8_t byte_stream[M_PDU_LEN]) { memcpy(byte_stream, m_pdu->header, M_PDU_HEADER_SIZE); byte_stream += M_PDU_HEADER_SIZE; - memcpy(byte_stream, m_pdu->data, M_PDU_DATA_SIZE); } @@ -70,8 +72,7 @@ uint16_t M_PDU_get_1st_hdr_ptr(const M_PDU* m_pdu) return ptr; } -void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, - uint16_t ptr) +void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, uint16_t ptr) { unsigned int pos = 0; uint8_t mask = 0x3f; // 00111111b @@ -81,10 +82,7 @@ void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, m_pdu->header[pos + 1] = (uint8_t)(ptr & 0xff); } -void M_PDU_set_data(M_PDU* m_pdu, - const uint8_t* data, - size_t offset, - size_t len) +void M_PDU_set_data(M_PDU* m_pdu, const uint8_t* data, size_t offset, size_t len) { // 指定されたデータ長が上限値を超過する場合は上限値に制限 if (offset + len > M_PDU_DATA_SIZE) @@ -95,4 +93,5 @@ void M_PDU_set_data(M_PDU* m_pdu, // offset以降にデータを書き込む memcpy(m_pdu->data + offset, data, len); } + #pragma section diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.h index 4dc706687..342d260e8 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.h @@ -1,11 +1,27 @@ +/** + * @file + * @brief CCSDS で規定される M_PDU (Multiplexing Protocol Data Unit) の実装 + * @note packet 構造 + * |---------+-------+-------+--------------------------| + * | Pos | Pos | Size | Name | + * | [octet] | [bit] | [bit] | | + * |---------+-------+-------+--------------------------| + * | === Header ========================================| + * |---------+-------+-------+--------------------------| + * | 0 | 0 | 5 | Reserved Spare | + * | 0 | 5 | 11 | First Header Pointer | + * |---------+-------+-------+--------------------------| + * | === Packet Zone ===================================| + * |---------+-------+-------+--------------------------| + * | 2 | 0 | * | いくつかの Space Packet | + * |---------+-------+-------+--------------------------| + */ #ifndef M_PDU_H_ #define M_PDU_H_ - #include #include - #define M_PDU_HEADER_SIZE (2u) #define M_PDU_DATA_SIZE (432u) #define M_PDU_LEN (M_PDU_HEADER_SIZE + M_PDU_DATA_SIZE) @@ -22,21 +38,16 @@ typedef enum M_PDU_PTR_IDLE = 0x7fe // 11111111110b } M_PDU_PTR; -void M_PDU_generate_byte_stream(const M_PDU* m_pdu, - uint8_t byte_stream[M_PDU_LEN]); +void M_PDU_generate_byte_stream(const M_PDU* m_pdu, uint8_t byte_stream[M_PDU_LEN]); void M_PDU_setup_idle_m_pdu(M_PDU* m_pdu); uint16_t M_PDU_get_1st_hdr_ptr(const M_PDU* m_pdu); -void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, - uint16_t ptr); +void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, uint16_t ptr); const uint8_t* M_PDU_get_data_head(const M_PDU* m_pdu); -void M_PDU_set_data(M_PDU* m_pdu, - const uint8_t* data, - size_t offset, - size_t len); +void M_PDU_set_data(M_PDU* m_pdu, const uint8_t* data, size_t offset, size_t len); -#endif // M_PDU_H_ +#endif diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c index d2fccd9c9..b5aeed6db 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c @@ -2,6 +2,7 @@ /** * @file * @brief PacketList から TCPacket を取ってきてそれを送信可能な M_PDU へと変換する + * @note FIXME: これはリファクタしてなんとかしたい・・・ */ #include "tcp_to_m_pdu.h" diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h index ba9df4491..a10f1c718 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h @@ -1,6 +1,7 @@ /** * @file * @brief PacketList から TCPacket を取ってきてそれを送信可能な M_PDU へと変換する + * @note FIXME: これはリファクタしてなんとかしたい・・・ */ #ifndef TCP_TO_M_PDU_H_ #define TCP_TO_M_PDU_H_ From cc6d22f7f5a09edb2fa75c83f583127118b789ae Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 00:21:35 +0900 Subject: [PATCH 13/87] rename file M_PDU to multiplexing_protocol_data_unit --- .../ccsds/{m_pdu.c => multiplexing_protocol_data_unit.c} | 4 ++-- .../ccsds/{m_pdu.h => multiplexing_protocol_data_unit.h} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename examples/mobc/src/src_user/tlm_cmd/ccsds/{m_pdu.c => multiplexing_protocol_data_unit.c} (97%) rename examples/mobc/src/src_user/tlm_cmd/ccsds/{m_pdu.h => multiplexing_protocol_data_unit.h} (95%) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c similarity index 97% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c rename to examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c index 2cf05733f..7349c06e5 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c @@ -2,9 +2,9 @@ /** * @file * @brief CCSDS で規定される M_PDU (Multiplexing Protocol Data Unit) の実装 - * @note 詳細は m_pdu.h を参照 + * @note 詳細は multiplexing_protocol_data_unit.h を参照 */ -#include "m_pdu.h" +#include "multiplexing_protocol_data_unit.h" #include "string.h" // for memcpy static void M_PDU_clear_spare_(M_PDU* m_pdu); diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h similarity index 95% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.h rename to examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h index 342d260e8..3e0db3e33 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/m_pdu.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h @@ -16,8 +16,8 @@ * | 2 | 0 | * | いくつかの Space Packet | * |---------+-------+-------+--------------------------| */ -#ifndef M_PDU_H_ -#define M_PDU_H_ +#ifndef MULTIPLEXING_PROTOCOL_DATA_UNIT_H_ +#define MULTIPLEXING_PROTOCOL_DATA_UNIT_H_ #include #include From c66faff4f7381e6d22b2f3cb4f6d522507956b3b Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 00:23:42 +0900 Subject: [PATCH 14/87] fix small --- .../tlm_cmd/ccsds/multiplexing_protocol_data_unit.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h index 3e0db3e33..f84bc228a 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h @@ -22,9 +22,9 @@ #include #include -#define M_PDU_HEADER_SIZE (2u) -#define M_PDU_DATA_SIZE (432u) -#define M_PDU_LEN (M_PDU_HEADER_SIZE + M_PDU_DATA_SIZE) +#define M_PDU_HEADER_SIZE (2u) +#define M_PDU_DATA_SIZE (432u) +#define M_PDU_LEN (M_PDU_HEADER_SIZE + M_PDU_DATA_SIZE) typedef struct { @@ -34,8 +34,8 @@ typedef struct typedef enum { - M_PDU_PTR_NO_HDR = 0x07ff, // 11111111111b - M_PDU_PTR_IDLE = 0x7fe // 11111111110b + M_PDU_PTR_NO_HDR = 0x07ff, // 11111111111b + M_PDU_PTR_IDLE = 0x7fe // 11111111110b } M_PDU_PTR; void M_PDU_generate_byte_stream(const M_PDU* m_pdu, uint8_t byte_stream[M_PDU_LEN]); @@ -46,7 +46,8 @@ uint16_t M_PDU_get_1st_hdr_ptr(const M_PDU* m_pdu); void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, uint16_t ptr); -const uint8_t* M_PDU_get_data_head(const M_PDU* m_pdu); +// FIXME: 存在しなかったためコメントアウトした +// const uint8_t* M_PDU_get_data_head(const M_PDU* m_pdu); void M_PDU_set_data(M_PDU* m_pdu, const uint8_t* data, size_t offset, size_t len); From 8109377189d30939f1e5d0359efba87b0f432ece Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 00:28:24 +0900 Subject: [PATCH 15/87] sed M_PDU to MultiplexingProtocolDataUnit --- .../src_user/tlm_cmd/ccsds/aos_transfer_frame.h | 6 +++--- .../ccsds/multiplexing_protocol_data_unit.c | 14 +++++++------- .../ccsds/multiplexing_protocol_data_unit.h | 14 +++++++------- .../mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c | 2 +- .../mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h index 6fd03cee7..a2f066b76 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h @@ -49,9 +49,9 @@ typedef struct { - uint8_t header[AOSTF_HEADER_SIZE]; - M_PDU m_pdu; - uint8_t trailer[AOSTF_TRAILER_SIZE]; + uint8_t header[AOSTF_HEADER_SIZE]; + MultiplexingProtocolDataUnit m_pdu; + uint8_t trailer[AOSTF_TRAILER_SIZE]; } AosTransferFrame; typedef enum diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c index 7349c06e5..6140b8c99 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c @@ -7,16 +7,16 @@ #include "multiplexing_protocol_data_unit.h" #include "string.h" // for memcpy -static void M_PDU_clear_spare_(M_PDU* m_pdu); +static void M_PDU_clear_spare_(MultiplexingProtocolDataUnit* m_pdu); -void M_PDU_generate_byte_stream(const M_PDU* m_pdu, uint8_t byte_stream[M_PDU_LEN]) +void M_PDU_generate_byte_stream(const MultiplexingProtocolDataUnit* m_pdu, uint8_t byte_stream[M_PDU_LEN]) { memcpy(byte_stream, m_pdu->header, M_PDU_HEADER_SIZE); byte_stream += M_PDU_HEADER_SIZE; memcpy(byte_stream, m_pdu->data, M_PDU_DATA_SIZE); } -void M_PDU_setup_idle_m_pdu(M_PDU* m_pdu) +void M_PDU_setup_idle_m_pdu(MultiplexingProtocolDataUnit* m_pdu) { static uint8_t temp_fill_aostf_data_[432] = { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, @@ -52,7 +52,7 @@ void M_PDU_setup_idle_m_pdu(M_PDU* m_pdu) memcpy(&m_pdu->data[0], &temp_fill_aostf_data_[0], 432); } -static void M_PDU_clear_spare_(M_PDU* m_pdu) +static void M_PDU_clear_spare_(MultiplexingProtocolDataUnit* m_pdu) { unsigned int pos = 0; uint8_t mask = 0xf8; // 11111000b @@ -60,7 +60,7 @@ static void M_PDU_clear_spare_(M_PDU* m_pdu) m_pdu->header[pos] &= (uint8_t)(~mask); } -uint16_t M_PDU_get_1st_hdr_ptr(const M_PDU* m_pdu) +uint16_t M_PDU_get_1st_hdr_ptr(const MultiplexingProtocolDataUnit* m_pdu) { unsigned int pos = 0; uint8_t mask = 0x3f; // 00111111b @@ -72,7 +72,7 @@ uint16_t M_PDU_get_1st_hdr_ptr(const M_PDU* m_pdu) return ptr; } -void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, uint16_t ptr) +void M_PDU_set_1st_hdr_ptr(MultiplexingProtocolDataUnit* m_pdu, uint16_t ptr) { unsigned int pos = 0; uint8_t mask = 0x3f; // 00111111b @@ -82,7 +82,7 @@ void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, uint16_t ptr) m_pdu->header[pos + 1] = (uint8_t)(ptr & 0xff); } -void M_PDU_set_data(M_PDU* m_pdu, const uint8_t* data, size_t offset, size_t len) +void M_PDU_set_data(MultiplexingProtocolDataUnit* m_pdu, const uint8_t* data, size_t offset, size_t len) { // 指定されたデータ長が上限値を超過する場合は上限値に制限 if (offset + len > M_PDU_DATA_SIZE) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h index f84bc228a..800af2152 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h @@ -30,7 +30,7 @@ typedef struct { uint8_t header[M_PDU_HEADER_SIZE]; uint8_t data[M_PDU_DATA_SIZE]; -} M_PDU; +} MultiplexingProtocolDataUnit; typedef enum { @@ -38,17 +38,17 @@ typedef enum M_PDU_PTR_IDLE = 0x7fe // 11111111110b } M_PDU_PTR; -void M_PDU_generate_byte_stream(const M_PDU* m_pdu, uint8_t byte_stream[M_PDU_LEN]); +void M_PDU_generate_byte_stream(const MultiplexingProtocolDataUnit* m_pdu, uint8_t byte_stream[M_PDU_LEN]); -void M_PDU_setup_idle_m_pdu(M_PDU* m_pdu); +void M_PDU_setup_idle_m_pdu(MultiplexingProtocolDataUnit* m_pdu); -uint16_t M_PDU_get_1st_hdr_ptr(const M_PDU* m_pdu); +uint16_t M_PDU_get_1st_hdr_ptr(const MultiplexingProtocolDataUnit* m_pdu); -void M_PDU_set_1st_hdr_ptr(M_PDU* m_pdu, uint16_t ptr); +void M_PDU_set_1st_hdr_ptr(MultiplexingProtocolDataUnit* m_pdu, uint16_t ptr); // FIXME: 存在しなかったためコメントアウトした -// const uint8_t* M_PDU_get_data_head(const M_PDU* m_pdu); +// const uint8_t* M_PDU_get_data_head(const MultiplexingProtocolDataUnit* m_pdu); -void M_PDU_set_data(M_PDU* m_pdu, const uint8_t* data, size_t offset, size_t len); +void M_PDU_set_data(MultiplexingProtocolDataUnit* m_pdu, const uint8_t* data, size_t offset, size_t len); #endif diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c index b5aeed6db..51cdf1400 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c @@ -24,7 +24,7 @@ void T2M_initialize(TcpToMPdu* tcp_to_m_pdu) return; } -T2M_ACK T2M_form_m_pdu(TcpToMPdu* tcp_to_m_pdu, PacketList* pl, M_PDU* m_pdu) +T2M_ACK T2M_form_m_pdu(TcpToMPdu* tcp_to_m_pdu, PacketList* pl, MultiplexingProtocolDataUnit* m_pdu) { // M_PDUが完成する or TC Packetがなくなるまで実施 while (tcp_to_m_pdu->m_pdu_wp != M_PDU_DATA_SIZE) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h index a10f1c718..cfd3d35bc 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h @@ -53,6 +53,6 @@ void T2M_initialize(TcpToMPdu* tcp_to_m_pdu); * @param[out] m_pdu: 生成される M_PDU * @return T2M_ACK */ -T2M_ACK T2M_form_m_pdu(TcpToMPdu* tcp_to_m_pdu, PacketList* pl, M_PDU* m_pdu); +T2M_ACK T2M_form_m_pdu(TcpToMPdu* tcp_to_m_pdu, PacketList* pl, MultiplexingProtocolDataUnit* m_pdu); #endif From c1f76ba79b6ae40d9a2b711963df9d98ac126f2c Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 00:29:51 +0900 Subject: [PATCH 16/87] Update CMakeLists.txt --- examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt b/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt index a88e26e87..0fbae1a07 100644 --- a/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt +++ b/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt @@ -15,7 +15,7 @@ set(C2A_SRCS normal_block_command_definition/nbc_respond_eh_for_test.c normal_block_command_definition/nbc_test_bcl.c ccsds/aos_transfer_frame.c - ccsds/m_pdu.c + ccsds/multiplexing_protocol_data_unit.c ccsds/tc_transfer_frame.c ccsds/tcp_to_m_pdu.c ccsds/tc_segment.c From 69c8466afda18659d70a96097ef308d384c04db9 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 00:32:19 +0900 Subject: [PATCH 17/87] fix include --- examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h | 2 +- examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h index a2f066b76..796086d3a 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h @@ -40,7 +40,7 @@ #ifndef AOS_TRANSFER_FRAME_H_ #define AOS_TRANSFER_FRAME_H_ -#include "m_pdu.h" +#include "multiplexing_protocol_data_unit.h" #define AOSTF_HEADER_SIZE (6u) #define AOSTF_TRAILER_SIZE (4u) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h index cfd3d35bc..c0da712de 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h @@ -11,7 +11,7 @@ #include // for size_t #include -#include "m_pdu.h" +#include "multiplexing_protocol_data_unit.h" #include /** From a63e64f04a540abc29409e261082287735e12f0a Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 18:27:48 +0900 Subject: [PATCH 18/87] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 338b1093b..d250105a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Fixed - [#193](https://github.com/arkedge/c2a-core/pull/193): VCDU を AOS transfer frame に rename する +- [#197](https://github.com/arkedge/c2a-core/pull/197): M_PDU をコード規約に合わせるなどのリファクタ ### Migration Guide - [#193](https://github.com/arkedge/c2a-core/pull/193): 影響範囲は MOBC のみ @@ -16,6 +17,11 @@ 1. `vcdu.h` を `aos_transfer_frame.h` に置換する(include の修正). 1. コンパイルが通らないところを直す.想定されるものは以下. - `VCDU` 構造体 が `AosTransferFrame` 構造体に変わったので,変数定義の型名が変わっているはず. +- [#197](https://github.com/arkedge/c2a-core/pull/197): 影響範囲は MOBC のみ + 1. `src_user/tlm_cmd/ccsds/m_pdu.{c,h}` を消し,`src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.{c,h}` をコピーする. `CMakeLists.txt` も修正する. + 1. `m_pdu.h` を `multiplexing_protocol_data_unit.h` に置換する(include の修正). + 1. コンパイルが通らないところを直す.想定されるものは以下. + - `M_PDU` 構造体 が `MultiplexingProtocolDataUnit` 構造体に変わったので,変数定義の型名が変わっているはず. ## v4.0.1 (2023-11-09) From 594b543e274c6dcac41d8a59b5f9ed62c2f02ca0 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 9 Nov 2023 18:31:46 +0900 Subject: [PATCH 19/87] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d250105a4..1c3f37087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,14 +11,14 @@ ### Migration Guide - [#193](https://github.com/arkedge/c2a-core/pull/193): 影響範囲は MOBC のみ - 1. `src_user/tlm_cmd/ccsds/vcdu.{c,h}` を消し,`src_user/tlm_cmd/ccsds/aos_transfer_frame.{c,h}` を `examples/mobc` からコピーする.CMakeLists.txt も修正する. + 1. `src_user/tlm_cmd/ccsds/vcdu.{c,h}` を消し,`src_user/tlm_cmd/ccsds/aos_transfer_frame.{c,h}` を `examples/mobc` からコピーする. `CMakeLists.txt` も修正する. 1. `VCDU` を `AOSTF` に置換する(TLM DB の csv なども). 1. `vcdu` を `aostf` に置換する(TLM DB の csv なども). 1. `vcdu.h` を `aos_transfer_frame.h` に置換する(include の修正). 1. コンパイルが通らないところを直す.想定されるものは以下. - `VCDU` 構造体 が `AosTransferFrame` 構造体に変わったので,変数定義の型名が変わっているはず. - [#197](https://github.com/arkedge/c2a-core/pull/197): 影響範囲は MOBC のみ - 1. `src_user/tlm_cmd/ccsds/m_pdu.{c,h}` を消し,`src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.{c,h}` をコピーする. `CMakeLists.txt` も修正する. + 1. `src_user/tlm_cmd/ccsds/m_pdu.{c,h}` を消し,`src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.{c,h}` を `examples/mobc` からコピーする. `CMakeLists.txt` も修正する. 1. `m_pdu.h` を `multiplexing_protocol_data_unit.h` に置換する(include の修正). 1. コンパイルが通らないところを直す.想定されるものは以下. - `M_PDU` 構造体 が `MultiplexingProtocolDataUnit` 構造体に変わったので,変数定義の型名が変わっているはず. From 5856cfdde4722d17bd69af11782c2f8c266f39a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:40:24 +0000 Subject: [PATCH 20/87] Update Rust crate bindgen to 0.69.1 --- library/bind-utils/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/bind-utils/Cargo.toml b/library/bind-utils/Cargo.toml index e802a5ee7..bbb1c799c 100644 --- a/library/bind-utils/Cargo.toml +++ b/library/bind-utils/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" license = "MIT" [dependencies] -bindgen = "0.68.1" +bindgen = "0.69.1" doxygen-rs = "0.4.2" From 1a4a3c6a6fdd75d8866b795de38e812df28ae225 Mon Sep 17 00:00:00 2001 From: sksat Date: Thu, 9 Nov 2023 14:33:48 +0900 Subject: [PATCH 21/87] Revert "Merge pull request #580 from ut-issl/feature/export-src-dir-via-cargo" This reverts commit db74c2892b698e24d31a94080a46211e6c664600, reversing changes made to 7497a8e8fc06e9792c07fdd0d3232481ab629b9a. --- Cargo.toml | 2 -- build.rs | 2 -- 2 files changed, 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e093b9f42..63282d505 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,8 +32,6 @@ name = "c2a-core" version.workspace = true edition = "2021" -links = "c2a-core" - description = "Core of Command Centric Architecture" readme = "README.md" license = "MIT" diff --git a/build.rs b/build.rs index f849f281e..0315f33da 100644 --- a/build.rs +++ b/build.rs @@ -7,8 +7,6 @@ use semver::Version; use clang::{token::TokenKind::Punctuation, Clang, Index}; fn main() { - println!("cargo:source_dir={}", env!("CARGO_MANIFEST_DIR")); - let ver = env!("CARGO_PKG_VERSION"); let ver = Version::parse(ver).unwrap(); dbg!(&ver); From b873940fc72c6001e84aa7c0b5e8f3e8031e5f31 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 17:20:27 +0900 Subject: [PATCH 22/87] more match script migration (for CMakeLists.txt or .github/workflows) --- script/migration/v4-rename-script.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/migration/v4-rename-script.sh b/script/migration/v4-rename-script.sh index abf4a02cf..bf7354983 100755 --- a/script/migration/v4-rename-script.sh +++ b/script/migration/v4-rename-script.sh @@ -28,14 +28,14 @@ mv src/src_user/script/CI src/src_user/script/ci mv src/src_user/script/Git src/src_user/script/git echo "rename ref: src_user/Script -> src_user/script" -find_all | xargs -0 sed -i -e "s#src_user/Script/AddSection#src_user/script/add_section#g" -find_all | xargs -0 sed -i -e "s#src_user\\\Script\\\AddSection#src_user\\\script\\\add_section#g" +find_all | xargs -0 sed -i -e "s#Script/AddSection#script/add_section#g" +find_all | xargs -0 sed -i -e "s#Script\\\AddSection#script\\\add_section#g" -find_all | xargs -0 sed -i -e "s#src_user/Script/CI#src_user/script/ci#g" -find_all | xargs -0 sed -i -e "s#src_user\\\Script\\\CI#src_user\\\script\\\ci#g" +find_all | xargs -0 sed -i -e "s#Script/CI#script/ci#g" +find_all | xargs -0 sed -i -e "s#Script\\\CI#script\\\ci#g" -find_all | xargs -0 sed -i -e "s#src_user/Script/Git#src_user/script/git#g" -find_all | xargs -0 sed -i -e "s#src_user\\\Script\\\Git#src_user\\\script\\\git#g" +find_all | xargs -0 sed -i -e "s#Script/Git#script/git#g" +find_all | xargs -0 sed -i -e "s#Script\\\Git#script\\\git#g" find_all | xargs -0 sed -i -e "s#src_user/Script#src_user/script#g" find_all | xargs -0 sed -i -e "s#src_user\\\Script#src_user\\\script#g" From d509075a0ba67eb975ec53bcca8740e590e032d3 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 17:51:39 +0900 Subject: [PATCH 23/87] fix typo in v4 applications rename --- script/migration/v4-rename-applications.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/migration/v4-rename-applications.sh b/script/migration/v4-rename-applications.sh index 4eac9c73a..18a90dc5d 100755 --- a/script/migration/v4-rename-applications.sh +++ b/script/migration/v4-rename-applications.sh @@ -1,5 +1,5 @@ #!/bin/bash -echo "Script -> script migration" +echo "Applications -> applications migration" function find_all() { find . -name "*" -not \( -path "*/.git/*" -o -path "*/src_core/*" -o -path "*.xlsm" \) -type f -print0 @@ -56,7 +56,7 @@ echo "rename ref: UserDefined" for ((i=0; i<${#user_defined_org[@]}; i++)); do echo " ${user_defined_org[i]} -> ${user_defined_new[i]}" - find_all | xargs -0 sed -i -e "s#UserDefined/${drv_org[i]}#user_defined/${drv_new[i]}#g" + find_all | xargs -0 sed -i -e "s#UserDefined/${user_defined_org[i]}#user_defined/${user_defined_new[i]}#g" find_all | xargs -0 sed -i -e "s#UserDefined\\\${drv_org}#user_defined\\\${drv_new}#g" done From 79520154db36b7f38ed8877ee1ec494c689229c1 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 18:10:15 +0900 Subject: [PATCH 24/87] fix v4 applications rename order --- script/migration/v4-rename-applications.sh | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/script/migration/v4-rename-applications.sh b/script/migration/v4-rename-applications.sh index 18a90dc5d..63ce2bd0f 100755 --- a/script/migration/v4-rename-applications.sh +++ b/script/migration/v4-rename-applications.sh @@ -36,32 +36,32 @@ done echo "rename ref: Applications/*" +echo " DriverInstances -> driver_instances" find_all | xargs -0 sed -i -e "s#Applications/DriverInstances#applications/driver_instances#g" find_all | xargs -0 sed -i -e "s#Applications\\\DriverInstances#applications\\\driver_instances#g" +find_all | xargs -0 sed -i -e "s#DriverInstances/#driver_instances/#g" +echo " Middleware -> middleware" find_all | xargs -0 sed -i -e "s#Applications/Middleware#applications/middleware#g" find_all | xargs -0 sed -i -e "s#Applications\\\Middleware#applications\\\middleware#g" - -find_all | xargs -0 sed -i -e "s#Applications/UserDefined#applications/user_defined#g" -find_all | xargs -0 sed -i -e "s#Applications\\\UserDefined#applications\\\user_defined#g" - -find_all | xargs -0 sed -i -e "s#/Applications#/applications#g" -find_all | xargs -0 sed -i -e "s#\\\Applications#\\\applications#g" - -# CMake -find_all | xargs -0 sed -i -e "s#DriverInstances/#driver_instances/#g" find_all | xargs -0 sed -i -e "s#Middleware/#middleware/#g" -echo "rename ref: UserDefined" +echo " UserDefined -> user_defined" for ((i=0; i<${#user_defined_org[@]}; i++)); do - echo " ${user_defined_org[i]} -> ${user_defined_new[i]}" + echo " ${user_defined_org[i]} -> ${user_defined_new[i]}" find_all | xargs -0 sed -i -e "s#UserDefined/${user_defined_org[i]}#user_defined/${user_defined_new[i]}#g" - find_all | xargs -0 sed -i -e "s#UserDefined\\\${drv_org}#user_defined\\\${drv_new}#g" + find_all | xargs -0 sed -i -e "s#UserDefined\\\${user_defined_org[i]}#user_defined\\\${user_defined_new[i]}#g" done - +echo " ." +find_all | xargs -0 sed -i -e "s#Applications/UserDefined#applications/user_defined#g" +find_all | xargs -0 sed -i -e "s#Applications\\\UserDefined#applications\\\user_defined#g" find_all | xargs -0 sed -i -e "s#UserDefined/#user_defined/#g" +echo " ." +find_all | xargs -0 sed -i -e "s#/Applications#/applications#g" +find_all | xargs -0 sed -i -e "s#\\\Applications#\\\applications#g" + # Settings echo "rename dir: src_user/Settings/Applications -> src_user/Settings/applications" mv src/src_user/Settings/Applications src/src_user/Settings/applications From 24ed586e957c264fa178ea4e640318c58926449c Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 18:40:03 +0900 Subject: [PATCH 25/87] more match system migration for src/src_user/Settings --- script/migration/v4-rename-system.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/migration/v4-rename-system.sh b/script/migration/v4-rename-system.sh index 3c4ccdbc9..ed91f7534 100755 --- a/script/migration/v4-rename-system.sh +++ b/script/migration/v4-rename-system.sh @@ -41,11 +41,11 @@ mv src/src_user/Settings/system/EventHandlerRules src/src_user/Settings/system/e find_settings | xargs -0 sed -i -e "s#System/EventHandlerRules#system/event_handler_rules#g" find_settings | xargs -0 sed -i -e "s#System#system#g" -find_all | xargs -0 sed -i -e "s#src_user/Settings/System/EventHandlerRules#src_user/Setting/system/event_handler_rules#g" -find_all | xargs -0 sed -i -e "s#src_user\\\Settings\\\System\\\EventHandlerRules#src_user\\\Settings\\\system\\\event_handler_rules#g" +find_all | xargs -0 sed -i -e "s#Settings/System/EventHandlerRules#Setting/system/event_handler_rules#g" +find_all | xargs -0 sed -i -e "s#Settings\\\System\\\EventHandlerRules#Settings\\\system\\\event_handler_rules#g" -find_all | xargs -0 sed -i -e "s#src_user/Settings/System#src_user/Settings/system#g" -find_all | xargs -0 sed -i -e "s#src_user\\\Settings\\\System#src_user\\\Settings\\\system#g" +find_all | xargs -0 sed -i -e "s#Settings/System#Settings/system#g" +find_all | xargs -0 sed -i -e "s#Settings\\\System#Settings\\\system#g" # Test echo "rename test dir: test/src_core/System -> test/src_core/system" From ca7092bc7a30991a3e36d6da251d7bcb568cbc09 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 21:02:30 +0900 Subject: [PATCH 26/87] move Doxygen config to c2a-core repo top --- examples/mobc/Doxyfile => Doxyfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/mobc/Doxyfile => Doxyfile (100%) diff --git a/examples/mobc/Doxyfile b/Doxyfile similarity index 100% rename from examples/mobc/Doxyfile rename to Doxyfile From 936bba9b1618a39c8fed3f2fb76b492a7e560288 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 21:08:23 +0900 Subject: [PATCH 27/87] change doxygen output dir to repo internal --- Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 01623aba1..6f237161e 100644 --- a/Doxyfile +++ b/Doxyfile @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../../../../docs/c2a-core +OUTPUT_DIRECTORY = docs/ # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and From b57868805921b12fd3492bbf3b5b5110a12d18d4 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 21:10:10 +0900 Subject: [PATCH 28/87] include examples/mobc/src/src_user in Doxygen --- Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 6f237161e..33e107aa2 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2220,7 +2220,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = examples/mobc/src/ # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the From baf665449af82f19a43915a94ebb620e048592a3 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 21:10:59 +0900 Subject: [PATCH 29/87] ignore Doxygen generated files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index b12c15a01..25fb000d2 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,7 @@ tlmcmddb*.json # Added by cargo /target /Cargo.lock + +# Doxygen +doxygen.log +docs/html/ From 79be1f151d7f671f4d3377e121d404e792320149 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 21:23:05 +0900 Subject: [PATCH 30/87] exclude Doxygen stdint_wrapper --- Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 33e107aa2..c2effb195 100644 --- a/Doxyfile +++ b/Doxyfile @@ -918,7 +918,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = library/stdint_wrapper/ # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded From 9f6d4f0a512faa5d2342af1a97599581626d622a Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 14 Nov 2023 15:08:14 +0900 Subject: [PATCH 31/87] fix v4 system rename typo --- script/migration/v4-rename-system.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/migration/v4-rename-system.sh b/script/migration/v4-rename-system.sh index ed91f7534..fd12c617d 100755 --- a/script/migration/v4-rename-system.sh +++ b/script/migration/v4-rename-system.sh @@ -41,7 +41,7 @@ mv src/src_user/Settings/system/EventHandlerRules src/src_user/Settings/system/e find_settings | xargs -0 sed -i -e "s#System/EventHandlerRules#system/event_handler_rules#g" find_settings | xargs -0 sed -i -e "s#System#system#g" -find_all | xargs -0 sed -i -e "s#Settings/System/EventHandlerRules#Setting/system/event_handler_rules#g" +find_all | xargs -0 sed -i -e "s#Settings/System/EventHandlerRules#Settings/system/event_handler_rules#g" find_all | xargs -0 sed -i -e "s#Settings\\\System\\\EventHandlerRules#Settings\\\system\\\event_handler_rules#g" find_all | xargs -0 sed -i -e "s#Settings/System#Settings/system#g" From 2c29c361c9d8bb0840549c919ef12d64e5107622 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 06:19:47 +0000 Subject: [PATCH 32/87] Update dependency ut-issl/s2e-core to v7.1.0 --- .github/workflows/build_with_s2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_with_s2e.yml b/.github/workflows/build_with_s2e.yml index 0ac5e1485..8cb8f26eb 100644 --- a/.github/workflows/build_with_s2e.yml +++ b/.github/workflows/build_with_s2e.yml @@ -9,7 +9,7 @@ on: env: # renovate: datasource=github-releases depName=ut-issl/s2e-core - S2E_CORE_VERSION: v7.0.1 + S2E_CORE_VERSION: v7.1.0 jobs: build_s2e_win: From ba96d82921acc9a40a942321f005b36031a14710 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 14 Nov 2023 17:54:17 +0900 Subject: [PATCH 33/87] more match v4 tlmcmd rename migration --- script/migration/v4-rename-tlmcmd.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/migration/v4-rename-tlmcmd.sh b/script/migration/v4-rename-tlmcmd.sh index d9dd409ab..aa1a1e436 100755 --- a/script/migration/v4-rename-tlmcmd.sh +++ b/script/migration/v4-rename-tlmcmd.sh @@ -38,7 +38,9 @@ find_all | xargs -0 sed -i -e "s#TlmCmd\\\#tlm_cmd\\\#g" # CMake echo "rename ref: TlmCmd/*" find_all | xargs -0 sed -i -e "s#Ccsds/#ccsds/#g" +find_all | xargs -0 sed -i -e "s#Ccsds\\\#ccsds\\\#g" find_all | xargs -0 sed -i -e "s#NormalBlockCommandDefinition/#normal_block_command_definition/#g" +find_all | xargs -0 sed -i -e "s#NormalBlockCommandDefinition\\\#normal_block_command_definition\\\#g" # Settings echo "rename settings dir: Settings/TlmCmd -> Settings/tlm_cmd" From 44c6cc9ac00c0429f538bca95b1b60c9696b2503 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 21 Nov 2023 03:23:48 +0900 Subject: [PATCH 34/87] refactor release rule --- docs/general/release.md | 84 +++++++++++++---------------------------- 1 file changed, 27 insertions(+), 57 deletions(-) diff --git a/docs/general/release.md b/docs/general/release.md index 10ecda630..cdd941ace 100644 --- a/docs/general/release.md +++ b/docs/general/release.md @@ -1,79 +1,49 @@ # Release -## リリース -現在, `main` ブランチがリリースブランチとなっている. -リリースには,本 Release と Pre-release の2つを設ける. +デフォルトのリリースブランチは `main` とする. -- 本 Release - - まとまった機能更新のリリース. - - バージョンを上げる. - - `v3.4.0` → `v3.5.0` など -- Pre-release - - [Tools/Overview](../tools/overview.md) などに対して非互換なアップデートが入った場合や,Bug fix や 大きな機能更新などで,本 Release 前に User サイドで最新の Core が必要になることが予想される際のリリース. - - `beta` をリリースする. - - `v3.4.0` → `v3.5.0-beta.0` など - - なお,メジャーバージョンアップ中では様々な破壊的な変更が連続するため,煩雑さ低減のためにツール等の互換性維持のための Pre-release は,一定程度免除することが可能である. +また,主な開発とは別に,既存のリリースに対するメンテナンスのためのリリースを行う際は `stable-4.1` のようなブランチを切ってリリースブランチとする. -リリースの手順は以下のようにする. +互換性の維持は基本的には(Pre Release ではない)本 Release を対象に行う. +ただし,[Tools](../tools/overview.md) などの外部プロジェクトに対して非互換となるような大きな変更を入れる際には,その変更をマージした時点で Pre Release を行うものとする. -### 本 Release +これは [Tools](../tools/overview.md) などのテストを迅速に行ったり,(非推奨ではあるが)Pre Release なバージョンの c2a-core を使っている C2A user で使用する [Tools](../tools/overview.md) などのバージョンを明らかにするための処置となる. +そのため,破壊的な変更が多く発生することが明らかな major update 中には,煩雑さ軽減のためこの処置は一定程度免除してもよいものとする. -1. バージョン番号をインクリメントする PR (Pull Request) を発行し,`develop` ブランチへ merge する. - - [c2a_core_main.h](https://github.com/arkedge/c2a-core/blob/develop/c2a_core_main.h) 内の `C2A_CORE_VER_*` をインクリメントする. - - [Cargo.toml](https://github.com/arkedge/c2a-core/blob/develop/Cargo.toml) 内の `workspace.package.version` をインクリメントする. +## Release 手順 + +1. バージョン番号をインクリメントする + - [c2a_core_main.h](https://github.com/arkedge/c2a-core/blob/main/c2a_core_main.h) 内の `C2A_CORE_VER_*` をインクリメントする. + - Pre Release でない場合,`#define C2A_CORE_VER_PRE` は `("")` とする. + - Pre Release のときは `#define C2A_CORE_VER_PRE` に `("beta.0")` などをセットする. + - [Cargo.toml](https://github.com/arkedge/c2a-core/blob/main/Cargo.toml) 内の `workspace.package.version` をインクリメントする. +1. リリースのための PR (Pull Request) をリリースブランチに発行する - この後リリースを控えるので,念の為すべてのテストを再度回す. - - `#define C2A_CORE_VER_PRE` は `("")` とする. - PR タイトルは `Update version (v3.4.0)` のようにする. - - 例: https://github.com/ut-issl/c2a-core/pulls?q=is%3Apr+Update+version -1. バージョン上げ PR が merge されたら,直ちに(他の PR を止め) `develop` から `main` に PR を発行し,すべてのテストを回し, merge する. - - PR タイトルは以下のようにする. - - `Update main (v3.4.0) on 2021-12-31` - - `Update main (v3.4.0) on 2021-12-31 - ほげほげ` - PR のディスクリプションは [これ](https://github.com/ut-issl/c2a-core/pull/151) のように書く. - - 例: https://github.com/ut-issl/c2a-core/pulls?q=is%3Apr+Update+main -1. [tag](https://github.com/ut-issl/c2a-core/tags) を打ち, [release](https://github.com/ut-issl/c2a-core/releases) を発行する. + - 例: https://github.com/arkedge/c2a-core/pulls?q=is%3Apr+Update+version +1. リリースのための PR を merge して,その merge commit に [Git tag](https://github.com/arkedge/c2a-core/tags) を打つ - tag 名は `v3.4.0` のようにする. - - release 名は `v3.4.0` や `v3.3.1 初版` のようにする. - - release には以下を含める. - - Release Note として簡潔な更新差分の箇条書き - - `main` に merge したときの PR のリンク -1. `cargo publish` する. - -これを,だいたい以下のような粒度で行う. - -- 最後のリリースからおおよそ1ヶ月程度が経過した場合(更新が少ない場合を除く) -- まとまった機能実装が一段落した場合 - -ただし,あるまとまった機能の実装の PR が複数に分割され,一部がまだ merge されていない場合はリリースを控えること. - -### Pre-release -1. ある `feature` ブランチから `develop` ブランチへの PR が発行されたとき,それが Pre-release に相当する場合,その PR は Pre-release PR と呼び,次のような手順を踏む. - - PR タイトルは以下のようにする. - - `Pre Release (v3.5.0-beta.0): 通常のPRのタイトル` - - 対応する Tools の PR のリンクを貼る. - - `#define C2A_CORE_VER_PRE` に `("beta.0")` などをセットする. - - 本 Release 後最初の Pre-release の場合, `C2A_CORE_VER_*` をインクリメントする. - - [Cargo.toml](https://github.com/arkedge/c2a-core/blob/develop/Cargo.toml) 内の `package.version` を同様にインクリメントする. - - 例: https://github.com/ut-issl/c2a-core/pulls?q=is%3Apr+Pre+Release -1. [tag](https://github.com/ut-issl/c2a-core/tags) を打ち, [release](https://github.com/ut-issl/c2a-core/releases) を Pre-release として発行する. - - Pre-release PR を merge したその merge commit(`develop` ブランチ上)で tag を打つ. - - tag 名は `v3.5.0-beta.0` のようにする. - - release 名は `v3.5.0-beta.0` のようにする. - - release には以下を含める. - - 非互換となった Tools の新しい バージョン (Release) へのリンク - - `develop` に merge したときの PR のリンク + - Pre Release のときは `v3.5.0-beta.0` のようにする. 1. `cargo publish` する. +1. [GitHub Release](https://github.com/ut-issl/c2a-core/releases) を発行する. + - Release Title は `v3.4.0` のようにする. + - Release Note には以下を含める. + - 簡潔な更新差分の箇条書き + - `main` に merge したときの PR のリンク + - サポートする Tools のバージョン ## バージョニング [Semantic Versioning](https://semver.org) を採用する. +ただし,c2a-core における Public API は定義中であり,C言語のフレームワークであるという特性上あらゆる変更が容易に破壊的な変更となってしまうため,minor update でもユーザ側対応は必須となることがほとんどであることには注意すること. + -## C2A Tools との互換性について -少なくとも, [Tools/Overview](../tools/overview.md) の Tool に後方互換性のない更新があった場合は,新しいバージョンをリリースする. +## C2A Tools のリリース Tool のリリースには,以下に注意する. -- C2A と同様の規則で Relase を発行する. +- c2a-core と同様の規則で Relase を発行する. - release には以下を含める. - Release Note として簡潔な更新差分の箇条書き - 対応する最小 C2A Core バージョン From add0099c3404a0f27ebe372bdd64a10d04ac929a Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 21 Nov 2023 16:51:53 +0900 Subject: [PATCH 35/87] update v4.0.0 changelog --- CHANGELOG.md | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c3f37087..a4340bbd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -232,12 +232,25 @@ Rust エコシステム / C2A Boom の導入については,ArkEdge Space Inc. 注意: migration 方法やスクリプトの修正などもありえるため,本 Migration Guide 及び Migration Script は c2a-core v4 系のその時点での最新版を参照すること.例えば,使う c2a-core version が v4.0.0 であっても,v4.1.0 や v4.2.0 がリリースされていれば,その時点のものを参照すること. -- v4.0.0-alpha.0 +- pytest への [rye](https://rye-up.com/) の導入(RECOMMENDED) + - [#59](https://github.com/arkedge/c2a-core/pull/59): Gaia pytest の導入 + - c2a-core [example user](./examples) では [WINGS](https://github.com/ut-issl/wings) に変わる新たな地上局システムである [Gaia](https://github.com/arkedge/gaia) を用いており,pytest のバックエンドシステムを [Gaia](https://github.com/arkedge/gaia) に切り替えている(RECOMMENDED) + - この切り替えと同時に,pytest project の依存関係管理のために [rye](https://rye-up.com/) を導入している. + - [Gaia](https://github.com/arkedge/gaia)への切り替えの有無に関わらず,pytest を含む Python の環境整備には [rye](https://rye-up.com/) を推奨する(RECOMMENDED) +- 現在使用している c2a-core version を確認する(MUST) + - [ut-issl/c2a-core](https://github.com/ut-issl/c2a-core) v3.8 系以前: サポート外.まずは v3.9 系までアップデートすること. + - [ut-issl/c2a-core v3.9.0](https://github.com/ut-issl/c2a-core/releases/tag/v3.9.0): サポート外.[ut-issl/c2a-core v3.9.1](https://github.com/ut-issl/c2a-core/releases/tag/v3.9.1) が結果的に breaking な release となってしまっているため,必ず [ut-issl/c2a-core v3.9.1](https://github.com/ut-issl/c2a-core/releases/tag/v3.9.1) を経由して v3.10 系にアップデートすること. + - [ut-issl/c2a-core v3.9.1](https://github.com/ut-issl/c2a-core/releases/tag/v3.9.1) ~ [ut-issl/c2a-core v3.9.2](https://github.com/ut-issl/c2a-core/releases/tag/v3.9.2): 移行はほぼ確実に可能と思われるが,明示的なサポートはしない.容易にアップデートが可能であるはずなため,事前に[ut-issl/c2a-core v3.10.0](https://github.com/ut-issl/c2a-core/releases/tag/v3.10.0) へアップデートすること. + - [ut-issl/c2a-core v3.10.0](https://github.com/ut-issl/c2a-core/releases/tag/v3.10.0): [v4.0.0](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0) ~ [v4.0.1](https://github.com/arkedge/c2a-core/releases/tag/v4.0.1) への移行をサポート. + - [ut-issl/c2a-core v3.10.1](https://github.com/ut-issl/c2a-core/releases/tag/v3.10.1): 限定的にサポート. + - [v4.0.0](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0) ~ [v4.0.1](https://github.com/arkedge/c2a-core/releases/tag/v4.0.1) への移行: 可能ではあるものの,[ut-issl/c2a-core v3.10.0](https://github.com/ut-issl/c2a-core/releases/tag/v3.10.0) からの差分は一時的に失われることになる + - v4.0.2(TBD) で移行をサポート予定 +- [v4.0.0-alpha.0](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-alpha.0) - [#19](https://github.com/arkedge/c2a-core/pull/18) の変更を取り込む -- v4.0.0-alpha.1 +- [v4.0.0-alpha.1](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-alpha.1) - [#21](https://github.com/arkedge/c2a-core/pull/21), [#24](https://github.com/arkedge/c2a-core/pull/24): IfWrapper -> HAL の rename: [v4-rename-ifwrapper.sh](./script/migration/v4-rename-ifwrapper.sh) を実行 - [#25](https://github.com/arkedge/c2a-core/pull/25): `IfWrapper/dc.h` を使用していた場合は,一旦 C2A user にヘッダを移す(`src/src_user/hal/dc.h`) -- v4.0.0-alpha.2 +- [v4.0.0-alpha.2](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-alpha.2) - [#18](https://github.com/arkedge/c2a-core/pull/18) の変更を取り込む - [yanked] [v4.0.0-beta.0](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.0): このバージョンは yank されているため,tag は存在するが使わないこと - [v4.0.0-beta.1](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.1) @@ -254,18 +267,32 @@ Rust エコシステム / C2A Boom の導入については,ArkEdge Space Inc. - [workflows-c2a v4.3.0](https://github.com/arkedge/workflows-c2a/releases/tag/v4.3.0) からこの構造に対応 - ただし,この挙動変更は workflows-c2a に対しては breaking change なので,新規に [.github/workflows/check-coding-rule-v4.yml](https://github.com/arkedge/workflows-c2a/blob/v4.3.0/.github/workflows/check-coding-rule-v4.yml) という workflow を生やしており,こちらに移行する必要がある([workflows-c2a#63](https://github.com/arkedge/workflows-c2a/pull/63)) - [v4.0.0-beta.2](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.2) + - [#100](https://github.com/arkedge/c2a-core/pull/100): rye の `build-backend` に pdm を指定する + - [c2a-enum-loader](./enum-loader) の相対パスでの指定への切り替えのためにすることになる(SHALL) + - これにより,rye の lockfile にそれを実行した PC での絶対パスが吐かれてしまうという既知の問題があるが,これは別途今後対処予定([#106](https://github.com/arkedge/c2a-core/issues/106))であり,v4.0.0 の段階では一旦許容するものとしている - [#99](https://github.com/arkedge/c2a-core/pull/99): [c2a-enum-loader](./enum-loader) を `src/src_core/enum-loader` のものに切り替える + - このバージョンから [ut-issl/c2a-enum-loader](https://github.com/ut-issl/c2a-enum-loader/) が c2a-core リポジトリに同梱されるようになった + - そのため,pytest で c2a-enum-loader を指定している部分を切り替える必要がある(SHOULD) + - `src/src_user/Test/pyproject.toml` の `dependencies` の `c2aenum` の部分を以下のようにする + - `"c2aenum @ file:///${PROJECT_ROOT}/../../src_core/enum-loader"` - [#111](https://github.com/arkedge/c2a-core/pull/111): [c2a-tlm-cmd-code-generator](./code-generator) を c2a-core のものに切り替える - - [v4.0.0-beta.2](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.2) 時点では `src/src_core/tlm-cmd-code-generator` - - [v4.0.0-beta.5](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.5)([#153](https://github.com/arkedge/c2a-core/pull/153))以降は `src/src_core/code-generator` - - [#86](https://github.com/arkedge/c2a-core/pull/86): CMake の option 修正 - - これは C2A user ごとに設定が異なるので,手動で確認・修正する必要がある + - このバージョンから [ut-issl/c2a-tlm-cmd-code-generator](https://github.com/ut-issl/c2a-tlm-cmd-code-generator) が c2a-core リポジトリに同梱されるようになった + - そのため,各 C2A user でのコード生成は以下のディレクトリで実行することになる(SHALL) + - [v4.0.0-beta.2](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.2) 時点では `src/src_core/tlm-cmd-code-generator` + - [v4.0.0-beta.5](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.5)([#153](https://github.com/arkedge/c2a-core/pull/153))以降は `src/src_core/code-generator` + - [#86](https://github.com/arkedge/c2a-core/pull/86): C2A 全体で共通の CMake の option 修正 + - C2A 全体での CMake option の命名の [コーディングルール](https://github.com/arkedge/c2a-core/blob/6a32752b6d5cea1ef5a5eb68c410cf705315170d/docs/general/coding_rule.md#cmake-option) が追加された + - C2A user ごとに設定があるので,手動で確認・修正する必要がある + - C2A user・c2a-core を横断する設定なので,c2a-core と命名を揃えなければならない(MUST) + - c2a-core でのマージ順などの関係上リリースが分かれているが,[#132](https://github.com/arkedge/c2a-core/pull/132) と同様の対応はこれと同種のものとして v4.0.0-beta.2 に更新するタイミングでまとめてやってもよい(MAY) + - あくまで c2a-core リポジトリでの作業としては C2A 全体で共通の option の整理を [#86](https://github.com/arkedge/c2a-core/pull/86) で,C2A user 固有の設定を [#132](https://github.com/arkedge/c2a-core/pull/132) で別途実施しているが,必ず v4.0.0-beta.3 でやらなければならない理由があるわけではない - [v4.0.0-beta.3](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.3) - [#122](https://github.com/arkedge/c2a-core/pull/122): Drivers ディレクトリの rename を実行([v4-rename-driver.sh](./script/migration/v4-rename-driver.sh)) - [c2a-tlm-cmd-code-generator](./code-generator) にも更新があるので,念のため再度コード生成を行うこと(migration script の実行時点で diff が出て,それと変わらないはず) - [#132](https://github.com/arkedge/c2a-core/pull/132): C2A user 側の CMake option の整理 - - これは C2A user ごとに設定が異なるので,手動で確認・修正する必要がある - - `C2A_USE_SCI_COM_WINGS` を default OFF にする + - C2A user ごとに設定が異なるので,手動で確認・修正する必要がある + - ただし,example user なので基本的には各 C2A user でもテンプレート的にこの実装が用いられているはずであり,同じ/同様の option 名を使っている場合は example user での命名に揃えることが推奨される(RECOMMENDED) + - `C2A_USE_SCI_COM_WINGS` を default OFF にする(RECOMMENDED) - このオプションを使う場合(つまり,SILS-S2E で WINGS と疎通する場合),S2E user の `CMakeLists.txt` ないしビルドスクリプト側でこのオプションを ON にして使うこと.あくまで C2A user 単体としては,この機能は optional であるべき. - [v4.0.0-beta.4](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.4) - [#146](https://github.com/arkedge/c2a-core/pull/146), [#147](https://github.com/arkedge/c2a-core/pull/147): Driver -> Component Driver の rename を実行([v4-rename-driver2](./script/migration/v4-rename-driver2.sh)) @@ -278,8 +305,6 @@ Rust エコシステム / C2A Boom の導入については,ArkEdge Space Inc. - v4.0.0 - [#167](https://github.com/arkedge/c2a-core/pull/167), [#168](https://github.com/arkedge/c2a-core/pull/168): `src/src_user/Settings` -> `src/src_user/settings` - [#172](https://github.com/arkedge/c2a-core/pull/172): `src/src_user/settings/tlm_cmd/data_base` -> `tlm-cmd-db` の rename を実行([v4-move-db-dir.sh](script/migration/v4-move-db-dir.sh)) -- pytest への rye の導入 - - [#100](https://github.com/arkedge/c2a-core/pull/100): `build-backend` に pdm を指定する ## Previous Releases From 5bd281512f06e45b674da333287d5bdddccce518 Mon Sep 17 00:00:00 2001 From: sksat Date: Mon, 27 Nov 2023 11:46:22 +0900 Subject: [PATCH 36/87] add v4.0.0-beta.4 migration disclaimer --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4340bbd8..7abd65274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -297,6 +297,7 @@ Rust エコシステム / C2A Boom の導入については,ArkEdge Space Inc. - [v4.0.0-beta.4](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.4) - [#146](https://github.com/arkedge/c2a-core/pull/146), [#147](https://github.com/arkedge/c2a-core/pull/147): Driver -> Component Driver の rename を実行([v4-rename-driver2](./script/migration/v4-rename-driver2.sh)) - [#143](https://github.com/arkedge/c2a-core/pull/143), [#144](https://github.com/arkedge/c2a-core/pull/144), [#150](https://github.com/arkedge/c2a-core/pull/150): Driver instance -> Component Service の rename を実行([v4-rename-driver-instance.sh](script/migration/v4-rename-driver-instance.sh)) + - 略語の 'DI' は短すぎるため,文脈が明らかなものしか sed していない.適宜検索して置き換えること(特にコマンド名になっているようなものに注意). - [v4.0.0-beta.5](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0-beta.5) - [#153](https://github.com/arkedge/c2a-core/pull/153): code generator のパス変更: `src/src_core/tlm-cmd-code-generator` -> `src/src_core/code-generator` - [#138](https://github.com/arkedge/c2a-core/pull/138): C2A user の pytest のディレクトリ構成のリファクタ: [v4-rename-test-dir.sh](./script/migration/v4-rename-test-dir.sh) を実行 From bc4605fa80de73460a5a96085dce7c6c4088455d Mon Sep 17 00:00:00 2001 From: sksat Date: Mon, 27 Nov 2023 11:47:10 +0900 Subject: [PATCH 37/87] add rename Drivers dir in Windows --- script/migration/v4-rename-driver2.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/script/migration/v4-rename-driver2.sh b/script/migration/v4-rename-driver2.sh index 7923a6c6a..8da8cbdee 100755 --- a/script/migration/v4-rename-driver2.sh +++ b/script/migration/v4-rename-driver2.sh @@ -19,6 +19,7 @@ mv src/src_user/Settings/DriverSuper src/src_user/Settings/component_driver_supe find_all | xargs -0 sed -i -e "s#\${C2A_USER_DIR}/driver#\${C2A_USER_DIR}/component_driver#g" find_all | xargs -0 sed -i -e "s#/driver/#/component_driver/#g" +find_all | xargs -0 sed -i -e "s#\\\driver\\\#\\\component_driver\\\#g" ## _init_dssc(), _from_dssc(), _to_dssc() find_all | xargs -0 sed -i "s/dssc/cdssc/g" From e8d7eaa633e03ea5bceeac84f0dfcdaa556d97f1 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 22:04:10 +0900 Subject: [PATCH 38/87] deploy Doxygen generated HTML to GitHub Pages --- .github/workflows/deploy-reference.yml | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/deploy-reference.yml diff --git a/.github/workflows/deploy-reference.yml b/.github/workflows/deploy-reference.yml new file mode 100644 index 000000000..e20c8dd7e --- /dev/null +++ b/.github/workflows/deploy-reference.yml @@ -0,0 +1,38 @@ +name: Deploy C2A Reference + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: "pages" + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4.1.1 + + - name: Build Doxygen + run: doxygen + + - uses: actions/upload-pages-artifact@v2.0.0 + with: + path: docs/html + + deploy: + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + permissions: + pages: write + id-token: write + runs-on: ubuntu-22.04 + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2.0.4 From 92f8c2b08332d255511a8b0318d90b60ba4d4e48 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 22:12:01 +0900 Subject: [PATCH 39/87] add dry-run deploy reference on pull_request --- .github/workflows/deploy-reference.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-reference.yml b/.github/workflows/deploy-reference.yml index e20c8dd7e..2ae686c92 100644 --- a/.github/workflows/deploy-reference.yml +++ b/.github/workflows/deploy-reference.yml @@ -4,6 +4,7 @@ on: push: branches: - main + pull_request: workflow_dispatch: concurrency: @@ -24,6 +25,7 @@ jobs: deploy: needs: build + if: github.event_name != 'pull_request' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From 30bd92b8758ff31a77940d85bb97328424580222 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 22:14:26 +0900 Subject: [PATCH 40/87] setup Doxygen --- .github/workflows/deploy-reference.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy-reference.yml b/.github/workflows/deploy-reference.yml index 2ae686c92..b194edd5f 100644 --- a/.github/workflows/deploy-reference.yml +++ b/.github/workflows/deploy-reference.yml @@ -14,6 +14,11 @@ jobs: build: runs-on: ubuntu-22.04 steps: + - name: install deps + run: | + sudo apt-get update -y + sudo apt install -y doxygen graphviz + - uses: actions/checkout@v4.1.1 - name: Build Doxygen From 7948f4c068e6ea799b50036481d2e1a2e4b25b13 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 10 Nov 2023 22:16:38 +0900 Subject: [PATCH 41/87] TEMP: deploy test --- .github/workflows/deploy-reference.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-reference.yml b/.github/workflows/deploy-reference.yml index b194edd5f..29c977cdb 100644 --- a/.github/workflows/deploy-reference.yml +++ b/.github/workflows/deploy-reference.yml @@ -30,7 +30,6 @@ jobs: deploy: needs: build - if: github.event_name != 'pull_request' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From 8289bd47a4dc3d0ff29454511d908b2e06032d15 Mon Sep 17 00:00:00 2001 From: sksat Date: Mon, 27 Nov 2023 16:59:38 +0900 Subject: [PATCH 42/87] run C2A setup before doxygen build --- .github/workflows/deploy-reference.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-reference.yml b/.github/workflows/deploy-reference.yml index 29c977cdb..04b4c27dd 100644 --- a/.github/workflows/deploy-reference.yml +++ b/.github/workflows/deploy-reference.yml @@ -21,6 +21,9 @@ jobs: - uses: actions/checkout@v4.1.1 + - name: C2A setup + run: ./setup.sh + - name: Build Doxygen run: doxygen From c00d1498463452ab904941bdb3c7bc8a358f9f5a Mon Sep 17 00:00:00 2001 From: sksat Date: Mon, 27 Nov 2023 17:12:48 +0900 Subject: [PATCH 43/87] do not deploy to GitHub Pages on pull_request --- .github/workflows/deploy-reference.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-reference.yml b/.github/workflows/deploy-reference.yml index 04b4c27dd..b302287b6 100644 --- a/.github/workflows/deploy-reference.yml +++ b/.github/workflows/deploy-reference.yml @@ -32,7 +32,9 @@ jobs: path: docs/html deploy: + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' needs: build + environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} From b3d76e3b3e3c9b5ad3011178237143d65197e93b Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 28 Nov 2023 17:27:36 +0900 Subject: [PATCH 44/87] rename source reference too --- .../migration/v4-rename-component-driver-prefix.sh | 14 +++++++++----- script/migration/v4-rename-if-list.sh | 6 ++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/script/migration/v4-rename-component-driver-prefix.sh b/script/migration/v4-rename-component-driver-prefix.sh index 12b149b25..959ade6eb 100755 --- a/script/migration/v4-rename-component-driver-prefix.sh +++ b/script/migration/v4-rename-component-driver-prefix.sh @@ -6,13 +6,17 @@ function find_all() { } ## c2a-core ref -header_org=("common_tlm_cmd_packet_for_driver_super.h" "eb90_frame_for_driver_super.h" "eb90_packet_for_driver_super.h") -header_new=("cdrv_common_tlm_cmd_packet.h" "cdrv_eb90_frame.h" "cdrv_eb90_packet.h") +src_org=("common_tlm_cmd_packet_for_driver_super" "eb90_frame_for_driver_super" "eb90_packet_for_driver_super") +src_new=("cdrv_common_tlm_cmd_packet" "cdrv_eb90_frame" "cdrv_eb90_packet") echo "rename c2a-core header file name prefix & remove _for_driver_super suffix" -for i in ${!header_org[@]}; do - echo " ${header_org[$i]} -> ${header_new[$i]}" - find_all | xargs -0 sed -i -e "s#${header_org[$i]}#${header_new[$i]}#g" +for i in ${!src_org[@]}; do + echo " ${src_org[$i]}.h -> ${src_new[$i]}.h" + find_all | xargs -0 sed -i -e "s#${src_org[$i]}\.h#${src_new[$i]}\.h#g" + + # rename c2a-core source impl ref for not CMake environment + echo " ${src_org[$i]}.c -> ${src_new[$i]}.c" + find_all | xargs -0 sed -i -e "s#${src_org[$i]}\.c#${src_new[$i]}\.c#g" done echo "rename init func" diff --git a/script/migration/v4-rename-if-list.sh b/script/migration/v4-rename-if-list.sh index a5cc004f6..6c8e09e92 100755 --- a/script/migration/v4-rename-if-list.sh +++ b/script/migration/v4-rename-if-list.sh @@ -15,9 +15,11 @@ mv src/src_user/hal/if_list.c src/src_user/Settings/component_driver_super/hal_h sed -i -e "s#IF_LIST_H_#HAL_HANDLER_REGISTRY_H_#g" src/src_user/Settings/component_driver_super/hal_handler_registry.h ### ref -sed -i -e "s#\"if_list\.h\"#\"hal_handler_registry\.h\"#g" src/src_user/Settings/component_driver_super/hal_handler_registry.c - find_all | xargs -0 sed -i -e "s#src_user/hal/if_list\.h#src_user/Settings/component_driver_super/hal_handler_registry\.h#g" +find_all | xargs -0 sed -i -e "s#src_user\\\hal\\\if_list\.h#src_user\\\Settings\\\component_driver_super\\\hal_handler_registry\.h#g" +find_all | xargs -0 sed -i -e "s#src_user\\\hal\\\if_list\.c#src_user\\\Settings\\\component_driver_super\\\hal_handler_registry\.c#g" + +sed -i -e "s#\"if_list\.h\"#\"hal_handler_registry\.h\"#g" src/src_user/Settings/component_driver_super/hal_handler_registry.c ## CMake echo "remove src/src_user/hal/if_list.c from CMakeLists.txt" From a9f12b5c63fa239ebcdddd015b5fa590cc1b5e58 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 28 Nov 2023 17:29:47 +0900 Subject: [PATCH 45/87] remove empty src_user/test/test dir --- script/migration/v4-rename-test-dir.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/migration/v4-rename-test-dir.sh b/script/migration/v4-rename-test-dir.sh index 3a3f9dce3..e9626ef3a 100755 --- a/script/migration/v4-rename-test-dir.sh +++ b/script/migration/v4-rename-test-dir.sh @@ -3,7 +3,10 @@ echo "rename test top dir src/src_user/Test -> src/src_user/test" mv src/src_user/Test src/src_user/test -echo "move test case files to test dir" +echo "move test case files to src/src_user/test" mv src/src_user/test/test/* src/src_user/test +echo "remove test dir src/src_user/test/test" +rm -r src/src_user/test/test + sed -i 's#ROOT_PATH = "../"#ROOT_PATH = "./"#' src/src_user/test/conftest.py From 0972b56f54eb8bf03144115bbc6450c0c6f56277 Mon Sep 17 00:00:00 2001 From: sksat Date: Wed, 29 Nov 2023 14:02:30 +0900 Subject: [PATCH 46/87] fix v4.0.0 migration guide --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7abd65274..1aa286f4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -303,8 +303,8 @@ Rust エコシステム / C2A Boom の導入については,ArkEdge Space Inc. - [#138](https://github.com/arkedge/c2a-core/pull/138): C2A user の pytest のディレクトリ構成のリファクタ: [v4-rename-test-dir.sh](./script/migration/v4-rename-test-dir.sh) を実行 - [#154](https://github.com/arkedge/c2a-core/pull/154), [#155](https://github.com/arkedge/c2a-core/pull/155): [v4-rename-component-driver-prefix.sh](./script/migration/v4-rename-component-driver-prefix.sh) を実行 - [#165](https://github.com/arkedge/c2a-core/pull/165), [#166](https://github.com/arkedge/c2a-core/pull/166), [#169](https://github.com/arkedge/c2a-core/pull/169): [v4-rename-if-list.sh](./script/migration/v4-rename-if-list.sh) -- v4.0.0 - - [#167](https://github.com/arkedge/c2a-core/pull/167), [#168](https://github.com/arkedge/c2a-core/pull/168): `src/src_user/Settings` -> `src/src_user/settings` +- [v4.0.0](https://github.com/arkedge/c2a-core/releases/tag/v4.0.0) + - [#167](https://github.com/arkedge/c2a-core/pull/167), [#168](https://github.com/arkedge/c2a-core/pull/168): `src/src_user/Settings` -> `src/src_user/settings`: [v4-rename-settings.sh](./script/migration/v4-rename-settings.sh) を実行 - [#172](https://github.com/arkedge/c2a-core/pull/172): `src/src_user/settings/tlm_cmd/data_base` -> `tlm-cmd-db` の rename を実行([v4-move-db-dir.sh](script/migration/v4-move-db-dir.sh)) From ba22ce27e440a2628c9d96468eb58a41182e9191 Mon Sep 17 00:00:00 2001 From: sksat Date: Wed, 29 Nov 2023 14:04:17 +0900 Subject: [PATCH 47/87] update v4.0.0 rename settings migration script from feedback --- script/migration/v4-rename-settings.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/script/migration/v4-rename-settings.sh b/script/migration/v4-rename-settings.sh index b0460741e..170ab4a0c 100755 --- a/script/migration/v4-rename-settings.sh +++ b/script/migration/v4-rename-settings.sh @@ -27,6 +27,7 @@ for ((i=0; i<${#tl_org[@]}; i++)); do sed -i -e "s#modes/task_lists/${tl_org[i]}#modes/task_lists/${tl_new[i]}#g" src/src_user/settings/CMakeLists.txt find_all | xargs -0 sed -i -e "s#Settings/Modes/TaskLists/${tl_org[i]}#settings/modes/task_lists/${tl_new[i]}#g" + find_all | xargs -0 sed -i -e "s#Settings\\\Modes\\\TaskLists\\\\${tl_org[i]}#settings\\\modes\\\task_lists\\\\${tl_new[i]}#g" if [ -e src/src_user/settings/modes/task_lists/${tl_org[i]} ]; then mv src/src_user/settings/modes/task_lists/${tl_org[i]} src/src_user/settings/modes/task_lists/${tl_new[i]} @@ -34,6 +35,7 @@ for ((i=0; i<${#tl_org[@]}; i++)); do done find_all | xargs -0 sed -i -e "s#Settings/Modes/TaskLists#settings/modes/task_lists#g" +find_all | xargs -0 sed -i -e "s#Settings\\\Modes\\\TaskLists#settings\\\modes\\\task_lists#g" echo " /modes/Transitions -> transitions" @@ -45,18 +47,27 @@ mv src/src_user/settings/modes/Transitions src/src_user/settings/modes/transitio for ((i=0; i<${#tr_org[@]}; i++)); do echo " /transitions/${tr_org[i]} -> ${tr_new[i]}" + sed -i -e "s#modes/transitions/${tr_org[i]}#modes/transitions/${tr_new[i]}#g" src/src_user/settings/CMakeLists.txt + find_all | xargs -0 sed -i -e "s#Settings/Modes/Transitions/${tr_org[i]}#settings/modes/transitions/${tr_new[i]}#g" + find_all | xargs -0 sed -i -e "s#Settings\\\Modes\\\Transitions\\\\${tr_org[i]}#settings\\\modes\\\transitions\\\\${tr_new[i]}#g" if [ -e src/src_user/settings/modes/transitions/${tr_org[i]} ]; then mv src/src_user/settings/modes/transitions/${tr_org[i]} src/src_user/settings/modes/transitions/${tr_new[i]} fi done find_all | xargs -0 sed -i -e "s#Settings/Modes/Transitions#settings/modes/transitions#g" +find_all | xargs -0 sed -i -e "s#Settings\\\Modes\\\Transitions#settings\\\modes\\\transitions#g" # ref find_all | xargs -0 sed -i -e "s#Settings/Modes#settings/modes#g" +find_all | xargs -0 sed -i -e "s#Settings\\\Modes#settings\\\modes#g" + find_all | xargs -0 sed -i -e "s#Settings/AnomalyHandlerRules#settings/anomaly_handler_rules#g" +find_all | xargs -0 sed -i -e "s#Settings\\\AnomalyHandlerRules#settings\\\anomaly_handler_rules#g" + find_all | xargs -0 sed -i -e "s#Settings/AnomalyLogger#settings/anomaly_logger#g" +find_all | xargs -0 sed -i -e "s#Settings\\\AnomalyLogger#settings\\\anomaly_logger#g" find_all | xargs -0 sed -i -e "s#Settings/ComponentDriverSuper#settings/component_driver_super#g" find_all | xargs -0 sed -i -e "s#Settings\\\ComponentDriverSuper#settings\\\component_driver_super#g" From cab85afd8a0a0d4cbd78e586c6cbe5480ce22884 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Tue, 28 Nov 2023 12:24:38 +0900 Subject: [PATCH 48/87] add section --- library/endian.c | 2 +- library/libc/bsearch.c | 2 ++ library/libc/memchr.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/library/endian.c b/library/endian.c index 4d63b8dbb..77f144c81 100644 --- a/library/endian.c +++ b/library/endian.c @@ -1,8 +1,8 @@ +#pragma section REPRO /** * @file * @brief エンディアンに関するものを定義する */ -#pragma section REPRO #include "endian.h" #include #include diff --git a/library/libc/bsearch.c b/library/libc/bsearch.c index a4a320ab3..fd89f4e72 100644 --- a/library/libc/bsearch.c +++ b/library/libc/bsearch.c @@ -1,3 +1,4 @@ +#pragma section REPRO /** * @file * @brief C2A が依存する libc 関数 bsearch を自前実装し,c2a-core から提供することで,C2A の移植性を高める. @@ -49,3 +50,4 @@ void *bsearch(const void* key, const void* base, size_t nmemb, size_t size, comp // not found return NULL; } +#pragma section diff --git a/library/libc/memchr.c b/library/libc/memchr.c index 457cb329a..d835d528b 100644 --- a/library/libc/memchr.c +++ b/library/libc/memchr.c @@ -1,3 +1,4 @@ +#pragma section REPRO /** * @file * @brief C2A が依存する libc 関数 memchr を自前実装し,c2a-core から提供することで,C2A の移植性を高める. @@ -22,3 +23,4 @@ void* memchr(const void* buf, int c, size_t n) return NULL; } +#pragma section From adbc0d36c0d85c3bab861b7992d37b2799993f6e Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Tue, 28 Nov 2023 12:27:28 +0900 Subject: [PATCH 49/87] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aa286f4a..bcebb27bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - [#193](https://github.com/arkedge/c2a-core/pull/193): VCDU を AOS transfer frame に rename する - [#197](https://github.com/arkedge/c2a-core/pull/197): M_PDU をコード規約に合わせるなどのリファクタ +- [#222](https://github.com/arkedge/c2a-core/pull/222): Add Section 漏れの修正 ### Migration Guide - [#193](https://github.com/arkedge/c2a-core/pull/193): 影響範囲は MOBC のみ From 7bb2bc2c3cbf3d211f19e79dee65977587a6264c Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 30 Nov 2023 17:57:07 +0900 Subject: [PATCH 50/87] move space packet dir --- CMakeLists.txt | 6 +++--- .../ccsds/{ => space_packet_protocol}/cmd_space_packet.c | 0 .../ccsds/{ => space_packet_protocol}/cmd_space_packet.h | 2 +- tlm_cmd/ccsds/{ => space_packet_protocol}/space_packet.c | 2 +- tlm_cmd/ccsds/{ => space_packet_protocol}/space_packet.h | 2 +- .../{ => space_packet_protocol}/space_packet_typedef.h | 0 .../ccsds/{ => space_packet_protocol}/tlm_space_packet.c | 0 .../ccsds/{ => space_packet_protocol}/tlm_space_packet.h | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename tlm_cmd/ccsds/{ => space_packet_protocol}/cmd_space_packet.c (100%) rename tlm_cmd/ccsds/{ => space_packet_protocol}/cmd_space_packet.h (99%) rename tlm_cmd/ccsds/{ => space_packet_protocol}/space_packet.c (99%) rename tlm_cmd/ccsds/{ => space_packet_protocol}/space_packet.h (99%) rename tlm_cmd/ccsds/{ => space_packet_protocol}/space_packet_typedef.h (100%) rename tlm_cmd/ccsds/{ => space_packet_protocol}/tlm_space_packet.c (100%) rename tlm_cmd/ccsds/{ => space_packet_protocol}/tlm_space_packet.h (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b84b193e6..f0c5ea1c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,9 +53,9 @@ set(C2A_SRCS tlm_cmd/packet_list.c tlm_cmd/telemetry_frame.c tlm_cmd/telemetry_generator.c - tlm_cmd/ccsds/cmd_space_packet.c - tlm_cmd/ccsds/space_packet.c - tlm_cmd/ccsds/tlm_space_packet.c + tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c + tlm_cmd/ccsds/space_packet_protocol/space_packet.c + tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.c ) if(C2A_USE_STDINT_WRAPPER) diff --git a/tlm_cmd/ccsds/cmd_space_packet.c b/tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c similarity index 100% rename from tlm_cmd/ccsds/cmd_space_packet.c rename to tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c diff --git a/tlm_cmd/ccsds/cmd_space_packet.h b/tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.h similarity index 99% rename from tlm_cmd/ccsds/cmd_space_packet.h rename to tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.h index 38b997afd..65dbfeabd 100644 --- a/tlm_cmd/ccsds/cmd_space_packet.h +++ b/tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.h @@ -62,7 +62,7 @@ typedef enum #include #include "space_packet_typedef.h" #include "space_packet.h" -#include "../common_cmd_packet.h" +#include "../../common_cmd_packet.h" #if CSP_MAX_LEN <= SP_PRM_HDR_LEN #error CSP_MAX_LEN is too small diff --git a/tlm_cmd/ccsds/space_packet.c b/tlm_cmd/ccsds/space_packet_protocol/space_packet.c similarity index 99% rename from tlm_cmd/ccsds/space_packet.c rename to tlm_cmd/ccsds/space_packet_protocol/space_packet.c index 938a81c21..5589f9a02 100644 --- a/tlm_cmd/ccsds/space_packet.c +++ b/tlm_cmd/ccsds/space_packet_protocol/space_packet.c @@ -5,7 +5,7 @@ * @note 詳細は space_packet.h を参照 */ #include "space_packet.h" -#include "../../library/endian.h" +#include "../../../library/endian.h" #include diff --git a/tlm_cmd/ccsds/space_packet.h b/tlm_cmd/ccsds/space_packet_protocol/space_packet.h similarity index 99% rename from tlm_cmd/ccsds/space_packet.h rename to tlm_cmd/ccsds/space_packet_protocol/space_packet.h index cdfb82bca..d1e91d739 100644 --- a/tlm_cmd/ccsds/space_packet.h +++ b/tlm_cmd/ccsds/space_packet_protocol/space_packet.h @@ -38,7 +38,7 @@ #include #include "space_packet_typedef.h" -#include "../common_tlm_cmd_packet.h" +#include "../../common_tlm_cmd_packet.h" #define SP_PRM_HDR_LEN (6) //!< Packet Primary Header 長 diff --git a/tlm_cmd/ccsds/space_packet_typedef.h b/tlm_cmd/ccsds/space_packet_protocol/space_packet_typedef.h similarity index 100% rename from tlm_cmd/ccsds/space_packet_typedef.h rename to tlm_cmd/ccsds/space_packet_protocol/space_packet_typedef.h diff --git a/tlm_cmd/ccsds/tlm_space_packet.c b/tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.c similarity index 100% rename from tlm_cmd/ccsds/tlm_space_packet.c rename to tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.c diff --git a/tlm_cmd/ccsds/tlm_space_packet.h b/tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.h similarity index 99% rename from tlm_cmd/ccsds/tlm_space_packet.h rename to tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.h index 5b5976f85..fe4259b3c 100644 --- a/tlm_cmd/ccsds/tlm_space_packet.h +++ b/tlm_cmd/ccsds/space_packet_protocol/tlm_space_packet.h @@ -75,7 +75,7 @@ typedef enum #include #include "space_packet_typedef.h" #include "space_packet.h" -#include "../common_tlm_packet.h" +#include "../../common_tlm_packet.h" #if TSP_MAX_LEN <= SP_PRM_HDR_LEN #error TSP_MAX_LEN is too small From 768d31e58b81e54800ec8e6abf8ca7f0dc4176f8 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 30 Nov 2023 18:06:40 +0900 Subject: [PATCH 51/87] fix include --- examples/mobc/src/src_user/component_driver/com/gs.c | 2 +- examples/mobc/src/src_user/component_driver/com/gs_validate.c | 2 +- .../src/src_user/settings/tlm_cmd/common_cmd_packet_define.h | 2 +- .../src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h | 2 +- .../src/src_user/settings/tlm_cmd/common_tlm_packet_define.h | 2 +- examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.h | 2 +- examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c | 2 +- examples/mobc/src/src_user/tlm_cmd/common_cmd_packet.c | 2 +- examples/mobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c | 2 +- examples/mobc/src/src_user/tlm_cmd/common_tlm_packet.c | 2 +- .../src/src_user/settings/tlm_cmd/common_cmd_packet_define.h | 2 +- .../src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h | 2 +- .../src/src_user/settings/tlm_cmd/common_tlm_packet_define.h | 2 +- examples/subobc/src/src_user/tlm_cmd/common_cmd_packet.c | 2 +- examples/subobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c | 2 +- examples/subobc/src/src_user/tlm_cmd/common_tlm_packet.c | 2 +- tlm_cmd/block_command_table.c | 4 ++-- tlm_cmd/telemetry_generator.c | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/mobc/src/src_user/component_driver/com/gs.c b/examples/mobc/src/src_user/component_driver/com/gs.c index 084c13fa4..f5bac2c06 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.c +++ b/examples/mobc/src/src_user/component_driver/com/gs.c @@ -13,7 +13,7 @@ #include "../../tlm_cmd/ccsds/tc_transfer_frame.h" #include #include -#include +#include #define GS_RX_HEADER_SIZE (2) diff --git a/examples/mobc/src/src_user/component_driver/com/gs_validate.c b/examples/mobc/src/src_user/component_driver/com/gs_validate.c index 7e8a09c27..8a3e4201a 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs_validate.c +++ b/examples/mobc/src/src_user/component_driver/com/gs_validate.c @@ -6,7 +6,7 @@ #include "gs_validate.h" #include "../../tlm_cmd/ccsds/tc_segment.h" -#include +#include #define GS_RECEIVE_WINDOW (256) #define GS_POSITIVE_WINDOW_WIDTH_DEFAULT (64) // FIXME: 要検討 diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h index 1d18a2b82..3c72f0371 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h @@ -5,7 +5,7 @@ #ifndef COMMON_CMD_PACKET_DEFINE_H_ #define COMMON_CMD_PACKET_DEFINE_H_ -#include +#include #include "./ccsds/apid_define.h" // CommonCmdPacket として CmdSpacePacket をつかう diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h index f4846059d..33408fd6c 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h @@ -5,7 +5,7 @@ #ifndef COMMON_TLM_CMD_PACKET_DEFINE_H_ #define COMMON_TLM_CMD_PACKET_DEFINE_H_ -#include +#include // CommonTlmCmdPacket として SpacePacket をつかう typedef SpacePacket CommonTlmCmdPacket; diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h index b1f59e820..fb528f712 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h @@ -5,7 +5,7 @@ #ifndef COMMON_TLM_PACKET_DEFINE_H_ #define COMMON_TLM_PACKET_DEFINE_H_ -#include +#include #include "./ccsds/apid_define.h" // CommonTlmPacket として TlmSpacePacket をつかう diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.h b/examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.h index 21524d2d8..f1861e889 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.h +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.h @@ -20,7 +20,7 @@ #define TC_SEGMENT_H_ #include -#include +#include #include #define TCS_HEADER_SIZE (1) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c index 51cdf1400..92ce180e8 100644 --- a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c +++ b/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c @@ -7,7 +7,7 @@ #include "tcp_to_m_pdu.h" // FIXME: CTP ではなく TSP を使ってしまっている.できれば抽象化するべき -#include +#include void T2M_initialize(TcpToMPdu* tcp_to_m_pdu) { diff --git a/examples/mobc/src/src_user/tlm_cmd/common_cmd_packet.c b/examples/mobc/src/src_user/tlm_cmd/common_cmd_packet.c index f510cf381..a0da7a640 100644 --- a/examples/mobc/src/src_user/tlm_cmd/common_cmd_packet.c +++ b/examples/mobc/src/src_user/tlm_cmd/common_cmd_packet.c @@ -5,7 +5,7 @@ * @note CCP: CommonCmdPacket */ #include -#include +#include #include diff --git a/examples/mobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c b/examples/mobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c index 259626eaa..c02e70958 100644 --- a/examples/mobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c +++ b/examples/mobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c @@ -7,7 +7,7 @@ * @note CCP: CommonCmdPacket */ #include -#include +#include #include diff --git a/examples/mobc/src/src_user/tlm_cmd/common_tlm_packet.c b/examples/mobc/src/src_user/tlm_cmd/common_tlm_packet.c index dbac65371..f0d6674e7 100644 --- a/examples/mobc/src/src_user/tlm_cmd/common_tlm_packet.c +++ b/examples/mobc/src/src_user/tlm_cmd/common_tlm_packet.c @@ -5,7 +5,7 @@ * @note CTP: CommonTlmPacket */ #include -#include +#include #include #include diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h index b21f5ee09..f61d1ac63 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h @@ -5,7 +5,7 @@ #ifndef COMMON_CMD_PACKET_DEFINE_H_ #define COMMON_CMD_PACKET_DEFINE_H_ -#include +#include #include "./ccsds/apid_define.h" // CommonCmdPacket として CmdSpacePacket をつかう diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h index f4846059d..33408fd6c 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_cmd_packet_define.h @@ -5,7 +5,7 @@ #ifndef COMMON_TLM_CMD_PACKET_DEFINE_H_ #define COMMON_TLM_CMD_PACKET_DEFINE_H_ -#include +#include // CommonTlmCmdPacket として SpacePacket をつかう typedef SpacePacket CommonTlmCmdPacket; diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h index b0785c362..01937bd0b 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h @@ -5,7 +5,7 @@ #ifndef COMMON_TLM_PACKET_DEFINE_H_ #define COMMON_TLM_PACKET_DEFINE_H_ -#include +#include #include "./ccsds/apid_define.h" // CommonTlmPacket として TlmSpacePacket をつかう diff --git a/examples/subobc/src/src_user/tlm_cmd/common_cmd_packet.c b/examples/subobc/src/src_user/tlm_cmd/common_cmd_packet.c index f510cf381..a0da7a640 100644 --- a/examples/subobc/src/src_user/tlm_cmd/common_cmd_packet.c +++ b/examples/subobc/src/src_user/tlm_cmd/common_cmd_packet.c @@ -5,7 +5,7 @@ * @note CCP: CommonCmdPacket */ #include -#include +#include #include diff --git a/examples/subobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c b/examples/subobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c index 259626eaa..c02e70958 100644 --- a/examples/subobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c +++ b/examples/subobc/src/src_user/tlm_cmd/common_tlm_cmd_packet.c @@ -7,7 +7,7 @@ * @note CCP: CommonCmdPacket */ #include -#include +#include #include diff --git a/examples/subobc/src/src_user/tlm_cmd/common_tlm_packet.c b/examples/subobc/src/src_user/tlm_cmd/common_tlm_packet.c index f8274edb5..ee1d2789d 100644 --- a/examples/subobc/src/src_user/tlm_cmd/common_tlm_packet.c +++ b/examples/subobc/src/src_user/tlm_cmd/common_tlm_packet.c @@ -5,7 +5,7 @@ * @note CTP: CommonTlmPacket */ #include -#include +#include #include diff --git a/tlm_cmd/block_command_table.c b/tlm_cmd/block_command_table.c index 57ad9a455..0b04ac5cd 100644 --- a/tlm_cmd/block_command_table.c +++ b/tlm_cmd/block_command_table.c @@ -21,8 +21,8 @@ #include "common_cmd_packet_util.h" // FIXME: この include は依存的にダメなので, TCP → Space Packet 大工事が終わったら直す -#include "./ccsds/space_packet.h" -#include "./ccsds/cmd_space_packet.h" +#include "./ccsds/space_packet_protocol/space_packet.h" +#include "./ccsds/space_packet_protocol/cmd_space_packet.h" static BlockCommandTable block_command_table_; const BlockCommandTable* const block_command_table = &block_command_table_; diff --git a/tlm_cmd/telemetry_generator.c b/tlm_cmd/telemetry_generator.c index ab92656f4..32f89ad66 100644 --- a/tlm_cmd/telemetry_generator.c +++ b/tlm_cmd/telemetry_generator.c @@ -11,7 +11,7 @@ #include #include #include -#include "./ccsds/tlm_space_packet.h" // FIXME: TSP 依存性はNGなので, TCP → SP 大工事終わったら直す +#include "./ccsds/space_packet_protocol/tlm_space_packet.h" // FIXME: TSP 依存性はNGなので, TCP → SP 大工事終わったら直す /** From 66f91ef8e5e864f4352a7a19aeb41f5e13c3fdad Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 30 Nov 2023 18:09:17 +0900 Subject: [PATCH 52/87] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcebb27bd..8db6d652f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - [#193](https://github.com/arkedge/c2a-core/pull/193): VCDU を AOS transfer frame に rename する - [#197](https://github.com/arkedge/c2a-core/pull/197): M_PDU をコード規約に合わせるなどのリファクタ - [#222](https://github.com/arkedge/c2a-core/pull/222): Add Section 漏れの修正 +- [#225](https://github.com/arkedge/c2a-core/pull/225): CCSDS の Space Packet Protocol に関連するコードのディレクトリを移動 ### Migration Guide - [#193](https://github.com/arkedge/c2a-core/pull/193): 影響範囲は MOBC のみ @@ -23,6 +24,12 @@ 1. `m_pdu.h` を `multiplexing_protocol_data_unit.h` に置換する(include の修正). 1. コンパイルが通らないところを直す.想定されるものは以下. - `M_PDU` 構造体 が `MultiplexingProtocolDataUnit` 構造体に変わったので,変数定義の型名が変わっているはず. +- [#225](https://github.com/arkedge/c2a-core/pull/225) + 1. コンパイルが通るように,以下の include の修正を行う. + - `#include ` -> `#include ` + - `#include ` -> `#include ` + - `#include ` -> `#include ` + - `#include ` -> `#include ` ## v4.0.1 (2023-11-09) From 642046b5fd832f5c5357813effdf69d8a1b9a9d7 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 16 Nov 2023 18:05:08 +0900 Subject: [PATCH 53/87] move mobc ccsds to core --- .../tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/aos_transfer_frame.c | 0 .../tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/aos_transfer_frame.h | 0 .../ccsds/mobc}/multiplexing_protocol_data_unit.c | 0 .../ccsds/mobc}/multiplexing_protocol_data_unit.h | 0 .../src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tc_segment.c | 0 .../src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tc_segment.h | 0 .../tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tc_transfer_frame.c | 0 .../tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tc_transfer_frame.h | 0 .../src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tcp_to_m_pdu.c | 0 .../src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tcp_to_m_pdu.h | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/aos_transfer_frame.c (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/aos_transfer_frame.h (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/multiplexing_protocol_data_unit.c (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/multiplexing_protocol_data_unit.h (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tc_segment.c (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tc_segment.h (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tc_transfer_frame.c (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tc_transfer_frame.h (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tcp_to_m_pdu.c (100%) rename {examples/mobc/src/src_user/tlm_cmd/ccsds => tlm_cmd/ccsds/mobc}/tcp_to_m_pdu.h (100%) diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c b/tlm_cmd/ccsds/mobc/aos_transfer_frame.c similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.c rename to tlm_cmd/ccsds/mobc/aos_transfer_frame.c diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h b/tlm_cmd/ccsds/mobc/aos_transfer_frame.h similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/aos_transfer_frame.h rename to tlm_cmd/ccsds/mobc/aos_transfer_frame.h diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c b/tlm_cmd/ccsds/mobc/multiplexing_protocol_data_unit.c similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.c rename to tlm_cmd/ccsds/mobc/multiplexing_protocol_data_unit.c diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h b/tlm_cmd/ccsds/mobc/multiplexing_protocol_data_unit.h similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/multiplexing_protocol_data_unit.h rename to tlm_cmd/ccsds/mobc/multiplexing_protocol_data_unit.h diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.c b/tlm_cmd/ccsds/mobc/tc_segment.c similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.c rename to tlm_cmd/ccsds/mobc/tc_segment.c diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.h b/tlm_cmd/ccsds/mobc/tc_segment.h similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/tc_segment.h rename to tlm_cmd/ccsds/mobc/tc_segment.h diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tc_transfer_frame.c b/tlm_cmd/ccsds/mobc/tc_transfer_frame.c similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/tc_transfer_frame.c rename to tlm_cmd/ccsds/mobc/tc_transfer_frame.c diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tc_transfer_frame.h b/tlm_cmd/ccsds/mobc/tc_transfer_frame.h similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/tc_transfer_frame.h rename to tlm_cmd/ccsds/mobc/tc_transfer_frame.h diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c b/tlm_cmd/ccsds/mobc/tcp_to_m_pdu.c similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.c rename to tlm_cmd/ccsds/mobc/tcp_to_m_pdu.c diff --git a/examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h b/tlm_cmd/ccsds/mobc/tcp_to_m_pdu.h similarity index 100% rename from examples/mobc/src/src_user/tlm_cmd/ccsds/tcp_to_m_pdu.h rename to tlm_cmd/ccsds/mobc/tcp_to_m_pdu.h From f16afb8e9e61ff53a7948b524f5ff6d4d809d709 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Thu, 16 Nov 2023 18:14:49 +0900 Subject: [PATCH 54/87] Create README.md --- tlm_cmd/ccsds/mobc/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tlm_cmd/ccsds/mobc/README.md diff --git a/tlm_cmd/ccsds/mobc/README.md b/tlm_cmd/ccsds/mobc/README.md new file mode 100644 index 000000000..f13b5b3f0 --- /dev/null +++ b/tlm_cmd/ccsds/mobc/README.md @@ -0,0 +1,10 @@ +# CCSDS / MOBC + +本ディレクトリに配置されているコードは,地上局と通信する無線機 (STX や SRX) に接続される OBC (MOBC など) が,CCSDS Space Communications Protocols における,TC Space Data Link Protocol と AOS Space Data Link Protocol に関連するコードである. + +CSDS Space Communications Protocols は,様々な設計パラメタがあるが,ここでのコードは,ある特定の設計パラメタにおける実装であることに注意すること. +したがって,現時点では汎用性の低いコードが配置されている. +(今後,適切にリファクタリンスする予定.) + +また,本コードをコンパイル対象に加えると,少なくない RAM を static に確保してしまうため,デフォルトではコンパイル対象には含まれない. +コンパイル対象に含める場合は, FIXME: で設定すること. From a7691bf3480b6cce87f1975d50888468b3a54d9a Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 17 Nov 2023 02:04:12 +0900 Subject: [PATCH 55/87] fix include --- .../src/src_user/applications/component_service/csrv_gs.h | 4 ++-- examples/mobc/src/src_user/component_driver/com/gs.c | 2 +- examples/mobc/src/src_user/component_driver/com/gs.h | 2 +- examples/mobc/src/src_user/component_driver/com/gs_validate.c | 2 +- examples/mobc/src/src_user/component_driver/com/gs_validate.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h index 594e2900a..78e57b4b4 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h @@ -8,8 +8,8 @@ #include #include "../../component_driver/com/gs.h" -#include "../../tlm_cmd/ccsds/tcp_to_m_pdu.h" -#include "../../tlm_cmd/ccsds/aos_transfer_frame.h" +#include +#include #include /** diff --git a/examples/mobc/src/src_user/component_driver/com/gs.c b/examples/mobc/src/src_user/component_driver/com/gs.c index f5bac2c06..3f26cdabd 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.c +++ b/examples/mobc/src/src_user/component_driver/com/gs.c @@ -10,7 +10,7 @@ #include #include "../../hal/ccsds_user.h" -#include "../../tlm_cmd/ccsds/tc_transfer_frame.h" +#include #include #include #include diff --git a/examples/mobc/src/src_user/component_driver/com/gs.h b/examples/mobc/src/src_user/component_driver/com/gs.h index b35a0e2b1..aeb227196 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.h +++ b/examples/mobc/src/src_user/component_driver/com/gs.h @@ -10,7 +10,7 @@ #include #include #include "../../hal/ccsds_user.h" -#include "../../tlm_cmd/ccsds/aos_transfer_frame.h" +#include #include "gs_validate.h" #define GS_RX_HEADER_NUM (3) diff --git a/examples/mobc/src/src_user/component_driver/com/gs_validate.c b/examples/mobc/src/src_user/component_driver/com/gs_validate.c index 8a3e4201a..537292032 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs_validate.c +++ b/examples/mobc/src/src_user/component_driver/com/gs_validate.c @@ -5,7 +5,7 @@ */ #include "gs_validate.h" -#include "../../tlm_cmd/ccsds/tc_segment.h" +#include #include #define GS_RECEIVE_WINDOW (256) diff --git a/examples/mobc/src/src_user/component_driver/com/gs_validate.h b/examples/mobc/src/src_user/component_driver/com/gs_validate.h index d397bcfb6..59de575b1 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs_validate.h +++ b/examples/mobc/src/src_user/component_driver/com/gs_validate.h @@ -14,7 +14,7 @@ #include -#include "../../tlm_cmd/ccsds/tc_transfer_frame.h" +#include /** * @enum GS_VALIDATE_ERR From 4c7cbf6dd5d19279ebd460ed372408164c15d3a8 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 17 Nov 2023 02:08:06 +0900 Subject: [PATCH 56/87] Update CMakeLists.txt --- examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt b/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt index 0fbae1a07..cc0d7962a 100644 --- a/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt +++ b/examples/mobc/src/src_user/tlm_cmd/CMakeLists.txt @@ -14,11 +14,6 @@ set(C2A_SRCS normal_block_command_definition/nbc_start_hk_tlm.c normal_block_command_definition/nbc_respond_eh_for_test.c normal_block_command_definition/nbc_test_bcl.c - ccsds/aos_transfer_frame.c - ccsds/multiplexing_protocol_data_unit.c - ccsds/tc_transfer_frame.c - ccsds/tcp_to_m_pdu.c - ccsds/tc_segment.c ) if(C2A_BUILD_AS_CXX) From 42ae8196ea2bee4d8acf1f4ee224c71ebb780219 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 17 Nov 2023 13:09:07 +0900 Subject: [PATCH 57/87] Update README.md --- tlm_cmd/ccsds/mobc/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tlm_cmd/ccsds/mobc/README.md b/tlm_cmd/ccsds/mobc/README.md index f13b5b3f0..b280a5f51 100644 --- a/tlm_cmd/ccsds/mobc/README.md +++ b/tlm_cmd/ccsds/mobc/README.md @@ -1,10 +1,10 @@ # CCSDS / MOBC -本ディレクトリに配置されているコードは,地上局と通信する無線機 (STX や SRX) に接続される OBC (MOBC など) が,CCSDS Space Communications Protocols における,TC Space Data Link Protocol と AOS Space Data Link Protocol に関連するコードである. +本ディレクトリに配置されているコードは,地上局と通信する無線機 (STX や SRX) に接続される OBC (MOBC など) 向けの,CCSDS Space Communications Protocols における,TC Space Data Link Protocol と AOS Space Data Link Protocol に関連するコードである. CSDS Space Communications Protocols は,様々な設計パラメタがあるが,ここでのコードは,ある特定の設計パラメタにおける実装であることに注意すること. したがって,現時点では汎用性の低いコードが配置されている. -(今後,適切にリファクタリンスする予定.) +(今後,適切にリファクタリングする予定.) また,本コードをコンパイル対象に加えると,少なくない RAM を static に確保してしまうため,デフォルトではコンパイル対象には含まれない. コンパイル対象に含める場合は, FIXME: で設定すること. From c2db7f53d9ebf747156a38cd7db0b0e4f0ca1b6f Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 22 Nov 2023 18:48:17 +0900 Subject: [PATCH 58/87] move to protocol name folder --- .../{mobc => aos_space_data_link_protocol}/aos_transfer_frame.c | 0 .../{mobc => aos_space_data_link_protocol}/aos_transfer_frame.h | 0 .../multiplexing_protocol_data_unit.c | 0 .../multiplexing_protocol_data_unit.h | 0 .../ccsds/{mobc => aos_space_data_link_protocol}/tcp_to_m_pdu.c | 0 .../ccsds/{mobc => aos_space_data_link_protocol}/tcp_to_m_pdu.h | 0 tlm_cmd/ccsds/{mobc => tc_space_data_link_protocol}/tc_segment.c | 0 tlm_cmd/ccsds/{mobc => tc_space_data_link_protocol}/tc_segment.h | 0 .../{mobc => tc_space_data_link_protocol}/tc_transfer_frame.c | 0 .../{mobc => tc_space_data_link_protocol}/tc_transfer_frame.h | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename tlm_cmd/ccsds/{mobc => aos_space_data_link_protocol}/aos_transfer_frame.c (100%) rename tlm_cmd/ccsds/{mobc => aos_space_data_link_protocol}/aos_transfer_frame.h (100%) rename tlm_cmd/ccsds/{mobc => aos_space_data_link_protocol}/multiplexing_protocol_data_unit.c (100%) rename tlm_cmd/ccsds/{mobc => aos_space_data_link_protocol}/multiplexing_protocol_data_unit.h (100%) rename tlm_cmd/ccsds/{mobc => aos_space_data_link_protocol}/tcp_to_m_pdu.c (100%) rename tlm_cmd/ccsds/{mobc => aos_space_data_link_protocol}/tcp_to_m_pdu.h (100%) rename tlm_cmd/ccsds/{mobc => tc_space_data_link_protocol}/tc_segment.c (100%) rename tlm_cmd/ccsds/{mobc => tc_space_data_link_protocol}/tc_segment.h (100%) rename tlm_cmd/ccsds/{mobc => tc_space_data_link_protocol}/tc_transfer_frame.c (100%) rename tlm_cmd/ccsds/{mobc => tc_space_data_link_protocol}/tc_transfer_frame.h (100%) diff --git a/tlm_cmd/ccsds/mobc/aos_transfer_frame.c b/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.c similarity index 100% rename from tlm_cmd/ccsds/mobc/aos_transfer_frame.c rename to tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.c diff --git a/tlm_cmd/ccsds/mobc/aos_transfer_frame.h b/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.h similarity index 100% rename from tlm_cmd/ccsds/mobc/aos_transfer_frame.h rename to tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.h diff --git a/tlm_cmd/ccsds/mobc/multiplexing_protocol_data_unit.c b/tlm_cmd/ccsds/aos_space_data_link_protocol/multiplexing_protocol_data_unit.c similarity index 100% rename from tlm_cmd/ccsds/mobc/multiplexing_protocol_data_unit.c rename to tlm_cmd/ccsds/aos_space_data_link_protocol/multiplexing_protocol_data_unit.c diff --git a/tlm_cmd/ccsds/mobc/multiplexing_protocol_data_unit.h b/tlm_cmd/ccsds/aos_space_data_link_protocol/multiplexing_protocol_data_unit.h similarity index 100% rename from tlm_cmd/ccsds/mobc/multiplexing_protocol_data_unit.h rename to tlm_cmd/ccsds/aos_space_data_link_protocol/multiplexing_protocol_data_unit.h diff --git a/tlm_cmd/ccsds/mobc/tcp_to_m_pdu.c b/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c similarity index 100% rename from tlm_cmd/ccsds/mobc/tcp_to_m_pdu.c rename to tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c diff --git a/tlm_cmd/ccsds/mobc/tcp_to_m_pdu.h b/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.h similarity index 100% rename from tlm_cmd/ccsds/mobc/tcp_to_m_pdu.h rename to tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.h diff --git a/tlm_cmd/ccsds/mobc/tc_segment.c b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.c similarity index 100% rename from tlm_cmd/ccsds/mobc/tc_segment.c rename to tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.c diff --git a/tlm_cmd/ccsds/mobc/tc_segment.h b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.h similarity index 100% rename from tlm_cmd/ccsds/mobc/tc_segment.h rename to tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.h diff --git a/tlm_cmd/ccsds/mobc/tc_transfer_frame.c b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c similarity index 100% rename from tlm_cmd/ccsds/mobc/tc_transfer_frame.c rename to tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c diff --git a/tlm_cmd/ccsds/mobc/tc_transfer_frame.h b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.h similarity index 100% rename from tlm_cmd/ccsds/mobc/tc_transfer_frame.h rename to tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.h From d30410fc7b602a43fbfa87a3e63d2aea28080e3c Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 22 Nov 2023 18:55:48 +0900 Subject: [PATCH 59/87] fix include --- .../src/src_user/applications/component_service/csrv_gs.h | 4 ++-- examples/mobc/src/src_user/component_driver/com/gs.c | 2 +- examples/mobc/src/src_user/component_driver/com/gs.h | 2 +- examples/mobc/src/src_user/component_driver/com/gs_validate.c | 2 +- examples/mobc/src/src_user/component_driver/com/gs_validate.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h index 78e57b4b4..e23135c1d 100644 --- a/examples/mobc/src/src_user/applications/component_service/csrv_gs.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h @@ -8,8 +8,8 @@ #include #include "../../component_driver/com/gs.h" -#include -#include +#include +#include #include /** diff --git a/examples/mobc/src/src_user/component_driver/com/gs.c b/examples/mobc/src/src_user/component_driver/com/gs.c index 3f26cdabd..cd2f600b7 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.c +++ b/examples/mobc/src/src_user/component_driver/com/gs.c @@ -10,7 +10,7 @@ #include #include "../../hal/ccsds_user.h" -#include +#include #include #include #include diff --git a/examples/mobc/src/src_user/component_driver/com/gs.h b/examples/mobc/src/src_user/component_driver/com/gs.h index aeb227196..c19d92565 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.h +++ b/examples/mobc/src/src_user/component_driver/com/gs.h @@ -10,7 +10,7 @@ #include #include #include "../../hal/ccsds_user.h" -#include +#include #include "gs_validate.h" #define GS_RX_HEADER_NUM (3) diff --git a/examples/mobc/src/src_user/component_driver/com/gs_validate.c b/examples/mobc/src/src_user/component_driver/com/gs_validate.c index 537292032..b14d4e804 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs_validate.c +++ b/examples/mobc/src/src_user/component_driver/com/gs_validate.c @@ -5,7 +5,7 @@ */ #include "gs_validate.h" -#include +#include #include #define GS_RECEIVE_WINDOW (256) diff --git a/examples/mobc/src/src_user/component_driver/com/gs_validate.h b/examples/mobc/src/src_user/component_driver/com/gs_validate.h index 59de575b1..2a664fff8 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs_validate.h +++ b/examples/mobc/src/src_user/component_driver/com/gs_validate.h @@ -14,7 +14,7 @@ #include -#include +#include /** * @enum GS_VALIDATE_ERR From df48ef75d8da4bc4bd493237e427f84b4edaef68 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 22 Nov 2023 19:06:19 +0900 Subject: [PATCH 60/87] fix include --- tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c | 2 +- tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.h | 4 ++-- tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.h | 2 +- tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c b/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c index 92ce180e8..83e7e79e7 100644 --- a/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c +++ b/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c @@ -7,7 +7,7 @@ #include "tcp_to_m_pdu.h" // FIXME: CTP ではなく TSP を使ってしまっている.できれば抽象化するべき -#include +#include "../space_packet_protocol/tlm_space_packet.h" void T2M_initialize(TcpToMPdu* tcp_to_m_pdu) { diff --git a/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.h b/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.h index c0da712de..fc568710d 100644 --- a/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.h +++ b/tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.h @@ -10,9 +10,9 @@ #include // for size_t -#include #include "multiplexing_protocol_data_unit.h" -#include +#include "../../packet_list.h" +#include "../../../system/time_manager/time_manager.h" /** * @enum T2M_ACK diff --git a/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.h b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.h index f1861e889..7c57fa6f8 100644 --- a/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.h +++ b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.h @@ -20,7 +20,7 @@ #define TC_SEGMENT_H_ #include -#include +#include "../space_packet_protocol/cmd_space_packet.h" #include #define TCS_HEADER_SIZE (1) diff --git a/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c index 4c90be69b..a4646933c 100644 --- a/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c +++ b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c @@ -6,7 +6,7 @@ #include "tc_transfer_frame.h" #include -#include +#include "../../../library/crc.h" TCTF_VER TCTF_get_ver(const TcTransferFrame* tctf) { From 3e6dd4c2b22619037ac4333d5e5523ec7927bc23 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Wed, 22 Nov 2023 19:54:47 +0900 Subject: [PATCH 61/87] add ccsds doc --- docs/README.md | 1 + docs/core/ccsds.md | 24 ++++++++++++++++++++++++ tlm_cmd/ccsds/mobc/README.md | 10 ---------- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 docs/core/ccsds.md delete mode 100644 tlm_cmd/ccsds/mobc/README.md diff --git a/docs/README.md b/docs/README.md index 777af589c..c624ce479 100644 --- a/docs/README.md +++ b/docs/README.md @@ -37,6 +37,7 @@ C2A に関する説明の棲み分けは,次のようになっています. 1. Core Layer 1. Overview 1. [Communication](./core/communication.md) + 1. [CCSDS](./core/ccsds.md) 1. [Tips](./core/tips.md) 1. Component Driver 1. [Overview](./component_driver/overview.md) diff --git a/docs/core/ccsds.md b/docs/core/ccsds.md new file mode 100644 index 000000000..869f4c506 --- /dev/null +++ b/docs/core/ccsds.md @@ -0,0 +1,24 @@ +# CCSDS + +## 概要 +C2A Core に実装された CCSDS (Consultative Committee for Space Data Systems) によって規定される宇宙データシステムの標準規格 Space Communications Protocols についてまとめる. +CCSDS 技術仕様文書は [ブルーブック(Blue Books):全85文書](https://stage.tksc.jaxa.jp/ccsds/docs/doc_blue.html) を参照すること. + + +## Space Packet Protocol +[`tlm_cmd/ccsds/space_packet_protocol`](/tlm_cmd/ccsds/space_packet_protocol/) に配置される. + +[Core/Communication.md#c2a-標準-space-packet-定義](./communication.md#c2a-標準-space-packet-定義) などを参照のこと. + + +## AOS Space Data Link Protocol / TC Space Data Link Protocol +[`tlm_cmd/ccsds/aos_space_data_link_protocol`](/tlm_cmd/ccsds/aos_space_data_link_protocol/), [`tlm_cmd/ccsds/tc_space_data_link_protocol`](/tlm_cmd/ccsds/tc_space_data_link_protocol/) に配置される. + +基本的には,地上局と通信する無線機 (STX や SRX) に接続される OBC (MOBC など) 向けのコードとなる. + +AOS Space Data Link Protocol や TC Space Data Link Protocol は,様々な設計パラメタがあるが,ここでのコードは,ある特定の設計パラメタにおける実装であることに注意すること. +したがって,現時点では汎用性の低いコードが配置されている. +(今後,適切にリファクタリングする予定.) + +また,本コードをコンパイル対象に加えると,少なくない RAM を static に確保してしまうため,デフォルトではコンパイル対象には含まれない. +コンパイル対象に含める場合は, FIXME: で設定すること. diff --git a/tlm_cmd/ccsds/mobc/README.md b/tlm_cmd/ccsds/mobc/README.md deleted file mode 100644 index b280a5f51..000000000 --- a/tlm_cmd/ccsds/mobc/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# CCSDS / MOBC - -本ディレクトリに配置されているコードは,地上局と通信する無線機 (STX や SRX) に接続される OBC (MOBC など) 向けの,CCSDS Space Communications Protocols における,TC Space Data Link Protocol と AOS Space Data Link Protocol に関連するコードである. - -CSDS Space Communications Protocols は,様々な設計パラメタがあるが,ここでのコードは,ある特定の設計パラメタにおける実装であることに注意すること. -したがって,現時点では汎用性の低いコードが配置されている. -(今後,適切にリファクタリングする予定.) - -また,本コードをコンパイル対象に加えると,少なくない RAM を static に確保してしまうため,デフォルトではコンパイル対象には含まれない. -コンパイル対象に含める場合は, FIXME: で設定すること. From 719f4204ed0afeffa42d40438a06fe7325166de1 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 24 Nov 2023 14:11:31 +0900 Subject: [PATCH 62/87] add ccsds cmakelists --- CMakeLists.txt | 17 +++++++++++++++++ .../aos_space_data_link_protocol/CMakeLists.txt | 17 +++++++++++++++++ .../tc_space_data_link_protocol/CMakeLists.txt | 16 ++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt create mode 100644 tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index f0c5ea1c6..8a7c39420 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,11 @@ option(C2A_USE_ALL_CORE_APPS "Use C2A-core all Applications" ON) option(C2A_USE_ALL_CORE_TEST_APPS "Use C2A-core all Test Applications" ON) option(C2A_USE_ALL_CORE_LIB "Use C2A-core all library" ON) +## C2A CCSDS select +# See alse; /docs/core/ccsds.md +option(C2A_USE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL "Use C2A-core CCSDS AOS SPACE DATA LINK PROTOCOL" OFF) +option(C2A_USE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL "Use C2A-core CCSDS TC SPACE DATA LINK PROTOCOL" OFF) + option(C2A_USE_SIMPLE_LIBC "Use C2A-core hosted simple libc (c2a-core/library/libc) implementation" OFF) set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) @@ -99,4 +104,16 @@ if(C2A_USE_ALL_CORE_LIB) target_sources(${PROJECT_NAME} PUBLIC $) endif() +if(C2A_USE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL) + add_subdirectory(tlm_cmd/ccsds/aos_space_data_link_protocol) + target_sources(${PROJECT_NAME} PUBLIC $) +endif() + +if(C2A_USE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL) + add_subdirectory(tlm_cmd/ccsds/tc_space_data_link_protocol) + target_sources(${PROJECT_NAME} PUBLIC $) +endif() + + + include(common.cmake) diff --git a/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt b/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt new file mode 100644 index 000000000..147f84b22 --- /dev/null +++ b/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.13) + +project(C2A_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL) + +set(C2A_SRCS + tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.c + tlm_cmd/ccsds/aos_space_data_link_protocol/multiplexing_protocol_data_unit.c + tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c +) + +if(C2A_BUILD_AS_CXX) + set_source_files_properties(${C2A_SRCS} PROPERTIES LANGUAGE CXX) # C++ +endif() + +add_library(${PROJECT_NAME} OBJECT ${C2A_SRCS}) + +include(${C2A_CORE_DIR}/common.cmake) diff --git a/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt b/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt new file mode 100644 index 000000000..06c6b90ca --- /dev/null +++ b/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.13) + +project(C2A_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL) + +set(C2A_SRCS + tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.c + tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c +) + +if(C2A_BUILD_AS_CXX) + set_source_files_properties(${C2A_SRCS} PROPERTIES LANGUAGE CXX) # C++ +endif() + +add_library(${PROJECT_NAME} OBJECT ${C2A_SRCS}) + +include(${C2A_CORE_DIR}/common.cmake) From 5a0c1c15f787e820739b01c93a605bf2154ec800 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 24 Nov 2023 14:13:51 +0900 Subject: [PATCH 63/87] add ccsds use flag in mobc cmake --- examples/mobc/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/mobc/CMakeLists.txt b/examples/mobc/CMakeLists.txt index 77f97b445..982d77066 100644 --- a/examples/mobc/CMakeLists.txt +++ b/examples/mobc/CMakeLists.txt @@ -20,6 +20,10 @@ option(C2A_BUILD_WITH_SILS_MOCKUP "Build C2A with SILS mockup for check undefine option(C2A_BUILD_FOR_SILS "Build C2A for SILS target" ON) +# core に同封されている CCSDS の実装を使う +set(C2A_USE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL ON) +set(C2A_USE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL ON) + if(C2A_BUILD_WITH_SILS_MOCKUP) set(C2A_BUILD_AS_CXX OFF) endif() From c49b75a6e06569832e6f52d043d5005d3b97fd92 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 24 Nov 2023 14:15:49 +0900 Subject: [PATCH 64/87] fix small --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a7c39420..89505117c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,4 @@ if(C2A_USE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL) target_sources(${PROJECT_NAME} PUBLIC $) endif() - - include(common.cmake) From 4ad649839d01ced2f595c7ffa170a2417bba08ce Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 24 Nov 2023 14:17:28 +0900 Subject: [PATCH 65/87] fix cmake --- tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt | 6 +++--- tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt b/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt index 147f84b22..236f139c2 100644 --- a/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt +++ b/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt @@ -3,9 +3,9 @@ cmake_minimum_required(VERSION 3.13) project(C2A_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL) set(C2A_SRCS - tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.c - tlm_cmd/ccsds/aos_space_data_link_protocol/multiplexing_protocol_data_unit.c - tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c + aos_transfer_frame.c + multiplexing_protocol_data_unit.c + tcp_to_m_pdu.c ) if(C2A_BUILD_AS_CXX) diff --git a/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt b/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt index 06c6b90ca..09fc22e87 100644 --- a/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt +++ b/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt @@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.13) project(C2A_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL) set(C2A_SRCS - tlm_cmd/ccsds/tc_space_data_link_protocol/tc_segment.c - tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c + tc_segment.c + tc_transfer_frame.c ) if(C2A_BUILD_AS_CXX) From ac09ee53620c519b6e849ff495859d3ff11da42d Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 24 Nov 2023 23:35:07 +0900 Subject: [PATCH 66/87] fix cmakelists --- CMakeLists.txt | 12 ++++++------ examples/mobc/CMakeLists.txt | 4 ++-- .../aos_space_data_link_protocol/CMakeLists.txt | 2 +- .../ccsds/tc_space_data_link_protocol/CMakeLists.txt | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89505117c..95580c75d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,8 @@ option(C2A_USE_ALL_CORE_LIB "Use C2A-core all library" ON) ## C2A CCSDS select # See alse; /docs/core/ccsds.md -option(C2A_USE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL "Use C2A-core CCSDS AOS SPACE DATA LINK PROTOCOL" OFF) -option(C2A_USE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL "Use C2A-core CCSDS TC SPACE DATA LINK PROTOCOL" OFF) +option(C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL "Use C2A-core CCSDS AOS SPACE DATA LINK PROTOCOL implementation" OFF) +option(C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL "Use C2A-core CCSDS TC SPACE DATA LINK PROTOCOL implementation" OFF) option(C2A_USE_SIMPLE_LIBC "Use C2A-core hosted simple libc (c2a-core/library/libc) implementation" OFF) @@ -104,14 +104,14 @@ if(C2A_USE_ALL_CORE_LIB) target_sources(${PROJECT_NAME} PUBLIC $) endif() -if(C2A_USE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL) +if(C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL) add_subdirectory(tlm_cmd/ccsds/aos_space_data_link_protocol) - target_sources(${PROJECT_NAME} PUBLIC $) + target_sources(${PROJECT_NAME} PUBLIC $) endif() -if(C2A_USE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL) +if(C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL) add_subdirectory(tlm_cmd/ccsds/tc_space_data_link_protocol) - target_sources(${PROJECT_NAME} PUBLIC $) + target_sources(${PROJECT_NAME} PUBLIC $) endif() include(common.cmake) diff --git a/examples/mobc/CMakeLists.txt b/examples/mobc/CMakeLists.txt index 982d77066..6e791b4ef 100644 --- a/examples/mobc/CMakeLists.txt +++ b/examples/mobc/CMakeLists.txt @@ -21,8 +21,8 @@ option(C2A_BUILD_WITH_SILS_MOCKUP "Build C2A with SILS mockup for check undefine option(C2A_BUILD_FOR_SILS "Build C2A for SILS target" ON) # core に同封されている CCSDS の実装を使う -set(C2A_USE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL ON) -set(C2A_USE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL ON) +set(C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL ON) +set(C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL ON) if(C2A_BUILD_WITH_SILS_MOCKUP) set(C2A_BUILD_AS_CXX OFF) diff --git a/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt b/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt index 236f139c2..a9b512b74 100644 --- a/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt +++ b/tlm_cmd/ccsds/aos_space_data_link_protocol/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.13) -project(C2A_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL) +project(C2A_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL) set(C2A_SRCS aos_transfer_frame.c diff --git a/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt b/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt index 09fc22e87..cb6894dcb 100644 --- a/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt +++ b/tlm_cmd/ccsds/tc_space_data_link_protocol/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.13) -project(C2A_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL) +project(C2A_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL) set(C2A_SRCS tc_segment.c From d606473d0275800691bb6fcab2cf84018772fd71 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 11:48:09 +0900 Subject: [PATCH 67/87] fix typo --- examples/mobc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mobc/CMakeLists.txt b/examples/mobc/CMakeLists.txt index 6e791b4ef..0583bd82d 100644 --- a/examples/mobc/CMakeLists.txt +++ b/examples/mobc/CMakeLists.txt @@ -20,7 +20,7 @@ option(C2A_BUILD_WITH_SILS_MOCKUP "Build C2A with SILS mockup for check undefine option(C2A_BUILD_FOR_SILS "Build C2A for SILS target" ON) -# core に同封されている CCSDS の実装を使う +# core に同梱されている CCSDS の実装を使う set(C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL ON) set(C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL ON) From bb4c86339d3f37071c95cbfe1b4a7ce529527c92 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 11:53:56 +0900 Subject: [PATCH 68/87] Update check_coding_rule.json --- examples/subobc/check_coding_rule.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/subobc/check_coding_rule.json b/examples/subobc/check_coding_rule.json index 5c9e1e795..5f191bb54 100644 --- a/examples/subobc/check_coding_rule.json +++ b/examples/subobc/check_coding_rule.json @@ -31,7 +31,12 @@ "CommonCmdPacket", "SpacePacket", "TlmSpacePacket", - "CmdSpacePacket" + "CmdSpacePacket", + "AosTransferFrame", + "MultiplexingProtocolDataUnit", + "TcpToMPdu", + "TcSegment", + "TcTransferFrame" ], "comment_additional_type" : [ "FIXME: TCP はもう存在しないはずなので,どこかで消す", From 6a4946cca64bb306116e50b8867ac28e58516434 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 12:04:50 +0900 Subject: [PATCH 69/87] Update CHANGELOG.md --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8db6d652f..2d54bf0c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## v4.1.0 (Unreleased) +### Enhancements + +- [#214](https://github.com/arkedge/c2a-core/pull/214): CCSDS の主 MOBC 向け Data Link Layer のコードを Core 管理にする + ### Fixed - [#193](https://github.com/arkedge/c2a-core/pull/193): VCDU を AOS transfer frame に rename する @@ -30,6 +34,13 @@ - `#include ` -> `#include ` - `#include ` -> `#include ` - `#include ` -> `#include ` +- [#214](https://github.com/arkedge/c2a-core/pull/214): 影響範囲は MOBC のみ + 1. `src_user/tlm_cmd/ccsds/` 内部の Data Link Layer に関連するコードを消すし, `CMakeLists.txt` も修正する. + 1. c2a user のトップレベルの `CMakeLists.txt` にて, `C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL`, `C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL` をともに `ON` に設定する. + - `examples/mobc/CMakeLists.txt` を参考にできる. + 1. コンパイルが通らないところを直す.想定されるものは以下. + - `src_core/tlm_cmd/ccsds/` のファイルの場所が変わったことにより, include パスを修正する.コンパイルが通らないところを直す. + ## v4.0.1 (2023-11-09) From 7c5087ccd13575a7135a47a328e91a858efaba3e Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Tue, 28 Nov 2023 12:54:21 +0900 Subject: [PATCH 70/87] fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d54bf0c0..b412e0250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,7 @@ - `#include ` -> `#include ` - `#include ` -> `#include ` - [#214](https://github.com/arkedge/c2a-core/pull/214): 影響範囲は MOBC のみ - 1. `src_user/tlm_cmd/ccsds/` 内部の Data Link Layer に関連するコードを消すし, `CMakeLists.txt` も修正する. + 1. `src_user/tlm_cmd/ccsds/` 内部の Data Link Layer に関連するコードを消し, `CMakeLists.txt` も修正する. 1. c2a user のトップレベルの `CMakeLists.txt` にて, `C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL`, `C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL` をともに `ON` に設定する. - `examples/mobc/CMakeLists.txt` を参考にできる. 1. コンパイルが通らないところを直す.想定されるものは以下. From 513058d9658d7afa9b1021b069c69024785d6e86 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Tue, 28 Nov 2023 12:56:44 +0900 Subject: [PATCH 71/87] Update CHANGELOG.md --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b412e0250..077649ef7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,12 @@ - `#include ` -> `#include ` - `#include ` -> `#include ` - [#214](https://github.com/arkedge/c2a-core/pull/214): 影響範囲は MOBC のみ - 1. `src_user/tlm_cmd/ccsds/` 内部の Data Link Layer に関連するコードを消し, `CMakeLists.txt` も修正する. + 1. `src_user/tlm_cmd/ccsds/` 内部の以下のような Data Link Layer に関連するコードを消し, `CMakeLists.txt` も修正する. + - `aos_transfer_frame.{c,h}` + - `multiplexing_protocol_data_unit.{c,h}` + - `tcp_to_m_pdu.{c,h}` + - `tc_segment.{c,h}` + - `tc_transfer_frame.{c,h}` 1. c2a user のトップレベルの `CMakeLists.txt` にて, `C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL`, `C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL` をともに `ON` に設定する. - `examples/mobc/CMakeLists.txt` を参考にできる. 1. コンパイルが通らないところを直す.想定されるものは以下. From 78e9d78deb177c4b5e01c50d7b669d7234ab3965 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Sun, 3 Dec 2023 17:57:37 +0900 Subject: [PATCH 72/87] Update CHANGELOG.md --- CHANGELOG.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 077649ef7..3b9edfa16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,17 +34,26 @@ - `#include ` -> `#include ` - `#include ` -> `#include ` - `#include ` -> `#include ` -- [#214](https://github.com/arkedge/c2a-core/pull/214): 影響範囲は MOBC のみ - 1. `src_user/tlm_cmd/ccsds/` 内部の以下のような Data Link Layer に関連するコードを消し, `CMakeLists.txt` も修正する. - - `aos_transfer_frame.{c,h}` - - `multiplexing_protocol_data_unit.{c,h}` - - `tcp_to_m_pdu.{c,h}` - - `tc_segment.{c,h}` - - `tc_transfer_frame.{c,h}` - 1. c2a user のトップレベルの `CMakeLists.txt` にて, `C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL`, `C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL` をともに `ON` に設定する. - - `examples/mobc/CMakeLists.txt` を参考にできる. - 1. コンパイルが通らないところを直す.想定されるものは以下. - - `src_core/tlm_cmd/ccsds/` のファイルの場所が変わったことにより, include パスを修正する.コンパイルが通らないところを直す. +- [#214](https://github.com/arkedge/c2a-core/pull/214): 影響範囲は MOBC の CCSDS Data Link Layer の実装 + 1. AOS Space Data Link Protocol の実装を c2a-core のものに切り替える + 1. `src_user/tlm_cmd/ccsds/` 内の既存の実装を消す + - `aos_transfer_frame.{c,h}` + - `multiplexing_protocol_data_unit.{c,h}` + - `tcp_to_m_pdu.{c,h}` + 1. c2a-core の実装を使うように切り替える + - `src_core/ccsds/aos_space_data_link_protocol/` 内のソースファイルをビルド対象に追加する + - CMake の場合, `C2A_USE_CORE_CCSDS_AOS_SPACE_DATA_LINK_PROTOCOL` option を `ON` にするだけでよい (C2A user top の `CMakeLists.txt`) + - `examples/mobc/CMakeLists.txt` を参考にできる. + 1. コンパイルが通らないところを直す.ファイルの場所が変わったことによる include path の修正が想定される. + 1. TC Space Data Link Protocol の実装を c2a-core のものに切り替える + 1. `src_user/tlm_cmd/ccsds/` 内の既存の実装を消す + - `tc_segment.{c,h}` + - `tc_transfer_frame.{c,h}` + 1. c2a-core の実装を使うように切り替える + - `src_core/ccsds/tc_space_data_link_protocol/` 内のソースファイルをビルド対象に追加する + - CMake の場合, `C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL` option を `ON` にするだけでよい (C2A user top の `CMakeLists.txt`) + - `examples/mobc/CMakeLists.txt` を参考にできる. + 1. コンパイルが通らないところを直す.ファイルの場所が変わったことによる include path の修正が想定される. ## v4.0.1 (2023-11-09) From 7b40f5bc52177a29cd3b65316262e3ef9361d91a Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 13:20:23 +0900 Subject: [PATCH 73/87] extract SCID to user settings --- .../mobc/src/src_user/settings/CMakeLists.txt | 2 ++ .../tlm_cmd/ccsds/aos_transfer_frame_define.c | 19 +++++++++++ .../tlm_cmd/ccsds/aos_transfer_frame_define.h | 32 +++++++++++++++++++ .../tlm_cmd/ccsds/tc_transfer_frame_define.c | 19 +++++++++++ .../tlm_cmd/ccsds/tc_transfer_frame_define.h | 32 +++++++++++++++++++ .../aos_transfer_frame.h | 17 ++++++---- .../tc_transfer_frame.h | 22 ++++++------- 7 files changed, 126 insertions(+), 17 deletions(-) create mode 100644 examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.c create mode 100644 examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.h create mode 100644 examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.c create mode 100644 examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.h diff --git a/examples/mobc/src/src_user/settings/CMakeLists.txt b/examples/mobc/src/src_user/settings/CMakeLists.txt index 05d9690df..ee69efb9c 100644 --- a/examples/mobc/src/src_user/settings/CMakeLists.txt +++ b/examples/mobc/src/src_user/settings/CMakeLists.txt @@ -17,7 +17,9 @@ set(C2A_SRCS system/event_handler_rules/event_handler_rules.c system/event_handler_rules/event_handler_rule_test.c tlm_cmd/common_cmd_packet_define.c + tlm_cmd/ccsds/aos_transfer_frame_define.c tlm_cmd/ccsds/apid_define.c + tlm_cmd/ccsds/tc_transfer_frame_define.c ) if(C2A_BUILD_AS_CXX) diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.c b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.c new file mode 100644 index 000000000..66d0ef174 --- /dev/null +++ b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.c @@ -0,0 +1,19 @@ +#pragma section REPRO +/** + * @file + * @brief AOS Transfer Frame のユーザー定義 + */ +#include "aos_transfer_frame_define.h" + +AOSTF_SCID AOSTF_get_scid_from_uint8(uint8_t scid) +{ + switch ((AOSTF_SCID)scid) + { + case AOSTF_SCID_SAMPLE_SATELLITE: + return (AOSTF_SCID)scid; + default: + return AOSTF_SCID_UNKNOWN; + } +} + +#pragma section diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.h new file mode 100644 index 000000000..fcde0da8b --- /dev/null +++ b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.h @@ -0,0 +1,32 @@ +/** + * @file + * @brief AOS Transfer Frame のユーザー定義 + * @note aos_transfer_frame.h などから include されることを前提 + */ +#ifndef AOS_TRANSFER_FRAME_DEFINE_H_ +#define AOS_TRANSFER_FRAME_DEFINE_H_ + +#include + +/** + * @enum AOSTF_SCID + * @brief Spacecraft ID + * @note 8 bit + */ +typedef enum +{ + AOSTF_SCID_SAMPLE_SATELLITE = 0x00, + AOSTF_SCID_UNKNOWN +} AOSTF_SCID; + +#define AOSTF_SCID_MY_ID (AOSTF_SCID_SAMPLE_SATELLITE) //!< 自分の SCID + +/** + * @brief バイト列から AOSTF_SCID を取得 + * @param scid: AOSTF_SCID 候補の uint8_t + * @note 不正な入力のときは AOSTF_SCID_UNKNOWN を返す + * @return AOSTF_SCID + */ +AOSTF_SCID AOSTF_get_scid_from_uint8(uint8_t scid); + +#endif diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.c b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.c new file mode 100644 index 000000000..a81d13f2c --- /dev/null +++ b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.c @@ -0,0 +1,19 @@ +#pragma section REPRO +/** + * @file + * @brief TC Transfer Frame のユーザー定義 + */ +#include "tc_transfer_frame_define.h" + +TCTF_SCID TCTF_get_scid_from_uint16(uint16_t scid) +{ + switch ((TCTF_SCID)scid) + { + case TCTF_SCID_SAMPLE_SATELLITE: + return (TCTF_SCID)scid; + default: + return TCTF_SCID_UNKNOWN; + } +} + +#pragma section diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.h new file mode 100644 index 000000000..cd877cb38 --- /dev/null +++ b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.h @@ -0,0 +1,32 @@ +/** + * @file + * @brief TC Transfer Frame のユーザー定義 + * @note tc_transfer_frame.h などから include されることを前提 + */ +#ifndef TC_TRANSFER_FRAME_DEFINE_H_ +#define TC_TRANSFER_FRAME_DEFINE_H_ + +#include + +/** + * @enum TCTF_SCID + * @brief Spacecraft ID + * @note 10 bit + */ +typedef enum +{ + TCTF_SCID_SAMPLE_SATELLITE = 0x157, // SCID for command of sample satellite + TCTF_SCID_UNKNOWN +} TCTF_SCID; + +#define TCTD_SCID_MY_ID (TCTF_SCID_SAMPLE_SATELLITE) //!< 自分の SCID + +/** + * @brief バイト列から TCTF_SCID を取得 + * @param scid: TCTF_SCID 候補の uint16_t + * @note 不正な入力のときは TCTF_SCID_UNKNOWN を返す + * @return TCTF_SCID + */ +TCTF_SCID TCTF_get_scid_from_uint16(uint16_t scid); + +#endif diff --git a/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.h b/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.h index 796086d3a..1a7cc4a41 100644 --- a/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.h +++ b/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.h @@ -47,6 +47,17 @@ #define AOSTF_LEN (AOSTF_HEADER_SIZE + M_PDU_LEN + AOSTF_TRAILER_SIZE) #define AOSTF_COUNTER_MAX (0x01000000) // 24bit長 +// ここで AOSTF_SCID, AOSTF_SCID_MY_ID を定義する +// AOSTF_SCID_UNKNOWN は必須 +/* 例 +typedef enum +{ + AOSTF_SCID_SAMPLE_SATELLITE = 0x00, + AOSTF_SCID_UNKNOWN +} AOSTF_SCID; +*/ +#include + typedef struct { uint8_t header[AOSTF_HEADER_SIZE]; @@ -60,12 +71,6 @@ typedef enum AOSTF_VER_UNKNOWN } AOSTF_VER; -typedef enum -{ - AOSTF_SCID_SAMPLE_SATELLITE = 0x00, - AOSTF_SCID_UNKNOWN -} AOSTF_SCID; - typedef enum { AOSTF_VCID_REALTIME = 0x01, // 000001b: Realtime Transfer Frame diff --git a/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.h b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.h index e16667f9e..d69102ee5 100644 --- a/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.h +++ b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.h @@ -45,6 +45,17 @@ #error TCTCF LEN IS LONGER THAN TCTF MAX LEN #endif +// ここで TCTF_SCID, TCTD_SCID_MY_ID を定義する +// TCTF_SCID_UNKNOWN は必須 +/* 例 +typedef enum +{ + TCTF_SCID_SAMPLE_SATELLITE = 0x000, + TCTF_SCID_UNKNOWN +} TCTF_SCID; +*/ +#include + /** * @struct TcTransferFrame * @brief TC Transfer Frame のパケット構造体 @@ -78,17 +89,6 @@ typedef enum TCTF_TYPE_UNKNOWN } TCTF_TYPE; -/** - * @enum TCTF_SCID - * @brief Spacecraft ID - * @note 10 bit - */ -typedef enum -{ - TCTF_SCID_SAMPLE_SATELLITE = 0x157, // SCID for command of sample satellite - TCTF_SCID_UNKNOWN -} TCTF_SCID; - /** * @enum TCTF_VCID * @brief Virtual Channel ID From c23c7ab13a752e9cb8216aca2078f3fb0d097f7e Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 13:27:31 +0900 Subject: [PATCH 74/87] use specific SCID in core code --- .../mobc/src/src_user/component_driver/com/gs.c | 4 ++-- .../src_user/component_driver/com/gs_validate.c | 2 +- .../aos_transfer_frame.c | 10 ++-------- .../tc_transfer_frame.c | 15 ++++----------- 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/examples/mobc/src/src_user/component_driver/com/gs.c b/examples/mobc/src/src_user/component_driver/com/gs.c index cd2f600b7..7e4859b1a 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs.c +++ b/examples/mobc/src/src_user/component_driver/com/gs.c @@ -84,8 +84,8 @@ CDS_INIT_ERR_CODE GS_init(GS_Driver* gs_driver, GS_rx_header_[2][0] |= (uint8_t)((TCTF_TYPE_BC & 0x0f) << 4); for (stream = 0; stream < GS_RX_HEADER_NUM; ++stream) { - GS_rx_header_[stream][0] |= (uint8_t)((TCTF_SCID_SAMPLE_SATELLITE & 0x3ff) >> 8); - GS_rx_header_[stream][1] |= (uint8_t)(TCTF_SCID_SAMPLE_SATELLITE & 0xff); + GS_rx_header_[stream][0] |= (uint8_t)((TCTD_SCID_MY_ID & 0x3ff) >> 8); + GS_rx_header_[stream][1] |= (uint8_t)(TCTD_SCID_MY_ID & 0xff); } ret_ccsds = CDS_init_streams(&gs_driver->driver_ccsds.super, diff --git a/examples/mobc/src/src_user/component_driver/com/gs_validate.c b/examples/mobc/src/src_user/component_driver/com/gs_validate.c index b14d4e804..9956630c4 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs_validate.c +++ b/examples/mobc/src/src_user/component_driver/com/gs_validate.c @@ -84,7 +84,7 @@ GS_VALIDATE_ERR GS_validate_tctf(const TcTransferFrame* tctf) static GS_VALIDATE_ERR GS_check_tctf_header_(const TcTransferFrame* tctf) { if (TCTF_get_ver(tctf) != TCTF_VER_1) return GS_VALIDATE_ERR_TCTF_VER; - if (TCTF_get_scid(tctf) != TCTF_SCID_SAMPLE_SATELLITE) return GS_VALIDATE_ERR_TCTF_SCID; + if (TCTF_get_scid(tctf) != TCTD_SCID_MY_ID) return GS_VALIDATE_ERR_TCTF_SCID; if (TCTF_get_vcid(tctf) != TCTF_VCID_REALTIME) return GS_VALIDATE_ERR_TCTF_VCID; return GS_VALIDATE_ERR_OK; diff --git a/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.c b/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.c index f177e4227..6e5f170f3 100644 --- a/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.c +++ b/tlm_cmd/ccsds/aos_space_data_link_protocol/aos_transfer_frame.c @@ -47,7 +47,7 @@ void AOSTF_setup_replay_aostf_hdr(AosTransferFrame* aostf, uint32_t counter) static void AOSTF_set_common_hdr_(AosTransferFrame* aostf) { AOSTF_set_ver(aostf, AOSTF_VER_2); - AOSTF_set_scid(aostf, AOSTF_SCID_SAMPLE_SATELLITE); // FIXME: 仮 + AOSTF_set_scid(aostf, AOSTF_SCID_MY_ID); AOSTF_set_replay_flag(aostf, AOSTF_REPLAY_FALSE); AOSTF_clear_spare_(aostf); } @@ -96,13 +96,7 @@ AOSTF_SCID AOSTF_get_scdi(const AosTransferFrame* aostf) scid <<= 2; scid |= ((aostf->header[pos + 1] & mask2) >> 6); - switch (scid) - { - case AOSTF_SCID_SAMPLE_SATELLITE: - return (AOSTF_SCID)scid; - default: - return AOSTF_SCID_UNKNOWN; - } + return AOSTF_get_scid_from_uint8((uint8_t)scid); } void AOSTF_set_scid(AosTransferFrame* aostf, AOSTF_SCID scid) diff --git a/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c index a4646933c..b32736a66 100644 --- a/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c +++ b/tlm_cmd/ccsds/tc_space_data_link_protocol/tc_transfer_frame.c @@ -50,18 +50,11 @@ TCTF_SCID TCTF_get_scid(const TcTransferFrame* tctf) uint8_t mask = 0x03; // 0000 0011b // pos = 0の下位2bitsとpos = 1の8bitsを合わせた10bits - TCTF_SCID scid = (TCTF_SCID)(tctf->packet[pos] & mask); - scid = (TCTF_SCID)(scid << 8); - scid = (TCTF_SCID)(scid + tctf->packet[pos + 1]); + uint16_t scid = (uint16_t)(tctf->packet[pos] & mask); + scid = (uint16_t)(scid << 8); + scid = (uint16_t)(scid + tctf->packet[pos + 1]); - switch (scid) - { - case TCTF_SCID_SAMPLE_SATELLITE: - return scid; - - default: - return TCTF_SCID_UNKNOWN; - } + return TCTF_get_scid_from_uint16(scid); } TCTF_VCID TCTF_get_vcid(const TcTransferFrame* tctf) From 276b229582d5d657458f1d7e1742e952f981f28c Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 15:27:40 +0900 Subject: [PATCH 75/87] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9edfa16..89e602b01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Enhancements - [#214](https://github.com/arkedge/c2a-core/pull/214): CCSDS の主 MOBC 向け Data Link Layer のコードを Core 管理にする +- [#214](https://github.com/arkedge/c2a-core/pull/219): CCSDS の主 MOBC 向け Data Link Layer の SCID をユーザー設定として切り出す ### Fixed @@ -54,6 +55,8 @@ - CMake の場合, `C2A_USE_CORE_CCSDS_TC_SPACE_DATA_LINK_PROTOCOL` option を `ON` にするだけでよい (C2A user top の `CMakeLists.txt`) - `examples/mobc/CMakeLists.txt` を参考にできる. 1. コンパイルが通らないところを直す.ファイルの場所が変わったことによる include path の修正が想定される. +- [#219](https://github.com/arkedge/c2a-core/pull/219): 影響範囲は MOBC のみ + 1. PR の diff (`examples/mobc/src/`) に出ている修正を, user にも反映させる. ## v4.0.1 (2023-11-09) From a8f945adea8f557e350b60f59e151688e8607bf0 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 15:50:02 +0900 Subject: [PATCH 76/87] apply APID naming rule --- .../settings/tlm_cmd/ccsds/apid_define.c | 16 +++++----- .../settings/tlm_cmd/ccsds/apid_define.h | 30 +++++++++++++------ .../settings/tlm_cmd/ccsds/apid_define.c | 16 +++++----- .../settings/tlm_cmd/ccsds/apid_define.h | 30 +++++++++++++------ tlm_cmd/common_tlm_cmd_packet.h | 18 +++++------ 5 files changed, 67 insertions(+), 43 deletions(-) diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.c b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.c index 57afc6e33..274132fd4 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.c +++ b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.c @@ -11,14 +11,14 @@ APID APID_get_apid_from_uint16(uint16_t apid) { switch ((APID)apid) { - case APID_MOBC_CMD: // FALLTHROUGH - case APID_AOBC_CMD: // FALLTHROUGH - case APID_TOBC_CMD: // FALLTHROUGH - case APID_TCAL_TLM: // FALLTHROUGH - case APID_MOBC_TLM: // FALLTHROUGH - case APID_AOBC_TLM: // FALLTHROUGH - case APID_TOBC_TLM: // FALLTHROUGH - case APID_DUMP_TLM: // FALLTHROUGH + case APID_CMD_TO_MOBC: // FALLTHROUGH + case APID_CMD_TO_AOBC: // FALLTHROUGH + case APID_CMD_TO_TOBC: // FALLTHROUGH + case APID_TLM_TCAL: // FALLTHROUGH + case APID_TLM_MOBC: // FALLTHROUGH + case APID_TLM_AOBC: // FALLTHROUGH + case APID_TLM_TOBC: // FALLTHROUGH + case APID_TLM_DUMP: // FALLTHROUGH case APID_FILL_PKT: return (APID)apid; diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h index c2a6d24b0..12e2e5e8b 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h @@ -12,18 +12,30 @@ * @enum APID * @brief Application Process ID * @note 11bit + * @note 命名規則: + * Tlm: APID_TLM_{送信元}_TO_{受信先}_VIA_{経由地} + * Cmd: APID_CMD_{送信元}_TO_{受信先}_VIA_{経由地} + * ただし,Tlm の TO_SGS,Cmd の SGS は省略できる + * 例: + * APID_CMD_TO_MOBC (SGS を省略) + * APID_TLM_AOBC (TO_SGS を省略.パスが単一しかありえないので, VIA_MOBCも省略) + * APID_TLM_CAMERA_TO_XGS_VIA_MIF (全部記載) + * 注意: + * 同一コンポからアプリケーション等を区別して APID を発行したい場合 (eg; HK テレメ,ミッションデータ,Sバンドデータ,X バンドデータ,など) は {送信元} にそれを識別する命名ができる + * APID_TLM_AOBC, APID_TLM_AOBC_STT_IMG, など + * 詳細: https://github.com/arkedge/c2a-core/issues/186#issuecomment-1798685321 */ typedef enum { - APID_MOBC_CMD = 0x210, //!< 01000010000b: APID for MOBC 宛の CMD - APID_AOBC_CMD = 0x211, //!< 01000010001b: APID for AOBC 宛の CMD - APID_TOBC_CMD = 0x212, //!< 01000010010b: APID for TOBC 宛の CMD - APID_TCAL_TLM = 0x410, //!< 10000010000b: APID for TIME CARIBLATION TLM (FIXME: 現在まともに使ってない) - APID_MOBC_TLM = 0x510, //!< 10100010000b: APID for MOBC で生成される TLM - APID_AOBC_TLM = 0x511, //!< 10100010001b: APID for AOBC で生成される TLM - APID_TOBC_TLM = 0x512, //!< 10100010002b: APID for TOBC で生成される TLM - APID_DUMP_TLM = 0x710, //!< 11100010000b: APID for DUMP TLM (FIXME: 現在まともに使ってない) - APID_FILL_PKT = 0x7ff, //!< 11111111111b: APID for FILL PACKET + APID_CMD_TO_MOBC = 0x210, //!< 01000010000b: APID for MOBC 宛の CMD + APID_CMD_TO_AOBC = 0x211, //!< 01000010001b: APID for AOBC 宛の CMD + APID_CMD_TO_TOBC = 0x212, //!< 01000010010b: APID for TOBC 宛の CMD + APID_TLM_TCAL = 0x410, //!< 10000010000b: APID for TIME CARIBLATION TLM (FIXME: 現在まともに使ってない) + APID_TLM_MOBC = 0x510, //!< 10100010000b: APID for MOBC で生成される TLM + APID_TLM_AOBC = 0x511, //!< 10100010001b: APID for AOBC で生成される TLM + APID_TLM_TOBC = 0x512, //!< 10100010002b: APID for TOBC で生成される TLM + APID_TLM_DUMP = 0x710, //!< 11100010000b: APID for DUMP TLM (FIXME: 現在まともに使ってない) + APID_FILL_PKT = 0x7ff, //!< 11111111111b: APID for FILL PACKET APID_UNKNOWN } APID; diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.c b/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.c index 57afc6e33..274132fd4 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.c +++ b/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.c @@ -11,14 +11,14 @@ APID APID_get_apid_from_uint16(uint16_t apid) { switch ((APID)apid) { - case APID_MOBC_CMD: // FALLTHROUGH - case APID_AOBC_CMD: // FALLTHROUGH - case APID_TOBC_CMD: // FALLTHROUGH - case APID_TCAL_TLM: // FALLTHROUGH - case APID_MOBC_TLM: // FALLTHROUGH - case APID_AOBC_TLM: // FALLTHROUGH - case APID_TOBC_TLM: // FALLTHROUGH - case APID_DUMP_TLM: // FALLTHROUGH + case APID_CMD_TO_MOBC: // FALLTHROUGH + case APID_CMD_TO_AOBC: // FALLTHROUGH + case APID_CMD_TO_TOBC: // FALLTHROUGH + case APID_TLM_TCAL: // FALLTHROUGH + case APID_TLM_MOBC: // FALLTHROUGH + case APID_TLM_AOBC: // FALLTHROUGH + case APID_TLM_TOBC: // FALLTHROUGH + case APID_TLM_DUMP: // FALLTHROUGH case APID_FILL_PKT: return (APID)apid; diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h index c2a6d24b0..12e2e5e8b 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h @@ -12,18 +12,30 @@ * @enum APID * @brief Application Process ID * @note 11bit + * @note 命名規則: + * Tlm: APID_TLM_{送信元}_TO_{受信先}_VIA_{経由地} + * Cmd: APID_CMD_{送信元}_TO_{受信先}_VIA_{経由地} + * ただし,Tlm の TO_SGS,Cmd の SGS は省略できる + * 例: + * APID_CMD_TO_MOBC (SGS を省略) + * APID_TLM_AOBC (TO_SGS を省略.パスが単一しかありえないので, VIA_MOBCも省略) + * APID_TLM_CAMERA_TO_XGS_VIA_MIF (全部記載) + * 注意: + * 同一コンポからアプリケーション等を区別して APID を発行したい場合 (eg; HK テレメ,ミッションデータ,Sバンドデータ,X バンドデータ,など) は {送信元} にそれを識別する命名ができる + * APID_TLM_AOBC, APID_TLM_AOBC_STT_IMG, など + * 詳細: https://github.com/arkedge/c2a-core/issues/186#issuecomment-1798685321 */ typedef enum { - APID_MOBC_CMD = 0x210, //!< 01000010000b: APID for MOBC 宛の CMD - APID_AOBC_CMD = 0x211, //!< 01000010001b: APID for AOBC 宛の CMD - APID_TOBC_CMD = 0x212, //!< 01000010010b: APID for TOBC 宛の CMD - APID_TCAL_TLM = 0x410, //!< 10000010000b: APID for TIME CARIBLATION TLM (FIXME: 現在まともに使ってない) - APID_MOBC_TLM = 0x510, //!< 10100010000b: APID for MOBC で生成される TLM - APID_AOBC_TLM = 0x511, //!< 10100010001b: APID for AOBC で生成される TLM - APID_TOBC_TLM = 0x512, //!< 10100010002b: APID for TOBC で生成される TLM - APID_DUMP_TLM = 0x710, //!< 11100010000b: APID for DUMP TLM (FIXME: 現在まともに使ってない) - APID_FILL_PKT = 0x7ff, //!< 11111111111b: APID for FILL PACKET + APID_CMD_TO_MOBC = 0x210, //!< 01000010000b: APID for MOBC 宛の CMD + APID_CMD_TO_AOBC = 0x211, //!< 01000010001b: APID for AOBC 宛の CMD + APID_CMD_TO_TOBC = 0x212, //!< 01000010010b: APID for TOBC 宛の CMD + APID_TLM_TCAL = 0x410, //!< 10000010000b: APID for TIME CARIBLATION TLM (FIXME: 現在まともに使ってない) + APID_TLM_MOBC = 0x510, //!< 10100010000b: APID for MOBC で生成される TLM + APID_TLM_AOBC = 0x511, //!< 10100010001b: APID for AOBC で生成される TLM + APID_TLM_TOBC = 0x512, //!< 10100010002b: APID for TOBC で生成される TLM + APID_TLM_DUMP = 0x710, //!< 11100010000b: APID for DUMP TLM (FIXME: 現在まともに使ってない) + APID_FILL_PKT = 0x7ff, //!< 11111111111b: APID for FILL PACKET APID_UNKNOWN } APID; diff --git a/tlm_cmd/common_tlm_cmd_packet.h b/tlm_cmd/common_tlm_cmd_packet.h index 2f6440f07..74bc345de 100644 --- a/tlm_cmd/common_tlm_cmd_packet.h +++ b/tlm_cmd/common_tlm_cmd_packet.h @@ -21,15 +21,15 @@ // FIXME: APID は Space Packet なので, CTCP にあるのは不適切? 抽象化してもいいかも typedef enum { - APID_MOBC_CMD = 0x210, //!< 01000010000b: APID for MOBC 宛の CMD - APID_AOBC_CMD = 0x211, //!< 01000010001b: APID for AOBC 宛の CMD - APID_TOBC_CMD = 0x212, //!< 01000010010b: APID for TOBC 宛の CMD - APID_TCAL_TLM = 0x410, //!< 10000010000b: APID for TIME CARIBLATION TLM (FIXME: 現在まともに使ってない) - APID_MOBC_TLM = 0x510, //!< 10100010000b: APID for MOBC で生成される TLM - APID_AOBC_TLM = 0x511, //!< 10100010001b: APID for AOBC で生成される TLM - APID_TOBC_TLM = 0x512, //!< 10100010002b: APID for TOBC で生成される TLM - APID_DUMP_TLM = 0x710, //!< 11100010000b: APID for DUMP TLM (FIXME: 現在まともに使ってない) - APID_FILL_PKT = 0x7ff, //!< 11111111111b: APID for FILL PACKET + APID_CMD_TO_MOBC = 0x210, //!< 01000010000b: APID for MOBC 宛の CMD + APID_CMD_TO_AOBC = 0x211, //!< 01000010001b: APID for AOBC 宛の CMD + APID_CMD_TO_TOBC = 0x212, //!< 01000010010b: APID for TOBC 宛の CMD + APID_TLM_TCAL = 0x410, //!< 10000010000b: APID for TIME CARIBLATION TLM (FIXME: 現在まともに使ってない) + APID_TLM_MOBC = 0x510, //!< 10100010000b: APID for MOBC で生成される TLM + APID_TLM_AOBC = 0x511, //!< 10100010001b: APID for AOBC で生成される TLM + APID_TLM_TOBC = 0x512, //!< 10100010002b: APID for TOBC で生成される TLM + APID_TLM_DUMP = 0x710, //!< 11100010000b: APID for DUMP TLM (FIXME: 現在まともに使ってない) + APID_FILL_PKT = 0x7ff, //!< 11111111111b: APID for FILL PACKET APID_UNKNOWN } APID; */ From 6ca9eb47b48744b55891d5679962ae667ae887f2 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 17:43:38 +0900 Subject: [PATCH 77/87] sed CCP_APID_TO_ME, CTP_APID_FROM_ME --- .../src/src_user/settings/tlm_cmd/common_cmd_packet_define.h | 2 +- .../src/src_user/settings/tlm_cmd/common_tlm_packet_define.h | 2 +- .../src/src_user/settings/tlm_cmd/common_cmd_packet_define.h | 2 +- .../src/src_user/settings/tlm_cmd/common_tlm_packet_define.h | 2 +- tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c | 2 +- tlm_cmd/common_cmd_packet.h | 2 +- tlm_cmd/common_tlm_packet.h | 2 +- tlm_cmd/packet_handler.c | 2 +- tlm_cmd/telemetry_generator.c | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h index 3c72f0371..461e6a256 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h @@ -15,7 +15,7 @@ typedef CmdSpacePacket CommonCmdPacket; // 自分宛て CMD を示す AIPD を定義 // FIXME: Space Packet が整備されたら直す -#define CCP_APID_TO_ME (APID_MOBC_CMD) +#define CCP_APID_CMD_TO_ME (APID_MOBC_CMD) /** * @enum CCP_DEST_TYPE diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h index fb528f712..4977e87fc 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h @@ -15,6 +15,6 @@ typedef TlmSpacePacket CommonTlmPacket; // 自分で生成される TLM を示す AIPD を定義 // FIXME: Space Packet が整備されたら直す -#define CTP_APID_FROM_ME (APID_MOBC_TLM) +#define CTP_APID_TLM_FROM_ME (APID_MOBC_TLM) #endif diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h index f61d1ac63..33bb0e7c4 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h @@ -15,7 +15,7 @@ typedef CmdSpacePacket CommonCmdPacket; // 自分宛て CMD を示す AIPD を定義 // FIXME: Space Packet が整備されたら直す -#define CCP_APID_TO_ME (APID_AOBC_CMD) +#define CCP_APID_CMD_TO_ME (APID_AOBC_CMD) /** * @enum CCP_DEST_TYPE diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h index 01937bd0b..03302b4c1 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h @@ -15,6 +15,6 @@ typedef TlmSpacePacket CommonTlmPacket; // 自分で生成される TLM を示す AIPD を定義 // FIXME: Space Packet が整備されたら直す -#define CTP_APID_FROM_ME (APID_AOBC_TLM) +#define CTP_APID_TLM_FROM_ME (APID_AOBC_TLM) #endif diff --git a/tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c b/tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c index 2a8aa55af..16a32a294 100644 --- a/tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c +++ b/tlm_cmd/ccsds/space_packet_protocol/cmd_space_packet.c @@ -290,7 +290,7 @@ void CSP_set_common_hdr(CmdSpacePacket* csp) // ここでは Secondary Header は必須 CSP_set_2nd_hdr_flag(csp, SP_2ND_HDR_FLAG_PRESENT); // APID - CSP_set_apid(csp, CCP_APID_TO_ME); + CSP_set_apid(csp, CCP_APID_CMD_TO_ME); // ここでは Sequence Flag は Standalone Packet に固定 CSP_set_seq_flag(csp, SP_SEQ_FLAG_SINGLE); // ここでは Sequence Count は 0 固定 diff --git a/tlm_cmd/common_cmd_packet.h b/tlm_cmd/common_cmd_packet.h index 84b5fc1bc..7e332de0b 100644 --- a/tlm_cmd/common_cmd_packet.h +++ b/tlm_cmd/common_cmd_packet.h @@ -25,7 +25,7 @@ typedef enum CCP_DEST_TYPE_TO_APID = 0xf } CCP_DEST_TYPE; */ -// さらに, CCP_APID_TO_ME, CCP_MAX_LEN, CommonCmdPacket として使うパケット型を指定する +// さらに, CCP_APID_CMD_TO_ME, CCP_MAX_LEN, CommonCmdPacket として使うパケット型を指定する #include // ここで APID を定義する diff --git a/tlm_cmd/common_tlm_packet.h b/tlm_cmd/common_tlm_packet.h index a1d9cb0b9..1c0c9fd04 100644 --- a/tlm_cmd/common_tlm_packet.h +++ b/tlm_cmd/common_tlm_packet.h @@ -9,7 +9,7 @@ #include "../system/time_manager/obc_time.h" #include -// ここで, CTP_APID_FROM_ME, CTP_MAX_LEN, CommonTlmPacket として使うパケット型を指定する +// ここで, CTP_APID_TLM_FROM_ME, CTP_MAX_LEN, CommonTlmPacket として使うパケット型を指定する #include // ここで APID を定義する diff --git a/tlm_cmd/packet_handler.c b/tlm_cmd/packet_handler.c index 81e4710f5..186dd432d 100644 --- a/tlm_cmd/packet_handler.c +++ b/tlm_cmd/packet_handler.c @@ -236,7 +236,7 @@ CCP_CmdRet PH_dispatch_command(const CommonCmdPacket* packet) } // FIXME: CTCP, SpacePacket 整理で直す - if (CCP_get_apid(packet) == CCP_APID_TO_ME) + if (CCP_get_apid(packet) == CCP_APID_CMD_TO_ME) { // 自分宛てのコマンドの場合は対応処理を呼び出し。 return CA_execute_cmd(packet); diff --git a/tlm_cmd/telemetry_generator.c b/tlm_cmd/telemetry_generator.c index 32f89ad66..dfc6796be 100644 --- a/tlm_cmd/telemetry_generator.c +++ b/tlm_cmd/telemetry_generator.c @@ -102,7 +102,7 @@ CCP_CmdRet Cmd_GENERATE_TLM(const CommonCmdPacket* packet) { // Primary Header // FIXME: Space Packet 依存を直す - TSP_setup_primary_hdr(&TG_ctp_, CTP_APID_FROM_ME, TG_get_next_seq_count_(), len); + TSP_setup_primary_hdr(&TG_ctp_, CTP_APID_TLM_FROM_ME, TG_get_next_seq_count_(), len); // Secondary Header TSP_set_board_time(&TG_ctp_, (uint32_t)(TMGR_get_master_total_cycle())); @@ -246,7 +246,7 @@ static CCP_CmdRet TG_generate_tlm_(TLM_CODE tlm_id, // 自身の OBC のテレメ生成を前提としているので, Cmd_GENERATE_TLM のように sub OBC 判定はいれない // Primary Header - TSP_setup_primary_hdr(&TG_ctp_, CTP_APID_FROM_ME, TG_get_next_seq_count_(), packet_len); + TSP_setup_primary_hdr(&TG_ctp_, CTP_APID_TLM_FROM_ME, TG_get_next_seq_count_(), packet_len); // Secondary Header TSP_set_2nd_hdr_ver(&TG_ctp_, TSP_2ND_HDR_VER_1); From 2d3bb7d73186958b8e260c234158a99daae76c56 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 17:50:10 +0900 Subject: [PATCH 78/87] rename APID --- docs/core/communication.md | 6 +++--- .../src/src_user/component_driver/com/gs_validate.c | 6 +++--- .../settings/tlm_cmd/common_cmd_packet_define.h | 2 +- .../settings/tlm_cmd/common_tlm_packet_define.h | 2 +- .../normal_block_command_definition/nbc_test_bcl.c | 2 +- .../mobc/src/src_user/tlm_cmd/user_packet_handler.c | 12 ++++++------ .../applications/component_service/csrv_mobc.c | 4 ++-- .../subobc/src/src_user/component_driver/etc/mobc.c | 2 +- .../settings/tlm_cmd/common_cmd_packet_define.h | 2 +- .../settings/tlm_cmd/common_tlm_packet_define.h | 2 +- .../src/src_user/test/test_comm_between_c2a.py | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/core/communication.md b/docs/core/communication.md index 25a3f71a6..d0d063022 100644 --- a/docs/core/communication.md +++ b/docs/core/communication.md @@ -166,13 +166,13 @@ https://github.com/arkedge/c2a-core/blob/45d78a05c339c285b5aa0c2fcbf57c1b105137e - BC: GS から MOBC に届き, MOBC で BC 登録されずに,そのまま AOBC へ配送される.配送時, Destination Type は自分宛 (TO_ME) に上書きされ, AOBC で BC として登録 & 実行される. - 地上局 SW での実装まとめ - MOBC 宛 - - APID: APID_MOBC_CMD + - APID: APID_CMD_TO_MOBC - CCP_DEST_TYPE: CCP_DEST_TYPE_TO_ME - AOBC 宛(AOBC 直送) - - APID: APID_AOBC_CMD + - APID: APID_CMD_TO_AOBC - CCP_DEST_TYPE: CCP_DEST_TYPE_TO_AOBC - AOBC 宛(MOBC でキューに入り,実行時に AOBC に転送) - - APID: APID_AOBC_CMD + - APID: APID_CMD_TO_AOBC - CCP_DEST_TYPE: CCP_DEST_TYPE_TO_ME diff --git a/examples/mobc/src/src_user/component_driver/com/gs_validate.c b/examples/mobc/src/src_user/component_driver/com/gs_validate.c index 9956630c4..67c9e5c23 100644 --- a/examples/mobc/src/src_user/component_driver/com/gs_validate.c +++ b/examples/mobc/src/src_user/component_driver/com/gs_validate.c @@ -139,9 +139,9 @@ static GS_VALIDATE_ERR GS_check_cmd_space_packet_headers_(const CmdSpacePacket* } apid = CSP_get_apid(csp); - if ( !( apid == APID_MOBC_CMD || - apid == APID_AOBC_CMD || - apid == APID_TOBC_CMD ) ) + if ( !( apid == APID_CMD_TO_MOBC || + apid == APID_CMD_TO_AOBC || + apid == APID_CMD_TO_TOBC ) ) { return GS_VALIDATE_ERR_APID; } diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h index 461e6a256..7418ccd98 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h @@ -15,7 +15,7 @@ typedef CmdSpacePacket CommonCmdPacket; // 自分宛て CMD を示す AIPD を定義 // FIXME: Space Packet が整備されたら直す -#define CCP_APID_CMD_TO_ME (APID_MOBC_CMD) +#define CCP_APID_CMD_TO_ME (APID_CMD_TO_MOBC) /** * @enum CCP_DEST_TYPE diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h index 4977e87fc..0e0f3c66f 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h @@ -15,6 +15,6 @@ typedef TlmSpacePacket CommonTlmPacket; // 自分で生成される TLM を示す AIPD を定義 // FIXME: Space Packet が整備されたら直す -#define CTP_APID_TLM_FROM_ME (APID_MOBC_TLM) +#define CTP_APID_TLM_FROM_ME (APID_TLM_MOBC) #endif diff --git a/examples/mobc/src/src_user/tlm_cmd/normal_block_command_definition/nbc_test_bcl.c b/examples/mobc/src/src_user/tlm_cmd/normal_block_command_definition/nbc_test_bcl.c index a8fbb0448..1799a120d 100644 --- a/examples/mobc/src/src_user/tlm_cmd/normal_block_command_definition/nbc_test_bcl.c +++ b/examples/mobc/src/src_user/tlm_cmd/normal_block_command_definition/nbc_test_bcl.c @@ -31,7 +31,7 @@ void BCL_load_test_bcl(void) // other_obc コマンドのチェック // FIXME: other OBC のコマンド数が 本OBC より多くなるとキャストできなくて困る BCL_tool_prepare_param_uint8(3); - BCL_tool_register_cmd_to_other_obc(5, APID_AOBC_CMD, (CMD_CODE)AOBC_Cmd_CODE_MM_START_TRANSITION); + BCL_tool_register_cmd_to_other_obc(5, APID_CMD_TO_AOBC, (CMD_CODE)AOBC_Cmd_CODE_MM_START_TRANSITION); } #pragma section diff --git a/examples/mobc/src/src_user/tlm_cmd/user_packet_handler.c b/examples/mobc/src/src_user/tlm_cmd/user_packet_handler.c index 45525777d..f5fd49961 100644 --- a/examples/mobc/src/src_user/tlm_cmd/user_packet_handler.c +++ b/examples/mobc/src/src_user/tlm_cmd/user_packet_handler.c @@ -39,12 +39,12 @@ PH_ACK PH_user_analyze_cmd(const CommonCmdPacket* packet) { switch (apid) { - case APID_AOBC_CMD: + case APID_CMD_TO_AOBC: return (PH_add_aobc_cmd_(packet) == PH_ACK_SUCCESS) ? PH_ACK_FORWARDED : PH_ACK_PL_LIST_FULL; - case APID_TOBC_CMD: + case APID_CMD_TO_TOBC: return (PH_add_tobc_cmd_(packet) == PH_ACK_SUCCESS) ? PH_ACK_FORWARDED : PH_ACK_PL_LIST_FULL; default: - // APID_MOBC_CMD + // APID_CMD_TO_MOBC // 不正な APID // はここに return PH_ACK_UNKNOWN; @@ -74,10 +74,10 @@ CCP_CmdRet PH_user_cmd_router(const CommonCmdPacket* packet) APID apid = CCP_get_apid(packet); switch (apid) { - case APID_AOBC_CMD: + case APID_CMD_TO_AOBC: // AOBCに配送 return CSRV_AOBC_dispatch_command(packet); - case APID_TOBC_CMD: + case APID_CMD_TO_TOBC: // TOBCに配送 // return CSRV_TOBC_dispatch_command(packet); default: @@ -95,7 +95,7 @@ TF_TLM_FUNC_ACK PH_user_telemetry_router(APID apid, { switch (apid) { - case APID_AOBC_TLM: + case APID_TLM_AOBC: return AOBC_pick_up_tlm_buffer(aobc_driver, (AOBC_TLM_CODE)tlm_id, packet, len, max_len); default: return TF_TLM_FUNC_ACK_NOT_DEFINED; diff --git a/examples/subobc/src/src_user/applications/component_service/csrv_mobc.c b/examples/subobc/src/src_user/applications/component_service/csrv_mobc.c index ddc25b38d..2cc2c107d 100644 --- a/examples/subobc/src/src_user/applications/component_service/csrv_mobc.c +++ b/examples/subobc/src/src_user/applications/component_service/csrv_mobc.c @@ -112,8 +112,8 @@ static RESULT CSRV_MOBC_rt_tlm_packet_handler_(void) PL_drop_executed(&PH_rt_tlm_list); // FIXME: 現状,WINGS の問題から DUMP TLMは考えない. - // APID_AOBC_TLM 以外を弾いている. - if (CTP_get_apid(&packet) != APID_AOBC_TLM) + // APID_TLM_AOBC 以外を弾いている. + if (CTP_get_apid(&packet) != APID_TLM_AOBC) { // FIXME: アノマリいれる? 最後のエラーは以下で保存されるので不要な気もする. // AOBC のアノマリ基準は? diff --git a/examples/subobc/src/src_user/component_driver/etc/mobc.c b/examples/subobc/src/src_user/component_driver/etc/mobc.c index 3c0baaf4b..f85d916cd 100644 --- a/examples/subobc/src/src_user/component_driver/etc/mobc.c +++ b/examples/subobc/src/src_user/component_driver/etc/mobc.c @@ -106,7 +106,7 @@ static CDS_ERR_CODE MOBC_analyze_rec_data_(CDS_StreamConfig* p_stream_config, vo // MOBC からのコマンドは以下のパターン // APID: - // APID_AOBC_CMD + // APID_CMD_TO_AOBC // CCP_EXEC_TYPE: // CCP_EXEC_TYPE_GS <- GS から MOBC のキューに入らず直接転送されたもの // CCP_EXEC_TYPE_TL0 <- GS から MOBC のキューに入らず直接転送されたもの diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h index 33bb0e7c4..45b35cd83 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/common_cmd_packet_define.h @@ -15,7 +15,7 @@ typedef CmdSpacePacket CommonCmdPacket; // 自分宛て CMD を示す AIPD を定義 // FIXME: Space Packet が整備されたら直す -#define CCP_APID_CMD_TO_ME (APID_AOBC_CMD) +#define CCP_APID_CMD_TO_ME (APID_CMD_TO_AOBC) /** * @enum CCP_DEST_TYPE diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h index 03302b4c1..9cdb8104a 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/common_tlm_packet_define.h @@ -15,6 +15,6 @@ typedef TlmSpacePacket CommonTlmPacket; // 自分で生成される TLM を示す AIPD を定義 // FIXME: Space Packet が整備されたら直す -#define CTP_APID_TLM_FROM_ME (APID_AOBC_TLM) +#define CTP_APID_TLM_FROM_ME (APID_TLM_AOBC) #endif diff --git a/examples/subobc/src/src_user/test/test_comm_between_c2a.py b/examples/subobc/src/src_user/test/test_comm_between_c2a.py index 94fb3caee..ec5faa4df 100644 --- a/examples/subobc/src/src_user/test/test_comm_between_c2a.py +++ b/examples/subobc/src/src_user/test/test_comm_between_c2a.py @@ -22,7 +22,7 @@ SUB_OBC = "AOBC" Tlm_CODE_SUB_OBC_HK = c2a_enum.Tlm_CODE_AOBC_HK -TLM_APID_SUB_OBC = c2a_enum.APID_AOBC_TLM +TLM_APID_SUB_OBC = c2a_enum.APID_TLM_AOBC USE_BCT_ID = 100 # NOP だと id が 0x00 なのでちがうのを From 2fc99c12ac0a0ceaead68a8ba8ab3878040fcbc8 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 17:52:53 +0900 Subject: [PATCH 79/87] add comment for APID --- tlm_cmd/common_tlm_cmd_packet.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tlm_cmd/common_tlm_cmd_packet.h b/tlm_cmd/common_tlm_cmd_packet.h index 74bc345de..33b156ab1 100644 --- a/tlm_cmd/common_tlm_cmd_packet.h +++ b/tlm_cmd/common_tlm_cmd_packet.h @@ -14,11 +14,20 @@ #include "./common_tlm_packet.h" #include "./common_cmd_packet.h" -// ここで APID を定義する -// APID_UNKNOWN, APID_FILL_PKT は必須 +// ここで APID を定義する.APID_UNKNOWN, APID_FILL_PKT は必須とする. +// 命名規則: +// Tlm: APID_TLM_{送信元}_TO_{受信先}_VIA_{経由地} +// Cmd: APID_CMD_{送信元}_TO_{受信先}_VIA_{経由地} +// ただし,Tlm の TO_SGS,Cmd の SGS は省略できる +// 例: +// APID_CMD_TO_MOBC (SGS を省略) +// APID_TLM_AOBC (TO_SGS を省略.パスが単一しかありえないので, VIA_MOBCも省略) +// APID_TLM_CAMERA_TO_XGS_VIA_MIF (全部記載) +// 注意: +// 同一コンポからアプリケーション等を区別して APID を発行したい場合 (eg; HK テレメ,ミッションデータ,Sバンドデータ,X バンドデータ,など) は {送信元} にそれを識別する命名ができる +// APID_TLM_AOBC, APID_TLM_AOBC_STT_IMG, など +// 詳細: https://github.com/arkedge/c2a-core/issues/186#issuecomment-1798685321 /* 例 -// FIXME: CCSDS JAXA 標準になおす -// FIXME: APID は Space Packet なので, CTCP にあるのは不適切? 抽象化してもいいかも typedef enum { APID_CMD_TO_MOBC = 0x210, //!< 01000010000b: APID for MOBC 宛の CMD @@ -33,6 +42,8 @@ typedef enum APID_UNKNOWN } APID; */ +// FIXME: CCSDS JAXA 標準になおす +// FIXME: APID は Space Packet なので, CTCP にあるのは不適切? 抽象化してもいいかも #include From 8f557355630c9708b4c1acec9f06b4b65271d87a Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 27 Nov 2023 17:54:24 +0900 Subject: [PATCH 80/87] fix comment --- .../src_user/settings/tlm_cmd/ccsds/apid_define.h | 13 +------------ .../src_user/settings/tlm_cmd/ccsds/apid_define.h | 13 +------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h index 12e2e5e8b..a4de47d3e 100644 --- a/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h +++ b/examples/mobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h @@ -12,18 +12,7 @@ * @enum APID * @brief Application Process ID * @note 11bit - * @note 命名規則: - * Tlm: APID_TLM_{送信元}_TO_{受信先}_VIA_{経由地} - * Cmd: APID_CMD_{送信元}_TO_{受信先}_VIA_{経由地} - * ただし,Tlm の TO_SGS,Cmd の SGS は省略できる - * 例: - * APID_CMD_TO_MOBC (SGS を省略) - * APID_TLM_AOBC (TO_SGS を省略.パスが単一しかありえないので, VIA_MOBCも省略) - * APID_TLM_CAMERA_TO_XGS_VIA_MIF (全部記載) - * 注意: - * 同一コンポからアプリケーション等を区別して APID を発行したい場合 (eg; HK テレメ,ミッションデータ,Sバンドデータ,X バンドデータ,など) は {送信元} にそれを識別する命名ができる - * APID_TLM_AOBC, APID_TLM_AOBC_STT_IMG, など - * 詳細: https://github.com/arkedge/c2a-core/issues/186#issuecomment-1798685321 + * @note 命名規則は tlm_cmd/common_tlm_cmd_packet.h を参照 */ typedef enum { diff --git a/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h b/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h index 12e2e5e8b..a4de47d3e 100644 --- a/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h +++ b/examples/subobc/src/src_user/settings/tlm_cmd/ccsds/apid_define.h @@ -12,18 +12,7 @@ * @enum APID * @brief Application Process ID * @note 11bit - * @note 命名規則: - * Tlm: APID_TLM_{送信元}_TO_{受信先}_VIA_{経由地} - * Cmd: APID_CMD_{送信元}_TO_{受信先}_VIA_{経由地} - * ただし,Tlm の TO_SGS,Cmd の SGS は省略できる - * 例: - * APID_CMD_TO_MOBC (SGS を省略) - * APID_TLM_AOBC (TO_SGS を省略.パスが単一しかありえないので, VIA_MOBCも省略) - * APID_TLM_CAMERA_TO_XGS_VIA_MIF (全部記載) - * 注意: - * 同一コンポからアプリケーション等を区別して APID を発行したい場合 (eg; HK テレメ,ミッションデータ,Sバンドデータ,X バンドデータ,など) は {送信元} にそれを識別する命名ができる - * APID_TLM_AOBC, APID_TLM_AOBC_STT_IMG, など - * 詳細: https://github.com/arkedge/c2a-core/issues/186#issuecomment-1798685321 + * @note 命名規則は tlm_cmd/common_tlm_cmd_packet.h を参照 */ typedef enum { From d69e346b151a9ffb8e3b3d1938d37941837da1a7 Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Mon, 4 Dec 2023 04:39:53 +0900 Subject: [PATCH 81/87] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e602b01..136eef696 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - [#214](https://github.com/arkedge/c2a-core/pull/214): CCSDS の主 MOBC 向け Data Link Layer のコードを Core 管理にする - [#214](https://github.com/arkedge/c2a-core/pull/219): CCSDS の主 MOBC 向け Data Link Layer の SCID をユーザー設定として切り出す +- [#220](https://github.com/arkedge/c2a-core/pull/220): APID の命名規則を策定 (命名規則は `tlm_cmd/common_tlm_cmd_packet.h` を参照) ### Fixed @@ -57,6 +58,8 @@ 1. コンパイルが通らないところを直す.ファイルの場所が変わったことによる include path の修正が想定される. - [#219](https://github.com/arkedge/c2a-core/pull/219): 影響範囲は MOBC のみ 1. PR の diff (`examples/mobc/src/`) に出ている修正を, user にも反映させる. +- [#220](https://github.com/arkedge/c2a-core/pull/220) + 1. `tlm_cmd/common_tlm_cmd_packet.h` にある命名規則に従うように, APID の命名を更新する. ## v4.0.1 (2023-11-09) From 2158fbe0e65e67effadf6a69d4114d5044b43432 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 5 Dec 2023 13:49:30 +0900 Subject: [PATCH 82/87] run Rust CI on all workspace crates --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e1bcacc7b..7499eb77b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -37,10 +37,10 @@ jobs: uses: sksat/action-clippy@v0.3.0 with: reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }} - clippy_flags: --all-features + clippy_flags: --workspace --all-features - name: format run: cargo fmt --all -- --check - name: unit test - run: cargo test + run: cargo test --workspace From 4bdf4b2be8671cd1a7071bc6f2e77e82a4722f06 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 5 Dec 2023 14:07:53 +0900 Subject: [PATCH 83/87] run C2A setup before clippy to build example users --- .github/workflows/rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7499eb77b..e43dd81df 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,6 +33,9 @@ jobs: - name: cache dependencies uses: Swatinem/rust-cache@v2.7.1 + - name: setup c2a-core + run: ./setup.sh + - name: reviewdog / clippy uses: sksat/action-clippy@v0.3.0 with: From 0bcf1ff557beb909226b6465f753819f44888b58 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 5 Dec 2023 13:32:01 +0900 Subject: [PATCH 84/87] update v4.1.0 changelog --- CHANGELOG.md | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 136eef696..fb49a2258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,18 +4,45 @@ ## v4.1.0 (Unreleased) +### Breaking Changes + +- [#193](https://github.com/arkedge/c2a-core/pull/193): VCDU を AOS transfer frame に rename する +- [#197](https://github.com/arkedge/c2a-core/pull/197): M_PDU をコード規約に合わせるなどのリファクタ +- [#199](https://github.com/arkedge/c2a-core/pull/199): Drop c2a-core crate links config +- [#201](https://github.com/arkedge/c2a-core/pull/201): Refactor release rule +- [#225](https://github.com/arkedge/c2a-core/pull/225): Space Packet 関連ファイルのディレクトリを変更 +- [#219](https://github.com/arkedge/c2a-core/pull/219): CCSDS data link layer における SCID をユーザー設定として切り出す +- [#220](https://github.com/arkedge/c2a-core/pull/220): APIDの命名規則の更新 + - 命名規則は `tlm_cmd/common_tlm_cmd_packet.h` を参照 + ### Enhancements - [#214](https://github.com/arkedge/c2a-core/pull/214): CCSDS の主 MOBC 向け Data Link Layer のコードを Core 管理にする -- [#214](https://github.com/arkedge/c2a-core/pull/219): CCSDS の主 MOBC 向け Data Link Layer の SCID をユーザー設定として切り出す -- [#220](https://github.com/arkedge/c2a-core/pull/220): APID の命名規則を策定 (命名規則は `tlm_cmd/common_tlm_cmd_packet.h` を参照) ### Fixed -- [#193](https://github.com/arkedge/c2a-core/pull/193): VCDU を AOS transfer frame に rename する -- [#197](https://github.com/arkedge/c2a-core/pull/197): M_PDU をコード規約に合わせるなどのリファクタ -- [#222](https://github.com/arkedge/c2a-core/pull/222): Add Section 漏れの修正 -- [#225](https://github.com/arkedge/c2a-core/pull/225): CCSDS の Space Packet Protocol に関連するコードのディレクトリを移動 +- [#188](https://github.com/arkedge/c2a-core/pull/188): [v3.10.1 Backport] PL_BC_LIST_CLEARED を level high で EL 登録する +- [#204](https://github.com/arkedge/c2a-core/pull/204): More match v4.0.0 script migration +- [#205](https://github.com/arkedge/c2a-core/pull/205): Fix v4 applications rename order +- [#206](https://github.com/arkedge/c2a-core/pull/206): More match system migration +- [#211](https://github.com/arkedge/c2a-core/pull/211): Fix v4 system rename typo +- [#212](https://github.com/arkedge/c2a-core/pull/212): More match v4 tlmcmd rename migration +- [#218](https://github.com/arkedge/c2a-core/pull/218): Feedback from v4.0.0 beta.4 +- [#223](https://github.com/arkedge/c2a-core/pull/223): Feedback from v4.0.0 beta.5 migration +- [#224](https://github.com/arkedge/c2a-core/pull/224): Feedback from v4.0.0 migration +- [#222](https://github.com/arkedge/c2a-core/pull/222): add section 漏れを修正 + +### Documentation + +- [#215](https://github.com/arkedge/c2a-core/pull/215): Update v4.0.0 migration guide +- [#207](https://github.com/arkedge/c2a-core/pull/207): Move doxygen config to top +- [#208](https://github.com/arkedge/c2a-core/pull/208): Exclude Doxygen stdint_wrapper +- [#209](https://github.com/arkedge/c2a-core/pull/209): Deploy Doxygen generated HTML to GitHub Pages + +### Internal + +- [#179](https://github.com/arkedge/c2a-core/pull/179): Update Rust crate bindgen to 0.69.1 +- [#210](https://github.com/arkedge/c2a-core/pull/210): Update dependency ut-issl/s2e-core to v7.1.0 ### Migration Guide - [#193](https://github.com/arkedge/c2a-core/pull/193): 影響範囲は MOBC のみ From ec22d4a2446a71cae60fe907e50e9d5ccc84fda8 Mon Sep 17 00:00:00 2001 From: sksat Date: Mon, 11 Dec 2023 16:57:42 +0900 Subject: [PATCH 85/87] fix changelog --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb49a2258..4df1d35e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,14 +11,11 @@ - [#199](https://github.com/arkedge/c2a-core/pull/199): Drop c2a-core crate links config - [#201](https://github.com/arkedge/c2a-core/pull/201): Refactor release rule - [#225](https://github.com/arkedge/c2a-core/pull/225): Space Packet 関連ファイルのディレクトリを変更 +- [#214](https://github.com/arkedge/c2a-core/pull/214): CCSDS の主に MOBC 向け Data Link Layer のコードを Core 管理にする - [#219](https://github.com/arkedge/c2a-core/pull/219): CCSDS data link layer における SCID をユーザー設定として切り出す - [#220](https://github.com/arkedge/c2a-core/pull/220): APIDの命名規則の更新 - 命名規則は `tlm_cmd/common_tlm_cmd_packet.h` を参照 -### Enhancements - -- [#214](https://github.com/arkedge/c2a-core/pull/214): CCSDS の主 MOBC 向け Data Link Layer のコードを Core 管理にする - ### Fixed - [#188](https://github.com/arkedge/c2a-core/pull/188): [v3.10.1 Backport] PL_BC_LIST_CLEARED を level high で EL 登録する From a22c33ae67f131449f01e79c725f4d32efdbd2f5 Mon Sep 17 00:00:00 2001 From: sksat Date: Mon, 11 Dec 2023 16:59:02 +0900 Subject: [PATCH 86/87] Bump to v4.1.0 --- CHANGELOG.md | 2 +- Cargo.toml | 2 +- c2a_core_main.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4df1d35e0..ce1f022e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ 注意: これは既存の C2A core update の「リリースの間の Pull Request を眺めてなんとなく察する」という曖昧な操作を緩和していくための試みであり,C2A user に対するお知らせを行う場として使っていくことを意図しています.初めから c2a-core の全変更を取り扱うと不必要に煩雑になるだけになってしまうため,完全な変更内容の一覧についてはこれまで通り [GitHub Releases](https://github.com/arkedge/c2a-core/releases) などから参照してください. -## v4.1.0 (Unreleased) +## v4.1.0 (2023-12-11) ### Breaking Changes diff --git a/Cargo.toml b/Cargo.toml index 63282d505..5517a88af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "4.0.1" +version = "4.1.0" [workspace] resolver = "2" diff --git a/c2a_core_main.h b/c2a_core_main.h index ab102c4d3..ed70863eb 100644 --- a/c2a_core_main.h +++ b/c2a_core_main.h @@ -8,8 +8,8 @@ void C2A_core_main(void); // これらの番号は,リリース時に手動で合わせる // 詳細: docs/general/release.md #define C2A_CORE_VER_MAJOR (4) -#define C2A_CORE_VER_MINOR (0) -#define C2A_CORE_VER_PATCH (1) +#define C2A_CORE_VER_MINOR (1) +#define C2A_CORE_VER_PATCH (0) #define C2A_CORE_VER_PRE ("") #endif From 6cdd4097de76576a6e06f8127d21bb22b97cebaa Mon Sep 17 00:00:00 2001 From: sksat Date: Mon, 11 Dec 2023 17:04:54 +0900 Subject: [PATCH 87/87] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce1f022e8..e4bd07156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - [#179](https://github.com/arkedge/c2a-core/pull/179): Update Rust crate bindgen to 0.69.1 - [#210](https://github.com/arkedge/c2a-core/pull/210): Update dependency ut-issl/s2e-core to v7.1.0 +- [#229](https://github.com/arkedge/c2a-core/pull/229): Run Rust CI on all workspace crates ### Migration Guide - [#193](https://github.com/arkedge/c2a-core/pull/193): 影響範囲は MOBC のみ