Skip to content

Commit 1647282

Browse files
authored
Merge pull request #10462 from michalpasztamobica/nanostack_semaphore_release_connecting
Nanostack: release connect_semaphore only when it is pending
2 parents 1b63aad + 2b26a62 commit 1647282

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ nsapi_error_t MeshInterfaceNanostack::initialize(NanostackRfPhy *phy)
120120
void Nanostack::Interface::network_handler(mesh_connection_status_t status)
121121
{
122122
if (_blocking) {
123-
if (status == MESH_CONNECTED || status == MESH_CONNECTED_LOCAL ||
124-
status == MESH_CONNECTED_GLOBAL) {
123+
if (_connect_status == NSAPI_STATUS_CONNECTING
124+
&& (status == MESH_CONNECTED || status == MESH_CONNECTED_LOCAL
125+
|| status == MESH_CONNECTED_GLOBAL)) {
125126
connect_semaphore.release();
126127
} else if (status == MESH_DISCONNECTED) {
127128
disconnect_semaphore.release();

0 commit comments

Comments
 (0)