I am trying to communicate with USB device from Android-based smartphone via OTG. I was able to communicate with my device using Android USB Host API. The problem of USB Host API solution is performance (single bulk transfer bounded by 16384 bytes).
The libusb can perform larger requests and now I am trying to integrate it using Android NDK. I succeeded to compile libusb sources for Android and even initUSB()
, but libusb_open(dev, &dev_handle)
returns -3 (Access denied).
How can I pass the file descriptor
int fd = connection.getFileDescriptor()
to libusb after getting USB_PERMISSION under Android USB Host API and get USB device access under libusb?