SWRA770 august   2023 CC2564C

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Demo Overview
  5. 2Running the Bluetooth Code
  6. 3Demo Application
    1. 3.1 Device 1 (Host/HID Host) Setup on the Demo Application
    2. 3.2 Device 2 (Client/HID Device Setup on the Demo Application
    3. 3.3 Initiating Connection from the HID Host
    4. 3.4 Initiating Connection from HID Device
    5. 3.5 Communication Between Host and Device
  7. 4Application Commands
  8. 5Gap Commands
    1. 5.1  Help (DisplayHelp)
    2. 5.2  Inquiry
    3. 5.3  Display Inquiry List
    4. 5.4  Pair
    5. 5.5  End Pairing
    6. 5.6  PIN Code Response
    7. 5.7  Pass Key Response
    8. 5.8  User Confirmation Response
    9. 5.9  Set Discoverability Mode
    10. 5.10 Set Connectability Mode
    11. 5.11 Set Pairability Mode
    12. 5.12 Change Simple Pairing Parameters
    13. 5.13 Get Local Address
    14. 5.14 Set Local Name
    15. 5.15 Get Local Name
    16. 5.16 Set Class of Device
    17. 5.17 Get Class of Device
    18. 5.18 Get Remote Name
  9. 6Human Interface Demo Profile
    1. 6.1 Host
      1. 6.1.1  Connect Remote HID Device
      2. 6.1.2  Close Connection
      3. 6.1.3  Control Request
      4. 6.1.4  Get Report Request
      5. 6.1.5  Set Report Request
      6. 6.1.6  Get Protocol Request
      7. 6.1.7  Set Protocol Request
      8. 6.1.8  Get Idle Request
      9. 6.1.9  Set Idle Request
      10. 6.1.10 Data Write
    2. 6.2 Client
      1. 6.2.1 Get Report Response
      2. 6.2.2 Set Report Response
      3. 6.2.3 Get Protocol Response
      4. 6.2.4 Set Protocol Response
      5. 6.2.5 Get Idle Response
      6. 6.2.6 Set Idle Response
  10. 7References
  11. 8Revision History

Communication Between Host and Device

  1. Now that a connection is 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-20230228-SS0I-9K7G-FTNJ-0PNJR4HM4KRS-low.png

    On the device side, a hcVirtualCableUnplug indication appears.


    GUID-20230228-SS0I-0VGH-BR5D-WTTVQ9QR8RV2-low.png

    For the DeviceControlRequest has no parameters. This does hcVirtualCableUnplug by default.


    GUID-20230228-SS0I-0NWG-4ZL4-TB5WFBRMJ6N0-low.png

    On the host side, a hcVirtualCableUnplug indication appears.


    GUID-20230228-SS0I-HGQX-ZQVV-JRHQ6V81FXWP-low.png

  3. Make Report Requests by issuing the GetReportRequest command. This 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 a custom buffer for size is used in the first parameter, specify that here. For example, send a Report Request with size of Report, rtInput and ReportID of 2. Observe a Report Request Success indication.
    GUID-20230228-SS0I-FRXN-TFJF-57NV67GH6VNJ-low.png

    On the device, observe a report indication with the report type, ID, size, and buffer size.


    GUID-20230228-SS0I-RGX2-HRKD-LNVH1BZ7C9VG-low.png

    The device can respond to GetReportRequest using GetReportResponse. This needs the Result type (0 for rtSuccessful, 1 for rtNotReady, 2 for rtErrInvalidReportID, 3 forrtErrUnsupportedRequest, 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, respond to the above rtInput request from thehost with rtData as Result type and rtInput as Report Type.


    GUID-20230228-SS0I-TDLW-ZZS7-G3V6V5BHZTF9-low.png

    The host gets a report confirmation back.


    GUID-20230228-SS0I-V3SJ-CD4Z-LDTKTWT9X6N8-low.png

  4. Run SetReportRequest from the Host. The only parameter needed is the report type which is 0 for rtOther, 1 for rtInput, 2 for rtOutput, and 3 for rtFeature.
    GUID-20230228-SS0I-QGKT-TP7P-KGB00WJZVQT6-low.png

    The device gets a SetReportIndication with the Report type.


    GUID-20230228-SS0I-5LT4-HNLF-KPT25WQKRLM5-low.png

    The device can respond to SetReportReques t by issuing the SetReportResponse command. The only parameter needed is Result type (0 for rtSuccessful, 1 for rtNotReady, 2 forrtErrInvalidReportID, 3 for rtErrUnsupportedRequest, 4 for rtErrInvalidParameter, 5 for rtErrUnknown, 6 for rtErrFatal, 7 for rtData). For example, respond to the above rtInputReport request using rtSuccesful.


    GUID-20230228-SS0I-N7MS-SWRH-FXCVBS61WJNB-low.png

    The host receives a SetReportConfirmation indication with the Result type.


    GUID-20230228-SS0I-MMVS-X2DR-ZJMG1GG2T8DM-low.png

  5. Send a Protocol Request using GetProtocolRequest. This requires no parameters.
    GUID-20230228-SS0I-JDJR-F8GS-W2DCX0PMPJCR-low.png

    The device gets a Protocol Indication.


    GUID-20230228-SS0I-RD9R-DT9L-MPPXX93RJ4S7-low.png

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


    GUID-20230228-SS0I-Z4PJ-FHCZ-3H4NN5VMFCW5-low.png

    The host gets a protocol confirmation with the result type and protocol.


    GUID-20230228-SS0I-2XTP-J35W-MCRB6CHL9K8N-low.png

  6. Issue SetProtocolRequest from the host. The only parameter needed is the protocol(0 for ptBoot and 1 for ptReport). For example, send a request with ptReport.
    GUID-20230228-SS0I-MLFK-2F3J-0DFGNJB4K9RK-low.png

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


    GUID-20230228-SS0I-WBWX-D4HH-VMLJWTVPRMZ6-low.png

    A Protocol Confirmation with Result type in the host.

  7. Set the Idle request issuing the GetIdleRequest command. This requires no parameters.
    GUID-20230228-SS0I-J8LC-L68T-N12HKBK4NFDG-low.png

    The device gets a GetIdleIndication.


    GUID-20230228-SS0I-W8CT-13MN-M8Q2VHCQ3MZ9-low.png

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


    GUID-20230228-SS0I-PPW1-MGB1-FLXSZ58TK3GG-low.png

    The host gets an Idle Confirmation.


    GUID-20230228-SS0I-WKWN-W5XZ-629VL8G41VNP-low.png

  8. 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-20230228-SS0I-CXW8-K0K3-RVNC26MDLK0X-low.png

    The device receives a Set Idle Indication. This can respond using Set Idle Response which requires Result type (0 for rtSuccessful, 1 for rtNotReady, 2 for rtErrInvalidReportID, 3 forrtErrUnsupportedRequest, 4 for rtErrInvalidParameter, 5 for rtErrUnknown, 6 for rtErrFatal, and 7 for rtData) as the one parameter.


    GUID-20230228-SS0I-2Z0T-MM6L-GKKBSRWBKD4Q-low.png

    The host receives a SetIdleConfirmation with the result type.


    GUID-20230228-SS0I-SNTW-8FHH-FLGZL8R8KKPQ-low.png

  9. Write data between devices using DataWrite. The one parameter needed is ReportType (0 for rtOther, 1 for rtInput, 2 for rtOutput, and 3 for rtFeature). Data is written from the device in the below example.
    GUID-20230228-SS0I-SPLJ-HZNV-0P1TMXPVLVBB-low.png

    The Host receives a Data indication.


    GUID-20230228-SS0I-QM68-KGQW-N89FP5V8BMQ8-low.png