Closed matheusmoreira closed 1 month ago
It implements a general stored error mechanism for hid_error
. There's even an internal API that makes it easy to use.
All that remains is setting the error data in the appropriate functions. I added the one I needed. More can be added in future contributions.
Fixed the issues pointed out in code review. Got rid of a lot of wide character stuff, much easier to just do everything needed with the utf8 data and convert just before returning the actual result. Improved the generated error message, now it contains the standard libusb error strings in addition to the context, if any.
Ideally there would be an
hid_libusb_error
function
Why not - we have all means for it.
I added the one I needed. More can be added in future contributions.
In that case I'd accept it into the future branch for now. Having small improvements/changes/fixes for a future branch might speedup the development/readiness for master branch.
I've updated the implementation myself: #698 I don't have a good environment right now to do extensive testing, @matheusmoreira would be great if you could check it.
Ideally there would be an
hid_libusb_error
functionWhy not - we have all means for it.
Huh, I was trying to avoid adding new functions this whole time. If we can just add that function then most of this PR becomes unnecessary since its just juggling error strings.
Looks like it's become a new pull request so I'll close this one.
The
hid_error
function is not implemented yet, and contributions are welcome. So add error data to the device structure and return it fromhid_error
. Also set error data in the functions I need.Closes: #684