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

Feature Request: Expose device underlying file descriptor via API #144

Open
rnixx opened this issue May 10, 2016 · 5 comments
Open

Feature Request: Expose device underlying file descriptor via API #144

rnixx opened this issue May 10, 2016 · 5 comments

Comments

@rnixx
Copy link
Contributor

rnixx commented May 10, 2016

As described in #143, it would be great if devices provide the underlying file descriptor via API.

@jonasmalacofilho
Copy link
Member

Cc: @mcuee

This would require patches to the backend libraries, as well as be linux[/mac] specific, no?

@mcuee
Copy link
Member

mcuee commented Dec 9, 2019

I think libusb api has that.
http://libusb.sourceforge.net/api-1.0/group__poll.html

I think it is generic, Windows libusb implementation has emulated poll-fd as well.
https://github.com/libusb/libusb/tree/master/libusb/os

I am not an expert in libusb internals. If needed we can ask in libusb mailing list.

@mcuee
Copy link
Member

mcuee commented Dec 9, 2019

Oops, looks like we do have a limitation under Windows. But it may still be okay, just return unsupported under WIndows (same for hotplug now for libusb Windows).

https://github.com/libusb/libusb/wiki/Windows
Because there is no native poll() on Windows, the ability to return externally pollable file descriptors on Windows libusb_get_pollfd() returns an error.

@mcuee
Copy link
Member

mcuee commented Jul 24, 2021

@jonasmalacofilho Is this worth looking at? Thanks.

@jonasmalacofilho
Copy link
Member

jonasmalacofilho commented Jul 24, 2021

I think it is, and IIRC getting the fd has also been mentioned in the Termux/Android discussions.

EDIT: regarding the initial "I think is", I wasn't really thinking about any specific use case besides the one mentioned in #143 (i.e. polling).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants