Own fork of MbedSmartRestMain

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Cumulocity Official

Revision:
116:5de54f09f754
Parent:
114:c54e9731b9de
Child:
120:d4d44550e087
--- a/MbedAgent.cpp	Mon May 18 09:29:12 2015 +0000
+++ b/MbedAgent.cpp	Wed May 20 09:55:49 2015 +0000
@@ -3,10 +3,9 @@
 #include "logging.h"
 
 MbedAgent::MbedAgent(DeviceInfo& deviceInfo):
-    _client(), tpl(), _bootstrap(_client, deviceInfo), 
-    _integration(_client, tpl, deviceInfo), lcdThirdLineBlank(true),
-    signal(deviceInfo), temp(), poti(), gps(), acc(), sock(),
-    pool(), _operationSupport(tpl, pool)
+    client(), tpl(), _bootstrap(deviceInfo), _integration(client, tpl, deviceInfo),
+    lcdThirdLineBlank(true), signal(deviceInfo), temp(), poti(), gps(),
+    acc(), sock(), pool(), _operationSupport(tpl, pool)
 {
     reporters[0] = &ConfigSync::inst();
     reporters[1] = &temp;
@@ -75,16 +74,18 @@
 {
     // device bootstrapping process
     if (!_bootstrap.bootstrap()) {
+        LCDDisplay::inst().setLines("Bootstrap Failure");
         return -1;
     }
+
     Thread::wait(2000);
-
     LCDDisplay::inst().setLines("Connect to Cloud", srHost);
+    setX_ID(UBLOX_SMARTREST_VERSION);
     if (!_integration.integrate()) {
         LCDDisplay::inst().setLines("Integrate failure");
         return -2;
     }
-    setX_ID(_client.getIdentifier());
+    setX_ID(client.getIdentifier());
     aInfo("Set X-ID: %s\n", srX_ID);
 
     return 0;
@@ -117,8 +118,7 @@
         }
         if (l) {
             l = snprintf(buf, sizeof(buf), fmtSmartRest, "/s", l, buf2);
-//            l = sock.sendOnly(buf, l);
-            l = sock.sendAndReceive(buf, l, sizeof(buf));
+            l = sock.sendOnly(buf, l);
             if (l < 0)
                 aWarning("%s\n", status);
         }