From 8161e757139bebac53839f54e3acb5e121f79b08 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 13 Oct 2023 20:16:18 +0900 Subject: [PATCH 1/2] examples/mobc: apply driver_instances -> component_service migration --- .../Elements/tl_elem_drivers_update.c | 10 +- .../Elements/tl_elem_gs_related_process.c | 2 +- .../Elements/tl_elem_tlm_cmd_hirate.c | 4 +- .../Settings/Modes/TaskLists/tl_initial.c | 2 +- .../Settings/Modes/Transitions/sl_initial.c | 2 +- .../CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv | 18 +- .../TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv | 12 +- .../TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv | 4 +- .../calced_data/SAMPLE_MOBC_TLM_DB_GS.csv | 12 +- .../calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv | 4 +- .../src/src_user/applications/CMakeLists.txt | 6 +- .../src/src_user/applications/app_headers.h | 6 +- .../src/src_user/applications/app_registry.c | 12 +- .../src/src_user/applications/app_registry.h | 12 +- .../csrv_aobc.c} | 58 ++-- .../csrv_aobc.h} | 16 +- .../applications/component_service/csrv_gs.c | 267 ++++++++++++++++++ .../applications/component_service/csrv_gs.h | 48 ++++ .../csrv_uart_test.c} | 26 +- .../csrv_uart_test.h} | 4 +- .../applications/driver_instances/di_gs.c | 267 ------------------ .../applications/driver_instances/di_gs.h | 48 ---- .../applications/user_defined/debug_apps.c | 2 +- .../src_user/tlm_cmd/command_definitions.c | 28 +- .../src_user/tlm_cmd/command_definitions.h | 18 +- .../src_user/tlm_cmd/telemetry_definitions.c | 16 +- .../src_user/tlm_cmd/user_packet_handler.c | 8 +- 27 files changed, 456 insertions(+), 456 deletions(-) rename examples/mobc/src/src_user/applications/{driver_instances/di_aobc.c => component_service/csrv_aobc.c} (60%) rename examples/mobc/src/src_user/applications/{driver_instances/di_aobc.h => component_service/csrv_aobc.h} (75%) create mode 100644 examples/mobc/src/src_user/applications/component_service/csrv_gs.c create mode 100644 examples/mobc/src/src_user/applications/component_service/csrv_gs.h rename examples/mobc/src/src_user/applications/{driver_instances/di_uart_test.c => component_service/csrv_uart_test.c} (76%) rename examples/mobc/src/src_user/applications/{driver_instances/di_uart_test.h => component_service/csrv_uart_test.h} (91%) delete mode 100644 examples/mobc/src/src_user/applications/driver_instances/di_gs.c delete mode 100644 examples/mobc/src/src_user/applications/driver_instances/di_gs.h diff --git a/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_drivers_update.c b/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_drivers_update.c index f0f617d78..754c80c68 100644 --- a/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_drivers_update.c +++ b/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_drivers_update.c @@ -9,15 +9,15 @@ void BCL_load_tl_elem_drivers_update_initial(void) { - BCL_tool_register_app(0, AR_DI_AOBC); + BCL_tool_register_app(0, AR_CSRV_AOBC); BCL_tool_register_app(1, AR_NOP); - BCL_tool_register_app(2, AR_DI_AOBC); + BCL_tool_register_app(2, AR_CSRV_AOBC); BCL_tool_register_app(3, AR_NOP); - BCL_tool_register_app(4, AR_DI_AOBC); + BCL_tool_register_app(4, AR_CSRV_AOBC); BCL_tool_register_app(5, AR_NOP); - BCL_tool_register_app(6, AR_DI_AOBC); + BCL_tool_register_app(6, AR_CSRV_AOBC); BCL_tool_register_app(7, AR_NOP); - BCL_tool_register_app(8, AR_DI_AOBC); + BCL_tool_register_app(8, AR_CSRV_AOBC); BCL_tool_register_app(9, AR_NOP); } diff --git a/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_gs_related_process.c b/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_gs_related_process.c index 4357ebf44..e40004d7a 100644 --- a/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_gs_related_process.c +++ b/examples/mobc/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_GS_CMD_PH); + BCL_tool_register_app(0, AR_CSRV_GS_CMD_PH); BCL_tool_register_app(1, AR_GSC_DISPATCHER); } diff --git a/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_tlm_cmd_hirate.c b/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_tlm_cmd_hirate.c index 874e9e1f1..e8a986d7c 100644 --- a/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_tlm_cmd_hirate.c +++ b/examples/mobc/src/src_user/Settings/Modes/TaskLists/Elements/tl_elem_tlm_cmd_hirate.c @@ -12,8 +12,8 @@ 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_GS_RT_TLM_PH); - BCL_tool_register_app (4, AR_DI_GS_RP_TLM_PH); + BCL_tool_register_app (3, AR_CSRV_GS_RT_TLM_PH); + BCL_tool_register_app (4, AR_CSRV_GS_RP_TLM_PH); #ifdef TLCD_ENABLE_MISSION_TL BCL_tool_register_app (5, AR_TLC_DISPATCHER_MIS); #endif diff --git a/examples/mobc/src/src_user/Settings/Modes/TaskLists/tl_initial.c b/examples/mobc/src/src_user/Settings/Modes/TaskLists/tl_initial.c index 5f3100c3a..c8924ac73 100644 --- a/examples/mobc/src/src_user/Settings/Modes/TaskLists/tl_initial.c +++ b/examples/mobc/src/src_user/Settings/Modes/TaskLists/tl_initial.c @@ -13,7 +13,7 @@ void BCL_load_tl_initial(void) BCL_tool_register_combine(10, BC_AC_TLM_CMD_HIRATE); BCL_tool_register_rotate (30, BC_AR_DRIVERS_UPDATE_INI); BCL_tool_register_app (40, AR_EVENT_UTILITY); - BCL_tool_register_app (50, AR_DI_AOBC_CDIS); + BCL_tool_register_app (50, AR_CSRV_AOBC_CDIS); BCL_tool_register_rotate (95, BC_AR_DEBUG_DISPLAY_INI); } diff --git a/examples/mobc/src/src_user/Settings/Modes/Transitions/sl_initial.c b/examples/mobc/src/src_user/Settings/Modes/Transitions/sl_initial.c index 7b5fa6020..b5920d0f0 100644 --- a/examples/mobc/src/src_user/Settings/Modes/Transitions/sl_initial.c +++ b/examples/mobc/src/src_user/Settings/Modes/Transitions/sl_initial.c @@ -15,7 +15,7 @@ void BCL_load_sl_start_up_to_initial(void) BCL_tool_register_deploy(OBCT_sec2cycle(1), BC_HK_CYCLIC_TLM, TLCD_ID_DEPLOY_TLM); BCL_tool_prepare_param_uint8((uint8_t)GS_PORT_TYPE_UART); - BCL_tool_register_cmd(OBCT_sec2cycle(2), Cmd_CODE_DI_GS_SET_INFO); + BCL_tool_register_cmd(OBCT_sec2cycle(2), Cmd_CODE_CSRV_GS_SET_INFO); BCL_tool_register_cmd(OBCT_sec2cycle(10), Cmd_CODE_MM_FINISH_TRANSITION); } diff --git a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv index 2530a371e..f49ce6fa0 100644 --- a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv +++ b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv @@ -159,15 +159,15 @@ Comment,,,,,Type,Description,Type,Description,Type,Description,Type,Description, ,TEST_CCP_GET_RAW_PARAM_INFO,OBC,0x0089,3,uint16_t,raw data len,uint8_t,first data,raw,raw data,,,,,,,,,CCP UTIL の ParamGenerator のテスト, **,,,,,,,,,,,,,,,,,,,, * CDH,GS用,,,,,,,,,,,,,,,,,,, -,DI_GS_DRIVER_RESET,OBC,0x0100,0,,,,,,,,,,,,,,,GS ドライバの初期化, -,DI_GS_SET_RT_FLUSH_INTERVAL,OBC,0x0101,1,uint32_t,排出間隔,,,,,,,,,,,,,RT VCDUの排出間隔設定, -,DI_GS_SET_RP_FLUSH_INTERVAL,OBC,0x0102,1,uint32_t,排出間隔,,,,,,,,,,,,,RP VCDUの排出間隔設定, -,DI_GS_SET_FARM_PW,OBC,0x0103,1,uint8_t,positive_window_width,,,,,,,,,,,,,FARM-1のPositive Window Width設定, -,DI_GS_SET_INFO,OBC,0x0104,1,uint8_t,TLM選択,,,,,,,,,,,,,GS送信TLMが0ならCCSDSに@@ 1ならUARTの情報が出てくる, -,DI_GS_CCSDS_GET_BUFFER,OBC,0x0105,0,,,,,,,,,,,,,,,, -,DI_GS_CCSDS_SET_RATE,OBC,0x0106,1,uint8_t,bps セットパラメータ,,,,,,,,,,,danger,,40M/パラメータ が bps になる.初期値は 0xAD で 230.4 Kbps (微妙に対応していない), -,DI_GS_UART_TLM_ON,OBC,0x0107,0,,,,,,,,,,,,,,,TLM の UART への送出を行う, -,DI_GS_UART_TLM_OFF,OBC,0x0108,0,,,,,,,,,,,,,,,TLM の UART への送出を止める, +,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_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,,,,,,,,,,,,,,,, +,CSRV_GS_CCSDS_SET_RATE,OBC,0x0106,1,uint8_t,bps セットパラメータ,,,,,,,,,,,danger,,40M/パラメータ が bps になる.初期値は 0xAD で 230.4 Kbps (微妙に対応していない), +,CSRV_GS_UART_TLM_ON,OBC,0x0107,0,,,,,,,,,,,,,,,TLM の UART への送出を行う, +,CSRV_GS_UART_TLM_OFF,OBC,0x0108,0,,,,,,,,,,,,,,,TLM の UART への送出を止める, **,WDT用コマンド,,,,,,,,,,,,,,,,,,, ,WDT_INIT,OBC,0x0109,0,,,,,,,,,,,,,,,WDT初期化.WDTがアプリイニシャライザを持たなくなったので追加, ,WDT_ENABLE,OBC,0x010A,0,,,,,,,,,,,,,,,WDT有効化, diff --git a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv index e88832649..73f535648 100644 --- a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv +++ b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv @@ -56,12 +56,12 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,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)DI_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)DI_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)DI_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)DI_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)DI_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)DI_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.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,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv index 68ff46481..4a6a1e443 100644 --- a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv +++ b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/SAMPLE_MOBC_TLM_DB_MOBC.csv @@ -123,8 +123,8 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,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_T2M_FLUSH_INTERVAL,uint32_t,(uint32_t)(DI_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)(DI_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_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コマンドカウンタ, ,RT_TLM_QUEUED,uint8_t,(uint8_t)(PL_count_active_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登録コマンド数, ,ST_TLM_COUNTER,uint32_t,PL_count_executed_nodes(&PH_st_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コマンドカウンタ, diff --git a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv index e5f198c9e..a5cfe6f12 100644 --- a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv +++ b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv @@ -56,12 +56,12 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,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)DI_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)DI_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)DI_GS_rt_tlm_packet_handler->vcdu_counter,PACKET,97,0,32,NONE,,,,,,,,, -,RP_TLM.VCDU.FLUSH_INTERVAL,uint32_t,(uint32_t)DI_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)DI_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)DI_GS_rp_tlm_packet_handler->vcdu_counter,PACKET,109,0,32,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,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv index 56172b543..6ee565c4c 100644 --- a/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv +++ b/examples/mobc/src/src_user/Settings/tlm_cmd/data_base/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_MOBC.csv @@ -123,8 +123,8 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,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_T2M_FLUSH_INTERVAL,uint32_t,(uint32_t)(DI_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)(DI_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval),PACKET,303,0,32,NONE,,,,,,,,TL0コマンドカウンタ, +,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コマンドカウンタ, ,RT_TLM_QUEUED,uint8_t,(uint8_t)(PL_count_active_nodes(&PH_rt_tlm_list)),PACKET,311,0,8,NONE,,,,,,,,TL0登録コマンド数, ,ST_TLM_COUNTER,uint32_t,PL_count_executed_nodes(&PH_st_tlm_list),PACKET,312,0,32,NONE,,,,,,,,TL0コマンドカウンタ, diff --git a/examples/mobc/src/src_user/applications/CMakeLists.txt b/examples/mobc/src/src_user/applications/CMakeLists.txt index f5ac69837..45db35de9 100644 --- a/examples/mobc/src/src_user/applications/CMakeLists.txt +++ b/examples/mobc/src/src_user/applications/CMakeLists.txt @@ -4,9 +4,9 @@ project(C2A_USER_APPS) set(C2A_SRCS app_registry.c - driver_instances/di_aobc.c - driver_instances/di_gs.c - driver_instances/di_uart_test.c + component_service/csrv_aobc.c + component_service/csrv_gs.c + component_service/csrv_uart_test.c user_defined/debug_apps.c ) diff --git a/examples/mobc/src/src_user/applications/app_headers.h b/examples/mobc/src/src_user/applications/app_headers.h index 77be8a6bb..6707b95a9 100644 --- a/examples/mobc/src/src_user/applications/app_headers.h +++ b/examples/mobc/src/src_user/applications/app_headers.h @@ -21,9 +21,9 @@ #include // DI -#include "driver_instances/di_aobc.h" -#include "driver_instances/di_uart_test.h" -#include "driver_instances/di_gs.h" +#include "component_service/csrv_aobc.h" +#include "component_service/csrv_uart_test.h" +#include "component_service/csrv_gs.h" // UserDefined #include "user_defined/debug_apps.h" diff --git a/examples/mobc/src/src_user/applications/app_registry.c b/examples/mobc/src/src_user/applications/app_registry.c index 8a7f72d91..d010ef7a5 100644 --- a/examples/mobc/src/src_user/applications/app_registry.c +++ b/examples/mobc/src/src_user/applications/app_registry.c @@ -11,10 +11,10 @@ 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_GS_CMD_PH, DI_GS_cmd_packet_handler_app); - add_application_(AR_DI_GS_RT_TLM_PH, DI_GS_rt_tlm_packet_handler_app); - add_application_(AR_DI_GS_RP_TLM_PH, DI_GS_rp_tlm_packet_handler_app); - add_application_(AR_DI_UART_TEST, UART_TEST_update); + add_application_(AR_CSRV_GS_CMD_PH, CSRV_GS_cmd_packet_handler_app); + add_application_(AR_CSRV_GS_RT_TLM_PH, CSRV_GS_rt_tlm_packet_handler_app); + add_application_(AR_CSRV_GS_RP_TLM_PH, CSRV_GS_rp_tlm_packet_handler_app); + add_application_(AR_CSRV_UART_TEST, UART_TEST_update); 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); @@ -23,8 +23,8 @@ void AR_load_initial_settings(void) #ifdef TLCD_ENABLE_MISSION_TL add_application_(AR_TLC_DISPATCHER_MIS, TLCD_mis_create_app); #endif - add_application_(AR_DI_AOBC, DI_AOBC_update); - add_application_(AR_DI_AOBC_CDIS, DI_AOBC_cmd_dispatcher); + add_application_(AR_CSRV_AOBC, CSRV_AOBC_update); + add_application_(AR_CSRV_AOBC_CDIS, CSRV_AOBC_cmd_dispatcher); add_application_(AR_EVENT_UTILITY, EVENT_UTIL_create_app); add_application_(AR_MEM_DUMP, MEM_create_app); add_application_(AR_TELEMETRY_MANAGER, TLM_MGR_create_app); diff --git a/examples/mobc/src/src_user/applications/app_registry.h b/examples/mobc/src/src_user/applications/app_registry.h index 6580b95bb..f653afdd3 100644 --- a/examples/mobc/src/src_user/applications/app_registry.h +++ b/examples/mobc/src/src_user/applications/app_registry.h @@ -6,12 +6,12 @@ typedef enum { AR_NOP, - AR_DI_GS_CMD_PH, - AR_DI_GS_RT_TLM_PH, - AR_DI_GS_RP_TLM_PH, - AR_DI_AOBC, - AR_DI_AOBC_CDIS, - AR_DI_UART_TEST, + AR_CSRV_GS_CMD_PH, + AR_CSRV_GS_RT_TLM_PH, + AR_CSRV_GS_RP_TLM_PH, + AR_CSRV_AOBC, + AR_CSRV_AOBC_CDIS, + AR_CSRV_UART_TEST, AR_GSC_DISPATCHER, AR_RTC_DISPATCHER, AR_TLC_DISPATCHER_GS, diff --git a/examples/mobc/src/src_user/applications/driver_instances/di_aobc.c b/examples/mobc/src/src_user/applications/component_service/csrv_aobc.c similarity index 60% rename from examples/mobc/src/src_user/applications/driver_instances/di_aobc.c rename to examples/mobc/src/src_user/applications/component_service/csrv_aobc.c index f290fcb33..031c51b8a 100644 --- a/examples/mobc/src/src_user/applications/driver_instances/di_aobc.c +++ b/examples/mobc/src/src_user/applications/component_service/csrv_aobc.c @@ -5,7 +5,7 @@ * @note C2A 間通信のデモ用であり, AOBC も C2A 搭載を仮定する */ -#include "di_aobc.h" +#include "csrv_aobc.h" #include "../../component_driver/aocs/aobc.h" #include "../../tlm_cmd/user_packet_handler.h" #include @@ -14,45 +14,45 @@ #include "../../Settings/component_driver_super/driver_buffer_define.h" #include -static RESULT DI_AOBC_init_(void); -static RESULT DI_AOBC_update_(void); +static RESULT CSRV_AOBC_init_(void); +static RESULT CSRV_AOBC_update_(void); -static RESULT DI_AOBC_cmd_dispatcher_init_(void); -static RESULT DI_AOBC_cmd_dispatcher_(void); +static RESULT CSRV_AOBC_cmd_dispatcher_init_(void); +static RESULT CSRV_AOBC_cmd_dispatcher_(void); static AOBC_Driver aobc_driver_; const AOBC_Driver* const aobc_driver = &aobc_driver_; -static CommandDispatcher DI_AOBC_cdis_; -const CommandDispatcher* const DI_AOBC_cdis = &DI_AOBC_cdis_; +static CommandDispatcher CSRV_AOBC_cdis_; +const CommandDispatcher* const CSRV_AOBC_cdis = &CSRV_AOBC_cdis_; // バッファ -static CDS_StreamRecBuffer DI_AOBC_rx_buffer_; -static uint8_t DI_AOBC_rx_buffer_allocation_[CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; +static CDS_StreamRecBuffer CSRV_AOBC_rx_buffer_; +static uint8_t CSRV_AOBC_rx_buffer_allocation_[CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; -AppInfo DI_AOBC_update(void) +AppInfo CSRV_AOBC_update(void) { - return AI_create_app_info("update_AOBC", DI_AOBC_init_, DI_AOBC_update_); + return AI_create_app_info("update_AOBC", CSRV_AOBC_init_, CSRV_AOBC_update_); } -static RESULT DI_AOBC_init_(void) +static RESULT CSRV_AOBC_init_(void) { CDS_ERR_CODE ret1; CDS_INIT_ERR_CODE ret2; RESULT err = RESULT_OK; - ret1 = CDS_init_stream_rec_buffer(&DI_AOBC_rx_buffer_, - DI_AOBC_rx_buffer_allocation_, - sizeof(DI_AOBC_rx_buffer_allocation_)); + ret1 = CDS_init_stream_rec_buffer(&CSRV_AOBC_rx_buffer_, + CSRV_AOBC_rx_buffer_allocation_, + sizeof(CSRV_AOBC_rx_buffer_allocation_)); if (ret1 != CDS_ERR_CODE_OK) { Printf("AOBC buffer init Failed ! %d \n", ret1); err = RESULT_ERR; } - ret2 = AOBC_init(&aobc_driver_, PORT_CH_RS422_AOBC, &DI_AOBC_rx_buffer_); + ret2 = AOBC_init(&aobc_driver_, PORT_CH_RS422_AOBC, &CSRV_AOBC_rx_buffer_); if (ret2 != CDS_INIT_OK) { Printf("AOBC init Failed ! %d \n", ret2); @@ -63,7 +63,7 @@ static RESULT DI_AOBC_init_(void) } -static RESULT DI_AOBC_update_(void) +static RESULT CSRV_AOBC_update_(void) { int ret; ret = AOBC_rec(&aobc_driver_); @@ -75,28 +75,28 @@ static RESULT DI_AOBC_update_(void) } -AppInfo DI_AOBC_cmd_dispatcher(void) +AppInfo CSRV_AOBC_cmd_dispatcher(void) { return AI_create_app_info("aobc_cdis", - DI_AOBC_cmd_dispatcher_init_, - DI_AOBC_cmd_dispatcher_); + CSRV_AOBC_cmd_dispatcher_init_, + CSRV_AOBC_cmd_dispatcher_); } -static RESULT DI_AOBC_cmd_dispatcher_init_(void) +static RESULT CSRV_AOBC_cmd_dispatcher_init_(void) { - return CDIS_init(&DI_AOBC_cdis_, &PH_aobc_cmd_list); + return CDIS_init(&CSRV_AOBC_cdis_, &PH_aobc_cmd_list); } -static RESULT DI_AOBC_cmd_dispatcher_(void) +static RESULT CSRV_AOBC_cmd_dispatcher_(void) { - CDIS_dispatch_command(&DI_AOBC_cdis_); + CDIS_dispatch_command(&CSRV_AOBC_cdis_); return RESULT_OK; } -CCP_CmdRet DI_AOBC_dispatch_command(const CommonCmdPacket* packet) +CCP_CmdRet CSRV_AOBC_dispatch_command(const CommonCmdPacket* packet) { CDS_CMD_ERR_CODE ret; CommonCmdPacket* pckt = (CommonCmdPacket*)packet; // const_cast @@ -125,21 +125,21 @@ CCP_CmdRet DI_AOBC_dispatch_command(const CommonCmdPacket* packet) } -CCP_CmdRet Cmd_DI_AOBC_CDIS_CLEAR_ALL_REALTIME(const CommonCmdPacket* packet) +CCP_CmdRet Cmd_CSRV_AOBC_CDIS_CLEAR_ALL_REALTIME(const CommonCmdPacket* packet) { (void)packet; - CDIS_clear_command_list(&DI_AOBC_cdis_); + CDIS_clear_command_list(&CSRV_AOBC_cdis_); return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); } -CCP_CmdRet Cmd_DI_AOBC_CDIS_CLEAR_ERR_LOG(const CommonCmdPacket* packet) +CCP_CmdRet Cmd_CSRV_AOBC_CDIS_CLEAR_ERR_LOG(const CommonCmdPacket* packet) { (void)packet; // 記録されたエラー情報を解除 - CDIS_clear_error_status(&DI_AOBC_cdis_); + CDIS_clear_error_status(&CSRV_AOBC_cdis_); return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); } diff --git a/examples/mobc/src/src_user/applications/driver_instances/di_aobc.h b/examples/mobc/src/src_user/applications/component_service/csrv_aobc.h similarity index 75% rename from examples/mobc/src/src_user/applications/driver_instances/di_aobc.h rename to examples/mobc/src/src_user/applications/component_service/csrv_aobc.h index cbc227c0f..d187b2ffa 100644 --- a/examples/mobc/src/src_user/applications/driver_instances/di_aobc.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_aobc.h @@ -3,8 +3,8 @@ * @brief AOBC の DI と AOBC の cmd dispatcher * @note C2A 間通信のデモ用であり, AOBC も C2A 搭載を仮定する */ -#ifndef DI_AOBC_H_ -#define DI_AOBC_H_ +#ifndef CSRV_AOBC_H_ +#define CSRV_AOBC_H_ #include "../../component_driver/aocs/aobc.h" #include "../../component_driver/aocs/aobc_command_definitions.h" @@ -14,21 +14,21 @@ #include extern const AOBC_Driver* const aobc_driver; //!< AOBC driver -extern const CommandDispatcher* const DI_AOBC_cdis; //!< AOBC cmd dispatcher +extern const CommandDispatcher* const CSRV_AOBC_cdis; //!< AOBC cmd dispatcher /** * @brief AOBC update アプリ生成関数 * @param void * @return void */ -AppInfo DI_AOBC_update(void); +AppInfo CSRV_AOBC_update(void); /** * @brief AOBC cmd dispatcher アプリ生成関数 * @param void * @return void */ -AppInfo DI_AOBC_cmd_dispatcher(void); +AppInfo CSRV_AOBC_cmd_dispatcher(void); /** * @brief CommonCmdPacket を AOBC に送信する @@ -38,10 +38,10 @@ AppInfo DI_AOBC_cmd_dispatcher(void); * @retval CCP_CmdRet{CCP_EXEC_SUCCESS, *}: 無事に転送された * @retval それ以外: 転送失敗(CDS_CMD_ERR_CODE を CCP_EXEC_STS に変換して返す.詳細エラーは ComponentDriverSuper を参照) */ -CCP_CmdRet DI_AOBC_dispatch_command(const CommonCmdPacket* packet); +CCP_CmdRet CSRV_AOBC_dispatch_command(const CommonCmdPacket* packet); -CCP_CmdRet Cmd_DI_AOBC_CDIS_CLEAR_ALL_REALTIME(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_CSRV_AOBC_CDIS_CLEAR_ALL_REALTIME(const CommonCmdPacket* packet); -CCP_CmdRet Cmd_DI_AOBC_CDIS_CLEAR_ERR_LOG(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_CSRV_AOBC_CDIS_CLEAR_ERR_LOG(const CommonCmdPacket* packet); #endif 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 new file mode 100644 index 000000000..5c63d63e8 --- /dev/null +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.c @@ -0,0 +1,267 @@ +#pragma section REPRO +/** + * @file + * @brief GS Driver のインスタンス化 + */ +#include "csrv_gs.h" +#include +#include +#include +#include +#include "../../component_driver/com/gs_validate.h" +#include "../../Settings/port_config.h" +#include "../../Settings/component_driver_super/driver_buffer_define.h" + +static RESULT CSRV_GS_init_(void); + +// 以下 init と update の定義 +static RESULT CSRV_GS_cmd_packet_handler_app_init_(void); +static RESULT CSRV_GS_cmd_packet_handler_app_(void); + +static RESULT CSRV_GS_rt_tlm_packet_handler_app_init_(void); +static RESULT CSRV_GS_rt_tlm_packet_handler_app_(void); +static RESULT CSRV_GS_rp_tlm_packet_handler_app_init_(void); +static RESULT CSRV_GS_rp_tlm_packet_handler_app_(void); + +static void CSRV_GS_set_t2m_flush_interval_(cycle_t flush_interval, CSRV_GS_TlmPacketHandler* gs_tlm_packet_handler); + +static GS_Driver gs_driver_; +const GS_Driver* const gs_driver = &gs_driver_; + +static CSRV_GS_TlmPacketHandler CSRV_GS_rt_tlm_packet_handler_; +const CSRV_GS_TlmPacketHandler* const CSRV_GS_rt_tlm_packet_handler = &CSRV_GS_rt_tlm_packet_handler_; +static CSRV_GS_TlmPacketHandler CSRV_GS_rp_tlm_packet_handler_; +const CSRV_GS_TlmPacketHandler* const CSRV_GS_rp_tlm_packet_handler = &CSRV_GS_rp_tlm_packet_handler_; + +// バッファ +static CDS_StreamRecBuffer CSRV_GS_ccsds_rx_buffer_[GS_RX_HEADER_NUM]; +static uint8_t CSRV_GS_ccsds_rx_buffer_allocation_[GS_RX_HEADER_NUM][CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; +static CDS_StreamRecBuffer CSRV_GS_uart_rx_buffer_[GS_RX_HEADER_NUM]; +static uint8_t CSRV_GS_uart_rx_buffer_allocation_[GS_RX_HEADER_NUM][CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; + + +static RESULT CSRV_GS_init_(void) +{ + int stream; + CDS_INIT_ERR_CODE ret; + CDS_StreamRecBuffer* ccsds_rx_buffers[CDS_STREAM_MAX]; + CDS_StreamRecBuffer* uart_rx_buffers[CDS_STREAM_MAX]; + CDS_nullify_stream_rec_buffers(ccsds_rx_buffers); + CDS_nullify_stream_rec_buffers(uart_rx_buffers); + + // GS_RX_HEADER_NUM > CDS_STREAM_MAX のアサーションは gs.c でやっているのでここではしない + for (stream = 0; stream < GS_RX_HEADER_NUM; ++stream) + { + CDS_ERR_CODE ret1; + CDS_ERR_CODE ret2; + ret1 = CDS_init_stream_rec_buffer(&CSRV_GS_ccsds_rx_buffer_[stream], + CSRV_GS_ccsds_rx_buffer_allocation_[stream], + sizeof(CSRV_GS_ccsds_rx_buffer_allocation_[stream])); + ret2 = CDS_init_stream_rec_buffer(&CSRV_GS_uart_rx_buffer_[stream], + CSRV_GS_uart_rx_buffer_allocation_[stream], + sizeof(CSRV_GS_uart_rx_buffer_allocation_[stream])); + if (ret1 != CDS_ERR_CODE_OK || ret2 != CDS_ERR_CODE_OK) + { + Printf("GS buffer init Failed ! %d, %d \n", ret1, ret2); + return RESULT_ERR; + } + ccsds_rx_buffers[stream] = &CSRV_GS_ccsds_rx_buffer_[stream]; + uart_rx_buffers[stream] = &CSRV_GS_uart_rx_buffer_[stream]; + } + + ret = GS_init(&gs_driver_, PORT_CH_RS422_MOBC_EXT, ccsds_rx_buffers, uart_rx_buffers); + + if (ret != CDS_INIT_OK) + { + Printf("!! GS Init Error %d !!\n", ret); + return RESULT_ERR; + } + + return RESULT_OK; +} + +AppInfo CSRV_GS_cmd_packet_handler_app(void) +{ + return AI_create_app_info("GS_CMD", CSRV_GS_cmd_packet_handler_app_init_, CSRV_GS_cmd_packet_handler_app_); +} + +AppInfo CSRV_GS_rt_tlm_packet_handler_app(void) +{ + return AI_create_app_info("GS_RT_TLM", CSRV_GS_rt_tlm_packet_handler_app_init_, CSRV_GS_rt_tlm_packet_handler_app_); +} + +AppInfo CSRV_GS_rp_tlm_packet_handler_app(void) +{ + return AI_create_app_info("GS_RP_TLM", CSRV_GS_rp_tlm_packet_handler_app_init_, CSRV_GS_rp_tlm_packet_handler_app_); +} + +static RESULT CSRV_GS_cmd_packet_handler_app_init_(void) +{ + CSRV_GS_init_(); + return RESULT_OK; +} + +static RESULT CSRV_GS_cmd_packet_handler_app_(void) +{ + GS_rec_tctf(&gs_driver_); + // TODO: エラー処理 + return RESULT_OK; +} + +static RESULT CSRV_GS_rt_tlm_packet_handler_app_init_(void) +{ + T2M_initialize(&CSRV_GS_rt_tlm_packet_handler_.tc_packet_to_m_pdu); + return RESULT_OK; +} + +static RESULT CSRV_GS_rt_tlm_packet_handler_app_(void) +{ + int i; + + // 本当なら max(今の FIFO の空き, 残り時間で実行可能な数) とかしたい + for (i = 0; i < CCSDS_FIFO_SIZE; ++i) + { + 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); + 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); + + // 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()); + + // 完成した VCDU を RT VCDU として送出 + GS_send_vcdu(&gs_driver_, &CSRV_GS_rt_tlm_packet_handler_.vcdu); + } + + return RESULT_OK; +} + +static RESULT CSRV_GS_rp_tlm_packet_handler_app_init_(void) +{ + T2M_initialize(&CSRV_GS_rp_tlm_packet_handler_.tc_packet_to_m_pdu); + return RESULT_OK; +} + +static RESULT CSRV_GS_rp_tlm_packet_handler_app_(void) +{ + int i; + + // 本当なら max(今の FIFO の空き, 残り時間で実行可能な数) とかしたい + for (i = 0; i < CCSDS_FIFO_SIZE; ++i) + { + 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); + 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); + + // 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()); + + // 完成した VCDU を RP VCDU として送出 + GS_send_vcdu(&gs_driver_, &CSRV_GS_rp_tlm_packet_handler_.vcdu); + } + + return RESULT_OK; +} + +static void CSRV_GS_set_t2m_flush_interval_(cycle_t flush_interval, CSRV_GS_TlmPacketHandler* gs_tlm_packet_handler) +{ + gs_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval = flush_interval; +} + +CCP_CmdRet Cmd_CSRV_GS_DRIVER_RESET(const CommonCmdPacket* packet) +{ + (void)packet; + if (CSRV_GS_init_() != RESULT_OK) return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_CSRV_GS_SET_RT_FLUSH_INTERVAL(const CommonCmdPacket* packet) +{ + cycle_t flush_interval; + ENDIAN_memcpy(&flush_interval, CCP_get_param_head(packet), sizeof(cycle_t)); + + CSRV_GS_set_t2m_flush_interval_(flush_interval, &CSRV_GS_rt_tlm_packet_handler_); + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_CSRV_GS_SET_RP_FLUSH_INTERVAL(const CommonCmdPacket* packet) +{ + cycle_t flush_interval; + ENDIAN_memcpy(&flush_interval, CCP_get_param_head(packet), sizeof(cycle_t)); + + CSRV_GS_set_t2m_flush_interval_(flush_interval, &CSRV_GS_rp_tlm_packet_handler_); + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_CSRV_GS_SET_FARM_PW(const CommonCmdPacket* packet) +{ + uint8_t pw = CCP_get_param_head(packet)[0]; + if (pw < 1 || pw > 127) return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); + GS_set_farm_pw(pw); + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_CSRV_GS_SET_INFO(const CommonCmdPacket* packet) +{ + uint8_t which = CCP_get_param_head(packet)[0]; + if (which >= GS_PORT_TYPE_NUM) return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); + gs_driver_.latest_info = &gs_driver_.info[(GS_PORT_TYPE)which]; + gs_driver_.tlm_tx_port_type = (GS_PORT_TYPE)which; + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_CSRV_GS_CCSDS_GET_BUFFER(const CommonCmdPacket* packet) +{ + (void)packet; + gs_driver_.ccsds_info.buffer_num = CCSDS_get_buffer_num(); + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_CSRV_GS_CCSDS_SET_RATE(const CommonCmdPacket* packet) +{ + uint32_t ui_rate = (uint32_t)CCP_get_param_head(packet)[0]; + if (ui_rate == 0) return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); + + CCSDS_set_rate(ui_rate, &gs_driver_.driver_ccsds.ccsds_config); + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_CSRV_GS_UART_TLM_ON(const CommonCmdPacket* packet) +{ + (void)packet; + gs_driver_.driver_uart.is_tlm_on = 1; + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +CCP_CmdRet Cmd_CSRV_GS_UART_TLM_OFF(const CommonCmdPacket* packet) +{ + (void)packet; + gs_driver_.driver_uart.is_tlm_on = 0; + + return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); +} + +#pragma section 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 new file mode 100644 index 000000000..448103eec --- /dev/null +++ b/examples/mobc/src/src_user/applications/component_service/csrv_gs.h @@ -0,0 +1,48 @@ +/** + * @file + * @brief GS Driver のインスタンス化 + */ +#ifndef CSRV_GS_H_ +#define CSRV_GS_H_ + +#include + +#include "../../component_driver/com/gs.h" +#include "../../tlm_cmd/ccsds/tcp_to_m_pdu.h" +#include "../../tlm_cmd/ccsds/vcdu.h" +#include + +/** + * @struct CSRV_GS_TlmPacketHandler + * @brief テレメの送信 + */ +typedef struct +{ + TcpToMPdu tc_packet_to_m_pdu; //!< PL から取り出した tc_packet を M_PDU に変換する + VCDU vcdu; //!< 送信するVCDU + uint32_t vcdu_counter; //!< VCDU counter +} CSRV_GS_TlmPacketHandler; + +extern const GS_Driver* const gs_driver; +extern const CSRV_GS_TlmPacketHandler* const CSRV_GS_rt_tlm_packet_handler; +extern const CSRV_GS_TlmPacketHandler* const CSRV_GS_rp_tlm_packet_handler; + +// 以下インスタンス化 +AppInfo CSRV_GS_cmd_packet_handler_app(void); + +AppInfo CSRV_GS_rt_tlm_packet_handler_app(void); +AppInfo CSRV_GS_rp_tlm_packet_handler_app(void); + +CCP_CmdRet Cmd_CSRV_GS_DRIVER_RESET(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_CSRV_GS_SET_RT_FLUSH_INTERVAL(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_CSRV_GS_SET_RP_FLUSH_INTERVAL(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_CSRV_GS_SET_FARM_PW(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_CSRV_GS_SET_INFO(const CommonCmdPacket* packet); + +CCP_CmdRet Cmd_CSRV_GS_CCSDS_GET_BUFFER(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_CSRV_GS_CCSDS_SET_RATE(const CommonCmdPacket* packet); + +CCP_CmdRet Cmd_CSRV_GS_UART_TLM_ON(const CommonCmdPacket* packet); +CCP_CmdRet Cmd_CSRV_GS_UART_TLM_OFF(const CommonCmdPacket* packet); + +#endif diff --git a/examples/mobc/src/src_user/applications/driver_instances/di_uart_test.c b/examples/mobc/src/src_user/applications/component_service/csrv_uart_test.c similarity index 76% rename from examples/mobc/src/src_user/applications/driver_instances/di_uart_test.c rename to examples/mobc/src/src_user/applications/component_service/csrv_uart_test.c index 1f1616c40..e4d1d9990 100644 --- a/examples/mobc/src/src_user/applications/driver_instances/di_uart_test.c +++ b/examples/mobc/src/src_user/applications/component_service/csrv_uart_test.c @@ -3,7 +3,7 @@ * @file * @brief UART と ComponentDriverSuper テスト用 */ -#include "di_uart_test.h" +#include "csrv_uart_test.h" #include // for NULL #include #include @@ -25,10 +25,10 @@ static UART_TEST_Driver uart_test_driver_; const UART_TEST_Driver* const uart_test_driver = &uart_test_driver_; // バッファ -static CDS_StreamRecBuffer DI_UART_TEST_rx_buffer_0_; -static CDS_StreamRecBuffer DI_UART_TEST_rx_buffer_1_; -static uint8_t DI_UART_TEST_rx_buffer_allocation_0_[CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; -static uint8_t DI_UART_TEST_rx_buffer_allocation_1_[CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; +static CDS_StreamRecBuffer CSRV_UART_TEST_rx_buffer_0_; +static CDS_StreamRecBuffer CSRV_UART_TEST_rx_buffer_1_; +static uint8_t CSRV_UART_TEST_rx_buffer_allocation_0_[CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; +static uint8_t CSRV_UART_TEST_rx_buffer_allocation_1_[CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; // !!!!!!!!!! 注意 !!!!!!!!!! @@ -54,16 +54,16 @@ static void UART_TEST_init_(void) CDS_StreamRecBuffer* rx_buffers[CDS_STREAM_MAX]; CDS_nullify_stream_rec_buffers(rx_buffers); - ret1 = CDS_init_stream_rec_buffer(&DI_UART_TEST_rx_buffer_0_, - DI_UART_TEST_rx_buffer_allocation_0_, - sizeof(DI_UART_TEST_rx_buffer_allocation_0_)); + ret1 = CDS_init_stream_rec_buffer(&CSRV_UART_TEST_rx_buffer_0_, + CSRV_UART_TEST_rx_buffer_allocation_0_, + sizeof(CSRV_UART_TEST_rx_buffer_allocation_0_)); if (ret1 != CDS_ERR_CODE_OK) { Printf("UART_TEST buffer0 init Failed ! %d \n", ret1); } - ret1 = CDS_init_stream_rec_buffer(&DI_UART_TEST_rx_buffer_1_, - DI_UART_TEST_rx_buffer_allocation_1_, - sizeof(DI_UART_TEST_rx_buffer_allocation_1_)); + ret1 = CDS_init_stream_rec_buffer(&CSRV_UART_TEST_rx_buffer_1_, + CSRV_UART_TEST_rx_buffer_allocation_1_, + sizeof(CSRV_UART_TEST_rx_buffer_allocation_1_)); if (ret1 != CDS_ERR_CODE_OK) { Printf("UART_TEST buffer1 init Failed ! %d \n", ret1); @@ -75,8 +75,8 @@ static void UART_TEST_init_(void) return; } - rx_buffers[0] = &DI_UART_TEST_rx_buffer_0_; - rx_buffers[1] = &DI_UART_TEST_rx_buffer_1_; + rx_buffers[0] = &CSRV_UART_TEST_rx_buffer_0_; + rx_buffers[1] = &CSRV_UART_TEST_rx_buffer_1_; ret2 = UART_TEST_init(&uart_test_driver_, PORT_CH_UART_TEST, rx_buffers); if (ret2 != CDS_INIT_OK) diff --git a/examples/mobc/src/src_user/applications/driver_instances/di_uart_test.h b/examples/mobc/src/src_user/applications/component_service/csrv_uart_test.h similarity index 91% rename from examples/mobc/src/src_user/applications/driver_instances/di_uart_test.h rename to examples/mobc/src/src_user/applications/component_service/csrv_uart_test.h index ac7d65dfa..0a4b8ac0f 100644 --- a/examples/mobc/src/src_user/applications/driver_instances/di_uart_test.h +++ b/examples/mobc/src/src_user/applications/component_service/csrv_uart_test.h @@ -2,8 +2,8 @@ * @file * @brief UART と ComponentDriverSuper テスト用 */ -#ifndef DI_UART_TEST_H_ -#define DI_UART_TEST_H_ +#ifndef CSRV_UART_TEST_H_ +#define CSRV_UART_TEST_H_ #include "../../component_driver/etc/uart_test.h" #include diff --git a/examples/mobc/src/src_user/applications/driver_instances/di_gs.c b/examples/mobc/src/src_user/applications/driver_instances/di_gs.c deleted file mode 100644 index c4975d258..000000000 --- a/examples/mobc/src/src_user/applications/driver_instances/di_gs.c +++ /dev/null @@ -1,267 +0,0 @@ -#pragma section REPRO -/** - * @file - * @brief GS Driver のインスタンス化 - */ -#include "di_gs.h" -#include -#include -#include -#include -#include "../../component_driver/com/gs_validate.h" -#include "../../Settings/port_config.h" -#include "../../Settings/component_driver_super/driver_buffer_define.h" - -static RESULT DI_GS_init_(void); - -// 以下 init と update の定義 -static RESULT DI_GS_cmd_packet_handler_app_init_(void); -static RESULT DI_GS_cmd_packet_handler_app_(void); - -static RESULT DI_GS_rt_tlm_packet_handler_app_init_(void); -static RESULT DI_GS_rt_tlm_packet_handler_app_(void); -static RESULT DI_GS_rp_tlm_packet_handler_app_init_(void); -static RESULT DI_GS_rp_tlm_packet_handler_app_(void); - -static void DI_GS_set_t2m_flush_interval_(cycle_t flush_interval, DI_GS_TlmPacketHandler* gs_tlm_packet_handler); - -static GS_Driver gs_driver_; -const GS_Driver* const gs_driver = &gs_driver_; - -static DI_GS_TlmPacketHandler DI_GS_rt_tlm_packet_handler_; -const DI_GS_TlmPacketHandler* const DI_GS_rt_tlm_packet_handler = &DI_GS_rt_tlm_packet_handler_; -static DI_GS_TlmPacketHandler DI_GS_rp_tlm_packet_handler_; -const DI_GS_TlmPacketHandler* const DI_GS_rp_tlm_packet_handler = &DI_GS_rp_tlm_packet_handler_; - -// バッファ -static CDS_StreamRecBuffer DI_GS_ccsds_rx_buffer_[GS_RX_HEADER_NUM]; -static uint8_t DI_GS_ccsds_rx_buffer_allocation_[GS_RX_HEADER_NUM][CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; -static CDS_StreamRecBuffer DI_GS_uart_rx_buffer_[GS_RX_HEADER_NUM]; -static uint8_t DI_GS_uart_rx_buffer_allocation_[GS_RX_HEADER_NUM][CDS_STREAM_REC_BUFFER_SIZE_DEFAULT]; - - -static RESULT DI_GS_init_(void) -{ - int stream; - CDS_INIT_ERR_CODE ret; - CDS_StreamRecBuffer* ccsds_rx_buffers[CDS_STREAM_MAX]; - CDS_StreamRecBuffer* uart_rx_buffers[CDS_STREAM_MAX]; - CDS_nullify_stream_rec_buffers(ccsds_rx_buffers); - CDS_nullify_stream_rec_buffers(uart_rx_buffers); - - // GS_RX_HEADER_NUM > CDS_STREAM_MAX のアサーションは gs.c でやっているのでここではしない - for (stream = 0; stream < GS_RX_HEADER_NUM; ++stream) - { - CDS_ERR_CODE ret1; - CDS_ERR_CODE ret2; - ret1 = CDS_init_stream_rec_buffer(&DI_GS_ccsds_rx_buffer_[stream], - DI_GS_ccsds_rx_buffer_allocation_[stream], - sizeof(DI_GS_ccsds_rx_buffer_allocation_[stream])); - ret2 = CDS_init_stream_rec_buffer(&DI_GS_uart_rx_buffer_[stream], - DI_GS_uart_rx_buffer_allocation_[stream], - sizeof(DI_GS_uart_rx_buffer_allocation_[stream])); - if (ret1 != CDS_ERR_CODE_OK || ret2 != CDS_ERR_CODE_OK) - { - Printf("GS buffer init Failed ! %d, %d \n", ret1, ret2); - return RESULT_ERR; - } - ccsds_rx_buffers[stream] = &DI_GS_ccsds_rx_buffer_[stream]; - uart_rx_buffers[stream] = &DI_GS_uart_rx_buffer_[stream]; - } - - ret = GS_init(&gs_driver_, PORT_CH_RS422_MOBC_EXT, ccsds_rx_buffers, uart_rx_buffers); - - if (ret != CDS_INIT_OK) - { - Printf("!! GS Init Error %d !!\n", ret); - return RESULT_ERR; - } - - return RESULT_OK; -} - -AppInfo DI_GS_cmd_packet_handler_app(void) -{ - return AI_create_app_info("GS_CMD", DI_GS_cmd_packet_handler_app_init_, DI_GS_cmd_packet_handler_app_); -} - -AppInfo DI_GS_rt_tlm_packet_handler_app(void) -{ - return AI_create_app_info("GS_RT_TLM", DI_GS_rt_tlm_packet_handler_app_init_, DI_GS_rt_tlm_packet_handler_app_); -} - -AppInfo DI_GS_rp_tlm_packet_handler_app(void) -{ - return AI_create_app_info("GS_RP_TLM", DI_GS_rp_tlm_packet_handler_app_init_, DI_GS_rp_tlm_packet_handler_app_); -} - -static RESULT DI_GS_cmd_packet_handler_app_init_(void) -{ - DI_GS_init_(); - return RESULT_OK; -} - -static RESULT DI_GS_cmd_packet_handler_app_(void) -{ - GS_rec_tctf(&gs_driver_); - // TODO: エラー処理 - return RESULT_OK; -} - -static RESULT DI_GS_rt_tlm_packet_handler_app_init_(void) -{ - T2M_initialize(&DI_GS_rt_tlm_packet_handler_.tc_packet_to_m_pdu); - return RESULT_OK; -} - -static RESULT DI_GS_rt_tlm_packet_handler_app_(void) -{ - int i; - - // 本当なら max(今の FIFO の空き, 残り時間で実行可能な数) とかしたい - for (i = 0; i < CCSDS_FIFO_SIZE; ++i) - { - T2M_ACK ack = T2M_form_m_pdu(&DI_GS_rt_tlm_packet_handler_.tc_packet_to_m_pdu, - &PH_rt_tlm_list, - &DI_GS_rt_tlm_packet_handler_.vcdu.m_pdu); - if (ack != T2M_SUCCESS) return RESULT_OK; - - // Realtime VCDU カウンタの設定 - VCDU_setup_realtime_vcdu_hdr(&DI_GS_rt_tlm_packet_handler_.vcdu, DI_GS_rt_tlm_packet_handler_.vcdu_counter); - DI_GS_rt_tlm_packet_handler_.vcdu_counter = VCDU_calc_next_counter(DI_GS_rt_tlm_packet_handler_.vcdu_counter); - - // CLCW の設定 - // CMD の VCID と TLM の VCID は独立で関係がない - // TLM の VCID 種別(Realtime, Replay)によらず CLCW を設定して良い - // CLCW が対応する CMD の VCID は CLCW の内部で指定される - VCDU_set_clcw(&DI_GS_rt_tlm_packet_handler_.vcdu, GS_form_clcw()); - - // 完成した VCDU を RT VCDU として送出 - GS_send_vcdu(&gs_driver_, &DI_GS_rt_tlm_packet_handler_.vcdu); - } - - return RESULT_OK; -} - -static RESULT DI_GS_rp_tlm_packet_handler_app_init_(void) -{ - T2M_initialize(&DI_GS_rp_tlm_packet_handler_.tc_packet_to_m_pdu); - return RESULT_OK; -} - -static RESULT DI_GS_rp_tlm_packet_handler_app_(void) -{ - int i; - - // 本当なら max(今の FIFO の空き, 残り時間で実行可能な数) とかしたい - for (i = 0; i < CCSDS_FIFO_SIZE; ++i) - { - T2M_ACK ack = T2M_form_m_pdu(&DI_GS_rp_tlm_packet_handler_.tc_packet_to_m_pdu, - &PH_rp_tlm_list, - &DI_GS_rp_tlm_packet_handler_.vcdu.m_pdu); - if (ack != T2M_SUCCESS) return RESULT_OK; - - // Replay VCDU カウンタの設定 - VCDU_setup_replay_vcdu_hdr(&DI_GS_rp_tlm_packet_handler_.vcdu, DI_GS_rp_tlm_packet_handler_.vcdu_counter); - DI_GS_rp_tlm_packet_handler_.vcdu_counter = VCDU_calc_next_counter(DI_GS_rp_tlm_packet_handler_.vcdu_counter); - - // CLCW の設定 - // CMD の VCIDと TLM の VCID は独立で関係がない - // TLM の VCID 種別(Realtime, Replay) によらず CLCW を設定して良い - // CLCW が対応する CMD の VCID は CLCW の内部で指定される - VCDU_set_clcw(&DI_GS_rp_tlm_packet_handler_.vcdu, GS_form_clcw()); - - // 完成した VCDU を RP VCDU として送出 - GS_send_vcdu(&gs_driver_, &DI_GS_rp_tlm_packet_handler_.vcdu); - } - - return RESULT_OK; -} - -static void DI_GS_set_t2m_flush_interval_(cycle_t flush_interval, DI_GS_TlmPacketHandler* gs_tlm_packet_handler) -{ - gs_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval = flush_interval; -} - -CCP_CmdRet Cmd_DI_GS_DRIVER_RESET(const CommonCmdPacket* packet) -{ - (void)packet; - if (DI_GS_init_() != RESULT_OK) return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_CONTEXT); - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -CCP_CmdRet Cmd_DI_GS_SET_RT_FLUSH_INTERVAL(const CommonCmdPacket* packet) -{ - cycle_t flush_interval; - ENDIAN_memcpy(&flush_interval, CCP_get_param_head(packet), sizeof(cycle_t)); - - DI_GS_set_t2m_flush_interval_(flush_interval, &DI_GS_rt_tlm_packet_handler_); - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -CCP_CmdRet Cmd_DI_GS_SET_RP_FLUSH_INTERVAL(const CommonCmdPacket* packet) -{ - cycle_t flush_interval; - ENDIAN_memcpy(&flush_interval, CCP_get_param_head(packet), sizeof(cycle_t)); - - DI_GS_set_t2m_flush_interval_(flush_interval, &DI_GS_rp_tlm_packet_handler_); - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -CCP_CmdRet Cmd_DI_GS_SET_FARM_PW(const CommonCmdPacket* packet) -{ - uint8_t pw = CCP_get_param_head(packet)[0]; - if (pw < 1 || pw > 127) return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); - GS_set_farm_pw(pw); - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -CCP_CmdRet Cmd_DI_GS_SET_INFO(const CommonCmdPacket* packet) -{ - uint8_t which = CCP_get_param_head(packet)[0]; - if (which >= GS_PORT_TYPE_NUM) return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); - gs_driver_.latest_info = &gs_driver_.info[(GS_PORT_TYPE)which]; - gs_driver_.tlm_tx_port_type = (GS_PORT_TYPE)which; - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -CCP_CmdRet Cmd_DI_GS_CCSDS_GET_BUFFER(const CommonCmdPacket* packet) -{ - (void)packet; - gs_driver_.ccsds_info.buffer_num = CCSDS_get_buffer_num(); - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -CCP_CmdRet Cmd_DI_GS_CCSDS_SET_RATE(const CommonCmdPacket* packet) -{ - uint32_t ui_rate = (uint32_t)CCP_get_param_head(packet)[0]; - if (ui_rate == 0) return CCP_make_cmd_ret_without_err_code(CCP_EXEC_ILLEGAL_PARAMETER); - - CCSDS_set_rate(ui_rate, &gs_driver_.driver_ccsds.ccsds_config); - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -CCP_CmdRet Cmd_DI_GS_UART_TLM_ON(const CommonCmdPacket* packet) -{ - (void)packet; - gs_driver_.driver_uart.is_tlm_on = 1; - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -CCP_CmdRet Cmd_DI_GS_UART_TLM_OFF(const CommonCmdPacket* packet) -{ - (void)packet; - gs_driver_.driver_uart.is_tlm_on = 0; - - return CCP_make_cmd_ret_without_err_code(CCP_EXEC_SUCCESS); -} - -#pragma section diff --git a/examples/mobc/src/src_user/applications/driver_instances/di_gs.h b/examples/mobc/src/src_user/applications/driver_instances/di_gs.h deleted file mode 100644 index f250675d4..000000000 --- a/examples/mobc/src/src_user/applications/driver_instances/di_gs.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file - * @brief GS Driver のインスタンス化 - */ -#ifndef DI_GS_H_ -#define DI_GS_H_ - -#include - -#include "../../component_driver/com/gs.h" -#include "../../tlm_cmd/ccsds/tcp_to_m_pdu.h" -#include "../../tlm_cmd/ccsds/vcdu.h" -#include - -/** - * @struct DI_GS_TlmPacketHandler - * @brief テレメの送信 - */ -typedef struct -{ - TcpToMPdu tc_packet_to_m_pdu; //!< PL から取り出した tc_packet を M_PDU に変換する - VCDU vcdu; //!< 送信するVCDU - uint32_t vcdu_counter; //!< VCDU counter -} DI_GS_TlmPacketHandler; - -extern const GS_Driver* const gs_driver; -extern const DI_GS_TlmPacketHandler* const DI_GS_rt_tlm_packet_handler; -extern const DI_GS_TlmPacketHandler* const DI_GS_rp_tlm_packet_handler; - -// 以下インスタンス化 -AppInfo DI_GS_cmd_packet_handler_app(void); - -AppInfo DI_GS_rt_tlm_packet_handler_app(void); -AppInfo DI_GS_rp_tlm_packet_handler_app(void); - -CCP_CmdRet Cmd_DI_GS_DRIVER_RESET(const CommonCmdPacket* packet); -CCP_CmdRet Cmd_DI_GS_SET_RT_FLUSH_INTERVAL(const CommonCmdPacket* packet); -CCP_CmdRet Cmd_DI_GS_SET_RP_FLUSH_INTERVAL(const CommonCmdPacket* packet); -CCP_CmdRet Cmd_DI_GS_SET_FARM_PW(const CommonCmdPacket* packet); -CCP_CmdRet Cmd_DI_GS_SET_INFO(const CommonCmdPacket* packet); - -CCP_CmdRet Cmd_DI_GS_CCSDS_GET_BUFFER(const CommonCmdPacket* packet); -CCP_CmdRet Cmd_DI_GS_CCSDS_SET_RATE(const CommonCmdPacket* packet); - -CCP_CmdRet Cmd_DI_GS_UART_TLM_ON(const CommonCmdPacket* packet); -CCP_CmdRet Cmd_DI_GS_UART_TLM_OFF(const CommonCmdPacket* packet); - -#endif diff --git a/examples/mobc/src/src_user/applications/user_defined/debug_apps.c b/examples/mobc/src/src_user/applications/user_defined/debug_apps.c index 80cdbdda5..14ecacdaf 100644 --- a/examples/mobc/src/src_user/applications/user_defined/debug_apps.c +++ b/examples/mobc/src/src_user/applications/user_defined/debug_apps.c @@ -18,7 +18,7 @@ #include #include #include -#include "../../applications/driver_instances/di_gs.h" +#include "../../applications/component_service/csrv_gs.h" // #include #include "../../library/vt100.h" #include diff --git a/examples/mobc/src/src_user/tlm_cmd/command_definitions.c b/examples/mobc/src/src_user/tlm_cmd/command_definitions.c index 82895e88f..ded7828de 100644 --- a/examples/mobc/src/src_user/tlm_cmd/command_definitions.c +++ b/examples/mobc/src/src_user/tlm_cmd/command_definitions.c @@ -148,15 +148,15 @@ void CA_load_cmd_table(CA_CmdInfo cmd_table[CA_MAX_CMDS]) cmd_table[Cmd_CODE_DCU_CLEAR_LOG].cmd_func = Cmd_DCU_CLEAR_LOG; cmd_table[Cmd_CODE_TEST_CCP_REGISTER_TLC_ASAP].cmd_func = Cmd_TEST_CCP_REGISTER_TLC_ASAP; cmd_table[Cmd_CODE_TEST_CCP_GET_RAW_PARAM_INFO].cmd_func = Cmd_TEST_CCP_GET_RAW_PARAM_INFO; - cmd_table[Cmd_CODE_DI_GS_DRIVER_RESET].cmd_func = Cmd_DI_GS_DRIVER_RESET; - cmd_table[Cmd_CODE_DI_GS_SET_RT_FLUSH_INTERVAL].cmd_func = Cmd_DI_GS_SET_RT_FLUSH_INTERVAL; - cmd_table[Cmd_CODE_DI_GS_SET_RP_FLUSH_INTERVAL].cmd_func = Cmd_DI_GS_SET_RP_FLUSH_INTERVAL; - cmd_table[Cmd_CODE_DI_GS_SET_FARM_PW].cmd_func = Cmd_DI_GS_SET_FARM_PW; - cmd_table[Cmd_CODE_DI_GS_SET_INFO].cmd_func = Cmd_DI_GS_SET_INFO; - cmd_table[Cmd_CODE_DI_GS_CCSDS_GET_BUFFER].cmd_func = Cmd_DI_GS_CCSDS_GET_BUFFER; - cmd_table[Cmd_CODE_DI_GS_CCSDS_SET_RATE].cmd_func = Cmd_DI_GS_CCSDS_SET_RATE; - cmd_table[Cmd_CODE_DI_GS_UART_TLM_ON].cmd_func = Cmd_DI_GS_UART_TLM_ON; - cmd_table[Cmd_CODE_DI_GS_UART_TLM_OFF].cmd_func = Cmd_DI_GS_UART_TLM_OFF; + cmd_table[Cmd_CODE_CSRV_GS_DRIVER_RESET].cmd_func = Cmd_CSRV_GS_DRIVER_RESET; + cmd_table[Cmd_CODE_CSRV_GS_SET_RT_FLUSH_INTERVAL].cmd_func = Cmd_CSRV_GS_SET_RT_FLUSH_INTERVAL; + cmd_table[Cmd_CODE_CSRV_GS_SET_RP_FLUSH_INTERVAL].cmd_func = Cmd_CSRV_GS_SET_RP_FLUSH_INTERVAL; + cmd_table[Cmd_CODE_CSRV_GS_SET_FARM_PW].cmd_func = Cmd_CSRV_GS_SET_FARM_PW; + cmd_table[Cmd_CODE_CSRV_GS_SET_INFO].cmd_func = Cmd_CSRV_GS_SET_INFO; + cmd_table[Cmd_CODE_CSRV_GS_CCSDS_GET_BUFFER].cmd_func = Cmd_CSRV_GS_CCSDS_GET_BUFFER; + cmd_table[Cmd_CODE_CSRV_GS_CCSDS_SET_RATE].cmd_func = Cmd_CSRV_GS_CCSDS_SET_RATE; + cmd_table[Cmd_CODE_CSRV_GS_UART_TLM_ON].cmd_func = Cmd_CSRV_GS_UART_TLM_ON; + cmd_table[Cmd_CODE_CSRV_GS_UART_TLM_OFF].cmd_func = Cmd_CSRV_GS_UART_TLM_OFF; cmd_table[Cmd_CODE_WDT_INIT].cmd_func = Cmd_WDT_INIT; cmd_table[Cmd_CODE_WDT_ENABLE].cmd_func = Cmd_WDT_ENABLE; cmd_table[Cmd_CODE_WDT_DISABLE].cmd_func = Cmd_WDT_DISABLE; @@ -341,11 +341,11 @@ void CA_load_cmd_table(CA_CmdInfo cmd_table[CA_MAX_CMDS]) cmd_table[Cmd_CODE_TEST_CCP_GET_RAW_PARAM_INFO].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_2BYTE; cmd_table[Cmd_CODE_TEST_CCP_GET_RAW_PARAM_INFO].param_size_infos[0].packed_info.bit.second = CA_PARAM_SIZE_TYPE_1BYTE; cmd_table[Cmd_CODE_TEST_CCP_GET_RAW_PARAM_INFO].param_size_infos[1].packed_info.bit.first = CA_PARAM_SIZE_TYPE_RAW; - cmd_table[Cmd_CODE_DI_GS_SET_RT_FLUSH_INTERVAL].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_4BYTE; - cmd_table[Cmd_CODE_DI_GS_SET_RP_FLUSH_INTERVAL].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_4BYTE; - cmd_table[Cmd_CODE_DI_GS_SET_FARM_PW].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_1BYTE; - cmd_table[Cmd_CODE_DI_GS_SET_INFO].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_1BYTE; - cmd_table[Cmd_CODE_DI_GS_CCSDS_SET_RATE].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_1BYTE; + cmd_table[Cmd_CODE_CSRV_GS_SET_RT_FLUSH_INTERVAL].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_4BYTE; + cmd_table[Cmd_CODE_CSRV_GS_SET_RP_FLUSH_INTERVAL].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_4BYTE; + cmd_table[Cmd_CODE_CSRV_GS_SET_FARM_PW].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_1BYTE; + cmd_table[Cmd_CODE_CSRV_GS_SET_INFO].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_1BYTE; + cmd_table[Cmd_CODE_CSRV_GS_CCSDS_SET_RATE].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_1BYTE; cmd_table[Cmd_CODE_UART_TEST_SEND_TEST].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_1BYTE; cmd_table[Cmd_CODE_UTIL_CMD_ADD].param_size_infos[0].packed_info.bit.first = CA_PARAM_SIZE_TYPE_1BYTE; cmd_table[Cmd_CODE_UTIL_CMD_ADD].param_size_infos[0].packed_info.bit.second = CA_PARAM_SIZE_TYPE_4BYTE; diff --git a/examples/mobc/src/src_user/tlm_cmd/command_definitions.h b/examples/mobc/src/src_user/tlm_cmd/command_definitions.h index d3fad8168..01a90f089 100644 --- a/examples/mobc/src/src_user/tlm_cmd/command_definitions.h +++ b/examples/mobc/src/src_user/tlm_cmd/command_definitions.h @@ -146,15 +146,15 @@ typedef enum Cmd_CODE_DCU_CLEAR_LOG = 0x0087, Cmd_CODE_TEST_CCP_REGISTER_TLC_ASAP = 0x0088, Cmd_CODE_TEST_CCP_GET_RAW_PARAM_INFO = 0x0089, - Cmd_CODE_DI_GS_DRIVER_RESET = 0x0100, - Cmd_CODE_DI_GS_SET_RT_FLUSH_INTERVAL = 0x0101, - Cmd_CODE_DI_GS_SET_RP_FLUSH_INTERVAL = 0x0102, - Cmd_CODE_DI_GS_SET_FARM_PW = 0x0103, - Cmd_CODE_DI_GS_SET_INFO = 0x0104, - Cmd_CODE_DI_GS_CCSDS_GET_BUFFER = 0x0105, - Cmd_CODE_DI_GS_CCSDS_SET_RATE = 0x0106, - Cmd_CODE_DI_GS_UART_TLM_ON = 0x0107, - Cmd_CODE_DI_GS_UART_TLM_OFF = 0x0108, + Cmd_CODE_CSRV_GS_DRIVER_RESET = 0x0100, + Cmd_CODE_CSRV_GS_SET_RT_FLUSH_INTERVAL = 0x0101, + Cmd_CODE_CSRV_GS_SET_RP_FLUSH_INTERVAL = 0x0102, + Cmd_CODE_CSRV_GS_SET_FARM_PW = 0x0103, + Cmd_CODE_CSRV_GS_SET_INFO = 0x0104, + Cmd_CODE_CSRV_GS_CCSDS_GET_BUFFER = 0x0105, + Cmd_CODE_CSRV_GS_CCSDS_SET_RATE = 0x0106, + Cmd_CODE_CSRV_GS_UART_TLM_ON = 0x0107, + Cmd_CODE_CSRV_GS_UART_TLM_OFF = 0x0108, Cmd_CODE_WDT_INIT = 0x0109, Cmd_CODE_WDT_ENABLE = 0x010A, Cmd_CODE_WDT_DISABLE = 0x010B, 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 e3c9e94d2..d21fe18e3 100644 --- a/examples/mobc/src/src_user/tlm_cmd/telemetry_definitions.c +++ b/examples/mobc/src/src_user/tlm_cmd/telemetry_definitions.c @@ -169,8 +169,8 @@ static TF_TLM_FUNC_ACK Tlm_MOBC_(uint8_t* packet, uint16_t* len, uint16_t max_le TF_copy_u32(&packet[292], ((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)))); TF_copy_u16(&packet[296], (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)))); TF_copy_u8(&packet[298], gs_driver->ccsds_info.buffer_num); - TF_copy_u32(&packet[299], (uint32_t)(DI_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval)); - TF_copy_u32(&packet[303], (uint32_t)(DI_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval)); + TF_copy_u32(&packet[299], (uint32_t)(CSRV_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval)); + TF_copy_u32(&packet[303], (uint32_t)(CSRV_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval)); TF_copy_u32(&packet[307], PL_count_executed_nodes(&PH_rt_tlm_list)); TF_copy_u8(&packet[311], (uint8_t)(PL_count_active_nodes(&PH_rt_tlm_list))); TF_copy_u32(&packet[312], PL_count_executed_nodes(&PH_st_tlm_list)); @@ -3589,12 +3589,12 @@ static TF_TLM_FUNC_ACK Tlm_GS_(uint8_t* packet, uint16_t* len, uint16_t max_len) TF_copy_u8(&packet[86], gs_validate_info->lockout_flag); TF_copy_u8(&packet[87], gs_validate_info->retransmit_flag); TF_copy_u8(&packet[88], gs_validate_info->positive_window_width); - TF_copy_u32(&packet[89], (uint32_t)DI_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval); - TF_copy_u32(&packet[93], (uint32_t)DI_GS_rt_tlm_packet_handler->tc_packet_to_m_pdu.last_updated); - TF_copy_u32(&packet[97], (uint32_t)DI_GS_rt_tlm_packet_handler->vcdu_counter); - TF_copy_u32(&packet[101], (uint32_t)DI_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval); - TF_copy_u32(&packet[105], (uint32_t)DI_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated); - TF_copy_u32(&packet[109], (uint32_t)DI_GS_rp_tlm_packet_handler->vcdu_counter); + 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[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); #endif *len = 113; 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 497185897..45525777d 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 @@ -5,8 +5,8 @@ */ #include "user_packet_handler.h" #include -#include "../applications/driver_instances/di_aobc.h" -// #include "../applications/driver_instances/di_tobc.h" +#include "../applications/component_service/csrv_aobc.h" +// #include "../applications/component_service/di_tobc.h" #define PH_AOBC_CMD_LIST_MAX (16) //!< AOBC CMD QUEUEサイズ #define PH_TOBC_CMD_LIST_MAX (16) //!< TOBC CMD QUEUEサイズ @@ -76,10 +76,10 @@ CCP_CmdRet PH_user_cmd_router(const CommonCmdPacket* packet) { case APID_AOBC_CMD: // AOBCに配送 - return DI_AOBC_dispatch_command(packet); + return CSRV_AOBC_dispatch_command(packet); case APID_TOBC_CMD: // TOBCに配送 - // return DI_TOBC_dispatch_command(packet); + // return CSRV_TOBC_dispatch_command(packet); default: // 該当する配送先が定義されていない場合 return CCP_make_cmd_ret(CCP_EXEC_ROUTING_FAILED, apid); From 7cb7bfafa1fd63ca407714b021266c0ab49e9b49 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 13 Oct 2023 20:16:29 +0900 Subject: [PATCH 2/2] 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 +- .../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 +- 11 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/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