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:
- 55:a0f7295ed6b6
- Child:
- 67:c360a2b2c948
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/util/RtosSmartRest.h Thu Oct 23 12:50:07 2014 +0000 @@ -0,0 +1,40 @@ +#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(const char*, uint16_t, const char*, uint8_t = MBEDSMARTREST_TRIES); + ~RtosSmartRest(); + + struct Slot { + osThreadId tid; + MbedSmartRest *inst; + }; + + uint8_t setAuthorization(const char*, const char*); + uint8_t bootstrap(const DataGenerator&); + uint8_t send(const DataGenerator&, const char* = NULL); + uint8_t receive(ParsedRecord&); + void stop(); + const char * getIdentifier(); + +protected: + MbedSmartRest * instance(); + +private: + const char *_host, *_identifier; + uint8_t _port, _tries; + const char *_username, *_password; + + Slot _slots[RTOS_SMARTREST_SLOTS]; + size_t _count; +}; + +#endif \ No newline at end of file