From 2f2da42f53002024fd3ed55df440b594d95188ab Mon Sep 17 00:00:00 2001 From: jflyper Date: Mon, 12 Nov 2018 20:27:11 +0900 Subject: [PATCH] Add an ability to handle multiple DFU device types --- manifest.json | 3 ++- src/js/port_handler.js | 9 +++++---- src/js/tabs/firmware_flasher.js | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index c5bb2d69..74e90e31 100755 --- a/manifest.json +++ b/manifest.json @@ -34,7 +34,8 @@ "notifications", "alwaysOnTopWindows", {"usbDevices": [ - {"vendorId": 1155, "productId": 57105} + {"vendorId": 1155, "productId": 57105}, + {"vendorId": 10473, "productId": 393} ]}, "webview", "unlimitedStorage" diff --git a/src/js/port_handler.js b/src/js/port_handler.js index 45c6f69b..ec9c7f2d 100755 --- a/src/js/port_handler.js +++ b/src/js/port_handler.js @@ -1,8 +1,9 @@ 'use strict'; -var usbDevices = { - STM32DFU: {'vendorId': 1155, 'productId': 57105} -}; +var usbDevices = { filters: [ + {'vendorId': 1155, 'productId': 57105}, + {'vendorId': 10473, 'productId': 393} +] }; var PortHandler = new function () { this.initial_ports = false; @@ -146,7 +147,7 @@ PortHandler.check = function () { }; PortHandler.check_usb_devices = function (callback) { - chrome.usb.getDevices(usbDevices.STM32DFU, function (result) { + chrome.usb.getDevices(usbDevices, function (result) { if (result.length) { if (!$("div#port-picker #port [value='DFU']").length) { $('div#port-picker #port').append($('