Go to the source code of this file.
|hid_return||hid_os_force_claim (HIDInterface *const hidif, int const interface, HIDInterfaceMatcher const *const matcher, unsigned short retries)|
|Forcibly claim an interface from an attached kernel driver. |
Definition in file linux.c.
|hid_return hid_os_force_claim||(||HIDInterface *const||hidif,|
|HIDInterfaceMatcher const *const||matcher,|
|unsigned short retries|
Forcibly claim an interface from an attached kernel driver.
This function is necessary in Linux because the kernel prefers that applications and drivers claim a device's appropriate interface before accessing it. For libhid to successfully claim an interface that has already been claimed by hiddev (for instance), libhid must first tell the kernel interface to relinquish control over the interface. This may take several tries.
If the return code is anything but HID_RET_SUCCESS, there will probably be more information in the kernel message buffer (available from the "dmesg" command).
References HIDInterface_t::dev_handle, ERROR, hid_is_opened(), HID_RET_DEVICE_ALREADY_OPENED, HID_RET_FAIL_CLAIM_IFACE, HID_RET_FAIL_DETACH_DRIVER, HID_RET_INVALID_PARAMETER, HID_RET_SUCCESS, HIDInterface_t::id, TRACE, and WARNING.