Menu

famouso::mw::afp::frag::UseFEC< FCP > Class Template Reference

Fragmentation with forward error correction. More...

#include <UseFEC.h>

Public Types

enum  { header_length = sizeof(Header1001) }
 

Length of the generated header.

More...

Public Member Functions

 UseFEC ()
 Constructor.
 ~UseFEC ()
 Destructor.
void init (elen_t event_length, flen_t payload_length, fcount_t k)
 Initialization. Has to be called immediately after construction.
void get_header (uint8_t *data, bool more_headers)
 Write header.
void put_nonred_fragment (const uint8_t *data)
 Give payload data of message fragment to FEC data constructor.
void put_smaller_nonred_fragment (const uint8_t *data, flen_t length)
 Give payload data of last message fragment to FEC data collector. This fragment may be shorter than payload_length bytes.
void get_red_fragment (uint8_t *data)
 Get redundancy fragment payload data.

Static Public Member Functions

static fcount_t k2n (fcount_t k)
 Calculate total number of fragments (data + redundancy).

Detailed Description

template<class FCP>
class famouso::mw::afp::frag::UseFEC< FCP >

Fragmentation with forward error correction.

Currently not supported on AVR platform.

TODO Error handling (new), allocator


Member Enumeration Documentation

template<class FCP >
anonymous enum

Length of the generated header.

Enumerator:
header_length 

Constructor & Destructor Documentation

template<class FCP >
famouso::mw::afp::frag::UseFEC< FCP >::UseFEC (  )  [inline]

Constructor.

template<class FCP >
famouso::mw::afp::frag::UseFEC< FCP >::~UseFEC (  )  [inline]

Destructor.


Member Function Documentation

template<class FCP >
void famouso::mw::afp::frag::UseFEC< FCP >::get_header ( uint8_t *  data,
bool  more_headers 
) [inline]

Write header.

Parameters:
data Buffer to write header to
more_headers True if there will be another header behind this one

Referenced by famouso::mw::afp::frag::FECFragmenter< FCP >::get_fragment().

template<class FCP >
void famouso::mw::afp::frag::UseFEC< FCP >::get_red_fragment ( uint8_t *  data  )  [inline]

Get redundancy fragment payload data.

Parameters:
data Pointer to buffer to fill with data.

References FAMOUSO_ASSERT.

Referenced by famouso::mw::afp::frag::FECFragmenter< FCP >::get_fragment().

template<class FCP >
void famouso::mw::afp::frag::UseFEC< FCP >::init ( elen_t  event_length,
flen_t  payload_length,
fcount_t  k 
) [inline]

Initialization. Has to be called immediately after construction.

Parameters:
event_length Length of the event data
payload_length Maximum length of payload
k Count of data fragments

References FAMOUSO_ASSERT, and famouso::mw::afp::frag::UseFEC< FCP >::k2n().

Referenced by famouso::mw::afp::frag::FECFragmenter< FCP >::init().

template<class FCP >
static fcount_t famouso::mw::afp::frag::UseFEC< FCP >::k2n ( fcount_t  k  )  [inline, static]

Calculate total number of fragments (data + redundancy).

Parameters:
k Number of data fragments
Returns:
Total number of fragments

Referenced by famouso::mw::afp::frag::UseFEC< FCP >::init(), and famouso::mw::afp::frag::FECFragmenter< FCP >::init().

template<class FCP >
void famouso::mw::afp::frag::UseFEC< FCP >::put_nonred_fragment ( const uint8_t *  data  )  [inline]

Give payload data of message fragment to FEC data constructor.

Parameters:
data Pointer to fragment payload. Has to stay valid as long as get_red_fragment() may be called.

References FAMOUSO_ASSERT.

Referenced by famouso::mw::afp::frag::FECFragmenter< FCP >::get_fragment().

template<class FCP >
void famouso::mw::afp::frag::UseFEC< FCP >::put_smaller_nonred_fragment ( const uint8_t *  data,
flen_t  length 
) [inline]

Give payload data of last message fragment to FEC data collector. This fragment may be shorter than payload_length bytes.

Parameters:
data Pointer to fragment payload. Has to stay valid as long as get_red_fragment() may be called.
length Length of data.

References FAMOUSO_ASSERT.

Referenced by famouso::mw::afp::frag::FECFragmenter< FCP >::get_fragment().


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