Merge pull request #10434 from michalpasztamobica/nanostack_network_handler_fix

Nanostack network handle does not always call status cb for BOOTSTRAP events
pull/10503/head
Anna Bridge 2019-04-26 13:33:46 +01:00 committed by GitHub
commit 016ce322b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -149,8 +149,9 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
_connect_status = NSAPI_STATUS_DISCONNECTED;
}
if (_connection_status_cb && _previous_connection_status != _connect_status) {
if (_connection_status_cb && _previous_connection_status != _connect_status
&& (_previous_connection_status != NSAPI_STATUS_GLOBAL_UP || status != MESH_BOOTSTRAP_STARTED)
&& (_previous_connection_status != NSAPI_STATUS_CONNECTING || status != MESH_BOOTSTRAP_START_FAILED)) {
_connection_status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connect_status);
}
_previous_connection_status = _connect_status;