readCharacteristic method

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

Reads value of Characteristic matching specified UUIDs.

Returns value of 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<CharacteristicWithValue> readCharacteristic(
  String serviceUuid,
  String characteristicUuid, {
  String? transactionId,
}) =>
    _manager.readCharacteristicForDevice(
      this,
      serviceUuid,
      characteristicUuid,
      transactionId ?? TransactionIdGenerator.getNextId(),
    );