-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
51 lines (42 loc) · 2.11 KB
/
README
File metadata and controls
51 lines (42 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
libusb
======
libusb is a library for USB device access from Linux, Mac OS X,
Windows, OpenBSD/NetBSD and Haiku userspace.
It is written in C (Haiku backend in C++) and licensed under the GNU
Lesser General Public License version 2.1 or, at your option, any later
version (see COPYING).
libusb is abstracted internally in such a way that it can hopefully
be ported to other operating systems. Please see the PORTING file
for more information.
libusb homepage:
http://libusb.info/
Developers will wish to consult the API documentation:
http://api.libusb.info
Use the mailing list for questions, comments, etc:
http://mailing-list.libusb.info
- Pete Batard <pete@akeo.ie>
- Hans de Goede <hdegoede@redhat.com>
- Xiaofan Chen <xiaofanc@gmail.com>
- Ludovic Rousseau <ludovic.rousseau@gmail.com>
- Nathan Hjelm <hjelmn@users.sourceforge.net>
- Chris Dickens <christopher.a.dickens@gmail.com>
(Please use the mailing list rather than mailing developers directly)
How To for Android
==================
1. Search for the UsbDevice [1] you are interested in.
2. Extract the usbfs path [2] from the UsbDevice.
3. Build a libbox0_device from the path
using libusb_get_device2(context, path) [3]
4. open the UsbDevice [4], you will get UsbDeviceConnection [5].
5. from the UsbDeviceConnection, extract the fd[6]
6. now, from the fd and the previously
created libusb_device, build a libusb_device_handle
by calling libusb_get_device2(dev, handle, fd)[7].
7. and that all you need.
[1] http://developer.android.com/reference/android/hardware/usb/UsbDevice.html
[2] http://developer.android.com/reference/android/hardware/usb/UsbDevice.html#getDeviceName%28%29
[3] https://github.com/kuldeepdhaka/libusb/blob/android-open2/libusb/core.c#L1492
[4] http://developer.android.com/reference/android/hardware/usb/UsbManager.html#openDevice%28android.hardware.usb.UsbDevice%29
[5] http://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html
[6] http://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#getFileDescriptor%28%29
[7] https://github.com/kuldeepdhaka/libusb/blob/android-open2/libusb/core.c#L1267