Bluetooth Pairing - HFP profile and Classic Bluetooth/BLE

落花浮王杯 提交于 2019-12-06 12:26:46

问题


Can any one help me on bluetooth pairing and communicating

1.Is it possible to view all the device trying to connect via Bluetooth in the application, not by going to settings page.

2 Can we access data from devices that use standard profile like HFP,A2DP etc without MFi.(Classic bluetooth, not BLE) How is it done and which framework?

Pls help and thanks in advance

3.(Edited) Is it possible to view all devices that uses BLE (standard profiles only HFP, A2DP )in the application by using Corebluetooth???


回答1:


  1. There are three types of devices you might want to connect via Bluetooth, being A) Bluetooth Low Energy (BLE) devices B) Classic Bluetooth accessories participating in MFi program C) some generic Classic Bluetooth devices, like hands-free headsets.

With BLE devices you can do almost whatever you want. You can get a list of them inside your app, present it nicely and let the user choose a device to connect (or connect transparently).

MFi devices you can either see in Settings.app or in Accessory Picker popup (see ExternalAccessory.framework reference for more details). However, you don't have control over the Accessory Picker. But after the user has selected the device there, you can see it programmatically as connected.

With standard Classic Bluetooth devices, like hands-frees, your one and only pairing option is to go to the Settings.app and pair from there. End of story.

So no, there's no such magic place where you can see all the devices around you. You should know in advance with which type of devices you need to communicate and react accordingly.

  1. There's no standard framework to deal with standard Classic BT devices, different Apple frameworks are responsible for them. And in general, you can't do much, most communication is being done internally by the system. E.g. for hands-free devices you can only detect that such device was connected/disconnected (see more here).

  2. HFP and A2DP are Classic Bluetooth profiles that have nothing to do with BLE. You can't see a list of such devices around using CoreBluetooth.framework.



来源:https://stackoverflow.com/questions/21178929/bluetooth-pairing-hfp-profile-and-classic-bluetooth-ble

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!