[英]Can an iOS app that is acting as a BLE peripheral running in the background be woken up by a connection request from a BLE central?
I have an iOS application that is acting as a BLE peripheral. 我有一个充当BLE外围设备的iOS应用程序。 It is advertising at all times.
它一直在做广告。 I have a Raspberry Pi that is acting as a BLE central.
我有一个充当BLE中心的Raspberry Pi。 It is scanning at all times.
它一直在扫描。 If the iOS app goes into the background and is suspended, and if the iOS app has the UIBackgroundModes key set to bluetooth-peripheral, will the app be woken up by a connection request from the central?
如果iOS应用程序进入后台并被挂起,并且iOS应用程序的UIBackgroundModes密钥设置为Bluetooth-peripheral,该应用程序是否会被来自中央的连接请求唤醒? Assume that the central and the peripheral have never connected before.
假设中央和外围设备以前从未连接过。 Thank you!
谢谢!
You can advertise a peripheral in the background, but there are some limitations, which are described in the Core Bluetooth Programming Guide 您可以在后台播报外围设备,但是有一些限制,请参见《 Core Bluetooth编程指南》中的描述。
- The
CBAdvertisementDataLocalNameKey
advertisement key is ignored, and the local name of peripheral is not advertised.CBAdvertisementDataLocalNameKey
广告密钥将被忽略,并且外围设备的本地名称不会被广告。- All service UUIDs contained in the value of the CBAdvertisementDataServiceUUIDsKey advertisement key are placed in a special “overflow” area;
CBAdvertisementDataServiceUUIDsKey广告密钥的值中包含的所有服务UUID都放置在特殊的“溢出”区域中。 they can be discovered only by an iOS device that is explicitly scanning for them.
只有通过显式扫描它们的iOS设备才能发现它们。
- If all apps that are advertising are in the background, the frequency at which your peripheral device sends advertising packets may decrease.
如果所有正在做广告的应用程序都在后台,则外围设备发送广告数据包的频率可能会降低。
The second point, in particular, may make it difficult for your RPi to discover the peripheral; 特别是第二点,可能会使RPi很难发现外围设备。 I am not sure if the standard discovery process will work.
我不确定标准发现过程是否可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.