diff options
author | Cristian Maglie <c.maglie@bug.st> | 2013-06-07 17:40:10 +0200 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2013-06-07 17:40:10 +0200 |
commit | da2b2264b381e53b01a45e08e82d984c4430286c (patch) | |
tree | 3ee2ae536c3b1c31601bfeeca8d4502e1231f768 /libraries/Bridge/Bridge.cpp | |
parent | 1dd29064350f40d8f1d644f57d25537b1b2d9501 (diff) |
Bridge: now processes start can be checked for errors
Diffstat (limited to 'libraries/Bridge/Bridge.cpp')
-rw-r--r-- | libraries/Bridge/Bridge.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libraries/Bridge/Bridge.cpp b/libraries/Bridge/Bridge.cpp index a653b12..928479c 100644 --- a/libraries/Bridge/Bridge.cpp +++ b/libraries/Bridge/Bridge.cpp @@ -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) { |