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

Get Report Request

Description

The following function is responsible for sending a GET_REPORT Transaction to the remote HID Device. This function returns zero on successful execution and a negative value on all errors.

Parameters

This function required three or four parameters. The first is size, 0 = grSizeOfReport, 1 = grUseBufferSize, the second is ReportType 0 = rtOther, 1 = rtInput, 2 = rtOutput, 3 = rtFeature,the third is ReportId. If the size parameter is 1, we need to specify a fourth parameter Buffersize.

Possible Return Values

  • (0) HID_Get_Report_Request: Function Successful
  • (-4) FUNCTION_ERROR
  • (-6)INVALID_PARAMETERS_ERROR
  • (-8) INVALID_STACK_ID_ERROR
  • (-103)BTPS_ERROR_FEATURE_NOT_AVAILABLE
  • (-1000)BTHID_ERROR_INVALID_PARAMETER
  • (-1001)BTHID_ERROR_NOT_INITIALIZED
  • (-1002)BTHID_ERROR_INVALID_BLUETOOTH_STACK_ID
  • (-1005)BTHID_ERROR_INVALID_OPERATION

API Call

HID_Get_Report_Request(BluetoothStackID, HIDID, (HID_Get_Report_Size_Type_t)TempParam->Params[0].intParam, (HID_Report_Type_Type_t)TempParam->Params[1].intParam, (Byte_t)(TempParam->Params[2].intParam), (Word_t)(TempParam->Params[3].intParam))

API Prototype

HID_Get_Report_Request(unsigned int BluetoothStackID, unsigned int HIDID, HID_Get_Report_Size_Type_t Size, HID_Report_Type_Type_t ReportType, Byte_t ReportID,Word_t BufferSize)

Description of API

The following function is responsible for sending a GET_REPORT transaction to the remote Device. This function accepts as input the Bluetooth Stack ID of the Bluetooth Stack which is to send the request and the HID ID for which the connection has been established. The third parameter is the descriptor that indicates how the device is to determine the size of the buffer that the host has allocated. The fourth parameter is the type of report requested. The fifth parameter is the Report ID determined by the Device's SDP record. Passing a zero for this parameter indicated that this parameter is not used and excludes the appropriate byte from the transaction payload. The fifth parameters use is based on the parameter passed as size. If the host indicates an allocation for a smaller size of buffer than the report is requesting, this parameter is used as the size of the report returned. Otherwise, the appropriate bytes are not included in the transaction payload. This function returns zero if successful or a negative return error code if there was an error.

Note: Control Channel transfers have two phases, a Request by the host and a Response by the device. Only ONE host control channel Request can be outstanding at a time. Reception of a HID Get Report Confirmation event indicates that a Response has been received and the Control Channel is now free for further transactions.