What profile can I use with CoreBluetooth?

2020-07-23 11:47发布

问题:

I looking for informations about CoreBluetooth, I see iPhone4s/5 support Bluetooth 4.0 and Bluetooth LE.
Also, according to this note, I can use these profiles :

  1. Hands-Free Profile (HFP 1.6)
  2. Phone Book Access Profile (PBAP)
  3. Advanced Audio Distribution Profile (A2DP)
  4. Audio/Video Remote Control Profile (AVRCP 1.4)
  5. Personal Area Network Profile (PAN)
  6. Human Interface Device Profile (HID)
  7. Message Access Profile (MAP)

Can I have access to them using CoreBluetooth and, if so, how could I access to them ?

回答1:

You can't use any of the mentioned profiles if you want to communicate from the application. Core Bluetooth is meant for low energy,You can only implement GATT Profiles(like Heart Rate,Alert Notification) with BLE and BLE is for small data rates.You can only write or read characteristics to/from the device. In order to implement any of the mentioned profiles you require Serial Port Profile, which is supported only through MFi using External Accessory Framework.

GATT Profiles

http://developer.bluetooth.org/gatt/profiles/Pages/ProfilesHome.aspx

You can find External Accessory Framework documentation in the link below.

http://developer.apple.com/library/ios/#documentation/ExternalAccessory/Reference/ExternalAccessoryFrameworkReference/_index.html

MFi

https://developer.apple.com/programs/mfi/



回答2:

CoreBluetooth framework is for Bluetooth Low Energy. The note seems to be dealing with "classic" Bluetooth only (since you see "old" devices) . In that case, you'll have to use ExternalAccessory framework. Its two technologies quite different, as you could see by searching in Google or in different questions here in StackOverflow.
There is a sample from Apple dealing with ExternalAccessory framework : EADemo.