Skip to content

Commit

Permalink
Fix nasa#897, fix incorrect use of EventCount
Browse files Browse the repository at this point in the history
Do not use EventCount to track whether an "unregistered" event
was generated, because that by definition came from a different app
than the one that "owns" that field.

This just adds a separate field to track that state, so it doesn't
potentially modify the counter for an unrelated app.
  • Loading branch information
jphickey committed Sep 29, 2020
1 parent 8a7dc8f commit 02b3a54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fsw/cfe-core/src/evs/cfe_evs_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ typedef struct
typedef struct
{
CFE_ES_ResourceID_t AppID;
CFE_ES_ResourceID_t UnregAppID;

EVS_BinFilter_t BinFilters[CFE_PLATFORM_EVS_MAX_EVENT_FILTERS]; /* Array of binary filters */

uint8 ActiveFlag; /* Application event service active flag */
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/evs/cfe_evs_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ int32 EVS_NotRegistered (EVS_AppData_t *AppDataPtr, CFE_ES_ResourceID_t CallerID
char AppName[OS_MAX_API_NAME];

/* Send only one "not registered" event per application */
if (AppDataPtr->EventCount == 0)
if ( !CFE_ES_ResourceID_Equal(AppDataPtr->UnregAppID, CallerID) )
{
/* Increment count of "not registered" applications */
CFE_EVS_GlobalData.EVS_TlmPkt.Payload.UnregisteredAppCounter++;

/* Indicate that "not registered" event has been sent for this app */
AppDataPtr->EventCount++;
AppDataPtr->UnregAppID = CallerID;

/* Get the name of the "not registered" app */
CFE_ES_GetAppName(AppName, CallerID, OS_MAX_API_NAME);
Expand Down

0 comments on commit 02b3a54

Please sign in to comment.