From d21dc8c91656672ba37465d7ee215d6ed37041e1 Mon Sep 17 00:00:00 2001 From: cTn Date: Wed, 20 Nov 2013 12:26:00 +0100 Subject: [PATCH] implemented automatic port poll/refresh --- js/gui.js | 2 + js/serial_backend.js | 146 ++++++++++++++++++++++++++++--------------- 2 files changed, 98 insertions(+), 50 deletions(-) diff --git a/js/gui.js b/js/gui.js index b6e08174..f8c4eae1 100644 --- a/js/gui.js +++ b/js/gui.js @@ -1,4 +1,6 @@ var GUI_control = function() { + this.connecting_to = false; + this.connected_to = false; this.active_tab; this.operating_system; this.interval_array = []; diff --git a/js/serial_backend.js b/js/serial_backend.js index 6bf72605..7138f06c 100644 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -93,45 +93,8 @@ $(document).ready(function() { baud_picker = $('div#port-picker #baud'); delay_picker = $('div#port-picker #delay'); - $('div#port-picker a.refresh').click(function() { - console.log("Available port list requested."); - port_picker.html(''); - - chrome.serial.getPorts(function(ports) { - if (ports.length > 0) { - // Port list received - - ports.forEach(function(port) { - $(port_picker).append($("