![](/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
DeviceIntegration.h@116:5de54f09f754, 2015-05-20 (annotated)
- Committer:
- xinlei
- Date:
- Wed May 20 09:55:49 2015 +0000
- Revision:
- 116:5de54f09f754
- Parent:
- 99:47ea098f8a47
device bootstrap revamp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Cumulocity | 41:804f6a0bda26 | 1 | #ifndef DEVICEINTEGRATION_H |
Cumulocity | 41:804f6a0bda26 | 2 | #define DEVICEINTEGRATION_H |
Cumulocity | 41:804f6a0bda26 | 3 | |
xinlei | 116:5de54f09f754 | 4 | #include "SmartRest.h" |
Cumulocity | 41:804f6a0bda26 | 5 | #include "SmartRestTemplate.h" |
Cumulocity | 41:804f6a0bda26 | 6 | #include "DeviceInfo.h" |
Cumulocity | 41:804f6a0bda26 | 7 | |
Cumulocity | 41:804f6a0bda26 | 8 | class DeviceIntegration |
Cumulocity | 41:804f6a0bda26 | 9 | { |
Cumulocity | 41:804f6a0bda26 | 10 | public: |
xinlei | 116:5de54f09f754 | 11 | DeviceIntegration(SmartRest& c, SmartRestTemplate& t, DeviceInfo& d): |
xinlei | 116:5de54f09f754 | 12 | _init(false), _tpl(t), _client(c), _deviceInfo(d) {} |
Cumulocity | 41:804f6a0bda26 | 13 | bool init(); |
Cumulocity | 41:804f6a0bda26 | 14 | bool integrate(); |
Cumulocity | 41:804f6a0bda26 | 15 | |
Cumulocity | 41:804f6a0bda26 | 16 | protected: |
Cumulocity | 41:804f6a0bda26 | 17 | bool deviceExisting(); |
Cumulocity | 41:804f6a0bda26 | 18 | bool createDevice(); |
Cumulocity | 41:804f6a0bda26 | 19 | bool addGlobalIdentifier(); |
Cumulocity | 41:804f6a0bda26 | 20 | bool updateDevice(); |
Cumulocity | 41:804f6a0bda26 | 21 | |
Cumulocity | 41:804f6a0bda26 | 22 | private: |
Cumulocity | 41:804f6a0bda26 | 23 | bool _init; |
Cumulocity | 41:804f6a0bda26 | 24 | SmartRestTemplate& _tpl; |
xinlei | 116:5de54f09f754 | 25 | SmartRest& _client; |
Cumulocity | 41:804f6a0bda26 | 26 | DeviceInfo& _deviceInfo; |
Cumulocity | 41:804f6a0bda26 | 27 | }; |
Cumulocity | 41:804f6a0bda26 | 28 | |
Cumulocity | 41:804f6a0bda26 | 29 | #endif |