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

FX.25: AX.25 frames with Reed-Solomon forward error correction (as implemented by direwolf). The complete HDLC frame (flag, bit stuffed frame with FCS, flags as fill) is the data part of a Reed-Solomon code word, which is preceded by a 64 bit correlation tag that identifies the code. A receiver without FX.25 still decodes the HDLC frame in the data part. More...

#include <AX25FEC.h>

Classes

struct  Tag
 a code (correlation tag) More...

Static Public Member Functions

static const Tag & tag (int index)
 The tag 1 - 11.
static int findTag (uint64_t bits)
 Finds the tag which matches the received 64 bits: returns 0 if none.
static int pickTag (int check_bytes, int data_len)
static int encode (const uint8_t *frame, int len, int check_bytes, uint8_t *block, int &block_len)
static int correct (int t, uint8_t *received)
static int extract (const uint8_t *data, int len, uint8_t *frame, int frame_size)

Static Public Attributes

static constexpr int BLOCK_SIZE = 255
static constexpr int MAX_DATA = 239
static constexpr int FIRST_TAG = 1
static constexpr int LAST_TAG = 11
static constexpr int TAG_TOLERANCE = 8
 max number of wrong bits in a received tag

Static Protected Member Functions

static int popcount (uint64_t v)
static int stuff (const uint8_t *frame, int len, uint8_t *out, int size)

Detailed Description

FX.25: AX.25 frames with Reed-Solomon forward error correction (as implemented by direwolf). The complete HDLC frame (flag, bit stuffed frame with FCS, flags as fill) is the data part of a Reed-Solomon code word, which is preceded by a 64 bit correlation tag that identifies the code. A receiver without FX.25 still decodes the HDLC frame in the data part.

Member Function Documentation

◆ correct()

int tinymodem::FX25::correct ( int t,
uint8_t * received )
inlinestatic

Corrects the received data part and check bytes of the tag in place (data = tag.data bytes, check bytes follow): returns the number of corrected bytes or -1

◆ encode()

int tinymodem::FX25::encode ( const uint8_t * frame,
int len,
int check_bytes,
uint8_t * block,
int & block_len )
inlinestatic

Creates the code word for a frame (without FCS): block receives the data part followed by the check bytes. Returns the tag (0 if the frame is too long).

◆ extract()

int tinymodem::FX25::extract ( const uint8_t * data,
int len,
uint8_t * frame,
int frame_size )
inlinestatic

Extracts the HDLC frame from the data part: returns the frame length (without FCS) or 0 if there is no valid frame

◆ findTag()

int tinymodem::FX25::findTag ( uint64_t bits)
inlinestatic

Finds the tag which matches the received 64 bits: returns 0 if none.

◆ pickTag()

int tinymodem::FX25::pickTag ( int check_bytes,
int data_len )
inlinestatic

Smallest tag with the indicated check bytes (16, 32, 64) for the data length: returns 0 if the data is too long

◆ popcount()

int tinymodem::FX25::popcount ( uint64_t v)
inlinestaticprotected

◆ stuff()

int tinymodem::FX25::stuff ( const uint8_t * frame,
int len,
uint8_t * out,
int size )
inlinestaticprotected

HDLC frame (flag, bit stuffed frame with FCS, flag) padded with flags: returns the number of used bytes or -1 if it does not fit

◆ tag()

const Tag & tinymodem::FX25::tag ( int index)
inlinestatic

The tag 1 - 11.

Member Data Documentation

◆ BLOCK_SIZE

int tinymodem::FX25::BLOCK_SIZE = 255
staticconstexpr

◆ FIRST_TAG

int tinymodem::FX25::FIRST_TAG = 1
staticconstexpr

◆ LAST_TAG

int tinymodem::FX25::LAST_TAG = 11
staticconstexpr

◆ MAX_DATA

int tinymodem::FX25::MAX_DATA = 239
staticconstexpr

◆ TAG_TOLERANCE

int tinymodem::FX25::TAG_TOLERANCE = 8
staticconstexpr

max number of wrong bits in a received tag


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