Skip to content

Commit

Permalink
Fix #1398, Consistent use of CFE_EVS_EventType_Enum_t for EventType
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Oct 26, 2023
1 parent 0316672 commit 4d60bc3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion modules/cfe_assert/src/cfe_assert_runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool CFE_Assert_Status_DeferredCheck(CFE_Status_t Status, UtAssert_CaseType_t Ca

void CFE_Assert_StatusReport(uint8 MessageType, const char *Prefix, const char *OutputMessage)
{
uint16 EventType;
CFE_EVS_EventType_Enum_t EventType;

switch (MessageType)
{
Expand Down
11 changes: 6 additions & 5 deletions modules/core_api/fsw/inc/cfe_evs.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ CFE_Status_t CFE_EVS_Register(const void *Filters, uint16 NumEventFilters, uint1
** \sa #CFE_EVS_SendEventWithAppID, #CFE_EVS_SendTimedEvent
**
**/
CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spec, ...) OS_PRINTF(3, 4);
CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, CFE_EVS_EventType_Enum_t EventType, const char *Spec, ...)
OS_PRINTF(3, 4);

/**
** \brief Generate a software event given the specified Application ID.
Expand Down Expand Up @@ -201,8 +202,8 @@ CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spe
** \sa #CFE_EVS_SendEvent, #CFE_EVS_SendTimedEvent
**
**/
CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, uint16 EventType, CFE_ES_AppId_t AppID, const char *Spec, ...)
OS_PRINTF(4, 5);
CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, CFE_EVS_EventType_Enum_t EventType, CFE_ES_AppId_t AppID,
const char *Spec, ...) OS_PRINTF(4, 5);

/**
** \brief Generate a software event with a specific time tag.
Expand Down Expand Up @@ -251,8 +252,8 @@ CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, uint16 EventType, CFE_ES
** \sa #CFE_EVS_SendEvent, #CFE_EVS_SendEventWithAppID
**
**/
CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, uint16 EventType, const char *Spec, ...)
OS_PRINTF(4, 5);
CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, CFE_EVS_EventType_Enum_t EventType,
const char *Spec, ...) OS_PRINTF(4, 5);
/**@}*/

/** @defgroup CFEAPIEVSResetFilter cFE Reset Event Filter APIs
Expand Down
14 changes: 8 additions & 6 deletions modules/core_api/ut-stubs/src/cfe_evs_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ CFE_Status_t CFE_EVS_ResetFilter(uint16 EventID)
* Generated stub function for CFE_EVS_SendEvent()
* ----------------------------------------------------
*/
CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spec, ...)
CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, CFE_EVS_EventType_Enum_t EventType, const char *Spec, ...)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
{
va_list UtStub_ArgList;

UT_GenStub_SetupReturnBuffer(CFE_EVS_SendEvent, CFE_Status_t);

UT_GenStub_AddParam(CFE_EVS_SendEvent, uint16, EventID);
UT_GenStub_AddParam(CFE_EVS_SendEvent, uint16, EventType);
UT_GenStub_AddParam(CFE_EVS_SendEvent, CFE_EVS_EventType_Enum_t, EventType);
UT_GenStub_AddParam(CFE_EVS_SendEvent, const char *, Spec);

va_start(UtStub_ArgList, Spec);
Expand All @@ -106,14 +106,15 @@ CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spe
* Generated stub function for CFE_EVS_SendEventWithAppID()
* ----------------------------------------------------
*/
CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, uint16 EventType, CFE_ES_AppId_t AppID, const char *Spec, ...)
CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, CFE_EVS_EventType_Enum_t EventType, CFE_ES_AppId_t AppID,

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
const char *Spec, ...)
{
va_list UtStub_ArgList;

UT_GenStub_SetupReturnBuffer(CFE_EVS_SendEventWithAppID, CFE_Status_t);

UT_GenStub_AddParam(CFE_EVS_SendEventWithAppID, uint16, EventID);
UT_GenStub_AddParam(CFE_EVS_SendEventWithAppID, uint16, EventType);
UT_GenStub_AddParam(CFE_EVS_SendEventWithAppID, CFE_EVS_EventType_Enum_t, EventType);
UT_GenStub_AddParam(CFE_EVS_SendEventWithAppID, CFE_ES_AppId_t, AppID);
UT_GenStub_AddParam(CFE_EVS_SendEventWithAppID, const char *, Spec);

Expand All @@ -129,15 +130,16 @@ CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, uint16 EventType, CFE_ES
* Generated stub function for CFE_EVS_SendTimedEvent()
* ----------------------------------------------------
*/
CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, uint16 EventType, const char *Spec, ...)
CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, CFE_EVS_EventType_Enum_t EventType,

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
const char *Spec, ...)
{
va_list UtStub_ArgList;

UT_GenStub_SetupReturnBuffer(CFE_EVS_SendTimedEvent, CFE_Status_t);

UT_GenStub_AddParam(CFE_EVS_SendTimedEvent, CFE_TIME_SysTime_t, Time);
UT_GenStub_AddParam(CFE_EVS_SendTimedEvent, uint16, EventID);
UT_GenStub_AddParam(CFE_EVS_SendTimedEvent, uint16, EventType);
UT_GenStub_AddParam(CFE_EVS_SendTimedEvent, CFE_EVS_EventType_Enum_t, EventType);
UT_GenStub_AddParam(CFE_EVS_SendTimedEvent, const char *, Spec);

va_start(UtStub_ArgList, Spec);
Expand Down
8 changes: 5 additions & 3 deletions modules/evs/fsw/src/cfe_evs.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ CFE_Status_t CFE_EVS_Register(const void *Filters, uint16 NumEventFilters, uint1
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spec, ...)
CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, CFE_EVS_EventType_Enum_t EventType, const char *Spec, ...)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
{
int32 Status;
CFE_ES_AppId_t AppID;
Expand Down Expand Up @@ -166,7 +166,8 @@ CFE_Status_t CFE_EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spe
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, uint16 EventType, CFE_ES_AppId_t AppID, const char *Spec, ...)
CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, CFE_EVS_EventType_Enum_t EventType, CFE_ES_AppId_t AppID,

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
const char *Spec, ...)
{
int32 Status = CFE_SUCCESS;
CFE_TIME_SysTime_t Time;
Expand Down Expand Up @@ -215,7 +216,8 @@ CFE_Status_t CFE_EVS_SendEventWithAppID(uint16 EventID, uint16 EventType, CFE_ES
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, uint16 EventType, const char *Spec, ...)
CFE_Status_t CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time, uint16 EventID, CFE_EVS_EventType_Enum_t EventType,

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
const char *Spec, ...)
{
int32 Status;
CFE_ES_AppId_t AppID;
Expand Down
6 changes: 3 additions & 3 deletions modules/evs/fsw/src/cfe_evs_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ int32 EVS_NotRegistered(EVS_AppData_t *AppDataPtr, CFE_ES_AppId_t CallerID)
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
bool EVS_IsFiltered(EVS_AppData_t *AppDataPtr, uint16 EventID, uint16 EventType)
bool EVS_IsFiltered(EVS_AppData_t *AppDataPtr, uint16 EventID, CFE_EVS_EventType_Enum_t EventType)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.

Check notice

Code scanning / CodeQL-coding-standard

Function too long Note

EVS_IsFiltered has too many lines (91, while 60 are allowed).
{
EVS_BinFilter_t *FilterPtr;
bool Filtered = false;
Expand Down Expand Up @@ -449,7 +449,7 @@ void EVS_DisableTypes(EVS_AppData_t *AppDataPtr, uint8 BitMask)
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint16 EventType,
void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, CFE_EVS_EventType_Enum_t EventType,

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.

Check notice

Code scanning / CodeQL-coding-standard

Function too long Note

EVS_GenerateEventTelemetry has too many lines (78, while 60 are allowed).
const CFE_TIME_SysTime_t *TimeStamp, const char *MsgSpec, va_list ArgPtr)
{
CFE_EVS_LongEventTlm_t LongEventTlm; /* The "long" flavor is always generated, as this is what is logged */
Expand Down Expand Up @@ -591,7 +591,7 @@ void EVS_OutputPort(uint8 PortNum, char *Message)
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
int32 EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spec, ...)
int32 EVS_SendEvent(uint16 EventID, CFE_EVS_EventType_Enum_t EventType, const char *Spec, ...)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
{
CFE_TIME_SysTime_t Time;
va_list Ptr;
Expand Down
6 changes: 3 additions & 3 deletions modules/evs/fsw/src/cfe_evs_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ int32 EVS_NotRegistered(EVS_AppData_t *AppDataPtr, CFE_ES_AppId_t CallerID);
* is filtered for the given application identifier. Otherwise a value of
* false is returned.
*/
bool EVS_IsFiltered(EVS_AppData_t *AppDataPtr, uint16 EventID, uint16 EventType);
bool EVS_IsFiltered(EVS_AppData_t *AppDataPtr, uint16 EventID, CFE_EVS_EventType_Enum_t EventType);

/*---------------------------------------------------------------------------------------*/
/**
Expand Down Expand Up @@ -238,7 +238,7 @@ void EVS_DisableTypes(EVS_AppData_t *AppDataPtr, uint8 BitMask);
* If configured for short events, a separate short message is generated using a subset
* of the information from the long message.
*/
void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint16 EventType,
void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, CFE_EVS_EventType_Enum_t EventType,
const CFE_TIME_SysTime_t *Time, const char *MsgSpec, va_list ArgPtr);

/*---------------------------------------------------------------------------------------*/
Expand All @@ -250,6 +250,6 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1
* This routine also does not need to acquire the mutex semaphore,
* which can be time consuming on some platforms.
*/
int32 EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spec, ...);
int32 EVS_SendEvent(uint16 EventID, CFE_EVS_EventType_Enum_t EventType, const char *Spec, ...);

#endif /* CFE_EVS_UTILS_H */

0 comments on commit 4d60bc3

Please sign in to comment.