Yate
UARTBuffer Class Reference

A fixed length byte accumulator used by an UART. More...

#include <yatemodem.h>

Public Member Functions

 UARTBuffer (UART *client)
 
const DataBlockbuffer () const
 
unsigned int free () const
 
void reset (unsigned int len=0)
 
bool accumulate (unsigned char value)
 

Detailed Description

A fixed length byte accumulator used by an UART.

This class is used by an UART to accumulate messages with known length

Constructor & Destructor Documentation

◆ UARTBuffer()

UARTBuffer ( UART * client)
inline

Constructor

Parameters
clientThe client of this buffer

References reset().

Member Function Documentation

◆ accumulate()

bool accumulate ( unsigned char value)
inline

Accumulate data

Parameters
valueThe value to append to the buffer
Returns
False on buffer overflow

◆ buffer()

const DataBlock & buffer ( ) const
inline

Get the accumulated data

Returns
The accumulated data

◆ free()

unsigned int free ( ) const
inline

Get the free space length in the buffer

Returns
The free space length

◆ reset()

void reset ( unsigned int len = 0)
inline

Reset the buffer

Parameters
lenThe new length of the buffer. Set to 0 to left the length unchanged

Referenced by UARTBuffer().


The documentation for this class was generated from the following file: