Skip to content

Commit

Permalink
ESP32 - Make sure that BLE indications are sent sequentially (#22446)
Browse files Browse the repository at this point in the history
The next indication is sent only after the previous one is acked
  • Loading branch information
dhrishi authored and pull[bot] committed Oct 18, 2023
1 parent 1a05328 commit 5510017
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5510017

Please sign in to comment.