Closed shufps closed 11 months ago
libusb hidapi has a close function:
close
https://github.com/libusb/hidapi/blob/master/hidapi/hidapi.h#L481
This crate has a call to it via ffi::hid_close(device)
ffi::hid_close(device)
But the crate itself doesn't expose the close - is there a way how we could do it?
Problem is that we open a device multiple times what leads to errors after a couple of minutes and we would like to close it before opening it again.
i have the same question
If you want to close a device, you need to drop the HidDevice.
HidDevice
libusb hidapi has a
close
function:https://github.com/libusb/hidapi/blob/master/hidapi/hidapi.h#L481
This crate has a call to it via
ffi::hid_close(device)
But the crate itself doesn't expose the close - is there a way how we could do it?
Problem is that we open a device multiple times what leads to errors after a couple of minutes and we would like to close it before opening it again.