@@ -161,6 +161,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
161
161
}
162
162
}
163
163
164
+ bool global_up = false ;
164
165
165
166
if (status == MESH_CONNECTED) {
166
167
uint8_t temp_ipv6_global[16 ];
@@ -171,6 +172,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
171
172
if (arm_net_address_get (interface_id, ADDR_IPV6_GP, temp_ipv6_global) == 0
172
173
&& (memcmp (temp_ipv6_global, temp_ipv6_local, 16 ) != 0 )) {
173
174
_connect_status = NSAPI_STATUS_GLOBAL_UP;
175
+ global_up = true ;
174
176
}
175
177
} else if (status == MESH_CONNECTED_LOCAL) {
176
178
_connect_status = NSAPI_STATUS_LOCAL_UP;
@@ -182,9 +184,9 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
182
184
_connect_status = NSAPI_STATUS_DISCONNECTED;
183
185
}
184
186
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)) )) {
188
190
_connection_status_cb (NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connect_status);
189
191
}
190
192
_previous_connection_status = _connect_status;
0 commit comments