diff --git a/Examples/minimum_user/src/src_user/Applications/DriverInstances/di_gs.c b/Examples/minimum_user/src/src_user/Applications/DriverInstances/di_gs.c index 76a132d48..9e2ac6c9d 100644 --- a/Examples/minimum_user/src/src_user/Applications/DriverInstances/di_gs.c +++ b/Examples/minimum_user/src/src_user/Applications/DriverInstances/di_gs.c @@ -196,4 +196,20 @@ CCP_CmdRet Cmd_DI_GS_CCSDS_SET_RATE(const CommonCmdPacket* packet) 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/minimum_user/src/src_user/Applications/DriverInstances/di_gs.h b/Examples/minimum_user/src/src_user/Applications/DriverInstances/di_gs.h index 9f9f11151..752358166 100644 --- a/Examples/minimum_user/src/src_user/Applications/DriverInstances/di_gs.h +++ b/Examples/minimum_user/src/src_user/Applications/DriverInstances/di_gs.h @@ -41,4 +41,7 @@ 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/minimum_user/src/src_user/Drivers/Com/gs.c b/Examples/minimum_user/src/src_user/Drivers/Com/gs.c index d55aa65b3..426988ecd 100644 --- a/Examples/minimum_user/src/src_user/Drivers/Com/gs.c +++ b/Examples/minimum_user/src/src_user/Drivers/Com/gs.c @@ -109,6 +109,7 @@ DS_INIT_ERR_CODE GS_init(GS_Driver* gs_driver, uint8_t uart_ch) } gs_driver->ccsds_info.buffer_num = 8; + gs_driver->driver_uart.is_tlm_on = 1; return DS_INIT_OK; } @@ -245,7 +246,6 @@ static DS_ERR_CODE GS_analyze_rec_data_(DS_StreamConfig* p_stream_config, void* DS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const VCDU* vcdu) { - int i; DS_ERR_CODE ret_ccsds = DS_ERR_CODE_OK; DS_ERR_CODE ret_uart = DS_ERR_CODE_OK; size_t vcdu_size = sizeof(VCDU); @@ -263,29 +263,27 @@ DS_CMD_ERR_CODE GS_send_vcdu(GS_Driver* gs_driver, const VCDU* vcdu) DSSC_set_tx_frame(&gs_driver->driver_uart.super.stream_config[GS_TX_STREAM], GS_tx_frame_); } - for (i = 0; i < GS_PORT_TYPE_NUM; ++i) + // CCSDS + gs_driver->ccsds_info.buffer_num = CCSDS_get_buffer_num(); + if (gs_driver->ccsds_info.buffer_num) { - if (i == GS_PORT_TYPE_CCSDS) - { - // バッファー空きが無い場合は 下の処理は端折る - // FIXME: 一杯だった時の処理 - gs_driver->ccsds_info.buffer_num = CCSDS_get_buffer_num(); - if (gs_driver->ccsds_info.buffer_num == 0) continue; - } + gs_driver->info[GS_PORT_TYPE_CCSDS].tx.send_cycle = TMGR_get_master_total_cycle(); + gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcid = VCDU_get_vcid(vcdu); + gs_driver->info[GS_PORT_TYPE_CCSDS].tx.vcdu_counter = VCDU_get_vcdu_counter(vcdu); - gs_driver->info[i].tx.send_cycle = TMGR_get_master_total_cycle(); - gs_driver->info[i].tx.vcid = VCDU_get_vcid(vcdu); - gs_driver->info[i].tx.vcdu_counter = VCDU_get_vcdu_counter(vcdu); + // DS 側の名称が cmd なだけで送信しているのは TLM + ret_ccsds = DS_send_general_cmd(&gs_driver->driver_ccsds.super, GS_TX_STREAM); + } + + // UART + if (gs_driver->driver_uart.is_tlm_on) + { + gs_driver->info[GS_PORT_TYPE_UART].tx.send_cycle = TMGR_get_master_total_cycle(); + gs_driver->info[GS_PORT_TYPE_UART].tx.vcid = VCDU_get_vcid(vcdu); + gs_driver->info[GS_PORT_TYPE_UART].tx.vcdu_counter = VCDU_get_vcdu_counter(vcdu); // DS 側の名称が cmd なだけで送信しているのは TLM - if (i == GS_PORT_TYPE_CCSDS) - { - ret_ccsds = DS_send_general_cmd(&gs_driver->driver_ccsds.super, GS_TX_STREAM); - } - else - { - ret_uart = DS_send_general_cmd(&gs_driver->driver_uart.super, GS_TX_STREAM); - } + ret_uart = DS_send_general_cmd(&gs_driver->driver_uart.super, GS_TX_STREAM); } if (ret_ccsds != DS_ERR_CODE_OK || ret_uart != DS_ERR_CODE_OK) diff --git a/Examples/minimum_user/src/src_user/Drivers/Com/gs.h b/Examples/minimum_user/src/src_user/Drivers/Com/gs.h index 07ba8a956..1413ef19f 100644 --- a/Examples/minimum_user/src/src_user/Drivers/Com/gs.h +++ b/Examples/minimum_user/src/src_user/Drivers/Com/gs.h @@ -74,6 +74,7 @@ typedef struct { DriverSuper super; UART_Config uart_config; + uint8_t is_tlm_on; //!< UART に TLM を流すかどうか, CCSDS では許容でも UART に TLM を送りすぎると詰まってしまうため } driver_uart; GS_Info info[GS_PORT_TYPE_NUM]; //!< CCSDS 用と UART 用 2 つ diff --git a/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv b/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv index c8d9a2ec1..165f3b5ec 100644 --- a/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv +++ b/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/CMD_DB/SAMPLE_MOBC_CMD_DB_CMD_DB.csv @@ -166,16 +166,18 @@ Comment,,,,,Type,Description,Type,Description,Type,Description,Type,Description, ,Cmd_DI_GS_SET_INFO,OBC,0x0104,1,uint8_t,TLM選択,,,,,,,,,,,,,GS送信TLMが0ならCCSDSに@@ 1ならUARTの情報が出てくる, ,Cmd_DI_GS_CCSDS_GET_BUFFER,OBC,0x0105,0,,,,,,,,,,,,,,,, ,Cmd_DI_GS_CCSDS_SET_RATE,OBC,0x0106,1,uint8_t,bps セットパラメータ,,,,,,,,,,,danger,,40M/パラメータ が bps になる.初期値は 0xAD で 230.4 Kbps (微妙に対応していない), +,Cmd_DI_GS_UART_TLM_ON,OBC,0x0107,0,,,,,,,,,,,,,,,TLM の UART への送出を行う, +,Cmd_DI_GS_UART_TLM_OFF,OBC,0x0108,0,,,,,,,,,,,,,,,TLM の UART への送出を止める, **,WDT用コマンド,,,,,,,,,,,,,,,,,,, -,Cmd_WDT_INIT,OBC,0x0107,0,,,,,,,,,,,,,,,WDT初期化.WDTがアプリイニシャライザを持たなくなったので追加, -,Cmd_WDT_ENABLE,OBC,0x0108,0,,,,,,,,,,,,,,,WDT有効化, -,Cmd_WDT_DISABLE,OBC,0x0109,0,,,,,,,,,,,,,,,WDT無効化, -,Cmd_WDT_STOP_CLEAR,OBC,0x010A,0,,,,,,,,,,,,,danger,,WDTのカウンタクリアを止める=リセット実行, -,Cmd_WDT_START_CLEAR,OBC,0x010B,0,,,,,,,,,,,,,,,WDTのカウンタクリアを開始する, +,Cmd_WDT_INIT,OBC,0x0109,0,,,,,,,,,,,,,,,WDT初期化.WDTがアプリイニシャライザを持たなくなったので追加, +,Cmd_WDT_ENABLE,OBC,0x010A,0,,,,,,,,,,,,,,,WDT有効化, +,Cmd_WDT_DISABLE,OBC,0x010B,0,,,,,,,,,,,,,,,WDT無効化, +,Cmd_WDT_STOP_CLEAR,OBC,0x010C,0,,,,,,,,,,,,,danger,,WDTのカウンタクリアを止める=リセット実行, +,Cmd_WDT_START_CLEAR,OBC,0x010D,0,,,,,,,,,,,,,,,WDTのカウンタクリアを開始する, **,UART TESTコマンド,,,,,,,,,,,,,,,,,,, -,Cmd_UART_TEST_INIT_DI,OBC,0x010C,0,,,,,,,,,,,,,,,DI初期化, -,Cmd_UART_TEST_UPDATE,OBC,0x010D,0,,,,,,,,,,,,,,,DI update, -,Cmd_UART_TEST_SEND_TEST,OBC,0x010E,1,uint8_t,id,,,,,,,,,,,,,DI send test, +,Cmd_UART_TEST_INIT_DI,OBC,0x010E,0,,,,,,,,,,,,,,,DI初期化, +,Cmd_UART_TEST_UPDATE,OBC,0x010F,0,,,,,,,,,,,,,,,DI update, +,Cmd_UART_TEST_SEND_TEST,OBC,0x0110,1,uint8_t,id,,,,,,,,,,,,,DI send test, **,,,,,,,,,,,,,,,,,,,, * POWER,,,,,,,,,,,,,,,,,,,, **,,,,,,,,,,,,,,,,,,,, @@ -996,5 +998,3 @@ Comment,,,,,Type,Description,Type,Description,Type,Description,Type,Description, ,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,, -,,,,,,,,,,,,,,,,,,,, -,,,,,,,,,,,,,,,,,,,, diff --git a/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv b/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv index 92d446fe2..a24145ed6 100644 --- a/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv +++ b/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/SAMPLE_MOBC_TLM_DB_GS.csv @@ -32,7 +32,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,CCSDS.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[0].tx.send_cycle,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,CCSDS.TX.VCID,uint8_t,(uint8_t)gs_driver->info[0].tx.vcid,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, ,CCSDS.TX.VCDU_COUNTER,uint32_t,gs_driver->info[0].tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, -,CCSDS.TX.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.TX.BUFFER_NUM,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.CH,uint8_t,gs_driver->driver_uart.uart_config.ch,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.BAUDRATE,uint32_t,gs_driver->driver_uart.uart_config.baudrate,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.PARITY,uint8_t,(uint8_t)gs_driver->driver_uart.uart_config.parity_settings,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,0=NONE@@ 1=ODD@@ 2=EVEN@@ 3=MARK@@ 4 =SPACE,, @@ -50,6 +50,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,UART.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[1].tx.send_cycle,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,UART.TX.VCID,uint8_t,(uint8_t)gs_driver->info[1].tx.vcid,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, ,UART.TX.VCDU_COUNTER,uint32_t,gs_driver->info[1].tx.vcdu_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, +,UART.IS_TLM_ON,uint8_t,gs_driver->driver_uart.is_tlm_on,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),STATUS,,,,,,,0=OFF@@ 1=ON,, ,COP-1.TYPE_A_COUNTER,uint8_t,gs_validate_info->type_a_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,COP-1.TYPE_B_COUNTER,uint8_t,gs_validate_info->type_b_counter,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, ,COP-1.LOCKOUT_FLAG,uint8_t,gs_validate_info->lockout_flag,PACKET,=R[-1]C+INT((R[-1]C[1]+R[-1]C[2])/8),=MOD((R[-1]C+R[-1]C[1])@@8),=IF(OR(EXACT(RC[-5]@@"uint8_t")@@EXACT(RC[-5]@@"int8_t"))@@8@@IF(OR(EXACT(RC[-5]@@"uint16_t")@@EXACT(RC[-5]@@"int16_t"))@@16@@IF(OR(EXACT(RC[-5]@@"uint32_t")@@EXACT(RC[-5]@@"int32_t")@@EXACT(RC[-5]@@"float"))@@32@@IF(EXACT(RC[-5]@@"double")@@64)))),NONE,,,,,,,,, @@ -497,4 +498,3 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, -,,,,,,,,,,,,,,,,, diff --git a/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv b/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv index c99bae025..11222618c 100644 --- a/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv +++ b/Examples/minimum_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/calced_data/SAMPLE_MOBC_TLM_DB_GS.csv @@ -32,7 +32,7 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,CCSDS.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[0].tx.send_cycle,PACKET,41,0,32,NONE,,,,,,,,, ,CCSDS.TX.VCID,uint8_t,(uint8_t)gs_driver->info[0].tx.vcid,PACKET,45,0,8,STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, ,CCSDS.TX.VCDU_COUNTER,uint32_t,gs_driver->info[0].tx.vcdu_counter,PACKET,46,0,32,NONE,,,,,,,,, -,CCSDS.TX.BUFFER_AVAILABLE,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,50,0,8,NONE,,,,,,,,, +,CCSDS.TX.BUFFER_NUM,uint8_t,gs_driver->ccsds_info.buffer_num,PACKET,50,0,8,NONE,,,,,,,,, ,UART.CH,uint8_t,gs_driver->driver_uart.uart_config.ch,PACKET,51,0,8,NONE,,,,,,,,, ,UART.BAUDRATE,uint32_t,gs_driver->driver_uart.uart_config.baudrate,PACKET,52,0,32,NONE,,,,,,,,, ,UART.PARITY,uint8_t,(uint8_t)gs_driver->driver_uart.uart_config.parity_settings,PACKET,56,0,8,STATUS,,,,,,,0=NONE@@ 1=ODD@@ 2=EVEN@@ 3=MARK@@ 4 =SPACE,, @@ -50,18 +50,18 @@ Comment,TLM Entry,Onboard Software Info.,,Extraction Info.,,,,Conversion Info.,, ,UART.TX.SEND_CYCLE,uint32_t,(uint32_t)gs_driver->info[1].tx.send_cycle,PACKET,74,0,32,NONE,,,,,,,,, ,UART.TX.VCID,uint8_t,(uint8_t)gs_driver->info[1].tx.vcid,PACKET,78,0,8,STATUS,,,,,,,1=REALTIME@@2=REPLAY@@63=FILL@@*=UNKNOWN,, ,UART.TX.VCDU_COUNTER,uint32_t,gs_driver->info[1].tx.vcdu_counter,PACKET,79,0,32,NONE,,,,,,,,, -,COP-1.TYPE_A_COUNTER,uint8_t,gs_validate_info->type_a_counter,PACKET,83,0,8,NONE,,,,,,,,, -,COP-1.TYPE_B_COUNTER,uint8_t,gs_validate_info->type_b_counter,PACKET,84,0,8,NONE,,,,,,,,, -,COP-1.LOCKOUT_FLAG,uint8_t,gs_validate_info->lockout_flag,PACKET,85,0,8,NONE,,,,,,,,, -,COP-1.RETRANSMIT_FLAG,uint8_t,gs_validate_info->retransmit_flag,PACKET,86,0,8,NONE,,,,,,,,, -,COP-1.POSITIVE_WINDOW_WIDTH,uint8_t,gs_validate_info->positive_window_width,PACKET,87,0,8,NONE,,,,,,,,, -,MS_TLM.VCDU.FLUSH_INTERVAL,uint32_t,(uint32_t)DI_GS_ms_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,88,0,32,NONE,,,,,,,,, -,MS_TLM.VCDU.LAST_UPDATED,uint32_t,(uint32_t)DI_GS_ms_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,92,0,32,NONE,,,,,,,,, -,MS_TLM.VCDU.COUNTER,uint32_t,(uint32_t)DI_GS_ms_tlm_packet_handler->vcdu_counter,PACKET,96,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,100,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,104,0,32,NONE,,,,,,,,, -,RP_TLM.VCDU.COUNTER,uint32_t,(uint32_t)DI_GS_rp_tlm_packet_handler->vcdu_counter,PACKET,108,0,32,NONE,,,,,,,,, -,,,,,,,,,,,,,,,,, +,UART.IS_TLM_ON,uint8_t,gs_driver->driver_uart.is_tlm_on,PACKET,83,0,8,STATUS,,,,,,,0=OFF@@ 1=ON,, +,COP-1.TYPE_A_COUNTER,uint8_t,gs_validate_info->type_a_counter,PACKET,84,0,8,NONE,,,,,,,,, +,COP-1.TYPE_B_COUNTER,uint8_t,gs_validate_info->type_b_counter,PACKET,85,0,8,NONE,,,,,,,,, +,COP-1.LOCKOUT_FLAG,uint8_t,gs_validate_info->lockout_flag,PACKET,86,0,8,NONE,,,,,,,,, +,COP-1.RETRANSMIT_FLAG,uint8_t,gs_validate_info->retransmit_flag,PACKET,87,0,8,NONE,,,,,,,,, +,COP-1.POSITIVE_WINDOW_WIDTH,uint8_t,gs_validate_info->positive_window_width,PACKET,88,0,8,NONE,,,,,,,,, +,MS_TLM.VCDU.FLUSH_INTERVAL,uint32_t,(uint32_t)DI_GS_ms_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval,PACKET,89,0,32,NONE,,,,,,,,, +,MS_TLM.VCDU.LAST_UPDATED,uint32_t,(uint32_t)DI_GS_ms_tlm_packet_handler->tc_packet_to_m_pdu.last_updated,PACKET,93,0,32,NONE,,,,,,,,, +,MS_TLM.VCDU.COUNTER,uint32_t,(uint32_t)DI_GS_ms_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,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,, diff --git a/Examples/minimum_user/src/src_user/TlmCmd/command_definitions.c b/Examples/minimum_user/src/src_user/TlmCmd/command_definitions.c index 8bbddff27..ababaff84 100644 --- a/Examples/minimum_user/src/src_user/TlmCmd/command_definitions.c +++ b/Examples/minimum_user/src/src_user/TlmCmd/command_definitions.c @@ -154,6 +154,8 @@ void CA_load_cmd_table(CA_CmdInfo cmd_table[CA_MAX_CMDS]) 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_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; diff --git a/Examples/minimum_user/src/src_user/TlmCmd/command_definitions.h b/Examples/minimum_user/src/src_user/TlmCmd/command_definitions.h index acddc56f2..80e994270 100644 --- a/Examples/minimum_user/src/src_user/TlmCmd/command_definitions.h +++ b/Examples/minimum_user/src/src_user/TlmCmd/command_definitions.h @@ -152,14 +152,16 @@ typedef enum 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_WDT_INIT = 0x0107, - Cmd_CODE_WDT_ENABLE = 0x0108, - Cmd_CODE_WDT_DISABLE = 0x0109, - Cmd_CODE_WDT_STOP_CLEAR = 0x010A, - Cmd_CODE_WDT_START_CLEAR = 0x010B, - Cmd_CODE_UART_TEST_INIT_DI = 0x010C, - Cmd_CODE_UART_TEST_UPDATE = 0x010D, - Cmd_CODE_UART_TEST_SEND_TEST = 0x010E, + Cmd_CODE_DI_GS_UART_TLM_ON = 0x0107, + Cmd_CODE_DI_GS_UART_TLM_OFF = 0x0108, + Cmd_CODE_WDT_INIT = 0x0109, + Cmd_CODE_WDT_ENABLE = 0x010A, + Cmd_CODE_WDT_DISABLE = 0x010B, + Cmd_CODE_WDT_STOP_CLEAR = 0x010C, + Cmd_CODE_WDT_START_CLEAR = 0x010D, + Cmd_CODE_UART_TEST_INIT_DI = 0x010E, + Cmd_CODE_UART_TEST_UPDATE = 0x010F, + Cmd_CODE_UART_TEST_SEND_TEST = 0x0110, Cmd_CODE_UTIL_CMD_ADD = 0x03E0, Cmd_CODE_UTIL_CMD_SEND = 0x03E1, Cmd_CODE_UTIL_CMD_RESET = 0x03E2, diff --git a/Examples/minimum_user/src/src_user/TlmCmd/telemetry_definitions.c b/Examples/minimum_user/src/src_user/TlmCmd/telemetry_definitions.c index 1db998315..30db2a794 100644 --- a/Examples/minimum_user/src/src_user/TlmCmd/telemetry_definitions.c +++ b/Examples/minimum_user/src/src_user/TlmCmd/telemetry_definitions.c @@ -3137,7 +3137,7 @@ static TF_TLM_FUNC_ACK Tlm_EH_INDEX_(uint8_t* packet, uint16_t* len, uint16_t ma static TF_TLM_FUNC_ACK Tlm_GS_(uint8_t* packet, uint16_t* len, uint16_t max_len) { - if (112 > max_len) return TF_TLM_FUNC_ACK_TOO_SHORT_LEN; + if (113 > max_len) return TF_TLM_FUNC_ACK_TOO_SHORT_LEN; #ifndef BUILD_SETTINGS_FAST_BUILD TF_copy_u8(&packet[26], (uint8_t)gs_driver->info[0].rx.rec_status); @@ -3170,20 +3170,21 @@ static TF_TLM_FUNC_ACK Tlm_GS_(uint8_t* packet, uint16_t* len, uint16_t max_len) TF_copy_u32(&packet[74], (uint32_t)gs_driver->info[1].tx.send_cycle); TF_copy_u8(&packet[78], (uint8_t)gs_driver->info[1].tx.vcid); TF_copy_u32(&packet[79], gs_driver->info[1].tx.vcdu_counter); - TF_copy_u8(&packet[83], gs_validate_info->type_a_counter); - TF_copy_u8(&packet[84], gs_validate_info->type_b_counter); - TF_copy_u8(&packet[85], gs_validate_info->lockout_flag); - TF_copy_u8(&packet[86], gs_validate_info->retransmit_flag); - TF_copy_u8(&packet[87], gs_validate_info->positive_window_width); - TF_copy_u32(&packet[88], (uint32_t)DI_GS_ms_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval); - TF_copy_u32(&packet[92], (uint32_t)DI_GS_ms_tlm_packet_handler->tc_packet_to_m_pdu.last_updated); - TF_copy_u32(&packet[96], (uint32_t)DI_GS_ms_tlm_packet_handler->vcdu_counter); - TF_copy_u32(&packet[100], (uint32_t)DI_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval); - TF_copy_u32(&packet[104], (uint32_t)DI_GS_rp_tlm_packet_handler->tc_packet_to_m_pdu.last_updated); - TF_copy_u32(&packet[108], (uint32_t)DI_GS_rp_tlm_packet_handler->vcdu_counter); + TF_copy_u8(&packet[83], gs_driver->driver_uart.is_tlm_on); + TF_copy_u8(&packet[84], gs_validate_info->type_a_counter); + TF_copy_u8(&packet[85], gs_validate_info->type_b_counter); + 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_ms_tlm_packet_handler->tc_packet_to_m_pdu.flush_interval); + TF_copy_u32(&packet[93], (uint32_t)DI_GS_ms_tlm_packet_handler->tc_packet_to_m_pdu.last_updated); + TF_copy_u32(&packet[97], (uint32_t)DI_GS_ms_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); #endif - *len = 112; + *len = 113; return TF_TLM_FUNC_ACK_SUCCESS; }