usb 2.1.3 → 2.2.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.
- package/CHANGELOG.md +12 -0
- package/README.md +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/usb/bindings.d.ts +4 -0
- package/dist/usb/device.js +5 -0
- package/dist/usb/device.js.map +1 -1
- package/libusb/.gitattributes +2 -6
- package/libusb/.private/appveyor_build.sh +22 -0
- package/libusb/.private/bm.sh +1 -1
- package/libusb/.private/ci-build.sh +67 -0
- package/libusb/.private/post-rewrite.sh +5 -1
- package/libusb/.private/pre-commit.sh +5 -1
- package/libusb/.private/wbs.txt +4 -19
- package/libusb/.travis.yml +32 -23
- package/libusb/AUTHORS +76 -3
- package/libusb/ChangeLog +41 -3
- package/libusb/INSTALL_WIN.txt +22 -44
- package/libusb/Makefile.am +32 -10
- package/libusb/{README.md → README} +2 -2
- package/libusb/README.git +3 -3
- package/libusb/Xcode/common.xcconfig +23 -19
- package/libusb/Xcode/config.h +25 -13
- package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +511 -109
- package/libusb/android/README +90 -54
- package/libusb/android/config.h +23 -43
- package/libusb/android/examples/unrooted_android.c +301 -0
- package/libusb/android/examples/unrooted_android.h +36 -0
- package/libusb/android/jni/Android.mk +1 -1
- package/libusb/android/jni/Application.mk +16 -0
- package/libusb/android/jni/examples.mk +63 -29
- package/libusb/android/jni/libusb.mk +14 -8
- package/libusb/android/jni/tests.mk +13 -24
- package/libusb/appveyor.yml +69 -30
- package/libusb/autogen.sh +5 -3
- package/libusb/bootstrap.sh +6 -2
- package/libusb/configure.ac +302 -228
- package/libusb/doc/Makefile.in +22 -0
- package/libusb/doc/doxygen.cfg.in +460 -223
- package/libusb/examples/Makefile.am +6 -13
- package/libusb/examples/dpfp.c +276 -73
- package/libusb/examples/ezusb.c +18 -8
- package/libusb/examples/ezusb.h +6 -17
- package/libusb/examples/fxload.c +4 -5
- package/libusb/examples/hotplugtest.c +1 -1
- package/libusb/examples/sam3u_benchmark.c +59 -24
- package/libusb/examples/testlibusb.c +138 -104
- package/libusb/examples/xusb.c +26 -22
- package/libusb/libusb/Makefile.am +57 -70
- package/libusb/libusb/Makefile.am.extra +26 -0
- package/libusb/libusb/core.c +420 -423
- package/libusb/libusb/descriptor.c +365 -419
- package/libusb/libusb/hotplug.c +197 -104
- package/libusb/libusb/io.c +491 -528
- package/libusb/libusb/libusb-1.0.def +7 -3
- package/libusb/libusb/libusb-1.0.rc +1 -9
- package/libusb/libusb/libusb.h +295 -226
- package/libusb/libusb/libusbi.h +587 -314
- package/libusb/libusb/os/darwin_usb.c +634 -317
- package/libusb/libusb/os/darwin_usb.h +39 -15
- package/libusb/libusb/os/events_posix.c +300 -0
- package/libusb/libusb/os/events_posix.h +59 -0
- package/libusb/libusb/os/events_windows.c +214 -0
- package/libusb/{msvc/missing.h → libusb/os/events_windows.h} +25 -11
- package/libusb/libusb/os/haiku_pollfs.cpp +14 -9
- package/libusb/libusb/os/haiku_usb.h +12 -12
- package/libusb/libusb/os/haiku_usb_backend.cpp +36 -37
- package/libusb/libusb/os/haiku_usb_raw.cpp +80 -116
- package/libusb/libusb/os/linux_netlink.c +55 -63
- package/libusb/libusb/os/linux_udev.c +61 -69
- package/libusb/libusb/os/linux_usbfs.c +926 -1015
- package/libusb/libusb/os/linux_usbfs.h +74 -57
- package/libusb/libusb/os/netbsd_usb.c +103 -168
- package/libusb/libusb/os/null_usb.c +111 -0
- package/libusb/libusb/os/openbsd_usb.c +71 -120
- package/libusb/libusb/os/sunos_usb.c +289 -375
- package/libusb/libusb/os/sunos_usb.h +0 -1
- package/libusb/libusb/os/threads_posix.c +81 -32
- package/libusb/libusb/os/threads_posix.h +19 -23
- package/libusb/libusb/os/threads_windows.c +9 -95
- package/libusb/libusb/os/threads_windows.h +33 -31
- package/libusb/libusb/os/windows_common.c +904 -0
- package/libusb/libusb/os/windows_common.h +329 -42
- package/libusb/libusb/os/windows_usbdk.c +161 -267
- package/libusb/libusb/os/windows_usbdk.h +5 -2
- package/libusb/libusb/os/windows_winusb.c +1326 -1190
- package/libusb/libusb/os/windows_winusb.h +167 -167
- package/libusb/libusb/strerror.c +20 -30
- package/libusb/libusb/sync.c +20 -21
- package/libusb/libusb/version.h +1 -1
- package/libusb/libusb/version_nano.h +1 -1
- package/libusb/msvc/.gitattributes +3 -0
- package/libusb/msvc/config.h +27 -20
- package/libusb/msvc/{hotplugtest_2012.vcxproj → dpfp_2013.vcxproj} +14 -10
- package/libusb/msvc/dpfp_2013.vcxproj.filters +26 -0
- package/libusb/msvc/{listdevs_2010.vcxproj → dpfp_2015.vcxproj} +14 -9
- package/libusb/msvc/dpfp_2015.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_2017.vcxproj +106 -0
- package/libusb/msvc/dpfp_2017.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_2019.vcxproj +106 -0
- package/libusb/msvc/dpfp_2019.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_threaded_2013.vcxproj +87 -0
- package/libusb/msvc/dpfp_threaded_2013.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_threaded_2015.vcxproj +87 -0
- package/libusb/msvc/dpfp_threaded_2015.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_threaded_2017.vcxproj +106 -0
- package/libusb/msvc/dpfp_threaded_2017.vcxproj.filters +26 -0
- package/libusb/msvc/{fxload_2012.vcxproj → dpfp_threaded_2019.vcxproj} +32 -17
- package/libusb/msvc/dpfp_threaded_2019.vcxproj.filters +26 -0
- package/libusb/msvc/fxload_2013.vcxproj +6 -3
- package/libusb/msvc/fxload_2013.vcxproj.filters +35 -0
- package/libusb/msvc/fxload_2015.vcxproj +6 -3
- package/libusb/msvc/fxload_2015.vcxproj.filters +35 -0
- package/libusb/msvc/fxload_2017.vcxproj +6 -7
- package/libusb/msvc/fxload_2017.vcxproj.filters +35 -0
- package/libusb/msvc/{fxload_2010.vcxproj → fxload_2019.vcxproj} +29 -6
- package/libusb/msvc/fxload_2019.vcxproj.filters +35 -0
- package/libusb/{examples → msvc}/getopt/getopt.c +0 -0
- package/libusb/{examples → msvc}/getopt/getopt.h +0 -0
- package/libusb/{examples → msvc}/getopt/getopt1.c +0 -0
- package/libusb/msvc/getopt_2013.vcxproj +4 -5
- package/libusb/msvc/getopt_2013.vcxproj.filters +26 -0
- package/libusb/msvc/getopt_2015.vcxproj +4 -4
- package/libusb/msvc/getopt_2015.vcxproj.filters +26 -0
- package/libusb/msvc/getopt_2017.vcxproj +4 -10
- package/libusb/msvc/getopt_2017.vcxproj.filters +26 -0
- package/libusb/msvc/{getopt_2012.vcxproj → getopt_2019.vcxproj} +25 -6
- package/libusb/msvc/getopt_2019.vcxproj.filters +26 -0
- package/libusb/msvc/hotplugtest_2013.vcxproj +6 -3
- package/libusb/msvc/hotplugtest_2013.vcxproj.filters +23 -0
- package/libusb/msvc/hotplugtest_2015.vcxproj +6 -3
- package/libusb/msvc/hotplugtest_2015.vcxproj.filters +23 -0
- package/libusb/msvc/hotplugtest_2017.vcxproj +6 -7
- package/libusb/msvc/hotplugtest_2017.vcxproj.filters +23 -0
- package/libusb/msvc/hotplugtest_2019.vcxproj +105 -0
- package/libusb/msvc/hotplugtest_2019.vcxproj.filters +23 -0
- package/libusb/msvc/libusb_2013.sln +50 -20
- package/libusb/msvc/libusb_2015.sln +51 -21
- package/libusb/msvc/libusb_2017.sln +90 -36
- package/libusb/msvc/libusb_2019.sln +240 -0
- package/libusb/msvc/libusb_dll_2013.vcxproj +6 -9
- package/libusb/msvc/libusb_dll_2013.vcxproj.filters +94 -0
- package/libusb/msvc/libusb_dll_2015.vcxproj +6 -8
- package/libusb/msvc/libusb_dll_2015.vcxproj.filters +94 -0
- package/libusb/msvc/libusb_dll_2017.vcxproj +6 -16
- package/libusb/msvc/libusb_dll_2017.vcxproj.filters +94 -0
- package/libusb/msvc/{libusb_dll_2010.vcxproj → libusb_dll_2019.vcxproj} +27 -9
- package/libusb/msvc/libusb_dll_2019.vcxproj.filters +94 -0
- package/libusb/msvc/libusb_static_2013.vcxproj +5 -9
- package/libusb/msvc/libusb_static_2013.vcxproj.filters +80 -0
- package/libusb/msvc/libusb_static_2015.vcxproj +5 -8
- package/libusb/msvc/libusb_static_2015.vcxproj.filters +80 -0
- package/libusb/msvc/libusb_static_2017.vcxproj +5 -8
- package/libusb/msvc/libusb_static_2017.vcxproj.filters +80 -0
- package/libusb/msvc/{libusb_static_2010.vcxproj → libusb_static_2019.vcxproj} +26 -9
- package/libusb/msvc/libusb_static_2019.vcxproj.filters +80 -0
- package/libusb/msvc/listdevs_2013.vcxproj +6 -3
- package/libusb/msvc/listdevs_2013.vcxproj.filters +23 -0
- package/libusb/msvc/listdevs_2015.vcxproj +6 -3
- package/libusb/msvc/listdevs_2015.vcxproj.filters +23 -0
- package/libusb/msvc/listdevs_2017.vcxproj +6 -7
- package/libusb/msvc/listdevs_2017.vcxproj.filters +23 -0
- package/libusb/msvc/listdevs_2019.vcxproj +105 -0
- package/libusb/msvc/listdevs_2019.vcxproj.filters +23 -0
- package/libusb/msvc/{listdevs_2012.vcxproj → sam3u_benchmark_2013.vcxproj} +13 -9
- package/libusb/msvc/sam3u_benchmark_2013.vcxproj.filters +26 -0
- package/libusb/msvc/{hotplugtest_2010.vcxproj → sam3u_benchmark_2015.vcxproj} +13 -8
- package/libusb/msvc/sam3u_benchmark_2015.vcxproj.filters +26 -0
- package/libusb/msvc/sam3u_benchmark_2017.vcxproj +106 -0
- package/libusb/msvc/sam3u_benchmark_2017.vcxproj.filters +26 -0
- package/libusb/msvc/sam3u_benchmark_2019.vcxproj +106 -0
- package/libusb/msvc/sam3u_benchmark_2019.vcxproj.filters +26 -0
- package/libusb/msvc/stress_2013.vcxproj +4 -2
- package/libusb/msvc/stress_2013.vcxproj.filters +32 -0
- package/libusb/msvc/stress_2015.vcxproj +4 -2
- package/libusb/msvc/stress_2015.vcxproj.filters +32 -0
- package/libusb/msvc/stress_2017.vcxproj +4 -6
- package/libusb/msvc/stress_2017.vcxproj.filters +32 -0
- package/libusb/msvc/{stress_2010.vcxproj → stress_2019.vcxproj} +26 -4
- package/libusb/msvc/stress_2019.vcxproj.filters +32 -0
- package/libusb/msvc/testlibusb_2013.vcxproj +6 -3
- package/libusb/msvc/testlibusb_2013.vcxproj.filters +23 -0
- package/libusb/msvc/testlibusb_2015.vcxproj +6 -3
- package/libusb/msvc/testlibusb_2015.vcxproj.filters +23 -0
- package/libusb/msvc/testlibusb_2017.vcxproj +6 -7
- package/libusb/msvc/testlibusb_2017.vcxproj.filters +23 -0
- package/libusb/msvc/{testlibusb_2010.vcxproj → testlibusb_2019.vcxproj} +28 -5
- package/libusb/msvc/testlibusb_2019.vcxproj.filters +23 -0
- package/libusb/msvc/xusb_2013.vcxproj +6 -3
- package/libusb/msvc/xusb_2013.vcxproj.filters +23 -0
- package/libusb/msvc/xusb_2015.vcxproj +6 -3
- package/libusb/msvc/xusb_2015.vcxproj.filters +23 -0
- package/libusb/msvc/xusb_2017.vcxproj +6 -7
- package/libusb/msvc/xusb_2017.vcxproj.filters +23 -0
- package/libusb/msvc/{xusb_2010.vcxproj → xusb_2019.vcxproj} +28 -5
- package/libusb/msvc/xusb_2019.vcxproj.filters +23 -0
- package/libusb/tests/Makefile.am +1 -0
- package/libusb/tests/libusb_testlib.h +12 -43
- package/libusb/tests/stress.c +59 -50
- package/libusb/tests/testlib.c +78 -171
- package/libusb.gypi +10 -11
- package/package.json +1 -1
- package/prebuilds/android-arm/node.napi.armv7.node +0 -0
- package/prebuilds/android-arm64/node.napi.armv8.node +0 -0
- package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
- package/prebuilds/linux-arm/node.napi.armv6.node +0 -0
- package/prebuilds/linux-arm/node.napi.armv7.node +0 -0
- package/prebuilds/linux-arm64/node.napi.armv8.node +0 -0
- package/prebuilds/linux-ia32/node.napi.node +0 -0
- package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/prebuilds/win32-ia32/node.napi.node +0 -0
- package/prebuilds/win32-x64/node.napi.node +0 -0
- package/src/device.cc +12 -7
- package/src/node_usb.cc +10 -0
- package/test/usb.coffee +6 -0
- package/tsc/index.ts +2 -0
- package/tsc/usb/bindings.ts +5 -0
- package/tsc/usb/device.ts +6 -0
- package/libusb/.private/bd.cmd +0 -89
- package/libusb/.private/bwince.cmd +0 -57
- package/libusb/.private/wbs_wince.txt +0 -42
- package/libusb/Brewfile +0 -4
- package/libusb/appveyor_cygwin.bat +0 -11
- package/libusb/appveyor_minGW.bat +0 -19
- package/libusb/doc/Makefile.am +0 -9
- package/libusb/examples/dpfp_threaded.c +0 -557
- package/libusb/libusb/hotplug.h +0 -99
- package/libusb/libusb/os/poll_posix.c +0 -84
- package/libusb/libusb/os/poll_posix.h +0 -14
- package/libusb/libusb/os/poll_windows.c +0 -447
- package/libusb/libusb/os/poll_windows.h +0 -98
- package/libusb/libusb/os/wince_usb.c +0 -888
- package/libusb/libusb/os/wince_usb.h +0 -126
- package/libusb/libusb/os/windows_nt_common.c +0 -1010
- package/libusb/libusb/os/windows_nt_common.h +0 -110
- package/libusb/libusb/os/windows_nt_shared_types.h +0 -147
- package/libusb/msvc/appveyor.bat +0 -27
- package/libusb/msvc/ddk_build.cmd +0 -219
- package/libusb/msvc/errno.h +0 -102
- package/libusb/msvc/fxload_sources +0 -23
- package/libusb/msvc/getopt_2005.vcproj +0 -288
- package/libusb/msvc/getopt_2010.vcxproj +0 -72
- package/libusb/msvc/getopt_sources +0 -24
- package/libusb/msvc/hotplugtest_sources +0 -20
- package/libusb/msvc/inttypes.h +0 -295
- package/libusb/msvc/libusb.dsw +0 -71
- package/libusb/msvc/libusb_2005.sln +0 -95
- package/libusb/msvc/libusb_2010.sln +0 -105
- package/libusb/msvc/libusb_2012.sln +0 -105
- package/libusb/msvc/libusb_dll.dsp +0 -194
- package/libusb/msvc/libusb_dll_2005.vcproj +0 -464
- package/libusb/msvc/libusb_dll_2012.vcxproj +0 -107
- package/libusb/msvc/libusb_dll_wince.vcproj +0 -1251
- package/libusb/msvc/libusb_sources +0 -43
- package/libusb/msvc/libusb_static.dsp +0 -174
- package/libusb/msvc/libusb_static_2005.vcproj +0 -390
- package/libusb/msvc/libusb_static_2012.vcxproj +0 -98
- package/libusb/msvc/libusb_static_wince.vcproj +0 -1179
- package/libusb/msvc/libusb_wince.sln +0 -246
- package/libusb/msvc/listdevs.dsp +0 -103
- package/libusb/msvc/listdevs_2005.vcproj +0 -360
- package/libusb/msvc/listdevs_sources +0 -20
- package/libusb/msvc/listdevs_wince.vcproj +0 -1120
- package/libusb/msvc/missing.c +0 -80
- package/libusb/msvc/stdint.h +0 -256
- package/libusb/msvc/stress_2005.vcproj +0 -390
- package/libusb/msvc/stress_2012.vcxproj +0 -87
- package/libusb/msvc/stress_sources +0 -21
- package/libusb/msvc/stress_wince.vcproj +0 -1128
- package/libusb/msvc/testlibusb_2012.vcxproj +0 -83
- package/libusb/msvc/testlibusb_sources +0 -20
- package/libusb/msvc/xusb.dsp +0 -102
- package/libusb/msvc/xusb_2005.vcproj +0 -344
- package/libusb/msvc/xusb_2012.vcxproj +0 -83
- package/libusb/msvc/xusb_sources +0 -20
- package/libusb/msvc/xusb_wince.vcproj +0 -1120
- package/libusb/travis-autogen.sh +0 -39
package/libusb/tests/testlib.c
CHANGED
|
@@ -17,43 +17,26 @@
|
|
|
17
17
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
#include
|
|
20
|
+
#include <config.h>
|
|
21
21
|
|
|
22
|
-
#include <
|
|
22
|
+
#include <errno.h>
|
|
23
23
|
#include <stdarg.h>
|
|
24
|
+
#include <stdbool.h>
|
|
25
|
+
#include <stdio.h>
|
|
24
26
|
#include <string.h>
|
|
25
|
-
#include <errno.h>
|
|
26
|
-
#if !defined(_WIN32_WCE)
|
|
27
|
-
#include <sys/types.h>
|
|
28
|
-
#include <sys/stat.h>
|
|
29
|
-
#include <fcntl.h>
|
|
30
|
-
#endif
|
|
31
27
|
|
|
32
|
-
#
|
|
33
|
-
|
|
34
|
-
#
|
|
35
|
-
#define STDOUT_FILENO 1
|
|
36
|
-
#elif defined(_WIN32)
|
|
37
|
-
#include <io.h>
|
|
38
|
-
#define dup _dup
|
|
39
|
-
#define dup2 _dup2
|
|
40
|
-
#define open _open
|
|
41
|
-
#define close _close
|
|
42
|
-
#define fdopen _fdopen
|
|
43
|
-
#define NULL_PATH "nul"
|
|
44
|
-
#define STDOUT_FILENO 1
|
|
45
|
-
#define STDERR_FILENO 2
|
|
46
|
-
#else
|
|
47
|
-
#include <unistd.h>
|
|
28
|
+
#include "libusb_testlib.h"
|
|
29
|
+
|
|
30
|
+
#if defined(PLATFORM_POSIX)
|
|
48
31
|
#define NULL_PATH "/dev/null"
|
|
32
|
+
#elif defined(PLATFORM_WINDOWS)
|
|
33
|
+
#define NULL_PATH "nul"
|
|
49
34
|
#endif
|
|
50
|
-
#define INVALID_FD -1
|
|
51
|
-
#define IGNORE_RETVAL(expr) do { (void)(expr); } while(0)
|
|
52
35
|
|
|
53
36
|
/**
|
|
54
37
|
* Converts a test result code into a human readable string.
|
|
55
38
|
*/
|
|
56
|
-
static const char*
|
|
39
|
+
static const char *test_result_to_str(libusb_testlib_result result)
|
|
57
40
|
{
|
|
58
41
|
switch (result) {
|
|
59
42
|
case TEST_STATUS_SUCCESS:
|
|
@@ -69,100 +52,27 @@ static const char* test_result_to_str(libusb_testlib_result result)
|
|
|
69
52
|
}
|
|
70
53
|
}
|
|
71
54
|
|
|
72
|
-
static void print_usage(
|
|
55
|
+
static void print_usage(const char *progname)
|
|
73
56
|
{
|
|
74
|
-
printf("Usage: %s [-l] [-v] [<test_name> ...]\n",
|
|
75
|
-
argc > 0 ? argv[0] : "test_*");
|
|
57
|
+
printf("Usage: %s [-l] [-v] [<test_name> ...]\n", progname);
|
|
76
58
|
printf(" -l List available tests\n");
|
|
77
|
-
printf(" -v Don't redirect STDERR
|
|
59
|
+
printf(" -v Don't redirect STDERR before running tests\n");
|
|
60
|
+
printf(" -h Display this help and exit\n");
|
|
78
61
|
}
|
|
79
62
|
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
#ifndef DISABLE_STDOUT_REDIRECTION
|
|
83
|
-
if (!ctx->verbose) {
|
|
84
|
-
if (ctx->old_stdout != INVALID_FD) {
|
|
85
|
-
IGNORE_RETVAL(dup2(ctx->old_stdout, STDOUT_FILENO));
|
|
86
|
-
ctx->old_stdout = INVALID_FD;
|
|
87
|
-
}
|
|
88
|
-
if (ctx->old_stderr != INVALID_FD) {
|
|
89
|
-
IGNORE_RETVAL(dup2(ctx->old_stderr, STDERR_FILENO));
|
|
90
|
-
ctx->old_stderr = INVALID_FD;
|
|
91
|
-
}
|
|
92
|
-
if (ctx->null_fd != INVALID_FD) {
|
|
93
|
-
close(ctx->null_fd);
|
|
94
|
-
ctx->null_fd = INVALID_FD;
|
|
95
|
-
}
|
|
96
|
-
if (ctx->output_file != stdout) {
|
|
97
|
-
fclose(ctx->output_file);
|
|
98
|
-
ctx->output_file = stdout;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
#endif
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Setup test output handles
|
|
106
|
-
* \return zero on success, non-zero on failure
|
|
107
|
-
*/
|
|
108
|
-
static int setup_test_output(libusb_testlib_ctx * ctx)
|
|
109
|
-
{
|
|
110
|
-
#ifndef DISABLE_STDOUT_REDIRECTION
|
|
111
|
-
/* Stop output to stdout and stderr from being displayed if using non-verbose output */
|
|
112
|
-
if (!ctx->verbose) {
|
|
113
|
-
/* Keep a copy of STDOUT and STDERR */
|
|
114
|
-
ctx->old_stdout = dup(STDOUT_FILENO);
|
|
115
|
-
if (ctx->old_stdout < 0) {
|
|
116
|
-
ctx->old_stdout = INVALID_FD;
|
|
117
|
-
printf("Failed to duplicate stdout handle: %d\n", errno);
|
|
118
|
-
return 1;
|
|
119
|
-
}
|
|
120
|
-
ctx->old_stderr = dup(STDERR_FILENO);
|
|
121
|
-
if (ctx->old_stderr < 0) {
|
|
122
|
-
ctx->old_stderr = INVALID_FD;
|
|
123
|
-
cleanup_test_output(ctx);
|
|
124
|
-
printf("Failed to duplicate stderr handle: %d\n", errno);
|
|
125
|
-
return 1;
|
|
126
|
-
}
|
|
127
|
-
/* Redirect STDOUT_FILENO and STDERR_FILENO to /dev/null or "nul"*/
|
|
128
|
-
ctx->null_fd = open(NULL_PATH, O_WRONLY);
|
|
129
|
-
if (ctx->null_fd < 0) {
|
|
130
|
-
ctx->null_fd = INVALID_FD;
|
|
131
|
-
cleanup_test_output(ctx);
|
|
132
|
-
printf("Failed to open null handle: %d\n", errno);
|
|
133
|
-
return 1;
|
|
134
|
-
}
|
|
135
|
-
if ((dup2(ctx->null_fd, STDOUT_FILENO) < 0) ||
|
|
136
|
-
(dup2(ctx->null_fd, STDERR_FILENO) < 0)) {
|
|
137
|
-
cleanup_test_output(ctx);
|
|
138
|
-
return 1;
|
|
139
|
-
}
|
|
140
|
-
ctx->output_file = fdopen(ctx->old_stdout, "w");
|
|
141
|
-
if (!ctx->output_file) {
|
|
142
|
-
ctx->output_file = stdout;
|
|
143
|
-
cleanup_test_output(ctx);
|
|
144
|
-
printf("Failed to open FILE for output handle: %d\n", errno);
|
|
145
|
-
return 1;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
#endif
|
|
149
|
-
return 0;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
void libusb_testlib_logf(libusb_testlib_ctx * ctx,
|
|
153
|
-
const char* fmt, ...)
|
|
63
|
+
void libusb_testlib_logf(const char *fmt, ...)
|
|
154
64
|
{
|
|
155
65
|
va_list va;
|
|
66
|
+
|
|
156
67
|
va_start(va, fmt);
|
|
157
|
-
vfprintf(
|
|
68
|
+
vfprintf(stdout, fmt, va);
|
|
158
69
|
va_end(va);
|
|
159
|
-
|
|
160
|
-
fflush(
|
|
70
|
+
fputc('\n', stdout);
|
|
71
|
+
fflush(stdout);
|
|
161
72
|
}
|
|
162
73
|
|
|
163
|
-
int libusb_testlib_run_tests(int argc,
|
|
164
|
-
|
|
165
|
-
const libusb_testlib_test * tests)
|
|
74
|
+
int libusb_testlib_run_tests(int argc, char *argv[],
|
|
75
|
+
const libusb_testlib_test *tests)
|
|
166
76
|
{
|
|
167
77
|
int run_count = 0;
|
|
168
78
|
int idx = 0;
|
|
@@ -170,108 +80,105 @@ int libusb_testlib_run_tests(int argc,
|
|
|
170
80
|
int fail_count = 0;
|
|
171
81
|
int error_count = 0;
|
|
172
82
|
int skip_count = 0;
|
|
173
|
-
int r, j;
|
|
174
|
-
size_t arglen;
|
|
175
|
-
libusb_testlib_result test_result;
|
|
176
|
-
libusb_testlib_ctx ctx;
|
|
177
83
|
|
|
178
84
|
/* Setup default mode of operation */
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
ctx.old_stdout = INVALID_FD;
|
|
184
|
-
ctx.old_stderr = INVALID_FD;
|
|
185
|
-
ctx.output_file = stdout;
|
|
186
|
-
ctx.null_fd = INVALID_FD;
|
|
85
|
+
char **test_names = NULL;
|
|
86
|
+
int test_count = 0;
|
|
87
|
+
bool list_tests = false;
|
|
88
|
+
bool verbose = false;
|
|
187
89
|
|
|
188
90
|
/* Parse command line options */
|
|
189
91
|
if (argc >= 2) {
|
|
190
|
-
for (j = 1; j < argc; j++) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
92
|
+
for (int j = 1; j < argc; j++) {
|
|
93
|
+
const char *argstr = argv[j];
|
|
94
|
+
size_t arglen = strlen(argstr);
|
|
95
|
+
|
|
96
|
+
if (argstr[0] == '-' || argstr[0] == '/') {
|
|
97
|
+
if (arglen == 2) {
|
|
98
|
+
switch (argstr[1]) {
|
|
195
99
|
case 'l':
|
|
196
|
-
|
|
197
|
-
|
|
100
|
+
list_tests = true;
|
|
101
|
+
continue;
|
|
198
102
|
case 'v':
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return 1;
|
|
103
|
+
verbose = true;
|
|
104
|
+
continue;
|
|
105
|
+
case 'h':
|
|
106
|
+
print_usage(argv[0]);
|
|
107
|
+
return 0;
|
|
205
108
|
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
fprintf(stderr, "Unknown option: '%s'\n", argstr);
|
|
112
|
+
print_usage(argv[0]);
|
|
113
|
+
return 1;
|
|
206
114
|
} else {
|
|
207
115
|
/* End of command line options, remaining must be list of tests to run */
|
|
208
|
-
|
|
209
|
-
|
|
116
|
+
test_names = argv + j;
|
|
117
|
+
test_count = argc - j;
|
|
210
118
|
break;
|
|
211
119
|
}
|
|
212
120
|
}
|
|
213
121
|
}
|
|
214
122
|
|
|
215
123
|
/* Validate command line options */
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
print_usage(
|
|
124
|
+
if (test_names && list_tests) {
|
|
125
|
+
fprintf(stderr, "List of tests requested but test list provided\n");
|
|
126
|
+
print_usage(argv[0]);
|
|
219
127
|
return 1;
|
|
220
128
|
}
|
|
221
129
|
|
|
222
130
|
/* Setup test log output */
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
131
|
+
if (!verbose) {
|
|
132
|
+
if (!freopen(NULL_PATH, "w", stderr)) {
|
|
133
|
+
printf("Failed to open null handle: %d\n", errno);
|
|
134
|
+
return 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
226
137
|
|
|
227
138
|
/* Act on any options not related to running tests */
|
|
228
|
-
if (
|
|
229
|
-
while (tests[idx].function
|
|
230
|
-
libusb_testlib_logf(
|
|
231
|
-
++idx;
|
|
232
|
-
}
|
|
233
|
-
cleanup_test_output(&ctx);
|
|
139
|
+
if (list_tests) {
|
|
140
|
+
while (tests[idx].function)
|
|
141
|
+
libusb_testlib_logf("%s", tests[idx++].name);
|
|
234
142
|
return 0;
|
|
235
143
|
}
|
|
236
144
|
|
|
237
145
|
/* Run any requested tests */
|
|
238
|
-
while (tests[idx].function
|
|
239
|
-
const libusb_testlib_test *
|
|
240
|
-
|
|
241
|
-
|
|
146
|
+
while (tests[idx].function) {
|
|
147
|
+
const libusb_testlib_test *test = &tests[idx++];
|
|
148
|
+
libusb_testlib_result test_result;
|
|
149
|
+
|
|
150
|
+
if (test_count > 0) {
|
|
242
151
|
/* Filtering tests to run, check if this is one of them */
|
|
243
152
|
int i;
|
|
244
|
-
|
|
245
|
-
|
|
153
|
+
|
|
154
|
+
for (i = 0; i < test_count; i++) {
|
|
155
|
+
if (!strcmp(test_names[i], test->name))
|
|
246
156
|
/* Matches a requested test name */
|
|
247
157
|
break;
|
|
248
158
|
}
|
|
249
|
-
if (i
|
|
159
|
+
if (i == test_count) {
|
|
250
160
|
/* Failed to find a test match, so do the next loop iteration */
|
|
251
161
|
continue;
|
|
252
162
|
}
|
|
253
163
|
}
|
|
254
|
-
libusb_testlib_logf(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
libusb_testlib_logf(&ctx,
|
|
258
|
-
"%s (%d)",
|
|
259
|
-
test_result_to_str(test_result), test_result);
|
|
164
|
+
libusb_testlib_logf("Starting test run: %s...", test->name);
|
|
165
|
+
test_result = test->function();
|
|
166
|
+
libusb_testlib_logf("%s (%d)", test_result_to_str(test_result), test_result);
|
|
260
167
|
switch (test_result) {
|
|
261
168
|
case TEST_STATUS_SUCCESS: pass_count++; break;
|
|
262
169
|
case TEST_STATUS_FAILURE: fail_count++; break;
|
|
263
170
|
case TEST_STATUS_ERROR: error_count++; break;
|
|
264
171
|
case TEST_STATUS_SKIP: skip_count++; break;
|
|
265
172
|
}
|
|
266
|
-
|
|
173
|
+
run_count++;
|
|
267
174
|
}
|
|
268
|
-
libusb_testlib_logf(&ctx, "---");
|
|
269
|
-
libusb_testlib_logf(&ctx, "Ran %d tests", run_count);
|
|
270
|
-
libusb_testlib_logf(&ctx, "Passed %d tests", pass_count);
|
|
271
|
-
libusb_testlib_logf(&ctx, "Failed %d tests", fail_count);
|
|
272
|
-
libusb_testlib_logf(&ctx, "Error in %d tests", error_count);
|
|
273
|
-
libusb_testlib_logf(&ctx, "Skipped %d tests", skip_count);
|
|
274
175
|
|
|
275
|
-
|
|
176
|
+
libusb_testlib_logf("---");
|
|
177
|
+
libusb_testlib_logf("Ran %d tests", run_count);
|
|
178
|
+
libusb_testlib_logf("Passed %d tests", pass_count);
|
|
179
|
+
libusb_testlib_logf("Failed %d tests", fail_count);
|
|
180
|
+
libusb_testlib_logf("Error in %d tests", error_count);
|
|
181
|
+
libusb_testlib_logf("Skipped %d tests", skip_count);
|
|
182
|
+
|
|
276
183
|
return pass_count != run_count;
|
|
277
184
|
}
|
package/libusb.gypi
CHANGED
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
'libusb/libusb/core.c',
|
|
16
16
|
'libusb/libusb/descriptor.c',
|
|
17
17
|
'libusb/libusb/hotplug.c',
|
|
18
|
-
'libusb/libusb/hotplug.h',
|
|
19
18
|
'libusb/libusb/io.c',
|
|
20
19
|
'libusb/libusb/libusb.h',
|
|
21
20
|
'libusb/libusb/libusbi.h',
|
|
22
21
|
'libusb/libusb/strerror.c',
|
|
23
22
|
'libusb/libusb/sync.c',
|
|
24
|
-
'libusb/libusb/version.h',
|
|
25
23
|
'libusb/libusb/version_nano.h',
|
|
24
|
+
'libusb/libusb/version.h',
|
|
26
25
|
],
|
|
27
26
|
'include_dirs': [
|
|
28
27
|
'libusb_config',
|
|
@@ -43,8 +42,8 @@
|
|
|
43
42
|
'conditions': [
|
|
44
43
|
[ 'OS == "linux" or OS == "android" or OS == "mac"', {
|
|
45
44
|
'sources': [
|
|
46
|
-
'libusb/libusb/os/
|
|
47
|
-
'libusb/libusb/os/
|
|
45
|
+
'libusb/libusb/os/events_posix.c',
|
|
46
|
+
'libusb/libusb/os/events_posix.h',
|
|
48
47
|
'libusb/libusb/os/threads_posix.c',
|
|
49
48
|
'libusb/libusb/os/threads_posix.h',
|
|
50
49
|
],
|
|
@@ -105,6 +104,10 @@
|
|
|
105
104
|
'sources': [
|
|
106
105
|
'libusb/libusb/os/darwin_usb.c',
|
|
107
106
|
'libusb/libusb/os/darwin_usb.h',
|
|
107
|
+
'libusb/Xcode/config.h',
|
|
108
|
+
],
|
|
109
|
+
'include_dirs': [
|
|
110
|
+
'libusb/Xcode',
|
|
108
111
|
],
|
|
109
112
|
'defines': [
|
|
110
113
|
'OS_DARWIN=1',
|
|
@@ -120,21 +123,17 @@
|
|
|
120
123
|
}],
|
|
121
124
|
[ 'OS == "win"', {
|
|
122
125
|
'sources': [
|
|
123
|
-
'libusb/libusb/os/
|
|
124
|
-
'libusb/libusb/os/
|
|
126
|
+
'libusb/libusb/os/events_windows.c',
|
|
127
|
+
'libusb/libusb/os/events_windows.h',
|
|
125
128
|
'libusb/libusb/os/threads_windows.c',
|
|
126
129
|
'libusb/libusb/os/threads_windows.h',
|
|
130
|
+
'libusb/libusb/os/windows_common.c',
|
|
127
131
|
'libusb/libusb/os/windows_common.h',
|
|
128
|
-
'libusb/libusb/os/windows_nt_common.c',
|
|
129
|
-
'libusb/libusb/os/windows_nt_common.h',
|
|
130
|
-
'libusb/libusb/os/windows_nt_shared_types.h',
|
|
131
132
|
'libusb/libusb/os/windows_usbdk.c',
|
|
132
133
|
'libusb/libusb/os/windows_usbdk.h',
|
|
133
134
|
'libusb/libusb/os/windows_winusb.c',
|
|
134
135
|
'libusb/libusb/os/windows_winusb.h',
|
|
135
136
|
'libusb/msvc/config.h',
|
|
136
|
-
'libusb/msvc/inttypes.h',
|
|
137
|
-
'libusb/msvc/stdint.h',
|
|
138
137
|
],
|
|
139
138
|
'include_dirs!': [
|
|
140
139
|
'libusb_config',
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/device.cc
CHANGED
|
@@ -18,14 +18,16 @@ Device::Device(const Napi::CallbackInfo & info) : Napi::ObjectWrap<Device>(info)
|
|
|
18
18
|
{
|
|
19
19
|
device = info[0].As<Napi::External<libusb_device>>().Data();
|
|
20
20
|
libusb_ref_device(device);
|
|
21
|
-
byPtr
|
|
21
|
+
byPtr[device] = this;
|
|
22
22
|
DEBUG_LOG("Created device %p", this);
|
|
23
23
|
Constructor(info);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
Device::~Device(){
|
|
27
27
|
DEBUG_LOG("Freed device %p", this);
|
|
28
|
-
byPtr.
|
|
28
|
+
auto it = byPtr.find(device);
|
|
29
|
+
if (it != byPtr.end() && it->second == this)
|
|
30
|
+
byPtr.erase(it);
|
|
29
31
|
libusb_close(device_handle);
|
|
30
32
|
libusb_unref_device(device);
|
|
31
33
|
}
|
|
@@ -37,12 +39,15 @@ std::map<libusb_device*, Device*> Device::byPtr;
|
|
|
37
39
|
// or create a new one and add it to the map.
|
|
38
40
|
Napi::Object Device::get(napi_env env, libusb_device* dev){
|
|
39
41
|
auto it = byPtr.find(dev);
|
|
40
|
-
if (it != byPtr.end()){
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
if (it != byPtr.end()) {
|
|
43
|
+
auto value = it->second->Value();
|
|
44
|
+
// JS object may have already been garbage collected
|
|
45
|
+
if (!value.IsEmpty())
|
|
46
|
+
return value;
|
|
45
47
|
}
|
|
48
|
+
|
|
49
|
+
Napi::Object obj = Device::constructor.New({ Napi::External<libusb_device>::New(env, dev) });
|
|
50
|
+
return obj;
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
Napi::Value Device::Constructor(const Napi::CallbackInfo& info) {
|
package/src/node_usb.cc
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#include <thread>
|
|
4
4
|
|
|
5
5
|
Napi::Value SetDebugLevel(const Napi::CallbackInfo& info);
|
|
6
|
+
Napi::Value UseUsbDkBackend(const Napi::CallbackInfo& info);
|
|
6
7
|
Napi::Value GetDeviceList(const Napi::CallbackInfo& info);
|
|
7
8
|
Napi::Value GetLibusbCapability(const Napi::CallbackInfo& info);
|
|
8
9
|
Napi::Value EnableHotplugEvents(const Napi::CallbackInfo& info);
|
|
@@ -97,6 +98,7 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
|
|
97
98
|
Transfer::Init(env, exports);
|
|
98
99
|
|
|
99
100
|
exports.Set("setDebugLevel", Napi::Function::New(env, SetDebugLevel));
|
|
101
|
+
exports.Set("useUsbDkBackend", Napi::Function::New(env, UseUsbDkBackend));
|
|
100
102
|
exports.Set("getDeviceList", Napi::Function::New(env, GetDeviceList));
|
|
101
103
|
exports.Set("_getLibusbCapability", Napi::Function::New(env, GetLibusbCapability));
|
|
102
104
|
exports.Set("_enableHotplugEvents", Napi::Function::New(env, EnableHotplugEvents));
|
|
@@ -119,6 +121,14 @@ Napi::Value SetDebugLevel(const Napi::CallbackInfo& info) {
|
|
|
119
121
|
return env.Undefined();
|
|
120
122
|
}
|
|
121
123
|
|
|
124
|
+
Napi::Value UseUsbDkBackend(const Napi::CallbackInfo& info) {
|
|
125
|
+
Napi::Env env = info.Env();
|
|
126
|
+
Napi::HandleScope scope(env);
|
|
127
|
+
|
|
128
|
+
libusb_set_option(usb_context, LIBUSB_OPTION_USE_USBDK);
|
|
129
|
+
return env.Undefined();
|
|
130
|
+
}
|
|
131
|
+
|
|
122
132
|
Napi::Value GetDeviceList(const Napi::CallbackInfo& info) {
|
|
123
133
|
Napi::Env env = info.Env();
|
|
124
134
|
Napi::HandleScope scope(env);
|
package/test/usb.coffee
CHANGED
|
@@ -70,6 +70,12 @@ describe 'Device', ->
|
|
|
70
70
|
assert.equal(s, 'Nonolith Labs')
|
|
71
71
|
done()
|
|
72
72
|
|
|
73
|
+
it 'supports null string descriptors', (done) ->
|
|
74
|
+
device.getStringDescriptor device.configDescriptor.iConfiguration, (e, s) ->
|
|
75
|
+
assert.ok(e == undefined, e)
|
|
76
|
+
assert.equal(s, undefined)
|
|
77
|
+
done()
|
|
78
|
+
|
|
73
79
|
describe 'control transfer', ->
|
|
74
80
|
b = Buffer.from([0x30...0x40])
|
|
75
81
|
it 'should OUT transfer when the IN bit is not set', (done) ->
|
package/tsc/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as usb from './usb';
|
|
|
5
5
|
|
|
6
6
|
const webusb = new WebUSB();
|
|
7
7
|
const getDeviceList = usb.getDeviceList;
|
|
8
|
+
const useUsbDkBackend = usb.useUsbDkBackend;
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.
|
|
@@ -57,6 +58,7 @@ export {
|
|
|
57
58
|
usb,
|
|
58
59
|
|
|
59
60
|
// Convenience methods
|
|
61
|
+
useUsbDkBackend,
|
|
60
62
|
getDeviceList,
|
|
61
63
|
findByIds,
|
|
62
64
|
findBySerialNumber,
|
package/tsc/usb/bindings.ts
CHANGED
|
@@ -26,6 +26,11 @@ export declare class LibUSBException extends Error {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function setDebugLevel(level: number): void;
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Use USBDK Backend (Windows only)
|
|
31
|
+
*/
|
|
32
|
+
export declare function useUsbDkBackend(): void;
|
|
33
|
+
|
|
29
34
|
export declare function _enableHotplugEvents(): void;
|
|
30
35
|
export declare function _disableHotplugEvents(): void;
|
|
31
36
|
export declare function _getLibusbCapability(capability: number): number;
|
package/tsc/usb/device.ts
CHANGED
|
@@ -203,6 +203,12 @@ export class ExtendedDevice {
|
|
|
203
203
|
* @param callback
|
|
204
204
|
*/
|
|
205
205
|
public getStringDescriptor(this: usb.Device, desc_index: number, callback: (error?: usb.LibUSBException, value?: string) => void): void {
|
|
206
|
+
// Index 0 indicates null
|
|
207
|
+
if (desc_index === 0) {
|
|
208
|
+
callback();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
|
|
206
212
|
const langid = 0x0409;
|
|
207
213
|
const length = 255;
|
|
208
214
|
this.controlTransfer(
|
package/libusb/.private/bd.cmd
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
rem produce the DDK binary files for snapshots
|
|
3
|
-
rem !!!THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY!!!
|
|
4
|
-
|
|
5
|
-
if NOT x%DDK_TARGET_OS%==xWinXP goto usage
|
|
6
|
-
|
|
7
|
-
set IWD=%~dp0
|
|
8
|
-
cd ..
|
|
9
|
-
mkdir E:\dailies\%DATE%
|
|
10
|
-
for %%A in (MS32 MS64) do mkdir E:\dailies\%DATE%\%%A
|
|
11
|
-
for %%A in (MS32 MS64) do mkdir E:\dailies\%DATE%\%%A\static
|
|
12
|
-
for %%A in (MS32 MS64) do mkdir E:\dailies\%DATE%\%%A\dll
|
|
13
|
-
for %%A in (source bin32 bin64) do mkdir E:\dailies\%DATE%\examples\%%A
|
|
14
|
-
copy examples\listdevs.c E:\dailies\%DATE%\examples\source
|
|
15
|
-
copy examples\xusb.c E:\dailies\%DATE%\examples\source
|
|
16
|
-
copy examples\ezusb.? E:\dailies\%DATE%\examples\source
|
|
17
|
-
copy examples\fxload.c E:\dailies\%DATE%\examples\source
|
|
18
|
-
copy msvc\stdint.h E:\dailies\%DATE%\examples\source
|
|
19
|
-
copy .private\wbs.txt E:\dailies\%DATE%\README.txt
|
|
20
|
-
|
|
21
|
-
set ORG_BUILD_ALT_DIR=%BUILD_ALT_DIR%
|
|
22
|
-
set ORG_BUILDARCH=%_BUILDARCH%
|
|
23
|
-
set ORG_PATH=%PATH%
|
|
24
|
-
set ORG_BUILD_DEFAULT_TARGETS=%BUILD_DEFAULT_TARGETS%
|
|
25
|
-
|
|
26
|
-
set 386=1
|
|
27
|
-
set AMD64=
|
|
28
|
-
set BUILD_DEFAULT_TARGETS=-386
|
|
29
|
-
set _AMD64bit=
|
|
30
|
-
set _BUILDARCH=x86
|
|
31
|
-
set PATH=%BASEDIR%\bin\x86;%BASEDIR%\bin\x86\x86
|
|
32
|
-
|
|
33
|
-
cd msvc
|
|
34
|
-
call ddk_build
|
|
35
|
-
cd ..
|
|
36
|
-
|
|
37
|
-
@echo off
|
|
38
|
-
copy Win32\Release\lib\libusb-1.0.lib E:\dailies\%DATE%\MS32\static
|
|
39
|
-
copy Win32\Release\examples\listdevs.exe E:\dailies\%DATE%\examples\bin32
|
|
40
|
-
copy Win32\Release\examples\xusb.exe E:\dailies\%DATE%\examples\bin32
|
|
41
|
-
copy Win32\Release\examples\fxload.exe E:\dailies\%DATE%\examples\bin32
|
|
42
|
-
|
|
43
|
-
cd msvc
|
|
44
|
-
call ddk_build DLL
|
|
45
|
-
cd ..
|
|
46
|
-
|
|
47
|
-
@echo off
|
|
48
|
-
copy Win32\Release\lib\libusb-1.0.lib E:\dailies\%DATE%\MS32\dll
|
|
49
|
-
copy Win32\Release\dll\libusb-1.0.dll E:\dailies\%DATE%\MS32\dll
|
|
50
|
-
copy Win32\Release\dll\libusb-1.0.pdb E:\dailies\%DATE%\MS32\dll
|
|
51
|
-
|
|
52
|
-
set 386=
|
|
53
|
-
set AMD64=1
|
|
54
|
-
set BUILD_DEFAULT_TARGETS=-amd64
|
|
55
|
-
set _AMD64bit=true
|
|
56
|
-
set _BUILDARCH=AMD64
|
|
57
|
-
set PATH=%BASEDIR%\bin\x86\amd64;%BASEDIR%\bin\x86
|
|
58
|
-
|
|
59
|
-
cd msvc
|
|
60
|
-
call ddk_build
|
|
61
|
-
cd ..
|
|
62
|
-
|
|
63
|
-
@echo off
|
|
64
|
-
copy x64\Release\lib\libusb-1.0.lib E:\dailies\%DATE%\MS64\static
|
|
65
|
-
copy x64\Release\examples\listdevs.exe E:\dailies\%DATE%\examples\bin64
|
|
66
|
-
copy x64\Release\examples\xusb.exe E:\dailies\%DATE%\examples\bin64
|
|
67
|
-
copy x64\Release\examples\fxload.exe E:\dailies\%DATE%\examples\bin64
|
|
68
|
-
|
|
69
|
-
cd msvc
|
|
70
|
-
call ddk_build DLL
|
|
71
|
-
cd ..
|
|
72
|
-
|
|
73
|
-
@echo off
|
|
74
|
-
copy x64\Release\lib\libusb-1.0.lib E:\dailies\%DATE%\MS64\dll
|
|
75
|
-
copy x64\Release\dll\libusb-1.0.dll E:\dailies\%DATE%\MS64\dll
|
|
76
|
-
copy x64\Release\dll\libusb-1.0.pdb E:\dailies\%DATE%\MS64\dll
|
|
77
|
-
|
|
78
|
-
set BUILD_ALT_DIR=%ORG_BUILD_ALT_DIR%
|
|
79
|
-
set _BUILDARCH=%ORG_BUILDARCH%
|
|
80
|
-
set PATH=%ORG_PATH%
|
|
81
|
-
set BUILD_DEFAULT_TARGETS=%ORG_BUILD_DEFAULT_TARGETS%
|
|
82
|
-
|
|
83
|
-
goto done
|
|
84
|
-
|
|
85
|
-
:usage
|
|
86
|
-
echo must be run in a WXP build environment!
|
|
87
|
-
|
|
88
|
-
:done
|
|
89
|
-
cd %IWD%
|