This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Connect cc2564b to the headset

Other Parts Discussed in Thread: CC2564

Hello, I have a problem with a headset which I am trying to connect with cc2564 bluetooth module.

What I have so far: The working bluetooth stack (I am able to initiate commands, scan the media, advertise and do a lot of conventional stuff) working under FreeRTOS and STM32 MCU Controller.

Now I am trying to connect the conventional headset (which works with my mobile phone) with the cc2564 bluetooth module (which acts as a client for the headset). My algorithm is the following:

1) Enable pairability and connectability modes (success)

2) Pair the device with the headset (success, I am getting the link identifier)

3) Find the remote port of the headset using sdp discovery procedure

4) Open remote headset using the HDSET_Open_Remote_Headset_Port command.

The last command returns success, but after a while (few seconds) the callback is initiated with etHDSET_Open_Port_Confirmation event, which shows that something wrong here: PortOpenStatus field is not zero. The button press on the headset doesn't generate any event and nothing happens.

Could someone provide any tips where should I dig further?

Thank you.

  • Hi,

    Can you share the tera term logs?
    My suspicion is that you're trying to connect to the wrong port.

    Regards,
    Gigi Joseph.
  • Of course, the log is here, according to it the bluetooth stack gets 0x01 code which means connection timeout error.

    bt# init: 0xB0B448618B08
    bt# GAP callback: Link Key request succes
    bt# GAP callback: PIN code request send success
    bt# GAP callback: link key create request
    bt# GAP callback: link key stored locally
    Link Key 46 FC 40 0A D2 F9 40 16 26 63 07 87 5F 65 11 65
    bt# GAP callback: Auth status 0
    bt# start: port ID 4
    bt# HDSET_Open_Remote_Headset_Port() was successful 1.
    bt# HDSET Open Port Confirmation, HDSETID: 0x0001, Status 0x0001.
    bt# There was an error while trying to open a Client Port.

    I get different port ID for two different headsets, so I suppose that there is no problem here...

  • After playing a while with the code I figured out that it is neccessary to initiate HDSET_Open_Audio_Gateway_Server_Port, HDSET_Register_Audio_Gateway_SDP_Record and HDSET_Open_Remote_Headset_Port commands if we want to act as a client. Nevertheless, now I am able to get the indication status messages from the headset (such as button press, audio indication and others). But HDSET Open Port Confirmation still returns Status 0x0001, which has to be interpreted as an error according to the documentation.
  • Hi,

    The HDSET_Open_Remote_Headset_Port() is for the HSP (Headset Profile), and based on your description, you need to establish the Handsfree Profile connection (HFP). Please refer to the HFPAGDemo app.

    You should be using the HFRE_Open_Remote_HandsFree_Port() instead.

    Regards,
    Gigi Joseph.
  • Hi, thank you for your reply.

    Why do you think that I need HFP profile if I want to connect headset with the cc2564b board?

  • Hi,

    You mentioned headset "indicators" (such as button press, audio indication and others). This is indicative of the HFP profile being active on your headset.

    Can you confirm which profile is running on the headset? Can you paste the SDP results?

    Regards,
    Gigi Joseph.