xrocusOS_ADXL355 version
Dependencies: mbed SDFileSystem
include/DeviceRepeater.h@7:9ab8809f9693, 2019-05-11 (annotated)
- Committer:
- Inscape_ao
- Date:
- Sat May 11 04:03:33 2019 +0000
- Revision:
- 7:9ab8809f9693
- Child:
- 10:db2be22bc2f9
add Repeatable Controllor; add Dummy Devicedriver; add Sensing Control Command; (All Host->Device Commands are already implemented)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Inscape_ao | 7:9ab8809f9693 | 1 | #ifndef _DEVICEREPEATER_H_ |
Inscape_ao | 7:9ab8809f9693 | 2 | #define _DEVICEREPEATER_H_ |
Inscape_ao | 7:9ab8809f9693 | 3 | |
Inscape_ao | 7:9ab8809f9693 | 4 | #include "DeviceDriverInterface.h" |
Inscape_ao | 7:9ab8809f9693 | 5 | |
Inscape_ao | 7:9ab8809f9693 | 6 | class DeviceRepeater |
Inscape_ao | 7:9ab8809f9693 | 7 | { |
Inscape_ao | 7:9ab8809f9693 | 8 | public: |
Inscape_ao | 7:9ab8809f9693 | 9 | typedef enum device_attr_status { |
Inscape_ao | 7:9ab8809f9693 | 10 | DEV_FATAL = -2, |
Inscape_ao | 7:9ab8809f9693 | 11 | DEV_NOT_INIT = -1, |
Inscape_ao | 7:9ab8809f9693 | 12 | DEV_READY = 0, |
Inscape_ao | 7:9ab8809f9693 | 13 | DEV_RUNNING, |
Inscape_ao | 7:9ab8809f9693 | 14 | DEV_REQ_STOP, |
Inscape_ao | 7:9ab8809f9693 | 15 | } DevStatus; |
Inscape_ao | 7:9ab8809f9693 | 16 | private: |
Inscape_ao | 7:9ab8809f9693 | 17 | static const int DEFAULT_REPEAT_MAX_COUNT = 1; |
Inscape_ao | 7:9ab8809f9693 | 18 | static const int DEFAULT_REPEAT_STRIDE = 5; |
Inscape_ao | 7:9ab8809f9693 | 19 | static const int NOT_ID_SELECTED = -1; |
Inscape_ao | 7:9ab8809f9693 | 20 | private: |
Inscape_ao | 7:9ab8809f9693 | 21 | int selected_id; |
Inscape_ao | 7:9ab8809f9693 | 22 | DevStatus stat; |
Inscape_ao | 7:9ab8809f9693 | 23 | DeviceDriver *pDriver; |
Inscape_ao | 7:9ab8809f9693 | 24 | |
Inscape_ao | 7:9ab8809f9693 | 25 | /* Tick base class */ |
Inscape_ao | 7:9ab8809f9693 | 26 | Ticker *pClock; |
Inscape_ao | 7:9ab8809f9693 | 27 | /* members for repeating */ |
Inscape_ao | 7:9ab8809f9693 | 28 | int repeat_max_count; |
Inscape_ao | 7:9ab8809f9693 | 29 | int repeat_stride_sec; |
Inscape_ao | 7:9ab8809f9693 | 30 | int repeat_remain_cnt; |
Inscape_ao | 7:9ab8809f9693 | 31 | int repeat_remain_sec; |
Inscape_ao | 7:9ab8809f9693 | 32 | private: |
Inscape_ao | 7:9ab8809f9693 | 33 | DeviceRepeater(void); |
Inscape_ao | 7:9ab8809f9693 | 34 | public: |
Inscape_ao | 7:9ab8809f9693 | 35 | DeviceRepeater(DeviceDriver *setDriver); |
Inscape_ao | 7:9ab8809f9693 | 36 | bool setRepeatCount(int maxcount); |
Inscape_ao | 7:9ab8809f9693 | 37 | bool setRepeatStride(int sec); |
Inscape_ao | 7:9ab8809f9693 | 38 | bool setConfigId(int id); |
Inscape_ao | 7:9ab8809f9693 | 39 | bool setConfigValue(int setValue); |
Inscape_ao | 7:9ab8809f9693 | 40 | bool getConfigValue(int *retValue); |
Inscape_ao | 7:9ab8809f9693 | 41 | bool start(); |
Inscape_ao | 7:9ab8809f9693 | 42 | bool stop(); |
Inscape_ao | 7:9ab8809f9693 | 43 | bool readyToStart(); |
Inscape_ao | 7:9ab8809f9693 | 44 | void tick(); |
Inscape_ao | 7:9ab8809f9693 | 45 | bool resetAllStatus(void); |
Inscape_ao | 7:9ab8809f9693 | 46 | private: |
Inscape_ao | 7:9ab8809f9693 | 47 | bool init(); |
Inscape_ao | 7:9ab8809f9693 | 48 | }; |
Inscape_ao | 7:9ab8809f9693 | 49 | |
Inscape_ao | 7:9ab8809f9693 | 50 | #endif /* _DEVICEREPEATER_H_ */ |