mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
re-add support for NO_RESPONSE write characteristic
This commit is contained in:
@@ -23,7 +23,8 @@ public class WriteAction extends BtLEAction {
|
|||||||
@Override
|
@Override
|
||||||
public boolean run(BluetoothGatt gatt) {
|
public boolean run(BluetoothGatt gatt) {
|
||||||
int properties = getCharacteristic().getProperties();
|
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)) {
|
if (getCharacteristic().setValue(value)) {
|
||||||
return gatt.writeCharacteristic(getCharacteristic());
|
return gatt.writeCharacteristic(getCharacteristic());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user