int32 Ut_CFE_EVS_SendEventHook(uint16 EventID, uint16 EventType, const char *EventText)
{
    Ut_CFE_EVS_Event_t  EventMessage;

    if (strlen(EventText) >= CFE_EVS_MAX_MESSAGE_LENGTH) {
        UtPrintf("WARNING - Event Message Too Long: %s\n", EventText);
    }

    EventMessage.EventID = EventID;
    EventMessage.EventType = EventType;
    strncpy(&EventMessage.EventText[0], EventText, CFE_EVS_MAX_MESSAGE_LENGTH);
    UtList_Add(&EventQueue, &EventMessage, sizeof(EventMessage), 0);

    if (EventType == CFE_EVS_DEBUG)
        UtPrintf("DEBUG EVENT ID=%d %s\n", EventID, EventText);
    else if (EventType == CFE_EVS_INFORMATION)
        UtPrintf("INFO EVENT ID=%d %s\n", EventID, EventText);
    else if (EventType == CFE_EVS_ERROR)
        UtPrintf("ERROR EVENT ID=%d %s\n", EventID, EventText);
    else if (EventType == CFE_EVS_CRITICAL)
        UtPrintf("CRITICAL EVENT ID=%d %s\n", EventID, EventText);
    else
    {
        UtPrintf("Invalid Event Type %d ID=%d %s\n", EventType, EventID, EventText);
        UtAssert_True(FALSE, "Invalid Event Type");
    }

    return CFE_SUCCESS;
}
Exemplo n.º 2
0
int32 Ut_CFE_SB_SendMsgHook(CFE_SB_Msg_t *MsgPtr)
{
    UtList_Add(&MsgQueue, MsgPtr, CFE_SB_GetTotalMsgLength(MsgPtr), 0);

    UtPrintf("PKT: ");
    UtPrintx(MsgPtr, (uint16)(CFE_SB_GetTotalMsgLength(MsgPtr)));
    return CFE_SUCCESS;
}
Exemplo n.º 3
0
void Ut_CFE_SB_AddMsgToPipe(void *MsgPtr, CFE_SB_PipeId_t PipeId)
{
    if (PipeTable[PipeId].InUse == TRUE) {
        UtList_Add(&PipeTable[PipeId].MsgQueue, MsgPtr, CFE_SB_GetTotalMsgLength((CFE_SB_MsgPtr_t)MsgPtr), 0);
    }
    else {
        printf("Error - Invalid PipeId\n");
    }
}
Exemplo n.º 4
0
void UtTest_Add(void (*Test)(void), void (*Setup)(void), void (*Teardown)(void), char *TestName)
{
    UtTestDataBaseEntry_t   UtTestDataBaseEntry;

    UtTestDataBaseEntry.Test = Test;
    UtTestDataBaseEntry.Setup = Setup;
    UtTestDataBaseEntry.Teardown = Teardown;
    UtTestDataBaseEntry.TestName = TestName;
    UtList_Add(&UtTestDataBase, &UtTestDataBaseEntry, sizeof(UtTestDataBaseEntry_t), 0);
}