From d127a160ca48723359ff610ae3c5b2bb668ad729 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 30 Nov 2020 10:57:26 -0500 Subject: [PATCH] Fix #1009, Alignment pattern - core updates - Added CFE_SB_TransmitMsg, CFE_SB_TransmitBuffer, CFE_SB_ReceiveBuffer (partial #1019 fix) - Replace CFE_SB_RcvMsg with CFE_SB_ReceiveBuffer - Deprecated CFE_SB_SendMsg, CFE_SB_PassMsg, CFE_SB_RcvMsg CFE_SB_ZeroCopyPass, CFE_SB_ZeroCopySend - Use CFE_SB_Buffer_t for receiving and casting to command types - Use CFE_MSG_CommandHeader_t and CFE_MSG_TelemetryHeader_t in command and telemetry type definitions - Use CFE_SB_TransmitMsg to copy the command and telemetry into a CFE_SB_Buffer_t and send it where needed - Avoids need to create send buffers within the app (or union the packet types with CFE_SB_Buffer_t) - Eliminates references to CFE_SB_CmdHdr_t and CFE_SB_TlmHdr_t that formerly enforced alignment since these had potential to change the actual packet sizes - No need to cast to CFE_MSG_Message_t anywhere since it's available in the CFE_SB_Buffer_t union - CFE_MSG_Size_t redefined as size_t to simplify future transition - Replaced Syslog with SysLog for consistency - Added Cmd to all command typedefs - Replaced CFE_SB_CMD_HDR_SIZE and CFE_SB_TLM_HDR_SIZE with sizeof the appropriate type --- fsw/cfe-core/src/es/cfe_es_log.h | 6 +- fsw/cfe-core/src/es/cfe_es_perf.c | 8 +- fsw/cfe-core/src/es/cfe_es_syslog.c | 2 +- fsw/cfe-core/src/es/cfe_es_task.c | 190 ++++++----- fsw/cfe-core/src/es/cfe_es_task.h | 65 ++-- fsw/cfe-core/src/es/cfe_es_verify.h | 2 +- fsw/cfe-core/src/evs/cfe_evs_log.c | 4 +- fsw/cfe-core/src/evs/cfe_evs_log.h | 4 +- fsw/cfe-core/src/evs/cfe_evs_task.c | 152 ++++----- fsw/cfe-core/src/evs/cfe_evs_task.h | 42 +-- fsw/cfe-core/src/evs/cfe_evs_utils.c | 12 +- fsw/cfe-core/src/inc/cfe_error.h | 9 +- fsw/cfe-core/src/inc/cfe_es_msg.h | 263 +++++++++------- fsw/cfe-core/src/inc/cfe_evs.h | 6 +- fsw/cfe-core/src/inc/cfe_evs_msg.h | 197 +++++++----- fsw/cfe-core/src/inc/cfe_msg_typedefs.h | 2 +- fsw/cfe-core/src/inc/cfe_sb.h | 216 ++++++++----- fsw/cfe-core/src/inc/cfe_sb_events.h | 22 +- fsw/cfe-core/src/inc/cfe_sb_msg.h | 82 ++--- fsw/cfe-core/src/inc/cfe_tbl_events.h | 4 +- fsw/cfe-core/src/inc/cfe_tbl_msg.h | 150 +++++---- fsw/cfe-core/src/inc/cfe_time_msg.h | 216 ++++++------- fsw/cfe-core/src/sb/cfe_sb_api.c | 382 +++++++++++++---------- fsw/cfe-core/src/sb/cfe_sb_init.c | 2 +- fsw/cfe-core/src/sb/cfe_sb_priv.c | 2 +- fsw/cfe-core/src/sb/cfe_sb_priv.h | 58 ++-- fsw/cfe-core/src/sb/cfe_sb_task.c | 110 +++---- fsw/cfe-core/src/sb/cfe_sb_util.c | 4 +- fsw/cfe-core/src/tbl/cfe_tbl_internal.c | 14 +- fsw/cfe-core/src/tbl/cfe_tbl_task.c | 45 +-- fsw/cfe-core/src/tbl/cfe_tbl_task.h | 3 +- fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c | 30 +- fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h | 22 +- fsw/cfe-core/src/time/cfe_time_task.c | 181 +++++------ fsw/cfe-core/src/time/cfe_time_tone.c | 14 +- fsw/cfe-core/src/time/cfe_time_utils.c | 16 +- fsw/cfe-core/src/time/cfe_time_utils.h | 7 +- 37 files changed, 1379 insertions(+), 1165 deletions(-) diff --git a/fsw/cfe-core/src/es/cfe_es_log.h b/fsw/cfe-core/src/es/cfe_es_log.h index 147496ae3..fd92aa60d 100644 --- a/fsw/cfe-core/src/es/cfe_es_log.h +++ b/fsw/cfe-core/src/es/cfe_es_log.h @@ -75,7 +75,7 @@ * first significantly decreases the amount of time that the syslog is locked after * a file dump is requested. * - * This buffer also reflects the Syslog "burst size" that is guaranteed to be + * This buffer also reflects the SysLog "burst size" that is guaranteed to be * safe for concurrent writes and reads/dump operations. If applications Log more than * this amount of data in less time than it takes to write this amount of data to disk, * then some log messages may be corrupt or lost in the output file. @@ -121,7 +121,7 @@ */ /** - * \brief Buffer structure for reading data out of the Syslog + * \brief Buffer structure for reading data out of the SysLog * * Access to the syslog must be synchronized, so it is not possible to * directly access the contents. This structure keeps the state of @@ -309,7 +309,7 @@ void CFE_ES_SysLog_snprintf(char *Buffer, size_t BufferSize, const char *SpecStr * * A snapshot of the log indices is taken at the beginning of the writing * process. Additional log entries added after this (e.g. from applications - * calling CFE_ES_WriteToSyslog() after starting a syslog dump) will not be + * calling CFE_ES_WriteToSysLog() after starting a syslog dump) will not be * included in the dump file. * * Note that preference is given to the realtime application threads over diff --git a/fsw/cfe-core/src/es/cfe_es_perf.c b/fsw/cfe-core/src/es/cfe_es_perf.c index 518e4b55f..a4b47104c 100644 --- a/fsw/cfe-core/src/es/cfe_es_perf.c +++ b/fsw/cfe-core/src/es/cfe_es_perf.c @@ -158,7 +158,7 @@ uint32 CFE_ES_GetPerfLogDumpRemaining(void) /* CFE_ES_StartPerfDataCmd() -- */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfData_t *data) +int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data) { const CFE_ES_StartPerfCmd_Payload_t *CmdPtr = &data->Payload; CFE_ES_PerfDumpGlobal_t *PerfDumpState = &CFE_ES_TaskData.BackgroundPerfDumpState; @@ -214,7 +214,7 @@ int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfData_t *data) /* CFE_ES_StopPerfDataCmd() -- */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfData_t *data) +int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfDataCmd_t *data) { const CFE_ES_StopPerfCmd_Payload_t *CmdPtr = &data->Payload; CFE_ES_PerfDumpGlobal_t *PerfDumpState = &CFE_ES_TaskData.BackgroundPerfDumpState; @@ -496,7 +496,7 @@ bool CFE_ES_RunPerfLogDump(uint32 ElapsedTime, void *Arg) /* CFE_ES_SetPerfFilterMaskCmd() -- */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMask_t *data) +int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMaskCmd_t *data) { const CFE_ES_SetPerfFilterMaskCmd_Payload_t *cmd = &data->Payload; @@ -526,7 +526,7 @@ int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMask_t *data) /* CFE_ES_SetPerfTriggerMaskCmd() -- */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_SetPerfTriggerMaskCmd(const CFE_ES_SetPerfTriggerMask_t *data) +int32 CFE_ES_SetPerfTriggerMaskCmd(const CFE_ES_SetPerfTriggerMaskCmd_t *data) { const CFE_ES_SetPerfTrigMaskCmd_Payload_t *cmd = &data->Payload; diff --git a/fsw/cfe-core/src/es/cfe_es_syslog.c b/fsw/cfe-core/src/es/cfe_es_syslog.c index 5bb929348..1da1738af 100644 --- a/fsw/cfe-core/src/es/cfe_es_syslog.c +++ b/fsw/cfe-core/src/es/cfe_es_syslog.c @@ -33,7 +33,7 @@ ** ** Some functions have EXTERNAL SYNC REQUIREMENTS ** -** Syslog functions marked with "Unsync" in their name are designated +** SysLog functions marked with "Unsync" in their name are designated ** as functions which are _not_ safe to be called concurrently by multiple ** threads, and also do _not_ implement any locking or protection. These ** functions expect the caller to perform all thread synchronization before diff --git a/fsw/cfe-core/src/es/cfe_es_task.c b/fsw/cfe-core/src/es/cfe_es_task.c index 05bd7ae5e..c852c7614 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.c +++ b/fsw/cfe-core/src/es/cfe_es_task.c @@ -79,9 +79,9 @@ CFE_ES_TaskData_t CFE_ES_TaskData; void CFE_ES_TaskMain(void) { - int32 Status; - uint32 AppRunStatus = CFE_ES_RunStatus_APP_RUN; - + int32 Status; + uint32 AppRunStatus = CFE_ES_RunStatus_APP_RUN; + CFE_SB_Buffer_t *SBBufPtr; /* ** Performance Time Stamp Entry @@ -136,9 +136,7 @@ void CFE_ES_TaskMain(void) /* ** Wait for the next Software Bus message. */ - Status = CFE_SB_RcvMsg(&CFE_ES_TaskData.MsgPtr, - CFE_ES_TaskData.CmdPipe, - CFE_SB_PEND_FOREVER); + Status = CFE_SB_ReceiveBuffer(&SBBufPtr, CFE_ES_TaskData.CmdPipe, CFE_SB_PEND_FOREVER); /* ** Performance Time Stamp Entry @@ -148,9 +146,9 @@ void CFE_ES_TaskMain(void) if (Status == CFE_SUCCESS) { /* - ** Process Software Bus message. + ** Process message. */ - CFE_ES_TaskPipe(CFE_ES_TaskData.MsgPtr); + CFE_ES_TaskPipe(SBBufPtr); /* * Wake up the background task, which includes the @@ -252,21 +250,21 @@ int32 CFE_ES_TaskInit(void) /* ** Initialize housekeeping packet (clear user data area) */ - CFE_MSG_Init(&CFE_ES_TaskData.HkPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_ES_TaskData.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_HK_TLM_MID), sizeof(CFE_ES_TaskData.HkPacket)); /* ** Initialize single application telemetry packet */ - CFE_MSG_Init(&CFE_ES_TaskData.OneAppPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_ES_TaskData.OneAppPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_APP_TLM_MID), sizeof(CFE_ES_TaskData.OneAppPacket)); /* ** Initialize memory pool statistics telemetry packet */ - CFE_MSG_Init(&CFE_ES_TaskData.MemStatsPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_ES_TaskData.MemStatsPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_MEMSTATS_TLM_MID), sizeof(CFE_ES_TaskData.MemStatsPacket)); @@ -434,19 +432,19 @@ int32 CFE_ES_TaskInit(void) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void CFE_ES_TaskPipe(CFE_MSG_Message_t *MsgPtr) +void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr) { CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; CFE_MSG_FcnCode_t CommandCode = 0; - CFE_MSG_GetMsgId(MsgPtr, &MessageID); + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); switch (CFE_SB_MsgIdToValue(MessageID)) { /* ** Housekeeping telemetry request */ case CFE_ES_SEND_HK_MID: - CFE_ES_HousekeepingCmd((CFE_SB_CmdHdr_t*)MsgPtr); + CFE_ES_HousekeepingCmd((CFE_MSG_CommandHeader_t *)SBBufPtr); break; /* @@ -454,174 +452,174 @@ void CFE_ES_TaskPipe(CFE_MSG_Message_t *MsgPtr) */ case CFE_ES_CMD_MID: - CFE_MSG_GetFcnCode(MsgPtr, &CommandCode); + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); switch (CommandCode) { case CFE_ES_NOOP_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_Noop_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_NoopCmd_t))) { - CFE_ES_NoopCmd((CFE_ES_Noop_t*)MsgPtr); + CFE_ES_NoopCmd((CFE_ES_NoopCmd_t*)SBBufPtr); } break; case CFE_ES_RESET_COUNTERS_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_ResetCounters_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ResetCountersCmd_t))) { - CFE_ES_ResetCountersCmd((CFE_ES_ResetCounters_t*)MsgPtr); + CFE_ES_ResetCountersCmd((CFE_ES_ResetCountersCmd_t*)SBBufPtr); } break; case CFE_ES_RESTART_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_Restart_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_RestartCmd_t))) { - CFE_ES_RestartCmd((CFE_ES_Restart_t*)MsgPtr); + CFE_ES_RestartCmd((CFE_ES_RestartCmd_t*)SBBufPtr); } break; case CFE_ES_START_APP_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_StartApp_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StartAppCmd_t))) { - CFE_ES_StartAppCmd((CFE_ES_StartApp_t*)MsgPtr); + CFE_ES_StartAppCmd((CFE_ES_StartAppCmd_t*)SBBufPtr); } break; case CFE_ES_STOP_APP_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_StopApp_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StopAppCmd_t))) { - CFE_ES_StopAppCmd((CFE_ES_StopApp_t*)MsgPtr); + CFE_ES_StopAppCmd((CFE_ES_StopAppCmd_t*)SBBufPtr); } break; case CFE_ES_RESTART_APP_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_RestartApp_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_RestartAppCmd_t))) { - CFE_ES_RestartAppCmd((CFE_ES_RestartApp_t*)MsgPtr); + CFE_ES_RestartAppCmd((CFE_ES_RestartAppCmd_t*)SBBufPtr); } break; case CFE_ES_RELOAD_APP_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_ReloadApp_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ReloadAppCmd_t))) { - CFE_ES_ReloadAppCmd((CFE_ES_ReloadApp_t*)MsgPtr); + CFE_ES_ReloadAppCmd((CFE_ES_ReloadAppCmd_t*)SBBufPtr); } break; case CFE_ES_QUERY_ONE_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_QueryOne_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryOneCmd_t))) { - CFE_ES_QueryOneCmd((CFE_ES_QueryOne_t*)MsgPtr); + CFE_ES_QueryOneCmd((CFE_ES_QueryOneCmd_t*)SBBufPtr); } break; case CFE_ES_QUERY_ALL_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_QueryAll_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryAllCmd_t))) { - CFE_ES_QueryAllCmd((CFE_ES_QueryAll_t*)MsgPtr); + CFE_ES_QueryAllCmd((CFE_ES_QueryAllCmd_t*)SBBufPtr); } break; case CFE_ES_QUERY_ALL_TASKS_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_QueryAllTasks_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_QueryAllTasksCmd_t))) { - CFE_ES_QueryAllTasksCmd((CFE_ES_QueryAllTasks_t*)MsgPtr); + CFE_ES_QueryAllTasksCmd((CFE_ES_QueryAllTasksCmd_t*)SBBufPtr); } break; case CFE_ES_CLEAR_SYSLOG_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_ClearSyslog_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ClearSysLogCmd_t))) { - CFE_ES_ClearSyslogCmd((CFE_ES_ClearSyslog_t*)MsgPtr); + CFE_ES_ClearSysLogCmd((CFE_ES_ClearSysLogCmd_t*)SBBufPtr); } break; case CFE_ES_WRITE_SYSLOG_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_WriteSyslog_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_WriteSysLogCmd_t))) { - CFE_ES_WriteSyslogCmd((CFE_ES_WriteSyslog_t*)MsgPtr); + CFE_ES_WriteSysLogCmd((CFE_ES_WriteSysLogCmd_t*)SBBufPtr); } break; case CFE_ES_OVER_WRITE_SYSLOG_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_OverWriteSyslog_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_OverWriteSysLogCmd_t))) { - CFE_ES_OverWriteSyslogCmd((CFE_ES_OverWriteSyslog_t*)MsgPtr); + CFE_ES_OverWriteSysLogCmd((CFE_ES_OverWriteSysLogCmd_t*)SBBufPtr); } break; case CFE_ES_CLEAR_ER_LOG_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_ClearERLog_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ClearERLogCmd_t))) { - CFE_ES_ClearERLogCmd((CFE_ES_ClearERLog_t*)MsgPtr); + CFE_ES_ClearERLogCmd((CFE_ES_ClearERLogCmd_t*)SBBufPtr); } break; case CFE_ES_WRITE_ER_LOG_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_WriteERLog_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_WriteERLogCmd_t))) { - CFE_ES_WriteERLogCmd((CFE_ES_WriteERLog_t*)MsgPtr); + CFE_ES_WriteERLogCmd((CFE_ES_WriteERLogCmd_t*)SBBufPtr); } break; case CFE_ES_START_PERF_DATA_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_StartPerfData_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StartPerfDataCmd_t))) { - CFE_ES_StartPerfDataCmd((CFE_ES_StartPerfData_t*)MsgPtr); + CFE_ES_StartPerfDataCmd((CFE_ES_StartPerfDataCmd_t*)SBBufPtr); } break; case CFE_ES_STOP_PERF_DATA_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_StopPerfData_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_StopPerfDataCmd_t))) { - CFE_ES_StopPerfDataCmd((CFE_ES_StopPerfData_t*)MsgPtr); + CFE_ES_StopPerfDataCmd((CFE_ES_StopPerfDataCmd_t*)SBBufPtr); } break; case CFE_ES_SET_PERF_FILTER_MASK_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_SetPerfFilterMask_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetPerfFilterMaskCmd_t))) { - CFE_ES_SetPerfFilterMaskCmd((CFE_ES_SetPerfFilterMask_t*)MsgPtr); + CFE_ES_SetPerfFilterMaskCmd((CFE_ES_SetPerfFilterMaskCmd_t*)SBBufPtr); } break; case CFE_ES_SET_PERF_TRIGGER_MASK_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_SetPerfTriggerMask_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetPerfTriggerMaskCmd_t))) { - CFE_ES_SetPerfTriggerMaskCmd((CFE_ES_SetPerfTriggerMask_t*)MsgPtr); + CFE_ES_SetPerfTriggerMaskCmd((CFE_ES_SetPerfTriggerMaskCmd_t*)SBBufPtr); } break; case CFE_ES_RESET_PR_COUNT_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_ResetPRCount_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ResetPRCountCmd_t))) { - CFE_ES_ResetPRCountCmd((CFE_ES_ResetPRCount_t*)MsgPtr); + CFE_ES_ResetPRCountCmd((CFE_ES_ResetPRCountCmd_t*)SBBufPtr); } break; case CFE_ES_SET_MAX_PR_COUNT_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_SetMaxPRCount_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SetMaxPRCountCmd_t))) { - CFE_ES_SetMaxPRCountCmd((CFE_ES_SetMaxPRCount_t*)MsgPtr); + CFE_ES_SetMaxPRCountCmd((CFE_ES_SetMaxPRCountCmd_t*)SBBufPtr); } break; case CFE_ES_DELETE_CDS_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_DeleteCDS_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_DeleteCDSCmd_t))) { - CFE_ES_DeleteCDSCmd((CFE_ES_DeleteCDS_t*)MsgPtr); + CFE_ES_DeleteCDSCmd((CFE_ES_DeleteCDSCmd_t*)SBBufPtr); } break; case CFE_ES_SEND_MEM_POOL_STATS_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_SendMemPoolStats_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_SendMemPoolStatsCmd_t))) { - CFE_ES_SendMemPoolStatsCmd((CFE_ES_SendMemPoolStats_t*)MsgPtr); + CFE_ES_SendMemPoolStatsCmd((CFE_ES_SendMemPoolStatsCmd_t*)SBBufPtr); } break; case CFE_ES_DUMP_CDS_REGISTRY_CC: - if (CFE_ES_VerifyCmdLength(MsgPtr, sizeof(CFE_ES_DumpCDSRegistry_t))) + if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_DumpCDSRegistryCmd_t))) { - CFE_ES_DumpCDSRegistryCmd((CFE_ES_DumpCDSRegistry_t*)MsgPtr); + CFE_ES_DumpCDSRegistryCmd((CFE_ES_DumpCDSRegistryCmd_t*)SBBufPtr); } break; @@ -652,7 +650,7 @@ void CFE_ES_TaskPipe(CFE_MSG_Message_t *MsgPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) +int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) { OS_heap_prop_t HeapProp; int32 stat; @@ -746,8 +744,8 @@ int32 CFE_ES_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) /* ** Send housekeeping telemetry packet. */ - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_ES_TaskData.HkPacket); - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_ES_TaskData.HkPacket); + CFE_SB_TimeStampMsg(&CFE_ES_TaskData.HkPacket.TlmHeader.Msg); + CFE_SB_TransmitMsg(&CFE_ES_TaskData.HkPacket.TlmHeader.Msg, true); /* ** This command does not affect the command execution counter. @@ -763,7 +761,7 @@ int32 CFE_ES_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_NoopCmd(const CFE_ES_Noop_t *Cmd) +int32 CFE_ES_NoopCmd(const CFE_ES_NoopCmd_t *Cmd) { /* ** Advertise the build and version information with the no-op command @@ -804,7 +802,7 @@ int32 CFE_ES_NoopCmd(const CFE_ES_Noop_t *Cmd) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_ResetCountersCmd(const CFE_ES_ResetCounters_t *data) +int32 CFE_ES_ResetCountersCmd(const CFE_ES_ResetCountersCmd_t *data) { CFE_ES_TaskData.CommandCounter = 0; CFE_ES_TaskData.CommandErrorCounter = 0; @@ -825,7 +823,7 @@ int32 CFE_ES_ResetCountersCmd(const CFE_ES_ResetCounters_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_RestartCmd(const CFE_ES_Restart_t *data) +int32 CFE_ES_RestartCmd(const CFE_ES_RestartCmd_t *data) { const CFE_ES_RestartCmd_Payload_t *cmd = &data->Payload; @@ -854,7 +852,7 @@ int32 CFE_ES_RestartCmd(const CFE_ES_Restart_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_StartAppCmd(const CFE_ES_StartApp_t *data) +int32 CFE_ES_StartAppCmd(const CFE_ES_StartAppCmd_t *data) { const CFE_ES_StartAppCmd_Payload_t *cmd = &data->Payload; CFE_ES_ResourceID_t AppID; @@ -966,7 +964,7 @@ int32 CFE_ES_StartAppCmd(const CFE_ES_StartApp_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_StopAppCmd(const CFE_ES_StopApp_t *data) +int32 CFE_ES_StopAppCmd(const CFE_ES_StopAppCmd_t *data) { const CFE_ES_AppNameCmd_Payload_t *cmd = &data->Payload; char LocalApp[OS_MAX_API_NAME]; @@ -1020,7 +1018,7 @@ int32 CFE_ES_StopAppCmd(const CFE_ES_StopApp_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_RestartAppCmd(const CFE_ES_RestartApp_t *data) +int32 CFE_ES_RestartAppCmd(const CFE_ES_RestartAppCmd_t *data) { const CFE_ES_AppNameCmd_Payload_t *cmd = &data->Payload; char LocalApp[OS_MAX_API_NAME]; @@ -1070,7 +1068,7 @@ int32 CFE_ES_RestartAppCmd(const CFE_ES_RestartApp_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_ReloadAppCmd(const CFE_ES_ReloadApp_t *data) +int32 CFE_ES_ReloadAppCmd(const CFE_ES_ReloadAppCmd_t *data) { const CFE_ES_AppReloadCmd_Payload_t *cmd = &data->Payload; char LocalApp[OS_MAX_API_NAME]; @@ -1124,7 +1122,7 @@ int32 CFE_ES_ReloadAppCmd(const CFE_ES_ReloadApp_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOne_t *data) +int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOneCmd_t *data) { const CFE_ES_AppNameCmd_Payload_t *cmd = &data->Payload; char LocalApp[OS_MAX_API_NAME]; @@ -1154,8 +1152,8 @@ int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOne_t *data) /* ** Send application status telemetry packet. */ - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_ES_TaskData.OneAppPacket); - Result = CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_ES_TaskData.OneAppPacket); + CFE_SB_TimeStampMsg(&CFE_ES_TaskData.OneAppPacket.TlmHeader.Msg); + Result = CFE_SB_TransmitMsg(&CFE_ES_TaskData.OneAppPacket.TlmHeader.Msg, true); if ( Result == CFE_SUCCESS ) { CFE_ES_TaskData.CommandCounter++; @@ -1187,7 +1185,7 @@ int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOne_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAll_t *data) +int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) { CFE_FS_Header_t FileHeader; osal_id_t FileDescriptor; @@ -1346,7 +1344,7 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAll_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasks_t *data) +int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data) { CFE_FS_Header_t FileHeader; osal_id_t FileDescriptor; @@ -1488,11 +1486,11 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasks_t *data) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ -/* CFE_ES_ClearSyslogCmd() -- Clear executive services system log */ +/* CFE_ES_ClearSysLogCmd() -- Clear executive services system log */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_ClearSyslogCmd(const CFE_ES_ClearSyslog_t *data) +int32 CFE_ES_ClearSysLogCmd(const CFE_ES_ClearSysLogCmd_t *data) { /* ** Clear syslog index and memory area @@ -1510,15 +1508,15 @@ int32 CFE_ES_ClearSyslogCmd(const CFE_ES_ClearSyslog_t *data) "Cleared Executive Services log data"); return CFE_SUCCESS; -} /* End of CFE_ES_ClearSyslogCmd() */ +} /* End of CFE_ES_ClearSysLogCmd() */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ -/* CFE_ES_OverWriteSyslogCmd() -- set syslog mode */ +/* CFE_ES_OverWriteSysLogCmd() -- set syslog mode */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_OverWriteSyslogCmd(const CFE_ES_OverWriteSyslog_t *data) +int32 CFE_ES_OverWriteSysLogCmd(const CFE_ES_OverWriteSysLogCmd_t *data) { int32 Status; const CFE_ES_OverWriteSysLogCmd_Payload_t *CmdPtr = &data->Payload; @@ -1543,16 +1541,16 @@ int32 CFE_ES_OverWriteSyslogCmd(const CFE_ES_OverWriteSyslog_t *data) } return CFE_SUCCESS; -} /* End CFE_ES_OverWriteSyslogCmd() */ +} /* End CFE_ES_OverWriteSysLogCmd() */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ -/* CFE_ES_WriteSyslogCmd() -- Process Cmd to write ES System Log to file */ +/* CFE_ES_WriteSysLogCmd() -- Process Cmd to write ES System Log to file */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_WriteSyslogCmd(const CFE_ES_WriteSyslog_t *data) +int32 CFE_ES_WriteSysLogCmd(const CFE_ES_WriteSysLogCmd_t *data) { const CFE_ES_FileNameCmd_Payload_t *CmdPtr = &data->Payload; int32 Stat; @@ -1573,7 +1571,7 @@ int32 CFE_ES_WriteSyslogCmd(const CFE_ES_WriteSyslog_t *data) }/* end if */ return CFE_SUCCESS; -}/* end CFE_ES_WriteSyslogCmd */ +}/* end CFE_ES_WriteSysLogCmd */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -1582,7 +1580,7 @@ int32 CFE_ES_WriteSyslogCmd(const CFE_ES_WriteSyslog_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_ClearERLogCmd(const CFE_ES_ClearERLog_t *data) +int32 CFE_ES_ClearERLogCmd(const CFE_ES_ClearERLogCmd_t *data) { /* ** Clear ER log data buffer @@ -1617,7 +1615,7 @@ int32 CFE_ES_ClearERLogCmd(const CFE_ES_ClearERLog_t *data) /* log to a file. */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_WriteERLogCmd(const CFE_ES_WriteERLog_t *data) +int32 CFE_ES_WriteERLogCmd(const CFE_ES_WriteERLogCmd_t *data) { const CFE_ES_FileNameCmd_Payload_t *CmdPtr = &data->Payload; @@ -1688,7 +1686,7 @@ bool CFE_ES_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_ResetPRCountCmd(const CFE_ES_ResetPRCount_t *data) +int32 CFE_ES_ResetPRCountCmd(const CFE_ES_ResetPRCountCmd_t *data) { /* ** Reset the processor reset count @@ -1712,7 +1710,7 @@ int32 CFE_ES_ResetPRCountCmd(const CFE_ES_ResetPRCount_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_SetMaxPRCountCmd(const CFE_ES_SetMaxPRCount_t *data) +int32 CFE_ES_SetMaxPRCountCmd(const CFE_ES_SetMaxPRCountCmd_t *data) { const CFE_ES_SetMaxPRCountCmd_Payload_t *cmd = &data->Payload; @@ -1738,7 +1736,7 @@ int32 CFE_ES_SetMaxPRCountCmd(const CFE_ES_SetMaxPRCount_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDS_t *data) +int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDSCmd_t *data) { int32 Status; const CFE_ES_DeleteCDSCmd_Payload_t *cmd = &data->Payload; @@ -1799,7 +1797,7 @@ int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDS_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStats_t *data) +int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStatsCmd_t *data) { const CFE_ES_SendMemPoolStatsCmd_Payload_t *Cmd; CFE_ES_MemHandle_t MemHandle; @@ -1822,8 +1820,8 @@ int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStats_t *data) /* ** Send memory statistics telemetry packet. */ - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_ES_TaskData.MemStatsPacket); - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_ES_TaskData.MemStatsPacket); + CFE_SB_TimeStampMsg(&CFE_ES_TaskData.MemStatsPacket.TlmHeader.Msg); + CFE_SB_TransmitMsg(&CFE_ES_TaskData.MemStatsPacket.TlmHeader.Msg, true); CFE_ES_TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_TLM_POOL_STATS_INFO_EID, CFE_EVS_EventType_DEBUG, @@ -1847,7 +1845,7 @@ int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStats_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistry_t *data) +int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data) { CFE_FS_Header_t StdFileHeader; osal_id_t FileDescriptor; diff --git a/fsw/cfe-core/src/es/cfe_es_task.h b/fsw/cfe-core/src/es/cfe_es_task.h index 670305ccb..22270cc50 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.h +++ b/fsw/cfe-core/src/es/cfe_es_task.h @@ -89,8 +89,6 @@ typedef struct char DataFileName[OS_MAX_PATH_LEN]; } CFE_ES_BackgroundLogDumpGlobal_t; - - /* ** Type definition (ES task global data) */ @@ -103,24 +101,23 @@ typedef struct uint8 CommandErrorCounter; /* - ** ES Task housekeeping telemetry packet + ** ES Task housekeeping telemetry */ - CFE_ES_HousekeepingTlm_t HkPacket; + CFE_ES_HousekeepingTlm_t HkPacket; /* - ** Single application telemetry packet + ** Single application telemetry */ - CFE_ES_OneAppTlm_t OneAppPacket; + CFE_ES_OneAppTlm_t OneAppPacket; /* - ** Single application telemetry packet + ** Memory statistics telemetry */ CFE_ES_MemStatsTlm_t MemStatsPacket; /* ** ES Task operational data (not reported in housekeeping) */ - CFE_MSG_Message_t *MsgPtr; CFE_SB_PipeId_t CmdPipe; /* @@ -160,7 +157,7 @@ extern CFE_ES_TaskData_t CFE_ES_TaskData; */ void CFE_ES_TaskMain(void); int32 CFE_ES_TaskInit(void); -void CFE_ES_TaskPipe(CFE_MSG_Message_t *MsgPtr); +void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); /* @@ -174,31 +171,31 @@ void CFE_ES_BackgroundCleanup(void); /* ** ES Task message dispatch functions */ -int32 CFE_ES_HousekeepingCmd(const CFE_SB_CmdHdr_t *data); -int32 CFE_ES_NoopCmd(const CFE_ES_Noop_t *Cmd); -int32 CFE_ES_ResetCountersCmd(const CFE_ES_ResetCounters_t *data); -int32 CFE_ES_RestartCmd(const CFE_ES_Restart_t *data); -int32 CFE_ES_StartAppCmd(const CFE_ES_StartApp_t *data); -int32 CFE_ES_StopAppCmd(const CFE_ES_StopApp_t *data); -int32 CFE_ES_RestartAppCmd(const CFE_ES_RestartApp_t *data); -int32 CFE_ES_ReloadAppCmd(const CFE_ES_ReloadApp_t *data); -int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOne_t *data); -int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAll_t *data); -int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasks_t *data); -int32 CFE_ES_ClearSyslogCmd(const CFE_ES_ClearSyslog_t *data); -int32 CFE_ES_OverWriteSyslogCmd(const CFE_ES_OverWriteSyslog_t *data); -int32 CFE_ES_WriteSyslogCmd(const CFE_ES_WriteSyslog_t *data); -int32 CFE_ES_ClearERLogCmd(const CFE_ES_ClearERLog_t *data); -int32 CFE_ES_WriteERLogCmd(const CFE_ES_WriteERLog_t *data); -int32 CFE_ES_ResetPRCountCmd(const CFE_ES_ResetPRCount_t *data); -int32 CFE_ES_SetMaxPRCountCmd(const CFE_ES_SetMaxPRCount_t *data); -int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDS_t *data); -int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfData_t *data); -int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfData_t *data); -int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMask_t *data); -int32 CFE_ES_SetPerfTriggerMaskCmd(const CFE_ES_SetPerfTriggerMask_t *data); -int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStats_t *data); -int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistry_t *data); +int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data); +int32 CFE_ES_NoopCmd(const CFE_ES_NoopCmd_t *Cmd); +int32 CFE_ES_ResetCountersCmd(const CFE_ES_ResetCountersCmd_t *data); +int32 CFE_ES_RestartCmd(const CFE_ES_RestartCmd_t *data); +int32 CFE_ES_StartAppCmd(const CFE_ES_StartAppCmd_t *data); +int32 CFE_ES_StopAppCmd(const CFE_ES_StopAppCmd_t *data); +int32 CFE_ES_RestartAppCmd(const CFE_ES_RestartAppCmd_t *data); +int32 CFE_ES_ReloadAppCmd(const CFE_ES_ReloadAppCmd_t *data); +int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOneCmd_t *data); +int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data); +int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data); +int32 CFE_ES_ClearSysLogCmd(const CFE_ES_ClearSysLogCmd_t *data); +int32 CFE_ES_OverWriteSysLogCmd(const CFE_ES_OverWriteSysLogCmd_t *data); +int32 CFE_ES_WriteSysLogCmd(const CFE_ES_WriteSysLogCmd_t *data); +int32 CFE_ES_ClearERLogCmd(const CFE_ES_ClearERLogCmd_t *data); +int32 CFE_ES_WriteERLogCmd(const CFE_ES_WriteERLogCmd_t *data); +int32 CFE_ES_ResetPRCountCmd(const CFE_ES_ResetPRCountCmd_t *data); +int32 CFE_ES_SetMaxPRCountCmd(const CFE_ES_SetMaxPRCountCmd_t *data); +int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDSCmd_t *data); +int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data); +int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfDataCmd_t *data); +int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMaskCmd_t *data); +int32 CFE_ES_SetPerfTriggerMaskCmd(const CFE_ES_SetPerfTriggerMaskCmd_t *data); +int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStatsCmd_t *data); +int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data); /* ** Message Handler Helper Functions diff --git a/fsw/cfe-core/src/es/cfe_es_verify.h b/fsw/cfe-core/src/es/cfe_es_verify.h index 8434e077c..b27beafbc 100644 --- a/fsw/cfe-core/src/es/cfe_es_verify.h +++ b/fsw/cfe-core/src/es/cfe_es_verify.h @@ -145,7 +145,7 @@ #endif /* -** Syslog mode +** SysLog mode */ #if CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE < 0 #error CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE cannot be less than 0! diff --git a/fsw/cfe-core/src/evs/cfe_evs_log.c b/fsw/cfe-core/src/evs/cfe_evs_log.c index e6c091203..b3583b2bf 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_log.c +++ b/fsw/cfe-core/src/evs/cfe_evs_log.c @@ -148,7 +148,7 @@ void EVS_ClearLog ( void ) ** Assumptions and Notes: ** */ -int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFile_t *data) +int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data) { const CFE_EVS_LogFileCmd_Payload_t *CmdPtr = &data->Payload; int32 Result; @@ -269,7 +269,7 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFile_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_SetLogModeCmd(const CFE_EVS_SetLogMode_t *data) +int32 CFE_EVS_SetLogModeCmd(const CFE_EVS_SetLogModeCmd_t *data) { const CFE_EVS_SetLogMode_Payload_t *CmdPtr = &data->Payload; int32 Status; diff --git a/fsw/cfe-core/src/evs/cfe_evs_log.h b/fsw/cfe-core/src/evs/cfe_evs_log.h index 9b05d7a74..736d7c919 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_log.h +++ b/fsw/cfe-core/src/evs/cfe_evs_log.h @@ -55,7 +55,7 @@ void EVS_AddLog ( CFE_EVS_LongEventTlm_t *EVS_PktPtr ); void EVS_ClearLog ( void ); -int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFile_t *data); -int32 CFE_EVS_SetLogModeCmd(const CFE_EVS_SetLogMode_t *data); +int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data); +int32 CFE_EVS_SetLogModeCmd(const CFE_EVS_SetLogModeCmd_t *data); #endif /* _cfe_evs_log_ */ diff --git a/fsw/cfe-core/src/evs/cfe_evs_task.c b/fsw/cfe-core/src/evs/cfe_evs_task.c index 8ac772f0c..e47e449ae 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_task.c +++ b/fsw/cfe-core/src/evs/cfe_evs_task.c @@ -53,7 +53,7 @@ CFE_EVS_GlobalData_t CFE_EVS_GlobalData; /* ** Local function prototypes. */ -void CFE_EVS_ProcessGroundCommand(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId); +void CFE_EVS_ProcessGroundCommand(CFE_SB_Buffer_t *SBBufPtr, CFE_SB_MsgId_t MsgId); bool CFE_EVS_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength); /* Function Definitions */ @@ -86,7 +86,7 @@ int32 CFE_EVS_EarlyInit ( void ) memset(&CFE_EVS_GlobalData, 0, sizeof(CFE_EVS_GlobalData_t)); /* Initialize housekeeping packet */ - CFE_MSG_Init(&CFE_EVS_GlobalData.EVS_TlmPkt.TlmHeader.BaseMsg, CFE_SB_ValueToMsgId(CFE_EVS_HK_TLM_MID), + CFE_MSG_Init(&CFE_EVS_GlobalData.EVS_TlmPkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_EVS_HK_TLM_MID), sizeof(CFE_EVS_GlobalData.EVS_TlmPkt)); /* Elements stored in the hk packet that have non-zero default values */ @@ -213,7 +213,7 @@ int32 CFE_EVS_CleanUpApp(CFE_ES_ResourceID_t AppID) void CFE_EVS_TaskMain(void) { int32 Status; - CFE_MSG_Message_t *MsgPtr; /* Pointer to SB message */ + CFE_SB_Buffer_t *SBBufPtr; CFE_ES_PerfLogEntry(CFE_MISSION_EVS_MAIN_PERF_ID); @@ -244,7 +244,7 @@ void CFE_EVS_TaskMain(void) CFE_ES_PerfLogExit(CFE_MISSION_EVS_MAIN_PERF_ID); /* Pend on receipt of packet */ - Status = CFE_SB_RcvMsg(&MsgPtr, + Status = CFE_SB_ReceiveBuffer(&SBBufPtr, CFE_EVS_GlobalData.EVS_CommandPipe, CFE_SB_PEND_FOREVER); @@ -253,14 +253,14 @@ void CFE_EVS_TaskMain(void) if (Status == CFE_SUCCESS) { /* Process cmd pipe msg */ - CFE_EVS_ProcessCommandPacket(MsgPtr); + CFE_EVS_ProcessCommandPacket(SBBufPtr); }else{ CFE_ES_WriteToSysLog("EVS:Error reading cmd pipe,RC=0x%08X\n",(unsigned int)Status); }/* end if */ }/* end while */ - /* while loop exits only if CFE_SB_RcvMsg returns error */ + /* while loop exits only if CFE_SB_ReceiveBuffer returns error */ CFE_ES_ExitApp(CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR); } /* end CFE_EVS_TaskMain */ @@ -352,23 +352,23 @@ int32 CFE_EVS_TaskInit ( void ) ** Assumptions and Notes: ** */ -void CFE_EVS_ProcessCommandPacket(CFE_MSG_Message_t *MsgPtr) +void CFE_EVS_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr) { CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; - CFE_MSG_GetMsgId(MsgPtr, &MessageID); + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); /* Process all SB messages */ switch (CFE_SB_MsgIdToValue(MessageID)) { case CFE_EVS_CMD_MID: /* EVS task specific command */ - CFE_EVS_ProcessGroundCommand(MsgPtr, MessageID); + CFE_EVS_ProcessGroundCommand(SBBufPtr, MessageID); break; case CFE_EVS_SEND_HK_MID: /* Housekeeping request */ - CFE_EVS_ReportHousekeepingCmd((CFE_SB_CmdHdr_t*)MsgPtr); + CFE_EVS_ReportHousekeepingCmd((CFE_MSG_CommandHeader_t *)SBBufPtr); break; default: @@ -396,182 +396,182 @@ void CFE_EVS_ProcessCommandPacket(CFE_MSG_Message_t *MsgPtr) ** Assumptions and Notes: ** */ -void CFE_EVS_ProcessGroundCommand(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId) +void CFE_EVS_ProcessGroundCommand(CFE_SB_Buffer_t *SBBufPtr, CFE_SB_MsgId_t MsgId) { /* status will get reset if it passes length check */ int32 Status = CFE_STATUS_WRONG_MSG_LENGTH; CFE_MSG_FcnCode_t FcnCode = 0; - CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); /* Process "known" EVS task ground commands */ switch (FcnCode) { case CFE_EVS_NOOP_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_Noop_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_NoopCmd_t))) { - Status = CFE_EVS_NoopCmd((CFE_EVS_Noop_t*)MsgPtr); + Status = CFE_EVS_NoopCmd((CFE_EVS_NoopCmd_t*)SBBufPtr); } break; case CFE_EVS_RESET_COUNTERS_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_ResetCounters_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetCountersCmd_t))) { - Status = CFE_EVS_ResetCountersCmd((CFE_EVS_ResetCounters_t*)MsgPtr); + Status = CFE_EVS_ResetCountersCmd((CFE_EVS_ResetCountersCmd_t*)SBBufPtr); } break; case CFE_EVS_ENABLE_EVENT_TYPE_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_EnableEventType_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableEventTypeCmd_t))) { - Status = CFE_EVS_EnableEventTypeCmd((CFE_EVS_EnableEventType_t*)MsgPtr); + Status = CFE_EVS_EnableEventTypeCmd((CFE_EVS_EnableEventTypeCmd_t*)SBBufPtr); } break; case CFE_EVS_DISABLE_EVENT_TYPE_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_DisableEventType_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableEventTypeCmd_t))) { - Status = CFE_EVS_DisableEventTypeCmd((CFE_EVS_DisableEventType_t*)MsgPtr); + Status = CFE_EVS_DisableEventTypeCmd((CFE_EVS_DisableEventTypeCmd_t*)SBBufPtr); } break; case CFE_EVS_SET_EVENT_FORMAT_MODE_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_SetEventFormatMode_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetEventFormatModeCmd_t))) { - Status = CFE_EVS_SetEventFormatModeCmd((CFE_EVS_SetEventFormatMode_t*)MsgPtr); + Status = CFE_EVS_SetEventFormatModeCmd((CFE_EVS_SetEventFormatModeCmd_t*)SBBufPtr); } break; case CFE_EVS_ENABLE_APP_EVENT_TYPE_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_EnableAppEventType_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableAppEventTypeCmd_t))) { - Status = CFE_EVS_EnableAppEventTypeCmd((CFE_EVS_EnableAppEventType_t*)MsgPtr); + Status = CFE_EVS_EnableAppEventTypeCmd((CFE_EVS_EnableAppEventTypeCmd_t*)SBBufPtr); } break; case CFE_EVS_DISABLE_APP_EVENT_TYPE_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_DisableAppEventType_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableAppEventTypeCmd_t))) { - Status = CFE_EVS_DisableAppEventTypeCmd((CFE_EVS_DisableAppEventType_t*)MsgPtr); + Status = CFE_EVS_DisableAppEventTypeCmd((CFE_EVS_DisableAppEventTypeCmd_t*)SBBufPtr); } break; case CFE_EVS_ENABLE_APP_EVENTS_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_EnableAppEvents_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnableAppEventsCmd_t))) { - Status = CFE_EVS_EnableAppEventsCmd((CFE_EVS_EnableAppEvents_t*)MsgPtr); + Status = CFE_EVS_EnableAppEventsCmd((CFE_EVS_EnableAppEventsCmd_t*)SBBufPtr); } break; case CFE_EVS_DISABLE_APP_EVENTS_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_DisableAppEvents_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisableAppEventsCmd_t))) { - Status = CFE_EVS_DisableAppEventsCmd((CFE_EVS_DisableAppEvents_t*)MsgPtr); + Status = CFE_EVS_DisableAppEventsCmd((CFE_EVS_DisableAppEventsCmd_t*)SBBufPtr); } break; case CFE_EVS_RESET_APP_COUNTER_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_ResetAppCounter_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetAppCounterCmd_t))) { - Status = CFE_EVS_ResetAppCounterCmd((CFE_EVS_ResetAppCounter_t*)MsgPtr); + Status = CFE_EVS_ResetAppCounterCmd((CFE_EVS_ResetAppCounterCmd_t*)SBBufPtr); } break; case CFE_EVS_SET_FILTER_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_SetFilter_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetFilterCmd_t))) { - Status = CFE_EVS_SetFilterCmd((CFE_EVS_SetFilter_t*)MsgPtr); + Status = CFE_EVS_SetFilterCmd((CFE_EVS_SetFilterCmd_t*)SBBufPtr); } break; case CFE_EVS_ENABLE_PORTS_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_EnablePorts_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_EnablePortsCmd_t))) { - Status = CFE_EVS_EnablePortsCmd((CFE_EVS_EnablePorts_t*)MsgPtr); + Status = CFE_EVS_EnablePortsCmd((CFE_EVS_EnablePortsCmd_t*)SBBufPtr); } break; case CFE_EVS_DISABLE_PORTS_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_DisablePorts_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DisablePortsCmd_t))) { - Status = CFE_EVS_DisablePortsCmd((CFE_EVS_DisablePorts_t*)MsgPtr); + Status = CFE_EVS_DisablePortsCmd((CFE_EVS_DisablePortsCmd_t*)SBBufPtr); } break; case CFE_EVS_RESET_FILTER_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_ResetFilter_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetFilterCmd_t))) { - Status = CFE_EVS_ResetFilterCmd((CFE_EVS_ResetFilter_t*)MsgPtr); + Status = CFE_EVS_ResetFilterCmd((CFE_EVS_ResetFilterCmd_t*)SBBufPtr); } break; case CFE_EVS_RESET_ALL_FILTERS_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_ResetAllFilters_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ResetAllFiltersCmd_t))) { - Status = CFE_EVS_ResetAllFiltersCmd((CFE_EVS_ResetAllFilters_t*)MsgPtr); + Status = CFE_EVS_ResetAllFiltersCmd((CFE_EVS_ResetAllFiltersCmd_t*)SBBufPtr); } break; case CFE_EVS_ADD_EVENT_FILTER_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_AddEventFilter_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_AddEventFilterCmd_t))) { - Status = CFE_EVS_AddEventFilterCmd((CFE_EVS_AddEventFilter_t*)MsgPtr); + Status = CFE_EVS_AddEventFilterCmd((CFE_EVS_AddEventFilterCmd_t*)SBBufPtr); } break; case CFE_EVS_DELETE_EVENT_FILTER_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_DeleteEventFilter_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_DeleteEventFilterCmd_t))) { - Status = CFE_EVS_DeleteEventFilterCmd((CFE_EVS_DeleteEventFilter_t*)MsgPtr); + Status = CFE_EVS_DeleteEventFilterCmd((CFE_EVS_DeleteEventFilterCmd_t*)SBBufPtr); } break; case CFE_EVS_WRITE_APP_DATA_FILE_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_WriteAppDataFile_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_WriteAppDataFileCmd_t))) { - Status = CFE_EVS_WriteAppDataFileCmd((CFE_EVS_WriteAppDataFile_t*)MsgPtr); + Status = CFE_EVS_WriteAppDataFileCmd((CFE_EVS_WriteAppDataFileCmd_t*)SBBufPtr); } break; case CFE_EVS_SET_LOG_MODE_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_SetLogMode_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_SetLogModeCmd_t))) { - Status = CFE_EVS_SetLogModeCmd((CFE_EVS_SetLogMode_t*)MsgPtr); + Status = CFE_EVS_SetLogModeCmd((CFE_EVS_SetLogModeCmd_t*)SBBufPtr); } break; case CFE_EVS_CLEAR_LOG_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_ClearLog_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_ClearLogCmd_t))) { - Status = CFE_EVS_ClearLogCmd((CFE_EVS_ClearLog_t *)MsgPtr); + Status = CFE_EVS_ClearLogCmd((CFE_EVS_ClearLogCmd_t *)SBBufPtr); } break; case CFE_EVS_WRITE_LOG_DATA_FILE_CC: - if (CFE_EVS_VerifyCmdLength(MsgPtr, sizeof(CFE_EVS_WriteLogDataFile_t))) + if (CFE_EVS_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_EVS_WriteLogDataFileCmd_t))) { - Status = CFE_EVS_WriteLogDataFileCmd((CFE_EVS_WriteLogDataFile_t*)MsgPtr); + Status = CFE_EVS_WriteLogDataFileCmd((CFE_EVS_WriteLogDataFileCmd_t*)SBBufPtr); } break; @@ -649,7 +649,7 @@ bool CFE_EVS_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) ** Assumptions and Notes: ** */ -int32 CFE_EVS_NoopCmd(const CFE_EVS_Noop_t *data) +int32 CFE_EVS_NoopCmd(const CFE_EVS_NoopCmd_t *data) { EVS_SendEvent(CFE_EVS_NOOP_EID, CFE_EVS_EventType_INFORMATION,"No-op command. %s", CFE_VERSION_STRING); @@ -666,7 +666,7 @@ int32 CFE_EVS_NoopCmd(const CFE_EVS_Noop_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_ClearLogCmd(const CFE_EVS_ClearLog_t *data) +int32 CFE_EVS_ClearLogCmd(const CFE_EVS_ClearLogCmd_t *data) { int32 Status; @@ -694,7 +694,7 @@ int32 CFE_EVS_ClearLogCmd(const CFE_EVS_ClearLog_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_ReportHousekeepingCmd (const CFE_SB_CmdHdr_t *data) +int32 CFE_EVS_ReportHousekeepingCmd (const CFE_MSG_CommandHeader_t *data) { uint32 i, j; EVS_AppData_t *AppDataPtr; @@ -732,9 +732,9 @@ int32 CFE_EVS_ReportHousekeepingCmd (const CFE_SB_CmdHdr_t *data) AppTlmDataPtr->AppMessageSentCounter = 0; } - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_EVS_GlobalData.EVS_TlmPkt); + CFE_SB_TimeStampMsg(&CFE_EVS_GlobalData.EVS_TlmPkt.TlmHeader.Msg); - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_EVS_GlobalData.EVS_TlmPkt); + CFE_SB_TransmitMsg(&CFE_EVS_GlobalData.EVS_TlmPkt.TlmHeader.Msg, true); return CFE_STATUS_NO_COUNTER_INCREMENT; } /* End of CFE_EVS_ReportHousekeepingCmd() */ @@ -751,7 +751,7 @@ int32 CFE_EVS_ReportHousekeepingCmd (const CFE_SB_CmdHdr_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_ResetCountersCmd(const CFE_EVS_ResetCounters_t *data) +int32 CFE_EVS_ResetCountersCmd(const CFE_EVS_ResetCountersCmd_t *data) { /* Status of commands processed by EVS task */ CFE_EVS_GlobalData.EVS_TlmPkt.Payload.CommandCounter = 0; @@ -781,7 +781,7 @@ int32 CFE_EVS_ResetCountersCmd(const CFE_EVS_ResetCounters_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_SetFilterCmd(const CFE_EVS_SetFilter_t *data) +int32 CFE_EVS_SetFilterCmd(const CFE_EVS_SetFilterCmd_t *data) { const CFE_EVS_AppNameEventIDMaskCmd_Payload_t *CmdPtr = &data->Payload; EVS_BinFilter_t *FilterPtr; @@ -858,7 +858,7 @@ int32 CFE_EVS_SetFilterCmd(const CFE_EVS_SetFilter_t *data) ** Shifting is done so the value not masked off is placed in the ones spot: ** necessary for comparing with true. */ -int32 CFE_EVS_EnablePortsCmd(const CFE_EVS_EnablePorts_t *data) +int32 CFE_EVS_EnablePortsCmd(const CFE_EVS_EnablePortsCmd_t *data) { const CFE_EVS_BitMaskCmd_Payload_t *CmdPtr = &data->Payload; int32 ReturnCode; @@ -914,7 +914,7 @@ int32 CFE_EVS_EnablePortsCmd(const CFE_EVS_EnablePorts_t *data) ** Shifting is done so the value not masked off is placed in the ones spot: ** necessary for comparing with true. */ -int32 CFE_EVS_DisablePortsCmd(const CFE_EVS_DisablePorts_t *data) +int32 CFE_EVS_DisablePortsCmd(const CFE_EVS_DisablePortsCmd_t *data) { const CFE_EVS_BitMaskCmd_Payload_t *CmdPtr = &data->Payload; int32 ReturnCode; @@ -972,7 +972,7 @@ int32 CFE_EVS_DisablePortsCmd(const CFE_EVS_DisablePorts_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_EnableEventTypeCmd(const CFE_EVS_EnableEventType_t *data) +int32 CFE_EVS_EnableEventTypeCmd(const CFE_EVS_EnableEventTypeCmd_t *data) { uint32 i; const CFE_EVS_BitMaskCmd_Payload_t *CmdPtr = &data->Payload; @@ -1023,7 +1023,7 @@ int32 CFE_EVS_EnableEventTypeCmd(const CFE_EVS_EnableEventType_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_DisableEventTypeCmd(const CFE_EVS_DisableEventType_t *data) +int32 CFE_EVS_DisableEventTypeCmd(const CFE_EVS_DisableEventTypeCmd_t *data) { uint32 i; const CFE_EVS_BitMaskCmd_Payload_t *CmdPtr = &data->Payload; @@ -1075,7 +1075,7 @@ int32 CFE_EVS_DisableEventTypeCmd(const CFE_EVS_DisableEventType_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_SetEventFormatModeCmd(const CFE_EVS_SetEventFormatMode_t *data) +int32 CFE_EVS_SetEventFormatModeCmd(const CFE_EVS_SetEventFormatModeCmd_t *data) { const CFE_EVS_SetEventFormatMode_Payload_t *CmdPtr = &data->Payload; int32 Status; @@ -1113,7 +1113,7 @@ int32 CFE_EVS_SetEventFormatModeCmd(const CFE_EVS_SetEventFormatMode_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_EnableAppEventTypeCmd(const CFE_EVS_EnableAppEventType_t *data) +int32 CFE_EVS_EnableAppEventTypeCmd(const CFE_EVS_EnableAppEventTypeCmd_t *data) { const CFE_EVS_AppNameBitMaskCmd_Payload_t *CmdPtr = &data->Payload; EVS_AppData_t *AppDataPtr; @@ -1188,7 +1188,7 @@ int32 CFE_EVS_EnableAppEventTypeCmd(const CFE_EVS_EnableAppEventType_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_DisableAppEventTypeCmd(const CFE_EVS_DisableAppEventType_t *data) +int32 CFE_EVS_DisableAppEventTypeCmd(const CFE_EVS_DisableAppEventTypeCmd_t *data) { EVS_AppData_t *AppDataPtr; const CFE_EVS_AppNameBitMaskCmd_Payload_t *CmdPtr = &data->Payload; @@ -1262,7 +1262,7 @@ int32 CFE_EVS_DisableAppEventTypeCmd(const CFE_EVS_DisableAppEventType_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_EnableAppEventsCmd(const CFE_EVS_EnableAppEvents_t *data) +int32 CFE_EVS_EnableAppEventsCmd(const CFE_EVS_EnableAppEventsCmd_t *data) { EVS_AppData_t *AppDataPtr; const CFE_EVS_AppNameCmd_Payload_t *CmdPtr = &data->Payload; @@ -1321,7 +1321,7 @@ int32 CFE_EVS_EnableAppEventsCmd(const CFE_EVS_EnableAppEvents_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_DisableAppEventsCmd(const CFE_EVS_DisableAppEvents_t *data) +int32 CFE_EVS_DisableAppEventsCmd(const CFE_EVS_DisableAppEventsCmd_t *data) { EVS_AppData_t *AppDataPtr; const CFE_EVS_AppNameCmd_Payload_t *CmdPtr = &data->Payload; @@ -1381,7 +1381,7 @@ int32 CFE_EVS_DisableAppEventsCmd(const CFE_EVS_DisableAppEvents_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_ResetAppCounterCmd(const CFE_EVS_ResetAppCounter_t *data) +int32 CFE_EVS_ResetAppCounterCmd(const CFE_EVS_ResetAppCounterCmd_t *data) { EVS_AppData_t *AppDataPtr; const CFE_EVS_AppNameCmd_Payload_t *CmdPtr = &data->Payload; @@ -1441,7 +1441,7 @@ int32 CFE_EVS_ResetAppCounterCmd(const CFE_EVS_ResetAppCounter_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_ResetFilterCmd(const CFE_EVS_ResetFilter_t *data) +int32 CFE_EVS_ResetFilterCmd(const CFE_EVS_ResetFilterCmd_t *data) { const CFE_EVS_AppNameEventIDCmd_Payload_t *CmdPtr = &data->Payload; EVS_BinFilter_t *FilterPtr; @@ -1515,7 +1515,7 @@ int32 CFE_EVS_ResetFilterCmd(const CFE_EVS_ResetFilter_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_ResetAllFiltersCmd(const CFE_EVS_ResetAllFilters_t *data) +int32 CFE_EVS_ResetAllFiltersCmd(const CFE_EVS_ResetAllFiltersCmd_t *data) { EVS_AppData_t *AppDataPtr; const CFE_EVS_AppNameCmd_Payload_t *CmdPtr = &data->Payload; @@ -1578,7 +1578,7 @@ int32 CFE_EVS_ResetAllFiltersCmd(const CFE_EVS_ResetAllFilters_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_AddEventFilterCmd(const CFE_EVS_AddEventFilter_t *data) +int32 CFE_EVS_AddEventFilterCmd(const CFE_EVS_AddEventFilterCmd_t *data) { const CFE_EVS_AppNameEventIDMaskCmd_Payload_t *CmdPtr = &data->Payload; EVS_BinFilter_t *FilterPtr; @@ -1671,7 +1671,7 @@ int32 CFE_EVS_AddEventFilterCmd(const CFE_EVS_AddEventFilter_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilter_t *data) +int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilterCmd_t *data) { const CFE_EVS_AppNameEventIDCmd_Payload_t *CmdPtr = &data->Payload; EVS_BinFilter_t *FilterPtr; @@ -1749,7 +1749,7 @@ int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilter_t *data) ** Assumptions and Notes: ** */ -int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFile_t *data) +int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFileCmd_t *data) { int32 Result; osal_id_t FileHandle; diff --git a/fsw/cfe-core/src/evs/cfe_evs_task.h b/fsw/cfe-core/src/evs/cfe_evs_task.h index bf6007f3b..40a5e3aea 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_task.h +++ b/fsw/cfe-core/src/evs/cfe_evs_task.h @@ -140,31 +140,31 @@ extern CFE_EVS_GlobalData_t CFE_EVS_GlobalData; * Functions used within this module and by the unit test */ extern int32 CFE_EVS_TaskInit (void); -extern void CFE_EVS_ProcessCommandPacket(CFE_MSG_Message_t *MsgPtr); +extern void CFE_EVS_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr); /* * EVS Message Handler Functions */ -int32 CFE_EVS_ReportHousekeepingCmd (const CFE_SB_CmdHdr_t *data); -int32 CFE_EVS_NoopCmd(const CFE_EVS_Noop_t *data); -int32 CFE_EVS_ClearLogCmd(const CFE_EVS_ClearLog_t *data); -int32 CFE_EVS_ResetCountersCmd(const CFE_EVS_ResetCounters_t *data); -int32 CFE_EVS_SetFilterCmd(const CFE_EVS_SetFilter_t *data); -int32 CFE_EVS_EnablePortsCmd(const CFE_EVS_EnablePorts_t *data); -int32 CFE_EVS_DisablePortsCmd(const CFE_EVS_DisablePorts_t *data); -int32 CFE_EVS_EnableEventTypeCmd(const CFE_EVS_EnableEventType_t *data); -int32 CFE_EVS_DisableEventTypeCmd(const CFE_EVS_DisableEventType_t *data); -int32 CFE_EVS_SetEventFormatModeCmd(const CFE_EVS_SetEventFormatMode_t *data); -int32 CFE_EVS_EnableAppEventTypeCmd(const CFE_EVS_EnableAppEventType_t *data); -int32 CFE_EVS_DisableAppEventTypeCmd(const CFE_EVS_DisableAppEventType_t *data); -int32 CFE_EVS_EnableAppEventsCmd(const CFE_EVS_EnableAppEvents_t *data); -int32 CFE_EVS_DisableAppEventsCmd(const CFE_EVS_DisableAppEvents_t *data); -int32 CFE_EVS_ResetAppCounterCmd(const CFE_EVS_ResetAppCounter_t *data); -int32 CFE_EVS_ResetFilterCmd(const CFE_EVS_ResetFilter_t *data); -int32 CFE_EVS_AddEventFilterCmd(const CFE_EVS_AddEventFilter_t *data); -int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilter_t *data); -int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFile_t *data); -int32 CFE_EVS_ResetAllFiltersCmd(const CFE_EVS_ResetAllFilters_t *data); +int32 CFE_EVS_ReportHousekeepingCmd(const CFE_MSG_CommandHeader_t *data); +int32 CFE_EVS_NoopCmd(const CFE_EVS_NoopCmd_t *data); +int32 CFE_EVS_ClearLogCmd(const CFE_EVS_ClearLogCmd_t *data); +int32 CFE_EVS_ResetCountersCmd(const CFE_EVS_ResetCountersCmd_t *data); +int32 CFE_EVS_SetFilterCmd(const CFE_EVS_SetFilterCmd_t *data); +int32 CFE_EVS_EnablePortsCmd(const CFE_EVS_EnablePortsCmd_t *data); +int32 CFE_EVS_DisablePortsCmd(const CFE_EVS_DisablePortsCmd_t *data); +int32 CFE_EVS_EnableEventTypeCmd(const CFE_EVS_EnableEventTypeCmd_t *data); +int32 CFE_EVS_DisableEventTypeCmd(const CFE_EVS_DisableEventTypeCmd_t *data); +int32 CFE_EVS_SetEventFormatModeCmd(const CFE_EVS_SetEventFormatModeCmd_t *data); +int32 CFE_EVS_EnableAppEventTypeCmd(const CFE_EVS_EnableAppEventTypeCmd_t *data); +int32 CFE_EVS_DisableAppEventTypeCmd(const CFE_EVS_DisableAppEventTypeCmd_t *data); +int32 CFE_EVS_EnableAppEventsCmd(const CFE_EVS_EnableAppEventsCmd_t *data); +int32 CFE_EVS_DisableAppEventsCmd(const CFE_EVS_DisableAppEventsCmd_t *data); +int32 CFE_EVS_ResetAppCounterCmd(const CFE_EVS_ResetAppCounterCmd_t *data); +int32 CFE_EVS_ResetFilterCmd(const CFE_EVS_ResetFilterCmd_t *data); +int32 CFE_EVS_AddEventFilterCmd(const CFE_EVS_AddEventFilterCmd_t *data); +int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilterCmd_t *data); +int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFileCmd_t *data); +int32 CFE_EVS_ResetAllFiltersCmd(const CFE_EVS_ResetAllFiltersCmd_t *data); #endif /* _cfe_evs_task_ */ diff --git a/fsw/cfe-core/src/evs/cfe_evs_utils.c b/fsw/cfe-core/src/evs/cfe_evs_utils.c index 74993f862..c1cb9b25d 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_utils.c +++ b/fsw/cfe-core/src/evs/cfe_evs_utils.c @@ -404,7 +404,7 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 int ExpandedLength; /* Initialize EVS event packets */ - CFE_MSG_Init(&LongEventTlm.TlmHeader.BaseMsg, CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), + CFE_MSG_Init(&LongEventTlm.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), sizeof(LongEventTlm)); LongEventTlm.Payload.PacketID.EventID = EventID; LongEventTlm.Payload.PacketID.EventType = EventType; @@ -428,7 +428,7 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 LongEventTlm.Payload.PacketID.ProcessorID = CFE_PSP_GetProcessorId(); /* Set the packet timestamp */ - CFE_MSG_SetMsgTime((CFE_MSG_Message_t *) &LongEventTlm, *TimeStamp); + CFE_MSG_SetMsgTime(&LongEventTlm.TlmHeader.Msg, *TimeStamp); /* Write event to the event log */ EVS_AddLog(&LongEventTlm); @@ -439,7 +439,7 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 if (CFE_EVS_GlobalData.EVS_TlmPkt.Payload.MessageFormatMode == CFE_EVS_MsgFormat_LONG) { /* Send long event via SoftwareBus */ - CFE_SB_SendMsg((CFE_MSG_Message_t *) &LongEventTlm); + CFE_SB_TransmitMsg(&LongEventTlm.TlmHeader.Msg, true); } else if (CFE_EVS_GlobalData.EVS_TlmPkt.Payload.MessageFormatMode == CFE_EVS_MsgFormat_SHORT) { @@ -449,11 +449,11 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 * * This goes out on a separate message ID. */ - CFE_MSG_Init(&ShortEventTlm.TlmHeader.BaseMsg, CFE_SB_ValueToMsgId(CFE_EVS_SHORT_EVENT_MSG_MID), + CFE_MSG_Init(&ShortEventTlm.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_EVS_SHORT_EVENT_MSG_MID), sizeof(ShortEventTlm)); - CFE_MSG_SetMsgTime((CFE_MSG_Message_t *) &ShortEventTlm, *TimeStamp); + CFE_MSG_SetMsgTime(&ShortEventTlm.TlmHeader.Msg, *TimeStamp); ShortEventTlm.Payload.PacketID = LongEventTlm.Payload.PacketID; - CFE_SB_SendMsg((CFE_MSG_Message_t *) &ShortEventTlm); + CFE_SB_TransmitMsg(&ShortEventTlm.TlmHeader.Msg, true); } /* Increment message send counters (prevent rollover) */ diff --git a/fsw/cfe-core/src/inc/cfe_error.h b/fsw/cfe-core/src/inc/cfe_error.h index b561c2bfa..872c89f03 100644 --- a/fsw/cfe-core/src/inc/cfe_error.h +++ b/fsw/cfe-core/src/inc/cfe_error.h @@ -717,7 +717,7 @@ typedef int32 CFE_Status_t; /** * @brief Time Out * - * In #CFE_SB_RcvMsg, this return value indicates that a packet has not + * In #CFE_SB_ReceiveBuffer, this return value indicates that a packet has not * been received in the time given in the "timeout" parameter. * */ @@ -727,7 +727,7 @@ typedef int32 CFE_Status_t; /** * @brief No Message * - * When "Polling" a pipe for a message in #CFE_SB_RcvMsg, this return + * When "Polling" a pipe for a message in #CFE_SB_ReceiveBuffer, this return * value indicates that there was not a message on the pipe. * */ @@ -796,9 +796,8 @@ typedef int32 CFE_Status_t; /** * @brief Buffer Allocation Error * - * This error code will be returned from #CFE_SB_SendMsg when the memory - * in the SB message buffer pool has been depleted. The amount of memory - * in the pool is dictated by the configuration parameter + * Returned when the memory in the SB message buffer pool has been depleted. + * The amount of memory in the pool is dictated by the configuration parameter * #CFE_PLATFORM_SB_BUF_MEMORY_BYTES specified in the cfe_platform_cfg.h file. Also * the memory statistics, including current utilization figures and high * water marks for the SB Buffer memory pool can be monitored by sending diff --git a/fsw/cfe-core/src/inc/cfe_es_msg.h b/fsw/cfe-core/src/inc/cfe_es_msg.h index 96fdc420b..7748b52df 100644 --- a/fsw/cfe-core/src/inc/cfe_es_msg.h +++ b/fsw/cfe-core/src/inc/cfe_es_msg.h @@ -39,8 +39,6 @@ ** Includes */ #include "cfe_es_extern_typedefs.h" - -/* The CFE_SB_CMD_HDR_SIZE and CFE_SB_TLM_HDR_SIZE are defined by cfe_sb.h */ #include "cfe_sb.h" /* @@ -58,7 +56,7 @@ ** \cfecmdmnemonic \ES_NOOP ** ** \par Command Structure -** #CFE_ES_NoArgsCmd_t +** #CFE_ES_NoopCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -94,7 +92,7 @@ ** \cfecmdmnemonic \ES_RESETCTRS ** ** \par Command Structure -** #CFE_ES_NoArgsCmd_t +** #CFE_ES_ResetCountersCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -138,7 +136,7 @@ ** \cfecmdmnemonic \ES_RESET ** ** \par Command Structure -** #CFE_ES_RestartCmd_Payload_t +** #CFE_ES_RestartCmd_t ** ** \par Command Verification ** Successful execution of this command (as a Processor Reset) @@ -182,7 +180,7 @@ ** \cfecmdmnemonic \ES_STARTAPP ** ** \par Command Structure -** #CFE_ES_StartApp_t +** #CFE_ES_StartAppCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -232,7 +230,7 @@ ** \cfecmdmnemonic \ES_STOPAPP ** ** \par Command Structure -** #CFE_ES_AppNameCmd_t +** #CFE_ES_StopAppCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -279,7 +277,7 @@ ** \cfecmdmnemonic \ES_RESTARTAPP ** ** \par Command Structure -** #CFE_ES_AppNameCmd_t +** #CFE_ES_RestartAppCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -325,7 +323,7 @@ ** \cfecmdmnemonic \ES_RELOADAPP ** ** \par Command Structure -** #CFE_ES_ReloadApp_t +** #CFE_ES_ReloadAppCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -367,7 +365,7 @@ ** \cfecmdmnemonic \ES_QUERYAPP ** ** \par Command Structure -** #CFE_ES_AppNameCmd_t +** #CFE_ES_QueryOneCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -405,7 +403,7 @@ ** \cfecmdmnemonic \ES_WRITEAPPINFO2FILE ** ** \par Command Structure -** #CFE_ES_FileNameCmd_t +** #CFE_ES_QueryAllCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -446,7 +444,7 @@ ** \cfecmdmnemonic \ES_CLEARSYSLOG ** ** \par Command Structure -** #CFE_ES_NoArgsCmd_t +** #CFE_ES_ClearSysLogCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -485,7 +483,7 @@ ** \cfecmdmnemonic \ES_WRITESYSLOG2FILE ** ** \par Command Structure -** #CFE_ES_FileNameCmd_t +** #CFE_ES_WriteSysLogCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -528,7 +526,7 @@ ** \cfecmdmnemonic \ES_CLEARERLOG ** ** \par Command Structure -** #CFE_ES_NoArgsCmd_t +** #CFE_ES_ClearERLogCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -565,7 +563,7 @@ ** \cfecmdmnemonic \ES_WRITEERLOG2FILE ** ** \par Command Structure -** #CFE_ES_FileNameCmd_t +** #CFE_ES_WriteERLogCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -606,7 +604,7 @@ ** \cfecmdmnemonic \ES_STARTLADATA ** ** \par Command Structure -** #CFE_ES_StartPerfData_t +** #CFE_ES_StartPerfDataCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -652,7 +650,7 @@ ** \cfecmdmnemonic \ES_STOPLADATA ** ** \par Command Structure -** #CFE_ES_StopPerfData_t +** #CFE_ES_StopPerfDataCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -695,7 +693,7 @@ ** \cfecmdmnemonic \ES_LAFILTERMASK ** ** \par Command Structure -** #CFE_ES_SetPerfFilterMask_t +** #CFE_ES_SetPerfFilterMaskCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -733,7 +731,7 @@ ** \cfecmdmnemonic \ES_LATRIGGERMASK ** ** \par Command Structure -** #CFE_ES_SetPerfTriggerMask_t +** #CFE_ES_SetPerfTriggerMaskCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -773,7 +771,7 @@ ** \cfecmdmnemonic \ES_OVERWRITESYSLOGMODE ** ** \par Command Structure -** #CFE_ES_OverWriteSyslog_t +** #CFE_ES_OverWriteSysLogCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -815,7 +813,7 @@ ** \cfecmdmnemonic \ES_RESETPRCNT ** ** \par Command Structure -** #CFE_ES_NoArgsCmd_t +** #CFE_ES_ResetPRCountCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -853,7 +851,7 @@ ** \cfecmdmnemonic \ES_SETMAXPRCNT ** ** \par Command Structure -** #CFE_ES_SetMaxPRCount_t +** #CFE_ES_SetMaxPRCountCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -894,7 +892,7 @@ ** \cfecmdmnemonic \ES_DELETECDS ** ** \par Command Structure -** #CFE_ES_DeleteCDS_t +** #CFE_ES_DeleteCDSCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -937,7 +935,7 @@ ** \cfecmdmnemonic \ES_TLMPOOLSTATS ** ** \par Command Structure -** #CFE_ES_SendMemPoolStats_t +** #CFE_ES_SendMemPoolStatsCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -979,7 +977,7 @@ ** \cfecmdmnemonic \ES_DUMPCDSREG ** ** \par Command Structure -** #CFE_ES_DumpCDSRegistry_t +** #CFE_ES_DumpCDSRegistryCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -1020,7 +1018,7 @@ ** \cfecmdmnemonic \ES_WRITETASKINFO2FILE ** ** \par Command Structure -** #CFE_ES_FileNameCmd_t +** #CFE_ES_QueryAllTasksCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -1072,8 +1070,7 @@ */ typedef struct CFE_ES_NoArgsCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ } CFE_ES_NoArgsCmd_t; /* @@ -1083,14 +1080,14 @@ typedef struct CFE_ES_NoArgsCmd * allows them to change independently in the future without changing the prototype * of the handler function. */ -typedef CFE_ES_NoArgsCmd_t CFE_ES_Noop_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetCounters_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearSyslog_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearERLog_t; -typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetPRCount_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_NoopCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetCountersCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearSysLogCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearERLogCmd_t; +typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetPRCountCmd_t; /** -** \brief Restart cFE Command +** \brief Restart cFE Command Payload ** ** For command details, see #CFE_ES_RESTART_CC ** @@ -1101,15 +1098,17 @@ typedef struct CFE_ES_RestartCmd_Payload or #CFE_PSP_RST_TYPE_POWERON=Power-On Reset */ } CFE_ES_RestartCmd_Payload_t; -typedef struct CFE_ES_Restart +/** + * \brief Restart cFE Command + */ +typedef struct CFE_ES_RestartCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_RestartCmd_Payload_t Payload; -} CFE_ES_Restart_t; - + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_RestartCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_RestartCmd_t; /** -** \brief Payload format for commands which accept a single file name +** \brief Generic file name command payload ** ** This format is shared by several executive services commands. ** For command details, see #CFE_ES_QUERY_ALL_CC, #CFE_ES_QUERY_ALL_TASKS_CC, @@ -1122,23 +1121,26 @@ typedef struct CFE_ES_FileNameCmd_Payload filename of file in which Application data is to be dumped */ } CFE_ES_FileNameCmd_Payload_t; +/** + * \brief Generic file name command + */ typedef struct CFE_ES_FileNameCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_FileNameCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_FileNameCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_FileNameCmd_t; /* * Unique typedefs for each of the commands that utilize the FileNameCmd * packet format */ -typedef CFE_ES_FileNameCmd_t CFE_ES_QueryAll_t; -typedef CFE_ES_FileNameCmd_t CFE_ES_QueryAllTasks_t; -typedef CFE_ES_FileNameCmd_t CFE_ES_WriteSyslog_t; -typedef CFE_ES_FileNameCmd_t CFE_ES_WriteERLog_t; +typedef CFE_ES_FileNameCmd_t CFE_ES_QueryAllCmd_t; +typedef CFE_ES_FileNameCmd_t CFE_ES_QueryAllTasksCmd_t; +typedef CFE_ES_FileNameCmd_t CFE_ES_WriteSysLogCmd_t; +typedef CFE_ES_FileNameCmd_t CFE_ES_WriteERLogCmd_t; /** -** \brief Overwrite/Discard System Log Configuration Command +** \brief Overwrite/Discard System Log Configuration Command Payload ** ** For command details, see #CFE_ES_OVER_WRITE_SYSLOG_CC ** @@ -1150,14 +1152,17 @@ typedef struct CFE_ES_OverWriteSysLogCmd_Payload } CFE_ES_OverWriteSysLogCmd_Payload_t; -typedef struct CFE_ES_OverWriteSyslog +/** + * \brief Overwrite/Discard System Log Configuration Command Payload + */ +typedef struct CFE_ES_OverWriteSysLogCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_OverWriteSysLogCmd_Payload_t Payload; -} CFE_ES_OverWriteSyslog_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_OverWriteSysLogCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_OverWriteSysLogCmd_t; /** -** \brief Start Application Command +** \brief Start Application Command Payload ** ** For command details, see #CFE_ES_START_APP_CC ** @@ -1179,14 +1184,17 @@ typedef struct CFE_ES_StartAppCmd_Payload } CFE_ES_StartAppCmd_Payload_t; +/** + * \brief Start Application Command + */ typedef struct CFE_ES_StartApp { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_StartAppCmd_Payload_t Payload; -} CFE_ES_StartApp_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_StartAppCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_StartAppCmd_t; /** -** \brief Command Structure for Commands requiring just an Application Name +** \brief Generic application name command payload ** ** For command details, see #CFE_ES_STOP_APP_CC, #CFE_ES_RESTART_APP_CC, #CFE_ES_QUERY_ONE_CC ** @@ -1196,10 +1204,13 @@ typedef struct CFE_ES_AppNameCmd_Payload char Application[CFE_MISSION_MAX_API_LEN]; /**< \brief ASCII text string containing Application Name */ } CFE_ES_AppNameCmd_Payload_t; +/** + * \brief Generic application name command + */ typedef struct CFE_ES_AppNameCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_AppNameCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_ES_AppNameCmd_t; /* @@ -1207,12 +1218,12 @@ typedef struct CFE_ES_AppNameCmd * Create a separate typedef for each one so they can all evolve independently * without affecting the prototype. */ -typedef CFE_ES_AppNameCmd_t CFE_ES_StopApp_t; -typedef CFE_ES_AppNameCmd_t CFE_ES_RestartApp_t; -typedef CFE_ES_AppNameCmd_t CFE_ES_QueryOne_t; +typedef CFE_ES_AppNameCmd_t CFE_ES_StopAppCmd_t; +typedef CFE_ES_AppNameCmd_t CFE_ES_RestartAppCmd_t; +typedef CFE_ES_AppNameCmd_t CFE_ES_QueryOneCmd_t; /** -** \brief Reload Application Command +** \brief Reload Application Command Payload ** ** For command details, see #CFE_ES_RELOAD_APP_CC ** @@ -1224,14 +1235,17 @@ typedef struct CFE_ES_AppReloadCmd_Payload executable image */ } CFE_ES_AppReloadCmd_Payload_t; -typedef struct CFE_ES_ReloadApp +/** + * \brief Reload Application Command + */ +typedef struct CFE_ES_ReloadAppCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_AppReloadCmd_Payload_t Payload; -} CFE_ES_ReloadApp_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_AppReloadCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_ReloadAppCmd_t; /** -** \brief Set Maximum Processor Reset Count Command +** \brief Set Maximum Processor Reset Count Command Payload ** ** For command details, see #CFE_ES_SET_MAX_PR_COUNT_CC ** @@ -1242,14 +1256,17 @@ typedef struct CFE_ES_SetMaxPRCountCmd_Payload an automatic Power-On Reset is performed */ } CFE_ES_SetMaxPRCountCmd_Payload_t; -typedef struct CFE_ES_SetMaxPRCount +/** + * \brief Set Maximum Processor Reset Count Command + */ +typedef struct CFE_ES_SetMaxPRCountCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_SetMaxPRCountCmd_Payload_t Payload; -} CFE_ES_SetMaxPRCount_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_SetMaxPRCountCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_SetMaxPRCountCmd_t; /** -** \brief Delete Critical Data Store Command +** \brief Delete Critical Data Store Command Payload ** ** For command details, see #CFE_ES_DELETE_CDS_CC ** @@ -1260,14 +1277,17 @@ typedef struct CFE_ES_DeleteCDSCmd_Payload } CFE_ES_DeleteCDSCmd_Payload_t; -typedef struct CFE_ES_DeleteCDS +/** + * \brief Delete Critical Data Store Command + */ +typedef struct CFE_ES_DeleteCDSCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_DeleteCDSCmd_Payload_t Payload; -} CFE_ES_DeleteCDS_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_DeleteCDSCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_DeleteCDSCmd_t; /** -** \brief Start Performance Analyzer Command +** \brief Start Performance Analyzer Command Payload ** ** For command details, see #CFE_ES_START_PERF_DATA_CC ** @@ -1277,14 +1297,17 @@ typedef struct CFE_ES_StartPerfCmd_Payload uint32 TriggerMode; /**< \brief Desired trigger position (Start, Center, End) */ } CFE_ES_StartPerfCmd_Payload_t; -typedef struct CFE_ES_StartPerfData +/** + * \brief Start Performance Analyzer Command + */ +typedef struct CFE_ES_StartPerfDataCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_StartPerfCmd_Payload_t Payload; -} CFE_ES_StartPerfData_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_StartPerfCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_StartPerfDataCmd_t; /** -** \brief Stop Performance Analyzer Command +** \brief Stop Performance Analyzer Command Payload ** ** For command details, see #CFE_ES_STOP_PERF_DATA_CC ** @@ -1295,15 +1318,18 @@ typedef struct CFE_ES_StopPerfCmd_Payload of file Performance Analyzer data is to be written */ } CFE_ES_StopPerfCmd_Payload_t; -typedef struct CFE_ES_StopPerfData +/** + * \brief Stop Performance Analyzer Command + */ +typedef struct CFE_ES_StopPerfDataCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_StopPerfCmd_Payload_t Payload; -} CFE_ES_StopPerfData_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_StopPerfCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_StopPerfDataCmd_t; /** -** \brief Set Performance Analyzer Filter Mask Command +** \brief Set Performance Analyzer Filter Mask Command Payload ** ** For command details, see #CFE_ES_SET_PERF_FILTER_MASK_CC ** @@ -1315,14 +1341,17 @@ typedef struct CFE_ES_SetPerfFilterMaskCmd_Payload } CFE_ES_SetPerfFilterMaskCmd_Payload_t; -typedef struct CFE_ES_SetPerfFilterMask +/** + * \brief Set Performance Analyzer Filter Mask Command + */ +typedef struct CFE_ES_SetPerfFilterMaskCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_SetPerfFilterMaskCmd_Payload_t Payload; -} CFE_ES_SetPerfFilterMask_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_SetPerfFilterMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_SetPerfFilterMaskCmd_t; /** -** \brief Set Performance Analyzer Trigger Mask Command +** \brief Set Performance Analyzer Trigger Mask Command Payload ** ** For command details, see #CFE_ES_SET_PERF_TRIGGER_MASK_CC ** @@ -1334,14 +1363,17 @@ typedef struct CFE_ES_SetPerfTrigMaskCmd_Payload } CFE_ES_SetPerfTrigMaskCmd_Payload_t; -typedef struct CFE_ES_SetPerfTriggerMask +/** + * \brief Set Performance Analyzer Trigger Mask Command + */ +typedef struct CFE_ES_SetPerfTriggerMaskCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_SetPerfTrigMaskCmd_Payload_t Payload; -} CFE_ES_SetPerfTriggerMask_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_SetPerfTrigMaskCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_SetPerfTriggerMaskCmd_t; /** -** \brief Telemeter Memory Pool Statistics Command +** \brief Send Memory Pool Statistics Command Payload ** ** For command details, see #CFE_ES_SEND_MEM_POOL_STATS_CC ** @@ -1353,14 +1385,17 @@ typedef struct CFE_ES_SendMemPoolStatsCmd_Payload } CFE_ES_SendMemPoolStatsCmd_Payload_t; -typedef struct CFE_ES_SendMemPoolStats +/** + * \brief Send Memory Pool Statistics Command + */ +typedef struct CFE_ES_SendMemPoolStatsCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_SendMemPoolStatsCmd_Payload_t Payload; -} CFE_ES_SendMemPoolStats_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_SendMemPoolStatsCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_SendMemPoolStatsCmd_t; /** -** \brief Dump CDS Registry Command +** \brief Dump CDS Registry Command Payload ** ** For command details, see #CFE_ES_DUMP_CDS_REGISTRY_CC ** @@ -1371,12 +1406,14 @@ typedef struct CFE_ES_DumpCDSRegistryCmd_Payload of file CDS Registry is to be written */ } CFE_ES_DumpCDSRegistryCmd_Payload_t; -typedef struct CFE_ES_DumpCDSRegistry +/** + * \brief Dump CDS Registry Command + */ +typedef struct CFE_ES_DumpCDSRegistryCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_ES_DumpCDSRegistryCmd_Payload_t Payload; - -} CFE_ES_DumpCDSRegistry_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_ES_DumpCDSRegistryCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_ES_DumpCDSRegistryCmd_t; /*************************************************************************/ @@ -1529,8 +1566,8 @@ typedef struct CFE_ES_OneAppTlm_Payload typedef struct CFE_ES_OneAppTlm { - CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */ - CFE_ES_OneAppTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_ES_OneAppTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_ES_OneAppTlm_t; /** @@ -1545,8 +1582,8 @@ typedef struct CFE_ES_PoolStatsTlm_Payload typedef struct CFE_ES_MemStatsTlm { - CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */ - CFE_ES_PoolStatsTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_ES_PoolStatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_ES_MemStatsTlm_t; /*************************************************************************/ @@ -1642,8 +1679,8 @@ typedef struct CFE_ES_HousekeepingTlm_Payload typedef struct CFE_ES_HousekeepingTlm { - CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */ - CFE_ES_HousekeepingTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_ES_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_ES_HousekeepingTlm_t; diff --git a/fsw/cfe-core/src/inc/cfe_evs.h b/fsw/cfe-core/src/inc/cfe_evs.h index 044c5b539..9b0a62517 100644 --- a/fsw/cfe-core/src/inc/cfe_evs.h +++ b/fsw/cfe-core/src/inc/cfe_evs.h @@ -214,7 +214,7 @@ CFE_Status_t CFE_EVS_Unregister( void ); ** in the format string; they will mess up the formatting when the events are ** displayed on the ground system. ** -** \return Execution status below or from #CFE_ES_GetAppID/#CFE_SB_SendMsg, see \ref CFEReturnCodes +** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_EVS_APP_NOT_REGISTERED \copybrief CFE_EVS_APP_NOT_REGISTERED ** \retval #CFE_EVS_APP_ILLEGAL_APP_ID \copybrief CFE_EVS_APP_ILLEGAL_APP_ID @@ -265,7 +265,7 @@ CFE_Status_t CFE_EVS_SendEvent (uint16 EventID, ** in the format string; they will mess up the formatting when the events are ** displayed on the ground system. ** -** \return Execution status below or from #CFE_ES_GetAppID/#CFE_SB_SendMsg, see \ref CFEReturnCodes +** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_EVS_APP_NOT_REGISTERED \copybrief CFE_EVS_APP_NOT_REGISTERED ** \retval #CFE_EVS_APP_ILLEGAL_APP_ID \copybrief CFE_EVS_APP_ILLEGAL_APP_ID @@ -317,7 +317,7 @@ CFE_Status_t CFE_EVS_SendEventWithAppID (uint16 EventID, ** in the format string; they will mess up the formatting when the events are ** displayed on the ground system. ** -** \return Execution status below or from #CFE_ES_GetAppID/#CFE_SB_SendMsg, see \ref CFEReturnCodes +** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_EVS_APP_NOT_REGISTERED \copybrief CFE_EVS_APP_NOT_REGISTERED ** \retval #CFE_EVS_APP_ILLEGAL_APP_ID \copybrief CFE_EVS_APP_ILLEGAL_APP_ID diff --git a/fsw/cfe-core/src/inc/cfe_evs_msg.h b/fsw/cfe-core/src/inc/cfe_evs_msg.h index 63c9496ef..5bbc90761 100644 --- a/fsw/cfe-core/src/inc/cfe_evs_msg.h +++ b/fsw/cfe-core/src/inc/cfe_evs_msg.h @@ -56,7 +56,7 @@ ** \cfecmdmnemonic \EVS_NOOP ** ** \par Command Structure -** #CFE_TBL_NoArgsCmd_t +** #CFE_EVS_NoopCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -90,7 +90,7 @@ ** \cfecmdmnemonic \EVS_RESETCTRS ** ** \par Command Structure -** #CFE_TBL_NoArgsCmd_t +** #CFE_EVS_ResetCountersCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -128,7 +128,7 @@ ** \cfecmdmnemonic \EVS_ENAEVENTTYPE ** ** \par Command Structure -** #CFE_EVS_BitMaskCmd_t +** #CFE_EVS_EnableEventTypeCmd_t ** The following bit positions apply to structure member named 'BitMask'. ** Bit 0 - Debug ** Bit 1 - Informational @@ -177,7 +177,7 @@ ** \cfecmdmnemonic \EVS_DISEVENTTYPE ** ** \par Command Structure -** #CFE_EVS_BitMaskCmd_t +** #CFE_EVS_DisableEventTypeCmd_t ** The following bit positions apply to structure member named 'BitMask'. ** Bit 0 - Debug ** Bit 1 - Informational @@ -235,7 +235,7 @@ ** \cfecmdmnemonic \EVS_SETEVTFMT ** ** \par Command Structure -** #CFE_EVS_SetLogMode_t +** #CFE_EVS_SetEventFormatModeCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -278,7 +278,7 @@ ** \cfecmdmnemonic \EVS_ENAAPPEVTTYPE ** ** \par Command Structure -** #CFE_EVS_AppNameBitMaskCmd_t +** #CFE_EVS_EnableAppEventTypeCmd_t ** The following bit positions apply to structure member named 'BitMask'. ** Bit 0 - Debug ** Bit 1 - Informational @@ -330,7 +330,7 @@ ** \cfecmdmnemonic \EVS_DISAPPEVTTYPE ** ** \par Command Structure -** #CFE_EVS_AppNameBitMaskCmd_t +** #CFE_EVS_DisableAppEventTypeCmd_t ** The following bit positions apply to structure member named 'BitMask'. ** Bit 0 - Debug ** Bit 1 - Informational @@ -379,7 +379,7 @@ ** \cfecmdmnemonic \EVS_ENAAPPEVGEN ** ** \par Command Structure -** #CFE_EVS_AppNameCmd_t +** #CFE_EVS_EnableAppEventsCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -420,7 +420,7 @@ ** \cfecmdmnemonic \EVS_DISAPPEVGEN ** ** \par Command Structure -** #CFE_EVS_AppNameCmd_t +** #CFE_EVS_DisableAppEventsCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -461,7 +461,7 @@ ** \cfecmdmnemonic \EVS_RSTAPPCTRS ** ** \par Command Structure -** #CFE_EVS_AppNameCmd_t +** #CFE_EVS_ResetAppCounterCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -500,7 +500,7 @@ ** \cfecmdmnemonic \EVS_SETBINFLTRMASK ** ** \par Command Structure -** #CFE_EVS_AppNameEventIDMaskCmd_t +** #CFE_EVS_SetFilterCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -539,7 +539,7 @@ ** \cfecmdmnemonic \EVS_ENAPORT ** ** \par Command Structure -** #CFE_EVS_BitMaskCmd_t +** #CFE_EVS_EnablePortsCmd_t ** The following bit positions apply to structure member named 'BitMask'. ** Bit 0 - Port 1 ** Bit 1 - Port 2 @@ -579,7 +579,7 @@ ** \cfecmdmnemonic \EVS_DISPORT ** ** \par Command Structure -** #CFE_EVS_BitMaskCmd_t +** #CFE_EVS_DisablePortsCmd_t ** The following bit positions apply to structure member named 'BitMask'. ** Bit 0 - Port 1 ** Bit 1 - Port 2 @@ -621,7 +621,7 @@ ** \cfecmdmnemonic \EVS_RSTBINFLTRCTR ** ** \par Command Structure -** #CFE_EVS_AppNameEventIDCmd_t +** #CFE_EVS_ResetFilterCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -657,7 +657,7 @@ ** \cfecmdmnemonic \EVS_RSTALLFLTRS ** ** \par Command Structure -** #CFE_EVS_AppNameCmd_t +** #CFE_EVS_ResetAllFiltersCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -693,7 +693,7 @@ ** \cfecmdmnemonic \EVS_ADDEVTFLTR ** ** \par Command Structure -** #CFE_EVS_AppNameEventIDMaskCmd_t +** #CFE_EVS_AddEventFilterCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -729,7 +729,7 @@ ** \cfecmdmnemonic \EVS_DELEVTFLTR ** ** \par Command Structure -** #CFE_EVS_AppNameEventIDCmd_t +** #CFE_EVS_DeleteEventFilterCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -765,7 +765,7 @@ ** \cfecmdmnemonic \EVS_WRITEAPPDATA2FILE ** ** \par Command Structure -** #CFE_EVS_WriteAppDataFile_t +** #CFE_EVS_WriteAppDataFileCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -800,7 +800,7 @@ ** \cfecmdmnemonic \EVS_WRITELOG2FILE ** ** \par Command Structure -** #CFE_EVS_WriteLogDataFile_t +** #CFE_EVS_WriteLogDataFileCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -833,7 +833,7 @@ ** \cfecmdmnemonic \EVS_SETLOGMODE ** ** \par Command Structure -** #CFE_EVS_SetLogMode_t +** #CFE_EVS_SetLogModeCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -869,7 +869,7 @@ ** \cfecmdmnemonic \EVS_CLRLOG ** ** \par Command Structure -** #CFE_TBL_NoArgsCmd_t +** #CFE_EVS_ClearLogCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -919,7 +919,7 @@ ** \brief Command with no additional arguments **/ typedef struct CFE_EVS_NoArgsCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ } CFE_EVS_NoArgsCmd_t; /* @@ -927,28 +927,31 @@ typedef struct CFE_EVS_NoArgsCmd { * Create a unique type for each one so the prototypes will follow the naming pattern, * allowing each command to evolve independently. */ -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_Noop_t; -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ResetCounters_t; -typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ClearLog_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_NoopCmd_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ResetCountersCmd_t; +typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ClearLogCmd_t; /** -** \brief Write Event Log to File Command +** \brief Write Event Log to File Command Payload ** ** For command details, see #CFE_EVS_WRITE_LOG_DATA_FILE_CC ** **/ typedef struct CFE_EVS_LogFileCmd_Payload { - char LogFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where log data is to be written */ + char LogFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where log data is to be written */ } CFE_EVS_LogFileCmd_Payload_t; -typedef struct CFE_EVS_WriteLogDataFile { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_LogFileCmd_Payload_t Payload; -} CFE_EVS_WriteLogDataFile_t; +/** + * \brief Write Event Log to File Command + */ +typedef struct CFE_EVS_WriteLogDataFileCmd { + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_LogFileCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_WriteLogDataFileCmd_t; /** -** \brief Write Event Services Application Information to File Command +** \brief Write Event Services Application Information to File Command Payload ** ** For command details, see #CFE_EVS_WRITE_APP_DATA_FILE_CC ** @@ -957,31 +960,37 @@ typedef struct CFE_EVS_AppDataCmd_Payload { char AppDataFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename where applicaton data is to be written */ } CFE_EVS_AppDataCmd_Payload_t; -typedef struct CFE_EVS_WriteAppDataFile { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_AppDataCmd_Payload_t Payload; -} CFE_EVS_WriteAppDataFile_t; +/** + * \brief Write Event Services Application Information to File Command + */ +typedef struct CFE_EVS_WriteAppDataFileCmd { + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_AppDataCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_WriteAppDataFileCmd_t; /** -** \brief Set Event Format Mode or Set Log Mode Commands +** \brief Set Log Mode Command Payload ** -** For command details, see #CFE_EVS_SET_EVENT_FORMAT_MODE_CC and/or #CFE_EVS_SET_LOG_MODE_CC +** For command details, see #CFE_EVS_SET_LOG_MODE_CC ** **/ typedef struct CFE_EVS_SetLogMode_Payload { CFE_EVS_LogMode_Enum_t LogMode; /**< \brief Mode to use in the command*/ - uint8 Spare; /**< \brief Pad to even byte*/ + uint8 Spare; /**< \brief Pad to even byte*/ } CFE_EVS_SetLogMode_Payload_t; -typedef struct CFE_EVS_SetLogMode { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_SetLogMode_Payload_t Payload; -} CFE_EVS_SetLogMode_t; +/** + * \brief Set Log Mode Command + */ +typedef struct CFE_EVS_SetLogModeCmd { + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_SetLogMode_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_SetLogModeCmd_t; /** -** \brief Set Event Format Mode or Set Log Mode Commands +** \brief Set Event Format Mode Command Payload ** -** For command details, see #CFE_EVS_SET_EVENT_FORMAT_MODE_CC and/or #CFE_EVS_SET_LOG_MODE_CC +** For command details, see #CFE_EVS_SET_EVENT_FORMAT_MODE_CC ** **/ typedef struct CFE_EVS_SetEventFormatCode_Payload { @@ -989,13 +998,16 @@ typedef struct CFE_EVS_SetEventFormatCode_Payload { uint8 Spare; /**< \brief Pad to even byte*/ } CFE_EVS_SetEventFormatMode_Payload_t; -typedef struct CFE_EVS_SetEventFormatMode { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_SetEventFormatMode_Payload_t Payload; -} CFE_EVS_SetEventFormatMode_t; +/** + * \brief Set Event Format Mode Command + */ +typedef struct CFE_EVS_SetEventFormatModeCmd { + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_SetEventFormatMode_Payload_t Payload; /**< \brief Command payload */ +} CFE_EVS_SetEventFormatModeCmd_t; /** -** \brief Enable/Disable Events or Ports Commands +** \brief Generic Bitmask Command Payload ** ** For command details, see #CFE_EVS_ENABLE_EVENT_TYPE_CC, #CFE_EVS_DISABLE_EVENT_TYPE_CC, ** #CFE_EVS_ENABLE_PORTS_CC and/or #CFE_EVS_DISABLE_PORTS_CC @@ -1006,9 +1018,12 @@ typedef struct CFE_EVS_BitMaskCmd_Payload { uint8 Spare; /**< \brief Pad to even byte*/ } CFE_EVS_BitMaskCmd_Payload_t; +/** + * \brief Generic Bitmask Command + */ typedef struct CFE_EVS_BitMaskCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_BitMaskCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_BitMaskCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_BitMaskCmd_t; /* @@ -1016,13 +1031,13 @@ typedef struct CFE_EVS_BitMaskCmd { * Create a unique type for each one so the prototypes will follow the naming pattern, * allowing each command to evolve independently. */ -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnablePorts_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisablePorts_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnableEventType_t; -typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisableEventType_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnablePortsCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisablePortsCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_EnableEventTypeCmd_t; +typedef CFE_EVS_BitMaskCmd_t CFE_EVS_DisableEventTypeCmd_t; /** -** \brief Enable/Disable Application Events or Reset One or All Filter Counters +** \brief Generic App Name Command Payload ** ** For command details, see #CFE_EVS_ENABLE_APP_EVENTS_CC, #CFE_EVS_DISABLE_APP_EVENTS_CC, ** #CFE_EVS_RESET_APP_COUNTER_CC and/or #CFE_EVS_RESET_ALL_FILTERS_CC @@ -1032,9 +1047,12 @@ typedef struct CFE_EVS_AppNameCmd_Payload { char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Application name to use in the command*/ } CFE_EVS_AppNameCmd_Payload_t; +/** + * \brief Generic App Name Command + */ typedef struct CFE_EVS_AppNameCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_AppNameCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_AppNameCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_AppNameCmd_t; /* @@ -1042,15 +1060,15 @@ typedef struct CFE_EVS_AppNameCmd { * Create a unique type for each one so the prototypes will follow the naming pattern, * allowing each command to evolve independently. */ -typedef CFE_EVS_AppNameCmd_t CFE_EVS_EnableAppEvents_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_DisableAppEvents_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAppCounter_t; -typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAllFilters_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_EnableAppEventsCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_DisableAppEventsCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAppCounterCmd_t; +typedef CFE_EVS_AppNameCmd_t CFE_EVS_ResetAllFiltersCmd_t; /** -** \brief Reset an Event Filter for an Application +** \brief Generic App Name and Event ID Command Payload ** -** For command details, see #CFE_EVS_RESET_FILTER_CC +** For command details, see #CFE_EVS_RESET_FILTER_CC and #CFE_EVS_DELETE_EVENT_FILTER_CC ** **/ typedef struct CFE_EVS_AppNameEventIDCmd_Payload { @@ -1058,9 +1076,12 @@ typedef struct CFE_EVS_AppNameEventIDCmd_Payload { uint16 EventID; /**< \brief Event ID to use in the command*/ } CFE_EVS_AppNameEventIDCmd_Payload_t; +/** + * \brief Generic App Name and Event ID Command + */ typedef struct CFE_EVS_AppNameEventIDCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_AppNameEventIDCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_AppNameEventIDCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_AppNameEventIDCmd_t; /* @@ -1068,11 +1089,11 @@ typedef struct CFE_EVS_AppNameEventIDCmd { * Create a unique type for each one so the prototypes will follow the naming pattern, * allowing each command to evolve independently. */ -typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_ResetFilter_t; -typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_DeleteEventFilter_t; +typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_ResetFilterCmd_t; +typedef CFE_EVS_AppNameEventIDCmd_t CFE_EVS_DeleteEventFilterCmd_t; /** -** \brief Enable/Disable an Event Type for an Application +** \brief Generic App Name and Bitmask Command Payload ** ** For command details, see #CFE_EVS_ENABLE_APP_EVENT_TYPE_CC and/or #CFE_EVS_DISABLE_APP_EVENT_TYPE_CC ** @@ -1083,9 +1104,12 @@ typedef struct CFE_EVS_AppNameBitMaskCmd_Payload { uint8 Spare; /**< \brief Pad to even byte*/ } CFE_EVS_AppNameBitMaskCmd_Payload_t; +/** + * \brief Generic App Name and Bitmask Command + */ typedef struct CFE_EVS_AppNameBitMaskCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_AppNameBitMaskCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_AppNameBitMaskCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_AppNameBitMaskCmd_t; /* @@ -1093,11 +1117,11 @@ typedef struct CFE_EVS_AppNameBitMaskCmd { * Create a unique type for each one so the prototypes will follow the naming pattern, * allowing each command to evolve independently. */ -typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_EnableAppEventType_t; -typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_DisableAppEventType_t; +typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_EnableAppEventTypeCmd_t; +typedef CFE_EVS_AppNameBitMaskCmd_t CFE_EVS_DisableAppEventTypeCmd_t; /** -** \brief Set, Add or Delete an Event Filter for an Application +** \brief Generic App Name, Event ID, Mask Command Payload ** ** For command details, see #CFE_EVS_SET_FILTER_CC, #CFE_EVS_ADD_EVENT_FILTER_CC ** and/or #CFE_EVS_DELETE_EVENT_FILTER_CC @@ -1109,9 +1133,12 @@ typedef struct CFE_EVS_AppNameEventIDMaskCmd_Payload { uint16 Mask; /**< \brief Mask to use in the command */ } CFE_EVS_AppNameEventIDMaskCmd_Payload_t; +/** + * \brief Generic App Name, Event ID, Mask Command + */ typedef struct CFE_EVS_AppNameEventIDMaskCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_EVS_AppNameEventIDMaskCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_EVS_AppNameEventIDMaskCmd_t; /* @@ -1119,8 +1146,8 @@ typedef struct CFE_EVS_AppNameEventIDMaskCmd { * Create a unique type for each one so the prototypes will follow the naming pattern, * allowing each command to evolve independently. */ -typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_AddEventFilter_t; -typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_SetFilter_t; +typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_AddEventFilterCmd_t; +typedef CFE_EVS_AppNameEventIDMaskCmd_t CFE_EVS_SetFilterCmd_t; /*************************************************************************/ /**********************************/ @@ -1181,8 +1208,8 @@ typedef struct CFE_EVS_HousekeepingTlm_Payload { } CFE_EVS_HousekeepingTlm_Payload_t; typedef struct CFE_EVS_HousekeepingTlm { - CFE_SB_TlmHdr_t TlmHeader; - CFE_EVS_HousekeepingTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_EVS_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_EVS_HousekeepingTlm_t; /** Telemetry packet structures */ @@ -1224,14 +1251,14 @@ typedef struct CFE_EVS_ShortEventTlm_Payload { } CFE_EVS_ShortEventTlm_Payload_t; typedef struct CFE_EVS_LongEventTlm { - CFE_SB_TlmHdr_t TlmHeader; - CFE_EVS_LongEventTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_EVS_LongEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_EVS_LongEventTlm_t; typedef struct CFE_EVS_ShortEventTlm { - CFE_SB_TlmHdr_t TlmHeader; - CFE_EVS_ShortEventTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_EVS_ShortEventTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_EVS_ShortEventTlm_t; diff --git a/fsw/cfe-core/src/inc/cfe_msg_typedefs.h b/fsw/cfe-core/src/inc/cfe_msg_typedefs.h index c30454ad4..4df7bfd41 100644 --- a/fsw/cfe-core/src/inc/cfe_msg_typedefs.h +++ b/fsw/cfe-core/src/inc/cfe_msg_typedefs.h @@ -43,7 +43,7 @@ /* * Types */ -typedef uint32 CFE_MSG_Size_t; /**< \brief Message size (CCSDS needs uint32 for max size) */ +typedef size_t CFE_MSG_Size_t; /**< \brief Message size (CCSDS needs uint32 for max size) */ typedef uint32 CFE_MSG_Checksum_t; /**< \brief Message checksum (Oversized to avoid redefine) */ typedef uint16 CFE_MSG_FcnCode_t; /**< \brief Message function code */ typedef uint16 CFE_MSG_HeaderVersion_t; /**< \brief Message header version */ diff --git a/fsw/cfe-core/src/inc/cfe_sb.h b/fsw/cfe-core/src/inc/cfe_sb.h index e81d5c794..551fd71b5 100644 --- a/fsw/cfe-core/src/inc/cfe_sb.h +++ b/fsw/cfe-core/src/inc/cfe_sb.h @@ -48,8 +48,8 @@ /* ** Defines */ -#define CFE_SB_POLL 0 /**< \brief Option used with #CFE_SB_RcvMsg to request immediate pipe status */ -#define CFE_SB_PEND_FOREVER -1 /**< \brief Option used with #CFE_SB_RcvMsg to force a wait for next message */ +#define CFE_SB_POLL 0 /**< \brief Option used with #CFE_SB_ReceiveBuffer to request immediate pipe status */ +#define CFE_SB_PEND_FOREVER -1 /**< \brief Option used with #CFE_SB_ReceiveBuffer to force a wait for next message */ #define CFE_SB_SUB_ENTRIES_PER_PKT 20 /**< \brief Configuration parameter used by SBN App */ #define CFE_SB_SUBSCRIPTION 0 /**< \brief Subtype specifier used in #CFE_SB_SingleSubscriptionTlm_t by SBN App */ #define CFE_SB_UNSUBSCRIPTION 1 /**< \brief Subtype specified used in #CFE_SB_SingleSubscriptionTlm_t by SBN App */ @@ -131,29 +131,30 @@ ** Type Definitions */ -#ifndef CFE_OMIT_DEPRECATED_6_8 /** \brief Software Bus generic message */ -typedef CFE_MSG_Message_t CFE_SB_Msg_t; -#endif /* CFE_OMIT_DEPRECATED_6_8 */ +typedef union CFE_SB_Msg { + CFE_MSG_Message_t Msg; /**< \brief Base message type without enforced alignment */ + long long int LongInt; /**< \brief Align to support Long Integer */ + long double LongDouble; /**< \brief Align to support Long Double */ +} CFE_SB_Buffer_t; -/** \brief Aligned Software Bus command header */ -typedef union CFE_SB_CmdHdr { - CFE_MSG_CommandHeader_t Cmd; - CFE_MSG_Message_t BaseMsg; -} CFE_SB_CmdHdr_t; +#ifndef CFE_OMIT_DEPRECATED_6_8 +/** \brief Deperecated type to minimize required changes */ +typedef CFE_SB_Buffer_t CFE_SB_Msg_t; -/** \brief Aligned Software Bus telemetry header */ -typedef union CFE_SB_TlmHdr { - CFE_MSG_TelemetryHeader_t Tlm; - CFE_MSG_Message_t BaseMsg; -} CFE_SB_TlmHdr_t; +/** \brief Deperecated type to minimize required changes */ +typedef CFE_MSG_CommandHeader_t CFE_SB_CmdHdr_t; -#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_SB_CmdHdr_t))/**< \brief Size of #CFE_SB_CmdHdr_t in bytes */ -#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_SB_TlmHdr_t))/**< \brief Size of #CFE_SB_TlmHdr_t in bytes */ +/** \brief Deperecated type to minimize required changes */ +typedef CFE_MSG_TelemetryHeader_t CFE_SB_TlmHdr_t; + +#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t))/**< \brief Size of command header */ +#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_MSG_TelemetryHeader_t))/**< \brief Size of telemetry header */ +#endif /* CFE_OMIT_DEPRECATED_6_8 */ /** \brief CFE_SB_TimeOut_t to primitive type definition ** -** Internally used by SB in the #CFE_SB_RcvMsg API. Translated from the +** Internally used by SB in the #CFE_SB_ReceiveBuffer API. Translated from the ** input parmater named TimeOut which specifies the maximum time in ** milliseconds that the caller wants to wait for a message. */ @@ -513,7 +514,40 @@ CFE_Status_t CFE_SB_UnsubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeI /*****************************************************************************/ /** -** \brief Send a software bus message +** \brief Transmit a message +** +** \par Description +** This routine copies the specified message into a software bus +** buffer which is then transmitted to all subscribers. The +** software bus will read the message ID from the message header to +** determine which pipes should receive the message. +** +** \par Assumptions, External Events, and Notes: +** - This routine will not normally wait for the receiver tasks to +** process the message before returning control to the caller's task. +** - However, if a higher priority task is pending and subscribed to +** this message, that task may get to run before returning +** control to the caller. +** +** \param[in] MsgPtr A pointer to the message to be sent. This must point +** to the first byte of the message header. +** \param[in] IncrementSequenceCount Boolean to increment the internally tracked +** sequence count and update the message if the +** buffer contains a telemetry message +** +** \return Execution status, see \ref CFEReturnCodes +** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS +** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT +** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG +** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR +**/ +CFE_Status_t CFE_SB_TransmitMsg(CFE_MSG_Message_t *MsgPtr, bool IncrementSequenceCount); + +#ifndef CFE_OMIT_DEPRECATED_6_8 +/*****************************************************************************/ +/** +** \brief DEPRECATED: Send a software bus message +** \deprecated Use CFE_SB_TransmitMsg ** ** \par Description ** This routine sends the specified message to all subscribers. The @@ -524,8 +558,8 @@ CFE_Status_t CFE_SB_UnsubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeI ** - This routine will not normally wait for the receiver tasks to ** process the message before returning control to the caller's task. ** - However, if a higher priority task is pending and subscribed to -** this message, that task may get to run before #CFE_SB_SendMsg -** returns control to the caller. +** this message, that task may get to run before returning +** control to the caller. ** - This function tracks and increments the source sequence counter ** of a telemetry message. ** @@ -537,14 +571,13 @@ CFE_Status_t CFE_SB_UnsubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeI ** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT ** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG ** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR -** -** \sa #CFE_SB_RcvMsg, #CFE_SB_ZeroCopySend, #CFE_SB_PassMsg **/ CFE_Status_t CFE_SB_SendMsg(CFE_MSG_Message_t *MsgPtr); /*****************************************************************************/ /** -** \brief Passes a software bus message +** \brief DEPRECATED: Passes a software bus message +** \deprecated Use CFE_SB_TransmitMsg ** ** \par Description ** This routine sends the specified message to all subscribers. The @@ -558,8 +591,7 @@ CFE_Status_t CFE_SB_SendMsg(CFE_MSG_Message_t *MsgPtr); ** - However, if a higher priority task is pending and subscribed to ** this message, that task may get to run before #CFE_SB_PassMsg ** returns control to the caller. -** - Unlike #CFE_SB_SendMsg this routine will preserve the source -** sequence counter in a telemetry message. +** - This routine will not modify the sequence counter in the message. ** ** \param[in] MsgPtr A pointer to the message to be sent. This must point ** to the first byte of the message header. @@ -569,10 +601,9 @@ CFE_Status_t CFE_SB_SendMsg(CFE_MSG_Message_t *MsgPtr); ** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT ** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG ** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR -** -** \sa #CFE_SB_RcvMsg, #CFE_SB_ZeroCopySend, #CFE_SB_SendMsg **/ CFE_Status_t CFE_SB_PassMsg(CFE_MSG_Message_t *MsgPtr); +#endif /* CFE_OMIT_DEPRECATED_6_8 */ /*****************************************************************************/ /** @@ -588,18 +619,16 @@ CFE_Status_t CFE_SB_PassMsg(CFE_MSG_Message_t *MsgPtr); ** random. Therefore, it is recommended that the return code be tested ** for CFE_SUCCESS before processing the message. ** -** \param[in, out] BufPtr A pointer to a message pointer. -** Typically a caller declares a ptr of type CFE_MSG_Message_t -** (i.e. CFE_MSG_Message_t *Ptr) then gives the address of that +** \param[in, out] BufPtr A pointer to the software bus buffer to receive to. +** Typically a caller declares a ptr of type CFE_SB_Buffer_t +** (i.e. CFE_SB_Buffer_t *Ptr) then gives the address of that ** pointer (&Ptr) as this parmeter. After a successful ** receipt of a message, *BufPtr will point to the first -** byte of the software bus message header. This should be +** byte of the software bus buffer. This should be ** used as a read-only pointer (in systems with an MMU, ** writes to this pointer may cause a memory protection fault). ** The *BufPtr is valid only until the next call to -** CFE_SB_RcvMsg for the same pipe. \n *BufPtr is a pointer -** to the message obtained from the pipe. Valid -** only until the next call to CFE_SB_RcvMsg for the same pipe. +** CFE_SB_ReceiveBuffer for the same pipe. ** ** \param[in] PipeId The pipe ID of the pipe containing the message to be obtained. ** @@ -614,13 +643,19 @@ CFE_Status_t CFE_SB_PassMsg(CFE_MSG_Message_t *MsgPtr); ** \retval #CFE_SB_TIME_OUT \copybrief CFE_SB_TIME_OUT ** \retval #CFE_SB_PIPE_RD_ERR \copybrief CFE_SB_PIPE_RD_ERR ** \retval #CFE_SB_NO_MESSAGE \copybrief CFE_SB_NO_MESSAGE -** -** \sa #CFE_SB_SendMsg, #CFE_SB_ZeroCopySend **/ -CFE_Status_t CFE_SB_RcvMsg(CFE_MSG_Message_t **BufPtr, CFE_SB_PipeId_t PipeId, int32 TimeOut); +CFE_Status_t CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int32 TimeOut); + +#if CFE_OMIT_DEPRECATED_6_8 +/** + * \brief DEPRECATED: receive buffer + * \deprecated use CFE_SB_ReceiveBuffer + */ +CFE_Status_t CFE_SB_RcvMsg(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int32 TimeOut); +#endif /* CFE_OMIT_DEPRECATED_6_8 */ /**@}*/ -/** @defgroup CFEAPISBZeroCopy cFE Zero Copy Message APIs +/** @defgroup CFEAPISBZeroCopy cFE Zero Copy APIs * @{ */ @@ -632,20 +667,20 @@ CFE_Status_t CFE_SB_RcvMsg(CFE_MSG_Message_t **BufPtr, CFE_SB_PipeId_t PipeId, ** This routine can be used to get a pointer to one of the software bus' ** internal memory buffers that are used for sending messages. The caller ** can use this memory buffer to build an SB message, then send it using -** the #CFE_SB_ZeroCopySend function. This interface is more complicated -** than the normal #CFE_SB_ZeroCopySend interface, but it avoids an extra +** the #CFE_SB_TransmitBuffer function. This interface is more complicated +** than the normal #CFE_SB_TransmitMsg interface, but it avoids an extra ** copy of the message from the user's memory buffer to the software bus ** internal buffer. The "zero copy" interface can be used to improve ** performance in high-rate, high-volume software bus traffic. ** ** \par Assumptions, External Events, and Notes: ** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for one -** call to #CFE_SB_ZeroCopySend. +** call to #CFE_SB_TransmitBuffer. ** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is -** equivalent to a \c malloc() and #CFE_SB_ZeroCopySend is equivalent to +** equivalent to a \c malloc() and #CFE_SB_TransmitBuffer is equivalent to ** a \c free(). ** -# Applications must not de-reference the message pointer (for reading -** or writing) after the call to #CFE_SB_ZeroCopySend. +** or writing) after the call to #CFE_SB_TransmitBuffer. ** ** \param[in] MsgSize The size of the SB message buffer the caller wants ** (including the SB message header). @@ -653,13 +688,11 @@ CFE_Status_t CFE_SB_RcvMsg(CFE_MSG_Message_t **BufPtr, CFE_SB_PipeId_t PipeId, ** \param[out] BufferHandle A handle that must be supplied when sending or releasing ** in zero copy mode. ** -** \return A pointer to a memory buffer that can be used to build one SB message -** for use with #CFE_SB_ZeroCopySend. -** -** \sa #CFE_SB_ZeroCopyReleasePtr, #CFE_SB_ZeroCopySend +** \return A pointer to a memory buffer that message data can be written to +** for use with #CFE_SB_TransmitBuffer. **/ -CFE_MSG_Message_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, - CFE_SB_ZeroCopyHandle_t *BufferHandle); +CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, + CFE_SB_ZeroCopyHandle_t *BufferHandle); /*****************************************************************************/ /** @@ -673,11 +706,11 @@ CFE_MSG_Message_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, ** -# This function is not needed for normal "zero copy" transfers. It ** is needed only for cleanup when an application gets a pointer using ** #CFE_SB_ZeroCopyGetPtr, but (due to some error condition) never uses -** that pointer for a #CFE_SB_ZeroCopySend +** that pointer for a #CFE_SB_TransmitBuffer ** ** \param[in] Ptr2Release A pointer to the SB internal buffer. This must be a ** pointer returned by a call to #CFE_SB_ZeroCopyGetPtr, -** but never used in a call to #CFE_SB_ZeroCopySend. +** but never used in a call to #CFE_SB_TransmitBuffer. ** ** \param[in] BufferHandle This must be the handle supplied with the pointer ** when #CFE_SB_ZeroCopyGetPtr was called. @@ -685,37 +718,78 @@ CFE_MSG_Message_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_SB_BUFFER_INVALID \copybrief CFE_SB_BUFFER_INVALID +**/ +CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t BufferHandle); + +/*****************************************************************************/ +/** +** \brief Transmit a buffer +** +** \par Description +** This routine sends a message that has been created directly in an +** internal SB message buffer by an application (after a call to +** #CFE_SB_ZeroCopyGetPtr). This interface is more complicated than +** the normal #CFE_SB_TransmitMsg interface, but it avoids an extra copy of +** the message from the user's memory buffer to the software bus +** internal buffer. The "zero copy" interface can be used to improve +** performance in high-rate, high-volume software bus traffic. ** -** \sa #CFE_SB_ZeroCopyGetPtr, #CFE_SB_ZeroCopySend +** \par Assumptions, External Events, and Notes: +** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for +** one call to #CFE_SB_TransmitBuffer. +** -# Callers must not use the same SB message buffer for multiple sends. +** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is +** equivalent to a \c malloc() and #CFE_SB_TransmitBuffer is equivalent +** to a \c free(). +** -# Applications must not de-reference the message pointer (for reading +** or writing) after the call to #CFE_SB_TransmitBuffer. +** -# This function will increment and apply the internally tracked +** sequence counter if set to do so. +** +** \param[in] BufPtr A pointer to the buffer to be sent. +** \param[in] ZeroCopyHandle The handle supplied by the #CFE_SB_ZeroCopyGetPtr call +** \param[in] IncrementSequenceCount Boolean to increment the internally tracked +** sequence count and update the message if the +** buffer contains a telemetry message +** +** \return Execution status, see \ref CFEReturnCodes +** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS +** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT +** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG +** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR **/ -CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_MSG_Message_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t BufferHandle); +CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, + CFE_SB_ZeroCopyHandle_t ZeroCopyHandle, + bool IncrementSequenceCount); +#ifndef CFE_OMIT_DEPRECATED_6_8 /*****************************************************************************/ /** -** \brief Send an SB message in "zero copy" mode. +** \brief DEPRECATED: Send an SB message in "zero copy" mode. +** \deprecated use CFE_SB_TransmitBuffer ** ** \par Description ** This routine sends a message that has been created directly in an ** internal SB message buffer by an application (after a call to ** #CFE_SB_ZeroCopyGetPtr). This interface is more complicated than -** the normal #CFE_SB_SendMsg interface, but it avoids an extra copy of +** the normal #CFE_SB_TransmitMsg interface, but it avoids an extra copy of ** the message from the user's memory buffer to the software bus ** internal buffer. The "zero copy" interface can be used to improve ** performance in high-rate, high-volume software bus traffic. ** ** \par Assumptions, External Events, and Notes: ** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for -** one call to #CFE_SB_ZeroCopySend. +** one call to #CFE_SB_TransmitBuffer. ** -# Callers must not use the same SB message buffer for multiple sends. ** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is -** equivalent to a \c malloc() and #CFE_SB_ZeroCopySend is equivalent +** equivalent to a \c malloc() and #CFE_SB_TransmitBuffer is equivalent ** to a \c free(). ** -# Applications must not de-reference the message pointer (for reading -** or writing) after the call to #CFE_SB_ZeroCopySend. +** or writing) after the call to #CFE_SB_TransmitBuffer. ** -# This function tracks and increments the source sequence counter ** of a telemetry message. ** -** \param[in] MsgPtr A pointer to the SB message to be sent. +** \param[in] BufPtr A pointer to the SB buffer to be sent. ** ** \param[in] BufferHandle The handle supplied with the #CFE_SB_ZeroCopyGetPtr call. ** @@ -725,20 +799,19 @@ CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_MSG_Message_t *Ptr2Release, CFE_SB_Ze ** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG ** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR ** \retval #CFE_SB_BUFFER_INVALID \copybrief CFE_SB_BUFFER_INVALID -** -** \sa #CFE_SB_SendMsg, #CFE_SB_RcvMsg, #CFE_SB_ZeroCopyReleasePtr, #CFE_SB_ZeroCopyGetPtr **/ -CFE_Status_t CFE_SB_ZeroCopySend(CFE_MSG_Message_t *MsgPtr, CFE_SB_ZeroCopyHandle_t BufferHandle); +CFE_Status_t CFE_SB_ZeroCopySend(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle); /*****************************************************************************/ /** -** \brief Pass an SB message in "zero copy" mode. +** \brief DEPRECATED: Pass an SB message in "zero copy" mode. +** \deprecated use CFE_SB_TransmitBuffer ** ** \par Description ** This routine sends a message that has been created directly in an ** internal SB message buffer by an application (after a call to ** #CFE_SB_ZeroCopyGetPtr). This interface is more complicated than -** the normal #CFE_SB_SendMsg interface, but it avoids an extra copy of +** the normal #CFE_SB_TransmitMsg interface, but it avoids an extra copy of ** the message from the user's memory buffer to the software bus ** internal buffer. The "zero copy" interface can be used to improve ** performance in high-rate, high-volume software bus traffic. This @@ -747,17 +820,17 @@ CFE_Status_t CFE_SB_ZeroCopySend(CFE_MSG_Message_t *MsgPtr, CFE_SB_ZeroCopyHandl ** ** \par Assumptions, External Events, and Notes: ** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for -** one call to #CFE_SB_ZeroCopySend or #CFE_SB_ZeroCopyPass. +** one call to #CFE_SB_TransmitBuffer or #CFE_SB_ZeroCopyPass. ** -# Callers must not use the same SB message buffer for multiple sends. ** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is ** equivalent to a \c malloc() and #CFE_SB_ZeroCopyPass is equivalent ** to a \c free(). ** -# Applications must not de-reference the message pointer (for reading ** or writing) after the call to #CFE_SB_ZeroCopyPass. -** -# Unlike #CFE_SB_ZeroCopySend this routine will preserve the source -** sequence counter in a telemetry message. +** -# This routine will not modify the sequence counter in a telemetry +** message ** -** \param[in] MsgPtr A pointer to the SB message to be sent. +** \param[in] BufPtr A pointer to the SB buffer to be sent. ** ** \param[in] BufferHandle The handle supplied with the #CFE_SB_ZeroCopyGetPtr call. ** @@ -767,11 +840,10 @@ CFE_Status_t CFE_SB_ZeroCopySend(CFE_MSG_Message_t *MsgPtr, CFE_SB_ZeroCopyHandl ** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG ** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR ** \retval #CFE_SB_BUFFER_INVALID \copybrief CFE_SB_BUFFER_INVALID -** -** \sa #CFE_SB_PassMsg, #CFE_SB_ZeroCopySend, #CFE_SB_ZeroCopyReleasePtr, #CFE_SB_ZeroCopyGetPtr **/ -CFE_Status_t CFE_SB_ZeroCopyPass(CFE_MSG_Message_t *MsgPtr, CFE_SB_ZeroCopyHandle_t BufferHandle); +CFE_Status_t CFE_SB_ZeroCopyPass(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle); /**@}*/ +#endif /** @defgroup CFEAPISBSetMessage cFE Setting Message Characteristics APIs * @{ diff --git a/fsw/cfe-core/src/inc/cfe_sb_events.h b/fsw/cfe-core/src/inc/cfe_sb_events.h index 464d4a519..87ac2798c 100644 --- a/fsw/cfe-core/src/inc/cfe_sb_events.h +++ b/fsw/cfe-core/src/inc/cfe_sb_events.h @@ -361,7 +361,7 @@ ** ** \par Cause: ** -** This error event message is issued when the #CFE_SB_SendMsg API receives an +** This error event message is issued when a transmit API receives an ** invalid (possibly NULL) ptr as an argument. **/ #define CFE_SB_SEND_BAD_ARG_EID 13 @@ -373,7 +373,7 @@ ** ** \par Cause: ** -** This info event message is issued when the #CFE_SB_SendMsg API is called and there +** This info event message is issued when a transmit API is called and there ** are no subscribers (therefore no destinations) for the message to be sent. Each ** time the SB detects this situation, the corresponding SB telemetry point is ** incremented.. @@ -391,7 +391,7 @@ ** ** \par Cause: ** -** This error event message is issued when the #CFE_SB_SendMsg API is called and the +** This error event message is issued when a transmit API is called and the ** packet length field in the message header implies that the message size exceeds ** the max size defined by mission cfg param #CFE_MISSION_SB_MAX_SB_MSG_SIZE. The request to ** send the message is denied, there is no partial packet sent. @@ -405,7 +405,7 @@ ** ** \par Cause: ** -** This error event message is issued when the #CFE_SB_SendMsg API fails to receive +** This error event message is issued when a transmit API fails to receive ** the necessary buffer memory from the ES memory pool. This could be an indication ** that the cfg param #CFE_PLATFORM_SB_BUF_MEMORY_BYTES is set too low. To check this, send SB ** cmd to dump the SB statistics pkt and view the buffer memory parameters. @@ -419,7 +419,7 @@ ** ** \par Cause: ** -** This error event message is issued when the #CFE_SB_SendMsg API cannot route the +** This error event message is issued when a transmit API cannot route the ** MsgId (displayed in event) to the pipe (displayed in the event) because the pipe ** currently contains the maximum number of messages of this type (MsgId). This is ** typically an indication that the receiver is not reading its pipe fast enough, or @@ -439,7 +439,7 @@ ** \par Cause: ** ** This error event message is issued when an invalid paramter is passed into the -** #CFE_SB_RcvMsg API. Two possibile problems would be the first parameter (*BufPtr) +** #CFE_SB_ReceiveBuffer API. Two possibile problems would be the first parameter (*BufPtr) ** being NULL or the third paramter (TimeOut) being less than -1. **/ #define CFE_SB_RCV_BAD_ARG_EID 18 @@ -452,7 +452,7 @@ ** \par Cause: ** ** This error event message is issued when an invalid PipeId is passed into the -** #CFE_SB_RcvMsg API. The SB Pipe Table shows all valid PipeIds and may be viewed +** #CFE_SB_ReceiveBuffer API. The SB Pipe Table shows all valid PipeIds and may be viewed ** for verification. **/ #define CFE_SB_BAD_PIPEID_EID 19 @@ -479,7 +479,7 @@ ** ** \par Cause: ** -** This error event message is issued when the #CFE_SB_SendMsg API is called and +** This error event message is issued when a transmit API is called and ** the SB discovers that the message to send has a msg id that is invalid. It may be ** due to a msg id that is greater than cfg parameter #CFE_PLATFORM_SB_HIGHEST_VALID_MSGID **/ @@ -519,7 +519,7 @@ ** ** \par Cause: ** -** This error event message is issued when the #CFE_SB_SendMsg API is called and +** This error event message is issued when a transmit API is called and ** encounters an error when attempting to write the msg to the destination pipe ** (which is an underlying queue). This could indicate that the owner of the pipe is ** not readings its messages fast enough or at all. It may also mean that the @@ -535,7 +535,7 @@ ** ** \par Cause: ** -** This error event message is issued when the #CFE_SB_SendMsg API is called and +** This error event message is issued when a transmit API is called and ** encounters an error when attempting to write the msg to the destination pipe ** (which is an underlying queue). More precisely, the OS API #OS_QueuePut has ** returned an unexpected error. The return code is displayed in the event. For @@ -551,7 +551,7 @@ ** ** \par Cause: ** -** This error event message is issued when the #CFE_SB_SendMsg API is called and +** This error event message is issued when a transmit API is called and ** encounters an error when attempting to read the msg from the destination pipe ** (which is an underlying queue). More precisely, the OS API #OS_QueueGet has ** returned an unexpected error. The return code is displayed in the event. For diff --git a/fsw/cfe-core/src/inc/cfe_sb_msg.h b/fsw/cfe-core/src/inc/cfe_sb_msg.h index 03407b0c9..cdf37ccef 100644 --- a/fsw/cfe-core/src/inc/cfe_sb_msg.h +++ b/fsw/cfe-core/src/inc/cfe_sb_msg.h @@ -54,7 +54,7 @@ ** \cfecmdmnemonic \SB_NOOP ** ** \par Command Structure -** #CFE_SB_CmdHdr_t +** #CFE_SB_NoopCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -88,7 +88,7 @@ ** \cfecmdmnemonic \SB_RESETCTRS ** ** \par Command Structure -** #CFE_SB_CmdHdr_t +** #CFE_SB_ResetCountersCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -125,7 +125,7 @@ ** \cfecmdmnemonic \SB_DUMPSTATS ** ** \par Command Structure -** #CFE_SB_CmdHdr_t +** #CFE_SB_SendSbStatsCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -164,7 +164,7 @@ ** \cfecmdmnemonic \SB_WRITEROUTING2FILE ** ** \par Command Structure -** #CFE_SB_WriteFileInfoCmd_t +** #CFE_SB_SendRoutingInfoCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -205,7 +205,7 @@ ** \cfecmdmnemonic \SB_ENAROUTE ** ** \par Command Structure -** #CFE_SB_RouteCmd_t +** #CFE_SB_EnableRouteCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -243,7 +243,7 @@ ** \cfecmdmnemonic \SB_DISROUTE ** ** \par Command Structure -** #CFE_SB_RouteCmd_t +** #CFE_SB_DisableRouteCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -291,7 +291,7 @@ ** \cfecmdmnemonic \SB_WRITEPIPE2FILE ** ** \par Command Structure -** #CFE_SB_WriteFileInfoCmd_t +** #CFE_SB_SendPipeInfoCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -336,7 +336,7 @@ ** \cfecmdmnemonic \SB_WRITEMAP2FILE ** ** \par Command Structure -** #CFE_SB_WriteFileInfoCmd_t +** #CFE_SB_SendMapInfoCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -380,7 +380,7 @@ ** \cfecmdmnemonic \SB_ENASUBRPTG ** ** \par Command Structure -** #CFE_SB_CmdHdr_t +** #CFE_SB_EnableSubReportingCmd_t ** ** \par Command Verification ** Successful execution of this command will result in the sending @@ -413,7 +413,7 @@ ** \cfecmdmnemonic \SB_DISSUBRPTG ** ** \par Command Structure -** #CFE_SB_CmdHdr_t +** #CFE_SB_DisableSubReportingCmd_t ** ** \par Command Verification ** Successful execution of this command will result in the suppression @@ -445,7 +445,7 @@ ** \cfecmdmnemonic \SB_SENDPREVSUBS ** ** \par Command Structure -** #CFE_SB_CmdHdr_t +** #CFE_SB_SendPrevSubsCmd_t ** ** \par Command Verification ** Successful execution of this command will result in a series @@ -472,19 +472,19 @@ * SB Messages which have no payload are each * given unique typedefs to follow the command handler convention * - * For the SB application these is mapped to the CFE_SB_CmdHdr_t type, + * For the SB application these is mapped to the CFE_MSG_CommandHeader_t type, * as they contain only a primary + command header. */ -typedef CFE_SB_CmdHdr_t CFE_SB_Noop_t; -typedef CFE_SB_CmdHdr_t CFE_SB_ResetCounters_t; -typedef CFE_SB_CmdHdr_t CFE_SB_EnableSubReporting_t; -typedef CFE_SB_CmdHdr_t CFE_SB_DisableSubReporting_t; -typedef CFE_SB_CmdHdr_t CFE_SB_SendSbStats_t; -typedef CFE_SB_CmdHdr_t CFE_SB_SendPrevSubs_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_NoopCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_ResetCountersCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_EnableSubReportingCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_DisableSubReportingCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_SendSbStatsCmd_t; +typedef CFE_MSG_CommandHeader_t CFE_SB_SendPrevSubsCmd_t; /** -** \brief Write File Info Commands +** \brief Write File Info Command Payload ** ** This structure contains a generic definition used by three SB commands, ** 'Write Routing Info to File' #CFE_SB_SEND_ROUTING_INFO_CC, @@ -495,20 +495,23 @@ typedef struct CFE_SB_WriteFileInfoCmd_Payload { char Filename[CFE_MISSION_MAX_PATH_LEN];/**< \brief Path and Filename of data to be loaded */ } CFE_SB_WriteFileInfoCmd_Payload_t; +/** + * \brief Write File Info Command + */ typedef struct CFE_SB_WriteFileInfoCmd { - CFE_SB_CmdHdr_t Hdr;/**< \brief cFE Software Bus Command Message Header #CFE_SB_CmdHdr_t */ - CFE_SB_WriteFileInfoCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t Hdr; /**< \brief Command header */ + CFE_SB_WriteFileInfoCmd_Payload_t Payload; /**< \brief Command payload */ }CFE_SB_WriteFileInfoCmd_t; /* * Create a unique typedef for each of the commands that share this format. */ -typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_SendRoutingInfo_t; -typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_SendPipeInfo_t; -typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_SendMapInfo_t; +typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_SendRoutingInfoCmd_t; +typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_SendPipeInfoCmd_t; +typedef CFE_SB_WriteFileInfoCmd_t CFE_SB_SendMapInfoCmd_t; /** -** \brief Enable/Disable Route Commands +** \brief Enable/Disable Route Command Payload ** ** This structure contains a definition used by two SB commands, ** 'Enable Route' #CFE_SB_ENABLE_ROUTE_CC and 'Disable Route' #CFE_SB_DISABLE_ROUTE_CC. @@ -522,16 +525,19 @@ typedef struct CFE_SB_RouteCmd_Payload { uint8 Spare;/**<\brief Spare byte to make command even number of bytes */ } CFE_SB_RouteCmd_Payload_t; +/** + * \brief Enable/Disable Route Command + */ typedef struct CFE_SB_RouteCmd { - CFE_SB_CmdHdr_t Hdr;/**< \brief cFE Software Bus Command Message Header #CFE_SB_CmdHdr_t */ - CFE_SB_RouteCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t Hdr; /**< \brief Command header */ + CFE_SB_RouteCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_SB_RouteCmd_t; /* * Create a unique typedef for each of the commands that share this format. */ -typedef CFE_SB_RouteCmd_t CFE_SB_EnableRoute_t; -typedef CFE_SB_RouteCmd_t CFE_SB_DisableRoute_t; +typedef CFE_SB_RouteCmd_t CFE_SB_EnableRouteCmd_t; +typedef CFE_SB_RouteCmd_t CFE_SB_DisableRouteCmd_t; /**************************** ** SB Telemetry Formats ** @@ -584,8 +590,8 @@ typedef struct CFE_SB_HousekeepingTlm_Payload { } CFE_SB_HousekeepingTlm_Payload_t; typedef struct CFE_SB_HousekeepingTlm { - CFE_SB_TlmHdr_t Hdr;/**< \brief cFE Software Bus Telemetry Message Header */ - CFE_SB_HousekeepingTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t Hdr; /**< \brief Telemetry header */ + CFE_SB_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_HousekeepingTlm_t; @@ -612,7 +618,7 @@ typedef struct CFE_SB_PipeDepthStats { /** ** \cfesbtlm SB Statistics Telemetry Packet ** -** SB Statistics packet sent (via CFE_SB_SendMsg) in response to #CFE_SB_SEND_SB_STATS_CC +** SB Statistics packet sent in response to #CFE_SB_SEND_SB_STATS_CC */ typedef struct CFE_SB_StatsTlm_Payload { @@ -657,8 +663,8 @@ typedef struct CFE_SB_StatsTlm_Payload { } CFE_SB_StatsTlm_Payload_t; typedef struct CFE_SB_StatsTlm { - CFE_SB_TlmHdr_t Hdr;/**< \brief cFE Software Bus Telemetry Message Header */ - CFE_SB_StatsTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t Hdr; /**< \brief Telemetry header */ + CFE_SB_StatsTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_StatsTlm_t; @@ -708,8 +714,8 @@ typedef struct CFE_SB_SingleSubscriptionTlm_Payload { } CFE_SB_SingleSubscriptionTlm_Payload_t; typedef struct CFE_SB_SingleSubscriptionTlm { - CFE_SB_TlmHdr_t Hdr;/**< \brief cFE Software Bus Telemetry Message Header */ - CFE_SB_SingleSubscriptionTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t Hdr; /**< \brief Telemetry header */ + CFE_SB_SingleSubscriptionTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_SingleSubscriptionTlm_t; @@ -748,8 +754,8 @@ typedef struct CFE_SB_AllSubscriptionsTlm_Payload { } CFE_SB_AllSubscriptionsTlm_Payload_t; typedef struct CFE_SB_AllSubscriptionsTlm { - CFE_SB_TlmHdr_t Hdr;/**< \brief cFE Software Bus Telemetry Message Header */ - CFE_SB_AllSubscriptionsTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t Hdr; /**< \brief Telemetry header */ + CFE_SB_AllSubscriptionsTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_AllSubscriptionsTlm_t; diff --git a/fsw/cfe-core/src/inc/cfe_tbl_events.h b/fsw/cfe-core/src/inc/cfe_tbl_events.h index 6a40b6a45..e35245024 100644 --- a/fsw/cfe-core/src/inc/cfe_tbl_events.h +++ b/fsw/cfe-core/src/inc/cfe_tbl_events.h @@ -365,7 +365,7 @@ ** This event message is generated when failure occurs while attempting to send the ** Housekeeping Message over the Software Bus. ** -** The \c Status field of the event message contains the error code returned by #CFE_SB_SendMsg. +** The \c Status field of the event message contains the error code. **/ #define CFE_TBL_FAIL_HK_SEND_ERR_EID 56 @@ -838,7 +838,7 @@ ** ** The \c MsgId is the message ID of the table management notification message that was attempted to be sent, ** the \c CC is the command code, the \c Param is the application specified command parameter and the \c Status -** is the error code returned by the #CFE_SB_SendMsg API call. +** is the error code returned. **/ #define CFE_TBL_FAIL_NOTIFY_SEND_ERR_EID 89 /** \} */ diff --git a/fsw/cfe-core/src/inc/cfe_tbl_msg.h b/fsw/cfe-core/src/inc/cfe_tbl_msg.h index 3ae7bd792..e4d83d211 100644 --- a/fsw/cfe-core/src/inc/cfe_tbl_msg.h +++ b/fsw/cfe-core/src/inc/cfe_tbl_msg.h @@ -58,7 +58,7 @@ ** \cfecmdmnemonic \TBL_NOOP ** ** \par Command Structure -** #CFE_TBL_NoArgsCmd_t +** #CFE_TBL_NoopCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -95,7 +95,7 @@ ** \cfecmdmnemonic \TBL_RESETCTRS ** ** \par Command Structure -** #CFE_TBL_NoArgsCmd_t +** #CFE_TBL_ResetCountersCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -130,7 +130,7 @@ ** \cfecmdmnemonic \TBL_LOAD ** ** \par Command Structure -** #CFE_TBL_Load_t +** #CFE_TBL_LoadCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with @@ -184,7 +184,7 @@ ** \cfecmdmnemonic \TBL_DUMP ** ** \par Command Structure -** #CFE_TBL_Dump_t +** #CFE_TBL_DumpCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -230,7 +230,7 @@ ** \cfecmdmnemonic \TBL_VALIDATE ** ** \par Command Structure -** #CFE_TBL_Validate_t +** #CFE_TBL_ValidateCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the following @@ -286,7 +286,7 @@ ** \cfecmdmnemonic \TBL_ACTIVATE ** ** \par Command Structure -** #CFE_TBL_Activate_t +** #CFE_TBL_ActivateCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -326,7 +326,7 @@ ** \cfecmdmnemonic \TBL_WRITEREG2FILE ** ** \par Command Structure -** #CFE_TBL_DumpRegistry_t +** #CFE_TBL_DumpRegistryCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -366,7 +366,7 @@ ** \cfecmdmnemonic \TBL_TLMREG ** ** \par Command Structure -** #CFE_TBL_DumpRegistry_t +** #CFE_TBL_SendRegistryCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -405,7 +405,7 @@ ** \cfecmdmnemonic \TBL_DELETECDS ** ** \par Command Structure -** #CFE_TBL_DeleteCDS_t +** #CFE_TBL_DeleteCDSCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -448,7 +448,7 @@ ** \cfecmdmnemonic \TBL_LOADABORT ** ** \par Command Structure -** #CFE_TBL_AbortLoad_t +** #CFE_TBL_AbortLoadCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -492,8 +492,7 @@ */ typedef struct CFE_TBL_NoArgsCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ } CFE_TBL_NoArgsCmd_t; /* @@ -501,30 +500,31 @@ typedef struct CFE_TBL_NoArgsCmd * Allows each command to evolve independently, while following the command * handler prototype convention */ -typedef CFE_TBL_NoArgsCmd_t CFE_TBL_Noop_t; -typedef CFE_TBL_NoArgsCmd_t CFE_TBL_ResetCounters_t; +typedef CFE_TBL_NoArgsCmd_t CFE_TBL_NoopCmd_t; +typedef CFE_TBL_NoArgsCmd_t CFE_TBL_ResetCountersCmd_t; /** -** \brief Load Table Command +** \brief Load Table Command Payload ** ** For command details, see #CFE_TBL_LOAD_CC ** **/ typedef struct CFE_TBL_LoadCmd_Payload { - char LoadFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename (and path) of data to be loaded */ - /**< ASCII Character string containing full path - filename for file to be loaded */ + char LoadFilename[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename (and path) of data to be loaded */ } CFE_TBL_LoadCmd_Payload_t; -typedef struct CFE_TBL_Load +/** + * \brief Load Table Command + */ +typedef struct CFE_TBL_LoadCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_LoadCmd_Payload_t Payload; -} CFE_TBL_Load_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_LoadCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TBL_LoadCmd_t; /** -** \brief Dump Table Command +** \brief Dump Table Command Payload ** ** For command details, see #CFE_TBL_DUMP_CC */ @@ -544,14 +544,17 @@ typedef struct CFE_TBL_DumpCmd_Payload where data is to be dumped */ } CFE_TBL_DumpCmd_Payload_t; +/** + * /brief Dump Table Command + */ typedef struct CFE_TBL_DumpCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_DumpCmd_Payload_t Payload; -} CFE_TBL_Dump_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_DumpCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TBL_DumpCmd_t; /** -** \brief Validate Table Command +** \brief Validate Table Command Payload ** ** For command details, see #CFE_TBL_VALIDATE_CC */ @@ -568,14 +571,17 @@ typedef struct CFE_TBL_ValidateCmd_Payload identifier of table to be validated */ } CFE_TBL_ValidateCmd_Payload_t; -typedef struct CFE_TBL_Validate +/** + * \brief Validate Table Command + */ +typedef struct CFE_TBL_ValidateCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_ValidateCmd_Payload_t Payload; -} CFE_TBL_Validate_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_ValidateCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TBL_ValidateCmd_t; /** -** \brief Activate Table Command +** \brief Activate Table Command Payload ** ** For command details, see #CFE_TBL_ACTIVATE_CC */ @@ -586,14 +592,17 @@ typedef struct CFE_TBL_ActivateCmd_Payload identifier of table to be activated */ } CFE_TBL_ActivateCmd_Payload_t; -typedef struct CFE_TBL_Activate +/** + * \brief Activate Table Command + */ +typedef struct CFE_TBL_ActivateCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_ActivateCmd_Payload_t Payload; -} CFE_TBL_Activate_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_ActivateCmd_Payload_t Payload; /**< \brief Command paylod */ +} CFE_TBL_ActivateCmd_t; /** -** \brief Dump Registry Command +** \brief Dump Registry Command Payload ** ** For command details, see #CFE_TBL_DUMP_REGISTRY_CC */ @@ -605,14 +614,17 @@ typedef struct CFE_TBL_DumpRegistryCmd_Payload where registry is to be dumped */ } CFE_TBL_DumpRegistryCmd_Payload_t; -typedef struct CFE_TBL_DumpRegistry +/** + * \brief Dump Registry Command + */ +typedef struct CFE_TBL_DumpRegistryCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_DumpRegistryCmd_Payload_t Payload; -} CFE_TBL_DumpRegistry_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_DumpRegistryCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TBL_DumpRegistryCmd_t; /** -** \brief Telemeter Table Registry Entry Command +** \brief Send Table Registry Command Payload ** ** For command details, see #CFE_TBL_SEND_REGISTRY_CC */ @@ -625,14 +637,17 @@ typedef struct CFE_TBL_SendRegistryCmd_Payload to be telemetered via #CFE_TBL_TableRegistryTlm_t */ } CFE_TBL_SendRegistryCmd_Payload_t; -typedef struct CFE_TBL_SendRegistry +/** + * \brief Send Table Registry Command + */ +typedef struct CFE_TBL_SendRegistryCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_SendRegistryCmd_Payload_t Payload; -} CFE_TBL_SendRegistry_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_SendRegistryCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TBL_SendRegistryCmd_t; /** -** \brief Delete Critical Table CDS Command +** \brief Delete Critical Table CDS Command Payload ** ** For command details, see #CFE_TBL_DELETE_CDS_CC */ @@ -645,14 +660,17 @@ typedef struct CFE_TBL_DelCDSCmd_Payload CDS is to be deleted */ } CFE_TBL_DelCDSCmd_Payload_t; -typedef struct CFE_TBL_DeleteCDS +/** + * \brief Delete Critical Table CDS Command + */ +typedef struct CFE_TBL_DeleteCDSCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_DelCDSCmd_Payload_t Payload; -} CFE_TBL_DeleteCDS_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_DelCDSCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TBL_DeleteCDSCmd_t; /** -** \brief Abort Load Command +** \brief Abort Load Command Payload ** ** For command details, see #CFE_TBL_ABORT_LOAD_CC */ @@ -663,11 +681,14 @@ typedef struct CFE_TBL_AbortLoadCmd_Payload identifier of a table whose load is to be aborted */ } CFE_TBL_AbortLoadCmd_Payload_t; -typedef struct CFE_TBL_AbortLoad +/** + * \brief Abort Load Command + */ +typedef struct CFE_TBL_AbortLoadCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_AbortLoadCmd_Payload_t Payload; -} CFE_TBL_AbortLoad_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_AbortLoadCmd_Payload_t Payload; /**< \brief Command paylod */ +} CFE_TBL_AbortLoadCmd_t; /*************************************************************************/ @@ -675,7 +696,7 @@ typedef struct CFE_TBL_AbortLoad /* Generated Command Message Data Formats */ /******************************************/ /** -** \brief Table Management Notification Message +** \brief Table Management Notification Command Payload ** ** \par Description ** Whenever an application that owns a table calls the #CFE_TBL_NotifyByMessage API @@ -688,10 +709,13 @@ typedef struct CFE_TBL_NotifyCmd_Payload uint32 Parameter; /**< \brief Application specified command parameter */ } CFE_TBL_NotifyCmd_Payload_t; +/** + * /brief Table Management Notification Command + */ typedef struct CFE_TBL_NotifyCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; /**< \brief cFE Software Bus Command Message Header */ - CFE_TBL_NotifyCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TBL_NotifyCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TBL_NotifyCmd_t; /*************************************************************************/ @@ -762,8 +786,8 @@ typedef struct CFE_TBL_HousekeepingTlm_Payload typedef struct CFE_TBL_HousekeepingTlm { - CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */ - CFE_TBL_HousekeepingTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_TBL_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TBL_HousekeepingTlm_t; @@ -810,8 +834,8 @@ typedef struct CFE_TBL_TblRegPacket_Payload typedef struct CFE_TBL_TableRegistryTlm { - CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */ - CFE_TBL_TblRegPacket_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_TBL_TblRegPacket_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TBL_TableRegistryTlm_t; diff --git a/fsw/cfe-core/src/inc/cfe_time_msg.h b/fsw/cfe-core/src/inc/cfe_time_msg.h index e0f2b7b12..2345a05b8 100644 --- a/fsw/cfe-core/src/inc/cfe_time_msg.h +++ b/fsw/cfe-core/src/inc/cfe_time_msg.h @@ -58,7 +58,7 @@ ** \cfecmdmnemonic \TIME_NOOP ** ** \par Command Structure -** #CFE_TIME_NoArgsCmd_t +** #CFE_TIME_NoopCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -102,7 +102,7 @@ ** \cfecmdmnemonic \TIME_RESETCTRS ** ** \par Command Structure -** #CFE_TIME_NoArgsCmd_t +** #CFE_TIME_ResetCountersCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -135,7 +135,7 @@ ** \cfecmdmnemonic \TIME_REQUESTDIAG ** ** \par Command Structure -** #CFE_TIME_NoArgsCmd_t +** #CFE_TIME_SendDiagnosticCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -182,7 +182,7 @@ ** \cfecmdmnemonic \TIME_SETSOURCE ** ** \par Command Structure -** #CFE_TIME_SetSource_t +** #CFE_TIME_SetSourceCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -233,7 +233,7 @@ ** \cfecmdmnemonic \TIME_SETSTATE ** ** \par Command Structure -** #CFE_TIME_SetState_t +** #CFE_TIME_SetStateCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -276,7 +276,7 @@ ** \cfecmdmnemonic \TIME_ADDCLOCKLAT ** ** \par Command Structure -** #CFE_TIME_TimeCmd_t +** #CFE_TIME_AddDelayCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -314,7 +314,7 @@ ** \cfecmdmnemonic \TIME_SUBCLOCKLAT ** ** \par Command Structure -** #CFE_TIME_TimeCmd_t +** #CFE_TIME_SubDelayCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -359,7 +359,7 @@ ** \cfecmdmnemonic \TIME_SETCLOCK ** ** \par Command Structure -** #CFE_TIME_TimeCmd_t +** #CFE_TIME_SetTimeCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -399,7 +399,7 @@ ** \cfecmdmnemonic \TIME_SETCLOCKMET ** ** \par Command Structure -** #CFE_TIME_TimeCmd_t +** #CFE_TIME_SetMETCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -436,7 +436,7 @@ ** \cfecmdmnemonic \TIME_SETCLOCKSTCF ** ** \par Command Structure -** #CFE_TIME_TimeCmd_t +** #CFE_TIME_SetSTCFCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -473,7 +473,7 @@ ** \cfecmdmnemonic \TIME_SETCLOCKLEAP ** ** \par Command Structure -** #CFE_TIME_TimeCmd_t +** #CFE_TIME_SetLeapSecondsCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -506,7 +506,7 @@ ** \cfecmdmnemonic \TIME_ADDSTCFADJ ** ** \par Command Structure -** #CFE_TIME_TimeCmd_t +** #CFE_TIME_AddAdjustCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -540,7 +540,7 @@ ** \cfecmdmnemonic \TIME_SUBSTCFADJ ** ** \par Command Structure -** #CFE_TIME_TimeCmd_t +** #CFE_TIME_SubAdjustCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -587,7 +587,7 @@ ** \cfecmdmnemonic \TIME_ADD1HZSTCF ** ** \par Command Structure -** #CFE_TIME_Add1HZAdjustment_t +** #CFE_TIME_Add1HZAdjustmentCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -633,7 +633,7 @@ ** \cfecmdmnemonic \TIME_SUB1HZSTCF ** ** \par Command Structure -** #CFE_TIME_Sub1HZAdjustment_t +** #CFE_TIME_Sub1HZAdjustmentCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -675,7 +675,7 @@ ** \cfecmdmnemonic \TIME_SETSIGNAL ** ** \par Command Structure -** #CFE_TIME_SetSignal_t +** #CFE_TIME_SetSignalCmd_t ** ** \par Command Verification ** Successful execution of this command may be verified with the @@ -723,12 +723,12 @@ /*************************************************************************/ -/* -** Type definition (generic "no arguments" command)... -*/ +/** + * \brief Generic no argument command + */ typedef struct CFE_TIME_NoArgsCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ } CFE_TIME_NoArgsCmd_t; @@ -737,28 +737,33 @@ typedef struct CFE_TIME_NoArgsCmd * This follows the convention for command handler prototypes and allows * each one to independently evolve as necessary. */ -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_Noop_t; -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_ResetCounters_t; -typedef CFE_TIME_NoArgsCmd_t CFE_TIME_SendDiagnosticTlm_t; - -/* -** Type definition (leap seconds command)... -*/ +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_NoopCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_ResetCountersCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_SendDiagnosticCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_1HzCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_ToneSignalCmd_t; +typedef CFE_TIME_NoArgsCmd_t CFE_TIME_FakeToneCmd_t; + +/** + * \brief Set leap seconds command payload + */ typedef struct CFE_TIME_LeapsCmd_Payload { int16 LeapSeconds; } CFE_TIME_LeapsCmd_Payload_t; -typedef struct CFE_TIME_SetLeapSeconds +/** + * \brief Set leap seconds command + */ +typedef struct CFE_TIME_SetLeapSecondsCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_TIME_LeapsCmd_Payload_t Payload; -} CFE_TIME_SetLeapSeconds_t; - + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TIME_LeapsCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_SetLeapSecondsCmd_t; -/* -** Type definition (clock state command)... -*/ +/** + * \brief Set clock state command payload + */ typedef struct CFE_TIME_StateCmd_Payload { int16 ClockState; /**< \brief #CFE_TIME_ClockState_INVALID=Spacecraft time has not been accurately set, @@ -767,16 +772,19 @@ typedef struct CFE_TIME_StateCmd_Payload /**< Selects the current clock state */ } CFE_TIME_StateCmd_Payload_t; +/** + * \brief Set clock state command + */ typedef struct CFE_TIME_SetStateCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_TIME_StateCmd_Payload_t Payload; -} CFE_TIME_SetState_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TIME_StateCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_SetStateCmd_t; -/* -** Type definition (time data source command)... -*/ +/** + * \brief Set time data source command payload + */ typedef struct CFE_TIME_SourceCmd_Payload { int16 TimeSource; /**< \brief #CFE_TIME_SourceSelect_INTERNAL=Internal Source, @@ -784,16 +792,18 @@ typedef struct CFE_TIME_SourceCmd_Payload /**< Selects either the "Internal" and "External" clock source */ } CFE_TIME_SourceCmd_Payload_t; -typedef struct CFE_TIME_SetSource +/** + * \brief Set time data source command + */ +typedef struct CFE_TIME_SetSourceCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_TIME_SourceCmd_Payload_t Payload; -} CFE_TIME_SetSource_t; - + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TIME_SourceCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_SetSourceCmd_t; -/* -** Type definition (tone signal source command)... -*/ +/** + * \brief Set tone signal source command payload + */ typedef struct CFE_TIME_SignalCmd_Payload { int16 ToneSource; /**< \brief #CFE_TIME_ToneSignalSelect_PRIMARY=Primary Source, @@ -801,27 +811,32 @@ typedef struct CFE_TIME_SignalCmd_Payload /**< Selects either the "Primary" or "Redundant" tone signal source */ } CFE_TIME_SignalCmd_Payload_t; -typedef struct CFE_TIME_SetSignal +/** + * \brief Set tone signal source command + */ +typedef struct CFE_TIME_SetSignalCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_TIME_SignalCmd_Payload_t Payload; - -} CFE_TIME_SetSignal_t; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TIME_SignalCmd_Payload_t Payload; /**< \brief Command payload */ +} CFE_TIME_SetSignalCmd_t; -/* -** Type definition (generic "time argument" command)... -*/ +/** + * \brief Generic seconds, microseconds command payload + */ typedef struct CFE_TIME_TimeCmd_Payload { uint32 Seconds; uint32 MicroSeconds; } CFE_TIME_TimeCmd_Payload_t; +/** + * \brief Generic seconds, microseconds argument command + */ typedef struct CFE_TIME_TimeCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_TIME_TimeCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TIME_TimeCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_TimeCmd_t; /* @@ -829,18 +844,18 @@ typedef struct CFE_TIME_TimeCmd * This follows the convention for command handler prototypes and allows * each one to independently evolve as necessary. */ -typedef CFE_TIME_TimeCmd_t CFE_TIME_AddDelay_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SubDelay_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SetMET_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SetSTCF_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_AddAdjust_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SubAdjust_t; -typedef CFE_TIME_TimeCmd_t CFE_TIME_SetTime_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_AddDelayCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SubDelayCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SetMETCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SetSTCFCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_AddAdjustCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SubAdjustCmd_t; +typedef CFE_TIME_TimeCmd_t CFE_TIME_SetTimeCmd_t; -/* -** Type definition (1Hz STCF adjustment "time argument" command)... -*/ +/** + * \brief Generic seconds, subseconds command payload + */ typedef struct CFE_TIME_OneHzAdjustmentCmd_Payload { uint32 Seconds; @@ -848,11 +863,13 @@ typedef struct CFE_TIME_OneHzAdjustmentCmd_Payload } CFE_TIME_OneHzAdjustmentCmd_Payload_t; +/** + * \brief Generic seconds, subseconds adjustment command + */ typedef struct CFE_TIME_OneHzAdjustmentCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_TIME_OneHzAdjustmentCmd_Payload_t Payload; - + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TIME_OneHzAdjustmentCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_OneHzAdjustmentCmd_t; /* @@ -860,42 +877,12 @@ typedef struct CFE_TIME_OneHzAdjustmentCmd * This follows the convention for command handler prototypes and allows * each one to independently evolve as necessary. */ -typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Add1HZAdjustment_t; -typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Sub1HZAdjustment_t; - -/* -** Type definition (local 1Hz wake-up command)... -*/ -typedef struct CFE_TIME_1HzCmd -{ - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - -} CFE_TIME_1HzCmd_t; - +typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Add1HZAdjustmentCmd_t; +typedef CFE_TIME_OneHzAdjustmentCmd_t CFE_TIME_Sub1HZAdjustmentCmd_t; -/* -** Type definition (time at the tone signal command)... -*/ -typedef struct CFE_TIME_ToneSignalCmd -{ - CFE_SB_CmdHdr_t CmdHeader; - -} CFE_TIME_ToneSignalCmd_t; - - -/* -** Type definition ("fake" time at the tone signal command)... -*/ -typedef struct CFE_TIME_FakeToneCmd -{ - CFE_SB_CmdHdr_t CmdHeader; - -} CFE_TIME_FakeToneCmd_t; - - -/* -** Type definition (time at the tone data command)... -*/ +/** + * \brief Time at tone data command payload + */ typedef struct CFE_TIME_ToneDataCmd_Payload { CFE_TIME_SysTime_t AtToneMET; /**< \brief MET at time of tone */ @@ -904,10 +891,13 @@ typedef struct CFE_TIME_ToneDataCmd_Payload int16 AtToneState; /**< \brief Clock state at time of tone */ } CFE_TIME_ToneDataCmd_Payload_t; +/** + * \brief Time at tone data command + */ typedef struct CFE_TIME_ToneDataCmd { - uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; - CFE_TIME_ToneDataCmd_Payload_t Payload; + CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_TIME_ToneDataCmd_Payload_t Payload; /**< \brief Command payload */ } CFE_TIME_ToneDataCmd_t; @@ -977,8 +967,8 @@ typedef struct CFE_TIME_HousekeepingTlm_Payload typedef struct CFE_TIME_HousekeepingTlm { - CFE_SB_TlmHdr_t TlmHeader; - CFE_TIME_HousekeepingTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_TIME_HousekeepingTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TIME_HousekeepingTlm_t; @@ -1135,8 +1125,8 @@ typedef struct CFE_TIME_DiagnosticTlm_Payload typedef struct CFE_TIME_DiagnosticTlm { - CFE_SB_TlmHdr_t TlmHeader; - CFE_TIME_DiagnosticTlm_Payload_t Payload; + CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */ + CFE_TIME_DiagnosticTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TIME_DiagnosticTlm_t; diff --git a/fsw/cfe-core/src/sb/cfe_sb_api.c b/fsw/cfe-core/src/sb/cfe_sb_api.c index e1c6570ef..62fd41809 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_api.c +++ b/fsw/cfe-core/src/sb/cfe_sb_api.c @@ -293,7 +293,7 @@ int32 CFE_SB_DeletePipeFull(CFE_SB_PipeId_t PipeId,CFE_ES_ResourceID_t AppId) int32 Stat; CFE_ES_ResourceID_t Owner; CFE_ES_ResourceID_t TskId; - CFE_MSG_Message_t *PipeMsgPtr; + CFE_SB_Buffer_t *BufPtr; char FullName[(OS_MAX_API_NAME * 2)]; CFE_SB_RemovePipeCallback_t Args; @@ -346,7 +346,7 @@ int32 CFE_SB_DeletePipeFull(CFE_SB_PipeId_t PipeId,CFE_ES_ResourceID_t AppId) /* this step will free the memory used to store the message */ do{ CFE_SB_UnlockSharedData(__func__,__LINE__); - Stat = CFE_SB_RcvMsg(&PipeMsgPtr,PipeId,CFE_SB_POLL); + Stat = CFE_SB_ReceiveBuffer(&BufPtr,PipeId,CFE_SB_POLL); CFE_SB_LockSharedData(__func__,__LINE__); }while(Stat == CFE_SUCCESS); @@ -876,7 +876,7 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId, CFE_SB.SubRprtMsg.Payload.Qos.Reliability = Quality.Reliability; CFE_SB.SubRprtMsg.Payload.SubType = CFE_SB_SUBSCRIPTION; CFE_SB_UnlockSharedData(__func__,__LINE__); - Stat = CFE_SB_SendMsg((CFE_MSG_Message_t *)&CFE_SB.SubRprtMsg); + Stat = CFE_SB_TransmitMsg(&CFE_SB.SubRprtMsg.Hdr.Msg, true); CFE_EVS_SendEventWithAppID(CFE_SB_SUBSCRIPTION_RPT_EID,CFE_EVS_EventType_DEBUG,CFE_SB.AppId, "Sending Subscription Report Msg=0x%x,Pipe=%d,Stat=0x%x", (unsigned int)CFE_SB_MsgIdToValue(MsgId), @@ -1099,21 +1099,87 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId,CFE_SB_PipeId_t PipeId, return CFE_SUCCESS; }/* end CFE_SB_UnsubscribeFull */ +/* + * Function CFE_SB_TransmitMsg - See API and header file for details + */ +int32 CFE_SB_TransmitMsg(CFE_MSG_Message_t *MsgPtr, bool IncrementSequenceCount) +{ + int32 Status; + CFE_MSG_Size_t Size = 0; + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; + CFE_ES_ResourceID_t TskId; + char FullName[(OS_MAX_API_NAME * 2)]; + CFE_SB_BufferD_t *BufDscPtr; + CFE_SBR_RouteId_t RouteId; + CFE_MSG_Type_t MsgType; + + /* Get task id for events and Sender Info*/ + CFE_ES_GetTaskID(&TskId); + + Status = CFE_SB_TransmitMsgValidate(MsgPtr, &MsgId, &Size, &RouteId); + + /* Copy into buffer and send if route exists */ + if (Status == CFE_SUCCESS && CFE_SBR_IsValidRouteId(RouteId)) + { + /* Get buffer */ + BufDscPtr = CFE_SB_GetBufferFromPool(MsgId, Size); + if (BufDscPtr == NULL) + { + /* Determine if event can be sent without causing recursive event problem */ + if(CFE_SB_RequestToSendEvent(TskId,CFE_SB_GET_BUF_ERR_EID_BIT) == CFE_SB_GRANTED) + { + CFE_EVS_SendEventWithAppID(CFE_SB_GET_BUF_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, + "Send Err:Request for Buffer Failed. MsgId 0x%x,app %s,size %d", + (unsigned int)CFE_SB_MsgIdToValue(MsgId), + CFE_SB_GetAppTskName(TskId,FullName),(int)Size); + + /* clear the bit so the task may send this event again */ + CFE_SB_FinishSendEvent(TskId,CFE_SB_GET_BUF_ERR_EID_BIT); + } + + Status = CFE_SB_BUF_ALOC_ERR; + } + else + { + /* For Tlm packets, increment the seq count if requested */ + CFE_MSG_GetType(MsgPtr, &MsgType); + if((MsgType == CFE_MSG_Type_Tlm) && IncrementSequenceCount) + { + CFE_SBR_IncrementSequenceCounter(RouteId); + CFE_MSG_SetSequenceCount(MsgPtr, CFE_SBR_GetSequenceCounter(RouteId)); + } + + /* Copy data into buffer and transmit */ + memcpy(BufDscPtr->Buffer, MsgPtr, Size); + Status = CFE_SB_TransmitBufferFull(BufDscPtr, RouteId, MsgId); + } + } + + if (Status != CFE_SUCCESS) + { + /* Increment error counter (inside lock) if not success */ + CFE_SB_LockSharedData(__func__, __LINE__); + CFE_SB.HKTlmMsg.Payload.MsgSendErrorCounter++; + CFE_SB_UnlockSharedData(__func__, __LINE__); + } + + return Status; +} + +#ifndef CFE_OMIT_DEPRECATED_6_8 /* * Function: CFE_SB_SendMsg - See API and header file for details */ int32 CFE_SB_SendMsg(CFE_MSG_Message_t *MsgPtr) { - int32 Status = 0; + int32 Status = 0; - Status = CFE_SB_SendMsgFull(MsgPtr,CFE_SB_INCREMENT_TLM,CFE_SB_SEND_ONECOPY); + Status = CFE_SB_TransmitMsg(MsgPtr, true); return Status; }/* end CFE_SB_SendMsg */ - - /* * Function: CFE_SB_PassMsg - See API and header file for details */ @@ -1121,190 +1187,124 @@ int32 CFE_SB_PassMsg(CFE_MSG_Message_t *MsgPtr) { int32 Status = 0; - Status = CFE_SB_SendMsgFull(MsgPtr,CFE_SB_DO_NOT_INCREMENT,CFE_SB_SEND_ONECOPY); + Status = CFE_SB_TransmitMsg(MsgPtr, false); return Status; }/* end CFE_SB_PassMsg */ +#endif /* CFE_OMIT_DEPRECATED_6_8 */ - - -/****************************************************************************** -** Name: CFE_SB_SendMsgFull -** -** Purpose: API used to send a message on the software bus. -** -** Assumptions, External Events, and Notes: -** -** Note: This function increments and tracks the source sequence -** counter for all telemetry messages. -** -** Date Written: -** 04/25/2005 -** -** Input Arguments: -** MsgPtr -** TlmCntIncrements -** CopyMode -** -** Output Arguments: -** None -** -** Return Values: -** Status -** -******************************************************************************/ -int32 CFE_SB_SendMsgFull(CFE_MSG_Message_t *MsgPtr, - uint32 TlmCntIncrements, - uint32 CopyMode) +/*****************************************************************************/ +/** + * \brief Internal routine to validate a transmit message before sending + * + * \param[in] MsgPtr Pointer to the message to validate + * \param[out] MsgIdPtr Message Id of message + * \param[out] SizePtr Size of message + * \param[out] RouteIdPtr Route ID of the message (invalid if none) + */ +int32 CFE_SB_TransmitMsgValidate(CFE_MSG_Message_t *MsgPtr, + CFE_SB_MsgId_t *MsgIdPtr, + CFE_MSG_Size_t *SizePtr, + CFE_SBR_RouteId_t *RouteIdPtr) { - CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; - int32 Status; - CFE_SB_DestinationD_t *DestPtr = NULL; - CFE_SB_PipeD_t *PipeDscPtr; - CFE_SBR_RouteId_t RouteId; - CFE_SB_BufferD_t *BufDscPtr; - CFE_MSG_Size_t TotalMsgSize = 0; - CFE_ES_ResourceID_t AppId; CFE_ES_ResourceID_t TskId; - uint32 i; char FullName[(OS_MAX_API_NAME * 2)]; - CFE_SB_EventBuf_t SBSndErr; - char PipeName[OS_MAX_API_NAME] = {'\0'}; - CFE_SB_PipeDepthStats_t *StatObj; - CFE_MSG_Type_t MsgType = CFE_MSG_Type_Invalid; - - SBSndErr.EvtsToSnd = 0; - - /* get app id for loopback testing */ - CFE_ES_GetAppID(&AppId); /* get task id for events and Sender Info*/ CFE_ES_GetTaskID(&TskId); /* check input parameter */ - if(MsgPtr == NULL){ - CFE_SB_LockSharedData(__func__,__LINE__); - CFE_SB.HKTlmMsg.Payload.MsgSendErrorCounter++; - CFE_SB_UnlockSharedData(__func__,__LINE__); + if(MsgPtr == NULL) + { CFE_EVS_SendEventWithAppID(CFE_SB_SEND_BAD_ARG_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, "Send Err:Bad input argument,Arg 0x%lx,App %s", (unsigned long)MsgPtr,CFE_SB_GetAppTskName(TskId,FullName)); return CFE_SB_BAD_ARGUMENT; }/* end if */ - CFE_MSG_GetMsgId(MsgPtr, &MsgId); + CFE_MSG_GetMsgId(MsgPtr, MsgIdPtr); /* validate the msgid in the message */ - if(!CFE_SB_IsValidMsgId(MsgId)) + if(!CFE_SB_IsValidMsgId(*MsgIdPtr)) { - CFE_SB_LockSharedData(__func__,__LINE__); - CFE_SB.HKTlmMsg.Payload.MsgSendErrorCounter++; - if (CopyMode == CFE_SB_SEND_ZEROCOPY) - { - BufDscPtr = CFE_SB_GetBufferFromCaller(MsgId, MsgPtr); - CFE_SB_DecrBufUseCnt(BufDscPtr); - } - CFE_SB_UnlockSharedData(__func__,__LINE__); CFE_EVS_SendEventWithAppID(CFE_SB_SEND_INV_MSGID_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, "Send Err:Invalid MsgId(0x%x)in msg,App %s", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), + (unsigned int)CFE_SB_MsgIdToValue(*MsgIdPtr), CFE_SB_GetAppTskName(TskId,FullName)); return CFE_SB_BAD_ARGUMENT; }/* end if */ - CFE_MSG_GetSize(MsgPtr, &TotalMsgSize); + CFE_MSG_GetSize(MsgPtr, SizePtr); /* Verify the size of the pkt is < or = the mission defined max */ - if(TotalMsgSize > CFE_MISSION_SB_MAX_SB_MSG_SIZE){ - CFE_SB_LockSharedData(__func__,__LINE__); - CFE_SB.HKTlmMsg.Payload.MsgSendErrorCounter++; - if (CopyMode == CFE_SB_SEND_ZEROCOPY) - { - BufDscPtr = CFE_SB_GetBufferFromCaller(MsgId, MsgPtr); - CFE_SB_DecrBufUseCnt(BufDscPtr); - } - CFE_SB_UnlockSharedData(__func__,__LINE__); + if(*SizePtr > CFE_MISSION_SB_MAX_SB_MSG_SIZE) + { CFE_EVS_SendEventWithAppID(CFE_SB_MSG_TOO_BIG_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, "Send Err:Msg Too Big MsgId=0x%x,app=%s,size=%d,MaxSz=%d", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), - CFE_SB_GetAppTskName(TskId,FullName),(int)TotalMsgSize,CFE_MISSION_SB_MAX_SB_MSG_SIZE); + (unsigned int)CFE_SB_MsgIdToValue(*MsgIdPtr), + CFE_SB_GetAppTskName(TskId,FullName),(int)*SizePtr,CFE_MISSION_SB_MAX_SB_MSG_SIZE); return CFE_SB_MSG_TOO_BIG; }/* end if */ - /* take semaphore to prevent a task switch during this call */ - CFE_SB_LockSharedData(__func__,__LINE__); - - /* Get the routing pointer */ - RouteId = CFE_SBR_GetRouteId(MsgId); + /* Get the routing id */ + *RouteIdPtr = CFE_SBR_GetRouteId(*MsgIdPtr); /* if there have been no subscriptions for this pkt, */ /* increment the dropped pkt cnt, send event and return success */ - if(!CFE_SBR_IsValidRouteId(RouteId)){ + if(!CFE_SBR_IsValidRouteId(*RouteIdPtr)){ CFE_SB.HKTlmMsg.Payload.NoSubscribersCounter++; - if (CopyMode == CFE_SB_SEND_ZEROCOPY){ - BufDscPtr = CFE_SB_GetBufferFromCaller(MsgId, MsgPtr); - CFE_SB_DecrBufUseCnt(BufDscPtr); - } - - CFE_SB_UnlockSharedData(__func__,__LINE__); - /* Determine if event can be sent without causing recursive event problem */ if(CFE_SB_RequestToSendEvent(TskId,CFE_SB_SEND_NO_SUBS_EID_BIT) == CFE_SB_GRANTED){ CFE_EVS_SendEventWithAppID(CFE_SB_SEND_NO_SUBS_EID,CFE_EVS_EventType_INFORMATION,CFE_SB.AppId, "No subscribers for MsgId 0x%x,sender %s", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), + (unsigned int)CFE_SB_MsgIdToValue(*MsgIdPtr), CFE_SB_GetAppTskName(TskId,FullName)); /* clear the bit so the task may send this event again */ CFE_SB_FinishSendEvent(TskId,CFE_SB_SEND_NO_SUBS_EID_BIT); }/* end if */ - return CFE_SUCCESS; }/* end if */ - /* Allocate a new buffer. */ - if (CopyMode == CFE_SB_SEND_ZEROCOPY){ - BufDscPtr = CFE_SB_GetBufferFromCaller(MsgId, MsgPtr); - } - else{ - BufDscPtr = CFE_SB_GetBufferFromPool(MsgId, TotalMsgSize); - } - if (BufDscPtr == NULL){ - CFE_SB.HKTlmMsg.Payload.MsgSendErrorCounter++; - CFE_SB_UnlockSharedData(__func__,__LINE__); - - /* Determine if event can be sent without causing recursive event problem */ - if(CFE_SB_RequestToSendEvent(TskId,CFE_SB_GET_BUF_ERR_EID_BIT) == CFE_SB_GRANTED){ - - CFE_EVS_SendEventWithAppID(CFE_SB_GET_BUF_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId, - "Send Err:Request for Buffer Failed. MsgId 0x%x,app %s,size %d", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), - CFE_SB_GetAppTskName(TskId,FullName),(int)TotalMsgSize); + return CFE_SUCCESS; +} - /* clear the bit so the task may send this event again */ - CFE_SB_FinishSendEvent(TskId,CFE_SB_GET_BUF_ERR_EID_BIT); - }/* end if */ +/*****************************************************************************/ +/** + * \brief Internal routine implements full send logic + * + * \param[in] BufDscPtr Pointer to the buffer description from the memory pool, + * released prior to return + * \param[in] RouteId Route to send to + * \param[in] MsgId Message Id that is being sent + */ +int32 CFE_SB_TransmitBufferFull(CFE_SB_BufferD_t *BufDscPtr, + CFE_SBR_RouteId_t RouteId, + CFE_SB_MsgId_t MsgId) +{ + CFE_ES_ResourceID_t AppId; + CFE_ES_ResourceID_t TskId; + CFE_SB_DestinationD_t *DestPtr; + CFE_SB_PipeD_t *PipeDscPtr; + CFE_SB_EventBuf_t SBSndErr = {0}; + char PipeName[OS_MAX_API_NAME] = {'\0'}; + CFE_SB_PipeDepthStats_t *StatObj; + int32 Status; + uint32 i; + char FullName[(OS_MAX_API_NAME * 2)]; - return CFE_SB_BUF_ALOC_ERR; - }/* end if */ + /* get app id for loopback testing */ + CFE_ES_GetAppID(&AppId); - /* Copy the packet into the SB memory space */ - if (CopyMode != CFE_SB_SEND_ZEROCOPY){ - /* Copy the packet into the SB memory space */ - memcpy( BufDscPtr->Buffer, MsgPtr, TotalMsgSize ); - } + /* get task id for events and Sender Info*/ + CFE_ES_GetTaskID(&TskId); - /* For Tlm packets, increment the seq count if requested */ - CFE_MSG_GetType(MsgPtr, &MsgType); - if((MsgType == CFE_MSG_Type_Tlm) && - (TlmCntIncrements==CFE_SB_INCREMENT_TLM)){ - CFE_SBR_IncrementSequenceCounter(RouteId); - CFE_MSG_SetSequenceCount((CFE_MSG_Message_t *)BufDscPtr->Buffer, CFE_SBR_GetSequenceCounter(RouteId)); - }/* end if */ + /* take semaphore to prevent a task switch during processing */ + CFE_SB_LockSharedData(__func__,__LINE__); /* Send the packet to all destinations */ for(DestPtr = CFE_SBR_GetDestListHeadPtr(RouteId); DestPtr != NULL; DestPtr = DestPtr->Next) @@ -1453,16 +1453,23 @@ int32 CFE_SB_SendMsgFull(CFE_MSG_Message_t *MsgPtr, return CFE_SUCCESS; -}/* end CFE_SB_SendMsgFull */ - +} +#if CFE_OMIT_DEPRECATED_6_8 +int32 CFE_SB_RcvMsg(CFE_SB_Buffer_t **BufPtr, + CFE_SB_PipeId_t PipeId, + int32 TimeOut) +{ + return CFE_SB_ReceiveBuffer(BufPtr, PipeId, TimeOut); +} +#endif /* CFE_OMIT_DEPRECATED_6_8 */ /* - * Function: CFE_SB_RcvMsg - See API and header file for details + * Function: CFE_SB_ReceiveBuffer - See API and header file for details */ -int32 CFE_SB_RcvMsg(CFE_MSG_Message_t **BufPtr, - CFE_SB_PipeId_t PipeId, - int32 TimeOut) +int32 CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr, + CFE_SB_PipeId_t PipeId, + int32 TimeOut) { int32 Status; CFE_SB_BufferD_t *Message; @@ -1532,12 +1539,12 @@ int32 CFE_SB_RcvMsg(CFE_MSG_Message_t **BufPtr, /* ** Load the pipe tables 'CurrentBuff' with the buffer descriptor ** ptr corresponding to the message just read. This is done so that - ** the buffer can be released on the next RcvMsg call for this pipe. + ** the buffer can be released on the next receive call for this pipe. */ PipeDscPtr->CurrentBuff = Message; /* Set the Receivers pointer to the address of the actual message */ - *BufPtr = (CFE_MSG_Message_t*) Message->Buffer; + *BufPtr = (CFE_SB_Buffer_t *) Message->Buffer; /* get pointer to destination to be used in decrementing msg limit cnt*/ RouteId = CFE_SBR_GetRouteId(PipeDscPtr->CurrentBuff->MsgId); @@ -1579,14 +1586,14 @@ int32 CFE_SB_RcvMsg(CFE_MSG_Message_t **BufPtr, */ return Status; -}/* end CFE_SB_RcvMsg */ +} /* * Function: CFE_SB_ZeroCopyGetPtr - See API and header file for details */ -CFE_MSG_Message_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, - CFE_SB_ZeroCopyHandle_t *BufferHandle) +CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, + CFE_SB_ZeroCopyHandle_t *BufferHandle) { int32 stat1; CFE_ES_ResourceID_t AppId; @@ -1667,7 +1674,7 @@ CFE_MSG_Message_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, bd->Size = MsgSize; bd->Buffer = (void *)address; - return (CFE_MSG_Message_t *)address; + return (CFE_SB_Buffer_t *)address; }/* CFE_SB_ZeroCopyGetPtr */ @@ -1675,7 +1682,7 @@ CFE_MSG_Message_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, /* * Function: CFE_SB_ZeroCopyReleasePtr - See API and header file for details */ -int32 CFE_SB_ZeroCopyReleasePtr(CFE_MSG_Message_t *Ptr2Release, +int32 CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t BufferHandle) { int32 Status; @@ -1727,7 +1734,7 @@ int32 CFE_SB_ZeroCopyReleasePtr(CFE_MSG_Message_t *Ptr2Release, ** Status ** ******************************************************************************/ -int32 CFE_SB_ZeroCopyReleaseDesc(CFE_MSG_Message_t *Ptr2Release, +int32 CFE_SB_ZeroCopyReleaseDesc(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t BufferHandle) { int32 Stat; @@ -1766,20 +1773,75 @@ int32 CFE_SB_ZeroCopyReleaseDesc(CFE_MSG_Message_t *Ptr2Release, }/* end CFE_SB_ZeroCopyReleaseDesc */ +/* + * Function CFE_SB_TransmitBuffer - See API and header file for details + */ +int32 CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, + CFE_SB_ZeroCopyHandle_t ZeroCopyHandle, + bool IncrementSequenceCount) +{ + int32 Status; + CFE_MSG_Size_t Size = 0; + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; + CFE_SB_BufferD_t *BufDscPtr; + CFE_SBR_RouteId_t RouteId; + CFE_MSG_Type_t MsgType; + + /* Release zero copy handle */ + Status = CFE_SB_ZeroCopyReleaseDesc(BufPtr, ZeroCopyHandle); + + if (Status == CFE_SUCCESS) + { + Status = CFE_SB_TransmitMsgValidate(&BufPtr->Msg, &MsgId, &Size, &RouteId); + + /* Send if route exists */ + if (Status == CFE_SUCCESS) + { + /* Get buffer descriptor pointer */ + BufDscPtr = CFE_SB_GetBufferFromCaller(MsgId, BufPtr); + + if(CFE_SBR_IsValidRouteId(RouteId)) + { + /* For Tlm packets, increment the seq count if requested */ + CFE_MSG_GetType(&BufPtr->Msg, &MsgType); + if((MsgType == CFE_MSG_Type_Tlm) && IncrementSequenceCount) + { + CFE_SBR_IncrementSequenceCounter(RouteId); + CFE_MSG_SetSequenceCount(&BufPtr->Msg, CFE_SBR_GetSequenceCounter(RouteId)); + } + + Status = CFE_SB_TransmitBufferFull(BufDscPtr, RouteId, MsgId); + } + else + { + /* Decrement use count if transmit buffer full not called */ + CFE_SB_LockSharedData(__func__, __LINE__); + CFE_SB_DecrBufUseCnt(BufDscPtr); + CFE_SB_UnlockSharedData(__func__, __LINE__); + } + } + else + { + /* Increment send error counter for validation failure */ + CFE_SB_LockSharedData(__func__, __LINE__); + CFE_SB.HKTlmMsg.Payload.MsgSendErrorCounter++; + CFE_SB_UnlockSharedData(__func__, __LINE__); + } + } + + return Status; +} +#ifndef CFE_OMIT_DEPRECATED_6_8 /* * Function: CFE_SB_ZeroCopySend - See API and header file for details */ -int32 CFE_SB_ZeroCopySend(CFE_MSG_Message_t *MsgPtr, +int32 CFE_SB_ZeroCopySend(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) { - int32 Status = 0; - - Status = CFE_SB_ZeroCopyReleaseDesc(MsgPtr, BufferHandle); + int32 Status = 0; - if(Status == CFE_SUCCESS){ - Status = CFE_SB_SendMsgFull(MsgPtr,CFE_SB_INCREMENT_TLM,CFE_SB_SEND_ZEROCOPY); - } + Status = CFE_SB_TransmitBuffer(BufPtr, BufferHandle, true); return Status; @@ -1789,21 +1851,17 @@ int32 CFE_SB_ZeroCopySend(CFE_MSG_Message_t *MsgPtr, /* * Function: CFE_SB_ZeroCopyPass - See API and header file for details */ -int32 CFE_SB_ZeroCopyPass(CFE_MSG_Message_t *MsgPtr, +int32 CFE_SB_ZeroCopyPass(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) { - int32 Status = 0; + int32 Status = 0; - Status = CFE_SB_ZeroCopyReleaseDesc(MsgPtr, BufferHandle); - - if(Status == CFE_SUCCESS){ - Status = CFE_SB_SendMsgFull(MsgPtr,CFE_SB_DO_NOT_INCREMENT,CFE_SB_SEND_ZEROCOPY); - } + Status = CFE_SB_TransmitBuffer(BufPtr, BufferHandle, false); return Status; }/* end CFE_SB_ZeroCopyPass */ - +#endif /****************************************************************************** ** Function: CFE_SB_ReadQueue() diff --git a/fsw/cfe-core/src/sb/cfe_sb_init.c b/fsw/cfe-core/src/sb/cfe_sb_init.c index 374430251..e9a35cfb4 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_init.c +++ b/fsw/cfe-core/src/sb/cfe_sb_init.c @@ -116,7 +116,7 @@ int32 CFE_SB_EarlyInit (void) { CFE_SBR_Init(); /* Initialize the SB Statistics Pkt */ - CFE_MSG_Init(&CFE_SB.StatTlmMsg.Hdr.BaseMsg, + CFE_MSG_Init(&CFE_SB.StatTlmMsg.Hdr.Msg, CFE_SB_ValueToMsgId(CFE_SB_STATS_TLM_MID), sizeof(CFE_SB.StatTlmMsg)); diff --git a/fsw/cfe-core/src/sb/cfe_sb_priv.c b/fsw/cfe-core/src/sb/cfe_sb_priv.c index f6eeb5623..80ba52c2b 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_priv.c +++ b/fsw/cfe-core/src/sb/cfe_sb_priv.c @@ -608,7 +608,7 @@ int32 CFE_SB_ZeroCopyReleaseAppId(CFE_ES_ResourceID_t AppId) prev = (CFE_SB_ZeroCopyD_t *) (zcd->Prev); if( CFE_ES_ResourceID_Equal(zcd->AppID, AppId) ) { - CFE_SB_ZeroCopyReleasePtr((CFE_MSG_Message_t *) zcd->Buffer, (CFE_SB_ZeroCopyHandle_t) zcd); + CFE_SB_ZeroCopyReleasePtr((CFE_SB_Buffer_t *) zcd->Buffer, (CFE_SB_ZeroCopyHandle_t) zcd); } zcd = prev; } diff --git a/fsw/cfe-core/src/sb/cfe_sb_priv.h b/fsw/cfe-core/src/sb/cfe_sb_priv.h index 944db2ba8..a70d658fe 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_priv.h +++ b/fsw/cfe-core/src/sb/cfe_sb_priv.h @@ -194,7 +194,6 @@ typedef struct CFE_SB_HousekeepingTlm_t HKTlmMsg; CFE_SB_StatsTlm_t StatTlmMsg; CFE_SB_PipeId_t CmdPipe; - CFE_MSG_Message_t *CmdPipePktPtr; CFE_SB_MemParams_t Mem; CFE_SB_AllSubscriptionsTlm_t PrevSubMsg; CFE_SB_SingleSubscriptionTlm_t SubRprtMsg; @@ -245,7 +244,7 @@ int32 CFE_SB_WriteQueue(CFE_SB_PipeD_t *pd,uint32 TskId, const CFE_SB_BufferD_t *bd,CFE_SB_MsgId_t MsgId ); uint8 CFE_SB_GetPipeIdx(CFE_SB_PipeId_t PipeId); int32 CFE_SB_ReturnBufferToPool(CFE_SB_BufferD_t *bd); -void CFE_SB_ProcessCmdPipePkt(void); +void CFE_SB_ProcessCmdPipePkt(CFE_SB_Buffer_t *SBBufPtr); void CFE_SB_ResetCounters(void); void CFE_SB_SetMsgSeqCnt(CFE_MSG_Message_t *MsgPtr,uint32 Count); char *CFE_SB_GetAppTskName(CFE_ES_ResourceID_t TaskId, char* FullName); @@ -266,11 +265,17 @@ int32 CFE_SB_UnsubscribeWithAppId(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, uint8 Scope, CFE_ES_ResourceID_t AppId); -int32 CFE_SB_SendMsgFull(CFE_MSG_Message_t *MsgPtr, uint32 TlmCntIncrements, uint32 CopyMode); +int32 CFE_SB_TransmitBufferFull(CFE_SB_BufferD_t *BufDscPtr, + CFE_SBR_RouteId_t RouteId, + CFE_SB_MsgId_t MsgId); +int32 CFE_SB_TransmitMsgValidate(CFE_MSG_Message_t *MsgPtr, + CFE_SB_MsgId_t *MsgIdPtr, + CFE_MSG_Size_t *SizePtr, + CFE_SBR_RouteId_t *RouteIdPtr); int32 CFE_SB_SendRtgInfo(const char *Filename); int32 CFE_SB_SendPipeInfo(const char *Filename); int32 CFE_SB_SendMapInfo(const char *Filename); -int32 CFE_SB_ZeroCopyReleaseDesc(CFE_MSG_Message_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t BufferHandle); +int32 CFE_SB_ZeroCopyReleaseDesc(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t BufferHandle); int32 CFE_SB_ZeroCopyReleaseAppId(CFE_ES_ResourceID_t AppId); int32 CFE_SB_DecrBufUseCnt(CFE_SB_BufferD_t *bd); int32 CFE_SB_ValidateMsgId(CFE_SB_MsgId_t MsgId); @@ -335,27 +340,26 @@ CFE_SB_DestinationD_t *CFE_SB_GetDestPtr(CFE_SBR_RouteId_t RouteId, CFE_SB_PipeI /*****************************************************************************/ /** -** \brief Get the size of a software bus message header. +** \brief Get the size of a message header. ** ** \par Description -** This routine returns the number of bytes in a software bus message header. -** This can be used for sizing buffers that need to store SB messages. SB -** message header formats can be different for each deployment of the cFE. -** So, applications should use this function and avoid hard coding their buffer -** sizes. +** This routine is a best guess of the message header size based off type +** information and the local message implementation. +** If a different header implementation was used to generate the message +** the returned size may not be correct. Critical functionality should +** use the real message structure or otherwise confirm header implementation +** matches expectations prior to using this API. ** ** \par Assumptions, External Events, and Notes: -** - For statically defined messages, a function call will not work. The -** macros #CFE_SB_CMD_HDR_SIZE and #CFE_SB_TLM_HDR_SIZE are available for use -** in static message buffer sizing or structure definitions. +** - Utilize CFE_MSG_CommandHeader_t and CFE_MSG_TelemetryHeader_t for +** defining message structures. ** ** \param[in] *MsgPtr The message ID to calculate header size for. The size of the message ** header may depend on the MsgId in some implementations. For example, ** if SB messages are implemented as CCSDS packets, the size of the header ** is different for command vs. telemetry packets. ** -** \returns The number of bytes in the software bus message header for -** messages with the given \c MsgId. +** \returns Estimated number of bytes in the message header for the given message **/ size_t CFE_SB_MsgHdrSize(const CFE_MSG_Message_t *MsgPtr); @@ -363,18 +367,18 @@ size_t CFE_SB_MsgHdrSize(const CFE_MSG_Message_t *MsgPtr); /* * Software Bus Message Handler Function prototypes */ -int32 CFE_SB_NoopCmd(const CFE_SB_Noop_t *data); -int32 CFE_SB_ResetCountersCmd(const CFE_SB_ResetCounters_t *data); -int32 CFE_SB_EnableSubReportingCmd(const CFE_SB_EnableSubReporting_t *data); -int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReporting_t *data); -int32 CFE_SB_SendHKTlmCmd(const CFE_SB_CmdHdr_t *data); -int32 CFE_SB_EnableRouteCmd(const CFE_SB_EnableRoute_t *data); -int32 CFE_SB_DisableRouteCmd(const CFE_SB_DisableRoute_t *data); -int32 CFE_SB_SendStatsCmd(const CFE_SB_SendSbStats_t *data); -int32 CFE_SB_SendRoutingInfoCmd(const CFE_SB_SendRoutingInfo_t *data); -int32 CFE_SB_SendPipeInfoCmd(const CFE_SB_SendPipeInfo_t *data); -int32 CFE_SB_SendMapInfoCmd(const CFE_SB_SendMapInfo_t *data); -int32 CFE_SB_SendPrevSubsCmd(const CFE_SB_SendPrevSubs_t *data); +int32 CFE_SB_NoopCmd(const CFE_SB_NoopCmd_t *data); +int32 CFE_SB_ResetCountersCmd(const CFE_SB_ResetCountersCmd_t *data); +int32 CFE_SB_EnableSubReportingCmd(const CFE_SB_EnableSubReportingCmd_t *data); +int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReportingCmd_t *data); +int32 CFE_SB_SendHKTlmCmd(const CFE_MSG_CommandHeader_t *data); +int32 CFE_SB_EnableRouteCmd(const CFE_SB_EnableRouteCmd_t *data); +int32 CFE_SB_DisableRouteCmd(const CFE_SB_DisableRouteCmd_t *data); +int32 CFE_SB_SendStatsCmd(const CFE_SB_SendSbStatsCmd_t *data); +int32 CFE_SB_SendRoutingInfoCmd(const CFE_SB_SendRoutingInfoCmd_t *data); +int32 CFE_SB_SendPipeInfoCmd(const CFE_SB_SendPipeInfoCmd_t *data); +int32 CFE_SB_SendMapInfoCmd(const CFE_SB_SendMapInfoCmd_t *data); +int32 CFE_SB_SendPrevSubsCmd(const CFE_SB_SendPrevSubsCmd_t *data); /* diff --git a/fsw/cfe-core/src/sb/cfe_sb_task.c b/fsw/cfe-core/src/sb/cfe_sb_task.c index a6aff96e2..003f3c0f5 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_task.c +++ b/fsw/cfe-core/src/sb/cfe_sb_task.c @@ -72,7 +72,8 @@ typedef struct */ void CFE_SB_TaskMain(void) { - int32 Status; + int32 Status; + CFE_SB_Buffer_t *SBBufPtr; CFE_ES_PerfLogEntry(CFE_MISSION_SB_MAIN_PERF_ID); @@ -103,7 +104,7 @@ void CFE_SB_TaskMain(void) CFE_ES_PerfLogExit(CFE_MISSION_SB_MAIN_PERF_ID); /* Pend on receipt of packet */ - Status = CFE_SB_RcvMsg(&CFE_SB.CmdPipePktPtr, + Status = CFE_SB_ReceiveBuffer(&SBBufPtr, CFE_SB.CmdPipe, CFE_SB_PEND_FOREVER); @@ -112,14 +113,14 @@ void CFE_SB_TaskMain(void) if(Status == CFE_SUCCESS) { /* Process cmd pipe msg */ - CFE_SB_ProcessCmdPipePkt(); + CFE_SB_ProcessCmdPipePkt(SBBufPtr); }else{ CFE_ES_WriteToSysLog("SB:Error reading cmd pipe,RC=0x%08X\n",(unsigned int)Status); }/* end if */ }/* end while */ - /* while loop exits only if CFE_SB_RcvMsg returns error */ + /* while loop exits only if CFE_SB_ReceiveBuffer returns error */ CFE_ES_ExitApp(CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR); }/* end CFE_SB_TaskMain */ @@ -224,15 +225,15 @@ int32 CFE_SB_AppInit(void){ CFE_ES_WriteToSysLog("SB:Registered %d events for filtering\n",(int)CfgFileEventsToFilter); - CFE_MSG_Init(&CFE_SB.HKTlmMsg.Hdr.BaseMsg, + CFE_MSG_Init(&CFE_SB.HKTlmMsg.Hdr.Msg, CFE_SB_ValueToMsgId(CFE_SB_HK_TLM_MID), sizeof(CFE_SB.HKTlmMsg)); - CFE_MSG_Init(&CFE_SB.PrevSubMsg.Hdr.BaseMsg, + CFE_MSG_Init(&CFE_SB.PrevSubMsg.Hdr.Msg, CFE_SB_ValueToMsgId(CFE_SB_ALLSUBS_TLM_MID), sizeof(CFE_SB.PrevSubMsg)); - CFE_MSG_Init(&CFE_SB.SubRprtMsg.Hdr.BaseMsg, + CFE_MSG_Init(&CFE_SB.SubRprtMsg.Hdr.Msg, CFE_SB_ValueToMsgId(CFE_SB_ONESUB_TLM_MID), sizeof(CFE_SB.SubRprtMsg)); @@ -279,7 +280,7 @@ int32 CFE_SB_AppInit(void){ /* Ensure a ground commanded reset does not get blocked if SB mem pool */ /* becomes fully configured (DCR6772) */ Status = CFE_ES_GetPoolBuf(&TmpPtr, CFE_SB.Mem.PoolHdl, - sizeof(CFE_ES_Restart_t)); + sizeof(CFE_ES_RestartCmd_t)); if(Status < 0){ CFE_ES_WriteToSysLog("SB:Init error, GetPool Failed:RC=0x%08X\n",(unsigned int)Status); @@ -358,46 +359,47 @@ bool CFE_SB_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) ** Function to control actions when an SB command is received. ** ** Arguments: -** none +** Software bus buffer pointer ** ** Return: ** none */ -void CFE_SB_ProcessCmdPipePkt(void) { +void CFE_SB_ProcessCmdPipePkt(CFE_SB_Buffer_t *SBBufPtr) +{ CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; CFE_MSG_FcnCode_t FcnCode = 0; - CFE_MSG_GetMsgId(CFE_SB.CmdPipePktPtr, &MessageID); + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); switch(CFE_SB_MsgIdToValue(MessageID)){ case CFE_SB_SEND_HK_MID: /* Note: Command counter not incremented for this command */ - CFE_SB_SendHKTlmCmd((CFE_SB_CmdHdr_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_SendHKTlmCmd((CFE_MSG_CommandHeader_t *)SBBufPtr); break; case CFE_SB_SUB_RPT_CTRL_MID: /* Note: Command counter not incremented for this command */ - CFE_MSG_GetFcnCode(CFE_SB.CmdPipePktPtr, &FcnCode); + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); switch (FcnCode) { case CFE_SB_SEND_PREV_SUBS_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_SendPrevSubs_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendPrevSubsCmd_t))) { - CFE_SB_SendPrevSubsCmd((CFE_SB_SendPrevSubs_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_SendPrevSubsCmd((CFE_SB_SendPrevSubsCmd_t *)SBBufPtr); } break; case CFE_SB_ENABLE_SUB_REPORTING_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_EnableSubReporting_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_EnableSubReportingCmd_t))) { - CFE_SB_EnableSubReportingCmd((CFE_SB_EnableSubReporting_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_EnableSubReportingCmd((CFE_SB_EnableSubReportingCmd_t *)SBBufPtr); } break; case CFE_SB_DISABLE_SUB_REPORTING_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_DisableSubReporting_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_DisableSubReportingCmd_t))) { - CFE_SB_DisableSubReportingCmd((CFE_SB_DisableSubReporting_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_DisableSubReportingCmd((CFE_SB_DisableSubReportingCmd_t *)SBBufPtr); } break; @@ -410,62 +412,62 @@ void CFE_SB_ProcessCmdPipePkt(void) { break; case CFE_SB_CMD_MID: - CFE_MSG_GetFcnCode(CFE_SB.CmdPipePktPtr, &FcnCode); + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &FcnCode); switch (FcnCode) { case CFE_SB_NOOP_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_Noop_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_NoopCmd_t))) { - CFE_SB_NoopCmd((CFE_SB_Noop_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_NoopCmd((CFE_SB_NoopCmd_t *)SBBufPtr); } break; case CFE_SB_RESET_COUNTERS_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_ResetCounters_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_ResetCountersCmd_t))) { /* Note: Command counter not incremented for this command */ - CFE_SB_ResetCountersCmd((CFE_SB_ResetCounters_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_ResetCountersCmd((CFE_SB_ResetCountersCmd_t *)SBBufPtr); } break; case CFE_SB_SEND_SB_STATS_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_SendSbStats_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendSbStatsCmd_t))) { - CFE_SB_SendStatsCmd((CFE_SB_SendSbStats_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_SendStatsCmd((CFE_SB_SendSbStatsCmd_t *)SBBufPtr); } break; case CFE_SB_SEND_ROUTING_INFO_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_SendRoutingInfo_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendRoutingInfoCmd_t))) { - CFE_SB_SendRoutingInfoCmd((CFE_SB_SendRoutingInfo_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_SendRoutingInfoCmd((CFE_SB_SendRoutingInfoCmd_t *)SBBufPtr); } break; case CFE_SB_ENABLE_ROUTE_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_EnableRoute_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_EnableRouteCmd_t))) { - CFE_SB_EnableRouteCmd((CFE_SB_EnableRoute_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_EnableRouteCmd((CFE_SB_EnableRouteCmd_t *)SBBufPtr); } break; case CFE_SB_DISABLE_ROUTE_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_DisableRoute_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_DisableRouteCmd_t))) { - CFE_SB_DisableRouteCmd((CFE_SB_DisableRoute_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_DisableRouteCmd((CFE_SB_DisableRouteCmd_t *)SBBufPtr); } break; case CFE_SB_SEND_PIPE_INFO_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_SendPipeInfo_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendPipeInfoCmd_t))) { - CFE_SB_SendPipeInfoCmd((CFE_SB_SendPipeInfo_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_SendPipeInfoCmd((CFE_SB_SendPipeInfoCmd_t *)SBBufPtr); } break; case CFE_SB_SEND_MAP_INFO_CC: - if (CFE_SB_VerifyCmdLength(CFE_SB.CmdPipePktPtr, sizeof(CFE_SB_SendMapInfo_t))) + if (CFE_SB_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_SB_SendMapInfoCmd_t))) { - CFE_SB_SendMapInfoCmd((CFE_SB_SendMapInfo_t *)CFE_SB.CmdPipePktPtr); + CFE_SB_SendMapInfoCmd((CFE_SB_SendMapInfoCmd_t *)SBBufPtr); } break; @@ -497,7 +499,7 @@ void CFE_SB_ProcessCmdPipePkt(void) { ** Handler function the SB command ** */ -int32 CFE_SB_NoopCmd(const CFE_SB_Noop_t *data) +int32 CFE_SB_NoopCmd(const CFE_SB_NoopCmd_t *data) { CFE_EVS_SendEvent(CFE_SB_CMD0_RCVD_EID,CFE_EVS_EventType_INFORMATION, "No-op Cmd Rcvd. %s", CFE_VERSION_STRING); @@ -513,7 +515,7 @@ int32 CFE_SB_NoopCmd(const CFE_SB_Noop_t *data) ** Handler function the SB command ** */ -int32 CFE_SB_ResetCountersCmd(const CFE_SB_ResetCounters_t *data) +int32 CFE_SB_ResetCountersCmd(const CFE_SB_ResetCountersCmd_t *data) { CFE_EVS_SendEvent(CFE_SB_CMD1_RCVD_EID,CFE_EVS_EventType_DEBUG, "Reset Counters Cmd Rcvd"); @@ -530,7 +532,7 @@ int32 CFE_SB_ResetCountersCmd(const CFE_SB_ResetCounters_t *data) ** Handler function the SB command ** */ -int32 CFE_SB_EnableSubReportingCmd(const CFE_SB_EnableSubReporting_t *data) +int32 CFE_SB_EnableSubReportingCmd(const CFE_SB_EnableSubReportingCmd_t *data) { CFE_SB_SetSubscriptionReporting(CFE_SB_ENABLE); return CFE_SUCCESS; @@ -543,7 +545,7 @@ int32 CFE_SB_EnableSubReportingCmd(const CFE_SB_EnableSubReporting_t *data) ** Handler function the SB command ** */ -int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReporting_t *data) +int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReportingCmd_t *data) { CFE_SB_SetSubscriptionReporting(CFE_SB_DISABLE); return CFE_SUCCESS; @@ -565,13 +567,13 @@ int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReporting_t *data) ** Return: ** none */ -int32 CFE_SB_SendHKTlmCmd(const CFE_SB_CmdHdr_t *data) +int32 CFE_SB_SendHKTlmCmd(const CFE_MSG_CommandHeader_t *data) { CFE_SB.HKTlmMsg.Payload.MemInUse = CFE_SB.StatTlmMsg.Payload.MemInUse; CFE_SB.HKTlmMsg.Payload.UnmarkedMem = CFE_PLATFORM_SB_BUF_MEMORY_BYTES - CFE_SB.StatTlmMsg.Payload.PeakMemInUse; - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_SB.HKTlmMsg); - CFE_SB_SendMsg((CFE_MSG_Message_t *)&CFE_SB.HKTlmMsg); + CFE_SB_TimeStampMsg(&CFE_SB.HKTlmMsg.Hdr.Msg); + CFE_SB_TransmitMsg(&CFE_SB.HKTlmMsg.Hdr.Msg, true); return CFE_SUCCESS; }/* end CFE_SB_SendHKTlmCmd */ @@ -622,7 +624,7 @@ void CFE_SB_ResetCounters(void){ ** Return: ** None */ -int32 CFE_SB_EnableRouteCmd(const CFE_SB_EnableRoute_t *data) +int32 CFE_SB_EnableRouteCmd(const CFE_SB_EnableRouteCmd_t *data) { CFE_SB_MsgId_t MsgId; CFE_SB_PipeId_t PipeId; @@ -687,7 +689,7 @@ int32 CFE_SB_EnableRouteCmd(const CFE_SB_EnableRoute_t *data) ** Return: ** None */ -int32 CFE_SB_DisableRouteCmd(const CFE_SB_DisableRoute_t *data) +int32 CFE_SB_DisableRouteCmd(const CFE_SB_DisableRouteCmd_t *data) { CFE_SB_MsgId_t MsgId; CFE_SB_PipeId_t PipeId; @@ -749,11 +751,11 @@ int32 CFE_SB_DisableRouteCmd(const CFE_SB_DisableRoute_t *data) ** Return: ** None */ -int32 CFE_SB_SendStatsCmd(const CFE_SB_SendSbStats_t *data) +int32 CFE_SB_SendStatsCmd(const CFE_SB_SendSbStatsCmd_t *data) { - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_SB.StatTlmMsg); - CFE_SB_SendMsg((CFE_MSG_Message_t *)&CFE_SB.StatTlmMsg); + CFE_SB_TimeStampMsg(&CFE_SB.StatTlmMsg.Hdr.Msg); + CFE_SB_TransmitMsg(&CFE_SB.StatTlmMsg.Hdr.Msg, true); CFE_EVS_SendEvent(CFE_SB_SND_STATS_EID,CFE_EVS_EventType_DEBUG, "Software Bus Statistics packet sent"); @@ -776,7 +778,7 @@ int32 CFE_SB_SendStatsCmd(const CFE_SB_SendSbStats_t *data) ** Return: ** None */ -int32 CFE_SB_SendRoutingInfoCmd(const CFE_SB_SendRoutingInfo_t *data) +int32 CFE_SB_SendRoutingInfoCmd(const CFE_SB_SendRoutingInfoCmd_t *data) { const CFE_SB_WriteFileInfoCmd_Payload_t *ptr; char LocalFilename[OS_MAX_PATH_LEN]; @@ -806,7 +808,7 @@ int32 CFE_SB_SendRoutingInfoCmd(const CFE_SB_SendRoutingInfo_t *data) ** Return: ** None */ -int32 CFE_SB_SendPipeInfoCmd(const CFE_SB_SendPipeInfo_t *data) +int32 CFE_SB_SendPipeInfoCmd(const CFE_SB_SendPipeInfoCmd_t *data) { const CFE_SB_WriteFileInfoCmd_Payload_t *ptr; char LocalFilename[OS_MAX_PATH_LEN]; @@ -836,7 +838,7 @@ int32 CFE_SB_SendPipeInfoCmd(const CFE_SB_SendPipeInfo_t *data) ** Return: ** None */ -int32 CFE_SB_SendMapInfoCmd(const CFE_SB_SendMapInfo_t *data) +int32 CFE_SB_SendMapInfoCmd(const CFE_SB_SendMapInfoCmd_t *data) { const CFE_SB_WriteFileInfoCmd_Payload_t *ptr; char LocalFilename[OS_MAX_PATH_LEN]; @@ -1160,7 +1162,7 @@ void CFE_SB_SendRouteSub(CFE_SBR_RouteId_t RouteId, void *ArgPtr) if(CFE_SB.PrevSubMsg.Payload.Entries >= CFE_SB_SUB_ENTRIES_PER_PKT) { CFE_SB_UnlockSharedData(__func__,__LINE__); - status = CFE_SB_SendMsg((CFE_MSG_Message_t *)&CFE_SB.PrevSubMsg); + status = CFE_SB_TransmitMsg(&CFE_SB.PrevSubMsg.Hdr.Msg, true); CFE_EVS_SendEvent(CFE_SB_FULL_SUB_PKT_EID, CFE_EVS_EventType_DEBUG, "Full Sub Pkt %d Sent,Entries=%d,Stat=0x%x\n", (int)CFE_SB.PrevSubMsg.Payload.PktSegment, @@ -1199,7 +1201,7 @@ void CFE_SB_SendRouteSub(CFE_SBR_RouteId_t RouteId, void *ArgPtr) ** Return: ** None */ -int32 CFE_SB_SendPrevSubsCmd(const CFE_SB_SendPrevSubs_t *data) +int32 CFE_SB_SendPrevSubsCmd(const CFE_SB_SendPrevSubsCmd_t *data) { int32 status; @@ -1218,7 +1220,7 @@ int32 CFE_SB_SendPrevSubsCmd(const CFE_SB_SendPrevSubs_t *data) /* if pkt has any number of entries, send it as a partial pkt */ if(CFE_SB.PrevSubMsg.Payload.Entries > 0) { - status = CFE_SB_SendMsg((CFE_MSG_Message_t *)&CFE_SB.PrevSubMsg); + status = CFE_SB_TransmitMsg(&CFE_SB.PrevSubMsg.Hdr.Msg, true); CFE_EVS_SendEvent(CFE_SB_PART_SUB_PKT_EID, CFE_EVS_EventType_DEBUG, "Partial Sub Pkt %d Sent,Entries=%d,Stat=0x%x", (int)CFE_SB.PrevSubMsg.Payload.PktSegment, (int)CFE_SB.PrevSubMsg.Payload.Entries, diff --git a/fsw/cfe-core/src/sb/cfe_sb_util.c b/fsw/cfe-core/src/sb/cfe_sb_util.c index e1e43b127..654f5f47b 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_util.c +++ b/fsw/cfe-core/src/sb/cfe_sb_util.c @@ -86,11 +86,11 @@ size_t CFE_SB_MsgHdrSize(const CFE_MSG_Message_t *MsgPtr) } else if(type == CFE_MSG_Type_Cmd) { - size = sizeof(CFE_SB_CmdHdr_t); + size = sizeof(CFE_MSG_CommandHeader_t); } else if(type == CFE_MSG_Type_Tlm) { - size = sizeof(CFE_SB_TlmHdr_t); + size = sizeof(CFE_MSG_TelemetryHeader_t); } return size; diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_internal.c b/fsw/cfe-core/src/tbl/cfe_tbl_internal.c index e2ae1cb99..2ec3cf6e7 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_internal.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_internal.c @@ -142,14 +142,14 @@ int32 CFE_TBL_EarlyInit (void) /* ** Initialize housekeeping packet (clear user data area)... */ - CFE_MSG_Init(&CFE_TBL_TaskData.HkPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_TBL_TaskData.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TBL_HK_TLM_MID), sizeof(CFE_TBL_TaskData.HkPacket)); /* ** Initialize table registry report packet (clear user data area)... */ - CFE_MSG_Init(&CFE_TBL_TaskData.TblRegPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_TBL_TaskData.TblRegPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TBL_REG_TLM_MID), sizeof(CFE_TBL_TaskData.TblRegPacket)); @@ -1511,18 +1511,18 @@ int32 CFE_TBL_SendNotificationMsg(CFE_TBL_RegistryRec_t *RegRecPtr) /* ** Initialize notification message packet (clear user data area)... */ - CFE_MSG_Init((CFE_MSG_Message_t *)&CFE_TBL_TaskData.NotifyMsg, + CFE_MSG_Init(&CFE_TBL_TaskData.NotifyMsg.CmdHeader.Msg, RegRecPtr->NotificationMsgId, - sizeof(CFE_TBL_NotifyCmd_t)); + sizeof(CFE_TBL_TaskData.NotifyMsg)); /* Set the command code */ - CFE_MSG_SetFcnCode((CFE_MSG_Message_t *) &CFE_TBL_TaskData.NotifyMsg, RegRecPtr->NotificationCC); + CFE_MSG_SetFcnCode(&CFE_TBL_TaskData.NotifyMsg.CmdHeader.Msg, RegRecPtr->NotificationCC); /* Set the command parameter */ CFE_TBL_TaskData.NotifyMsg.Payload.Parameter = RegRecPtr->NotificationParam; - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_TBL_TaskData.NotifyMsg); - Status = CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TBL_TaskData.NotifyMsg); + CFE_SB_TimeStampMsg(&CFE_TBL_TaskData.NotifyMsg.CmdHeader.Msg); + Status = CFE_SB_TransmitMsg(&CFE_TBL_TaskData.NotifyMsg.CmdHeader.Msg, false); if (Status != CFE_SUCCESS) { diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task.c b/fsw/cfe-core/src/tbl/cfe_tbl_task.c index 828796f95..efea646f4 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_task.c @@ -54,7 +54,7 @@ CFE_TBL_TaskData_t CFE_TBL_TaskData; * For generic message entries, which only have a MID and a handler function (no command payload) */ #define CFE_TBL_MESSAGE_ENTRY(mid,handlerfunc) \ - { CFE_SB_MSGID_WRAP_VALUE(mid), 0, sizeof(CFE_SB_CmdHdr_t), (CFE_TBL_MsgProcFuncPtr_t)handlerfunc, CFE_TBL_MSG_MSGTYPE } + { CFE_SB_MSGID_WRAP_VALUE(mid), 0, sizeof(CFE_MSG_CommandHeader_t), (CFE_TBL_MsgProcFuncPtr_t)handlerfunc, CFE_TBL_MSG_MSGTYPE } /* * Macros to assist in building the CFE_TBL_CmdHandlerTbl - @@ -71,16 +71,16 @@ const CFE_TBL_CmdHandlerTblRec_t CFE_TBL_CmdHandlerTbl[] = CFE_TBL_MESSAGE_ENTRY(CFE_TBL_SEND_HK_MID, CFE_TBL_HousekeepingCmd), /* command entries (everything else) */ - CFE_TBL_COMMAND_ENTRY( CFE_TBL_NOOP_CC, CFE_TBL_Noop_t, CFE_TBL_NoopCmd), - CFE_TBL_COMMAND_ENTRY(CFE_TBL_RESET_COUNTERS_CC,CFE_TBL_ResetCounters_t,CFE_TBL_ResetCountersCmd), - CFE_TBL_COMMAND_ENTRY( CFE_TBL_LOAD_CC, CFE_TBL_Load_t, CFE_TBL_LoadCmd), - CFE_TBL_COMMAND_ENTRY( CFE_TBL_DUMP_CC, CFE_TBL_Dump_t, CFE_TBL_DumpCmd), - CFE_TBL_COMMAND_ENTRY( CFE_TBL_VALIDATE_CC, CFE_TBL_Validate_t, CFE_TBL_ValidateCmd), - CFE_TBL_COMMAND_ENTRY( CFE_TBL_ACTIVATE_CC, CFE_TBL_Activate_t, CFE_TBL_ActivateCmd), - CFE_TBL_COMMAND_ENTRY( CFE_TBL_DUMP_REGISTRY_CC, CFE_TBL_DumpRegistry_t, CFE_TBL_DumpRegistryCmd), - CFE_TBL_COMMAND_ENTRY( CFE_TBL_SEND_REGISTRY_CC, CFE_TBL_SendRegistry_t, CFE_TBL_SendRegistryCmd), - CFE_TBL_COMMAND_ENTRY( CFE_TBL_DELETE_CDS_CC, CFE_TBL_DeleteCDS_t, CFE_TBL_DeleteCDSCmd), - CFE_TBL_COMMAND_ENTRY( CFE_TBL_ABORT_LOAD_CC, CFE_TBL_AbortLoad_t, CFE_TBL_AbortLoadCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_NOOP_CC, CFE_TBL_NoopCmd_t, CFE_TBL_NoopCmd), + CFE_TBL_COMMAND_ENTRY(CFE_TBL_RESET_COUNTERS_CC,CFE_TBL_ResetCountersCmd_t,CFE_TBL_ResetCountersCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_LOAD_CC, CFE_TBL_LoadCmd_t, CFE_TBL_LoadCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_DUMP_CC, CFE_TBL_DumpCmd_t, CFE_TBL_DumpCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_VALIDATE_CC, CFE_TBL_ValidateCmd_t, CFE_TBL_ValidateCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_ACTIVATE_CC, CFE_TBL_ActivateCmd_t, CFE_TBL_ActivateCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_DUMP_REGISTRY_CC, CFE_TBL_DumpRegistryCmd_t, CFE_TBL_DumpRegistryCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_SEND_REGISTRY_CC, CFE_TBL_SendRegistryCmd_t, CFE_TBL_SendRegistryCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_DELETE_CDS_CC, CFE_TBL_DeleteCDSCmd_t, CFE_TBL_DeleteCDSCmd), + CFE_TBL_COMMAND_ENTRY( CFE_TBL_ABORT_LOAD_CC, CFE_TBL_AbortLoadCmd_t, CFE_TBL_AbortLoadCmd), /* list terminator (keep last) */ { CFE_SB_MSGID_RESERVED, 0, 0, NULL, CFE_TBL_TERM_MSGTYPE } @@ -91,7 +91,8 @@ const CFE_TBL_CmdHandlerTblRec_t CFE_TBL_CmdHandlerTbl[] = void CFE_TBL_TaskMain(void) { - int32 Status; + int32 Status; + CFE_SB_Buffer_t *SBBufPtr; CFE_ES_PerfLogEntry(CFE_MISSION_TBL_MAIN_PERF_ID); @@ -122,7 +123,7 @@ void CFE_TBL_TaskMain(void) CFE_ES_PerfLogExit(CFE_MISSION_TBL_MAIN_PERF_ID); /* Pend on receipt of packet */ - Status = CFE_SB_RcvMsg( &CFE_TBL_TaskData.MsgPtr, + Status = CFE_SB_ReceiveBuffer( &SBBufPtr, CFE_TBL_TaskData.CmdPipe, CFE_SB_PEND_FOREVER); @@ -131,14 +132,14 @@ void CFE_TBL_TaskMain(void) if (Status == CFE_SUCCESS) { /* Process cmd pipe msg */ - CFE_TBL_TaskPipe(CFE_TBL_TaskData.MsgPtr); + CFE_TBL_TaskPipe(SBBufPtr); }else{ CFE_ES_WriteToSysLog("TBL:Error reading cmd pipe,RC=0x%08X\n",(unsigned int)Status); }/* end if */ }/* end while */ - /* while loop exits only if CFE_SB_RcvMsg returns error */ + /* while loop exits only if CFE_SB_ReceiveBuffer returns error */ CFE_ES_ExitApp(CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR); } /* end CFE_TBL_TaskMain() */ @@ -245,11 +246,11 @@ void CFE_TBL_InitData(void) strncpy(CFE_TBL_TaskData.PipeName, CFE_TBL_TASK_PIPE_NAME, 16); /* Initialize Packet Headers */ - CFE_MSG_Init(&CFE_TBL_TaskData.HkPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_TBL_TaskData.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TBL_HK_TLM_MID), sizeof(CFE_TBL_TaskData.HkPacket)); - CFE_MSG_Init(&CFE_TBL_TaskData.TblRegPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_TBL_TaskData.TblRegPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TBL_REG_TLM_MID), sizeof(CFE_TBL_TaskData.TblRegPacket)); @@ -258,7 +259,7 @@ void CFE_TBL_InitData(void) /******************************************************************************/ -void CFE_TBL_TaskPipe(CFE_MSG_Message_t *MessagePtr) +void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr) { CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; CFE_MSG_FcnCode_t CommandCode = 0; @@ -266,8 +267,8 @@ void CFE_TBL_TaskPipe(CFE_MSG_Message_t *MessagePtr) CFE_MSG_Size_t ActualLength = 0; CFE_TBL_CmdProcRet_t CmdStatus = CFE_TBL_INC_ERR_CTR; /* Assume a failed command */ - CFE_MSG_GetMsgId(MessagePtr, &MessageID); - CFE_MSG_GetFcnCode(MessagePtr, &CommandCode); + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); /* Search the Command Handler Table for a matching message */ CmdIndx = CFE_TBL_SearchCmdHndlrTbl(MessageID, CommandCode); @@ -276,11 +277,11 @@ void CFE_TBL_TaskPipe(CFE_MSG_Message_t *MessagePtr) if (CmdIndx >= 0) { /* Verify Message Length before processing */ - CFE_MSG_GetSize(MessagePtr, &ActualLength); + CFE_MSG_GetSize(&SBBufPtr->Msg, &ActualLength); if (ActualLength == CFE_TBL_CmdHandlerTbl[CmdIndx].ExpectedLength) { /* All checks have passed, call the appropriate message handler */ - CmdStatus = (CFE_TBL_CmdHandlerTbl[CmdIndx].MsgProcFuncPtr)(MessagePtr); + CmdStatus = (CFE_TBL_CmdHandlerTbl[CmdIndx].MsgProcFuncPtr)(SBBufPtr); } else /* Bad Message Length */ { diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task.h b/fsw/cfe-core/src/tbl/cfe_tbl_task.h index d2f2bf135..4e0f8fa2f 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task.h +++ b/fsw/cfe-core/src/tbl/cfe_tbl_task.h @@ -308,7 +308,6 @@ typedef struct /* ** Task operational data (not reported in housekeeping)... */ - CFE_MSG_Message_t *MsgPtr; /**< \brief Pointer to most recently received command message */ CFE_SB_PipeId_t CmdPipe; /**< \brief Table Task command pipe ID as obtained from Software Bus */ /* @@ -404,7 +403,7 @@ int32 CFE_TBL_TaskInit(void); ** ** ******************************************************************************/ -void CFE_TBL_TaskPipe(CFE_MSG_Message_t *MessagePtr); +void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); /*****************************************************************************/ /** diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c b/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c index 5f49c229d..32b286873 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c @@ -53,7 +53,7 @@ ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) +int32 CFE_TBL_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) { int32 Status; uint32 i; @@ -69,8 +69,8 @@ int32 CFE_TBL_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) /* ** Send housekeeping telemetry packet */ - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_TBL_TaskData.HkPacket); - Status = CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TBL_TaskData.HkPacket); + CFE_SB_TimeStampMsg(&CFE_TBL_TaskData.HkPacket.TlmHeader.Msg); + Status = CFE_SB_TransmitMsg(&CFE_TBL_TaskData.HkPacket.TlmHeader.Msg, true); if (Status != CFE_SUCCESS) { @@ -88,8 +88,8 @@ int32 CFE_TBL_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) /* ** Send Table Registry Info Packet */ - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_TBL_TaskData.TblRegPacket); - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TBL_TaskData.TblRegPacket); + CFE_SB_TimeStampMsg(&CFE_TBL_TaskData.TblRegPacket.TlmHeader.Msg); + CFE_SB_TransmitMsg(&CFE_TBL_TaskData.TblRegPacket.TlmHeader.Msg, true); /* Once the data has been sent, clear the index so that we don't send it again and again */ CFE_TBL_TaskData.HkTlmTblRegIndex = CFE_TBL_NOT_FOUND; @@ -325,7 +325,7 @@ void CFE_TBL_GetTblRegData(void) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_NoopCmd(const CFE_TBL_Noop_t *data) +int32 CFE_TBL_NoopCmd(const CFE_TBL_NoopCmd_t *data) { /* Acknowledge receipt of NOOP with Event Message */ CFE_EVS_SendEvent(CFE_TBL_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op command. %s", CFE_VERSION_STRING); @@ -342,7 +342,7 @@ int32 CFE_TBL_NoopCmd(const CFE_TBL_Noop_t *data) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_ResetCountersCmd(const CFE_TBL_ResetCounters_t *data) +int32 CFE_TBL_ResetCountersCmd(const CFE_TBL_ResetCountersCmd_t *data) { CFE_TBL_TaskData.CommandCounter = 0; CFE_TBL_TaskData.CommandErrorCounter = 0; @@ -367,7 +367,7 @@ int32 CFE_TBL_ResetCountersCmd(const CFE_TBL_ResetCounters_t *data) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_LoadCmd(const CFE_TBL_Load_t *data) +int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data) { CFE_TBL_CmdProcRet_t ReturnCode = CFE_TBL_INC_ERR_CTR; /* Assume failure */ const CFE_TBL_LoadCmd_Payload_t *CmdPtr = &data->Payload; @@ -572,7 +572,7 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_Load_t *data) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_DumpCmd(const CFE_TBL_Dump_t *data) +int32 CFE_TBL_DumpCmd(const CFE_TBL_DumpCmd_t *data) { CFE_TBL_CmdProcRet_t ReturnCode = CFE_TBL_INC_ERR_CTR; /* Assume failure */ int16 RegIndex; @@ -865,7 +865,7 @@ CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile( const char *DumpFilename, const char *T ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_ValidateCmd(const CFE_TBL_Validate_t *data) +int32 CFE_TBL_ValidateCmd(const CFE_TBL_ValidateCmd_t *data) { CFE_TBL_CmdProcRet_t ReturnCode = CFE_TBL_INC_ERR_CTR; /* Assume failure */ int16 RegIndex; @@ -1023,7 +1023,7 @@ int32 CFE_TBL_ValidateCmd(const CFE_TBL_Validate_t *data) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_ActivateCmd(const CFE_TBL_Activate_t *data) +int32 CFE_TBL_ActivateCmd(const CFE_TBL_ActivateCmd_t *data) { CFE_TBL_CmdProcRet_t ReturnCode = CFE_TBL_INC_ERR_CTR; /* Assume failure */ int16 RegIndex; @@ -1115,7 +1115,7 @@ int32 CFE_TBL_ActivateCmd(const CFE_TBL_Activate_t *data) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistry_t *data) +int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistryCmd_t *data) { CFE_TBL_CmdProcRet_t ReturnCode = CFE_TBL_INC_ERR_CTR; /* Assume failure */ bool FileExistedPrev = false; @@ -1301,7 +1301,7 @@ int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistry_t *data) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_SendRegistryCmd(const CFE_TBL_SendRegistry_t *data) +int32 CFE_TBL_SendRegistryCmd(const CFE_TBL_SendRegistryCmd_t *data) { CFE_TBL_CmdProcRet_t ReturnCode = CFE_TBL_INC_ERR_CTR; /* Assume failure */ int16 RegIndex; @@ -1348,7 +1348,7 @@ int32 CFE_TBL_SendRegistryCmd(const CFE_TBL_SendRegistry_t *data) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDS_t *data) +int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDSCmd_t *data) { CFE_TBL_CmdProcRet_t ReturnCode = CFE_TBL_INC_ERR_CTR; /* Assume failure */ const CFE_TBL_DelCDSCmd_Payload_t *CmdPtr = &data->Payload; @@ -1446,7 +1446,7 @@ int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDS_t *data) ** NOTE: For complete prolog information, see 'cfe_tbl_task_cmds.h' ********************************************************************/ -int32 CFE_TBL_AbortLoadCmd(const CFE_TBL_AbortLoad_t *data) +int32 CFE_TBL_AbortLoadCmd(const CFE_TBL_AbortLoadCmd_t *data) { CFE_TBL_CmdProcRet_t ReturnCode = CFE_TBL_INC_ERR_CTR; /* Assume failure */ int16 RegIndex; diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h b/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h index 486f46cc7..ba3531cde 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h +++ b/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h @@ -126,7 +126,7 @@ extern void CFE_TBL_GetTblRegData(void); ** ** \retval #CFE_TBL_DONT_INC_CTR \copydoc CFE_TBL_DONT_INC_CTR ******************************************************************************/ -int32 CFE_TBL_HousekeepingCmd(const CFE_SB_CmdHdr_t *data); +int32 CFE_TBL_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data); /*****************************************************************************/ /** @@ -143,7 +143,7 @@ int32 CFE_TBL_HousekeepingCmd(const CFE_SB_CmdHdr_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_NoopCmd(const CFE_TBL_Noop_t *data); +int32 CFE_TBL_NoopCmd(const CFE_TBL_NoopCmd_t *data); /*****************************************************************************/ /** @@ -159,7 +159,7 @@ int32 CFE_TBL_NoopCmd(const CFE_TBL_Noop_t *data); ** ** \retval #CFE_TBL_DONT_INC_CTR \copydoc CFE_TBL_DONT_INC_CTR ******************************************************************************/ -int32 CFE_TBL_ResetCountersCmd(const CFE_TBL_ResetCounters_t *data); +int32 CFE_TBL_ResetCountersCmd(const CFE_TBL_ResetCountersCmd_t *data); /*****************************************************************************/ /** @@ -177,7 +177,7 @@ int32 CFE_TBL_ResetCountersCmd(const CFE_TBL_ResetCounters_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_LoadCmd(const CFE_TBL_Load_t *data); +int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data); /*****************************************************************************/ /** @@ -195,7 +195,7 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_Load_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_DumpCmd(const CFE_TBL_Dump_t *data); +int32 CFE_TBL_DumpCmd(const CFE_TBL_DumpCmd_t *data); /*****************************************************************************/ /** @@ -214,7 +214,7 @@ int32 CFE_TBL_DumpCmd(const CFE_TBL_Dump_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_ValidateCmd(const CFE_TBL_Validate_t *data); +int32 CFE_TBL_ValidateCmd(const CFE_TBL_ValidateCmd_t *data); /*****************************************************************************/ /** @@ -232,7 +232,7 @@ int32 CFE_TBL_ValidateCmd(const CFE_TBL_Validate_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_ActivateCmd(const CFE_TBL_Activate_t *data); +int32 CFE_TBL_ActivateCmd(const CFE_TBL_ActivateCmd_t *data); /*****************************************************************************/ /** @@ -249,7 +249,7 @@ int32 CFE_TBL_ActivateCmd(const CFE_TBL_Activate_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistry_t *data); +int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistryCmd_t *data); /*****************************************************************************/ /** @@ -267,7 +267,7 @@ int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistry_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_SendRegistryCmd(const CFE_TBL_SendRegistry_t *data); +int32 CFE_TBL_SendRegistryCmd(const CFE_TBL_SendRegistryCmd_t *data); /*****************************************************************************/ /** @@ -284,7 +284,7 @@ int32 CFE_TBL_SendRegistryCmd(const CFE_TBL_SendRegistry_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDS_t *data); +int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDSCmd_t *data); /*****************************************************************************/ /** @@ -301,7 +301,7 @@ int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDS_t *data); ** \retval #CFE_TBL_INC_ERR_CTR \copydoc CFE_TBL_INC_ERR_CTR ** \retval #CFE_TBL_INC_CMD_CTR \copydoc CFE_TBL_INC_CMD_CTR ******************************************************************************/ -int32 CFE_TBL_AbortLoadCmd(const CFE_TBL_AbortLoad_t *data); +int32 CFE_TBL_AbortLoadCmd(const CFE_TBL_AbortLoadCmd_t *data); /*****************************************************************************/ diff --git a/fsw/cfe-core/src/time/cfe_time_task.c b/fsw/cfe-core/src/time/cfe_time_task.c index 24a8c65f1..702525bcd 100644 --- a/fsw/cfe-core/src/time/cfe_time_task.c +++ b/fsw/cfe-core/src/time/cfe_time_task.c @@ -46,12 +46,12 @@ CFE_TIME_TaskData_t CFE_TIME_TaskData; /* ** Command handler for "HK request"... */ -int32 CFE_TIME_HousekeepingCmd(const CFE_SB_CmdHdr_t *data); +int32 CFE_TIME_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data); /* ** Command handler for "tone signal detected"... */ -int32 CFE_TIME_ToneSignalCmd(const CFE_SB_CmdHdr_t *data); +int32 CFE_TIME_ToneSignalCmd(const CFE_TIME_ToneSignalCmd_t *data); /* ** Command handler for "time at the tone"... @@ -61,7 +61,7 @@ int32 CFE_TIME_ToneDataCmd(const CFE_TIME_ToneDataCmd_t *data); /* ** Command handler for 1Hz signal... */ -int32 CFE_TIME_OneHzCmd(const CFE_SB_CmdHdr_t *data); +int32 CFE_TIME_OneHzCmd(const CFE_TIME_1HzCmd_t *data); /* ** Command handler for "request time at the tone"... @@ -79,7 +79,7 @@ int32 CFE_TIME_OneHzCmd(const CFE_SB_CmdHdr_t *data); ** non-fake tone mode. */ #if (CFE_PLATFORM_TIME_CFG_SERVER == true) -int32 CFE_TIME_ToneSendCmd(const CFE_SB_CmdHdr_t *data); +int32 CFE_TIME_ToneSendCmd(const CFE_TIME_FakeToneCmd_t *data); #endif /* @@ -92,22 +92,22 @@ void CFE_TIME_AdjustImpl(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, CFE_TIME_ /* ** Ground command handlers... */ -int32 CFE_TIME_Add1HZAdjustmentCmd(const CFE_TIME_Add1HZAdjustment_t *data); -int32 CFE_TIME_AddAdjustCmd(const CFE_TIME_AddAdjust_t *data); -int32 CFE_TIME_AddDelayCmd(const CFE_TIME_AddDelay_t *data); -int32 CFE_TIME_SendDiagnosticTlm(const CFE_TIME_SendDiagnosticTlm_t *data); -int32 CFE_TIME_NoopCmd(const CFE_TIME_Noop_t *data); -int32 CFE_TIME_ResetCountersCmd(const CFE_TIME_ResetCounters_t *data); -int32 CFE_TIME_SetLeapSecondsCmd(const CFE_TIME_SetLeapSeconds_t *data); -int32 CFE_TIME_SetMETCmd(const CFE_TIME_SetMET_t *data); -int32 CFE_TIME_SetSignalCmd(const CFE_TIME_SetSignal_t *data); -int32 CFE_TIME_SetSourceCmd(const CFE_TIME_SetSource_t *data); -int32 CFE_TIME_SetStateCmd(const CFE_TIME_SetState_t *data); -int32 CFE_TIME_SetSTCFCmd(const CFE_TIME_SetSTCF_t *data); -int32 CFE_TIME_SetTimeCmd(const CFE_TIME_SetTime_t *data); -int32 CFE_TIME_Sub1HZAdjustmentCmd(const CFE_TIME_Sub1HZAdjustment_t *data); -int32 CFE_TIME_SubAdjustCmd(const CFE_TIME_SubAdjust_t *data); -int32 CFE_TIME_SubDelayCmd(const CFE_TIME_SubDelay_t *data); +int32 CFE_TIME_Add1HZAdjustmentCmd(const CFE_TIME_Add1HZAdjustmentCmd_t *data); +int32 CFE_TIME_AddAdjustCmd(const CFE_TIME_AddAdjustCmd_t *data); +int32 CFE_TIME_AddDelayCmd(const CFE_TIME_AddDelayCmd_t *data); +int32 CFE_TIME_SendDiagnosticTlm(const CFE_TIME_SendDiagnosticCmd_t *data); +int32 CFE_TIME_NoopCmd(const CFE_TIME_NoopCmd_t *data); +int32 CFE_TIME_ResetCountersCmd(const CFE_TIME_ResetCountersCmd_t *data); +int32 CFE_TIME_SetLeapSecondsCmd(const CFE_TIME_SetLeapSecondsCmd_t *data); +int32 CFE_TIME_SetMETCmd(const CFE_TIME_SetMETCmd_t *data); +int32 CFE_TIME_SetSignalCmd(const CFE_TIME_SetSignalCmd_t *data); +int32 CFE_TIME_SetSourceCmd(const CFE_TIME_SetSourceCmd_t *data); +int32 CFE_TIME_SetStateCmd(const CFE_TIME_SetStateCmd_t *data); +int32 CFE_TIME_SetSTCFCmd(const CFE_TIME_SetSTCFCmd_t *data); +int32 CFE_TIME_SetTimeCmd(const CFE_TIME_SetTimeCmd_t *data); +int32 CFE_TIME_Sub1HZAdjustmentCmd(const CFE_TIME_Sub1HZAdjustmentCmd_t *data); +int32 CFE_TIME_SubAdjustCmd(const CFE_TIME_SubAdjustCmd_t *data); +int32 CFE_TIME_SubDelayCmd(const CFE_TIME_SubDelayCmd_t *data); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ @@ -135,7 +135,8 @@ int32 CFE_TIME_EarlyInit(void) void CFE_TIME_TaskMain(void) { - int32 Status; + int32 Status; + CFE_SB_Buffer_t *SBBufPtr; CFE_ES_PerfLogEntry(CFE_MISSION_TIME_MAIN_PERF_ID); @@ -167,7 +168,7 @@ void CFE_TIME_TaskMain(void) CFE_ES_PerfLogExit(CFE_MISSION_TIME_MAIN_PERF_ID); /* Pend on receipt of packet */ - Status = CFE_SB_RcvMsg(&CFE_TIME_TaskData.MsgPtr, + Status = CFE_SB_ReceiveBuffer(&SBBufPtr, CFE_TIME_TaskData.CmdPipe, CFE_SB_PEND_FOREVER); @@ -176,14 +177,14 @@ void CFE_TIME_TaskMain(void) if (Status == CFE_SUCCESS) { /* Process cmd pipe msg */ - CFE_TIME_TaskPipe(CFE_TIME_TaskData.MsgPtr); + CFE_TIME_TaskPipe(SBBufPtr); }else{ CFE_ES_WriteToSysLog("TIME:Error reading cmd pipe,RC=0x%08X\n",(unsigned int)Status); }/* end if */ }/* end while */ - /* while loop exits only if CFE_SB_RcvMsg returns error */ + /* while loop exits only if CFE_SB_ReceiveBuffer returns error */ CFE_ES_ExitApp(CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR); } /* end CFE_TIME_TaskMain */ @@ -463,12 +464,12 @@ bool CFE_TIME_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void CFE_TIME_TaskPipe(CFE_MSG_Message_t *MsgPtr) +void CFE_TIME_TaskPipe(CFE_SB_Buffer_t *SBBufPtr) { CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; CFE_MSG_FcnCode_t CommandCode = 0; - CFE_MSG_GetMsgId(MsgPtr, &MessageID); + CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MessageID); switch (CFE_SB_MsgIdToValue(MessageID)) { @@ -476,28 +477,28 @@ void CFE_TIME_TaskPipe(CFE_MSG_Message_t *MsgPtr) ** Housekeeping telemetry request... */ case CFE_TIME_SEND_HK_MID: - CFE_TIME_HousekeepingCmd((CFE_SB_CmdHdr_t *)MsgPtr); + CFE_TIME_HousekeepingCmd((CFE_MSG_CommandHeader_t *)SBBufPtr); break; /* ** Time at the tone "signal"... */ case CFE_TIME_TONE_CMD_MID: - CFE_TIME_ToneSignalCmd((CFE_SB_CmdHdr_t *)MsgPtr); + CFE_TIME_ToneSignalCmd((CFE_TIME_ToneSignalCmd_t *)SBBufPtr); break; /* ** Time at the tone "data"... */ case CFE_TIME_DATA_CMD_MID: - CFE_TIME_ToneDataCmd((CFE_TIME_ToneDataCmd_t *)MsgPtr); + CFE_TIME_ToneDataCmd((CFE_TIME_ToneDataCmd_t *)SBBufPtr); break; /* ** Run time state machine at 1Hz... */ case CFE_TIME_1HZ_CMD_MID: - CFE_TIME_OneHzCmd((CFE_SB_CmdHdr_t *)MsgPtr); + CFE_TIME_OneHzCmd((CFE_TIME_1HzCmd_t *)SBBufPtr); break; /* @@ -505,7 +506,7 @@ void CFE_TIME_TaskPipe(CFE_MSG_Message_t *MsgPtr) */ #if (CFE_PLATFORM_TIME_CFG_SERVER == true) case CFE_TIME_SEND_CMD_MID: - CFE_TIME_ToneSendCmd((CFE_SB_CmdHdr_t *)MsgPtr); + CFE_TIME_ToneSendCmd((CFE_TIME_FakeToneCmd_t *)SBBufPtr); break; #endif @@ -514,48 +515,48 @@ void CFE_TIME_TaskPipe(CFE_MSG_Message_t *MsgPtr) */ case CFE_TIME_CMD_MID: - CFE_MSG_GetFcnCode(MsgPtr, &CommandCode); + CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &CommandCode); switch (CommandCode) { case CFE_TIME_NOOP_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_Noop_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_NoopCmd_t))) { - CFE_TIME_NoopCmd((CFE_TIME_Noop_t *)MsgPtr); + CFE_TIME_NoopCmd((CFE_TIME_NoopCmd_t *)SBBufPtr); } break; case CFE_TIME_RESET_COUNTERS_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_ResetCounters_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_ResetCountersCmd_t))) { - CFE_TIME_ResetCountersCmd((CFE_TIME_ResetCounters_t *)MsgPtr); + CFE_TIME_ResetCountersCmd((CFE_TIME_ResetCountersCmd_t *)SBBufPtr); } break; case CFE_TIME_SEND_DIAGNOSTIC_TLM_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SendDiagnosticTlm_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SendDiagnosticCmd_t))) { - CFE_TIME_SendDiagnosticTlm((CFE_TIME_SendDiagnosticTlm_t *)MsgPtr); + CFE_TIME_SendDiagnosticTlm((CFE_TIME_SendDiagnosticCmd_t *)SBBufPtr); } break; case CFE_TIME_SET_STATE_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SetState_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetStateCmd_t))) { - CFE_TIME_SetStateCmd((CFE_TIME_SetState_t *)MsgPtr); + CFE_TIME_SetStateCmd((CFE_TIME_SetStateCmd_t *)SBBufPtr); } break; case CFE_TIME_SET_SOURCE_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SetSource_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSourceCmd_t))) { - CFE_TIME_SetSourceCmd((CFE_TIME_SetSource_t *)MsgPtr); + CFE_TIME_SetSourceCmd((CFE_TIME_SetSourceCmd_t *)SBBufPtr); } break; case CFE_TIME_SET_SIGNAL_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SetSignal_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSignalCmd_t))) { - CFE_TIME_SetSignalCmd((CFE_TIME_SetSignal_t *)MsgPtr); + CFE_TIME_SetSignalCmd((CFE_TIME_SetSignalCmd_t *)SBBufPtr); } break; @@ -563,16 +564,16 @@ void CFE_TIME_TaskPipe(CFE_MSG_Message_t *MsgPtr) ** Time Clients process "tone delay" commands... */ case CFE_TIME_ADD_DELAY_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_AddDelay_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_AddDelayCmd_t))) { - CFE_TIME_AddDelayCmd((CFE_TIME_AddDelay_t *)MsgPtr); + CFE_TIME_AddDelayCmd((CFE_TIME_AddDelayCmd_t *)SBBufPtr); } break; case CFE_TIME_SUB_DELAY_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SubDelay_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SubDelayCmd_t))) { - CFE_TIME_SubDelayCmd((CFE_TIME_SubDelay_t *)MsgPtr); + CFE_TIME_SubDelayCmd((CFE_TIME_SubDelayCmd_t *)SBBufPtr); } break; @@ -580,58 +581,58 @@ void CFE_TIME_TaskPipe(CFE_MSG_Message_t *MsgPtr) ** Time Servers process "set time" commands... */ case CFE_TIME_SET_TIME_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SetTime_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetTimeCmd_t))) { - CFE_TIME_SetTimeCmd((CFE_TIME_SetTime_t *)MsgPtr); + CFE_TIME_SetTimeCmd((CFE_TIME_SetTimeCmd_t *)SBBufPtr); } break; case CFE_TIME_SET_MET_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SetMET_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetMETCmd_t))) { - CFE_TIME_SetMETCmd((CFE_TIME_SetMET_t *)MsgPtr); + CFE_TIME_SetMETCmd((CFE_TIME_SetMETCmd_t *)SBBufPtr); } break; case CFE_TIME_SET_STCF_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SetSTCF_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetSTCFCmd_t))) { - CFE_TIME_SetSTCFCmd((CFE_TIME_SetSTCF_t *)MsgPtr); + CFE_TIME_SetSTCFCmd((CFE_TIME_SetSTCFCmd_t *)SBBufPtr); } break; case CFE_TIME_SET_LEAP_SECONDS_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SetLeapSeconds_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SetLeapSecondsCmd_t))) { - CFE_TIME_SetLeapSecondsCmd((CFE_TIME_SetLeapSeconds_t *)MsgPtr); + CFE_TIME_SetLeapSecondsCmd((CFE_TIME_SetLeapSecondsCmd_t *)SBBufPtr); } break; case CFE_TIME_ADD_ADJUST_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_AddAdjust_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_AddAdjustCmd_t))) { - CFE_TIME_AddAdjustCmd((CFE_TIME_AddAdjust_t *)MsgPtr); + CFE_TIME_AddAdjustCmd((CFE_TIME_AddAdjustCmd_t *)SBBufPtr); } break; case CFE_TIME_SUB_ADJUST_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_SubAdjust_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_SubAdjustCmd_t))) { - CFE_TIME_SubAdjustCmd((CFE_TIME_SubAdjust_t *)MsgPtr); + CFE_TIME_SubAdjustCmd((CFE_TIME_SubAdjustCmd_t *)SBBufPtr); } break; case CFE_TIME_ADD_1HZ_ADJUSTMENT_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_Add1HZAdjustment_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Add1HZAdjustmentCmd_t))) { - CFE_TIME_Add1HZAdjustmentCmd((CFE_TIME_Add1HZAdjustment_t *)MsgPtr); + CFE_TIME_Add1HZAdjustmentCmd((CFE_TIME_Add1HZAdjustmentCmd_t *)SBBufPtr); } break; case CFE_TIME_SUB_1HZ_ADJUSTMENT_CC: - if (CFE_TIME_VerifyCmdLength(MsgPtr, sizeof(CFE_TIME_Sub1HZAdjustment_t))) + if (CFE_TIME_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_TIME_Sub1HZAdjustmentCmd_t))) { - CFE_TIME_Sub1HZAdjustmentCmd((CFE_TIME_Sub1HZAdjustment_t *)MsgPtr); + CFE_TIME_Sub1HZAdjustmentCmd((CFE_TIME_Sub1HZAdjustmentCmd_t *)SBBufPtr); } break; @@ -670,7 +671,7 @@ void CFE_TIME_TaskPipe(CFE_MSG_Message_t *MsgPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) +int32 CFE_TIME_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) { CFE_TIME_Reference_t Reference; @@ -692,8 +693,8 @@ int32 CFE_TIME_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) /* ** Send housekeeping telemetry packet... */ - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.HkPacket); - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.HkPacket); + CFE_SB_TimeStampMsg(&CFE_TIME_TaskData.HkPacket.TlmHeader.Msg); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.HkPacket.TlmHeader.Msg, true); /* ** Note: we only increment the command execution counter when @@ -710,7 +711,7 @@ int32 CFE_TIME_HousekeepingCmd(const CFE_SB_CmdHdr_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_ToneSignalCmd(const CFE_SB_CmdHdr_t *data) +int32 CFE_TIME_ToneSignalCmd(const CFE_TIME_ToneSignalCmd_t *data) { /* ** Indication that tone signal occurred recently... @@ -759,7 +760,7 @@ int32 CFE_TIME_ToneDataCmd(const CFE_TIME_ToneDataCmd_t *data) * as we do not need a separate MID for this job. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_OneHzCmd(const CFE_SB_CmdHdr_t *data) +int32 CFE_TIME_OneHzCmd(const CFE_TIME_1HzCmd_t *data) { /* * Run the state machine updates required at 1Hz. @@ -792,7 +793,7 @@ int32 CFE_TIME_OneHzCmd(const CFE_SB_CmdHdr_t *data) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if (CFE_PLATFORM_TIME_CFG_SERVER == true) -int32 CFE_TIME_ToneSendCmd(const CFE_SB_CmdHdr_t *data) +int32 CFE_TIME_ToneSendCmd(const CFE_TIME_FakeToneCmd_t *data) { /* ** Request for "time at tone" data packet (probably scheduler)... @@ -814,7 +815,7 @@ int32 CFE_TIME_ToneSendCmd(const CFE_SB_CmdHdr_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_NoopCmd(const CFE_TIME_Noop_t *data) +int32 CFE_TIME_NoopCmd(const CFE_TIME_NoopCmd_t *data) { CFE_TIME_TaskData.CommandCounter++; @@ -833,7 +834,7 @@ int32 CFE_TIME_NoopCmd(const CFE_TIME_Noop_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_ResetCountersCmd(const CFE_TIME_ResetCounters_t *data) +int32 CFE_TIME_ResetCountersCmd(const CFE_TIME_ResetCountersCmd_t *data) { CFE_TIME_TaskData.CommandCounter = 0; @@ -876,20 +877,20 @@ int32 CFE_TIME_ResetCountersCmd(const CFE_TIME_ResetCounters_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SendDiagnosticTlm(const CFE_TIME_SendDiagnosticTlm_t *data) +int32 CFE_TIME_SendDiagnosticTlm(const CFE_TIME_SendDiagnosticCmd_t *data) { CFE_TIME_TaskData.CommandCounter++; /* - ** Collect housekeeping data from Time Services utilities... + ** Collect diagnostics data from Time Services utilities... */ CFE_TIME_GetDiagData(); /* - ** Send housekeeping telemetry packet... + ** Send diagnostics telemetry packet... */ - CFE_SB_TimeStampMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.DiagPacket); - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.DiagPacket); + CFE_SB_TimeStampMsg(&CFE_TIME_TaskData.DiagPacket.TlmHeader.Msg); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.DiagPacket.TlmHeader.Msg, true); CFE_EVS_SendEvent(CFE_TIME_DIAG_EID, CFE_EVS_EventType_DEBUG, "Request diagnostics command"); @@ -905,7 +906,7 @@ int32 CFE_TIME_SendDiagnosticTlm(const CFE_TIME_SendDiagnosticTlm_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SetStateCmd(const CFE_TIME_SetState_t *data) +int32 CFE_TIME_SetStateCmd(const CFE_TIME_SetStateCmd_t *data) { const CFE_TIME_StateCmd_Payload_t *CommandPtr = &data->Payload; const char *ClockStateText; @@ -957,7 +958,7 @@ int32 CFE_TIME_SetStateCmd(const CFE_TIME_SetState_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SetSourceCmd(const CFE_TIME_SetSource_t *data) +int32 CFE_TIME_SetSourceCmd(const CFE_TIME_SetSourceCmd_t *data) { const CFE_TIME_SourceCmd_Payload_t *CommandPtr = &data->Payload; @@ -1027,7 +1028,7 @@ int32 CFE_TIME_SetSourceCmd(const CFE_TIME_SetSource_t *data) /* CFE_TIME_SetSignalCmd() -- Time task command (set tone source) */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SetSignalCmd(const CFE_TIME_SetSignal_t *data) +int32 CFE_TIME_SetSignalCmd(const CFE_TIME_SetSignalCmd_t *data) { const CFE_TIME_SignalCmd_Payload_t *CommandPtr = &data->Payload; @@ -1150,12 +1151,12 @@ void CFE_TIME_SetDelayImpl(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, CFE_TIM /* Wrapper around CFE_TIME_SetDelayImpl() for add/subtract operations */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_AddDelayCmd(const CFE_TIME_AddDelay_t *data) +int32 CFE_TIME_AddDelayCmd(const CFE_TIME_AddDelayCmd_t *data) { CFE_TIME_SetDelayImpl(&data->Payload, CFE_TIME_AdjustDirection_ADD); return CFE_SUCCESS; } -int32 CFE_TIME_SubDelayCmd(const CFE_TIME_SubDelay_t *data) +int32 CFE_TIME_SubDelayCmd(const CFE_TIME_SubDelayCmd_t *data) { CFE_TIME_SetDelayImpl(&data->Payload, CFE_TIME_AdjustDirection_SUBTRACT); return CFE_SUCCESS; @@ -1167,7 +1168,7 @@ int32 CFE_TIME_SubDelayCmd(const CFE_TIME_SubDelay_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SetTimeCmd(const CFE_TIME_SetTime_t *data) +int32 CFE_TIME_SetTimeCmd(const CFE_TIME_SetTimeCmd_t *data) { const CFE_TIME_TimeCmd_Payload_t *CommandPtr = &data->Payload; @@ -1226,7 +1227,7 @@ int32 CFE_TIME_SetTimeCmd(const CFE_TIME_SetTime_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SetMETCmd(const CFE_TIME_SetMET_t *data) +int32 CFE_TIME_SetMETCmd(const CFE_TIME_SetMETCmd_t *data) { const CFE_TIME_TimeCmd_Payload_t *CommandPtr = &data->Payload; @@ -1280,7 +1281,7 @@ int32 CFE_TIME_SetMETCmd(const CFE_TIME_SetMET_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SetSTCFCmd(const CFE_TIME_SetSTCF_t *data) +int32 CFE_TIME_SetSTCFCmd(const CFE_TIME_SetSTCFCmd_t *data) { const CFE_TIME_TimeCmd_Payload_t *CommandPtr = &data->Payload; @@ -1334,7 +1335,7 @@ int32 CFE_TIME_SetSTCFCmd(const CFE_TIME_SetSTCF_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SetLeapSecondsCmd(const CFE_TIME_SetLeapSeconds_t *data) +int32 CFE_TIME_SetLeapSecondsCmd(const CFE_TIME_SetLeapSecondsCmd_t *data) { #if (CFE_PLATFORM_TIME_CFG_SERVER == true) @@ -1424,7 +1425,7 @@ void CFE_TIME_AdjustImpl(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, CFE_TIME_ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_AddAdjustCmd(const CFE_TIME_AddAdjust_t *data) +int32 CFE_TIME_AddAdjustCmd(const CFE_TIME_AddAdjustCmd_t *data) { CFE_TIME_AdjustImpl(&data->Payload, CFE_TIME_AdjustDirection_ADD); return CFE_SUCCESS; @@ -1438,7 +1439,7 @@ int32 CFE_TIME_AddAdjustCmd(const CFE_TIME_AddAdjust_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_SubAdjustCmd(const CFE_TIME_SubAdjust_t *data) +int32 CFE_TIME_SubAdjustCmd(const CFE_TIME_SubAdjustCmd_t *data) { CFE_TIME_AdjustImpl(&data->Payload, CFE_TIME_AdjustDirection_SUBTRACT); return CFE_SUCCESS; @@ -1489,7 +1490,7 @@ void CFE_TIME_1HzAdjImpl(const CFE_TIME_OneHzAdjustmentCmd_Payload_t *CommandPtr /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_Add1HZAdjustmentCmd(const CFE_TIME_Add1HZAdjustment_t *data) +int32 CFE_TIME_Add1HZAdjustmentCmd(const CFE_TIME_Add1HZAdjustmentCmd_t *data) { CFE_TIME_1HzAdjImpl(&data->Payload, CFE_TIME_AdjustDirection_ADD); return CFE_SUCCESS; @@ -1503,7 +1504,7 @@ int32 CFE_TIME_Add1HZAdjustmentCmd(const CFE_TIME_Add1HZAdjustment_t *data) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 CFE_TIME_Sub1HZAdjustmentCmd(const CFE_TIME_Sub1HZAdjustment_t *data) +int32 CFE_TIME_Sub1HZAdjustmentCmd(const CFE_TIME_Sub1HZAdjustmentCmd_t *data) { CFE_TIME_1HzAdjImpl(&data->Payload, CFE_TIME_AdjustDirection_SUBTRACT); return CFE_SUCCESS; diff --git a/fsw/cfe-core/src/time/cfe_time_tone.c b/fsw/cfe-core/src/time/cfe_time_tone.c index b5cfd312e..40b86f1b9 100644 --- a/fsw/cfe-core/src/time/cfe_time_tone.c +++ b/fsw/cfe-core/src/time/cfe_time_tone.c @@ -165,7 +165,7 @@ void CFE_TIME_ToneSend(void) /* ** Send "time at the tone" command data packet... */ - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.ToneDataCmd); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.ToneDataCmd.CmdHeader.Msg, false); /* ** Count of "time at the tone" commands sent with internal data... @@ -305,7 +305,7 @@ int32 CFE_TIME_ToneSendMET(CFE_TIME_SysTime_t NewMET) /* ** Send "time at the tone" command data packet... */ - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.ToneDataCmd); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.ToneDataCmd.CmdHeader.Msg, false); /* ** Count of "time at the tone" commands sent with external data... @@ -459,7 +459,7 @@ int32 CFE_TIME_ToneSendGPS(CFE_TIME_SysTime_t NewTime, int16 NewLeaps) /* ** Send "time at the tone" command data packet... */ - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.ToneDataCmd); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.ToneDataCmd.CmdHeader.Msg, false); /* ** Count of "time at the tone" commands sent with external data... @@ -612,7 +612,7 @@ int32 CFE_TIME_ToneSendTime(CFE_TIME_SysTime_t NewTime) /* ** Send "time at the tone" command data packet... */ - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.ToneDataCmd); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.ToneDataCmd.CmdHeader.Msg, false); /* ** Count of "time at the tone" commands sent with external data... @@ -1217,7 +1217,7 @@ void CFE_TIME_Tone1HzTask(void) /* ** Send tone signal command packet... */ - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.ToneSignalCmd); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.ToneSignalCmd.CmdHeader.Msg, false); #if (CFE_MISSION_TIME_CFG_FAKE_TONE == true) /* @@ -1225,7 +1225,7 @@ void CFE_TIME_Tone1HzTask(void) ** to send the tone to other time clients. ** (this is done by scheduler in non-fake mode) */ - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.ToneSendCmd); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.ToneSendCmd.CmdHeader.Msg, false); #endif /* @@ -1434,7 +1434,7 @@ void CFE_TIME_Local1HzTask(void) ** This used to be optional in previous CFE versions, but it is now required ** as TIME subscribes to this itself to do state machine tasks. */ - CFE_SB_SendMsg((CFE_MSG_Message_t *) &CFE_TIME_TaskData.Local1HzCmd); + CFE_SB_TransmitMsg(&CFE_TIME_TaskData.Local1HzCmd.CmdHeader.Msg, false); CFE_TIME_TaskData.LocalTaskCounter++; } diff --git a/fsw/cfe-core/src/time/cfe_time_utils.c b/fsw/cfe-core/src/time/cfe_time_utils.c index 0130d15f0..aeaeebeef 100644 --- a/fsw/cfe-core/src/time/cfe_time_utils.c +++ b/fsw/cfe-core/src/time/cfe_time_utils.c @@ -388,21 +388,21 @@ void CFE_TIME_InitData(void) /* ** Initialize housekeeping packet (clear user data area)... */ - CFE_MSG_Init(&CFE_TIME_TaskData.HkPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_TIME_TaskData.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_HK_TLM_MID), sizeof(CFE_TIME_TaskData.HkPacket)); /* ** Initialize diagnostic packet (clear user data area)... */ - CFE_MSG_Init(&CFE_TIME_TaskData.DiagPacket.TlmHeader.BaseMsg, + CFE_MSG_Init(&CFE_TIME_TaskData.DiagPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_DIAG_TLM_MID), sizeof(CFE_TIME_TaskData.DiagPacket)); /* ** Initialize "time at the tone" signal command packet... */ - CFE_MSG_Init(&CFE_TIME_TaskData.ToneSignalCmd.CmdHeader.BaseMsg, + CFE_MSG_Init(&CFE_TIME_TaskData.ToneSignalCmd.CmdHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_TONE_CMD_MID), sizeof(CFE_TIME_TaskData.ToneSignalCmd)); @@ -410,7 +410,7 @@ void CFE_TIME_InitData(void) ** Initialize "time at the tone" data command packet... */ #if (CFE_PLATFORM_TIME_CFG_SERVER == true) - CFE_MSG_Init((CFE_MSG_Message_t *)&CFE_TIME_TaskData.ToneDataCmd, + CFE_MSG_Init(&CFE_TIME_TaskData.ToneDataCmd.CmdHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_DATA_CMD_MID), sizeof(CFE_TIME_TaskData.ToneDataCmd)); #endif @@ -419,7 +419,7 @@ void CFE_TIME_InitData(void) ** Initialize simulated tone send message ("fake tone" mode only)... */ #if (CFE_MISSION_TIME_CFG_FAKE_TONE == true) - CFE_MSG_Init(&CFE_TIME_TaskData.ToneSendCmd.BaseMsg, + CFE_MSG_Init(&CFE_TIME_TaskData.ToneSendCmd.CmdHeader.Msg, CFE_SB_ValueToMsgId(CFE_TIME_SEND_CMD_MID), sizeof(CFE_TIME_TaskData.ToneSendCmd)); #endif @@ -427,9 +427,9 @@ void CFE_TIME_InitData(void) /* ** Initialize local 1Hz "wake-up" command packet (optional)... */ - CFE_MSG_Init((CFE_MSG_Message_t *)&CFE_TIME_TaskData.Local1HzCmd, - CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), - sizeof(CFE_TIME_TaskData.Local1HzCmd)); + CFE_MSG_Init(&CFE_TIME_TaskData.Local1HzCmd.CmdHeader.Msg, + CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), + sizeof(CFE_TIME_TaskData.Local1HzCmd)); return; diff --git a/fsw/cfe-core/src/time/cfe_time_utils.h b/fsw/cfe-core/src/time/cfe_time_utils.h index 34eac94c4..e5ee2267c 100644 --- a/fsw/cfe-core/src/time/cfe_time_utils.h +++ b/fsw/cfe-core/src/time/cfe_time_utils.h @@ -183,7 +183,6 @@ typedef struct /* ** Task operational data (not reported in housekeeping)... */ - CFE_MSG_Message_t *MsgPtr; CFE_SB_PipeId_t CmdPipe; /* @@ -277,7 +276,7 @@ typedef struct /* ** Local 1Hz wake-up command packet (not related to time at tone)... */ - CFE_SB_CmdHdr_t Local1HzCmd; + CFE_TIME_1HzCmd_t Local1HzCmd; /* ** Time at the tone command packets (sent by time servers)... @@ -294,7 +293,7 @@ typedef struct * "tone signal" message above. */ #if (CFE_MISSION_TIME_CFG_FAKE_TONE == true) - CFE_SB_CmdHdr_t ToneSendCmd; + CFE_TIME_FakeToneCmd_t ToneSendCmd; #endif /* @@ -349,7 +348,7 @@ CFE_TIME_SysTime_t CFE_TIME_LatchClock(void); ** Function prototypes (Time Services utilities data)... */ int32 CFE_TIME_TaskInit (void); -void CFE_TIME_TaskPipe(CFE_MSG_Message_t *MsgPtr); +void CFE_TIME_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); void CFE_TIME_InitData(void); void CFE_TIME_QueryResetVars(void); void CFE_TIME_UpdateResetVars(const CFE_TIME_Reference_t *Reference);