Can Two Apps Running Simultaneously On The Same iDevice Communicate through Bluetooth?

懵懂的女人 提交于 2019-12-11 12:40:15

问题


Question is as title describes.

I have two apps, one CBPeripheralDelegate and one CBCentralManagerDelegate. The peripheral advertises when it is in the foreground (I think, I have no other BTLE devices to test it), but if I run the Central app in the foreground on the phone and the peripheral in the background, neither seems to see the other.

I have enabled UIBackgroundModes:bluetooth-peripheral in the peripherals info.plist as per the documentation for CoreBluetooth background execution.

I've found a few people trying to advertise in the background on here, but none to an app on the same device.

Let's say for the sake of my question that my code works perfectly... Can the bluetooth signal be 'looped' back into the same iPhone?


回答1:


In short, no it cannot.

Although two different apps may be advertising and searching for their own services, at the end of the day they are still accessing the same chipset. Apple just masks away all the gritty details to streamline bluetooth dev.

Browse around the following link, if you want to break into some of the more underlying details involving Bluetooth Core System Architecture



来源:https://stackoverflow.com/questions/24456479/can-two-apps-running-simultaneously-on-the-same-idevice-communicate-through-blue

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