write method

Future<void> write(
  1. List<int> value, {
  2. bool withResponse = true,
  3. Duration? timeout,
})

Writes a value to the characteristic.

value is the list of bytes to write. withResponse indicates whether the write should be performed with a response from the device. Default is true, meaning the device will acknowledge the write operation. If set to false, the write operation will be performed without waiting for a response.

Implementation

Future<void> write(
  List<int> value, {
  bool withResponse = true,
  Duration? timeout,
}) async {
  await UniversalBle.write(
    _deviceId,
    _serviceId,
    uuid,
    Uint8List.fromList(value),
    withoutResponse: !withResponse,
    timeout: timeout,
  );
}