airspy / airspyhf

Code repository for AirspyHF+
BSD 3-Clause "New" or "Revised" License
146 stars 39 forks source link

Non-root android support #40

Closed AlexandreRouma closed 2 years ago

AlexandreRouma commented 2 years ago

This PR contains the following modifications:

1) Disabled libusb enumeration when compiling on android since it is not supported (As explained in the libusb documentation line 92) 2) Add the airspyhf_open_fd function that allows to open an Airspy HF+ device using a file descriptor. This is the only possible way to open a usb device on a non-rooted android device.

I tried to do these modifications in such a way that they modify as few lines as possible. Feel free to let me know if the exact manner it was implemented is not in line with the project's code style.

This code has been tested and confirmed working on several android device but I still recommend testing it further. It should not impact any other operating system.

touil commented 2 years ago

Merged the initial non-root Android support by @AlexandreRouma.

AlexandreRouma commented 2 years ago

Just found some issues with libusb not even defining libusb_wrap_sys_device on windows. A new pull request with this disabled will be open in a minute.