Skip to content

Commit 7287775

Browse files
michalpasztamobicaadbridge
authored andcommitted
Nanostack network handle does not always call status cb for BOOTSTRAP events
UBLOX_EVK_ODIN_W2 advertises more events than we expect. 1) When disconnecting first network connectivity is lost and then an actual disconnection event arrives. The first one is unexpected. 2) When reconnecting MESH_BOOTSTRAP_START_FAILED shows up, but the board eventually manages to connect
1 parent 0328ffd commit 7287775

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)