gsm0503_coding.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#include <osmocom/core/defs.h>
#include <osmocom/core/bits.h>
#define GSM0503_GPRS_BURSTS_NBITS (116 * 4)
#define GSM0503_EGPRS_BURSTS_NBITS (348 * 4)
enum gsm0503_egprs_mcs {
EGPRS_MCS0,
EGPRS_MCS1,
EGPRS_MCS2,
EGPRS_MCS3,
EGPRS_MCS4,
EGPRS_MCS5,
EGPRS_MCS6,
EGPRS_MCS7,
EGPRS_MCS8,
EGPRS_MCS9,
EGPRS_NUM_MCS,
};
int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data);
int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts,
int *n_errors, int *n_bits_total);
int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len);
int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p,
int *n_errors, int *n_bits_total);
int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data,
uint8_t l2_len);
int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts,
uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total);
int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int net_order);
int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order,
int efr, int *n_errors, int *n_bits_total);
int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len);
int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
int *n_errors, int *n_bits_total);
int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft,
uint8_t cmr);
int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total);
int gsm0503_tch_afs_decode_dtx(uint8_t *tch_data, const sbit_t *bursts,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total, uint8_t *dtx);
int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr);
int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total);
int gsm0503_tch_ahs_decode_dtx(uint8_t *tch_data, const sbit_t *bursts, int odd,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total, uint8_t *dtx);
int gsm0503_rach_ext_encode(ubit_t *burst, uint16_t ra, uint8_t bsic, bool is_11bit);
int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) OSMO_DEPRECATED("Use gsm0503_rach_ext_encode() instead");
int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic)
OSMO_DEPRECATED("Use gsm0503_rach_decode_ber() instead");
int gsm0503_rach_decode_ber(uint8_t *ra, const sbit_t *burst, uint8_t bsic,
int *n_errors, int *n_bits_total);
int gsm0503_rach_ext_decode(uint16_t *ra, const sbit_t *burst, uint8_t bsic)
OSMO_DEPRECATED("Use gsm0503_rach_ext_decode_ber() instead");
int gsm0503_rach_ext_decode_ber(uint16_t *ra, const sbit_t *burst, uint8_t bsic,
int *n_errors, int *n_bits_total);
int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info);
int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst);
bits.h
defs.h
ubit_t
uint8_t ubit_t
sbit_t
int8_t sbit_t
gsm0503_tch_afs_decode_dtx
int gsm0503_tch_afs_decode_dtx(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total, uint8_t *dtx)
Perform channel decoding of a TCH/AFS channel according TS 05.03.
Definition: gsm0503_coding.c:2157
gsm0503_xcch_encode
int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data)
Encoding of xCCH data from L2 frame to bursts.
Definition: gsm0503_coding.c:658
gsm0503_rach_ext_decode_ber
int gsm0503_rach_ext_decode_ber(uint16_t *ra, const sbit_t *burst, uint8_t bsic, int *n_errors, int *n_bits_total)
Decode the Extended (11-bit) RACH according to 3GPP TS 45.003.
Definition: gsm0503_coding.c:3104
gsm0503_xcch_decode
int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Decoding of xCCH data from bursts to L2 frame.
Definition: gsm0503_coding.c:639
gsm0503_pdtch_egprs_decode
int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total)
Decode EGPRS UL message.
Definition: gsm0503_coding.c:933
gsm0503_rach_ext_decode
int gsm0503_rach_ext_decode(uint16_t *ra, const sbit_t *burst, uint8_t bsic) OSMO_DEPRECATED("Use gsm0503_rach_ext_decode_ber() instead")
Decode the Extended (11-bit) RACH according to 3GPP TS 45.003.
Definition: gsm0503_coding.c:3070
gsm0503_rach_decode
int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic) OSMO_DEPRECATED("Use gsm0503_rach_decode_ber() instead")
Decode the (8-bit) RACH according to TS 05.03.
Definition: gsm0503_coding.c:3087
gsm0503_sch_decode
int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst)
Decode the SCH according to TS 05.03.
Definition: gsm0503_coding.c:3182
gsm0503_tch_hr_decode
int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total)
Perform channel decoding of a HR(v1) channel according TS 05.03.
Definition: gsm0503_coding.c:1991
gsm0503_tch_fr_encode
int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order)
Perform channel encoding on a TCH/FS channel according to TS 05.03.
Definition: gsm0503_coding.c:1926
gsm0503_tch_afs_decode
int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total)
Perform channel decoding of a TCH/AFS channel according TS 05.03.
Definition: gsm0503_coding.c:2134
gsm0503_tch_afs_encode
int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr)
Perform channel encoding on a TCH/AFS channel according to TS 05.03.
Definition: gsm0503_coding.c:2411
gsm0503_pdtch_decode
int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total)
Decode GPRS PDTCH.
Definition: gsm0503_coding.c:1022
gsm0503_tch_fr_decode
int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total)
Perform channel decoding of a FR/EFR channel according TS 05.03.
Definition: gsm0503_coding.c:1842
gsm0503_pdtch_encode
int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len)
GPRS DL message encoding.
Definition: gsm0503_coding.c:1432
gsm0503_tch_ahs_decode
int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total)
Perform channel decoding of a TCH/AFS channel according TS 05.03.
Definition: gsm0503_coding.c:2585
gsm0503_tch_hr_encode
int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len)
Perform channel encoding on a TCH/HS channel according to TS 05.03.
Definition: gsm0503_coding.c:2066
gsm0503_egprs_mcs
gsm0503_egprs_mcs
Definition: gsm0503_coding.h:19
gsm0503_tch_ahs_encode
int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr)
Perform channel encoding on a TCH/AHS channel according to TS 05.03.
Definition: gsm0503_coding.c:2872
gsm0503_rach_decode_ber
int gsm0503_rach_decode_ber(uint8_t *ra, const sbit_t *burst, uint8_t bsic, int *n_errors, int *n_bits_total)
Decode the (8-bit) RACH according to TS 05.03.
Definition: gsm0503_coding.c:3122
gsm0503_pdtch_egprs_encode
int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len)
EGPRS DL message encoding.
Definition: gsm0503_coding.c:1337
gsm0503_rach_ext_encode
int gsm0503_rach_ext_encode(ubit_t *burst, uint16_t ra, uint8_t bsic, bool is_11bit)
Encode the Extended (11-bit) or regular (8-bit) RACH according to 3GPP TS 45.003.
Definition: gsm0503_coding.c:3151
gsm0503_sch_encode
int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info)
Encode the SCH according to TS 05.03.
Definition: gsm0503_coding.c:3202
gsm0503_rach_encode
int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) OSMO_DEPRECATED("Use gsm0503_rach_ext_encode() instead")
Encode the (8-bit) RACH according to TS 05.03.
Definition: gsm0503_coding.c:3140
gsm0503_tch_ahs_decode_dtx
int gsm0503_tch_ahs_decode_dtx(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total, uint8_t *dtx)
Perform channel decoding of a TCH/AFS channel according TS 05.03.
Definition: gsm0503_coding.c:2609
EGPRS_NUM_MCS
@ EGPRS_NUM_MCS
Definition: gsm0503_coding.h:30
EGPRS_MCS3
@ EGPRS_MCS3
Definition: gsm0503_coding.h:23
EGPRS_MCS2
@ EGPRS_MCS2
Definition: gsm0503_coding.h:22
EGPRS_MCS4
@ EGPRS_MCS4
Definition: gsm0503_coding.h:24
EGPRS_MCS1
@ EGPRS_MCS1
Definition: gsm0503_coding.h:21
EGPRS_MCS8
@ EGPRS_MCS8
Definition: gsm0503_coding.h:28
EGPRS_MCS6
@ EGPRS_MCS6
Definition: gsm0503_coding.h:26
EGPRS_MCS0
@ EGPRS_MCS0
Definition: gsm0503_coding.h:20
EGPRS_MCS5
@ EGPRS_MCS5
Definition: gsm0503_coding.h:25
EGPRS_MCS7
@ EGPRS_MCS7
Definition: gsm0503_coding.h:27
EGPRS_MCS9
@ EGPRS_MCS9
Definition: gsm0503_coding.h:29
len
static size_t len(const char *str)
OSMO_DEPRECATED
#define OSMO_DEPRECATED(text)