Comparing version 1.8.1-libusb.6 to 1.8.1
{ | ||
"name": "usb", | ||
"description": "Library to access USB devices", | ||
"version": "1.8.1-libusb.6", | ||
"version": "1.8.1", | ||
"engines": { | ||
@@ -58,3 +58,3 @@ "node": ">=10.16.0" | ||
"coffeescript": "~2.4.1", | ||
"mocha": "^8.3.2", | ||
"mocha": "^9.1.3", | ||
"node-gyp": "^7.1.2", | ||
@@ -61,0 +61,0 @@ "prebuildify": "^4.2.1", |
57
usb.js
var usb = exports = module.exports = require('node-gyp-build')(__dirname); | ||
var events = require('events'); | ||
var util = require('util'); | ||
var events = require('events') | ||
var util = require('util') | ||
@@ -17,2 +17,4 @@ var isBuffer = function(obj) { | ||
usb._disableHotplugEvents = function () { }; | ||
usb.refHotplugEvents = function () { }; | ||
usb.unrefHotplugEvents = function () { }; | ||
} | ||
@@ -512,41 +514,2 @@ | ||
// Polling mechanism for discovering Windows device changes until this is fixed: | ||
// https://github.com/libusb/libusb/issues/86 | ||
exports._windowsPollTimeout = 500; | ||
var hotplugSupported = usb._getLibusbCapability(usb.LIBUSB_CAP_HAS_HOTPLUG) > 0; | ||
var pollingHotplug = false; | ||
var windowsDevices = []; | ||
function pollHotplug(start) { | ||
if (start) { | ||
pollingHotplug = true; | ||
} else if (!pollingHotplug) { | ||
return; | ||
} | ||
var devices = usb.getDeviceList(); | ||
if (!start) { | ||
// Find attached devices | ||
for (var device of devices) { | ||
var found = windowsDevices.find(item => item.deviceAddress === device.deviceAddress); | ||
if (!found) { | ||
usb.emit('attach', device); | ||
} | ||
} | ||
// Find detached devices | ||
for (var device of windowsDevices) { | ||
var found = devices.find(item => item.deviceAddress === device.deviceAddress); | ||
if (!found) { | ||
usb.emit('detach', device); | ||
} | ||
} | ||
} | ||
windowsDevices = devices; | ||
setTimeout(() => { | ||
pollHotplug(); | ||
}, exports._windowsPollTimeout); | ||
} | ||
var hotplugListeners = 0; | ||
@@ -556,7 +519,3 @@ exports.on('newListener', function(name) { | ||
if (++hotplugListeners === 1) { | ||
if (hotplugSupported) { | ||
usb._enableHotplugEvents(); | ||
} else { | ||
pollHotplug(true); | ||
} | ||
usb._enableHotplugEvents(); | ||
} | ||
@@ -568,8 +527,4 @@ }); | ||
if (--hotplugListeners === 0) { | ||
if (hotplugSupported) { | ||
usb._disableHotplugEvents(); | ||
} else { | ||
pollingHotplug = false; | ||
} | ||
usb._disableHotplugEvents(); | ||
} | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 3 instances in 1 package
7
70
1
346
4785606
194
450