#include <yatemodem.h>
Public Types | |
enum | State { Idle, BitStart, BitData, BitParity, BitStop, UARTError } |
enum | Error { EFraming, EParity, EChksum, EInvalidData, EUnknown, EStopped, ENone } |
Public Member Functions | |
UART (State state, const NamedList ¶ms, const char *name=0) | |
virtual | ~UART () |
State | state () const |
Error | error () const |
int | modemType () const |
const BitAccumulator & | accumulator () const |
virtual void | reset (State newState=Idle) |
bool | demodulate (const DataBlock &data) |
bool | modulate (DataBlock &dest, NamedList ¶ms) |
void | modulate (DataBlock &dest, const DataBlock &src) |
bool | recvBit (bool value) |
virtual bool | recvByte (unsigned char data) |
virtual bool | fskStarted () |
Static Public Attributes | |
static TokenDict | s_errors [] |
Protected Member Functions | |
virtual int | idleRecvByte (unsigned char data) |
virtual bool | createMsg (NamedList ¶ms, DataBlock &data) |
bool | error (Error e) |
Accumulate data bits received from a modem
Constructor
state | The initial state of this UART | |
params | The UART's parameters | |
name | The name of this debug enabler |
virtual ~UART | ( | ) | [inline, virtual] |
Destructor
State state | ( | ) | const [inline] |
Error error | ( | ) | const [inline] |
int modemType | ( | ) | const [inline] |
Get the type of this UART's modem
const BitAccumulator& accumulator | ( | ) | const [inline] |
virtual void reset | ( | State | newState = Idle |
) | [virtual] |
Reset this UART
newState | The state to reset to |
bool demodulate | ( | const DataBlock & | data | ) | [inline] |
Send data to the enclosed modem to be demodulated
data | The data to process |
Create a buffer containing the modulated representation of a list of parameters
dest | Destination buffer | |
params | The list containing the values to be modulated |
Create a buffer containing the modulated representation of another one
dest | Destination buffer | |
src | Source buffer |
bool recvBit | ( | bool | value | ) |
Push a bit of data into this UART. Once a data byte is accumulated, push it back to itself
value | The bit to be processed |
virtual bool recvByte | ( | unsigned char | data | ) | [inline, virtual] |
virtual bool fskStarted | ( | ) | [inline, virtual] |
Notification from modem that the FSK start was detected
virtual int idleRecvByte | ( | unsigned char | data | ) | [inline, protected, virtual] |
Process an accumulated byte in Idle state
data | The byte to process |
Reimplemented in ETSIModem.
Create a buffer containing the byte representation of a message to be sent
params | The list containing message parameters | |
data | Destination message data buffer |
Reimplemented in ETSIModem.
bool error | ( | Error | e | ) | [protected] |