writeCharacteristicWithoutResponse method

Future<void> writeCharacteristicWithoutResponse(
  1. QualifiedCharacteristic characteristic, {
  2. required List<int> value,
})

Writes a value to the specified characteristic without waiting for an acknowledgement.

Use this method in case the client does not need an acknowledgement that the write was successfully performed. For subsequent write operations it is recommended to execute a writeCharacteristicWithResponse each n times to make sure the BLE device is still responsive.

The returned future completes with an error in case of a failure during writing.

This method assumes there is a single characteristic with the ids specified in characteristic. If there are multiple characteristics with the same id on a device, use resolve to find them all. Or use getDiscoveredServices to select the Services and Characteristics you're interested in.

Implementation

Future<void> writeCharacteristicWithoutResponse(
  QualifiedCharacteristic characteristic, {
  required List<int> value,
}) async {
  await initialize();
  await (await resolveSingle(characteristic)).write(value, withResponse: false);
}