Ошибка таймаута (errno: 2) при чтении данных с USB

Я получаю LIBUSB_TRANSFER_TIMED_OUT ошибка (errcode: 2) при попытке прочитать данные с usb. Я использую этот модуль.

function onUsbAttached(device) {
    console.log('you gotta usb.\n');
    device.open();  // open the device. 
    // console.log(device.interfaces);
    var syncInterface = device.interfaces[0];   // sync interface
    var asyncInterface = device.interfaces[1];  // async interface
    // console.log('incomingEndpoint', incomingEndpoint);
    if(syncInterface.isKernelDriverActive()){
        console.log('Kernel driver is active. Detaching kernel driver.');
        syncInterface.detachKernelDriver();
    }
    console.log('Claiming interface');
    syncInterface.claim();

    var INendpoint = syncInterface.endpoints[0];
    var OUTendpoint = syncInterface.endpoints[1];

    // .controlTransfer(bmRequestType, bRequest, wValue, wIndex, data_or_length, callback(error, data))
    device.controlTransfer(0xC0, 0x32, 0, 0, 1, function (err, data) {
        if(err){
            console.log('Error while getting data', err);
            return ;
        }
        console.log('Got some data.', data);
    });
};

Если кто-то может указать на мою ошибку, было бы здорово!!

0 ответов

Другие вопросы по тегам