<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Aug 20, 2014, at 11:07 AM, Shen Chuan <<a href="mailto:shen@minutekey.com">shen@minutekey.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Hello, </div><div><br></div><div>Just installed libhid in the opensuse platform and running a c program to communicate with the card reader</div><div><br></div><div><div>i | libhidapi-devel   | Development libraries and header files for hidapi                   | package</div>
<div>i | libhidapi-hidraw0 | Simple library for communicating with USB and Bluetooth HID devices | package</div><div>i | libhidapi-libusb0 | Simple library for communicating with USB and Bluetooth HID devices | package</div>
</div><div><br></div>But when I run it, it always give me 13 error code. Not sure what it means, is there somewhere I can debug it?<div></div></div></blockquote><div dir="ltr"><div><br></div><div>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.</div><div><br></div></div><blockquote type="cite"><div dir="ltr"><div><div>hid_force_open failed with return code 13<br></div></div></div></blockquote><br></div><div>There are at least three separate HID APIs for Linux:</div><div><br></div><div>1) <a href="http://libhid.alioth.debian.org/">http://libhid.alioth.debian.org/</a> (defunct; uses this list)</div><div>2) the Linux kernel HID API, sometimes called hidraw</div><div>3) <a href="http://www.signal11.us/oss/hidapi/">http://www.signal11.us/oss/hidapi/</a> (also <a href="https://github.com/signal11/hidapi">https://github.com/signal11/hidapi</a>) which corresponds to those packages</div><div><br></div><div>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: <a href="http://www.signal11.us/oss/hidapi/hidapi/doxygen/html/group__API.html">http://www.signal11.us/oss/hidapi/hidapi/doxygen/html/group__API.html</a></div><div><br></div><div>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.</div><br><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div>-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br></body></html>