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
util/SmartRestTemplate.h@92:48069375dffa, 2015-03-20 (annotated)
- Committer:
- xinlei
- Date:
- Fri Mar 20 14:27:10 2015 +0000
- Revision:
- 92:48069375dffa
- Parent:
- 55:a0f7295ed6b6
Get rid of all annoying warning messages.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Cumulocity | 41:804f6a0bda26 | 1 | #ifndef SMARTRESTTEMPLATE_H |
Cumulocity | 41:804f6a0bda26 | 2 | #define SMARTRESTTEMPLATE_H |
Cumulocity | 41:804f6a0bda26 | 3 | |
Cumulocity | 41:804f6a0bda26 | 4 | #include "DataGenerator.h" |
Cumulocity | 41:804f6a0bda26 | 5 | |
Cumulocity | 41:804f6a0bda26 | 6 | #define SMARTREST_TEMPLATE_FIXED_SIZE 64 |
Cumulocity | 41:804f6a0bda26 | 7 | |
Cumulocity | 41:804f6a0bda26 | 8 | /** |
Cumulocity | 41:804f6a0bda26 | 9 | * A data generator implementation holding an array of template lines |
Cumulocity | 41:804f6a0bda26 | 10 | * to send via .bootstrap(). |
Cumulocity | 41:804f6a0bda26 | 11 | */ |
Cumulocity | 41:804f6a0bda26 | 12 | class SmartRestTemplate : public DataGenerator |
Cumulocity | 41:804f6a0bda26 | 13 | { |
Cumulocity | 41:804f6a0bda26 | 14 | public: |
Cumulocity | 41:804f6a0bda26 | 15 | SmartRestTemplate(); |
Cumulocity | 41:804f6a0bda26 | 16 | bool add(const char*); |
Cumulocity | 41:804f6a0bda26 | 17 | |
xinlei | 92:48069375dffa | 18 | virtual size_t writeTo(AbstractDataSink&) const; |
xinlei | 92:48069375dffa | 19 | virtual size_t writtenLength() const; |
xinlei | 92:48069375dffa | 20 | virtual DataGenerator* copy() const; |
Cumulocity | 41:804f6a0bda26 | 21 | |
Cumulocity | 41:804f6a0bda26 | 22 | private: |
Cumulocity | 41:804f6a0bda26 | 23 | const char *_buffer[SMARTREST_TEMPLATE_FIXED_SIZE]; |
Cumulocity | 41:804f6a0bda26 | 24 | size_t _len; |
Cumulocity | 41:804f6a0bda26 | 25 | }; |
Cumulocity | 41:804f6a0bda26 | 26 | |
Cumulocity | 41:804f6a0bda26 | 27 | #endif |