ex

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Committer:
tmboy
Date:
Tue Jul 18 09:08:52 2017 +0000
Revision:
50:9ecaa144d1f3
Parent:
47:9e361da97763
add .json

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TMBOY 47:9e361da97763 1 // Copyright (2016) Baidu Inc. All rights reserved.
TMBOY 47:9e361da97763 2
TMBOY 47:9e361da97763 3 #ifndef BAIDU_IOT_TINYDU_DEMO_DUER_APP_H
TMBOY 47:9e361da97763 4 #define BAIDU_IOT_TINYDU_DEMO_DUER_APP_H
TMBOY 47:9e361da97763 5
TMBOY 47:9e361da97763 6 #include "baidu_recorder_manager.h"
TMBOY 47:9e361da97763 7 #include "baidu_ca_scheduler.h"
TMBOY 47:9e361da97763 8
TMBOY 47:9e361da97763 9 namespace duer {
TMBOY 47:9e361da97763 10
TMBOY 47:9e361da97763 11 class DuerApp {
TMBOY 47:9e361da97763 12 public:
TMBOY 47:9e361da97763 13 enum Color {
TMBOY 47:9e361da97763 14 WHITE,
TMBOY 47:9e361da97763 15 YELLOW,
TMBOY 47:9e361da97763 16 PURPLE,
TMBOY 47:9e361da97763 17 RED,
TMBOY 47:9e361da97763 18 CYAN,
TMBOY 47:9e361da97763 19 GREEN,
TMBOY 47:9e361da97763 20 BLUE,
TMBOY 47:9e361da97763 21 OFF
TMBOY 47:9e361da97763 22 };
TMBOY 47:9e361da97763 23
TMBOY 47:9e361da97763 24 DuerApp();
TMBOY 47:9e361da97763 25
TMBOY 47:9e361da97763 26 ~DuerApp();
TMBOY 47:9e361da97763 27
TMBOY 47:9e361da97763 28 void start();
TMBOY 47:9e361da97763 29
TMBOY 47:9e361da97763 30 void stop();
TMBOY 47:9e361da97763 31
TMBOY 47:9e361da97763 32 void talk_start();
TMBOY 47:9e361da97763 33
TMBOY 47:9e361da97763 34 void talk_stop();
TMBOY 47:9e361da97763 35
TMBOY 47:9e361da97763 36 void set_color(Color c);
TMBOY 47:9e361da97763 37
TMBOY 47:9e361da97763 38 void restart();
TMBOY 47:9e361da97763 39
TMBOY 47:9e361da97763 40 int get_topic_id() const;
TMBOY 47:9e361da97763 41
TMBOY 47:9e361da97763 42 void pause_play();
TMBOY 47:9e361da97763 43
TMBOY 47:9e361da97763 44 private:
TMBOY 47:9e361da97763 45 void button_fall_handle();
TMBOY 47:9e361da97763 46
TMBOY 47:9e361da97763 47 void button_rise_handle();
TMBOY 47:9e361da97763 48
TMBOY 47:9e361da97763 49 void pause_button_fall_handle();
TMBOY 47:9e361da97763 50
TMBOY 47:9e361da97763 51 #if defined(TEST_BOARD)
TMBOY 47:9e361da97763 52 void send_timestamp();
TMBOY 47:9e361da97763 53 #endif
TMBOY 47:9e361da97763 54
TMBOY 47:9e361da97763 55 RecorderManager _recorder;
TMBOY 47:9e361da97763 56 Recorder::IListener* _recorder_listener;
TMBOY 47:9e361da97763 57
TMBOY 47:9e361da97763 58 duer::Scheduler::IOnEvent* _on_event;
TMBOY 47:9e361da97763 59
TMBOY 47:9e361da97763 60 #if !defined(TARGET_UNO_91H)
TMBOY 47:9e361da97763 61 mbed::BusOut _indicate;
TMBOY 47:9e361da97763 62 #endif
TMBOY 47:9e361da97763 63
TMBOY 47:9e361da97763 64 rtos::RtosTimer _timer;
TMBOY 47:9e361da97763 65 unsigned int _delay;
TMBOY 47:9e361da97763 66
TMBOY 47:9e361da97763 67 #if defined(TEST_BOARD)
TMBOY 47:9e361da97763 68 rtos::RtosTimer _send_ticker;
TMBOY 47:9e361da97763 69 #endif
TMBOY 47:9e361da97763 70 };
TMBOY 47:9e361da97763 71
TMBOY 47:9e361da97763 72 } // namespace duer
TMBOY 47:9e361da97763 73
TMBOY 47:9e361da97763 74 #endif // BAIDU_IOT_TINYDU_DEMO_DUER_APP_H