Programmatically Connecting to Bluetooth

Hi,

My client and I would like to experiment connecting to our accessory over Bluetooth using the PAN profile:

https://support.apple.com/en-us/HT204387


which apparently iOS supports be default. Even if I could pair and connect to the device using the Settings app, say, how could an app I create communicate with the accessory? As far as I understand it the ExternalAccessory framework is for MFi devices only. Thanks!

Accepted Reply

is the External Accessory framework for MFi devices only?

Correct.

Also, if we can't use the External Accessory framework is there any other way we can communicate with our device over classic Bluetooth?

Not really. If the accessory supports one of the standard protocols that are directly supported by iOS (like those in the AppleCare article you reference), you could try to abuse that to implement your communication (morse code to HFP perhaps? ;-) but that doesn’t strike me as a good idea.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

>the ExternalAccessory framework is for MFi devices only


Which BT are you expecting to work with?


QA 1657 says this about that:

Note: Bluetooth low energy accessories do not interface with the External Accessory framework and are not required to be MFi compliant. Instead, apps use the CoreBluetooth framework to communicate with Bluetooth low energy accessories from iOS or OS X.

The article you referenced has this text:

With iOS, this is common with multiplayer games and Personal Hotspot on iPhone.

Let me explain each point in turn:

  • “multiplayer games” — This is a reference to Bonjour’s peer-to-peer Bluetooth networking. Under the covers this used a Bluetooth PAN but the signalling required to set it up is documented for third-party use.

    Note This support was removed in iOS 11, where Bonjour’s peer-to-peer networking support is restricted to peer-to-peer Wi-Fi (and that on-the-wire protocol is also undocumented for third-party use).

  • “Personal Hotspot” — This is a user-facing feature that allows standard Bluetooth PAN devices to access the Internet via the iPhone’s WWAN.

Neither of these is appropriate for accessory integration. Peer-to-peer Bluetooth networking is a complete non-starter:

  • It’s not documented for third-party use

  • It’s not supported on the latest round of OS releases

Personal Hotspot is more subtle. I have serious concerns about using this for accessory integration. You can read this thread to learn more.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Really what we'd like to know is can we use the External Accessory framework to communicxate over classic Bluetooth to our non-MFi device, or is the External Accessory framework for MFi devices only?


Also, if we can't use the External Accessory framework is there any other way we can communicate with our device over classic Bluetooth?


Thanks!

is the External Accessory framework for MFi devices only?

Correct.

Also, if we can't use the External Accessory framework is there any other way we can communicate with our device over classic Bluetooth?

Not really. If the accessory supports one of the standard protocols that are directly supported by iOS (like those in the AppleCare article you reference), you could try to abuse that to implement your communication (morse code to HFP perhaps? ;-) but that doesn’t strike me as a good idea.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

For transferring ~200kB of data between an external device & iPhone App:

1. Do you have a table that shows which iPhone models support which BLE version, or at least support DLE?


2. For BT classic, would it require to use the External Accessory framework? Or is this only on the app development side?


3. Since iOS does not support BT SPP profile, how would you accomplish this communication via BT on the HW development side? Is there additional tools/software for developing BT for iOS devices with the MFi license?


4. To manufacture a product that communicates with an iPhone via BT classic, is it required that the HW developer has to obtain an MFi manufacturers license?


5. If you are transferring an image via BLE into the photo library on your device and no application is required, is a MFi license required?


6. If you want to develop an application for the device to accept and transfer the image, do you still have to get an MFi license if you are transferring the image data via BLE?

This thread has been closed - pls. see your duplicate question, thanks.


https://forums.developer.apple.com/thread/98584

Hi,


May I know if it's possible to transfer data from iphone to non-apple bluetooth devices using PAN?

Hi eskimo,


May I know is it possible to connect , pair and transfer data with external devices via bluetooth without joining MFI program?


Regards,

Arbind

I answered your other instance of this question.

ps It’s generally considered bad form to post the same question to multiple threads, especially threads that are only vaguely related to your actual question.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

No