class UART

An UART receiver/transmitter. More...

Full nameTelEngine::UART
Definition#include <libs/ymodem/yatemodem.h>
InheritsTelEngine::DebugEnabler [public ]
Inherited byETSIModem
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Members

Protected Methods


Detailed Description

Accumulate data bits received from a modem

enum State { Idle, BitStart, BitData, BitParity, BitStop, UARTError, }

State

UART state enumeration

enum Error { EFraming, EParity, EChksum, EInvalidData, EUnknown, EStopped, ENone }

Error

UART error enumeration

 UART (State state, const NamedList& params, const char* name = 0)

UART

Constructor

Parameters:
stateThe initial state of this UART
paramsThe UART's parameters
nameThe name of this debug enabler

 ~UART ()

~UART

[virtual]

Destructor

inline State  state ()

state

[const]

Get the current state of this UART

Returns: The current state of this UART as enumeration

inline Error  error ()

error

[const]

Get the current error state of this UART, if any

Returns: The current error state of this UART as enumeration

inline int  modemType ()

modemType

[const]

Get the type of this UART's modem

Returns: The type of this UART's modem

inline const BitAccumulator&  accumulator ()

accumulator

[const]

Get the data bit accumulator used by this UART

Returns: The data bit accumulator used by this UART

void  reset (State newState = Idle)

reset

[virtual]

Reset this UART

Parameters:
newStateThe state to reset to

inline bool  demodulate (const DataBlock& data)

demodulate

Send data to the enclosed modem to be demodulated

Parameters:
dataThe data to process

Returns: False to stop processing

inline bool  modulate (DataBlock& dest, NamedList& params)

modulate

Create a buffer containing the modulated representation of a list of parameters

Parameters:
destDestination buffer
paramsThe list containing the values to be modulated

Returns: False on failure (an 'error' parameter will be set in params)

inline void  modulate (DataBlock& dest, const DataBlock& src)

modulate

Create a buffer containing the modulated representation of another one

Parameters:
destDestination buffer
srcSource buffer

bool  recvBit (bool value)

recvBit

Push a bit of data into this UART. Once a data byte is accumulated, push it back to itself

Parameters:
valueThe bit to be processed

Returns: False to stop feeding data

bool  recvByte (unsigned char data)

recvByte

[virtual]

Push a data byte into this UART

Parameters:
dataThe byte to be processed

Returns: False to stop feeding data

bool  fskStarted ()

fskStarted

[virtual]

Notification from modem that the FSK start was detected

Returns: False to stop the modem

static TokenDict s_errors[]

s_errors[]

int  idleRecvByte (unsigned char data)

idleRecvByte

[protected virtual]

Process an accumulated byte in Idle state

Parameters:
dataThe byte to process

Returns: Negative to stop, positive to change state to BitStart, 0 to continue

bool  createMsg (NamedList& params, DataBlock& data)

createMsg

[protected virtual]

Create a buffer containing the byte representation of a message to be sent

Parameters:
paramsThe list containing message parameters
dataDestination message data buffer

Returns: False on failure

bool  error (Error e)

error

[protected]

Set the error state of this UART

Parameters:
eThe error

Returns: False


Generated by: paulc on bussard on Tue Mar 8 18:42:27 2011, using kdoc 2.0a54.