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: measurement/TemperatureMeasurement.cpp
- Revision:
- 85:5dc5a50e4b06
- Parent:
- 84:3c8ceb12b773
- Child:
- 86:b49c4cfecc43
--- a/measurement/TemperatureMeasurement.cpp Fri Mar 06 11:10:48 2015 +0000 +++ b/measurement/TemperatureMeasurement.cpp Fri Mar 06 11:20:07 2015 +0000 @@ -44,12 +44,16 @@ if (!_open) return false; + extern bool lastSensorReadingSent; float data = 0; data = _sensor.temp(); if (abs(oldValue-data) <= abs(oldValue)*THRESHOLD_PERCENT_TEMP) { if (sendingTimer.read() < TIME_LIMIT_TEMP) { - _io.lcdPrint(_displayInfo.getFirstLine(), _displayInfo.getSecondLine()); + if (lastSensorReadingSent) { + _io.lcdPrint(_displayInfo.getFirstLine(), _displayInfo.getSecondLine()); + lastSensorReadingSent=false; + } aDebug("Similar temperature readings found, no sending!\r\n"); return true; } else { @@ -78,5 +82,6 @@ aInfo("Temperature readings sent in %.1f.\r\n", t_end-t_start); oldValue = data; sendingTimer.reset(); + lastSensorReadingSent=true; return true; }