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.
pull/15311/head
Saeed Kazemi 2022-07-25 09:25:36 +02:00 committed by GitHub
parent 63dc2fd550
commit 19fddbf01a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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++;