cabana: fix live addressing; live button doesnt hang on errors

main
Andy Haden 2017-08-21 18:19:29 -07:00
parent e066c3e39a
commit c15f506029
3 changed files with 10 additions and 14 deletions

View File

@ -573,7 +573,7 @@ export default class CanExplorer extends Component {
this.setState({ attemptingPandaConnection: true, live: true });
const persistedDbc = fetchPersistedDbc('live');
if(persistedDbc) {
if( persistedDbc ) {
const {dbc, dbcText} = persistedDbc;
this.setState({dbc, dbcText});
}
@ -586,10 +586,8 @@ export default class CanExplorer extends Component {
this.setState({ showOnboarding: false });
this.setState({ showLoadDbc: true });
}).catch((err) => {
if (err.code === PandaReader.ERROR_NO_DEVICE_SELECTED) {
this.setState({ attemptingPandaConnection: false });
}
else { console.log(err) }
console.log(err);
this.setState({ attemptingPandaConnection: false });
});
}

View File

@ -45,12 +45,8 @@ export default class Panda {
const datView = Buffer.from(dat);
const f1 = datView.readInt32LE(0), f2 = datView.readInt32LE(4);
let address;
if(f2 & CAN_EXTENDED) {
address = f1 >>> 3;
} else {
address = f1 >>> 21;
}
const address = f1 >>> 21;
const busTime = (f2 >>> 16);
const data = new Buffer(dat.slice(8, 8 + (f2 & 0xF)));
const source = ((f2 >> 4) & 0xF) & 0xFF;

View File

@ -412,9 +412,11 @@ export default class DBC {
}
}
if(warnings.length > 0) {
warnings.forEach((warning) => CloudLog.warn('importDbcString: ' + warning));
}
// Disabled b/c live mode frequently calls this function
// and executes way too many network requests
// if(warnings.length > 0) {
// warnings.forEach((warning) => CloudLog.warn('importDbcString: ' + warning));
// }
this.messages = messages;
this.boardUnits = boardUnits;