usb 2.0.0-alpha.1 → 2.0.3

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 (262) hide show
  1. package/.gitattributes +1 -0
  2. package/.gitmodules +1 -1
  3. package/CHANGELOG.md +91 -0
  4. package/README.md +570 -0
  5. package/binding.gyp +2 -2
  6. package/dist/index.d.ts +16 -5
  7. package/dist/index.js +135 -5
  8. package/dist/index.js.map +1 -1
  9. package/dist/usb/bindings.d.ts +13 -0
  10. package/dist/usb/bindings.js +2 -1
  11. package/dist/usb/bindings.js.map +1 -1
  12. package/dist/usb/index.d.ts +0 -2
  13. package/dist/usb/index.js +75 -112
  14. package/dist/usb/index.js.map +1 -1
  15. package/dist/usb/interface.js.map +1 -1
  16. package/dist/webusb/index.d.ts +28 -19
  17. package/dist/webusb/index.js +152 -66
  18. package/dist/webusb/index.js.map +1 -1
  19. package/dist/webusb/webusb-device.d.ts +1 -1
  20. package/dist/webusb/webusb-device.js +15 -6
  21. package/dist/webusb/webusb-device.js.map +1 -1
  22. package/libusb/.private/pre-commit.sh +7 -1
  23. package/libusb/.travis.yml +49 -0
  24. package/libusb/AUTHORS +44 -3
  25. package/libusb/Brewfile +4 -0
  26. package/libusb/ChangeLog +74 -2
  27. package/libusb/README.md +32 -0
  28. package/libusb/TODO +1 -1
  29. package/libusb/Xcode/common.xcconfig +12 -0
  30. package/libusb/Xcode/config.h +0 -3
  31. package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +959 -1
  32. package/libusb/android/README +4 -2
  33. package/libusb/android/config.h +0 -6
  34. package/libusb/appveyor.yml +41 -0
  35. package/libusb/appveyor_cygwin.bat +11 -0
  36. package/libusb/appveyor_minGW.bat +19 -0
  37. package/libusb/autogen.sh +1 -1
  38. package/libusb/bootstrap.sh +3 -16
  39. package/libusb/configure.ac +108 -80
  40. package/libusb/doc/doxygen.cfg.in +1785 -739
  41. package/libusb/examples/Makefile.am +1 -1
  42. package/libusb/examples/dpfp.c +3 -1
  43. package/libusb/examples/dpfp_threaded.c +23 -10
  44. package/libusb/examples/ezusb.c +3 -3
  45. package/libusb/examples/ezusb.h +2 -2
  46. package/libusb/examples/fxload.c +31 -9
  47. package/libusb/examples/hotplugtest.c +35 -7
  48. package/libusb/examples/listdevs.c +3 -1
  49. package/libusb/examples/sam3u_benchmark.c +3 -3
  50. package/libusb/examples/testlibusb.c +277 -0
  51. package/libusb/examples/xusb.c +40 -34
  52. package/libusb/libusb/Makefile.am +49 -23
  53. package/libusb/libusb/core.c +855 -457
  54. package/libusb/libusb/descriptor.c +72 -78
  55. package/libusb/libusb/hotplug.c +122 -76
  56. package/libusb/libusb/hotplug.h +42 -25
  57. package/libusb/libusb/io.c +625 -390
  58. package/libusb/libusb/libusb-1.0.def +12 -0
  59. package/libusb/libusb/libusb.h +218 -150
  60. package/libusb/libusb/libusbi.h +346 -176
  61. package/libusb/libusb/os/darwin_usb.c +604 -319
  62. package/libusb/libusb/os/darwin_usb.h +61 -20
  63. package/libusb/libusb/os/haiku_pollfs.cpp +367 -0
  64. package/libusb/libusb/os/haiku_usb.h +113 -0
  65. package/libusb/libusb/os/haiku_usb_backend.cpp +533 -0
  66. package/libusb/libusb/os/haiku_usb_raw.cpp +267 -0
  67. package/libusb/libusb/os/haiku_usb_raw.h +188 -0
  68. package/libusb/libusb/os/linux_netlink.c +186 -146
  69. package/libusb/libusb/os/linux_udev.c +36 -14
  70. package/libusb/libusb/os/linux_usbfs.c +426 -225
  71. package/libusb/libusb/os/linux_usbfs.h +5 -3
  72. package/libusb/libusb/os/netbsd_usb.c +21 -77
  73. package/libusb/libusb/os/openbsd_usb.c +32 -115
  74. package/libusb/libusb/os/poll_posix.c +38 -5
  75. package/libusb/libusb/os/poll_posix.h +3 -0
  76. package/libusb/libusb/os/poll_windows.c +277 -626
  77. package/libusb/libusb/os/poll_windows.h +11 -44
  78. package/libusb/libusb/os/sunos_usb.c +1695 -0
  79. package/libusb/libusb/os/sunos_usb.h +80 -0
  80. package/libusb/libusb/os/threads_posix.c +24 -26
  81. package/libusb/libusb/os/threads_posix.h +73 -21
  82. package/libusb/libusb/os/threads_windows.c +71 -157
  83. package/libusb/libusb/os/threads_windows.h +68 -44
  84. package/libusb/libusb/os/wince_usb.c +276 -420
  85. package/libusb/libusb/os/wince_usb.h +23 -28
  86. package/libusb/libusb/os/windows_common.h +78 -58
  87. package/libusb/libusb/os/windows_nt_common.c +1010 -0
  88. package/libusb/libusb/os/windows_nt_common.h +110 -0
  89. package/libusb/libusb/os/windows_nt_shared_types.h +147 -0
  90. package/libusb/libusb/os/windows_usbdk.c +830 -0
  91. package/libusb/libusb/os/windows_usbdk.h +103 -0
  92. package/libusb/libusb/os/windows_winusb.c +4391 -0
  93. package/libusb/libusb/os/windows_winusb.h +783 -0
  94. package/libusb/libusb/strerror.c +41 -7
  95. package/libusb/libusb/sync.c +41 -13
  96. package/libusb/libusb/version.h +1 -1
  97. package/libusb/libusb/version_nano.h +1 -1
  98. package/libusb/libusb-1.0.pc.in +1 -1
  99. package/libusb/msvc/appveyor.bat +27 -0
  100. package/libusb/msvc/config.h +5 -4
  101. package/libusb/msvc/ddk_build.cmd +87 -43
  102. package/libusb/msvc/fxload_2010.vcxproj +24 -104
  103. package/libusb/msvc/fxload_2012.vcxproj +24 -107
  104. package/libusb/msvc/fxload_2013.vcxproj +24 -107
  105. package/libusb/msvc/fxload_2015.vcxproj +91 -0
  106. package/libusb/msvc/fxload_2017.vcxproj +114 -0
  107. package/libusb/msvc/fxload_sources +1 -1
  108. package/libusb/msvc/getopt_2010.vcxproj +16 -75
  109. package/libusb/msvc/getopt_2012.vcxproj +16 -79
  110. package/libusb/msvc/getopt_2013.vcxproj +16 -79
  111. package/libusb/msvc/getopt_2015.vcxproj +73 -0
  112. package/libusb/msvc/getopt_2017.vcxproj +98 -0
  113. package/libusb/msvc/getopt_sources +6 -2
  114. package/libusb/msvc/hotplugtest_2010.vcxproj +18 -99
  115. package/libusb/msvc/hotplugtest_2012.vcxproj +18 -102
  116. package/libusb/msvc/hotplugtest_2013.vcxproj +18 -102
  117. package/libusb/msvc/hotplugtest_2015.vcxproj +83 -0
  118. package/libusb/msvc/hotplugtest_2017.vcxproj +106 -0
  119. package/libusb/msvc/hotplugtest_sources +1 -1
  120. package/libusb/msvc/libusb_2005.sln +20 -20
  121. package/libusb/msvc/libusb_2010.sln +57 -46
  122. package/libusb/msvc/libusb_2012.sln +57 -46
  123. package/libusb/msvc/libusb_2013.sln +57 -50
  124. package/libusb/msvc/libusb_2015.sln +59 -52
  125. package/libusb/msvc/libusb_2017.sln +186 -0
  126. package/libusb/msvc/libusb_dll.dsp +2 -2
  127. package/libusb/msvc/libusb_dll_2005.vcproj +30 -2
  128. package/libusb/msvc/libusb_dll_2010.vcxproj +26 -90
  129. package/libusb/msvc/libusb_dll_2012.vcxproj +28 -96
  130. package/libusb/msvc/libusb_dll_2013.vcxproj +28 -96
  131. package/libusb/msvc/libusb_dll_2015.vcxproj +107 -0
  132. package/libusb/msvc/libusb_dll_2017.vcxproj +134 -0
  133. package/libusb/msvc/libusb_dll_wince.vcproj +9 -1
  134. package/libusb/msvc/libusb_sources +10 -5
  135. package/libusb/msvc/libusb_static.dsp +2 -2
  136. package/libusb/msvc/libusb_static_2005.vcproj +32 -4
  137. package/libusb/msvc/libusb_static_2010.vcxproj +24 -83
  138. package/libusb/msvc/libusb_static_2012.vcxproj +25 -87
  139. package/libusb/msvc/libusb_static_2013.vcxproj +25 -87
  140. package/libusb/msvc/libusb_static_2015.vcxproj +98 -0
  141. package/libusb/msvc/libusb_static_2017.vcxproj +117 -0
  142. package/libusb/msvc/libusb_static_wince.vcproj +20 -26
  143. package/libusb/msvc/libusb_wince.sln +88 -88
  144. package/libusb/msvc/listdevs_2010.vcxproj +16 -99
  145. package/libusb/msvc/listdevs_2012.vcxproj +16 -102
  146. package/libusb/msvc/listdevs_2013.vcxproj +16 -102
  147. package/libusb/msvc/listdevs_2015.vcxproj +83 -0
  148. package/libusb/msvc/listdevs_2017.vcxproj +106 -0
  149. package/libusb/msvc/listdevs_sources +2 -1
  150. package/libusb/msvc/stress_2010.vcxproj +20 -101
  151. package/libusb/msvc/stress_2012.vcxproj +20 -104
  152. package/libusb/msvc/stress_2013.vcxproj +20 -104
  153. package/libusb/msvc/stress_2015.vcxproj +87 -0
  154. package/libusb/msvc/stress_2017.vcxproj +110 -0
  155. package/libusb/msvc/stress_sources +21 -0
  156. package/libusb/msvc/testlibusb_2010.vcxproj +82 -0
  157. package/libusb/msvc/testlibusb_2012.vcxproj +83 -0
  158. package/libusb/msvc/testlibusb_2013.vcxproj +83 -0
  159. package/libusb/msvc/testlibusb_2015.vcxproj +83 -0
  160. package/libusb/msvc/testlibusb_2017.vcxproj +106 -0
  161. package/libusb/msvc/testlibusb_sources +20 -0
  162. package/libusb/msvc/xusb_2010.vcxproj +17 -98
  163. package/libusb/msvc/xusb_2012.vcxproj +17 -101
  164. package/libusb/msvc/xusb_2013.vcxproj +17 -101
  165. package/libusb/msvc/xusb_2015.vcxproj +83 -0
  166. package/libusb/msvc/xusb_2017.vcxproj +106 -0
  167. package/libusb/msvc/xusb_sources +1 -1
  168. package/libusb/tests/stress.c +2 -2
  169. package/libusb/tests/testlib.c +0 -4
  170. package/libusb/travis-autogen.sh +39 -0
  171. package/libusb.gypi +13 -2
  172. package/package.json +23 -13
  173. package/prebuilds/android-arm/node.napi.armv7.node +0 -0
  174. package/prebuilds/android-arm64/node.napi.armv8.node +0 -0
  175. package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
  176. package/prebuilds/linux-arm/node.napi.armv6.node +0 -0
  177. package/prebuilds/linux-arm/node.napi.armv7.node +0 -0
  178. package/prebuilds/linux-arm64/node.napi.armv8.node +0 -0
  179. package/prebuilds/linux-ia32/node.napi.node +0 -0
  180. package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
  181. package/prebuilds/linux-x64/node.napi.musl.node +0 -0
  182. package/prebuilds/win32-ia32/node.napi.node +0 -0
  183. package/prebuilds/win32-x64/node.napi.node +0 -0
  184. package/src/device.cc +7 -7
  185. package/src/node_usb.cc +43 -1
  186. package/src/node_usb.h +1 -0
  187. package/src/uv_async_queue.h +33 -25
  188. package/test/usb.coffee +12 -4
  189. package/tsc/index.ts +68 -8
  190. package/tsc/usb/bindings.ts +19 -1
  191. package/tsc/usb/index.ts +66 -68
  192. package/tsc/usb/interface.ts +2 -2
  193. package/tsc/webusb/index.ts +187 -75
  194. package/tsc/webusb/webusb-device.ts +28 -17
  195. package/.github/workflows/prebuild.yml +0 -48
  196. package/Readme.md +0 -339
  197. package/dist/webusb/typed-event-target.d.ts +0 -11
  198. package/dist/webusb/typed-event-target.js +0 -21
  199. package/dist/webusb/typed-event-target.js.map +0 -1
  200. package/docs/assets/css/main.css +0 -2660
  201. package/docs/assets/images/icons.png +0 -0
  202. package/docs/assets/images/icons@2x.png +0 -0
  203. package/docs/assets/images/widgets.png +0 -0
  204. package/docs/assets/images/widgets@2x.png +0 -0
  205. package/docs/assets/js/main.js +0 -248
  206. package/docs/assets/js/search.js +0 -1
  207. package/docs/classes/usb_bindings.device.html +0 -1338
  208. package/docs/classes/usb_bindings.libusbexception.html +0 -234
  209. package/docs/classes/usb_bindings.transfer.html +0 -344
  210. package/docs/classes/usb_capability.capability.html +0 -297
  211. package/docs/classes/usb_device.extendeddevice.html +0 -766
  212. package/docs/classes/usb_endpoint.endpoint.html +0 -472
  213. package/docs/classes/usb_endpoint.inendpoint.html +0 -766
  214. package/docs/classes/usb_endpoint.outendpoint.html +0 -582
  215. package/docs/classes/usb_interface.interface.html +0 -648
  216. package/docs/classes/webusb.webusb-1.html +0 -615
  217. package/docs/classes/webusb_mutex.mutex.html +0 -270
  218. package/docs/classes/webusb_typed_event_target.typedeventtarget.html +0 -443
  219. package/docs/classes/webusb_webusb_device.webusbdevice.html +0 -904
  220. package/docs/index.html +0 -500
  221. package/docs/interfaces/usb.deviceevents.html +0 -242
  222. package/docs/interfaces/usb_descriptors.bosdescriptor.html +0 -293
  223. package/docs/interfaces/usb_descriptors.capabilitydescriptor.html +0 -274
  224. package/docs/interfaces/usb_descriptors.configdescriptor.html +0 -388
  225. package/docs/interfaces/usb_descriptors.devicedescriptor.html +0 -464
  226. package/docs/interfaces/usb_descriptors.endpointdescriptor.html +0 -370
  227. package/docs/interfaces/usb_descriptors.interfacedescriptor.html +0 -407
  228. package/docs/interfaces/webusb.usboptions.html +0 -226
  229. package/docs/modules/index.html +0 -173
  230. package/docs/modules/usb.html +0 -173
  231. package/docs/modules/usb_bindings.html +0 -2319
  232. package/docs/modules/usb_capability.html +0 -156
  233. package/docs/modules/usb_descriptors.html +0 -176
  234. package/docs/modules/usb_device.html +0 -156
  235. package/docs/modules/usb_endpoint.html +0 -164
  236. package/docs/modules/usb_interface.html +0 -156
  237. package/docs/modules/webusb.html +0 -165
  238. package/docs/modules/webusb_mutex.html +0 -156
  239. package/docs/modules/webusb_typed_event_target.html +0 -156
  240. package/docs/modules/webusb_webusb_device.html +0 -156
  241. package/docs/modules.html +0 -156
  242. package/libusb/INSTALL +0 -234
  243. package/libusb/README +0 -28
  244. package/libusb/libusb/os/windows_usb.c +0 -5347
  245. package/libusb/libusb/os/windows_usb.h +0 -971
  246. package/libusb/msvc/fxload_2010.vcxproj.filters +0 -25
  247. package/libusb/msvc/fxload_2012.vcxproj.filters +0 -25
  248. package/libusb/msvc/getopt_2010.vcxproj.filters +0 -26
  249. package/libusb/msvc/getopt_2012.vcxproj.filters +0 -26
  250. package/libusb/msvc/hotplugtest_2010.vcxproj.filters +0 -14
  251. package/libusb/msvc/hotplugtest_2012.vcxproj.filters +0 -14
  252. package/libusb/msvc/libusb_dll_2010.vcxproj.filters +0 -81
  253. package/libusb/msvc/libusb_dll_2012.vcxproj.filters +0 -84
  254. package/libusb/msvc/libusb_static_2010.vcxproj.filters +0 -74
  255. package/libusb/msvc/libusb_static_2012.vcxproj.filters +0 -74
  256. package/libusb/msvc/listdevs_2010.vcxproj.filters +0 -14
  257. package/libusb/msvc/listdevs_2012.vcxproj.filters +0 -14
  258. package/libusb/msvc/stress_2010.vcxproj.filters +0 -25
  259. package/libusb/msvc/stress_2012.vcxproj.filters +0 -25
  260. package/libusb/msvc/xusb_2010.vcxproj.filters +0 -14
  261. package/libusb/msvc/xusb_2012.vcxproj.filters +0 -14
  262. package/tsc/webusb/typed-event-target.ts +0 -23
@@ -0,0 +1,103 @@
1
+ /*
2
+ * windows UsbDk backend for libusb 1.0
3
+ * Copyright © 2014 Red Hat, Inc.
4
+
5
+ * Authors:
6
+ * Dmitry Fleytman <dmitry@daynix.com>
7
+ * Pavel Gurvich <pavel@daynix.com>
8
+ *
9
+ * This library is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU Lesser General Public
11
+ * License as published by the Free Software Foundation; either
12
+ * version 2.1 of the License, or (at your option) any later version.
13
+ *
14
+ * This library is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ * Lesser General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Lesser General Public
20
+ * License along with this library; if not, write to the Free Software
21
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
+ */
23
+
24
+ #pragma once
25
+
26
+ #include "windows_nt_common.h"
27
+
28
+ typedef struct USB_DK_CONFIG_DESCRIPTOR_REQUEST {
29
+ USB_DK_DEVICE_ID ID;
30
+ ULONG64 Index;
31
+ } USB_DK_CONFIG_DESCRIPTOR_REQUEST, *PUSB_DK_CONFIG_DESCRIPTOR_REQUEST;
32
+
33
+ typedef enum {
34
+ TransferFailure = 0,
35
+ TransferSuccess,
36
+ TransferSuccessAsync
37
+ } TransferResult;
38
+
39
+ typedef enum {
40
+ NoSpeed = 0,
41
+ LowSpeed,
42
+ FullSpeed,
43
+ HighSpeed,
44
+ SuperSpeed
45
+ } USB_DK_DEVICE_SPEED;
46
+
47
+ typedef enum {
48
+ ControlTransferType,
49
+ BulkTransferType,
50
+ InterruptTransferType,
51
+ IsochronousTransferType
52
+ } USB_DK_TRANSFER_TYPE;
53
+
54
+ typedef BOOL (__cdecl *USBDK_GET_DEVICES_LIST)(
55
+ PUSB_DK_DEVICE_INFO *DeviceInfo,
56
+ PULONG DeviceNumber
57
+ );
58
+ typedef void (__cdecl *USBDK_RELEASE_DEVICES_LIST)(
59
+ PUSB_DK_DEVICE_INFO DeviceInfo
60
+ );
61
+ typedef HANDLE (__cdecl *USBDK_START_REDIRECT)(
62
+ PUSB_DK_DEVICE_ID DeviceId
63
+ );
64
+ typedef BOOL (__cdecl *USBDK_STOP_REDIRECT)(
65
+ HANDLE DeviceHandle
66
+ );
67
+ typedef BOOL (__cdecl *USBDK_GET_CONFIGURATION_DESCRIPTOR)(
68
+ PUSB_DK_CONFIG_DESCRIPTOR_REQUEST Request,
69
+ PUSB_CONFIGURATION_DESCRIPTOR *Descriptor,
70
+ PULONG Length
71
+ );
72
+ typedef void (__cdecl *USBDK_RELEASE_CONFIGURATION_DESCRIPTOR)(
73
+ PUSB_CONFIGURATION_DESCRIPTOR Descriptor
74
+ );
75
+ typedef TransferResult (__cdecl *USBDK_WRITE_PIPE)(
76
+ HANDLE DeviceHandle,
77
+ PUSB_DK_TRANSFER_REQUEST Request,
78
+ LPOVERLAPPED lpOverlapped
79
+ );
80
+ typedef TransferResult (__cdecl *USBDK_READ_PIPE)(
81
+ HANDLE DeviceHandle,
82
+ PUSB_DK_TRANSFER_REQUEST Request,
83
+ LPOVERLAPPED lpOverlapped
84
+ );
85
+ typedef BOOL (__cdecl *USBDK_ABORT_PIPE)(
86
+ HANDLE DeviceHandle,
87
+ ULONG64 PipeAddress
88
+ );
89
+ typedef BOOL (__cdecl *USBDK_RESET_PIPE)(
90
+ HANDLE DeviceHandle,
91
+ ULONG64 PipeAddress
92
+ );
93
+ typedef BOOL (__cdecl *USBDK_SET_ALTSETTING)(
94
+ HANDLE DeviceHandle,
95
+ ULONG64 InterfaceIdx,
96
+ ULONG64 AltSettingIdx
97
+ );
98
+ typedef BOOL (__cdecl *USBDK_RESET_DEVICE)(
99
+ HANDLE DeviceHandle
100
+ );
101
+ typedef HANDLE (__cdecl *USBDK_GET_REDIRECTOR_SYSTEM_HANDLE)(
102
+ HANDLE DeviceHandle
103
+ );