Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const xferInEndpoint: usb.InEndpoint = inEndpoint.transfer(1, (error: string, data: Buffer) => inEndpoint);
inEndpoint.startPoll(1, 1);
inEndpoint.stopPoll(() => null);
const outEndpoint: usb.OutEndpoint = new usb.OutEndpoint(device, endpointDesc);
outEndpoint.direction = "out";
outEndpoint.transferType = 1;
outEndpoint.timeout = 1;
outEndpoint.descriptor = endpointDesc;
const xferOutEndpoint: usb.OutEndpoint = outEndpoint.transfer(new Buffer([]), (error: string) => null);
outEndpoint.transferWithZLP(new Buffer([]), (error: string) => null);
const findByDevice: usb.Device = usb.findByIds(1, 1);
usb.on("hey", (device: usb.Device) => null);
const deviceList: usb.Device[] = usb.getDeviceList();
usb.setDebugLevel(1);
const CHECK_LIBUSB_CLASS_PER_INTERFACE: number = usb.LIBUSB_CLASS_PER_INTERFACE;
const CHECK_LIBUSB_CLASS_AUDIO: number = usb.LIBUSB_CLASS_AUDIO;
const CHECK_LIBUSB_CLASS_COMM: number = usb.LIBUSB_CLASS_COMM;
const CHECK_LIBUSB_CLASS_HID: number = usb.LIBUSB_CLASS_HID;
const CHECK_LIBUSB_CLASS_PRINTER: number = usb.LIBUSB_CLASS_PRINTER;
const CHECK_LIBUSB_CLASS_PTP: number = usb.LIBUSB_CLASS_PTP;
const CHECK_LIBUSB_CLASS_MASS_STORAGE: number = usb.LIBUSB_CLASS_MASS_STORAGE;
const CHECK_LIBUSB_CLASS_HUB: number = usb.LIBUSB_CLASS_HUB;
const CHECK_LIBUSB_CLASS_DATA: number = usb.LIBUSB_CLASS_DATA;
const CHECK_LIBUSB_CLASS_WIRELESS: number = usb.LIBUSB_CLASS_WIRELESS;
const CHECK_LIBUSB_CLASS_APPLICATION: number = usb.LIBUSB_CLASS_APPLICATION;
const CHECK_LIBUSB_CLASS_VENDOR_SPEC: number = usb.LIBUSB_CLASS_VENDOR_SPEC;
// libusb_standard_request
const CHECK_LIBUSB_REQUEST_GET_STATUS: number = usb.LIBUSB_REQUEST_GET_STATUS;
const CHECK_LIBUSB_REQUEST_CLEAR_FEATURE: number = usb.LIBUSB_REQUEST_CLEAR_FEATURE;
var usb = require('usb'),
_ = require('underscore'),
async = require('async');
usb.setDebugLevel(3);
function RocketLauncher()
{
this.launcher_device = null;
this.commands = {
'down' : 0x01,
'up' : 0x02,
'left' : 0x04,
'right' : 0x08,
'shoot' : 0x10,
'stop' : 0x20,
'boom' : 0x40
};
this.acquireDevice = function()
function avrgirlIspmkii(chip) {
var self = this;
usb.setDebugLevel(0);
var VID = 0x03eb;
var PID = 0x2104;
var device = usb.findByIds(VID, PID);
if (!device) {
return new Error('Could not find a connected AVRISP mkii device.');
}
var options = {
chip: chip,
debug: false,
comm: device,
frameless: true
};