From 63dc2fd550a92cfe6dc0f219e354d1e2f42cf7a8 Mon Sep 17 00:00:00 2001 From: Saeed Kazemi Date: Fri, 22 Jul 2022 17:01:39 +0200 Subject: [PATCH 1/2] Fix missing GLOBAL_UP callback on successful connect Fix an issue where CellularContext::do_connect_with_retry() does not call NSAPI_STATUS_GLOBAL_UP callback on successful connect after failed try in blocking mode. --- .../cellular/source/framework/device/CellularContext.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/connectivity/cellular/source/framework/device/CellularContext.cpp b/connectivity/cellular/source/framework/device/CellularContext.cpp index 6a2801888a..e8ee733d7f 100644 --- a/connectivity/cellular/source/framework/device/CellularContext.cpp +++ b/connectivity/cellular/source/framework/device/CellularContext.cpp @@ -156,6 +156,7 @@ void CellularContext::do_connect_with_retry() rtos::ThisThread::sleep_for(_retry_timeout_array[_retry_count] * 1s); do_connect(); if (_cb_data.error == NSAPI_ERROR_OK) { + call_network_cb(NSAPI_STATUS_GLOBAL_UP); return; } _retry_count++; From 19fddbf01a8085e7e08ed87740a2a4cac321426a Mon Sep 17 00:00:00 2001 From: Saeed Kazemi Date: Mon, 25 Jul 2022 09:25:36 +0200 Subject: [PATCH 2/2] Fix missing GLOBAL_UP callback on successful connect Fix an issue where CellularContext::do_connect_with_retry() does not call NSAPI_STATUS_GLOBAL_UP callback and validate_ip_address() on successful connect after failed try in blocking mode. --- .../cellular/source/framework/device/CellularContext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connectivity/cellular/source/framework/device/CellularContext.cpp b/connectivity/cellular/source/framework/device/CellularContext.cpp index e8ee733d7f..d72b6b5263 100644 --- a/connectivity/cellular/source/framework/device/CellularContext.cpp +++ b/connectivity/cellular/source/framework/device/CellularContext.cpp @@ -156,7 +156,12 @@ void CellularContext::do_connect_with_retry() rtos::ThisThread::sleep_for(_retry_timeout_array[_retry_count] * 1s); do_connect(); if (_cb_data.error == NSAPI_ERROR_OK) { +#if !NSAPI_PPP_AVAILABLE + if (!_nonip_req && !_cp_in_use) { // don't validate if non-ip case + validate_ip_address(); + } call_network_cb(NSAPI_STATUS_GLOBAL_UP); +#endif return; } _retry_count++;