From 5510017d23370a5547c77d1a13bb4b4325e7d9e5 Mon Sep 17 00:00:00 2001 From: Hrishikesh Dhayagude Date: Wed, 7 Sep 2022 21:57:05 +0530 Subject: [PATCH] ESP32 - Make sure that BLE indications are sent sequentially (#22446) The next indication is sent only after the previous one is acked --- src/platform/ESP32/nimble/BLEManagerImpl.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index b4459196fd9baa..fe3c707685b1ca 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -833,7 +833,7 @@ CHIP_ERROR BLEManagerImpl::HandleTXComplete(struct ble_gap_event * gapEvent) gapEvent->notify_tx.conn_handle, gapEvent->notify_tx.status); // Signal the BLE Layer that the outstanding indication is complete. - if (gapEvent->notify_tx.status == 0 || gapEvent->notify_tx.status == BLE_HS_EDONE) + if (gapEvent->notify_tx.status == BLE_HS_EDONE) { // Post an event to the Chip queue to process the indicate confirmation. ChipDeviceEvent event; @@ -1012,8 +1012,11 @@ int BLEManagerImpl::ble_svr_gap_event(struct ble_gap_event * event, void * arg) break; case BLE_GAP_EVENT_NOTIFY_TX: - err = sInstance.HandleTXComplete(event); - SuccessOrExit(err); + if (event->notify_tx.status != 0) + { + err = sInstance.HandleTXComplete(event); + SuccessOrExit(err); + } break; case BLE_GAP_EVENT_MTU: