From cda43ac9bf8d11b374468f139b1637e99e6cbca0 Mon Sep 17 00:00:00 2001 From: cTn Date: Sun, 8 Jun 2014 18:42:31 +0200 Subject: [PATCH] add additional permissions so we can use USB api --- js/stm32dfu.js | 6 ++++++ manifest.json | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/js/stm32dfu.js b/js/stm32dfu.js index 97a1fafb..dc4a7368 100644 --- a/js/stm32dfu.js +++ b/js/stm32dfu.js @@ -53,6 +53,12 @@ var STM32DFU_protocol = function() { dfuUPLOAD_IDLE: 9, // The device is processing an upload operation. Expecting DFU_UPLOAD requests. dfuERROR: 10 // An error has occurred. Awaiting the DFU_CLRSTATUS request. }; + + this.usbDevices = { + F3DiscoveryDFU: {'vendorId': 1155, 'productId': 57105} + }; + + this.usbPermissions = {permissions: [{'usbDevices': [this.usbDevices.F3DiscoveryDFU]}]}; }; STM32DFU_protocol.prototype.openDevice = function(callback) { diff --git a/manifest.json b/manifest.json index 83da3444..5b48ad14 100644 --- a/manifest.json +++ b/manifest.json @@ -23,6 +23,7 @@ "https://*.github.com/", "https://*.githubusercontent.com/", "serial", + "usb", "storage", "fileSystem", "fileSystem.write", @@ -30,6 +31,12 @@ "notifications" ], + "optional_permissions": [ + {"usbDevices": [ + {"vendorId": 1155, "productId": 57105} + ]} + ], + "icons": { "128": "images/icon_128.png" }