Remote Writing IoT Data to Influx-DB over HTTP-API.

Dependencies:   FXOS8700CQ mbed

Fork of AvnetATT_shape_hackathon by Demo Software for Avnet+AT&T IoT kit.

Files at this revision

API Documentation at this revision

Comitter:
fkellermavnet
Date:
Wed Jul 13 19:39:56 2016 +0000
Parent:
21:d0038d14ee7c
Child:
24:bd480d2aade4
Child:
25:e7996d22a7e6
Commit message:
Added a 10mS delay to the socket read function. 10mS for the first read and then 10mS in between each retry.

Changed in this revision

wnc_control.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/wnc_control.cpp	Wed Jul 13 18:34:56 2016 +0000
+++ b/wnc_control.cpp	Wed Jul 13 19:39:56 2016 +0000
@@ -325,11 +325,17 @@
   if (n <= 1500)
   {
     char num2str[6];
+    
     itoa(n, num2str, 10);
     cmd_str += num2str;
     retries += 1;
     while (retries--)
     {
+      // Assuming someone is sending then calling this to receive response, invoke
+      // a pause to give the response some time to come back and then also
+      // between each retry.
+      wait_ms(10);
+      
       send_wnc_cmd(cmd_str.data(), &pRespStr, WNC_TIMEOUT_MS);
       size_t pos_start = pRespStr->find("\"")  + 1;
       size_t pos_end   = pRespStr->rfind("\"") - 1;