Bridge.get("key", buffer, 0) takes > 5 seconds

If the buffer_length is smaller than the actual content of “key” then the Bridge.get() command takes about >5200 ms (yes, more than 5 seconds …).

Tested with the following code:

#include <Bridge.h>
#define BUFF_LEN 5

bool once = true;
unsigned long start;
unsigned long end;
char *buffer = new char[BUFF_LEN+1] { ‘\0’ };

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Bridge.begin(250000);
}

void loop() {
// put your main code here, to run repeatedly:
if (once) {
delay(1000);
once = false;
Bridge.put(“key”, “Test”); // 4 chars including 1 termination char = 5 OK

start = millis();
Bridge.get(“key”, buffer, BUFF_LEN);
end = millis();
Serial.println(end - start); // 6ms

Bridge.put(“key”, “TestContent”); // more than 5 chars …

start = millis();
Bridge.get(“key”, buffer, BUFF_LEN);
end = millis();
Serial.println(end - start); // 5237ms

Bridge.put(“key”, “Test”); // again 4 chars including 1 termination char = 5 OK

start = millis();
Bridge.get(“key”, buffer, BUFF_LEN);
end = millis();
Serial.println(end - start); // 5237ms even if the content should be exactly 5 chars
}
}

If the buffer_length is bigger than or the exact size of the actual content, it works within ~7ms. Also if the content ONCE is bigger than buffer_length the Bridge.get() will ALLWAYS take >5 seconds, no matter if you reset the content smaller than buffer_length …

Arduino Yun with Bridge 1.6.3