Skip to content

Commit 012ec36

Browse files
committed
Fix #60, Apply consistent Event ID names to common events
1 parent 6418164 commit 012ec36

8 files changed

+18
-18
lines changed

fsw/inc/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/inc/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_HkTlm_Payload_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_HkTlm_Payload_t.CmdAcceptedCounter will reset to zero
73-
* - The #DS_RESET_CMD_EID debug event message will be sent
73+
* - The #DS_RESET_INF_EID debug event message will be sent
7474
*
7575
* \par Error Conditions
7676
* This command can fail for the following reasons:

fsw/src/ds_app.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ int32 DS_AppInitialize(void)
261261
*/
262262
if (Result == CFE_SUCCESS)
263263
{
264-
CFE_EVS_SendEvent(DS_INIT_EID, CFE_EVS_EventType_INFORMATION,
264+
CFE_EVS_SendEvent(DS_INIT_INF_EID, CFE_EVS_EventType_INFORMATION,
265265
"Application initialized, version %d.%d.%d.%d, data at %p", DS_MAJOR_VERSION,
266266
DS_MINOR_VERSION, DS_REVISION, DS_MISSION_REV, (void *)&DS_AppData);
267267
}

fsw/src/ds_cmds.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void DS_NoopCmd(const CFE_SB_Buffer_t *BufPtr)
6161
*/
6262
DS_AppData.CmdAcceptedCounter++;
6363

64-
CFE_EVS_SendEvent(DS_NOOP_CMD_EID, CFE_EVS_EventType_INFORMATION, "NOOP command, Version %d.%d.%d.%d",
64+
CFE_EVS_SendEvent(DS_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "NOOP command, Version %d.%d.%d.%d",
6565
DS_MAJOR_VERSION, DS_MINOR_VERSION, DS_REVISION, DS_MISSION_REV);
6666
}
6767

@@ -103,7 +103,7 @@ void DS_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr)
103103
DS_AppData.FilterTblLoadCounter = 0;
104104
DS_AppData.FilterTblErrCounter = 0;
105105

106-
CFE_EVS_SendEvent(DS_RESET_CMD_EID, CFE_EVS_EventType_DEBUG, "Reset counters command");
106+
CFE_EVS_SendEvent(DS_RESET_INF_EID, CFE_EVS_EventType_DEBUG, "Reset counters command");
107107
}
108108

109109
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

fsw/src/ds_dispatch.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void DS_RemoveMIDVerifyDispatch(const CFE_SB_Buffer_t *BufPtr)
360360

361361
void DS_SendHkVerifyDispatch(const CFE_SB_Buffer_t *BufPtr)
362362
{
363-
if (DS_VerifyLength(BufPtr, sizeof(DS_SendHkCmd_t), DS_HK_REQUEST_ERR_EID, "SEND HK"))
363+
if (DS_VerifyLength(BufPtr, sizeof(DS_SendHkCmd_t), DS_HKREQ_LEN_ERR_EID, "SEND HK"))
364364
{
365365
DS_AppSendHkCmd();
366366
}
@@ -562,8 +562,8 @@ void DS_AppProcessCmd(const CFE_SB_Buffer_t *BufPtr)
562562
** DS application command with unknown command code...
563563
*/
564564
default:
565-
CFE_EVS_SendEvent(DS_CMD_CODE_ERR_EID, CFE_EVS_EventType_ERROR,
566-
"Invalid command code: MID = 0x%08X, CC = %d", DS_CMD_MID, CommandCode);
565+
CFE_EVS_SendEvent(DS_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command code: MID = 0x%08X, CC = %d",
566+
DS_CMD_MID, CommandCode);
567567

568568
DS_AppData.CmdRejectedCounter++;
569569
break;

unit-test/ds_app_tests.c

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

161161
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
162-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_INIT_EID);
162+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_INIT_INF_EID);
163163
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);
164164
}
165165

unit-test/ds_cmds_tests.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void DS_NoopCmd_Test_Nominal(void)
6161
UtAssert_UINT32_EQ(DS_AppData.CmdAcceptedCounter, 1);
6262

6363
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
64-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_NOOP_CMD_EID);
64+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_NOOP_INF_EID);
6565
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION);
6666

6767
/* Verify command struct size minus header is at least explicitly padded to 32-bit boundaries */
@@ -90,7 +90,7 @@ void DS_ResetCountersCmd_Test_Nominal(void)
9090
UtAssert_ZERO(DS_AppData.FilterTblErrCounter);
9191

9292
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
93-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_RESET_CMD_EID);
93+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_RESET_INF_EID);
9494
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG);
9595

9696
/* Verify command struct size minus header is at least explicitly padded to 32-bit boundaries */

unit-test/ds_dispatch_tests.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void DS_AppProcessMsg_Test_HKInvalidRequest(void)
138138

139139
/* Verify results */
140140
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
141-
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_HK_REQUEST_ERR_EID);
141+
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_HKREQ_LEN_ERR_EID);
142142
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR);
143143
}
144144

0 commit comments

Comments
 (0)