0

I've written an app that could (as a side effect) provide information to another app (not mine) running on the same iDevice. In order to do so, I'd need to make my app a BLE Peripheral providing the BLE service that the other app looks for. If I were to do this, would the other app be able to connect to my Peripheral app, even though it's running on the same iDevice?

I've only found one passing comment on the topic, in this Stack Overflow answer. It says: "Note that you cannot connect to your own device even if it acts as a peripheral" but I'm not ready to give up on the basis of one opinion. Is there any authoritative documentation that rules this out, or is this something people know from trial and error?

Community
  • 1
  • 1
Bezewy
  • 322
  • 4
  • 11
  • I am pretty sure the comment is correct - it wouldn't make sense for the Bluetooth radio to receive its own transmissions and the Bluetooth stack isn't addressed like the IP stack is where you can connect to your own address (or use 127.0.0.1). You may also have difficulties as your app cannot act as a peripheral while it is in the background – Paulw11 Aug 15 '14 at 02:50
  • @Paulw11, I'm not sure that addressing is an issue. Services have GUIDs and I don't see any logical reason why the BT stack couldn't expose a local implementation of some service. – Bezewy Aug 16 '14 at 01:03
  • You will still have the problem that if application A is the foreground and scanning for peripherals so that the user can select one then application B in the background can't be acting as a peripheral as background node peripheral isn't supported. Also ios peripherals change their UUID every few minutes making it difficult to keep a connection – Paulw11 Aug 16 '14 at 01:59
  • @Paulw11, there are background modes for both peripheral and central. From Apple's docs: "While your app is in the background you can still discover and connect to peripherals, and explore and interact with peripheral data." And: "In addition to allowing your app to be woken up to handle read, write, and subscription requests from connected centrals, the Core Bluetooth framework allows your app to advertise while in the background state." – Bezewy Aug 16 '14 at 21:05
  • You don't need to believe, try it. The own peripheral will never show up in the scans. I don't know if this is a restriction in the standard (but I guess it is) or the CB framework is not prepared for it but on iOS all you attempts will be in vain. Though I would definitely vote up if you found the corresponding section in the standard. – allprog Aug 16 '14 at 21:59

0 Answers0