TinyModem
Header-only software audio modem library
Loading...
Searching...
No Matches
tinymodem::BaudotCodec Class Reference

Baudot (ITA2) 5-bit data. More...

#include <DataCodecs.h>

Inheritance diagram for tinymodem::BaudotCodec:
Collaboration diagram for tinymodem::BaudotCodec:

Public Member Functions

void setUSOS (bool usos)
 Unshift on space.
void reset () override
 resets the internal state (called when the carrier is acquired)
void resetShift ()
int encode (uint32_t words[2], uint8_t ch) override
 Converts a character into 0, 1 or 2 data words: returns the count.
size_t decode (Print &out, uint64_t bits, unsigned) override
 Decodes the data bits of a frame: returns the number of written bytes.
Public Member Functions inherited from tinymodem::DataCodec
virtual ~DataCodec ()=default

Static Protected Member Functions

static const char * decodeTable (uint8_t idx)
 letter, U.S. figs, CCITT No.2 figs (Europe)
static const uint8_t * encodeTable (uint8_t idx)
 index: ascii char; values: bits, ltrs(1) or figs(2) or both(3)

Protected Attributes

unsigned charset = 0
 0 unknown, 1 LTRS, 2 FIGS
bool usos = true

Static Protected Attributes

static constexpr uint8_t LTRS = 0x1F
static constexpr uint8_t FIGS = 0x1B
static constexpr uint8_t SPACE = 0x04

Detailed Description

Baudot (ITA2) 5-bit data.

Member Function Documentation

◆ decode()

size_t tinymodem::BaudotCodec::decode ( Print & out,
uint64_t bits,
unsigned n_bits )
inlineoverridevirtual

Decodes the data bits of a frame: returns the number of written bytes.

Implements tinymodem::DataCodec.

◆ decodeTable()

const char * tinymodem::BaudotCodec::decodeTable ( uint8_t idx)
inlinestaticprotected

letter, U.S. figs, CCITT No.2 figs (Europe)

◆ encode()

int tinymodem::BaudotCodec::encode ( uint32_t words[2],
uint8_t ch )
inlineoverridevirtual

Converts a character into 0, 1 or 2 data words: returns the count.

Reimplemented from tinymodem::DataCodec.

◆ encodeTable()

const uint8_t * tinymodem::BaudotCodec::encodeTable ( uint8_t idx)
inlinestaticprotected

index: ascii char; values: bits, ltrs(1) or figs(2) or both(3)

◆ reset()

void tinymodem::BaudotCodec::reset ( )
inlineoverridevirtual

resets the internal state (called when the carrier is acquired)

Reimplemented from tinymodem::DataCodec.

◆ resetShift()

void tinymodem::BaudotCodec::resetShift ( )
inline

Forgets the shift state, so that the next encoded character is preceded by a LTRS or FIGS code (call at the start of each transmission)

◆ setUSOS()

void tinymodem::BaudotCodec::setUSOS ( bool usos)
inline

Unshift on space.

Member Data Documentation

◆ charset

unsigned tinymodem::BaudotCodec::charset = 0
protected

0 unknown, 1 LTRS, 2 FIGS

◆ FIGS

uint8_t tinymodem::BaudotCodec::FIGS = 0x1B
staticconstexprprotected

◆ LTRS

uint8_t tinymodem::BaudotCodec::LTRS = 0x1F
staticconstexprprotected

◆ SPACE

uint8_t tinymodem::BaudotCodec::SPACE = 0x04
staticconstexprprotected

◆ usos

bool tinymodem::BaudotCodec::usos = true
protected

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