What, exactly, is a BLE connected device on iOS?

我是研究僧i 提交于 2019-12-04 03:03:51

问题


The CBCentralManager retrieveConnectedPeripherals method says it gets "the list of the peripherals currently connected to the system." The definition of system is a bit ambiguous here.

Does this mean I get a list of peripherals connected to my app, or a list of peripherals connected to any app?

If I can get peripherals connected to another app, does this also mean multiple apps can connect to the same peripheral?

Can this only happen if the app is in the foreground, or do I need to allow for the possibility that a background app is sending commands to a peripheral I think my app owns?


回答1:


BLE 4.0 enabled devices are usually connected with CBCentralManager unboundly. What is bounded and unbounded connection, you can know from this link. One BLE 4.0 enabled device can be connected with only one master device thus enhancing secured connectivity. You should follow this link. Whether in foreground of background, if the connection exists, the BLE slave device won't get connected with another app or device.



来源:https://stackoverflow.com/questions/11852662/what-exactly-is-a-ble-connected-device-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!