1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-12 20:49:16 +03:00

Bridge: now processes start can be checked for errors

This commit is contained in:
Cristian Maglie
2013-06-07 17:40:10 +02:00
parent 0541c2663a
commit 8dfa8775e5
4 changed files with 12 additions and 7 deletions

View File

@@ -55,11 +55,12 @@ void BridgeClass::begin() {
transfer(cmd, 2);
}
uint8_t BridgeClass::runCommand(String &command) {
uint8_t BridgeClass::runCommand(String &command, uint8_t &err) {
uint8_t cmd[] = {'R'};
uint8_t res[1];
transfer(cmd, 1, (uint8_t*)command.c_str(), command.length(), res, 1);
return res[0];
uint8_t res[2];
transfer(cmd, 1, (uint8_t*)command.c_str(), command.length(), res, 2);
err = res[0];
return res[1];
}
bool BridgeClass::commandIsRunning(uint8_t handle) {