1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-17 21:35:33 +03:00

Fix tcp boot

This commit is contained in:
Mark Haslinghuis 2020-10-29 00:28:29 +01:00
parent 71586c914a
commit 545ec324c0
5 changed files with 235 additions and 243 deletions

View file

@ -137,16 +137,22 @@ PortHandler.detectPort = function(currentPorts) {
const newPorts = self.array_difference(currentPorts, self.initialPorts);
if (newPorts.length) {
// pick last_used_port for manual tcp auto-connect or detect and select new port for serial
currentPorts = self.updatePortSelect(currentPorts);
console.log(`PortHandler - Found: ${JSON.stringify(newPorts)}`);
// select / highlight new port, if connected -> select connected port
if (GUI.connected_to) {
self.portPickerElement.val(GUI.connected_to);
} else if (newPorts.length === 1) {
self.portPickerElement.val(newPorts[0].path);
} else if (newPorts.length > 1) {
self.selectPort(currentPorts);
}
ConfigStorage.get('last_used_port', function (result) {
if (result.last_used_port) {
if (result.last_used_port.includes('tcp')) {
self.portPickerElement.val('manual');
} else if (newPorts.length === 1) {
self.portPickerElement.val(newPorts[0].path);
} else if (newPorts.length > 1) {
self.selectPort(currentPorts);
}
}
});
// auto-connect if enabled
if (GUI.auto_connect && !GUI.connecting_to && !GUI.connected_to) {
// start connect procedure. We need firmware flasher protection over here