<div dir="ltr">Hello Charles,<div><br></div><div>Sorry for the late reply. Last week we were debating if we want to add this libhid communication device software into our build. We were trying to communicate with the cardreader. But looks like the communication c code provided for magtek reader is not working consistently among different models of our PCs. We had Lenovo m71e and this model always works without -13 issue but not the other models. When I was trying to debug with strace and management decided not to spend more time on it and the strace is not available in our PCs in suse platform so I stopped from there.</div>
<div><br></div><div>I attacked the c program and libhid rpm we experimented in the attachment. Sorry genuinely want to contribute more to the society.</div><div><br></div><div>And thank you for your help with the NUT ups, we were using EATON 3S and Tripplite. The ups software performs very well in the field.</div>
<div><br></div><div>Thank you again</div><div><br></div><div>Shen</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 20, 2014 at 5:56 PM, Charles Lepple <span dir="ltr"><<a href="mailto:clepple@gmail.com" target="_blank">clepple@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="">On Aug 20, 2014, at 11:07 AM, Shen Chuan <<a href="mailto:shen@minutekey.com" target="_blank">shen@minutekey.com</a>> wrote:<br>
</div><div><div class=""><br><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><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><div class=""><blockquote type="cite"><div dir="ltr"><div><div>hid_force_open failed with return code 13<br></div></div></div></blockquote><br></div></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/" target="_blank">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/" target="_blank">http://www.signal11.us/oss/hidapi/</a> (also <a href="https://github.com/signal11/hidapi" target="_blank">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" target="_blank">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><span class="HOEnZb"><font color="#888888"><br>
<br><div>
<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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>
-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div></span><br>

</div>
<br></font></span></div></blockquote></div><br></div>