annotate trau-decode/osmo_bits.h @ 94:f9ef582c199c

tfo-ut: check in tfo-fr.bin and tfo-efr.bin Each of these binary files is an extract from MSC-side E1 timeslot recording in a Nokia TCSM2 TFO session involving a cross-connect between two TRAU channels. The extracts have been chosen to begin at the point where the TRAU starts emitting TFO frames, thereby beginning with a series of TFO frames that contain an embedded TFO_TRANS message. In each experiment, one of the two cross-connected TRAU channels emitted two "plain" TFO frames (not containing embedded TFO messages) in between the initial embedded TFO_TRANS and the subsequent embedded TFO_REQ_L; this channel was chosen for the present extracts. Each extract is thus 2560 PCM samples, containing 16 aligned TFO frames: 5 carrying TFO_TRANS, 2 plain, 9 carrying TFO_REQ_L.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 18 Mar 2025 22:56:23 +0000
parents d9c095357c32
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This include file has been put together from Osmocom (specifically
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * libosmocore) header files, containing definitions for bit vector
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * manipulation and CRC functions.
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 /* from bits.h */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 /*! unpacked bit (0 or 1): 1 bit per byte */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 typedef uint8_t ubit_t;
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 /* from crc8gen.h */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 /*! structure describing a given CRC code of max 8 bits */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 struct osmo_crc8gen_code {
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 int bits; /*!< Actual number of bits of the CRC */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 uint8_t poly; /*!< Polynom (normal representation, MSB omitted */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 uint8_t init; /*!< Initialization value of the CRC state */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 uint8_t remainder; /*!< Remainder of the CRC (final XOR) */
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 };
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 uint8_t osmo_crc8gen_compute_bits(const struct osmo_crc8gen_code *code,
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 const ubit_t *in, int len);
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 int osmo_crc8gen_check_bits(const struct osmo_crc8gen_code *code,
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 const ubit_t *in, int len, const ubit_t *crc_bits);
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 void osmo_crc8gen_set_bits(const struct osmo_crc8gen_code *code,
d9c095357c32 trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 const ubit_t *in, int len, ubit_t *crc_bits);