fsw/src/sample_app.c
void SAMPLE_AppMain( void )
{
    int32  status;

    /*
    ** Register the app with Executive services
    */
    CFE_ES_RegisterApp();

    /*
    ** Create the first Performance Log entry
    */
    CFE_ES_PerfLogEntry(SAMPLE_APP_PERF_ID);

    /*
    ** Perform application specific initialization
    ** If the Initialization fails, set the RunStatus to
    ** CFE_ES_APP_ERROR and the App will not enter the RunLoop
    */
    status = SAMPLE_AppInit();
    if (status != CFE_SUCCESS)
    {
        Sample_AppData.RunStatus = CFE_ES_APP_ERROR;
    }

    /*
    ** SAMPLE Runloop
    */
    while (CFE_ES_RunLoop(&Sample_AppData.RunStatus) == TRUE)
    {
        /*
        ** Performance Log Exit Stamp
        */
        CFE_ES_PerfLogExit(SAMPLE_APP_PERF_ID);

        /* Pend on receipt of command packet */
        status = CFE_SB_RcvMsg(&Sample_AppData.SAMPLEMsgPtr,
                               Sample_AppData.SAMPLE_CommandPipe,
                               CFE_SB_PEND_FOREVER);

        /*
        ** Performance Log Entry Stamp
        */
        CFE_ES_PerfLogEntry(SAMPLE_APP_PERF_ID);

        if (status == CFE_SUCCESS)
        {
            SAMPLE_ProcessCommandPacket(Sample_AppData.SAMPLEMsgPtr);
        }
        else
        {
            CFE_EVS_SendEvent(SAMPLE_PIPE_ERR_EID,
                              CFE_EVS_ERROR,
                              "SAMPLE APP: SB Pipe Read Error, App Will Exit");

            Sample_AppData.RunStatus = CFE_ES_APP_ERROR;
        }

    }

    /*
    ** Performance Log Exit Stamp
    */
    CFE_ES_PerfLogExit(SAMPLE_APP_PERF_ID);

    CFE_ES_ExitApp(Sample_AppData.RunStatus);

}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  * *  * * * * **/
/* SAMPLE_AppMain() -- Application entry point and main process loop          */
/*                                                                            */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  * *  * * * * **/
- Application entry point and main process loop


- Application entry point and main process loop
void SAMPLE_AppMain( void )
{
    int32  status;
    CFE_ES_RegisterApp();
    CFE_ES_PerfLogEntry(SAMPLE_APP_PERF_ID);
    status = SAMPLE_AppInit();
    if (status != CFE_SUCCESS)
    {
        Sample_AppData.RunStatus = CFE_ES_APP_ERROR;
    }
    while (CFE_ES_RunLoop(&Sample_AppData.RunStatus) == TRUE)
    {
        CFE_ES_PerfLogExit(SAMPLE_APP_PERF_ID);
        status = CFE_SB_RcvMsg(&Sample_AppData.SAMPLEMsgPtr,
                               Sample_AppData.SAMPLE_CommandPipe,
                               CFE_SB_PEND_FOREVER);
        CFE_ES_PerfLogEntry(SAMPLE_APP_PERF_ID);
        if (status == CFE_SUCCESS)
        {
            SAMPLE_ProcessCommandPacket(Sample_AppData.SAMPLEMsgPtr);
        }
        else
        {
            CFE_EVS_SendEvent(SAMPLE_PIPE_ERR_EID,
                              CFE_EVS_ERROR,
                              "SAMPLE APP: SB Pipe Read Error, App Will Exit");
            Sample_AppData.RunStatus = CFE_ES_APP_ERROR;
        }
    }
    CFE_ES_PerfLogExit(SAMPLE_APP_PERF_ID);
    CFE_ES_ExitApp(Sample_AppData.RunStatus);
}
void SAMPLE_AppMain ( void ) { int32 status ; CFE_ES_RegisterApp ( ) ; CFE_ES_PerfLogEntry ( SAMPLE_APP_PERF_ID ) ; status = SAMPLE_AppInit ( ) ; if ( status != CFE_SUCCESS ) { Sample_AppData . RunStatus = CFE_ES_APP_ERROR ; } while ( CFE_ES_RunLoop ( & Sample_AppData . RunStatus ) == TRUE ) { CFE_ES_PerfLogExit ( SAMPLE_APP_PERF_ID ) ; status = CFE_SB_RcvMsg ( & Sample_AppData . SAMPLEMsgPtr , Sample_AppData . SAMPLE_CommandPipe , CFE_SB_PEND_FOREVER ) ; CFE_ES_PerfLogEntry ( SAMPLE_APP_PERF_ID ) ; if ( status == CFE_SUCCESS ) { SAMPLE_ProcessCommandPacket ( Sample_AppData . SAMPLEMsgPtr ) ; } else { CFE_EVS_SendEvent ( SAMPLE_PIPE_ERR_EID , CFE_EVS_ERROR , " " ) ; Sample_AppData . RunStatus = CFE_ES_APP_ERROR ; } } CFE_ES_PerfLogExit ( SAMPLE_APP_PERF_ID ) ; CFE_ES_ExitApp ( Sample_AppData . RunStatus ) ; }
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *  * *  * * * 
SAMPLE_AppMain() -- Application entry point and main process loop
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * SAMPLE_AppMain () -- Application entry point and main process loop
/*
    ** Register the app with Executive services
    */ /*
    ** Create the first Performance Log entry
    */ /*
    ** Perform application specific initialization
    ** If the Initialization fails, set the RunStatus to
    ** CFE_ES_APP_ERROR and the App will not enter the RunLoop
    */ /*
    ** SAMPLE Runloop
    */ /*
        ** Performance Log Exit Stamp
        */ /* Pend on receipt of command packet */ /*
        ** Performance Log Entry Stamp
        */ /*
    ** Performance Log Exit Stamp
    */