Official reference client implementation for Cumulocity SmartREST on u-blox C027.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
MbedAgent.h@67:c360a2b2c948, 2014-11-30 (annotated)
- Committer:
- vwochnik
- Date:
- Sun Nov 30 19:34:49 2014 +0000
- Revision:
- 67:c360a2b2c948
- Parent:
- 66:31c754c36ed7
- Child:
- 68:0dc778a16d0d
refactor credentials persistence, add factory reset upon fire press button
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" |
vwochnik | 55:a0f7295ed6b6 | 7 | #include "RtosSmartRest.h" |
Cumulocity | 41:804f6a0bda26 | 8 | #include "SmartRestTemplate.h" |
Cumulocity | 41:804f6a0bda26 | 9 | #include "DeviceInfo.h" |
vwochnik | 67:c360a2b2c948 | 10 | #include "DeviceMemory.h" |
Cumulocity | 41:804f6a0bda26 | 11 | #include "DeviceBootstrap.h" |
Cumulocity | 41:804f6a0bda26 | 12 | #include "DeviceIntegration.h" |
Cumulocity | 41:804f6a0bda26 | 13 | #include "SignalQualityMeasurement.h" |
Cumulocity | 41:804f6a0bda26 | 14 | #include "TemperatureMeasurement.h" |
Cumulocity | 41:804f6a0bda26 | 15 | #include "AccelerationMeasurement.h" |
Cumulocity | 47:89ae46d5c466 | 16 | #include "AnalogMeasurement.h" |
Cumulocity | 47:89ae46d5c466 | 17 | #include "LocationUpdate.h" |
vwochnik | 57:4af5f1bec3a6 | 18 | #include "OperationSupport.h" |
Cumulocity | 41:804f6a0bda26 | 19 | |
Cumulocity | 41:804f6a0bda26 | 20 | #define MBED_AGENT_HOST "developer.cumulocity.com" |
Cumulocity | 41:804f6a0bda26 | 21 | #define MBED_AGENT_PORT 80 |
vwochnik | 66:31c754c36ed7 | 22 | #define MBED_AGENT_DEVICE_IDENTIFIER "com_cumulocity_MbedAgent_1.4.2" |
vwochnik | 66:31c754c36ed7 | 23 | #define MBED_AGENT_INTERVAL 30.0 |
Cumulocity | 41:804f6a0bda26 | 24 | |
Cumulocity | 41:804f6a0bda26 | 25 | class MbedAgent |
Cumulocity | 41:804f6a0bda26 | 26 | { |
Cumulocity | 41:804f6a0bda26 | 27 | public: |
vwochnik | 67:c360a2b2c948 | 28 | MbedAgent(DeviceIO&, MDMSerial&, DeviceInfo&, DeviceMemory&); |
Cumulocity | 41:804f6a0bda26 | 29 | |
Cumulocity | 41:804f6a0bda26 | 30 | bool init(); |
Cumulocity | 41:804f6a0bda26 | 31 | bool run(); |
Cumulocity | 41:804f6a0bda26 | 32 | |
Cumulocity | 41:804f6a0bda26 | 33 | protected: |
Cumulocity | 41:804f6a0bda26 | 34 | void loop(); |
Cumulocity | 41:804f6a0bda26 | 35 | |
Cumulocity | 41:804f6a0bda26 | 36 | private: |
Cumulocity | 42:104746744af8 | 37 | DeviceIO& _io; |
Cumulocity | 41:804f6a0bda26 | 38 | MDMSerial& _mdm; |
Cumulocity | 41:804f6a0bda26 | 39 | DeviceInfo& _deviceInfo; |
vwochnik | 67:c360a2b2c948 | 40 | DeviceMemory& _deviceMemory; |
vwochnik | 55:a0f7295ed6b6 | 41 | RtosSmartRest _client; |
Cumulocity | 41:804f6a0bda26 | 42 | SmartRestTemplate _tpl; |
Cumulocity | 41:804f6a0bda26 | 43 | DeviceBootstrap _bootstrap; |
Cumulocity | 41:804f6a0bda26 | 44 | DeviceIntegration _integration; |
Cumulocity | 41:804f6a0bda26 | 45 | SignalQualityMeasurement _signalQualityMeasurement; |
Cumulocity | 41:804f6a0bda26 | 46 | TemperatureMeasurement _temperatureMeasurement; |
Cumulocity | 41:804f6a0bda26 | 47 | AccelerationMeasurement _accelerationMeasurement; |
Cumulocity | 47:89ae46d5c466 | 48 | AnalogMeasurement _analogMeasurement; |
Cumulocity | 47:89ae46d5c466 | 49 | LocationUpdate _locationUpdate; |
vwochnik | 57:4af5f1bec3a6 | 50 | OperationSupport _operationSupport; |
Cumulocity | 41:804f6a0bda26 | 51 | long _deviceId; |
Cumulocity | 41:804f6a0bda26 | 52 | }; |
Cumulocity | 41:804f6a0bda26 | 53 | |
Cumulocity | 41:804f6a0bda26 | 54 | #endif |