availableForWrite (#4664)

added availableForWrite to Print.h to make compatible with Arduino Print.h
This commit is contained in:
drmpf 2021-01-11 20:43:10 +11:00 committed by GitHub
parent fe093a5e35
commit 15db297130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,6 +73,11 @@ public:
} }
size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3))); size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3)));
// add availableForWrite to make compatible with Arduino Print.h
// default to zero, meaning "a single write may block"
// should be overriden by subclasses with buffering
virtual int availableForWrite() { return 0; }
size_t print(const __FlashStringHelper *); size_t print(const __FlashStringHelper *);
size_t print(const String &); size_t print(const String &);
size_t print(const char[]); size_t print(const char[]);