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 Vincent Wochnik

util/SmartRestSocket.h

Committer:
xinlei
Date:
2015-05-11
Revision:
106:c61f0d62b625
Parent:
99:e369fc75c000
Child:
116:4eb3c7e945cf

File content as of revision 106:c61f0d62b625:

#ifndef SMARTRESTSOCKET_H
#define SMARTRESTSOCKET_H
#include "TCPSocketConnection.h"
#include "rtos.h"

class SmartRestSocket : private TCPSocketConnection
{
public:
        SmartRestSocket(): TCPSocketConnection(), timeout(-1) {}
        virtual ~SmartRestSocket() {}
        int sendOnly(char *buf, int size);
        int sendAndReceive(char *buf, int size, int maxSize);
        void setBlocking(int _timeout = -1) { // timeout in milliseconds
                timeout = _timeout;
        }
private:
        int connect();
        static char cachedIP[16];
        int timeout;
        Mutex ipLock;
};

#endif /* SMARTRESTSOCKET_H */