1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

manual port override as chrome won't enumerate bluetooth serial ports on linux

This commit is contained in:
Paul Rogalinski 2015-05-10 14:37:31 +02:00
parent d10023ec4b
commit 1bb63a597b
4 changed files with 44 additions and 13 deletions

16
js/port_handler.js Normal file → Executable file
View file

@ -1,12 +1,10 @@
'use strict';
var PortHandler = new function () {
this.main_timeout_reference;
this.initial_ports = false;
this.port_detected_callbacks = [];
this.port_removed_callbacks = [];
}
};
PortHandler.initialize = function () {
// start listening, check after 250ms
@ -137,7 +135,7 @@ PortHandler.check = function () {
check_usb_devices();
}
self.main_timeout_reference = setTimeout(function () {
setTimeout(function () {
self.check();
}, 250);
});
@ -161,13 +159,11 @@ PortHandler.check = function () {
PortHandler.update_port_select = function (ports) {
$('div#port-picker #port').html(''); // drop previous one
if (ports.length > 0) {
for (var i = 0; i < ports.length; i++) {
$('div#port-picker #port').append($("<option/>", {value: ports[i], text: ports[i]}));
}
} else {
$('div#port-picker #port').append($("<option/>", {value: 0, text: 'No Ports'}));
for (var i = 0; i < ports.length; i++) {
$('div#port-picker #port').append($("<option/>", {value: ports[i], text: ports[i], data: {isManual: false}}));
}
$('div#port-picker #port').append($("<option/>", {value: 'manual', text: 'Manual Selection', data: {isManual: true}}));
};
PortHandler.port_detected = function(name, code, timeout, ignore_timeout) {