Re: Help needed with IOBluetoothHandsFreeDevice
Re: Help needed with IOBluetoothHandsFreeDevice
- Subject: Re: Help needed with IOBluetoothHandsFreeDevice
- From: Peter Sichel <email@hidden>
- Date: Wed, 20 Nov 2013 09:31:47 -0500
On Nov 20, 2013, at 4:32 AM, Mihai Fratu <email@hidden> wrote:
> Peter!
>
> Thank you very much for your reply. I have two questions for you:
>
> 1. What's DTS? Who am I suppose to ask for more help?
DTS stands for Developer Technical Support. Registered Apple Developers receive two “code level" DTS support incidents per year. Another big support opportunity is the Bluetooth Lab at WWDC.
> 2. I already use the IOBlietoothHandsFreeDevice for connecting to my phone. I managed to connect to it, dial a number, receive an incoming call notification, but there is no audio playing on my PC during a phone call.
>
> The thing that I've observed is that if I search for a handsfreeaudiogateway and open an rmfcomm channel to it, my IOBlietoothHandsFreeDevice won't connect. When I call it's connect method it will just hang until my rmfcomm channel get's closed with no information why.
>
> If I search for a SerialPort service instead and open a rmfcomm channel to that service everything looks to go fine and my IOBlietoothHandsFreeDevice connects when it's connect method get's called. What's up with that?
Bluetooth HFP (HandsFree Profile) is built on top of Bluetooth SPP (Serial Port Profile). The specs for both of these are available on line. The iPhone does not expose the SPP, but many other phones do. If you see an SPP service, it means you are not using an iPhone.
To connect using the SPP, you can just open an RFCOMM channel and begin sending AT commands. There is not support for handling call audio.
When connecting with HFP, an additional handshake is needed to establish a “Service Level Connection”. IOBluetoothHandsFreeDevice is designed to open the needed RFCOMM channel for you so it might fail if you have already opened an RFCOMM channel to the audio gateway service on the peer device. If you just tell it to connect with the corresponding service record, it usually works.
When using HFP, the phone implements the Audio Gateway (AG) side of the HFP, while the Mac implements the HandsFree (HF) side of HFP. Technically, the Mac needs to publish an SDP (Service Discovery Profile) record indicating that it supports the HF side of HFP. Some Audio Gateways will look for this record before accepting an HFP connection. Apple’s APIs make it relatively simple to publish an SDP record, but you still have to understand the content and format of this record.
Kind Regards,
- Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden