Bridge class now checks for protocol version

This commit is contained in:
Cristian Maglie 2013-06-12 12:08:11 +02:00
parent 60d4c13f76
commit 9e59262f64
1 changed files with 5 additions and 4 deletions

View File

@ -27,8 +27,6 @@ void BridgeClass::begin() {
return; return;
started = true; started = true;
// TODO: A more robust restart
// Wait for Atheros bootloader to finish startup // Wait for Atheros bootloader to finish startup
do { do {
dropAll(); dropAll();
@ -53,8 +51,11 @@ void BridgeClass::begin() {
// are ignored as "invalid packets". // are ignored as "invalid packets".
// Reset the brigde // Reset the brigde
uint8_t cmd[] = {'X','X'}; uint8_t cmd[] = {'X','X', '1','0','0'};
transfer(cmd, 2); uint8_t res[1];
transfer(cmd, 5, res, 1);
if (res[0] != 0)
while (true);
} }
uint8_t BridgeClass::runCommand(String &command, uint8_t &err) { uint8_t BridgeClass::runCommand(String &command, uint8_t &err) {