gpt4 book ai didi

ios - CoreBluetooth `retrieveConnectedPeripheralsWithServices` 返回断开连接的外围设备

转载 作者:行者123 更新时间:2023-11-29 00:50:08 24 4
gpt4 key购买 nike

我想知道CBManagerretrieveConnectedPeripheralsWithServices的语义。每次我使用它时,我都会得到状态为 CBPeripheralStateDisconnectedCBPeripheral 实例。

再次连接不是问题,但是这个方法不是应该返回已连接外围设备吗?

最佳答案

不幸的是,这是有意的行为。我不得不承认这有点违反直觉,但外围设备状态始终与您的应用程序相关。这意味着,如果您使用其他应用程序或通过蓝牙系统设置连接/配对/绑定(bind)了外围设备,它仍然会在您的应用程序中显示为已断开连接。如果您在应用程序中连接了一些外围设备,它们将显示为已连接。

关于ios - CoreBluetooth `retrieveConnectedPeripheralsWithServices` 返回断开连接的外围设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38218353/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com