[libhid-discuss] Question about hid_force_open failed
Charles Lepple
clepple at gmail.com
Wed Aug 20 23:56:41 UTC 2014
On Aug 20, 2014, at 11:07 AM, Shen Chuan <shen at minutekey.com> wrote:
> Hello,
>
> Just installed libhid in the opensuse platform and running a c program to communicate with the card reader
>
> i | libhidapi-devel | Development libraries and header files for hidapi | package
> i | libhidapi-hidraw0 | Simple library for communicating with USB and Bluetooth HID devices | package
> i | libhidapi-libusb0 | Simple library for communicating with USB and Bluetooth HID devices | package
>
> But when I run it, it always give me 13 error code. Not sure what it means, is there somewhere I can debug it?
You could try running it under strace to see the return values from the system calls. If the 13 is coming from a system call, strace will show the symbolic error name.
> hid_force_open failed with return code 13
There are at least three separate HID APIs for Linux:
1) http://libhid.alioth.debian.org/ (defunct; uses this list)
2) the Linux kernel HID API, sometimes called hidraw
3) http://www.signal11.us/oss/hidapi/ (also https://github.com/signal11/hidapi) which corresponds to those packages
I am not too familiar with #2 and #3. If it is #3, you should be able to look up that error code in their Doxygen output: http://www.signal11.us/oss/hidapi/hidapi/doxygen/html/group__API.html
If it is #2, error 13 is EACCESS, so you might want to check permissions on /dev/bus/usb. HIDAPI might also be passing that error code through to you from the kernel HID API.
--
Charles Lepple
clepple at gmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20140820/fe18864a/attachment.html>
More information about the libhid-discuss
mailing list