writeValueWithoutResponse method

Future<void> writeValueWithoutResponse(
  1. Uint8List value
)

Will write a new value to the characteristic.

This will not update the WebBluetoothRemoteGATTCharacteristic.value property.

Write a value without waiting for the response of the device before continuing.

This method may not be implemented in the current browser version. Check this by calling hasWriteValueWithoutResponse. ignore: deprecated_member_use_from_same_package Otherwise use writeValue.

  • May throw NativeAPINotImplementedError if the method does not exist.

  • May throw NotSupportedError if the operation is not allowed. Check properties to see if it is supported.

  • May throw SecurityError if the characteristic is blocked form writing using a blocklist.

  • May throw NetworkError if the GATT server is not connected.

  • May throw InvalidStateError if characteristic is null

See:

ignore: deprecated_member_use_from_same_package

Implementation

Future<void> writeValueWithoutResponse(final Uint8List value) async {
  if (!hasWriteValueWithoutResponse()) {
    throw NativeAPINotImplementedError("writeValueWithoutResponse");
  }
  final data = WebBluetoothConverters.convertUint8ListToJSArrayBuffer(value);
  final promise =
      _JSUtil.callMethod(_jsObject, "writeValueWithoutResponse", [data]);
  await _JSUtil.promiseToFuture(promise);
}