将BLE外围设备连接到在单个iPhone上运行的多个应用

时间:2017-09-04 15:12:13

标签: ios core-bluetooth

我已将BLE外设连接到在后台运行的应用程序。

在另一个应用程序中,我调用retrieveConnectedPeripherals(withServices:)来检索已连接外围设备的列表。

然后我按documentation的“讨论”部分所述致电connect(\_:options:),但永远不会调用centralManager(\_:didConnect:)

我保留了CBPeripheral对象。

1 个答案:

答案 0 :(得分:0)

根据https://developer.apple.com/documentation/corebluetooth/cbcentralmanager/1518924-retrieveconnectedperipheralshttps://developer.apple.com/documentation/corebluetooth/cbcentralmanager/1518766-connect链接的讨论。 " centralManager(:didFailToConnect:错误:)"调用而不是" centralManager(:didConnect :)"如果BLE外设已连接其他App。