On 09/16/2013 05:00 PM, Scott Talbert wrote: >> Note that on Linux you can use libhidapi-hidraw (the raw internal >> implementation), or libhidapi-libusb (uses libusb internally), but we >> use libusb becuase the hidraw is unstable at this point. On other >> platforms, only the respective native HID implementations are > > I don't think the hidraw implementation is necessarily buggy on Linux - I > think it would just have required kernel changes to make it work with our > devices.
Their site claims it's buggy on Linux. :)
>> -AC_CONFIG_HEADERS([config.h])
>
> Any particular reason why you removed this from libconcord/configure.ac?
> Not that I noticed a problem - I just noticed that there are a bunch more
> -Dxxyyzz arguments on compilation commands (vice having all the defines
> written to config.h). Just curious, mainly.
Because we weren't including config.h in any of the source files, and so I had
to pick one or the other now that we're using it. :) I don't care all that much.
>> +int HID_WriteReport(const uint8_t *data)
>> +{
>> + int err = hid_write(h_dev, data, USB_PACKET_LENGTH);
>> + if (err < 0) {
>> + debug("Failed to write to device: %d (%s)", err, hid_error(h_dev));
>> + return err;
>> + }
>> +
>> + return 0;
>> +}
>
> I found a pretty substantial bug here. It turns out that hid_write
> requires that you pass it a 'Report ID' as the first byte - so we actually
> need to pass in a buffer of USB_PACKET_LENGTH + 1, and set the first byte
> to zero. So, here we'll probably have to copy the input data into a
> larger buffer, and pass that on. Because of the way hid_write() works,
> this bug is only seen when we send a packet that starts with 0x00. (See
> the hidapi.h header file for more info on the 'Report ID' requirement.)
Woah. How does this work?! Shouldn't that mean the first byte of our reports
are getting lost?
>> + debug("Failed to write to device: %d (%s)", err, hid_error(h_dev));
>> + debug("Failed to read from device: %d (%s)", err, hid_error(h_dev));
>
> I think both of these should actually use %ls instead of %s because
> hid_error returns a wchar_t*.
Good call.
--
Phil Dibowitz [email protected]
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/
"Be who you are and say what you feel, because those who mind don't matter
and those who matter don't mind."
- Dr. Seuss
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________ concordance-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/concordance-devel
