Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1398, Consistent use of CFE_EVS_EventType_Enum_t for EventType #2308

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
* 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

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 @@
* 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

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 @@
* 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

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
4 changes: 2 additions & 2 deletions modules/evs/config/default_cfe_evs_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ typedef struct CFE_EVS_HousekeepingTlm_Payload
typedef struct CFE_EVS_PacketID
{
char AppName[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \EVS_APPNAME
\brief Application name */
\brief Application name */
uint16 EventID; /**< \cfetlmmnemonic \EVS_EVENTID
\brief Numerical event identifier */
uint16 EventType; /**< \cfetlmmnemonic \EVS_EVENTTYPE
CFE_EVS_EventType_Enum_t EventType; /**< \cfetlmmnemonic \EVS_EVENTTYPE
\brief Numerical event type identifier */
uint32 SpacecraftID; /**< \cfetlmmnemonic \EVS_SCID
\brief Spacecraft identifier */
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 @@
* 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

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 @@
* 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

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 All @@ -188,7 +189,7 @@
/* Handler for events from apps not registered with EVS */
Status = EVS_NotRegistered(AppDataPtr, AppID);
}
else if (EVS_IsFiltered(AppDataPtr, EventID, EventType) == false)

Check warning

Code scanning / CodeQL

Uses of recursion Warning

The function CFE_EVS_SendEventWithAppID is indirectly recursive via this call to
EVS_IsFiltered
.
{
if (EVS_CheckAndIncrementSquelchTokens(AppDataPtr) == true)
{
Expand All @@ -197,7 +198,7 @@

/* Send the event packets */
va_start(Ptr, Spec);
EVS_GenerateEventTelemetry(AppDataPtr, EventID, EventType, &Time, Spec, Ptr);

Check warning

Code scanning / CodeQL

Uses of recursion Warning

The function CFE_EVS_SendEventWithAppID is indirectly recursive via this call to
EVS_GenerateEventTelemetry
.
va_end(Ptr);
}
else
Expand All @@ -215,7 +216,8 @@
* 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

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 @@ -167,7 +167,7 @@
CFE_ES_GetAppName(AppName, CallerID, sizeof(AppName));

/* Send the "not registered" event */
EVS_SendEvent(CFE_EVS_ERR_UNREGISTERED_EVS_APP, CFE_EVS_EventType_ERROR,

Check warning

Code scanning / CodeQL

Uses of recursion Warning

The function EVS_NotRegistered is indirectly recursive via this call to
EVS_SendEvent
.
"App %s not registered with Event Services. Unable to send event.", AppName);

/* Write the "not registered" info to the system log */
Expand All @@ -184,7 +184,7 @@
* 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

Long function without assertion Note

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

Check notice

Code scanning / CodeQL

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 @@ -265,7 +265,7 @@
{
CFE_ES_GetAppName(AppName, EVS_AppDataGetID(AppDataPtr), sizeof(AppName));

EVS_SendEvent(CFE_EVS_FILTER_MAX_EID, CFE_EVS_EventType_INFORMATION,

Check warning

Code scanning / CodeQL

Uses of recursion Warning

The function EVS_IsFiltered is indirectly recursive via this call to
EVS_SendEvent
.
"Max filter count reached, AppName = %s, EventID = 0x%08x: Filter locked until reset",
AppName, (unsigned int)EventID);
}
Expand Down Expand Up @@ -387,7 +387,7 @@
if (SendSquelchEvent)
{
CFE_ES_GetAppName(AppName, EVS_AppDataGetID(AppDataPtr), sizeof(AppName));
EVS_SendEvent(CFE_EVS_SQUELCHED_ERR_EID, CFE_EVS_EventType_ERROR, "Events squelched, AppName = %s",

Check warning

Code scanning / CodeQL

Uses of recursion Warning

The function EVS_CheckAndIncrementSquelchTokens is indirectly recursive via this call to
EVS_SendEvent
.
AppName);
}
}
Expand Down Expand Up @@ -449,7 +449,7 @@
* 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

Long function without assertion Note

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

Check notice

Code scanning / CodeQL

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 @@
* 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

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 All @@ -607,14 +607,14 @@
/* Note that we do not squelch events coming from EVS to prevent event recursion,
* and EVS is assumed to be "well-behaved" */
if (EVS_AppDataIsMatch(AppDataPtr, CFE_EVS_Global.EVS_AppID) &&
EVS_IsFiltered(AppDataPtr, EventID, EventType) == false)

Check warning

Code scanning / CodeQL

Uses of recursion Warning

The function EVS_SendEvent is indirectly recursive via this call to
EVS_IsFiltered
.
{
/* Get current spacecraft time */
Time = CFE_TIME_GetTime();

/* Send the event packets */
va_start(Ptr, Spec);
EVS_GenerateEventTelemetry(AppDataPtr, EventID, EventType, &Time, Spec, Ptr);

Check warning

Code scanning / CodeQL

Uses of recursion Warning

The function EVS_SendEvent is indirectly recursive via this call to
EVS_GenerateEventTelemetry
.
va_end(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 */
Loading