| | |
| | | TEST_END |
| | | }; |
| | | |
| | | enum { |
| | | TEST_TYPE_AREA = 2, |
| | | TEST_TYPE_ROAD_DUMMY_LIGHT, |
| | | TEST_TYPE_ROAD_TRUE_LIGHT |
| | | }; |
| | | |
| | | static bool TestStart = false; |
| | | static int TestType; |
| | | |
| | | static int CarInArea = 0; |
| | | int errs = 0; |
| | |
| | | err = true; |
| | | MA_SendExamStatus(0, -2); |
| | | } |
| | | if (DummyLightContent == NULL && type == 3) { |
| | | if (DummyLightContent == NULL && type == TEST_TYPE_ROAD_DUMMY_LIGHT) { |
| | | err = true; |
| | | MA_SendExamStatus(0, -3); |
| | | } |
| | |
| | | |
| | | TestStart = true; |
| | | CommTestStart(true); |
| | | |
| | | if (type == TEST_TYPE_ROAD_DUMMY_LIGHT) { |
| | | StartDummyLightExam(DummyLightContent, DummyLightContentSize); |
| | | } |
| | | } |
| | | MA_SendExamStatus(1, 0); |
| | | } |
| | |
| | | // |
| | | |
| | | #include <cstdlib> |
| | | #include "../common/apptimer.h" |
| | | #include "dummy_light.h" |
| | | #include "../native-lib.h" |
| | | #include "../jni_log.h" |
| | | |
| | | #define DEBUG(fmt, args...) LOGD("<dummy_light> <%s>: " fmt, __func__, ##args) |
| | | |
| | | static struct dummy_light_exam *content; |
| | | static int cn; |
| | | static int contentNum; |
| | | static int currContent; |
| | | |
| | | static void ExamDummyLight(union sigval sig); |
| | | |
| | | void StartDummyLightExam(struct dummy_light_exam *ptr, int num) |
| | | { |
| | | content = ptr; |
| | | cn = num; |
| | | contentNum = num; |
| | | currContent = 0; |
| | | AppTimer_add(ExamDummyLight, D_SEC(2)); |
| | | } |
| | | |
| | | static void ExamDummyLight(union sigval sig) |
| | | { |
| | | AppTimer_delete(ExamDummyLight); |
| | | |
| | | if (currContent < contentNum) { |
| | | DEBUG("模拟灯光测试 %s", content[currContent].tts); |
| | | |
| | | PlayTTS(content[currContent].tts); |
| | | currContent++; |
| | | AppTimer_add(ExamDummyLight, D_SEC(5)); |
| | | } |
| | | } |
| | |
| | | char tts[512]; |
| | | }; |
| | | |
| | | void StartDummyLightExam(struct dummy_light_exam *ptr, int num); |
| | | |
| | | #endif //MYAPPLICATION2_DUMMY_LIGHT_H |