libusb 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/Gemfile +1 -0
  5. data/History.md +10 -0
  6. data/README.md +19 -6
  7. data/Rakefile +1 -1
  8. data/ext/extconf.rb +17 -1
  9. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/AUTHORS +18 -6
  10. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/COPYING +0 -0
  11. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/ChangeLog +58 -1
  12. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/INSTALL +0 -0
  13. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/Makefile.am +6 -1
  14. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/Makefile.in +248 -174
  15. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/NEWS +2 -2
  16. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/PORTING +0 -0
  17. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/README +2 -1
  18. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/TODO +0 -0
  19. data/ext/libusbx-1.0.17/Xcode/common.xcconfig +40 -0
  20. data/ext/libusbx-1.0.17/Xcode/config.h +28 -0
  21. data/ext/libusbx-1.0.17/Xcode/debug.xcconfig +29 -0
  22. data/ext/libusbx-1.0.17/Xcode/libusbx.xcconfig +21 -0
  23. data/ext/libusbx-1.0.17/Xcode/libusbx.xcodeproj/project.pbxproj +864 -0
  24. data/ext/libusbx-1.0.17/Xcode/libusbx_debug.xcconfig +21 -0
  25. data/ext/libusbx-1.0.17/Xcode/libusbx_release.xcconfig +21 -0
  26. data/ext/libusbx-1.0.17/Xcode/release.xcconfig +29 -0
  27. data/ext/libusbx-1.0.17/aclocal.m4 +1112 -0
  28. data/ext/libusbx-1.0.17/android/README +114 -0
  29. data/ext/libusbx-1.0.17/android/config.h +90 -0
  30. data/ext/libusbx-1.0.17/android/jni/Android.mk +23 -0
  31. data/ext/libusbx-1.0.17/android/jni/Application.mk +19 -0
  32. data/ext/libusbx-1.0.17/android/jni/examples.mk +134 -0
  33. data/ext/libusbx-1.0.17/android/jni/libusb.mk +54 -0
  34. data/ext/libusbx-1.0.17/android/jni/tests.mk +56 -0
  35. data/ext/libusbx-1.0.17/compile +347 -0
  36. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/config.guess +164 -130
  37. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/config.h.in +37 -1
  38. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/config.sub +174 -89
  39. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/configure +723 -302
  40. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/configure.ac +71 -20
  41. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/depcomp +345 -185
  42. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/doc/Makefile.am +0 -0
  43. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/doc/Makefile.in +95 -32
  44. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/doc/doxygen.cfg.in +1 -1
  45. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/Makefile.am +5 -4
  46. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/Makefile.in +208 -104
  47. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/dpfp.c +1 -1
  48. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/dpfp_threaded.c +1 -1
  49. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/ezusb.c +188 -8
  50. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/ezusb.h +18 -5
  51. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/fxload.c +90 -64
  52. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/getopt/getopt.c +0 -0
  53. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/getopt/getopt.h +0 -0
  54. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/getopt/getopt1.c +0 -0
  55. data/ext/libusbx-1.0.17/examples/hotplugtest.c +97 -0
  56. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/listdevs.c +12 -4
  57. data/ext/libusbx-1.0.17/examples/sam3u_benchmark.c +193 -0
  58. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/examples/xusb.c +106 -49
  59. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/install-sh +21 -14
  60. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb-1.0.pc.in +1 -1
  61. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/Makefile.am +29 -10
  62. data/ext/libusbx-1.0.17/libusb/Makefile.in +914 -0
  63. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/core.c +378 -87
  64. data/ext/libusbx-1.0.17/libusb/descriptor.c +1199 -0
  65. data/ext/libusbx-1.0.17/libusb/hotplug.c +322 -0
  66. data/ext/libusbx-1.0.17/libusb/hotplug.h +82 -0
  67. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/io.c +182 -62
  68. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/libusb-1.0.def +32 -0
  69. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/libusb-1.0.rc +2 -0
  70. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/libusb.h +481 -32
  71. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/libusbi.h +135 -38
  72. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/darwin_usb.c +591 -496
  73. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/darwin_usb.h +39 -46
  74. data/ext/libusbx-1.0.17/libusb/os/linux_netlink.c +345 -0
  75. data/ext/libusbx-1.0.17/libusb/os/linux_udev.c +306 -0
  76. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/linux_usbfs.c +653 -617
  77. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/linux_usbfs.h +32 -0
  78. data/ext/{libusbx-1.0.14/libusb/os/openbsd_usb.c → libusbx-1.0.17/libusb/os/netbsd_usb.c} +70 -63
  79. data/ext/libusbx-1.0.17/libusb/os/openbsd_usb.c +823 -0
  80. data/ext/libusbx-1.0.17/libusb/os/poll_posix.c +51 -0
  81. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/poll_posix.h +2 -1
  82. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/poll_windows.c +85 -106
  83. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/poll_windows.h +14 -3
  84. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/threads_posix.c +3 -1
  85. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/threads_posix.h +0 -0
  86. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/threads_windows.c +6 -5
  87. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/threads_windows.h +0 -0
  88. data/ext/libusbx-1.0.17/libusb/os/wince_usb.c +1026 -0
  89. data/ext/libusbx-1.0.17/libusb/os/wince_usb.h +131 -0
  90. data/ext/libusbx-1.0.17/libusb/os/windows_common.h +108 -0
  91. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/windows_usb.c +92 -57
  92. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/os/windows_usb.h +2 -63
  93. data/ext/libusbx-1.0.17/libusb/strerror.c +184 -0
  94. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/sync.c +24 -38
  95. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/libusb/version.h +1 -1
  96. data/ext/libusbx-1.0.17/libusb/version_nano.h +1 -0
  97. data/ext/{libusbx-1.0.14 → libusbx-1.0.17}/ltmain.sh +60 -41
  98. data/ext/{libusbx-1.0.14/aclocal.m4 → libusbx-1.0.17/m4/libtool.m4} +229 -1723
  99. data/ext/libusbx-1.0.17/m4/ltoptions.m4 +384 -0
  100. data/ext/libusbx-1.0.17/m4/ltsugar.m4 +123 -0
  101. data/ext/libusbx-1.0.17/m4/ltversion.m4 +23 -0
  102. data/ext/libusbx-1.0.17/m4/lt~obsolete.m4 +98 -0
  103. data/ext/libusbx-1.0.17/missing +215 -0
  104. data/ext/libusbx-1.0.17/tests/Makefile.am +6 -0
  105. data/ext/libusbx-1.0.17/tests/Makefile.in +583 -0
  106. data/ext/libusbx-1.0.17/tests/libusbx_testlib.h +107 -0
  107. data/ext/libusbx-1.0.17/tests/stress.c +160 -0
  108. data/ext/libusbx-1.0.17/tests/testlib.c +276 -0
  109. data/lib/libusb.rb +4 -0
  110. data/lib/libusb/call.rb +43 -1
  111. data/lib/libusb/constants.rb +5 -0
  112. data/lib/libusb/context.rb +100 -0
  113. data/lib/libusb/dev_handle.rb +27 -0
  114. data/lib/libusb/device.rb +10 -4
  115. data/lib/libusb/version_gem.rb +1 -1
  116. data/test/test_libusb_capability.rb +2 -2
  117. data/test/test_libusb_compat.rb +2 -2
  118. data/test/test_libusb_compat_mass_storage.rb +2 -2
  119. data/test/test_libusb_descriptors.rb +4 -2
  120. data/test/test_libusb_event_machine.rb +2 -2
  121. data/test/test_libusb_gc.rb +2 -2
  122. data/test/test_libusb_hotplug.rb +115 -0
  123. data/test/test_libusb_iso_transfer.rb +3 -3
  124. data/test/test_libusb_mass_storage.rb +6 -16
  125. data/test/test_libusb_mass_storage2.rb +26 -3
  126. data/test/test_libusb_structs.rb +2 -2
  127. data/test/test_libusb_threads.rb +2 -2
  128. data/test/test_libusb_version.rb +2 -2
  129. metadata +127 -68
  130. metadata.gz.sig +0 -0
  131. data/ext/libusbx-1.0.14/THANKS +0 -7
  132. data/ext/libusbx-1.0.14/compile +0 -143
  133. data/ext/libusbx-1.0.14/libusb/Makefile.in +0 -721
  134. data/ext/libusbx-1.0.14/libusb/descriptor.c +0 -731
  135. data/ext/libusbx-1.0.14/libusb/version_nano.h +0 -1
  136. data/ext/libusbx-1.0.14/missing +0 -376
@@ -0,0 +1,114 @@
1
+ libusb for Android
2
+ ==================
3
+
4
+ Building:
5
+ ---------
6
+
7
+ To build libusb for Android do the following:
8
+
9
+ 1. Download the latest NDK from:
10
+ http://developer.android.com/tools/sdk/ndk/index.html
11
+
12
+ 2. Extract the NDK.
13
+
14
+ 3. Open a shell and make sure there exist an NDK global variable
15
+ set to the directory where you extracted the NDK.
16
+
17
+ 4. Change directory to libusb's "android/jni"
18
+
19
+ 5. Run "$NDK/ndk-build".
20
+
21
+ The libusb library, examples and tests can then be found in:
22
+ "android/libs/$ARCH"
23
+
24
+ Where $ARCH is one of:
25
+ armeabi
26
+ armeabi-v7a
27
+ x86
28
+
29
+
30
+ Installing:
31
+ -----------
32
+
33
+ If you wish to use libusb from native code in own Android application
34
+ then you should add the following line to your Android.mk file:
35
+
36
+ include $(PATH_TO_LIBUSB_SRC)/android/jni/libusb.mk
37
+
38
+ You will then need to add the following lines to the build
39
+ configuration for each native binary which uses libusb:
40
+
41
+ LOCAL_C_INCLUDES += $(LIBUSB_ROOT_ABS)
42
+ LOCAL_SHARED_LIBRARIES += libusb1.0
43
+
44
+ The Android build system will then correctly include libusb in the
45
+ application package (APK) file, provided ndk-build is invoked before
46
+ the package is built.
47
+
48
+
49
+ For a rooted device it is possible to install libusb into the system
50
+ image of a running device:
51
+
52
+ 1. Enable ADB on the device.
53
+
54
+ 2. Connect the device to a machine running ADB.
55
+
56
+ 3. Execute the following commands on the machine
57
+ running ADB:
58
+
59
+ # Make the system partition writable
60
+ adb shell su -c "mount -o remount,rw /system"
61
+
62
+ # Install libusb
63
+ adb push obj/local/armeabi/libusb1.0.so /sdcard/
64
+ adb shell su -c "cat > /system/lib/libusb1.0.so < /sdcard/libusb1.0.so"
65
+ adb shell rm /system/lib/libusb1.0.so
66
+
67
+ # Install the samples and tests
68
+ for B in listdevs fxload xusb sam3u_benchmark hotplugtest stress
69
+ do
70
+ adb push "obj/local/armeabi/$B" /sdcard/
71
+ adb shell su -c "cat > /system/bin/$B < /sdcard/$B"
72
+ adb shell su -c "chmod 0755 /system/bin/$B"
73
+ adb shell rm "/sdcard/$B"
74
+ done
75
+
76
+ # Make the system partition read only again
77
+ adb shell su -c "mount -o remount,ro /system"
78
+
79
+ # Run listdevs to
80
+ adb shell su -c "listdevs"
81
+
82
+ 4. If your device only has a single OTG port then ADB can generally
83
+ be switched to using Wifi with the following commands when connected
84
+ via USB:
85
+
86
+ adb shell netcfg
87
+ # Note the wifi IP address of the phone
88
+ adb tcpip 5555
89
+ # Use the IP address from netcfg
90
+ adb connect 192.168.1.123:5555
91
+
92
+ Runtime Permissions:
93
+ --------------------
94
+
95
+ The default system configuration on most Android device will not allow
96
+ access to USB devices. There are several options for changing this.
97
+
98
+ If you have control of the system image then you can modify the
99
+ ueventd.rc used in the image to change the permissions on
100
+ /dev/bus/usb/*/*. If using this approach then it is advisable to
101
+ create a new Android permission to protect access to these files.
102
+ It is not advisable to give all applications read and write permissions
103
+ to these files.
104
+
105
+ For rooted devices the code using libusb could be executed as root
106
+ using the "su" command. An alternative would be to use the "su" command
107
+ to change the permissions on the appropriate /dev/bus/usb/ files.
108
+
109
+ Users have reported success in using android.hardware.usb.UsbManager
110
+ to request permission to use the UsbDevice and then opening the
111
+ device. The difficulties in this method is that there is no guarantee
112
+ that it will continue to work in the future Android versions, it
113
+ requires invoking Java APIs and running code to match each
114
+ android.hardware.usb.UsbDevice to a libusb_device.
@@ -0,0 +1,90 @@
1
+ /*
2
+ * Android build config for libusbx
3
+ * Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+ /* Start with debug message logging enabled */
21
+ /* #undef ENABLE_DEBUG_LOGGING */
22
+
23
+ /* Message logging */
24
+ #define ENABLE_LOGGING
25
+
26
+ /* Define to 1 if you have the <dlfcn.h> header file. */
27
+ #define HAVE_DLFCN_H 1
28
+
29
+ /* Define to 1 if you have the `gettimeofday' function. */
30
+ #define HAVE_GETTIMEOFDAY 1
31
+
32
+ /* Define to 1 if you have the <inttypes.h> header file. */
33
+ #define HAVE_INTTYPES_H 1
34
+
35
+ /* Linux backend */
36
+ #define OS_LINUX 1
37
+
38
+ /* Enable output to system log */
39
+ #define USE_SYSTEM_LOGGING_FACILITY 1
40
+
41
+ /* type of second poll() argument */
42
+ #define POLL_NFDS_TYPE nfds_t
43
+
44
+ /* Use POSIX Threads */
45
+ #define THREADS_POSIX 1
46
+
47
+ /* Default visibility */
48
+ #define DEFAULT_VISIBILITY __attribute__((visibility("default")))
49
+
50
+ /* Define to 1 if you have the <memory.h> header file. */
51
+ #define HAVE_MEMORY_H 1
52
+
53
+ /* Define to 1 if you have the <poll.h> header file. */
54
+ #define HAVE_POLL_H 1
55
+
56
+ /* Define to 1 if you have the <signal.h> header file. */
57
+ #define HAVE_SIGNAL_H 1
58
+
59
+ /* Define to 1 if you have the <sys/stat.h> header file. */
60
+ #define HAVE_SYS_STAT_H 1
61
+
62
+ /* Define to 1 if you have the <sys/time.h> header file. */
63
+ #define HAVE_SYS_TIME_H 1
64
+
65
+ /* Define to 1 if you have the <sys/types.h> header file. */
66
+ #define HAVE_SYS_TYPES_H 1
67
+
68
+ /* Define to 1 if you have the <unistd.h> header file. */
69
+ #define HAVE_UNISTD_H 1
70
+
71
+ /* Define to 1 if you have the <linux/filter.h> header file. */
72
+ #define HAVE_LINUX_FILTER_H 1
73
+
74
+ /* Define to 1 if you have the <linux/netlink.h> header file. */
75
+ #define HAVE_LINUX_NETLINK_H 1
76
+
77
+ /* Define to 1 if you have the <asm/types.h> header file. */
78
+ #define HAVE_ASM_TYPES_H 1
79
+
80
+ /* Define to 1 if you have the <sys/socket.h> header file. */
81
+ #define HAVE_SYS_SOCKET_H 1
82
+
83
+ /* Add defines which Android is missing */
84
+ #ifndef TIMESPEC_TO_TIMEVAL
85
+ #define TIMESPEC_TO_TIMEVAL(tv, ts) \
86
+ do { \
87
+ (tv)->tv_sec = (ts)->tv_sec; \
88
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
89
+ } while (0)
90
+ #endif
@@ -0,0 +1,23 @@
1
+ # Android build config for libusb, examples and tests
2
+ # Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>
3
+ #
4
+ # This library is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU Lesser General Public
6
+ # License as published by the Free Software Foundation; either
7
+ # version 2.1 of the License, or (at your option) any later version.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ #
18
+
19
+ LOCAL_PATH:= $(call my-dir)
20
+
21
+ include $(LOCAL_PATH)/libusb.mk
22
+ include $(LOCAL_PATH)/examples.mk
23
+ include $(LOCAL_PATH)/tests.mk
@@ -0,0 +1,19 @@
1
+ # Android application build config for libusb
2
+ # Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>
3
+ #
4
+ # This library is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU Lesser General Public
6
+ # License as published by the Free Software Foundation; either
7
+ # version 2.1 of the License, or (at your option) any later version.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ #
18
+
19
+ APP_ABI := armeabi armeabi-v7a x86
@@ -0,0 +1,134 @@
1
+ # Android build config for libusb examples
2
+ # Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>
3
+ #
4
+ # This library is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU Lesser General Public
6
+ # License as published by the Free Software Foundation; either
7
+ # version 2.1 of the License, or (at your option) any later version.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ #
18
+
19
+ LOCAL_PATH:= $(call my-dir)
20
+ LIBUSB_ROOT_REL:= ../..
21
+ LIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../..
22
+
23
+ # listdevs
24
+
25
+ include $(CLEAR_VARS)
26
+
27
+ LOCAL_SRC_FILES := \
28
+ $(LIBUSB_ROOT_REL)/examples/listdevs.c
29
+
30
+ LOCAL_C_INCLUDES += \
31
+ $(LIBUSB_ROOT_ABS)
32
+
33
+ LOCAL_SHARED_LIBRARIES += libusb1.0
34
+
35
+ LOCAL_MODULE:= listdevs
36
+
37
+ include $(BUILD_EXECUTABLE)
38
+
39
+ # xusb
40
+
41
+ include $(CLEAR_VARS)
42
+
43
+ LOCAL_SRC_FILES := \
44
+ $(LIBUSB_ROOT_REL)/examples/xusb.c
45
+
46
+ LOCAL_C_INCLUDES += \
47
+ $(LIBUSB_ROOT_ABS)
48
+
49
+ LOCAL_SHARED_LIBRARIES += libusb1.0
50
+
51
+ LOCAL_MODULE:= xusb
52
+
53
+ include $(BUILD_EXECUTABLE)
54
+
55
+ # hotplugtest
56
+
57
+ include $(CLEAR_VARS)
58
+
59
+ LOCAL_SRC_FILES := \
60
+ $(LIBUSB_ROOT_REL)/examples/hotplugtest.c
61
+
62
+ LOCAL_C_INCLUDES += \
63
+ $(LIBUSB_ROOT_ABS)
64
+
65
+ LOCAL_SHARED_LIBRARIES += libusb1.0
66
+
67
+ LOCAL_MODULE:= hotplugtest
68
+
69
+ include $(BUILD_EXECUTABLE)
70
+
71
+ # fxload
72
+
73
+ include $(CLEAR_VARS)
74
+
75
+ LOCAL_SRC_FILES := \
76
+ $(LIBUSB_ROOT_REL)/examples/fxload.c \
77
+ $(LIBUSB_ROOT_REL)/examples/ezusb.c
78
+
79
+ LOCAL_C_INCLUDES += \
80
+ $(LIBUSB_ROOT_ABS)
81
+
82
+ LOCAL_SHARED_LIBRARIES += libusb1.0
83
+
84
+ LOCAL_MODULE:= fxload
85
+
86
+ include $(BUILD_EXECUTABLE)
87
+
88
+ # sam3u_benchmake
89
+
90
+ include $(CLEAR_VARS)
91
+
92
+ LOCAL_SRC_FILES := \
93
+ $(LIBUSB_ROOT_REL)/examples/sam3u_benchmark.c
94
+
95
+ LOCAL_C_INCLUDES += \
96
+ $(LIBUSB_ROOT_ABS)
97
+
98
+ LOCAL_SHARED_LIBRARIES += libusb1.0
99
+
100
+ LOCAL_MODULE:= sam3u_benchmark
101
+
102
+ include $(BUILD_EXECUTABLE)
103
+
104
+ # dpfp
105
+
106
+ include $(CLEAR_VARS)
107
+
108
+ LOCAL_SRC_FILES := \
109
+ $(LIBUSB_ROOT_REL)/examples/dpfp.c
110
+
111
+ LOCAL_C_INCLUDES += \
112
+ $(LIBUSB_ROOT_ABS)
113
+
114
+ LOCAL_SHARED_LIBRARIES += libusb1.0
115
+
116
+ LOCAL_MODULE:= dpfp
117
+
118
+ include $(BUILD_EXECUTABLE)
119
+
120
+ # dpfp_threaded
121
+
122
+ include $(CLEAR_VARS)
123
+
124
+ LOCAL_SRC_FILES := \
125
+ $(LIBUSB_ROOT_REL)/examples/dpfp_threaded.c
126
+
127
+ LOCAL_C_INCLUDES += \
128
+ $(LIBUSB_ROOT_ABS)
129
+
130
+ LOCAL_SHARED_LIBRARIES += libusb1.0
131
+
132
+ LOCAL_MODULE:= dpfp_threaded
133
+
134
+ include $(BUILD_EXECUTABLE)
@@ -0,0 +1,54 @@
1
+ # Android build config for libusb
2
+ # Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>
3
+ #
4
+ # This library is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU Lesser General Public
6
+ # License as published by the Free Software Foundation; either
7
+ # version 2.1 of the License, or (at your option) any later version.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ #
18
+
19
+ LOCAL_PATH:= $(call my-dir)
20
+ LIBUSB_ROOT_REL:= ../..
21
+ LIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../..
22
+
23
+ # libusb
24
+
25
+ include $(CLEAR_VARS)
26
+
27
+ LIBUSB_ROOT_REL:= ../..
28
+ LIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../..
29
+
30
+ LOCAL_SRC_FILES := \
31
+ $(LIBUSB_ROOT_REL)/libusb/core.c \
32
+ $(LIBUSB_ROOT_REL)/libusb/descriptor.c \
33
+ $(LIBUSB_ROOT_REL)/libusb/hotplug.c \
34
+ $(LIBUSB_ROOT_REL)/libusb/io.c \
35
+ $(LIBUSB_ROOT_REL)/libusb/sync.c \
36
+ $(LIBUSB_ROOT_REL)/libusb/strerror.c \
37
+ $(LIBUSB_ROOT_REL)/libusb/os/linux_usbfs.c \
38
+ $(LIBUSB_ROOT_REL)/libusb/os/poll_posix.c \
39
+ $(LIBUSB_ROOT_REL)/libusb/os/threads_posix.c \
40
+ $(LIBUSB_ROOT_REL)/libusb/os/linux_netlink.c
41
+
42
+ LOCAL_C_INCLUDES += \
43
+ $(LOCAL_PATH)/.. \
44
+ $(LIBUSB_ROOT_ABS)/libusb \
45
+ $(LIBUSB_ROOT_ABS)/libusb/os
46
+
47
+ LOCAL_EXPORT_C_INCLUDES := \
48
+ $(LIBUSB_ROOT_ABS)/libusb
49
+
50
+ LOCAL_LDLIBS := -llog
51
+
52
+ LOCAL_MODULE := libusb1.0
53
+
54
+ include $(BUILD_SHARED_LIBRARY)
@@ -0,0 +1,56 @@
1
+ # Android build config for libusb tests
2
+ # Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>
3
+ #
4
+ # This library is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU Lesser General Public
6
+ # License as published by the Free Software Foundation; either
7
+ # version 2.1 of the License, or (at your option) any later version.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ #
18
+
19
+ LOCAL_PATH:= $(call my-dir)
20
+ LIBUSB_ROOT_REL:= ../..
21
+ LIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../..
22
+
23
+ # testlib
24
+
25
+ include $(CLEAR_VARS)
26
+
27
+ LOCAL_SRC_FILES := \
28
+ $(LIBUSB_ROOT_REL)/tests/testlib.c
29
+
30
+ LOCAL_C_INCLUDES += \
31
+ $(LIBUSB_ROOT_ABS)/tests
32
+
33
+ LOCAL_EXPORT_C_INCLUDES := \
34
+ $(LIBUSB_ROOT_ABS)/tests
35
+
36
+ LOCAL_MODULE := testlib
37
+
38
+ include $(BUILD_STATIC_LIBRARY)
39
+
40
+
41
+ # stress
42
+
43
+ include $(CLEAR_VARS)
44
+
45
+ LOCAL_SRC_FILES := \
46
+ $(LIBUSB_ROOT_REL)/tests/stress.c
47
+
48
+ LOCAL_C_INCLUDES += \
49
+ $(LIBUSB_ROOT_ABS)
50
+
51
+ LOCAL_SHARED_LIBRARIES += libusb1.0
52
+ LOCAL_STATIC_LIBRARIES += testlib
53
+
54
+ LOCAL_MODULE:= stress
55
+
56
+ include $(BUILD_EXECUTABLE)