//-------------------------------------------------------------------------------------------------- static void Testle_ecall_StartTest ( void ) { le_ecall_CallRef_t testECallRef = 0x00; le_ecall_State_t state = LE_ECALL_STATE_UNKNOWN; LE_ASSERT(le_ecall_SetPsapNumber("0102030405") == LE_OK); LE_ASSERT(le_ecall_SetMsdTxMode(LE_ECALL_TX_MODE_PUSH) == LE_OK); LE_ASSERT((testECallRef=le_ecall_Create()) != NULL); LE_ASSERT(le_ecall_SetMsdPosition(testECallRef, true, +48898064, +2218092, 0) == LE_OK); LE_ASSERT(le_ecall_SetMsdPassengersCount(testECallRef, 3) == LE_OK); LE_ASSERT(le_ecall_StartTest(testECallRef) == LE_OK); LE_ASSERT(le_ecall_StartManual(testECallRef) == LE_BUSY); LE_ASSERT(le_ecall_StartAutomatic(testECallRef) == LE_BUSY); state=le_ecall_GetState(testECallRef); LE_ASSERT(((state>=LE_ECALL_STATE_STARTED) && (state<=LE_ECALL_STATE_FAILED))); le_ecall_Delete(testECallRef); }
//-------------------------------------------------------------------------------------------------- static void Testle_ecall_ConfigSettings ( void ) { char psap[LE_MDMDEFS_PHONE_NUM_MAX_BYTES]; le_ecall_MsdTxMode_t mode = LE_ECALL_TX_MODE_PULL; uint16_t deregTime = 0; LE_ASSERT(le_ecall_UseUSimNumbers() == LE_OK); LE_ASSERT(le_ecall_SetPsapNumber("0102030405") == LE_OK); LE_ASSERT(le_ecall_GetPsapNumber(psap, 1) == LE_OVERFLOW); LE_ASSERT(le_ecall_GetPsapNumber(psap, sizeof(psap)) == LE_OK); LE_ASSERT(strncmp(psap, "0102030405", strlen("0102030405")) == 0); LE_ASSERT(le_ecall_SetMsdTxMode(LE_ECALL_TX_MODE_PUSH) == LE_OK); LE_ASSERT(le_ecall_GetMsdTxMode(&mode) == LE_OK); LE_ASSERT(mode == LE_ECALL_TX_MODE_PUSH); LE_ASSERT(le_ecall_SetNadDeregistrationTime(180) == LE_OK); LE_ASSERT(le_ecall_GetNadDeregistrationTime(&deregTime) == LE_OK); LE_ASSERT(deregTime == 180); }
//-------------------------------------------------------------------------------------------------- static void Testle_ecall_StartManual ( void ) { le_ecall_CallRef_t testECallRef = 0x00; le_ecall_State_t state = LE_ECALL_STATE_UNKNOWN; LE_INFO("Start Testle_ecall_StartManual"); LE_ASSERT(le_ecall_SetPsapNumber("0102030405") == LE_OK); LE_ASSERT(le_ecall_SetMsdTxMode(LE_ECALL_TX_MODE_PUSH) == LE_OK); LE_ASSERT((testECallRef=le_ecall_Create()) != NULL); LE_ASSERT(le_ecall_ImportMsd(testECallRef, ImportedMsd, sizeof(ImportedMsd)) == LE_OK); LE_ASSERT(le_ecall_StartManual(testECallRef) == LE_OK); LE_ASSERT(le_ecall_StartTest(testECallRef) == LE_BUSY); LE_ASSERT(le_ecall_StartAutomatic(testECallRef) == LE_BUSY); LE_ASSERT(le_ecall_End(testECallRef) == LE_OK); state=le_ecall_GetState(testECallRef); LE_ASSERT(((state>=LE_ECALL_STATE_STARTED) && (state<=LE_ECALL_STATE_FAILED))); le_ecall_Delete(testECallRef); }
//-------------------------------------------------------------------------------------------------- void Testle_ecall_StartTest ( void ) { le_ecall_State_t state = LE_ECALL_STATE_UNKNOWN; LE_INFO("Start Testle_ecall_StartTest"); 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_SetMsdPositionN1(LastTestECallRef, 11, -22) == LE_OK); LE_ASSERT(le_ecall_SetMsdPositionN2(LastTestECallRef, -33, 44) == LE_OK); LE_ASSERT(le_ecall_SetMsdPassengersCount(LastTestECallRef, 3) == LE_OK); LE_ASSERT(le_ecall_StartTest(LastTestECallRef) == LE_OK); LE_ASSERT(le_ecall_StartManual(LastTestECallRef) == LE_BUSY); LE_ASSERT(le_ecall_StartAutomatic(LastTestECallRef) == LE_BUSY); LE_ASSERT(((state>=LE_ECALL_STATE_STARTED) && (state<=LE_ECALL_STATE_FAILED))); }
//-------------------------------------------------------------------------------------------------- void Testle_ecall_StartManual ( void ) { le_ecall_CallRef_t testECallRef = 0x00; le_ecall_State_t state = LE_ECALL_STATE_UNKNOWN; char psap[LE_MDMDEFS_PHONE_NUM_MAX_BYTES]; LE_INFO("Start Testle_ecall_StartManual"); LE_ASSERT(le_ecall_SetPsapNumber(PsapNumber) == LE_OK); LE_ASSERT(le_ecall_GetPsapNumber(psap, sizeof(psap)) == LE_OK); LE_INFO("psap %s", psap); LE_ASSERT(strncmp(psap, PsapNumber, strlen(PsapNumber)) == 0); LE_ASSERT(le_ecall_SetMsdTxMode(LE_ECALL_TX_MODE_PUSH) == LE_OK); LE_ASSERT((testECallRef=le_ecall_Create()) != NULL); LE_ASSERT(le_ecall_ImportMsd(testECallRef, ImportedMsd, sizeof(ImportedMsd)) == LE_OK); LE_ASSERT(le_ecall_StartManual(testECallRef) == LE_OK); LE_ASSERT(le_ecall_StartTest(testECallRef) == LE_BUSY); LE_ASSERT(le_ecall_StartAutomatic(testECallRef) == LE_BUSY); LE_ASSERT(le_ecall_End(testECallRef) == LE_OK); state=le_ecall_GetState(testECallRef); LE_ASSERT(((state>=LE_ECALL_STATE_STARTED) && (state<=LE_ECALL_STATE_FAILED))); le_ecall_Delete(testECallRef); sleep(5); }
//-------------------------------------------------------------------------------------------------- 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); }
//-------------------------------------------------------------------------------------------------- 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))); }
//-------------------------------------------------------------------------------------------------- void Testle_ecall_ConfigSettings ( void ) { char psap[LE_MDMDEFS_PHONE_NUM_MAX_BYTES]; uint32_t msdVersion = 1; uint16_t deregTime = 0; le_ecall_MsdTxMode_t mode = LE_ECALL_TX_MODE_PULL; le_ecall_SystemStandard_t systemStandard = LE_ECALL_ERA_GLONASS; le_ecall_MsdVehicleType_t vehicleType = LE_ECALL_MSD_VEHICLE_BUS_M2; LE_INFO("Start Testle_ecall_ConfigSettings"); LE_ASSERT(le_ecall_UseUSimNumbers() == LE_OK); LE_ASSERT(le_ecall_SetPsapNumber("0102030405") == LE_OK); LE_ASSERT(le_ecall_GetPsapNumber(psap, 1) == LE_OVERFLOW); LE_ASSERT(le_ecall_GetPsapNumber(psap, sizeof(psap)) == LE_OK); LE_ASSERT(strncmp(psap, "0102030405", strlen("0102030405")) == 0); LE_ASSERT(le_ecall_SetMsdTxMode(LE_ECALL_TX_MODE_PUSH) == LE_OK); LE_ASSERT(le_ecall_GetMsdTxMode(&mode) == LE_OK); LE_ASSERT(mode == LE_ECALL_TX_MODE_PUSH); LE_ASSERT(le_ecall_SetNadDeregistrationTime(180) == LE_OK); LE_ASSERT(le_ecall_GetNadDeregistrationTime(&deregTime) == LE_OK); LE_ASSERT(deregTime == 180); LE_ASSERT((LE_OK == le_ecall_SetSystemStandard(LE_ECALL_ERA_GLONASS))); systemStandard = LE_ECALL_PAN_EUROPEAN; LE_ASSERT((LE_OK == le_ecall_GetSystemStandard(&systemStandard))); LE_ASSERT(LE_ECALL_ERA_GLONASS == systemStandard); LE_ASSERT((LE_OK == le_ecall_SetMsdVersion(msdVersion))); msdVersion = 42; LE_ASSERT((LE_OK == le_ecall_GetMsdVersion(&msdVersion))); LE_ASSERT(( 1 == msdVersion )); LE_ASSERT((LE_OK == le_ecall_SetVehicleType(vehicleType))); vehicleType = LE_ECALL_MSD_VEHICLE_PASSENGER_M1; LE_ASSERT((LE_OK == le_ecall_GetVehicleType(&vehicleType))); LE_ASSERT(( LE_ECALL_MSD_VEHICLE_BUS_M2 == vehicleType )); char VinSet[LE_ECALL_VIN_MAX_BYTES] = "12345678901234567"; char VinGet[LE_ECALL_VIN_MAX_BYTES] = { '\0' }; LE_ASSERT((LE_OK == le_ecall_SetVIN(VinSet))); LE_ASSERT((LE_OK == le_ecall_GetVIN(&VinGet[0], LE_ECALL_VIN_MAX_LEN))); LE_ASSERT(( 0 == strncmp(&VinSet[0], &VinGet[0], LE_ECALL_VIN_MAX_LEN ))); le_ecall_PropulsionTypeBitMask_t propulsionType = LE_ECALL_PROPULSION_TYPE_ELECTRIC; LE_ASSERT((LE_OK == le_ecall_SetPropulsionType(propulsionType))); propulsionType = LE_ECALL_PROPULSION_TYPE_GASOLINE; LE_ASSERT((LE_OK == le_ecall_GetPropulsionType(&propulsionType))); LE_ASSERT( LE_ECALL_PROPULSION_TYPE_ELECTRIC == propulsionType ); }