mbed.org implementation of the abstract SmartREST library for the Cumulocity Platform SmartREST protocol.

Dependents:   MbedSmartRestMain MbedSmartRestMain

Revision:
6:cd7ba1ddb664
Parent:
5:2b74510900da
Child:
7:8159a2d12e4e
diff -r 2b74510900da -r cd7ba1ddb664 SmartRest.cpp
--- a/SmartRest.cpp	Thu Jul 10 16:20:31 2014 +0200
+++ b/SmartRest.cpp	Mon Jul 28 12:11:02 2014 +0200
@@ -62,7 +62,7 @@
 {
     uint8_t res;
 
-    if (!aggregator.isManaged())
+    if (!aggregator.managed())
         return SMARTREST_INTERNAL_ERROR;
 
     res = send(generator, overrideIdentifier);
@@ -72,8 +72,10 @@
     }
 
     ParsedRecord recvd;
-    while ((res = receive(recvd)) == SMARTREST_SUCCESS)
-        aggregator.add(recvd);
+    while ((res = receive(recvd)) == SMARTREST_SUCCESS) {
+        if (!aggregator.add(recvd))
+            return SMARTREST_INTERNAL_ERROR;
+    }
 
     stop();
     if (res == SMARTREST_END_OF_RESPONSE)