|
GNU Radio's M17 Package
|
#include <stdint.h>#include <stddef.h>#include <string.h>#include <time.h>#include <math.h>Go to the source code of this file.
Classes | |
| struct | lsf_t |
| Structure holding Link Setup Frame data. More... | |
Enumerations | |
| enum | pream_t { PREAM_LSF , PREAM_BERT } |
| Preamble type (0 for LSF, 1 for BERT). More... | |
| enum | frame_t { FRAME_LSF , FRAME_STR , FRAME_PKT , FRAME_BERT } |
| Frame type (0 - LSF, 1 - stream, 2 - packet, 3 - BERT). More... | |
Functions | |
| void | gen_preamble (float out[SYM_PER_FRA], uint32_t *cnt, pream_t type) |
| void | gen_preamble_i8 (int8_t out[SYM_PER_FRA], uint32_t *cnt, pream_t type) |
| void | gen_syncword (float out[SYM_PER_SWD], uint32_t *cnt, uint16_t syncword) |
| void | gen_syncword_i8 (int8_t out[SYM_PER_SWD], uint32_t *cnt, uint16_t syncword) |
| void | gen_data (float out[SYM_PER_PLD], uint32_t *cnt, const uint8_t *in) |
| void | gen_data_i8 (int8_t out[SYM_PER_PLD], uint32_t *cnt, const uint8_t *in) |
| void | gen_eot (float out[SYM_PER_FRA], uint32_t *cnt) |
| void | gen_eot_i8 (int8_t out[SYM_PER_FRA], uint32_t *cnt) |
| void | gen_frame (float out[SYM_PER_FRA], const uint8_t *data, frame_t type, const lsf_t *lsf, uint8_t lich_cnt, uint16_t fn) |
| void | gen_frame_i8 (int8_t out[SYM_PER_FRA], const uint8_t *data, frame_t type, const lsf_t *lsf, uint8_t lich_cnt, uint16_t fn) |
| uint32_t | decode_LSF (lsf_t *lsf, const float pld_symbs[SYM_PER_PLD]) |
| uint32_t | decode_str_frame (uint8_t frame_data[16], uint8_t lich[5], uint16_t *fn, uint8_t *lich_cnt, const float pld_symbs[SYM_PER_PLD]) |
| uint32_t | decode_pkt_frame (uint8_t frame_data[25], uint8_t *eof, uint8_t *fn, const float pld_symbs[SYM_PER_PLD]) |
| void | conv_encode_stream_frame (uint8_t *out, const uint8_t *in, uint16_t fn) |
| void | conv_encode_packet_frame (uint8_t out[SYM_PER_PLD *2], const uint8_t in[26]) |
| void | conv_encode_LSF (uint8_t out[SYM_PER_PLD *2], const lsf_t *in) |
| void | conv_encode_bert_frame (uint8_t out[SYM_PER_PLD *2], const uint8_t in[25]) |
| void | decode_callsign_bytes (uint8_t *outp, const uint8_t inp[6]) |
| void | decode_callsign_value (uint8_t *outp, uint64_t inp) |
| int8_t | encode_callsign_bytes (uint8_t out[6], const uint8_t *inp) |
| int8_t | encode_callsign_value (uint64_t *out, const uint8_t *inp) |
| uint16_t | CRC_M17 (const uint8_t *in, uint16_t len) |
| uint16_t | LSF_CRC (const lsf_t *in) |
| void | extract_LICH (uint8_t outp[6], uint8_t cnt, const lsf_t *inp) |
| void | unpack_LICH (uint8_t *out, const uint8_t in[12]) |
| void | update_LSF_CRC (lsf_t *lsf) |
| void | set_LSF (lsf_t *lsf, char *src, char *dst, uint16_t type, uint8_t meta[14]) |
| void | set_LSF_meta (lsf_t *lsf, const uint8_t meta[14]) |
| void | set_LSF_meta_position (lsf_t *lsf, uint8_t data_source, uint8_t station_type, float lat, float lon, uint8_t flags, int32_t altitude, uint16_t bearing, uint8_t speed) |
| void | set_LSF_meta_ecd (lsf_t *lsf, const char *cf1, const char *cf2) |
| void | set_LSF_meta_nonce (lsf_t *lsf, time_t ts, const uint8_t rand[10]) |
| int8_t | get_LSF_meta_position (uint8_t *data_source, uint8_t *station_type, float *lat, float *lon, uint8_t *flags, int32_t *altitude, uint16_t *bearing, uint8_t *speed, const lsf_t *lsf) |
| uint32_t | golay24_encode (uint16_t data) |
| uint16_t | golay24_sdecode (const uint16_t codeword[24]) |
| void | decode_LICH (uint8_t outp[6], const uint16_t inp[96]) |
| void | encode_LICH (uint8_t outp[12], const uint8_t inp[6]) |
| void | reorder_bits (uint8_t outp[SYM_PER_PLD *2], const uint8_t inp[SYM_PER_PLD *2]) |
| void | reorder_soft_bits (uint16_t outp[SYM_PER_PLD *2], const uint16_t inp[SYM_PER_PLD *2]) |
| uint16_t | q_abs_diff (uint16_t v1, uint16_t v2) |
| float | eucl_norm (const float *in1, const int8_t *in2, uint8_t n) |
| void | int_to_soft (uint16_t *out, uint16_t in, uint8_t len) |
| uint16_t | soft_to_int (const uint16_t *in, uint8_t len) |
| uint16_t | div16 (uint16_t a, uint16_t b) |
| uint16_t | mul16 (uint16_t a, uint16_t b) |
| uint16_t | soft_bit_XOR (uint16_t a, uint16_t b) |
| uint16_t | soft_bit_NOT (uint16_t a) |
| void | soft_XOR (uint16_t *out, const uint16_t *a, const uint16_t *b, uint8_t len) |
| void | randomize_bits (uint8_t inp[SYM_PER_PLD *2]) |
| void | randomize_soft_bits (uint16_t inp[SYM_PER_PLD *2]) |
| void | slice_symbols (uint16_t out[2 *SYM_PER_PLD], const float inp[SYM_PER_PLD]) |
| uint32_t | viterbi_decode (uint8_t *out, const uint16_t *in, uint16_t len) |
| uint32_t | viterbi_decode_punctured (uint8_t *out, const uint16_t *in, const uint8_t *punct, uint16_t in_len, uint16_t p_len) |
| void | viterbi_decode_bit (uint16_t s0, uint16_t s1, size_t pos) |
| uint32_t | viterbi_chainback (uint8_t *out, size_t pos, uint16_t len) |
| void | viterbi_reset (void) |
Variables | |
| const uint8_t | puncture_pattern_1 [61] |
| const uint8_t | puncture_pattern_2 [12] |
| const uint8_t | puncture_pattern_3 [8] |
| const uint16_t | M17_CRC_POLY |
| const uint16_t | encode_matrix [12] |
| const uint16_t | decode_matrix [12] |
| const uint16_t | intrl_seq [SYM_PER_PLD *2] |
| const uint8_t | rand_seq [46] |
| const float | rrc_taps_10 [8 *10+1] |
| const float | rrc_taps_5 [8 *5+1] |
| const int8_t | symbol_map [4] |
| const int8_t | symbol_list [4] |
| const uint16_t | SYNC_LSF |
| const uint16_t | SYNC_STR |
| const uint16_t | SYNC_PKT |
| const uint16_t | SYNC_BER |
| const uint16_t | EOT_MRKR |
| const int8_t | eot_symbols [8] |
| const int8_t | lsf_sync_symbols [8] |
| const int8_t | str_sync_symbols [8] |
| const int8_t | pkt_sync_symbols [8] |
| #define CHAR_MAP " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-/." |
| #define LIBM17_VERSION "1.0.9" |
| #define M17_CONVOL_K 5 |
| #define M17_CONVOL_STATES (1 << (M17_CONVOL_K - 1)) |
| #define M17_META_ALT_DATA_INVALID (0<<2) |
| #define M17_META_ALT_DATA_VALID (1<<2) |
| #define M17_META_LAT_NORTH (0<<0) |
| #define M17_META_LAT_SOUTH (1<<0) |
| #define M17_META_LON_EAST (0<<1) |
| #define M17_META_LON_WEST (1<<1) |
| #define M17_META_SOURCE_M17C 0 |
| #define M17_META_SOURCE_M17C 0 |
| #define M17_META_SOURCE_OPENRTX 1 |
| #define M17_META_SOURCE_OTHER 255 |
| #define M17_META_SPD_BEARING_INVALID (0<<3) |
| #define M17_META_SPD_BEARING_VALID (1<<3) |
| #define M17_META_STATION_FIXED 0 |
| #define M17_META_STATION_HANDHELD 2 |
| #define M17_META_STATION_MOBILE 1 |
| #define M17_TYPE_CAN | ( | x | ) |
| #define M17_TYPE_DATA (1<<1) |
| #define M17_TYPE_ENCR_AES (2<<3) |
| #define M17_TYPE_ENCR_AES128 (0<<5) |
| #define M17_TYPE_ENCR_AES192 (1<<5) |
| #define M17_TYPE_ENCR_AES256 (2<<5) |
| #define M17_TYPE_ENCR_NONE (0<<3) |
| #define M17_TYPE_ENCR_SCRAM (1<<3) |
| #define M17_TYPE_ENCR_SCRAM_16 (1<<5) |
| #define M17_TYPE_ENCR_SCRAM_24 (2<<5) |
| #define M17_TYPE_ENCR_SCRAM_8 (0<<5) |
| #define M17_TYPE_META_EXT_CALL (2<<5) |
| #define M17_TYPE_META_POSITION (1<<5) |
| #define M17_TYPE_META_TEXT (0<<5) |
| #define M17_TYPE_PACKET 0 |
| #define M17_TYPE_SIGNED (1<<11) |
| #define M17_TYPE_STREAM 1 |
| #define M17_TYPE_UNSIGNED (0<<11) |
| #define M17_TYPE_VOICE (2<<1) |
| #define SYM_PER_FRA 192 |
Referenced by gen_eot(), gen_eot_i8(), gen_frame(), gen_frame_i8(), gen_preamble(), and gen_preamble_i8().
| #define SYM_PER_PLD 184 |
| #define SYM_PER_SWD 8 |
Referenced by gen_syncword(), and gen_syncword_i8().
| #define U40_9 (262144000000000ULL) |
| #define U40_9_8 (268697600000000ULL) |
| enum frame_t |
| enum pream_t |
| void conv_encode_bert_frame | ( | uint8_t | out[SYM_PER_PLD *2], |
| const uint8_t | in[25] ) |
References SYM_PER_PLD.
| void conv_encode_LSF | ( | uint8_t | out[SYM_PER_PLD *2], |
| const lsf_t * | in ) |
References SYM_PER_PLD.
| void conv_encode_packet_frame | ( | uint8_t | out[SYM_PER_PLD *2], |
| const uint8_t | in[26] ) |
References SYM_PER_PLD.
| void conv_encode_stream_frame | ( | uint8_t * | out, |
| const uint8_t * | in, | ||
| uint16_t | fn ) |
| uint16_t CRC_M17 | ( | const uint8_t * | in, |
| uint16_t | len ) |
| void decode_callsign_bytes | ( | uint8_t * | outp, |
| const uint8_t | inp[6] ) |
| void decode_callsign_value | ( | uint8_t * | outp, |
| uint64_t | inp ) |
| void decode_LICH | ( | uint8_t | outp[6], |
| const uint16_t | inp[96] ) |
| uint32_t decode_LSF | ( | lsf_t * | lsf, |
| const float | pld_symbs[SYM_PER_PLD] ) |
References SYM_PER_PLD.
| uint32_t decode_pkt_frame | ( | uint8_t | frame_data[25], |
| uint8_t * | eof, | ||
| uint8_t * | fn, | ||
| const float | pld_symbs[SYM_PER_PLD] ) |
References puncture_pattern_1, puncture_pattern_2, puncture_pattern_3, and SYM_PER_PLD.
| uint32_t decode_str_frame | ( | uint8_t | frame_data[16], |
| uint8_t | lich[5], | ||
| uint16_t * | fn, | ||
| uint8_t * | lich_cnt, | ||
| const float | pld_symbs[SYM_PER_PLD] ) |
References SYM_PER_PLD.
| uint16_t div16 | ( | uint16_t | a, |
| uint16_t | b ) |
| int8_t encode_callsign_bytes | ( | uint8_t | out[6], |
| const uint8_t * | inp ) |
| int8_t encode_callsign_value | ( | uint64_t * | out, |
| const uint8_t * | inp ) |
References M17_CRC_POLY.
| void encode_LICH | ( | uint8_t | outp[12], |
| const uint8_t | inp[6] ) |
References intrl_seq, and SYM_PER_PLD.
| float eucl_norm | ( | const float * | in1, |
| const int8_t * | in2, | ||
| uint8_t | n ) |
| void extract_LICH | ( | uint8_t | outp[6], |
| uint8_t | cnt, | ||
| const lsf_t * | inp ) |
| void gen_data | ( | float | out[SYM_PER_PLD], |
| uint32_t * | cnt, | ||
| const uint8_t * | in ) |
References SYM_PER_PLD.
| void gen_data_i8 | ( | int8_t | out[SYM_PER_PLD], |
| uint32_t * | cnt, | ||
| const uint8_t * | in ) |
References SYM_PER_PLD.
| void gen_eot | ( | float | out[SYM_PER_FRA], |
| uint32_t * | cnt ) |
References SYM_PER_FRA.
| void gen_eot_i8 | ( | int8_t | out[SYM_PER_FRA], |
| uint32_t * | cnt ) |
References SYM_PER_FRA.
| void gen_frame | ( | float | out[SYM_PER_FRA], |
| const uint8_t * | data, | ||
| frame_t | type, | ||
| const lsf_t * | lsf, | ||
| uint8_t | lich_cnt, | ||
| uint16_t | fn ) |
References SYM_PER_FRA.
| void gen_frame_i8 | ( | int8_t | out[SYM_PER_FRA], |
| const uint8_t * | data, | ||
| frame_t | type, | ||
| const lsf_t * | lsf, | ||
| uint8_t | lich_cnt, | ||
| uint16_t | fn ) |
References SYM_PER_FRA.
| void gen_preamble | ( | float | out[SYM_PER_FRA], |
| uint32_t * | cnt, | ||
| pream_t | type ) |
References SYM_PER_FRA.
| void gen_preamble_i8 | ( | int8_t | out[SYM_PER_FRA], |
| uint32_t * | cnt, | ||
| pream_t | type ) |
References SYM_PER_FRA.
| void gen_syncword | ( | float | out[SYM_PER_SWD], |
| uint32_t * | cnt, | ||
| uint16_t | syncword ) |
References SYM_PER_SWD.
| void gen_syncword_i8 | ( | int8_t | out[SYM_PER_SWD], |
| uint32_t * | cnt, | ||
| uint16_t | syncword ) |
References SYM_PER_SWD.
| int8_t get_LSF_meta_position | ( | uint8_t * | data_source, |
| uint8_t * | station_type, | ||
| float * | lat, | ||
| float * | lon, | ||
| uint8_t * | flags, | ||
| int32_t * | altitude, | ||
| uint16_t * | bearing, | ||
| uint8_t * | speed, | ||
| const lsf_t * | lsf ) |
References decode_matrix, and encode_matrix.
| uint32_t golay24_encode | ( | uint16_t | data | ) |
| uint16_t golay24_sdecode | ( | const uint16_t | codeword[24] | ) |
| void int_to_soft | ( | uint16_t * | out, |
| uint16_t | in, | ||
| uint8_t | len ) |
| uint16_t LSF_CRC | ( | const lsf_t * | in | ) |
| uint16_t mul16 | ( | uint16_t | a, |
| uint16_t | b ) |
| uint16_t q_abs_diff | ( | uint16_t | v1, |
| uint16_t | v2 ) |
| void randomize_bits | ( | uint8_t | inp[SYM_PER_PLD *2] | ) |
References SYM_PER_PLD.
| void randomize_soft_bits | ( | uint16_t | inp[SYM_PER_PLD *2] | ) |
References SYM_PER_PLD.
| void reorder_bits | ( | uint8_t | outp[SYM_PER_PLD *2], |
| const uint8_t | inp[SYM_PER_PLD *2] ) |
References SYM_PER_PLD.
| void reorder_soft_bits | ( | uint16_t | outp[SYM_PER_PLD *2], |
| const uint16_t | inp[SYM_PER_PLD *2] ) |
References SYM_PER_PLD.
| void set_LSF | ( | lsf_t * | lsf, |
| char * | src, | ||
| char * | dst, | ||
| uint16_t | type, | ||
| uint8_t | meta[14] ) |
| void set_LSF_meta | ( | lsf_t * | lsf, |
| const uint8_t | meta[14] ) |
| void set_LSF_meta_ecd | ( | lsf_t * | lsf, |
| const char * | cf1, | ||
| const char * | cf2 ) |
| void set_LSF_meta_nonce | ( | lsf_t * | lsf, |
| time_t | ts, | ||
| const uint8_t | rand[10] ) |
| void set_LSF_meta_position | ( | lsf_t * | lsf, |
| uint8_t | data_source, | ||
| uint8_t | station_type, | ||
| float | lat, | ||
| float | lon, | ||
| uint8_t | flags, | ||
| int32_t | altitude, | ||
| uint16_t | bearing, | ||
| uint8_t | speed ) |
| void slice_symbols | ( | uint16_t | out[2 *SYM_PER_PLD], |
| const float | inp[SYM_PER_PLD] ) |
References EOT_MRKR, rrc_taps_10, rrc_taps_5, SYM_PER_PLD, symbol_list, symbol_map, SYNC_BER, SYNC_LSF, SYNC_PKT, and SYNC_STR.
| uint16_t soft_bit_NOT | ( | uint16_t | a | ) |
| uint16_t soft_bit_XOR | ( | uint16_t | a, |
| uint16_t | b ) |
| uint16_t soft_to_int | ( | const uint16_t * | in, |
| uint8_t | len ) |
| void soft_XOR | ( | uint16_t * | out, |
| const uint16_t * | a, | ||
| const uint16_t * | b, | ||
| uint8_t | len ) |
References rand_seq.
| void unpack_LICH | ( | uint8_t * | out, |
| const uint8_t | in[12] ) |
| void update_LSF_CRC | ( | lsf_t * | lsf | ) |
| uint32_t viterbi_chainback | ( | uint8_t * | out, |
| size_t | pos, | ||
| uint16_t | len ) |
| uint32_t viterbi_decode | ( | uint8_t * | out, |
| const uint16_t * | in, | ||
| uint16_t | len ) |
| void viterbi_decode_bit | ( | uint16_t | s0, |
| uint16_t | s1, | ||
| size_t | pos ) |
| uint32_t viterbi_decode_punctured | ( | uint8_t * | out, |
| const uint16_t * | in, | ||
| const uint8_t * | punct, | ||
| uint16_t | in_len, | ||
| uint16_t | p_len ) |
| void viterbi_reset | ( | void | ) |
References eot_symbols, lsf_sync_symbols, pkt_sync_symbols, and str_sync_symbols.
|
extern |
Referenced by get_LSF_meta_position().
|
extern |
Referenced by get_LSF_meta_position().
|
extern |
Referenced by slice_symbols().
|
extern |
Referenced by viterbi_reset().
|
extern |
Referenced by encode_LICH().
|
extern |
Referenced by viterbi_reset().
|
extern |
Referenced by encode_callsign_value().
|
extern |
Referenced by viterbi_reset().
|
extern |
Referenced by decode_pkt_frame().
|
extern |
Referenced by decode_pkt_frame().
|
extern |
Referenced by decode_pkt_frame().
|
extern |
Referenced by soft_XOR().
|
extern |
Referenced by slice_symbols().
|
extern |
Referenced by slice_symbols().
|
extern |
Referenced by viterbi_reset().
|
extern |
Referenced by slice_symbols().
|
extern |
Referenced by slice_symbols().
|
extern |
Referenced by slice_symbols().
|
extern |
Referenced by slice_symbols().
|
extern |
Referenced by slice_symbols().
|
extern |
Referenced by slice_symbols().