Skip to content

Commit 77f3f5e

Browse files
authored
Merge pull request #13714 from mikaleppanen/mesh_global_up_master
nanostack: mesh interface global up is indicated always on bootstrap
2 parents 00402b7 + 4bf2c3a commit 77f3f5e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
129129
}
130130
}
131131

132+
bool global_up = false;
132133

133134
if (status == MESH_CONNECTED) {
134135
uint8_t temp_ipv6_global[16];
@@ -139,6 +140,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
139140
if (arm_net_address_get(interface_id, ADDR_IPV6_GP, temp_ipv6_global) == 0
140141
&& (memcmp(temp_ipv6_global, temp_ipv6_local, 16) != 0)) {
141142
_connect_status = NSAPI_STATUS_GLOBAL_UP;
143+
global_up = true;
142144
}
143145
} else if (status == MESH_CONNECTED_LOCAL) {
144146
_connect_status = NSAPI_STATUS_LOCAL_UP;
@@ -150,9 +152,9 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
150152
_connect_status = NSAPI_STATUS_DISCONNECTED;
151153
}
152154

153-
if (_connection_status_cb && _previous_connection_status != _connect_status
154-
&& (_previous_connection_status != NSAPI_STATUS_GLOBAL_UP || status != MESH_BOOTSTRAP_STARTED)
155-
&& (_previous_connection_status != NSAPI_STATUS_CONNECTING || status != MESH_BOOTSTRAP_START_FAILED)) {
155+
if (_connection_status_cb && (global_up || (_previous_connection_status != _connect_status
156+
&& (_previous_connection_status != NSAPI_STATUS_GLOBAL_UP || status != MESH_BOOTSTRAP_STARTED)
157+
&& (_previous_connection_status != NSAPI_STATUS_CONNECTING || status != MESH_BOOTSTRAP_START_FAILED)))) {
156158
_connection_status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connect_status);
157159
}
158160
_previous_connection_status = _connect_status;

connectivity/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)