Interface for error correction code implementations.
More...
#include <errorcorrectioncode.h>
|
virtual | ~ErrorCorrectionCode ()=default |
|
virtual size_t | encode (const uint8_t data[], size_t dataBitSize, uint8_t buffer[], size_t bufferSize) const =0 |
| Add ecc bits to the data and write them to the buffer. More...
|
|
virtual size_t | decode (const uint8_t data[], size_t dataSize, uint8_t buffer[], size_t bufferSize) const =0 |
| Remove ecc bits from the data, corrects bit errors and write them to the buffer. More...
|
|
virtual size_t | blockBitSize (size_t messageBitSize) const =0 |
| Calculates the size of the bits which are needed to store a certain amount of bits with ecc. More...
|
|
Interface for error correction code implementations.
Definition at line 24 of file errorcorrectioncode.h.
◆ ~ErrorCorrectionCode()
virtual semf::app::ErrorCorrectionCode::~ErrorCorrectionCode |
( |
| ) |
|
|
virtualdefault |
◆ blockBitSize()
virtual size_t semf::app::ErrorCorrectionCode::blockBitSize |
( |
size_t |
messageBitSize | ) |
const |
|
pure virtual |
Calculates the size of the bits which are needed to store a certain amount of bits with ecc.
- Parameters
-
messageBitSize | Bit size of message without ecc bits. |
- Returns
- The bits which are needed to store the message bits with ecc.
◆ decode()
virtual size_t semf::app::ErrorCorrectionCode::decode |
( |
const uint8_t |
data[], |
|
|
size_t |
dataSize, |
|
|
uint8_t |
buffer[], |
|
|
size_t |
bufferSize |
|
) |
| const |
|
pure virtual |
Remove ecc bits from the data, corrects bit errors and write them to the buffer.
- Parameters
-
data | Data including ecc bits. |
dataSize | The size of data. |
buffer | Buffer for storing the corrected data without ecc bits. |
bufferSize | The size of the buffer. |
- Returns
- The number of bits that have been written into the buffer.
◆ encode()
virtual size_t semf::app::ErrorCorrectionCode::encode |
( |
const uint8_t |
data[], |
|
|
size_t |
dataBitSize, |
|
|
uint8_t |
buffer[], |
|
|
size_t |
bufferSize |
|
) |
| const |
|
pure virtual |
Add ecc bits to the data and write them to the buffer.
- Parameters
-
data | Data which should be encoded. |
dataBitSize | The size of the data. |
buffer | The buffer for storing the data including ecc bits. |
bufferSize | The size of the buffer. |
- Returns
- The number of bits that have been written into the buffer.
◆ error