Skip to content

Commit 0a9099f

Browse files
authored
Merge pull request #60 from thnkslprpt/fix-59-apply-consistent-event-id-names
Fix #59, Apply consistent Event ID names to common events
2 parents 1f8e29a + d0a06de commit 0a9099f

7 files changed

Lines changed: 19 additions & 19 deletions

File tree

fsw/inc/fm_events.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* This event message is issued after the File Manager application has
4040
* successfully completed startup initialization.
4141
*/
42-
#define FM_STARTUP_EID 1
42+
#define FM_INIT_INF_EID 1
4343

4444
/**
4545
* \brief FM Initialization Register For Event Services Failed Event ID
@@ -71,7 +71,7 @@
7171
* This is a fatal error that will cause the File Manager application
7272
* to terminate.
7373
*/
74-
#define FM_STARTUP_CREAT_PIPE_ERR_EID 3
74+
#define FM_CR_PIPE_ERR_EID 3
7575

7676
/**
7777
* \brief FM Initialization Subscribe to HK Request Failed Event ID
@@ -188,7 +188,7 @@
188188
* This event message is generated upon receipt of a housekeeping
189189
* request command packet with an invalid length.
190190
*/
191-
#define FM_HK_REQ_ERR_EID 11
191+
#define FM_HKREQ_LEN_ERR_EID 11
192192

193193
/**
194194
* \brief FM No-op Command Event ID
@@ -200,7 +200,7 @@
200200
* This event message signals the successful completion of a
201201
* /FM_Noop command.
202202
*/
203-
#define FM_NOOP_CMD_EID 12
203+
#define FM_NOOP_INF_EID 12
204204

205205
/**
206206
* \brief FM No-op Command Length Invalid Event ID
@@ -227,7 +227,7 @@
227227
* This event message signals the successful completion of a
228228
* /FM_ResetCtrs command.
229229
*/
230-
#define FM_RESET_CMD_EID 14
230+
#define FM_RESET_INF_EID 14
231231

232232
/**
233233
* \brief FM Reset Counters Command Length Invalid Event ID

fsw/inc/fm_msgdefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* #FM_NoopCmd_t
4545
*
4646
* \par Command Success Verification
47-
* - Informational event #FM_NOOP_CMD_EID will be sent
47+
* - Informational event #FM_NOOP_INF_EID will be sent
4848
* - #FM_HousekeepingPkt_Payload_t.CommandCounter will increment
4949
*
5050
* \par Command Error Conditions
@@ -75,7 +75,7 @@
7575
*
7676
* \par Command Success Verification
7777
* - Command counters will be set to zero (see description)
78-
* - Debug event #FM_RESET_CMD_EID will be sent
78+
* - Debug event #FM_RESET_INF_EID will be sent
7979
*
8080
* \par Command Error Conditions
8181
* - Invalid command packet length

fsw/src/fm_app.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ CFE_Status_t FM_AppInit(void)
186186
Result = CFE_SB_CreatePipe(&FM_GlobalData.CmdPipe, FM_APP_PIPE_DEPTH, FM_APP_PIPE_NAME);
187187
if (Result != CFE_SUCCESS)
188188
{
189-
CFE_EVS_SendEvent(FM_STARTUP_CREAT_PIPE_ERR_EID, CFE_EVS_EventType_ERROR,
190-
"%s create SB input pipe: result = 0x%08X", ErrText, (unsigned int)Result);
189+
CFE_EVS_SendEvent(FM_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, "%s create SB input pipe: result = 0x%08X",
190+
ErrText, (unsigned int)Result);
191191
}
192192
else
193193
{
@@ -229,7 +229,7 @@ CFE_Status_t FM_AppInit(void)
229229
FM_ChildInit();
230230

231231
/* Application startup event message */
232-
CFE_EVS_SendEvent(FM_STARTUP_EID, CFE_EVS_EventType_INFORMATION,
232+
CFE_EVS_SendEvent(FM_INIT_INF_EID, CFE_EVS_EventType_INFORMATION,
233233
"Initialization complete: version %d.%d.%d.%d", FM_MAJOR_VERSION, FM_MINOR_VERSION,
234234
FM_REVISION, FM_MISSION_REV);
235235
}

fsw/src/fm_cmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ bool FM_NoopCmd(const CFE_SB_Buffer_t *BufPtr)
5757
{
5858
const char *CmdText = "No-op";
5959

60-
CFE_EVS_SendEvent(FM_NOOP_CMD_EID, CFE_EVS_EventType_INFORMATION, "%s command: FM version %d.%d.%d.%d", CmdText,
60+
CFE_EVS_SendEvent(FM_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "%s command: FM version %d.%d.%d.%d", CmdText,
6161
FM_MAJOR_VERSION, FM_MINOR_VERSION, FM_REVISION, FM_MISSION_REV);
6262

6363
return true;
@@ -81,7 +81,7 @@ bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr)
8181
FM_GlobalData.ChildCmdWarnCounter = 0;
8282

8383
/* Send command completion event (debug) */
84-
CFE_EVS_SendEvent(FM_RESET_CMD_EID, CFE_EVS_EventType_DEBUG, "%s command", CmdText);
84+
CFE_EVS_SendEvent(FM_RESET_INF_EID, CFE_EVS_EventType_DEBUG, "%s command", CmdText);
8585

8686
return true;
8787
}

fsw/src/fm_dispatch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ bool FM_SetPermissionsVerifyDispatch(const CFE_SB_Buffer_t *BufPtr)
390390
void FM_SendHkVerifyDispatch(const CFE_SB_Buffer_t *BufPtr)
391391
{
392392
/* Verify command packet length */
393-
if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_SendHkCmd_t), FM_HK_REQ_ERR_EID, "HK Request"))
393+
if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_SendHkCmd_t), FM_HKREQ_LEN_ERR_EID, "HK Request"))
394394
{
395395
return;
396396
}

unit-test/fm_app_tests.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void Test_FM_AppMain_SBReceiveBufferDefaultOption(void)
9494
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 3);
9595
UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1);
9696
UtAssert_STUB_COUNT(CFE_SB_ReceiveBuffer, 1);
97-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_STARTUP_EID);
97+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_INIT_INF_EID);
9898
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);
9999
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, FM_SB_RECEIVE_ERR_EID);
100100
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventType, CFE_EVS_EventType_ERROR);
@@ -168,7 +168,7 @@ void Test_FM_AppMain_BufPtrNotEqualNull(void)
168168
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
169169
UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1);
170170
UtAssert_STUB_COUNT(CFE_SB_ReceiveBuffer, 1);
171-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_STARTUP_EID);
171+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_INIT_INF_EID);
172172
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);
173173
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, FM_EXIT_ERR_EID);
174174
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventType, CFE_EVS_EventType_ERROR);
@@ -202,7 +202,7 @@ void Test_FM_AppInit_CreatePipeFail(void)
202202
UtAssert_STUB_COUNT(CFE_EVS_Register, 1);
203203
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
204204
UtAssert_STUB_COUNT(CFE_SB_CreatePipe, 1);
205-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_STARTUP_CREAT_PIPE_ERR_EID);
205+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_CR_PIPE_ERR_EID);
206206
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR);
207207
}
208208

@@ -282,7 +282,7 @@ void Test_FM_AppInit_TableInitSuccess(void)
282282
UtAssert_STUB_COUNT(CFE_SB_CreatePipe, 1);
283283
UtAssert_STUB_COUNT(CFE_SB_Subscribe, 2);
284284
UtAssert_STUB_COUNT(FM_ChildInit, 1);
285-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_STARTUP_EID);
285+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_INIT_INF_EID);
286286
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);
287287
}
288288

unit-test/fm_cmds_tests.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void Test_FM_NoopCmd_Success(void)
7474

7575
UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1);
7676

77-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_NOOP_CMD_EID);
77+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_NOOP_INF_EID);
7878

7979
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);
8080

@@ -114,7 +114,7 @@ void Test_FM_ResetCountersCmd_Success(void)
114114

115115
UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1);
116116

117-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_RESET_CMD_EID);
117+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_RESET_INF_EID);
118118

119119
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG);
120120

0 commit comments

Comments
 (0)