Skip to content

Commit 016ce32

Browse files
authored
Merge pull request #10434 from michalpasztamobica/nanostack_network_handler_fix
Nanostack network handle does not always call status cb for BOOTSTRAP events
2 parents a5f1a12 + 8d1edc7 commit 016ce32

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
149149
_connect_status = NSAPI_STATUS_DISCONNECTED;
150150
}
151151

152-
if (_connection_status_cb && _previous_connection_status != _connect_status) {
153-
152+
if (_connection_status_cb && _previous_connection_status != _connect_status
153+
&& (_previous_connection_status != NSAPI_STATUS_GLOBAL_UP || status != MESH_BOOTSTRAP_STARTED)
154+
&& (_previous_connection_status != NSAPI_STATUS_CONNECTING || status != MESH_BOOTSTRAP_START_FAILED)) {
154155
_connection_status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connect_status);
155156
}
156157
_previous_connection_status = _connect_status;

0 commit comments

Comments
 (0)