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

Files at this revision

API Documentation at this revision

Comitter:
vwochnik
Date:
Fri Oct 24 08:55:17 2014 +0000
Parent:
57:4af5f1bec3a6
Child:
59:f96be79feccd
Commit message:
operation support templates

Changed in this revision

MbedAgent.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
measurement/LocationUpdate.cpp Show annotated file Show diff for this revision Revisions of this file
operation/OperationSupport.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MbedAgent.h	Thu Oct 23 14:21:26 2014 +0000
+++ b/MbedAgent.h	Fri Oct 24 08:55:17 2014 +0000
@@ -18,7 +18,7 @@
 
 #define MBED_AGENT_HOST "developer.cumulocity.com"
 #define MBED_AGENT_PORT 80
-#define MBED_AGENT_DEVICE_IDENTIFIER "com_cumulocity_MbedAgent_1.1.0"
+#define MBED_AGENT_DEVICE_IDENTIFIER "com_cumulocity_MbedAgent_1.1.0_asdbr"
 #define MBED_AGENT_INTERVAL 60.0
 
 class MbedAgent
--- a/main.cpp	Thu Oct 23 14:21:26 2014 +0000
+++ b/main.cpp	Fri Oct 24 08:55:17 2014 +0000
@@ -26,6 +26,8 @@
 
     MDMRtos<MDMSerial> mdm;
     GPSI2C gps;
+    
+    mdm.setDebug(4);
 
     if (!mdm.init(SIM_PIN, &devStatus))
         status = 1;
--- a/measurement/LocationUpdate.cpp	Thu Oct 23 14:21:26 2014 +0000
+++ b/measurement/LocationUpdate.cpp	Fri Oct 24 08:55:17 2014 +0000
@@ -26,7 +26,7 @@
 
     // Insert measurement
     // USAGE: 109,<DEVICE/ID>,<ALTITUDE>,<LATITUDE>,<LONGITUDE>
-    if (!_tpl.add("10,109,POST,/event/events,application/vnd.com.nsn.cumulocity.event+json,application/vnd.com.nsn.cumulocity.event+json,%%,NOW UNSIGNED NUMBER NUMBER NUMBER,\"{\"\"time\"\":\"\"%%\"\",\"\"source\"\":{\"\"id\"\":\"\"%%\"\"},\"\"type\"\":\"\"c8y_LocationUpdate\"\",\"\"text\"\":\"\"Mbed location update\"\",\"\"c8y_Position\"\":{\"\"alt\"\":%%,\"\"lat\"\":%%,\"\"lng\"\":%%}}\""))
+    if (!_tpl.add("10,109,POST,/event/events,application/vnd.com.nsn.cumulocity.event+json,application/vnd.com.nsn.cumulocity.event+json,%%,NOW UNSIGNED NUMBER NUMBER NUMBER,\"{\"\"time\"\":\"\"%%\"\",\"\"source\"\":{\"\"id\"\":\"\"%%\"\"},\"\"type\"\":\"\"c8y_LocationUpdate\"\",\"\"text\"\":\"\"Mbed location update\"\",\"\"c8y_Position\"\":{\"\"alt\"\":%%,\"\"lat\"\":%%,\"\"lng\"\":%%}}\"\r\n"))
         return false;
 
     _init = true;
--- a/operation/OperationSupport.cpp	Thu Oct 23 14:21:26 2014 +0000
+++ b/operation/OperationSupport.cpp	Fri Oct 24 08:55:17 2014 +0000
@@ -23,7 +23,7 @@
 
     // Set operation state
     // USAGE: 110,<OPERATION/ID>,<STATE>
-    if (!_tpl.add("10,110,PUT,/devicecontrol/operations/%%,application/vnd.com.nsn.cumulocity.operation+json,application/vnd.com.nsn.cumulocity.operation+json,%%,UNSIGNED STRING,\"{\"\"status\"\":\"\"%%\"\"}\"\r\n"))
+    if (!_tpl.add("10,111,PUT,/devicecontrol/operations/%%,application/vnd.com.nsn.cumulocity.operation+json,application/vnd.com.nsn.cumulocity.operation+json,%%,UNSIGNED STRING,\"{\"\"status\"\":\"\"%%\"\"}\"\r\n"))
         return false;
 
     // Get operations