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 board and communicate over Bluetooth. Bluetooth SPP 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. Perform the steps mentioned earlier in "Running the Bluetooth Code" section to initialize the application. Once initialized, note the Bluetooth address of the server. We will later use this to initiate a connection from the client.
  2. On the "Choose mode>" prompt, enter Server.
  3. You will see a list of all possible commands at this time for a server. You can see this list at any time by entering Help at the Server> prompt.
  4. Now we are ready to open a server. To open a server, at the "Server>" prompt, enter Open 1. You can replace 1 with any number between 1 and 30, as long as there is no server open on that port. Once you see "Server opened: 1", you have a SPP server open on port 1.
    GUID-20210311-CA0I-J0V9-8WD9-KV9HGBX81876-low.png Figure 11-2 SPP Demo Server Setup
Client setup and device discovery on the demo application
  1. We will setup the second board as a client. Perform the steps mentioned earlier in "Running the Bluetooth Code" section to initialize the application. On the "Choose mode>" prompt, enter Client.
  2. You will see a list of all possible commands at this time for a Client. You can see this list at any time by entering Help at the Client> prompt.
  3. At the "Client>" prompt, enter Inquiry. This will initiate the Inquiry process. Once it is complete, you will get a list of all discovered devices.
  4. You can access this list any time by choosing DisplayInquiryList at the Client prompt.
    GUID-20210311-CA0I-V4H6-40DL-F0WZQ15SRLTX-low.png Figure 11-3 SPP Demo Client Setup
Initiating connection from the client
  1. Note the index number of the first board that was configured as a server. [If the list is not on the screen, issue DisplayInquiryList command on the client to display the list of discovered devices again.]
  2. Issue a Open <index number> <server port number> command at the command prompt.
  3. Wait for SPP Open confirmation. l) When a client successfully connects to a server, the server will see the open indication.
    GUID-20210311-CA0I-R1MV-TXJV-MHRZ3BTTX8SH-low.png Figure 11-4 SPP Demo Client Connection
    GUID-20210311-CA0I-RPC7-X2ZL-J8KZH3JMHLRB-low.png Figure 11-5 SPP Demo Server Connection
Data Transfer between Client and Server
  1. Now we have a SPP connection established and both devices are ready to transmit data to each other.
  2. On Client or Server you can send some data to the remote side by issuing a Write command. This command sends a hardcoded test string to the other side.
  3. The remote side will receive a data indication
  4. The user can read the data by issuing a Read command.
  5. The connection can be closed on either side by issuing the close command. In the example the client closes the connection and the server receives a close indication.
    GUID-20210311-CA0I-SJF2-F12H-MHHSJDHFZNJG-low.png Figure 11-6 SPP Demo Client Connection and Data Transfer
    GUID-20210311-CA0I-CDKL-4RNW-QSBJMVLZCL81-low.png Figure 11-7 SPP Demo Server Connection and Data Transfer
Example connection using Blueterm

We will demonstrate a SPP connection using Blueterm. Blueterm is an app that can be used to connect an Android device to the SPPDemo. For more about the app refer to BlueTerm-Google Play.

Note: The app requires Android V2.1 and above.
  1. Open a server port on the MSP430.
    GUID-20210311-CA0I-LGKB-2TLG-D5G4CF67VWQL-low.png Figure 11-8 SPP Demo Multiple SPP
  2. To connect to the device, open blueterm, press the menu button and hit the connect icon.
    GUID-20210311-CA0I-M83H-DXJC-TKZWRMQLFQGW-low.png Figure 11-9 SPP Demo Connect on Blueterm
  3. The app should show a list of paired devices. If the device is not already paired, select scan. It should search for available bluetooth devices.
    GUID-20210311-CA0I-RN0D-KLNN-F07LT5RNNJMT-low.png Figure 11-10 SPP Demo Available devices
  4. Select and Pair it with the device running the SPPdemo. If it needs a pincode enter a pincode on the app/phone. The MSP430 will prompt for a PINCodeResponse. Type PINCodeResponse <the pin code you used for the phone> in the prompt. It will pair and you should see an open indication on the MSP430.
    GUID-20210311-CA0I-NXQG-HCNG-RPNKZMFRTB4P-low.png Figure 11-11 SPP Demo MSP430 PINCodeResponse
  5. The two devices are now connected. Data can be sent/received from the two devices as shown here.
    GUID-20210311-CA0I-KQPD-BK0T-48HT0JVWZH6N-low.png Figure 11-12 SPP Demo Test Terminal
    GUID-20210311-CA0I-V35K-7PSN-2VNT70DGTZDH-low.png Figure 11-13 SPP Demo Test Terminal 2
Note: If you are having difficulty connecting to the sppdemo, first pair with the device under your phone's bluetooth settings and then select the device from the list of paired devices when you select connect device in blueterm. In the shipped SPP application that is a part of the SPP/SPPLE application , using the write command sends 76 bytes to the other device. It is not possible for the sender to send all 76 bytes at once because of the limitations on buffers that are smaller to reduce RAM usage. So the code sends 31 bytes and waits until the other side is ready to receive more. The other side will not be ready until it reads the sent data by calling a read operation. So the idea is to call Read whenever the receiver receives an SPP Data Indication and all data that was sent will be read.

An example communication:

SPP+LE>write

Wrote: 76.


SPP+LE>

Transmit Buffer Empty Indication, ID: 0x0001

 

Here is the Server side (who is receiving the data):

 
SPP+LE>

SPP Data Indication, ID: 0x0001, Length: 0x0026.

 
SPP+LE>read

Read: 31.

Message: ~!@#$%^&*()_+`1234567890-=:;"'<

Read: 7.

Message: >?,./@A

Read: 0.

 
SPP+LE>

SPP Data Indication, ID: 0x0001, Length: 0x0026.

 
SPP+LE>read

Read: 31.

Message: BCDEFGHIJKLMNOPQRSTUVWXYZ[\]`ab

Read: 7.

Message: cdefghi

Read: 0.

So we have:
31+31+7+7=76.