re-add support for NO_RESPONSE write characteristic
parent
fe11e6d306
commit
fd5a620091
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue