#include <yatemodem.h>
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) |
This class encapsulates an 8 bits length buffer used to accumulate bits
BitAccumulator | ( | unsigned char | dataBits | ) | [inline] |
Constructor
dataBits | The buffer size. Values interval 1..8 |
unsigned char dataBits | ( | ) | const [inline] |
Get the buffer size
void dataBits | ( | unsigned char | value | ) | [inline] |
Set the buffer size. Reset the accumulator
value | The new buffer size. Values interval 1..8 |
unsigned char reset | ( | bool * | oddParity = 0 |
) | [inline] |
Reset the accumulator. Returns the old data
oddParity | Optional pointer to get the parity of old data |
unsigned int accumulate | ( | bool | bit, | |
bool * | oddParity = 0 | |||
) | [inline] |
Accumulate a bit. Reset accumulator when full
bit | The bit value to accumulate | |
oddParity | Optional pointer to get the data parity when full |