writeCharacteristic method

Future<Characteristic> writeCharacteristic(
  1. String serviceUuid,
  2. String characteristicUuid,
  3. Uint8List value,
  4. bool withResponse, {
  5. String? transactionId,
})

Writes value of Characteristic matching specified UUIDs.

Writes value to characteristic with characteristicUuid for service with serviceUuid. Optional transactionId could be used to cancel operation.

Will result in error if discovery was not done during this connection.

Implementation

Future<Characteristic> writeCharacteristic(
  String serviceUuid,
  String characteristicUuid,
  Uint8List value,
  bool withResponse, {
  String? transactionId,
}) =>
    _manager.writeCharacteristicForDevice(
      this,
      serviceUuid,
      characteristicUuid,
      value,
      withResponse,
      transactionId ?? TransactionIdGenerator.getNextId(),
    );