Skip to content

Commit 08a2e0c

Browse files
authoredNov 30, 2023
Merge pull request #337 from thnkslprpt/fix-336-apply-consistent-event-id-names
Fix #336, Apply consistent Event ID names to common events
2 parents df516ad + 46c6a66 commit 08a2e0c

File tree

7 files changed

+49
-49
lines changed

7 files changed

+49
-49
lines changed
 

‎fsw/inc/cf_events.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
*
4545
* Successful completion of application initialization
4646
*/
47-
#define CF_EID_INF_INIT (20)
47+
#define CF_INIT_INF_EID (20)
4848

4949
/**
5050
* \brief CF Check Table Release Address Failed Event ID
@@ -166,7 +166,7 @@
166166
*
167167
* Failure from create pipe call during engine channel initialization
168168
*/
169-
#define CF_EID_ERR_INIT_PIPE (31)
169+
#define CF_CR_PIPE_ERR_EID (31)
170170

171171
/**
172172
* \brief CF Channel Message Subscription Failed Event ID
@@ -910,7 +910,7 @@
910910
*
911911
* Receipt of NOOP command
912912
*/
913-
#define CF_EID_INF_CMD_NOOP (110)
913+
#define CF_NOOP_INF_EID (110)
914914

915915
/**
916916
* \brief CF Reset Counters Command Received Event ID
@@ -921,7 +921,7 @@
921921
*
922922
* Receipt and successful processing of reset counters command
923923
*/
924-
#define CF_EID_INF_CMD_RESET (111)
924+
#define CF_RESET_INF_EID (111)
925925

926926
/**
927927
* \brief CF Set Parameter Command Received Event ID
@@ -1361,7 +1361,7 @@
13611361
*
13621362
* Received command length verification failure
13631363
*/
1364-
#define CF_EID_ERR_CMD_GCMD_LEN (151)
1364+
#define CF_CMD_LEN_ERR_EID (151)
13651365

13661366
/**
13671367
* \brief CF Command Code Invalid Event ID
@@ -1372,7 +1372,7 @@
13721372
*
13731373
* Received command code unrecognized
13741374
*/
1375-
#define CF_EID_ERR_CMD_GCMD_CC (152)
1375+
#define CF_CC_ERR_EID (152)
13761376

13771377
/**
13781378
* \brief CF Write Entry To File Failed Event ID

‎fsw/inc/cf_msg.h

+22-22
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ typedef enum
180180
* Successful execution of this command may be verified with
181181
* the following telemetry:
182182
* - #CF_HkPacket_t.counters #CF_HkCmdCounters_t.cmd will increment
183-
* - #CF_EID_INF_CMD_NOOP
183+
* - #CF_NOOP_INF_EID
184184
*
185185
* \par Error Conditions
186186
* This command may fail for the following reason(s):
187-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
187+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
188188
*
189189
* \par Evidence of failure may be found in the following telemetry:
190190
* - #CF_HkPacket_t.counters #CF_HkCmdCounters_t.err will increment
@@ -212,11 +212,11 @@ typedef enum
212212
* Successful execution of this command may be verified with
213213
* the following telemetry:
214214
* - #CF_HkPacket_t.counters #CF_HkCmdCounters_t.cmd will increment
215-
* - #CF_EID_INF_CMD_RESET
215+
* - #CF_RESET_INF_EID
216216
*
217217
* \par Error Conditions
218218
* This command may fail for the following reason(s):
219-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
219+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
220220
* - Invalid counter type, #CF_EID_ERR_CMD_RESET_INVALID
221221
*
222222
* \par Evidence of failure may be found in the following telemetry:
@@ -244,7 +244,7 @@ typedef enum
244244
*
245245
* \par Error Conditions
246246
* This command may fail for the following reason(s):
247-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
247+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
248248
* - Invalid parameter, #CF_EID_ERR_CMD_BAD_PARAM
249249
* - Transaction initialization failure, #CF_EID_ERR_CMD_TX_FILE
250250
*
@@ -276,7 +276,7 @@ typedef enum
276276
*
277277
* \par Error Conditions
278278
* This command may fail for the following reason(s):
279-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
279+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
280280
* - Invalid parameter, #CF_EID_ERR_CMD_BAD_PARAM
281281
* - Playback initialization failure, #CF_EID_ERR_CMD_PLAYBACK_DIR
282282
*
@@ -311,7 +311,7 @@ typedef enum
311311
*
312312
* \par Error Conditions
313313
* This command may fail for the following reason(s):
314-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
314+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
315315
* - Invalid channel number, #CF_EID_ERR_CMD_CHAN_PARAM
316316
* - Command processing failure, #CF_EID_ERR_CMD_FREEZE
317317
*
@@ -345,7 +345,7 @@ typedef enum
345345
*
346346
* \par Error Conditions
347347
* This command may fail for the following reason(s):
348-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
348+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
349349
* - Invalid channel number, #CF_EID_ERR_CMD_CHAN_PARAM
350350
* - Command processing failure, #CF_EID_ERR_CMD_THAW
351351
*
@@ -379,7 +379,7 @@ typedef enum
379379
*
380380
* \par Error Conditions
381381
* This command may fail for the following reason(s):
382-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
382+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
383383
* - Transaction not found using compound key, #CF_EID_ERR_CMD_TRANS_NOT_FOUND
384384
* - Invalid channel number, #CF_EID_ERR_CMD_TSN_CHAN_INVALID
385385
* - Already in requested state, #CF_EID_ERR_CMD_SUSPRES_SAME
@@ -415,7 +415,7 @@ typedef enum
415415
*
416416
* \par Error Conditions
417417
* This command may fail for the following reason(s):
418-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
418+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
419419
* - Transaction not found using compound key, #CF_EID_ERR_CMD_TRANS_NOT_FOUND
420420
* - Invalid channel number, #CF_EID_ERR_CMD_TSN_CHAN_INVALID
421421
* - Already in requested state, #CF_EID_ERR_CMD_SUSPRES_SAME
@@ -450,7 +450,7 @@ typedef enum
450450
*
451451
* \par Error Conditions
452452
* This command may fail for the following reason(s):
453-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
453+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
454454
* - Transaction not found using compound key, #CF_EID_ERR_CMD_TRANS_NOT_FOUND
455455
* - Invalid channel number, #CF_EID_ERR_CMD_TSN_CHAN_INVALID
456456
* - No matching transaction, #CF_EID_ERR_CMD_CANCEL_CHAN
@@ -484,7 +484,7 @@ typedef enum
484484
*
485485
* \par Error Conditions
486486
* This command may fail for the following reason(s):
487-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
487+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
488488
* - Transaction not found using compound key, #CF_EID_ERR_CMD_TRANS_NOT_FOUND
489489
* - Invalid channel number, #CF_EID_ERR_CMD_TSN_CHAN_INVALID
490490
* - No matching transaction, #CF_EID_ERR_CMD_ABANDON_CHAN
@@ -516,7 +516,7 @@ typedef enum
516516
*
517517
* \par Error Conditions
518518
* This command may fail for the following reason(s):
519-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
519+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
520520
* - Invalid configuration parameter key, #CF_EID_ERR_CMD_GETSET_PARAM
521521
* - Invalid channel number, #CF_EID_ERR_CMD_GETSET_CHAN
522522
* - Parameter value failed validation, #CF_EID_ERR_CMD_GETSET_VALIDATE
@@ -548,7 +548,7 @@ typedef enum
548548
*
549549
* \par Error Conditions
550550
* This command may fail for the following reason(s):
551-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
551+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
552552
* - Invalid configuration parameter key, #CF_EID_ERR_CMD_GETSET_PARAM
553553
* - Invalid channel number, #CF_EID_ERR_CMD_GETSET_CHAN
554554
*
@@ -579,7 +579,7 @@ typedef enum
579579
*
580580
* \par Error Conditions
581581
* This command may fail for the following reason(s):
582-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
582+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
583583
* - Invalid parameter combination, #CF_EID_ERR_CMD_WQ_ARGS
584584
* - Invalid channel number, #CF_EID_ERR_CMD_WQ_CHAN
585585
* - Open file to write failed, #CF_EID_ERR_CMD_WQ_OPEN
@@ -617,7 +617,7 @@ typedef enum
617617
*
618618
* \par Error Conditions
619619
* This command may fail for the following reason(s):
620-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
620+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
621621
* - Invalid channel number, #CF_EID_ERR_CMD_CHAN_PARAM
622622
* - Enable dequeue failed, #CF_EID_ERR_CMD_ENABLE_DEQUEUE
623623
*
@@ -650,7 +650,7 @@ typedef enum
650650
*
651651
* \par Error Conditions
652652
* This command may fail for the following reason(s):
653-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
653+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
654654
* - Invalid channel number, #CF_EID_ERR_CMD_CHAN_PARAM
655655
* - Disable dequeue failed, #CF_EID_INF_CMD_DISABLE_DEQUEUE
656656
*
@@ -689,7 +689,7 @@ typedef enum
689689
*
690690
* \par Error Conditions
691691
* This command may fail for the following reason(s):
692-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
692+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
693693
* - Invalid channel number, #CF_EID_ERR_CMD_CHAN_PARAM
694694
* - Invalid polling directory index, #CF_EID_ERR_CMD_POLLDIR_INVALID
695695
* - Enable directory polling failed, #CF_EID_ERR_CMD_ENABLE_POLLDIR
@@ -729,7 +729,7 @@ typedef enum
729729
*
730730
* \par Error Conditions
731731
* This command may fail for the following reason(s):
732-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
732+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
733733
* - Invalid channel number, #CF_EID_ERR_CMD_CHAN_PARAM
734734
* - Invalid polling directory index, #CF_EID_ERR_CMD_POLLDIR_INVALID
735735
* - Disable directory polling failed, #CF_EID_ERR_CMD_DISABLE_POLLDIR
@@ -770,7 +770,7 @@ typedef enum
770770
*
771771
* \par Error Conditions
772772
* This command may fail for the following reason(s):
773-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
773+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
774774
* - Invalid channel number, #CF_EID_ERR_CMD_CHAN_PARAM
775775
* - Invalid purge queue argument, #CF_EID_ERR_CMD_PURGE_ARG
776776
* - Purge queue failed, #CF_EID_ERR_CMD_PURGE_QUEUE
@@ -803,7 +803,7 @@ typedef enum
803803
*
804804
* \par Error Conditions
805805
* This command may fail for the following reason(s):
806-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
806+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
807807
* - Engine initialization failed, #CF_EID_ERR_CMD_ENABLE_ENGINE
808808
* - Engine already enabled, #CF_EID_ERR_CMD_ENG_ALREADY_ENA
809809
*
@@ -836,7 +836,7 @@ typedef enum
836836
*
837837
* \par Error Conditions
838838
* This command may fail for the following reason(s):
839-
* - Command packet length not as expected, #CF_EID_ERR_CMD_GCMD_LEN
839+
* - Command packet length not as expected, #CF_CMD_LEN_ERR_EID
840840
* - Engine already disabled, #CF_EID_ERR_CMD_ENG_ALREADY_DIS
841841
*
842842
* \par Evidence of failure may be found in the following telemetry:

‎fsw/src/cf_app.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ CFE_Status_t CF_Init(void)
249249
if (status == CFE_SUCCESS)
250250
{
251251
status =
252-
CFE_EVS_SendEvent(CF_EID_INF_INIT, CFE_EVS_EventType_INFORMATION, "CF Initialized. Version %d.%d.%d.%d",
252+
CFE_EVS_SendEvent(CF_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "CF Initialized. Version %d.%d.%d.%d",
253253
CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION, CF_MISSION_REV);
254254
if (status != CFE_SUCCESS)
255255
{

‎fsw/src/cf_cfdp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ CFE_Status_t CF_CFDP_InitEngine(void)
969969
nbuf);
970970
if (ret != CFE_SUCCESS)
971971
{
972-
CFE_EVS_SendEvent(CF_EID_ERR_INIT_PIPE, CFE_EVS_EventType_ERROR,
972+
CFE_EVS_SendEvent(CF_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR,
973973
"CF: failed to create pipe %s, returned 0x%08lx", nbuf, (unsigned long)ret);
974974
break;
975975
}

‎fsw/src/cf_cmd.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*-----------------------------------------------------------------*/
4747
void CF_CmdNoop(CFE_SB_Buffer_t *msg)
4848
{
49-
CFE_EVS_SendEvent(CF_EID_INF_CMD_NOOP, CFE_EVS_EventType_INFORMATION, "CF: No-Op received, Version %d.%d.%d.%d",
49+
CFE_EVS_SendEvent(CF_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "CF: No-Op received, Version %d.%d.%d.%d",
5050
CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION, CF_MISSION_REV);
5151
++CF_AppData.hk.counters.cmd;
5252
}
@@ -74,8 +74,8 @@ void CF_CmdReset(CFE_SB_Buffer_t *msg)
7474
}
7575
else
7676
{
77-
CFE_EVS_SendEvent(CF_EID_INF_CMD_RESET, CFE_EVS_EventType_INFORMATION,
78-
"CF: Received RESET COUNTERS command: %s", names[param]);
77+
CFE_EVS_SendEvent(CF_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "CF: Received RESET COUNTERS command: %s",
78+
names[param]);
7979

8080
/* if the param is CF_Reset_command, or all counters */
8181
if ((param == CF_Reset_all) || (param == CF_Reset_command))
@@ -1240,16 +1240,16 @@ void CF_ProcessGroundCommand(CFE_SB_Buffer_t *msg)
12401240
}
12411241
else
12421242
{
1243-
CFE_EVS_SendEvent(CF_EID_ERR_CMD_GCMD_LEN, CFE_EVS_EventType_ERROR,
1243+
CFE_EVS_SendEvent(CF_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
12441244
"CF: invalid ground command length for command 0x%02x, expected %d got %zd", cmd,
12451245
expected_lengths[cmd], len);
12461246
++CF_AppData.hk.counters.err;
12471247
}
12481248
}
12491249
else
12501250
{
1251-
CFE_EVS_SendEvent(CF_EID_ERR_CMD_GCMD_CC, CFE_EVS_EventType_ERROR,
1252-
"CF: invalid ground command packet cmd_code=0x%02x", cmd);
1251+
CFE_EVS_SendEvent(CF_CC_ERR_EID, CFE_EVS_EventType_ERROR, "CF: invalid ground command packet cmd_code=0x%02x",
1252+
cmd);
12531253
++CF_AppData.hk.counters.err;
12541254
}
12551255
}

‎unit-test/cf_app_tests.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ void Test_CF_AppMain_CFE_SB_ReceiveBuffer_Cases(void)
630630

631631
/* Event from CF_Init and CF_AppMain */
632632
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
633-
UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_EID_INF_INIT);
633+
UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_INIT_INF_EID);
634634
UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[1], CF_EID_ERR_INIT_MSG_RECV);
635635

636636
/* Reset, return CFE_SUCCESS from CFE_SB_ReceiveBuffer and buffer NULL */
@@ -642,7 +642,7 @@ void Test_CF_AppMain_CFE_SB_ReceiveBuffer_Cases(void)
642642

643643
/* Event from CF_Init and CF_AppMain */
644644
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
645-
UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_EID_INF_INIT);
645+
UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_INIT_INF_EID);
646646
UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[1], CF_EID_ERR_INIT_MSG_RECV);
647647

648648
/* Reset, return non-error codes and non-NULL buffer */
@@ -659,7 +659,7 @@ void Test_CF_AppMain_CFE_SB_ReceiveBuffer_Cases(void)
659659

660660
/* Event from CF_Init */
661661
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
662-
UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_EID_INF_INIT);
662+
UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_INIT_INF_EID);
663663
UtAssert_STUB_COUNT(CFE_ES_RunLoop, 3);
664664
}
665665

0 commit comments

Comments
 (0)