diff --git a/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp b/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp index 015828265b..b33b83f84e 100644 --- a/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp +++ b/features/nanostack/mbed-mesh-api/source/MeshInterfaceNanostack.cpp @@ -161,6 +161,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status) } } + bool global_up = false; if (status == MESH_CONNECTED) { uint8_t temp_ipv6_global[16]; @@ -171,6 +172,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status) if (arm_net_address_get(interface_id, ADDR_IPV6_GP, temp_ipv6_global) == 0 && (memcmp(temp_ipv6_global, temp_ipv6_local, 16) != 0)) { _connect_status = NSAPI_STATUS_GLOBAL_UP; + global_up = true; } } else if (status == MESH_CONNECTED_LOCAL) { _connect_status = NSAPI_STATUS_LOCAL_UP; @@ -182,9 +184,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 - && (_previous_connection_status != NSAPI_STATUS_GLOBAL_UP || status != MESH_BOOTSTRAP_STARTED) - && (_previous_connection_status != NSAPI_STATUS_CONNECTING || status != MESH_BOOTSTRAP_START_FAILED)) { + if (_connection_status_cb && (global_up || (_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; diff --git a/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c b/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c index 593b9eefe7..304b05c38f 100644 --- a/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c +++ b/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c @@ -176,11 +176,9 @@ static void wisun_tasklet_parse_network_event(arm_event_s *event) switch (status) { case ARM_NWK_BOOTSTRAP_READY: /* Network is ready and node is connected to Access Point */ - if (wisun_tasklet_data_ptr->tasklet_state != TASKLET_STATE_BOOTSTRAP_READY) { - tr_info("Wi-SUN bootstrap ready"); - wisun_tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_READY; - wisun_tasklet_network_state_changed(MESH_CONNECTED); - } + tr_info("Wi-SUN bootstrap ready"); + wisun_tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_READY; + wisun_tasklet_network_state_changed(MESH_CONNECTED); break; case ARM_NWK_NWK_SCAN_FAIL: /* Link Layer Active Scan Fail, Stack is Already at Idle state */