write method

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

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,
  String? queueId,
}) async {
  await BleShieldNative.write(
    _metaData.deviceId,
    _metaData.serviceId,
    uuid,
    Uint8List.fromList(value),
    withoutResponse: !withResponse,
    timeout: timeout,
    queueId: queueId,
  );
}