hidapi icon indicating copy to clipboard operation
hidapi copied to clipboard

hid_write REPORT_ID byte on linux/windows/mac

Open jonasschnelli opened this issue 9 years ago • 6 comments

I'm currently finalizing deployment of a cross platform application. But what I can't follow is,...

Why do i need to send the REPORT_ID on mac/windows: (pseudecode): hid_write(handle, 0x00 + buffer, size(buffer)+1)

While on Linux it need to be hid_write(handle, buffer, size(buffer))

Can I somehow detect if hid_write expect a REPORT_ID?

jonasschnelli avatar Jan 29 '16 14:01 jonasschnelli

It should be the same. Are you using the latest from git?

signal11 avatar Feb 01 '16 16:02 signal11

I'm using 0.8.0-rc1. Maybe it was fixed with https://github.com/signal11/hidapi/commit/54eb31dc16dcc67d0b689ed947bc53a038608c0e which is not in 0.8.0-rc1.

What about doing a 0.8.0 release (current master)?

jonasschnelli avatar Feb 23 '16 13:02 jonasschnelli

It seems to be a difference between hid-libusb and hid-hidraw (at least on linux).

jonasschnelli avatar Feb 25 '16 08:02 jonasschnelli

https://github.com/signal11/hidapi/commit/3a66d4e513ed1b1ce82b7e6fcfa30ff05598b696 this commit is un Ubuntus version but not in the 0.8.0rc1 tag. Maybe spun of a rc2?

jonasschnelli avatar Feb 25 '16 10:02 jonasschnelli

Indeed. Ubuntu < 16.04 has a git snapshot at rev 3a66d4e. Ubuntu 16.04+ has a git snapshot at rev d17db57.

swt2c avatar Mar 24 '16 20:03 swt2c

So much thanks for this question!!! I found solution for me with your approach. Function works great, but it behaves really unexpecting!

nvchernov avatar Jun 01 '18 12:06 nvchernov