|
|
@ -69,10 +69,30 @@ var serial = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'break':
|
|
|
|
case 'break':
|
|
|
|
// This occurs on F1 boards with old firmware.
|
|
|
|
// This occurs on F1 boards with old firmware during reboot
|
|
|
|
|
|
|
|
// wait 50 ms and attempt recovery
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
|
|
|
chrome.serial.setPaused(info.connectionId, false, function() {
|
|
|
|
|
|
|
|
self.getInfo(function (info) {
|
|
|
|
|
|
|
|
if (info.paused) {
|
|
|
|
|
|
|
|
// assume unrecoverable, disconnect
|
|
|
|
|
|
|
|
console.log('SERIAL: Connection did not recover from break condition, disconnecting');
|
|
|
|
|
|
|
|
GUI.log('Unrecoverable <span style="color: red">failure</span> of serial connection, disconnecting...');
|
|
|
|
|
|
|
|
googleAnalytics.sendException('Serial: break condition - unrecoverable', false);
|
|
|
|
|
|
|
|
|
|
|
|
if (GUI.connected_to || GUI.connecting_to) {
|
|
|
|
if (GUI.connected_to || GUI.connecting_to) {
|
|
|
|
$('a.connect').click();
|
|
|
|
$('a.connect').click();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
self.disconnect();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
console.log('SERIAL: Connection recovered from break condition');
|
|
|
|
|
|
|
|
googleAnalytics.sendException('Serial: break condition - recovered', false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}, 50);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'timeout':
|
|
|
|
case 'timeout':
|
|
|
|
// TODO
|
|
|
|
// TODO
|
|
|
|