A Frequency Shift Keying modem. More...
#include <yatemodem.h>
Public Types | |
enum | Type { ETSI = 0, TypeCount = 1 } |
Public Member Functions | |
FSKModem (const NamedList ¶ms, 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 [] |
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
enum Type |
Modem type enumeration
Constructor
params | Modem parameters (including modemtype) | |
uart | The UART attached to this modem |
~FSKModem | ( | ) |
Destructor
static void addRaw | ( | DataBlock & | dest, | |
void * | buf, | |||
unsigned int | len | |||
) | [inline, static] |
Append a raw buffer to a data block
dest | Destination buffer | |
buf | Buffer to append to destination | |
len | the 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
data | The data to process |
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
dest | Destination buffer | |
data | Message 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
int type | ( | ) | const [inline] |
Get the type of this modem
TokenDict s_typeName[] [static] |
Keep the modem type names. Useful to configure the modem