StreamLib icon indicating copy to clipboard operation
StreamLib copied to clipboard

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

Open JAndrassy opened this issue 5 years ago • 2 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;
}

JAndrassy avatar Sep 12 '20 14:09 JAndrassy

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

kefahi avatar Jan 21 '21 22:01 kefahi

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

JAndrassy avatar Jan 22 '21 06:01 JAndrassy