Closed mcuee closed 2 years ago
For reference, there is another linux-only function group being used in this example: select.epoll
.
But it is not actually using the biggest incompatible feature of epoll (the ability of (un)registering file descriptors while in the poll function is running), so it should be possible to replace it with something else.
More broadly, it will be good to port the following to libusb/python-libusb1. As of now pyusb does not support async transfer so it may be difficult. But that is not relevant to this issue. https://github.com/torvalds/linux/blob/master/drivers/usb/misc/usbtest.c
Specific to this issue, I think it is of low priority. It is just a nice to have on my side -- I like cross platform codes (often Windows is the weak link compared to Linux or even macOS).
I will close this issue for now as it is not the core feature of this repo.
https://github.com/vpelletier/python-functionfs/blob/master/examples/usbcat/host.py The above uses fcntl which is not available under Windows.
It is said that you can port the function of fcntl to cross platform portalocker. https://github.com/WoLpH/portalocker