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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Temperature.h Source File

Temperature.h

00001 #ifndef TEMPERATURE_H
00002 #define TEMPERATURE_H
00003 #include "mbed.h"
00004 #include "LM75B.h"
00005 #include "AbstractReporter.h"
00006 
00007 
00008 class Temperature: public AbstractReporter
00009 {
00010 public:
00011         Temperature(): deviceReady(false), oldValue(0),
00012                 timer(), sensor(D14, D15) {
00013                 timer.start();
00014         }
00015         virtual ~Temperature() {}
00016         virtual bool init() {
00017                 deviceReady = sensor.open();
00018                 return deviceReady;
00019         }
00020         virtual const char* name() const { return "Temp"; }
00021         virtual int read(char*, size_t, char*, size_t);
00022 private:
00023         bool deviceReady;
00024         float oldValue;
00025         Timer timer;
00026         LM75B sensor;
00027 };
00028 
00029 #endif /* TEMPERATURE_H */