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.

Dual concurrent SCO connections

Other Parts Discussed in Thread: CC2564, CC2564MODN, CC2564MODNEM

The CC2564x datasheet mentions that it is possible to run 2 concurrent SCO connections.  i.e. dual HFP connections with their accompanying SCO.

Can you point me to some more information of how that works?

I am guessing you can simply pair with 2 HFP devices and connect with them

But what happens to the 2 audio streams?

- are they mixed internally and the mixed audio is available to a connected CODEC?

If som is there any control of gain on each ?

- can the inidividual streams be routed to L and R channels or enabled/disabled individually?

- would incoming audio (microphone) be broadcast back out to both connections ?

I have been unable to find any references to this in the StonestreetOne stack API documentation.

Interested in using the CC2564 module with an MSP430 (or perhaps Tiva).  This would be for a new product for one of our customers.

Thanks - Daraius

TenX Precision

  • Hi,

    Please see the answers below:

    But what happens to the 2 audio streams?
    [Answer] – The PCM interface can handle two channels

    - are they mixed internally and the mixed audio is available to a connected CODEC?
    [Answer] - Yes when we receive audio from both remote devices it is mixed and sent to the PCM lines. Usually, the first 16 bits are for the first channel, the 2nd channel use the following 16 bits

    If som is there any control of gain on each ?
    [Answer] – No, the PCM is pure logic

    - can the individual streams be routed to L and R channels or enabled/disabled individually?
    [Answer] – It depends on the coded that is connected to the PCM lines

    - would incoming audio (microphone) be broadcast back out to both connections ?
    [Answer] – It depends on the coded. If it will put the data on both channels, it will be sent to both of them. If it puts the data only on one of the channels, it will be sent to one of them

    I have been unable to find any references to this in the StonestreetOne stack API documentation.
    Interested in using the CC2564 module with an MSP430 (or perhaps Tiva). This would be for a new product for one of our customers.
    [Answer] – AFAIK, SSO doesn’t support two voice channels. The HW supports it (CC2564) but not the stack.

  • Thanks Sundeep - that is helpful (although not what I wanted to hear!).

    Does anyone have recommendations or pointers to how to achieve this functionality?

    - is SSO stack supplied as source code, and if so how difficult would it be to extend its functionality

    - has anyone done this ?  and willing to consult with us?

    It would seem that the stack should have relatively little to do, other than allow the multiple connections to happen.  The audio does not travel to the stack, just the PCM port.  i am assuming that the stack already supports multiple connections like SPP, since this is quite common on other BT modules we have used.

    Thanks - Daraius

  • Hi,

    HFP supports Multiple HFP connections but it is not enabled out of the box. You should be able to make it work by just modifying the samples.

    Thanks.

    Stonestreet One.

  • Would like to clarify...

    We need 2 concurrent SCO audio streams, not just 2 HFP connections.

    When you say "modifying the samples" I assume you mean the sample code, not hardware, correct?

    Can you provide some guidance on how to do this?  And then what happens to the dual audio streams?

    Do they appear as Ch1 and Ch2 on a composite PCM stream?

    Is it possible to setup a phone call with StonestreetOne to discuss ?

    Thanks

    Daraius@tenxp.com

  • vHello Sundeep,

       I need to resurrect this discussion because I'm not able to get the second SCO's connection data over PCM with my dual SCO connection.  Let me explain...

    We are using the TIVA TM4C129X-EM with the CC2564MODN module running the latest version of CCS6 with BT release v1.2 R2 and starting from the HPDemo we were sent showing an example of creating a dual SCO connection. 

    The changes I have made include:

    * Disabled WBS.  Was told CC2564 cannot assist dual SCO connections with WBS enabled.

    * Setup PCM for 128Hz/8kHz audio  (I have also tested at 2 MHz / 8kHz just to see)

    * Replaced CurrentClientPortID with a second parameter for the commands.  Gives me more flexibility than assuming the last port opened is the one I want commands issued against.

    My workflow is:

    1).  Pair both devices (Bluegiga module in a headset, and an Android Phone)

    2).  openhandsfreeclient to the headset

    3).  manageaudio to the headset - Audio is now going both ways.  Visible as 1 channel on PCM bus between fsync pulses.

    4).  openhandsfreeclient to the phone

    5).  manageaudio to the phone - Phone now shows a wireless headset connected and ready for when a call comes in

    6).  call the phone - see incoming call on the terminal. 

    7).  answer the call - call thinks its audio is going to a HF device

    8).  I observe no change to the PCM bus output.  The second SCO connection is not coming out on the PCM bus.

    9).  If manageaudio 0 to disconnect the headset.  The phone still believes it is connected.  Fsync is still on the PCM bus, but no audio is flowing.

    10).  If I manageaudio 1 to the phone again, its audio begins flowing on the PCM bus. 

    11).  If I manageaudio 1 to the headset, the PCM bus remains unchanged.  The headset believes it has an SCO connection.

    I've copied a log below this.  Please let me know if you can think of anything.    Thanks!

    OpenStack().
    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    Bluetooth Stack ID: 1.
    WBS Support successfully disabled.
    Frequencies Set successfully.
    Device Chipset Version: Unknown (greater 4.0)
    Bluetooth Device Address: 0x0017e9506303
    GAP_Set_Connectability_Mode(cmConnectable).
    GAP_Set_Discoverability_Mode(dmGeneralDiscoverable, 0).
    GAP_Set_Pairability_Mode(pmPairableMode).
    GAP_Register_Remote_Authentication() Success.

    ******************************************************************
    * Command Options: Inquiry, DisplayInquiryList, Pair,            *
    *                  EndPairing, PINCodeResponse, PassKeyResponse, *
    *                  UserConfirmationResponse,                     *
    *                  SetDiscoverabilityMode, SetConnectabilityMode,*
    *                  SetPairabilityMode,                           *
    *                  ChangeSimplePairingParameters,                *
    *                  GetLocalAddress, GetLocalName, SetLocalName,  *
    *                  GetClassOfDevice, SetClassOfDevice,           *
    *                  GetRemoteName, OpenHFServer, CloseHFServer    *
    *                  ManageAudio, AnswerCall, HangUpCall, Close,   *
    *                  OPENHANDSFREECLIENT, SERVICEDISCOVERY,        *
    *                  SENDAUDIO, DATA, Help                         *
    ******************************************************************
    HFRE_Open_HandsFree_Server_Port: Function Successful.
    HFRE_Register_HandsFree_SDP_Record: Function Successful.

    HFRE16>setpairabilitymode 2
    Pairability Mode successfully set to: Pairable (Secure Simple Pairing).
    Current I/O Capabilities: No Input/Output, MITM Protection: FALSE.

    HFRE16>inquiry
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.

    HFRE16>
    GAP Inquiry Entry Result: 0x0a5c00000000.

    HFRE16>
    GAP Inquiry Entry Result: 0x1430c6bbb008.

    HFRE16>
    GAP_Inquiry_Result: 2 Found.
    GAP Inquiry Result: 1, 0x0a5c00000000.
    GAP Inquiry Result: 2, 0x1430c6bbb008.

    HFRE16>inquiry
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.

    HFRE16>
    GAP Inquiry Entry Result: 0x1430c6bbb008.

    HFRE16>
    GAP Inquiry Entry Result: 0x0a5c00000000.

    HFRE16>
    GAP_Inquiry_Result: 2 Found.
    GAP Inquiry Result: 1, 0x1430c6bbb008.
    GAP Inquiry Result: 2, 0x0a5c00000000.

    HFRE16>inquiry
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.

    HFRE16>
    GAP Inquiry Entry Result: 0x000780110d19.

    HFRE16>
    GAP Inquiry Entry Result: 0x1430c6bbb008.

    HFRE16>
    GAP Inquiry Entry Result: 0x0a5c00000000.

    HFRE16>
    GAP_Inquiry_Result: 3 Found.
    GAP Inquiry Result: 1, 0x000780110d19.
    GAP Inquiry Result: 2, 0x1430c6bbb008.
    GAP Inquiry Result: 3, 0x0a5c00000000.

    HFRE16>pair 1
    GAP_Initiate_Bonding (Dedicated): Function Successful.

    HFRE16>
    atLinkKeyRequest: 0x000780110d19
    GAP_Authentication_Response() Success.

    HFRE16>
    atIOCapabilityRequest: 0x000780110d19
    GAP_Authentication_Response() Success.

    HFRE16>
    atIOCapabilityResponse: 0x000780110d19
    Remote Capabilities: No Input/Output

    HFRE16>
    atUserConfirmationRequest: 0x000780110d19

    Auto Accepting: 339779
    GAP_Authentication_Response() Success.

    HFRE16>
    Un-handled GAP Authentication Event 11.

    HFRE16>
    atLinkKeyCreation: 0x000780110d19
    Link Key: 0xcc9f711c20c44af9c0a973525bee6368
    Link Key Stored locally.

    HFRE16>
    atAuthenticationStatus: 0 Board: 0x000780110d19

    HFRE16>pair 2
    GAP_Initiate_Bonding (Dedicated): Function Successful.

    HFRE16>
    atLinkKeyRequest: 0x1430c6bbb008
    GAP_Authentication_Response() Success.

    HFRE16>
    atIOCapabilityRequest: 0x1430c6bbb008
    GAP_Authentication_Response() Success.

    HFRE16>
    atIOCapabilityResponse: 0x1430c6bbb008
    Remote Capabilities: Display Yes/No, MITM

    HFRE16>
    atUserConfirmationRequest: 0x1430c6bbb008

    Auto Accepting: 792573
    GAP_Authentication_Response() Success.

    HFRE16>
    Un-handled GAP Authentication Event 11.

    HFRE16>
    atLinkKeyCreation: 0x1430c6bbb008
    Link Key: 0xc1af0590a1697b33cf05f5b40db33b63
    Link Key Stored locally.

    HFRE16>
    atAuthenticationStatus: 0 Board: 0x1430c6bbb008


    ---- Now we begin to open hands free connections ----

    HFRE16>openhandsfreeclient 1 3
    Bluetooth Device Address: 0x000780110d19
    Open Remote HandsFree Port = 0003
    HFRE_Open_Remote_Audio_Gateway_Port: Function Successful (ID = 0002).

    HFRE16>
    atLinkKeyRequest: 0x000780110d19
    GAP_Authentication_Response() Success.

    HFRE16>
    atAuthenticationStatus: 0 Board: 0x000780110d19

    HFRE16>
    Unknown/Unhandled GAP Event: 1.

    HFRE16>
    HFRE Open Port Confirmation, ID: 0x0002, Status: 0x0000.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: SERVICE, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: CALL, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: CALLSETUP, Value: 0.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: CALLHELD, Value: 0.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: SIGNAL, Value: 0.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: ROAM, Value: FALSE.

    HFRE16>
    HFRE Open Service Level Connection Indication, ID: 0x0002
                         RemoteSupportedFeaturesValid: TRUE
                              RemoteSupportedFeatures: 0xERRORX
                      RemoteCallHoldMultipartySupport: 0xERRORX
    HFRE_Enable Call Line Identification

    HFRE16>
    HFRE Command Result, ID: 0x0002, Type 0 Code 0.

    HFRE16>manageaudio 1 2
    HFRE_Setup_Audio_Connection: Function Successful.

    HFRE16>
    HFRE Audio Connection Indication, ID: 0x0002, Status: 0x0000.

      ------ At this point I have audio flowing to one device ------

    HFRE16>openhandsfreeclient 2 3
    Bluetooth Device Address: 0x1430c6bbb008
    Open Remote HandsFree Port = 0003
    HFRE_Open_Remote_Audio_Gateway_Port: Function Successful (ID = 0003).

    HFRE16>
    atLinkKeyRequest: 0x1430c6bbb008
    GAP_Authentication_Response() Success.

    HFRE16>
    atAuthenticationStatus: 0 Board: 0x1430c6bbb008

    HFRE16>
    Unknown/Unhandled GAP Event: 1.

    HFRE16>
    HFRE Open Port Confirmation, ID: 0x0003, Status: 0x0000.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0003, Description: CALL, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0003, Description: CALLSETUP, Value: 0.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0003, Description: SERVICE, Value: TRUE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0003, Description: ROAM, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0003, Description: BATTCHG, Value: 3.

    HFRE16>
    HFRE Open Service Level Connection Indication, ID: 0x0003
                         RemoteSupportedFeaturesValid: TRUE
                              RemoteSupportedFeatures: 0xERRORX
                      RemoteCallHoldMultipartySupport: 0xERRORX
    HFRE_Enable Call Line Identification

    HFRE16>
    HFRE Command Result, ID: 0x0003, Type 0 Code 0.

    HFRE16>
    HFRE Control Indicator Status Indication, ID: 0x0003, Description: SIGNAL, Value: 5.

    HFRE16>manageaudio 1 3
    HFRE_Setup_Audio_Connection: Function Successful.

    HFRE16>
    HFRE Audio Connection Indication, ID: 0x0003, Status: 0x0000.

    HFRE16>
    HFRE Control Indicator Status Indication, ID: 0x0003, Description: CALLSETUP, Value: 1.

    HFRE16>
    HFRE Ring Indication, ID: 0x0003.

    HFRE16>
    HFRE Call Line Identification Notification Indication, ID: 0x0003, Phone Number 3135301096.

    HFRE16>
    HFRE Control Indicator Status Indication, ID: 0x0003, Description: CALL, Value: TRUE.

    HFRE16>
    HFRE Control Indicator Status Indication, ID: 0x0003, Description: CALLSETUP, Value: 0.

    HFRE16>manageaudio 0 2
    HFRE_Release_Audio_Connection: Function Successful.

    HFRE16>
    HFRE Audio Disconnection Indication, ID: 0x0003.

    HFRE16>
    HFRE Audio Connection Indication, ID: 0x0003, Status: 0x0000.

    HFRE16>manageaudio 1 2
    HFRE_Setup_Audio_Connection: Function Successful.

    HFRE16>
    HFRE Audio Connection Indication, ID: 0x0002, Status: 0x0000.

    HFRE16>
    HFRE Audio Disconnection Indication, ID: 0x0003.

    HFRE16>
    HFRE Control Indicator Status Indication, ID: 0x0003, Description: CALL, Value: FALSE.

    HFRE16>

  • Hi,

    Are you making sure that you are using the correct port Id while setting up an Audio Connection (HFRE_Setup_Audio_Connection)?
  • Hello Sundeep.  This problem appears related to the creation of a HFServer on the CC2564.  If I do not open the HFServer, I am able to get a dual SCO connection working between Android/Bluegiga solutions. 

    However, Apple phones will not see the CC2564 unless a HFServer exists.  And, I am unable to open a remote handsfree connection to apple phones.  The phones reject the connection with status code 0002.  If I first open a HFServer, the phones can connect to the CC2564 and I am able to open a single SCO connection.  But trying to connect a second device to the HF server fails.  Trying to open a remote hands free connection from the CC2564 to an Android phone also fails.  This prevents a dual SCO connection from being established with Apple phones.

    So to recap:

    No HFServer

    Pair 2 android/bluegiga devices

    Issue OpenRemoteHFClient to both

    ManageAudio to both  = dual SCO connections

    no HFServer

    apple device cannot "see" the CC2564

    CC2564 can see apple device and pairs

    Also pair with Android/Bluegiga device

    Issue OpenRemoteHFclient to apple device - fails

    With HFServer

    Apple Device can see and pair with CC2564

    Apple device can open a HF connection to the CC2564 - CC2564 trying to open a remote HF client still fails if attempted

    Can pair with Android/Bluegiga device

    Issue OpenRemoteHFClient to Android/Bluegiga device fails to open the port - I never get the callback that kicks off the connection process

    Thus, only 1 SCO connection appears possible

    My BlueGiga module can open a remote HF connection to the apple phone just fine, so this doesn't appear to be an apple problem. 

    Hope that helps explain things.  I'll spend some time this weekend working on a series of logs for it all...

    - Jason

  • Jason Gossiaux,
    I am also using CC2564MODN module but with TM4C123G, and performing the experiment similar to you. I opened HFP Server port for connecting smart phone and I had to open a SSP client connection for the hands free device with SCO connection in order to connect with CC2564, because, Mr Sundeep Mandava advised me, we cannot perform the HFRE_Open_Remote_HandsFree_Port because it is not supported with CC2564. If you could provide me the code sample of OPENHANDSFREECLIENT or, guide me, how to get this, I will be very great full you.
    Thank you.
    Best Wishes
  • Hello Nishantha,

      I think you may be confused.  It was TI support that sent me an HFPDemo example edited with comments by Mr. Sundeep showing OPENHANDSFREECLIENT being used from the TIVA/CC2564MODN console to open two HF SCO connections with two Android phones.   This works successfully as shown in the log below.   My problem is it fails on Apple phones.  I'll provide a log here once I have a chance to set the test back up.

       Is it possible to have two phones connect to the CC2564's HFPServer and then open two SCO connections? If not, how does one go about initiating two SCO connections without the use of OPENHANDSFREECLIENT ?

    Thank you,

      - Jason

    Here is the log of the example provided to me. 

    OpenStack().
    Bluetooth Stack ID: 1.
    WBS Support initialized.
    Device Chipset Version: Unknown (greater 4.0)
    Bluetooth Device Address: 0x0017e9505f95
    GAP_Set_Connectability_Mode(cmConnectable).
    GAP_Set_Discoverability_Mode(dmGeneralDiscoverable, 0).
    GAP_Set_Pairability_Mode(pmPairableMode).
    GAP_Register_Remote_Authentication() Success.

    ******************************************************************
    * Command Options: Inquiry, DisplayInquiryList, Pair,            *
    *                  EndPairing, PINCodeResponse, PassKeyResponse, *
    *                  UserConfirmationResponse,                     *
    *                  SetDiscoverabilityMode, SetConnectabilityMode,*
    *                  SetPairabilityMode,                           *
    *                  ChangeSimplePairingParameters,                *
    *                  GetLocalAddress, GetLocalName, SetLocalName,  *
    *                  GetClassOfDevice, SetClassOfDevice,           *
    *                  GetRemoteName, OpenHFServer, CloseHFServer    *
    *                  ManageAudio, AnswerCall, HangUpCall, Close,   *
    *                  OPENHANDSFREECLIENT, SERVICEDISCOVERY,        *
    *                  Help                                          *
    ******************************************************************

    HFRE16>SetLocalName tivahfp
    Local Device Name set to: tivahfp.

    HFRE16>Inquiry
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.

    HFRE16>
    GAP Inquiry Entry Result: 0x10683f59e8a1.

    HFRE16>
    GAP Inquiry Entry Result: 0x40b0fa0adb7e.

    HFRE16>
    GAP Inquiry Entry Result: 0x945103ccc50e.

    HFRE16>
    GAP_Inquiry_Result: 3 Found.
    GAP Inquiry Result: 1, 0x10683f59e8a1.
    GAP Inquiry Result: 2, 0x40b0fa0adb7e.
    GAP Inquiry Result: 3, 0x945103ccc50e.

    HFRE16>GetRemoteName 2
    GAP_Query_Remote_Device_Name: Function Successful.

    HFRE16>
    GAP Remote Name Result: BD_ADDR: 0x40b0fa0adb7e.
    GAP Remote Name Result: Nexus 4.

    HFRE16>SERVICEDISCOVERY 2 12
    SDP_Service_Search_Attribute_Request(Audio gateway) Success.

    HFRE16>
    SDP Service Search Attribute Response Received (Size = 0x0010)
    Service Record: 1:
    Attribute ID 0x0000
    Type: Unsigned Int = 0x00010003
    Attribute ID 0x0001
    Type: Data Element Sequence
    Type: UUID_16 = 0x111f
    Type: UUID_16 = 0x1203
    Attribute ID 0x0004
    Type: Data Element Sequence
    Type: Data Element Sequence
    Type: UUID_16 = 0x0100
    Type: Data Element Sequence
    Type: UUID_16 = 0x0003
    Type: Unsigned Int = 0x03
    Attribute ID 0x0005
    Type: Data Element Sequence
    Type: UUID_16 = 0x1002
    Attribute ID 0x0009
    Type: Data Element Sequence
    Type: Data Element Sequence
    Type: UUID_16 = 0x111e
    Type: Unsigned Int = 0x0106
    Attribute ID 0x0100
    Type: Text String = Handsfree Gateway
    Attribute ID 0x0301
    Type: Unsigned Int = 0x01
    Attribute ID 0x0311
    Type: Unsigned Int = 0x0007

    HFRE16>OPENHANDSFREECLIENT 2 3
    Bluetooth Device Address: 0x40b0fa0adb7e
    Open Remote HandsFree Port = 0003
    HFRE_Open_Remote_Audio_Gateway_Port: Function Successful (ID = 0001).

    HFRE16>
    atPINCodeRequest: 0x40b0fa0adb7e

    Respond with the command: PINCodeResponse

    HFRE16>PINCodeResponse 0000
    GAP_Authentication_Response(), Pin Code Response Success.

    HFRE16>
    atLinkKeyCreation: 0x40b0fa0adb7e
    Link Key: 0x8ed9c450725d07fffdb6f08c96f9d7fb
    Link Key Stored locally.

    HFRE16>
    HFRE Open Port Confirmation, ID: 0x0001, Status: 0x0000.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: CALL, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: CALLSETUP, Value: 0.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: SERVICE, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: SIGNAL, Value: 0.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: ROAM, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: BATTCHG, Value: 4.

    HFRE16>
    HFRE Open Service Level Connection Indication, ID: 0x0001
                         RemoteSupportedFeaturesValid: TRUE
                              RemoteSupportedFeatures: 0xERRORX
                      RemoteCallHoldMultipartySupport: 0xERRORX
    HFRE_Enable Call Line Identification

    HFRE16>
    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SERVICE, Value: TRUE.

    HFRE16>
    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 5.

    HFRE16>
    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

    HFRE16>ManageAudio 1
    HFRE_Setup_Audio_Connection: Function Successful.

    HFRE16>
    HFRE Audio Connection Indication, ID: 0x0001, Status: 0x0000.

    HFRE16>OPENHANDSFREECLIENT 1 3
    Bluetooth Device Address: 0x10683f59e8a1
    Open Remote HandsFree Port = 0003
    HFRE_Open_Remote_Audio_Gateway_Port: Function Successful (ID = 0002).

    HFRE16>
    atPINCodeRequest: 0x10683f59e8a1

    Respond with the command: PINCodeResponse

    HFRE16>PINCodeResponse 0000
    GAP_Authentication_Response(), Pin Code Response Success.

    HFRE16>
    atLinkKeyCreation: 0x10683f59e8a1
    Link Key: 0xe922374459baac52fc6acd02d5e3576d
    Link Key NOT Stored locally: Link Key array is full.

    HFRE16>
    HFRE Open Port Confirmation, ID: 0x0002, Status: 0x0000.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: CALL, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: CALLSETUP, Value: 0.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: SERVICE, Value: TRUE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: SIGNAL, Value: 5.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: ROAM, Value: FALSE.

    HFRE16>
    HFRE Control Indicator Status Confirmation, ID: 0x0002, Description: BATTCHG, Value: 4.

    HFRE16>
    HFRE Open Service Level Connection Indication, ID: 0x0002
                         RemoteSupportedFeaturesValid: TRUE
                              RemoteSupportedFeatures: 0xERRORX
                      RemoteCallHoldMultipartySupport: 0xERRORX
    HFRE_Enable Call Line Identification

    HFRE16>
    HFRE Command Result, ID: 0x0002, Type 0 Code 0.

    HFRE16>ManageAudio 1
    HFRE_Setup_Audio_Connection: Function Successful.

    HFRE16>
    HFRE Audio Connection Indication, ID: 0x0002, Status: 0x0000.

    HFRE16>

      

  • Hello Jason Gossiaux,

    Thank you very much contacting me. I am enlightened. Yes it is possible to open two SCO connections, I have done this. I copy the codes from SPPLE project in to SPP demo folder because SPPLE has multiple sever connection examples, then I connect my smart phone with SPP server and made the other connection with hands free device using open remote server command. Now I can open two SCO channels over SPP ports. I am performing, two concurrent SCO connections over HCI channel and also obtained the audio sample through the SCO_Connection_Callback as event.

    case etSCO_Data_Indication:
    if(SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->SCO_Connection_ID == SCOConnectionID_Client)
    {
    // sample
    }
    if(SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->SCO_Connection_ID == SCOConnectionID_Server)
    {
    // sample
    }
    My experiment is success with hands free device but I didn’t able to hear the audio signal from mobile side there must be something wrong. However two SCO connections are established and conform.
    I have a question, if you have any demo project which you can perform OPENHANDSFREECLIENT, I would like to have it. Because I am having terrible situation with a project, also if CC2564 doesn’t support with audio gateway function then why they provide log demonstrations to you? I am very confuse. Please reply.
    Thank you very much
    Best Wishes
  • Hello again,

    drive.google.com/.../view

    This is a link to my Googledrive share of a 7zip containing the demo project sent to me by TI Support. The log I previously copied should give the steps for making two assisted SCO connections and streaming the audio out of the PCM interface.

    To clarify - you are doing SCO over HCI? We are doing SCO over the PCM interface of the CC2564. We have been told by TI support and have demonstrated that the CC2564 can assist two non-WBS SCO connections and stream left/right channel audio to an attached codec IC. The MSP430/TIVA processor is then not involved with the SCO data streaming.

    But yes, I am confused as well. The documentation has been insufficient for us to completely understand what is going on. Trial and error for 3 months has only marginally improved our knowledge.



    Some things we have learned along the way -

    * The CC2564 can only assist two non WideBandSpeech SCO connections. Though this example doesn't do it, we had to disable WBS to get dual SCO connections to work

    * The CC2564 will lockup when negotiating the SCO codec with an Apple iPhone on iOS 8.x. It is necessary to disable codec negotiation and force a CVSD 8kHz audio connection at a PCM data rate of 256kbps or higher.

    * SCO connections will be sent over PCM as left/right channels in between fsync pulses. This can be viewed on a scope if you do not have a codec wired over. Our board has a codec wired over so we can listen to the audio with speakers and send microphone data back.

    But to restate - our problem is with OPENHANDSFREECLIENT (which calls HFRE_Open_Remote_HandsFree_Port) failing on iPhones. It works fine on Android devices and on our BlueGIGA modules. We do not wish to use SCO over HCI for our application.


    Thank you,

    - Jason
  • Hello Jason Gossiaux,

    Thank you so much posting the demo project. Audio Gateway is functioning, but when I was trying to open Manage Audio then, I got error. Also, the port is all ways closed right after the port open conformation. Are you having same problem? I did test with hands free device and also with mobile.
    I also like to perform the project with PCM channel rather than HCI, hope fully, that will be helpful to eliminate lot of technical issues, but I just need to play with HCI channel little bit before the final assembly.
    I have done another test with HFP Server with smart phone. This time I opened Manage Audio command for creating audio channel and also switch to the HCI. The reason why i need it to be in HCI, because then I can received the samples over the HFRE_Event_Callback and then samples can be routed in to another channel without any hardware involve. This time I got excellent sound quality, but with SCO, it was very poor.

    Best Wishes
  • Hello again,

    One limitation of the demo I linked, is it requires a specific order for the commands.  It is just a quick demo and lacks some quality of life features.

    Be careful if multiple devices appear on INQUIRY.  The commands reference IDs in the order they appear in this list - not the order you pair devices in.  Also, because the clientID is a global and only points to the most recent connection it is easy to get mixed up.  

    To provide better functionality, I ended up storing paired IDs in a new data array and having each command reference that ID.  I then added a second parameter to each console command so I could specify which port to act upon.

    What kind of codec is connected to the PCM bus on the CC2564?  What kind of phone are you pairing with the CC2564?   Perhaps post a console log and I could try and identify where it is going wrong.

    PCM audio quality will depend on the sample rate and PCM rate and your codec and attached speaker.  I'm not sure what your setup is, but be sure to verify the PCM frequency and ensure the codec can handle it.  If not, the audio can sound garbled. 

    Could you please give an example of issuing the ManageAudio command and then "switching to HCI" ?  The Vendor Specific command set specifically says that an SCO connection must be initialized for PCM or HCI before it is created - and cannot be changed afterwards.  ManageAudio would be creating the SCO connection, so I'm not sure how you switch to HCI audio mode afterwards. 

    For TI, I am still needing help with opening remote hands free clients with Apple devices.  And I am still confused on the need for a HFServer if I only intend to do assisted SCO audio over the CC2564's PCM bus.  It works fine with competitor Bluetooth modules, so I'm inclined to say this is a problem on the CC2564/TIVA end.

    Thank you,

     - Jason

     

  • Hello Jason Gossiaux,

    Here are the codes for my test project. OpenMServer is a function which I did create for testing, and that open HFRE_Open_HandsFree_Server_Port. And then, I can scan BT device using my android phone and connect with CC2564. I have added the authenticating code set in gap event for response for PINCode request. That is it! Demo setup is ready, all I have to do is, call to my android phone from another mobile then at the first ringing indication, CC2564 accept the call and switch the audio channel in to HCI link. Once, the HCI channel activated, all the voice samples can be received from  HFRE_Event_Callback at the etHFRE_Audio_Data_Indication as events. This is the example project of voice over HCI channel and I have excellent results. If I can have code set for HFRE_Setup_Audio_Connection API, that will be splendid then I can see what is exactly happening in side it. Well, my opinion is, Ti must provide one template project for developers.  

     

    static void BTPSAPI HFRE_Event_Callback(unsigned int BluetoothStackID, HFRE_Event_Data_t *HFREEventData, unsigned long CallbackParameter)

    switch(HFREEventData->Event_Data_Type)

    {

         Case   etHFRE_Open_Service_Level_Connection_Indication:

                    Result  = HFRE_Setup_Audio_Connection(BluetoothStackID,  HFREEventData-           >Event_Data.HFRE_Open_Service_Level_Connection_Indication_Data->HFREPortID);      // NEW

    Break;

        Case  etHFRE_Ring_Indication:

    Result = HFRE_Answer_Incoming_Call(BluetoothStackID, HFREEventData->Event_Data.HFRE_Ring_Indication_Data->HFREPortID);

    if(Result < 0)

    { DisplayFunctionError("HFRE_Answer_Incoming_Call", Result);

    }

    else

    {

             if((Result = BTPSAPI VS_HCI_Enable(BluetoothStackID)) < 0)  // This is the new function in BTVS.c for switch in to HCI channel. ( HCI_VS_Write_SCO_Configuration 0xFE10, 1, 120, 720, 1 <- SunDeep sent me)

                     DisplayFunctionError("VS_HCI_Enable()", Result);    

    }

    Break;

    case   etHFRE_Audio_Data_Indication:    // NEW

              HFRE_Send_Audio_Data(BluetoothStackID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->HFREPortID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->AudioDataLength, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->AudioData);  

    /**** This code sends the incoming audio samples back in to same BT device, causing eco sound but with small delay. You can hear your own voice playing again and this is the proof of concept of device functionality. Also this is the code which plays major roll in my device. ****/

    Break;

    } // end of switch

    BTVS.c

    static const unsigned char HCI_VS_Write_SCO_Configuration[]  = {0x01, 0x10, 0xFE, 0x05, 0x01, 0x78, 0xD0, 0x02, 0x01};   //  HCI_VS_Write_SCO_Configuration 0xFE10, 1, 120, 720, 1 <- SunDeep sent me

    int BTPSAPI VS_HCI_Enable(unsigned int BluetoothStackID)

    {

      int    ret_val;

      Byte_t CommandBuffer[48];

      Word_t OpCode;

      Word_t OCF;

      Byte_t OGF;

      Byte_t Length;

      Byte_t Status;

      Byte_t CommandLength;

      Byte_t ReturnBuffer[1];

      /* Verify that the parameters that were passed in appear valid.      */

      if(BluetoothStackID)

      {

         BTPS_MemCopy(CommandBuffer, HCI_VS_Write_SCO_Configuration, sizeof(HCI_VS_Write_SCO_Configuration));

         CommandLength = CommandBuffer[3];

         OpCode        = READ_UNALIGNED_WORD_LITTLE_ENDIAN(&(CommandBuffer[1]));

         Length        = sizeof(ReturnBuffer);

         OGF           = VS_COMMAND_OGF(OpCode);

         OCF           = VS_COMMAND_OCF(OpCode);

         ret_val       = HCI_Send_Raw_Command(BluetoothStackID, OGF, OCF, CommandLength, (Byte_t *)&CommandBuffer[4], &Status, &Length, ReturnBuffer, TRUE);

         /* Map the results from Send Raw.                                 */

         if((ret_val = MapSendRawResults(ret_val, Status, Length, ReturnBuffer)) == 0)   // here I get error code but it does switch in to HCI channel ( VS_HCI_Enable() Failed: -57 )

         {

            /* Set the Voice Settings for 16 bit CVSD mode.                */

            ret_val = HCI_Write_Voice_Setting(BluetoothStackID, (HCI_VOICE_SETTING_INPUT_DATA_FORMAT_2_COMPLEMENT | HCI_VOICE_SETTING_INPUT_SAMPLE_SIZE_16_BIT | HCI_VOICE_SETTING_AIR_CODING_FORMAT_CVSD), &Status);

            if(!ret_val)

            {

               /* Set the Voice Settings for 16 bit transparent mode.      */

               ret_val = WBS_Associate(BluetoothStackID, 0, WBS_DISABLE);

            }

         }

      }

      else

         ret_val = BTPS_ERROR_INVALID_PARAMETER;

      /* Return the result the caller.                                     */

      return(ret_val);

    }

    This is the log report.

    OpenStack().

    HCI_VS_InitializeAfterHCIReset

    VS_Update_UART_Baud_Rate success.

    HCI_VS_InitializeAfterHCIReset Success

    Bluetooth Stack ID: 1.

    WBS Support initialized.

    Device Chipset Version: 4.1

    Bluetooth Device Address: 0x0017e950631b

    ******************************************************************

    * Command Options: Server, Client, Help                          *

    ******************************************************************

    Choose Mode>Server

    ******************************************************************

    * Command Options: Inquiry, DisplayInquiryList, Pair,            *

    *                  EndPairing, PINCodeResponse, PassKeyResponse, *

    *                  UserConfirmationResponse,                     *

    *                  SetDiscoverabilityMode, SetConnectabilityMode,*

    *                  SetPairabilityMode,                           *

    *                  ChangeSimplePairingParameters,                *

    *                  GetLocalAddress, GetLocalName, SetLocalName,  *

    *                  GetClassOfDevice, SetClassOfDevice,           *

    *                  GetRemoteName, SniffMode, ExitSniffMode,      *

    *                  Open, Close, Read, Write,                     *

    *                  GetConfigParams, SetConfigParams,             *

    *                  GetQueueParams, SetQueueParams,               *

    *                  Loopback, DisplayRawModeData,                 *

    *                  AutomaticReadMode, SetBaudRate, Send          *

    *                  Help, Quit, OpenRemoteServer2                 *

    *                  OpenMServer, AudioGateway, ScoAdd             *

    *                  OpenRemoteAudioGatewayPort                    *

    ******************************************************************

    Server>OpenMServer 1

    Server Opened: Server Port 1, Serial Port ID 1.

    Server Port Context Stored.

    Server>

    atPINCodeRequest: 0x18227ef9a455

    Respond with: PINCodeResponse

    GAP_Authentication_Response(), Pin Code Response Success.

    Server>

    atLinkKeyCreation: 0x18227ef9a455

    Link Key Stored.

    Server>

    HFRE Open Port Indication, ID: 0x0001, Board: 0x18227ef9a455.

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: CALL, Value: FALSE.

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: CALLSETUP, Value: 0.

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: SERVICE, Value: TRUE.

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: SIGNAL, Value: 2.

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: ROAM, Value: FALSE.

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: BATTCHG, Value: 5.

    HFRE Open Service Level Connection Indication, ID: 0x0001

                        RemoteSupportedFeaturesValid: TRUE

                             RemoteSupportedFeatures: 0xERRORX

                     RemoteCallHoldMultipartySupport: 0xERRORX

    HFRE_Enable Call Line Identification

    HFRE_Setup_Audio_Connection: Function Successful.

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

    etHFRE_Codec_Select_Indication, ID: 0x0001 Codec ID: 2.

    ConnectionHandle 1 for 0x18227ef9a455.

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

    HFRE Audio Connection Indication, ID: 0x0001, Status: 0x0000.

    HFRE Audio Disconnection Indication, ID: 0x0001.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 1.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: CALLSETUP, Value: 1.

    HFRE Ring Indication, ID: 0x0001.

    VS_HCI_Enable() Failed: -57.

    HFRE Call Line Identification Notification Indication, ID: 0x0001, Phone Number 075xxxxxxx.

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

    HFRE Ring Indication, ID: 0x0001.

    VS_HCI_Enable() Failed: -57.

    HFRE Call Line Identification Notification Indication, ID: 0x0001, Phone Number 075xxxxxxx.

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

    etHFRE_Codec_Select_Indication, ID: 0x0001 Codec ID: 2.

    ConnectionHandle 1 for 0x18227ef9a455.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: CALL, Value: TRUE.

    HFRE Audio Connection Indication, ID: 0x0001, Status: 0x0000.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: CALLSETUP, Value: 0.

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

    HFRE Audio Disconnection Indication, ID: 0x0001.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: CALL, Value: FALSE.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

    HFRE Close Port Indication, ID: 0x0001, Status: 0x0000.

  • Hello Jason Gossiaux,

     

    Here are the codes for my test project. OpenMServer is function which I did create for testing, and that open HFRE_Open_HandsFree_Server_Port. And then, I can scan BT device using my android phone and connect with CC2564. I have add auto authenticating code set in gap event for response for PINCode request. That is it! Demo setup is ready, all I have to do is, call to my android phone from another mobile then at the first ringing indication, CC2564 accept the call and switch the audio channel in to HCI link. Once, the HCI channel activated, all the voice samples can be received from HFRE_Event_Callback at the etHFRE_Audio_Data_Indication as events. This is the example project of voice over HCI channel and I have excellent results. If I can have code set for HFRE_Setup_Audio_Connection API, that will be splendid then I can see what is exactly happening in side of it. Well, my opinion is, Ti must provide one template project for developers.    

     

     

    static void BTPSAPI HFRE_Event_Callback(unsigned int BluetoothStackID, HFRE_Event_Data_t *HFREEventData, unsigned long CallbackParameter)

     

    switch(HFREEventData->Event_Data_Type)

    {

         Case etHFRE_Open_Service_Level_Connection_Indication:

                     Result = HFRE_Setup_Audio_Connection(BluetoothStackID, HFREEventData-           >Event_Data.HFRE_Open_Service_Level_Connection_Indication_Data->HFREPortID);      // NEW

    Break;

         Case etHFRE_Ring_Indication:

    Result = HFRE_Answer_Incoming_Call(BluetoothStackID, HFREEventData->Event_Data.HFRE_Ring_Indication_Data->HFREPortID);

    if(Result < 0)

    {                                                                                                              DisplayFunctionError("HFRE_Answer_Incoming_Call", Result);

    }

    else

    {

             if((Result = BTPSAPI VS_HCI_Enable(BluetoothStackID)) < 0) // This is the new function in BTVS.c for switch in to HCI channel. ( HCI_VS_Write_SCO_Configuration 0xFE10, 1, 120, 720, 1 <- SunDeep sent me)

                     DisplayFunctionError("VS_HCI_Enable()", Result);              

    }

    Break;

     

    case  etHFRE_Audio_Data_Indication:   // NEW

               HFRE_Send_Audio_Data(BluetoothStackID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->HFREPortID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->AudioDataLength, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->AudioData);  

    /**** This code sends the incoming audio samples back in to same BT device, causing eco sound but with small delay. You can hear your own voice and conform the functionality of the device. Also this is the code which plays major roll in my device. ****/

    Break;

    } // end of switch

     

    BTVS.c

    static const unsigned char HCI_VS_Write_SCO_Configuration[] = {0x01, 0x10, 0xFE, 0x05, 0x01, 0x78, 0xD0, 0x02, 0x01};   // HCI_VS_Write_SCO_Configuration 0xFE10, 1, 120, 720, 1 <- SunDeep sent me

     

     

    int BTPSAPI VS_HCI_Enable(unsigned int BluetoothStackID)

    {

       int   ret_val;

       Byte_t CommandBuffer[48];

       Word_t OpCode;

       Word_t OCF;

       Byte_t OGF;

       Byte_t Length;

       Byte_t Status;

       Byte_t CommandLength;

       Byte_t ReturnBuffer[1];

     

       /* Verify that the parameters that were passed in appear valid.     */

       if(BluetoothStackID)

       {

        

         BTPS_MemCopy(CommandBuffer, HCI_VS_Write_SCO_Configuration, sizeof(HCI_VS_Write_SCO_Configuration));

                                   

                                   

         CommandLength = CommandBuffer[3];

         OpCode       = READ_UNALIGNED_WORD_LITTLE_ENDIAN(&(CommandBuffer[1]));

         Length       = sizeof(ReturnBuffer);

         OGF           = VS_COMMAND_OGF(OpCode);

         OCF           = VS_COMMAND_OCF(OpCode);

     

         ret_val       = HCI_Send_Raw_Command(BluetoothStackID, OGF, OCF, CommandLength, (Byte_t *)&CommandBuffer[4], &Status, &Length, ReturnBuffer, TRUE);

                                   

         /* Map the results from Send Raw.                                 */

         if((ret_val = MapSendRawResults(ret_val, Status, Length, ReturnBuffer)) == 0) // here I get error code but it does switch in to HCI channel ( VS_HCI_Enable() Failed: -57 )

         {

             /* Set the Voice Settings for 16 bit CVSD mode.               */

             ret_val = HCI_Write_Voice_Setting(BluetoothStackID, (HCI_VOICE_SETTING_INPUT_DATA_FORMAT_2_COMPLEMENT | HCI_VOICE_SETTING_INPUT_SAMPLE_SIZE_16_BIT | HCI_VOICE_SETTING_AIR_CODING_FORMAT_CVSD), &Status);

             if(!ret_val)

             {

               /* Set the Voice Settings for 16 bit transparent mode.     */

               ret_val = WBS_Associate(BluetoothStackID, 0, WBS_DISABLE);

           }

                                                                   

         }

       }

       else

         ret_val = BTPS_ERROR_INVALID_PARAMETER;

     

       /* Return the result the caller.                                     */

       return(ret_val);

    }

     

    This is the log report.

     

    OpenStack().

    HCI_VS_InitializeAfterHCIReset

    VS_Update_UART_Baud_Rate success.

    HCI_VS_InitializeAfterHCIReset Success

    Bluetooth Stack ID: 1.

    WBS Support initialized.

    Device Chipset Version: 4.1

    Bluetooth Device Address: 0x0017e950631b

     

    ******************************************************************

    * Command Options: Server, Client, Help                         *

    ******************************************************************

     

    Choose Mode>Server

     

    ******************************************************************

    * Command Options: Inquiry, DisplayInquiryList, Pair,           *

    *                 EndPairing, PINCodeResponse, PassKeyResponse, *

    *                 UserConfirmationResponse,                     *

    *                 SetDiscoverabilityMode, SetConnectabilityMode,*

    *                 SetPairabilityMode,                           *

    *                 ChangeSimplePairingParameters,               *

    *                 GetLocalAddress, GetLocalName, SetLocalName, *

    *                 GetClassOfDevice, SetClassOfDevice,           *

    *                  GetRemoteName, SniffMode, ExitSniffMode,     *

    *                 Open, Close, Read, Write,                     *

    *                 GetConfigParams, SetConfigParams,             *

    *                 GetQueueParams, SetQueueParams,              *

    *                 Loopback, DisplayRawModeData,                 *

    *                 AutomaticReadMode, SetBaudRate, Send         *

    *                 Help, Quit, OpenRemoteServer2                 *

    *                 OpenMServer, AudioGateway, ScoAdd             *

    *                 OpenRemoteAudioGatewayPort                   *

    ******************************************************************

     

    Server>OpenMServer 1

    Server Opened: Server Port 1, Serial Port ID 1.

    Server Port Context Stored.

     

    Server>

    atPINCodeRequest: 0x18227ef9a455

    Respond with: PINCodeResponse

    GAP_Authentication_Response(), Pin Code Response Success.

     

    Server>

    atLinkKeyCreation: 0x18227ef9a455

    Link Key Stored.

     

    Server>

    HFRE Open Port Indication, ID: 0x0001, Board: 0x18227ef9a455.

     

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: CALL, Value: FALSE.

     

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: CALLSETUP, Value: 0.

     

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: SERVICE, Value: TRUE.

     

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: SIGNAL, Value: 2.

     

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: ROAM, Value: FALSE.

     

    HFRE Control Indicator Status Confirmation, ID: 0x0001, Description: BATTCHG, Value: 5.

     

    HFRE Open Service Level Connection Indication, ID: 0x0001

                         RemoteSupportedFeaturesValid: TRUE

                             RemoteSupportedFeatures: 0xERRORX

                     RemoteCallHoldMultipartySupport: 0xERRORX

    HFRE_Enable Call Line Identification

    HFRE_Setup_Audio_Connection: Function Successful.

     

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

     

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

     

    etHFRE_Codec_Select_Indication, ID: 0x0001 Codec ID: 2.

    ConnectionHandle 1 for 0x18227ef9a455.

     

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

     

    HFRE Audio Connection Indication, ID: 0x0001, Status: 0x0000.

     

    HFRE Audio Disconnection Indication, ID: 0x0001.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 1.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: CALLSETUP, Value: 1.

     

    HFRE Ring Indication, ID: 0x0001.

     

    VS_HCI_Enable() Failed: -57.

     

    HFRE Call Line Identification Notification Indication, ID: 0x0001, Phone Number 075xxxxxxx.

     

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

     

    HFRE Ring Indication, ID: 0x0001.

     

    VS_HCI_Enable() Failed: -57.

     

    HFRE Call Line Identification Notification Indication, ID: 0x0001, Phone Number 075xxxxxxx.

     

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

     

    etHFRE_Codec_Select_Indication, ID: 0x0001 Codec ID: 2.

    ConnectionHandle 1 for 0x18227ef9a455.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: CALL, Value: TRUE.

     

    HFRE Audio Connection Indication, ID: 0x0001, Status: 0x0000.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: CALLSETUP, Value: 0.

     

    HFRE Command Result, ID: 0x0001, Type 0 Code 0.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

     

    HFRE Audio Disconnection Indication, ID: 0x0001.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: CALL, Value: FALSE.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 3.

     

    HFRE Control Indicator Status Indication, ID: 0x0001, Description: SIGNAL, Value: 2.

     

    HFRE Close Port Indication, ID: 0x0001, Status: 0x0000.

  • Hello Jason Gossiaux,

     

    I sent a reply for you. but Ti admin holding it. don't know why.

  • Hello Jason Gossiaux,

    Here are the codes for my test project. OpenMServer is function which I did create for testing, and that open HFRE_Open_HandsFree_Server_Port. And then, I can scan BT device using my android phone and connect with CC2564. I have add auto authenticating code set in gap event for response for PINCode request. That is it! Demo setup is ready, all I have to do is, call to my android phone from another mobile then at the first ringing indication, CC2564 accept the call and switch the audio channel in to HCI link. Once, the HCI channel activated, all the voice samples can be received from HFRE_Event_Callback at the etHFRE_Audio_Data_Indication as events. This is the example project of voice over HCI channel and I have excellent results. If I can have code set for HFRE_Setup_Audio_Connection API, that will be splendid then I can see what is exactly happening in side of it. Well, my opinion is, Ti must provide one template project for developers.
  • static void BTPSAPI HFRE_Event_Callback(unsigned int BluetoothStackID, HFRE_Event_Data_t *HFREEventData, unsigned long CallbackParameter)

    switch(HFREEventData->Event_Data_Type)
    {
    Case etHFRE_Open_Service_Level_Connection_Indication:
    Result = HFRE_Setup_Audio_Connection(BluetoothStackID, HFREEventData- >Event_Data.HFRE_Open_Service_Level_Connection_Indication_Data->HFREPortID); // NEW
    Break;
    Case etHFRE_Ring_Indication:
    Result = HFRE_Answer_Incoming_Call(BluetoothStackID, HFREEventData->Event_Data.HFRE_Ring_Indication_Data->HFREPortID);
    if(Result < 0)
    { DisplayFunctionError("HFRE_Answer_Incoming_Call", Result);
    }
    else
    {
    if((Result = BTPSAPI VS_HCI_Enable(BluetoothStackID)) < 0) // This is the new function in BTVS.c for switch in to HCI channel. ( HCI_VS_Write_SCO_Configuration 0xFE10, 1, 120, 720, 1 <- SunDeep sent me)
    DisplayFunctionError("VS_HCI_Enable()", Result);
    }
    Break;

    case etHFRE_Audio_Data_Indication: // NEW
    HFRE_Send_Audio_Data(BluetoothStackID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->HFREPortID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->AudioDataLength, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->AudioData);
    /**** This code sends the incoming audio samples back in to same BT device, causing eco sound but with small delay. You can hear your own voice and conform the functionality of the device. Also this is the code which plays major roll in my device. ****/
    Break;
    } // end of switch



    BTVS.c

    static const unsigned char HCI_VS_Write_SCO_Configuration[] = {0x01, 0x10, 0xFE, 0x05, 0x01, 0x78, 0xD0, 0x02, 0x01}; // HCI_VS_Write_SCO_Configuration 0xFE10, 1, 120, 720, 1 <- SunDeep sent me


    int BTPSAPI VS_HCI_Enable(unsigned int BluetoothStackID)
    {
    int ret_val;
    Byte_t CommandBuffer[48];
    Word_t OpCode;
    Word_t OCF;
    Byte_t OGF;
    Byte_t Length;
    Byte_t Status;
    Byte_t CommandLength;
    Byte_t ReturnBuffer[1];

    /* Verify that the parameters that were passed in appear valid. */
    if(BluetoothStackID)
    {

    BTPS_MemCopy(CommandBuffer, HCI_VS_Write_SCO_Configuration, sizeof(HCI_VS_Write_SCO_Configuration));


    CommandLength = CommandBuffer[3];
    OpCode = READ_UNALIGNED_WORD_LITTLE_ENDIAN(&(CommandBuffer[1]));
    Length = sizeof(ReturnBuffer);
    OGF = VS_COMMAND_OGF(OpCode);
    OCF = VS_COMMAND_OCF(OpCode);

    ret_val = HCI_Send_Raw_Command(BluetoothStackID, OGF, OCF, CommandLength, (Byte_t *)&CommandBuffer[4], &Status, &Length, ReturnBuffer, TRUE);

    /* Map the results from Send Raw. */
    if((ret_val = MapSendRawResults(ret_val, Status, Length, ReturnBuffer)) == 0) // here I get error code but it does switch in to HCI channel ( VS_HCI_Enable() Failed: -57 )
    {
    /* Set the Voice Settings for 16 bit CVSD mode. */
    ret_val = HCI_Write_Voice_Setting(BluetoothStackID, (HCI_VOICE_SETTING_INPUT_DATA_FORMAT_2_COMPLEMENT | HCI_VOICE_SETTING_INPUT_SAMPLE_SIZE_16_BIT | HCI_VOICE_SETTING_AIR_CODING_FORMAT_CVSD), &Status);
    if(!ret_val)
    {
    /* Set the Voice Settings for 16 bit transparent mode. */
    ret_val = WBS_Associate(BluetoothStackID, 0, WBS_DISABLE);
    }

    }
    }
    else
    ret_val = BTPS_ERROR_INVALID_PARAMETER;

    /* Return the result the caller. */
    return(ret_val);
    }
  • Hello Jason Gossiaux,


    I am sorry for posting multiple reply, because I got problem with Ti admin and I thought my letters are too long so I send them again as multiple small letters. Looks like I screwed up the entire blog. I am sorry for this. Is there way to delete the extra posts? This is the log report, I got with Sundeep’s project. CC2564 closed the port right after it is opened. Also cannot activate the Manage Audio.
    Best Wishes



    OpenStack().
    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    Bluetooth Stack ID: 1. WBS Support initialized.
    Device Chipset Version: Unknown (greater 4.0)
    Bluetooth Device Address: 0x0017e950631b
    GAP_Set_Connectability_Mode(cmConnectable).
    GAP_Set_Discoverability_Mode(dmGeneralDiscoverable, 0).
    GAP_Set_Pairability_Mode(pmPairableMode).
    GAP_Register_Remote_Authentication() Success.

    * Command Options: Inquiry, DisplayInquiryList, Pair, *
    * EndPairing, PINCodeResponse, PassKeyResponse, *
    * UserConfirmationResponse, *
    * SetDiscoverabilityMode, SetConnectabilityMode, *
    * SetPairabilityMode, *
    * ChangeSimplePairingParameters, *
    * GetLocalAddress, GetLocalName, SetLocalName, *
    * GetClassOfDevice, SetClassOfDevice, *
    * GetRemoteName, OpenHFServer, CloseHFServer *
    * ManageAudio, AnswerCall, HangUpCall, Close, *
    * OPENHANDSFREECLIENT, SERVICEDISCOVERY, *
    * Help * ******************************************************************
    HFRE16>inquiry
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.
    HFRE16>
    GAP Inquiry Entry Result: 0x001167111157.
    HFRE16>
    GAP_Inquiry_Result: 1 Found.
    GAP Inquiry Result: 1, 0x001167111157.
    HFRE16>Pair 1
    GAP_Initiate_Bonding (Dedicated): Function Successful.
    HFRE16>
    atPINCodeRequest: 0x001167111157
    Respond with the command: PINCodeResponse
    HFRE16>PinCodeResponse 0000
    GAP_Authentication_Response(), Pin Code Response Success.
    HFRE16>
    atLinkKeyCreation: 0x001167111157
    Link Key: 0x0c465338b15c2d481d7ad7f7dbebe0b4
    Link Key Stored locally.
    HFRE16>
    atAuthenticationStatus: 0 Board: 0x001167111157
    HFRE16>OPENHANDSFREECLIENT 1 2
    Bluetooth Device Address: 0x001167111157
    Open Remote HandsFree Port = 0002
    HFRE_Open_Remote_Audio_Gateway_Port: Function Successful (ID = 0001).
    HFRE16>
    atLinkKeyRequest: 0x001167111157
    GAP_Authentication_Response() Success.
    HFRE16> HFRE Open Port Confirmation, ID: 0x0001, Status: 0x0000.
    HFRE16> HFRE Close Port Indication, ID: 0x0001, Status: 0x0001.
  • Hello Jason Gossiaux,

     

    I am intending to give up the CC2564. Because of many reasons. Looks like the CC2564 is not a good choice for me. I do system designed and work online. I bought, brand new pair of Tiva TM4C123G launch pad kit with another two CC2564MODNEM modules but it has been more than two month for now, I am still struggling to complete very small project. I have experience in designing Bluetooth low energy applications based on other brands of bluetooth ICs and I never had such a cataclysm with those products because they have been fully organized their product's details and discriptions, also well documented . Any one, who even doesn’t have deep knowledge about Bluetooth, they can easily engage with new product, and can be included in to their design. Also they don’t keep any details or product resources as top secrets. When you are buying an elephant, the ankus must be provided with in full set, otherwise how are you taking them home? I end up with two elephants with no ankus. Now I am on street with them. Someone can say “hey you must be responsible when you are choosing the product” I respect to that, but also Ti is a technologically advance company, also fully armed with “master minds” it is not hard them to think, how will be the future of mine, when I end up with two elephants and no ANKUS?

     

    Best Wishes

  • I am sorry to hear you are having as many problems as difficult a time as I am. 

    I see you did OPENHANDSFREECLIENT 1 2

    The 2 refers to the port you are opening.  1 and 2 seem to be off limits for some reason.  1 might make sense as it could be port the HFPServer is using (if you've opened one).  2 I am not sure of.  But I've had the best success opening both on port 3.

    Below is a link to a zip file with 2 logs. 

    The first shows a successful pair and opening of dual SCO to an android phone and a BlueGiga module.  I verified today that I get both channels flowing properly out of the PCM bus and through the codec I wired in. 

    The second log shows a successful pair and opening of an SCO connection to a BlueGiga module.  It then shows a failed attempt to open a hands free client to an apple phone. The pair succeeds after OPENHANDSFREECLIENT 2 3. (2 for the device and 3 for the port).  But it fails to complete opening the port.  It stops short with a status 0x0002.

    Clicking the CC2564 device in the phone's BT list causes it to finish opening a connection.  However, I feel this may be taking place on the HFServer (Hence why the ID changed from 0003 to 0001.  This results in the ManageAudio command failing with a STATUS 0001.

    https://drive.google.com/file/d/0B9EYwAWdSUu2WE5EbnN4enk3S0k/view?usp=sharing

    - Jason

  • Hi Nishantha,

    Could you please provide your e-mail ID.
  • Dear Sir,

    This is my e-mail address. usembeddedsystem@yahoo.com

    Best Wishes

  • Hello Nishantha Mahesh,

    I copied your code into a clean HFPDemo with a litte bit modification. I want to send a tone sound to the devie but it didn't work, do you experience this?

    The Result of HFRE_Send_Audio_Data call is always -1000

    code chage:

    added some global var

    #define AudioDataLength 256

    Byte_t AudioData[256];

    static unsigned int AudioDataToneIndex;

    static Byte_t AudioDataTone_1KHz_8Bit[] = { 0x80, 0xC3, 0xDF, 0xC3, 0x80, 0x3C,
    0x20, 0x3C };

    static Byte_t AudioDataTone_1KHz_16Bit[] = { 0x00, 0x00, 0xE1, 0x43, 0xFF, 0x5F,
    0xE1, 0x43, 0x00, 0x00, 0x1F, 0xBC, 0x01, 0xA0, 0x1F, 0xBC };

    modification on the callback switch case

    case etHFRE_Audio_Data_Indication: {
    // Result=HFRE_Send_Audio_Data(BluetoothStackID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->HFREPortID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->AudioDataLength, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->AudioData);
    unsigned int Index;


    for (Index = 0; Index < AudioDataLength; Index++) {
        if (1) {
               AudioData[Index] =
                                   AudioDataTone_1KHz_8Bit[AudioDataToneIndex++];

                 AudioDataToneIndex %= sizeof(AudioDataTone_1KHz_8Bit);
        } else {
                AudioData[Index] =
                                   AudioDataTone_1KHz_16Bit[AudioDataToneIndex++];

                  AudioDataToneIndex %= sizeof(AudioDataTone_1KHz_16Bit);
        }
    }
    Result=HFRE_Send_Audio_Data(BluetoothStackID, HFREEventData->Event_Data.HFRE_Audio_Data_Indication_Data->HFREPortID, AudioDataLength,AudioData);
     Display(("etHFRE_Audio_Data_Indication %d",Result));
    break;
    }
    case etHFRE_Audio_Transmit_Buffer_Empty_Indication:
    Display(("etHFRE_Audio_Transmit_Buffer_Empty_Indication"));
    break;

     

  • Hi all,

    Just want to clarify that this is not a HFP Audio gateway demo. and in the MSP430 SDK avalibe curently "HFRE_Send_Audio_Data" is not enabled in the current MSP430 SDK release, As SCO over HCI is not supported on the MSP430. Only SCO over PCM.

    and wanted you to know that this is just to demo that two SCO connection can be established simultaneously (where only sanity testing was done and the DUT will act as HFP handsfree role ).

    1. For initiating the connection (using HFRE_Open_Remote_Audio_Gateway_Port) you will have to first determine the required RFCOMM port number of the remote device.
    2. Once it is successful, you need to establish audio (ManageAudio call, which intern calls HFRE_Setup_Audio_Connection) to this device.
    3. Now you can establish another connection (as mentioned in step one)
    NOTE : Once this is done the channel id is updated to the second connection, and the previous one is not tracked.
    4. Establish audio to second device.

    Now if you want the demo to act differently, You need to make the required modifications. I want to mention it once again that this is not the stranded demo which is provided as part of the SDK releases.

  • Hello wing ho

     

    Thank you very much for replying. I test the codes you are provided and also realized, there was problem in the connection of smart phone and CC2564. The feedback voice comes from my smart phone not through the CC2564, because, I am staying closer the smart phone when I was testing the device and also all the portfolio setting were close to each other. Thank you so much providing the codes and that was really helpful to find the error. Also, I apologize about providing the defective codes. However, I did another test with my hands free device but not with standard HFRE_Open_HandsFree_Server_Port API.

    I created serial connection between hands free device and CC2564 using OpenRemoteServer command and established the SCO connection over SPP link. I obtained successful results, and I can hear the feedback voice. Today, I did implement the codes you are provided in to the SCO over SPP link project. But that did not work either. I did some modification with codes then I got excellent result. It was the loud tone noise over my hands free device. Well, my suggestion is, we cannot send 256 byte pay load at once if I am wrong I would like to have advice. If my memory is correct, I remember Bluetooth low energy protocol allowed 20 bytes max payload at one transmission event. I had this experience with nRF51822. We need Mr. Sandeep’s advice for this. However, I came up with instant solution for solving the problem. This is the code line.

    (SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->DataLength)

    And this is the codes for testing SCO connection with hands free device.

     

    Best Wishes

     

    static void BTPSAPI SCO_Connection_Callback(unsigned int BluetoothStackID, SCO_Event_Data_t *SCO_Event_Data, unsigned long CallbackParameter)

    {

                    int ret_val = 0;

                    BD_ADDR_t BD_addr_Client;

                    BD_ADDR_t BD_addr_Server;

                   

                    unsigned int Index;

                                 

                    switch(SCO_Event_Data->SCO_Event_Type)

                    {

                                    case etSCO_Connect_Result:

     

           if((SCO_Event_Data->SCO_Event_Data.SCO_Connect_Result_Event->SCO_Connection_ID == SCOConnectionID_Server)&&(!ServerConnected))

                                                    {                                                            

                                                                                                                                  

                                                                    ServerConnected = TRUE;

                                                                    Display(("SCO Server: connected.\r\n"));

                                                    }

                                                    else

                                                    {

                                                  

                 if((SCO_Event_Data->SCO_Event_Data.SCO_Connect_Result_Event->SCO_Connection_ID == SCOConnectionID_Client)&&(!ClientConnected))

                                                           {                                                                                                                     

                                                                           ClientConnected = TRUE;

                                                                       Display(("SCO Client: connected.\r\n"));                                                                       

                                                         }

                                       }                                          

                                                   

                                       Display(("SCO Event: connected.\r\n"));

                                                    break;

                                   

                                    case etSCO_Disconnect:

                                                   

                                    if((SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->SCO_Connection_ID == SCOConnectionID_Client)&&(!ClientConnected))

                                    {

                                                    ClientConnected = FALSE;

                                                    Display(("Client Disconnect.\r\n"));

                                    }

                                    if((SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->SCO_Connection_ID == SCOConnectionID_Server)&&(!ServerConnected))

                                    {

                                                    ServerConnected = FALSE;

                                                    Display(("Server Disconnect.\r\n"));

                                    }

                                                    break;

                                                                   

                                    case etSCO_Data_Indication:

                                   

                                    if(SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->SCO_Connection_ID == SCOConnectionID_Client)

                                    {

                                                   

                                                    for (Index = 0; Index < AudioDataLength1; Index++) {

                 if (1){

                           AudioData[Index] = AudioDataTone_1KHz_8Bit[AudioDataToneIndex++];

                           AudioDataToneIndex %= sizeof(AudioDataTone_1KHz_8Bit);                

              

                         }

                                                                                                                         else

                                                                                                                                                                                    {

                                   AudioData[Index] = AudioDataTone_1KHz_16Bit[AudioDataToneIndex++];                                                  

                                   AudioDataToneIndex %= sizeof(AudioDataTone_1KHz_16Bit);

                        }

                         }

                                                   

                                                    SCO_Send_Data(BluetoothStackID, SCOConnectionID_Client, SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->DataLength, AudioData);

                                                                                                                                                                                                   

    //                            SCO_Send_Data(BluetoothStackID, SCOConnectionID_Client, SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->DataLength, SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->DataBuffer);

                                                    Display(("SCO_Data_Client.\r\n"));                                        

                                    }

                                   

                                    if(SCO_Event_Data->SCO_Event_Data.SCO_Data_Indication_Event->SCO_Connection_ID == SCOConnectionID_Server)

                                    {

                                                   

                                                    Display(("SCO_Data_Server.\r\n"));

                                    }

                                   

    //                                            Display(("SCO_Data_Indication.\r\n"));                              

                                                    break;

                                   

                                    case etSCO_Transmit_Buffer_Empty_Indication:

                                                    Display(("SCO_Transmit_Buffer_Empty_Indication"));  

                                                    break;

                                   

                                    case etSCO_Synchronous_Connection_Changed:

                                                    Display(("SCO_Synchronous_Connection_Changed")); 

                                                    break;

                                   

                                    default:

                                                    break;

                    }

    }

  • Mr. Sundeep Mandava
    Dear Sir,

    Thank you very much for all the tech supports you are provided. I would like to know, is it possible to have code set for SPP API? What I need is, to find out how it has been done. If it is not, then would you mind to provide us the instructions? The documents are in the Bluetopia stake is not enough, also there was a lot of PDFs are missing in the SDK folder. If you are having restrictions to provide codes for SPP API then at list guide for creating custom API?

    Thank you very much

    Best Wishes
  • Hello Sundeep,

    Just want to clarify that this is not a HFP Audio gateway demo.

    * Correct.  But what is the difference between opening an HFServer and having devices initiate HF connections to the CC2564, and not opening an HFServer and instead using HFRE_Open_Remote_Audio_Gateway_Port to connect the CC2564 to other device.  Both allow me to get a single SCO connection.  Only the HFRE_Open_Remote_Audio_Gateway_Port method allows us get a dual SCO connection.

    In the MSP430 SDK avalibe curently "HFRE_Send_Audio_Data" is not enabled in the current MSP430 SDK release

    * Also correct.  But we are using the TIVA platform.  As I have mentioned in other posts, the code comments indicate SCO connections must be configured for HCI or SCO AND configuration must be done before the connection is established and cannot be changed after.  I am asking if my understanding is true?  Can you please confirm this? 

    Wanted you to know that this is just to demo that two SCO connection can be established simultaneously (where only sanity testing was done and the DUT will act as HFP handsfree role ).

    * Yes but this is a product that TI markets as having certain capabilities.  Stone street one also responded on this forum that their stack supported it, and only changes to the demo app would be required to make it work.   However, the documentation of the CC2564, the stack and the demo are lacking.  There may be bugs or compatibility problems.   This is why we are here asking questions and attempting to get support.  in my opinion, it should not matter what the intended capabilities of the demo app were.

    1. For initiating the connection (using HFRE_Open_Remote_Audio_Gateway_Port) you will have to first determine the required RFCOMM port number of the remote device.

    My complaint has been that HFRE_Open_Remote_Audio_Gateway_Port fails on the Apple phones we've tested with.  https://drive.google.com/file/d/0B9EYwAWdSUu2WE5EbnN4enk3S0k/view?usp=sharing  is a link to the demo working with an Android phone and failing with an Apple phone.  The only modifications on my end where

    - Disabling WBS

    - Adding a parameter so I can specify the port #, giving me more flexibility with the commands being issued

    - Opened a HFServer to allow the apple device to connect after failing to Open_Remote_Audio_Gateway_Port

    The error returned is:

    HFRE16> HFRE Open Port Confirmation, ID: 0x0003, Status: 0x0002.

    Now the CC2564 shows connected in the Apple phone's Bluetooth list.  And clicking it causes the phone to connect to the HFServer.  But the other device is then unable to HFRE_Setup_Audio_Connection successfully.   This may be related to needing to know what RFCOMM port the iPhone requires - or if it even supports this.  I'm not sure and was hoping you could provide some insight.

    If it isn't supported, why/how are we able to open a single SCO connection by having the Apple device connect to our HFServer?  Is there a way to have a second device connect in this manner and thereby get dual SCO working?

    Thank you for looking into this for us.

     - Jason

      

  • Hello wing ho,

    This is the modification. And some reason, I am unable to send the 256 byes. My suggestion is, there must be limits.

    SCO_Send_Data(BluetoothStackID, SCOConnectionID_Client, (sizeof(AudioData)-1), AudioData);

    Best Wishes
  • Hello Jason Gossiaux,

    Thank you very for the sample codes. I fallow the Sandeep’s advice and got to work with my android phone. But this is for only mobile phones. Have you done test with hands free device? For me, I always having port closed message. Service discovery number 12 for audio gateway and 11 for head set device. I need to modify the codes for operate with hands free device. Any idea for editing codes?

    Best Wishes.


    OpenStack().
    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    Bluetooth Stack ID: 1.
    WBS Support initialized.
    Device Chipset Version: Unknown (greater 4.0)
    Bluetooth Device Address: 0x0017e950631b
    GAP_Set_Connectability_Mode(cmConnectable).
    GAP_Set_Discoverability_Mode(dmGeneralDiscoverable, 0).
    GAP_Set_Pairability_Mode(pmPairableMode).
    GAP_Register_Remote_Authentication() Success.

    ******************************************************************
    * Command Options: Inquiry, DisplayInquiryList, Pair, *
    * EndPairing, PINCodeResponse, PassKeyResponse, *
    * UserConfirmationResponse, *
    * SetDiscoverabilityMode, SetConnectabilityMode,*
    * SetPairabilityMode, *
    * ChangeSimplePairingParameters, *
    * GetLocalAddress, GetLocalName, SetLocalName, *
    * GetClassOfDevice, SetClassOfDevice, *
    * GetRemoteName, OpenHFServer, CloseHFServer *
    * ManageAudio, AnswerCall, HangUpCall, Close, *
    * OPENHANDSFREECLIENT, SERVICEDISCOVERY, *
    * Help *
    ******************************************************************

    HFRE16>Inquiry
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.

    HFRE16>
    GAP Inquiry Entry Result: 0x001167111157.

    HFRE16>
    GAP_Inquiry_Result: 1 Found.
    GAP Inquiry Result: 1, 0x001167111157.

    HFRE16>SERVICEDISCOVERY
    Usage: ServiceDiscovery [Inquiry Index] [Profile Index] [16/32 bit UUID (Manual only)].

    Profile Index:
    0) Manual (MUST specify 16/32 bit UUID)
    1) L2CAP
    2) Advanced Audio
    3) A/V Remote Control
    4) Basic Imaging
    5) Basic Printing
    6) Dial-up Networking
    7) FAX
    8) File Transfer
    9) Hard Copy Cable Repl.
    10) Health Device
    11) Headset
    12) Audio gateway
    13) HID
    14) LAN Access
    15) Message Access
    16) Object Push
    17) Personal Area Network
    18) Phonebook Access
    19) SIM Access
    20) Serial Port
    21) IrSYNC

    Function Error.

    HFRE16>SERVICEDISCOVERY 1 11
    SDP_Service_Search_Attribute_Request(Headset) Success.

    HFRE16>
    atPINCodeRequest: 0x001167111157

    Respond with the command: PINCodeResponse

    HFRE16>PINCodeResponse 0000
    GAP_Authentication_Response(), Pin Code Response Success.

    HFRE16>
    atLinkKeyCreation: 0x001167111157
    Link Key: 0x5cbd7e13057c44aac75d474fde8503a9
    Link Key Stored locally.

    HFRE16>
    SDP Service Search Attribute Response Received (Size = 0x0010)
    Service Record: 1:
    Attribute ID 0x0000
    Type: Unsigned Int = 0x00010002
    Attribute ID 0x0001
    Type: Data Element Sequence
    Type: UUID_16 = 0x1108
    Type: UUID_16 = 0x1203
    Attribute ID 0x0004
    Type: Data Element Sequence
    Type: Data Element Sequence
    Type: UUID_16 = 0x0100
    Type: Data Element Sequence
    Type: UUID_16 = 0x0003
    Type: Unsigned Int = 0x02
    Attribute ID 0x0006
    Type: Data Element Sequence
    Type: Unsigned Int = 0x656e
    Type: Unsigned Int = 0x006a
    Type: Unsigned Int = 0x0100
    Attribute ID 0x0009
    Type: Data Element Sequence
    Type: Data Element Sequence
    Type: UUID_16 = 0x1108
    Type: Unsigned Int = 0x0100
    Attribute ID 0x0100
    Type: Text String = Headset unit
    Attribute ID 0x0302
    Type: Boolean = TRUE

    HFRE16>OPENHANDSFREECLIENT 1 2
    Bluetooth Device Address: 0x001167111157
    Open Remote HandsFree Port = 0002
    HFRE_Open_Remote_Audio_Gateway_Port: Function Successful (ID = 0001).

    HFRE16>
    HFRE Open Port Confirmation, ID: 0x0001, Status: 0x0000.

    HFRE16>
    HFRE Close Port Indication, ID: 0x0001, Status: 0x0001.

    HFRE16>
  • Hi Nishantha,

    Thanks for your help. You made my day!

  • Mr. Sandeep Mandaw,
    Dear Sir,

    I have modify the demo project with adding the above code line, but the problem is, continuing with closing the port, why? I need to fix this problem and I need your help.
    Best Wishes

    static UUIDInfo_t UUIDTable[] = { "HFP", { 0x00, 0x00, 0x11, 0x1E, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB } }


    OpenStack().
    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    Bluetooth Stack ID: 1.
    WBS Support initialized.
    Device Chipset Version: Unknown (greater 4.0)
    Bluetooth Device Address: 0x0017e950631b
    GAP_Set_Connectability_Mode(cmConnectable).
    GAP_Set_Discoverability_Mode(dmGeneralDiscoverable, 0).
    GAP_Set_Pairability_Mode(pmPairableMode).
    GAP_Register_Remote_Authentication() Success.

    ******************************************************************
    * Command Options: Inquiry, DisplayInquiryList, Pair, *
    * EndPairing, PINCodeResponse, PassKeyResponse, *
    * UserConfirmationResponse, *
    * SetDiscoverabilityMode, SetConnectabilityMode,*
    * SetPairabilityMode, *
    * ChangeSimplePairingParameters, *
    * GetLocalAddress, GetLocalName, SetLocalName, *
    * GetClassOfDevice, SetClassOfDevice, *
    * GetRemoteName, OpenHFServer, CloseHFServer *
    * ManageAudio, AnswerCall, HangUpCall, Close, *
    * OPENHANDSFREECLIENT, SERVICEDISCOVERY, *
    * Help *
    ******************************************************************

    HFRE16>SetLocalName tivahfp
    Local Device Name set to: tivahfp.

    HFRE16>Inquiry
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.

    HFRE16>
    GAP Inquiry Entry Result: 0x001167111157.

    HFRE16>
    GAP_Inquiry_Result: 1 Found.
    GAP Inquiry Result: 1, 0x001167111157.

    HFRE16>GetRemoteName 1
    GAP_Query_Remote_Device_Name: Function Successful.

    HFRE16>
    GAP Remote Name Result: BD_ADDR: 0x001167111157.
    GAP Remote Name Result: F515.

    HFRE16>SERVICEDISCOVERY
    Usage: ServiceDiscovery [Inquiry Index] [Profile Index] [16/32 bit UUID (Manual only)].

    Profile Index:
    0) Manual (MUST specify 16/32 bit UUID)
    1) L2CAP
    2) Advanced Audio
    3) A/V Remote Control
    4) Basic Imaging
    5) Basic Printing
    6) Dial-up Networking
    7) FAX
    8) File Transfer
    9) Hard Copy Cable Repl.
    10) Health Device
    11) Headset
    12) Audio gateway
    13) HID
    14) LAN Access
    15) Message Access
    16) Object Push
    17) Personal Area Network
    18) Phonebook Access
    19) SIM Access
    20) Serial Port
    21) IrSYNC
    22) HFP

    Function Error.

    HFRE16>SERVICEDISCOVERY 1 22
    SDP_Service_Search_Attribute_Request(HFP) Success.

    HFRE16>
    atPINCodeRequest: 0x001167111157

    Respond with the command: PINCodeResponse

    HFRE16>PINCodeResponse 0000
    GAP_Authentication_Response(), Pin Code Response Success.

    HFRE16>
    atLinkKeyCreation: 0x001167111157
    Link Key: 0x958304300b0c43f1077c31c0286d8c16
    Link Key Stored locally.

    HFRE16>
    SDP Service Search Attribute Response Received (Size = 0x0010)
    Service Record: 1:
    Attribute ID 0x0000
    Type: Unsigned Int = 0x00010003
    Attribute ID 0x0001
    Type: Data Element Sequence
    Type: UUID_16 = 0x111e
    Type: UUID_16 = 0x1203
    Attribute ID 0x0004
    Type: Data Element Sequence
    Type: Data Element Sequence
    Type: UUID_16 = 0x0100
    Type: Data Element Sequence
    Type: UUID_16 = 0x0003
    Type: Unsigned Int = 0x01
    Attribute ID 0x0006
    Type: Data Element Sequence
    Type: Unsigned Int = 0x656e
    Type: Unsigned Int = 0x006a
    Type: Unsigned Int = 0x0100
    Attribute ID 0x0009
    Type: Data Element Sequence
    Type: Data Element Sequence
    Type: UUID_16 = 0x111e
    Type: Unsigned Int = 0x0105
    Attribute ID 0x0100
    Type: Text String = Hands-free unit
    Attribute ID 0x0311
    Type: Unsigned Int = 0x001a

    HFRE16>OPENHANDSFREECLIENT 1 1
    Bluetooth Device Address: 0x001167111157
    Open Remote HandsFree Port = 0001
    HFRE_Open_Remote_Audio_Gateway_Port: Function Successful (ID = 0001).

    HFRE16>
    HFRE Open Port Confirmation, ID: 0x0001, Status: 0x0000.

    HFRE16>
    HFRE Close Port Indication, ID: 0x0001, Status: 0x0001.

    HFRE16>
  • Hi,

    Run the command as SERVICEDISCOVERY 1 12. So that you can get the services of the remote Audio gateway.

    As mentioned earlier in this post and in the mail (I sent you), this is not a HFP Audio gateway demo, You are trying to connect a handsfree to a handsfree which is not possible. You can only connect to a audio gateway from this Handsfree (HFPDemo).

    Audio gateway API's are not enabled in the libraries provided in Latest SDK's available currently, So even you try to write your own app, It will not work. only HFP (handsfree role) is available as part of the current release
  • Mr. Sandeep Mandawa

    Dear Sir,

    Thank you very much. You answer is clear to me, no point to spend more time with CC25564. Would you mind to recommend deferent Bluetooth module or IC for my project? What I need is, dual concurrent SCO connection capability, and full functioning API set with audio gateway support. I have full version of Keil uVersion5, if I can develop the project based on Keil, that will be excellent.

    Beside your super vision, I don’t want to go through surfing the Ti website myself. Because, I have done this before. I took almost one month for searching a solution for my design and finally came up with ultimate CC2564, because it was the best and identical solution as far as what I found. However, I didn’t know it doesn’t supports with audio gateway. It is hard to say, buy looking at the API, weather it works or not. I do system design, also freelancer, we don’t have time to engage with developing Ti products, what we need is solutions which ready to go on our design that because we have lot more works do with our project design.

    I have my personal opinion. I think you must lunch full functioning API as soon as possible. People who buy your products they don’t buy it for manufacturing what you want, they want to produce the items what they want. You must activate the full set of API’s as soon as possible and let them to take control over it.

    Thank you

    Best Wishes

  • Hi,

    CC256x does not have any limitation, It is the Bluetopia stack we provide, does not have support for Audio gateway currently.
    And we are planning to add it in our future releases.
  • Hi Sundeep:
    I wanted to chime in here (I had initiated this thread in Aug 2014).
    We do appreciate your ongoing involvement here and attempts to help (at least someone is listening and responding, even if its not with answers we want to hear!)
    As is the case today, Dual SCO is prominently highlighted on the CC2564 web page and docs. And was the primary reason to select this module for our project. We have always understood that its the stack that has the limitations. But its also understood that TI would have no takers on the hardware product if there were no accompanying stack.

    Most of the frustration has been with incomplete or incorrect documentation that up-front indicates what the limitations are, whats implemented, whats not, whats the timeline. So we do not spend months working with the product to eventually discover that what we intended is not possible. We are approaching such a situation in dealing with iPhones right now. Its taken a lot of effort to get Dual SCO to 'kind of' do what we want, but there are still plenty of uncertainties about how we will handle state changes when one device drops/reconnects etc.

    It was a surprise to us for example that HFP-AG is not supported. Luckily we can solve this by use of a different module acting as our Base unit.

    I would suggest an appnote dedicated to HFP and SCO with example code and a complete detail of capabiity / limitations.

    Its clear that the SSO acquisition precipitated some of this turmoil, where you perhaps lost the primary developers. Hopefully TI still owns the source code and can rebuild the resources necessary to support it and develop further. btw - your website still states that SSO is a partner.

    Regards - Daraius
  • Hi Nishantha: We have not found any other module capable of Dual SCO. We had discussions with BlueCreations - they were willing to implement this on their BC127 module for an NRE fee. However they could not commit to availability of a Class 1.5 or long range module, so that was not a fit for us (we need the longer range).
    Daraius
  • I would also suggest a Reference Design/Eval board to test HFP with. It took a lot of effort to tack on a suitable codec to simply be able to witness 2-way audio. Kind of messy with a Tiva Eval Board, CC2564MOD, Codec Eval board. We did not want to commit to doing a custom board due to all the uncertainty. And a good thing, since along the way we switched from MSP430 to Tiva! Your existing designs simply focus on A2DP source/sink.
  • Hello Sundeep,

       We have encountered a new problem with all devices using the HFPDemo.

    Dual SCO only appears possible if we allow the pairing process to be initiated by the HFRE_Open_Remote_Audio_Gateway_Port command.  If I first manually pair my devices and then open the remote port, the second SCO connection fails.   The logs reveal no obvious clue to what is going on.  

    It also does not appear to be possible to PAIR after an SCO connection is established unless you initiate it by the HFRE_Open_Remote_Audio_Gateway_Port command. 

    How/why is HFRE_Open_Remote_Audio_Gateway_Port capable of initiating pairing?   What is different about this pairing then when manually initiated with GAP_Initiate_Bonding() ?

    Is this taking place somewhere in the compiled stack libraries?  I see no calls to GAP_Initiate_Bonding()  or to the Pair() function from within the demo application.  

    This behavior isn't described in any documentation I've found.  Thank you for explaining it further.

    Thank you,

    - Jason

  • I've been working on this non-stop, and have come to the conclusion something is broken in the stack. The behavior I am seeing is completely random.

    Here is a link to logs demonstrating a success and a failure -

    drive.google.com/.../view

    Note:

    - I've shortened the OpenHandsFreeClient function to OpenHF, and SetPairabilityMode to SetPM to save on typing
    - The functions now take 2 parameters. The first is the paired index and the second is the port.

    The logs are damn near identical, but in one case the dual SCO works, and in the other it fails. I did a controlled comparison of 20 tests using identical steps, and only 4 out of 20 times was the dual SCO connection successful.

    Why would the ManageAudio call be returning a status 0x0001 which the BT Stack documentation lists as an unhelpful "Unknown Error" ? Is there anything I can do to learn more about why this error is being generated?

    Thank you,

    - Jason
  • Hello Daraius Hathiram1

    Thank you very much for replying, I must find a solution for my need then I can completed my project. I am already too late. I didn’t know anything about Blutopia Stack crisis and got to know after I bought two modules. I am from Asia, it cost lot more for shipping charges, than cost for the product. So it is hard case for me, other hand more than covering the investment, I must consider how to rescue my hardly made reputation which is, already melting with CC2564 and what should I write on my project report about delaying? I can say “project is ready, CC2564 also wonderful but device won’t work because stack has to be modified. Modification will be done as soon as possible, but I cannot give you a date. Please stay in tune”

    Hope they will hire me again!

    Best Wishes 

  • Hello Sundeep,

       My testing is showing the CC2564 Dual SCO error is not present when connecting to BlueGiga modules.  I have been able to reliably open and close HF SCO connections over and over to BlueGiga modules now that I have a second headset to play with. 

       But with phones (multiple Android and iOS phones) it still fails 7 out of 10 times.  When it works though, it works reliably.  I can open/close the SCO connections on each device.  I can close the HF connections and re-open them.  But after a power-cycle it often all goes back to failing.  This occurs even if I let the phone open the SCO connection, with or without an SCO connection already present.

       In an attempt to learn more about the problem, I read the SCOAPI headers and tried adding callback handlers for SCO events.  Unfortunately, these never seem to get called.  It is as though the HF SCO connections use some other, unexposed mechanism. 

       Please let me know your thoughts. 

    - Jason

       

      

     

  • Hi,

    CC256x prefers to be master on the SCO connection (for duel SCO ). If the phone is initiating the connection, we are slave (you can try doing a role switch to master and try).

    HFRE_Setup_Audio_Connection in tern calls SCO_Add_Connection() for SCO connection or SCO_Setup_Synchronous_Connection() for eSCO connection
  • Hello Sundeep,

      That may be true, but doesn't match our test results.   We have previously posted our logs.  Can you please comment on where we failed to be the master? 

    For example:

    * Open HF connection with a headshet and my phone

    * Open an audio connection to the headset

    * Call the phone - the phone then opens the SCO connection

     * Dual SCO does work occasionally (Is this what you mean by "prefers"? Can it occasionally work?)

     

       Alternatively we can

    * Open HF connection with a headshet and my phone

    * Open an audio connection to the headset

    * Manually open an SCO connection from the CC2564 to the Phone prior to any calls being made

    * Dual SCO often does NOT work (is it possible I'm still not being flagged as the master?)

    This is another thing I have noticed:

    ret_val = SCO_Register_Connect_Request_Callback(BluetoothStackID, SCO_Callback, (unsigned long)0);

    This call back is never hit when opening SCO connections from the CC2564. This call back is only hit when manually toggling audio destination (speaker vs Bluetooth) on the phone itself. 

    (Is opening an SCO connection from ManageAudio = setting CC2564 as the master?)

    ( How does one do a role switch?  Close the audio stream and re-open it?  That has never successfully fixed the problem..


    Is it possible to configure the SCO connections to only allow master connections?  The BT Stack has #defines indicating this is possible from the header files, but they do not seem to change the behavior of the system.

     

    Thank you for the help,

     - Jason

  • Anyone who like to suffer with one brand new TM4C123G with CC2564MODNEM and one month used TM4C123G with CC2564MODNEM are available for zero cost. If you are living outside of Sri Lanka then I need money for shipping or if you are in Sri Lanka, just send me an e-mails I will handover to you and no money require. I don’t want those stuff in my house anymore. As a bones you can have one brand new TM4C129 CPU, take it that too.

    Best Wishes 

  • Jason Gossiaux

    Sorry for interrupting, have you made HF connection with hands free device and CC2564? For me that didn’t work and also ret_val = SCO_Register_Connect_Request_Callback never work on my setup, however I was using HCI. If you got a way to established the HF connection between CC2564 and hands free device? If yes, Ooh!! Thanks to the Jason Gossiaux, I am done my project, then I don’t need to give away my project board or put those on railway track.

    Best Wishes
  • Hello Nishantha,

    The TI version of the BT stack has AudioGateway support disabled. Trying to open an AG server returns an "unsupported" error. Likewise, trying to use HFRE_Open_Remote_HandsFree_Port() fails.

    Our application involves connecting to other HF devices with AG role enabled such as Phones and BlueGiga modules. Without AG support on the CC2564 I do not believe you can connect to HF devices lacking the AG role.

    Furthermore, Sundeep has said that HCI audio is not recommended on the CC2564 and you are likely to get poor quality. I'm not sure why, it appears to be another limitation of the stack.

    So if you do not need dual SCO audio I'd recommend pursuing a different module solution.


    - Jason
  • Jason Gossiaux

    Thank you for replying, I am confuse little bit. Are you performing your test with Bluegiga module? Does it has AG enable? I need dual module because I am also working on the project similar to your one. My need is, connect my smart phone with hands free device through CC2564. CC2564 is a central device.

    Best wishes
  • Hello again Sundeep,

     I replaced the calls to HFRE_Setup_Audio_Connection() with SCO_Add_Connection(), then hooked up a new event callback to it.

     Randomly I will get an ERROR CODE 28 SCO_INTERVAL_REJECTED when adding the second SCO connection. 

     This is off a fresh power up and connection to a phone and headset.   Closing/reopening the SCO and/or HF connections does not fix it.  

     Do you have any thoughts on what this error means and how we might work around it?

    Thank you,

    - Jason

  • Hello Nishantha,

    The CC2564 is our headset, and the BlueGiga module is the base. We wish to open HF connections with Dual SCO from the CC2564 to the Base and a Phone. Luckily the BlueGiga module has AG role enabled, so this works. BlueGiga does not have Dual SCO, so I do not believe it would work for your application.

    Does this make sense?


    - Jason