Skip to content

Commit 4ed1559

Browse files
committed
Fix #897, fix incorrect use of EventCount
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.
1 parent 2339ae3 commit 4ed1559

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fsw/cfe-core/src/evs/cfe_evs_task.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ typedef struct
8989
typedef struct
9090
{
9191
CFE_ES_ResourceID_t AppID;
92+
CFE_ES_ResourceID_t UnregAppID;
93+
9294
EVS_BinFilter_t BinFilters[CFE_PLATFORM_EVS_MAX_EVENT_FILTERS]; /* Array of binary filters */
9395

9496
uint8 ActiveFlag; /* Application event service active flag */

fsw/cfe-core/src/evs/cfe_evs_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ int32 EVS_NotRegistered (EVS_AppData_t *AppDataPtr, CFE_ES_ResourceID_t CallerID
185185
char AppName[OS_MAX_API_NAME];
186186

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

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

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

0 commit comments

Comments
 (0)