From 2d82cacd059911d7217c471fb7472228653e20ba Mon Sep 17 00:00:00 2001 From: DigiH Date: Tue, 27 Jul 2021 02:40:37 +0200 Subject: [PATCH] Suggestion to also allow BLE WRITE procedures for characteristics which are only WriteWithoutResponse (#1037) While playing with the new BLE READ/WRITE feature for my Playbulb Candles I found that writing was not possible for characteristics which are WriteWithoutResponse only. I implemented this quick fix which might be useful for others with devices for which they want to write to WriteWithoutResponse characteristics. Alternatively a more slective option could be possible for a future release, i.e. adding an additional WRITE tag like "ble_write_withoutresponse": true/false --- main/ZgatewayBLEConnect.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/ZgatewayBLEConnect.ino b/main/ZgatewayBLEConnect.ino index fc8ecad..1661042 100644 --- a/main/ZgatewayBLEConnect.ino +++ b/main/ZgatewayBLEConnect.ino @@ -36,7 +36,7 @@ NimBLERemoteCharacteristic* zBLEConnect::getCharacteristic(const NimBLEUUID& ser bool zBLEConnect::writeData(BLEAction* action) { NimBLERemoteCharacteristic* pChar = getCharacteristic(action->service, action->characteristic); - if (pChar && pChar->canWrite()) { + if (pChar && (pChar->canWrite() || pChar->canWriteNoResponse())) { switch (action->value_type) { case BLE_VAL_HEX: { int len = action->value.length();