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

operation/ReportThread.h

Committer:
xinlei
Date:
2015-04-27
Revision:
97:ea056f6be2e8
Parent:
94:61d44636f020
Child:
101:dbcd3bc51758

File content as of revision 97:ea056f6be2e8:

#ifndef REPORTTHREAD_H
#define REPORTTHREAD_H
#include "SmartRestSocket.h"
#include "Operation.h"
#include "SmartRestConf.h"

class ReportThread
{
public:
        ReportThread(OperationPool& pool) : ipool(pool), sock(),
                thread(ReportThread::threadWrapper, this) {
                strncpy(uri, "/s", sizeof(uri));
        }
        virtual ~ReportThread() { sock.close(); }
        void threadFunc();
        static void threadWrapper(const void *p) { ((ReportThread*)p)->threadFunc(); }
private:
        char uri[4];
        OperationPool& ipool;
        char buf[SMARTREST_SIZE];
        char buf2[SMARRESTBODY_SIZE];
        SmartRestSocket sock;
        Thread thread;
};

#endif /* REPORTTHREAD_H */