mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-19 22:35:15 +03:00
Filter out serial ports identified by HEX address only
This commit is contained in:
parent
c699dc6318
commit
beb0ba8a28
3 changed files with 22 additions and 10 deletions
|
@ -22,7 +22,16 @@ PortHandler.initialize = function () {
|
||||||
PortHandler.check = function () {
|
PortHandler.check = function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
ConnectionSerial.getDevices(function(current_ports) {
|
ConnectionSerial.getDevices(function(all_ports) {
|
||||||
|
|
||||||
|
// filter out ports that are not serial
|
||||||
|
let current_ports = [];
|
||||||
|
for (var i = 0; i < all_ports.length; i++) {
|
||||||
|
if (all_ports[i].indexOf(':') === -1) {
|
||||||
|
current_ports.push(all_ports[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// port got removed or initial_ports wasn't initialized yet
|
// port got removed or initial_ports wasn't initialized yet
|
||||||
if (self.array_difference(self.initial_ports, current_ports).length > 0 || !self.initial_ports) {
|
if (self.array_difference(self.initial_ports, current_ports).length > 0 || !self.initial_ports) {
|
||||||
var removed_ports = self.array_difference(self.initial_ports, current_ports);
|
var removed_ports = self.array_difference(self.initial_ports, current_ports);
|
||||||
|
|
19
package-lock.json
generated
19
package-lock.json
generated
|
@ -22,7 +22,7 @@
|
||||||
"jquery-ui-npm": "1.12.0",
|
"jquery-ui-npm": "1.12.0",
|
||||||
"marked": "^0.3.17",
|
"marked": "^0.3.17",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"nw": "^0.61.0-sdk",
|
"nw": "^0.81.0",
|
||||||
"nw-dialog": "^1.0.7",
|
"nw-dialog": "^1.0.7",
|
||||||
"openlayers": "^4.6.5",
|
"openlayers": "^4.6.5",
|
||||||
"plotly": "^1.0.6",
|
"plotly": "^1.0.6",
|
||||||
|
@ -4984,9 +4984,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/merge": {
|
"node_modules/merge": {
|
||||||
"version": "1.2.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz",
|
||||||
"integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ=="
|
"integrity": "sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w=="
|
||||||
},
|
},
|
||||||
"node_modules/merge-descriptors": {
|
"node_modules/merge-descriptors": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
|
@ -5482,16 +5482,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nw": {
|
"node_modules/nw": {
|
||||||
"version": "0.61.0",
|
"version": "0.81.0",
|
||||||
"resolved": "https://registry.npmjs.org/nw/-/nw-0.61.0.tgz",
|
"resolved": "https://registry.npmjs.org/nw/-/nw-0.81.0.tgz",
|
||||||
"integrity": "sha512-SazcPW9+kplf7/K2KuTaamOFGtKnnH4Gs/cHHRMf9luTkCGe2cFsnb6/fEP5xvu9tpoW9Z/oUKzj9lZ6kylFWQ==",
|
"integrity": "sha512-eM7TpyZj3No3jCWM7D6Td9um2yCQ7AGTYkXWUIoVrQxD4z2l/KEipyBjZGHWBQqjqUm9ItI5ZmrdDsP63YWb6w==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "~1.1.3",
|
"chalk": "~1.1.3",
|
||||||
"decompress": "^4.2.0",
|
"decompress": "^4.2.0",
|
||||||
"download": "^5.0.3",
|
"download": "^5.0.3",
|
||||||
"file-exists": "^2.0.0",
|
"file-exists": "^2.0.0",
|
||||||
"merge": "^1.2.0",
|
"merge": "^2.1.1",
|
||||||
"progress": "^2.0.3",
|
"progress": "^2.0.3",
|
||||||
"rimraf": "^2.2.8",
|
"rimraf": "^2.2.8",
|
||||||
"semver": "^5.1.0",
|
"semver": "^5.1.0",
|
||||||
|
@ -5499,6 +5499,9 @@
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"nw": "bin/nw"
|
"nw": "bin/nw"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "v20.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nw-builder": {
|
"node_modules/nw-builder": {
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
"jquery-ui-npm": "1.12.0",
|
"jquery-ui-npm": "1.12.0",
|
||||||
"marked": "^0.3.17",
|
"marked": "^0.3.17",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"nw": "^0.61.0-sdk",
|
"nw": "^0.81.0",
|
||||||
"nw-dialog": "^1.0.7",
|
"nw-dialog": "^1.0.7",
|
||||||
"openlayers": "^4.6.5",
|
"openlayers": "^4.6.5",
|
||||||
"plotly": "^1.0.6",
|
"plotly": "^1.0.6",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue