1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-19 06:15:11 +03:00

Filter out serial ports identified by HEX address only

This commit is contained in:
Pawel Spychalski (DzikuVx) 2023-12-25 13:32:59 +01:00
parent c699dc6318
commit beb0ba8a28
3 changed files with 22 additions and 10 deletions

View file

@ -22,7 +22,16 @@ PortHandler.initialize = function () {
PortHandler.check = function () {
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
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);

19
package-lock.json generated
View file

@ -22,7 +22,7 @@
"jquery-ui-npm": "1.12.0",
"marked": "^0.3.17",
"minimist": "^1.2.0",
"nw": "^0.61.0-sdk",
"nw": "^0.81.0",
"nw-dialog": "^1.0.7",
"openlayers": "^4.6.5",
"plotly": "^1.0.6",
@ -4984,9 +4984,9 @@
}
},
"node_modules/merge": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz",
"integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ=="
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz",
"integrity": "sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w=="
},
"node_modules/merge-descriptors": {
"version": "1.0.3",
@ -5482,16 +5482,16 @@
}
},
"node_modules/nw": {
"version": "0.61.0",
"resolved": "https://registry.npmjs.org/nw/-/nw-0.61.0.tgz",
"integrity": "sha512-SazcPW9+kplf7/K2KuTaamOFGtKnnH4Gs/cHHRMf9luTkCGe2cFsnb6/fEP5xvu9tpoW9Z/oUKzj9lZ6kylFWQ==",
"version": "0.81.0",
"resolved": "https://registry.npmjs.org/nw/-/nw-0.81.0.tgz",
"integrity": "sha512-eM7TpyZj3No3jCWM7D6Td9um2yCQ7AGTYkXWUIoVrQxD4z2l/KEipyBjZGHWBQqjqUm9ItI5ZmrdDsP63YWb6w==",
"hasInstallScript": true,
"dependencies": {
"chalk": "~1.1.3",
"decompress": "^4.2.0",
"download": "^5.0.3",
"file-exists": "^2.0.0",
"merge": "^1.2.0",
"merge": "^2.1.1",
"progress": "^2.0.3",
"rimraf": "^2.2.8",
"semver": "^5.1.0",
@ -5499,6 +5499,9 @@
},
"bin": {
"nw": "bin/nw"
},
"engines": {
"node": "v20.5.0"
}
},
"node_modules/nw-builder": {

View file

@ -36,7 +36,7 @@
"jquery-ui-npm": "1.12.0",
"marked": "^0.3.17",
"minimist": "^1.2.0",
"nw": "^0.61.0-sdk",
"nw": "^0.81.0",
"nw-dialog": "^1.0.7",
"openlayers": "^4.6.5",
"plotly": "^1.0.6",