Removed non-working reconnect attempts.
parent
2286b9dfa4
commit
80220738d1
|
@ -4639,7 +4639,7 @@
|
||||||
"semver": "^5.5.0",
|
"semver": "^5.5.0",
|
||||||
"simple-glob": "~0.2.0",
|
"simple-glob": "~0.2.0",
|
||||||
"tar-fs": "^1.13.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",
|
"thenify": "^3.3.0",
|
||||||
"update-notifier": "^2.4.0",
|
"update-notifier": "^2.4.0",
|
||||||
"winresourcer": "^0.9.0"
|
"winresourcer": "^0.9.0"
|
||||||
|
|
|
@ -729,14 +729,19 @@ function reinitialiseConnection(originatorTab, callback) {
|
||||||
GUI.log(i18n.getMessage('deviceRebooting'));
|
GUI.log(i18n.getMessage('deviceRebooting'));
|
||||||
|
|
||||||
if (FC.boardHasVcp()) { // VCP-based flight controls may crash old drivers, we catch and reconnect
|
if (FC.boardHasVcp()) { // VCP-based flight controls may crash old drivers, we catch and reconnect
|
||||||
setTimeout(function start_connection() {
|
GUI.timeout_add('waiting_for_disconnect', function waiting_for_bootup() {
|
||||||
$('a.connect').click();
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
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 {
|
} else {
|
||||||
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
|
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
|
||||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function() {
|
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function() {
|
||||||
GUI.log(i18n.getMessage('deviceReady'));
|
GUI.log(i18n.getMessage('deviceReady'));
|
||||||
originatorTab.initialize(false, $('#content').scrollTop());
|
originatorTab.initialize(false, $('#content').scrollTop());
|
||||||
|
|
|
@ -398,9 +398,10 @@ TABS.cli.cleanup = function (callback) {
|
||||||
// (another approach is however much more complicated):
|
// (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 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
|
// we could probably implement this someday
|
||||||
reinitialiseConnection(self, function () {
|
if (callback) {
|
||||||
GUI.timeout_add('tab_change_callback', callback, 500);
|
callback();
|
||||||
});
|
}
|
||||||
|
|
||||||
CONFIGURATOR.cliActive = false;
|
CONFIGURATOR.cliActive = false;
|
||||||
CONFIGURATOR.cliValid = false;
|
CONFIGURATOR.cliValid = false;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue