Skip to content

Commit

Permalink
Correct thread status callback functionality.
Browse files Browse the repository at this point in the history
At the start-up, there was 2 NSAPI_STATUS_CONNECTING callbacks,
so extra one removed from ThreadInterface.cpp.
At the network lost case, there was NSAPI_STATUS_DISCONNECTED and
NSAPI_STATUS_LOCAL_UP callbacks. NSAPI_STATUS_DISCONNECTED has been removed,
since the NSAPI_STATUS_LOCAL_UP is enought.
  • Loading branch information
KariHaapalehto committed Mar 12, 2019
1 parent 63242cf commit d944836
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions features/nanostack/mbed-mesh-api/source/ThreadInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ nsapi_error_t Nanostack::ThreadInterface::bringup(bool dhcp, const char *ip,
// -end devices will get connectivity once attached to existing network
// -devices without network settings gets connectivity once commissioned and attached to network
_connect_status = NSAPI_STATUS_CONNECTING;
if (_connection_status_cb) {
_connection_status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, NSAPI_STATUS_CONNECTING);
}
if (_blocking) {
int32_t count = connect_semaphore.wait(osWaitForever);

Expand Down
5 changes: 1 addition & 4 deletions features/nanostack/mbed-mesh-api/source/thread_tasklet.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@ void thread_tasklet_poll_network_status(void *param)
}
}
} else {
if (thread_tasklet_data_ptr->connection_status != MESH_DISCONNECTED &&
thread_tasklet_data_ptr->connection_status != MESH_BOOTSTRAP_STARTED) {
thread_tasklet_network_state_changed(MESH_DISCONNECTED);
}
thread_tasklet_data_ptr->connection_status = MESH_DISCONNECTED;
}
}

Expand Down

0 comments on commit d944836

Please sign in to comment.