From e16c8d5e73d6229d26ca74be6ac04e6f94e8f2ff Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 11 Sep 2023 13:01:39 +0800 Subject: [PATCH] Fix esp32 platform bluedroid, should send indication instead of notification. (#28923) * Fix esp32 platform bluedroid implementation, should send indication instead of notification * Add comments * Restyled by clang-format --------- Co-authored-by: Ryan Ma --- src/platform/ESP32/bluedroid/BLEManagerImpl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp index ef9cbece6f5fd4..b18ca5d9e7b997 100644 --- a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp +++ b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp @@ -852,7 +852,9 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU ChipLogDetail(Ble, "Sending indication for CHIPoBLE TX characteristic (con %u, len %u)", conId, data->DataLength()); #endif - err = MapBLEError(esp_ble_gatts_send_indicate(mAppIf, conId, mTXCharAttrHandle, data->DataLength(), data->Start(), false)); + // Set param need_confirm as false will send notification, otherwise indication. + err = MapBLEError( + esp_ble_gatts_send_indicate(mAppIf, conId, mTXCharAttrHandle, data->DataLength(), data->Start(), true /* need_confirm */)); if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "esp_ble_gatts_send_indicate() failed: %s", ErrorStr(err));