Skip to content

Commit 2d82cac

Browse files
authored
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
1 parent 91497da commit 2d82cac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main/ZgatewayBLEConnect.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ NimBLERemoteCharacteristic* zBLEConnect::getCharacteristic(const NimBLEUUID& ser
3636

3737
bool zBLEConnect::writeData(BLEAction* action) {
3838
NimBLERemoteCharacteristic* pChar = getCharacteristic(action->service, action->characteristic);
39-
if (pChar && pChar->canWrite()) {
39+
if (pChar && (pChar->canWrite() || pChar->canWriteNoResponse())) {
4040
switch (action->value_type) {
4141
case BLE_VAL_HEX: {
4242
int len = action->value.length();

0 commit comments

Comments
 (0)