[BLE Client] Fix deadlock if connection loss ... (#7319)

... while readValue
This commit is contained in:
Rotzbua 2022-11-02 12:07:47 +01:00 committed by GitHub
parent c8da793c95
commit 4ac71d2a7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -247,6 +247,8 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event,
break; break;
case ESP_GATTC_DISCONNECT_EVT: case ESP_GATTC_DISCONNECT_EVT:
// Cleanup semaphores to avoid deadlocks.
m_semaphoreReadCharEvt.give(1);
m_semaphoreWriteCharEvt.give(1); m_semaphoreWriteCharEvt.give(1);
break; break;