1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-31 02:54:29 +02:00

re-add support for NO_RESPONSE write characteristic

This commit is contained in:
Daniele Gobbetti 2015-08-10 09:20:06 +02:00
parent fe11e6d306
commit fd5a620091

View File

@ -23,7 +23,8 @@ public class WriteAction extends BtLEAction {
@Override
public boolean run(BluetoothGatt gatt) {
int properties = getCharacteristic().getProperties();
if ((properties & BluetoothGattCharacteristic.PROPERTY_WRITE) > 0) {
//TODO: expectsResult should return false if PROPERTY_WRITE_NO_RESPONSE is true, but this yelds to timing issues
if ((properties & BluetoothGattCharacteristic.PROPERTY_WRITE) > 0 || ((properties & BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE) > 0)) {
if (getCharacteristic().setValue(value)) {
return gatt.writeCharacteristic(getCharacteristic());
}