From b50f9eafea57286ef6cd26c29f16f1a3ccfb0b20 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 13 Oct 2023 20:01:15 +0900 Subject: [PATCH] examples/subobc: apply driver_instances -> component_service migration --- .../Elements/tl_elem_gs_related_process.c | 2 +- .../Elements/tl_elem_tlm_cmd_hirate.c | 2 +- .../tlm_cmd/data_base/CMDFILE/sample.ops | 2 +- .../data_base/TLM_DB/SAMPLE_AOBC_TLM_DB.xlsm | Bin 369678 -> 369680 bytes .../Test/test/test_comm_between_c2a.py | 2 +- .../src/src_user/applications/CMakeLists.txt | 2 +- .../src/src_user/applications/app_headers.h | 2 +- .../src/src_user/applications/app_registry.c | 4 +- .../src/src_user/applications/app_registry.h | 4 +- .../csrv_mobc.c} | 44 +++++++++--------- .../csrv_mobc.h} | 8 ++-- .../applications/user_defined/debug_apps.c | 2 +- 12 files changed, 37 insertions(+), 37 deletions(-) rename examples/subobc/src/src_user/applications/{driver_instances/di_mobc.c => component_service/csrv_mobc.c} (71%) rename examples/subobc/src/src_user/applications/{driver_instances/di_mobc.h => component_service/csrv_mobc.h} (83%) diff --git a/examples/subobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_gs_related_process.c b/examples/subobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_gs_related_process.c index e1d5c44b4..4c2be3563 100644 --- a/examples/subobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_gs_related_process.c +++ b/examples/subobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_gs_related_process.c @@ -8,7 +8,7 @@ void BCL_load_tl_elem_gs_related_process(void) { - BCL_tool_register_app(0, AR_DI_MOBC_CMD_PH); + BCL_tool_register_app(0, AR_CSRV_MOBC_CMD_PH); BCL_tool_register_app(1, AR_GSC_DISPATCHER); } diff --git a/examples/subobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_tlm_cmd_hirate.c b/examples/subobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_tlm_cmd_hirate.c index c44a7ba61..df3db8a4d 100644 --- a/examples/subobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_tlm_cmd_hirate.c +++ b/examples/subobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_tlm_cmd_hirate.c @@ -12,7 +12,7 @@ void BCL_load_tl_elem_tlm_cmd_hirate(void) BCL_tool_register_app (0, AR_RTC_DISPATCHER); BCL_tool_register_app (1, AR_TLC_DISPATCHER_BC); BCL_tool_register_app (2, AR_TLC_DISPATCHER_TLM); - BCL_tool_register_app (3, AR_DI_MOBC_RT_TLM_PH); + BCL_tool_register_app (3, AR_CSRV_MOBC_RT_TLM_PH); #ifdef TLCD_ENABLE_MISSION_TL BCL_tool_register_app (5, AR_TLC_DISPATCHER_MIS); #endif diff --git a/examples/subobc/src/src_user/Settings/tlm_cmd/data_base/CMDFILE/sample.ops b/examples/subobc/src/src_user/Settings/tlm_cmd/data_base/CMDFILE/sample.ops index 81cc47f57..2e49e7566 100644 --- a/examples/subobc/src/src_user/Settings/tlm_cmd/data_base/CMDFILE/sample.ops +++ b/examples/subobc/src/src_user/Settings/tlm_cmd/data_base/CMDFILE/sample.ops @@ -36,7 +36,7 @@ .MOBC_RT.TG_FORWARD_AS_RT_TLM 0x511 0x90 # AOBC AOBC .# .# AOBCリセット -.MOBC_RT.AM_INITIALIZE_APP 4 # AR_DI_AOBC +.MOBC_RT.AM_INITIALIZE_APP 4 # AR_CSRV_AOBC .MOBC_RT.TG_FORWARD_AS_RT_TLM 0x511 0x90 # AOBC AOBC → CNT ERR が出るはず .AOBC_RT.TG_GENERATE_RT_TLM 0x90 # AOBC AOBC .MOBC_RT.TG_FORWARD_AS_RT_TLM 0x511 0x90 # AOBC AOBC diff --git a/examples/subobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_AOBC_TLM_DB.xlsm b/examples/subobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_AOBC_TLM_DB.xlsm index 49d77c03d7e99fc22baf3ace245aaa44fbf1947d..f6400669a920df2d3292d71da375b9754a59d430 100644 GIT binary patch delta 35 ocmeA>AvWQJ*aoE?EY86}Va+N#+EsQi0x=U1GjCVf!Sd=g00H+7p#T5? delta 33 mcmbPmLagtE*aoE?OfH_yYCGE1b}#}l6A&|RSKGnz>NNo9xefRL diff --git a/examples/subobc/src/src_user/Test/test/test_comm_between_c2a.py b/examples/subobc/src/src_user/Test/test/test_comm_between_c2a.py index db3a0391a..94fb3caee 100644 --- a/examples/subobc/src/src_user/Test/test/test_comm_between_c2a.py +++ b/examples/subobc/src/src_user/Test/test/test_comm_between_c2a.py @@ -101,7 +101,7 @@ def test_c2a_comm_blc(): @pytest.mark.real @pytest.mark.sils def test_c2a_comm_tlm_buffer(): - send_mobc_gsc(mobc_c2a_enum.Cmd_CODE_AM_INITIALIZE_APP, (mobc_c2a_enum.AR_DI_AOBC,)) + send_mobc_gsc(mobc_c2a_enum.Cmd_CODE_AM_INITIALIZE_APP, (mobc_c2a_enum.AR_CSRV_AOBC,)) # MOBC の tlm buffer が空なのでエラー assert "CNT" == wings.util.send_rt_cmd_and_confirm( diff --git a/examples/subobc/src/src_user/applications/CMakeLists.txt b/examples/subobc/src/src_user/applications/CMakeLists.txt index 7a51c0020..8fa66673e 100644 --- a/examples/subobc/src/src_user/applications/CMakeLists.txt +++ b/examples/subobc/src/src_user/applications/CMakeLists.txt @@ -4,7 +4,7 @@ project(C2A_USER_APPS) set(C2A_SRCS app_registry.c - driver_instances/di_mobc.c + component_service/csrv_mobc.c user_defined/debug_apps.c ${C2A_CORE_DIR}/applications/gs_command_dispatcher.c ${C2A_CORE_DIR}/applications/event_utility.c diff --git a/examples/subobc/src/src_user/applications/app_headers.h b/examples/subobc/src/src_user/applications/app_headers.h index d87156c6a..8e498583f 100644 --- a/examples/subobc/src/src_user/applications/app_headers.h +++ b/examples/subobc/src/src_user/applications/app_headers.h @@ -16,7 +16,7 @@ #include // DI -#include "driver_instances/di_mobc.h" +#include "component_service/csrv_mobc.h" // UserDefined #include "user_defined/debug_apps.h" diff --git a/examples/subobc/src/src_user/applications/app_registry.c b/examples/subobc/src/src_user/applications/app_registry.c index 2f3226ed0..0f7dd7e55 100644 --- a/examples/subobc/src/src_user/applications/app_registry.c +++ b/examples/subobc/src/src_user/applications/app_registry.c @@ -11,8 +11,8 @@ static AM_ACK add_application_(size_t id, void AR_load_initial_settings(void) { add_application_(AR_NOP, NOP_create_app); - add_application_(AR_DI_MOBC_CMD_PH, DI_MOBC_update); - add_application_(AR_DI_MOBC_RT_TLM_PH, DI_MOBC_rt_tlm_packet_handler); + add_application_(AR_CSRV_MOBC_CMD_PH, CSRV_MOBC_update); + add_application_(AR_CSRV_MOBC_RT_TLM_PH, CSRV_MOBC_rt_tlm_packet_handler); add_application_(AR_GSC_DISPATCHER, GSCD_create_app); add_application_(AR_RTC_DISPATCHER, RTCD_create_app); add_application_(AR_TLC_DISPATCHER_GS, TLCD_gs_create_app); diff --git a/examples/subobc/src/src_user/applications/app_registry.h b/examples/subobc/src/src_user/applications/app_registry.h index fb8c50914..eb57f26fc 100644 --- a/examples/subobc/src/src_user/applications/app_registry.h +++ b/examples/subobc/src/src_user/applications/app_registry.h @@ -6,8 +6,8 @@ typedef enum { AR_NOP, - AR_DI_MOBC_CMD_PH, - AR_DI_MOBC_RT_TLM_PH, + AR_CSRV_MOBC_CMD_PH, + AR_CSRV_MOBC_RT_TLM_PH, AR_GSC_DISPATCHER, AR_RTC_DISPATCHER, AR_TLC_DISPATCHER_GS, diff --git a/examples/subobc/src/src_user/applications/driver_instances/di_mobc.c b/examples/subobc/src/src_user/applications/component_service/csrv_mobc.c similarity index 71% rename from examples/subobc/src/src_user/applications/driver_instances/di_mobc.c rename to examples/subobc/src/src_user/applications/component_service/csrv_mobc.c index 83dec04e0..10f0cab67 100644 --- a/examples/subobc/src/src_user/applications/driver_instances/di_mobc.c +++ b/examples/subobc/src/src_user/applications/component_service/csrv_mobc.c @@ -4,49 +4,49 @@ * @brief MOBC の DI. MOBC における GS との DI に相当する */ -#include "di_mobc.h" +#include "csrv_mobc.h" #include #include #include "../../Settings/port_config.h" #include "../../Settings/component_driver_super/driver_buffer_define.h" #include -static RESULT DI_MOBC_init_(void); -static RESULT DI_MOBC_update_(void); -static RESULT DI_MOBC_rt_tlm_packet_handler_init_(void); -static RESULT DI_MOBC_rt_tlm_packet_handler_(void); +static RESULT CSRV_MOBC_init_(void); +static RESULT CSRV_MOBC_update_(void); +static RESULT CSRV_MOBC_rt_tlm_packet_handler_init_(void); +static RESULT CSRV_MOBC_rt_tlm_packet_handler_(void); static MOBC_Driver mobc_driver_; const MOBC_Driver* const mobc_driver = &mobc_driver_; // バッファ -static CDS_StreamRecBuffer DI_MOBC_rx_buffer_; -static uint8_t DI_MOBC_rx_buffer_allocation_[CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; +static CDS_StreamRecBuffer CSRV_MOBC_rx_buffer_; +static uint8_t CSRV_MOBC_rx_buffer_allocation_[CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; -static const uint8_t DI_MOBC_kRtTlmPhMaxNumOfProc_ = 4; //!< 一度に送出する最大テレメ数 +static const uint8_t CSRV_MOBC_kRtTlmPhMaxNumOfProc_ = 4; //!< 一度に送出する最大テレメ数 -AppInfo DI_MOBC_update(void) +AppInfo CSRV_MOBC_update(void) { - return AI_create_app_info("update_MOBC", DI_MOBC_init_, DI_MOBC_update_); + return AI_create_app_info("update_MOBC", CSRV_MOBC_init_, CSRV_MOBC_update_); } -static RESULT DI_MOBC_init_(void) +static RESULT CSRV_MOBC_init_(void) { CDS_ERR_CODE ret1; CDS_INIT_ERR_CODE ret2; RESULT err = RESULT_OK; - ret1 = CDS_init_stream_rec_buffer(&DI_MOBC_rx_buffer_, - DI_MOBC_rx_buffer_allocation_, - sizeof(DI_MOBC_rx_buffer_allocation_)); + ret1 = CDS_init_stream_rec_buffer(&CSRV_MOBC_rx_buffer_, + CSRV_MOBC_rx_buffer_allocation_, + sizeof(CSRV_MOBC_rx_buffer_allocation_)); if (ret1 != CDS_ERR_CODE_OK) { Printf("MOBC buffer init Failed ! %d \n", ret1); err = RESULT_ERR; } - ret2 = MOBC_init(&mobc_driver_, PORT_CH_UART_MOBC, &DI_MOBC_rx_buffer_); + ret2 = MOBC_init(&mobc_driver_, PORT_CH_UART_MOBC, &CSRV_MOBC_rx_buffer_); if (ret2 != CDS_INIT_OK) { Printf("MOBC init Failed ! %d \n", ret2); @@ -56,7 +56,7 @@ static RESULT DI_MOBC_init_(void) return err; } -static RESULT DI_MOBC_update_(void) +static RESULT CSRV_MOBC_update_(void) { CDS_REC_ERR_CODE ret; ret = MOBC_rec(&mobc_driver_); @@ -67,20 +67,20 @@ static RESULT DI_MOBC_update_(void) } -AppInfo DI_MOBC_rt_tlm_packet_handler(void) +AppInfo CSRV_MOBC_rt_tlm_packet_handler(void) { return AI_create_app_info("MOBC_rt_tlm_ph", - DI_MOBC_rt_tlm_packet_handler_init_, - DI_MOBC_rt_tlm_packet_handler_); + CSRV_MOBC_rt_tlm_packet_handler_init_, + CSRV_MOBC_rt_tlm_packet_handler_); } -static RESULT DI_MOBC_rt_tlm_packet_handler_init_(void) +static RESULT CSRV_MOBC_rt_tlm_packet_handler_init_(void) { // なにもしない return RESULT_OK; } -static RESULT DI_MOBC_rt_tlm_packet_handler_(void) +static RESULT CSRV_MOBC_rt_tlm_packet_handler_(void) { uint8_t i; CommonTlmPacket packet; // FIXME: これは static にする? @@ -88,7 +88,7 @@ static RESULT DI_MOBC_rt_tlm_packet_handler_(void) // 一方でメモリ使用量は増える. mobc_driver_.info.c2a.send_tlm_err_code = CDS_CMD_OK; - for (i = 0; i < DI_MOBC_kRtTlmPhMaxNumOfProc_; i++) + for (i = 0; i < CSRV_MOBC_kRtTlmPhMaxNumOfProc_; i++) { CDS_CMD_ERR_CODE ret; diff --git a/examples/subobc/src/src_user/applications/driver_instances/di_mobc.h b/examples/subobc/src/src_user/applications/component_service/csrv_mobc.h similarity index 83% rename from examples/subobc/src/src_user/applications/driver_instances/di_mobc.h rename to examples/subobc/src/src_user/applications/component_service/csrv_mobc.h index 1d08bbb02..ced3042d4 100644 --- a/examples/subobc/src/src_user/applications/driver_instances/di_mobc.h +++ b/examples/subobc/src/src_user/applications/component_service/csrv_mobc.h @@ -2,8 +2,8 @@ * @file * @brief MOBC の DI. MOBC における GS との DI に相当する */ -#ifndef DI_MOBC_H_ -#define DI_MOBC_H_ +#ifndef CSRV_MOBC_H_ +#define CSRV_MOBC_H_ #include "../../component_driver/etc/mobc.h" #include @@ -16,7 +16,7 @@ extern const MOBC_Driver* const mobc_driver; //!< MOBC driver * @param void * @return AppInfo */ -AppInfo DI_MOBC_update(void); +AppInfo CSRV_MOBC_update(void); /** * @brief MOBC RT_TLM (Realtime Telemetry) PH (packet handler) アプリ生成関数 @@ -24,6 +24,6 @@ AppInfo DI_MOBC_update(void); * @return AppInfo * @note ひとまずテレメは RT_TLM のみ実装する */ -AppInfo DI_MOBC_rt_tlm_packet_handler(void); +AppInfo CSRV_MOBC_rt_tlm_packet_handler(void); #endif diff --git a/examples/subobc/src/src_user/applications/user_defined/debug_apps.c b/examples/subobc/src/src_user/applications/user_defined/debug_apps.c index 951ecfd5f..a97861468 100644 --- a/examples/subobc/src/src_user/applications/user_defined/debug_apps.c +++ b/examples/subobc/src/src_user/applications/user_defined/debug_apps.c @@ -18,7 +18,7 @@ #include #include #include -#include "../../applications/driver_instances/di_mobc.h" +#include "../../applications/component_service/csrv_mobc.h" // #include #include "../../library/vt100.h" #include