![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
MbedAgent.h@138:f8ab852e83e7, 2016-08-08 (annotated)
- Committer:
- xinlei
- Date:
- Mon Aug 08 11:05:57 2016 +0000
- Revision:
- 138:f8ab852e83e7
- Parent:
- 116:5de54f09f754
Etisalat and Teleena APN.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Cumulocity | 41:804f6a0bda26 | 1 | #ifndef MBEDAGENT_H |
Cumulocity | 41:804f6a0bda26 | 2 | #define MBEDAGENT_H |
Cumulocity | 41:804f6a0bda26 | 3 | |
xinlei | 93:61d44636f020 | 4 | #include "SmartRest.h" |
Cumulocity | 41:804f6a0bda26 | 5 | #include "SmartRestTemplate.h" |
Cumulocity | 41:804f6a0bda26 | 6 | #include "DeviceInfo.h" |
Cumulocity | 41:804f6a0bda26 | 7 | #include "DeviceBootstrap.h" |
Cumulocity | 41:804f6a0bda26 | 8 | #include "DeviceIntegration.h" |
xinlei | 99:47ea098f8a47 | 9 | |
xinlei | 99:47ea098f8a47 | 10 | #include "Signal.h" |
xinlei | 99:47ea098f8a47 | 11 | #include "Temperature.h" |
xinlei | 99:47ea098f8a47 | 12 | #include "Location.h" |
xinlei | 99:47ea098f8a47 | 13 | #include "Potentiometer.h" |
xinlei | 99:47ea098f8a47 | 14 | #include "Acceleration.h" |
xinlei | 98:e369fc75c000 | 15 | #include "ConfigSync.h" |
xinlei | 99:47ea098f8a47 | 16 | |
vwochnik | 57:4af5f1bec3a6 | 17 | #include "OperationSupport.h" |
xinlei | 92:0acd11870c6a | 18 | #include "SmartRestConf.h" |
xinlei | 95:5dfdc8568e9f | 19 | #include "PollThread.h" |
xinlei | 93:61d44636f020 | 20 | #include "ReportThread.h" |
xinlei | 100:dbcd3bc51758 | 21 | #include "LCDDisplay.h" |
Cumulocity | 41:804f6a0bda26 | 22 | |
xinlei | 99:47ea098f8a47 | 23 | const size_t N = 6; |
xinlei | 99:47ea098f8a47 | 24 | |
Cumulocity | 41:804f6a0bda26 | 25 | class MbedAgent |
Cumulocity | 41:804f6a0bda26 | 26 | { |
Cumulocity | 41:804f6a0bda26 | 27 | public: |
xinlei | 98:e369fc75c000 | 28 | MbedAgent(DeviceInfo&); |
xinlei | 92:0acd11870c6a | 29 | |
Cumulocity | 41:804f6a0bda26 | 30 | bool init(); |
xinlei | 92:0acd11870c6a | 31 | int run(); |
xinlei | 92:0acd11870c6a | 32 | void loop(); |
Cumulocity | 41:804f6a0bda26 | 33 | |
Cumulocity | 41:804f6a0bda26 | 34 | private: |
xinlei | 116:5de54f09f754 | 35 | SmartRest client; |
xinlei | 99:47ea098f8a47 | 36 | SmartRestTemplate tpl; |
Cumulocity | 41:804f6a0bda26 | 37 | DeviceBootstrap _bootstrap; |
Cumulocity | 41:804f6a0bda26 | 38 | DeviceIntegration _integration; |
xinlei | 99:47ea098f8a47 | 39 | bool lcdThirdLineBlank; |
xinlei | 99:47ea098f8a47 | 40 | Signal signal; |
xinlei | 99:47ea098f8a47 | 41 | Temperature temp; |
xinlei | 99:47ea098f8a47 | 42 | Potentiometer poti; |
xinlei | 99:47ea098f8a47 | 43 | Location gps; |
xinlei | 99:47ea098f8a47 | 44 | Acceleration acc; |
xinlei | 99:47ea098f8a47 | 45 | char buf[SMARTREST_SIZE]; |
xinlei | 105:c61f0d62b625 | 46 | char buf2[SMARTREST_BODY_SIZE]; |
xinlei | 100:dbcd3bc51758 | 47 | char status[DISPLAY_LEN]; |
xinlei | 99:47ea098f8a47 | 48 | AbstractReporter *reporters[N]; |
xinlei | 100:dbcd3bc51758 | 49 | SmartRestSocket sock; |
xinlei | 93:61d44636f020 | 50 | OperationPool pool; |
vwochnik | 57:4af5f1bec3a6 | 51 | OperationSupport _operationSupport; |
Cumulocity | 41:804f6a0bda26 | 52 | }; |
Cumulocity | 41:804f6a0bda26 | 53 | |
Cumulocity | 41:804f6a0bda26 | 54 | #endif |