getConnectedDevices method
获取当前已连接设备列表。
参数:
serviceUuids:服务 UUID 过滤列表,默认const <String>[]。iOS/macOS 可用它查询 系统已连接且包含指定服务的外设;Android 当前忽略该参数并返回已连接 GATT 设备; Linux 返回 BlueZ 已连接设备并可按 UUID 过滤;Windows 返回本插件已知的已连接 BLE 设备并可按服务过滤; Web 仅能过滤当前站点已授权且已连接的设备。
推荐:需要兼容 iOS/macOS 或 Web 时传入目标服务 UUID;只关心本插件已连接设备时可使用默认值。
Implementation
Future<List<BluetoothDevice>> getConnectedDevices({
List<String> serviceUuids = const <String>[],
}) {
throw UnimplementedError('getConnectedDevices() has not been implemented.');
}