JAndrassy / StreamLib

Arduino library with Stream helper classes. BufferedPrint stream for efficient networking. ChunkedPrint for HTTP chunked encoding. ChunkedStreamReader for HTTP chunked decoding. CStringBulder builds a c-string with Print class methods. StringReadStream to wrap string as Stream. And printf() function with formatting string from F macro.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BufferedPrint.cpp:51:18: error: 'class Print' has no member named 'availableForWrite'

JAndrassy opened this issue · comments

some cores have the Arduino API older then 2017 and are missing Print::availbleForWrite function.

workaround:

int BufferedPrint::availableForWrite() {
//  int a = target.availableForWrite();
//  if (!a) // target doesn't report aFW or is really full
    return size - pos; // then return space left in our buffer
//  a = a - pos; // what will be left in target after our flush()
//  return a < 0 ? 0 : a;
}

I ran into the same problem and used your work around. Thank you!
But I'm sure my libraries are updated. If not how can I check?

ps: I used ESP 32 WROOM with Ardruino IDE

I ran into the same problem and used your work around. Thank you!
But I'm sure my libraries are updated. If not how can I check?

ps: I used ESP 32 WROOM with Ardruino IDE

Print::availableForWrite support was added to esp32 core GitHub repository only some days ago. it is not in a release