Yate
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes

FSKModem Class Reference

A Frequency Shift Keying modem. More...

#include <yatemodem.h>

List of all members.

Public Types

enum  Type { ETSI = 0, TypeCount = 1 }

Public Member Functions

 FSKModem (const NamedList &params, UART *uart)
 ~FSKModem ()
bool terminated () const
int type () const
void reset ()
bool demodulate (const DataBlock &data)
void modulate (DataBlock &dest, const DataBlock &data)

Static Public Member Functions

static void addRaw (DataBlock &dest, void *buf, unsigned int len)

Static Public Attributes

static TokenDict s_typeName []

Detailed Description

A Frequency Shift Keying modem.

This is a modulator/demodulator class attached to an UART. Used to demodulate bits from frequency modulated signal and send them to an UART


Member Enumeration Documentation

enum Type

Modem type enumeration


Constructor & Destructor Documentation

FSKModem ( const NamedList params,
UART uart 
)

Constructor

Parameters:
paramsModem parameters (including modemtype)
uartThe UART attached to this modem
~FSKModem ( )

Destructor


Member Function Documentation

static void addRaw ( DataBlock dest,
void *  buf,
unsigned int  len 
) [inline, static]

Append a raw buffer to a data block

Parameters:
destDestination buffer
bufBuffer to append to destination
lenthe number of bytes to append starting with buf

References DataBlock::clear().

bool demodulate ( const DataBlock data)

Data processor. Demodulate received data. Feed the UART with received bits

Parameters:
dataThe data to process
Returns:
False to stop feedding data (terminated)
void modulate ( DataBlock dest,
const DataBlock data 
)

Create a buffer containing the modulated representation of a message. A data pattern (depending on modem's type) will be added before the message. A mark pattern (2ms long) will be added after the message. Reset the modem before each request to modulate

Parameters:
destDestination buffer
dataMessage data (each byte will be enclosed in start/stop/parity bits)
void reset ( )

Reset modem to its initial state

bool terminated ( ) const [inline]

Check if this modem is terminated. Need reset if so. The modem can terminate processing on UART's request

Returns:
True if this modem is terminated
int type ( ) const [inline]

Get the type of this modem

Returns:
The modem type

Member Data Documentation

TokenDict s_typeName[] [static]

Keep the modem type names. Useful to configure the modem


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