Skip to content

Commit 87bbcd3

Browse files
committed
Fix nasa#60, Apply consistent Event ID names to common events
1 parent 3493142 commit 87bbcd3

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

fsw/src/ds_app.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ int32 DS_AppInitialize(void)
267267
*/
268268
if (Result == CFE_SUCCESS)
269269
{
270-
CFE_EVS_SendEvent(DS_INIT_EID, CFE_EVS_EventType_INFORMATION,
270+
CFE_EVS_SendEvent(DS_INIT_INF_EID, CFE_EVS_EventType_INFORMATION,
271271
"Application initialized, version %d.%d.%d.%d, data at %p", DS_MAJOR_VERSION,
272272
DS_MINOR_VERSION, DS_REVISION, DS_MISSION_REV, (void *)&DS_AppData);
273273
}
@@ -311,7 +311,7 @@ void DS_AppProcessMsg(const CFE_SB_Buffer_t *BufPtr)
311311
ExpectedLength = sizeof(DS_NoopCmd_t);
312312
if (ExpectedLength != ActualLength)
313313
{
314-
CFE_EVS_SendEvent(DS_HK_REQUEST_ERR_EID, CFE_EVS_EventType_ERROR,
314+
CFE_EVS_SendEvent(DS_HKREQ_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
315315
"Invalid HK request length: expected = %d, actual = %d", (int)ExpectedLength,
316316
(int)ActualLength);
317317
}
@@ -478,8 +478,8 @@ void DS_AppProcessCmd(const CFE_SB_Buffer_t *BufPtr)
478478
** DS application command with unknown command code...
479479
*/
480480
default:
481-
CFE_EVS_SendEvent(DS_CMD_CODE_ERR_EID, CFE_EVS_EventType_ERROR,
482-
"Invalid command code: MID = 0x%08X, CC = %d", DS_CMD_MID, CommandCode);
481+
CFE_EVS_SendEvent(DS_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command code: MID = 0x%08X, CC = %d",
482+
DS_CMD_MID, CommandCode);
483483

484484
DS_AppData.CmdRejectedCounter++;
485485
break;

fsw/src/ds_cmds.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void DS_CmdNoop(const CFE_SB_Buffer_t *BufPtr)
7171
*/
7272
DS_AppData.CmdAcceptedCounter++;
7373

74-
CFE_EVS_SendEvent(DS_NOOP_CMD_EID, CFE_EVS_EventType_INFORMATION, "NOOP command, Version %d.%d.%d.%d",
74+
CFE_EVS_SendEvent(DS_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "NOOP command, Version %d.%d.%d.%d",
7575
DS_MAJOR_VERSION, DS_MINOR_VERSION, DS_REVISION, DS_MISSION_REV);
7676
}
7777
}
@@ -132,7 +132,7 @@ void DS_CmdReset(const CFE_SB_Buffer_t *BufPtr)
132132
DS_AppData.FilterTblLoadCounter = 0;
133133
DS_AppData.FilterTblErrCounter = 0;
134134

135-
CFE_EVS_SendEvent(DS_RESET_CMD_EID, CFE_EVS_EventType_DEBUG, "Reset counters command");
135+
CFE_EVS_SendEvent(DS_RESET_INF_EID, CFE_EVS_EventType_DEBUG, "Reset counters command");
136136
}
137137
}
138138

fsw/src/ds_events.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* This event message is issued if the Data Storage (DS) application successfully
4040
* completes its initialization.
4141
*/
42-
#define DS_INIT_EID 1
42+
#define DS_INIT_INF_EID 1
4343

4444
/**
4545
* \brief DS Initialization Failed Event ID
@@ -242,7 +242,7 @@
242242
* these errors so the cause is more likely to result from sending "raw"
243243
* ground commands or on-board stored commands.
244244
*/
245-
#define DS_CMD_CODE_ERR_EID 21
245+
#define DS_CC_ERR_EID 21
246246

247247
/**
248248
* \brief DS Housekeeping Request Invalid Length Event ID
@@ -254,7 +254,7 @@
254254
* This event signals the failed execution of a HK request command.
255255
* The cause of the failure is an invalid command packet length.
256256
*/
257-
#define DS_HK_REQUEST_ERR_EID 22
257+
#define DS_HKREQ_LEN_ERR_EID 22
258258

259259
/**
260260
* \brief DS No-op Command Event ID
@@ -267,7 +267,7 @@
267267
* command. The command is used primarily as an indicator that the DS
268268
* application can receive commands and generate telemetry.
269269
*/
270-
#define DS_NOOP_CMD_EID 31
270+
#define DS_NOOP_INF_EID 31
271271

272272
/**
273273
* \brief DS No-op Command Invalid Length Event ID
@@ -284,15 +284,15 @@
284284
/**
285285
* \brief DS Reset Counters Command Event ID
286286
*
287-
* \par Type: DEBUG
287+
* \par Type: INFORMATION
288288
*
289289
* \par Cause:
290290
*
291291
* This event signals the successful execution of a RESET housekeeping
292292
* counters command. The command is used primarily to clear counters
293293
* that have already been examined.
294294
*/
295-
#define DS_RESET_CMD_EID 33
295+
#define DS_RESET_INF_EID 33
296296

297297
/**
298298
* \brief DS Reset Counters Command Invalid Length Event ID

fsw/src/ds_msgdefs.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* \par Command Verification
4444
* Evidence of success may be found in the following telemetry:
4545
* - #DS_HkPacket_t.CmdAcceptedCounter will increment
46-
* - The #DS_NOOP_CMD_EID informational event message will be sent
46+
* - The #DS_NOOP_INF_EID informational event message will be sent
4747
*
4848
* \par Error Conditions
4949
* This command can fail for the following reasons:
@@ -70,7 +70,7 @@
7070
* \par Command Verification
7171
* Evidence of success may be found in the following telemetry:
7272
* - #DS_HkPacket_t.CmdAcceptedCounter will reset to zero
73-
* - The #DS_RESET_CMD_EID debug event message will be sent
73+
* - The #DS_RESET_INF_EID informational event message will be sent
7474
*
7575
* \par Error Conditions
7676
* This command can fail for the following reasons:

unit-test/ds_app_tests.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void DS_AppInitialize_Test_Nominal(void)
160160
* are modified by subfunctions, which we're not testing here */
161161

162162
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
163-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_INIT_EID);
163+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_INIT_INF_EID);
164164
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);
165165
}
166166

@@ -399,7 +399,7 @@ void DS_AppProcessMsg_Test_HKInvalidRequest(void)
399399

400400
/* Verify results */
401401
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
402-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_HK_REQUEST_ERR_EID);
402+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_HKREQ_LEN_ERR_EID);
403403
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR);
404404
}
405405

unit-test/ds_cmds_tests.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void DS_CmdNoop_Test_Nominal(void)
7777
call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent));
7878
UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1);
7979

80-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_NOOP_CMD_EID);
80+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_NOOP_INF_EID);
8181

8282
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);
8383

@@ -158,7 +158,7 @@ void DS_CmdReset_Test_Nominal(void)
158158
call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent));
159159
UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1);
160160

161-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_RESET_CMD_EID);
161+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_RESET_INF_EID);
162162

163163
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG);
164164

0 commit comments

Comments
 (0)