mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
Merge pull request #2848 from facchinm/testBridgePut
Bridge: fix transfers which ignored host response
This commit is contained in:
commit
8b019650d5
@ -1,5 +1,5 @@
|
||||
name=Bridge
|
||||
version=1.0.0
|
||||
version=1.0.1
|
||||
author=Arduino
|
||||
maintainer=Arduino <info@arduino.cc>
|
||||
sentence=Enables the communication between the Linux processor and the AVR. For Arduino Yún and TRE only.
|
||||
|
@ -87,10 +87,11 @@ void BridgeClass::begin() {
|
||||
void BridgeClass::put(const char *key, const char *value) {
|
||||
// TODO: do it in a more efficient way
|
||||
String cmd = "D";
|
||||
uint8_t res[1];
|
||||
cmd += key;
|
||||
cmd += "\xFE";
|
||||
cmd += value;
|
||||
transfer((uint8_t*)cmd.c_str(), cmd.length());
|
||||
transfer((uint8_t*)cmd.c_str(), cmd.length(), res, 1);
|
||||
}
|
||||
|
||||
unsigned int BridgeClass::get(const char *key, uint8_t *value, unsigned int maxlen) {
|
||||
|
@ -175,7 +175,8 @@ void File::close() {
|
||||
if (mode == 255)
|
||||
return;
|
||||
uint8_t cmd[] = {'f', handle};
|
||||
bridge.transfer(cmd, 2);
|
||||
uint8_t ret[1];
|
||||
bridge.transfer(cmd, 2, ret, 1);
|
||||
mode = 255;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user