Skip to content

Commit 99661bd

Browse files
authored
Merge pull request #13715 from mikaleppanen/mesh_global_up_5.15
mbed-os-5.15: Mesh interface global up is indicated always on bootstrap ready
2 parents abf8a03 + 26a9079 commit 99661bd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
161161
}
162162
}
163163

164+
bool global_up = false;
164165

165166
if (status == MESH_CONNECTED) {
166167
uint8_t temp_ipv6_global[16];
@@ -171,6 +172,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
171172
if (arm_net_address_get(interface_id, ADDR_IPV6_GP, temp_ipv6_global) == 0
172173
&& (memcmp(temp_ipv6_global, temp_ipv6_local, 16) != 0)) {
173174
_connect_status = NSAPI_STATUS_GLOBAL_UP;
175+
global_up = true;
174176
}
175177
} else if (status == MESH_CONNECTED_LOCAL) {
176178
_connect_status = NSAPI_STATUS_LOCAL_UP;
@@ -182,9 +184,9 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
182184
_connect_status = NSAPI_STATUS_DISCONNECTED;
183185
}
184186

185-
if (_connection_status_cb && _previous_connection_status != _connect_status
186-
&& (_previous_connection_status != NSAPI_STATUS_GLOBAL_UP || status != MESH_BOOTSTRAP_STARTED)
187-
&& (_previous_connection_status != NSAPI_STATUS_CONNECTING || status != MESH_BOOTSTRAP_START_FAILED)) {
187+
if (_connection_status_cb && (global_up || (_previous_connection_status != _connect_status
188+
&& (_previous_connection_status != NSAPI_STATUS_GLOBAL_UP || status != MESH_BOOTSTRAP_STARTED)
189+
&& (_previous_connection_status != NSAPI_STATUS_CONNECTING || status != MESH_BOOTSTRAP_START_FAILED)))) {
188190
_connection_status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connect_status);
189191
}
190192
_previous_connection_status = _connect_status;

features/nanostack/mbed-mesh-api/source/wisun_tasklet.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,9 @@ static void wisun_tasklet_parse_network_event(arm_event_s *event)
176176
switch (status) {
177177
case ARM_NWK_BOOTSTRAP_READY:
178178
/* Network is ready and node is connected to Access Point */
179-
if (wisun_tasklet_data_ptr->tasklet_state != TASKLET_STATE_BOOTSTRAP_READY) {
180-
tr_info("Wi-SUN bootstrap ready");
181-
wisun_tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_READY;
182-
wisun_tasklet_network_state_changed(MESH_CONNECTED);
183-
}
179+
tr_info("Wi-SUN bootstrap ready");
180+
wisun_tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_READY;
181+
wisun_tasklet_network_state_changed(MESH_CONNECTED);
184182
break;
185183
case ARM_NWK_NWK_SCAN_FAIL:
186184
/* Link Layer Active Scan Fail, Stack is Already at Idle state */

0 commit comments

Comments
 (0)