discoverServices method
Future<List<BleService> >
discoverServices({
- Duration? timeout,
- bool withDescriptors = false,
- String? queueId,
- DiscoverServicesPlatformConfig? platformConfig,
Discovers the services offered by the device.
Returns cached services if already discovered after connection.
timeout bounds the call, and on Apple the native discovery too (see
BleShieldNative.discoverServices).
platformConfig: platform-specific options, e.g. Android's clearGattCache.
Implementation
Future<List<BleService>> discoverServices({
Duration? timeout,
bool withDescriptors = false,
String? queueId,
DiscoverServicesPlatformConfig? platformConfig,
}) async {
List<BleService> servicesCache = await BleShieldNative.discoverServices(
deviceId,
withDescriptors: withDescriptors,
timeout: timeout,
queueId: queueId,
platformConfig: platformConfig,
);
CacheHandler.instance.saveServices(
BleShieldNative.canonicalDeviceId(deviceId),
servicesCache,
);
return servicesCache;
}