Loading...
Searching...
No Matches
repetition.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2007-2015 Joseph Gaeddert
3 * SPDX-FileCopyrightText: 2018 HAW Hamburg
4 * SPDX-License-Identifier: MIT
5 */
6
7#pragma once
8
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
25#ifndef ECC_REPETITION_COUNT
26#define ECC_REPETITION_COUNT (3)
27#endif
28
30#define DECODER_MAJORITY ((ECC_REPETITION_COUNT - 1) / 2)
31
39void repetition_encode(unsigned int _dec_msg_len,
40 unsigned char *_msg_dec,
41 unsigned char *_msg_enc);
42
50void repetition_decode(unsigned int _dec_msg_len,
51 unsigned char *_msg_enc,
52 unsigned char *_msg_dec);
53
54#ifdef __cplusplus
55}
56#endif
57
void repetition_encode(unsigned int _dec_msg_len, unsigned char *_msg_dec, unsigned char *_msg_enc)
encode block of data with ECC_REPETITION_COUNT number of repetitions
void repetition_decode(unsigned int _dec_msg_len, unsigned char *_msg_enc, unsigned char *_msg_dec)
decode block of data with ECC_REPETITION_COUNT repetitions