this is using the mbed os version 5-13-1

Dependencies:   mbed-http

Files at this revision

API Documentation at this revision

Comitter:
ocomeni
Date:
Thu Jun 20 20:46:25 2019 +0000
Branch:
PassingRegression
Parent:
124:eae4512b131b
Child:
126:9bc33f8b57d5
Commit message:
currently failing

Changed in this revision

source/ATCmdManager.cpp Show annotated file Show diff for this revision Revisions of this file
source/WiFiManager.cpp Show annotated file Show diff for this revision Revisions of this file
source/common_config.h Show annotated file Show diff for this revision Revisions of this file
source/main-https.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/ATCmdManager.cpp	Sat Jun 15 15:52:26 2019 +0000
+++ b/source/ATCmdManager.cpp	Thu Jun 20 20:46:25 2019 +0000
@@ -1228,7 +1228,7 @@
 void ATCmdManager::_oob_getNetworkStatus()
 {
     int if_id; // interface id for request
-    _parser.scanf(",%d", &if_id);
+    _parser.scanf("%d", &if_id);
     dbg_printf(LOG, "\n Received Get Network Status command!!\n");
     if(if_id == WIFI_INTERFACE_ID){
         wifi_cmd_t cmd = WIFI_CMD_NETWORK_STATUS;
--- a/source/WiFiManager.cpp	Sat Jun 15 15:52:26 2019 +0000
+++ b/source/WiFiManager.cpp	Thu Jun 20 20:46:25 2019 +0000
@@ -276,7 +276,6 @@
                 while(secCount++ < WIFI_CONNECT_TIMEOUT_SECS && is_connected==false){
                     wait(1); // wait 1 sec
                 }
-                wifiCmd = WIFI_CMD_NONE;
                 if(is_connected==false){
                     if(outputBuffersAvailable() == false) // first free it
                     {
@@ -291,6 +290,7 @@
                 else {
                     sendATresponseString(AT_CONNECT_RESP);
                 }
+                wifiCmd = WIFI_CMD_NONE;
                 wifiBusy = 0;
                 break;
             }
@@ -303,7 +303,6 @@
                 }
                 wifiBusy = 1;
                 error = disconnect();
-                wifiCmd = WIFI_CMD_NONE;
                 if(error >= 0)
                 {
                     int secCount = 0;
@@ -325,9 +324,11 @@
                     // attempt reconnection if always connected scheme is set
                     if(internet_config->connectionScheme == ALWAYS_CONNECTED)
                     {
+                        wifiCmd = WIFI_CMD_NONE;
                         setNextCommand(WIFI_CMD_CONNECT);
                     }
                 }
+                wifiCmd = WIFI_CMD_NONE;
                 wifiBusy = 0;
                 break;
             }
@@ -348,7 +349,7 @@
                 callback_semaphore.wait();
 #endif
                 int msecCount = 0;
-                while(!backgroundTaskCompleted && msecCount < 1000)
+                while(!backgroundTaskCompleted && msecCount < 2000)
                 {
                     msecCount++;
                     wait_ms(10);
@@ -1007,13 +1008,19 @@
         int i = 0;
         responseBytes[i++] = IPv4_CONNECTION; // connect type IPv4
         responseBytes[i++] = TCP_PROTOCOL; // Protocol = TCP
+        dbg_printf(LOG, "Buffer available \r\n");
         if(is_connected && result>=0)
         {
             memcpy(&responseBytes[i], address->get_ip_bytes(), 4); // remote IPv4 address
+            dbg_printf(LOG, "IP Address OK \r\n");
             strcpy(internet_config->remote_IPv4Address, address->get_ip_address());
+            dbg_printf(LOG, "Remote IP address OK \r\n");
             i +=4;
             uint16_t port = address->get_port();
+            delete address;
+            dbg_printf(LOG, "Port OK \r\n");
             internet_config->remote_port = port;
+            dbg_printf(LOG, "Remote port OK \r\n");
             memcpy(&responseBytes[i], &port, 2); // remote IPv4 port #
             i +=2;
             // local IPv4 address
@@ -1029,6 +1036,7 @@
             responseBytes[i++] = 0;
             responseBytes[i]   = 0;
             printBufferInHex(responseBytes, HOSTNAME_RESPONSE_LEN);
+            dbg_printf(LOG, "About to send response bytes... \r\n");
             sendATresponseBytes(CONNECT_EVENT, HOSTNAME_RESPONSE_LEN);
         }
         else
--- a/source/common_config.h	Sat Jun 15 15:52:26 2019 +0000
+++ b/source/common_config.h	Thu Jun 20 20:46:25 2019 +0000
@@ -12,7 +12,7 @@
 #define UBLOX_ODIN_W2_RECV_TIMEOUT    5
 #endif
 #define USE_MALLOC_FOR_COMMAND_MEMORY_POOL
-#define WIFI_CONNECT_TIMEOUT_SECS 30
+#define WIFI_CONNECT_TIMEOUT_SECS 120
 #define MAIN_LOOP_WAIT_TIME_MS 100 // milliseconds
 #define WIFI_MAIN_LOOP_WAIT_TIME_MS 101 // milliseconds
 #define MAX_RESPONSE_STRING_LEN   512 // maximum response string length of 512 bytes
--- a/source/main-https.cpp	Sat Jun 15 15:52:26 2019 +0000
+++ b/source/main-https.cpp	Thu Jun 20 20:46:25 2019 +0000
@@ -117,7 +117,7 @@
 Semaphore sync_sema;
 
 Thread atcmd_evt_thread(osPriorityNormal, 1024);
-Thread wifi_evt_thread;
+Thread wifi_evt_thread; //(osPriorityNormal, 6*1024);
 #include "network-helper.h"
 
 /* List of trusted root CA certificates