Axeda AMMP sample code for the STMicro Nucleo-F103RB and W5500 Ethernet Shield

Dependencies:   W5500Interface mbed

Files at this revision

API Documentation at this revision

Comitter:
AxedaCorp
Date:
Tue Oct 29 16:51:32 2013 +0000
Parent:
1:16dd56f0f6c7
Child:
3:359e019da3b9
Commit message:
Update protocol to latest version

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Oct 17 19:53:50 2013 +0000
+++ b/main.cpp	Tue Oct 29 16:51:32 2013 +0000
@@ -70,7 +70,7 @@
             printf("Sending Value  %.2f\n\r", potVal);
             sock.connect("dev6-connect.axeda.com", 52689);
  
-            sprintf(http_cmd,  "POST /axeda/data/%s!%s HTTP/1.1\r\nContent-Type: application/vnd.m2m.msgbuf-v1+json\r\nContent-Length: 49\r\n\r\n{\"data\":[{\"items\":{\"bar\":\"camp\",\"pot1\":%.2f}}]}\r\n\r\n", MODEL, SERIAL_NUM,potVal);
+            sprintf(http_cmd,  "POST /ammp/data/1/%s!%s HTTP/1.1\r\nContent-Type: application/json\r\nContent-Length: 47\r\n\r\n{\"data\":[{\"di\":{\"bar\":\"camp\",\"pot1\":%.2f}}]}\r\n\r\n", MODEL, SERIAL_NUM,potVal);
             sock.send_all(http_cmd, sizeof(http_cmd)-1);
     
             while ( (returnCode = sock.receive(buffer, sizeof(buffer)-1)) > 0)