Yate
FSKModem Class Reference

A Frequency Shift Keying modem. More...

#include <yatemodem.h>

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

◆ Type

enum Type

Modem type enumeration

Constructor & Destructor Documentation

◆ FSKModem()

FSKModem ( const NamedList & params,
UART * uart )

Constructor

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

◆ ~FSKModem()

~FSKModem ( )

Destructor

Member Function Documentation

◆ addRaw()

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

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().

◆ demodulate()

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)

◆ modulate()

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)

◆ reset()

void reset ( )

Reset modem to its initial state

◆ terminated()

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

◆ type()

int type ( ) const
inline

Get the type of this modem

Returns
The modem type

Member Data Documentation

◆ s_typeName

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: