readCharacteristic method

Future<CharacteristicWithValue> readCharacteristic(
  1. String characteristicUuid, {
  2. String? transactionId,
})

Reads the value of a Characteristic identified by characteristicUuid.

It returns a Future that completes with CharacteristicWithValue, which is just a Characteristic but with an additonal value property of type Uint8List. Only Characteristic where Characteristic.isReadable is true can be read.

Implementation

Future<CharacteristicWithValue> readCharacteristic(
  String characteristicUuid, {
  String? transactionId,
}) =>
    _manager.readCharacteristicForService(
      peripheral,
      this,
      characteristicUuid,
      transactionId ?? TransactionIdGenerator.getNextId(),
    );