mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.9 KiB
C
74 lines
1.9 KiB
C
4 years ago
|
/**
|
||
5 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
5 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
5 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
5 years ago
|
*
|
||
|
*/
|
||
|
|
||
4 years ago
|
#ifndef SRSRAN_MIB_SL_H
|
||
|
#define SRSRAN_MIB_SL_H
|
||
5 years ago
|
|
||
|
#include <stdbool.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
4 years ago
|
#include "srsran/config.h"
|
||
|
#include "srsran/phy/common/phy_common_sl.h"
|
||
5 years ago
|
|
||
|
/**
|
||
|
* Master information block - Sidelink (MIB-SL and MIB-SL-V2X).
|
||
|
*
|
||
|
* \brief MIB-SL packing/unpacking functions to convert between bit streams
|
||
|
*
|
||
|
* Reference: 3GPP TS 36.331 version 15.6.0 Release 15 Sec. 6.5
|
||
|
*/
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
5 years ago
|
|
||
|
uint32_t mib_sl_len;
|
||
|
|
||
|
// sl-Bandwidth-r12 enum {6, 15, 25, 50, 75, 100} (3 bits)
|
||
|
uint32_t sl_bandwidth_r12;
|
||
|
|
||
|
// tdd-ConfigSL-r12 (3 bits)
|
||
|
uint32_t tdd_config_sl_r12;
|
||
|
|
||
|
// directFrameNumber-r12 (10 bits)
|
||
|
uint32_t direct_frame_number_r12;
|
||
|
|
||
|
// directSubframeNumber-r12 (4 bits)
|
||
|
uint32_t direct_subframe_number_r12;
|
||
|
|
||
|
// inCoverage-r12 (1 bit)
|
||
|
bool in_coverage_r12;
|
||
|
|
||
|
// reserved-r12
|
||
|
// TM2: (19 bits)
|
||
|
// TM4: (27 bits)
|
||
|
|
||
4 years ago
|
} srsran_mib_sl_t;
|
||
5 years ago
|
|
||
4 years ago
|
static const int srsran_mib_sl_bandwith_to_prb[6] = {6, 15, 25, 50, 75, 100};
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_mib_sl_init(srsran_mib_sl_t* q, srsran_sl_tm_t tm);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_mib_sl_set(srsran_mib_sl_t* q,
|
||
5 years ago
|
uint32_t nof_prb,
|
||
|
uint32_t tdd_config,
|
||
|
uint32_t direct_frame_number,
|
||
|
uint32_t direct_subframe_number,
|
||
|
bool in_coverage);
|
||
|
|
||
4 years ago
|
SRSRAN_API void srsran_mib_sl_pack(srsran_mib_sl_t* q, uint8_t* msg);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_mib_sl_unpack(srsran_mib_sl_t* q, uint8_t* msg);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_mib_sl_free(srsran_mib_sl_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_mib_sl_printf(FILE* f, srsran_mib_sl_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_MIB_SL_H
|