Skip to content

Bridge: fix transfers which ignored host response #2848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/Bridge/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Bridge
version=1.0.0
version=1.0.1
author=Arduino
maintainer=Arduino <[email protected]>
sentence=Enables the communication between the Linux processor and the AVR. For Arduino Yún and TRE only.
Expand Down
3 changes: 2 additions & 1 deletion libraries/Bridge/src/Bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion libraries/Bridge/src/FileIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down