From 8aa58a722b9d67a075982020bffec5036dfe61e5 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 10 Oct 2017 21:35:59 +0100 Subject: [PATCH] fix(sdk): set usbboot control transfer timeout to infinite (#1760) Change-Type: patch Signed-off-by: Juan Cruz Viotti --- lib/shared/sdk/usbboot/usb.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/shared/sdk/usbboot/usb.js b/lib/shared/sdk/usbboot/usb.js index 6ae844a9..1b35e123 100644 --- a/lib/shared/sdk/usbboot/usb.js +++ b/lib/shared/sdk/usbboot/usb.js @@ -45,6 +45,14 @@ _.each([ exports[constant] = usb[constant] }) +/** + * @summary The timeout for USB control transfers, in milliseconds + * @type {Number} + * @constant + */ +// In node-usb, 0 means "infinite" timeout +const USB_CONTROL_TRANSFER_TIMEOUT_MS = 0 + /** * @summary List the available USB devices * @function @@ -123,6 +131,7 @@ exports.performControlTransfer = (device, options) => { } return Bluebird.fromCallback((callback) => { + device.timeout = USB_CONTROL_TRANSFER_TIMEOUT_MS device.controlTransfer( options.bmRequestType, options.bRequest,