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 #174, Remove registration of empty event filters #175

Merged
merged 1 commit into from
Jun 22, 2022
Merged
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
20 changes: 1 addition & 19 deletions fsw/src/sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,28 +128,10 @@ int32 SAMPLE_APP_Init(void)
strncpy(SAMPLE_APP_Data.PipeName, "SAMPLE_APP_CMD_PIPE", sizeof(SAMPLE_APP_Data.PipeName));
SAMPLE_APP_Data.PipeName[sizeof(SAMPLE_APP_Data.PipeName) - 1] = 0;

/*
** Initialize event filter table...
*/
SAMPLE_APP_Data.EventFilters[0].EventID = SAMPLE_APP_STARTUP_INF_EID;
SAMPLE_APP_Data.EventFilters[0].Mask = 0x0000;
SAMPLE_APP_Data.EventFilters[1].EventID = SAMPLE_APP_COMMAND_ERR_EID;
SAMPLE_APP_Data.EventFilters[1].Mask = 0x0000;
SAMPLE_APP_Data.EventFilters[2].EventID = SAMPLE_APP_COMMANDNOP_INF_EID;
SAMPLE_APP_Data.EventFilters[2].Mask = 0x0000;
SAMPLE_APP_Data.EventFilters[3].EventID = SAMPLE_APP_COMMANDRST_INF_EID;
SAMPLE_APP_Data.EventFilters[3].Mask = 0x0000;
SAMPLE_APP_Data.EventFilters[4].EventID = SAMPLE_APP_INVALID_MSGID_ERR_EID;
SAMPLE_APP_Data.EventFilters[4].Mask = 0x0000;
SAMPLE_APP_Data.EventFilters[5].EventID = SAMPLE_APP_LEN_ERR_EID;
SAMPLE_APP_Data.EventFilters[5].Mask = 0x0000;
SAMPLE_APP_Data.EventFilters[6].EventID = SAMPLE_APP_PIPE_ERR_EID;
SAMPLE_APP_Data.EventFilters[6].Mask = 0x0000;

/*
** Register the events
*/
status = CFE_EVS_Register(SAMPLE_APP_Data.EventFilters, SAMPLE_APP_EVENT_COUNTS, CFE_EVS_EventFilter_BINARY);
status = CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error Registering Events, RC = 0x%08lX\n", (unsigned long)status);
Expand Down
3 changes: 1 addition & 2 deletions fsw/src/sample_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ typedef struct
char PipeName[CFE_MISSION_MAX_API_LEN];
uint16 PipeDepth;

CFE_EVS_BinFilter_t EventFilters[SAMPLE_APP_EVENT_COUNTS];
CFE_TBL_Handle_t TblHandles[SAMPLE_APP_NUMBER_OF_TABLES];
CFE_TBL_Handle_t TblHandles[SAMPLE_APP_NUMBER_OF_TABLES];

Check notice

Code scanning / CodeQL

Use of basic integral type

TblHandles uses the basic integral type signed short rather than a typedef with size and signedness.

} SAMPLE_APP_Data_t;

Expand Down
2 changes: 0 additions & 2 deletions fsw/src/sample_app_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@
#define SAMPLE_APP_LEN_ERR_EID 6
#define SAMPLE_APP_PIPE_ERR_EID 7

#define SAMPLE_APP_EVENT_COUNTS 7

#endif /* SAMPLE_APP_EVENTS_H */