pfodRingBuffer for Arduino Implements a ring buffer implementation of an Arduino Stream upto 32K buffers NOTE: this implementation DOES NOT BLOCK if the buffer is full extra bytes written are quietly dropped.
More...
#include <pfodRingBuffer.h>
Inherits Stream.
pfodRingBuffer for Arduino Implements a ring buffer implementation of an Arduino Stream upto 32K buffers NOTE: this implementation DOES NOT BLOCK if the buffer is full extra bytes written are quietly dropped.
markWrite() marks current write position resetWrite() resets buffer to previous markWrite effectively deleting any bytes written between markWrite() and resetWrite() any call to read() or flush() or clear() or resetWrite() clears the markWrite multiple calls to markWrite() only saves the last one.
Definition at line 25 of file pfodRingBuffer.h.
◆ pfodRingBuffer() [1/2]
pfodRingBuffer::pfodRingBuffer |
( |
| ) |
|
◆ pfodRingBuffer() [2/2]
pfodRingBuffer::pfodRingBuffer |
( |
uint8_t * |
_buf, |
|
|
size_t |
_size |
|
) |
| |
◆ available()
int pfodRingBuffer::available |
( |
| ) |
|
◆ availableForWrite()
int pfodRingBuffer::availableForWrite |
( |
| ) |
|
◆ clear()
void pfodRingBuffer::clear |
( |
| ) |
|
◆ copyTo()
void pfodRingBuffer::copyTo |
( |
Print * |
outputPtr | ) |
|
copyTo() copies contents to the print stream unlike read() copyTo does not remove any data from the buffer or move the current read position
◆ flush()
void pfodRingBuffer::flush |
( |
| ) |
|
◆ getSize()
size_t pfodRingBuffer::getSize |
( |
| ) |
|
◆ init()
void pfodRingBuffer::init |
( |
uint8_t * |
_buf, |
|
|
size_t |
_size |
|
) |
| |
_buf must be at least _size in length _size is limited to 32766
◆ markWrite()
void pfodRingBuffer::markWrite |
( |
| ) |
|
◆ peek()
int pfodRingBuffer::peek |
( |
| ) |
|
◆ read()
int pfodRingBuffer::read |
( |
| ) |
|
◆ resetWrite()
void pfodRingBuffer::resetWrite |
( |
| ) |
|
◆ write() [1/2]
size_t pfodRingBuffer::write |
( |
const uint8_t * |
buffer, |
|
|
size_t |
size |
|
) |
| |
◆ write() [2/2]
size_t pfodRingBuffer::write |
( |
uint8_t |
b | ) |
|