writeWithoutResponse property
Check to see if write without response is available in this characteristic.
Will return false
if the field doesn't exist.
If this is true
then you can use
WebBluetoothRemoteGATTCharacteristic.writeValueWithoutResponse.
Otherwise only
WebBluetoothRemoteGATTCharacteristic.writeValueWithResponse is available.
You will still need to check if these methods are available in the current browser by calling WebBluetoothRemoteGATTCharacteristic.hasWriteValueWithoutResponse and WebBluetoothRemoteGATTCharacteristic.hasWriteValueWithResponse.
Otherwise you're still only able to call ignore: deprecated_member_use_from_same_package WebBluetoothRemoteGATTCharacteristic.writeValue.
See:
-
WebBluetoothRemoteGATTCharacteristic.hasWriteValueWithoutResponse
-
WebBluetoothRemoteGATTCharacteristic.writeValueWithoutResponse
-
WebBluetoothRemoteGATTCharacteristic.hasWriteValueWithResponse
ignore: deprecated_member_use_from_same_package
Implementation
bool get writeWithoutResponse {
if (!hasWriteWithoutResponse) {
return false;
}
final result = _JSUtil.getProperty(_jsObject, "writeWithoutResponse");
if (result is bool) {
return result;
}
return false;
}