![](/media/cache/group/u-blox_logo_trans.png.50x50_q85.png)
portable version of the cumulocity demo
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
MbedAgent.h@47:89ae46d5c466, 2014-07-24 (annotated)
- Committer:
- Cumulocity
- Date:
- Thu Jul 24 23:32:53 2014 +0000
- Revision:
- 47:89ae46d5c466
- Parent:
- 42:104746744af8
- Child:
- 49:ac0ba9d54ebc
major update
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 | |
Cumulocity | 41:804f6a0bda26 | 4 | #include <stddef.h> |
Cumulocity | 41:804f6a0bda26 | 5 | #include "MDM.h" |
Cumulocity | 41:804f6a0bda26 | 6 | #include "DeviceIO.h" |
Cumulocity | 41:804f6a0bda26 | 7 | #include "MbedSmartRest.h" |
Cumulocity | 41:804f6a0bda26 | 8 | #include "SmartRestTemplate.h" |
Cumulocity | 41:804f6a0bda26 | 9 | #include "DeviceInfo.h" |
Cumulocity | 41:804f6a0bda26 | 10 | #include "DeviceBootstrap.h" |
Cumulocity | 41:804f6a0bda26 | 11 | #include "DeviceIntegration.h" |
Cumulocity | 41:804f6a0bda26 | 12 | #include "SignalQualityMeasurement.h" |
Cumulocity | 41:804f6a0bda26 | 13 | #include "TemperatureMeasurement.h" |
Cumulocity | 41:804f6a0bda26 | 14 | #include "AccelerationMeasurement.h" |
Cumulocity | 47:89ae46d5c466 | 15 | #include "AnalogMeasurement.h" |
Cumulocity | 47:89ae46d5c466 | 16 | #include "LocationUpdate.h" |
Cumulocity | 41:804f6a0bda26 | 17 | |
Cumulocity | 41:804f6a0bda26 | 18 | #define MBED_AGENT_HOST "developer.cumulocity.com" |
Cumulocity | 41:804f6a0bda26 | 19 | #define MBED_AGENT_PORT 80 |
Cumulocity | 47:89ae46d5c466 | 20 | #define MBED_AGENT_DEVICE_IDENTIFIER "com_cumulocity_MbedAgent_1.0.3" |
Cumulocity | 41:804f6a0bda26 | 21 | #define MBED_AGENT_INTERVAL 60.0 |
Cumulocity | 41:804f6a0bda26 | 22 | |
Cumulocity | 41:804f6a0bda26 | 23 | class MbedAgent |
Cumulocity | 41:804f6a0bda26 | 24 | { |
Cumulocity | 41:804f6a0bda26 | 25 | public: |
Cumulocity | 42:104746744af8 | 26 | MbedAgent(DeviceIO&, MDMSerial&, DeviceInfo&); |
Cumulocity | 41:804f6a0bda26 | 27 | |
Cumulocity | 41:804f6a0bda26 | 28 | bool init(); |
Cumulocity | 41:804f6a0bda26 | 29 | bool run(); |
Cumulocity | 41:804f6a0bda26 | 30 | |
Cumulocity | 41:804f6a0bda26 | 31 | protected: |
Cumulocity | 41:804f6a0bda26 | 32 | void loop(); |
Cumulocity | 41:804f6a0bda26 | 33 | |
Cumulocity | 41:804f6a0bda26 | 34 | private: |
Cumulocity | 42:104746744af8 | 35 | DeviceIO& _io; |
Cumulocity | 41:804f6a0bda26 | 36 | MDMSerial& _mdm; |
Cumulocity | 41:804f6a0bda26 | 37 | DeviceInfo& _deviceInfo; |
Cumulocity | 41:804f6a0bda26 | 38 | MbedSmartRest _client; |
Cumulocity | 41:804f6a0bda26 | 39 | SmartRestTemplate _tpl; |
Cumulocity | 41:804f6a0bda26 | 40 | DeviceBootstrap _bootstrap; |
Cumulocity | 41:804f6a0bda26 | 41 | DeviceIntegration _integration; |
Cumulocity | 41:804f6a0bda26 | 42 | SignalQualityMeasurement _signalQualityMeasurement; |
Cumulocity | 41:804f6a0bda26 | 43 | TemperatureMeasurement _temperatureMeasurement; |
Cumulocity | 41:804f6a0bda26 | 44 | AccelerationMeasurement _accelerationMeasurement; |
Cumulocity | 47:89ae46d5c466 | 45 | AnalogMeasurement _analogMeasurement; |
Cumulocity | 47:89ae46d5c466 | 46 | LocationUpdate _locationUpdate; |
Cumulocity | 41:804f6a0bda26 | 47 | long _deviceId; |
Cumulocity | 41:804f6a0bda26 | 48 | }; |
Cumulocity | 41:804f6a0bda26 | 49 | |
Cumulocity | 41:804f6a0bda26 | 50 | #endif |