SWRA770 august 2023 CC2564C
The following function is responsible for Connecting to a Remote HID Device. This function returns zero on successful execution and a negative value on all errors.
This command takes Inquiry Index number to work which can be found using the DisplayInquiryList command after an Inquiry has been completed.
HID_Connect_Remote_Device(BluetoothStackID, InquiryResultList[(TempParam->Params->intParam-1)], &HIDConfiguration, HID_Event_Callback, 0)
int BTPSAPI HID_Connect_Remote_Device(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, HID_Configuration_t *HIDConfiguration, HID_Event_Callback_tEventCallback, unsigned long CallbackParameter)
The following function is responsible for opening a connection to a Remote HID Device on the Specified Bluetooth Device. This function accepts as the first parameter the Bluetooth StackID of the Bluetooth Stack which opens the HID Connection. The second parameter specifies the Board Address (NON NULL) of the Remote Bluetooth Device to connect with. The third parameter to this function is the HID Configuration Specification to be used in the negotiation of the L2CAP Channels associated with this Device Client. The final two parameters specify the HID Event Callback function and Callback Parameter, respectively, of the HID Event Callback that is to process any further events associated with this Device Client. This function returns a non-zero, positive, value if successful, or a negative return error code if this function is unsuccessful. If this function is successful, the return value represents the HID ID that can be passed to all other functions that require this. Once a Connection is opened to a Remote Device, this can only be closed via a call to the HID_Close_Connection() function (passing in the return value from a successful call to this function as the HID ID input parameter.)