diff --git a/config/default_cf_fcncodes.h b/config/default_cf_fcncodes.h index 31a03ceb..155bee58 100644 --- a/config/default_cf_fcncodes.h +++ b/config/default_cf_fcncodes.h @@ -249,13 +249,13 @@ typedef enum * the following telemetry: * - #CF_HkPacket_Payload_t.counters #CF_HkCmdCounters_t.cmd will increment * - #CF_CMD_SUSPRES_INF_EID + * - #CF_CMD_SUSPRES_SAME_INF_EID * * \par Error Conditions * This command may fail for the following reason(s): * - Command packet length not as expected, #CF_CMD_LEN_ERR_EID * - Transaction not found using compound key, #CF_CMD_TRANS_NOT_FOUND_ERR_EID * - Invalid channel number, #CF_CMD_TSN_CHAN_INVALID_ERR_EID - * - Already in requested state, #CF_CMD_SUSPRES_SAME_ERR_EID * - No matching transaction, #CF_CMD_SUSPRES_CHAN_ERR_EID * * \par Evidence of failure may be found in the following telemetry: @@ -285,13 +285,13 @@ typedef enum * the following telemetry: * - #CF_HkPacket_Payload_t.counters #CF_HkCmdCounters_t.cmd will increment * - #CF_CMD_SUSPRES_INF_EID + * - #CF_CMD_SUSPRES_SAME_INF_EID * * \par Error Conditions * This command may fail for the following reason(s): * - Command packet length not as expected, #CF_CMD_LEN_ERR_EID * - Transaction not found using compound key, #CF_CMD_TRANS_NOT_FOUND_ERR_EID * - Invalid channel number, #CF_CMD_TSN_CHAN_INVALID_ERR_EID - * - Already in requested state, #CF_CMD_SUSPRES_SAME_ERR_EID * - No matching transaction, #CF_CMD_SUSPRES_CHAN_ERR_EID * * \par Evidence of failure may be found in the following telemetry: @@ -673,12 +673,12 @@ typedef enum * the following telemetry: * - #CF_HkPacket_Payload_t.counters #CF_HkCmdCounters_t.cmd will increment * - #CF_CMD_ENABLE_ENGINE_INF_EID + * - #CF_CMD_ENG_ALREADY_ENA_INF_EID * * \par Error Conditions * This command may fail for the following reason(s): * - Command packet length not as expected, #CF_CMD_LEN_ERR_EID * - Engine initialization failed, #CF_CMD_ENABLE_ENGINE_ERR_EID - * - Engine already enabled, #CF_CMD_ENG_ALREADY_ENA_ERR_EID * * \par Evidence of failure may be found in the following telemetry: * - #CF_HkPacket_Payload_t.counters #CF_HkCmdCounters_t.err will increment @@ -706,11 +706,11 @@ typedef enum * the following telemetry: * - #CF_HkPacket_Payload_t.counters #CF_HkCmdCounters_t.cmd will increment * - #CF_CMD_DISABLE_ENGINE_INF_EID + * - #CF_CMD_ENG_ALREADY_DIS_INF_EID * * \par Error Conditions * This command may fail for the following reason(s): * - Command packet length not as expected, #CF_CMD_LEN_ERR_EID - * - Engine already disabled, #CF_CMD_ENG_ALREADY_DIS_ERR_EID * * \par Evidence of failure may be found in the following telemetry: * - #CF_HkPacket_Payload_t.counters #CF_HkCmdCounters_t.err will increment diff --git a/fsw/inc/cf_events.h b/fsw/inc/cf_events.h index 7e1c551a..71e4931f 100644 --- a/fsw/inc/cf_events.h +++ b/fsw/inc/cf_events.h @@ -1157,13 +1157,13 @@ /** * \brief CF Suspend/Resume Command For Single Transaction State Unchanged Event ID * - * \par Type: ERROR + * \par Type: INFORMATION * * \par Cause: * * Suspend/resume command received affecting single transaction already set to that state */ -#define CF_CMD_SUSPRES_SAME_ERR_EID (133) +#define CF_CMD_SUSPRES_SAME_INF_EID (133) /** * \brief CF Suspend/Resume Command No Matching Transaction Event ID @@ -1333,24 +1333,24 @@ /** * \brief CF Enable Engine Command Engine Already Enabled Event ID * - * \par Type: ERROR + * \par Type: INFORMATION * * \par Cause: * * Enable engine command received while engine is already enabled */ -#define CF_CMD_ENG_ALREADY_ENA_ERR_EID (149) +#define CF_CMD_ENG_ALREADY_ENA_INF_EID (149) /** * \brief CF Disable Engine Command Engine Already Disabled Event ID * - * \par Type: ERROR + * \par Type: INFORMATION * * \par Cause: * * Disable engine command received while engine is already disabled */ -#define CF_CMD_ENG_ALREADY_DIS_ERR_EID (150) +#define CF_CMD_ENG_ALREADY_DIS_INF_EID (150) /** * \brief CF Command Length Verification Failed Event ID diff --git a/fsw/src/cf_cmd.c b/fsw/src/cf_cmd.c index 827cc57b..92117566 100644 --- a/fsw/src/cf_cmd.c +++ b/fsw/src/cf_cmd.c @@ -439,9 +439,9 @@ void CF_DoSuspRes(const CF_Transaction_Payload_t *payload, uint8 action) if (ret == 1 && args.same) { /* A single transaction was mached, and it was already set the same way */ - CFE_EVS_SendEvent(CF_CMD_SUSPRES_SAME_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(CF_CMD_SUSPRES_SAME_ERR_EID, CFE_EVS_EventType_INFORMATION, "CF: %s cmd: setting suspend flag to current value of %d", msgstr[action], action); - ++CF_AppData.hk.Payload.counters.err; + ++CF_AppData.hk.Payload.counters.cmd; } else if (ret <= 0) { @@ -1184,9 +1184,9 @@ CFE_Status_t CF_EnableEngineCmd(const CF_EnableEngineCmd_t *msg) } else { - CFE_EVS_SendEvent(CF_CMD_ENG_ALREADY_ENA_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(CF_CMD_ENG_ALREADY_ENA_INF_EID, CFE_EVS_EventType_INFORMATION, "CF: received enable engine command while engine already enabled"); - ++CF_AppData.hk.Payload.counters.err; + ++CF_AppData.hk.Payload.counters.cmd; } return CFE_SUCCESS; @@ -1204,15 +1204,15 @@ CFE_Status_t CF_DisableEngineCmd(const CF_DisableEngineCmd_t *msg) { CF_CFDP_DisableEngine(); CFE_EVS_SendEvent(CF_CMD_DISABLE_ENGINE_INF_EID, CFE_EVS_EventType_INFORMATION, "CF: disabled CFDP engine"); - ++CF_AppData.hk.Payload.counters.cmd; } else { - CFE_EVS_SendEvent(CF_CMD_ENG_ALREADY_DIS_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(CF_CMD_ENG_ALREADY_DIS_INF_EID, CFE_EVS_EventType_INFORMATION, "CF: received disable engine command while engine already disabled"); - ++CF_AppData.hk.Payload.counters.err; } + ++CF_AppData.hk.Payload.counters.cmd; + return CFE_SUCCESS; } diff --git a/unit-test/cf_cmd_tests.c b/unit-test/cf_cmd_tests.c index 35bff513..3d223ae5 100644 --- a/unit-test/cf_cmd_tests.c +++ b/unit-test/cf_cmd_tests.c @@ -1295,8 +1295,8 @@ void Test_CF_DoSuspRes(void) UT_SetHandlerFunction(UT_KEY(CF_TraverseAllTransactions), UT_AltHandler_CF_TraverseAllTransactions_SetSuspResArg, &utargs); UtAssert_VOIDCALL(CF_DoSuspRes(cmd, 0)); - UT_CF_AssertEventID(CF_CMD_SUSPRES_SAME_ERR_EID); - UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, 2); + UT_CF_AssertEventID(CF_CMD_SUSPRES_SAME_INF_EID); + UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, 2); /* Output the CF_ChanAction_SuspResArg_t back to the caller, to set the "same" flag to 1 */ /* however this time CF_TraverseAllTransactions reports it matched multiple transactions, so it should NOT reject it @@ -1306,7 +1306,7 @@ void Test_CF_DoSuspRes(void) UtAssert_VOIDCALL(CF_DoSuspRes(cmd, 1)); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); UT_CF_AssertEventID(CF_CMD_SUSPRES_INF_EID); - UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, 2); + UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, 3); } /******************************************************************************* @@ -3609,17 +3609,17 @@ void Test_CF_CmdEnableEngine_WithEngineNotEnableFailsInitSendEventAndIncrementEr UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementErrCounter(void) +void Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementCmdCounter(void) { /* Arrange */ CF_EnableEngineCmd_t utbuf; - uint16 initial_hk_err_counter = Any_uint16(); + uint16 initial_hk_cmd_counter = Any_uint16(); memset(&utbuf, 0, sizeof(utbuf)); CF_AppData.engine.enabled = 1; /* 1 is enabled */ - CF_AppData.hk.Payload.counters.err = initial_hk_err_counter; + CF_AppData.hk.Payload.counters.cmd = initial_hk_cmd_counter; /* Act */ CF_EnableEngineCmd(&utbuf); @@ -3629,9 +3629,9 @@ void Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementErrCounte /* Assert */ UtAssert_STUB_COUNT(CF_CFDP_InitEngine, 0); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); - UT_CF_AssertEventID(CF_CMD_ENG_ALREADY_ENA_ERR_EID); + UT_CF_AssertEventID(CF_CMD_ENG_ALREADY_ENA_INF_EID); /* Assert for incremented counter */ - UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); + UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } /******************************************************************************* @@ -3664,17 +3664,17 @@ void Test_CF_CmdDisableEngine_SuccessWhenEngineEnabledAndIncrementCmdCounter(voi UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementErrCounterThenFail(void) +void Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementCmdCounter(void) { /* Arrange */ CF_DisableEngineCmd_t utbuf; - uint16 initial_hk_err_counter = Any_uint16(); + uint16 initial_hk_counter = Any_uint16(); memset(&utbuf, 0, sizeof(utbuf)); CF_AppData.engine.enabled = 0; /* 0 is not enabled */ - CF_AppData.hk.Payload.counters.err = initial_hk_err_counter; + CF_AppData.hk.Payload.counters.cmd = initial_hk_counter; /* Act */ CF_DisableEngineCmd(&utbuf); @@ -3682,12 +3682,9 @@ void Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementErrCounterThenFail(v /* Assert */ UtAssert_STUB_COUNT(CF_CFDP_DisableEngine, 0); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); - UT_CF_AssertEventID(CF_CMD_ENG_ALREADY_DIS_ERR_EID); + UT_CF_AssertEventID(CF_CMD_ENG_ALREADY_DIS_INF_EID); /* Assert for incremented counter */ - UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); - UtAssert_True(CF_AppData.hk.Payload.counters.err == (uint16)(initial_hk_err_counter + 1), - "CF_AppData.hk.Payload.counters.err is %d and should be 1 more than %d", - CF_AppData.hk.Payload.counters.err, initial_hk_err_counter); + UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_counter + 1) & 0xFFFF); } /******************************************************************************* @@ -4103,16 +4100,16 @@ void add_CF_CmdEnableEngine_tests(void) UtTest_Add(Test_CF_CmdEnableEngine_WithEngineNotEnableFailsInitSendEventAndIncrementErrCounter, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_CmdEnableEngine_WithEngineNotEnableFailsInitSendEventAndIncrementErrCounter"); - UtTest_Add(Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementErrCounter, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementErrCounter"); + UtTest_Add(Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementCmdCounter, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementCmdCounter"); } void add_CF_CmdDisableEngine_tests(void) { UtTest_Add(Test_CF_CmdDisableEngine_SuccessWhenEngineEnabledAndIncrementCmdCounter, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_CmdDisableEngine_SuccessWhenEngineEnabledAndIncrementCmdCounter"); - UtTest_Add(Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementErrCounterThenFail, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementErrCounterThenFail"); + UtTest_Add(Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementCmdCounter, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementCmdCounter"); } void add_CF_SendHkCmd_tests(void)