-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use hid_open in android #137
Comments
Hi, https://developer.android.com/guide/topics/connectivity/usb/host.html#permission-d You can dig in your system logs running "logcat" as admin in a terminal, that may help you to understand whats wrong. |
Hi @tuxun i have added usb permission, but hid_open is still no working because the method hid_open in hid.c is use while condition and check "cur_dev->vendor_id == vendor_id && cur_dev->product_id == product_id".
i thank the problem is hid_open_path(const char *path) , but i have no idea how to test this method, can you help me ? thanks. |
Hi, I think i understand. your path is wrongly returned by enum_device(). You should check the file exist before open it :) |
Hi @tuxun,
Is it from hidtest here: Line 75 in ca1a2d6
If so, it doesn't exactly describe what went wrong.
Would you be able to trace with a debugger, to catch where exactly What would be helpful to know: is it goes as far as here: Line 906 in ca1a2d6
or not. |
coud we have an hid_open_path function using file path and another one using the other kind of path? IMHO its confusing ATM. |
strictly speaking, it is intended to receive only a it is not designed to be human-readable, or manually constructible |
libusb/libusb#830 |
Hi,
thank you for you solution to https://github.com/libusb/hidapi/issues/24, I have build android .so lib。
first,I have use "hid_init()",and the result is 0;
second,I have got "hid_device_info" from the method "hid_enumerate(0x0, 0x0)" , and the result is (
info = HidDeviceInfo{path='0003:0003:00', vendor_id=D197, product_id=E0A097}
info = HidDeviceInfo{path='0003:000b:00', vendor_id=D1B1, product_id=E78083}
info = HidDeviceInfo{path='0003:000b:01', vendor_id=D1B1, product_id=E78083}
)
third,When i use hid_open(vendor_id, product_id, NULL) from hidapi.h(vendor_id and product_id from hid_device_info),but it is not working, and log result is "unable to open device"。
then,i was tested "hid_open" in hid.c,flag "handle = hid_open_path(path_to_open);",go into this method,i do not know why "hid_open_path" return NULL。
can you help me? thanks
The text was updated successfully, but these errors were encountered: