From c8d3761436577f7d3536dc0ab519c99cf3112f00 Mon Sep 17 00:00:00 2001 From: tony <42725386+tony-fav@users.noreply.github.com> Date: Tue, 29 Mar 2022 23:13:59 -0400 Subject: [PATCH] BLEOp only request response if char supports it --- tasmota/xdrv_79_esp32_ble.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tasmota/xdrv_79_esp32_ble.ino b/tasmota/xdrv_79_esp32_ble.ino index 5efaa973c..196c53d27 100644 --- a/tasmota/xdrv_79_esp32_ble.ino +++ b/tasmota/xdrv_79_esp32_ble.ino @@ -1990,7 +1990,7 @@ static void BLETaskRunCurrentOperation(BLE_ESP32::generic_sensor_t** pCurrentOpe } if (op->writelen){ if(pCharacteristic->canWrite() || pCharacteristic->canWriteNoResponse() ) { - if (!pCharacteristic->writeValue(op->dataToWrite, op->writelen, true)){ + if (!pCharacteristic->writeValue(op->dataToWrite, op->writelen, !pCharacteristic->canWriteNoResponse())){ // request response, unless we can't newstate = GEN_STATE_FAILED_WRITE; #ifdef BLE_ESP32_DEBUG AddLog(LOG_LEVEL_DEBUG,PSTR("BLE: characteristic write fail")); @@ -3720,5 +3720,3 @@ void sendExample(){ #endif #endif // CONFIG_IDF_TARGET_ESP32 or CONFIG_IDF_TARGET_ESP32C3 #endif // ESP32 - -