From 4ed1559d69b57abc687a4bd51dc725f4548e5f87 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 22 Sep 2020 14:49:48 -0400 Subject: [PATCH] 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. --- fsw/cfe-core/src/evs/cfe_evs_task.h | 2 ++ fsw/cfe-core/src/evs/cfe_evs_utils.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fsw/cfe-core/src/evs/cfe_evs_task.h b/fsw/cfe-core/src/evs/cfe_evs_task.h index 95827b5fc..15a1ad321 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_task.h +++ b/fsw/cfe-core/src/evs/cfe_evs_task.h @@ -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 */ diff --git a/fsw/cfe-core/src/evs/cfe_evs_utils.c b/fsw/cfe-core/src/evs/cfe_evs_utils.c index d13cedfbb..906d808b0 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_utils.c +++ b/fsw/cfe-core/src/evs/cfe_evs_utils.c @@ -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);