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

The demo application provides a description on how to use the demo application to connect two configured boards and communicate over bluetoothLE. The included application registers a custom service on a board when the stack is initialized.


Device 1 (Host/ HID Host) setup on the demo application
  1. We will setup the first board as a Host. 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 Device or Client.
  2. On the Choose mode> prompt, enter Host.
  3. You will see a list of all possible commands at this time for a Host. You can see this list at any time by entering Help at the Host> prompt.
    GUID-20210311-CA0I-G73P-TBFG-PBVQC0THHVMZ-low.png Figure 7-2 HID Demo Register Server Terminal
  4. At the Host> prompt, enter Inquiry This will initiate the Inquiry process. Once it is complete, you will get a list of all discovered devices.
    GUID-20210311-CA0I-LH8D-4ZVZ-2MBCH94T74H4-low.png Figure 7-3 HID Demo Inquiry Result Terminal
  5. You can access this list any time by choosing DisplayInquiryList at the Host> prompt.
Device 2 (Client/HID Device) setup on the demo application
  1. We will setup the second board as a Device. Perform the steps mentioned earlier in Running the Bluetooth Code section to initialize the application. On the Choose mode> prompt, enter Device.
  2. You will see a list of all possible commands at this time for a Device. You can see this list at any time by entering Help at the Device> prompt.
    GUID-20210311-CA0I-SNMR-ZNMH-RRJDKM9NQDCN-low.png Figure 7-4 HID Demo SDP Record Terminal
Initiating connection from the HID Host
Note: When connecting for the first time, the connection should be initiated from the HID Host Device. If not the connection will be rejected as the HID Host will not allow a connection from an unknown HID Device.
  1. Note the index number of the second board that was configured as a HID Device. [If the list is not on the screen, issue the DisplayInquiryList command on the client to display the list of discovered devices.]
  2. Issue a ConnectRemoteHIDDevice <Inquiry Index> command from the Device.
  3. Wait for HID Open confirmation.
    GUID-20210311-CA0I-5QC6-PSLJ-4WK3TR3JVV8S-low.png Figure 7-5 HID Demo Connect Device Terminal
    Note: A status of 0x0000 means the connection was successful. Any other status implies that the connection did not succeed.
  4. When a client successfully connects to a server, the server will see the open indication.
    GUID-20210311-CA0I-H3MN-VVPF-V9XBXBTXJFRQ-low.png Figure 7-6 HID Demo Open Indication Terminal
Initiating connection from the HID Device

Initiating a connection from the HID Device is the same as the procedure as the Host except that we run the inquiry(mentioned in Step 4) on the HID Device instead and issue a ConnectRemoteHIDHost <Inquiry Index> where the Inquiry Index is the number that corresponds to the BD-ADDR of the Host when we run the inquiry.

GUID-20210311-CA0I-FXJC-CTDZ-3R3DVB7FHVPV-low.png Figure 7-7 HID Demo Connect Device Terminal 2
Communication between Host and Device
  1. Now that we have a connection established, the Host and Device can communicate with each other.
  2. We can send a control operation from either the Host or the Device using the ControlRequest command. For the Host we issue the Controlrequest <parameter-number> command. The options for control request are 0= hcNop, 1= hcHardReset, 2= hcSoftReset, 3= hcSuspend, 4=hcExitSuspend, 5=hcVirtualCableUnplug. When we type Control Request 5 on the Host we get the following message.
    GUID-20210311-CA0I-T341-4Q4P-8WJWVSHHHKVM-low.png Figure 7-8 HID Demo Connect Device Terminal

    On the Deviced side, we get a hcVirtualCableUnplug indication.

    GUID-20210311-CA0I-PJLG-NTGK-SFKTGHW9VQGQ-low.png Figure 7-9 HID Demo Control Indication Terminal

    The Device controlRequest has no parameters. It does hcVirtualCableUnplug by defalt.

    GUID-20210311-CA0I-JV1C-8ZNM-CDLJV6HKFKWT-low.png Figure 7-10 HID Demo Control Indication Terminal 2
  3. We can make Report Requests issuing the GetReportRequest command. It needs either 3 or 4 parameters. The first one is Size which is 0 for using the size of the Report or 1 for using a custom buffer size. The second is ReportType which is 0 for rtOther, 1 for rtInput, 2 for rtOutput, and 3 for rtFeature. The third is ReportID. IF we used a custom buffer for size in the first parameter we specify it here. For example, we send a Report Request with size of Report, rtInput and ReportID of 2. We get a Report Request Success indication.
    GUID-20210311-CA0I-NGLM-HRFT-FGQSCLL2DLP7-low.png Figure 7-11 HID Demo GetReportRequest

    On the Device, we receive a get Report Indication with the Report Type, Id and size and Buffer size.

    GUID-20210311-CA0I-VCNQ-QJHR-WJX7JFPHXDZG-low.png Figure 7-12 HID Demo Get Report Indication Terminal

    The Device can respond to GetReportRequest using GetReportResponse. It needs the Result type (0 for rtSuccessful, 1 for rtNotReady, 2 for rtErrInvalidReportID, 3 for rtErrUnsupportedRequest, 4 for rtErrInvalidParameter, 5 for rtErrUnknown, 6 for rtErrFatal, 7 for rtData) and ReportType (0 for rtOther, 1 for rtInput, 2 for rtOutput, 3 for rtFeature) as parameters. For example we respond to the above rtInput request from the Host with rtData as Result type and rtInput as Report Type.

    GUID-20210311-CA0I-T341-4Q4P-8WJWVSHHHKVM-low.png Figure 7-13 HID Demo Get Report Response Terminal

    The Host gets a report Confirmation back.

    GUID-20210311-CA0I-FNZW-72QP-4NMCPTTFGQ6J-low.png Figure 7-14 HID Demo Get Report Confirmation Terminal
  4. We can run SetReportRequest from the Host. The only parameter it needs is the report type which is 0 for rtOther, 1 for rtInput, 2 for rtOutput, and 3 for rtFeature.
    GUID-20210311-CA0I-FK5K-QMFQ-ZB6FRD0B82FG-low.png Figure 7-15 HID Demo SetReportRequest Terminal

    The Device gets a Set Report Indication with the Report type.

    GUID-20210311-CA0I-JPTJ-5PCK-LK93VCXMQKD1-low.png Figure 7-16 HID Demo SetReport Indication Terminal

    The Device can respond to SetReportRequest by issuing the SetReportResponse command. The only parameter it needs is Result type (0 for rtSuccessful, 1 for rtNotReady, 2 for rtErrInvalidReportID, 3 for rtErrUnsupportedRequest, 4 for rtErrInvalidParameter, 5 for rtErrUnknown, 6 for rtErrFatal, 7 for rtData). For example we respond to the above rtInput Report request using rtSuccesful.

    GUID-20210311-CA0I-LPZJ-DNRH-ZD4MGDN5QCKF-low.png Figure 7-17 HID Demo Set Report Response Terminal

    The Host receives a Set Report confirmation indication with the Result type.

    GUID-20210311-CA0I-FNZW-72QP-4NMCPTTFGQ6J-low.png Figure 7-18 HID Demo Set Report Confirmation Terminal
  5. We can send a Protocol Request using GetProtocolRequest. It requires no parameters.
    GUID-20210311-CA0I-P4NX-S2GV-0PNXHFQK7GDH-low.png Figure 7-19 HID Demo GetProtocolRequest Terminal

    The Device gets a Protocol Indication.

    GUID-20210311-CA0I-B2VB-300P-5MWMXJ57JJFK-low.png Figure 7-20 HID Demo Get Protocol Indication Terminal

    The Device can respond to the Protocol Request by issuing the GetProtocolResponse command. It requires two parameters, Result type (0 for rtSuccessful, 1 for rtNotReady, 2 for rtErrInvalidReportID, 3 for rtErrUnsupportedRequest, 4 for rtErrInvalidParameter, 5 for rtErrUnknown, 6 for rtErrFatal, and 7 for rtData) and Protocol (0 for ptBoot and 1 for ptReport). For example, we respond to the previous Request with rtData and ptBoot.

    GUID-20210311-CA0I-ZH55-T17W-VMKK1XJ2BKS1-low.png Figure 7-21 HID Demo Get Protocol Response Terminal 2

    The Host gets a protocol confirmation with the Result type and Protocol.

    GUID-20210311-CA0I-N2CW-G3PG-DKLDMW2QWZRF-low.png Figure 7-22 HID Demo Get Protocol Confirmation Terminal 2
  6. We can issue SetProtocolRequest from the Host. The only parameter we need is the protocol(0 for ptBoot and 1 for ptReport). For example we send a request with ptReport.
    GUID-20210311-CA0I-ZXGT-X7RM-QKKXFRCXN36W-low.png Figure 7-23 HID Demo SetProtocolResponse Terminal 2

    The Host gets a Set Protocol Indication along with the protocol. It can respond to it by issuing the SetProtocolResponse command which requires Result type as the parameter (0 for rtSuccessful, 1 for rtNotReady, 2 for rtErrInvalidReportID, 3 for rtErrUnsupportedRequest, 4 for rtErrInvalidParameter, 5 for rtErrUnknown, 6 for rtErrFatal, and 7 for rtData).

    GUID-20210311-CA0I-SHGQ-HMXG-N316RGGR2DNN-low.png Figure 7-24 HID Demo SetProtocolIndication Terminal 2

    We get a Protocol Confirmation with the Result type in the Host.

    GUID-20210311-CA0I-MTMC-RPRV-X5ZW9DVSP9WJ-low.png Figure 7-25 HID Demo Set Protocol Confirmation Terminal 2
  7. We can set the Idle request issuing the GetIdleRequest command. It requires no parameters.
    GUID-20210311-CA0I-BMCD-8P47-NR3B9TRBZRQS-low.png Figure 7-26 HID Demo GetIdleRequest Terminal

    The Device gets a GetIdleIndication.

    GUID-20210311-CA0I-NWJC-HNPT-C9D5CMTN9W7M-low.png Figure 7-27 HID Demo Get Idle Indication Terminal

    It can respond to it with a GetIdleResponse which requires Result type (0 for rtSuccessful, 1 for rtNotReady, 2 for rtErrInvalidReportID, 3 for rtErrUnsupportedRequest, 4 for rtErrInvalidParameter, 5 for rtErrUnknown, 6 for rtErrFatal, and 7 for rtData) and Idle Rate as parameters. For example we respond with a Result type of rtData and Idle Rate of 50.

    GUID-20210311-CA0I-ZTF1-SVM1-WDZH4QPCMM5W-low.png Figure 7-28 HID Demo Get Idle Response Terminal

    On the Host we get a Idle Confirmation.

    GUID-20210311-CA0I-8ZXK-KZZM-9FMT3Q6LLDVL-low.png Figure 7-29 HID Demo Get Idle Confirmation Terminal 2
  8. We can Set the Idle Rate using SetIdleRequest from the Host which requires Idle rate as the only parameter. For example we set the Idle rate to 50 from here.
    GUID-20210311-CA0I-DF4B-6SBN-253GZV9KR1WL-low.png Figure 7-30 HID Demo Set Idle Request Terminal 2

    The Device receives a Set Idle Indication. It can respond to it using Set Idle Response which requires Result type (0 for rtSuccessful, 1 for rtNotReady, 2 for rtErrInvalidReportID, 3 for rtErrUnsupportedRequest, 4 for rtErrInvalidParameter, 5 for rtErrUnknown, 6 for rtErrFatal, and 7 for rtData) as its one parameter.

    GUID-20210311-CA0I-SSLT-XVRB-9C5S916XWXRX-low.png Figure 7-31 HID Demo Set Idle Indication 2

    We get a SetIdleConfirmation with the Result type on the Host

    GUID-20210311-CA0I-DBK8-NKHR-BT5X6WKDHSNZ-low.png Figure 7-32 HID Demo Set Idle Confirmation Terminal 2
  9. We can write data between devices using DataWrite. The one parameter it needs is ReportType (0 for rtOther, 1 for rtInput, 2 for rtOutput, and 3 for rtFeature). We write data from the Device in this example.
    GUID-20210311-CA0I-BQDX-PJ2N-QTBJFSXV0VVV-low.png Figure 7-33 HID Demo DataWrite Terminal

    The Host gets a Data indication.

    GUID-20210311-CA0I-H9JS-P2Q9-XWM60FKTTKQZ-low.png Figure 7-34 HID Demo Data Indication Terminal