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 two configured boards and communicate over Bluetooth. The Bluetooth Heart Rate Service (HRS) is a simple Client-Server connection process. We will setup one of the boards as a Server and the other board as a Client. We will then initiate a connection from the Client to the Server. Once connected, we can transmit data between the two devices over Bluetooth.

Server setup on the demo application
  1. We will setup the first board as a Server. Note the Bluetooth address of the Server; we will later use this to initiate a connection from the Client.
  2. Two commands are all that is needed to setup the Server. The first is RegisterHRS, so issue the RegisterHRS 1 command.
  3. Now use the AdvertiseLE command by issuing the AdvertiseLE 1 command.
    GUID-20210311-CA0I-ZDDP-JWVT-KBWVRJCTSPZF-low.png Figure 15-2 HRP Demo Register HRS and Advertise
Initiating connection from the Client
Note: Steps 1 and 2 are optional if you already know the Bluetooth address of the device that you want to connect to.
  1. The Client LE device can try to find which LE devices are in the vicinity issuing the command: StartScanning.
  2. Once you have found the device, you can stop scanning by issuing the command: StopScanning
    GUID-20210311-CA0I-4LRK-D5BH-6J5XQ2HZVXVB-low.png Figure 15-3 HRP Demo Scanning
  3. Retrieve the Bluetooth address of the first board that was configured as a Server.
  4. Issue a ConnectLE <BD_ADDR of Server> command in the Client terminal.
  5. When a Client successfully connects to a Server, both the Client and Server will output LE_Connection_Complete and information about the current connection.
    GUID-20210311-CA0I-DMBV-0XPX-47PPPCVLQCLR-low.png Figure 15-4 HRP Demo Connect LE
Sending Heart Rate Information between Client and Server
  1. Now we have a connection established and both devices are ready to send data to each other.
  2. Before heart rate information can be sent we must first initialize commands in the Client terminal.
  3. The two commands are DiscoverHRS and ConfigureRemoteHRS, so issue the command DiscoverHRS 1. A list of supported services should be displayed.
  4. Now issue the ConfigureRemoteHRS 1 command. If the configuration succeeds information about the CCCD configuration will be displayed in the Client and Server terminals.
    GUID-20210311-CA0I-6SLS-1RHW-C7ZL2TKTCLKZ-low.png Figure 15-5 HRP Demo Discover HRS
  5. To send information about the heart rate, use the NotifyHeartRate command in the Server terminal. The parameters for the NotifyHeartRate command are [HR (BPM)] [HR Format (0 = Byte, 1 = Word)] [Sensor Contact Status (0 = Not Supported, 1 = Supported/Not Detected, 2 = Supported/Detected] [Energy Expended (0 = Don't send, 1 = Send)] [RR Intervals (0 = None, X = Number of Intervals)]. Use the parameters 80 1 2 1 0 after the command.
  6. Information about the heart rate should now be sent to the Client and be displayed in the Client terminal.
    GUID-20210311-CA0I-WXDM-7K5R-C8J0XPHW0MLH-low.png Figure 15-6 HRP Demo Notify Heart Rate
    GUID-20210311-CA0I-LKLP-1PK7-SJNJ3KBWB8XC-low.png Figure 15-7 HRP Demo Heart Rate Measurement
Setting a local appearance on the Server and checking that appearance from the Client
  1. In the Server terminal set the type of device with the command SetLocalAppearance and the parameter [index]. There are over 20 types of devices in the index, to look at them type first enter only SetLocalAppearance.
  2. Now use the DiscoverGAPS command in the Client terminal.
  3. Lastly enter GetRemoteAppearance in the Client terminal to see what type of device the Server had been set to.
Setting the location of the heart rate sensor on the Server and reading it from the Client
  1. In the Server terminal set the location of the heart rate sensor with the command SetBodySensorLocation [type]. Type = 0 – Other, 1 – Chest, 2 – Wrist, 3 – Finger, 4 – Hand, 5 - Ear Lobe, 6 – Foot.
  2. To see the location of the heart rate sensor type GetBodySensorLocation in the Client terminal.