getIncludedService method

Future<WebBluetoothRemoteGATTService> getIncludedService(
  1. String serviceUUID
)

Get an included service from this service.

This function doesn't exist if the current service has no included services. Check hasGetIncludedServiceFunction to make sure.

serviceUUID is the UUID (lower case) of the service to get.

  • May throw NativeAPINotImplementedError if the function does not exist.

  • May throw SecurityError if the service'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 service was not found.

See:

ignore: deprecated_member_use_from_same_package

Implementation

Future<WebBluetoothRemoteGATTService> getIncludedService(
    final String serviceUUID) async {
  if (!hasGetIncludedServiceFunction()) {
    throw NativeAPINotImplementedError("getIncludedService");
  }
  final promise = _JSUtil.callMethod(
      _jsObject, "getIncludedService", [serviceUUID.toLowerCase()]);
  final result = await _JSUtil.promiseToFuture(promise);
  return WebBluetoothRemoteGATTService.fromJSObject(result, device);
}