Vincent Wochnik / Mbed 2 deprecated MbedSmartRestMain

Dependencies:   C027 C027_Support mbed mbed-rtos MbedSmartRest LM75B MMA7660 C12832

Fork of MbedSmartRestTest by Vincent Wochnik

Revision:
25:8604bef314c1
Parent:
24:8f9b678a7932
Child:
26:26e9899e2cbe
diff -r 8f9b678a7932 -r 8604bef314c1 program.cpp
--- a/program.cpp	Tue Apr 15 16:59:56 2014 +0000
+++ b/program.cpp	Wed Apr 16 07:44:36 2014 +0000
@@ -78,7 +78,6 @@
         }
     }
     update(deviceId);
-
     printf("Device ID: %ld\r\n", deviceId);
 
     timer.start();
@@ -253,26 +252,31 @@
 
 void loop(long deviceId)
 {
-    Aggregator aggr(5, false, true);
+    Aggregator aggr(8, false, true);
 
     lcd_status("Sending measurements...");
     signalMeasurement(deviceId, aggr);
     if (client.send(aggr) != SMARTREST_SUCCESS) {
-        puts("Send failed.");
+        puts("Loop send failed.");
     }
     client.stop();
     aggr.clear();
     temperatureMeasurement(deviceId, aggr);
+    if (client.send(aggr) != SMARTREST_SUCCESS) {
+        puts("Loop send failed.");
+    }
+    client.stop();
+    aggr.clear();
     analogMeasurement(deviceId, aggr);
     if (client.send(aggr) != SMARTREST_SUCCESS) {
-        puts("Send failed.");
+        puts("Loop send failed.");
     }
     client.stop();
     aggr.clear();
     motionMeasurement(deviceId, aggr);
 
     if (client.send(aggr) != SMARTREST_SUCCESS) {
-        puts("Send failed.");
+        puts("Loop send failed.");
     }
     client.stop();
 }