Closed senpaiSubby closed 2 years ago
@senpaiSubby Test with this library https://www.npmjs.com/package/usb-detection
// Detect add or remove (change)
usbDetect.on('change', function(device) { console.log('change', device); });
usbDetect.on('change:vid', function(device) { console.log('change', device); });
usbDetect.on('change:vid:pid', function(device) { console.log('change', device); });
// Get a list of USB devices on your system, optionally filtered by `vid` or `pid`
usbDetect.find(function(err, devices) { console.log('find', devices, err); });
usbDetect.find(vid, function(err, devices) { console.log('find', devices, err); });
usbDetect.find(vid, pid, function(err, devices) { console.log('find', devices, err); });
// Promise version of `find`:
usbDetect.find().then(function(devices) { console.log(devices); }).catch(function(err) { console.log(err); });
@senpaiSubby @atiernan I made some basic changes last night to handle reconnect while I was playing around, not sure if helpful or even remotely correct, but just committed them here for reference - https://github.com/iranana/voc-poc
Cleaned up the codebase to ES6 standard.
Added chalk for colored logging output.
Updated the readme features.
The code now waits and attempts to retry the connection to the goggles if they are not powered on or connected yet.