11
votes

Apple provides the following two frameworks for communicating with nearby Bluetooth devices with iOS.

CoreBluetooth:

The Core Bluetooth framework provides the classes needed for your iOS and Mac apps to communicate with devices that are equipped with Bluetooth low energy wireless technology.

ExternalAccessory:

The External Accessory framework provides support for communicating with external hardware connected to an iOS-based device through either the Apple Lightning or 30-pin connector, or wirelessly using Bluetooth.

I have previously used the CoreBluetooth framework to successfully communicate with Bluetooth devices. However, I am now trying to communicate with a Bluetooth printer and it doesn't show up in the scan for nearby devices. Using the ExternalAccessory framework, it does.

How do these two frameworks differ as far as communicating with Bluetooth devices is concerned? Why do different Bluetooth devices require the use of different frameworks?

2

2 Answers

6
votes

There are two kinds of Bluetooth, Bluetooth LE which is very limited in bandwidth but that doesn't require any user pairing in the settings app and Bluetooth Classic, which requires the user to pair the device but gives you more functionality and bandwidth. CoreBluetooth supports Bluetooth LE and you can use it with a developer account. Bluetooth Classic requires that you join the Apple MFi program.

5
votes

Core Bluetooth only allows you to communicate with Bluetooth Low Energy devices using the GATT profile.

The External Accessory framework allows communication with 'legacy' Bluetooth devices using profiles such as the Serial Port Protocol (SPP). In order to communicate with devices using the External Accessory framework, the device must be certified under the MFi program.

I also believe that in order to get an app that can communicate with with an MFi device using the External Accessory Framework approved, the MFi licensee (i.e. the printer vendor) needs to provide some paperwork to authorise your app.