[英]Bluetooth connected device
I am wondering if there is any way to check if the device we want to connect to is already connected to the phone.我想知道是否有任何方法可以检查我们要连接的设备是否已经连接到手机。 In my case, the device pairs itself to the phone, and connects automatically.在我的例子中,设备将自己与手机配对,并自动连接。
I have not found a way yet to check if the device is already connected before scanning.我还没有找到在扫描之前检查设备是否已经连接的方法。
I expect something like this:我期待这样的事情:
I may be wrong, but every external library like flutter_reactive_ble or flutter_blue_plus has a flow like:我可能是错的,但是像 flutter_reactive_ble 或 flutter_blue_plus 这样的每个外部库都有这样的流程:
In my application I just want to know if a device with a certain mac address is connected to the phone the app is running on.在我的应用程序中,我只想知道具有特定 mac 地址的设备是否已连接到运行该应用程序的手机。
According to this Github issue , you can use FlutterBluePlus.instance.connectedDevices
to see a list of all devices connected since FlutterBluePlus was initialized.根据这个 Github 问题,您可以使用FlutterBluePlus.instance.connectedDevices
查看自 FlutterBluePlus 初始化以来连接的所有设备的列表。 That would allow you to check the list for a specific device.这将允许您检查特定设备的列表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.