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
Diff: util/RtosSmartRest.h
- Revision:
- 94:61d44636f020
- Parent:
- 93:0acd11870c6a
- Child:
- 95:010b0f7a0a1a
--- a/util/RtosSmartRest.h Mon Apr 13 14:24:58 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -#ifndef RTOSSMARTREST_H -#define RTOSSMARTREST_H - -#include "AbstractSmartRest.h" -#include "MbedSmartRest.h" -#include "rtos.h" - -#define RTOS_SMARTREST_SLOTS 8 - -class RtosSmartRest : public AbstractSmartRest -{ -public: - RtosSmartRest(MDMSerial&, uint8_t = MBEDSMARTREST_TRIES); - virtual ~RtosSmartRest(); - - struct Slot { - osThreadId tid; - MbedSmartRest *inst; - }; - - virtual uint8_t bootstrap(const DataGenerator&); - virtual uint8_t send(const DataGenerator&, const char* = NULL); - virtual uint8_t sendAndClose(const DataGenerator&, const char* = NULL); - virtual uint8_t stream(const char*, const Record&, const char* = NULL); - virtual uint8_t receive(ParsedRecord&); - virtual void stop(); - -protected: - MbedSmartRest * instance(); - -private: - uint8_t _tries; - - Slot _slots[RTOS_SMARTREST_SLOTS]; - size_t _count; - Mutex slotsLock; - MDMSerial& _mdm; -}; - -#endif \ No newline at end of file