From 9cfbd06b5f8eefa2d8c88b67b0788264dfb5bd83 Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Fri, 1 Dec 2023 20:03:13 +1000 Subject: [PATCH] test --- fsw/inc/sample_app_eventids.h | 22 +++++++++++++--------- fsw/src/sample_app.c | 13 ++++++++----- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/fsw/inc/sample_app_eventids.h b/fsw/inc/sample_app_eventids.h index 06406d8..7a7d178 100644 --- a/fsw/inc/sample_app_eventids.h +++ b/fsw/inc/sample_app_eventids.h @@ -25,14 +25,18 @@ #ifndef SAMPLE_APP_EVENTS_H #define SAMPLE_APP_EVENTS_H -#define SAMPLE_APP_RESERVED_EID 0 -#define SAMPLE_APP_INIT_INF_EID 1 -#define SAMPLE_APP_CC_ERR_EID 2 -#define SAMPLE_APP_NOOP_INF_EID 3 -#define SAMPLE_APP_RESET_INF_EID 4 -#define SAMPLE_APP_MID_ERR_EID 5 -#define SAMPLE_APP_CMD_LEN_ERR_EID 6 -#define SAMPLE_APP_PIPE_ERR_EID 7 -#define SAMPLE_APP_VALUE_INF_EID 8 +#define SAMPLE_APP_RESERVED_EID 0 +#define SAMPLE_APP_INIT_INF_EID 1 +#define SAMPLE_APP_CC_ERR_EID 2 +#define SAMPLE_APP_NOOP_INF_EID 3 +#define SAMPLE_APP_RESET_INF_EID 4 +#define SAMPLE_APP_MID_ERR_EID 5 +#define SAMPLE_APP_CMD_LEN_ERR_EID 6 +#define SAMPLE_APP_PIPE_ERR_EID 7 +#define SAMPLE_APP_VALUE_INF_EID 8 +#define SAMPLE_APP_CR_PIPE_ERR_EID 9 +#define SAMPLE_APP_SUB_HK_ERR_EID 10 +#define SAMPLE_APP_SUB_CMD_ERR_EID 11 +#define SAMPLE_APP_TABLE_REG_ERR_EID 12 #endif /* SAMPLE_APP_EVENTS_H */ diff --git a/fsw/src/sample_app.c b/fsw/src/sample_app.c index b3b7e8a..7fea673 100644 --- a/fsw/src/sample_app.c +++ b/fsw/src/sample_app.c @@ -146,7 +146,8 @@ int32 SAMPLE_APP_Init(void) status = CFE_SB_CreatePipe(&SAMPLE_APP_Data.CommandPipe, SAMPLE_APP_Data.PipeDepth, SAMPLE_APP_Data.PipeName); if (status != CFE_SUCCESS) { - CFE_ES_WriteToSysLog("Sample App: Error creating pipe, RC = 0x%08lX\n", (unsigned long)status); + CFE_EVS_SendEvent(SAMPLE_APP_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, + "Sample App: Error creating SB Command Pipe, RC = 0x%08lX\n", (unsigned long)status); } } @@ -158,7 +159,8 @@ int32 SAMPLE_APP_Init(void) status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(SAMPLE_APP_SEND_HK_MID), SAMPLE_APP_Data.CommandPipe); if (status != CFE_SUCCESS) { - CFE_ES_WriteToSysLog("Sample App: Error Subscribing to HK request, RC = 0x%08lX\n", (unsigned long)status); + CFE_EVS_SendEvent(SAMPLE_APP_SUBSCRIBE_HK_ERR_EID, CFE_EVS_EventType_ERROR, + "Sample App: Error Subscribing to HK request, RC = 0x%08lX\n", (unsigned long)status); } } @@ -170,9 +172,9 @@ int32 SAMPLE_APP_Init(void) status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(SAMPLE_APP_CMD_MID), SAMPLE_APP_Data.CommandPipe); if (status != CFE_SUCCESS) { - CFE_ES_WriteToSysLog("Sample App: Error Subscribing to Command, RC = 0x%08lX\n", (unsigned long)status); + CFE_EVS_SendEvent(SAMPLE_APP_SUBSCRIBE_CMD_ERR_EID, CFE_EVS_EventType_ERROR, + "Sample App: Error Subscribing to Commands, RC = 0x%08lX\n", (unsigned long)status); } - } if (status == CFE_SUCCESS) @@ -184,7 +186,8 @@ int32 SAMPLE_APP_Init(void) CFE_TBL_OPT_DEFAULT, SAMPLE_APP_TblValidationFunc); if (status != CFE_SUCCESS) { - CFE_ES_WriteToSysLog("Sample App: Error Registering Example Table, RC = 0x%08lX\n", (unsigned long)status); + CFE_EVS_SendEvent(SAMPLE_APP_TABLE_REG_ERR_EID, CFE_EVS_EventType_ERROR, + "Sample App: Error Registering Example Table, RC = 0x%08lX\n", (unsigned long)status); } else {