ruabmbua / hidapi-rs

Rust bindings for the hidapi C library
MIT License
167 stars 80 forks source link

Incorrect Function Error when using get_feature_report #88

Closed Manul-Keyboard closed 2 years ago

Manul-Keyboard commented 2 years ago

Code: image Error: image

ruabmbua commented 2 years ago

There is not any space in your buffer to actually write the received report into. Use a larger buf.

Also as per documentation:

Set the first byte of buf to the ‘Report ID’ of the report to be read. Upon return, the first byte will still contain the Report ID, and the report data will start in buf[1].

The first byte in the given buf is input, and contains the report id you wish to receive.

Manul-Keyboard commented 2 years ago

Thank you for your answer. It's working now.