/* ** Test reset filter calls */ void Test_FilterReset (void) { CFE_EVS_BinFilter_t filter; filter.EventID = 1; filter.Mask = 0x0001; CFE_EVS_Register(&filter, 1, CFE_EVS_BINARY_FILTER); /* TEST: invalid ID for filter reset */ UT_Report(CFE_EVS_ResetFilter(CFE_EVS_MAX_EVENT_FILTERS + 1) == CFE_SUCCESS, "CFE_EVS_ResetFilter", "invalid event ID"); /* TEST: unregistered ID for filter reset */ UT_Report(CFE_EVS_ResetFilter(-1) == CFE_SUCCESS, "CFE_EVS_ResetFilter", "unregistered event ID"); /* TEST: valid ID for filter reset */ UT_Report(CFE_EVS_ResetFilter(1) == CFE_SUCCESS, "CFE_EVS_ResetFilter", "valid reset filter"); /* TEST: valid reset of all filters */ UT_Report(CFE_EVS_ResetAllFilters() == CFE_SUCCESS, "CFE_EVS_ResetAllFilters", "valid reset all filters"); /* Return application to original state, re-register application */ CFE_EVS_Register(NULL, 0, CFE_EVS_BINARY_FILTER); }
/* ** Test functions using an unregistered application */ void Test_UnregisteredApp (void) { /* Unregister the application (it gets registered in CFE_EVS_TaskInit) */ CFE_EVS_Unregister(); /* TEST: application not registered */ UT_Report(CFE_EVS_Unregister() == CFE_EVS_APP_NOT_REGISTERED, "CFE_EVS_Unregister","app not registered"); UT_Report(CFE_EVS_SendEvent(0, 0, "NULL") == CFE_EVS_APP_NOT_REGISTERED, "CFE_EVS_SendEvent", "app not registered"); UT_Report(CFE_EVS_ResetFilter(0) == CFE_EVS_APP_NOT_REGISTERED, "CFE_EVS_ResetFilter", "app not registered"); UT_Report(CFE_EVS_ResetAllFilters() == CFE_EVS_APP_NOT_REGISTERED, "CFE_EVS_ResetAllFilters", "app not registered"); /* Return application to original state, register application */ CFE_EVS_Register(NULL, 0, CFE_EVS_BINARY_FILTER); }
/* ** Test functions using an illegal application ID */ void Test_IllegalAppID (void) { CFE_TIME_SysTime_t time; /* Set test up with illegal application ID */ UT_SetAppID(CFE_ES_MAX_APPLICATIONS + 1); /* Call external functions to test behavior with illegal ID */ UT_Report(CFE_EVS_Register(NULL, 0, 0) == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_Register", "illegal app id"); UT_Report(CFE_EVS_Unregister() == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_Unregister", "illegal app id"); UT_Report(CFE_EVS_SendEvent(0, 0, "NULL") == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_SendEvent", "illegal app id"); UT_Report(CFE_EVS_SendTimedEvent(time, 0, 0,"NULL" ) == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_SendTimedEvent", "illegal app id"); UT_Report(CFE_EVS_SendEventWithAppID(0, 0, CFE_ES_MAX_APPLICATIONS + 1, "NULL") == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_SendEventWithAppID", "illegal app id"); UT_Report(CFE_EVS_ResetFilter(0) == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_ResetFilter", "illegal app id"); UT_Report(CFE_EVS_ResetAllFilters() == CFE_EVS_APP_ILLEGAL_APP_ID, "CFE_EVS_ResetAllFilters", "illegal app id"); /* Return application ID to valid value */ UT_SetAppID(0); }
int32 SCH_HousekeepingCmd(CFE_SB_MsgPtr_t MessagePtr) { int32 TableResult = SCH_SUCCESS; if(SCH_VerifyCmdLength(MessagePtr, sizeof(SCH_NoArgsCmd_t)) == SCH_SUCCESS) { /* ** Update contents of Housekeeping Packet */ SCH_AppData.HkPacket.CmdCounter = SCH_AppData.CmdCounter; SCH_AppData.HkPacket.ErrCounter = SCH_AppData.ErrCounter; SCH_AppData.HkPacket.ScheduleActivitySuccessCount = SCH_AppData.ScheduleActivitySuccessCount; SCH_AppData.HkPacket.ScheduleActivityFailureCount = SCH_AppData.ScheduleActivityFailureCount; SCH_AppData.HkPacket.SlotsProcessedCount = SCH_AppData.SlotsProcessedCount; SCH_AppData.HkPacket.SkippedSlotsCount = SCH_AppData.SkippedSlotsCount; SCH_AppData.HkPacket.MultipleSlotsCount = SCH_AppData.MultipleSlotsCount; SCH_AppData.HkPacket.SameSlotCount = SCH_AppData.SameSlotCount; SCH_AppData.HkPacket.BadTableDataCount = SCH_AppData.BadTableDataCount; SCH_AppData.HkPacket.TableVerifySuccessCount = SCH_AppData.TableVerifySuccessCount; SCH_AppData.HkPacket.TableVerifyFailureCount = SCH_AppData.TableVerifyFailureCount; SCH_AppData.HkPacket.TablePassCount = SCH_AppData.TablePassCount; SCH_AppData.HkPacket.ValidMajorFrameCount = SCH_AppData.ValidMajorFrameCount; SCH_AppData.HkPacket.MissedMajorFrameCount = SCH_AppData.MissedMajorFrameCount; SCH_AppData.HkPacket.UnexpectedMajorFrameCount = SCH_AppData.UnexpectedMajorFrameCount; SCH_AppData.HkPacket.MinorFramesSinceTone = SCH_AppData.MinorFramesSinceTone; SCH_AppData.HkPacket.NextSlotNumber = SCH_AppData.NextSlotNumber; SCH_AppData.HkPacket.LastSyncMETSlot = SCH_AppData.LastSyncMETSlot; SCH_AppData.HkPacket.IgnoreMajorFrame = SCH_AppData.IgnoreMajorFrame; SCH_AppData.HkPacket.UnexpectedMajorFrame = SCH_AppData.UnexpectedMajorFrame; SCH_AppData.HkPacket.SyncToMET = SCH_AppData.SyncToMET; SCH_AppData.HkPacket.MajorFrameSource = SCH_AppData.MajorFrameSource; /* ** Timestamps and send housekeeping packet */ CFE_SB_TimeStampMsg((CFE_SB_Msg_t *) &SCH_AppData.HkPacket); CFE_SB_SendMsg((CFE_SB_Msg_t *) &SCH_AppData.HkPacket); /* ** Reset "high rate" event filters */ CFE_EVS_ResetAllFilters(); } /* ** Note: ** ** The following table functions will give the cFE Table Manager ** a chance to update the tables used by this application. If ** there is an error (very unlikely) the return value will cause ** us to fall out of the main process loop and terminate the SCH ** task. It may sound extreme but there is nothing for the ** Scheduler to do if it cannot access both the message ** and schedule tables. */ CFE_TBL_ReleaseAddress(SCH_AppData.ScheduleTableHandle); CFE_TBL_ReleaseAddress(SCH_AppData.MessageTableHandle); TableResult = SCH_AcquirePointers(); return(TableResult); } /* End of SCH_HousekeepingCmd() */