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

Revision:
85:5dc5a50e4b06
Parent:
84:3c8ceb12b773
Child:
87:a01faf58e938
--- a/measurement/AccelerationMeasurement.cpp	Fri Mar 06 11:10:48 2015 +0000
+++ b/measurement/AccelerationMeasurement.cpp	Fri Mar 06 11:20:07 2015 +0000
@@ -44,6 +44,7 @@
 
 bool AccelerationMeasurement::run()
 {
+    extern bool lastSensorReadingSent;
     if (!_test)
         return false;
     
@@ -56,7 +57,10 @@
     if (0.15 > abs(data[0]) &&
         0.1 > abs(data[1])) {
         if (sendingTimer.read() < TIME_LIMIT_ACCE) {
-            _io.lcdPrint(_displayInfo.getFirstLine(), _displayInfo.getSecondLine());
+            if (lastSensorReadingSent) {
+                _io.lcdPrint(_displayInfo.getFirstLine(), _displayInfo.getSecondLine());
+                lastSensorReadingSent=false;
+            }
             aDebug("Similar acceleration readings found, no sending!\r\n");
             return true;
         } else {
@@ -89,5 +93,6 @@
     oldValues[1] = data[1];
     oldValues[2] = data[2];
     sendingTimer.reset();
+    lastSensorReadingSent=true;
     return true;
 }