SafeString
4.1.27
SafeString is a safe, robust and debuggable replacement for string processing in Arduino
|
To create a BufferedInput use the macro createBufferedInput see the detailed description. More...
#include <BufferedInput.h>
Inherits Stream.
Public Member Functions | |
BufferedInput (size_t _bufferSize, uint8_t *_buf) | |
use createBufferedOutput(name, size); instead BufferedInput(size_t _bufferSize, uint8_t *_buf); More... | |
void | connect (Stream &_stream) |
void connect(Stream& _stream); // the stream to read from, can also write to stream – the stream to buffer input for More... | |
void | nextByteIn () |
virtual size_t | write (uint8_t) |
virtual size_t | write (const uint8_t *buf, size_t size) |
virtual int | available () |
virtual int | read () |
virtual int | peek () |
virtual void | flush () |
virtual int | availableForWrite () |
size_t | getSize () |
int | maxStreamAvailable () |
int | maxBufferUsed () |
To create a BufferedInput use the macro createBufferedInput see the detailed description.
The createBufferedInput macro takes 2 arguments.
createBufferedInput(name, bufferSize); creates a BufferedInput called name with a buffer size of bufferSize.
e.g. to create a BufferedInput called bufferedInput with a buffer size of 128 use
createBufferedInput(bufferedInput, 128)
Add a call to
bufferedInput.nextByteIn();
at the top of the loop() to read more chars from the input. You can add more of these calls through out the loop() code if needed.
Most BufferedInput methods also read more chars from the input
See Arduino Serial I/O for the Real World - BufferedInput for an example of its use.
Definition at line 61 of file BufferedInput.h.
BufferedInput::BufferedInput | ( | size_t | _bufferSize, |
uint8_t * | _buf | ||
) |
use createBufferedOutput(name, size); instead BufferedInput(size_t _bufferSize, uint8_t *_buf);
buf – the user allocated buffer to store the bytes, must be at least bufferSize long. Defaults to an internal 8 char buffer if buf is omitted or NULL bufferSize – number of bytes to buffer,max bufferSize is limited to 32766. Defaults to an internal 8 char buffer if bufferSize is < 8 or is omitted
|
virtual |
|
virtual |
void BufferedInput::connect | ( | Stream & | _stream | ) |
void connect(Stream& _stream); // the stream to read from, can also write to stream – the stream to buffer input for
|
virtual |
size_t BufferedInput::getSize | ( | ) |
int BufferedInput::maxBufferUsed | ( | ) |
int BufferedInput::maxStreamAvailable | ( | ) |
void BufferedInput::nextByteIn | ( | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |