Skip to content
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

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

Open
JAndrassy opened this issue Sep 12, 2020 · 2 comments

Comments

@JAndrassy
Copy link
Owner

JAndrassy commented Sep 12, 2020

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;
}
@kefahi
Copy link

kefahi commented Jan 21, 2021

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

@JAndrassy
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants