write property
Check to see if write is available in this characteristic.
Will return false
if the field doesn't exist.
If this is true
then you can use
BluetoothCharacteristic.writeValueWithResponse. Check
writeWithoutResponse if
BluetoothCharacteristic.writeValueWithoutResponse is also 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 write {
if (!hasWrite) {
return false;
}
final result = _JSUtil.getProperty(_jsObject, "write");
if (result is bool) {
return result;
}
return false;
}