问题
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