Yate
Public Member Functions

BitAccumulator Class Reference

A 1-byte length bit accumulator. More...

#include <yatemodem.h>

List of all members.

Public Member Functions

 BitAccumulator (unsigned char dataBits)
unsigned char dataBits () const
void dataBits (unsigned char value)
unsigned char reset (bool *oddParity=0)
unsigned int accumulate (bool bit, bool *oddParity=0)

Detailed Description

A 1-byte length bit accumulator.

This class encapsulates an 8 bits length buffer used to accumulate bits


Constructor & Destructor Documentation

BitAccumulator ( unsigned char  dataBits) [inline]

Constructor

Parameters:
dataBitsThe buffer size. Values interval 1..8

Member Function Documentation

unsigned int accumulate ( bool  bit,
bool *  oddParity = 0 
) [inline]

Accumulate a bit. Reset accumulator when full

Parameters:
bitThe bit value to accumulate
oddParityOptional pointer to get the data parity when full
Returns:
The accumulated byte or a value greater then 255 if incomplete
void dataBits ( unsigned char  value) [inline]

Set the buffer size. Reset the accumulator

Parameters:
valueThe new buffer size. Values interval 1..8
unsigned char dataBits ( ) const [inline]

Get the buffer size

Returns:
The buffer size
unsigned char reset ( bool *  oddParity = 0) [inline]

Reset the accumulator. Returns the old data

Parameters:
oddParityOptional pointer to get the parity of old data
Returns:
The old data

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