Fix more USB test scripts on Windows

This commit is contained in:
Farkas József
2016-11-12 21:21:18 +01:00
parent 055cba0575
commit 3b3c324c8e
4 changed files with 16 additions and 4 deletions

View File

@@ -16,7 +16,10 @@ var device = usb.findByIds(vid, pid);
device.open(); device.open();
var usbInterface = device.interface(0); var usbInterface = device.interface(0);
if (usbInterface.isKernelDriverActive()) {
// https://github.com/tessel/node-usb/issues/147
// The function 'isKernelDriverActive' is not available on Windows and not even needed.
if (process.platform !== 'win32' && usbInterface.isKernelDriverActive()) {
usbInterface.detachKernelDriver(); usbInterface.detachKernelDriver();
} }
usbInterface.claim(); usbInterface.claim();

View File

@@ -12,7 +12,10 @@ var device = usb.findByIds(vid, pid);
device.open(); device.open();
var usbInterface = device.interface(0); var usbInterface = device.interface(0);
if (usbInterface.isKernelDriverActive()) {
// https://github.com/tessel/node-usb/issues/147
// The function 'isKernelDriverActive' is not available on Windows and not even needed.
if (process.platform !== 'win32' && usbInterface.isKernelDriverActive()) {
usbInterface.detachKernelDriver(); usbInterface.detachKernelDriver();
} }
usbInterface.claim(); usbInterface.claim();

View File

@@ -12,7 +12,10 @@ var device = usb.findByIds(vid, pid);
device.open(); device.open();
var usbInterface = device.interface(0); var usbInterface = device.interface(0);
if (usbInterface.isKernelDriverActive()) {
// https://github.com/tessel/node-usb/issues/147
// The function 'isKernelDriverActive' is not available on Windows and not even needed.
if (process.platform !== 'win32' && usbInterface.isKernelDriverActive()) {
usbInterface.detachKernelDriver(); usbInterface.detachKernelDriver();
} }
usbInterface.claim(); usbInterface.claim();

View File

@@ -12,7 +12,10 @@ var device = usb.findByIds(vid, pid);
device.open(); device.open();
var usbInterface = device.interface(0); var usbInterface = device.interface(0);
if (usbInterface.isKernelDriverActive()) {
// https://github.com/tessel/node-usb/issues/147
// The function 'isKernelDriverActive' is not available on Windows and not even needed.
if (process.platform !== 'win32' && usbInterface.isKernelDriverActive()) {
usbInterface.detachKernelDriver(); usbInterface.detachKernelDriver();
} }
usbInterface.claim(); usbInterface.claim();