GNU Radio's DSD Package
p25p1_check_hdu.h
Go to the documentation of this file.
1
2#ifndef P25P1_CHECK_HDU_H_f5f079faf2d64cf5831e1da1ab83b9ba
3#define P25P1_CHECK_HDU_H_f5f079faf2d64cf5831e1da1ab83b9ba
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9/**
10 * Attempts to correct an hex (6-bit) word using the Golay(24,12,8) FEC.
11 * \param hex The 6-bit word to error correct, given as a char array of 6 elements, one bit each.
12 * \param parity A 12-bit word with the Golay parity data, given as a char array of 12 elements.
13 * \param fixed_error Output. Filled with the number of errors fixed in the input.
14 * \return 1 if there were uncorrectable errors in the input, 0 otherwise.
15 */
16int check_and_fix_golay_24_6(char* hex, char* parity, int* fixed_errors);
17
18/**
19 * Attempts to correct a 12-bit word using the Golay(24,12,8) FEC.
20 * \param dodeca The 12-bit word to error correct, given as a char array of 12 elements, one bit each.
21 * \param parity A 12-bit word with the Golay parity data, given as a char array of 12 elements.
22 * \param fixed_error Output. Filled with the number of errors fixed in the input.
23 * \return 1 if there were uncorrectable errors in the input, 0 otherwise.
24 */
25int check_and_fix_golay_24_12(char* dodeca, char* parity, int* fixed_errors);
26
27/**
28 * Encodes an hex word using the Golay(24,12,8) FEC.
29 * \param hex A 6-bit word to encode.
30 * \param out_parity The address to be filled with the calculated Golay parity.
31 */
32void encode_golay_24_6(char* hex, char* out_parity);
33
34/**
35 * Encodes an 12-bitword using the Golay(24,12,8) FEC.
36 * \param dodeca A 12-bit word to encode.
37 * \param out_parity The address to be filled with the calculated Golay parity.
38 */
39void encode_golay_24_12(char* dodeca, char* out_parity);
40
41/**
42 * Attempts to correct 20 hex words using the Reed-Solomon(36,20,17) FEC.
43 * \param data The packed hex words, each of 6 chars, one after the other.
44 * \param parity The corresponding 16 hex words with the parity information.
45 * \return 1 if irrecoverable errors have been detected, 0 otherwise.
46 */
47int check_and_fix_redsolomon_36_20_17(char* data, char* parity);
48
49/**
50 * Calculates the Reed-Solomon parity of 20 words of 6 bits each.
51 * \param hex_data The address with the words whose parity we want to calculate.
52 * \param fixed_parity The address to be filled with the calculated parity. 16 words of 6 bits are produced.
53 */
54void encode_reedsolomon_36_20_17(char* hex_data, char* fixed_parity);
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif // P25P1_CHECK_HDU_H_f5f079faf2d64cf5831e1da1ab83b9ba
int check_and_fix_redsolomon_36_20_17(char *data, char *parity)
void encode_golay_24_12(char *dodeca, char *out_parity)
void encode_reedsolomon_36_20_17(char *hex_data, char *fixed_parity)
int check_and_fix_golay_24_6(char *hex, char *parity, int *fixed_errors)
int check_and_fix_golay_24_12(char *dodeca, char *parity, int *fixed_errors)
void encode_golay_24_6(char *hex, char *out_parity)