----- Original Message -----
From: Tim Roberts
Sent: 10/24/13 07:15 PM
To: libusbx-devel@lists.sourceforge.net
Subject: Re: [Libusbx-devel] Problems running libusbx on nonrooted Android
Rasmus Bisschop-Larsen wrote:
I am trying to run libusbx on an unrooted android phone (Sony Ericson Xperia
Active (Android 4.0.4)). But I have hit a major problem I cannot open the
device. After looking at the libusbx code I can see that even though I know the
device address and vid+pid I hit an error as [libusb_open] open 1.2 returns -3.
(see debug code below). I do not have root access to my phone and I thought
libusbx did not need this.
Did you read the Android README in the libusbx distribution? If you are not
rooted, and you cannot rebuild the system image, then you can try using Java
code to call android.hardware.usb.UsbManager to request the permission you need.
Yes I have read the Android README maybe 10 times but it is not very clear
about how to get this to work. As I wrote (..."I can get file descriptors (fd)
through both libusbx and the android library
UsbDeviceConnection.getFileDescriptor() but I cannot figure out where to pass
the latter fd to libusbx in order to use it to open the device.") it is part of
my problem. I can see that libusb_init do get fd for the device (actually two)
and I can see that these are not the same as the one I get with
UsbDeviceConnection.getFileDescriptor(). It still leaves me with the problem of
how to pass the fd to libusbx if that is the way to get it to work. Through a
UsbManager.hasPermission(device) call in the android's java I know that I have
permission to the device.
Kind regards,
Rasmus
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel