コード例 #1
0
ファイル: eCallStress.c プロジェクト: H-H-bin/legato-af
//--------------------------------------------------------------------------------------------------
static void StartStressECall
(
    void
)
{
    LE_INFO("Start StartStressECall");

    LastECallState = LE_ECALL_STATE_DISCONNECTED;
    TestCount = 0;

    ThreadSemaphore = le_sem_Create("ThreadSem",0);

    LE_ASSERT(le_ecall_AddStateChangeHandler(MyECallEventHandler, NULL) != NULL);

    LE_ASSERT(le_ecall_SetPsapNumber(PsapNumber) == LE_OK);

    LE_ASSERT(le_ecall_SetMsdTxMode(LE_ECALL_TX_MODE_PUSH) == LE_OK);

    LE_ASSERT((MytECallRef=le_ecall_Create()) != NULL);

    LE_ASSERT(le_ecall_SetMsdPosition(MytECallRef, true, +48898064, +2218092, 0) == LE_OK);

    LE_ASSERT(le_ecall_SetMsdPassengersCount(MytECallRef, 3) == LE_OK);

    le_thread_Start(le_thread_Create("ECallLoopThread", ECallLoopThread, NULL));
    // Start Test
    le_sem_Post(ThreadSemaphore);
}
コード例 #2
0
ファイル: eCallWVoice.c プロジェクト: mbaglin/legato-af
//--------------------------------------------------------------------------------------------------
static void StartTestECall
(
    void
)
{
    le_ecall_State_t                   state = LE_ECALL_STATE_UNKNOWN;
    le_ecall_StateChangeHandlerRef_t   stateChangeHandlerRef = 0x00;

    LE_INFO("Start StartTestECall");

    LE_ASSERT((stateChangeHandlerRef = le_ecall_AddStateChangeHandler(MyECallEventHandler, NULL)) != NULL);

    LE_ASSERT(le_ecall_SetPsapNumber(PsapNumber) == LE_OK);

    LE_ASSERT(le_ecall_SetMsdTxMode(LE_ECALL_TX_MODE_PUSH) == LE_OK);

    LE_ASSERT((LastTestECallRef=le_ecall_Create()) != NULL);

    LE_ASSERT(le_ecall_SetMsdPosition(LastTestECallRef, true, +48898064, +2218092, 0) == LE_OK);

    LE_ASSERT(le_ecall_SetMsdPassengersCount(LastTestECallRef, 3) == LE_OK);

    ConnectAudio();
    // Set a default gain for my test
    le_audio_SetGain(FeOutRef, 50);

    LE_ASSERT(le_ecall_StartTest(LastTestECallRef) == LE_OK);

    state=le_ecall_GetState(LastTestECallRef);
    LE_ASSERT(((state>=LE_ECALL_STATE_STARTED) && (state<=LE_ECALL_STATE_FAILED)));
}
コード例 #3
0
ファイル: le_ecallTest.c プロジェクト: ekral85/legato-af
//--------------------------------------------------------------------------------------------------
static void* Test_thread(void* context)
{

    le_ecall_StateChangeHandlerRef_t   stateChangeHandlerRef = 0x00;

    le_ecall_ConnectService();


    LE_INFO("Add State Change Handler");
    LE_ASSERT((stateChangeHandlerRef = le_ecall_AddStateChangeHandler(MyECallEventHandler, NULL)) != NULL);

    LE_INFO("No event loop");
    le_event_RunLoop();

}
コード例 #4
0
ファイル: main.c プロジェクト: H-H-bin/legato-af
//--------------------------------------------------------------------------------------------------
static void* AppHandler
(
    void* ctxPtr
)
{
    AppContext_t * appCtxPtr = (AppContext_t*) ctxPtr;

    LE_INFO("App id: %d", appCtxPtr->appId);

    // Subscribe to eCall state handler
    LE_ASSERT((appCtxPtr->ecallHandler = le_ecall_AddStateChangeHandler(MyECallEventHandler,
                                                                        ctxPtr)) != NULL);

    // Semaphore is used to synchronize the task execution with the core test
    le_sem_Post(ThreadSemaphore);

    le_event_RunLoop();
}