1 #ifndef BufferedInput_h
2 #define BufferedInput_h
37 #include <Printable.h>
44 #define createBufferedInput(name, size) uint8_t name ## _INPUT_BUFFER[(size)]; BufferedInput name(sizeof(name ## _INPUT_BUFFER),name ## _INPUT_BUFFER);
80 virtual size_t write(
const uint8_t *buf,
size_t size);
97 uint8_t defaultBuffer[8];
104 void rb_init(uint8_t* _buf,
size_t _size);
106 inline int rb_available() {
107 return rb_buffer_count;
111 size_t rb_write(uint8_t b);
112 size_t rb_write(
const uint8_t *buffer,
size_t size);
113 int rb_availableForWrite();
116 void rb_dump(Stream* streamPtr);
119 uint16_t rb_buffer_head;
120 uint16_t rb_buffer_tail;
121 uint16_t rb_buffer_count;
122 uint16_t rb_wrapBufferIdx(uint16_t idx);
123 void rb_internalWrite(uint8_t b);