Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
util/SmartRestTemplate.h@138:f8ab852e83e7, 2016-08-08 (annotated)
- Committer:
- xinlei
- Date:
- Mon Aug 08 11:05:57 2016 +0000
- Revision:
- 138:f8ab852e83e7
- Parent:
- 91:48069375dffa
Etisalat and Teleena APN.
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 | 91:48069375dffa | 18 | virtual size_t writeTo(AbstractDataSink&) const; |
xinlei | 91:48069375dffa | 19 | virtual size_t writtenLength() const; |
xinlei | 91: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 |