SWRU580 April   2021 CC2564C , CC2564MODA , CC2564MODN

 

  1.   Trademarks
  2. Introduction
  3. A2DP (AUD) Demo Guide
    1. 2.1 Demo Overview
    2. 2.2 Demo Application
    3. 2.3 Application Commands
  4. A3DP Sink Demo Guide
    1. 3.1 Demo Overview
    2. 3.2 Demo Application
    3. 3.3 Sink Reference Board Demo Application
    4. 3.4 Multiple Source Demo
    5. 3.5 Application Commands
  5. A3DP Source Demo Guide
    1. 4.1 Demo Overview
    2. 4.2 Demo Application
    3. 4.3 Application Commands
  6. HFP Demo Guide
    1. 5.1 Demo Overview
    2. 5.2 Demo Application
    3. 5.3 Application Commands
  7. HFP Audio Gateway Demo Guide
    1. 6.1 Demo Overview
    2. 6.2 Demo Application
    3. 6.3 Application Commands
  8. HID Demo Guide
    1. 7.1 Demo Overview
    2. 7.2 Demo Application
    3. 7.3 Application Commands
  9. HSP Demo Guide
    1. 8.1 Demo Overview
    2. 8.2 Demo Application
    3. 8.3 Application Command
  10. Map Demo Guide
    1. 9.1 Demo Overview
    2. 9.2 Demo Application
    3. 9.3 Application Command
  11. 10PBAP Demo Guide
    1. 10.1 Demo Overview
    2. 10.2 Demo Application
    3. 10.3 Application Commands
  12. 11SPP Demo Guide
    1. 11.1 Demo Overview
    2. 11.2 Demo Application
    3. 11.3 Application Commands
  13. 12SPPLE Demo Guide
    1. 12.1 Demo Overview
    2. 12.2 Demo Application
    3. 12.3 Demonstrating SPP LE on an iOS Device with the LightBlue App
    4. 12.4 Demonstrating SPP LE on an iOS Device with the SPPLE Transfer App - LEGACY
    5. 12.5 SPP Demo
    6. 12.6 Application Commands
  14. 13SPPDMMulti Demo Guide
    1. 13.1 Demo Overview
    2. 13.2 Demo Application
    3. 13.3 Application Commands
  15. 14ANP Demo Guide
    1. 14.1 Demo Overview
    2. 14.2 Demo Application
    3. 14.3 Application Commands
  16. 15HFP Demo Guide
    1. 15.1 Demo Overview
    2. 15.2 Demo Application
    3. 15.3 Application Commands
  17. 16HTP Demo Guide
    1. 16.1 Demo Overview
    2. 16.2 Demo Application
    3. 16.3 Application Commands
  18. 17PASP Demo Guide
    1. 17.1 Demo Overview
    2. 17.2 Demo Application
    3. 17.3 Application Commands
  19. 18HOGP Demo Guide
    1. 18.1 Demo Overview
    2. 18.2 Demo Application
    3. 18.3 Application Commands
  20. 19PXP Demo Guide
    1. 19.1 Demo Overview
    2. 19.2 Demo Application
    3. 19.3 Applications Commands
  21. 20FMP Demo Guide
    1. 20.1 Demo Overview
    2. 20.2 Demo Application
    3. 20.3 Application Commands
  22. 21CSCP Demo Guide
    1. 21.1 Demo Overview
    2. 21.2 Demo Application
    3. 21.3 Application Commands
  23. 22Revision History

Demo Application

This section provides a description of how to use the demo application to connect an audio source to it and communicate over Bluetooth.

Device (sink) setup on the demo application

The STM32 board is ready to connect right after it starts, to create this connection, either the source or the sink can initialize it.

Initiating connection from the source

The A2DP source can be any application that can transmit audio. For our example, we will use an android phone as the demo. In order to connect to the sink, the source needs the sink Bluetooth address or name.

Sink Terminal

  1. The Bluetooth address can be found at the beginning of the demo application or by typing GetLocalAddress, in this case we can see the bluetooth address.
  2. The Sink name can be found by typing GetLocalName and the terminal will print the default name of the application AUDDemo
    GUID-20210311-CA0I-DMTG-SGKH-HCLQFJBTJTK0-low.jpg Figure 2-2 AUDDemo Name and Address

    Source Phone

    After the data of the sink for the connection is known:

  3. Open the Bluetooth settings menu on the android phone (Settings->Bluetooth).
  4. Hit on search for devices. The phone should begin looking for other Bluetooth devices.
    GUID-20210311-CA0I-BVPZ-KNMX-0VVQV0K8NXXL-low.png Figure 2-3 AUDDemo Searching for Devices
  5. An AUDDemo or A2DPDemo should appear like shown below in the picture. Click on the device to begin pairing.
    GUID-20210311-CA0I-3L7H-GR6K-RMPWCV13W49T-low.png Figure 2-4 AUDDemo TI Device Name
  6. Enter PIN password and remember it, in the example we use 0000.
    GUID-20210311-CA0I-XQTZ-NTZX-XNJC73WGQVF4-low.png Figure 2-5 AUDDemo Demo Pin

    Sink terminal
  7. In the Sink terminal there is a request for PIN code that to allow the pairing to complete, enter PINCodeResponse 0000.
    GUID-20210311-CA0I-TCDP-WR86-0XVF8G5QM9SG-low.jpg Figure 2-6 AUDDemo Pin Code Response
  8. After the devices are paired, the device should show connected on the phone side and on the STM32.
    GUID-20210311-CA0I-GS0C-QBLG-KVM9HRJ6VWRM-low.png Figure 2-7 AUDDemo Phone Connected
    GUID-20210311-CA0I-QLNS-GSRT-WCQWDQVGNVVG-low.jpg Figure 2-8 AUDDemo Connected From Source
  9. You can now control the audio of the phone from the STM32 board.
Initiating Connection from the Sink
Note: Make sure that the source is in discoverable mode
  1. In Order to connect to the source, the sink must find it first with inquiry command, type inquiry.
    GUID-20210311-CA0I-ND8V-WMVS-KLQKX9BVXWPH-low.jpg Figure 2-9 AUDDemo Inquiry Sink
  2. The inquiry command generates a list of all the devices in range.
  3. In order to connect to the source use the OpenRemoteSteam command with the index of the bluetooth address you want, in our case we connect to index 2, so we type OpenRemoteStream 2.
    GUID-20210311-CA0I-VGFF-JWRD-TDLGMNCWSVGW-low.jpg Figure 2-10 AUDDemo Open Remote Stream

    Sink Terminal
  4. Enter PIN password and remember it. In the example we use 0000.
    GUID-20210311-CA0I-XC6F-BP2V-ZWBS5K5KP39D-low.png Figure 2-11 AUDDemo Pin Sink
    Sink terminal
  5. In the Sink terminal there is a request for PIN code that to allow the pairing to complete, enter PINCodeResponse 0000.
    GUID-20210311-CA0I-SKKM-C22X-XBCS7ZMJRXSK-low.jpg Figure 2-12 AUDDemo Pin Code Response Sink
  6. After the devices are paired, the device should show connected on the phone side and on the STM32.
    GUID-20210311-CA0I-3KLT-TV4T-HTZGD5LJTHG0-low.png Figure 2-13 AUDDemo Phone Connect from Sink
    GUID-20210311-CA0I-XQHQ-BQWZ-41BST4WSZBW1-low.jpg Figure 2-14 AUDDemo Connected From Sink
A2DP+AVRCP Commands

Now, after the sink and the source are connected we can start controlling the audio of the source from the sink.

  1. Open any music application in the source, in the sink, in order to control the audio use SendPassThroughCommand Command and a parameter for the command. the command can be Pause = 0, Play = 1, Stop = 2, Vol. up = 3 and Vol. Down = 4.
    Note: Volume (Vol.) commands might not work with your device.
    GUID-20210311-CA0I-QNGJ-89VG-MWR1PWFSXZH8-low.jpg Figure 2-15 AUDDemo Send Pass Through Command
  2. Type SendPassThroughCommand 1. A track will start playing on the devices.
    GUID-20210311-CA0I-S7KG-MXW5-R2NF3444DQSL-low.jpg Figure 2-16 AUDDemo Send Pass Through Command 1
  3. Type SendPassThroughCommand 2. A track will stop playing on the devices.
    GUID-20210311-CA0I-2PR1-BFQN-TPGQLSWT5LBV-low.jpg Figure 2-17 AUDDemo Send Pass Through Command 2
  4. In order to change the Stream format: Sample rate and Mono/Stereo, use the ChangeStreamFormat command and a value which represent the supported format index that is needed.
  5. The supported sink formats and their indexes can be displayed by typing QuerySupportedFormats.
    Note: The connection must be in suspend in order to work. ChangeStreamFormat might not work with your device.
    GUID-20210311-CA0I-DKKZ-FFMK-MCVFWJCNBSGQ-low.jpg Figure 2-18 AUDDemo Change Stream Format

    The First Number is the index that you choose, the second number is the sample rate in Hz and the third number represents 1 = Mono, 2 = Stereo.

  6. In order to change the Stream State: Stopped or Started, use the Changestreamstate command and a value which represent the stream state 0 = Stopped, 1 = Started. When the Command Changestreamstate 0 is sent, the devices will enter to suspend mode of A2DP.
    Note: Changestreamstate might not work with your device.
    GUID-20210311-CA0I-HTGR-ZNTB-PVJD9MXK7G97-low.jpg Figure 2-19 AUDDemo Change Stream State
  7. The command ChangeConnectionMode enable the sink to allow automatically or manual connections or disallow connection, use the ChangeConnectionMode command and a value which represent the connection mode Automatic Accept = 0, Automatic Reject = 1, Manual Accept = 2.
    GUID-20210311-CA0I-TSJ4-RVMC-JG3F4LVWVXJN-low.jpg Figure 2-20 AUD Demo Change Connection Mode