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
Constructor
- Parameters:
-
| dataBits | The 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:
-
| bit | The bit value to accumulate |
| oddParity | Optional 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:
-
| value | The 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:
-
| oddParity | Optional pointer to get the parity of old data |
- Returns:
- The old data
The documentation for this class was generated from the following file: