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

Caller-ID (USA SDMF/MDMF) decoder. See http://melabs.com/resources/callerid.htm. More...

#include <DataCodecs.h>

Inheritance diagram for tinymodem::CallerIDCodec:
Collaboration diagram for tinymodem::CallerIDCodec:

Public Member Functions

void reset () override
 resets the internal state (called when the carrier is acquired)
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
virtual int encode (uint32_t words[2], uint8_t ch)
 Converts a character into 0, 1 or 2 data words: returns the count.

Protected Member Functions

size_t decodeMDMF (Print &out)
size_t decodeSDMF (Print &out)

Static Protected Member Functions

static const char * typeName (unsigned type)
static size_t printFmt (Print &out, const char *fmt,...)
static size_t printPhone (Print &out, const uint8_t *m)
static size_t printDateTime (Print &out, const uint8_t *m)

Protected Attributes

unsigned msg_type = 0
unsigned ndata = 0
uint8_t buf [256]

Static Protected Attributes

static constexpr uint8_t MSG_MDMF = 0x80
static constexpr uint8_t MSG_SDMF = 0x04
static constexpr uint8_t DATA_DATETIME = 0x01
static constexpr uint8_t DATA_PHONE = 0x02
static constexpr uint8_t DATA_PHONE_NA = 0x04
static constexpr uint8_t DATA_NAME = 0x07
static constexpr uint8_t DATA_NAME_NA = 0x08

Detailed Description

Caller-ID (USA SDMF/MDMF) decoder. See http://melabs.com/resources/callerid.htm.

Member Function Documentation

◆ decode()

size_t tinymodem::CallerIDCodec::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.

◆ decodeMDMF()

size_t tinymodem::CallerIDCodec::decodeMDMF ( Print & out)
inlineprotected

◆ decodeSDMF()

size_t tinymodem::CallerIDCodec::decodeSDMF ( Print & out)
inlineprotected

◆ printDateTime()

size_t tinymodem::CallerIDCodec::printDateTime ( Print & out,
const uint8_t * m )
inlinestaticprotected

◆ printFmt()

size_t tinymodem::CallerIDCodec::printFmt ( Print & out,
const char * fmt,
... )
inlinestaticprotected

◆ printPhone()

size_t tinymodem::CallerIDCodec::printPhone ( Print & out,
const uint8_t * m )
inlinestaticprotected

◆ reset()

void tinymodem::CallerIDCodec::reset ( )
inlineoverridevirtual

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

Reimplemented from tinymodem::DataCodec.

◆ typeName()

const char * tinymodem::CallerIDCodec::typeName ( unsigned type)
inlinestaticprotected

Member Data Documentation

◆ buf

uint8_t tinymodem::CallerIDCodec::buf[256]
protected

◆ DATA_DATETIME

uint8_t tinymodem::CallerIDCodec::DATA_DATETIME = 0x01
staticconstexprprotected

◆ DATA_NAME

uint8_t tinymodem::CallerIDCodec::DATA_NAME = 0x07
staticconstexprprotected

◆ DATA_NAME_NA

uint8_t tinymodem::CallerIDCodec::DATA_NAME_NA = 0x08
staticconstexprprotected

◆ DATA_PHONE

uint8_t tinymodem::CallerIDCodec::DATA_PHONE = 0x02
staticconstexprprotected

◆ DATA_PHONE_NA

uint8_t tinymodem::CallerIDCodec::DATA_PHONE_NA = 0x04
staticconstexprprotected

◆ MSG_MDMF

uint8_t tinymodem::CallerIDCodec::MSG_MDMF = 0x80
staticconstexprprotected

◆ MSG_SDMF

uint8_t tinymodem::CallerIDCodec::MSG_SDMF = 0x04
staticconstexprprotected

◆ msg_type

unsigned tinymodem::CallerIDCodec::msg_type = 0
protected

◆ ndata

unsigned tinymodem::CallerIDCodec::ndata = 0
protected

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