android - libusb on lollipop - fails to get devices list -
few days ago i've tested app on android lollipop , stops working. after debugging i've found libsub fails devices list:
struct libusb_device **devs; int devs_count = libusb_get_device_list(ctx, &devs);
i've continues dig sources , found next failure (linux_usbfs.c):
dir *buses = opendir(usbfs_path); // '/dev/bus/usb', correct struct discovered_devs *discdevs = *_discdevs; int r = 0; if (!buses) { usbi_err(ctx, "opendir buses failed errno=%d", errno); return libusb_error_io; // case! }
usbfs_path correct (/dev/bus/usb
) , device /dev/bus/usb/003/002
.
how can work usb device using libusb in android lollipop?
previously i've iterated on devices, found device using pid , vid, requested it's endpoints , worked usual. can't struct libusb_device **devs;
using libusb_get_device_list
, stops everything. can having device path , opened connection file descriptor android?
ps. testing on nexus 9 android 5.1.1
pps. can't use either libusb_open_device_with_vid_pid
requests devices list too:
default_visibility libusb_device_handle * libusb_call libusb_open_device_with_vid_pid( libusb_context *ctx, uint16_t vendor_id, uint16_t product_id) { struct libusb_device **devs; struct libusb_device *found = null; struct libusb_device *dev; struct libusb_device_handle *handle = null; size_t = 0; int r; if (libusb_get_device_list(ctx, &devs) < 0) return null;
Comments
Post a Comment