Removed non-working reconnect attempts.

10.5.x-maintenance
mikeller 2019-03-31 23:44:33 +13:00
parent 2286b9dfa4
commit 80220738d1
3 changed files with 13 additions and 7 deletions

2
package-lock.json generated
View File

@ -4639,7 +4639,7 @@
"semver": "^5.5.0",
"simple-glob": "~0.2.0",
"tar-fs": "^1.13.0",
"temp": "github:adam-lynch/node-temp#279c1350cb7e4f02515d91da9e35d39a40774016",
"temp": "github:adam-lynch/node-temp#remove_tmpdir_dep",
"thenify": "^3.3.0",
"update-notifier": "^2.4.0",
"winresourcer": "^0.9.0"

View File

@ -729,14 +729,19 @@ function reinitialiseConnection(originatorTab, callback) {
GUI.log(i18n.getMessage('deviceRebooting'));
if (FC.boardHasVcp()) { // VCP-based flight controls may crash old drivers, we catch and reconnect
setTimeout(function start_connection() {
$('a.connect').click();
GUI.timeout_add('waiting_for_disconnect', function waiting_for_bootup() {
if (callback) {
callback();
}
}, 2500);
}, 100);
//TODO: Need to work out how to do a proper reconnect here.
// caveat: Timeouts set with `GUI.timeout_add()` are removed on disconnect.
} else {
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
if (callback) {
callback();
}
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function() {
GUI.log(i18n.getMessage('deviceReady'));
originatorTab.initialize(false, $('#content').scrollTop());

View File

@ -398,9 +398,10 @@ TABS.cli.cleanup = function (callback) {
// (another approach is however much more complicated):
// we can setup an interval asking for data lets say every 200ms, when data arrives, callback will be triggered and tab switched
// we could probably implement this someday
reinitialiseConnection(self, function () {
GUI.timeout_add('tab_change_callback', callback, 500);
});
if (callback) {
callback();
}
CONFIGURATOR.cliActive = false;
CONFIGURATOR.cliValid = false;
});