@@ -129,6 +129,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
129
129
}
130
130
}
131
131
132
+ bool global_up = false ;
132
133
133
134
if (status == MESH_CONNECTED) {
134
135
uint8_t temp_ipv6_global[16 ];
@@ -139,6 +140,7 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
139
140
if (arm_net_address_get (interface_id, ADDR_IPV6_GP, temp_ipv6_global) == 0
140
141
&& (memcmp (temp_ipv6_global, temp_ipv6_local, 16 ) != 0 )) {
141
142
_connect_status = NSAPI_STATUS_GLOBAL_UP;
143
+ global_up = true ;
142
144
}
143
145
} else if (status == MESH_CONNECTED_LOCAL) {
144
146
_connect_status = NSAPI_STATUS_LOCAL_UP;
@@ -150,9 +152,9 @@ void Nanostack::Interface::network_handler(mesh_connection_status_t status)
150
152
_connect_status = NSAPI_STATUS_DISCONNECTED;
151
153
}
152
154
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)) )) {
156
158
_connection_status_cb (NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connect_status);
157
159
}
158
160
_previous_connection_status = _connect_status;
0 commit comments