Okundu Omeni
/
wifi-https-ble-sm-uart-atcmd-5-13-1
this is using the mbed os version 5-13-1
Diff: source/WiFiManager.cpp
- Revision:
- 94:fb4414aff957
- Parent:
- 93:06e755a80187
- Child:
- 95:290859010c8c
--- a/source/WiFiManager.cpp Sun Apr 14 14:38:51 2019 +0000 +++ b/source/WiFiManager.cpp Sun Apr 14 17:03:02 2019 +0000 @@ -410,20 +410,25 @@ at_data_resp->dataLen = 0; bool queueResult = true; int hdrLen = 0; + int wait_count = 0; do { - if(!queueResult) - { - wait_ms(10); // wait 10 ms to allow data to be transferred + if(!queueResult){ + wait_count++; + printf("[WIFI-MAN] ATCMD Queue full waiting %d ms so far...\n", wait_count*10); + wait_ms(10); } else { if(http_response_hdr_sent == false){ copyResponseHdr2Queue(); + printf("[WIFI-MAN] Http Response header copied to response buffer [bytes = %d] \r\n",at_data_resp->dataLen); hdrLen = at_data_resp->dataLen; http_response_hdr_sent = true; } - int cpyLen = (bufLen - pos) > bufSize? bufSize : (bufLen - pos - hdrLen ) ; + int cpyLen = (bufLen - pos) > bufSize? bufSize : (bufLen - pos) ; + printf("[WIFI-MAN] Http Response body [bytes = %d] \r\n",cpyLen); at_data_resp->dataLen += cpyLen; memcpy(&at_data_resp->buffer[hdrLen], &buf[pos], cpyLen); + printf("[WIFI-MAN] Http Response header and body copied to response buffer [bytes = %d] \r\n",at_data_resp->dataLen); } queueResult = queueWiFiDataResponse(*at_data_resp); if(queueResult){ @@ -432,6 +437,7 @@ hdrLen = 0; } }while(queueResult == false || pos < bufLen); + printf("[WIFI-MAN] response data queued - deleting data memory\r\n"); delete at_data_resp; }