connect method
连接 BLE 设备。
参数:
deviceId:设备标识,无默认值。Android 使用 MAC 地址;Linux 使用 BlueZ Address 或 DBus object path;Windows 使用扫描得到的蓝牙地址或 WinRT DeviceId;iOS/macOS 使用扫描得到的 peripheral UUID;Web 使用已通过设备选择器授权的浏览器设备 ID。autoConnect:是否使用 Android 自动连接语义,默认false。iOS/macOS/Linux/Windows/Web 会忽略该参数。 前台主动连接推荐保持false;后台等待设备回连时 Android 可设为true。timeout:连接超时,默认null表示不由插件自动超时。前台连接推荐Duration(seconds: 10)到Duration(seconds: 15);AndroidautoConnect: true语义下连接会立即返回,不建议依赖超时判断最终连接结果。Web 只能连接当前站点已授权设备。
Implementation
Future<void> connect(
String deviceId, {
bool autoConnect = false,
Duration? timeout,
}) {
throw UnimplementedError('connect() has not been implemented.');
}