bt_hid_connect()

Create a HID Device connection to a service on a remote Bluetooth device (HID Host)

Synopsis:

#include <btapi/bthid.h>
 
int bt_hid_connect(const char *addr)

Since:

BlackBerry 10.2.0

Arguments:

addr

The remote Bluetooth device (Host) address.

Library:

libbtapi (For the qcc command, use the -l btapi option to link against this library)

Description:

This function attempts to open a HID Device connection to a Host device at the address specified. The function blocks after making a connection request and returns EOK when the connection has been successfully established.

Returns:

0 if the service connection is successful, or -1 with the errno set otherwise. The error codes that can be returned are as follows:
  • EPERM: The bt_hid_init() function was not called or did not complete successfully.
  • EBUSY: The requested service is already in use.
  • EAGAIN: The link to the Bluetooth stack is unavailable. You can try again.
  • EINVAL: Invalid stack parameters or connection to the remote Bluetooth-enabled device is not available.
  • ENODEV: The requested Bluetooth-enabled device could not be found.
  • ENOMEM: Insufficient memory is available to perform the request.
  • ENOTSUP: The requested service is not supported by the device.
  • ENOSYS: Cannot create a connection to the device.
  • ESRVRFAULT: An internal error has occurred.
  • ETIMEOUT: The connection attempt has timed out.