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
This commit is contained in:
DigiH authored and GitHub committed 2021-07-26 19:40:37 -05:00
1 parent 91497da71c
commit 2d82cacd05
1 file changed
+1 -1
+1 -1
View File
@@ -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();