Multi-Hackers / Axeda_IoT_Connection_Example

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Vanger
Date:
Mon Mar 23 19:38:52 2015 +0000
Parent:
1:2d299b96dc79
Child:
3:677bdaf965ac
Commit message:
Declaring buffer sizes at the top of the file.; Changed a comment or two.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Mar 23 19:13:52 2015 +0000
+++ b/main.cpp	Mon Mar 23 19:38:52 2015 +0000
@@ -16,6 +16,10 @@
  */
 const string Serialstr = "";
 
+//Size of the http receive and send buffers
+const int BUFFER_SIZE = 2000;
+
+//Destination url to send data to the axeda cloud from the device
 const string base_url = "https://nucleus-connect.axeda.com/ammp/data/1/";
 
 int main(){
@@ -101,12 +105,12 @@
     }
     
     //Create receive interface and buffer
-    char rbuf[2000];
+    char rbuf[BUFFER_SIZE];
     HTTPText* receive = new HTTPText(rbuf, sizeof(rbuf));
     
     //Json output object, data must be in Json format, example data is input already:
     //HTTPJson type merely sets the HTTP header to JSON type, nothing else is different from the HTTPText type
-    char sbuf[2000] = "{\"data\":[{\"dataItems\":{\"mental_trauma\":1,\"physical_trauma\":2,\"emotional_trauma\":3}}]}\0";
+    char sbuf[BUFFER_SIZE] = "{\"data\":[{\"dataItems\":{\"mental_trauma\":1,\"physical_trauma\":2,\"emotional_trauma\":3}}]}\0";
     HTTPJson* send = new HTTPJson(sbuf);
     
     //Create HTTP Client Instance