Skip to content
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

add libusb-specific hid_libusb_wrap_sys_device #280

Merged
merged 2 commits into from
Sep 18, 2021

Conversation

Youw
Copy link
Member

@Youw Youw commented May 20, 2021

Rationale: on Android one must use UsbManager, to access any
USB device. As a result, libraries like libusb can only use file descriptors
that are provided by UsbManager.
libusb has an API to use such file descriptors: hid_libusb_wrap_sys_device.
Having hid_libusb_wrap_sys_device currently is the only way to make hidapi
work on Android without root access and without custom Android builds.

Relevant info: https://github.com/libusb/libusb/pull/830/files

@Youw Youw changed the title Libusb wrap device master add libusb-specific hid_libusb_wrap_sys_device May 20, 2021
@Youw
Copy link
Member Author

Youw commented May 20, 2021

When checking the diff, select "Hide whitespace changes" option on Github - makes the diff smaller and easier to read.

I'd appreciate an input from libusb team, if any.

@Youw Youw added the libusb Related to libusb backend label May 20, 2021
@mcuee mcuee added the Android Android OS related label Jun 10, 2021
@mcuee
Copy link
Member

mcuee commented Jun 18, 2021

@Peter-St Maybe you can take a look if you got time. Thanks.

@Peter-St
Copy link

@Peter-St Maybe you can take a look if you got time. Thanks.

Looks propper to me to support the unrooted way on the hid api too.
I haven't test the hid api for now, so I cannot give any further advices.

@mcuee mcuee mentioned this pull request Aug 29, 2021
@Youw Youw force-pushed the libusb_wrap_device_master branch 3 times, most recently from 2ddc6d1 to 5c9dc28 Compare September 18, 2021 15:37
Rationale: on Android one must use UsbManager, to access any
USB device. As a result, libraries like libusb can only use file descriptors
that are provided by UsbManager.
libusb has an API to use such file descriptors: hid_libusb_wrap_sys_device.
Having hid_libusb_wrap_sys_device currently is the only way to make hidapi
work on Android without root access and without custom Android builds.

Relevant info: https://github.com/libusb/libusb/pull/830/files
@Youw Youw merged commit aaf5f3d into master Sep 18, 2021
@Youw Youw deleted the libusb_wrap_device_master branch September 18, 2021 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android OS related libusb Related to libusb backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants