/** * * \section COPYRIGHT * * Copyright 2013-2021 Software Radio Systems Limited * * 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. * */ #ifndef SRSRAN_PBCH_MSG_NR_H #define SRSRAN_PBCH_MSG_NR_H #include "srsran/config.h" #include "srsran/phy/common/phy_common_nr.h" #include #include /** * @brief NR PBCH payload size generated by higher layers, deduced from TS 38.331 MIB description */ #define SRSRAN_PBCH_MSG_NR_SZ 24 /** * @brief Describes the NR PBCH message */ typedef struct SRSRAN_API { uint8_t payload[SRSRAN_PBCH_MSG_NR_SZ]; ///< Actual PBCH payload provided by higher layers uint8_t sfn_4lsb; ///< SFN 4 LSB uint8_t ssb_idx; ///< SS/PBCH blocks index described in TS 38.213 4.1 uint8_t k_ssb_msb; ///< Subcarrier offset MSB described in TS 38.211 7.4.3.1 bool hrf; ///< Half Radio Frame bit bool crc; ///< Decoder only, it is true only if the received CRC matches } srsran_pbch_msg_nr_t; typedef struct SRSRAN_API { uint32_t sfn; ///< System frame number uint8_t ssb_idx; ///< SS/PBCH blocks index described in TS 38.213 4.1 bool hrf; ///< Half Radio Frame bit srsran_subcarrier_spacing_t scs_common; ///< Subcarrier spacing common uint32_t ssb_offset; ///< SSB subcarrier offset srsran_dmrs_sch_typeA_pos_t dmrs_typeA_pos; ///< DMRS typeA position uint32_t coreset0_idx; ///< CORESET Zero configuration index (0-15) uint32_t ss0_idx; ///< SearchSpace Zero configuration index (0-15) bool cell_barred; ///< Set to true if the cell is barred bool intra_freq_reselection; ///< Set to true if allowed uint32_t spare; ///< Unused bits } srsran_mib_nr_t; SRSRAN_API bool srsran_pbch_msg_nr_is_mib(const srsran_pbch_msg_nr_t* msg); SRSRAN_API int srsran_pbch_msg_nr_mib_pack(const srsran_mib_nr_t* mib, srsran_pbch_msg_nr_t* msg); SRSRAN_API int srsran_pbch_msg_nr_mib_unpack(const srsran_pbch_msg_nr_t* pbch_msg, srsran_mib_nr_t* mib); SRSRAN_API uint32_t srsran_pbch_msg_info(const srsran_pbch_msg_nr_t* msg, char* str, uint32_t str_len); SRSRAN_API uint32_t srsran_pbch_msg_nr_mib_info(const srsran_mib_nr_t* mib, char* str, uint32_t str_len); #endif // SRSRAN_PBCH_MSG_NR_H