diff --git a/js/serial.js b/js/serial.js index bbb92de5..03b0adf5 100644 --- a/js/serial.js +++ b/js/serial.js @@ -68,17 +68,20 @@ var serial = { }); } break; + case 'break': // This occurs on F1 boards with old firmware during reboot + case 'overrun': // wait 50 ms and attempt recovery + self.error = info.error; 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'); + console.log('SERIAL: Connection did not recover from ' + self.error + ' condition, disconnecting'); GUI.log('Unrecoverable failure of serial connection, disconnecting...'); - googleAnalytics.sendException('Serial: break condition - unrecoverable', false); + googleAnalytics.sendException('Serial: ' + self.error + ' - unrecoverable', false); if (GUI.connected_to || GUI.connecting_to) { $('a.connect').click(); @@ -87,19 +90,22 @@ var serial = { } } else { - console.log('SERIAL: Connection recovered from break condition'); - googleAnalytics.sendException('Serial: break condition - recovered', false); + console.log('SERIAL: Connection recovered from ' + self.error + ' condition'); + googleAnalytics.sendException('Serial: ' + self.error + ' - recovered', false); } }); }); }, 50); break; + case 'timeout': // TODO break; + case 'device_lost': // TODO break; + case 'disconnected': // TODO break;