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.

CC2564: Unassisted HFP Autoconnection

Part Number: CC2564


Hello,
We are using STM32 and Bluetopia Stack 4.0.2.1 for our application. We are using BLE + HFP (Unassisted) and it works
fine. We want to do autoconnection of the HFP device to the Smart phone. 
Our detail Code implementation is like, 
-> Power On Device
-> Initialize the Stack
-> Make Device Connectable , Discoverable and Simple Secure Pairable.
-> We call the api HFRE_Open_HandsFree_Server_Port and on success of that we add the sdp record on the same port number(1)
   using HFRE_Register_HandsFree_SDP_Record.
-> We paired the device using smartphone and store that link key and BD Addr Information in the Flash Memory. This Pairing 
   Information we provide on every restart.Whenever Smartphone gives connection request it connects successfully.
   
To do Autoconnection we follow these steps.
-> Power On Device
-> Initialize the Stack
-> Make Device Connectable , Discoverable and Simple Secure Pairable
-> We call the api HFRE_Open_HandsFree_Server_Port and on success of that we add the sdp record on the same port number(1)
   using HFRE_Register_HandsFree_SDP_Record.
-> Our Smartphone BD Addr and Link key is with us so we call the api HFRE_Open_Remote_Audio_Gateway_Port with the
   Smart Phone BD Addr . In this we have two cases
   Case 1:
If we use the Port ID : 1 then it gives the etHFRE_Open_Port_Confirmation event with the Port Status Error 2.
   Case 2:
We dont know that which port id we require to use. We have tried with the Port ID 2 then it gives etHFRE_Open_Port_Confirmation 
         Event with the Port Status 0 . After around 30 Seconds It gives us Close Port Indication event.
 Please let us know what is wrong with our steps, and what we required to do after this confirmation event to make the connection live?
   
Regards
Rutvik Fadia
   
  • Hi,

    Can, you take FW logs? You are saving the link key and re-using it for re-connection right?

    Thanks
  •  

    Hi Hari,

     

    I have given the firmware logs of our Power on initialization , Pairing , Phone Connection request after device restart , Auto connection request from the device.

    Yes we are storing the link key and reusing it for the connection.

    /*Init Firmware Logs on Power On*/

    Port Number: 1

    HFRE_Open_HandsFree_Server_Port: Function Successful.

    HFRE_Register_HandsFree_SDP_Record: Function Successful.

    **** Server_Port Opened (RFCOMM for AG) and  Register the SDP Record Completed ********

    GAP_Register_Remote_Authentication() Success.

    /*Pairing Firmware Logs*/

    **** Pairing Started ********

    Remote Device IOCapabilities: Display Yes/No, MITM

    Request for local device IOCapability from Remote(0x94652D76EBB8)

    GAP_Authentication_Response() Success.

    atUserConfirmationRequest: 0x94652D76EBB8

    Auto Accepting: 872098

    GAP_Authentication_Response() Success.

    Un-handled GAP Authentication Event. 11

    atLinkKeyCreation: 0x94652D76EBB8

    Link Key: 0xDE31ABAA76CE719C6BBB35EF693A6244

    Link Key Stored locally.

    **** Pairing Completed ********

    etHFRE_Open_Port_Indication, Port_ID: 0x0001, Board: 0x94652D76EBB8.

    Number of active connections: 1

    **** AG is connected with HF on RFCOMM port(service level connection establishment started ********

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, CALL, FALSE.

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, CALLSETUP, 0.

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, SERVICE, TRUE.

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, SIGNAL, 5.

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, ROAM, FALSE.

    ServerPortIndex : 1,IsConnected     : FALSE,IsInActiveSCO   : FALSE,IsInActiveAudio : FALSE.

    **** Remote device(AG)'s  current indicator status received    ********

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, BATTCHG, 5.

    etHFRE_Open_Service_Level_Connection_Indication, Port_ID: 0x0001

    RemoteSupportedFeaturesValid                     : TRUE

    RemoteSupportedFeatures                          : 0x00000367

    RemoteCallHoldMultipartySupport                  : 0x00000000

    HFRE Enable Call Line Identification

    HFRE Enable Remote Call Waiting Notification

    StatusResult 0

    ServerPortIndex : 1,IsConnected     : TRUE,IsInActiveSCO   : FALSE,IsInActiveAudio : FALSE.

    **** Service level connection has been opened with remote device(AG) ********

    /*The logs After Restart If we initiate the connection from the phone*/

    atLinkKeyRequest: 0x94652D76EBB8

    GAP_Authentication_Response() Success.

    etHFRE_Open_Port_Indication, Port_ID: 0x0001, Board: 0x94652D76EBB8.

    Number of active connections: 1

    **** AG is connected with HF on RFCOMM port(service level connection establishment started ********

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, CALL, FALSE.

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, CALLSETUP, 0.

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, SERVICE, TRUE.

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, SIGNAL, 5.

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, ROAM, FALSE.

    ServerPortIndex : 1,IsConnected     : FALSE,IsInActiveSCO   : FALSE,IsInActiveAudio : FALSE.

    **** Remote device(AG)'s  current indicator status received    ********

    etHFRE_Control_Indicator_Status_Confirmation, Port_ID: 0x0001, BATTCHG, 5.

    etHFRE_Open_Service_Level_Connection_Indication, Port_ID: 0x0001

    RemoteSupportedFeaturesValid                     : TRUE

    RemoteSupportedFeatures                          : 0x00000367

    RemoteCallHoldMultipartySupport                  : 0x00000000

    HFRE Enable Call Line Identification

    HFRE Enable Remote Call Waiting Notification

    StatusResult 0

    ServerPortIndex : 1,IsConnected     : TRUE,IsInActiveSCO   : FALSE,IsInActiveAudio : FALSE.

    **** Service level connection has been opened with remote device(AG) ********

    /*Auto connect request firmware logs*/

    HFRE_Open_Remote_Audio_Gateway_Port Result =2

    atLinkKeyRequest: 0x94652D76EBB8

    GAP_Authentication_Response() Success.

    atAuthenticationStatus: 0 Board: 0x94652D76EBB8

    Unknown/Unhandled GAP Event: 1.

    HFRE Open Port Confirmation Event:

    HFRE Port ID :2 ,PORT Open Status:0

    etHFRE_Close_Port_Indication, Port_ID: 0x  %, Status: 0x0002.

     

    Regards

    Rutvik Fadia

  • Hi Hari,

    Is there any update on this?

    Regards
    Rutvik Fadia
  • Hi Rutvik,

    I think, you would need to use a SPP port, specified by the phone (remote device) for HFP. To get this port number, you may need to do a SDP querry for the remote device and parse the response for HFP port number..

    If, you have the test application to try this on MSP432, please send it across so that we can reproduce and review further..

    Thanks
  • Hello Hari,

    We tired SDP query and got client port ID. Now it is working.

    Thanks for your support.

    Regards,
    khodidas