recovery bugfix

10.3.x-maintenance
cTn 2014-08-10 06:01:21 +02:00 committed by Dominic Clifton
parent 696e27b503
commit 1e0cadc039
1 changed files with 4 additions and 6 deletions

View File

@ -29,12 +29,6 @@ var serial = {
switch (info.error) { switch (info.error) {
case 'system_error': // we might be able to recover from this one case 'system_error': // we might be able to recover from this one
chrome.serial.setPaused(self.connectionId, false, get_status);
var get_status = function () {
self.getInfo(crunch_status);
}
var crunch_status = function (info) { var crunch_status = function (info) {
if (!info.paused) { if (!info.paused) {
console.log('SERIAL: Connection recovered from last onReceiveError'); console.log('SERIAL: Connection recovered from last onReceiveError');
@ -51,6 +45,10 @@ var serial = {
} }
} }
} }
chrome.serial.setPaused(self.connectionId, false, function () {
self.getInfo(crunch_status);
});
break; break;
case 'timeout': case 'timeout':
// TODO // TODO