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:
86:b49c4cfecc43
--- a/measurement/LocationUpdate.cpp	Fri Mar 06 11:10:48 2015 +0000
+++ b/measurement/LocationUpdate.cpp	Fri Mar 06 11:20:07 2015 +0000
@@ -48,6 +48,7 @@
 
 bool LocationUpdate::run()
 {
+    extern bool lastSensorReadingSent;
     GPSTracker::Position position;    
     if (!_gpsTracker.position(&position)) {
         aError("No GPS data available.\r\n");
@@ -62,7 +63,10 @@
         abs(oldValues[1]-data[1]) <= abs(oldValues[1])*THRESHOLD_PERCENT_LOC &&
         abs(oldValues[2]-data[2]) <= abs(oldValues[2])*THRESHOLD_PERCENT_LOC) {
         if (sendingTimer.read() < TIME_LIMIT_LOC) {
-            _io.lcdPrint(_displayInfo.getFirstLine(), _displayInfo.getSecondLine());
+            if (lastSensorReadingSent) {
+                _io.lcdPrint(_displayInfo.getFirstLine(), _displayInfo.getSecondLine());
+                lastSensorReadingSent=false;
+            }
             aDebug("Similar location readings found, no sending!\r\n");
             return true;
         } else {
@@ -101,5 +105,6 @@
     oldValues[1] = data[1];
     oldValues[2] = data[2];
     sendingTimer.reset();
+    lastSensorReadingSent=true;
     return true;
 }