Hi Folks,
I have a simple loop read the WiFly output of a web client GET request response. I've seen the exact code in many examples and yet, I get buffer overflows every time. In fact, it seems the overflow is always after 61 characters (though the WiFly returns ASCII codes). I'm using a Pro Mini 3.3/8MHz. Is there some way I can handle the returned data fast enough to prevent this? DO I need to build some delay into the loop to prevent dropping out of the loop prematurely?
char ch;
while (wiFlySerial.available()) {
ch = wiFlySerial.read();
Serial.print(ch);
}
Serial.println();
if (wiFlySerial.overflow())
Serial.println("response overflowed buffer");
I get the same result when I use the even more commonly used code:
while (wiFlySerial.available()) {
Serial.print(wiFlySerial.read());
}
Serial.println();
if (wiFlySerial.overflow())
Serial.println("response overflowed buffer");