Loading...
Searching...
No Matches
v110.h File Reference
`#include <osmocom/core/bits.h>`

Go to the source code of this file.

## Data Structures

struct | osmo_v110_decoded_frame
| a 'decoded' representation of a single V.110 frame. More...

## Macros

#define | MAX_D_BITS 48
#define | MAX_E_BITS 7
#define | MAX_S_BITS 9
#define | MAX_X_BITS 2
#define | osmo_v110_e1e2e3_set(e_bits, rate)
#define | osmo_v110_e1e2e3_cmp(e_bits, rate)

## Enumerations

enum | osmo_v100_sync_ra1_rate { OSMO_V110_SYNC_RA1_600 , OSMO_V110_SYNC_RA1_1200 , OSMO_V110_SYNC_RA1_2400 , OSMO_V110_SYNC_RA1_4800 , OSMO_V110_SYNC_RA1_7200 , OSMO_V110_SYNC_RA1_9600 , OSMO_V110_SYNC_RA1_12000 , OSMO_V110_SYNC_RA1_14400 , OSMO_V110_SYNC_RA1_19200 , OSMO_V110_SYNC_RA1_24000 , OSMO_V110_SYNC_RA1_28800 , OSMO_V110_SYNC_RA1_38400 , _NUM_OSMO_V110_SYNC_RA1 }
| enum for each supported V.110 synchronous RA1 function (one for each user bitrate) More...

## Functions

int | osmo_v110_decode_frame (struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits)
| Decode a 80-bit V.110 frame present as 80 ubits into a struct osmo_v110_decoded_frame.
int | osmo_v110_encode_frame (ubit_t *ra_bits, size_t n_bits, const struct osmo_v110_decoded_frame *fr)
| Encode a struct osmo_v110_decoded_frame into an 80-bit V.110 frame as ubits.
void | osmo_v110_ubit_dump (FILE *outf, const ubit_t *fr, size_t in_len)
| Print a encoded V.110 frame in the same table-like structure as the spec.
int | osmo_v110_sync_ra1_get_user_data_chunk_bitlen (enum osmo_v100_sync_ra1_rate rate)
| obtain the size (in number of bits) of the user data bits in one V.110 frame for specified RA1 rate
int | osmo_v110_sync_ra1_get_user_data_rate (enum osmo_v100_sync_ra1_rate rate)
| obtain the user data rate (in bits/s) for specified RA1 rate
int | osmo_v110_sync_ra1_get_intermediate_rate (enum osmo_v100_sync_ra1_rate rate)
| obtain the intermediate rate (in bits/s) for specified RA1 rate
int | osmo_v110_sync_ra1_user_to_ir (enum osmo_v100_sync_ra1_rate rate, struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
| perform V.110 RA1 function in user rate -> intermediate rate direction.
int | osmo_v110_sync_ra1_ir_to_user (enum osmo_v100_sync_ra1_rate rate, ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
| perform V.110 RA1 function in intermediate rate -> user rate direction.

## Variables

const ubit_t | osmo_v110_e1e2e3 [_NUM_OSMO_V110_SYNC_RA1][3]
| E1/E2/E3 bit values as per Table 5/V.110.

## Macro Definition Documentation

## MAX_D_BITS

#define MAX_D_BITS 48

Referenced by v110_df_d_bits_are(), v110_ta_build_frame(), and v110_ta_handle_frame().

## MAX_E_BITS

#define MAX_E_BITS 7

## MAX_S_BITS

#define MAX_S_BITS 9

## MAX_X_BITS

#define MAX_X_BITS 2

## osmo_v110_e1e2e3_cmp

#define osmo_v110_e1e2e3_cmp | ( |  | e_bits,
|  |  | rate )

Value:
memcmp(e_bits, osmo_v110_e1e2e3[rate], 3)
osmo_v110_e1e2e3
const ubit_t osmo_v110_e1e2e3[_NUM_OSMO_V110_SYNC_RA1][3]
E1/E2/E3 bit values as per Table 5/V.110.
Definition v110.c:147

Referenced by v110_adapt_IR8000_to_1200(), v110_adapt_IR8000_to_2400(), v110_adapt_IR8000_to_600(), v110_adapt_IR_to_Nx12000(), v110_adapt_IR_to_Nx3600(), and v110_adapt_IR_to_Nx4800().

## osmo_v110_e1e2e3_set

#define osmo_v110_e1e2e3_set | ( |  | e_bits,
|  |  | rate )

Value:
memcpy(e_bits, osmo_v110_e1e2e3[rate], 3)

Referenced by v110_adapt_1200_to_IR8000(), v110_adapt_2400_to_IR8000(), v110_adapt_600_to_IR8000(), v110_adapt_Nx12000_to_IR(), v110_adapt_Nx3600_to_IR(), and v110_adapt_Nx4800_to_IR().

## Enumeration Type Documentation

## osmo_v100_sync_ra1_rate

enum osmo_v100_sync_ra1_rate

enum for each supported V.110 synchronous RA1 function (one for each user bitrate)

Enumerator
OSMO_V110_SYNC_RA1_600 |
OSMO_V110_SYNC_RA1_1200 |
OSMO_V110_SYNC_RA1_2400 |
OSMO_V110_SYNC_RA1_4800 |
OSMO_V110_SYNC_RA1_7200 |
OSMO_V110_SYNC_RA1_9600 |
OSMO_V110_SYNC_RA1_12000 |
OSMO_V110_SYNC_RA1_14400 |
OSMO_V110_SYNC_RA1_19200 |
OSMO_V110_SYNC_RA1_24000 |
OSMO_V110_SYNC_RA1_28800 |
OSMO_V110_SYNC_RA1_38400 |
_NUM_OSMO_V110_SYNC_RA1 |

## Function Documentation

## osmo_v110_decode_frame()

int osmo_v110_decode_frame | ( | struct osmo_v110_decoded_frame * | fr,
|  | const ubit_t * | ra_bits,
|  | size_t | n_bits )

Decode a 80-bit V.110 frame present as 80 ubits into a struct osmo_v110_decoded_frame.

Parameters

  [out] | fr | caller-allocated output data structure, filled by this function
  [in] | ra_bits | One V.110 frame as 80 unpacked bits.
  [in] | n_bits | number of unpacked bits provided in ra_bits

Returns
  0 in case of success; negative on error.

References osmo_v110_decoded_frame::d_bits, osmo_v110_decoded_frame::e_bits, osmo_v110_decoded_frame::s_bits, and osmo_v110_decoded_frame::x_bits.

## osmo_v110_encode_frame()

int osmo_v110_encode_frame | ( | ubit_t * | ra_bits,
|  | size_t | n_bits,
|  | const struct osmo_v110_decoded_frame * | fr )

Encode a struct osmo_v110_decoded_frame into an 80-bit V.110 frame as ubits.

Parameters

  [out] | ra_bits | caller-provided output buffer at leat 80 ubits large
  [in] | n_bits | length of ra_bits. Must be at least 80.
  [in] | input | data structure

Returns
  number of bits written to ra_bits

References osmo_v110_decoded_frame::d_bits, osmo_v110_decoded_frame::e_bits, osmo_v110_decoded_frame::s_bits, and osmo_v110_decoded_frame::x_bits.

## osmo_v110_sync_ra1_get_intermediate_rate()

int osmo_v110_sync_ra1_get_intermediate_rate | ( | enum osmo_v100_sync_ra1_rate | rate | ) |

obtain the intermediate rate (in bits/s) for specified RA1 rate

References _NUM_OSMO_V110_SYNC_RA1, and osmo_v110_sync_ra1_def.

## osmo_v110_sync_ra1_get_user_data_chunk_bitlen()

int osmo_v110_sync_ra1_get_user_data_chunk_bitlen | ( | enum osmo_v100_sync_ra1_rate | rate | ) |

obtain the size (in number of bits) of the user data bits in one V.110 frame for specified RA1 rate

References _NUM_OSMO_V110_SYNC_RA1, and osmo_v110_sync_ra1_def.

Referenced by v110_ta_build_frame(), and v110_ta_handle_frame().

## osmo_v110_sync_ra1_get_user_data_rate()

int osmo_v110_sync_ra1_get_user_data_rate | ( | enum osmo_v100_sync_ra1_rate | rate | ) |

obtain the user data rate (in bits/s) for specified RA1 rate

References _NUM_OSMO_V110_SYNC_RA1, and osmo_v110_sync_ra1_def.

## osmo_v110_sync_ra1_ir_to_user()

int osmo_v110_sync_ra1_ir_to_user | ( | enum osmo_v100_sync_ra1_rate | rate,
|  | ubit_t * | d_out,
|  | size_t | out_len,
|  | const struct osmo_v110_decoded_frame * | fr )

perform V.110 RA1 function in intermediate rate -> user rate direction.

Parameters

  [in] | rate | specification of the user bitrate
  [out] | d_out | caller-allocated output user data (unpacked bits)
  [out] | out_len | length of d_out output buffer
  [in] | fr | [decoded] V.110 frame used as input

Returns
  number of unpacked bits written to d_out on success; negative in case of error

References _NUM_OSMO_V110_SYNC_RA1, and osmo_v110_sync_ra1_def.

Referenced by v110_ta_handle_frame().

## osmo_v110_sync_ra1_user_to_ir()

int osmo_v110_sync_ra1_user_to_ir | ( | enum osmo_v100_sync_ra1_rate | rate,
|  | struct osmo_v110_decoded_frame * | fr,
|  | const ubit_t * | d_in,
|  | size_t | in_len )

perform V.110 RA1 function in user rate -> intermediate rate direction.

Parameters

  [in] | rate | specification of the user bitrate
  [out] | fr | caller-allocated output buffer for the [decoded] V.110 frame generated
  [in] | d_in | input user data (unpacked bits)
  [in] | in_len | length of user input data (in number of bits)

Returns
  0 on success; negative in case of error

References _NUM_OSMO_V110_SYNC_RA1, and osmo_v110_sync_ra1_def.

Referenced by v110_ta_build_frame().

## osmo_v110_ubit_dump()

void osmo_v110_ubit_dump | ( | FILE * | outf,
|  | const ubit_t * | fr,
|  | size_t | in_len )

Print a encoded V.110 frame in the same table-like structure as the spec.

Parameters

  | outf | output FILE stream to which to dump
  [in] | fr | unpacked bits to dump
  [in] | in_len | length of unpacked bits available at fr.

## Variable Documentation

## osmo_v110_e1e2e3

const ubit_t osmo_v110_e1e2e3[_NUM_OSMO_V110_SYNC_RA1][3]

extern

E1/E2/E3 bit values as per Table 5/V.110.