getCharacteristic method

Future<WebBluetoothRemoteGATTCharacteristic> getCharacteristic(
  1. String characteristicUUID
)

Get a characteristic from this service.

characteristicUUID is the UUID (lower case) of the characteristic to get.

  • May throw SecurityError if the characteristic's UUID is on a blocklist.

  • May throw NetworkError if the GATT server is not connected.

  • May throw InvalidStateError if service is null.

  • May throw NotFoundError if the characteristic was not found.

See:

Implementation

Future<WebBluetoothRemoteGATTCharacteristic> getCharacteristic(
    final String characteristicUUID) async {
  final promise = _JSUtil.callMethod(
      _jsObject, "getCharacteristic", [characteristicUUID.toLowerCase()]);
  final result = await _JSUtil.promiseToFuture(promise);
  return WebBluetoothRemoteGATTCharacteristic.fromJSObject(result, this);
}