fctom1215
2020-03-10 10c6d47260b4fb34262ec7a703a06fffa6a90ad0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Created by YY on 2020/3/9.
//
 
#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 contentNum;
static int currContent;
 
static void ExamDummyLight(union sigval sig);
 
void StartDummyLightExam(struct dummy_light_exam *ptr, int num)
{
    content = ptr;
    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));
    }
}