From 1733ffefcf65f86f80734a5529fc34a819749de7 Mon Sep 17 00:00:00 2001 From: Isaac Rowe <9010221+irowebbn@users.noreply.github.com> Date: Fri, 21 Jul 2023 12:32:36 -0500 Subject: [PATCH 1/6] Fix #2410, document ES Perf enums --- modules/es/config/default_cfe_es_msgdefs.h | 2 +- modules/es/fsw/src/cfe_es_perf.h | 30 ++++++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/modules/es/config/default_cfe_es_msgdefs.h b/modules/es/config/default_cfe_es_msgdefs.h index 61dd65dee..aae254ff0 100644 --- a/modules/es/config/default_cfe_es_msgdefs.h +++ b/modules/es/config/default_cfe_es_msgdefs.h @@ -151,7 +151,7 @@ typedef struct CFE_ES_DeleteCDSCmd_Payload **/ typedef struct CFE_ES_StartPerfCmd_Payload { - uint32 TriggerMode; /**< \brief Desired trigger position (Start, Center, End) */ + uint32 TriggerMode; /**< \brief Desired trigger position (Start, Center, End). Values defined by #CFE_ES_PerfMode. */ } CFE_ES_StartPerfCmd_Payload_t; /** diff --git a/modules/es/fsw/src/cfe_es_perf.h b/modules/es/fsw/src/cfe_es_perf.h index 1431b8d2f..f0244ff98 100644 --- a/modules/es/fsw/src/cfe_es_perf.h +++ b/modules/es/fsw/src/cfe_es_perf.h @@ -41,7 +41,15 @@ ** Defines */ -enum CFE_ES_PerfState_t + +/** @defgroup CFEESPerf Performance Analyzer Data Structures + * @{ + */ + +/** + * @brief Internal states for Performance Analyzer + */ +enum CFE_ES_PerfState { CFE_ES_PERF_IDLE = 0, CFE_ES_PERF_WAITING_FOR_TRIGGER, @@ -49,7 +57,11 @@ enum CFE_ES_PerfState_t CFE_ES_PERF_MAX_STATES }; -enum CFE_ES_PerfMode_t +/** + * @brief Labels for values to use in #CFE_ES_StartPerfCmd_Payload.TriggerMode + * @sa CFE_ES_StartPerfCmd_Payload +*/ +enum CFE_ES_PerfMode { CFE_ES_PERF_TRIGGER_START = 0, CFE_ES_PERF_TRIGGER_CENTER, @@ -57,8 +69,8 @@ enum CFE_ES_PerfMode_t CFE_ES_PERF_MAX_MODES }; -/* - * Perflog Dump Background Job states +/** + * @brief Perflog Dump Background Job states * * Writing performance log data is now handled by a state machine that runs * as a background job in Executive services. When a performance log dump is @@ -81,8 +93,8 @@ typedef enum CFE_ES_PerfDumpState_MAX /* Placeholder for last state, no action, always last */ } CFE_ES_PerfDumpState_t; -/* - * Performance log dump state structure +/** + * @brief Performance log dump state structure * * This structure is stored in global memory and keeps the state * of the performance log dump from one iteration to the next. @@ -110,8 +122,8 @@ typedef struct size_t FileSize; /* Total file size, for progress reporting in telemetry */ } CFE_ES_PerfDumpGlobal_t; -/* - * Helper function to obtain the progress/remaining items from +/** + * @brief Helper function to obtain the progress/remaining items from * the background task that is writing the performance log data * * This is no longer just simply reading a single value from a struct, @@ -137,4 +149,6 @@ uint32 CFE_ES_GetPerfLogDumpRemaining(void); */ bool CFE_ES_RunPerfLogDump(uint32 ElapsedTime, void *Arg); +/** @} */ + #endif /* CFE_ES_PERF_H */ From 23c7991e4910c74268379275df6fb486074596af Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Tue, 5 Dec 2023 17:13:47 +1000 Subject: [PATCH 2/6] Fix #2057, Update docs and UT to use `CFE_MSG_PTR` --- docs/cFE Application Developers Guide.md | 18 +- modules/cfe_testcase/src/sb_sendrecv_test.c | 4 +- modules/es/ut-coverage/es_UT.c | 284 +++++++++++--------- modules/evs/ut-coverage/evs_UT.c | 40 +-- modules/sb/ut-coverage/sb_UT.c | 76 +++--- modules/tbl/ut-coverage/tbl_UT.c | 12 +- modules/time/fsw/src/cfe_time_tone.c | 6 +- 7 files changed, 243 insertions(+), 197 deletions(-) diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index 3c3549beb..743fe2ef9 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -1916,7 +1916,7 @@ FILE: sample_app.h */ typedef struct { - CFE_MSG_TelemetryHeader_t TlmHeader; + CFE_MSG_TelemetryHeader_t TelemetryHeader; /* ** Task command interface counters... @@ -1949,7 +1949,7 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ int32 Status; ... - Status = CFE_MSG_Init(&SAMPLE_AppData.HkPacket.TlmHeader.Msg, /* Address of SB Message Data Buffer */ + Status = CFE_MSG_Init(CFE_MSG_PTR(SAMPLE_AppData.HkPacket.TelemetryHeader), /* Location of SB Message Data Buffer */ SAMPLE_HK_TLM_MID, /* SB Message ID associated with Data */ sizeof(SAMPLE_AppData.HkPacket)); /* Size of Buffer */ ... @@ -2107,8 +2107,8 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ /* ** Send housekeeping telemetry packet... */ - CFE_SB_TimeStampMsg(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg); - CFE_SB_TransmitMsg(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader), true); ... } ``` @@ -2222,7 +2222,7 @@ FILE: sample_app.h */ typedef struct { - CFE_MSG_CommandHeader_t TlmHeader; + CFE_MSG_CommandHeader_t TelemetryHeader; /* ** Task command interface counters... @@ -2255,17 +2255,17 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ */ SAMPLE_AppData.BigPktBuf = (SAMPLE_BigPkt_Buffer_t *)CFE_SB_AllocateMessageBuffer(sizeof(SAMPLE_BigPkt_t)); - CFE_MSG_Init(SAMPLE_AppData.BigPktBuf->Pkt.TlmHeader.Msg, SAMPLE_BIG_TLM_MID, - sizeof(SAMPLE_AppData.BigPktBuf->Pkt); + CFE_MSG_Init(SAMPLE_AppData.BigPktBuf->Pkt.TelemetryHeader.Msg, SAMPLE_BIG_TLM_MID, + sizeof(SAMPLE_AppData.BigPktBuf->Pkt)); /* ** ...Fill Packet with Data... */ - /* + /* ** Send Message after time tagging it with current time */ - CFE_SB_TimeStampMsg(&SAMPLE_AppData.BigPktBuf->Pkt.TlmHeader.Msg); + CFE_SB_TimeStampMsg(&SAMPLE_AppData.BigPktBuf->Pkt.TelemetryHeader.Msg); CFE_SB_TransmitBuffer(SAMPLE_AppData.BigPktBuf, BufferHandle, true); /* SAMPLE_AppData.BigPktBuf is no longer a valid pointer */ ... diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index 3ba2cf747..c404a0abb 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -51,8 +51,8 @@ typedef struct typedef union { CFE_MSG_Message_t Hdr; - CFE_MSG_CommandHeader_t CmdHeader; - CFE_MSG_TelemetryHeader_t TlmHeader; + CFE_MSG_CommandHeader_t CommandHeader; + CFE_MSG_TelemetryHeader_t TelemetryHeader; uint8 MaxSize[CFE_MISSION_SB_MAX_SB_MSG_SIZE + 16]; char StringBuffer[CFE_FT_STRINGBUF_SIZE]; } CFE_FT_TestBigMessage_t; diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 29d13ff1f..215a818b3 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -2599,23 +2599,23 @@ void TestTask(void) /* Test a successful HK request */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree)); /* Test the HK request with a get heap failure */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(OS_HeapGetInfo), 1, -1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); UtAssert_ZERO(CFE_ES_MEMOFFSET_TO_SIZET(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree)); /* Test successful no-op command */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_NOOP_INF_EID); /* Test successful reset counters command */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ResetCountersCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ResetCountersCmd), UT_TPID_CFE_ES_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESET_INF_EID); @@ -2624,14 +2624,14 @@ void TestTask(void) CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = 0; CmdBuf.RestartCmd.Payload.RestartType = CFE_PSP_RST_TYPE_PROCESSOR; UT_SetDataBuffer(UT_KEY(CFE_PSP_Restart), &ResetType, sizeof(ResetType), false); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); UtAssert_UINT32_EQ(ResetType, CFE_PSP_RST_TYPE_PROCESSOR); UtAssert_STUB_COUNT(CFE_PSP_Restart, 1); /* Test cFE restart with bad restart type */ ES_ResetUnitTest(); CmdBuf.RestartCmd.Payload.RestartType = 4524; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); CFE_UtAssert_EVENTSENT(CFE_ES_BOOT_ERR_EID); /* Test successful app create */ @@ -2647,13 +2647,13 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(8192); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INF_EID); /* Test app create with an OS task create failure */ ES_ResetUnitTest(); UT_SetDefaultReturnValue(UT_KEY(OS_TaskCreate), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_ERR_EID); /* Test app create with an invalid file name */ @@ -2670,7 +2670,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INVALID_FILENAME_ERR_EID); /* Test app create with a null application entry point */ @@ -2684,7 +2684,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INVALID_ENTRY_POINT_ERR_EID); /* Test app create with a null application name */ @@ -2699,7 +2699,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_NULL_APP_NAME_ERR_EID); /* Test app create with with an invalid exception action */ @@ -2715,7 +2715,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = 255; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_EXC_ACTION_ERR_EID); /* Test app create with a default stack size */ @@ -2731,7 +2731,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(0); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INF_EID); /* Test app create with a bad priority */ @@ -2747,7 +2747,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 1000; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_PRIORITY_ERR_EID); /* Test successful app stop */ @@ -2755,13 +2755,13 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.StopAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.StopAppCmd.Payload.Application) - 1); CmdBuf.StopAppCmd.Payload.Application[sizeof(CmdBuf.StopAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_STOP_DBG_EID); /* Test app stop failure */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_WAITING, "CFE_ES", NULL, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_STOP_ERR1_EID); /* Test app stop with a bad app name */ @@ -2769,7 +2769,7 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); strncpy(CmdBuf.StopAppCmd.Payload.Application, "BAD_APP_NAME", sizeof(CmdBuf.StopAppCmd.Payload.Application) - 1); CmdBuf.StopAppCmd.Payload.Application[sizeof(CmdBuf.StopAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_STOP_ERR2_EID); /* Test successful app restart */ @@ -2778,7 +2778,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.RestartAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_DBG_EID); /* Test app restart with failed file check */ @@ -2788,7 +2789,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.RestartAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.RestartAppCmd.Payload.Application)); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR1_EID); /* Test app restart with a bad app name */ @@ -2797,7 +2799,8 @@ void TestTask(void) strncpy(CmdBuf.RestartAppCmd.Payload.Application, "BAD_APP_NAME", sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR2_EID); /* Test failed app restart, core app */ @@ -2806,7 +2809,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.RestartAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR1_EID); /* Test failed app restart, not running */ @@ -2815,7 +2819,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_WAITING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.RestartAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.RestartAppCmd.Payload.Application)); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR1_EID); /* Test successful app reload */ @@ -2826,7 +2831,8 @@ void TestTask(void) CmdBuf.ReloadAppCmd.Payload.AppFileName[sizeof(CmdBuf.ReloadAppCmd.Payload.AppFileName) - 1] = '\0'; strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_DBG_EID); /* Test app reload with filename parse error */ @@ -2836,7 +2842,8 @@ void TestTask(void) strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR1_EID); /* Test app reload with missing file */ @@ -2848,7 +2855,8 @@ void TestTask(void) CmdBuf.ReloadAppCmd.Payload.AppFileName[sizeof(CmdBuf.ReloadAppCmd.Payload.AppFileName) - 1] = '\0'; strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application)); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR1_EID); /* Test app reload with a bad app name */ @@ -2857,7 +2865,8 @@ void TestTask(void) strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "BAD_APP_NAME", sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR2_EID); /* Test failed app reload, core app */ @@ -2866,7 +2875,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application)); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR1_EID); /* Test failed app reload, not RUNNING */ @@ -2875,7 +2885,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_WAITING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application)); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR1_EID); /* Test successful telemetry packet request for single app data */ @@ -2884,7 +2895,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_WAITING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.QueryOneCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1); CmdBuf.QueryOneCmd.Payload.Application[sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ONE_APP_EID); /* Test telemetry packet request for single app data with send message failure */ @@ -2894,7 +2905,7 @@ void TestTask(void) strncpy(CmdBuf.QueryOneCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1); CmdBuf.QueryOneCmd.Payload.Application[sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1] = '\0'; UT_SetDeferredRetcode(UT_KEY(CFE_SB_TransmitMsg), 1, -1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ONE_ERR_EID); /* Test telemetry packet request for single app data with a bad app name */ @@ -2903,7 +2914,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.QueryOneCmd.Payload.Application, "BAD_APP_NAME", sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1); CmdBuf.QueryOneCmd.Payload.Application[sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ONE_APPID_ERR_EID); /* Test successful write of all app data to file */ @@ -2912,7 +2923,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.QueryAllCmd.Payload.FileName, "AllFilename", sizeof(CmdBuf.QueryAllCmd.Payload.FileName) - 1); CmdBuf.QueryAllCmd.Payload.FileName[sizeof(CmdBuf.QueryAllCmd.Payload.FileName) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ALL_APPS_EID); /* Test Query tasks command with valid lib ID */ @@ -2920,27 +2931,27 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); CFE_ES_Global.LibTable[0].LibId = CFE_ES_LIBID_C(ES_UT_MakeLibIdForIndex(1)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ALL_APPS_EID); /* Test write of all app data to file with a null file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ALL_APPS_EID); /* Test write of all app data to file with a bad file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_OSCREATE_ERR_EID); /* Test write of all app data to file with a write header failure */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_WRHDR_ERR_EID); /* Test write of all app data to file with a file write failure */ @@ -2948,7 +2959,7 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKWR_ERR_EID); /* Test write of all app data to file with a file create failure */ @@ -2956,14 +2967,14 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_OSCREATE_ERR_EID); /* Test successful write of all task data to a file */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_EID); @@ -2973,7 +2984,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, &UtTaskRecPtr); TaskId = CFE_ES_TaskRecordGetID(UtTaskRecPtr); UT_SetHandlerFunction(UT_KEY(CFE_FS_InitHeader), ES_UT_UnusedAppTask, &TaskId); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_EID); @@ -2981,7 +2992,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_OSCREATE_ERR_EID); @@ -2991,7 +3002,7 @@ void TestTask(void) strncpy(CmdBuf.QueryAllTasksCmd.Payload.FileName, "filename", sizeof(CmdBuf.QueryAllTasksCmd.Payload.FileName) - 1); CmdBuf.QueryAllTasksCmd.Payload.FileName[sizeof(CmdBuf.QueryAllTasksCmd.Payload.FileName) - 1] = '\0'; UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, -1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_WRHDR_ERR_EID); @@ -3000,7 +3011,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "UT", NULL, NULL); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_WR_ERR_EID); @@ -3008,21 +3019,22 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_OSCREATE_ERR_EID); /* Test successful clearing of the system log */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ClearSysLogCmd), UT_TPID_CFE_ES_CMD_CLEAR_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ClearSysLogCmd), + UT_TPID_CFE_ES_CMD_CLEAR_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG1_INF_EID); /* Test successful overwriting of the system log using overwrite mode */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.OverwriteSysLogCmd.Payload.Mode = CFE_ES_LogMode_OVERWRITE; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.OverwriteSysLogCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.OverwriteSysLogCmd), UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOGMODE_EID); @@ -3030,7 +3042,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.OverwriteSysLogCmd.Payload.Mode = CFE_ES_LogMode_DISCARD; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.OverwriteSysLogCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.OverwriteSysLogCmd), UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOGMODE_EID); @@ -3038,7 +3050,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.OverwriteSysLogCmd.Payload.Mode = 255; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.OverwriteSysLogCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.OverwriteSysLogCmd), UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERR_SYSLOGMODE_EID); @@ -3048,21 +3060,24 @@ void TestTask(void) strncpy(CmdBuf.WriteSysLogCmd.Payload.FileName, "filename", sizeof(CmdBuf.WriteSysLogCmd.Payload.FileName) - 1); CmdBuf.WriteSysLogCmd.Payload.FileName[sizeof(CmdBuf.WriteSysLogCmd.Payload.FileName) - 1] = '\0'; CFE_ES_Global.TaskData.HkPacket.Payload.SysLogEntries = 123; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG2_EID); /* Test writing the system log using a bad file name */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG2_ERR_EID); /* Test writing the system log using a null file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.WriteSysLogCmd.Payload.FileName[0] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG2_EID); /* Test writing the system log with an OS create failure */ @@ -3070,7 +3085,8 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); CmdBuf.WriteSysLogCmd.Payload.FileName[0] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG2_ERR_EID); /* Test writing the system log with an OS write failure */ @@ -3082,19 +3098,22 @@ void TestTask(void) "0000-000-00:00:00.00000 Test Message\n"); CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; CmdBuf.WriteSysLogCmd.Payload.FileName[0] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_FILEWRITE_ERR_EID); /* Test writing the system log with a write header failure */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_FILEWRITE_ERR_EID); /* Test successful clearing of the E&R log */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ClearERLogCmd), UT_TPID_CFE_ES_CMD_CLEAR_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ClearERLogCmd), + UT_TPID_CFE_ES_CMD_CLEAR_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERLOG1_INF_EID); /* Test successful writing of the E&R log */ @@ -3105,26 +3124,30 @@ void TestTask(void) strncpy(CmdBuf.WriteERLogCmd.Payload.FileName, "filename", sizeof(CmdBuf.WriteERLogCmd.Payload.FileName) - 1); CmdBuf.WriteERLogCmd.Payload.FileName[sizeof(CmdBuf.WriteERLogCmd.Payload.FileName) - 1] = '\0'; UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpIsPending), false); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteERLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); UtAssert_STUB_COUNT(CFE_FS_BackgroundFileDumpRequest, 1); CFE_UtAssert_EVENTCOUNT(0); /* Failure of parsing the file name */ UT_ClearEventHistory(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteERLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERLOG2_ERR_EID); /* Failure from CFE_FS_BackgroundFileDumpRequest() should send the pending error event ID */ UT_ClearEventHistory(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_BackgroundFileDumpRequest), 1, CFE_STATUS_REQUEST_ALREADY_PENDING); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteERLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERLOG_PENDING_ERR_EID); /* Same event but pending locally */ UT_ClearEventHistory(); UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpIsPending), true); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteERLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERLOG_PENDING_ERR_EID); /* Test scan for exceptions in the PSP, should invoke a Processor Reset */ @@ -3226,20 +3249,21 @@ void TestTask(void) * length call */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_CLEAR_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_CLEAR_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test resetting and setting the max for the processor reset count */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ResetPRCountCmd), UT_TPID_CFE_ES_CMD_RESET_PR_COUNT_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ResetPRCountCmd), + UT_TPID_CFE_ES_CMD_RESET_PR_COUNT_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESET_PR_COUNT_EID); /* Test setting the maximum processor reset count */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.SetMaxPRCountCmd.Payload.MaxPRCount = 3; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SetMaxPRCountCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SetMaxPRCountCmd), UT_TPID_CFE_ES_CMD_SET_MAX_PR_COUNT_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SET_MAX_PR_COUNT_EID); @@ -3250,14 +3274,16 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); strncpy(CmdBuf.DeleteCDSCmd.Payload.CdsName, "CFE_ES.CDS_NAME", sizeof(CmdBuf.DeleteCDSCmd.Payload.CdsName) - 1); CmdBuf.DeleteCDSCmd.Payload.CdsName[sizeof(CmdBuf.DeleteCDSCmd.Payload.CdsName) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_DELETE_ERR_EID); /* Test failed deletion of specified critical table CDS */ /* NOTE - reuse command from previous test */ ES_ResetUnitTest(); ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, true, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_DELETE_TBL_ERR_EID); /* Test successful deletion of a specified CDS */ @@ -3266,14 +3292,16 @@ void TestTask(void) ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, false, NULL); /* Set up the block to read what we need to from the CDS */ - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_DELETED_INFO_EID); /* Test deletion of a specified CDS with the owning app being active */ ES_ResetUnitTest(); ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, false, NULL); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_OWNER_ACTIVE_EID); /* Test deletion of a specified CDS with the name not found */ @@ -3281,13 +3309,14 @@ void TestTask(void) ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, false, &UtCDSRegRecPtr); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_BAD", NULL, NULL); CFE_ES_CDSBlockRecordSetFree(UtCDSRegRecPtr); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_NAME_ERR_EID); /* Test successful dump of CDS to file using the default dump file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_REG_DUMP_INF_EID); @@ -3295,7 +3324,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CREATING_CDS_DUMP_ERR_EID); @@ -3303,7 +3332,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, -1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_WRITE_CFE_HDR_ERR_EID); @@ -3311,7 +3340,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CREATING_CDS_DUMP_ERR_EID); @@ -3320,14 +3349,14 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, false, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_DUMP_ERR_EID); /* Test telemetry pool statistics retrieval with an invalid handle */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendMemPoolStatsCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendMemPoolStatsCmd), UT_TPID_CFE_ES_CMD_SEND_MEM_POOL_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_INVALID_POOL_HANDLE_ERR_EID); @@ -3335,42 +3364,42 @@ void TestTask(void) ES_ResetUnitTest(); ES_UT_SetupMemPoolId(&UtPoolRecPtr); CmdBuf.SendMemPoolStatsCmd.Payload.PoolHandle = CFE_ES_MemPoolRecordGetID(UtPoolRecPtr); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendMemPoolStatsCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendMemPoolStatsCmd), UT_TPID_CFE_ES_CMD_SEND_MEM_POOL_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TLM_POOL_STATS_INFO_EID); /* Test the command pipe message process with an invalid command */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_INVALID_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_INVALID_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CC1_ERR_EID); /* Test sending a no-op command with an invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a reset counters command with an invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RESET_COUNTERS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a cFE restart command with an invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RESTART_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RESTART_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test cFE restart with a power on reset */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.RestartCmd.Payload.RestartType = CFE_PSP_RST_TYPE_POWERON; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_BOOT_ERR_EID); /* Test sending a start application command with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test start application command with a processor restart on application @@ -3388,77 +3417,77 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_PROC_RESTART; CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(CFE_PLATFORM_ES_DEFAULT_STACK_SIZE); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INF_EID); /* Test sending a stop application command with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_STOP_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_STOP_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a restart application command with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a reload application command with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a write request for a single application with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a write request for all applications with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a write request for all tasks with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to clear the system log with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_CLEAR_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_CLEAR_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to overwrite the system log with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to write the system log with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test successful overwriting of the system log using overwrite mode */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.OverwriteSysLogCmd.Payload.Mode = CFE_ES_LogMode_OVERWRITE; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.OverwriteSysLogCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.OverwriteSysLogCmd), UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOGMODE_EID); @@ -3466,35 +3495,35 @@ void TestTask(void) * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to reset the processor reset count with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RESET_PR_COUNT_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RESET_PR_COUNT_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to set the maximum processor reset count with * an invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_SET_MAX_PR_COUNT_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_SET_MAX_PR_COUNT_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to delete the CDS with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a telemetry pool statistics retrieval command with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_SEND_MEM_POOL_STATS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_SEND_MEM_POOL_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test successful dump of CDS to file using a specified dump file name */ @@ -3505,19 +3534,19 @@ void TestTask(void) strncpy(CmdBuf.DumpCDSRegistryCmd.Payload.DumpFilename, "DumpFile", sizeof(CmdBuf.DumpCDSRegistryCmd.Payload.DumpFilename) - 1); CmdBuf.DumpCDSRegistryCmd.Payload.DumpFilename[sizeof(CmdBuf.DumpCDSRegistryCmd.Payload.DumpFilename) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_REG_DUMP_INF_EID); /* Dump CDS command with invalid length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test error when sending Build Info event */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_EVS_SendEvent), 1, CFE_EVS_INVALID_PARAMETER); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); CFE_UtAssert_PRINTF("Error sending build info event"); /* @@ -3570,7 +3599,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test successful performance data collection start in CENTER @@ -3579,7 +3609,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_CENTER; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test successful performance data collection start in END @@ -3588,7 +3619,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_END; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test performance data collection start with an invalid trigger mode @@ -3597,7 +3629,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = (CFE_ES_PERF_TRIGGER_END + 1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_TRIG_ERR_EID); /* Test performance data collection start with an invalid trigger mode @@ -3606,7 +3639,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = 0xffffffff; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_TRIG_ERR_EID); /* Test performance data collection start with a file write in progress */ @@ -3616,13 +3650,15 @@ void TestPerf(void) memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_ERR_EID); /* Check again with pending state not idle */ CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_IDLE; CFE_ES_Global.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_ERR_EID); /* Test performance data collection by sending another valid @@ -3632,14 +3668,16 @@ void TestPerf(void) memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test successful performance data collection stop */ ES_ResetUnitTest(); memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STOPCMD_EID); /* Test performance data collection stop with a file name validation issue */ @@ -3647,7 +3685,8 @@ void TestPerf(void) memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(CFE_FS_ParseInputFileNameEx), CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_LOG_ERR_EID); /* Test successful performance data collection stop with a non-default @@ -3658,19 +3697,22 @@ void TestPerf(void) memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); strncpy(CmdBuf.PerfStopCmd.Payload.DataFileName, "filename", sizeof(CmdBuf.PerfStopCmd.Payload.DataFileName) - 1); CmdBuf.PerfStopCmd.Payload.DataFileName[sizeof(CmdBuf.PerfStopCmd.Payload.DataFileName) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STOPCMD_EID); /* Test performance data collection stop with a file write in progress */ ES_ResetUnitTest(); CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STOPCMD_ERR2_EID); /* Repeat with pending state not IDLE */ CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_IDLE; CFE_ES_Global.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STOPCMD_ERR2_EID); /* Test performance filter mask command with out of range filter @@ -3678,7 +3720,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetFilterMaskCmd.Payload.FilterMaskNum = CFE_ES_PERF_32BIT_WORDS_IN_MASK; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetFilterMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetFilterMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_FILTER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_FILTMSKERR_EID); @@ -3686,7 +3728,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetFilterMaskCmd.Payload.FilterMaskNum = CFE_ES_PERF_32BIT_WORDS_IN_MASK / 2; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetFilterMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetFilterMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_FILTER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_FILTMSKCMD_EID); @@ -3695,7 +3737,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetTrigMaskCmd.Payload.TriggerMaskNum = 0; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetTrigMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetTrigMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_TRIGMSKCMD_EID); @@ -3705,7 +3747,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetTrigMaskCmd.Payload.TriggerMaskNum = CFE_ES_PERF_32BIT_WORDS_IN_MASK - 1; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetTrigMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetTrigMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_TRIGMSKCMD_EID); @@ -3715,7 +3757,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetTrigMaskCmd.Payload.TriggerMaskNum = CFE_ES_PERF_32BIT_WORDS_IN_MASK + 1; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetTrigMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetTrigMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_TRIGMSKERR_EID); @@ -3838,22 +3880,22 @@ void TestPerf(void) /* Test performance data collection start with an invalid message length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test performance data collection stop with an invalid message length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_PERF_STOPCMD_EID); /* Test performance data filter mask with an invalid message length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_SET_PERF_FILTER_MASK_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_SET_PERF_FILTER_MASK_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_PERF_FILTMSKCMD_EID); /* Test performance data trigger mask with an invalid message length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_PERF_TRIGMSKCMD_EID); /* Test perf log dump state machine */ diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 3308e2476..95b6cfe5e 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -274,7 +274,7 @@ void Test_Init(void) { CFE_EVS_EnablePortsCmd_t bitmaskcmd; CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_SB_MsgId_t msgid = CFE_SB_INVALID_MSG_ID; + CFE_SB_MsgId_t msgid = CFE_SB_INVALID_MSG_ID; UtPrintf("Begin Test Init"); @@ -695,7 +695,7 @@ void Test_Format(void) CFE_TIME_SysTime_t time = {0, 0}; CFE_EVS_SetEventFormatModeCmd_t modecmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; CFE_EVS_PacketID_t CapturedMsg; UT_SoftwareBusSnapshot_Entry_t LongFmtSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID), .SnapshotBuffer = &CapturedMsg, @@ -821,7 +821,7 @@ void Test_Format(void) */ void Test_Ports(void) { - CFE_EVS_EnablePortsCmd_t bitmaskcmd; + CFE_EVS_EnablePortsCmd_t bitmaskcmd; UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; CFE_TIME_SysTime_t PacketTime; @@ -1074,9 +1074,9 @@ void Test_WriteApp(void) { union { - CFE_EVS_ResetCountersCmd_t ResetCountersCmd; - CFE_EVS_WriteAppDataFileCmd_t AppDataCmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_ResetCountersCmd_t ResetCountersCmd; + CFE_EVS_WriteAppDataFileCmd_t AppDataCmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; } CmdBuf; UtPrintf("Begin Test Write App"); @@ -1157,10 +1157,10 @@ void Test_WriteApp(void) */ void Test_BadAppCmd(void) { - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - CFE_EVS_AddEventFilterCmd_t appmaskcmd; - CFE_EVS_ResetFilterCmd_t appcmdcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + CFE_EVS_AddEventFilterCmd_t appmaskcmd; + CFE_EVS_ResetFilterCmd_t appcmdcmd; uint32 TestAppIndex; UtPrintf("Begin Test Bad App Command"); @@ -1425,11 +1425,11 @@ void Test_BadAppCmd(void) */ void Test_EventCmd(void) { - uint16 EventCount[4]; - CFE_EVS_EnablePortsCmd_t bitmaskcmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; + uint16 EventCount[4]; + CFE_EVS_EnablePortsCmd_t bitmaskcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; memset(&bitmaskcmd, 0, sizeof(bitmaskcmd)); @@ -1602,10 +1602,10 @@ void Test_EventCmd(void) void Test_FilterCmd(void) { int i; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - CFE_EVS_AddEventFilterCmd_t appmaskcmd; - CFE_EVS_ResetFilterCmd_t appcmdcmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + CFE_EVS_AddEventFilterCmd_t appmaskcmd; + CFE_EVS_ResetFilterCmd_t appcmdcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; UtPrintf("Begin Test Filter Command"); @@ -2124,4 +2124,4 @@ void Test_Misc(void) EVS_AppDataSetUsed(&CFE_EVS_Global.AppData[i], AppID); } UtAssert_UINT32_EQ(CFE_EVS_ReportHousekeepingCmd(NULL), CFE_STATUS_NO_COUNTER_INCREMENT); -} +} \ No newline at end of file diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 72df5a6b3..1f3c2c83b 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -514,13 +514,13 @@ void Test_SB_Cmds_Noop(void) memset(&Noop, 0, sizeof(Noop)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &Noop.SBBuf.Msg, sizeof(Noop.Cmd), UT_TPID_CFE_SB_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(Noop.SBBuf), sizeof(Noop.Cmd), UT_TPID_CFE_SB_CMD_NOOP_CC); CFE_UtAssert_EVENTCOUNT(1); CFE_UtAssert_EVENTSENT(CFE_SB_CMD0_RCVD_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &Noop.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(Noop.SBBuf), 0, UT_TPID_CFE_SB_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); } @@ -537,14 +537,15 @@ void Test_SB_Cmds_RstCtrs(void) memset(&ResetCounters, 0, sizeof(ResetCounters)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &ResetCounters.SBBuf.Msg, sizeof(ResetCounters.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(ResetCounters.SBBuf), sizeof(ResetCounters.Cmd), UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTCOUNT(1); CFE_UtAssert_EVENTSENT(CFE_SB_CMD1_RCVD_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &ResetCounters.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(ResetCounters.SBBuf), 0, + UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); } /* Test_SB_Cmds_RstCtrs */ @@ -587,7 +588,7 @@ void Test_SB_Cmds_Stats(void) CFE_UtAssert_EVENTSENT(CFE_SB_SND_STATS_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &SendSbStats.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_SEND_SB_STATS_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(SendSbStats.SBBuf), 0, UT_TPID_CFE_SB_CMD_SEND_SB_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -611,7 +612,7 @@ void Test_SB_Cmds_RoutingInfoDef(void) /* Make some routing info by calling CFE_SB_AppInit */ CFE_UtAssert_SETUP(CFE_SB_AppInit()); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteRoutingInfo.SBBuf), sizeof(WriteRoutingInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTCOUNT(5); @@ -622,12 +623,13 @@ void Test_SB_Cmds_RoutingInfoDef(void) /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteRoutingInfo.SBBuf), sizeof(WriteRoutingInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteRoutingInfo.SBBuf), 0, + UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); @@ -651,7 +653,7 @@ void Test_SB_Cmds_RoutingInfoAlreadyPending(void) strncpy(WriteRoutingInfo.Cmd.Payload.Filename, "RoutingTstFile", sizeof(WriteRoutingInfo.Cmd.Payload.Filename) - 1); WriteRoutingInfo.Cmd.Payload.Filename[sizeof(WriteRoutingInfo.Cmd.Payload.Filename) - 1] = '\0'; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteRoutingInfo.SBBuf), sizeof(WriteRoutingInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -758,7 +760,7 @@ void Test_SB_Cmds_PipeInfoDef(void) CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WritePipeInfo.SBBuf), sizeof(WritePipeInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTCOUNT(3); @@ -767,11 +769,12 @@ void Test_SB_Cmds_PipeInfoDef(void) /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WritePipeInfo.SBBuf), sizeof(WritePipeInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WritePipeInfo.SBBuf), 0, + UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -797,7 +800,7 @@ void Test_SB_Cmds_PipeInfoAlreadyPending(void) strncpy(WritePipeInfo.Cmd.Payload.Filename, "PipeTstFile", sizeof(WritePipeInfo.Cmd.Payload.Filename) - 1); WritePipeInfo.Cmd.Payload.Filename[sizeof(WritePipeInfo.Cmd.Payload.Filename) - 1] = '\0'; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WritePipeInfo.SBBuf), sizeof(WritePipeInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -960,7 +963,7 @@ void Test_SB_Cmds_MapInfoDef(void) CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteMapInfo.SBBuf), sizeof(WriteMapInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTCOUNT(10); @@ -971,12 +974,12 @@ void Test_SB_Cmds_MapInfoDef(void) /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteMapInfo.SBBuf), sizeof(WriteMapInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteMapInfo.SBBuf), 0, UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -1002,7 +1005,7 @@ void Test_SB_Cmds_MapInfoAlreadyPending(void) strncpy(WriteMapInfo.Cmd.Payload.Filename, "MapTstFile", sizeof(WriteMapInfo.Cmd.Payload.Filename) - 1); WriteMapInfo.Cmd.Payload.Filename[sizeof(WriteMapInfo.Cmd.Payload.Filename) - 1] = '\0'; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteMapInfo.SBBuf), sizeof(WriteMapInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1031,7 +1034,7 @@ void Test_SB_Cmds_EnRouteValParam(void) EnableRoute.Cmd.Payload.MsgId = MsgId; EnableRoute.Cmd.Payload.Pipe = PipeId; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(3); @@ -1043,7 +1046,7 @@ void Test_SB_Cmds_EnRouteValParam(void) CFE_UtAssert_EVENTSENT(CFE_SB_ENBL_RTE2_EID); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), 0, UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); @@ -1072,7 +1075,7 @@ void Test_SB_Cmds_EnRouteNonExist(void) EnableRoute.Cmd.Payload.MsgId = MsgId; EnableRoute.Cmd.Payload.Pipe = PipeId2; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(4); @@ -1101,7 +1104,7 @@ void Test_SB_Cmds_EnRouteInvParam(void) EnableRoute.Cmd.Payload.MsgId = SB_UT_LAST_VALID_MID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1125,7 +1128,7 @@ void Test_SB_Cmds_EnRouteInvParam2(void) EnableRoute.Cmd.Payload.MsgId = CFE_SB_INVALID_MSG_ID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1150,7 +1153,7 @@ void Test_SB_Cmds_EnRouteInvParam3(void) EnableRoute.Cmd.Payload.MsgId = SB_UT_ALTERNATE_INVALID_MID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_0; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1179,7 +1182,7 @@ void Test_SB_Cmds_DisRouteValParam(void) DisableRoute.Cmd.Payload.MsgId = MsgId; DisableRoute.Cmd.Payload.Pipe = PipeId; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(3); @@ -1191,7 +1194,7 @@ void Test_SB_Cmds_DisRouteValParam(void) CFE_UtAssert_EVENTSENT(CFE_SB_DSBL_RTE2_EID); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), 0, UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); @@ -1220,7 +1223,7 @@ void Test_SB_Cmds_DisRouteNonExist(void) DisableRoute.Cmd.Payload.MsgId = MsgId; DisableRoute.Cmd.Payload.Pipe = PipeId2; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(4); @@ -1249,7 +1252,7 @@ void Test_SB_Cmds_DisRouteInvParam(void) DisableRoute.Cmd.Payload.MsgId = SB_UT_LAST_VALID_MID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1273,7 +1276,7 @@ void Test_SB_Cmds_DisRouteInvParam2(void) DisableRoute.Cmd.Payload.MsgId = CFE_SB_INVALID_MSG_ID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1298,7 +1301,7 @@ void Test_SB_Cmds_DisRouteInvParam3(void) DisableRoute.Cmd.Payload.MsgId = SB_UT_ALTERNATE_INVALID_MID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_0; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1459,7 +1462,8 @@ void Test_SB_Cmds_SendPrevSubs(void) UT_ClearEventHistory(); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &SendPrevSubs.SBBuf.Msg, 0, UT_TPID_CFE_SB_SUB_RPT_CTL_SEND_PREV_SUBS_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(SendPrevSubs.SBBuf), 0, + UT_TPID_CFE_SB_SUB_RPT_CTL_SEND_PREV_SUBS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -1480,7 +1484,7 @@ void Test_SB_Cmds_SubRptOn(void) memset(&EnableSubReporting, 0, sizeof(EnableSubReporting)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableSubReporting.SBBuf.Msg, sizeof(EnableSubReporting.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableSubReporting.SBBuf), sizeof(EnableSubReporting.Cmd), UT_TPID_CFE_SB_SUB_RPT_CTL_ENABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTCOUNT(0); @@ -1489,7 +1493,7 @@ void Test_SB_Cmds_SubRptOn(void) UT_ClearEventHistory(); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableSubReporting.SBBuf.Msg, 0, + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableSubReporting.SBBuf), 0, UT_TPID_CFE_SB_SUB_RPT_CTL_ENABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -1508,7 +1512,7 @@ void Test_SB_Cmds_SubRptOff(void) memset(&DisableSubReporting, 0, sizeof(DisableSubReporting)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableSubReporting.SBBuf.Msg, sizeof(DisableSubReporting.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableSubReporting.SBBuf), sizeof(DisableSubReporting.Cmd), UT_TPID_CFE_SB_SUB_RPT_CTL_DISABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTCOUNT(0); @@ -1517,7 +1521,7 @@ void Test_SB_Cmds_SubRptOff(void) UT_ClearEventHistory(); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableSubReporting.SBBuf.Msg, 0, + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableSubReporting.SBBuf), 0, UT_TPID_CFE_SB_SUB_RPT_CTL_DISABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -4446,7 +4450,7 @@ void Test_SB_TransmitMsgPaths_Nominal(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_MSG_TOO_BIG_EID_BIT); - CFE_SB_TransmitMsg(&Housekeeping.SBBuf.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(Housekeeping.SBBuf), true); CFE_UtAssert_EVENTNOTSENT(CFE_SB_MSG_TOO_BIG_EID); UtAssert_UINT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 1); @@ -4455,7 +4459,7 @@ void Test_SB_TransmitMsgPaths_Nominal(void) MsgId = CFE_SB_INVALID_MSG_ID; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_SEND_INV_MSGID_EID_BIT); - CFE_SB_TransmitMsg(&Housekeeping.SBBuf.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(Housekeeping.SBBuf), true); CFE_UtAssert_EVENTNOTSENT(CFE_SB_SEND_INV_MSGID_EID); UtAssert_UINT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 1); diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index 113216dea..f6ad15bae 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -300,28 +300,28 @@ void Test_CFE_TBL_TaskInit(void) /* Test command pipe messages handler response to a valid command */ UT_InitData(); - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_TBL_NOOP_INF_EID); /* Test command pipe messages handler response to an invalid * message length */ UT_InitData(); - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd) - 1, UT_TPID_CFE_TBL_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd) - 1, UT_TPID_CFE_TBL_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_TBL_LEN_ERR_EID); /* Test command pipe messages handler response to an invalid * command code */ UT_InitData(); - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_CMD_INVALID_CC); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_CMD_INVALID_CC); CFE_UtAssert_EVENTSENT(CFE_TBL_CC1_ERR_EID); /* Test command pipe messages handler response to other errors */ UT_InitData(); CFE_TBL_Global.CommandCounter = 0; CFE_TBL_Global.CommandErrorCounter = 0; - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_INVALID_MID); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_INVALID_MID); CFE_UtAssert_EVENTSENT(CFE_TBL_MID_ERR_EID); UtAssert_ZERO(CFE_TBL_Global.CommandCounter); UtAssert_ZERO(CFE_TBL_Global.CommandErrorCounter); @@ -330,13 +330,13 @@ void Test_CFE_TBL_TaskInit(void) UT_InitData(); CFE_TBL_Global.CommandCounter = 0; CFE_TBL_Global.CommandErrorCounter = 0; - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_TBL_MSG_HK); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_TBL_MSG_HK); UtAssert_ZERO(CFE_TBL_Global.CommandCounter); UtAssert_ZERO(CFE_TBL_Global.CommandErrorCounter); /* Test command pipe messages handler response to "command type" message */ UT_InitData(); - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ResetCountersCmd), + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ResetCountersCmd), UT_TPID_CFE_TBL_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_TBL_RESET_INF_EID); UtAssert_ZERO(CFE_TBL_Global.CommandCounter); diff --git a/modules/time/fsw/src/cfe_time_tone.c b/modules/time/fsw/src/cfe_time_tone.c index b3a431386..5284d890b 100644 --- a/modules/time/fsw/src/cfe_time_tone.c +++ b/modules/time/fsw/src/cfe_time_tone.c @@ -275,7 +275,7 @@ int32 CFE_TIME_ToneSendMET(CFE_TIME_SysTime_t NewMET) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), true); /* ** Count of "time at the tone" commands sent with external data... @@ -415,7 +415,7 @@ int32 CFE_TIME_ToneSendGPS(CFE_TIME_SysTime_t NewTime, int16 NewLeaps) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), true); /* ** Count of "time at the tone" commands sent with external data... @@ -555,7 +555,7 @@ int32 CFE_TIME_ToneSendTime(CFE_TIME_SysTime_t NewTime) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), true); /* ** Count of "time at the tone" commands sent with external data... From f3cdfbe3ab63162a602ba8c00b69d705f212bc8a Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 6 Dec 2023 10:51:36 -0500 Subject: [PATCH 3/6] Fix #2473, document and use topicid numbers for cfe A topic ID is the same concept as was previously referred to as a portable message number. This just formalizes it, gives it a name, and adds some macros for easier customization of the behavior. --- cmake/arch_build.cmake | 79 ++++++++++++++++++- cmake/mission_build.cmake | 75 ++++++++++++++++++ cmake/sample_defs/example_platform_cfg.h | 15 ++-- .../config/default_cfe_test_msgids.h | 4 +- .../config/default_cfe_test_topicids.h | 4 +- .../cfe_testcase/src/sb_subscription_test.c | 2 +- modules/core_api/arch_build.cmake | 32 +++++--- .../config/default_cfe_core_api_base_msgids.h | 72 +++++++++++++++-- modules/core_api/mission_build.cmake | 52 ++++++++---- modules/es/arch_build.cmake | 9 ++- modules/es/config/default_cfe_es_msgids.h | 10 +-- modules/es/config/default_cfe_es_topicids.h | 10 +-- modules/evs/arch_build.cmake | 6 +- modules/evs/config/default_cfe_evs_msgids.h | 13 +-- modules/evs/config/default_cfe_evs_topicids.h | 10 +-- modules/evs/ut-coverage/evs_UT.c | 49 ++++++------ modules/sb/arch_build.cmake | 6 +- modules/sb/config/default_cfe_sb_msgids.h | 14 ++-- modules/sb/config/default_cfe_sb_topicids.h | 14 ++-- modules/sb/ut-coverage/sb_UT.h | 4 +- modules/tbl/arch_build.cmake | 6 +- modules/tbl/config/default_cfe_tbl_msgids.h | 8 +- modules/tbl/config/default_cfe_tbl_topicids.h | 8 +- modules/time/arch_build.cmake | 6 +- modules/time/config/default_cfe_time_msgids.h | 16 ++-- .../time/config/default_cfe_time_topicids.h | 16 ++-- 26 files changed, 392 insertions(+), 148 deletions(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index e94f86fe4..f173e5d06 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -606,6 +606,81 @@ function(cfs_app_check_intf MODULE_NAME) endfunction(cfs_app_check_intf) +################################################################## +# +# FUNCTION: setup_platform_msgids +# +# This is intended to support cases where MsgIDs for all apps +# and modules are assigned in a single/unified header file +# +function(setup_platform_msgids) + + set(PLATFORM_MSGID_HEADERFILE) + + # In an EDS build, the msg IDs always come from EDS, there should not be a local msgids.h file + if (NOT CFE_EDS_ENABLED_BUILD) + + # Check for the presence of a platform-specific msgid file + # This uses cfe_locate_implementation_file() as this returns whether or not it found one + cfe_locate_implementation_file(PLATFORM_MSGID_HEADERFILE "msgids.h" + PREFIX ${BUILD_CONFIG} cfs + SUBDIR config + ) + + # If a top level file was found, then create a wrapper around it called "cfs_msgids.h" + # Note that at this point it could be a list + if (PLATFORM_MSGID_HEADERFILE) + + set(TEMP_WRAPPER_FILE_CONTENT) + foreach(SELECTED_FILE ${PLATFORM_MSGID_HEADERFILE}) + file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH) + list(APPEND TEMP_WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n") + endforeach() + + # Generate a header file + generate_c_headerfile("${CMAKE_BINARY_DIR}/inc/cfs_msgids.h" ${TEMP_WRAPPER_FILE_CONTENT}) + unset(TEMP_WRAPPER_FILE_CONTENT) + + # From here on use the wrapper file + set(PLATFORM_MSGID_HEADERFILE "cfs_msgids.h") + + endif(PLATFORM_MSGID_HEADERFILE) + + endif(NOT CFE_EDS_ENABLED_BUILD) + + # Finally, export a CFGFILE_SRC variable for each of the deps + # This should make each respective "mission_build" create a wrapper + # that points directly at this global file, ignoring the default + if (PLATFORM_MSGID_HEADERFILE) + + # Historically there has been a cfe_msgids.h defined at the core api level + # be sure to include this in the export list + set (OUTPUT_VAR_LIST + CORE_API_CFGFILE_SRC_cfe_msgids + ) + + # Slight inconsistency: for CFE core components, the cfe_ prefix is omitted in DEP_NAME + # To make this work without major impact, add it back in here + foreach(DEP_NAME ${MISSION_CORE_MODULES}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_cfe_${DEP_NAME}_msgids) + endforeach(DEP_NAME ${MISSION_CORE_MODULES}) + + foreach(DEP_NAME ${TGTSYS_${SYSVAR}_APPS} ${TGTSYS_${SYSVAR}_STATICAPPS}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_${DEP_NAME}_msgids) + endforeach(DEP_NAME ${MISSION_APPS}) + + # This is the actual export to parent scope + foreach(VAR_NAME ${OUTPUT_VAR_LIST}) + message("${VAR_NAME}=${PLATFORM_MSGID_HEADERFILE}") + set(${VAR_NAME} ${PLATFORM_MSGID_HEADERFILE} PARENT_SCOPE) + endforeach(VAR_NAME ${OUTPUT_VAR_LIST}) + + endif (PLATFORM_MSGID_HEADERFILE) + +endfunction(setup_platform_msgids) + ################################################################## @@ -658,6 +733,9 @@ function(prepare) list(REMOVE_AT BUILD_CONFIG 0) set(BUILD_CONFIG ${BUILD_CONFIG} PARENT_SCOPE) + # Check if the user has provided a platform-specific "msgids.h" file and set up a wrapper to it + setup_platform_msgids() + # Pull in any application-specific platform-scope configuration # This may include user configuration files such as cfe_platform_cfg.h, # or any other configuration/preparation that needs to happen at @@ -746,7 +824,6 @@ function(process_arch SYSVAR) endif() endforeach() - # Add all core modules # The osal is handled explicitly (above) since this has special extra config foreach(DEP ${MISSION_CORE_INTERFACES} ${MISSION_CORE_MODULES}) diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 192c2e6c4..4664ee6a3 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -161,6 +161,78 @@ function(generate_build_version_templates) endfunction(generate_build_version_templates) +################################################################## +# +# FUNCTION: setup_global_topicids +# +# This is intended to support cases where topic IDs for all apps +# and modules are assigned in a single/unified header file +# +function(setup_global_topicids) + + if (CFE_EDS_ENABLED_BUILD) + + # In an EDS build, the topic IDs always come from EDS + set(MISSION_GLOBAL_TOPICID_HEADERFILE "cfe_mission_eds_designparameters.h") + + else(CFE_EDS_ENABLED_BUILD) + + # Check for the presence of a mission-wide/global topic ID file + # This uses cfe_locate_implementation_file() as this returns whether or not it found one + cfe_locate_implementation_file(MISSION_GLOBAL_TOPICID_HEADERFILE "global_topicids.h" + PREFIX ${MISSIONCONFIG} cfs + SUBDIR config + ) + + # If a top level file was found, then create a wrapper around it called "cfs_global_topicids.h" + # Note that at this point it could be a list + if (MISSION_GLOBAL_TOPICID_HEADERFILE) + + set(TEMP_WRAPPER_FILE_CONTENT) + foreach(SELECTED_FILE ${MISSION_GLOBAL_TOPICID_HEADERFILE}) + file(TO_NATIVE_PATH "${SELECTED_FILE}" SRC_NATIVE_PATH) + list(APPEND TEMP_WRAPPER_FILE_CONTENT "#include \"${SRC_NATIVE_PATH}\"\n") + endforeach() + + # Generate a header file + generate_c_headerfile("${CMAKE_BINARY_DIR}/inc/cfs_global_topicids.h" ${TEMP_WRAPPER_FILE_CONTENT}) + unset(TEMP_WRAPPER_FILE_CONTENT) + + # From here on use the wrapper file + set(MISSION_GLOBAL_TOPICID_HEADERFILE "cfs_global_topicids.h") + + endif(MISSION_GLOBAL_TOPICID_HEADERFILE) + + endif(CFE_EDS_ENABLED_BUILD) + + # Finally, export a CFGFILE_SRC variable for each of the deps + # This should make each respective "mission_build" create a wrapper + # that points directly at this global file, ignoring the default + if (MISSION_GLOBAL_TOPICID_HEADERFILE) + + set (OUTPUT_VAR_LIST) + + # Slight inconsistency: for CFE core components, the cfe_ prefix is omitted in DEP_NAME + # To make this work without major impact, add it back in here + foreach(DEP_NAME ${MISSION_CORE_MODULES}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_cfe_${DEP_NAME}_topicids) + endforeach(DEP_NAME ${MISSION_CORE_MODULES}) + + foreach(DEP_NAME ${MISSION_APPS}) + string(TOUPPER "${DEP_NAME}_CFGFILE_SRC" CFGSRC) + list(APPEND OUTPUT_VAR_LIST ${CFGSRC}_${DEP_NAME}_topicids) + endforeach(DEP_NAME ${MISSION_APPS}) + + # This is the actual export to parent scope + foreach(VAR_NAME ${OUTPUT_VAR_LIST}) + set(${VAR_NAME} ${MISSION_GLOBAL_TOPICID_HEADERFILE} PARENT_SCOPE) + endforeach(VAR_NAME ${OUTPUT_VAR_LIST}) + + endif (MISSION_GLOBAL_TOPICID_HEADERFILE) + +endfunction(setup_global_topicids) + ################################################################## # # FUNCTION: prepare @@ -348,6 +420,9 @@ function(prepare) add_dependencies(cfe-usersguide doc-prebuild) add_dependencies(mission-doc doc-prebuild) + # Set up the global topicid header file, if present + setup_global_topicids() + # Pull in any application-specific mission-scope configuration # This may include user configuration files such as cfe_mission_cfg.h, # msgid definitions, or any other configuration/preparation that needs to diff --git a/cmake/sample_defs/example_platform_cfg.h b/cmake/sample_defs/example_platform_cfg.h index c40f44e7d..d2de5d1de 100644 --- a/cmake/sample_defs/example_platform_cfg.h +++ b/cmake/sample_defs/example_platform_cfg.h @@ -16,26 +16,26 @@ * limitations under the License. ************************************************************************/ - /** +/** * @file * * This header file contains the internal configuration parameters and * typedefs with platform scope. - * + * * This provides default values for configurable items that do NOT affect * the interface(s) of this module. This includes internal parameters, * path names, and limit value(s) that are relevant for a specific platform. - * + * * @note It is no longer necessary to provide this file directly in the defs - * directory, but if present, this file is still supported/usable for backward + * directory, but if present, this file is still supported/usable for backward * compatibility. To use this file, is should be called "cfe_platform_cfg.h". - * + * * Going forward, more fine-grained (module/purposes-specific) header files are * included with each submodule. These may be overridden as necessary, but only * if a definition within that file needs to be changed from the default. This - * approach will reduce the amount of duplicate/cloned definitions and better + * approach will reduce the amount of duplicate/cloned definitions and better * support alternative build configurations in the future. - * + * * Note that if this file is present, the fine-grained header files noted above * will _not_ be used. */ @@ -83,7 +83,6 @@ */ #define CFE_PLATFORM_CORE_MAX_STARTUP_MSEC 30000 - /*******************************************************************************/ /* * CFE Executive Services (CFE_ES) Application Private Config Definitions diff --git a/modules/cfe_testcase/config/default_cfe_test_msgids.h b/modules/cfe_testcase/config/default_cfe_test_msgids.h index a4b41aa30..ba1a9a879 100644 --- a/modules/cfe_testcase/config/default_cfe_test_msgids.h +++ b/modules/cfe_testcase/config/default_cfe_test_msgids.h @@ -29,11 +29,11 @@ /* ** cFE Command Message Id's */ -#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TEST_CMD_MSG /* 0x1802 */ +#define CFE_TEST_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TEST_CMD_TOPICID) /* 0x1802 */ /* ** CFE Telemetry Message Id's */ -#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TEST_HK_TLM_MSG /* 0x0802 */ +#define CFE_TEST_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TEST_HK_TLM_TOPICID) /* 0x0802 */ #endif diff --git a/modules/cfe_testcase/config/default_cfe_test_topicids.h b/modules/cfe_testcase/config/default_cfe_test_topicids.h index 6ecca4fb5..4d90e525e 100644 --- a/modules/cfe_testcase/config/default_cfe_test_topicids.h +++ b/modules/cfe_testcase/config/default_cfe_test_topicids.h @@ -32,7 +32,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TEST_CMD_MSG 2 +#define CFE_MISSION_TEST_CMD_TOPICID 2 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -43,6 +43,6 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TEST_HK_TLM_MSG 2 +#define CFE_MISSION_TEST_HK_TLM_TOPICID 2 #endif diff --git a/modules/cfe_testcase/src/sb_subscription_test.c b/modules/cfe_testcase/src/sb_subscription_test.c index a55c73716..12cf51eb3 100644 --- a/modules/cfe_testcase/src/sb_subscription_test.c +++ b/modules/cfe_testcase/src/sb_subscription_test.c @@ -206,7 +206,7 @@ void TestSBMaxSubscriptions(void) while (NumSubs <= CFE_PLATFORM_SB_MAX_MSG_IDS) { /* fabricate a msgid to subscribe to (this may overlap real msgids) */ - TestMsgId = CFE_SB_ValueToMsgId(CFE_PLATFORM_CMD_MID_BASE + NumSubs); + TestMsgId = CFE_SB_ValueToMsgId(1 + NumSubs); Status = CFE_SB_Subscribe(TestMsgId, PipeId); if (Status != CFE_SUCCESS) diff --git a/modules/core_api/arch_build.cmake b/modules/core_api/arch_build.cmake index 738d770bd..be7d5edc3 100644 --- a/modules/core_api/arch_build.cmake +++ b/modules/core_api/arch_build.cmake @@ -9,17 +9,27 @@ ########################################################### # Generate the "cfe_platform_cfg.h" and "cfe_msgids.h" header files -# these must come from mission config +# these usually come from user config, but CFE provides defaults -generate_config_includefile( - FILE_NAME "cfe_msgids.h" - MATCH_SUFFIX "msgids.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_msgids.h" - PREFIXES ${BUILD_CONFIG} cfe +set(CORE_API_PLATFORM_CONFIG_FILE_LIST + cfe_core_api_base_msgids.h + cfe_msgids.h ) -generate_config_includefile( - FILE_NAME "cfe_core_api_base_msgids.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_core_api_base_msgids.h" - PREFIXES ${BUILD_CONFIG} -) +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(CORE_API_CFGFILE ${CORE_API_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${CORE_API_CFGFILE}" NAME_WE) + if (DEFINED CORE_API_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${CORE_API_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CORE_API_CFGFILE}") + endif() + + generate_config_includefile( + FILE_NAME "${CORE_API_CFGFILE}" + PREFIXES ${BUILD_CONFIG} cfe + ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/core_api/config/default_cfe_core_api_base_msgids.h b/modules/core_api/config/default_cfe_core_api_base_msgids.h index ffb8b6d62..f210d8c8b 100644 --- a/modules/core_api/config/default_cfe_core_api_base_msgids.h +++ b/modules/core_api/config/default_cfe_core_api_base_msgids.h @@ -19,9 +19,8 @@ /** * @file * - * Purpose: - * This header file contains the Message Id's for messages used by the - * cFE core. + * This header file contains the platform-specific base msg ID values and + * logic to convert a topic ID to a message ID value. * */ @@ -44,7 +43,7 @@ * of MIDs in the framework it will not scale so an alternative * method of deconfliction is recommended. */ -#define CFE_PLATFORM_CMD_MID_BASE 0x1800 +#define CFE_CPU1_CMD_MID_BASE 0x1800 /** * \brief Platform telemetry message ID base offset @@ -54,9 +53,9 @@ * 0x0000-0x007F since the command bit is 0x0080. Alternative * method of deconfliction is recommended. * - * See #CFE_PLATFORM_CMD_MID_BASE for more information + * See #CFE_CPU1_CMD_MID_BASE for more information */ -#define CFE_PLATFORM_TLM_MID_BASE 0x0800 +#define CFE_CPU1_TLM_MID_BASE 0x0800 /** * \brief "Global" command message ID base offset @@ -65,8 +64,65 @@ * 0x00E0 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080. * Works in limited cases only, alternative method of deconfliction * is recommended. - * See #CFE_PLATFORM_CMD_MID_BASE for more information + * See #CFE_CPU1_CMD_MID_BASE for more information */ -#define CFE_PLATFORM_CMD_MID_BASE_GLOB 0x1860 +#define CFE_GLOBAL_CMD_MID_BASE 0x1860 + +/** + * \brief "Global" telemetry message ID base offset + * + * 0x0860 - Nominal value for message ID V1 + * 0x0060 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080. + * Works in limited cases only, alternative method of deconfliction + * is recommended. + * See #CFE_CPU1_CMD_MID_BASE for more information + */ +#define CFE_GLOBAL_TLM_MID_BASE 0x0860 + +/** + * \brief Convert a command topic ID to a MsgID value + * + * This defines the logic to convert a topic ID value into a message ID value. + * This operates on integer values and should resolve at compile time such + * that it can be used in e.g. switch/case statements. + * + * \note The result of this conversion is a simple integer, thus also needs to + * go through CFE_SB_ValueToMsgId() to obtain a properly-typed CFE_SB_MsgId_t + * for interacting with SB APIs. + */ +#define CFE_PLATFORM_CMD_TOPICID_TO_MIDV(topic) (CFE_CPU1_CMD_MID_BASE | (topic)) + +/** + * \brief Convert a telemetry topic ID to a MsgID value + * + * This defines the logic to convert a topic ID value into a message ID value. + * This operates on integer values and should resolve at compile time such + * that it can be used in e.g. switch/case statements. + * + * \note The result of this conversion is a simple integer, thus also needs to + * go through CFE_SB_ValueToMsgId() to obtain a properly-typed CFE_SB_MsgId_t + * for interacting with SB APIs. + */ +#define CFE_PLATFORM_TLM_TOPICID_TO_MIDV(topic) (CFE_CPU1_TLM_MID_BASE | (topic)) + +/** + * \brief Convert a "global" command topic ID to a MsgID value + * + * A global command is one that is not specific to an individual instance of CFE, + * but rather intended to be broadcast to all CFE instances at the same time. + * + * This is otherwise identical to #CFE_PLATFORM_CMD_TOPICID_TO_MIDV + */ +#define CFE_GLOBAL_CMD_TOPICID_TO_MIDV(topic) (CFE_GLOBAL_CMD_MID_BASE | (topic)) + +/** + * \brief Convert a "global" telemetry topic ID to a MsgID value + * + * A global telemetry is one that is not specific to an individual instance of CFE, + * but rather intended to be broadcast to all CFE instances at the same time. + * + * This is otherwise identical to #CFE_PLATFORM_TLM_TOPICID_TO_MIDV + */ +#define CFE_GLOBAL_TLM_TOPICID_TO_MIDV(topic) (CFE_GLOBAL_TLM_MID_BASE | (topic)) #endif /* CFE_CORE_BASE_MSGIDS_H */ diff --git a/modules/core_api/mission_build.cmake b/modules/core_api/mission_build.cmake index 1139b1bc1..57f6a04af 100644 --- a/modules/core_api/mission_build.cmake +++ b/modules/core_api/mission_build.cmake @@ -9,23 +9,41 @@ ########################################################### # Generate the "cfe_mission_cfg.h" and "cfe_perfids.h" header files -# these must come from mission config -generate_config_includefile( - FILE_NAME "cfe_mission_cfg.h" - MATCH_SUFFIX "mission_cfg.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_mission_cfg.h" - PREFIXES ${MISSIONCONFIG} cfe -) +# these usually come from user config, but CFE provides defaults -generate_config_includefile( - FILE_NAME "cfe_perfids.h" - MATCH_SUFFIX "perfids.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_perfids.h" - PREFIXES ${MISSIONCONFIG} cfe +set(CORE_API_PLATFORM_CONFIG_FILE_LIST + cfe_core_api_interface_cfg.h + cfe_mission_cfg.h + cfe_perfids.h ) -generate_config_includefile( - FILE_NAME "cfe_core_api_interface_cfg.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_cfe_core_api_interface_cfg.h" - PREFIXES ${BUILD_CONFIG} -) +if (CFE_EDS_ENABLED_BUILD) + + # In an EDS-based build, these files come generated from the EDS tool + set(CORE_API_CFGFILE_SRC_cfe_core_api_interface_cfg "cfe_mission_eds_designparameters.h") + +endif(CFE_EDS_ENABLED_BUILD) + + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(CORE_API_CFGFILE ${CORE_API_PLATFORM_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${CORE_API_CFGFILE}" NAME_WE) + if (DEFINED CORE_API_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${CORE_API_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${CORE_API_CFGFILE}") + endif() + + # For backward compatibilty, strip off the leading "cfe_" and do a suffix match + # Other CFS apps don't do this, but this is a remnant of when the build system was first implemented + string(REPLACE "cfe_" "" SUFFIX ${CORE_API_CFGFILE}) + + generate_config_includefile( + FILE_NAME "${CORE_API_CFGFILE}" + MATCH_SUFFIX ${SUFFIX} + PREFIXES ${MISSIONCONFIG} cfe + ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/modules/es/arch_build.cmake b/modules/es/arch_build.cmake index 27403bd88..28707caa0 100644 --- a/modules/es/arch_build.cmake +++ b/modules/es/arch_build.cmake @@ -15,18 +15,21 @@ set(ES_PLATFORM_CONFIG_FILE_LIST cfe_es_platform_cfg.h ) +message("ES_CFGFILE_SRC_cfe_es_msgids = ${ES_CFGFILE_SRC_cfe_es_msgids}") + + # Create wrappers around the all the config header files # This makes them individually overridable by the missions, without modifying # the distribution default copies foreach(ES_CFGFILE ${ES_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${ES_CFGFILE}" NAME_WE) if (DEFINED ES_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${ES_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${ES_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${ES_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${ES_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/es/config/default_cfe_es_msgids.h b/modules/es/config/default_cfe_es_msgids.h index 9ee2bb252..cb442c326 100644 --- a/modules/es/config/default_cfe_es_msgids.h +++ b/modules/es/config/default_cfe_es_msgids.h @@ -29,14 +29,14 @@ /* ** cFE ES Command Message Id's */ -#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_CMD_MSG /* 0x1806 */ -#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_SEND_HK_MSG /* 0x1808 */ +#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_ES_CMD_TOPICID) /* 0x1806 */ +#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_ES_SEND_HK_TOPICID) /* 0x1808 */ /* ** CFE ES Telemetry Message Id's */ -#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_HK_TLM_MSG /* 0x0800 */ -#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_APP_TLM_MSG /* 0x080B */ -#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */ +#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_HK_TLM_TOPICID) /* 0x0800 */ +#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_APP_TLM_TOPICID) /* 0x080B */ +#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_ES_MEMSTATS_TLM_TOPICID) /* 0x0810 */ #endif diff --git a/modules/es/config/default_cfe_es_topicids.h b/modules/es/config/default_cfe_es_topicids.h index b45705c21..267411945 100644 --- a/modules/es/config/default_cfe_es_topicids.h +++ b/modules/es/config/default_cfe_es_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_ES_CMD_MSG 6 -#define CFE_MISSION_ES_SEND_HK_MSG 8 +#define CFE_MISSION_ES_CMD_TOPICID 6 +#define CFE_MISSION_ES_SEND_HK_TOPICID 8 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,8 +44,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_ES_HK_TLM_MSG 0 -#define CFE_MISSION_ES_APP_TLM_MSG 11 -#define CFE_MISSION_ES_MEMSTATS_TLM_MSG 16 +#define CFE_MISSION_ES_HK_TLM_TOPICID 0 +#define CFE_MISSION_ES_APP_TLM_TOPICID 11 +#define CFE_MISSION_ES_MEMSTATS_TLM_TOPICID 16 #endif diff --git a/modules/evs/arch_build.cmake b/modules/evs/arch_build.cmake index 63c50f8e2..0822defb0 100644 --- a/modules/evs/arch_build.cmake +++ b/modules/evs/arch_build.cmake @@ -21,12 +21,12 @@ set(EVS_PLATFORM_CONFIG_FILE_LIST foreach(EVS_CFGFILE ${EVS_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${EVS_CFGFILE}" NAME_WE) if (DEFINED EVS_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${EVS_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${EVS_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${EVS_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${EVS_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/evs/config/default_cfe_evs_msgids.h b/modules/evs/config/default_cfe_evs_msgids.h index 1d31ddb5b..2ee5292d3 100644 --- a/modules/evs/config/default_cfe_evs_msgids.h +++ b/modules/evs/config/default_cfe_evs_msgids.h @@ -29,14 +29,17 @@ /* ** cFE Command Message Id's */ -#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_CMD_MSG /* 0x1801 */ -#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_SEND_HK_MSG /* 0x1809 */ +#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_EVS_CMD_TOPICID) /* 0x1801 */ +#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_EVS_SEND_HK_TOPICID) /* 0x1809 */ /* ** CFE Telemetry Message Id's */ -#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_HK_TLM_MSG /* 0x0801 */ -#define CFE_EVS_LONG_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_LONG_EVENT_MSG_MSG /* 0x0808 */ -#define CFE_EVS_SHORT_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG /* 0x0809 */ +#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_HK_TLM_TOPICID) /* 0x0801 */ +#define CFE_EVS_LONG_EVENT_MSG_MID \ + CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_LONG_EVENT_MSG_TOPICID) /* 0x0808 \ + */ +#define CFE_EVS_SHORT_EVENT_MSG_MID \ + CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_EVS_SHORT_EVENT_MSG_TOPICID) /* 0x0809 */ #endif diff --git a/modules/evs/config/default_cfe_evs_topicids.h b/modules/evs/config/default_cfe_evs_topicids.h index 842758da0..f03aecb4f 100644 --- a/modules/evs/config/default_cfe_evs_topicids.h +++ b/modules/evs/config/default_cfe_evs_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_EVS_CMD_MSG 1 -#define CFE_MISSION_EVS_SEND_HK_MSG 9 +#define CFE_MISSION_EVS_CMD_TOPICID 1 +#define CFE_MISSION_EVS_SEND_HK_TOPICID 9 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,8 +44,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_EVS_HK_TLM_MSG 1 -#define CFE_MISSION_EVS_LONG_EVENT_MSG_MSG 8 -#define CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG 9 +#define CFE_MISSION_EVS_HK_TLM_TOPICID 1 +#define CFE_MISSION_EVS_LONG_EVENT_MSG_TOPICID 8 +#define CFE_MISSION_EVS_SHORT_EVENT_MSG_TOPICID 9 #endif diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 3308e2476..9c82c08cd 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -104,13 +104,13 @@ static const UT_TaskPipeDispatchId_t UT_TPID_CFE_EVS_CMD_INVALID_CC = { .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_CMD_MID), .CommandCode = 0x7F}; static const UT_TaskPipeDispatchId_t UT_TPID_CFE_EVS_SEND_HK = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SEND_HK_MID)}; -static const UT_SoftwareBusSnapshot_Entry_t UT_EVS_LONGFMT_SNAPSHOTDATA = { - .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID), +static UT_SoftwareBusSnapshot_Entry_t UT_EVS_LONGFMT_SNAPSHOTDATA = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(0), .SnapshotOffset = offsetof(CFE_EVS_LongEventTlm_t, Payload.PacketID.EventID), .SnapshotSize = sizeof(uint16)}; -static const UT_SoftwareBusSnapshot_Entry_t UT_EVS_SHORTFMT_SNAPSHOTDATA = { - .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SHORT_EVENT_MSG_MID), +static UT_SoftwareBusSnapshot_Entry_t UT_EVS_SHORTFMT_SNAPSHOTDATA = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(0), .SnapshotOffset = offsetof(CFE_EVS_ShortEventTlm_t, Payload.PacketID.EventID), .SnapshotSize = sizeof(uint16)}; @@ -140,6 +140,9 @@ void UT_InitData_EVS(void) { UT_InitData(); + UT_EVS_LONGFMT_SNAPSHOTDATA.MsgId = CFE_SB_MSGID_C(CFE_EVS_LONG_EVENT_MSG_MID); + UT_EVS_SHORTFMT_SNAPSHOTDATA.MsgId = CFE_SB_MSGID_C(CFE_EVS_SHORT_EVENT_MSG_MID); + UT_SetHandlerFunction(UT_KEY(CFE_MSG_GetMsgTime), UT_CFE_MSG_GetMsgTime_CustomHandler, NULL); } @@ -274,7 +277,7 @@ void Test_Init(void) { CFE_EVS_EnablePortsCmd_t bitmaskcmd; CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_SB_MsgId_t msgid = CFE_SB_INVALID_MSG_ID; + CFE_SB_MsgId_t msgid = CFE_SB_INVALID_MSG_ID; UtPrintf("Begin Test Init"); @@ -695,7 +698,7 @@ void Test_Format(void) CFE_TIME_SysTime_t time = {0, 0}; CFE_EVS_SetEventFormatModeCmd_t modecmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; CFE_EVS_PacketID_t CapturedMsg; UT_SoftwareBusSnapshot_Entry_t LongFmtSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID), .SnapshotBuffer = &CapturedMsg, @@ -821,7 +824,7 @@ void Test_Format(void) */ void Test_Ports(void) { - CFE_EVS_EnablePortsCmd_t bitmaskcmd; + CFE_EVS_EnablePortsCmd_t bitmaskcmd; UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; CFE_TIME_SysTime_t PacketTime; @@ -1074,9 +1077,9 @@ void Test_WriteApp(void) { union { - CFE_EVS_ResetCountersCmd_t ResetCountersCmd; - CFE_EVS_WriteAppDataFileCmd_t AppDataCmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_ResetCountersCmd_t ResetCountersCmd; + CFE_EVS_WriteAppDataFileCmd_t AppDataCmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; } CmdBuf; UtPrintf("Begin Test Write App"); @@ -1157,10 +1160,10 @@ void Test_WriteApp(void) */ void Test_BadAppCmd(void) { - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - CFE_EVS_AddEventFilterCmd_t appmaskcmd; - CFE_EVS_ResetFilterCmd_t appcmdcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + CFE_EVS_AddEventFilterCmd_t appmaskcmd; + CFE_EVS_ResetFilterCmd_t appcmdcmd; uint32 TestAppIndex; UtPrintf("Begin Test Bad App Command"); @@ -1425,11 +1428,11 @@ void Test_BadAppCmd(void) */ void Test_EventCmd(void) { - uint16 EventCount[4]; - CFE_EVS_EnablePortsCmd_t bitmaskcmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; + uint16 EventCount[4]; + CFE_EVS_EnablePortsCmd_t bitmaskcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; memset(&bitmaskcmd, 0, sizeof(bitmaskcmd)); @@ -1602,10 +1605,10 @@ void Test_EventCmd(void) void Test_FilterCmd(void) { int i; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - CFE_EVS_AddEventFilterCmd_t appmaskcmd; - CFE_EVS_ResetFilterCmd_t appcmdcmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + CFE_EVS_AddEventFilterCmd_t appmaskcmd; + CFE_EVS_ResetFilterCmd_t appcmdcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; UtPrintf("Begin Test Filter Command"); diff --git a/modules/sb/arch_build.cmake b/modules/sb/arch_build.cmake index 10f7372f0..57e38509e 100644 --- a/modules/sb/arch_build.cmake +++ b/modules/sb/arch_build.cmake @@ -21,12 +21,12 @@ set(SB_PLATFORM_CONFIG_FILE_LIST foreach(SB_CFGFILE ${SB_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${SB_CFGFILE}" NAME_WE) if (DEFINED SB_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${SB_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${SB_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SB_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${SB_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/sb/config/default_cfe_sb_msgids.h b/modules/sb/config/default_cfe_sb_msgids.h index 21fce9c10..338684d62 100644 --- a/modules/sb/config/default_cfe_sb_msgids.h +++ b/modules/sb/config/default_cfe_sb_msgids.h @@ -29,16 +29,16 @@ /* ** cFE Command Message Id's */ -#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_CMD_MSG /* 0x1803 */ -#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SEND_HK_MSG /* 0x180B */ -#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SUB_RPT_CTRL_MSG /* 0x180E */ +#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_CMD_TOPICID) /* 0x1803 */ +#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_SEND_HK_TOPICID) /* 0x180B */ +#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_SB_SUB_RPT_CTRL_TOPICID) /* 0x180E */ /* ** CFE Telemetry Message Id's */ -#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_HK_TLM_MSG /* 0x0803 */ -#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_STATS_TLM_MSG /* 0x080A */ -#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ALLSUBS_TLM_MSG /* 0x080D */ -#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */ +#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_HK_TLM_TOPICID) /* 0x0803 */ +#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_STATS_TLM_TOPICID) /* 0x080A */ +#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_ALLSUBS_TLM_TOPICID) /* 0x080D */ +#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_SB_ONESUB_TLM_TOPICID) /* 0x080E */ #endif diff --git a/modules/sb/config/default_cfe_sb_topicids.h b/modules/sb/config/default_cfe_sb_topicids.h index 3c3e7be37..1009385ca 100644 --- a/modules/sb/config/default_cfe_sb_topicids.h +++ b/modules/sb/config/default_cfe_sb_topicids.h @@ -32,9 +32,9 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_SB_CMD_MSG 3 -#define CFE_MISSION_SB_SEND_HK_MSG 11 -#define CFE_MISSION_SB_SUB_RPT_CTRL_MSG 14 +#define CFE_MISSION_SB_CMD_TOPICID 3 +#define CFE_MISSION_SB_SEND_HK_TOPICID 11 +#define CFE_MISSION_SB_SUB_RPT_CTRL_TOPICID 14 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -45,9 +45,9 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_SB_HK_TLM_MSG 3 -#define CFE_MISSION_SB_STATS_TLM_MSG 10 -#define CFE_MISSION_SB_ALLSUBS_TLM_MSG 13 -#define CFE_MISSION_SB_ONESUB_TLM_MSG 14 +#define CFE_MISSION_SB_HK_TLM_TOPICID 3 +#define CFE_MISSION_SB_STATS_TLM_TOPICID 10 +#define CFE_MISSION_SB_ALLSUBS_TLM_TOPICID 13 +#define CFE_MISSION_SB_ONESUB_TLM_TOPICID 14 #endif diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index 45e15fcf3..bf72d1055 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -79,8 +79,8 @@ typedef struct uint16 Tlm16Param2; } SB_UT_TstPktWoSecHdr_t; -#define SB_UT_CMD_MID_VALUE_BASE CFE_PLATFORM_CMD_MID_BASE + 1 -#define SB_UT_TLM_MID_VALUE_BASE CFE_PLATFORM_TLM_MID_BASE + 1 +#define SB_UT_CMD_MID_VALUE_BASE 0x100 +#define SB_UT_TLM_MID_VALUE_BASE 0x200 /* SB unit test functions */ /*****************************************************************************/ diff --git a/modules/tbl/arch_build.cmake b/modules/tbl/arch_build.cmake index 25495554c..40c771288 100644 --- a/modules/tbl/arch_build.cmake +++ b/modules/tbl/arch_build.cmake @@ -21,12 +21,12 @@ set(TBL_PLATFORM_CONFIG_FILE_LIST foreach(TBL_CFGFILE ${TBL_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${TBL_CFGFILE}" NAME_WE) if (DEFINED TBL_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${TBL_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${TBL_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${TBL_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/tbl/config/default_cfe_tbl_msgids.h b/modules/tbl/config/default_cfe_tbl_msgids.h index 58d492c9f..54b93261d 100644 --- a/modules/tbl/config/default_cfe_tbl_msgids.h +++ b/modules/tbl/config/default_cfe_tbl_msgids.h @@ -29,13 +29,13 @@ /* ** cFE Command Message Id's */ -#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_CMD_MSG /* 0x1804 */ -#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_SEND_HK_MSG /* 0x180C */ +#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TBL_CMD_TOPICID) /* 0x1804 */ +#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TBL_SEND_HK_TOPICID) /* 0x180C */ /* ** CFE Telemetry Message Id's */ -#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_HK_TLM_MSG /* 0x0804 */ -#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_REG_TLM_MSG /* 0x080C */ +#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TBL_HK_TLM_TOPICID) /* 0x0804 */ +#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TBL_REG_TLM_TOPICID) /* 0x080C */ #endif diff --git a/modules/tbl/config/default_cfe_tbl_topicids.h b/modules/tbl/config/default_cfe_tbl_topicids.h index 207cff719..03b285fa5 100644 --- a/modules/tbl/config/default_cfe_tbl_topicids.h +++ b/modules/tbl/config/default_cfe_tbl_topicids.h @@ -32,8 +32,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TBL_CMD_MSG 4 -#define CFE_MISSION_TBL_SEND_HK_MSG 12 +#define CFE_MISSION_TBL_CMD_TOPICID 4 +#define CFE_MISSION_TBL_SEND_HK_TOPICID 12 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -44,7 +44,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TBL_HK_TLM_MSG 4 -#define CFE_MISSION_TBL_REG_TLM_MSG 12 +#define CFE_MISSION_TBL_HK_TLM_TOPICID 4 +#define CFE_MISSION_TBL_REG_TLM_TOPICID 12 #endif diff --git a/modules/time/arch_build.cmake b/modules/time/arch_build.cmake index 534ca265f..14cf68ead 100644 --- a/modules/time/arch_build.cmake +++ b/modules/time/arch_build.cmake @@ -21,12 +21,12 @@ set(TIME_PLATFORM_CONFIG_FILE_LIST foreach(TIME_CFGFILE ${TIME_PLATFORM_CONFIG_FILE_LIST}) get_filename_component(CFGKEY "${TIME_CFGFILE}" NAME_WE) if (DEFINED TIME_CFGFILE_SRC_${CFGKEY}) - set(DEFAULT_SOURCE "${TIME_CFGFILE_SRC_${CFGKEY}}") + set(DEFAULT_SOURCE GENERATED_FILE "${TIME_CFGFILE_SRC_${CFGKEY}}") else() - set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TIME_CFGFILE}") + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TIME_CFGFILE}") endif() generate_config_includefile( FILE_NAME "${TIME_CFGFILE}" - FALLBACK_FILE ${DEFAULT_SOURCE} + ${DEFAULT_SOURCE} ) endforeach() diff --git a/modules/time/config/default_cfe_time_msgids.h b/modules/time/config/default_cfe_time_msgids.h index b2ef0aa32..cfaed989f 100644 --- a/modules/time/config/default_cfe_time_msgids.h +++ b/modules/time/config/default_cfe_time_msgids.h @@ -29,21 +29,21 @@ /* ** cFE Command Message Id's */ -#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_CMD_MSG /* 0x1805 */ -#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_SEND_HK_MSG /* 0x180D */ -#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_TONE_CMD_MSG /* 0x1810 */ -#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_1HZ_CMD_MSG /* 0x1811 */ +#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_CMD_TOPICID) /* 0x1805 */ +#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_SEND_HK_TOPICID) /* 0x180D */ +#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_TONE_CMD_TOPICID) /* 0x1810 */ +#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_1HZ_CMD_TOPICID) /* 0x1811 */ /* ** cFE Global Command Message Id's */ -#define CFE_TIME_DATA_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_DATA_CMD_MSG /* 0x1860 */ -#define CFE_TIME_SEND_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_SEND_CMD_MSG /* 0x1862 */ +#define CFE_TIME_DATA_CMD_MID CFE_GLOBAL_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_DATA_CMD_TOPICID) /* 0x1860 */ +#define CFE_TIME_SEND_CMD_MID CFE_GLOBAL_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_SEND_CMD_TOPICID) /* 0x1862 */ /* ** CFE Telemetry Message Id's */ -#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_HK_TLM_MSG /* 0x0805 */ -#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_DIAG_TLM_MSG /* 0x0806 */ +#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TIME_HK_TLM_TOPICID) /* 0x0805 */ +#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TIME_DIAG_TLM_TOPICID) /* 0x0806 */ #endif diff --git a/modules/time/config/default_cfe_time_topicids.h b/modules/time/config/default_cfe_time_topicids.h index a3c2ec1ef..964b39f27 100644 --- a/modules/time/config/default_cfe_time_topicids.h +++ b/modules/time/config/default_cfe_time_topicids.h @@ -32,10 +32,10 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_CMD_MSG 5 -#define CFE_MISSION_TIME_SEND_HK_MSG 13 -#define CFE_MISSION_TIME_TONE_CMD_MSG 16 -#define CFE_MISSION_TIME_1HZ_CMD_MSG 17 +#define CFE_MISSION_TIME_CMD_TOPICID 5 +#define CFE_MISSION_TIME_SEND_HK_TOPICID 13 +#define CFE_MISSION_TIME_TONE_CMD_TOPICID 16 +#define CFE_MISSION_TIME_1HZ_CMD_TOPICID 17 /** ** \cfemissioncfg cFE Portable Message Numbers for Global Messages @@ -46,8 +46,8 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_DATA_CMD_MSG 0 -#define CFE_MISSION_TIME_SEND_CMD_MSG 2 +#define CFE_MISSION_TIME_DATA_CMD_TOPICID 0 +#define CFE_MISSION_TIME_SEND_CMD_TOPICID 2 /** ** \cfemissioncfg cFE Portable Message Numbers for Telemetry @@ -58,7 +58,7 @@ ** \par Limits ** Not Applicable */ -#define CFE_MISSION_TIME_HK_TLM_MSG 5 -#define CFE_MISSION_TIME_DIAG_TLM_MSG 6 +#define CFE_MISSION_TIME_HK_TLM_TOPICID 5 +#define CFE_MISSION_TIME_DIAG_TLM_TOPICID 6 #endif From 1d6a7611a1ea7954734f37454a8ab3da3cfcdab7 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 7 Dec 2023 08:51:55 -0500 Subject: [PATCH 4/6] Fix #2475, rename 1HZ to ONEHZ in symbols This avoids having an identifier that starts with a digit in the case that the CFE_TIME_ prefix is not needed/used. --- cmake/sample_defs/example_platform_cfg.h | 5 ++- docs/src/cfe_time.dox | 4 +-- .../time/config/default_cfe_time_fcncodes.h | 22 ++++++------ .../config/default_cfe_time_internal_cfg.h | 4 +-- modules/time/config/default_cfe_time_msgids.h | 11 +++++- .../time/config/default_cfe_time_topicids.h | 2 +- modules/time/eds/cfe_time.xml | 8 ++--- modules/time/fsw/inc/cfe_time_eventids.h | 12 +++---- modules/time/fsw/src/cfe_time_dispatch.c | 6 ++-- modules/time/fsw/src/cfe_time_task.c | 16 ++++----- modules/time/fsw/src/cfe_time_utils.c | 2 +- modules/time/fsw/src/cfe_time_utils.h | 16 ++++----- modules/time/fsw/src/cfe_time_verify.h | 12 +++---- modules/time/ut-coverage/time_UT.c | 36 +++++++++---------- 14 files changed, 82 insertions(+), 74 deletions(-) diff --git a/cmake/sample_defs/example_platform_cfg.h b/cmake/sample_defs/example_platform_cfg.h index d2de5d1de..5e2d6d278 100644 --- a/cmake/sample_defs/example_platform_cfg.h +++ b/cmake/sample_defs/example_platform_cfg.h @@ -1725,7 +1725,7 @@ */ #define CFE_PLATFORM_TIME_START_TASK_PRIORITY 60 #define CFE_PLATFORM_TIME_TONE_TASK_PRIORITY 25 -#define CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY 25 +#define CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY 25 /** ** \cfetimecfg Define TIME Task Stack Sizes @@ -1744,7 +1744,6 @@ */ #define CFE_PLATFORM_TIME_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE #define CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE 4096 -#define CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE 8192 +#define CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE 8192 #endif /* EXAMPLE_PLATFORM_CFG_H */ - diff --git a/docs/src/cfe_time.dox b/docs/src/cfe_time.dox index 1f16a05cb..773cc46c4 100644 --- a/docs/src/cfe_time.dox +++ b/docs/src/cfe_time.dox @@ -657,7 +657,7 @@ TIME provides the ability to command a one time adjustment (#CFE_TIME_ADD_ADJUST_CC and #CFE_TIME_SUB_ADJUST_CC) to the current STCF. In addition there is a 1Hz adjustment - (#CFE_TIME_ADD_1HZ_ADJUSTMENT_CC and #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC) + (#CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC and #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC) that can be made to the STCF to compensate for oscillator drift. Mission specific ground correlation should be used to assist in determining the proper values to use. The Leap Seconds should be @@ -671,7 +671,7 @@ to by the other systems. \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_SET_STCF_CC, - #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC, #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC, #CFE_TIME_SET_LEAP_SECONDS_CC + #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC, #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC, #CFE_TIME_SET_LEAP_SECONDS_CC **/ diff --git a/modules/time/config/default_cfe_time_fcncodes.h b/modules/time/config/default_cfe_time_fcncodes.h index 6fe06e1f8..4b396f173 100644 --- a/modules/time/config/default_cfe_time_fcncodes.h +++ b/modules/time/config/default_cfe_time_fcncodes.h @@ -515,8 +515,8 @@ ** Inappropriately setting the clock may result in other sub-systems performing incorrect ** time based calculations. The specific risk is dependent upon the behavior of those sub-systems. ** -** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC, -*#CFE_TIME_SUB_1HZ_ADJUSTMENT_CC +** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC, +*#CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC */ #define CFE_TIME_ADD_ADJUST_CC 11 /* add one time STCF adjustment */ @@ -550,7 +550,7 @@ ** Inappropriately setting the clock may result in other sub-systems performing incorrect ** time based calculations. The specific risk is dependent upon the behavior of those sub-systems. ** -** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC, #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC +** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC, #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC */ #define CFE_TIME_SUB_ADJUST_CC 12 /* subtract one time STCF adjustment */ @@ -584,21 +584,21 @@ ** - \b \c \TIME_CMDPC - command execution counter will increment ** - \b \c \TIME_STCFSECS - Housekeeping Telemetry point indicating new STCF seconds value ** - \b \c \TIME_STCFSUBSECS - Housekeeping Telemetry point indicating new STCF subseconds value -** - The #CFE_TIME_1HZ_EID informational event message will be generated +** - The #CFE_TIME_ONEHZ_EID informational event message will be generated ** ** \par Error Conditions ** - Platform receiving the command is not a Time Server **

Evidence of Failure may be found in the following telemetry: ** - \b \c \TIME_CMDEC - command error counter will increment -** - Error specific event message will be issued (#CFE_TIME_1HZ_CFG_EID) +** - Error specific event message will be issued (#CFE_TIME_ONEHZ_CFG_EID) ** ** \par Criticality ** Inappropriately setting the clock may result in other sub-systems performing incorrect ** time based calculations. The specific risk is dependent upon the behavior of those sub-systems. ** -** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC +** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC */ -#define CFE_TIME_ADD_1HZ_ADJUSTMENT_CC 13 /* add 1Hz STCF adjustment */ +#define CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC 13 /* add 1Hz STCF adjustment */ /** \cfetimecmd Subtract Delta from Spacecraft Time Correlation Factor each 1Hz ** @@ -632,21 +632,21 @@ ** - \b \c \TIME_CMDPC - command execution counter will increment ** - \b \c \TIME_STCFSECS - Housekeeping Telemetry point indicating new STCF seconds value ** - \b \c \TIME_STCFSUBSECS - Housekeeping Telemetry point indicating new STCF subseconds value -** - The #CFE_TIME_1HZ_EID informational event message will be generated +** - The #CFE_TIME_ONEHZ_EID informational event message will be generated ** ** \par Error Conditions ** - Platform receiving the command is not a Time Server **

Evidence of Failure may be found in the following telemetry: ** - \b \c \TIME_CMDEC - command error counter will increment -** - Error specific event message will be issued (#CFE_TIME_1HZ_CFG_EID) +** - Error specific event message will be issued (#CFE_TIME_ONEHZ_CFG_EID) ** ** \par Criticality ** Inappropriately setting the clock may result in other sub-systems performing incorrect ** time based calculations. The specific risk is dependent upon the behavior of those sub-systems. ** -** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC +** \sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC */ -#define CFE_TIME_SUB_1HZ_ADJUSTMENT_CC 14 /* subtract 1Hz STCF adjustment */ +#define CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC 14 /* subtract 1Hz STCF adjustment */ /** \cfetimecmd Set Tone Signal Source ** diff --git a/modules/time/config/default_cfe_time_internal_cfg.h b/modules/time/config/default_cfe_time_internal_cfg.h index 3d284a24c..f00c25e7c 100644 --- a/modules/time/config/default_cfe_time_internal_cfg.h +++ b/modules/time/config/default_cfe_time_internal_cfg.h @@ -219,7 +219,7 @@ */ #define CFE_PLATFORM_TIME_START_TASK_PRIORITY 60 #define CFE_PLATFORM_TIME_TONE_TASK_PRIORITY 25 -#define CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY 25 +#define CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY 25 /** ** \cfetimecfg Define TIME Task Stack Sizes @@ -238,6 +238,6 @@ */ #define CFE_PLATFORM_TIME_START_TASK_STACK_SIZE CFE_PLATFORM_ES_DEFAULT_STACK_SIZE #define CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE 4096 -#define CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE 8192 +#define CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE 8192 #endif diff --git a/modules/time/config/default_cfe_time_msgids.h b/modules/time/config/default_cfe_time_msgids.h index cfaed989f..4421c4836 100644 --- a/modules/time/config/default_cfe_time_msgids.h +++ b/modules/time/config/default_cfe_time_msgids.h @@ -32,7 +32,7 @@ #define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_CMD_TOPICID) /* 0x1805 */ #define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_SEND_HK_TOPICID) /* 0x180D */ #define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_TONE_CMD_TOPICID) /* 0x1810 */ -#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_1HZ_CMD_TOPICID) /* 0x1811 */ +#define CFE_TIME_ONEHZ_CMD_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(CFE_MISSION_TIME_ONEHZ_CMD_TOPICID) /* 0x1811 */ /* ** cFE Global Command Message Id's @@ -46,4 +46,13 @@ #define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TIME_HK_TLM_TOPICID) /* 0x0805 */ #define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_TOPICID_TO_MIDV(CFE_MISSION_TIME_DIAG_TLM_TOPICID) /* 0x0806 */ +#ifndef CFE_OMIT_DEPRECATED +/* + * This name was changed/deprecated because technically it constitutes an + * identifier that starts with a digit (1) when the CFE_TIME_ namespace + * qualifier is removed. This matters in some circumstances. + */ +#define CFE_TIME_1HZ_CMD_MID CFE_TIME_ONEHZ_CMD_MID +#endif + #endif diff --git a/modules/time/config/default_cfe_time_topicids.h b/modules/time/config/default_cfe_time_topicids.h index 964b39f27..96b165d57 100644 --- a/modules/time/config/default_cfe_time_topicids.h +++ b/modules/time/config/default_cfe_time_topicids.h @@ -35,7 +35,7 @@ #define CFE_MISSION_TIME_CMD_TOPICID 5 #define CFE_MISSION_TIME_SEND_HK_TOPICID 13 #define CFE_MISSION_TIME_TONE_CMD_TOPICID 16 -#define CFE_MISSION_TIME_1HZ_CMD_TOPICID 17 +#define CFE_MISSION_TIME_ONEHZ_CMD_TOPICID 17 /** ** \cfemissioncfg cFE Portable Message Numbers for Global Messages diff --git a/modules/time/eds/cfe_time.xml b/modules/time/eds/cfe_time.xml index 5a3536b87..f26994629 100644 --- a/modules/time/eds/cfe_time.xml +++ b/modules/time/eds/cfe_time.xml @@ -1126,14 +1126,14 @@ - \b \c \TIME_CMDPC - command execution counter will increment - \b \c \TIME_STCFSECS - Housekeeping Telemetry point indicating new STCF seconds value - \b \c \TIME_STCFSUBSECS - Housekeeping Telemetry point indicating new STCF subseconds value - - The #CFE_TIME_1HZ_EID informational event message will be generated + - The #CFE_TIME_ONEHZ_EID informational event message will be generated \par Error Conditions - Platform receiving the command is not a Time Server Evidence of Failure may be found in the following telemetry: - \b \c \TIME_CMDEC - command error counter will increment - - Error specific event message will be issued (#CFE_TIME_1HZ_CFG_EID) + - Error specific event message will be issued (#CFE_TIME_ONEHZ_CFG_EID) \par Criticality Inappropriately setting the clock may result in other sub-systems performing incorrect @@ -1182,14 +1182,14 @@ - \b \c \TIME_CMDPC - command execution counter will increment - \b \c \TIME_STCFSECS - Housekeeping Telemetry point indicating new STCF seconds value - \b \c \TIME_STCFSUBSECS - Housekeeping Telemetry point indicating new STCF subseconds value - - The #CFE_TIME_1HZ_EID informational event message will be generated + - The #CFE_TIME_ONEHZ_EID informational event message will be generated \par Error Conditions - Platform receiving the command is not a Time Server Evidence of Failure may be found in the following telemetry: - \b \c \TIME_CMDEC - command error counter will increment - - Error specific event message will be issued (#CFE_TIME_1HZ_CFG_EID) + - Error specific event message will be issued (#CFE_TIME_ONEHZ_CFG_EID) \par Criticality Inappropriately setting the clock may result in other sub-systems performing incorrect diff --git a/modules/time/fsw/inc/cfe_time_eventids.h b/modules/time/fsw/inc/cfe_time_eventids.h index 9ea5eb239..5a91add9e 100644 --- a/modules/time/fsw/inc/cfe_time_eventids.h +++ b/modules/time/fsw/inc/cfe_time_eventids.h @@ -171,10 +171,10 @@ * * \par Cause: * - * \link #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC TIME Add STCF Adjustment Each Second Command \endlink OR - * \link #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC TIME Subtract STCF Adjustment Each Second Command \endlink success. + * \link #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC TIME Add STCF Adjustment Each Second Command \endlink OR + * \link #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC TIME Subtract STCF Adjustment Each Second Command \endlink success. */ -#define CFE_TIME_1HZ_EID 16 +#define CFE_TIME_ONEHZ_EID 16 /** * \brief TIME Set Leap Seconds Command Success Event ID @@ -431,11 +431,11 @@ * * \par Cause: * - * \link #CFE_TIME_ADD_1HZ_ADJUSTMENT_CC TIME Add STCF Adjustment Each Second Command \endlink OR - * \link #CFE_TIME_SUB_1HZ_ADJUSTMENT_CC TIME Subtract STCF Adjustment Each Second Command \endlink + * \link #CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC TIME Add STCF Adjustment Each Second Command \endlink OR + * \link #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC TIME Subtract STCF Adjustment Each Second Command \endlink * failure due to being in an incompatible mode. */ -#define CFE_TIME_1HZ_CFG_EID 48 +#define CFE_TIME_ONEHZ_CFG_EID 48 /** * \brief TIME Invalid Command Length Event ID diff --git a/modules/time/fsw/src/cfe_time_dispatch.c b/modules/time/fsw/src/cfe_time_dispatch.c index fcd6e08fd..758200293 100644 --- a/modules/time/fsw/src/cfe_time_dispatch.c +++ b/modules/time/fsw/src/cfe_time_dispatch.c @@ -101,7 +101,7 @@ void CFE_TIME_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) /* ** Run time state machine at 1Hz... */ - case CFE_TIME_1HZ_CMD_MID: + case CFE_TIME_ONEHZ_CMD_MID: CFE_TIME_OneHzCmd((const CFE_TIME_1HzCmd_t *)SBBufPtr); break; @@ -226,14 +226,14 @@ void CFE_TIME_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) } break; - case CFE_TIME_ADD_1HZ_ADJUSTMENT_CC: + case CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC: if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Add1HZAdjustmentCmd_t))) { CFE_TIME_Add1HZAdjustmentCmd((const CFE_TIME_Add1HZAdjustmentCmd_t *)SBBufPtr); } break; - case CFE_TIME_SUB_1HZ_ADJUSTMENT_CC: + case CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC: if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Sub1HZAdjustmentCmd_t))) { CFE_TIME_Sub1HZAdjustmentCmd((const CFE_TIME_Sub1HZAdjustmentCmd_t *)SBBufPtr); diff --git a/modules/time/fsw/src/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c index f392e6627..2453a5044 100644 --- a/modules/time/fsw/src/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -143,7 +143,7 @@ int32 CFE_TIME_TaskInit(void) return CFE_STATUS_EXTERNAL_RESOURCE_FAIL; } - OsStatus = OS_BinSemCreate(&CFE_TIME_Global.LocalSemaphore, CFE_TIME_SEM_1HZ_NAME, CFE_TIME_SEM_VALUE, + OsStatus = OS_BinSemCreate(&CFE_TIME_Global.LocalSemaphore, CFE_TIME_SEM_ONEHZ_NAME, CFE_TIME_SEM_VALUE, CFE_TIME_SEM_OPTIONS); if (OsStatus != OS_SUCCESS) { @@ -160,9 +160,9 @@ int32 CFE_TIME_TaskInit(void) return Status; } - Status = CFE_ES_CreateChildTask(&CFE_TIME_Global.LocalTaskID, CFE_TIME_TASK_1HZ_NAME, CFE_TIME_Local1HzTask, - CFE_TIME_TASK_STACK_PTR, CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE, - CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY, CFE_TIME_TASK_FLAGS); + Status = CFE_ES_CreateChildTask(&CFE_TIME_Global.LocalTaskID, CFE_TIME_TASK_ONEHZ_NAME, CFE_TIME_Local1HzTask, + CFE_TIME_TASK_STACK_PTR, CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE, + CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY, CFE_TIME_TASK_FLAGS); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("%s: Error creating local 1Hz child task:RC=0x%08X\n", __func__, (unsigned int)Status); @@ -221,11 +221,11 @@ int32 CFE_TIME_TaskInit(void) ** Subscribe to 1Hz signal commands... */ #if (CFE_PLATFORM_TIME_CFG_CLIENT == true) - Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), CFE_TIME_Global.CmdPipe); + Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_TIME_ONEHZ_CMD_MID), CFE_TIME_Global.CmdPipe); #endif #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), CFE_TIME_Global.CmdPipe, + Status = CFE_SB_SubscribeLocal(CFE_SB_ValueToMsgId(CFE_TIME_ONEHZ_CMD_MID), CFE_TIME_Global.CmdPipe, CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT); #endif @@ -1051,7 +1051,7 @@ void CFE_TIME_1HzAdjImpl(const CFE_TIME_OneHzAdjustmentCmd_Payload_t *CommandPtr CFE_TIME_Set1HzAdj(Adjust, Direction); CFE_TIME_Global.CommandCounter++; - CFE_EVS_SendEvent(CFE_TIME_1HZ_EID, CFE_EVS_EventType_INFORMATION, + CFE_EVS_SendEvent(CFE_TIME_ONEHZ_EID, CFE_EVS_EventType_INFORMATION, "STCF 1Hz Adjust -- secs = %d, ssecs = 0x%X, dir[1=Pos, 2=Neg] = %d", (int)CommandPtr->Seconds, (unsigned int)CommandPtr->Subseconds, (int)Direction); @@ -1061,7 +1061,7 @@ void CFE_TIME_1HzAdjImpl(const CFE_TIME_OneHzAdjustmentCmd_Payload_t *CommandPtr */ CFE_TIME_Global.CommandErrorCounter++; - CFE_EVS_SendEvent(CFE_TIME_1HZ_CFG_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(CFE_TIME_ONEHZ_CFG_EID, CFE_EVS_EventType_ERROR, "1Hz Adjust commands invalid without CFE_PLATFORM_TIME_CFG_SERVER set to TRUE"); #endif /* CFE_PLATFORM_TIME_CFG_SERVER */ diff --git a/modules/time/fsw/src/cfe_time_utils.c b/modules/time/fsw/src/cfe_time_utils.c index d0cdb3bc5..b0719d8ec 100644 --- a/modules/time/fsw/src/cfe_time_utils.c +++ b/modules/time/fsw/src/cfe_time_utils.c @@ -351,7 +351,7 @@ void CFE_TIME_InitData(void) /* ** Initialize local 1Hz "wake-up" command packet (optional)... */ - CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.Local1HzCmd.CommandHeader), CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), + CFE_MSG_Init(CFE_MSG_PTR(CFE_TIME_Global.Local1HzCmd.CommandHeader), CFE_SB_ValueToMsgId(CFE_TIME_ONEHZ_CMD_MID), sizeof(CFE_TIME_Global.Local1HzCmd)); } diff --git a/modules/time/fsw/src/cfe_time_utils.h b/modules/time/fsw/src/cfe_time_utils.h index 8c9502bac..31ef1283b 100644 --- a/modules/time/fsw/src/cfe_time_utils.h +++ b/modules/time/fsw/src/cfe_time_utils.h @@ -49,18 +49,18 @@ /* ** Interrupt task definitions... */ -#define CFE_TIME_TASK_TONE_NAME "TIME_TONE_TASK" -#define CFE_TIME_TASK_1HZ_NAME "TIME_1HZ_TASK" -#define CFE_TIME_TASK_STACK_PTR CFE_ES_TASK_STACK_ALLOCATE -#define CFE_TIME_TASK_FLAGS 0 +#define CFE_TIME_TASK_TONE_NAME "TIME_TONE_TASK" +#define CFE_TIME_TASK_ONEHZ_NAME "TIME_ONEHZ_TASK" +#define CFE_TIME_TASK_STACK_PTR CFE_ES_TASK_STACK_ALLOCATE +#define CFE_TIME_TASK_FLAGS 0 /* ** Interrupt semaphore definitions... */ -#define CFE_TIME_SEM_TONE_NAME "TIME_TONE_SEM" -#define CFE_TIME_SEM_1HZ_NAME "TIME_1HZ_SEM" -#define CFE_TIME_SEM_VALUE 0 -#define CFE_TIME_SEM_OPTIONS 0 +#define CFE_TIME_SEM_TONE_NAME "TIME_TONE_SEM" +#define CFE_TIME_SEM_ONEHZ_NAME "TIME_ONEHZ_SEM" +#define CFE_TIME_SEM_VALUE 0 +#define CFE_TIME_SEM_OPTIONS 0 /* ** Main Task Pipe definitions... diff --git a/modules/time/fsw/src/cfe_time_verify.h b/modules/time/fsw/src/cfe_time_verify.h index c8602fc9f..f0edc8416 100644 --- a/modules/time/fsw/src/cfe_time_verify.h +++ b/modules/time/fsw/src/cfe_time_verify.h @@ -159,10 +159,10 @@ #elif CFE_PLATFORM_TIME_TONE_TASK_PRIORITY > 255 #error CFE_PLATFORM_TIME_TONE_TASK_PRIORITY must be less than or equal to 255 #endif -#if CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY < 0 -#error CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY must be greater than or equal to zero -#elif CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY > 255 -#error CFE_PLATFORM_TIME_1HZ_TASK_PRIORITY must be less than or equal to 255 +#if CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY < 0 +#error CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY must be greater than or equal to zero +#elif CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY > 255 +#error CFE_PLATFORM_TIME_ONEHZ_TASK_PRIORITY must be less than or equal to 255 #endif /* @@ -176,8 +176,8 @@ #error CFE_PLATFORM_TIME_TONE_TASK_STACK_SIZE must be greater than or equal to 2048 #endif -#if CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE < 2048 -#error CFE_PLATFORM_TIME_1HZ_TASK_STACK_SIZE must be greater than or equal to 2048 +#if CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE < 2048 +#error CFE_PLATFORM_TIME_ONEHZ_TASK_STACK_SIZE must be greater than or equal to 2048 #endif /*************************************************************************/ diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index bdfdbeae3..c82993556 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -49,14 +49,14 @@ const char *TIME_SYSLOG_MSGS[] = {NULL, "%s: Application Init Failed,RC=0x%08X\n", "%s: Failed invalid arguments\n"}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_SEND_HK = {.MsgId = +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_SEND_HK = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_SEND_HK_MID)}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_TONE_CMD = {.MsgId = +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_TONE_CMD = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_TONE_CMD_MID)}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_DATA_CMD = {.MsgId = +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_DATA_CMD = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_DATA_CMD_MID)}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_1HZ_CMD = {.MsgId = - CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_1HZ_CMD_MID)}; +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_ONEHZ_CMD = {.MsgId = + CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_ONEHZ_CMD_MID)}; #if (CFE_PLATFORM_TIME_CFG_SERVER == true) static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_SEND_CMD = {.MsgId = @@ -91,10 +91,10 @@ static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_ADD_ADJUST_CC = { .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_ADD_ADJUST_CC}; static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_SUB_ADJUST_CC = { .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_SUB_ADJUST_CC}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_ADD_1HZ_ADJUSTMENT_CC = { - .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_ADD_1HZ_ADJUSTMENT_CC}; -static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_SUB_1HZ_ADJUSTMENT_CC = { - .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_SUB_1HZ_ADJUSTMENT_CC}; +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_ADD_ONEHZ_ADJUSTMENT_CC = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC}; +static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_SUB_ONEHZ_ADJUSTMENT_CC = { + .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC}; static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_INVALID_MID = {.MsgId = CFE_SB_MSGID_RESERVED, .CommandCode = 0}; static const UT_TaskPipeDispatchId_t UT_TPID_CFE_TIME_CMD_INVALID_CC = { .MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_CMD_MID), .CommandCode = 0x7F}; @@ -1799,14 +1799,14 @@ void Test_PipeCmds(void) CFE_TIME_Global.CommandCounter = 0; CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, sizeof(CmdBuf.add1hzadjcmd), - UT_TPID_CFE_TIME_CMD_ADD_1HZ_ADJUSTMENT_CC); + UT_TPID_CFE_TIME_CMD_ADD_ONEHZ_ADJUSTMENT_CC); #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - CFE_UtAssert_EVENTSENT(CFE_TIME_1HZ_EID); + CFE_UtAssert_EVENTSENT(CFE_TIME_ONEHZ_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 1); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 0); #else - CFE_UtAssert_EVENTSENT(CFE_TIME_1HZ_CFG_EID); + CFE_UtAssert_EVENTSENT(CFE_TIME_ONEHZ_CFG_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); #endif @@ -1816,7 +1816,7 @@ void Test_PipeCmds(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); CFE_TIME_Global.CommandCounter = 0; CFE_TIME_Global.CommandErrorCounter = 0; - UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_ADD_1HZ_ADJUSTMENT_CC); + UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_ADD_ONEHZ_ADJUSTMENT_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); @@ -1827,14 +1827,14 @@ void Test_PipeCmds(void) CFE_TIME_Global.CommandCounter = 0; CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, sizeof(CmdBuf.sub1hzadjcmd), - UT_TPID_CFE_TIME_CMD_SUB_1HZ_ADJUSTMENT_CC); + UT_TPID_CFE_TIME_CMD_SUB_ONEHZ_ADJUSTMENT_CC); #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - CFE_UtAssert_EVENTSENT(CFE_TIME_1HZ_EID); + CFE_UtAssert_EVENTSENT(CFE_TIME_ONEHZ_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 1); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 0); #else - CFE_UtAssert_EVENTSENT(CFE_TIME_1HZ_CFG_EID); + CFE_UtAssert_EVENTSENT(CFE_TIME_ONEHZ_CFG_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); #endif @@ -1844,7 +1844,7 @@ void Test_PipeCmds(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); CFE_TIME_Global.CommandCounter = 0; CFE_TIME_Global.CommandErrorCounter = 0; - UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SUB_1HZ_ADJUSTMENT_CC); + UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SUB_ONEHZ_ADJUSTMENT_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); @@ -1929,7 +1929,7 @@ void Test_PipeCmds(void) /* In the 1Hz state machine it should call PSP GetTime as part, of latching the clock. This is tested only to see that the latch executed. */ UT_InitData(); - UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, sizeof(CmdBuf.onehzcmd), UT_TPID_CFE_TIME_1HZ_CMD); + UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, sizeof(CmdBuf.onehzcmd), UT_TPID_CFE_TIME_ONEHZ_CMD); UtAssert_NONZERO(UT_GetStubCount(UT_KEY(CFE_PSP_GetTime))); } From e56d5e0bbb94ffa8fc43fa6ad8541bf4c54f0f0d Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 7 Dec 2023 13:52:01 -0500 Subject: [PATCH 5/6] HotFix #2411, move perf enum definition The API documentation should not refer to internal headers, only public headers. The fact that the message payload was based on this enum meant that the enum definition is in the wrong place. --- modules/es/config/default_cfe_es_msgdefs.h | 16 +++++++++++++++- modules/es/fsw/src/cfe_es_perf.h | 16 ++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/es/config/default_cfe_es_msgdefs.h b/modules/es/config/default_cfe_es_msgdefs.h index aae254ff0..f0da2e3d5 100644 --- a/modules/es/config/default_cfe_es_msgdefs.h +++ b/modules/es/config/default_cfe_es_msgdefs.h @@ -143,6 +143,20 @@ typedef struct CFE_ES_DeleteCDSCmd_Payload CdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief ASCII text string containing name of CDS to delete */ } CFE_ES_DeleteCDSCmd_Payload_t; +/** + * @brief Labels for values to use in #CFE_ES_StartPerfCmd_Payload.TriggerMode + * @sa CFE_ES_StartPerfCmd_Payload +*/ +enum CFE_ES_PerfMode +{ + CFE_ES_PERF_TRIGGER_START = 0, + CFE_ES_PERF_TRIGGER_CENTER, + CFE_ES_PERF_TRIGGER_END, + CFE_ES_PERF_MAX_MODES +}; + +typedef uint32 CFE_ES_PerfMode_Enum_t; + /** ** \brief Start Performance Analyzer Command Payload ** @@ -151,7 +165,7 @@ typedef struct CFE_ES_DeleteCDSCmd_Payload **/ typedef struct CFE_ES_StartPerfCmd_Payload { - uint32 TriggerMode; /**< \brief Desired trigger position (Start, Center, End). Values defined by #CFE_ES_PerfMode. */ + CFE_ES_PerfMode_Enum_t TriggerMode; /**< \brief Desired trigger position (Start, Center, End). Values defined by #CFE_ES_PerfMode. */ } CFE_ES_StartPerfCmd_Payload_t; /** diff --git a/modules/es/fsw/src/cfe_es_perf.h b/modules/es/fsw/src/cfe_es_perf.h index f0244ff98..26c3c719f 100644 --- a/modules/es/fsw/src/cfe_es_perf.h +++ b/modules/es/fsw/src/cfe_es_perf.h @@ -49,25 +49,13 @@ /** * @brief Internal states for Performance Analyzer */ -enum CFE_ES_PerfState +typedef enum CFE_ES_PerfState { CFE_ES_PERF_IDLE = 0, CFE_ES_PERF_WAITING_FOR_TRIGGER, CFE_ES_PERF_TRIGGERED, CFE_ES_PERF_MAX_STATES -}; - -/** - * @brief Labels for values to use in #CFE_ES_StartPerfCmd_Payload.TriggerMode - * @sa CFE_ES_StartPerfCmd_Payload -*/ -enum CFE_ES_PerfMode -{ - CFE_ES_PERF_TRIGGER_START = 0, - CFE_ES_PERF_TRIGGER_CENTER, - CFE_ES_PERF_TRIGGER_END, - CFE_ES_PERF_MAX_MODES -}; +} CFE_ES_PerfState_t; /** * @brief Perflog Dump Background Job states From ac792611eddd950d22f30e00140998703a9b169f Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 12 Dec 2023 08:25:33 -0500 Subject: [PATCH 6/6] Updating documentation and version numbers for v7.0.0-rc4+dev434 --- CHANGELOG.md | 6 ++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c206f34c..b10271be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Development Build: v7.0.0-rc4+dev434 +- Update docs and UT to use CFE_MSG_PTR +- document ES Perf enums +- document and use topicid numbers for cfe +- See , , and + ## Development Build: v7.0.0-rc4+dev424 - Add perfid limit info to ES docstring - TBL UT update for OSAL/CFE path length mismatch diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index f8fafa244..096f9f08c 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 424 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 434 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */