609 lines
21 KiB
C
609 lines
21 KiB
C
////
|
|
//// Created by xemon on 09.11.2021.
|
|
////
|
|
#include <SystemDelayInterface.h>
|
|
#include "DeviceTesting.h"
|
|
#include "UserInput.h"
|
|
#include "EraGlonassMsd.h"
|
|
#include "EraGlonassUveos.h"
|
|
|
|
#define LOGGER env->logger
|
|
#define LOG_SIGN "Тест. Пользв."
|
|
|
|
uint16_t timeoutPresButton = 10000;
|
|
|
|
|
|
void DeviceTesting_ErorEmergencyPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("emergency")
|
|
DEVTST_PLAY_SAMPLE("call")
|
|
}
|
|
|
|
void DeviceTesting_ErorEmergencyNumberNotSetPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("number")
|
|
DEVTST_PLAY_SAMPLE("call")
|
|
DEVTST_PLAY_SAMPLE("dont_set")
|
|
}
|
|
|
|
void DeviceTesting_ErorEmergencyTempLocPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("execute")
|
|
DEVTST_PLAY_SAMPLE("call")
|
|
DEVTST_PLAY_SAMPLE("temp_imposible")
|
|
}
|
|
|
|
void DeviceTesting_EmergencySucsessPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("emergency")
|
|
DEVTST_PLAY_SAMPLE("call")
|
|
DEVTST_PLAY_SAMPLE("successfully")
|
|
DEVTST_PLAY_SAMPLE("done")
|
|
}
|
|
|
|
void DeviceTesting_ErorAddButtonPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("buttom")
|
|
DEVTST_PLAY_SAMPLE("add_functions")
|
|
}
|
|
|
|
void DeviceTesting_ErorSosButtonPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("buttom")
|
|
DEVTST_PLAY_SAMPLE("sos_call")
|
|
}
|
|
|
|
void DeviceTesting_ButtonSuccessPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("buttom")
|
|
DEVTST_PLAY_SAMPLE("successfully")
|
|
DEVTST_PLAY_SAMPLE("done")
|
|
}
|
|
|
|
void DeviceTesting_IgnitionSucsessPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("ignition")
|
|
DEVTST_PLAY_SAMPLE("successfully")
|
|
DEVTST_PLAY_SAMPLE("done")
|
|
}
|
|
|
|
void DeviceTesting_IgnitionOffErrorPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("when_turned_off")
|
|
DEVTST_PLAY_SAMPLE("ignition")
|
|
}
|
|
|
|
void DeviceTesting_IgnitionOnErrorPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("when_turned_on")
|
|
DEVTST_PLAY_SAMPLE("ignition")
|
|
}
|
|
|
|
void DeviceTesting_ErorGreenIndicationPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("green_ind")
|
|
}
|
|
|
|
void DeviceTesting_ErorRedIndicationPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("red_ind")
|
|
}
|
|
|
|
void DeviceTesting_SucsessIndicationPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("indicators")
|
|
DEVTST_PLAY_SAMPLE("successfully")
|
|
DEVTST_PLAY_SAMPLE("done")
|
|
}
|
|
|
|
void DeviceTesting_ErorMicPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("microphon")
|
|
}
|
|
|
|
void DeviceTesting_SucsessMicPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("microphon")
|
|
DEVTST_PLAY_SAMPLE("successfully")
|
|
DEVTST_PLAY_SAMPLE("done")
|
|
}
|
|
|
|
void DeviceTesting_ErorSpeakerPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("error_testing")
|
|
DEVTST_PLAY_SAMPLE("dinamics")
|
|
}
|
|
|
|
void DeviceTesting_SucsessSpeakerPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(150);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("dinamics")
|
|
DEVTST_PLAY_SAMPLE("successfully")
|
|
DEVTST_PLAY_SAMPLE("done")
|
|
}
|
|
|
|
bool DeviceTesting_WaitTestResult(tTestDescriptor *test, uint16_t value, uint32_t timeout) {
|
|
uint32_t end = SystemGetMs() + timeout;
|
|
while (SystemGetMs() < end) {
|
|
DeviceTestsTable_MakeTest(test);
|
|
if (test->result == value) {
|
|
return true;
|
|
}
|
|
SystemDelayMs(1);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void DeviceTesting_ExitTestPlay(tDeviceTesting *env) {
|
|
SystemDelayMs(300);
|
|
DEVTST_PLAY_SAMPLE("exit_mode")
|
|
SystemDelayMs(500);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
}
|
|
|
|
bool DeviceTesting_WaitAddButtonClick(tDeviceTesting *env, uint32_t timeout) {
|
|
tUserInputButtonEvent buttonEvent;
|
|
uint32_t end = SystemGetMs() + timeout;
|
|
while (SystemGetMs() < end) {
|
|
UserButtons_Clear(env->input);
|
|
UserButtons_GetNext(env->input, &buttonEvent, timeout);
|
|
if (UserInputButtonEventIs(buttonEvent, UI_BUTTON_ADDITIONAL, FALL)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Нажата \"Доп.Функции\"")
|
|
return true;
|
|
}
|
|
SystemDelayMs(1);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool DeviceTesting_WaitSosButtonClick(tDeviceTesting *env, uint32_t timeout) {
|
|
tUserInputButtonEvent buttonEvent;
|
|
uint32_t end = SystemGetMs() + timeout;
|
|
while (SystemGetMs() < end) {
|
|
UserButtons_Clear(env->input);
|
|
UserButtons_GetNext(env->input, &buttonEvent, timeout);
|
|
if (UserInputButtonEventIs(buttonEvent, UI_BUTTON_EMERGENCY, FALL)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Нажата \"SOS\"")
|
|
return true;
|
|
}
|
|
SystemDelayMs(1);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool DeviceTesting_TestAudioSpeaker(tDeviceTesting *env) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест динамика")
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("dinamics")
|
|
DEVTST_PLAY_SAMPLE("if_you_hear_massage")
|
|
DEVTST_PLAY_SAMPLE("press_button")
|
|
DEVTST_PLAY_SAMPLE("add_functions")
|
|
if (!DeviceTesting_WaitAddButtonClick(env, timeoutPresButton)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста...")
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
return true;
|
|
}
|
|
DEVTST_PLAY_SAMPLE("confirmed")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Текущий тест пройден")
|
|
return false;
|
|
}
|
|
|
|
|
|
bool DeviceTesting_TestMic(tDeviceTesting *env) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тестирование микрофона")
|
|
// SystemDelayMs(200);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("microphon")
|
|
DEVTST_PLAY_SAMPLE("say_any")
|
|
DEVTST_REC_SAMPLE("test_rec_name")
|
|
SystemDelayMs(2000);
|
|
AudioPlayer_PlayStatic(env->audioPlayer, "test_rec_name", 85*1000);
|
|
SystemDelayMs(8000);
|
|
DEVTST_PLAY_SAMPLE("if_you_hear_recording")
|
|
DEVTST_PLAY_SAMPLE("press_button")
|
|
DEVTST_PLAY_SAMPLE("add_functions")
|
|
|
|
if (!DeviceTesting_WaitAddButtonClick(env, timeoutPresButton)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста...")
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
return true;
|
|
}
|
|
DEVTST_PLAY_SAMPLE("confirmed")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Текущий тест пройден")
|
|
return false;
|
|
}
|
|
|
|
bool DeviceTesting_Ignition(tDeviceTesting *env) {
|
|
env->flagAcsessExitThread = (uint8_t) 0;
|
|
tTestDescriptor *currentTest;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест зажигания")
|
|
currentTest = DeviceTestsTable_GetModeTestStatic(&env->testsTable, DEVICE_TESTING_MODE_ALL, "IGNITION");
|
|
if (currentTest) {
|
|
bool res = false;
|
|
env->ignitionAddStatusRes = 0;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Запрос выключить зажигание")
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("ignition")
|
|
|
|
DEVTST_PLAY_SAMPLE("turn_off")
|
|
DEVTST_PLAY_SAMPLE("ignition")
|
|
if (!DeviceTesting_WaitTestResult(currentTest, DEVICE_TESTING_CODE_NOT_CONNECTED_OK, 10000)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста...")
|
|
env->ignitionAddStatusRes = 1;
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
res = true;
|
|
} else {
|
|
DEVTST_PLAY_SAMPLE("confirmed")
|
|
res = false;
|
|
}
|
|
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Запрос включить зажигание")
|
|
DEVTST_PLAY_SAMPLE("turn_on")
|
|
DEVTST_PLAY_SAMPLE("ignition")
|
|
if (!DeviceTesting_WaitTestResult(currentTest, DEVICE_TESTING_CODE_CONNECTED, 10000)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста...")
|
|
env->ignitionAddStatusRes = 2;
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
res = true;
|
|
} else {
|
|
DEVTST_PLAY_SAMPLE("confirmed")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Текущий тест пройден")
|
|
if (env->ignitionAddStatusRes == 0 && res == false) {
|
|
env->ignitionAddStatusRes = 0;
|
|
}
|
|
}
|
|
|
|
SystemDelayMs(200);
|
|
env->flagAcsessExitThread = (uint8_t) 1;
|
|
return res;
|
|
}
|
|
SystemDelayMs(200);
|
|
env->flagAcsessExitThread = (uint8_t) 1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
bool DeviceTesting_Indication(tDeviceTesting *env) {
|
|
bool res = false;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест индикатора")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Горит зеленый")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ожидание подтверждения кнопкой доп. функций...")
|
|
|
|
UserIndication_Uiu(env->indication, UIU_GREEN);
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("indications")
|
|
DeviceTesting_ChekExit(env);
|
|
|
|
DEVTST_PLAY_SAMPLE("if_indication_on")
|
|
DEVTST_PLAY_SAMPLE("green")
|
|
DEVTST_PLAY_SAMPLE("press_button")
|
|
DEVTST_PLAY_SAMPLE("add_functions")
|
|
|
|
if (!DeviceTesting_WaitAddButtonClick(env, timeoutPresButton)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста...")
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
env->indicationStatusRes = 1;
|
|
res = true;
|
|
} else {
|
|
DEVTST_PLAY_SAMPLE("confirmed")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест пройден")
|
|
}
|
|
DeviceTesting_ChekExit(env);
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Горит красный")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ожидание подтверждения кнопкой доп. функций...")
|
|
|
|
UserIndication_Uiu(env->indication, UIU_RED);
|
|
DEVTST_PLAY_SAMPLE("if_indication_on")
|
|
DEVTST_PLAY_SAMPLE("red")
|
|
DEVTST_PLAY_SAMPLE("press_button")
|
|
DEVTST_PLAY_SAMPLE("add_functions")
|
|
|
|
if (!DeviceTesting_WaitAddButtonClick(env, timeoutPresButton)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста...")
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
res = true;
|
|
if (env->indicationStatusRes == 0) {
|
|
env->indicationStatusRes = 2;
|
|
} else {
|
|
env->indicationStatusRes = 3;
|
|
}
|
|
} else {
|
|
DEVTST_PLAY_SAMPLE("confirmed")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Текущий тест пройден")
|
|
if (env->indicationStatusRes == 0 && res == false) {
|
|
env->indicationStatusRes = 0;
|
|
}
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
bool DeviceTesting_Buttons(tDeviceTesting *env) {
|
|
bool res = false;
|
|
env->buttonAddStatusRes = 0;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест кнопок")
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("buttom")
|
|
|
|
DEVTST_PLAY_SAMPLE("press_button")
|
|
DEVTST_PLAY_SAMPLE("sos_call")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ожидание нажатия кнопки экстренного вызова...")
|
|
if (!DeviceTesting_WaitSosButtonClick(env, timeoutPresButton)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста...")
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
env->buttonAddStatusRes = 1;
|
|
res = true;
|
|
} else {
|
|
DEVTST_PLAY_SAMPLE("confirmed")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест пройден")
|
|
|
|
}
|
|
|
|
DeviceTesting_ChekExit(env);
|
|
DEVTST_PLAY_SAMPLE("press_button")
|
|
DEVTST_PLAY_SAMPLE("add_functions")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ожидание нажатия кнопки дополнительных функций...")
|
|
if (!DeviceTesting_WaitAddButtonClick(env, timeoutPresButton)) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста...")
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
res = true;
|
|
if (env->buttonAddStatusRes == 0) {
|
|
env->buttonAddStatusRes = 2;
|
|
} else {
|
|
env->buttonAddStatusRes = 3;
|
|
}
|
|
} else {
|
|
|
|
DEVTST_PLAY_SAMPLE("confirmed")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест пройден")
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Текущий тест пройден")
|
|
if (env->buttonAddStatusRes == 0 && res == false) {
|
|
env->buttonAddStatusRes = 0;
|
|
}
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
void DeviceTesting_EcallKZ1(tDeviceTesting *env) {
|
|
|
|
String16CopyStatic(&env->ErGlUv->settings->ECALL_TEST_NUMBER, "112");
|
|
env->ecallAddStatusRes = 0;
|
|
bool res = false;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест экстренного вызова")
|
|
|
|
eEraGlonassUveos_EcallProcessingResult resCall;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ожидание выполнения теста экстренного вызова...")
|
|
resCall = EraGlonassUveos_TestEmergencyCall(env->ErGlUv, &env->tmsdDiagRes, false);
|
|
String16CopyStatic(&env->ErGlUv->settings->ECALL_TEST_NUMBER, "+79418100029");
|
|
}
|
|
|
|
void DeviceTesting_EcallKZ(tDeviceTesting *env) {
|
|
|
|
String16CopyStatic(&env->ErGlUv->settings->ECALL_TEST_NUMBER, "112");
|
|
env->ecallAddStatusRes = 0;
|
|
bool res = false;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест экстренного вызова")
|
|
|
|
eEraGlonassUveos_EcallProcessingResult resCall;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ожидание выполнения теста экстренного вызова...")
|
|
resCall = EraGlonassUveos_TestEmergencyCall(env->ErGlUv, &env->tmsdDiagRes, true);
|
|
String16CopyStatic(&env->ErGlUv->settings->ECALL_TEST_NUMBER, "+79418100029");
|
|
}
|
|
|
|
bool DeviceTesting_Ecall(tDeviceTesting *env) {
|
|
env->ecallAddStatusRes = 0;
|
|
bool res = false;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест экстренного вызова")
|
|
|
|
DEVTST_PLAY_SAMPLE("testing")
|
|
DEVTST_PLAY_SAMPLE("emergency")
|
|
DEVTST_PLAY_SAMPLE("call")
|
|
|
|
if (env->ErGlUv->settings->ECALL_TEST_NUMBER.length < 2) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста")
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
SystemDelayMs(500);
|
|
env->ecallAddStatusRes = 1;
|
|
res = false;
|
|
} else {
|
|
eEraGlonassUveos_EcallProcessingResult resCall;
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ожидание выполнения теста экстренного вызова...")
|
|
resCall = EraGlonassUveos_TestEmergencyCall(env->ErGlUv, &env->tmsdDiagRes,false);
|
|
if (resCall == ERA_GLONASS_UVEOS_TEST_CALL_NOT_ALLOWED) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка текущего теста")
|
|
DEVTST_PLAY_SAMPLE("error")
|
|
SystemDelayMs(500);
|
|
env->ecallAddStatusRes = 2;
|
|
res = false;
|
|
} else {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Текущий тест пройден")
|
|
SystemDelayMs(500);
|
|
res = true;
|
|
}
|
|
}
|
|
return res;
|
|
}
|
|
|
|
bool DeviceTesting_TestIgnitionRes(tDeviceTesting *env) {
|
|
SystemDelayMs(200);
|
|
bool res = false;
|
|
if (env->tmsdDiagRes.ignitionLineFailure != 1) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест зажигания успешно выполнен")
|
|
DeviceTesting_IgnitionSucsessPlay(env);
|
|
res = true;
|
|
} else {
|
|
if (env->ignitionAddStatusRes == 1) {
|
|
SystemDelayMs(200);
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка при тестировании отключения заигания")
|
|
DeviceTesting_IgnitionOffErrorPlay(env);
|
|
}
|
|
if (env->ignitionAddStatusRes == 2) {
|
|
SystemDelayMs(200);
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка при тестировании включения заигания")
|
|
DeviceTesting_IgnitionOnErrorPlay(env);
|
|
}
|
|
res = false;
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
bool DeviceTesting_TestButtonRes(tDeviceTesting *env) {
|
|
bool res = false;
|
|
if (env->tmsdDiagRes.uimFailure != 1) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест кнопок успешно выполнен")
|
|
DeviceTesting_ButtonSuccessPlay(env);
|
|
SystemDelayMs(500);
|
|
res = true;
|
|
} else {
|
|
if (env->buttonAddStatusRes == 1) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка тестировании кнопки экстренного вызова")
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorSosButtonPlay(env);
|
|
}
|
|
if (env->buttonAddStatusRes == 2) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка тестировании кнопки дополнительный функций")
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorAddButtonPlay(env);
|
|
}
|
|
if (env->buttonAddStatusRes == 3) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка тестировании кнопки дополнительный функций")
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorSosButtonPlay(env);
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorAddButtonPlay(env);
|
|
}
|
|
res = false;
|
|
}
|
|
return res;
|
|
}
|
|
|
|
bool DeviceTesting_TestAudioSpeakerRes(tDeviceTesting *env) {
|
|
if (env->tmsdDiagRes.speakersFailure == 1) {
|
|
DeviceTesting_ErorSpeakerPlay(env);
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка тестирования динамика")
|
|
return 0;
|
|
} else {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест динамика успешно выполнен")
|
|
DeviceTesting_SucsessSpeakerPlay(env);
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
bool DeviceTesting_TestMicRes(tDeviceTesting *env) {
|
|
if (env->tmsdDiagRes.micFailure != 1) {
|
|
SystemDelayMs(500);
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест микрофона успешно выполнен")
|
|
DeviceTesting_SucsessMicPlay(env);
|
|
return 1;
|
|
} else {
|
|
SystemDelayMs(500);
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка тестирования микрофона")
|
|
DeviceTesting_ErorMicPlay(env);
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
bool DeviceTesting_TestIndicationRes(tDeviceTesting *env) {
|
|
bool res = false;
|
|
if (env->tmsdDiagRes.statusIndicatorFailure != 1) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тест индикаторов успешно выполнен")
|
|
SystemDelayMs(500);
|
|
DeviceTesting_SucsessIndicationPlay(env);
|
|
res = true;
|
|
} else {
|
|
if (env->indicationStatusRes == 1) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка при тестировании зелёного индикатора ")
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorGreenIndicationPlay(env);
|
|
}
|
|
|
|
if (env->indicationStatusRes == 2) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка при тестировании красного индикатора ")
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorRedIndicationPlay(env);
|
|
}
|
|
|
|
if (env->indicationStatusRes == 3) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Ошибка при тестировании индикации")
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorGreenIndicationPlay(env);
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorRedIndicationPlay(env);
|
|
}
|
|
|
|
res = false;
|
|
}
|
|
return res;
|
|
}
|
|
|
|
|
|
void DeviceTesting_GetEcalRes(tDeviceTesting *env) {
|
|
if (env->ecallAddStatusRes == 0) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Тестирование вызова выполнено успешно")
|
|
DeviceTesting_EmergencySucsessPlay(env);
|
|
}
|
|
if (env->ecallAddStatusRes == 1) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Номер тестового вызова не установлен, вызов не возможен")
|
|
DeviceTesting_ErorEmergencyPlay(env);
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorEmergencyNumberNotSetPlay(env);
|
|
}
|
|
if (env->ecallAddStatusRes == 2) {
|
|
LoggerInfoStatic(LOGGER, LOG_SIGN, "Превышен допустимый интервал, вызов не возможен, попробуйте позже")
|
|
DeviceTesting_ErorEmergencyPlay(env);
|
|
SystemDelayMs(500);
|
|
DeviceTesting_ErorEmergencyTempLocPlay(env);
|
|
}
|
|
}
|
|
|
|
bool DeviceTesting_UserGetResult(tDeviceTesting *env) {
|
|
bool fullRes = true;
|
|
SystemDelayMs(1000);
|
|
if (DeviceTesting_TestAudioSpeakerRes(env) && fullRes) {
|
|
fullRes = true;
|
|
} else {
|
|
fullRes = false;
|
|
}
|
|
|
|
if (DeviceTesting_TestMicRes(env) && fullRes) {
|
|
fullRes = true;
|
|
} else {
|
|
fullRes = false;
|
|
}
|
|
|
|
if (DeviceTesting_TestIgnitionRes(env) && fullRes) {
|
|
fullRes = true;
|
|
} else {
|
|
fullRes = false;
|
|
}
|
|
|
|
if (DeviceTesting_TestButtonRes(env) && fullRes) {
|
|
fullRes = true;
|
|
} else {
|
|
fullRes = false;
|
|
}
|
|
|
|
if (DeviceTesting_TestIndicationRes(env) && fullRes) {
|
|
fullRes = true;
|
|
} else {
|
|
fullRes = false;
|
|
}
|
|
|
|
return fullRes;
|
|
} |