Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between the CoreBluetooth and ExternalAccessory frameworks?

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?

like image 765
Extragorey Avatar asked Dec 12 '16 00:12

Extragorey


2 Answers

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.

like image 173
Paulw11 Avatar answered Oct 20 '22 03:10

Paulw11


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.

like image 33
Josh Homann Avatar answered Oct 20 '22 02:10

Josh Homann