From 6348ddefd56689dbde86c4f6cf8103cba2a26ae0 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Sat, 26 Dec 2020 22:41:41 +0100 Subject: [PATCH 001/138] Add option to run prach_worker in the caller thread instead of by a background worker. This is useful when running simulations with ZMQ, to avoid the prach worker to take too much time and miss the RAR deadline --- srsenb/hdr/phy/phy_interfaces.h | 1 + srsenb/hdr/phy/prach_worker.h | 9 ++++++--- srsenb/src/main.cc | 9 +++++++++ srsenb/src/phy/phy.cc | 8 +++++++- srsenb/src/phy/prach_worker.cc | 30 ++++++++++++++++++++++-------- 5 files changed, 45 insertions(+), 12 deletions(-) diff --git a/srsenb/hdr/phy/phy_interfaces.h b/srsenb/hdr/phy/phy_interfaces.h index 7d2d5e343..5f9661875 100644 --- a/srsenb/hdr/phy/phy_interfaces.h +++ b/srsenb/hdr/phy/phy_interfaces.h @@ -62,6 +62,7 @@ struct phy_args_t { bool pusch_meas_evm = false; bool pusch_meas_ta = true; bool pucch_meas_ta = true; + uint32_t nof_prach_threads = 1; srslte::channel::args_t dl_channel_args; srslte::channel::args_t ul_channel_args; diff --git a/srsenb/hdr/phy/prach_worker.h b/srsenb/hdr/phy/prach_worker.h index 85e8db6ab..0acbfa0fa 100644 --- a/srsenb/hdr/phy/prach_worker.h +++ b/srsenb/hdr/phy/prach_worker.h @@ -37,7 +37,8 @@ public: const srslte_prach_cfg_t& prach_cfg_, stack_interface_phy_lte* mac, srslte::log* log_h, - int priority); + int priority, + uint32_t nof_workers); int new_tti(uint32_t tti, cf_t* buffer); void set_max_prach_offset_us(float delay_us); void stop(); @@ -86,6 +87,7 @@ private: bool running = false; uint32_t nof_sf = 0; uint32_t sf_cnt = 0; + uint32_t nof_workers = 0; void run_thread() final; int run_tti(sf_buffer* b); @@ -105,14 +107,15 @@ public: const srslte_prach_cfg_t& prach_cfg_, stack_interface_phy_lte* mac, srslte::log* log_h, - int priority) + int priority, + uint32_t nof_workers_x_cc) { // Create PRACH worker if required while (cc_idx >= prach_vec.size()) { prach_vec.push_back(std::unique_ptr(new prach_worker(prach_vec.size()))); } - prach_vec[cc_idx]->init(cell_, prach_cfg_, mac, log_h, priority); + prach_vec[cc_idx]->init(cell_, prach_cfg_, mac, log_h, priority, nof_workers_x_cc); } void set_max_prach_offset_us(float delay_us) diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index e0f48b236..9353009c4 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -189,6 +189,7 @@ void parse_args(all_args_t* args, int argc, char* argv[]) ("expert.pusch_meas_evm", bpo::value(&args->phy.pusch_meas_evm)->default_value(false), "Enable/Disable PUSCH EVM measure") ("expert.tx_amplitude", bpo::value(&args->phy.tx_amplitude)->default_value(0.6), "Transmit amplitude factor") ("expert.nof_phy_threads", bpo::value(&args->phy.nof_phy_threads)->default_value(3), "Number of PHY threads") + ("expert.nof_prach_threads", bpo::value(&args->phy.nof_prach_threads)->default_value(1), "Number of PRACH workers per carrier. Only 1 or 0 is supported") ("expert.max_prach_offset_us", bpo::value(&args->phy.max_prach_offset_us)->default_value(30), "Maximum allowed RACH offset (in us)") ("expert.equalizer_mode", bpo::value(&args->phy.equalizer_mode)->default_value("mmse"), "Equalizer mode") ("expert.estimator_fil_w", bpo::value(&args->phy.estimator_fil_w)->default_value(0.1), "Chooses the coefficients for the 3-tap channel estimator centered filter.") @@ -306,6 +307,14 @@ void parse_args(all_args_t* args, int argc, char* argv[]) } } + // Check PRACH workers + if (args->phy.nof_prach_threads > 1) { + fprintf(stderr, + "nof_prach_workers = %d. Value is not supported, only 0 or 1 are allowed\n", + args->phy.nof_prach_threads); + exit(1); + } + // Convert eNB Id std::size_t pos = {}; try { diff --git a/srsenb/src/phy/phy.cc b/srsenb/src/phy/phy.cc index 624e770a2..791624f7c 100644 --- a/srsenb/src/phy/phy.cc +++ b/srsenb/src/phy/phy.cc @@ -132,7 +132,13 @@ int phy::init(const phy_args_t& args, // For each carrier, initialise PRACH worker for (uint32_t cc = 0; cc < cfg.phy_cell_cfg.size(); cc++) { prach_cfg.root_seq_idx = cfg.phy_cell_cfg[cc].root_seq_idx; - prach.init(cc, cfg.phy_cell_cfg[cc].cell, prach_cfg, stack_, log_h.get(), PRACH_WORKER_THREAD_PRIO); + prach.init(cc, + cfg.phy_cell_cfg[cc].cell, + prach_cfg, + stack_, + log_h.get(), + PRACH_WORKER_THREAD_PRIO, + args.nof_prach_threads); } prach.set_max_prach_offset_us(args.max_prach_offset_us); diff --git a/srsenb/src/phy/prach_worker.cc b/srsenb/src/phy/prach_worker.cc index 0704a5e0d..699dd8501 100644 --- a/srsenb/src/phy/prach_worker.cc +++ b/srsenb/src/phy/prach_worker.cc @@ -19,12 +19,14 @@ int prach_worker::init(const srslte_cell_t& cell_, const srslte_prach_cfg_t& prach_cfg_, stack_interface_phy_lte* stack_, srslte::log* log_h_, - int priority) + int priority, + uint32_t nof_workers_) { - log_h = log_h_; - stack = stack_; - prach_cfg = prach_cfg_; - cell = cell_; + log_h = log_h_; + stack = stack_; + prach_cfg = prach_cfg_; + cell = cell_; + nof_workers = nof_workers_; max_prach_offset_us = 50; @@ -41,7 +43,10 @@ int prach_worker::init(const srslte_cell_t& cell_, nof_sf = (uint32_t)ceilf(prach.T_tot * 1000); - start(priority); + if (nof_workers > 0) { + start(priority); + } + initiated = true; sf_cnt = 0; @@ -66,7 +71,10 @@ void prach_worker::stop() running = false; sf_buffer* s = nullptr; pending_buffers.push(s); - wait_thread_finish(); + + if (nof_workers > 0) { + wait_thread_finish(); + } srslte_prach_free(&prach); } @@ -106,7 +114,13 @@ int prach_worker::new_tti(uint32_t tti_rx, cf_t* buffer_rx) sf_cnt++; if (sf_cnt == nof_sf) { sf_cnt = 0; - pending_buffers.push(current_buffer); + if (nof_workers == 0) { + run_tti(current_buffer); + current_buffer->reset(); + buffer_pool.deallocate(current_buffer); + } else { + pending_buffers.push(current_buffer); + } } } return 0; From 1775052144370cef53bcdd14565abf7e7bd95009 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 15 Dec 2020 16:07:09 +0100 Subject: [PATCH 002/138] Fix NR PDSCH DMRS cinit and zero after free --- lib/src/phy/ch_estimation/dmrs_pdsch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/phy/ch_estimation/dmrs_pdsch.c b/lib/src/phy/ch_estimation/dmrs_pdsch.c index f6f3b8def..85a5227c0 100644 --- a/lib/src/phy/ch_estimation/dmrs_pdsch.c +++ b/lib/src/phy/ch_estimation/dmrs_pdsch.c @@ -453,7 +453,7 @@ static uint32_t srslte_dmrs_pdsch_seed(const srslte_carrier_nr_t* carrier, n_id = dmrs_cfg->scrambling_id1; } - return (uint32_t)(((((SRSLTE_MAX_NSYMB * slot_idx + symbol_idx + 1UL) * (2UL * n_id + 1UL)) << 17UL) + + return (uint32_t)(((((SRSLTE_NSYMB_PER_SLOT_NR * slot_idx + symbol_idx + 1UL) * (2UL * n_id + 1UL)) << 17UL) + (2UL * carrier->id + n_scid)) & (uint64_t)INT32_MAX); } @@ -485,6 +485,8 @@ void srslte_dmrs_pdsch_free(srslte_dmrs_pdsch_t* q) if (q->temp) { free(q->temp); } + + SRSLTE_MEM_ZERO(q, srslte_dmrs_pdsch_t, 1); } int srslte_dmrs_pdsch_set_carrier(srslte_dmrs_pdsch_t* q, const srslte_carrier_nr_t* carrier) From 0a060741582e6a658972189aa7ff642b57fbca2a Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 15 Dec 2020 17:57:37 +0100 Subject: [PATCH 003/138] Skip NR PDSCH allocation in PDSCH DMRS symbols --- lib/include/srslte/phy/common/phy_common_nr.h | 12 ++ lib/include/srslte/phy/phch/dci_nr.h | 8 -- lib/include/srslte/phy/phch/pdsch_cfg_nr.h | 3 +- lib/include/srslte/phy/phch/ra_nr.h | 30 +++++ lib/src/phy/ch_estimation/dmrs_pdsch.c | 34 +---- lib/src/phy/dft/ofdm.c | 2 +- lib/src/phy/enb/enb_dl_nr.c | 2 +- lib/src/phy/phch/pdsch_nr.c | 119 +++--------------- lib/src/phy/phch/ra_nr.c | 24 ++-- lib/src/phy/phch/sch_nr.c | 14 ++- 10 files changed, 93 insertions(+), 155 deletions(-) diff --git a/lib/include/srslte/phy/common/phy_common_nr.h b/lib/include/srslte/phy/common/phy_common_nr.h index ceaa2acc9..4fc47f6e6 100644 --- a/lib/include/srslte/phy/common/phy_common_nr.h +++ b/lib/include/srslte/phy/common/phy_common_nr.h @@ -145,6 +145,18 @@ typedef enum SRSLTE_API { srslte_mcs_table_N } srslte_mcs_table_t; +/** + * @brief RNTI types + */ +typedef enum SRSLTE_API { + srslte_rnti_type_c = 0, + srslte_rnti_type_p, + srslte_rnti_type_si, + srslte_rnti_type_ra, + srslte_rnti_type_tc, + srslte_rnti_type_cs, +} srslte_rnti_type_t; + /** * @brief DCI formats * @remark Described in TS 38.212 V15.9.0 Section 7.3.1 DCI formats diff --git a/lib/include/srslte/phy/phch/dci_nr.h b/lib/include/srslte/phy/phch/dci_nr.h index 535828284..aa10c4416 100644 --- a/lib/include/srslte/phy/phch/dci_nr.h +++ b/lib/include/srslte/phy/phch/dci_nr.h @@ -17,14 +17,6 @@ #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/phch/pdsch_cfg_nr.h" -typedef enum SRSLTE_API { - srslte_rnti_type_c = 0, - srslte_rnti_type_p, - srslte_rnti_type_si, - srslte_rnti_type_ra, - srslte_rnti_type_tc, -} srslte_rnti_type_t; - typedef struct SRSLTE_API { srslte_dci_location_t location; srslte_search_space_type_t search_space; diff --git a/lib/include/srslte/phy/phch/pdsch_cfg_nr.h b/lib/include/srslte/phy/phch/pdsch_cfg_nr.h index 37398400a..2d7f5050b 100644 --- a/lib/include/srslte/phy/phch/pdsch_cfg_nr.h +++ b/lib/include/srslte/phy/phch/pdsch_cfg_nr.h @@ -107,7 +107,8 @@ typedef struct SRSLTE_API { */ typedef struct SRSLTE_API { /// UE identifier - uint16_t rnti; + uint16_t rnti; + srslte_rnti_type_t rnti_type; /// Time domain resources uint32_t k0; diff --git a/lib/include/srslte/phy/phch/ra_nr.h b/lib/include/srslte/phy/phch/ra_nr.h index 00e44fe7e..91750f8a5 100644 --- a/lib/include/srslte/phy/phch/ra_nr.h +++ b/lib/include/srslte/phy/phch/ra_nr.h @@ -32,6 +32,36 @@ extern "C" { #endif +/** + * @brief Determines target rate + * @param mcs_table Configured MCS table + * @param dci_format DCI format used for the grant + * @param search_space_type Search space type + * @param rnti_type RNTI type + * @param mcs_idx Desired Modulation Coding Scheme (MCS) index + * @return The target rate if provided information is valid. Otherwise, it returns NAN + */ +SRSLTE_API double srslte_ra_nr_R_from_mcs(srslte_mcs_table_t mcs_table, + srslte_dci_format_nr_t dci_format, + srslte_search_space_type_t search_space_type, + srslte_rnti_type_t rnti_type, + uint32_t mcs_idx); + +/** + * @brief Determines target rate + * @param mcs_table Configured MCS table + * @param dci_format DCI format used for the grant + * @param search_space_type Search space type + * @param rnti_type RNTI type + * @param mcs_idx Desired Modulation Coding Scheme (MCS) index + * @return The selected modulation if provided information is valid. Otherwise, it returns SRSLTE_MOD_NITEMS + */ +SRSLTE_API srslte_mod_t srslte_ra_nr_mod_from_mcs(srslte_mcs_table_t mcs_table, + srslte_dci_format_nr_t dci_format, + srslte_search_space_type_t search_space_type, + srslte_rnti_type_t rnti_type, + uint32_t mcs_idx); + /** * @brief Determines the number of resource elements available for a given PDSCH transmission * @param pdsch_cfg PDSCH configuration provided by higher layers diff --git a/lib/src/phy/ch_estimation/dmrs_pdsch.c b/lib/src/phy/ch_estimation/dmrs_pdsch.c index 85a5227c0..a302f6c38 100644 --- a/lib/src/phy/ch_estimation/dmrs_pdsch.c +++ b/lib/src/phy/ch_estimation/dmrs_pdsch.c @@ -414,12 +414,6 @@ int srslte_dmrs_pdsch_get_sc_idx(const srslte_pdsch_dmrs_cfg_t* cfg, uint32_t ma int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, const srslte_pdsch_grant_nr_t* grant) { - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &cfg->dmrs_cfg_typeA : &cfg->dmrs_cfg_typeB; - - // Get number of frequency domain resource elements used for DMRS - int nof_sc = dmrs_cfg->type == srslte_dmrs_pdsch_type_1 ? 6 : 4; - // Get number of symbols used for DMRS uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS] = {}; int ret = srslte_dmrs_pdsch_get_symbols_idx(cfg, grant, symbols); @@ -428,7 +422,7 @@ int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, const srslte_p return SRSLTE_ERROR; } - return nof_sc * ret; + return SRSLTE_NRE * ret; } static uint32_t srslte_dmrs_pdsch_seed(const srslte_carrier_nr_t* carrier, @@ -739,29 +733,11 @@ int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, } if (symbols[symbol_idx] == l) { - switch (dmrs_cfg->type) { - - case srslte_dmrs_pdsch_type_1: - for (uint32_t i = 0; i < nof_re_x_symbol; i++) { - if (i % 2 != delta) { - chest_res->ce[0][0][count] = ce[i]; - count++; - } - } - break; - case srslte_dmrs_pdsch_type_2: - for (uint32_t i = 0; i < nof_re_x_symbol; i++) { - if ((i % 6 != delta) && (i % 6 != delta + 1)) { - chest_res->ce[0][0][count] = ce[i]; - count++; - } - } - break; - } - } else { - srslte_vec_cf_copy(&chest_res->ce[0][0][count], ce, nof_re_x_symbol); - count += nof_re_x_symbol; + continue; } + + srslte_vec_cf_copy(&chest_res->ce[0][0][count], ce, nof_re_x_symbol); + count += nof_re_x_symbol; } // Set other values in the estimation result chest_res->nof_re = count; diff --git a/lib/src/phy/dft/ofdm.c b/lib/src/phy/dft/ofdm.c index 1bace3101..9de0a0aaa 100644 --- a/lib/src/phy/dft/ofdm.c +++ b/lib/src/phy/dft/ofdm.c @@ -229,7 +229,7 @@ void srslte_ofdm_free_(srslte_ofdm_t* q) if (q->window_offset_buffer) { free(q->window_offset_buffer); } - bzero(q, sizeof(srslte_ofdm_t)); + SRSLTE_MEM_ZERO(q, srslte_ofdm_t, 1); } int srslte_ofdm_rx_init(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t* out_buffer, uint32_t max_prb) diff --git a/lib/src/phy/enb/enb_dl_nr.c b/lib/src/phy/enb/enb_dl_nr.c index 3e4b8ca36..b16773e96 100644 --- a/lib/src/phy/enb/enb_dl_nr.c +++ b/lib/src/phy/enb/enb_dl_nr.c @@ -98,7 +98,7 @@ void srslte_enb_dl_nr_free(srslte_enb_dl_nr_t* q) srslte_pdcch_nr_free(&q->pdcch); - memset(q, 0, sizeof(srslte_enb_dl_nr_t)); + SRSLTE_MEM_ZERO(q, srslte_enb_dl_nr_t, 1); } int srslte_enb_dl_nr_set_carrier(srslte_enb_dl_nr_t* q, const srslte_carrier_nr_t* carrier) diff --git a/lib/src/phy/phch/pdsch_nr.c b/lib/src/phy/phch/pdsch_nr.c index 5d4b270d2..ad2058bbb 100644 --- a/lib/src/phy/phch/pdsch_nr.c +++ b/lib/src/phy/phch/pdsch_nr.c @@ -168,100 +168,9 @@ void srslte_pdsch_nr_free(srslte_pdsch_nr_t* q) if (q->evm_buffer != NULL) { srslte_evm_free(q->evm_buffer); } -} - -/** - * @brief copies a number of countiguous Resource Elements - * @param sf_symbols slot symbols in frequency domain - * @param symbols resource elements - * @param count number of resource elements to copy - * @param put Direction, symbols are copied into sf_symbols if put is true, otherwise sf_symbols are copied into symbols - */ -static void srslte_pdsch_re_cp(cf_t* sf_symbols, cf_t* symbols, uint32_t count, bool put) -{ - if (put) { - srslte_vec_cf_copy(sf_symbols, symbols, count); - } else { - srslte_vec_cf_copy(symbols, sf_symbols, count); - } -} - -static uint32_t srslte_pdsch_nr_cp_dmrs_type1(const srslte_pdsch_nr_t* q, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols, - bool put) -{ - uint32_t count = 0; - uint32_t delta = 0; - - for (uint32_t i = 0; i < q->carrier.nof_prb; i++) { - if (grant->prb_idx[i]) { - for (uint32_t j = 0; j < SRSLTE_NRE; j += 2) { - if (put) { - sf_symbols[i * SRSLTE_NRE + delta + j + 1] = symbols[count++]; - } else { - symbols[count++] = sf_symbols[i * SRSLTE_NRE + delta + j + 1]; - } - } - } - } - return count; -} - -static uint32_t srslte_pdsch_nr_cp_dmrs_type2(const srslte_pdsch_nr_t* q, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols, - bool put) -{ - uint32_t count = 0; - uint32_t delta = 0; - - for (uint32_t i = 0; i < q->carrier.nof_prb; i++) { - if (grant->prb_idx[i]) { - // Copy RE before first pilot pair - if (delta > 0) { - srslte_pdsch_re_cp(&sf_symbols[i * SRSLTE_NRE], &symbols[count], delta, put); - count += delta; - } - - // Copy RE between pilot pairs - srslte_pdsch_re_cp(&sf_symbols[i * SRSLTE_NRE + delta + 2], &symbols[count], 4, put); - count += 4; - - // Copy RE after second pilot - srslte_pdsch_re_cp(&sf_symbols[(i + 1) * SRSLTE_NRE - 4 + delta], &symbols[count], 4 - delta, put); - count += 4 - delta; - } - } - - return count; -} - -static uint32_t srslte_pdsch_nr_cp_dmrs(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols, - bool put) -{ - uint32_t count = 0; - - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &cfg->dmrs_cfg_typeA : &cfg->dmrs_cfg_typeB; - - switch (dmrs_cfg->type) { - case srslte_dmrs_pdsch_type_1: - count = srslte_pdsch_nr_cp_dmrs_type1(q, grant, symbols, sf_symbols, put); - break; - case srslte_dmrs_pdsch_type_2: - count = srslte_pdsch_nr_cp_dmrs_type2(q, grant, symbols, sf_symbols, put); - break; - } - - return count; + // Make sure whole structure is fill with zeros + SRSLTE_MEM_ZERO(q, srslte_pdsch_nr_t, 1); } static uint32_t srslte_pdsch_nr_cp_clean(const srslte_pdsch_nr_t* q, @@ -340,13 +249,12 @@ static int srslte_pdsch_nr_cp(const srslte_pdsch_nr_t* q, dmrs_l_count++; } + // Skip DMRS symbol if (l == dmrs_l_idx[dmrs_l_count]) { - count += srslte_pdsch_nr_cp_dmrs( - q, cfg, grant, &symbols[count], &sf_symbols[l * q->carrier.nof_prb * SRSLTE_NRE], put); - } else { - count += - srslte_pdsch_nr_cp_clean(q, grant, &symbols[count], &sf_symbols[l * q->carrier.nof_prb * SRSLTE_NRE], put); + continue; } + + count += srslte_pdsch_nr_cp_clean(q, grant, &symbols[count], &sf_symbols[l * q->carrier.nof_prb * SRSLTE_NRE], put); } return count; @@ -400,7 +308,7 @@ static inline int pdsch_nr_encode_codeword(srslte_pdsch_nr_t* q, } if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("b="); + INFO("b="); srslte_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits); } @@ -416,7 +324,7 @@ static inline int pdsch_nr_encode_codeword(srslte_pdsch_nr_t* q, srslte_mod_modulate(&q->modem_tables[tb->mod], q->b[tb->cw_idx], q->d[tb->cw_idx], tb->nof_bits); if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("d="); + INFO("d="); srslte_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); } @@ -471,7 +379,16 @@ int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q, // ... Not implemented // 7.3.1.6 Mapping from virtual to physical resource blocks - srslte_pdsch_nr_put(q, cfg, grant, x[0], sf_symbols[0]); + int n = srslte_pdsch_nr_put(q, cfg, grant, x[0], sf_symbols[0]); + if (n < SRSLTE_SUCCESS) { + ERROR("Putting NR PDSCH resources\n"); + return SRSLTE_ERROR; + } + + if (n != grant->tb[0].nof_re) { + ERROR("Unmatched number of RE (%d != %d)\n", n, grant->tb[0].nof_re); + return SRSLTE_ERROR; + } if (q->meas_time_en) { gettimeofday(&t[2], NULL); diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 615001818..6ca60a900 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -111,18 +111,18 @@ typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; static ra_nr_table_t ra_nr_select_table(srslte_mcs_table_t mcs_table, srslte_dci_format_nr_t dci_format, srslte_search_space_type_t search_space_type, - uint16_t rnti) + srslte_rnti_type_t rnti_type) { // Non-implemented parameters bool sps_config_mcs_table_present = false; srslte_mcs_table_t sps_config_mcs_table = srslte_mcs_table_64qam; - bool is_cs_rnti = false; bool is_pdcch_sps = false; // - the higher layer parameter mcs-Table given by PDSCH-Config is set to 'qam256', and // - the PDSCH is scheduled by a PDCCH with DCI format 1_1 with // - CRC scrambled by C-RNTI - if (mcs_table == srslte_mcs_table_256qam && dci_format == srslte_dci_format_nr_1_1 && SRSLTE_RNTI_ISUSER(rnti)) { + if (mcs_table == srslte_mcs_table_256qam && dci_format == srslte_dci_format_nr_1_1 && + rnti_type == srslte_rnti_type_c) { return ra_nr_table_1; } @@ -131,7 +131,7 @@ static ra_nr_table_t ra_nr_select_table(srslte_mcs_table_t mcs_table, // the PDSCH is scheduled by a PDCCH in a UE-specific search space with // CRC scrambled by C - RNTI if (mcs_table == srslte_mcs_table_qam64LowSE && search_space_type == srslte_search_space_type_ue && - SRSLTE_RNTI_ISUSER(rnti)) { + rnti_type == srslte_rnti_type_c) { return ra_nr_table_3; } @@ -140,7 +140,7 @@ static ra_nr_table_t ra_nr_select_table(srslte_mcs_table_t mcs_table, // - if the PDSCH is scheduled by a PDCCH with DCI format 1_1 with CRC scrambled by CS-RNTI or // - if the PDSCH is scheduled without corresponding PDCCH transmission using SPS-Config, if (!sps_config_mcs_table_present && mcs_table == srslte_mcs_table_256qam && - ((dci_format == srslte_dci_format_nr_1_1 && is_cs_rnti) || (!is_pdcch_sps))) { + ((dci_format == srslte_dci_format_nr_1_1 && rnti_type == srslte_rnti_type_c) || (!is_pdcch_sps))) { return ra_nr_table_2; } @@ -148,7 +148,7 @@ static ra_nr_table_t ra_nr_select_table(srslte_mcs_table_t mcs_table, // - if the PDSCH is scheduled by a PDCCH with CRC scrambled by CS-RNTI or // - if the PDSCH is scheduled without corresponding PDCCH transmission using SPS-Config, if (sps_config_mcs_table_present && sps_config_mcs_table == srslte_mcs_table_qam64LowSE && - (is_cs_rnti || is_pdcch_sps)) { + (rnti_type == srslte_rnti_type_cs || is_pdcch_sps)) { return ra_nr_table_3; } @@ -159,10 +159,10 @@ static ra_nr_table_t ra_nr_select_table(srslte_mcs_table_t mcs_table, double srslte_ra_nr_R_from_mcs(srslte_mcs_table_t mcs_table, srslte_dci_format_nr_t dci_format, srslte_search_space_type_t search_space_type, - uint16_t rnti, + srslte_rnti_type_t rnti_type, uint32_t mcs_idx) { - ra_nr_table_t table = ra_nr_select_table(mcs_table, dci_format, search_space_type, rnti); + ra_nr_table_t table = ra_nr_select_table(mcs_table, dci_format, search_space_type, rnti_type); switch (table) { case ra_nr_table_1: @@ -181,10 +181,10 @@ double srslte_ra_nr_R_from_mcs(srslte_mcs_table_t mcs_table, srslte_mod_t srslte_ra_nr_mod_from_mcs(srslte_mcs_table_t mcs_table, srslte_dci_format_nr_t dci_format, srslte_search_space_type_t search_space_type, - uint16_t rnti, + srslte_rnti_type_t rnti_type, uint32_t mcs_idx) { - ra_nr_table_t table = ra_nr_select_table(mcs_table, dci_format, search_space_type, rnti); + ra_nr_table_t table = ra_nr_select_table(mcs_table, dci_format, search_space_type, rnti_type); switch (table) { case ra_nr_table_1: @@ -323,14 +323,14 @@ int srslte_ra_nr_fill_tb(const srslte_pdsch_cfg_nr_t* pdsch_cfg, // Get target Rate double R = srslte_ra_nr_R_from_mcs( - pdsch_cfg->sch_cfg.mcs_table, grant->dci_format, grant->dci_search_space, grant->rnti, mcs_idx); + pdsch_cfg->sch_cfg.mcs_table, grant->dci_format, grant->dci_search_space, grant->rnti_type, mcs_idx); if (!isnormal(R)) { return SRSLTE_ERROR; } // Get modulation srslte_mod_t m = srslte_ra_nr_mod_from_mcs( - pdsch_cfg->sch_cfg.mcs_table, grant->dci_format, grant->dci_search_space, grant->rnti, mcs_idx); + pdsch_cfg->sch_cfg.mcs_table, grant->dci_format, grant->dci_search_space, grant->rnti_type, mcs_idx); if (m >= SRSLTE_MOD_NITEMS) { return SRSLTE_ERROR; } diff --git a/lib/src/phy/phch/sch_nr.c b/lib/src/phy/phch/sch_nr.c index d89850698..a1c3e52de 100644 --- a/lib/src/phy/phch/sch_nr.c +++ b/lib/src/phy/phch/sch_nr.c @@ -362,6 +362,11 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, return SRSLTE_ERROR_INVALID_INPUTS; } + if (!tb->softbuffer.tx) { + ERROR("Error: Missing Tx softbuffer\n"); + return SRSLTE_ERROR; + } + const uint8_t* input_ptr = data; uint8_t* output_ptr = e_bits; @@ -402,7 +407,7 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, // Calculate TB CRC uint32_t checksum_tb = srslte_crc_checksum_byte(cfg.crc_tb, data, tb->tbs); if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("Encode: "); + INFO("tb="); srslte_vec_fprint_byte(stdout, data, tb->tbs / 8); } @@ -437,7 +442,7 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, } if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("CB %d:", r); + INFO("cb%d=", r); srslte_vec_fprint_byte(stdout, input_ptr, cb_len / 8); } @@ -456,6 +461,11 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, // Encode code block srslte_ldpc_encoder_encode(cfg.encoder, q->temp_cb, rm_buffer, cfg.Kr); + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + INFO("encoded="); + srslte_vec_fprint_b(stdout, rm_buffer, cfg.encoder->liftN - 2 * cfg.encoder->ls); + } } // Skip block From 808bb3fb946ebc31e67c345bf61fce3764690187 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 22 Dec 2020 10:42:56 +0100 Subject: [PATCH 004/138] Fix string to modulation conversion and apply clang-format --- lib/include/srslte/phy/common/phy_common.h | 2 +- lib/src/phy/common/phy_common.c | 54 ++++++++++++---------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/lib/include/srslte/phy/common/phy_common.h b/lib/include/srslte/phy/common/phy_common.h index 79abeabac..7bb1d1161 100644 --- a/lib/include/srslte/phy/common/phy_common.h +++ b/lib/include/srslte/phy/common/phy_common.h @@ -453,7 +453,7 @@ SRSLTE_API float srslte_coderate(uint32_t tbs, uint32_t nof_re); SRSLTE_API char* srslte_cp_string(srslte_cp_t cp); -SRSLTE_API srslte_mod_t srslte_str2mod(char* mod_str); +SRSLTE_API srslte_mod_t srslte_str2mod(const char* mod_str); SRSLTE_API char* srslte_mod_string(srslte_mod_t mod); diff --git a/lib/src/phy/common/phy_common.c b/lib/src/phy/common/phy_common.c index 46773bb1e..095a2085a 100644 --- a/lib/src/phy/common/phy_common.c +++ b/lib/src/phy/common/phy_common.c @@ -86,14 +86,14 @@ void srslte_cell_fprint(FILE* stream, srslte_cell_t* cell, uint32_t sfn) // TDD uplink-downlink configurations. // TS 36.211 v8.9.0 Table 4.2-2. -static const srslte_tdd_sf_t tdd_sf[SRSLTE_MAX_TDD_SF_CONFIGS][SRSLTE_NOF_SF_X_FRAME] = - {{D, S, U, U, U, D, S, U, U, U}, - {D, S, U, U, D, D, S, U, U, D}, - {D, S, U, D, D, D, S, U, D, D}, - {D, S, U, U, U, D, D, D, D, D}, - {D, S, U, U, D, D, D, D, D, D}, - {D, S, U, D, D, D, D, D, D, D}, - {D, S, U, U, U, D, S, U, U, D}}; +static const srslte_tdd_sf_t tdd_sf[SRSLTE_MAX_TDD_SF_CONFIGS][SRSLTE_NOF_SF_X_FRAME] = { + {D, S, U, U, U, D, S, U, U, U}, + {D, S, U, U, D, D, S, U, U, D}, + {D, S, U, D, D, D, S, U, D, D}, + {D, S, U, U, U, D, D, D, D, D}, + {D, S, U, U, D, D, D, D, D, D}, + {D, S, U, D, D, D, D, D, D, D}, + {D, S, U, U, U, D, S, U, U, D}}; #undef D #undef U @@ -128,17 +128,16 @@ uint32_t srslte_sfidx_tdd_nof_dw_slot(srslte_tdd_config_t tdd_config, uint32_t s // Number of DwPTS / GP / UpPTS symbols per subframe. // TS 36.211 v13.13.0 Table 4.2-2. -static const uint32_t tdd_nof_sf_symbols[SRSLTE_MAX_TDD_SS_CONFIGS][3] = - {{3, 10, 1}, - {9, 4, 1}, - {10, 3, 1}, - {11, 2, 1}, - {12, 1, 1}, - {3, 9, 2}, - {9, 3, 2}, - {10, 2, 2}, - {11, 1, 1}, - {6, 6, 2}}; +static const uint32_t tdd_nof_sf_symbols[SRSLTE_MAX_TDD_SS_CONFIGS][3] = {{3, 10, 1}, + {9, 4, 1}, + {10, 3, 1}, + {11, 2, 1}, + {12, 1, 1}, + {3, 9, 2}, + {9, 3, 2}, + {10, 2, 2}, + {11, 1, 1}, + {6, 6, 2}}; uint32_t srslte_sfidx_tdd_nof_dw(srslte_tdd_config_t tdd_config) { @@ -209,13 +208,18 @@ bool srslte_N_id_1_isvalid(uint32_t N_id_1) } } -srslte_mod_t srslte_str2mod(char* mod_str) +srslte_mod_t srslte_str2mod(const char* str) { - int i = 0; + char mod_str[7] = {}; - /* Upper case */ - while (mod_str[i] &= (~' '), mod_str[++i]) - ; + // Convert letters to upper case + for (uint32_t i = 0; str[i] != '\0' && i < 6; i++) { + char c = str[i]; + if (c >= 'a' && c <= 'z') { + c &= (~' '); + } + mod_str[i] = c; + } if (!strcmp(mod_str, "QPSK")) { return SRSLTE_MOD_QPSK; @@ -857,7 +861,7 @@ const char* srslte_ack_nack_feedback_mode_string(srslte_ack_nack_feedback_mode_t srslte_ack_nack_feedback_mode_t srslte_string_ack_nack_feedback_mode(const char* str) { #define MAX_STR_LEN (8) - int i = 0; + int i = 0; char str2[MAX_STR_LEN] = {}; // Copy string in local buffer From d413c1aaec825d155f4880920c49fdb41711d20d Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 22 Dec 2020 11:39:59 +0100 Subject: [PATCH 005/138] Fix base graph selection and improved PHY LIB logging --- lib/src/phy/phch/sch_nr.c | 91 ++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/lib/src/phy/phch/sch_nr.c b/lib/src/phy/phch/sch_nr.c index a1c3e52de..3be09cb6f 100644 --- a/lib/src/phy/phch/sch_nr.c +++ b/lib/src/phy/phch/sch_nr.c @@ -20,12 +20,15 @@ #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" +#define SCH_INFO_TX(...) INFO("SCH Tx: " __VA_ARGS__) +#define SCH_INFO_RX(...) INFO("SCH Rx: " __VA_ARGS__) + srslte_basegraph_t srslte_sch_nr_select_basegraph(uint32_t tbs, double R) { // if A ≤ 292 , or if A ≤ 3824 and R ≤ 0.67 , or if R ≤ 0 . 25 , LDPC base graph 2 is used; // otherwise, LDPC base graph 1 is used srslte_basegraph_t bg = BG1; - if ((tbs <= 292) || (tbs <= 292 && R <= 0.67) || (R <= 0.25)) { + if ((tbs <= 292) || (tbs <= 3824 && R <= 0.67) || (R <= 0.25)) { bg = BG2; } @@ -110,10 +113,11 @@ int srslte_dlsch_nr_fill_cfg(srslte_sch_nr_t* q, // Calculate Nref uint32_t N_re_lbrm = 156 * sch_nr_n_prb_lbrm(q->carrier.nof_prb); - double R_lbrm = 948.0 / 1024.0; + double TCR_lbrm = 948.0 / 1024.0; uint32_t Qm_lbrm = (sch_cfg->mcs_table == srslte_mcs_table_256qam) ? 8 : 6; - uint32_t TBS_LRBM = srslte_ra_nr_tbs(N_re_lbrm, 1.0, R_lbrm, Qm_lbrm, q->carrier.max_mimo_layers); - cfg->Nref = ceil(TBS_LRBM / (cbsegm.C * 2.0 / 3.0)); + uint32_t TBS_LRBM = srslte_ra_nr_tbs(N_re_lbrm, 1.0, TCR_lbrm, Qm_lbrm, q->carrier.max_mimo_layers); + double R = 2.0 / 3.0; + cfg->Nref = ceil(TBS_LRBM / (cbsegm.C * R)); // Calculate number of code blocks after applying CBGTI... not implemented, activate all CB for (uint32_t r = 0; r < cbsegm.C; r++) { @@ -406,8 +410,8 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, // Calculate TB CRC uint32_t checksum_tb = srslte_crc_checksum_byte(cfg.crc_tb, data, tb->tbs); - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - INFO("tb="); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("tb="); srslte_vec_fprint_byte(stdout, data, tb->tbs / 8); } @@ -435,14 +439,14 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, // Append TB CRC uint8_t* ptr = &q->temp_cb[cb_len]; srslte_bit_unpack(checksum_tb, &ptr, cfg.L_tb); - INFO("CB %d: appending TB CRC=%06x\n", r, checksum_tb); + SCH_INFO_TX("CB %d: appending TB CRC=%06x\n", r, checksum_tb); } else { // Copy payload srslte_bit_unpack_vector(input_ptr, q->temp_cb, (int)cb_len); } - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - INFO("cb%d=", r); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("cb%d=", r); srslte_vec_fprint_byte(stdout, input_ptr, cb_len / 8); } @@ -451,7 +455,7 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, // Attach code block CRC if required if (cfg.L_cb) { srslte_crc_attach(&q->crc_cb, q->temp_cb, (int)(cfg.Kp - cfg.L_cb)); - INFO("CB %d: CRC=%06x\n", r, (uint32_t)srslte_crc_checksum_get(&q->crc_cb)); + SCH_INFO_TX("CB %d: CRC=%06x\n", r, (uint32_t)srslte_crc_checksum_get(&q->crc_cb)); } // Insert filler bits @@ -462,8 +466,8 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, // Encode code block srslte_ldpc_encoder_encode(cfg.encoder, q->temp_cb, rm_buffer, cfg.Kr); - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - INFO("encoded="); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("encoded="); srslte_vec_fprint_b(stdout, rm_buffer, cfg.encoder->liftN - 2 * cfg.encoder->ls); } } @@ -478,15 +482,15 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, j++; // LDPC Rate matching - INFO("RM CB %d: E=%d; F=%d; BG=%d; Z=%d; RV=%d; Qm=%d; Nref=%d;\n", - r, - E, - cfg.F, - cfg.bg == BG1 ? 1 : 2, - cfg.Z, - tb->rv, - cfg.Qm, - cfg.Nref); + SCH_INFO_TX("RM CB %d: E=%d; F=%d; BG=%d; Z=%d; RV=%d; Qm=%d; Nref=%d;\n", + r, + E, + cfg.F, + cfg.bg == BG1 ? 1 : 2, + cfg.Z, + tb->rv, + cfg.Qm, + cfg.Nref); srslte_ldpc_rm_tx(&q->tx_rm, rm_buffer, output_ptr, E, cfg.bg, cfg.Z, tb->rv, tb->mod, cfg.Nref); output_ptr += E; } @@ -548,7 +552,7 @@ int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, if (decoded) { cb_ok++; } - INFO("RM CB %d: Disabled, CRC %s ... Skipping\n", r, decoded ? "OK" : "KO"); + SCH_INFO_RX("RM CB %d: Disabled, CRC %s ... Skipping\n", r, decoded ? "OK" : "KO"); continue; } @@ -558,21 +562,21 @@ int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, // Skip CB if it has a matched CRC if (decoded) { - INFO("RM CB %d: CRC OK ... Skipping\n", r); + SCH_INFO_RX("RM CB %d: CRC OK ... Skipping\n", r); cb_ok++; continue; } // LDPC Rate matching - INFO("RM CB %d: E=%d; F=%d; BG=%d; Z=%d; RV=%d; Qm=%d; Nref=%d;\n", - r, - E, - cfg.F, - cfg.bg == BG1 ? 1 : 2, - cfg.Z, - tb->rv, - cfg.Qm, - cfg.Nref); + SCH_INFO_RX("RM CB %d: E=%d; F=%d; BG=%d; Z=%d; RV=%d; Qm=%d; Nref=%d;\n", + r, + E, + cfg.F, + cfg.bg == BG1 ? 1 : 2, + cfg.Z, + tb->rv, + cfg.Qm, + cfg.Nref); srslte_ldpc_rm_rx_c(&q->rx_rm, input_ptr, rm_buffer, E, cfg.F, cfg.bg, cfg.Z, tb->rv, tb->mod, cfg.Nref); // Decode @@ -586,12 +590,12 @@ int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, uint32_t checksum2 = srslte_bit_pack(&ptr, cfg.L_cb); tb->softbuffer.rx->cb_crc[r] = (checksum1 == checksum2); - INFO("CB %d/%d: CRC={%06x, %06x} ... %s\n", - r, - cfg.C, - checksum1, - checksum2, - tb->softbuffer.rx->cb_crc[r] ? "OK" : "KO"); + SCH_INFO_RX("CB %d/%d: CRC={%06x, %06x} ... %s\n", + r, + cfg.C, + checksum1, + checksum2, + tb->softbuffer.rx->cb_crc[r] ? "OK" : "KO"); } else { tb->softbuffer.rx->cb_crc[r] = true; } @@ -621,11 +625,10 @@ int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, srslte_vec_u8_copy(output_ptr, tb->softbuffer.rx->data[r], cb_len / 8); output_ptr += cb_len / 8; - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("CB %d:", r); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("CB %d:", r); srslte_vec_fprint_byte(stdout, tb->softbuffer.rx->data[r], cb_len / 8); } - if (r == cfg.C - 1) { uint8_t tb_crc_unpacked[24] = {}; uint8_t* tb_crc_unpacked_ptr = tb_crc_unpacked; @@ -638,9 +641,9 @@ int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, uint32_t checksum1 = srslte_crc_checksum_byte(cfg.crc_tb, data, tb->tbs); *crc_ok = (checksum1 == checksum2); - INFO("TB: TBS=%d; CRC={%06x, %06x}\n", tb->tbs, checksum1, checksum2); - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("Decode: "); + SCH_INFO_RX("TB: TBS=%d; CRC={%06x, %06x}\n", tb->tbs, checksum1, checksum2); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("Decode: "); srslte_vec_fprint_byte(stdout, data, tb->tbs / 8); } } else { From 13443c3f8c3372b79705698df48ffa3c505a4aa0 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 22 Dec 2020 11:45:39 +0100 Subject: [PATCH 006/138] Added number of DMRS CDM groups without data to NR grant --- lib/include/srslte/phy/phch/pdsch_cfg_nr.h | 4 + lib/include/srslte/phy/ue/ue_dl_nr_data.h | 11 ++ lib/src/phy/ch_estimation/dmrs_pdsch.c | 55 +++++- .../phy/ch_estimation/test/dmrs_pdsch_test.c | 47 +++-- lib/src/phy/phch/pdsch_nr.c | 186 +++++++++++++++--- lib/src/phy/phch/ra_nr.c | 5 + lib/src/phy/phch/test/pdsch_nr_test.c | 15 +- lib/src/phy/ue/ue_dl_nr_data.c | 25 +++ lib/test/phy/phy_dl_nr_test.c | 5 +- 9 files changed, 293 insertions(+), 60 deletions(-) diff --git a/lib/include/srslte/phy/phch/pdsch_cfg_nr.h b/lib/include/srslte/phy/phch/pdsch_cfg_nr.h index 2d7f5050b..a0ec54b04 100644 --- a/lib/include/srslte/phy/phch/pdsch_cfg_nr.h +++ b/lib/include/srslte/phy/phch/pdsch_cfg_nr.h @@ -119,6 +119,10 @@ typedef struct SRSLTE_API { /// Frequency domain resources bool prb_idx[SRSLTE_MAX_PRB_NR]; + /// Number of DMRS groups without data + /// Described in TS 38.214 Section 5.1.6.2 + uint32_t nof_dmrs_cdm_groups_without_data; + /// Spatial resources uint32_t nof_layers; diff --git a/lib/include/srslte/phy/ue/ue_dl_nr_data.h b/lib/include/srslte/phy/ue/ue_dl_nr_data.h index f5cd0ca6c..c70beea80 100644 --- a/lib/include/srslte/phy/ue/ue_dl_nr_data.h +++ b/lib/include/srslte/phy/ue/ue_dl_nr_data.h @@ -58,6 +58,17 @@ SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocat SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t m, srslte_dmrs_pdsch_typeA_pos_t dmrs_typeA_pos, srslte_pdsch_grant_nr_t* grant); +/** + * @brief Calculates the number of PDSCH-DMRS CDM groups without data for DCI format 1_0 + * + * @remark Defined by TS 38.214 V15.10.0 5.1.6.1.3 CSI-RS for mobility + * + * @param pdsch_cfg PDSCH NR configuration by upper layers + * @param[out] grant Provides grant pointer to fill + * @return Returns SRSLTE_SUCCESS if the provided data is valid, otherwise it returns SRSLTE_ERROR code + */ +SRSLTE_API int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_pdsch_cfg_nr_t* pdsch_cfg, + srslte_pdsch_grant_nr_t* grant); #ifdef __cplusplus } diff --git a/lib/src/phy/ch_estimation/dmrs_pdsch.c b/lib/src/phy/ch_estimation/dmrs_pdsch.c index a302f6c38..16b652dab 100644 --- a/lib/src/phy/ch_estimation/dmrs_pdsch.c +++ b/lib/src/phy/ch_estimation/dmrs_pdsch.c @@ -201,8 +201,7 @@ static int srslte_dmrs_pdsch_put_symbol(srslte_dmrs_pdsch_t* q, } // Get contiguous pilots - pilot_count += srslte_dmrs_put_pilots( - q, &sequence_state, dmrs_cfg->type, prb_start, prb_count, delta, &symbols[prb_start * SRSLTE_NRE]); + pilot_count += srslte_dmrs_put_pilots(q, &sequence_state, dmrs_cfg->type, prb_start, prb_count, delta, symbols); // Reset counter prb_count = 0; @@ -317,6 +316,12 @@ static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_double(const srslte_ return SRSLTE_ERROR; } + // According to Table 7.4.1.1.2-4, the additional position 3 is invalid. + if (dmrs_cfg->additional_pos == srslte_dmrs_pdsch_add_pos_3) { + ERROR("Invalid additional DMRS (%d)\n", dmrs_cfg->additional_pos); + return SRSLTE_ERROR; + } + // l0 = 3 if the higher-layer parameter dmrs-TypeA-Position is equal to 'pos3' and l0 = 2 otherwise int l0 = (dmrs_cfg->typeA_pos == srslte_dmrs_pdsch_typeA_pos_3) ? 3 : 2; @@ -414,6 +419,19 @@ int srslte_dmrs_pdsch_get_sc_idx(const srslte_pdsch_dmrs_cfg_t* cfg, uint32_t ma int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, const srslte_pdsch_grant_nr_t* grant) { + const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = + grant->mapping == srslte_pdsch_mapping_type_A ? &cfg->dmrs_cfg_typeA : &cfg->dmrs_cfg_typeB; + + if (grant->nof_dmrs_cdm_groups_without_data < 1 || grant->nof_dmrs_cdm_groups_without_data > 3) { + ERROR("Invalid number if DMRS CDM groups without data (%d). Valid values: 1, 2 , 3\n", + grant->nof_dmrs_cdm_groups_without_data); + return SRSLTE_ERROR; + } + + // Get number of frequency domain resource elements used for DMRS + int nof_sc = SRSLTE_MIN( + SRSLTE_NRE, grant->nof_dmrs_cdm_groups_without_data * (dmrs_cfg->type == srslte_dmrs_pdsch_type_1 ? 6 : 4)); + // Get number of symbols used for DMRS uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS] = {}; int ret = srslte_dmrs_pdsch_get_symbols_idx(cfg, grant, symbols); @@ -422,7 +440,7 @@ int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, const srslte_p return SRSLTE_ERROR; } - return SRSLTE_NRE * ret; + return nof_sc * ret; } static uint32_t srslte_dmrs_pdsch_seed(const srslte_carrier_nr_t* carrier, @@ -733,11 +751,34 @@ int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, } if (symbols[symbol_idx] == l) { - continue; + switch (dmrs_cfg->type) { + + case srslte_dmrs_pdsch_type_1: + // Skip if there is no data to read + if (grant->nof_dmrs_cdm_groups_without_data != 1) { + continue; + } + for (uint32_t i = 1; i < nof_re_x_symbol; i += 2) { + chest_res->ce[0][0][count] = ce[i]; + count++; + } + break; + case srslte_dmrs_pdsch_type_2: + // Skip if there is no data to read + if (grant->nof_dmrs_cdm_groups_without_data != 1 && grant->nof_dmrs_cdm_groups_without_data != 2) { + continue; + } + for (uint32_t i = grant->nof_dmrs_cdm_groups_without_data * 2; i < nof_re_x_symbol; i += 6) { + uint32_t nof_re = (3 - grant->nof_dmrs_cdm_groups_without_data) * 2; + srslte_vec_cf_copy(&chest_res->ce[0][0][count], &ce[i], nof_re); + count += nof_re; + } + break; + } + } else { + srslte_vec_cf_copy(&chest_res->ce[0][0][count], ce, nof_re_x_symbol); + count += nof_re_x_symbol; } - - srslte_vec_cf_copy(&chest_res->ce[0][0][count], ce, nof_re_x_symbol); - count += nof_re_x_symbol; } // Set other values in the estimation result chest_res->nof_re = count; diff --git a/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c b/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c index 1e2de636f..4d5460f9d 100644 --- a/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c +++ b/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c @@ -216,9 +216,10 @@ static int run_test(srslte_dmrs_pdsch_t* dmrs_pdsch, srslte_dl_slot_cfg_t slot_cfg = {}; for (slot_cfg.idx = 0; slot_cfg.idx < SRSLTE_NSLOTS_PER_FRAME_NR(dmrs_pdsch->carrier.numerology); slot_cfg.idx++) { - srslte_dmrs_pdsch_put_sf(dmrs_pdsch, &slot_cfg, pdsch_cfg, grant, sf_symbols); + TESTASSERT(srslte_dmrs_pdsch_put_sf(dmrs_pdsch, &slot_cfg, pdsch_cfg, grant, sf_symbols) == SRSLTE_SUCCESS); - srslte_dmrs_pdsch_estimate(dmrs_pdsch, &slot_cfg, pdsch_cfg, grant, sf_symbols, chest_res); + TESTASSERT(srslte_dmrs_pdsch_estimate(dmrs_pdsch, &slot_cfg, pdsch_cfg, grant, sf_symbols, chest_res) == + SRSLTE_SUCCESS); float mse = 0.0f; for (uint32_t i = 0; i < chest_res->nof_re; i++) { @@ -294,6 +295,12 @@ int main(int argc, char** argv) srslte_dmrs_pdsch_len_t max_len_begin = srslte_dmrs_pdsch_len_1; srslte_dmrs_pdsch_len_t max_len_end = srslte_dmrs_pdsch_len_2; + // Only single DMRS symbols can have additional positions 2 and 3 + if (pdsch_cfg.dmrs_cfg_typeA.additional_pos == srslte_dmrs_pdsch_add_pos_2 || + pdsch_cfg.dmrs_cfg_typeA.additional_pos == srslte_dmrs_pdsch_add_pos_3) { + max_len_end = srslte_dmrs_pdsch_len_1; + } + for (pdsch_cfg.dmrs_cfg_typeA.length = max_len_begin; pdsch_cfg.dmrs_cfg_typeA.length <= max_len_end; pdsch_cfg.dmrs_cfg_typeA.length++) { @@ -303,28 +310,32 @@ int main(int argc, char** argv) grant.prb_idx[i] = (i < bw); } - // Load default type A grant - srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_cfg_typeA.typeA_pos, &grant); + for (grant.nof_dmrs_cdm_groups_without_data = 1; grant.nof_dmrs_cdm_groups_without_data <= 3; + grant.nof_dmrs_cdm_groups_without_data++) { - // Copy configuration - pdsch_cfg.dmrs_cfg_typeB = pdsch_cfg.dmrs_cfg_typeA; + // Load default type A grant + srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_cfg_typeA.typeA_pos, &grant); - int n = run_test(&dmrs_pdsch, &pdsch_cfg, &grant, sf_symbols, &chest_dl_res); + // Copy configuration + pdsch_cfg.dmrs_cfg_typeB = pdsch_cfg.dmrs_cfg_typeA; - if (n == SRSLTE_SUCCESS) { - test_passed++; - } else { - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = grant.mapping == srslte_pdsch_mapping_type_A - ? &pdsch_cfg.dmrs_cfg_typeA - : &pdsch_cfg.dmrs_cfg_typeB; + int n = run_test(&dmrs_pdsch, &pdsch_cfg, &grant, sf_symbols, &chest_dl_res); - char str[64] = {}; - srslte_dmrs_pdsch_cfg_to_str(dmrs_cfg, str, 64); + if (n == SRSLTE_SUCCESS) { + test_passed++; + } else { + const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = grant.mapping == srslte_pdsch_mapping_type_A + ? &pdsch_cfg.dmrs_cfg_typeA + : &pdsch_cfg.dmrs_cfg_typeB; - ERROR("Test %d failed. %s.\n", test_counter, str); - } + char str[64] = {}; + srslte_dmrs_pdsch_cfg_to_str(dmrs_cfg, str, 64); - test_counter++; + ERROR("Test %d failed. %s.\n", test_counter, str); + } + + test_counter++; + } } } } diff --git a/lib/src/phy/phch/pdsch_nr.c b/lib/src/phy/phch/pdsch_nr.c index ad2058bbb..35501f946 100644 --- a/lib/src/phy/phch/pdsch_nr.c +++ b/lib/src/phy/phch/pdsch_nr.c @@ -168,9 +168,129 @@ void srslte_pdsch_nr_free(srslte_pdsch_nr_t* q) if (q->evm_buffer != NULL) { srslte_evm_free(q->evm_buffer); } +} + +/** + * @brief copies a number of countiguous Resource Elements + * @param sf_symbols slot symbols in frequency domain + * @param symbols resource elements + * @param count number of resource elements to copy + * @param put Direction, symbols are copied into sf_symbols if put is true, otherwise sf_symbols are copied into symbols + */ +static void srslte_pdsch_re_cp(cf_t* sf_symbols, cf_t* symbols, uint32_t count, bool put) +{ + if (put) { + srslte_vec_cf_copy(sf_symbols, symbols, count); + } else { + srslte_vec_cf_copy(symbols, sf_symbols, count); + } +} + +/* + * As a RB is 12 RE wide, positions marked as 1 will be used for the 1st CDM group, and the same with group 2: + * + * +---+---+---+---+---+---+---+---+---+---+---+---+ + * | 1 | 1 | 2 | 2 | 1 | 1 | 2 | 2 | 1 | 1 | 2 | 2 | + * +---+---+---+---+---+---+---+---+---+---+---+---+ + * -- k --> + * + * If the number of DMRS CDM groups without data is set to: + * - 1, data is mapped in RE marked as 2 + * - Otherwise, no data is mapped in this symbol + */ +static uint32_t srslte_pdsch_nr_cp_dmrs_type1(const srslte_pdsch_nr_t* q, + const srslte_pdsch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) +{ + uint32_t count = 0; + uint32_t delta = 0; + + if (grant->nof_dmrs_cdm_groups_without_data != 1) { + return count; + } + + for (uint32_t i = 0; i < q->carrier.nof_prb; i++) { + if (grant->prb_idx[i]) { + for (uint32_t j = 0; j < SRSLTE_NRE; j += 2) { + if (put) { + sf_symbols[i * SRSLTE_NRE + delta + j + 1] = symbols[count++]; + } else { + symbols[count++] = sf_symbols[i * SRSLTE_NRE + delta + j + 1]; + } + } + } + } - // Make sure whole structure is fill with zeros - SRSLTE_MEM_ZERO(q, srslte_pdsch_nr_t, 1); + return count; +} + +/* + * As a RB is 12 RE wide, positions marked as 1 will be used for the 1st CDM group, and the same with groups 2 and 3: + * + * +---+---+---+---+---+---+---+---+---+---+---+---+ + * | 1 | 1 | 2 | 2 | 3 | 3 | 1 | 1 | 2 | 2 | 3 | 3 | + * +---+---+---+---+---+---+---+---+---+---+---+---+ + * -- k --> + * + * If the number of DMRS CDM groups without data is set to: + * - 1, data is mapped in RE marked as 2 and 3 + * - 2, data is mapped in RE marked as 3 + * - otherwise, no data is mapped in this symbol + */ +static uint32_t srslte_pdsch_nr_cp_dmrs_type2(const srslte_pdsch_nr_t* q, + const srslte_pdsch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) +{ + uint32_t count = 0; + + if (grant->nof_dmrs_cdm_groups_without_data != 1 && grant->nof_dmrs_cdm_groups_without_data != 2) { + return count; + } + + uint32_t re_offset = (grant->nof_dmrs_cdm_groups_without_data == 1) ? 2 : 4; + uint32_t re_count = (grant->nof_dmrs_cdm_groups_without_data == 1) ? 4 : 2; + + for (uint32_t i = 0; i < q->carrier.nof_prb; i++) { + if (grant->prb_idx[i]) { + // Copy RE between pilot pairs + srslte_pdsch_re_cp(&sf_symbols[i * SRSLTE_NRE + re_offset], &symbols[count], re_count, put); + count += re_count; + + // Copy RE after second pilot + srslte_pdsch_re_cp(&sf_symbols[(i + 1) * SRSLTE_NRE - re_count], &symbols[count], re_count, put); + count += re_count; + } + } + + return count; +} + +static uint32_t srslte_pdsch_nr_cp_dmrs(const srslte_pdsch_nr_t* q, + const srslte_pdsch_cfg_nr_t* cfg, + const srslte_pdsch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) +{ + uint32_t count = 0; + + const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = + grant->mapping == srslte_pdsch_mapping_type_A ? &cfg->dmrs_cfg_typeA : &cfg->dmrs_cfg_typeB; + + switch (dmrs_cfg->type) { + case srslte_dmrs_pdsch_type_1: + count = srslte_pdsch_nr_cp_dmrs_type1(q, grant, symbols, sf_symbols, put); + break; + case srslte_dmrs_pdsch_type_2: + count = srslte_pdsch_nr_cp_dmrs_type2(q, grant, symbols, sf_symbols, put); + break; + } + + return count; } static uint32_t srslte_pdsch_nr_cp_clean(const srslte_pdsch_nr_t* q, @@ -236,8 +356,8 @@ static int srslte_pdsch_nr_cp(const srslte_pdsch_nr_t* q, return SRSLTE_ERROR; } - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("dmrs_l_idx="); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("dmrs_l_idx="); srslte_vec_fprint_i(stdout, (int32_t*)dmrs_l_idx, nof_dmrs_symbols); } @@ -249,12 +369,13 @@ static int srslte_pdsch_nr_cp(const srslte_pdsch_nr_t* q, dmrs_l_count++; } - // Skip DMRS symbol if (l == dmrs_l_idx[dmrs_l_count]) { - continue; + count += srslte_pdsch_nr_cp_dmrs( + q, cfg, grant, &symbols[count], &sf_symbols[l * q->carrier.nof_prb * SRSLTE_NRE], put); + } else { + count += + srslte_pdsch_nr_cp_clean(q, grant, &symbols[count], &sf_symbols[l * q->carrier.nof_prb * SRSLTE_NRE], put); } - - count += srslte_pdsch_nr_cp_clean(q, grant, &symbols[count], &sf_symbols[l * q->carrier.nof_prb * SRSLTE_NRE], put); } return count; @@ -278,6 +399,20 @@ static int srslte_pdsch_nr_get(const srslte_pdsch_nr_t* q, return srslte_pdsch_nr_cp(q, cfg, grant, symbols, sf_symbols, false); } +static uint32_t +pdsch_nr_cinit(const srslte_carrier_nr_t* carrier, const srslte_pdsch_cfg_nr_t* cfg, uint16_t rnti, uint32_t cw_idx) +{ + uint32_t n_id = carrier->id; + if (cfg->scrambling_id_present && SRSLTE_RNTI_ISUSER(rnti)) { + n_id = cfg->scambling_id; + } + uint32_t cinit = (((uint32_t)rnti) << 15U) + (cw_idx << 14U) + n_id; + + INFO("PDSCH: RNTI=%d (0x%x); nid=%d; cinit=%d (0x%x);\n", rnti, rnti, n_id, cinit, cinit); + + return cinit; +} + static inline int pdsch_nr_encode_codeword(srslte_pdsch_nr_t* q, const srslte_pdsch_cfg_nr_t* cfg, const srslte_sch_tb_t* tb, @@ -307,24 +442,20 @@ static inline int pdsch_nr_encode_codeword(srslte_pdsch_nr_t* q, return SRSLTE_ERROR; } - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - INFO("b="); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("b="); srslte_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits); } // 7.3.1.1 Scrambling - uint32_t n_id = q->carrier.id; - if (cfg->scrambling_id_present && SRSLTE_RNTI_ISUSER(rnti)) { - n_id = cfg->scambling_id; - } - uint32_t cinit = ((uint32_t)rnti << 15U) + (tb->cw_idx << 14U) + n_id; + uint32_t cinit = pdsch_nr_cinit(&q->carrier, cfg, rnti, tb->cw_idx); srslte_sequence_apply_bit(q->b[tb->cw_idx], q->b[tb->cw_idx], tb->nof_bits, cinit); // 7.3.1.2 Modulation srslte_mod_modulate(&q->modem_tables[tb->mod], q->b[tb->cw_idx], q->d[tb->cw_idx], tb->nof_bits); - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - INFO("d="); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("d="); srslte_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); } @@ -422,8 +553,8 @@ static inline int pdsch_nr_decode_codeword(srslte_pdsch_nr_t* q, return SRSLTE_ERROR_OUT_OF_BOUNDS; } - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("d="); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("d="); srslte_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); } @@ -444,15 +575,10 @@ static inline int pdsch_nr_decode_codeword(srslte_pdsch_nr_t* q, } // Descrambling - uint32_t n_id = q->carrier.id; - if (cfg->scrambling_id_present && SRSLTE_RNTI_ISUSER(rnti)) { - n_id = cfg->scambling_id; - } - uint32_t cinit = ((uint32_t)rnti << 15U) + (tb->cw_idx << 14U) + n_id; - srslte_sequence_apply_c(llr, llr, tb->nof_bits, cinit); + srslte_sequence_apply_c(llr, llr, tb->nof_bits, pdsch_nr_cinit(&q->carrier, cfg, rnti, tb->cw_idx)); - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - printf("b="); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("b="); srslte_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits); } @@ -501,10 +627,10 @@ int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q, return SRSLTE_ERROR; } - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - INFO("ce="); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("ce="); srslte_vec_fprint_c(stdout, channel->ce[0][0], nof_re); - INFO("x="); + DEBUG("x="); srslte_vec_fprint_c(stdout, q->x[0], nof_re); } diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 6ca60a900..0fe8a71e6 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -303,6 +303,11 @@ uint32_t srslte_ra_nr_tbs(uint32_t N_re, double S, double R, uint32_t Qm, uint32 S = 1.0; } + if (nof_layers == 0) { + ERROR("Incorrect number of layers (%d). Setting to 1.\n", nof_layers); + nof_layers = 1; + } + // 2) Intermediate number of information bits (N info ) is obtained by N inf o = N RE · R · Q m · υ . uint32_t n_info = (uint32_t)(N_re * S * R * Qm * nof_layers); diff --git a/lib/src/phy/phch/test/pdsch_nr_test.c b/lib/src/phy/phch/test/pdsch_nr_test.c index 1efa496b2..266c98711 100644 --- a/lib/src/phy/phch/test/pdsch_nr_test.c +++ b/lib/src/phy/phch/test/pdsch_nr_test.c @@ -19,7 +19,7 @@ #include static srslte_carrier_nr_t carrier = { - 0, // cell_id + 1, // cell_id 0, // numerology SRSLTE_MAX_PRB_NR, // nof_prb 0, // start @@ -30,6 +30,7 @@ static uint32_t n_prb = 0; // Set to 0 for steering static uint32_t mcs = 30; // Set to 30 for steering static srslte_pdsch_cfg_nr_t pdsch_cfg = {}; static srslte_pdsch_grant_nr_t pdsch_grant = {}; +static uint16_t rnti = 0x1234; void usage(char* prog) { @@ -85,14 +86,14 @@ int main(int argc, char** argv) cf_t* sf_symbols[SRSLTE_MAX_LAYERS_NR] = {}; // Set default PDSCH configuration - pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam; + pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam; if (parse_args(argc, argv) < SRSLTE_SUCCESS) { goto clean_exit; } srslte_pdsch_nr_args_t pdsch_args = {}; - pdsch_args.sch.disable_simd = true; + pdsch_args.sch.disable_simd = false; pdsch_args.measure_evm = true; if (srslte_pdsch_nr_init_enb(&pdsch_tx, &pdsch_args) < SRSLTE_SUCCESS) { @@ -155,8 +156,16 @@ int main(int argc, char** argv) ERROR("Error loading default grant\n"); goto clean_exit; } + + // Load number of DMRS CDM groups without data + if (srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(&pdsch_cfg, &pdsch_grant) < SRSLTE_SUCCESS) { + ERROR("Error loading number of DMRS CDM groups without data\n"); + goto clean_exit; + } + pdsch_grant.nof_layers = carrier.max_mimo_layers; pdsch_grant.dci_format = srslte_dci_format_nr_1_0; + pdsch_grant.rnti = rnti; uint32_t n_prb_start = 1; uint32_t n_prb_end = carrier.nof_prb + 1; diff --git a/lib/src/phy/ue/ue_dl_nr_data.c b/lib/src/phy/ue/ue_dl_nr_data.c index 53100790a..60ef76b91 100644 --- a/lib/src/phy/ue/ue_dl_nr_data.c +++ b/lib/src/phy/ue/ue_dl_nr_data.c @@ -128,5 +128,30 @@ int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t return SRSLTE_ERROR; } + return SRSLTE_SUCCESS; +} + +int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_pdsch_cfg_nr_t* pdsch_cfg, + srslte_pdsch_grant_nr_t* grant) +{ + if (pdsch_cfg == NULL || grant == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = + grant->mapping == srslte_pdsch_mapping_type_A ? &pdsch_cfg->dmrs_cfg_typeA : &pdsch_cfg->dmrs_cfg_typeB; + + /* According to TS 38.214 V15.10.0 5.1.6.1.3 CSI-RS for mobility: + * When receiving PDSCH scheduled by DCI format 1_0, the UE shall assume the number of DM-RS CDM groups without data + * is 1 which corresponds to CDM group 0 for the case of PDSCH with allocation duration of 2 symbols, and the UE shall + * assume that the number of DM-RS CDM groups without data is 2 which corresponds to CDM group {0,1} for all other + * cases. + */ + if (dmrs_cfg->length == srslte_dmrs_pdsch_len_2) { + grant->nof_dmrs_cdm_groups_without_data = 1; + } else { + grant->nof_dmrs_cdm_groups_without_data = 2; + } + return SRSLTE_SUCCESS; } \ No newline at end of file diff --git a/lib/test/phy/phy_dl_nr_test.c b/lib/test/phy/phy_dl_nr_test.c index 316cd8c68..e790788d9 100644 --- a/lib/test/phy/phy_dl_nr_test.c +++ b/lib/test/phy/phy_dl_nr_test.c @@ -259,8 +259,9 @@ int main(int argc, char** argv) ERROR("Error loading default grant\n"); goto clean_exit; } - pdsch_grant.nof_layers = carrier.max_mimo_layers; - pdsch_grant.dci_format = srslte_dci_format_nr_1_0; + pdsch_grant.nof_layers = carrier.max_mimo_layers; + pdsch_grant.dci_format = srslte_dci_format_nr_1_0; + pdsch_grant.nof_dmrs_cdm_groups_without_data = 1; uint32_t n_prb_start = 1; uint32_t n_prb_end = carrier.nof_prb + 1; From 2e59f6a568a549fd1d38faeec1d7d4d95388af36 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 22 Dec 2020 11:57:12 +0100 Subject: [PATCH 007/138] Applied LDPC fixes and minor aestheic modifications --- lib/include/srslte/phy/fec/ldpc/base_graph.h | 4 +- lib/include/srslte/phy/fec/ldpc/ldpc_rm.h | 3 +- lib/src/phy/fec/ldpc/ldpc_dec_all.h | 6 ++- lib/src/phy/fec/ldpc/ldpc_dec_c_avx2.c | 3 +- lib/src/phy/fec/ldpc/ldpc_dec_c_avx2_flood.c | 3 +- lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long.c | 3 +- .../phy/fec/ldpc/ldpc_dec_c_avx2long_flood.c | 3 +- lib/src/phy/fec/ldpc/ldpc_enc_all.h | 6 +-- lib/src/phy/fec/ldpc/ldpc_enc_c.c | 15 ++++--- .../phy/fec/ldpc/test/ldpc_rm_chain_test.c | 40 ++++++++++++++----- 10 files changed, 57 insertions(+), 29 deletions(-) diff --git a/lib/include/srslte/phy/fec/ldpc/base_graph.h b/lib/include/srslte/phy/fec/ldpc/base_graph.h index c068dd662..2ccc61bc9 100644 --- a/lib/include/srslte/phy/fec/ldpc/base_graph.h +++ b/lib/include/srslte/phy/fec/ldpc/base_graph.h @@ -34,7 +34,9 @@ #define SRSLTE_LDPC_BG1_MAX_LEN_CB 8448 /*!< \brief Maximum code block size for LDPC BG1 */ #define SRSLTE_LDPC_BG2_MAX_LEN_CB 3840 /*!< \brief Maximum code block size for LDPC BG2 */ -#define SRSLTE_LDPC_MAX_LEN_CB SRSLTE_MAX(SRSLTE_LDPC_BG1_MAX_LEN_CB, SRSLTE_LDPC_BG2_MAX_LEN_CB) +#define SRSLTE_LDPC_MAX_LEN_CB \ + SRSLTE_MAX(SRSLTE_LDPC_BG1_MAX_LEN_CB, \ + SRSLTE_LDPC_BG2_MAX_LEN_CB) /*!< \brief Maximum code block size for LDPC BG1 or BG2 */ #define BG1Nfull 68 /*!< \brief Number of variable nodes in BG1. */ #define BG1N 66 /*!< \brief Number of variable nodes in BG1 after puncturing. */ diff --git a/lib/include/srslte/phy/fec/ldpc/ldpc_rm.h b/lib/include/srslte/phy/fec/ldpc/ldpc_rm.h index 7cd84ab03..cf5b87c9e 100644 --- a/lib/include/srslte/phy/fec/ldpc/ldpc_rm.h +++ b/lib/include/srslte/phy/fec/ldpc/ldpc_rm.h @@ -133,8 +133,7 @@ SRSLTE_API int srslte_ldpc_rm_rx_init_s(srslte_ldpc_rm_t* q); * \param[in] rv Redundancy version 0,1,2,3. * \param[in] mod_type Modulation type. * \param[in] Nref Size of limited buffer. - * \param[out] output The rate-dematched codeword resulting from the rate-dematching - * operation. + * \return An integer: 0 if the function executes correctly, -1 otherwise. */ SRSLTE_API int srslte_ldpc_rm_rx_s(srslte_ldpc_rm_t* q, const int16_t* input, diff --git a/lib/src/phy/fec/ldpc/ldpc_dec_all.h b/lib/src/phy/fec/ldpc/ldpc_dec_all.h index 145f89db9..9387b8f57 100644 --- a/lib/src/phy/fec/ldpc/ldpc_dec_all.h +++ b/lib/src/phy/fec/ldpc/ldpc_dec_all.h @@ -366,7 +366,8 @@ int update_ldpc_soft_bits_c_avx2(void* p, int i_layer, const int8_t (*these_var_ /*! * Returns the decoded message (hard bits) from the current soft bits (optimized 8-bit version, LS <= \ref - * SRSLTE_AVX2_B_SIZE). \param[in] p A pointer to the decoder registers (an ldpc_regs_c_avx2 structure). + * SRSLTE_AVX2_B_SIZE). + * \param[in] p A pointer to the decoder registers (an ldpc_regs_c_avx2 structure). * \param[out] message A pointer to the decoded message. * \param[in] liftK The length of the decoded message. * \return An integer: 0 if the function executes correctly, -1 otherwise. @@ -375,7 +376,8 @@ int extract_ldpc_message_c_avx2(void* p, uint8_t* message, uint16_t liftK); /*! * Creates the registers used by the optimized 8-bit-based implementation of the LDPC decoder (LS > \ref - * SRSLTE_AVX2_B_SIZE). \param[in] bgN Codeword length. \param[in] bgM Number of check nodes. + * SRSLTE_AVX2_B_SIZE). + * \param[in] bgN Codeword length. \param[in] bgM Number of check nodes. * \param[in] ls Lifting size. \param[in] scaling_fctr Scaling factor of the normalized min-sum algorithm. * \return A pointer to the created registers (an ldpc_regs_c_avx2long structure). */ diff --git a/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2.c b/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2.c index 1bb973feb..e7ac42de3 100644 --- a/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2.c +++ b/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2.c @@ -180,7 +180,8 @@ void* create_ldpc_dec_c_avx2(uint8_t bgN, uint8_t bgM, uint16_t ls, float scalin vp->hrr = hrr; vp->ls = ls; - vp->scaling_fctr = _mm256_set1_epi16((uint16_t)(scaling_fctr * F2I)); + // correction > 1/16 to compensate the scaling error (2^16-1)/2^16 incurred in _mm256_scalei_epi8 + vp->scaling_fctr = _mm256_set1_epi16((uint16_t)((scaling_fctr + 0.00001525879) * F2I)); return vp; } diff --git a/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2_flood.c b/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2_flood.c index 0ee5f1fdb..0975891f8 100644 --- a/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2_flood.c +++ b/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2_flood.c @@ -190,7 +190,8 @@ void* create_ldpc_dec_c_avx2_flood(uint8_t bgN, uint8_t bgM, uint16_t ls, float vp->hrr = hrr; vp->ls = ls; - vp->scaling_fctr = _mm256_set1_epi16((uint16_t)(scaling_fctr * F2I)); + // correction > 1/16 to compensate the scaling error (2^16-1)/2^16 incurred in _mm256_scalei_epi8 + vp->scaling_fctr = _mm256_set1_epi16((uint16_t)((scaling_fctr + 0.00001525879) * F2I)); return vp; } diff --git a/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long.c b/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long.c index 9626ae3a0..9ccc203d6 100644 --- a/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long.c +++ b/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long.c @@ -227,7 +227,8 @@ void* create_ldpc_dec_c_avx2long(uint8_t bgN, uint8_t bgM, uint16_t ls, float sc vp->n_subnodes = n_subnodes; - vp->scaling_fctr = _mm256_set1_epi16((uint16_t)(scaling_fctr * F2I)); + // correction > 1/16 to compensate the scaling error (2^16-1)/2^16 incurred in _mm256_scalei_epi8 + vp->scaling_fctr = _mm256_set1_epi16((uint16_t)((scaling_fctr + 0.00001525879) * F2I)); return vp; } diff --git a/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long_flood.c b/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long_flood.c index d50389b36..920b853ba 100644 --- a/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long_flood.c +++ b/lib/src/phy/fec/ldpc/ldpc_dec_c_avx2long_flood.c @@ -240,7 +240,8 @@ void* create_ldpc_dec_c_avx2long_flood(uint8_t bgN, uint8_t bgM, uint16_t ls, fl vp->n_subnodes = n_subnodes; - vp->scaling_fctr = _mm256_set1_epi16((uint16_t)(scaling_fctr * F2I)); + // correction > 1/16 to compensate the scaling error (2^16-1)/2^16 incurred in _mm256_scalei_epi8 + vp->scaling_fctr = _mm256_set1_epi16((uint16_t)((scaling_fctr + 0.00001525879) * F2I)); return vp; } diff --git a/lib/src/phy/fec/ldpc/ldpc_enc_all.h b/lib/src/phy/fec/ldpc/ldpc_enc_all.h index d4c5c969c..38ce30a60 100644 --- a/lib/src/phy/fec/ldpc/ldpc_enc_all.h +++ b/lib/src/phy/fec/ldpc/ldpc_enc_all.h @@ -108,17 +108,17 @@ void preprocess_systematic_bits_avx2(srslte_ldpc_encoder_t* q); void encode_high_rate_case1_avx2(void* o); /*! Computes the high-rate parity bits for BG1 and ls_index in {6} (SIMD-optimized version, LS <= \ref - * SRSLTE_AVX2_B_SIZE). \param[in,out] q A pointer to an encoder. + * SRSLTE_AVX2_B_SIZE). \param[in,out] o A pointer to an encoder. */ void encode_high_rate_case2_avx2(void* o); /*! Computes the high-rate parity bits for BG2 and ls_index in {0, 1, 2, 4, 5, 6} (SIMD-optimized version, LS <= \ref - * SRSLTE_AVX2_B_SIZE). \param[in,out] q A pointer to an encoder. + * SRSLTE_AVX2_B_SIZE). \param[in,out] o A pointer to an encoder. */ void encode_high_rate_case3_avx2(void* o); /*! Computes the high-rate parity bits for BG2 and ls_index in {3, 7} (SIMD-optimized version, LS <= \ref - * SRSLTE_AVX2_B_SIZE). \param[in,out] q A pointer to an encoder. + * SRSLTE_AVX2_B_SIZE). \param[in,out] o A pointer to an encoder. */ void encode_high_rate_case4_avx2(void* o); diff --git a/lib/src/phy/fec/ldpc/ldpc_enc_c.c b/lib/src/phy/fec/ldpc/ldpc_enc_c.c index 1650bdbc4..0b3c8a427 100644 --- a/lib/src/phy/fec/ldpc/ldpc_enc_c.c +++ b/lib/src/phy/fec/ldpc/ldpc_enc_c.c @@ -126,9 +126,10 @@ void encode_high_rate_case1(void* q_, uint8_t* output) } } -void encode_high_rate_case2(srslte_ldpc_encoder_t* q, uint8_t* output) +void encode_high_rate_case2(void* q_, uint8_t* output) { - uint8_t(*aux)[q->ls] = q->ptr; + srslte_ldpc_encoder_t* q = (srslte_ldpc_encoder_t*)q_; + uint8_t(*aux)[q->ls] = q->ptr; int ls = q->ls; int i = 0; @@ -155,9 +156,10 @@ void encode_high_rate_case2(srslte_ldpc_encoder_t* q, uint8_t* output) } } -void encode_high_rate_case3(srslte_ldpc_encoder_t* q, uint8_t* output) +void encode_high_rate_case3(void* q_, uint8_t* output) { - uint8_t(*aux)[q->ls] = q->ptr; + srslte_ldpc_encoder_t* q = (srslte_ldpc_encoder_t*)q_; + uint8_t(*aux)[q->ls] = q->ptr; int ls = q->ls; int i = 0; @@ -184,9 +186,10 @@ void encode_high_rate_case3(srslte_ldpc_encoder_t* q, uint8_t* output) } } -void encode_high_rate_case4(srslte_ldpc_encoder_t* q, uint8_t* output) +void encode_high_rate_case4(void* q_, uint8_t* output) { - uint8_t(*aux)[q->ls] = q->ptr; + srslte_ldpc_encoder_t* q = (srslte_ldpc_encoder_t*)q_; + uint8_t(*aux)[q->ls] = q->ptr; int ls = q->ls; int k = 0; diff --git a/lib/src/phy/fec/ldpc/test/ldpc_rm_chain_test.c b/lib/src/phy/fec/ldpc/test/ldpc_rm_chain_test.c index 3c648466b..1cf7f3340 100644 --- a/lib/src/phy/fec/ldpc/test/ldpc_rm_chain_test.c +++ b/lib/src/phy/fec/ldpc/test/ldpc_rm_chain_test.c @@ -35,6 +35,7 @@ * - **-B \** Number of codewords in a batch.(Default 100). * - **-N \** Max number of simulated batches.(Default 10000). * - **-E \** Minimum number of errors for a significant simulation.(Default 100). + * - **-w \** Rate-matching aware encoding/decoding [(0 or 1)] */ #include @@ -54,11 +55,12 @@ static srslte_basegraph_t base_graph = BG1; /*!< \brief Base Graph (BG1 or BG2). */ static uint32_t lift_size = 2; /*!< \brief Lifting Size. */ static uint32_t rm_length = 0; /*!< \brief Codeword length after rate matching. */ -static uint32_t F = 22 - 5; /*!< \brief Number of filler bits in each CBS. */ +static uint32_t F = 0; /*!< \brief Number of filler bits in each CBS. */ static uint8_t rv = 0; /*!< \brief Redundancy version {0-3}. */ static srslte_mod_t mod_type = SRSLTE_MOD_BPSK; /*!< \brief Modulation type: BPSK, QPSK, QAM16, QAM64, QAM256 = 4 */ static uint32_t Nref = 0; /*!< \brief Limited buffer size. */ static float snr = 0; /*!< \brief Signal-to-Noise Ratio [dB]. */ +static uint8_t rm_aware = 1; /*!< \brief Flag rate matching aware encoding/decoding (1 to enable). */ static int finalK = 0; /*!< \brief Number of uncoded bits (message length, including punctured and filler bits). */ static int finalN = 0; /*!< \brief Number of coded bits (codeword length). */ @@ -74,7 +76,7 @@ static int req_errors = 100; /*!< \brief Minimum number of errors for a signi void usage(char* prog) { - printf("Usage: %s [-bX] [-lX] [-eX] [-fX] [-rX] [-mX] [-MX] [sX]\n", prog); + printf("Usage: %s [-bX] [-lX] [-eX] [-fX] [-rX] [-mX] [-MX] [-wX] [-sX]\n", prog); printf("\t-b Base Graph [(1 or 2) Default %d]\n", base_graph + 1); printf("\t-l Lifting Size [Default %d]\n", lift_size); printf("\t-e Word length after rate matching [Default %d (no rate matching i.e. E = N - F)]\n", rm_length); @@ -86,6 +88,7 @@ void usage(char* prog) printf("\t-B Number of codewords in a batch. [Default %d]\n", batch_size); printf("\t-N Max number of simulated batches. [Default %d]\n", max_n_batch); printf("\t-E Minimum number of errors for a significant simulation. [Default %d]\n", req_errors); + printf("\t-w Rate-matching aware encoding/decoding [(0 or 1) Default = %d (normal buffer Nref = N)]\n", rm_aware); } /*! @@ -94,7 +97,7 @@ void usage(char* prog) void parse_args(int argc, char** argv) { int opt = 0; - while ((opt = getopt(argc, argv, "b:l:e:f:r:m:M:s:B:N:E:")) != -1) { + while ((opt = getopt(argc, argv, "b:l:e:f:r:m:w:M:s:B:N:E:")) != -1) { switch (opt) { case 'b': base_graph = (int)strtol(optarg, NULL, 10) - 1; @@ -117,6 +120,9 @@ void parse_args(int argc, char** argv) case 'M': Nref = (uint32_t)strtol(optarg, NULL, 10); break; + case 'w': + rm_aware = (uint8_t)strtol(optarg, NULL, 10); + break; case 's': snr = (float)strtod(optarg, NULL); break; @@ -338,6 +344,15 @@ int main(int argc, char** argv) int8_t inf7 = (1U << 6U) - 1; float gain_c = inf7 * noise_std_dev / 8 / (1 / noise_std_dev + 2); + // RM aware LDPC Encoding + // compute the number of symbols that we need to encode/decode: at least (rm_length + F) if rm_length +F < N, + unsigned int n_useful_symbols_enc = finalN; + unsigned int n_useful_symbols_dec = finalN; + if (rm_aware > 0) { + n_useful_symbols_enc = (rm_length + F); // if n_useful_symbols > N, the encoder set n_useful_symbols = finalN; + n_useful_symbols_dec = (rm_length + F); // if n_useful_symbols > N, the encoder set n_useful_symbols = finalN; + } + printf("\nBatch:\n "); while (((n_error_words_f < req_errors) || (n_error_words_s < req_errors) || (n_error_words_c < req_errors)) && @@ -363,7 +378,8 @@ int main(int argc, char** argv) gettimeofday(&t[1], NULL); for (j = 0; j < batch_size; j++) { - srslte_ldpc_encoder_encode(&encoder, messages_true + j * finalK, codewords + j * finalN, finalK); + srslte_ldpc_encoder_encode_rm( + &encoder, messages_true + j * finalK, codewords + j * finalN, finalK, n_useful_symbols_enc); } gettimeofday(&t[2], NULL); get_time_interval(t); @@ -425,12 +441,11 @@ int main(int argc, char** argv) // Recover messages gettimeofday(&t[1], NULL); for (j = 0; j < batch_size; j++) { - srslte_ldpc_decoder_decode_f(&decoder_f, symbols + j * finalN, messages_sim_f + j * finalK, finalN); + srslte_ldpc_decoder_decode_f(&decoder_f, symbols + j * finalN, messages_sim_f + j * finalK, n_useful_symbols_dec); } gettimeofday(&t[2], NULL); get_time_interval(t); elapsed_time_dec_f += t[0].tv_sec + 1e-6 * t[0].tv_usec; - for (i = 0; i < batch_size; i++) { for (j = 0; j < finalK; j++) { i_bit = i * finalK + j; @@ -465,7 +480,8 @@ int main(int argc, char** argv) // Recover messages gettimeofday(&t[1], NULL); for (j = 0; j < batch_size; j++) { - srslte_ldpc_decoder_decode_s(&decoder_s, symbols_s + j * finalN, messages_sim_s + j * finalK, finalN); + srslte_ldpc_decoder_decode_s( + &decoder_s, symbols_s + j * finalN, messages_sim_s + j * finalK, n_useful_symbols_dec); } gettimeofday(&t[2], NULL); get_time_interval(t); @@ -504,7 +520,8 @@ int main(int argc, char** argv) // Recover messages gettimeofday(&t[1], NULL); for (j = 0; j < batch_size; j++) { - srslte_ldpc_decoder_decode_rm_c(&decoder_c, symbols_c + j * finalN, messages_sim_c + j * finalK, finalN); + srslte_ldpc_decoder_decode_rm_c( + &decoder_c, symbols_c + j * finalN, messages_sim_c + j * finalK, n_useful_symbols_dec); } gettimeofday(&t[2], NULL); get_time_interval(t); @@ -526,7 +543,7 @@ int main(int argc, char** argv) gettimeofday(&t[1], NULL); for (j = 0; j < batch_size; j++) { srslte_ldpc_decoder_decode_rm_c( - &decoder_c_flood, symbols_c + j * finalN, messages_sim_c_flood + j * finalK, finalN); + &decoder_c_flood, symbols_c + j * finalN, messages_sim_c_flood + j * finalK, n_useful_symbols_dec); } gettimeofday(&t[2], NULL); get_time_interval(t); @@ -548,7 +565,8 @@ int main(int argc, char** argv) // Recover messages gettimeofday(&t[1], NULL); for (j = 0; j < batch_size; j++) { - srslte_ldpc_decoder_decode_rm_c(&decoder_avx, symbols_c + j * finalN, messages_sim_avx + j * finalK, finalN); + srslte_ldpc_decoder_decode_rm_c( + &decoder_avx, symbols_c + j * finalN, messages_sim_avx + j * finalK, n_useful_symbols_dec); } gettimeofday(&t[2], NULL); get_time_interval(t); @@ -570,7 +588,7 @@ int main(int argc, char** argv) gettimeofday(&t[1], NULL); for (j = 0; j < batch_size; j++) { srslte_ldpc_decoder_decode_rm_c( - &decoder_avx_flood, symbols_c + j * finalN, messages_sim_avx_flood + j * finalK, finalN); + &decoder_avx_flood, symbols_c + j * finalN, messages_sim_avx_flood + j * finalK, n_useful_symbols_dec); } gettimeofday(&t[2], NULL); get_time_interval(t); From d0a4b4d4090107137365920f05c8b4e0cdecd9b8 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 22 Dec 2020 15:42:34 +0100 Subject: [PATCH 008/138] Changed DL-SCH LDPC scaling factor for decoding high rates --- lib/src/phy/phch/sch_nr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/phch/sch_nr.c b/lib/src/phy/phch/sch_nr.c index 3be09cb6f..848edb3c5 100644 --- a/lib/src/phy/phch/sch_nr.c +++ b/lib/src/phy/phch/sch_nr.c @@ -266,7 +266,9 @@ int srslte_sch_nr_init_rx(srslte_sch_nr_t* q, const srslte_sch_nr_args_t* args) #endif // LV_HAVE_AVX2 } - float scaling_factor = isnormal(args->decoder_scaling_factor) ? args->decoder_scaling_factor : 0.75f; + // If the scaling factor is not provided use a default value that allows decoding all possible combinations of nPRB + // and MCS indexes for all possible MCS tables + float scaling_factor = isnormal(args->decoder_scaling_factor) ? args->decoder_scaling_factor : 0.8f; // Iterate over all possible lifting sizes for (uint16_t ls = 0; ls <= MAX_LIFTSIZE; ls++) { @@ -673,4 +675,4 @@ int srslte_sch_nr_tb_info(const srslte_sch_tb_t* tb, char* str, uint32_t str_len } return len; -} \ No newline at end of file +} From 909e5de34fab9693662095d6c9fa5e46b3faae7f Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 22 Dec 2020 19:07:54 +0100 Subject: [PATCH 009/138] Fix NR workers --- srsenb/src/phy/nr/cc_worker.cc | 6 ++++++ srsue/hdr/phy/nr/cc_worker.h | 2 +- srsue/src/phy/nr/cc_worker.cc | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/srsenb/src/phy/nr/cc_worker.cc b/srsenb/src/phy/nr/cc_worker.cc index 570008545..b951c1055 100644 --- a/srsenb/src/phy/nr/cc_worker.cc +++ b/srsenb/src/phy/nr/cc_worker.cc @@ -118,6 +118,12 @@ bool cc_worker::work_dl() ERROR("Error loading default grant\n"); return false; } + + if (srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(&pdsch_cfg, &pdsch_grant) < SRSLTE_SUCCESS) { + ERROR("Error loading number of DMRS CDM groups\n"); + return false; + } + pdsch_grant.nof_layers = enb_dl.carrier.max_mimo_layers; pdsch_grant.dci_format = srslte_dci_format_nr_1_0; pdsch_grant.rnti = 0x1234; diff --git a/srsue/hdr/phy/nr/cc_worker.h b/srsue/hdr/phy/nr/cc_worker.h index a51dbdab3..d3566b790 100644 --- a/srsue/hdr/phy/nr/cc_worker.h +++ b/srsue/hdr/phy/nr/cc_worker.h @@ -53,7 +53,7 @@ public: args.dl.nof_max_prb = 100; args.dl.pdsch.measure_evm = true; args.dl.pdsch.measure_time = true; - args.dl.pdsch.sch.disable_simd = true; + args.dl.pdsch.sch.disable_simd = false; } }; diff --git a/srsue/src/phy/nr/cc_worker.cc b/srsue/src/phy/nr/cc_worker.cc index 3e73d6b8e..a380a8bbe 100644 --- a/srsue/src/phy/nr/cc_worker.cc +++ b/srsue/src/phy/nr/cc_worker.cc @@ -74,6 +74,15 @@ bool cc_worker::set_carrier(const srslte_carrier_nr_t* carrier) return false; } + srslte_coreset_t coreset = {}; + coreset.freq_resources[0] = true; // Enable the bottom 6 PRB for PDCCH + coreset.duration = 2; + + if (srslte_ue_dl_nr_set_coreset(&ue_dl, &coreset) < SRSLTE_SUCCESS) { + ERROR("Error setting carrier\n"); + return false; + } + return true; } @@ -108,6 +117,12 @@ bool cc_worker::work_dl() ERROR("Error loading default grant\n"); return false; } + + if (srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(&pdsch_cfg, &pdsch_grant) < SRSLTE_SUCCESS) { + ERROR("Error loading number of DMRS CDM groups\n"); + return false; + } + pdsch_grant.nof_layers = ue_dl.carrier.max_mimo_layers; pdsch_grant.dci_format = srslte_dci_format_nr_1_0; pdsch_grant.rnti = 0x1234; From 3573644624d03e2ac42a6affd48ed06c41ef427c Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 28 Dec 2020 16:01:03 +0100 Subject: [PATCH 010/138] srsue: fix stdout metrics print when scells aren't configured yet during MAC reset, scells are reset to and their PCI is set to UINT32_MAX which results in malformatted stdout prints, see below: Random Access Transmission: seq=16, ra-rnti=0x2 Random Access Transmission: seq=14, ra-rnti=0x2 0 4 -24 24 -1.1u 1.0 140 0.50 0.0 0% 0.0 0.0 0.0 0.0 67% 14294967295 0.0 0.0 -1.1u 0.0 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0% 24294967295 0.0 0.0 -1.1u 0.0 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0% 34294967295 0.0 0.0 -1.1u 0.0 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0% this patch checks the configured PCI value against UINT32_MAX and prints "n/a" in case the scells aren't set yet. --- srsue/src/metrics_stdout.cc | 6 +++++- srsue/test/metrics_test.cc | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/srsue/src/metrics_stdout.cc b/srsue/src/metrics_stdout.cc index d64f3e2e2..86a14afb7 100644 --- a/srsue/src/metrics_stdout.cc +++ b/srsue/src/metrics_stdout.cc @@ -115,7 +115,11 @@ void metrics_stdout::set_metrics(const ue_metrics_t& metrics, const uint32_t per for (uint32_t r = 0; r < metrics.phy.nof_active_cc; r++) { cout << std::setw(2) << r; - cout << std::setw(4) << metrics.phy.info[r].pci << std::setw(0); + if (metrics.phy.info[r].pci != UINT32_MAX) { + cout << std::setw(4) << metrics.phy.info[r].pci << std::setw(0); + } else { + cout << " n/a"; + } cout << float_to_string(metrics.phy.ch[r].rsrp, 2); cout << float_to_string(metrics.phy.ch[r].pathloss, 2); cout << float_to_eng_string(metrics.phy.sync[r].cfo, 2); diff --git a/srsue/test/metrics_test.cc b/srsue/test/metrics_test.cc index a53a7c744..4a951ad3d 100644 --- a/srsue/test/metrics_test.cc +++ b/srsue/test/metrics_test.cc @@ -45,6 +45,7 @@ public: m->stack.mac[0].rx_brate = 200; m->stack.mac[0].nof_tti = 1; + m->phy.info[1].pci = UINT32_MAX; m->stack.mac[1].rx_pkts = 100; m->stack.mac[1].rx_errors = 100; m->stack.mac[1].rx_brate = 150; From 52da9eb46fa153bc6dea4b4c233e548e9e74d09f Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 28 Dec 2020 16:10:30 +0100 Subject: [PATCH 011/138] srsue,phy: fix setting of PHY log level probably a regression from the new log system integration. it was disabling PHY logs, from PRACH for example. --- srsue/src/phy/phy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index 3f27f4c26..5a50027e2 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -135,7 +135,7 @@ int phy::init(const phy_args_t& args_) { log_h = std::unique_ptr(new srslte::log_filter); log_h->init("PHY", logger, true); - log_h->set_level(args.log.phy_lib_level); + log_h->set_level(args.log.phy_level); log_h->set_hex_limit(args.log.phy_hex_limit); } From d0d7ab4662f8e76eead8bd6c50c19e40d339d66d Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 28 Dec 2020 16:20:13 +0100 Subject: [PATCH 012/138] srsenb: log cell gain updates add a logline in info whenever the user updates the cell individual gain. Note that this log happens before checking whether the cell even exists and can be updated. This is mainly because phy_common doesn't have an own logger object. --- srsenb/src/phy/phy.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/srsenb/src/phy/phy.cc b/srsenb/src/phy/phy.cc index 791624f7c..9f1e60170 100644 --- a/srsenb/src/phy/phy.cc +++ b/srsenb/src/phy/phy.cc @@ -234,6 +234,7 @@ void phy::get_metrics(std::vector& metrics) void phy::cmd_cell_gain(uint32_t cell_id, float gain_db) { + Info("set_cell_gain: cell_id=%d, gain_db=%.2f\n", cell_id, gain_db); workers_common.set_cell_gain(cell_id, gain_db); } From cc5fdb68f31bd4d23576037bf2d1dd11ecf0b3a3 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 28 Dec 2020 11:46:37 +0100 Subject: [PATCH 013/138] Added on-the-fly sequence for bit packed --- lib/include/srslte/phy/common/sequence.h | 2 + lib/src/phy/common/sequence.c | 63 +++++++++++++++++++++++- lib/src/phy/common/test/sequence_test.c | 34 ++++++++++--- 3 files changed, 90 insertions(+), 9 deletions(-) diff --git a/lib/include/srslte/phy/common/sequence.h b/lib/include/srslte/phy/common/sequence.h index f01bc6513..aa3ed9b71 100644 --- a/lib/include/srslte/phy/common/sequence.h +++ b/lib/include/srslte/phy/common/sequence.h @@ -62,6 +62,8 @@ SRSLTE_API void srslte_sequence_apply_c(const int8_t* in, int8_t* out, uint32_t SRSLTE_API void srslte_sequence_apply_bit(const uint8_t* in, uint8_t* out, uint32_t length, uint32_t seed); +SRSLTE_API void srslte_sequence_apply_bit_packed(const uint8_t* in, uint8_t* out, uint32_t length, uint32_t seed); + SRSLTE_API int srslte_sequence_pbch(srslte_sequence_t* seq, srslte_cp_t cp, uint32_t cell_id); SRSLTE_API int srslte_sequence_pcfich(srslte_sequence_t* seq, uint32_t nslot, uint32_t cell_id); diff --git a/lib/src/phy/common/sequence.c b/lib/src/phy/common/sequence.c index 49dfd2f3c..13fc32ca3 100644 --- a/lib/src/phy/common/sequence.c +++ b/lib/src/phy/common/sequence.c @@ -657,4 +657,65 @@ void srslte_sequence_apply_bit(const uint8_t* in, uint8_t* out, uint32_t length, x1 = sequence_gen_LTE_pr_memless_step_x1(x1); x2 = sequence_gen_LTE_pr_memless_step_x2(x2); } -} \ No newline at end of file +} + +void srslte_sequence_apply_bit_packed(const uint8_t* in, uint8_t* out, uint32_t length, uint32_t seed) +{ + uint32_t x1 = sequence_x1_init; // X1 initial state is fix + uint32_t x2 = sequence_get_x2_init(seed); // loads x2 initial state + + uint64_t buffer = 0; + uint32_t count = 0; + + const uint8_t reverse_lut[256] = { + 0b00000000, 0b10000000, 0b01000000, 0b11000000, 0b00100000, 0b10100000, 0b01100000, 0b11100000, 0b00010000, + 0b10010000, 0b01010000, 0b11010000, 0b00110000, 0b10110000, 0b01110000, 0b11110000, 0b00001000, 0b10001000, + 0b01001000, 0b11001000, 0b00101000, 0b10101000, 0b01101000, 0b11101000, 0b00011000, 0b10011000, 0b01011000, + 0b11011000, 0b00111000, 0b10111000, 0b01111000, 0b11111000, 0b00000100, 0b10000100, 0b01000100, 0b11000100, + 0b00100100, 0b10100100, 0b01100100, 0b11100100, 0b00010100, 0b10010100, 0b01010100, 0b11010100, 0b00110100, + 0b10110100, 0b01110100, 0b11110100, 0b00001100, 0b10001100, 0b01001100, 0b11001100, 0b00101100, 0b10101100, + 0b01101100, 0b11101100, 0b00011100, 0b10011100, 0b01011100, 0b11011100, 0b00111100, 0b10111100, 0b01111100, + 0b11111100, 0b00000010, 0b10000010, 0b01000010, 0b11000010, 0b00100010, 0b10100010, 0b01100010, 0b11100010, + 0b00010010, 0b10010010, 0b01010010, 0b11010010, 0b00110010, 0b10110010, 0b01110010, 0b11110010, 0b00001010, + 0b10001010, 0b01001010, 0b11001010, 0b00101010, 0b10101010, 0b01101010, 0b11101010, 0b00011010, 0b10011010, + 0b01011010, 0b11011010, 0b00111010, 0b10111010, 0b01111010, 0b11111010, 0b00000110, 0b10000110, 0b01000110, + 0b11000110, 0b00100110, 0b10100110, 0b01100110, 0b11100110, 0b00010110, 0b10010110, 0b01010110, 0b11010110, + 0b00110110, 0b10110110, 0b01110110, 0b11110110, 0b00001110, 0b10001110, 0b01001110, 0b11001110, 0b00101110, + 0b10101110, 0b01101110, 0b11101110, 0b00011110, 0b10011110, 0b01011110, 0b11011110, 0b00111110, 0b10111110, + 0b01111110, 0b11111110, 0b00000001, 0b10000001, 0b01000001, 0b11000001, 0b00100001, 0b10100001, 0b01100001, + 0b11100001, 0b00010001, 0b10010001, 0b01010001, 0b11010001, 0b00110001, 0b10110001, 0b01110001, 0b11110001, + 0b00001001, 0b10001001, 0b01001001, 0b11001001, 0b00101001, 0b10101001, 0b01101001, 0b11101001, 0b00011001, + 0b10011001, 0b01011001, 0b11011001, 0b00111001, 0b10111001, 0b01111001, 0b11111001, 0b00000101, 0b10000101, + 0b01000101, 0b11000101, 0b00100101, 0b10100101, 0b01100101, 0b11100101, 0b00010101, 0b10010101, 0b01010101, + 0b11010101, 0b00110101, 0b10110101, 0b01110101, 0b11110101, 0b00001101, 0b10001101, 0b01001101, 0b11001101, + 0b00101101, 0b10101101, 0b01101101, 0b11101101, 0b00011101, 0b10011101, 0b01011101, 0b11011101, 0b00111101, + 0b10111101, 0b01111101, 0b11111101, 0b00000011, 0b10000011, 0b01000011, 0b11000011, 0b00100011, 0b10100011, + 0b01100011, 0b11100011, 0b00010011, 0b10010011, 0b01010011, 0b11010011, 0b00110011, 0b10110011, 0b01110011, + 0b11110011, 0b00001011, 0b10001011, 0b01001011, 0b11001011, 0b00101011, 0b10101011, 0b01101011, 0b11101011, + 0b00011011, 0b10011011, 0b01011011, 0b11011011, 0b00111011, 0b10111011, 0b01111011, 0b11111011, 0b00000111, + 0b10000111, 0b01000111, 0b11000111, 0b00100111, 0b10100111, 0b01100111, 0b11100111, 0b00010111, 0b10010111, + 0b01010111, 0b11010111, 0b00110111, 0b10110111, 0b01110111, 0b11110111, 0b00001111, 0b10001111, 0b01001111, + 0b11001111, 0b00101111, 0b10101111, 0b01101111, 0b11101111, 0b00011111, 0b10011111, 0b01011111, 0b11011111, + 0b00111111, 0b10111111, 0b01111111, 0b11111111, + }; + + for (uint32_t i = 0; i < length / 8; i++) { + // Generate sequence bits + while (count < 8) { + uint32_t c = (uint32_t)(x1 ^ x2); + buffer = buffer | ((SEQUENCE_MASK & c) << count); + + // Step sequences + x1 = sequence_gen_LTE_pr_memless_step_par_x1(x1); + x2 = sequence_gen_LTE_pr_memless_step_par_x2(x2); + + // Increase count + count += SEQUENCE_PAR_BITS; + } + + // Apply XOR + out[i] = in[i] ^ reverse_lut[buffer & 255UL]; + buffer = buffer >> 8UL; + count -= 8; + } +} diff --git a/lib/src/phy/common/test/sequence_test.c b/lib/src/phy/common/test/sequence_test.c index 5757118ab..2eae5d58a 100644 --- a/lib/src/phy/common/test/sequence_test.c +++ b/lib/src/phy/common/test/sequence_test.c @@ -10,10 +10,10 @@ * */ +#include "srslte/phy/common/sequence.h" +#include "srslte/phy/utils/bit.h" #include "srslte/phy/utils/debug.h" -#include -#include -#include +#include "srslte/phy/utils/random.h" #define Nc 1600 #define MAX_SEQ_LEN (256 * 1024) @@ -24,6 +24,7 @@ static uint8_t c[Nc + MAX_SEQ_LEN + 31]; static float c_float[Nc + MAX_SEQ_LEN + 31]; static int16_t c_short[Nc + MAX_SEQ_LEN + 31]; static int8_t c_char[Nc + MAX_SEQ_LEN + 31]; +static uint8_t c_packed_gold[MAX_SEQ_LEN / 8]; static uint8_t c_packed[MAX_SEQ_LEN / 8]; static uint8_t c_unpacked[MAX_SEQ_LEN]; @@ -42,6 +43,7 @@ static int test_sequence(srslte_sequence_t* sequence, uint32_t seed, uint32_t le uint64_t interval_xor_short_us = 0; uint64_t interval_xor_char_us = 0; uint64_t interval_xor_unpacked_us = 0; + uint64_t interval_xor_packed_us = 0; gettimeofday(&t[1], NULL); @@ -72,7 +74,7 @@ static int test_sequence(srslte_sequence_t* sequence, uint32_t seed, uint32_t le c_char[n] = c[n] ? -1 : +1; } - srslte_bit_pack_vector(c, c_packed, length); + srslte_bit_pack_vector(c, c_packed_gold, length); if (memcmp(c, sequence->c, length) != 0) { ERROR("Unmatched c"); @@ -138,12 +140,26 @@ static int test_sequence(srslte_sequence_t* sequence, uint32_t seed, uint32_t le get_time_interval(t); interval_xor_unpacked_us = t->tv_sec * 1000000UL + t->tv_usec; + // Test in-place packed XOR + gettimeofday(&t[1], NULL); + for (uint32_t r = 0; r < repetitions; r++) { + srslte_sequence_apply_bit_packed(ones_packed, c_packed, length, seed); + } + gettimeofday(&t[2], NULL); + get_time_interval(t); + interval_xor_packed_us = t->tv_sec * 1000000UL + t->tv_usec; + if (memcmp(c_char, sequence->c_char, length * sizeof(int8_t)) != 0) { ERROR("Unmatched XOR c_char"); ret = SRSLTE_ERROR; } - if (memcmp(c_packed, sequence->c_bytes, length / 8) != 0) { + if (memcmp(c_packed_gold, sequence->c_bytes, length / 8) != 0) { + ERROR("Unmatched c_packed"); + ret = SRSLTE_ERROR; + } + + if (memcmp(c_packed_gold, c_packed, length / 8) != 0) { ERROR("Unmatched c_packed"); ret = SRSLTE_ERROR; } @@ -153,7 +169,7 @@ static int test_sequence(srslte_sequence_t* sequence, uint32_t seed, uint32_t le ret = SRSLTE_ERROR; } - printf("%08x; %8d; %8.1f; %8.1f; %8.1f; %8.1f; %8.1f; %8c\n", + printf("%08x; %8d; %8.1f; %8.1f; %8.1f; %8.1f; %8.1f; %8.1f; %8c\n", seed, length, (double)(length * repetitions) / (double)interval_gen_us, @@ -161,6 +177,7 @@ static int test_sequence(srslte_sequence_t* sequence, uint32_t seed, uint32_t le (double)(length * repetitions) / (double)interval_xor_short_us, (double)(length * repetitions) / (double)interval_xor_char_us, (double)(length * repetitions) / (double)interval_xor_unpacked_us, + (double)(length * repetitions) / (double)interval_xor_packed_us, ret == SRSLTE_SUCCESS ? 'y' : 'n'); return SRSLTE_SUCCESS; @@ -182,7 +199,7 @@ int main(int argc, char** argv) ones_char[i] = 1; ones_unpacked[i] = 0; if (i < MAX_SEQ_LEN / 8) { - ones_packed[i] = UINT8_MAX; + ones_packed[i] = 0; } } @@ -192,7 +209,7 @@ int main(int argc, char** argv) return SRSLTE_ERROR; } - printf("%8s; %8s; %8s; %8s; %8s; %8s; %8s; %8s;\n", + printf("%8s; %8s; %8s; %8s; %8s; %8s; %8s; %8s; %8s;\n", "seed", "length", "GEN", @@ -200,6 +217,7 @@ int main(int argc, char** argv) "XOR 16", "XOR 8", "XOR Unpack", + "XOR Pack", "Passed"); for (uint32_t length = min_length; length <= max_length; length = (length * 5) / 4) { From b3200d9ef5d733feb9ef15d6dae958616af13d2f Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 28 Dec 2020 18:28:16 +0100 Subject: [PATCH 014/138] Renaming common UL/DL DMRS related types and initial NR PUSCH implementation --- .../{dmrs_pdsch.h => dmrs_sch.h} | 62 +- lib/include/srslte/phy/common/phy_common_nr.h | 10 +- lib/include/srslte/phy/enb/enb_dl_nr.h | 28 +- lib/include/srslte/phy/phch/dci_nr.h | 2 +- lib/include/srslte/phy/phch/pdsch_nr.h | 54 +- .../phch/{pdsch_cfg_nr.h => phch_cfg_nr.h} | 79 +- lib/include/srslte/phy/phch/pusch_nr.h | 93 +++ lib/include/srslte/phy/phch/ra_nr.h | 13 +- lib/include/srslte/phy/phch/sch_nr.h | 51 +- lib/include/srslte/phy/ue/ue_dl_nr.h | 26 +- lib/include/srslte/phy/ue/ue_dl_nr_data.h | 14 +- lib/include/srslte/phy/ue/ue_ul_nr_data.h | 61 ++ .../{dmrs_pdsch.c => dmrs_sch.c} | 231 +++--- .../phy/ch_estimation/test/dmrs_pdsch_test.c | 207 +++-- lib/src/phy/common/phy_common_nr.c | 6 +- lib/src/phy/enb/enb_dl_nr.c | 28 +- lib/src/phy/phch/pdsch_nr.c | 166 ++-- lib/src/phy/phch/pusch_nr.c | 769 ++++++++++++++++++ lib/src/phy/phch/ra_nr.c | 88 +- lib/src/phy/phch/sch_nr.c | 74 +- lib/src/phy/phch/test/CMakeLists.txt | 9 +- lib/src/phy/phch/test/pdsch_nr_test.c | 13 +- lib/src/phy/phch/test/pusch_nr_test.c | 301 +++++++ .../test/{dlsch_nr_test.c => sch_nr_test.c} | 13 +- lib/src/phy/ue/ue_dl_nr.c | 30 +- lib/src/phy/ue/ue_dl_nr_data.c | 58 +- lib/src/phy/ue/ue_ul_nr_data.c | 84 ++ lib/test/phy/phy_dl_nr_test.c | 15 +- srsenb/hdr/phy/nr/cc_worker.h | 2 +- srsenb/src/phy/nr/cc_worker.cc | 7 +- srsue/hdr/phy/nr/cc_worker.h | 2 +- srsue/src/phy/nr/cc_worker.cc | 7 +- 32 files changed, 2026 insertions(+), 577 deletions(-) rename lib/include/srslte/phy/ch_estimation/{dmrs_pdsch.h => dmrs_sch.h} (66%) rename lib/include/srslte/phy/phch/{pdsch_cfg_nr.h => phch_cfg_nr.h} (63%) create mode 100644 lib/include/srslte/phy/phch/pusch_nr.h create mode 100644 lib/include/srslte/phy/ue/ue_ul_nr_data.h rename lib/src/phy/ch_estimation/{dmrs_pdsch.c => dmrs_sch.c} (70%) create mode 100644 lib/src/phy/phch/pusch_nr.c create mode 100644 lib/src/phy/phch/test/pusch_nr_test.c rename lib/src/phy/phch/test/{dlsch_nr_test.c => sch_nr_test.c} (94%) create mode 100644 lib/src/phy/ue/ue_ul_nr_data.c diff --git a/lib/include/srslte/phy/ch_estimation/dmrs_pdsch.h b/lib/include/srslte/phy/ch_estimation/dmrs_sch.h similarity index 66% rename from lib/include/srslte/phy/ch_estimation/dmrs_pdsch.h rename to lib/include/srslte/phy/ch_estimation/dmrs_sch.h index 04221dfa9..56abf30a1 100644 --- a/lib/include/srslte/phy/ch_estimation/dmrs_pdsch.h +++ b/lib/include/srslte/phy/ch_estimation/dmrs_sch.h @@ -10,11 +10,11 @@ * */ -#ifndef SRSLTE_DMRS_PDSCH_H -#define SRSLTE_DMRS_PDSCH_H +#ifndef SRSLTE_DMRS_SCH_H +#define SRSLTE_DMRS_SCH_H #include "srslte/phy/common/phy_common_nr.h" -#include "srslte/phy/phch/pdsch_cfg_nr.h" +#include "srslte/phy/phch/phch_cfg_nr.h" #include "srslte/srslte.h" #include @@ -22,18 +22,18 @@ extern "C" { #endif -#define SRSLTE_DMRS_PDSCH_MAX_SYMBOLS 4 +#define SRSLTE_DMRS_SCH_MAX_SYMBOLS 4 /** * @brief PDSCH DMRS estimator object * * @note The DMRS PDSCH object has to be initialised and the carrier parameters needs to be set. * - * @see srslte_dmrs_pdsch_init - * @see srslte_dmrs_pdsch_set_carrier - * @see srslte_dmrs_pdsch_free - * @see srslte_dmrs_pdsch_put_sf - * @see srslte_dmrs_pdsch_estimate + * @see srslte_dmrs_sch_init + * @see srslte_dmrs_sch_set_carrier + * @see srslte_dmrs_sch_free + * @see srslte_dmrs_sch_put_sf + * @see srslte_dmrs_sch_estimate */ typedef struct { bool is_ue; @@ -47,7 +47,7 @@ typedef struct { cf_t* pilot_estimates; /// Pilots least squares estimates cf_t* temp; /// Temporal data vector of size SRSLTE_NRE * carrier.nof_prb -} srslte_dmrs_pdsch_t; +} srslte_dmrs_sch_t; /** * @brief Computes the symbol indexes carrying DMRS and stores them in symbols_idx @@ -56,9 +56,9 @@ typedef struct { * @param symbols_idx is the destination pointer where the symbols indexes are stored * @return It returns the number of symbols if inputs are valid, otherwise, it returns SRSLTE_ERROR code. */ -SRSLTE_API int srslte_dmrs_pdsch_get_symbols_idx(const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - uint32_t symbols_idx[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS]); +SRSLTE_API int srslte_dmrs_sch_get_symbols_idx(const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + uint32_t symbols_idx[SRSLTE_DMRS_SCH_MAX_SYMBOLS]); /** * @brief Computes the sub-carrier indexes carrying DMRS @@ -69,7 +69,7 @@ SRSLTE_API int srslte_dmrs_pdsch_get_symbols_idx(const srslte_pdsch_cfg_nr_t* * * @return It returns the number of sub-carriers if inputs are valid, otherwise, it returns SRSLTE_ERROR code. */ -SRSLTE_API int srslte_dmrs_pdsch_get_sc_idx(const srslte_pdsch_dmrs_cfg_t* cfg, uint32_t max_count, uint32_t* sc_idx); +SRSLTE_API int srslte_dmrs_sch_get_sc_idx(const srslte_dmrs_sch_cfg_t* cfg, uint32_t max_count, uint32_t* sc_idx); /** * @brief Calculates the number of resource elements taken by a PDSCH-DMRS for a given PDSCH transmission @@ -77,7 +77,7 @@ SRSLTE_API int srslte_dmrs_pdsch_get_sc_idx(const srslte_pdsch_dmrs_cfg_t* cfg, * @param grant PDSCH information provided by a DCI * @return it returns the number of resource elements if the configuration is valid, otherwise it returns SRSLTE_ERROR */ -SRSLTE_API int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, const srslte_pdsch_grant_nr_t* grant); +SRSLTE_API int srslte_dmrs_sch_get_N_prb(const srslte_sch_cfg_nr_t* cfg, const srslte_sch_grant_nr_t* grant); /** * @brief Stringifies the PDSCH DMRS configuration @@ -89,7 +89,7 @@ SRSLTE_API int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, con * @return It returns the number of characters written in the vector if no error occurs, otherwise it returns * SRSLTE_ERROR code */ -SRSLTE_API int srslte_dmrs_pdsch_cfg_to_str(const srslte_pdsch_dmrs_cfg_t* cfg, char* msg, uint32_t max_len); +SRSLTE_API int srslte_dmrs_sch_cfg_to_str(const srslte_dmrs_sch_cfg_t* cfg, char* msg, uint32_t max_len); /** * @brief Initialises DMRS PDSCH object @@ -98,14 +98,14 @@ SRSLTE_API int srslte_dmrs_pdsch_cfg_to_str(const srslte_pdsch_dmrs_cfg_t* cfg, * @param is_ue indicates whethe the object is for a UE (in this case, it shall initialise as an estimator) * @return it returns SRSLTE_ERROR code if an error occurs, otherwise it returns SRSLTE_SUCCESS */ -SRSLTE_API int srslte_dmrs_pdsch_init(srslte_dmrs_pdsch_t* q, bool is_ue); +SRSLTE_API int srslte_dmrs_sch_init(srslte_dmrs_sch_t* q, bool is_ue); /** * @brief Frees DMRS PDSCH object * * @param q DMRS PDSCH object */ -SRSLTE_API void srslte_dmrs_pdsch_free(srslte_dmrs_pdsch_t* q); +SRSLTE_API void srslte_dmrs_sch_free(srslte_dmrs_sch_t* q); /** * @brief Sets the carrier configuration. if the PDSCH DMRS object is configured as UE, it will resize internal buffers @@ -116,7 +116,7 @@ SRSLTE_API void srslte_dmrs_pdsch_free(srslte_dmrs_pdsch_t* q); * * @return it returns SRSLTE_ERROR code if an error occurs, otherwise it returns SRSLTE_SUCCESS */ -SRSLTE_API int srslte_dmrs_pdsch_set_carrier(srslte_dmrs_pdsch_t* q, const srslte_carrier_nr_t* carrier); +SRSLTE_API int srslte_dmrs_sch_set_carrier(srslte_dmrs_sch_t* q, const srslte_carrier_nr_t* carrier); /** * @brief Puts PDSCH DMRS into a given resource grid @@ -129,11 +129,11 @@ SRSLTE_API int srslte_dmrs_pdsch_set_carrier(srslte_dmrs_pdsch_t* q, const srslt * * @return it returns SRSLTE_ERROR code if an error occurs, otherwise it returns SRSLTE_SUCCESS */ -SRSLTE_API int srslte_dmrs_pdsch_put_sf(srslte_dmrs_pdsch_t* q, - const srslte_dl_slot_cfg_t* slot_cfg, - const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - cf_t* sf_symbols); +SRSLTE_API int srslte_dmrs_sch_put_sf(srslte_dmrs_sch_t* q, + const srslte_dl_slot_cfg_t* slot_cfg, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* sf_symbols); /** * @brief Estimates the channel for PDSCH from the DMRS @@ -149,15 +149,15 @@ SRSLTE_API int srslte_dmrs_pdsch_put_sf(srslte_dmrs_pdsch_t* q, * * @return it returns SRSLTE_ERROR code if an error occurs, otherwise it returns SRSLTE_SUCCESS */ -SRSLTE_API int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, - const srslte_dl_slot_cfg_t* slot_cfg, - const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - const cf_t* sf_symbols, - srslte_chest_dl_res_t* chest_res); +SRSLTE_API int srslte_dmrs_sch_estimate(srslte_dmrs_sch_t* q, + const srslte_dl_slot_cfg_t* slot_cfg, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + const cf_t* sf_symbols, + srslte_chest_dl_res_t* chest_res); #ifdef __cplusplus } #endif -#endif // SRSLTE_DMRS_PDSCH_H +#endif // SRSLTE_DMRS_SCH_H diff --git a/lib/include/srslte/phy/common/phy_common_nr.h b/lib/include/srslte/phy/common/phy_common_nr.h index 4fc47f6e6..3449f21f2 100644 --- a/lib/include/srslte/phy/common/phy_common_nr.h +++ b/lib/include/srslte/phy/common/phy_common_nr.h @@ -128,7 +128,7 @@ typedef enum SRSLTE_API { * @brief PDSCH mapping type * @remark Described in TS 38.331 V15.10.0 Section PDSCH-TimeDomainResourceAllocationList */ -typedef enum SRSLTE_API { srslte_pdsch_mapping_type_A = 0, srslte_pdsch_mapping_type_B } srslte_pdsch_mapping_type_t; +typedef enum SRSLTE_API { srslte_sch_mapping_type_A = 0, srslte_sch_mapping_type_B } srslte_sch_mapping_type_t; typedef enum SRSLTE_API { srslte_search_space_type_common = 0, @@ -155,6 +155,8 @@ typedef enum SRSLTE_API { srslte_rnti_type_ra, srslte_rnti_type_tc, srslte_rnti_type_cs, + srslte_rnti_type_sp_csi, + srslte_rnti_type_mcs_crnti, } srslte_rnti_type_t; /** @@ -170,7 +172,9 @@ typedef enum SRSLTE_API { srslte_dci_format_nr_2_1, ///< @brief Notifying a group of UEs of the PRB(s) and OFDM symbol(s) where UE may assume no ///< transmission is intended for the UE srslte_dci_format_nr_2_2, ///< @brief Transmission of TPC commands for PUCCH and PUSCH - srslte_dci_format_nr_2_3 ///< @brief Transmission of a group of TPC commands for SRS transmissions by one or more UEs + srslte_dci_format_nr_2_3, ///< @brief Transmission of a group of TPC commands for SRS transmissions by one or more UEs + srslte_dci_format_nr_rar, ///< @brief Scheduling a transmission of PUSCH from RAR + srslte_dci_format_nr_cg ///< @brief Scheduling of PUSCH using a configured grant } srslte_dci_format_nr_t; /** @@ -287,7 +291,7 @@ SRSLTE_API uint32_t srslte_coreset_get_sz(const srslte_coreset_t* coreset); * @param mapping_type Mapping type * @return Constant string with PDSCH mapping type */ -SRSLTE_API const char* srslte_pdsch_mapping_type_to_str(srslte_pdsch_mapping_type_t mapping_type); +SRSLTE_API const char* srslte_sch_mapping_type_to_str(srslte_sch_mapping_type_t mapping_type); /** * @brief Get the MCS table string diff --git a/lib/include/srslte/phy/enb/enb_dl_nr.h b/lib/include/srslte/phy/enb/enb_dl_nr.h index 45e28120c..6d37f2119 100644 --- a/lib/include/srslte/phy/enb/enb_dl_nr.h +++ b/lib/include/srslte/phy/enb/enb_dl_nr.h @@ -37,9 +37,9 @@ typedef struct SRSLTE_API { srslte_ofdm_t fft[SRSLTE_MAX_PORTS]; - cf_t* sf_symbols[SRSLTE_MAX_PORTS]; - srslte_pdsch_nr_t pdsch; - srslte_dmrs_pdsch_t dmrs; + cf_t* sf_symbols[SRSLTE_MAX_PORTS]; + srslte_pdsch_nr_t pdsch; + srslte_dmrs_sch_t dmrs; srslte_pdcch_nr_t pdcch; } srslte_enb_dl_nr_t; @@ -64,17 +64,17 @@ SRSLTE_API int srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, const srslte_dci_location_t* dci_location, uint16_t rnti); -SRSLTE_API int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - uint8_t* data[SRSLTE_MAX_TB]); - -SRSLTE_API int srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - char* str, - uint32_t str_len); +SRSLTE_API int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + uint8_t* data[SRSLTE_MAX_TB]); + +SRSLTE_API int srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + char* str, + uint32_t str_len); #ifdef __cplusplus } diff --git a/lib/include/srslte/phy/phch/dci_nr.h b/lib/include/srslte/phy/phch/dci_nr.h index aa10c4416..d7fe44625 100644 --- a/lib/include/srslte/phy/phch/dci_nr.h +++ b/lib/include/srslte/phy/phch/dci_nr.h @@ -15,7 +15,7 @@ #include "dci.h" #include "srslte/phy/common/phy_common_nr.h" -#include "srslte/phy/phch/pdsch_cfg_nr.h" +#include "srslte/phy/phch/phch_cfg_nr.h" typedef struct SRSLTE_API { srslte_dci_location_t location; diff --git a/lib/include/srslte/phy/phch/pdsch_nr.h b/lib/include/srslte/phy/phch/pdsch_nr.h index 6c40b6567..a4b079f2e 100644 --- a/lib/include/srslte/phy/phch/pdsch_nr.h +++ b/lib/include/srslte/phy/phch/pdsch_nr.h @@ -18,12 +18,12 @@ * Reference: 3GPP TS 38.211 V15.8.0 Sec. 7.3.1 *****************************************************************************/ -#ifndef srslte_pdsch_nr_H -#define srslte_pdsch_nr_H +#ifndef SRSLTE_PDSCH_NR_H +#define SRSLTE_PDSCH_NR_H #include "srslte/config.h" -#include "srslte/phy/ch_estimation/dmrs_pdsch.h" -#include "srslte/phy/phch/pdsch_cfg_nr.h" +#include "srslte/phy/ch_estimation/dmrs_sch.h" +#include "srslte/phy/phch/phch_cfg_nr.h" #include "srslte/phy/phch/regs.h" #include "srslte/phy/phch/sch_nr.h" #include "srslte/phy/scrambling/scrambling.h" @@ -72,30 +72,30 @@ SRSLTE_API void srslte_pdsch_nr_free(srslte_pdsch_nr_t* q); SRSLTE_API int srslte_pdsch_nr_set_carrier(srslte_pdsch_nr_t* q, const srslte_carrier_nr_t* carrier); -SRSLTE_API int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - uint8_t* data[SRSLTE_MAX_TB], - cf_t* sf_symbols[SRSLTE_MAX_PORTS]); +SRSLTE_API int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + uint8_t* data[SRSLTE_MAX_TB], + cf_t* sf_symbols[SRSLTE_MAX_PORTS]); -SRSLTE_API int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - srslte_chest_dl_res_t* channel, - cf_t* sf_symbols[SRSLTE_MAX_PORTS], - srslte_pdsch_res_nr_t data[SRSLTE_MAX_TB]); +SRSLTE_API int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + srslte_chest_dl_res_t* channel, + cf_t* sf_symbols[SRSLTE_MAX_PORTS], + srslte_pdsch_res_nr_t data[SRSLTE_MAX_TB]); -SRSLTE_API uint32_t srslte_pdsch_nr_rx_info(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - const srslte_pdsch_res_nr_t* res, - char* str, - uint32_t str_len); +SRSLTE_API uint32_t srslte_pdsch_nr_rx_info(const srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + const srslte_pdsch_res_nr_t* res, + char* str, + uint32_t str_len); -SRSLTE_API uint32_t srslte_pdsch_nr_tx_info(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - char* str, - uint32_t str_len); +SRSLTE_API uint32_t srslte_pdsch_nr_tx_info(const srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + char* str, + uint32_t str_len); -#endif // srslte_pdsch_nr_H +#endif // SRSLTE_PDSCH_NR_H diff --git a/lib/include/srslte/phy/phch/pdsch_cfg_nr.h b/lib/include/srslte/phy/phch/phch_cfg_nr.h similarity index 63% rename from lib/include/srslte/phy/phch/pdsch_cfg_nr.h rename to lib/include/srslte/phy/phch/phch_cfg_nr.h index a0ec54b04..5de15cea0 100644 --- a/lib/include/srslte/phy/phch/pdsch_cfg_nr.h +++ b/lib/include/srslte/phy/phch/phch_cfg_nr.h @@ -18,8 +18,8 @@ * Reference: *****************************************************************************/ -#ifndef SRSLTE_PDSCH_CFG_NR_H -#define SRSLTE_PDSCH_CFG_NR_H +#ifndef SRSLTE_PHCH_CFG_NR_H +#define SRSLTE_PHCH_CFG_NR_H #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/phch/sch_cfg_nr.h" @@ -32,35 +32,35 @@ extern "C" { * @brief PDSCH DMRS type */ typedef enum { - srslte_dmrs_pdsch_type_1 = 0, // 1 pilot every 2 sub-carriers (default) - srslte_dmrs_pdsch_type_2 // 2 consecutive pilots every 6 sub-carriers -} srslte_dmrs_pdsch_type_t; + srslte_dmrs_sch_type_1 = 0, // 1 pilot every 2 sub-carriers (default) + srslte_dmrs_sch_type_2 // 2 consecutive pilots every 6 sub-carriers +} srslte_dmrs_sch_type_t; /** * @brief PDSCH DMRS length in symbols */ typedef enum { - srslte_dmrs_pdsch_len_1 = 0, // single, 1 symbol long (default) - srslte_dmrs_pdsch_len_2 // double, 2 symbol long -} srslte_dmrs_pdsch_len_t; + srslte_dmrs_sch_len_1 = 0, // single, 1 symbol long (default) + srslte_dmrs_sch_len_2 // double, 2 symbol long +} srslte_dmrs_sch_len_t; /** * @brief Determines whether the first pilot goes into symbol index 2 or 3 */ typedef enum { - srslte_dmrs_pdsch_typeA_pos_2 = 0, // Start in slot symbol index 2 (default) - srslte_dmrs_pdsch_typeA_pos_3 // Start in slot symbol index 3 -} srslte_dmrs_pdsch_typeA_pos_t; + srslte_dmrs_sch_typeA_pos_2 = 0, // Start in slot symbol index 2 (default) + srslte_dmrs_sch_typeA_pos_3 // Start in slot symbol index 3 +} srslte_dmrs_sch_typeA_pos_t; /** * @brief Determines additional symbols if possible to be added */ typedef enum { - srslte_dmrs_pdsch_add_pos_2 = 0, - srslte_dmrs_pdsch_add_pos_0, - srslte_dmrs_pdsch_add_pos_1, - srslte_dmrs_pdsch_add_pos_3 -} srslte_dmrs_pdsch_add_pos_t; + srslte_dmrs_sch_add_pos_2 = 0, + srslte_dmrs_sch_add_pos_0, + srslte_dmrs_sch_add_pos_1, + srslte_dmrs_sch_add_pos_3 +} srslte_dmrs_sch_add_pos_t; /** * @brief Provides PDSCH DMRS configuration from higher layers @@ -68,22 +68,22 @@ typedef enum { */ typedef struct { /// Parameters provided by IE DMRS-DownlinkConfig - srslte_dmrs_pdsch_type_t type; - srslte_dmrs_pdsch_add_pos_t additional_pos; - srslte_dmrs_pdsch_len_t length; - bool scrambling_id0_present; - uint32_t scrambling_id0; - bool scrambling_id1_present; - uint32_t scrambling_id1; + srslte_dmrs_sch_type_t type; + srslte_dmrs_sch_add_pos_t additional_pos; + srslte_dmrs_sch_len_t length; + bool scrambling_id0_present; + uint32_t scrambling_id0; + bool scrambling_id1_present; + uint32_t scrambling_id1; /// Parameters provided by ServingCellConfigCommon - srslte_dmrs_pdsch_typeA_pos_t typeA_pos; - bool lte_CRS_to_match_around; + srslte_dmrs_sch_typeA_pos_t typeA_pos; + bool lte_CRS_to_match_around; /// Parameters provided by FeatureSetDownlink-v1540 bool additional_DMRS_DL_Alt; -} srslte_pdsch_dmrs_cfg_t; +} srslte_dmrs_sch_cfg_t; /** * @brief flatten PDSCH time domain allocation parameters @@ -94,7 +94,7 @@ typedef struct SRSLTE_API { uint32_t k0; /// PDSCH mapping type - srslte_pdsch_mapping_type_t mapping_type; + srslte_sch_mapping_type_t mapping_type; /// An index giving valid combinations of start symbol and length (jointly encoded) as start and length indicator /// (SLIV). The network configures the field so that the allocation does not cross the slot boundary @@ -111,10 +111,11 @@ typedef struct SRSLTE_API { srslte_rnti_type_t rnti_type; /// Time domain resources - uint32_t k0; - uint32_t S; - uint32_t L; - srslte_pdsch_mapping_type_t mapping; + uint32_t k0; // PDSCH only + uint32_t k2; // PUSCH only + uint32_t S; + uint32_t L; + srslte_sch_mapping_type_t mapping; /// Frequency domain resources bool prb_idx[SRSLTE_MAX_PRB_NR]; @@ -138,25 +139,29 @@ typedef struct SRSLTE_API { /// .... srslte_sch_tb_t tb[SRSLTE_MAX_TB]; -} srslte_pdsch_grant_nr_t; +} srslte_sch_grant_nr_t; /** - * @brief flatten PDSCH configuration parameters provided by higher layers + * @brief flatten SCH configuration parameters provided by higher layers * @remark Described in TS 38.331 V15.10.0 Section PDSCH-Config + * @remark Described in TS 38.331 V15.10.0 Section PUSCH-Config */ typedef struct SRSLTE_API { bool scrambling_id_present; uint32_t scambling_id; // Identifier used to initialize data scrambling (0-1023) - srslte_pdsch_dmrs_cfg_t dmrs_cfg_typeA; - srslte_pdsch_dmrs_cfg_t dmrs_cfg_typeB; + srslte_dmrs_sch_cfg_t dmrs_typeA; + srslte_dmrs_sch_cfg_t dmrs_typeB; srslte_sch_cfg_t sch_cfg; ///< Common shared channel parameters -} srslte_pdsch_cfg_nr_t; + + /// Uplink params + bool enable_transform_precoder; +} srslte_sch_cfg_nr_t; #ifdef __cplusplus } #endif -#endif // SRSLTE_PDSCH_CFG_NR_H +#endif // SRSLTE_PHCH_CFG_NR_H diff --git a/lib/include/srslte/phy/phch/pusch_nr.h b/lib/include/srslte/phy/phch/pusch_nr.h new file mode 100644 index 000000000..64b99012e --- /dev/null +++ b/lib/include/srslte/phy/phch/pusch_nr.h @@ -0,0 +1,93 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_PUSCH_NR_H +#define SRSLTE_PUSCH_NR_H + +#include "srslte/config.h" +#include "srslte/phy/ch_estimation/dmrs_sch.h" +#include "srslte/phy/phch/phch_cfg_nr.h" +#include "srslte/phy/phch/regs.h" +#include "srslte/phy/phch/sch_nr.h" +#include "srslte/phy/scrambling/scrambling.h" + +/** + * @brief PUSCH encoder and decoder initialization arguments + */ +typedef struct SRSLTE_API { + srslte_sch_nr_args_t sch; + bool measure_evm; + bool measure_time; +} srslte_pusch_nr_args_t; + +/** + * @brief PDSCH NR object + */ +typedef struct SRSLTE_API { + uint32_t max_prb; ///< Maximum number of allocated prb + uint32_t max_layers; ///< Maximum number of allocated layers + uint32_t max_cw; ///< Maximum number of allocated code words + srslte_carrier_nr_t carrier; ///< NR carrier configuration + srslte_sch_nr_t sch; ///< SCH Encoder/Decoder Object + uint8_t* b[SRSLTE_MAX_CODEWORDS]; ///< SCH Encoded and scrambled data + cf_t* d[SRSLTE_MAX_CODEWORDS]; ///< PDSCH modulated bits + cf_t* x[SRSLTE_MAX_LAYERS_NR]; ///< PDSCH modulated bits + srslte_modem_table_t modem_tables[SRSLTE_MOD_NITEMS]; ///< Modulator tables + srslte_evm_buffer_t* evm_buffer; + bool meas_time_en; + uint32_t meas_time_us; +} srslte_pusch_nr_t; + +/** + * + */ +typedef struct { + uint8_t* payload; + bool crc; + float evm; +} srslte_pusch_res_nr_t; + +SRSLTE_API int srslte_pusch_nr_init_enb(srslte_pusch_nr_t* q, const srslte_pusch_nr_args_t* args); + +SRSLTE_API int srslte_pusch_nr_init_ue(srslte_pusch_nr_t* q, const srslte_pusch_nr_args_t* args); + +SRSLTE_API void srslte_pusch_nr_free(srslte_pusch_nr_t* q); + +SRSLTE_API int srslte_pusch_nr_set_carrier(srslte_pusch_nr_t* q, const srslte_carrier_nr_t* carrier); + +SRSLTE_API int srslte_pusch_nr_encode(srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + uint8_t* data[SRSLTE_MAX_TB], + cf_t* sf_symbols[SRSLTE_MAX_PORTS]); + +SRSLTE_API int srslte_pusch_nr_decode(srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + srslte_chest_dl_res_t* channel, + cf_t* sf_symbols[SRSLTE_MAX_PORTS], + srslte_pusch_res_nr_t data[SRSLTE_MAX_TB]); + +SRSLTE_API uint32_t srslte_pusch_nr_rx_info(const srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + const srslte_pusch_res_nr_t* res, + char* str, + uint32_t str_len); + +SRSLTE_API uint32_t srslte_pusch_nr_tx_info(const srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + char* str, + uint32_t str_len); + +#endif // SRSLTE_PUSCH_NR_H diff --git a/lib/include/srslte/phy/phch/ra_nr.h b/lib/include/srslte/phy/phch/ra_nr.h index 91750f8a5..291cabec2 100644 --- a/lib/include/srslte/phy/phch/ra_nr.h +++ b/lib/include/srslte/phy/phch/ra_nr.h @@ -26,7 +26,7 @@ #include "srslte/config.h" #include "srslte/phy/common/phy_common_nr.h" -#include "srslte/phy/phch/pdsch_cfg_nr.h" +#include "srslte/phy/phch/phch_cfg_nr.h" #ifdef __cplusplus extern "C" { @@ -68,8 +68,7 @@ SRSLTE_API srslte_mod_t srslte_ra_nr_mod_from_mcs(srslte_mcs_table_t mcs * @param grant The given PDSCH transmission grant * @return The number of resource elements if the provided configuration is valid, otherwise SRSLTE_ERROR code */ -SRSLTE_API int srslte_ra_dl_nr_slot_nof_re(const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant); +SRSLTE_API int srslte_ra_dl_nr_slot_nof_re(const srslte_sch_cfg_nr_t* pdsch_cfg, const srslte_sch_grant_nr_t* grant); /** * @brief Calculates shared channel TBS @@ -82,10 +81,10 @@ SRSLTE_API int srslte_ra_dl_nr_slot_nof_re(const srslte_pdsch_cfg_nr_t* pdsch_ */ SRSLTE_API uint32_t srslte_ra_nr_tbs(uint32_t N_re, double S, double R, uint32_t Qm, uint32_t nof_layers); -SRSLTE_API int srslte_ra_nr_fill_tb(const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - uint32_t mcs_idx, - srslte_sch_tb_t* tb); +SRSLTE_API int srslte_ra_nr_fill_tb(const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + uint32_t mcs_idx, + srslte_sch_tb_t* tb); #ifdef __cplusplus } diff --git a/lib/include/srslte/phy/phch/sch_nr.h b/lib/include/srslte/phy/phch/sch_nr.h index 3574b2e10..ce3cebbf3 100644 --- a/lib/include/srslte/phy/phch/sch_nr.h +++ b/lib/include/srslte/phy/phch/sch_nr.h @@ -27,7 +27,7 @@ #include "srslte/phy/fec/ldpc/ldpc_decoder.h" #include "srslte/phy/fec/ldpc/ldpc_encoder.h" #include "srslte/phy/fec/ldpc/ldpc_rm.h" -#include "srslte/phy/phch/pdsch_cfg_nr.h" +#include "srslte/phy/phch/phch_cfg_nr.h" #define SRSLTE_SCH_NR_MAX_NOF_CB_LDPC \ ((SRSLTE_SLOT_MAX_NOF_BITS_NR + (SRSLTE_LDPC_BG2_MAX_LEN_CB - 1)) / SRSLTE_LDPC_BG2_MAX_LEN_CB) @@ -110,17 +110,39 @@ SRSLTE_API srslte_basegraph_t srslte_sch_nr_select_basegraph(uint32_t tbs, doubl * @param cfg SCH object * @return */ -SRSLTE_API int srslte_dlsch_nr_fill_cfg(srslte_sch_nr_t* q, - const srslte_sch_cfg_t* sch_cfg, - const srslte_sch_tb_t* tb, - srslte_sch_nr_common_cfg_t* cfg); +SRSLTE_API int srslte_sch_nr_fill_cfg(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* sch_cfg, + const srslte_sch_tb_t* tb, + srslte_sch_nr_common_cfg_t* cfg); -SRSLTE_API int srslte_sch_nr_init_tx(srslte_sch_nr_t* q, const srslte_sch_nr_args_t* cfg); +/** + * @brief Initialises an SCH object as transmitter + * @param q Points ats the SCH object + * @param args Provides static configuration arguments + * @return SRSLTE_SUCCESS if the initialization is successful, SRSLTE_ERROR otherwise + */ +SRSLTE_API int srslte_sch_nr_init_tx(srslte_sch_nr_t* q, const srslte_sch_nr_args_t* args); -SRSLTE_API int srslte_sch_nr_init_rx(srslte_sch_nr_t* q, const srslte_sch_nr_args_t* cfg); +/** + * @brief Initialises an SCH object as receiver + * @param q Points ats the SCH object + * @param args Provides static configuration arguments + * @return SRSLTE_SUCCESS if the initialization is successful, SRSLTE_ERROR otherwise + */ +SRSLTE_API int srslte_sch_nr_init_rx(srslte_sch_nr_t* q, const srslte_sch_nr_args_t* args); +/** + * @brief Sets SCH object carrier attribute + * @param q Points ats the SCH object + * @param carrier Provides the NR carrier object + * @return SRSLTE_SUCCESS if the setting is successful, SRSLTE_ERROR otherwise + */ SRSLTE_API int srslte_sch_nr_set_carrier(srslte_sch_nr_t* q, const srslte_carrier_nr_t* carrier); +/** + * @brief Free allocated resources used by an SCH intance + * @param q Points ats the SCH object + */ SRSLTE_API void srslte_sch_nr_free(srslte_sch_nr_t* q); SRSLTE_API int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, @@ -129,8 +151,6 @@ SRSLTE_API int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, const uint8_t* data, uint8_t* e_bits); -SRSLTE_API int srslte_sch_nr_decoder_set_carrier(srslte_sch_nr_t* q, const srslte_carrier_nr_t* carrier); - SRSLTE_API int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, const srslte_sch_cfg_t* sch_cfg, const srslte_sch_tb_t* tb, @@ -138,6 +158,19 @@ SRSLTE_API int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, uint8_t* data, bool* crc_ok); +SRSLTE_API int srslte_ulsch_nr_encode(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* cfg, + const srslte_sch_tb_t* tb, + const uint8_t* data, + uint8_t* e_bits); + +SRSLTE_API int srslte_ulsch_nr_decode(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* sch_cfg, + const srslte_sch_tb_t* tb, + int8_t* e_bits, + uint8_t* data, + bool* crc_ok); + SRSLTE_API int srslte_sch_nr_tb_info(const srslte_sch_tb_t* tb, char* str, uint32_t str_len); #endif // SRSLTE_SCH_NR_H \ No newline at end of file diff --git a/lib/include/srslte/phy/ue/ue_dl_nr.h b/lib/include/srslte/phy/ue/ue_dl_nr.h index 960a649bc..3eadf2639 100644 --- a/lib/include/srslte/phy/ue/ue_dl_nr.h +++ b/lib/include/srslte/phy/ue/ue_dl_nr.h @@ -46,7 +46,7 @@ typedef struct SRSLTE_API { cf_t* sf_symbols[SRSLTE_MAX_PORTS]; srslte_chest_dl_res_t chest; srslte_pdsch_nr_t pdsch; - srslte_dmrs_pdsch_t dmrs_pdsch; + srslte_dmrs_sch_t dmrs_pdsch; srslte_dmrs_pdcch_estimator_t dmrs_pdcch; srslte_pdcch_nr_t pdcch; @@ -71,18 +71,18 @@ SRSLTE_API int srslte_ue_dl_nr_find_dl_dci(srslte_ue_dl_nr_t* q, srslte_dci_dl_nr_t* dci_dl_list, uint32_t nof_dci_msg); -SRSLTE_API int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - srslte_pdsch_res_nr_t* res); - -SRSLTE_API int srslte_ue_dl_nr_pdsch_info(const srslte_ue_dl_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - const srslte_pdsch_res_nr_t res[SRSLTE_MAX_CODEWORDS], - char* str, - uint32_t str_len); +SRSLTE_API int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + srslte_pdsch_res_nr_t* res); + +SRSLTE_API int srslte_ue_dl_nr_pdsch_info(const srslte_ue_dl_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + const srslte_pdsch_res_nr_t res[SRSLTE_MAX_CODEWORDS], + char* str, + uint32_t str_len); #ifdef __cplusplus } diff --git a/lib/include/srslte/phy/ue/ue_dl_nr_data.h b/lib/include/srslte/phy/ue/ue_dl_nr_data.h index c70beea80..b4c2266e5 100644 --- a/lib/include/srslte/phy/ue/ue_dl_nr_data.h +++ b/lib/include/srslte/phy/ue/ue_dl_nr_data.h @@ -24,7 +24,7 @@ #define SRSLTE_UE_DL_NR_DATA_H #include "srslte/phy/common/phy_common_nr.h" -#include "srslte/phy/phch/pdsch_cfg_nr.h" +#include "srslte/phy/phch/phch_cfg_nr.h" #ifdef __cplusplus extern "C" { @@ -41,7 +41,7 @@ extern "C" { * @return Returns SRSLTE_SUCCESS if the provided allocation is valid, otherwise it returns SRSLTE_ERROR code */ SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocation_t* pdsch_alloc, - srslte_pdsch_grant_nr_t* grant); + srslte_sch_grant_nr_t* grant); /** * @brief Calculates the PDSCH time resource default A and stores it in the provided PDSCH NR grant. This can be used by @@ -55,9 +55,9 @@ SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocat * @param[out] grant PDSCH mapping type * @return Returns SRSLTE_SUCCESS if the provided allocation is valid, otherwise it returns SRSLTE_ERROR code */ -SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t m, - srslte_dmrs_pdsch_typeA_pos_t dmrs_typeA_pos, - srslte_pdsch_grant_nr_t* grant); +SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t m, + srslte_dmrs_sch_typeA_pos_t dmrs_typeA_pos, + srslte_sch_grant_nr_t* grant); /** * @brief Calculates the number of PDSCH-DMRS CDM groups without data for DCI format 1_0 * @@ -67,8 +67,8 @@ SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t * @param[out] grant Provides grant pointer to fill * @return Returns SRSLTE_SUCCESS if the provided data is valid, otherwise it returns SRSLTE_ERROR code */ -SRSLTE_API int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_pdsch_cfg_nr_t* pdsch_cfg, - srslte_pdsch_grant_nr_t* grant); +SRSLTE_API int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_sch_cfg_nr_t* pdsch_cfg, + srslte_sch_grant_nr_t* grant); #ifdef __cplusplus } diff --git a/lib/include/srslte/phy/ue/ue_ul_nr_data.h b/lib/include/srslte/phy/ue/ue_ul_nr_data.h new file mode 100644 index 000000000..fe25f47e7 --- /dev/null +++ b/lib/include/srslte/phy/ue/ue_ul_nr_data.h @@ -0,0 +1,61 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +/****************************************************************************** + * @file ue_dl_nr.h + * + * Description: NR UE uplink physical layer procedures for data + * + * This module is a frontend to all the uplink data channel processing modules. + * + * Reference: + *****************************************************************************/ + +#ifndef SRSLTE_UE_UL_DATA_H +#define SRSLTE_UE_UL_DATA_H + +#include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/phch/phch_cfg_nr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Calculates the PUSCH time resource default A and stores it in the provided PUSCH NR grant. + * + * @remark Defined by TS 38.214 V15.10.0 Table 6.1.2.1.1-2: Default PUSCH time domain resource allocation A for normal + * CP + * + * @param m Time domain resource assignment field value m of the DCI + * @param[out] grant PUSCH grant + * @return Returns SRSLTE_SUCCESS if the provided allocation is valid, otherwise it returns SRSLTE_ERROR code + */ +SRSLTE_API int srslte_ue_ul_nr_pdsch_time_resource_default_A(uint32_t m, srslte_sch_grant_nr_t* grant); + +/** + * @brief Calculates the number of PUSCH-DMRS CDM groups without data for DCI format 0_0 + * + * @remark Defined by TS 38.214 V15.10.0 6.2.2 UE DM-RS transmission procedure + * + * @param cfg PUSCH NR configuration by upper layers + * @param[out] grant Provides grant pointer to fill + * @return Returns SRSLTE_SUCCESS if the provided data is valid, otherwise it returns SRSLTE_ERROR code + */ +SRSLTE_API int srslte_ue_ul_nr_nof_dmrs_cdm_groups_without_data_format_0_0(const srslte_sch_cfg_nr_t* cfg, + srslte_sch_grant_nr_t* grant); + +#ifdef __cplusplus +} +#endif + +#endif // SRSLTE_UE_UL_DATA_H diff --git a/lib/src/phy/ch_estimation/dmrs_pdsch.c b/lib/src/phy/ch_estimation/dmrs_sch.c similarity index 70% rename from lib/src/phy/ch_estimation/dmrs_pdsch.c rename to lib/src/phy/ch_estimation/dmrs_sch.c index 16b652dab..4bd0eddc7 100644 --- a/lib/src/phy/ch_estimation/dmrs_pdsch.c +++ b/lib/src/phy/ch_estimation/dmrs_sch.c @@ -10,22 +10,22 @@ * */ -#include "srslte/phy/ch_estimation/dmrs_pdsch.h" +#include "srslte/phy/ch_estimation/dmrs_sch.h" #include -#define SRSLTE_DMRS_PDSCH_TYPEA_SINGLE_DURATION_MIN 3 -#define SRSLTE_DMRS_PDSCH_TYPEA_DOUBLE_DURATION_MIN 4 +#define SRSLTE_DMRS_SCH_TYPEA_SINGLE_DURATION_MIN 3 +#define SRSLTE_DMRS_SCH_TYPEA_DOUBLE_DURATION_MIN 4 -int srslte_dmrs_pdsch_cfg_to_str(const srslte_pdsch_dmrs_cfg_t* cfg, char* msg, uint32_t max_len) +int srslte_dmrs_sch_cfg_to_str(const srslte_dmrs_sch_cfg_t* cfg, char* msg, uint32_t max_len) { int type = (int)cfg->type + 1; int typeA_pos = (int)cfg->typeA_pos + 2; - int additional_pos = cfg->additional_pos == srslte_dmrs_pdsch_add_pos_0 + int additional_pos = cfg->additional_pos == srslte_dmrs_sch_add_pos_0 ? 0 - : cfg->additional_pos == srslte_dmrs_pdsch_add_pos_1 + : cfg->additional_pos == srslte_dmrs_sch_add_pos_1 ? 1 - : cfg->additional_pos == srslte_dmrs_pdsch_add_pos_2 ? 2 : 3; - const char* len = cfg->length == srslte_dmrs_pdsch_len_1 ? "single" : "double"; + : cfg->additional_pos == srslte_dmrs_sch_add_pos_2 ? 2 : 3; + const char* len = cfg->length == srslte_dmrs_sch_len_1 ? "single" : "double"; return srslte_print_check( msg, max_len, 0, "type=%d, typeA_pos=%d, add_pos=%d, len=%s", type, typeA_pos, additional_pos, len); @@ -63,9 +63,9 @@ srslte_dmrs_get_pilots_type2(uint32_t start_prb, uint32_t nof_prb, uint32_t delt return count; } -static uint32_t srslte_dmrs_get_lse(srslte_dmrs_pdsch_t* q, +static uint32_t srslte_dmrs_get_lse(srslte_dmrs_sch_t* q, srslte_sequence_state_t* sequence_state, - srslte_dmrs_pdsch_type_t dmrs_type, + srslte_dmrs_sch_type_t dmrs_type, uint32_t start_prb, uint32_t nof_prb, uint32_t delta, @@ -76,10 +76,10 @@ static uint32_t srslte_dmrs_get_lse(srslte_dmrs_pdsch_t* q, switch (dmrs_type) { - case srslte_dmrs_pdsch_type_1: + case srslte_dmrs_sch_type_1: count = srslte_dmrs_get_pilots_type1(start_prb, nof_prb, delta, symbols, least_square_estimates); break; - case srslte_dmrs_pdsch_type_2: + case srslte_dmrs_sch_type_2: count = srslte_dmrs_get_pilots_type2(start_prb, nof_prb, delta, symbols, least_square_estimates); break; default: @@ -127,25 +127,25 @@ srslte_dmrs_put_pilots_type2(uint32_t start_prb, uint32_t nof_prb, uint32_t delt return count; } -static uint32_t srslte_dmrs_put_pilots(srslte_dmrs_pdsch_t* q, +static uint32_t srslte_dmrs_put_pilots(srslte_dmrs_sch_t* q, srslte_sequence_state_t* sequence_state, - srslte_dmrs_pdsch_type_t dmrs_type, + srslte_dmrs_sch_type_t dmrs_type, uint32_t start_prb, uint32_t nof_prb, uint32_t delta, cf_t* symbols) { - uint32_t count = (dmrs_type == srslte_dmrs_pdsch_type_1) ? nof_prb * 6 : nof_prb * 4; + uint32_t count = (dmrs_type == srslte_dmrs_sch_type_1) ? nof_prb * 6 : nof_prb * 4; // Generate sequence for the given pilots srslte_sequence_state_gen_f(sequence_state, M_SQRT1_2, (float*)q->temp, count * 2); switch (dmrs_type) { - case srslte_dmrs_pdsch_type_1: + case srslte_dmrs_sch_type_1: count = srslte_dmrs_put_pilots_type1(start_prb, nof_prb, delta, symbols, q->temp); break; - case srslte_dmrs_pdsch_type_2: + case srslte_dmrs_sch_type_2: count = srslte_dmrs_put_pilots_type2(start_prb, nof_prb, delta, symbols, q->temp); break; default: @@ -155,19 +155,19 @@ static uint32_t srslte_dmrs_put_pilots(srslte_dmrs_pdsch_t* q, return count; } -static int srslte_dmrs_pdsch_put_symbol(srslte_dmrs_pdsch_t* q, - const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - uint32_t cinit, - uint32_t delta, - cf_t* symbols) +static int srslte_dmrs_sch_put_symbol(srslte_dmrs_sch_t* q, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + uint32_t cinit, + uint32_t delta, + cf_t* symbols) { - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &pdsch_cfg->dmrs_cfg_typeA : &pdsch_cfg->dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &pdsch_cfg->dmrs_typeA : &pdsch_cfg->dmrs_typeB; uint32_t prb_count = 0; // Counts consecutive used PRB uint32_t prb_start = 0; // Start consecutive used PRB uint32_t prb_skip = 0; // Number of PRB to skip - uint32_t nof_pilots_x_prb = dmrs_cfg->type == srslte_dmrs_pdsch_type_1 ? 6 : 4; + uint32_t nof_pilots_x_prb = dmrs_cfg->type == srslte_dmrs_sch_type_1 ? 6 : 4; uint32_t pilot_count = 0; // Initialise sequence @@ -216,19 +216,19 @@ static int srslte_dmrs_pdsch_put_symbol(srslte_dmrs_pdsch_t* q, } // Implements 3GPP 38.211 R.15 Table 7.4.1.1.2-3 PDSCH mapping type A Single -static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_single(const srslte_pdsch_dmrs_cfg_t* dmrs_cfg, - uint32_t ld, - uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS]) +static int srslte_dmrs_sch_get_symbols_idx_mapping_type_A_single(const srslte_dmrs_sch_cfg_t* dmrs_cfg, + uint32_t ld, + uint32_t symbols[SRSLTE_DMRS_SCH_MAX_SYMBOLS]) { int count = 0; - if (ld < SRSLTE_DMRS_PDSCH_TYPEA_SINGLE_DURATION_MIN) { + if (ld < SRSLTE_DMRS_SCH_TYPEA_SINGLE_DURATION_MIN) { ERROR("Duration is below the minimum\n"); return SRSLTE_ERROR; } // l0 = 3 if the higher-layer parameter dmrs-TypeA-Position is equal to 'pos3' and l0 = 2 otherwise - int l0 = (dmrs_cfg->typeA_pos == srslte_dmrs_pdsch_typeA_pos_3) ? 3 : 2; + int l0 = (dmrs_cfg->typeA_pos == srslte_dmrs_sch_typeA_pos_3) ? 3 : 2; // For PDSCH mapping Type A single-symbol DM-RS, l1 = 11 except if all of the following conditions are fulfilled in // which case l1 = 12: @@ -236,15 +236,15 @@ static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_single(const srslte_ // - the higher-layer parameters dmrs-AdditionalPosition is equal to 'pos1' and l0 = 3; and // - the UE has indicated it is capable of additionalDMRS-DL-Alt int l1 = 11; - if (dmrs_cfg->lte_CRS_to_match_around && dmrs_cfg->additional_pos == srslte_dmrs_pdsch_add_pos_1 && - dmrs_cfg->typeA_pos == srslte_dmrs_pdsch_typeA_pos_3 && dmrs_cfg->additional_DMRS_DL_Alt) { + if (dmrs_cfg->lte_CRS_to_match_around && dmrs_cfg->additional_pos == srslte_dmrs_sch_add_pos_1 && + dmrs_cfg->typeA_pos == srslte_dmrs_sch_typeA_pos_3 && dmrs_cfg->additional_DMRS_DL_Alt) { l1 = 12; } symbols[count] = l0; count++; - if (ld < 8 || dmrs_cfg->additional_pos == srslte_dmrs_pdsch_add_pos_0) { + if (ld < 8 || dmrs_cfg->additional_pos == srslte_dmrs_sch_add_pos_0) { return count; } @@ -252,7 +252,7 @@ static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_single(const srslte_ symbols[count] = 7; count++; } else if (ld < 12) { - if (dmrs_cfg->additional_pos > srslte_dmrs_pdsch_add_pos_2) { + if (dmrs_cfg->additional_pos > srslte_dmrs_sch_add_pos_2) { symbols[count] = 6; count++; } @@ -262,11 +262,11 @@ static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_single(const srslte_ } else if (ld == 12) { switch (dmrs_cfg->additional_pos) { - case srslte_dmrs_pdsch_add_pos_1: + case srslte_dmrs_sch_add_pos_1: symbols[count] = 9; count++; break; - case srslte_dmrs_pdsch_add_pos_2: + case srslte_dmrs_sch_add_pos_2: symbols[count] = 6; count++; symbols[count] = 9; @@ -282,11 +282,11 @@ static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_single(const srslte_ } } else { switch (dmrs_cfg->additional_pos) { - case srslte_dmrs_pdsch_add_pos_1: + case srslte_dmrs_sch_add_pos_1: symbols[count] = l1; count++; break; - case srslte_dmrs_pdsch_add_pos_2: + case srslte_dmrs_sch_add_pos_2: symbols[count] = 7; count++; symbols[count] = 11; @@ -306,31 +306,31 @@ static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_single(const srslte_ } // Implements 3GPP 38.211 R.15 Table 7.4.1.1.2-4 PDSCH mapping type A Double -static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_double(const srslte_pdsch_dmrs_cfg_t* dmrs_cfg, - uint32_t ld, - uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS]) +static int srslte_dmrs_sch_get_symbols_idx_mapping_type_A_double(const srslte_dmrs_sch_cfg_t* dmrs_cfg, + uint32_t ld, + uint32_t symbols[SRSLTE_DMRS_SCH_MAX_SYMBOLS]) { int count = 0; - if (ld < SRSLTE_DMRS_PDSCH_TYPEA_DOUBLE_DURATION_MIN) { + if (ld < SRSLTE_DMRS_SCH_TYPEA_DOUBLE_DURATION_MIN) { return SRSLTE_ERROR; } // According to Table 7.4.1.1.2-4, the additional position 3 is invalid. - if (dmrs_cfg->additional_pos == srslte_dmrs_pdsch_add_pos_3) { + if (dmrs_cfg->additional_pos == srslte_dmrs_sch_add_pos_3) { ERROR("Invalid additional DMRS (%d)\n", dmrs_cfg->additional_pos); return SRSLTE_ERROR; } // l0 = 3 if the higher-layer parameter dmrs-TypeA-Position is equal to 'pos3' and l0 = 2 otherwise - int l0 = (dmrs_cfg->typeA_pos == srslte_dmrs_pdsch_typeA_pos_3) ? 3 : 2; + int l0 = (dmrs_cfg->typeA_pos == srslte_dmrs_sch_typeA_pos_3) ? 3 : 2; symbols[count] = l0; count++; symbols[count] = symbols[count - 1] + 1; count++; - if (ld < 10 || dmrs_cfg->additional_pos == srslte_dmrs_pdsch_add_pos_0) { + if (ld < 10 || dmrs_cfg->additional_pos == srslte_dmrs_sch_add_pos_0) { return count; } @@ -349,27 +349,26 @@ static int srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_double(const srslte_ return count; } -int srslte_dmrs_pdsch_get_symbols_idx(const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS]) +int srslte_dmrs_sch_get_symbols_idx(const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + uint32_t symbols[SRSLTE_DMRS_SCH_MAX_SYMBOLS]) { // The position(s) of the DM-RS symbols is given by l and duration ld where // - for PDSCH mapping type A, ld is the duration between the first OFDM symbol of the slot and the last OFDM symbol // of the scheduled PDSCH resources in the slot // - for PDSCH mapping type B, ld is the duration of the scheduled PDSCH resources uint32_t ld = grant->L; - if (grant->mapping == srslte_pdsch_mapping_type_A) { + if (grant->mapping == srslte_sch_mapping_type_A) { ld = grant->S + grant->L; } - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &cfg->dmrs_cfg_typeA : &cfg->dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &cfg->dmrs_typeA : &cfg->dmrs_typeB; switch (grant->mapping) { - case srslte_pdsch_mapping_type_A: + case srslte_sch_mapping_type_A: // The case dmrs-AdditionalPosition equals to 'pos3' is only supported when dmrs-TypeA-Position is equal to 'pos2' - if (dmrs_cfg->typeA_pos != srslte_dmrs_pdsch_typeA_pos_2 && - dmrs_cfg->additional_pos == srslte_dmrs_pdsch_add_pos_3) { + if (dmrs_cfg->typeA_pos != srslte_dmrs_sch_typeA_pos_2 && dmrs_cfg->additional_pos == srslte_dmrs_sch_add_pos_3) { ERROR("The case dmrs-AdditionalPosition equals to 'pos3' is only supported when dmrs-TypeA-Position is equal " "to 'pos2'\n"); return SRSLTE_ERROR; @@ -377,17 +376,17 @@ int srslte_dmrs_pdsch_get_symbols_idx(const srslte_pdsch_cfg_nr_t* cfg, // For PDSCH mapping type A, ld = 3 and ld = 4 symbols in Tables 7.4.1.1.2-3 and 7.4.1.1.2-4 respectively is only // applicable when dmrs-TypeA-Position is equal to 'pos2 - if ((ld == 3 || ld == 4) && dmrs_cfg->typeA_pos != srslte_dmrs_pdsch_typeA_pos_2) { + if ((ld == 3 || ld == 4) && dmrs_cfg->typeA_pos != srslte_dmrs_sch_typeA_pos_2) { ERROR("For PDSCH mapping type A, ld = 3 and ld = 4 symbols in Tables 7.4.1.1.2-3 and 7.4.1.1.2-4 respectively " "is only applicable when dmrs-TypeA-Position is equal to 'pos2\n"); return SRSLTE_ERROR; } - if (dmrs_cfg->length == srslte_dmrs_pdsch_len_1) { - return srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_single(dmrs_cfg, ld, symbols); + if (dmrs_cfg->length == srslte_dmrs_sch_len_1) { + return srslte_dmrs_sch_get_symbols_idx_mapping_type_A_single(dmrs_cfg, ld, symbols); } - return srslte_dmrs_pdsch_get_symbols_idx_mapping_type_A_double(dmrs_cfg, ld, symbols); - case srslte_pdsch_mapping_type_B: + return srslte_dmrs_sch_get_symbols_idx_mapping_type_A_double(dmrs_cfg, ld, symbols); + case srslte_sch_mapping_type_B: ERROR("Error PDSCH mapping type B not supported\n"); return SRSLTE_ERROR; } @@ -395,12 +394,12 @@ int srslte_dmrs_pdsch_get_symbols_idx(const srslte_pdsch_cfg_nr_t* cfg, return SRSLTE_ERROR; } -int srslte_dmrs_pdsch_get_sc_idx(const srslte_pdsch_dmrs_cfg_t* cfg, uint32_t max_count, uint32_t* sc_idx) +int srslte_dmrs_sch_get_sc_idx(const srslte_dmrs_sch_cfg_t* cfg, uint32_t max_count, uint32_t* sc_idx) { int count = 0; uint32_t delta = 0; - if (cfg->type == srslte_dmrs_pdsch_type_1) { + if (cfg->type == srslte_dmrs_sch_type_1) { for (uint32_t n = 0; count < max_count; n += 4) { for (uint32_t k_prime = 0; k_prime < 2 && count < max_count; k_prime++) { sc_idx[count++] = n + 2 * k_prime + delta; @@ -417,10 +416,10 @@ int srslte_dmrs_pdsch_get_sc_idx(const srslte_pdsch_dmrs_cfg_t* cfg, uint32_t ma return count; } -int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, const srslte_pdsch_grant_nr_t* grant) +int srslte_dmrs_sch_get_N_prb(const srslte_sch_cfg_nr_t* cfg, const srslte_sch_grant_nr_t* grant) { - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &cfg->dmrs_cfg_typeA : &cfg->dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &cfg->dmrs_typeA : &cfg->dmrs_typeB; if (grant->nof_dmrs_cdm_groups_without_data < 1 || grant->nof_dmrs_cdm_groups_without_data > 3) { ERROR("Invalid number if DMRS CDM groups without data (%d). Valid values: 1, 2 , 3\n", @@ -429,12 +428,12 @@ int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, const srslte_p } // Get number of frequency domain resource elements used for DMRS - int nof_sc = SRSLTE_MIN( - SRSLTE_NRE, grant->nof_dmrs_cdm_groups_without_data * (dmrs_cfg->type == srslte_dmrs_pdsch_type_1 ? 6 : 4)); + int nof_sc = SRSLTE_MIN(SRSLTE_NRE, + grant->nof_dmrs_cdm_groups_without_data * (dmrs_cfg->type == srslte_dmrs_sch_type_1 ? 6 : 4)); // Get number of symbols used for DMRS - uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS] = {}; - int ret = srslte_dmrs_pdsch_get_symbols_idx(cfg, grant, symbols); + uint32_t symbols[SRSLTE_DMRS_SCH_MAX_SYMBOLS] = {}; + int ret = srslte_dmrs_sch_get_symbols_idx(cfg, grant, symbols); if (ret < SRSLTE_SUCCESS) { ERROR("Error getting PDSCH DMRS symbol indexes\n"); return SRSLTE_ERROR; @@ -443,14 +442,14 @@ int srslte_dmrs_pdsch_get_N_prb(const srslte_pdsch_cfg_nr_t* cfg, const srslte_p return nof_sc * ret; } -static uint32_t srslte_dmrs_pdsch_seed(const srslte_carrier_nr_t* carrier, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - uint32_t slot_idx, - uint32_t symbol_idx) +static uint32_t srslte_dmrs_sch_seed(const srslte_carrier_nr_t* carrier, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + uint32_t slot_idx, + uint32_t symbol_idx) { - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &cfg->dmrs_cfg_typeA : &cfg->dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &cfg->dmrs_typeA : &cfg->dmrs_typeB; slot_idx = slot_idx % SRSLTE_NSLOTS_PER_FRAME_NR(carrier->numerology); @@ -470,7 +469,7 @@ static uint32_t srslte_dmrs_pdsch_seed(const srslte_carrier_nr_t* carrier, (uint64_t)INT32_MAX); } -int srslte_dmrs_pdsch_init(srslte_dmrs_pdsch_t* q, bool is_ue) +int srslte_dmrs_sch_init(srslte_dmrs_sch_t* q, bool is_ue) { if (q == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; @@ -483,7 +482,7 @@ int srslte_dmrs_pdsch_init(srslte_dmrs_pdsch_t* q, bool is_ue) return SRSLTE_SUCCESS; } -void srslte_dmrs_pdsch_free(srslte_dmrs_pdsch_t* q) +void srslte_dmrs_sch_free(srslte_dmrs_sch_t* q) { if (q == NULL) { return; @@ -498,10 +497,10 @@ void srslte_dmrs_pdsch_free(srslte_dmrs_pdsch_t* q) free(q->temp); } - SRSLTE_MEM_ZERO(q, srslte_dmrs_pdsch_t, 1); + SRSLTE_MEM_ZERO(q, srslte_dmrs_sch_t, 1); } -int srslte_dmrs_pdsch_set_carrier(srslte_dmrs_pdsch_t* q, const srslte_carrier_nr_t* carrier) +int srslte_dmrs_sch_set_carrier(srslte_dmrs_sch_t* q, const srslte_carrier_nr_t* carrier) { bool max_nof_prb_changed = q->max_nof_prb < carrier->nof_prb; @@ -544,7 +543,7 @@ int srslte_dmrs_pdsch_set_carrier(srslte_dmrs_pdsch_t* q, const srslte_carrier_n } // The maximum number of pilots is for Type 1 - q->pilot_estimates = srslte_vec_cf_malloc(SRSLTE_DMRS_PDSCH_MAX_SYMBOLS * q->max_nof_prb * SRSLTE_NRE / 2); + q->pilot_estimates = srslte_vec_cf_malloc(SRSLTE_DMRS_SCH_MAX_SYMBOLS * q->max_nof_prb * SRSLTE_NRE / 2); if (!q->pilot_estimates) { ERROR("malloc\n"); return SRSLTE_ERROR; @@ -554,11 +553,11 @@ int srslte_dmrs_pdsch_set_carrier(srslte_dmrs_pdsch_t* q, const srslte_carrier_n return SRSLTE_SUCCESS; } -int srslte_dmrs_pdsch_put_sf(srslte_dmrs_pdsch_t* q, - const srslte_dl_slot_cfg_t* slot_cfg, - const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - cf_t* sf_symbols) +int srslte_dmrs_sch_put_sf(srslte_dmrs_sch_t* q, + const srslte_dl_slot_cfg_t* slot_cfg, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* sf_symbols) { uint32_t delta = 0; @@ -569,8 +568,8 @@ int srslte_dmrs_pdsch_put_sf(srslte_dmrs_pdsch_t* q, uint32_t symbol_sz = q->carrier.nof_prb * SRSLTE_NRE; // Symbol size in resource elements // Get symbols indexes - uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS] = {}; - int nof_symbols = srslte_dmrs_pdsch_get_symbols_idx(pdsch_cfg, grant, symbols); + uint32_t symbols[SRSLTE_DMRS_SCH_MAX_SYMBOLS] = {}; + int nof_symbols = srslte_dmrs_sch_get_symbols_idx(pdsch_cfg, grant, symbols); if (nof_symbols < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } @@ -579,29 +578,29 @@ int srslte_dmrs_pdsch_put_sf(srslte_dmrs_pdsch_t* q, for (uint32_t i = 0; i < nof_symbols; i++) { uint32_t l = symbols[i]; // Symbol index inside the slot uint32_t slot_idx = slot_cfg->idx; // Slot index in the frame - uint32_t cinit = srslte_dmrs_pdsch_seed(&q->carrier, pdsch_cfg, grant, slot_idx, l); + uint32_t cinit = srslte_dmrs_sch_seed(&q->carrier, pdsch_cfg, grant, slot_idx, l); - srslte_dmrs_pdsch_put_symbol(q, pdsch_cfg, grant, cinit, delta, &sf_symbols[symbol_sz * l]); + srslte_dmrs_sch_put_symbol(q, pdsch_cfg, grant, cinit, delta, &sf_symbols[symbol_sz * l]); } return SRSLTE_SUCCESS; } -static int srslte_dmrs_pdsch_get_symbol(srslte_dmrs_pdsch_t* q, - const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - uint32_t cinit, - uint32_t delta, - const cf_t* symbols, - cf_t* least_square_estimates) +static int srslte_dmrs_sch_get_symbol(srslte_dmrs_sch_t* q, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + uint32_t cinit, + uint32_t delta, + const cf_t* symbols, + cf_t* least_square_estimates) { - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &pdsch_cfg->dmrs_cfg_typeA : &pdsch_cfg->dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &pdsch_cfg->dmrs_typeA : &pdsch_cfg->dmrs_typeB; uint32_t prb_count = 0; // Counts consecutive used PRB uint32_t prb_start = 0; // Start consecutive used PRB uint32_t prb_skip = 0; // Number of PRB to skip - uint32_t nof_pilots_x_prb = dmrs_cfg->type == srslte_dmrs_pdsch_type_1 ? 6 : 4; + uint32_t nof_pilots_x_prb = dmrs_cfg->type == srslte_dmrs_sch_type_1 ? 6 : 4; uint32_t pilot_count = 0; // Initialise sequence @@ -662,12 +661,12 @@ static int srslte_dmrs_pdsch_get_symbol(srslte_dmrs_pdsch_t* q, return pilot_count; } -int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, - const srslte_dl_slot_cfg_t* slot_cfg, - const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - const cf_t* sf_symbols, - srslte_chest_dl_res_t* chest_res) +int srslte_dmrs_sch_estimate(srslte_dmrs_sch_t* q, + const srslte_dl_slot_cfg_t* slot_cfg, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + const cf_t* sf_symbols, + srslte_chest_dl_res_t* chest_res) { const uint32_t delta = 0; @@ -675,15 +674,15 @@ int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, return SRSLTE_ERROR_INVALID_INPUTS; } - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &pdsch_cfg->dmrs_cfg_typeA : &pdsch_cfg->dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &pdsch_cfg->dmrs_typeA : &pdsch_cfg->dmrs_typeB; cf_t* ce = q->temp; uint32_t symbol_sz = q->carrier.nof_prb * SRSLTE_NRE; // Symbol size in resource elements // Get symbols indexes - uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS] = {}; - int nof_symbols = srslte_dmrs_pdsch_get_symbols_idx(pdsch_cfg, grant, symbols); + uint32_t symbols[SRSLTE_DMRS_SCH_MAX_SYMBOLS] = {}; + int nof_symbols = srslte_dmrs_sch_get_symbols_idx(pdsch_cfg, grant, symbols); if (nof_symbols <= SRSLTE_SUCCESS) { ERROR("Error getting symbol indexes\n"); return SRSLTE_ERROR; @@ -695,9 +694,9 @@ int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, for (uint32_t i = 0; i < nof_symbols; i++) { uint32_t l = symbols[i]; // Symbol index inside the slot - uint32_t cinit = srslte_dmrs_pdsch_seed(&q->carrier, pdsch_cfg, grant, slot_cfg->idx, l); + uint32_t cinit = srslte_dmrs_sch_seed(&q->carrier, pdsch_cfg, grant, slot_cfg->idx, l); - nof_pilots_x_symbol = srslte_dmrs_pdsch_get_symbol( + nof_pilots_x_symbol = srslte_dmrs_sch_get_symbol( q, pdsch_cfg, grant, cinit, delta, &sf_symbols[symbol_sz * l], &q->pilot_estimates[nof_pilots_x_symbol * i]); if (nof_pilots_x_symbol == 0) { @@ -720,8 +719,8 @@ int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, // Frequency domain interpolate uint32_t nof_re_x_symbol = - (dmrs_cfg->type == srslte_dmrs_pdsch_type_1) ? nof_pilots_x_symbol * 2 : nof_pilots_x_symbol * 3; - if (dmrs_cfg->type == srslte_dmrs_pdsch_type_1) { + (dmrs_cfg->type == srslte_dmrs_sch_type_1) ? nof_pilots_x_symbol * 2 : nof_pilots_x_symbol * 3; + if (dmrs_cfg->type == srslte_dmrs_sch_type_1) { // Prepare interpolator if (srslte_interp_linear_resize(&q->interpolator_type1, nof_pilots_x_symbol, 2) < SRSLTE_SUCCESS) { ERROR("Resizing interpolator nof_pilots_x_symbol=%d; M=%d;\n", nof_pilots_x_symbol, 2); @@ -753,7 +752,7 @@ int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, if (symbols[symbol_idx] == l) { switch (dmrs_cfg->type) { - case srslte_dmrs_pdsch_type_1: + case srslte_dmrs_sch_type_1: // Skip if there is no data to read if (grant->nof_dmrs_cdm_groups_without_data != 1) { continue; @@ -763,7 +762,7 @@ int srslte_dmrs_pdsch_estimate(srslte_dmrs_pdsch_t* q, count++; } break; - case srslte_dmrs_pdsch_type_2: + case srslte_dmrs_sch_type_2: // Skip if there is no data to read if (grant->nof_dmrs_cdm_groups_without_data != 1 && grant->nof_dmrs_cdm_groups_without_data != 2) { continue; diff --git a/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c b/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c index 4d5460f9d..00568a422 100644 --- a/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c +++ b/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c @@ -11,7 +11,7 @@ */ #include "srslte/common/test_common.h" -#include "srslte/phy/ch_estimation/dmrs_pdsch.h" +#include "srslte/phy/ch_estimation/dmrs_sch.h" #include "srslte/phy/ue/ue_dl_nr_data.h" #include "srslte/srslte.h" #include @@ -29,95 +29,95 @@ static srslte_carrier_nr_t carrier = { }; typedef struct { - srslte_pdsch_mapping_type_t mapping_type; - srslte_dmrs_pdsch_typeA_pos_t typeA_pos; - srslte_dmrs_pdsch_len_t max_length; - srslte_dmrs_pdsch_add_pos_t additional_pos; - srslte_dmrs_pdsch_type_t type; - uint32_t symbol_idx[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS]; - uint32_t nof_symbols; - uint32_t sc_idx[SRSLTE_NRE]; - uint32_t nof_sc; + srslte_sch_mapping_type_t mapping_type; + srslte_dmrs_sch_typeA_pos_t typeA_pos; + srslte_dmrs_sch_len_t max_length; + srslte_dmrs_sch_add_pos_t additional_pos; + srslte_dmrs_sch_type_t type; + uint32_t symbol_idx[SRSLTE_DMRS_SCH_MAX_SYMBOLS]; + uint32_t nof_symbols; + uint32_t sc_idx[SRSLTE_NRE]; + uint32_t nof_sc; } golden_t; // Golden values extracted from https://www.sharetechnote.com/html/5G/5G_PDSCH_DMRS.html -static const golden_t gold[] = {{.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_2, - .max_length = srslte_dmrs_pdsch_len_1, - .additional_pos = srslte_dmrs_pdsch_add_pos_0, - .type = srslte_dmrs_pdsch_type_2, +static const golden_t gold[] = {{.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_2, + .max_length = srslte_dmrs_sch_len_1, + .additional_pos = srslte_dmrs_sch_add_pos_0, + .type = srslte_dmrs_sch_type_2, .nof_symbols = 1, .symbol_idx = {2}, .nof_sc = 4, .sc_idx = {0, 1, 6, 7}}, - {.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_3, - .max_length = srslte_dmrs_pdsch_len_1, - .additional_pos = srslte_dmrs_pdsch_add_pos_0, - .type = srslte_dmrs_pdsch_type_2, + {.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_3, + .max_length = srslte_dmrs_sch_len_1, + .additional_pos = srslte_dmrs_sch_add_pos_0, + .type = srslte_dmrs_sch_type_2, .nof_symbols = 1, .symbol_idx = {3}, .nof_sc = 4, .sc_idx = {0, 1, 6, 7}}, - {.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_2, - .max_length = srslte_dmrs_pdsch_len_2, - .additional_pos = srslte_dmrs_pdsch_add_pos_0, - .type = srslte_dmrs_pdsch_type_2, + {.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_2, + .max_length = srslte_dmrs_sch_len_2, + .additional_pos = srslte_dmrs_sch_add_pos_0, + .type = srslte_dmrs_sch_type_2, .nof_symbols = 2, .symbol_idx = {2, 3}, .nof_sc = 4, .sc_idx = {0, 1, 6, 7}}, - {.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_2, - .max_length = srslte_dmrs_pdsch_len_1, - .additional_pos = srslte_dmrs_pdsch_add_pos_1, - .type = srslte_dmrs_pdsch_type_2, + {.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_2, + .max_length = srslte_dmrs_sch_len_1, + .additional_pos = srslte_dmrs_sch_add_pos_1, + .type = srslte_dmrs_sch_type_2, .nof_symbols = 2, .symbol_idx = {2, 11}, .nof_sc = 4, .sc_idx = {0, 1, 6, 7}}, - {.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_2, - .max_length = srslte_dmrs_pdsch_len_1, - .additional_pos = srslte_dmrs_pdsch_add_pos_2, - .type = srslte_dmrs_pdsch_type_2, + {.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_2, + .max_length = srslte_dmrs_sch_len_1, + .additional_pos = srslte_dmrs_sch_add_pos_2, + .type = srslte_dmrs_sch_type_2, .nof_symbols = 3, .symbol_idx = {2, 7, 11}, .nof_sc = 4, .sc_idx = {0, 1, 6, 7}}, - {.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_2, - .max_length = srslte_dmrs_pdsch_len_1, - .additional_pos = srslte_dmrs_pdsch_add_pos_3, - .type = srslte_dmrs_pdsch_type_2, + {.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_2, + .max_length = srslte_dmrs_sch_len_1, + .additional_pos = srslte_dmrs_sch_add_pos_3, + .type = srslte_dmrs_sch_type_2, .nof_symbols = 4, .symbol_idx = {2, 5, 8, 11}, .nof_sc = 4, .sc_idx = {0, 1, 6, 7}}, - {.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_2, - .max_length = srslte_dmrs_pdsch_len_1, - .additional_pos = srslte_dmrs_pdsch_add_pos_0, - .type = srslte_dmrs_pdsch_type_1, + {.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_2, + .max_length = srslte_dmrs_sch_len_1, + .additional_pos = srslte_dmrs_sch_add_pos_0, + .type = srslte_dmrs_sch_type_1, .nof_symbols = 1, .symbol_idx = {2}, .nof_sc = 6, .sc_idx = {0, 2, 4, 6, 8, 10}}, - {.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_2, - .max_length = srslte_dmrs_pdsch_len_2, - .additional_pos = srslte_dmrs_pdsch_add_pos_0, - .type = srslte_dmrs_pdsch_type_1, + {.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_2, + .max_length = srslte_dmrs_sch_len_2, + .additional_pos = srslte_dmrs_sch_add_pos_0, + .type = srslte_dmrs_sch_type_1, .nof_symbols = 2, .symbol_idx = {2, 3}, .nof_sc = 6, .sc_idx = {0, 2, 4, 6, 8, 10}}, - {.mapping_type = srslte_pdsch_mapping_type_A, - .typeA_pos = srslte_dmrs_pdsch_typeA_pos_2, - .max_length = srslte_dmrs_pdsch_len_1, - .additional_pos = srslte_dmrs_pdsch_add_pos_3, - .type = srslte_dmrs_pdsch_type_1, + {.mapping_type = srslte_sch_mapping_type_A, + .typeA_pos = srslte_dmrs_sch_typeA_pos_2, + .max_length = srslte_dmrs_sch_len_1, + .additional_pos = srslte_dmrs_sch_add_pos_3, + .type = srslte_dmrs_sch_type_1, .nof_symbols = 4, .symbol_idx = {2, 5, 8, 11}, .nof_sc = 6, @@ -156,7 +156,7 @@ static void parse_args(int argc, char** argv) } } -static int assert_cfg(const srslte_pdsch_cfg_nr_t* pdsch_cfg, const srslte_pdsch_grant_nr_t* grant) +static int assert_cfg(const srslte_sch_cfg_nr_t* pdsch_cfg, const srslte_sch_grant_nr_t* grant) { for (uint32_t i = 0; gold[i].nof_sc != 0; i++) { // Gold examples are done for more than 12 symbols @@ -168,24 +168,24 @@ static int assert_cfg(const srslte_pdsch_cfg_nr_t* pdsch_cfg, const srslte_pdsch continue; } - if (pdsch_cfg->dmrs_cfg_typeA.typeA_pos != gold[i].typeA_pos) { + if (pdsch_cfg->dmrs_typeA.typeA_pos != gold[i].typeA_pos) { continue; } - if (pdsch_cfg->dmrs_cfg_typeA.additional_pos != gold[i].additional_pos) { + if (pdsch_cfg->dmrs_typeA.additional_pos != gold[i].additional_pos) { continue; } - if (pdsch_cfg->dmrs_cfg_typeA.length != gold[i].max_length) { + if (pdsch_cfg->dmrs_typeA.length != gold[i].max_length) { continue; } - if (pdsch_cfg->dmrs_cfg_typeA.type != gold[i].type) { + if (pdsch_cfg->dmrs_typeA.type != gold[i].type) { continue; } - uint32_t symbols[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS] = {}; - int nof_symbols = srslte_dmrs_pdsch_get_symbols_idx(pdsch_cfg, grant, symbols); + uint32_t symbols[SRSLTE_DMRS_SCH_MAX_SYMBOLS] = {}; + int nof_symbols = srslte_dmrs_sch_get_symbols_idx(pdsch_cfg, grant, symbols); TESTASSERT(nof_symbols == gold[i].nof_symbols); @@ -194,7 +194,7 @@ static int assert_cfg(const srslte_pdsch_cfg_nr_t* pdsch_cfg, const srslte_pdsch } uint32_t sc[SRSLTE_NRE] = {}; - srslte_dmrs_pdsch_get_sc_idx(&pdsch_cfg->dmrs_cfg_typeA, SRSLTE_NRE, sc); + srslte_dmrs_sch_get_sc_idx(&pdsch_cfg->dmrs_typeA, SRSLTE_NRE, sc); for (uint32_t j = 0; j < gold[i].nof_sc; j++) { TESTASSERT(sc[j] == gold[i].sc_idx[j]); @@ -206,19 +206,19 @@ static int assert_cfg(const srslte_pdsch_cfg_nr_t* pdsch_cfg, const srslte_pdsch return SRSLTE_SUCCESS; } -static int run_test(srslte_dmrs_pdsch_t* dmrs_pdsch, - const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - cf_t* sf_symbols, - srslte_chest_dl_res_t* chest_res) +static int run_test(srslte_dmrs_sch_t* dmrs_pdsch, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* sf_symbols, + srslte_chest_dl_res_t* chest_res) { TESTASSERT(assert_cfg(pdsch_cfg, grant) == SRSLTE_SUCCESS); srslte_dl_slot_cfg_t slot_cfg = {}; for (slot_cfg.idx = 0; slot_cfg.idx < SRSLTE_NSLOTS_PER_FRAME_NR(dmrs_pdsch->carrier.numerology); slot_cfg.idx++) { - TESTASSERT(srslte_dmrs_pdsch_put_sf(dmrs_pdsch, &slot_cfg, pdsch_cfg, grant, sf_symbols) == SRSLTE_SUCCESS); + TESTASSERT(srslte_dmrs_sch_put_sf(dmrs_pdsch, &slot_cfg, pdsch_cfg, grant, sf_symbols) == SRSLTE_SUCCESS); - TESTASSERT(srslte_dmrs_pdsch_estimate(dmrs_pdsch, &slot_cfg, pdsch_cfg, grant, sf_symbols, chest_res) == + TESTASSERT(srslte_dmrs_sch_estimate(dmrs_pdsch, &slot_cfg, pdsch_cfg, grant, sf_symbols, chest_res) == SRSLTE_SUCCESS); float mse = 0.0f; @@ -241,10 +241,10 @@ int main(int argc, char** argv) parse_args(argc, argv); - srslte_dmrs_pdsch_t dmrs_pdsch = {}; - srslte_pdsch_cfg_nr_t pdsch_cfg = {}; - srslte_pdsch_grant_nr_t grant = {}; - srslte_chest_dl_res_t chest_dl_res = {}; + srslte_dmrs_sch_t dmrs_pdsch = {}; + srslte_sch_cfg_nr_t pdsch_cfg = {}; + srslte_sch_grant_nr_t grant = {}; + srslte_chest_dl_res_t chest_dl_res = {}; uint32_t nof_re = carrier.nof_prb * SRSLTE_NRE * SRSLTE_NOF_SLOTS_PER_SF * SRSLTE_MAX_NSYMB; cf_t* sf_symbols = srslte_vec_cf_malloc(nof_re); @@ -253,13 +253,13 @@ int main(int argc, char** argv) uint32_t test_passed = 0; // Initialise object DMRS for PDSCH - if (srslte_dmrs_pdsch_init(&dmrs_pdsch, true) != SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_init(&dmrs_pdsch, true) != SRSLTE_SUCCESS) { ERROR("Init\n"); goto clean_exit; } // Set carrier configuration - if (srslte_dmrs_pdsch_set_carrier(&dmrs_pdsch, &carrier) != SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_set_carrier(&dmrs_pdsch, &carrier) != SRSLTE_SUCCESS) { ERROR("Setting carrier\n"); goto clean_exit; } @@ -271,38 +271,36 @@ int main(int argc, char** argv) // For each DCI m param for (uint32_t m = 0; m < 16; m++) { - srslte_dmrs_pdsch_type_t type_begin = srslte_dmrs_pdsch_type_1; - srslte_dmrs_pdsch_type_t type_end = srslte_dmrs_pdsch_type_2; + srslte_dmrs_sch_type_t type_begin = srslte_dmrs_sch_type_1; + srslte_dmrs_sch_type_t type_end = srslte_dmrs_sch_type_2; - for (pdsch_cfg.dmrs_cfg_typeA.type = type_begin; pdsch_cfg.dmrs_cfg_typeA.type <= type_end; - pdsch_cfg.dmrs_cfg_typeA.type++) { - srslte_dmrs_pdsch_typeA_pos_t typeA_pos_begin = srslte_dmrs_pdsch_typeA_pos_2; - srslte_dmrs_pdsch_typeA_pos_t typeA_pos_end = srslte_dmrs_pdsch_typeA_pos_3; + for (pdsch_cfg.dmrs_typeA.type = type_begin; pdsch_cfg.dmrs_typeA.type <= type_end; pdsch_cfg.dmrs_typeA.type++) { + srslte_dmrs_sch_typeA_pos_t typeA_pos_begin = srslte_dmrs_sch_typeA_pos_2; + srslte_dmrs_sch_typeA_pos_t typeA_pos_end = srslte_dmrs_sch_typeA_pos_3; - for (pdsch_cfg.dmrs_cfg_typeA.typeA_pos = typeA_pos_begin; pdsch_cfg.dmrs_cfg_typeA.typeA_pos <= typeA_pos_end; - pdsch_cfg.dmrs_cfg_typeA.typeA_pos++) { - srslte_dmrs_pdsch_add_pos_t add_pos_begin = srslte_dmrs_pdsch_add_pos_2; - srslte_dmrs_pdsch_add_pos_t add_pos_end = srslte_dmrs_pdsch_add_pos_3; + for (pdsch_cfg.dmrs_typeA.typeA_pos = typeA_pos_begin; pdsch_cfg.dmrs_typeA.typeA_pos <= typeA_pos_end; + pdsch_cfg.dmrs_typeA.typeA_pos++) { + srslte_dmrs_sch_add_pos_t add_pos_begin = srslte_dmrs_sch_add_pos_2; + srslte_dmrs_sch_add_pos_t add_pos_end = srslte_dmrs_sch_add_pos_3; - if (pdsch_cfg.dmrs_cfg_typeA.typeA_pos == srslte_dmrs_pdsch_typeA_pos_3) { - add_pos_end = srslte_dmrs_pdsch_add_pos_1; + if (pdsch_cfg.dmrs_typeA.typeA_pos == srslte_dmrs_sch_typeA_pos_3) { + add_pos_end = srslte_dmrs_sch_add_pos_1; } - for (pdsch_cfg.dmrs_cfg_typeA.additional_pos = add_pos_begin; - pdsch_cfg.dmrs_cfg_typeA.additional_pos <= add_pos_end; - pdsch_cfg.dmrs_cfg_typeA.additional_pos++) { + for (pdsch_cfg.dmrs_typeA.additional_pos = add_pos_begin; pdsch_cfg.dmrs_typeA.additional_pos <= add_pos_end; + pdsch_cfg.dmrs_typeA.additional_pos++) { - srslte_dmrs_pdsch_len_t max_len_begin = srslte_dmrs_pdsch_len_1; - srslte_dmrs_pdsch_len_t max_len_end = srslte_dmrs_pdsch_len_2; + srslte_dmrs_sch_len_t max_len_begin = srslte_dmrs_sch_len_1; + srslte_dmrs_sch_len_t max_len_end = srslte_dmrs_sch_len_2; // Only single DMRS symbols can have additional positions 2 and 3 - if (pdsch_cfg.dmrs_cfg_typeA.additional_pos == srslte_dmrs_pdsch_add_pos_2 || - pdsch_cfg.dmrs_cfg_typeA.additional_pos == srslte_dmrs_pdsch_add_pos_3) { - max_len_end = srslte_dmrs_pdsch_len_1; + if (pdsch_cfg.dmrs_typeA.additional_pos == srslte_dmrs_sch_add_pos_2 || + pdsch_cfg.dmrs_typeA.additional_pos == srslte_dmrs_sch_add_pos_3) { + max_len_end = srslte_dmrs_sch_len_1; } - for (pdsch_cfg.dmrs_cfg_typeA.length = max_len_begin; pdsch_cfg.dmrs_cfg_typeA.length <= max_len_end; - pdsch_cfg.dmrs_cfg_typeA.length++) { + for (pdsch_cfg.dmrs_typeA.length = max_len_begin; pdsch_cfg.dmrs_typeA.length <= max_len_end; + pdsch_cfg.dmrs_typeA.length++) { for (uint32_t bw = 1; bw <= carrier.nof_prb; bw++) { @@ -314,22 +312,21 @@ int main(int argc, char** argv) grant.nof_dmrs_cdm_groups_without_data++) { // Load default type A grant - srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_cfg_typeA.typeA_pos, &grant); + srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &grant); // Copy configuration - pdsch_cfg.dmrs_cfg_typeB = pdsch_cfg.dmrs_cfg_typeA; + pdsch_cfg.dmrs_typeB = pdsch_cfg.dmrs_typeA; int n = run_test(&dmrs_pdsch, &pdsch_cfg, &grant, sf_symbols, &chest_dl_res); if (n == SRSLTE_SUCCESS) { test_passed++; } else { - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = grant.mapping == srslte_pdsch_mapping_type_A - ? &pdsch_cfg.dmrs_cfg_typeA - : &pdsch_cfg.dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant.mapping == srslte_sch_mapping_type_A ? &pdsch_cfg.dmrs_typeA : &pdsch_cfg.dmrs_typeB; char str[64] = {}; - srslte_dmrs_pdsch_cfg_to_str(dmrs_cfg, str, 64); + srslte_dmrs_sch_cfg_to_str(dmrs_cfg, str, 64); ERROR("Test %d failed. %s.\n", test_counter, str); } @@ -349,7 +346,7 @@ clean_exit: free(sf_symbols); } srslte_chest_dl_res_free(&chest_dl_res); - srslte_dmrs_pdsch_free(&dmrs_pdsch); + srslte_dmrs_sch_free(&dmrs_pdsch); ret = test_passed == test_counter ? SRSLTE_SUCCESS : SRSLTE_ERROR; printf("%s, %d of %d test passed successfully.\n", ret ? "Failed" : "Passed", test_passed, test_counter); diff --git a/lib/src/phy/common/phy_common_nr.c b/lib/src/phy/common/phy_common_nr.c index 86e5b2c41..37cc6e51c 100644 --- a/lib/src/phy/common/phy_common_nr.c +++ b/lib/src/phy/common/phy_common_nr.c @@ -35,12 +35,12 @@ uint32_t srslte_coreset_get_sz(const srslte_coreset_t* coreset) return srslte_coreset_get_bw(coreset) * SRSLTE_NRE * coreset->duration; } -const char* srslte_pdsch_mapping_type_to_str(srslte_pdsch_mapping_type_t mapping_type) +const char* srslte_sch_mapping_type_to_str(srslte_sch_mapping_type_t mapping_type) { switch (mapping_type) { - case srslte_pdsch_mapping_type_A: + case srslte_sch_mapping_type_A: return "A"; - case srslte_pdsch_mapping_type_B: + case srslte_sch_mapping_type_B: return "B"; default: return "undefined"; diff --git a/lib/src/phy/enb/enb_dl_nr.c b/lib/src/phy/enb/enb_dl_nr.c index b16773e96..2f7a4a542 100644 --- a/lib/src/phy/enb/enb_dl_nr.c +++ b/lib/src/phy/enb/enb_dl_nr.c @@ -66,7 +66,7 @@ int srslte_enb_dl_nr_init(srslte_enb_dl_nr_t* q, cf_t* output[SRSLTE_MAX_PORTS], srslte_ofdm_tx_init_cfg(&q->fft[i], &fft_cfg); } - if (srslte_dmrs_pdsch_init(&q->dmrs, false) < SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_init(&q->dmrs, false) < SRSLTE_SUCCESS) { ERROR("Error DMRS\n"); return SRSLTE_ERROR; } @@ -94,7 +94,7 @@ void srslte_enb_dl_nr_free(srslte_enb_dl_nr_t* q) } srslte_pdsch_nr_free(&q->pdsch); - srslte_dmrs_pdsch_free(&q->dmrs); + srslte_dmrs_sch_free(&q->dmrs); srslte_pdcch_nr_free(&q->pdcch); @@ -107,7 +107,7 @@ int srslte_enb_dl_nr_set_carrier(srslte_enb_dl_nr_t* q, const srslte_carrier_nr_ return SRSLTE_ERROR; } - if (srslte_dmrs_pdsch_set_carrier(&q->dmrs, carrier) < SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_set_carrier(&q->dmrs, carrier) < SRSLTE_SUCCESS) { ERROR("Error DMRS\n"); return SRSLTE_ERROR; } @@ -213,14 +213,14 @@ int srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, return SRSLTE_SUCCESS; } -int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - uint8_t* data[SRSLTE_MAX_TB]) +int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + uint8_t* data[SRSLTE_MAX_TB]) { - if (srslte_dmrs_pdsch_put_sf(&q->dmrs, slot, cfg, grant, q->sf_symbols[0]) < SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_put_sf(&q->dmrs, slot, cfg, grant, q->sf_symbols[0]) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } @@ -231,11 +231,11 @@ int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, return SRSLTE_SUCCESS; } -int srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - char* str, - uint32_t str_len) +int srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + char* str, + uint32_t str_len) { int len = 0; diff --git a/lib/src/phy/phch/pdsch_nr.c b/lib/src/phy/phch/pdsch_nr.c index 35501f946..a6d79e926 100644 --- a/lib/src/phy/phch/pdsch_nr.c +++ b/lib/src/phy/phch/pdsch_nr.c @@ -198,11 +198,11 @@ static void srslte_pdsch_re_cp(cf_t* sf_symbols, cf_t* symbols, uint32_t count, * - 1, data is mapped in RE marked as 2 * - Otherwise, no data is mapped in this symbol */ -static uint32_t srslte_pdsch_nr_cp_dmrs_type1(const srslte_pdsch_nr_t* q, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols, - bool put) +static uint32_t srslte_pdsch_nr_cp_dmrs_type1(const srslte_pdsch_nr_t* q, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) { uint32_t count = 0; uint32_t delta = 0; @@ -239,11 +239,11 @@ static uint32_t srslte_pdsch_nr_cp_dmrs_type1(const srslte_pdsch_nr_t* q, * - 2, data is mapped in RE marked as 3 * - otherwise, no data is mapped in this symbol */ -static uint32_t srslte_pdsch_nr_cp_dmrs_type2(const srslte_pdsch_nr_t* q, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols, - bool put) +static uint32_t srslte_pdsch_nr_cp_dmrs_type2(const srslte_pdsch_nr_t* q, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) { uint32_t count = 0; @@ -269,23 +269,23 @@ static uint32_t srslte_pdsch_nr_cp_dmrs_type2(const srslte_pdsch_nr_t* q, return count; } -static uint32_t srslte_pdsch_nr_cp_dmrs(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols, - bool put) +static uint32_t srslte_pdsch_nr_cp_dmrs(const srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) { uint32_t count = 0; - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &cfg->dmrs_cfg_typeA : &cfg->dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &cfg->dmrs_typeA : &cfg->dmrs_typeB; switch (dmrs_cfg->type) { - case srslte_dmrs_pdsch_type_1: + case srslte_dmrs_sch_type_1: count = srslte_pdsch_nr_cp_dmrs_type1(q, grant, symbols, sf_symbols, put); break; - case srslte_dmrs_pdsch_type_2: + case srslte_dmrs_sch_type_2: count = srslte_pdsch_nr_cp_dmrs_type2(q, grant, symbols, sf_symbols, put); break; } @@ -293,11 +293,11 @@ static uint32_t srslte_pdsch_nr_cp_dmrs(const srslte_pdsch_nr_t* q, return count; } -static uint32_t srslte_pdsch_nr_cp_clean(const srslte_pdsch_nr_t* q, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols, - bool put) +static uint32_t srslte_pdsch_nr_cp_clean(const srslte_pdsch_nr_t* q, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) { uint32_t count = 0; uint32_t start = 0; // Index of the start of continuous data @@ -339,19 +339,19 @@ static uint32_t srslte_pdsch_nr_cp_clean(const srslte_pdsch_nr_t* q, return count; } -static int srslte_pdsch_nr_cp(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols, - bool put) +static int srslte_pdsch_nr_cp(const srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) { - uint32_t count = 0; - uint32_t dmrs_l_idx[SRSLTE_DMRS_PDSCH_MAX_SYMBOLS] = {}; - uint32_t dmrs_l_count = 0; + uint32_t count = 0; + uint32_t dmrs_l_idx[SRSLTE_DMRS_SCH_MAX_SYMBOLS] = {}; + uint32_t dmrs_l_count = 0; // Get symbol indexes carrying DMRS - int32_t nof_dmrs_symbols = srslte_dmrs_pdsch_get_symbols_idx(cfg, grant, dmrs_l_idx); + int32_t nof_dmrs_symbols = srslte_dmrs_sch_get_symbols_idx(cfg, grant, dmrs_l_idx); if (nof_dmrs_symbols < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } @@ -381,26 +381,26 @@ static int srslte_pdsch_nr_cp(const srslte_pdsch_nr_t* q, return count; } -static int srslte_pdsch_nr_put(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols) +static int srslte_pdsch_nr_put(const srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols) { return srslte_pdsch_nr_cp(q, cfg, grant, symbols, sf_symbols, true); } -static int srslte_pdsch_nr_get(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - cf_t* symbols, - cf_t* sf_symbols) +static int srslte_pdsch_nr_get(const srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols) { return srslte_pdsch_nr_cp(q, cfg, grant, symbols, sf_symbols, false); } static uint32_t -pdsch_nr_cinit(const srslte_carrier_nr_t* carrier, const srslte_pdsch_cfg_nr_t* cfg, uint16_t rnti, uint32_t cw_idx) +pdsch_nr_cinit(const srslte_carrier_nr_t* carrier, const srslte_sch_cfg_nr_t* cfg, uint16_t rnti, uint32_t cw_idx) { uint32_t n_id = carrier->id; if (cfg->scrambling_id_present && SRSLTE_RNTI_ISUSER(rnti)) { @@ -413,11 +413,11 @@ pdsch_nr_cinit(const srslte_carrier_nr_t* carrier, const srslte_pdsch_cfg_nr_t* return cinit; } -static inline int pdsch_nr_encode_codeword(srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_sch_tb_t* tb, - const uint8_t* data, - uint16_t rnti) +static inline int pdsch_nr_encode_codeword(srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_tb_t* tb, + const uint8_t* data, + uint16_t rnti) { // Early return if TB is not enabled if (!tb->enabled) { @@ -462,11 +462,11 @@ static inline int pdsch_nr_encode_codeword(srslte_pdsch_nr_t* q, return SRSLTE_SUCCESS; } -int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - uint8_t* data[SRSLTE_MAX_TB], - cf_t* sf_symbols[SRSLTE_MAX_PORTS]) +int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + uint8_t* data[SRSLTE_MAX_TB], + cf_t* sf_symbols[SRSLTE_MAX_PORTS]) { // Check input pointers @@ -530,11 +530,11 @@ int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q, return SRSLTE_SUCCESS; } -static inline int pdsch_nr_decode_codeword(srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_sch_tb_t* tb, - srslte_pdsch_res_nr_t* res, - uint16_t rnti) +static inline int pdsch_nr_decode_codeword(srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_tb_t* tb, + srslte_pdsch_res_nr_t* res, + uint16_t rnti) { // Early return if TB is not enabled if (!tb->enabled) { @@ -591,12 +591,12 @@ static inline int pdsch_nr_decode_codeword(srslte_pdsch_nr_t* q, return SRSLTE_SUCCESS; } -int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - srslte_chest_dl_res_t* channel, - cf_t* sf_symbols[SRSLTE_MAX_PORTS], - srslte_pdsch_res_nr_t data[SRSLTE_MAX_TB]) +int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + srslte_chest_dl_res_t* channel, + cf_t* sf_symbols[SRSLTE_MAX_PORTS], + srslte_pdsch_res_nr_t data[SRSLTE_MAX_TB]) { // Check input pointers if (!q || !cfg || !grant || !data || !sf_symbols) { @@ -666,10 +666,10 @@ int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q, return SRSLTE_SUCCESS; } -static uint32_t srslte_pdsch_nr_grant_info(const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - char* str, - uint32_t str_len) +static uint32_t srslte_pdsch_nr_grant_info(const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + char* str, + uint32_t str_len) { uint32_t len = 0; len = srslte_print_check(str, str_len, len, "rnti=0x%x", grant->rnti); @@ -682,7 +682,7 @@ static uint32_t srslte_pdsch_nr_grant_info(const srslte_pdsch_cfg_nr_t* cfg, grant->k0, grant->S, grant->L, - srslte_pdsch_mapping_type_to_str(grant->mapping)); + srslte_sch_mapping_type_to_str(grant->mapping)); // Skip frequency domain resources... // ... @@ -701,12 +701,12 @@ static uint32_t srslte_pdsch_nr_grant_info(const srslte_pdsch_cfg_nr_t* cfg, return len; } -uint32_t srslte_pdsch_nr_rx_info(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - const srslte_pdsch_res_nr_t res[SRSLTE_MAX_CODEWORDS], - char* str, - uint32_t str_len) +uint32_t srslte_pdsch_nr_rx_info(const srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + const srslte_pdsch_res_nr_t res[SRSLTE_MAX_CODEWORDS], + char* str, + uint32_t str_len) { uint32_t len = 0; @@ -750,11 +750,11 @@ uint32_t srslte_pdsch_nr_rx_info(const srslte_pdsch_nr_t* q, return len; } -uint32_t srslte_pdsch_nr_tx_info(const srslte_pdsch_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - char* str, - uint32_t str_len) +uint32_t srslte_pdsch_nr_tx_info(const srslte_pdsch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + char* str, + uint32_t str_len) { uint32_t len = 0; diff --git a/lib/src/phy/phch/pusch_nr.c b/lib/src/phy/phch/pusch_nr.c new file mode 100644 index 000000000..0d391d804 --- /dev/null +++ b/lib/src/phy/phch/pusch_nr.c @@ -0,0 +1,769 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ +#include "srslte/phy/phch/pusch_nr.h" +#include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/phch/ra_nr.h" + +int pusch_nr_init_common(srslte_pusch_nr_t* q, const srslte_pusch_nr_args_t* args) +{ + for (srslte_mod_t mod = SRSLTE_MOD_BPSK; mod < SRSLTE_MOD_NITEMS; mod++) { + if (srslte_modem_table_lte(&q->modem_tables[mod], mod) < SRSLTE_SUCCESS) { + ERROR("Error initialising modem table for %s\n", srslte_mod_string(mod)); + return SRSLTE_ERROR; + } + if (args->measure_evm) { + srslte_modem_table_bytes(&q->modem_tables[mod]); + } + } + + return SRSLTE_SUCCESS; +} + +int srslte_pusch_nr_init_enb(srslte_pusch_nr_t* q, const srslte_pusch_nr_args_t* args) +{ + if (q == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (pusch_nr_init_common(q, args) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + if (srslte_sch_nr_init_tx(&q->sch, &args->sch)) { + ERROR("Initialising SCH\n"); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +int srslte_pusch_nr_init_ue(srslte_pusch_nr_t* q, const srslte_pusch_nr_args_t* args) +{ + if (q == NULL || args == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (pusch_nr_init_common(q, args) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + if (srslte_sch_nr_init_rx(&q->sch, &args->sch)) { + ERROR("Initialising SCH\n"); + return SRSLTE_ERROR; + } + + if (args->measure_evm) { + q->evm_buffer = srslte_evm_buffer_alloc(8); + if (q->evm_buffer == NULL) { + ERROR("Initialising EVM\n"); + return SRSLTE_ERROR; + } + } + + q->meas_time_en = args->measure_time; + + return SRSLTE_SUCCESS; +} + +int srslte_pusch_nr_set_carrier(srslte_pusch_nr_t* q, const srslte_carrier_nr_t* carrier) +{ + // Set carrier + q->carrier = *carrier; + + // Reallocate symbols if necessary + if (q->max_layers < carrier->max_mimo_layers || q->max_prb < carrier->nof_prb) { + q->max_layers = carrier->max_mimo_layers; + q->max_prb = carrier->nof_prb; + + // Free current allocations + for (uint32_t i = 0; i < SRSLTE_MAX_LAYERS_NR; i++) { + if (q->x[i] != NULL) { + free(q->x[i]); + } + } + + // Allocate for new sizes + for (uint32_t i = 0; i < q->max_layers; i++) { + q->x[i] = srslte_vec_cf_malloc(SRSLTE_SLOT_LEN_RE_NR(q->max_prb)); + if (q->x[i] == NULL) { + ERROR("Malloc"); + return SRSLTE_ERROR; + } + } + } + + // Allocate code words according to table 7.3.1.3-1 + uint32_t max_cw = (q->max_layers > 5) ? 2 : 1; + if (q->max_cw < max_cw) { + q->max_cw = max_cw; + + for (uint32_t i = 0; i < max_cw; i++) { + if (q->b[i] == NULL) { + q->b[i] = srslte_vec_u8_malloc(SRSLTE_SLOT_MAX_NOF_BITS_NR); + if (q->b[i] == NULL) { + ERROR("Malloc"); + return SRSLTE_ERROR; + } + } + + if (q->d[i] == NULL) { + q->d[i] = srslte_vec_cf_malloc(SRSLTE_SLOT_MAX_LEN_RE_NR); + if (q->d[i] == NULL) { + ERROR("Malloc"); + return SRSLTE_ERROR; + } + } + } + } + + // Set carrier in SCH + if (srslte_sch_nr_set_carrier(&q->sch, carrier) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + if (q->evm_buffer != NULL) { + srslte_evm_buffer_resize(q->evm_buffer, SRSLTE_SLOT_LEN_RE_NR(q->max_prb) * SRSLTE_MAX_QM); + } + + return SRSLTE_SUCCESS; +} + +void srslte_pusch_nr_free(srslte_pusch_nr_t* q) +{ + if (q == NULL) { + return; + } + + for (uint32_t cw = 0; cw < SRSLTE_MAX_CODEWORDS; cw++) { + if (q->b[cw]) { + free(q->b[cw]); + } + + if (q->d[cw]) { + free(q->d[cw]); + } + } + + srslte_sch_nr_free(&q->sch); + + for (uint32_t i = 0; i < SRSLTE_MAX_LAYERS_NR; i++) { + if (q->x[i]) { + free(q->x[i]); + } + } + + for (srslte_mod_t mod = SRSLTE_MOD_BPSK; mod < SRSLTE_MOD_NITEMS; mod++) { + srslte_modem_table_free(&q->modem_tables[mod]); + } + + if (q->evm_buffer != NULL) { + srslte_evm_free(q->evm_buffer); + } +} + +/** + * @brief copies a number of countiguous Resource Elements + * @param sf_symbols slot symbols in frequency domain + * @param symbols resource elements + * @param count number of resource elements to copy + * @param put Direction, symbols are copied into sf_symbols if put is true, otherwise sf_symbols are copied into symbols + */ +static void srslte_pusch_re_cp(cf_t* sf_symbols, cf_t* symbols, uint32_t count, bool put) +{ + if (put) { + srslte_vec_cf_copy(sf_symbols, symbols, count); + } else { + srslte_vec_cf_copy(symbols, sf_symbols, count); + } +} + +/* + * As a RB is 12 RE wide, positions marked as 1 will be used for the 1st CDM group, and the same with group 2: + * + * +---+---+---+---+---+---+---+---+---+---+---+---+ + * | 1 | 1 | 2 | 2 | 1 | 1 | 2 | 2 | 1 | 1 | 2 | 2 | + * +---+---+---+---+---+---+---+---+---+---+---+---+ + * -- k --> + * + * If the number of DMRS CDM groups without data is set to: + * - 1, data is mapped in RE marked as 2 + * - Otherwise, no data is mapped in this symbol + */ +static uint32_t srslte_pusch_nr_cp_dmrs_type1(const srslte_pusch_nr_t* q, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) +{ + uint32_t count = 0; + uint32_t delta = 0; + + if (grant->nof_dmrs_cdm_groups_without_data != 1) { + return count; + } + + for (uint32_t i = 0; i < q->carrier.nof_prb; i++) { + if (grant->prb_idx[i]) { + for (uint32_t j = 0; j < SRSLTE_NRE; j += 2) { + if (put) { + sf_symbols[i * SRSLTE_NRE + delta + j + 1] = symbols[count++]; + } else { + symbols[count++] = sf_symbols[i * SRSLTE_NRE + delta + j + 1]; + } + } + } + } + + return count; +} + +/* + * As a RB is 12 RE wide, positions marked as 1 will be used for the 1st CDM group, and the same with groups 2 and 3: + * + * +---+---+---+---+---+---+---+---+---+---+---+---+ + * | 1 | 1 | 2 | 2 | 3 | 3 | 1 | 1 | 2 | 2 | 3 | 3 | + * +---+---+---+---+---+---+---+---+---+---+---+---+ + * -- k --> + * + * If the number of DMRS CDM groups without data is set to: + * - 1, data is mapped in RE marked as 2 and 3 + * - 2, data is mapped in RE marked as 3 + * - otherwise, no data is mapped in this symbol + */ +static uint32_t srslte_pusch_nr_cp_dmrs_type2(const srslte_pusch_nr_t* q, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) +{ + uint32_t count = 0; + + if (grant->nof_dmrs_cdm_groups_without_data != 1 && grant->nof_dmrs_cdm_groups_without_data != 2) { + return count; + } + + uint32_t re_offset = (grant->nof_dmrs_cdm_groups_without_data == 1) ? 2 : 4; + uint32_t re_count = (grant->nof_dmrs_cdm_groups_without_data == 1) ? 4 : 2; + + for (uint32_t i = 0; i < q->carrier.nof_prb; i++) { + if (grant->prb_idx[i]) { + // Copy RE between pilot pairs + srslte_pusch_re_cp(&sf_symbols[i * SRSLTE_NRE + re_offset], &symbols[count], re_count, put); + count += re_count; + + // Copy RE after second pilot + srslte_pusch_re_cp(&sf_symbols[(i + 1) * SRSLTE_NRE - re_count], &symbols[count], re_count, put); + count += re_count; + } + } + + return count; +} + +static uint32_t srslte_pusch_nr_cp_dmrs(const srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) +{ + uint32_t count = 0; + + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &cfg->dmrs_typeA : &cfg->dmrs_typeB; + + switch (dmrs_cfg->type) { + case srslte_dmrs_sch_type_1: + count = srslte_pusch_nr_cp_dmrs_type1(q, grant, symbols, sf_symbols, put); + break; + case srslte_dmrs_sch_type_2: + count = srslte_pusch_nr_cp_dmrs_type2(q, grant, symbols, sf_symbols, put); + break; + } + + return count; +} + +static uint32_t srslte_pusch_nr_cp_clean(const srslte_pusch_nr_t* q, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) +{ + uint32_t count = 0; + uint32_t start = 0; // Index of the start of continuous data + uint32_t length = 0; // End of continuous RE + + for (uint32_t i = 0; i < q->carrier.nof_prb; i++) { + if (grant->prb_idx[i]) { + // If fist continuous block, save start + if (length == 0) { + start = i * SRSLTE_NRE; + } + length += SRSLTE_NRE; + } else { + // Consecutive block is finished + if (put) { + srslte_vec_cf_copy(&sf_symbols[start], &symbols[count], length); + } else { + srslte_vec_cf_copy(&symbols[count], &sf_symbols[start], length); + } + + // Increase RE count + count += length; + + // Reset consecutive block + length = 0; + } + } + + // Copy last contiguous block + if (length > 0) { + if (put) { + srslte_vec_cf_copy(&sf_symbols[start], &symbols[count], length); + } else { + srslte_vec_cf_copy(&symbols[count], &sf_symbols[start], length); + } + count += length; + } + + return count; +} + +static int srslte_pusch_nr_cp(const srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols, + bool put) +{ + uint32_t count = 0; + uint32_t dmrs_l_idx[SRSLTE_DMRS_SCH_MAX_SYMBOLS] = {}; + uint32_t dmrs_l_count = 0; + + // Get symbol indexes carrying DMRS + int32_t nof_dmrs_symbols = srslte_dmrs_sch_get_symbols_idx(cfg, grant, dmrs_l_idx); + if (nof_dmrs_symbols < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("dmrs_l_idx="); + srslte_vec_fprint_i(stdout, (int32_t*)dmrs_l_idx, nof_dmrs_symbols); + } + + for (uint32_t l = grant->S; l < grant->S + grant->L; l++) { + // Advance DMRS symbol counter until: + // - the current DMRS symbol index is greater or equal than current symbol l + // - no more DMRS symbols + while (dmrs_l_idx[dmrs_l_count] < l && dmrs_l_count < nof_dmrs_symbols) { + dmrs_l_count++; + } + + if (l == dmrs_l_idx[dmrs_l_count]) { + count += srslte_pusch_nr_cp_dmrs( + q, cfg, grant, &symbols[count], &sf_symbols[l * q->carrier.nof_prb * SRSLTE_NRE], put); + } else { + count += + srslte_pusch_nr_cp_clean(q, grant, &symbols[count], &sf_symbols[l * q->carrier.nof_prb * SRSLTE_NRE], put); + } + } + + return count; +} + +static int srslte_pusch_nr_put(const srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols) +{ + return srslte_pusch_nr_cp(q, cfg, grant, symbols, sf_symbols, true); +} + +static int srslte_pusch_nr_get(const srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + cf_t* symbols, + cf_t* sf_symbols) +{ + return srslte_pusch_nr_cp(q, cfg, grant, symbols, sf_symbols, false); +} + +static uint32_t +pusch_nr_cinit(const srslte_carrier_nr_t* carrier, const srslte_sch_cfg_nr_t* cfg, uint16_t rnti, uint32_t cw_idx) +{ + uint32_t n_id = carrier->id; + if (cfg->scrambling_id_present && SRSLTE_RNTI_ISUSER(rnti)) { + n_id = cfg->scambling_id; + } + uint32_t cinit = (((uint32_t)rnti) << 15U) + (cw_idx << 14U) + n_id; + + INFO("PUSCH: RNTI=%d (0x%x); nid=%d; cinit=%d (0x%x);\n", rnti, rnti, n_id, cinit, cinit); + + return cinit; +} + +static inline int pusch_nr_encode_codeword(srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_tb_t* tb, + const uint8_t* data, + uint16_t rnti) +{ + // Early return if TB is not enabled + if (!tb->enabled) { + return SRSLTE_SUCCESS; + } + + // Check codeword index + if (tb->cw_idx >= q->max_cw) { + ERROR("Unsupported codeword index %d\n", tb->cw_idx); + return SRSLTE_ERROR; + } + + // Check modulation + if (tb->mod >= SRSLTE_MOD_NITEMS) { + ERROR("Invalid modulation %s\n", srslte_mod_string(tb->mod)); + return SRSLTE_ERROR_OUT_OF_BOUNDS; + } + + // Encode SCH + if (srslte_ulsch_nr_encode(&q->sch, &cfg->sch_cfg, tb, data, q->b[tb->cw_idx]) < SRSLTE_SUCCESS) { + ERROR("Error in DL-SCH encoding\n"); + return SRSLTE_ERROR; + } + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("b="); + srslte_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits); + } + + // 7.3.1.1 Scrambling + uint32_t cinit = pusch_nr_cinit(&q->carrier, cfg, rnti, tb->cw_idx); + srslte_sequence_apply_bit(q->b[tb->cw_idx], q->b[tb->cw_idx], tb->nof_bits, cinit); + + // 7.3.1.2 Modulation + srslte_mod_modulate(&q->modem_tables[tb->mod], q->b[tb->cw_idx], q->d[tb->cw_idx], tb->nof_bits); + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("d="); + srslte_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); + } + + return SRSLTE_SUCCESS; +} + +int srslte_pusch_nr_encode(srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + uint8_t* data[SRSLTE_MAX_TB], + cf_t* sf_symbols[SRSLTE_MAX_PORTS]) +{ + + // Check input pointers + if (!q || !cfg || !grant || !data || !sf_symbols) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + struct timeval t[3]; + if (q->meas_time_en) { + gettimeofday(&t[1], NULL); + } + + // Check number of layers + if (q->max_layers < grant->nof_layers) { + ERROR("Error number of layers (%d) exceeds configured maximum (%d)\n", grant->nof_layers, q->max_layers); + return SRSLTE_ERROR; + } + + // 7.3.1.1 and 7.3.1.2 + uint32_t nof_cw = 0; + for (uint32_t tb = 0; tb < SRSLTE_MAX_TB; tb++) { + nof_cw += grant->tb[tb].enabled ? 1 : 0; + + if (pusch_nr_encode_codeword(q, cfg, &grant->tb[tb], data[tb], grant->rnti) < SRSLTE_SUCCESS) { + ERROR("Error encoding TB %d\n", tb); + return SRSLTE_ERROR; + } + } + + // 7.3.1.3 Layer mapping + cf_t** x = q->d; + if (grant->nof_layers > 1) { + x = q->x; + srslte_layermap_nr(q->d, nof_cw, x, grant->nof_layers, grant->nof_layers); + } + + // 7.3.1.4 Antenna port mapping + // ... Not implemented + + // 7.3.1.5 Mapping to virtual resource blocks + // ... Not implemented + + // 7.3.1.6 Mapping from virtual to physical resource blocks + int n = srslte_pusch_nr_put(q, cfg, grant, x[0], sf_symbols[0]); + if (n < SRSLTE_SUCCESS) { + ERROR("Putting NR PUSCH resources\n"); + return SRSLTE_ERROR; + } + + if (n != grant->tb[0].nof_re) { + ERROR("Unmatched number of RE (%d != %d)\n", n, grant->tb[0].nof_re); + return SRSLTE_ERROR; + } + + if (q->meas_time_en) { + gettimeofday(&t[2], NULL); + get_time_interval(t); + q->meas_time_us = (uint32_t)t[0].tv_usec; + } + + return SRSLTE_SUCCESS; +} + +static inline int pusch_nr_decode_codeword(srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_tb_t* tb, + srslte_pusch_res_nr_t* res, + uint16_t rnti) +{ + // Early return if TB is not enabled + if (!tb->enabled) { + return SRSLTE_SUCCESS; + } + + // Check codeword index + if (tb->cw_idx >= q->max_cw) { + ERROR("Unsupported codeword index %d\n", tb->cw_idx); + return SRSLTE_ERROR; + } + + // Check modulation + if (tb->mod >= SRSLTE_MOD_NITEMS) { + ERROR("Invalid modulation %s\n", srslte_mod_string(tb->mod)); + return SRSLTE_ERROR_OUT_OF_BOUNDS; + } + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("d="); + srslte_vec_fprint_c(stdout, q->d[tb->cw_idx], tb->nof_re); + } + + // Demodulation + int8_t* llr = (int8_t*)q->b[tb->cw_idx]; + if (srslte_demod_soft_demodulate_b(tb->mod, q->d[tb->cw_idx], llr, tb->nof_re)) { + return SRSLTE_ERROR; + } + + // EVM + if (q->evm_buffer != NULL) { + res->evm = srslte_evm_run_b(q->evm_buffer, &q->modem_tables[tb->mod], q->d[tb->cw_idx], llr, tb->nof_bits); + } + + // Change LLR sign + for (uint32_t i = 0; i < tb->nof_bits; i++) { + llr[i] = -llr[i]; + } + + // Descrambling + srslte_sequence_apply_c(llr, llr, tb->nof_bits, pusch_nr_cinit(&q->carrier, cfg, rnti, tb->cw_idx)); + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("b="); + srslte_vec_fprint_b(stdout, q->b[tb->cw_idx], tb->nof_bits); + } + + // Decode SCH + if (srslte_ulsch_nr_decode(&q->sch, &cfg->sch_cfg, tb, llr, res->payload, &res->crc) < SRSLTE_SUCCESS) { + ERROR("Error in DL-SCH encoding\n"); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +int srslte_pusch_nr_decode(srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + srslte_chest_dl_res_t* channel, + cf_t* sf_symbols[SRSLTE_MAX_PORTS], + srslte_pusch_res_nr_t data[SRSLTE_MAX_TB]) +{ + // Check input pointers + if (!q || !cfg || !grant || !data || !sf_symbols) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + struct timeval t[3]; + if (q->meas_time_en) { + gettimeofday(&t[1], NULL); + } + + uint32_t nof_cw = 0; + for (uint32_t tb = 0; tb < SRSLTE_MAX_TB; tb++) { + nof_cw += grant->tb[tb].enabled ? 1 : 0; + } + + uint32_t nof_re = srslte_ra_dl_nr_slot_nof_re(cfg, grant); + + if (channel->nof_re != nof_re) { + ERROR("Inconsistent number of RE (%d!=%d)\n", channel->nof_re, nof_re); + return SRSLTE_ERROR; + } + + // Demapping from virtual to physical resource blocks + uint32_t nof_re_get = srslte_pusch_nr_get(q, cfg, grant, q->x[0], sf_symbols[0]); + if (nof_re_get != nof_re) { + ERROR("Inconsistent number of RE (%d!=%d)\n", nof_re_get, nof_re); + return SRSLTE_ERROR; + } + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_DEBUG && !handler_registered) { + DEBUG("ce="); + srslte_vec_fprint_c(stdout, channel->ce[0][0], nof_re); + DEBUG("x="); + srslte_vec_fprint_c(stdout, q->x[0], nof_re); + } + + // Demapping to virtual resource blocks + // ... Not implemented + + // Antenna port demapping + // ... Not implemented + srslte_predecoding_type( + q->x, channel->ce, q->d, NULL, 1, 1, 1, 0, nof_re, SRSLTE_TXSCHEME_PORT0, 1.0f, channel->noise_estimate); + + // Layer demapping + if (grant->nof_layers > 1) { + srslte_layerdemap_nr(q->d, nof_cw, q->x, grant->nof_layers, nof_re); + } + + // SCH decode + for (uint32_t tb = 0; tb < SRSLTE_MAX_TB; tb++) { + nof_cw += grant->tb[tb].enabled ? 1 : 0; + + if (pusch_nr_decode_codeword(q, cfg, &grant->tb[tb], &data[tb], grant->rnti) < SRSLTE_SUCCESS) { + ERROR("Error encoding TB %d\n", tb); + return SRSLTE_ERROR; + } + } + + if (q->meas_time_en) { + gettimeofday(&t[2], NULL); + get_time_interval(t); + q->meas_time_us = (uint32_t)t[0].tv_usec; + } + + return SRSLTE_SUCCESS; +} + +static uint32_t srslte_pusch_nr_grant_info(const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + char* str, + uint32_t str_len) +{ + uint32_t len = 0; + len = srslte_print_check(str, str_len, len, "rnti=0x%x", grant->rnti); + + // Append time-domain resource mapping + len = srslte_print_check(str, + str_len, + len, + ",k0=%d,S=%d,L=%d,mapping=%s", + grant->k0, + grant->S, + grant->L, + srslte_sch_mapping_type_to_str(grant->mapping)); + + // Skip frequency domain resources... + // ... + + // Append spatial resources + len = srslte_print_check(str, str_len, len, ",Nl=%d", grant->nof_layers); + + // Append scrambling ID + len = srslte_print_check(str, str_len, len, ",n_scid=%d,", grant->n_scid); + + // Append TB info + for (uint32_t i = 0; i < SRSLTE_MAX_TB; i++) { + len += srslte_sch_nr_tb_info(&grant->tb[i], &str[len], str_len - len); + } + + return len; +} + +uint32_t srslte_pusch_nr_rx_info(const srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + const srslte_pusch_res_nr_t res[SRSLTE_MAX_CODEWORDS], + char* str, + uint32_t str_len) +{ + + uint32_t len = 0; + + len += srslte_pusch_nr_grant_info(cfg, grant, &str[len], str_len - len); + + if (q->evm_buffer != NULL) { + len = srslte_print_check(str, str_len, len, ",evm={", 0); + for (uint32_t i = 0; i < SRSLTE_MAX_CODEWORDS; i++) { + if (grant->tb[i].enabled && !isnan(res[i].evm)) { + len = srslte_print_check(str, str_len, len, "%.2f", res[i].evm); + if (i < SRSLTE_MAX_CODEWORDS - 1) { + if (grant->tb[i + 1].enabled) { + len = srslte_print_check(str, str_len, len, ",", 0); + } + } + } + } + len = srslte_print_check(str, str_len, len, "}", 0); + } + + if (res != NULL) { + len = srslte_print_check(str, str_len, len, ",crc={", 0); + for (uint32_t i = 0; i < SRSLTE_MAX_CODEWORDS; i++) { + if (grant->tb[i].enabled) { + len = srslte_print_check(str, str_len, len, "%s", res[i].crc ? "OK" : "KO"); + if (i < SRSLTE_MAX_CODEWORDS - 1) { + if (grant->tb[i + 1].enabled) { + len = srslte_print_check(str, str_len, len, ",", 0); + } + } + } + } + len = srslte_print_check(str, str_len, len, "}", 0); + } + + if (q->meas_time_en) { + len = srslte_print_check(str, str_len, len, ", t=%d us\n", q->meas_time_us); + } + + return len; +} + +uint32_t srslte_pusch_nr_tx_info(const srslte_pusch_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + char* str, + uint32_t str_len) +{ + + uint32_t len = 0; + + len += srslte_pusch_nr_grant_info(cfg, grant, &str[len], str_len - len); + + if (q->meas_time_en) { + len = srslte_print_check(str, str_len, len, ", t=%d us\n", q->meas_time_us); + } + + return len; +} diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 0fe8a71e6..9ad8f5a37 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -108,10 +108,63 @@ static const uint32_t ra_nr_tbs_table[RA_NR_TBS_SIZE_TABLE] = { typedef enum { ra_nr_table_1 = 0, ra_nr_table_2, ra_nr_table_3 } ra_nr_table_t; -static ra_nr_table_t ra_nr_select_table(srslte_mcs_table_t mcs_table, - srslte_dci_format_nr_t dci_format, - srslte_search_space_type_t search_space_type, - srslte_rnti_type_t rnti_type) +static ra_nr_table_t ra_nr_select_table_pusch_noprecoding(srslte_mcs_table_t mcs_table, + srslte_dci_format_nr_t dci_format, + srslte_search_space_type_t search_space_type, + srslte_rnti_type_t rnti_type) +{ + // Non-implemented parameters + bool mcs_c_rnti = false; + srslte_mcs_table_t configured_grant_table = srslte_mcs_table_64qam; + + // - if mcs-Table in pusch-Config is set to 'qam256', and + // - PUSCH is scheduled by a PDCCH with DCI format 0_1 with + // - CRC scrambled by C-RNTI or SP-CSI-RNTI, + if (mcs_table == srslte_mcs_table_256qam && dci_format == srslte_dci_format_nr_0_1 && + (rnti_type == srslte_rnti_type_c || rnti_type == srslte_rnti_type_sp_csi)) { + return ra_nr_table_2; + } + + // - the UE is not configured with MCS-C-RNTI, + // - mcs-Table in pusch-Config is set to 'qam64LowSE', and the + // - PUSCH is scheduled by a PDCCH in a UE-specific search space with + // - CRC scrambled by C-RNTI or SP-CSI-RNTI, + if (!mcs_c_rnti && mcs_table == srslte_mcs_table_qam64LowSE && dci_format != srslte_dci_format_nr_rar && + search_space_type == srslte_search_space_type_ue && + (rnti_type == srslte_rnti_type_c || rnti_type == srslte_rnti_type_sp_csi)) { + return ra_nr_table_3; + } + + // - the UE is configured with MCS-C-RNTI, and + // - the PUSCH is scheduled by a PDCCH with + // - CRC scrambled by MCS-C-RNTI, + if (mcs_c_rnti && dci_format != srslte_dci_format_nr_rar && rnti_type == srslte_rnti_type_mcs_crnti) { + return ra_nr_table_3; + } + + // - mcs-Table in configuredGrantConfig is set to 'qam256', + // - if PUSCH is scheduled by a PDCCH with CRC scrambled by CS-RNTI or + // - if PUSCH is transmitted with configured grant + if (configured_grant_table == srslte_mcs_table_256qam && + (rnti_type == srslte_rnti_type_cs || dci_format == srslte_dci_format_nr_cg)) { + return ra_nr_table_2; + } + + // - mcs-Table in configuredGrantConfig is set to 'qam64LowSE' + // - if PUSCH is scheduled by a PDCCH with CRC scrambled by CS-RNTI or + // - if PUSCH is transmitted with configured grant, + if (configured_grant_table == srslte_mcs_table_qam64LowSE && + (rnti_type == srslte_rnti_type_cs || dci_format == srslte_dci_format_nr_cg)) { + return ra_nr_table_3; + } + + return ra_nr_table_1; +} + +static ra_nr_table_t ra_nr_select_table_pdsch(srslte_mcs_table_t mcs_table, + srslte_dci_format_nr_t dci_format, + srslte_search_space_type_t search_space_type, + srslte_rnti_type_t rnti_type) { // Non-implemented parameters bool sps_config_mcs_table_present = false; @@ -156,6 +209,21 @@ static ra_nr_table_t ra_nr_select_table(srslte_mcs_table_t mcs_table, return ra_nr_table_1; } +static ra_nr_table_t ra_nr_select_table(srslte_mcs_table_t mcs_table, + srslte_dci_format_nr_t dci_format, + srslte_search_space_type_t search_space_type, + srslte_rnti_type_t rnti_type) +{ + + // Check if it is a PUSCH transmission + if (dci_format == srslte_dci_format_nr_0_0 || dci_format == srslte_dci_format_nr_0_1 || + dci_format == srslte_dci_format_nr_rar || dci_format == srslte_dci_format_nr_cg) { + return ra_nr_select_table_pusch_noprecoding(mcs_table, dci_format, search_space_type, rnti_type); + } + + return ra_nr_select_table_pdsch(mcs_table, dci_format, search_space_type, rnti_type); +} + double srslte_ra_nr_R_from_mcs(srslte_mcs_table_t mcs_table, srslte_dci_format_nr_t dci_format, srslte_search_space_type_t search_space_type, @@ -200,13 +268,13 @@ srslte_mod_t srslte_ra_nr_mod_from_mcs(srslte_mcs_table_t mcs_table, return SRSLTE_MOD_NITEMS; } -int srslte_ra_dl_nr_slot_nof_re(const srslte_pdsch_cfg_nr_t* pdsch_cfg, const srslte_pdsch_grant_nr_t* grant) +int srslte_ra_dl_nr_slot_nof_re(const srslte_sch_cfg_nr_t* pdsch_cfg, const srslte_sch_grant_nr_t* grant) { // the number of symbols of the PDSCH allocation within the slot int n_sh_symb = grant->L; // the number of REs for DM-RS per PRB in the scheduled duration - int n_prb_dmrs = srslte_dmrs_pdsch_get_N_prb(pdsch_cfg, grant); + int n_prb_dmrs = srslte_dmrs_sch_get_N_prb(pdsch_cfg, grant); if (n_prb_dmrs < SRSLTE_SUCCESS) { ERROR("Invalid number of DMRS RE\n"); return SRSLTE_ERROR; @@ -319,10 +387,10 @@ uint32_t srslte_ra_nr_tbs(uint32_t N_re, double S, double R, uint32_t Qm, uint32 return ra_nr_tbs_from_n_info4(n_info, R); } -int srslte_ra_nr_fill_tb(const srslte_pdsch_cfg_nr_t* pdsch_cfg, - const srslte_pdsch_grant_nr_t* grant, - uint32_t mcs_idx, - srslte_sch_tb_t* tb) +int srslte_ra_nr_fill_tb(const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_sch_grant_nr_t* grant, + uint32_t mcs_idx, + srslte_sch_tb_t* tb) { uint32_t cw_idx = 0; diff --git a/lib/src/phy/phch/sch_nr.c b/lib/src/phy/phch/sch_nr.c index 848edb3c5..045df37c1 100644 --- a/lib/src/phy/phch/sch_nr.c +++ b/lib/src/phy/phch/sch_nr.c @@ -65,10 +65,10 @@ uint32_t sch_nr_n_prb_lbrm(uint32_t nof_prb) return 273; } -int srslte_dlsch_nr_fill_cfg(srslte_sch_nr_t* q, - const srslte_sch_cfg_t* sch_cfg, - const srslte_sch_tb_t* tb, - srslte_sch_nr_common_cfg_t* cfg) +int srslte_sch_nr_fill_cfg(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* sch_cfg, + const srslte_sch_tb_t* tb, + srslte_sch_nr_common_cfg_t* cfg) { if (!sch_cfg || !tb || !cfg) { @@ -357,14 +357,14 @@ void srslte_sch_nr_free(srslte_sch_nr_t* q) srslte_ldpc_rm_rx_free_c(&q->rx_rm); } -int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, - const srslte_sch_cfg_t* pdsch_cfg, - const srslte_sch_tb_t* tb, - const uint8_t* data, - uint8_t* e_bits) +static inline int sch_nr_encode(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* sch_cfg, + const srslte_sch_tb_t* tb, + const uint8_t* data, + uint8_t* e_bits) { // Pointer protection - if (!q || !pdsch_cfg || !tb || !data || !e_bits) { + if (!q || !sch_cfg || !tb || !data || !e_bits) { return SRSLTE_ERROR_INVALID_INPUTS; } @@ -377,7 +377,7 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, uint8_t* output_ptr = e_bits; srslte_sch_nr_common_cfg_t cfg = {}; - if (srslte_dlsch_nr_fill_cfg(q, pdsch_cfg, tb, &cfg) < SRSLTE_SUCCESS) { + if (srslte_sch_nr_fill_cfg(q, sch_cfg, tb, &cfg) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } @@ -500,12 +500,12 @@ int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, return SRSLTE_SUCCESS; } -int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, - const srslte_sch_cfg_t* sch_cfg, - const srslte_sch_tb_t* tb, - int8_t* e_bits, - uint8_t* data, - bool* crc_ok) +int sch_nr_decode(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* sch_cfg, + const srslte_sch_tb_t* tb, + int8_t* e_bits, + uint8_t* data, + bool* crc_ok) { // Pointer protection if (!q || !sch_cfg || !tb || !data || !e_bits || !crc_ok) { @@ -515,7 +515,7 @@ int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, int8_t* input_ptr = e_bits; srslte_sch_nr_common_cfg_t cfg = {}; - if (srslte_dlsch_nr_fill_cfg(q, sch_cfg, tb, &cfg) < SRSLTE_SUCCESS) { + if (srslte_sch_nr_fill_cfg(q, sch_cfg, tb, &cfg) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } @@ -655,6 +655,44 @@ int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, return SRSLTE_SUCCESS; } +int srslte_dlsch_nr_encode(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* pdsch_cfg, + const srslte_sch_tb_t* tb, + const uint8_t* data, + uint8_t* e_bits) +{ + return sch_nr_encode(q, pdsch_cfg, tb, data, e_bits); +} + +int srslte_dlsch_nr_decode(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* sch_cfg, + const srslte_sch_tb_t* tb, + int8_t* e_bits, + uint8_t* data, + bool* crc_ok) +{ + return sch_nr_decode(q, sch_cfg, tb, e_bits, data, crc_ok); +} + +int srslte_ulsch_nr_encode(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* pdsch_cfg, + const srslte_sch_tb_t* tb, + const uint8_t* data, + uint8_t* e_bits) +{ + return sch_nr_encode(q, pdsch_cfg, tb, data, e_bits); +} + +int srslte_ulsch_nr_decode(srslte_sch_nr_t* q, + const srslte_sch_cfg_t* sch_cfg, + const srslte_sch_tb_t* tb, + int8_t* e_bits, + uint8_t* data, + bool* crc_ok) +{ + return sch_nr_decode(q, sch_cfg, tb, e_bits, data, crc_ok); +} + int srslte_sch_nr_tb_info(const srslte_sch_tb_t* tb, char* str, uint32_t str_len) { int len = 0; diff --git a/lib/src/phy/phch/test/CMakeLists.txt b/lib/src/phy/phch/test/CMakeLists.txt index d19dd3608..646b637b2 100644 --- a/lib/src/phy/phch/test/CMakeLists.txt +++ b/lib/src/phy/phch/test/CMakeLists.txt @@ -614,14 +614,17 @@ endif(RF_FOUND) # NR ######################################################################## -add_executable(dlsch_nr_test dlsch_nr_test.c) -target_link_libraries(dlsch_nr_test srslte_phy) -add_test(dlsch_nr_test dlsch_nr_test -m 0 -p 1) +add_executable(sch_nr_test sch_nr_test.c) +target_link_libraries(sch_nr_test srslte_phy) +add_test(sch_nr_test sch_nr_test -m 0 -p 1) add_executable(pdsch_nr_test pdsch_nr_test.c) target_link_libraries(pdsch_nr_test srslte_phy) add_test(pdsch_nr_test pdsch_nr_test -p 6 -m 20) +add_executable(pusch_nr_test pusch_nr_test.c) +target_link_libraries(pusch_nr_test srslte_phy) +add_test(pusch_nr_test pusch_nr_test -p 6 -m 20) add_executable(pdcch_nr_test pdcch_nr_test.c) target_link_libraries(pdcch_nr_test srslte_phy) diff --git a/lib/src/phy/phch/test/pdsch_nr_test.c b/lib/src/phy/phch/test/pdsch_nr_test.c index 266c98711..ea6e2d9a2 100644 --- a/lib/src/phy/phch/test/pdsch_nr_test.c +++ b/lib/src/phy/phch/test/pdsch_nr_test.c @@ -26,11 +26,11 @@ static srslte_carrier_nr_t carrier = { 1 // max_mimo_layers }; -static uint32_t n_prb = 0; // Set to 0 for steering -static uint32_t mcs = 30; // Set to 30 for steering -static srslte_pdsch_cfg_nr_t pdsch_cfg = {}; -static srslte_pdsch_grant_nr_t pdsch_grant = {}; -static uint16_t rnti = 0x1234; +static uint32_t n_prb = 0; // Set to 0 for steering +static uint32_t mcs = 30; // Set to 30 for steering +static srslte_sch_cfg_nr_t pdsch_cfg = {}; +static srslte_sch_grant_nr_t pdsch_grant = {}; +static uint16_t rnti = 0x1234; void usage(char* prog) { @@ -151,8 +151,7 @@ int main(int argc, char** argv) } // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_cfg_typeA.typeA_pos, &pdsch_grant) < - SRSLTE_SUCCESS) { + if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading default grant\n"); goto clean_exit; } diff --git a/lib/src/phy/phch/test/pusch_nr_test.c b/lib/src/phy/phch/test/pusch_nr_test.c new file mode 100644 index 000000000..1002968de --- /dev/null +++ b/lib/src/phy/phch/test/pusch_nr_test.c @@ -0,0 +1,301 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/phch/pusch_nr.h" +#include "srslte/phy/phch/ra_nr.h" +#include "srslte/phy/ue/ue_ul_nr_data.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/random.h" +#include "srslte/phy/utils/vector.h" +#include + +static srslte_carrier_nr_t carrier = { + 1, // cell_id + 0, // numerology + SRSLTE_MAX_PRB_NR, // nof_prb + 0, // start + 1 // max_mimo_layers +}; + +static uint32_t n_prb = 0; // Set to 0 for steering +static uint32_t mcs = 30; // Set to 30 for steering +static srslte_sch_cfg_nr_t pusch_cfg = {}; +static srslte_sch_grant_nr_t pusch_grant = {}; +static uint16_t rnti = 0x1234; + +void usage(char* prog) +{ + printf("Usage: %s [pTL] \n", prog); + printf("\t-p Number of grant PRB, set to 0 for steering [Default %d]\n", n_prb); + printf("\t-m MCS PRB, set to >28 for steering [Default %d]\n", mcs); + printf("\t-T Provide MCS table (64qam, 256qam, 64qamLowSE) [Default %s]\n", + srslte_mcs_table_to_str(pusch_cfg.sch_cfg.mcs_table)); + printf("\t-L Provide number of layers [Default %d]\n", carrier.max_mimo_layers); + printf("\t-v [set srslte_verbose to debug, default none]\n"); +} + +int parse_args(int argc, char** argv) +{ + int opt; + while ((opt = getopt(argc, argv, "pmTLv")) != -1) { + switch (opt) { + case 'p': + n_prb = (uint32_t)strtol(argv[optind], NULL, 10); + break; + case 'm': + mcs = (uint32_t)strtol(argv[optind], NULL, 10); + break; + case 'T': + pusch_cfg.sch_cfg.mcs_table = srslte_mcs_table_from_str(argv[optind]); + break; + case 'L': + carrier.max_mimo_layers = (uint32_t)strtol(argv[optind], NULL, 10); + break; + case 'v': + srslte_verbose++; + break; + default: + usage(argv[0]); + return SRSLTE_ERROR; + } + } + + return SRSLTE_SUCCESS; +} + +int main(int argc, char** argv) +{ + int ret = SRSLTE_ERROR; + srslte_pusch_nr_t pusch_tx = {}; + srslte_pusch_nr_t pusch_rx = {}; + srslte_chest_dl_res_t chest = {}; + srslte_pusch_res_nr_t pusch_res[SRSLTE_MAX_TB] = {}; + srslte_random_t rand_gen = srslte_random_init(1234); + + uint8_t* data_tx[SRSLTE_MAX_TB] = {}; + uint8_t* data_rx[SRSLTE_MAX_CODEWORDS] = {}; + cf_t* sf_symbols[SRSLTE_MAX_LAYERS_NR] = {}; + + // Set default PUSCH configuration + pusch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam; + + if (parse_args(argc, argv) < SRSLTE_SUCCESS) { + goto clean_exit; + } + + srslte_pusch_nr_args_t pusch_args = {}; + pusch_args.sch.disable_simd = false; + pusch_args.measure_evm = true; + + if (srslte_pusch_nr_init_enb(&pusch_tx, &pusch_args) < SRSLTE_SUCCESS) { + ERROR("Error initiating PUSCH for Tx\n"); + goto clean_exit; + } + + if (srslte_pusch_nr_init_ue(&pusch_rx, &pusch_args) < SRSLTE_SUCCESS) { + ERROR("Error initiating SCH NR for Rx\n"); + goto clean_exit; + } + + if (srslte_pusch_nr_set_carrier(&pusch_tx, &carrier)) { + ERROR("Error setting SCH NR carrier\n"); + goto clean_exit; + } + + if (srslte_pusch_nr_set_carrier(&pusch_rx, &carrier)) { + ERROR("Error setting SCH NR carrier\n"); + goto clean_exit; + } + + for (uint32_t i = 0; i < carrier.max_mimo_layers; i++) { + sf_symbols[i] = srslte_vec_cf_malloc(SRSLTE_SLOT_LEN_RE_NR(carrier.nof_prb)); + if (sf_symbols[i] == NULL) { + ERROR("Error malloc\n"); + goto clean_exit; + } + } + + for (uint32_t i = 0; i < pusch_tx.max_cw; i++) { + data_tx[i] = srslte_vec_u8_malloc(SRSLTE_SLOT_MAX_NOF_BITS_NR); + data_rx[i] = srslte_vec_u8_malloc(SRSLTE_SLOT_MAX_NOF_BITS_NR); + if (data_tx[i] == NULL || data_rx[i] == NULL) { + ERROR("Error malloc\n"); + goto clean_exit; + } + + pusch_res[i].payload = data_rx[i]; + } + + srslte_softbuffer_tx_t softbuffer_tx = {}; + srslte_softbuffer_rx_t softbuffer_rx = {}; + + if (srslte_softbuffer_tx_init_guru(&softbuffer_tx, SRSLTE_SCH_NR_MAX_NOF_CB_LDPC, SRSLTE_LDPC_MAX_LEN_ENCODED_CB) < + SRSLTE_SUCCESS) { + ERROR("Error init soft-buffer\n"); + goto clean_exit; + } + + if (srslte_softbuffer_rx_init_guru(&softbuffer_rx, SRSLTE_SCH_NR_MAX_NOF_CB_LDPC, SRSLTE_LDPC_MAX_LEN_ENCODED_CB) < + SRSLTE_SUCCESS) { + ERROR("Error init soft-buffer\n"); + goto clean_exit; + } + + // Use grant default A time resources with m=0 + if (srslte_ue_ul_nr_pdsch_time_resource_default_A(0, &pusch_grant) < SRSLTE_SUCCESS) { + ERROR("Error loading default grant\n"); + goto clean_exit; + } + + // Load number of DMRS CDM groups without data + if (srslte_ue_ul_nr_nof_dmrs_cdm_groups_without_data_format_0_0(&pusch_cfg, &pusch_grant) < SRSLTE_SUCCESS) { + ERROR("Error loading number of DMRS CDM groups without data\n"); + goto clean_exit; + } + + pusch_grant.nof_layers = carrier.max_mimo_layers; + pusch_grant.dci_format = srslte_dci_format_nr_1_0; + pusch_grant.rnti = rnti; + + uint32_t n_prb_start = 1; + uint32_t n_prb_end = carrier.nof_prb + 1; + if (n_prb > 0) { + n_prb_start = SRSLTE_MIN(n_prb, n_prb_end - 1); + n_prb_end = SRSLTE_MIN(n_prb + 1, n_prb_end); + } + + uint32_t mcs_start = 0; + uint32_t mcs_end = pusch_cfg.sch_cfg.mcs_table == srslte_mcs_table_256qam ? 28 : 29; + if (mcs < mcs_end) { + mcs_start = SRSLTE_MIN(mcs, mcs_end - 1); + mcs_end = SRSLTE_MIN(mcs + 1, mcs_end); + } + + if (srslte_chest_dl_res_init(&chest, carrier.nof_prb) < SRSLTE_SUCCESS) { + ERROR("Initiating chest\n"); + goto clean_exit; + } + + for (n_prb = n_prb_start; n_prb < n_prb_end; n_prb++) { + for (mcs = mcs_start; mcs < mcs_end; mcs++) { + + for (uint32_t n = 0; n < SRSLTE_MAX_PRB_NR; n++) { + pusch_grant.prb_idx[n] = (n < n_prb); + } + + pusch_grant.dci_format = srslte_dci_format_nr_0_0; + if (srslte_ra_nr_fill_tb(&pusch_cfg, &pusch_grant, mcs, &pusch_grant.tb[0]) < SRSLTE_SUCCESS) { + ERROR("Error filing tb\n"); + goto clean_exit; + } + + for (uint32_t tb = 0; tb < SRSLTE_MAX_TB; tb++) { + // Skip TB if no allocated + if (data_tx[tb] == NULL) { + continue; + } + + for (uint32_t i = 0; i < pusch_grant.tb[tb].tbs; i++) { + data_tx[tb][i] = (uint8_t)srslte_random_uniform_int_dist(rand_gen, 0, UINT8_MAX); + } + pusch_grant.tb[tb].softbuffer.tx = &softbuffer_tx; + } + + if (srslte_pusch_nr_encode(&pusch_tx, &pusch_cfg, &pusch_grant, data_tx, sf_symbols) < SRSLTE_SUCCESS) { + ERROR("Error encoding\n"); + goto clean_exit; + } + + for (uint32_t tb = 0; tb < SRSLTE_MAX_TB; tb++) { + pusch_grant.tb[tb].softbuffer.rx = &softbuffer_rx; + srslte_softbuffer_rx_reset(pusch_grant.tb[tb].softbuffer.rx); + } + + for (uint32_t i = 0; i < pusch_grant.tb->nof_re; i++) { + chest.ce[0][0][i] = 1.0f; + } + chest.nof_re = pusch_grant.tb->nof_re; + + if (srslte_pusch_nr_decode(&pusch_rx, &pusch_cfg, &pusch_grant, &chest, sf_symbols, pusch_res) < SRSLTE_SUCCESS) { + ERROR("Error encoding\n"); + goto clean_exit; + } + + if (pusch_res->evm > 0.001f) { + ERROR("Error PUSCH EVM is too high %f\n", pusch_res->evm); + goto clean_exit; + } + + float mse = 0.0f; + uint32_t nof_re = srslte_ra_dl_nr_slot_nof_re(&pusch_cfg, &pusch_grant); + for (uint32_t i = 0; i < pusch_grant.nof_layers; i++) { + for (uint32_t j = 0; j < nof_re; j++) { + mse += cabsf(pusch_tx.d[i][j] - pusch_rx.d[i][j]); + } + } + if (nof_re * pusch_grant.nof_layers > 0) { + mse = mse / (nof_re * pusch_grant.nof_layers); + } + if (mse > 0.001) { + ERROR("MSE error (%f) is too high\n", mse); + for (uint32_t i = 0; i < pusch_grant.nof_layers; i++) { + printf("d_tx[%d]=", i); + srslte_vec_fprint_c(stdout, pusch_tx.d[i], nof_re); + printf("d_rx[%d]=", i); + srslte_vec_fprint_c(stdout, pusch_rx.d[i], nof_re); + } + goto clean_exit; + } + + if (!pusch_res[0].crc) { + ERROR("Failed to match CRC; n_prb=%d; mcs=%d; TBS=%d;\n", n_prb, mcs, pusch_grant.tb[0].tbs); + goto clean_exit; + } + + if (memcmp(data_tx[0], data_rx[0], pusch_grant.tb[0].tbs / 8) != 0) { + ERROR("Failed to match Tx/Rx data; n_prb=%d; mcs=%d; TBS=%d;\n", n_prb, mcs, pusch_grant.tb[0].tbs); + printf("Tx data: "); + srslte_vec_fprint_byte(stdout, data_tx[0], pusch_grant.tb[0].tbs / 8); + printf("Rx data: "); + srslte_vec_fprint_byte(stdout, data_rx[0], pusch_grant.tb[0].tbs / 8); + goto clean_exit; + } + + printf("n_prb=%d; mcs=%d; TBS=%d; EVM=%f; PASSED!\n", n_prb, mcs, pusch_grant.tb[0].tbs, pusch_res[0].evm); + } + } + + ret = SRSLTE_SUCCESS; + +clean_exit: + srslte_chest_dl_res_free(&chest); + srslte_random_free(rand_gen); + srslte_pusch_nr_free(&pusch_tx); + srslte_pusch_nr_free(&pusch_rx); + for (uint32_t i = 0; i < SRSLTE_MAX_CODEWORDS; i++) { + if (data_tx[i]) { + free(data_tx[i]); + } + if (data_rx[i]) { + free(data_rx[i]); + } + } + for (uint32_t i = 0; i < SRSLTE_MAX_LAYERS_NR; i++) { + if (sf_symbols[i]) { + free(sf_symbols[i]); + } + } + srslte_softbuffer_tx_free(&softbuffer_tx); + srslte_softbuffer_rx_free(&softbuffer_rx); + + return ret; +} diff --git a/lib/src/phy/phch/test/dlsch_nr_test.c b/lib/src/phy/phch/test/sch_nr_test.c similarity index 94% rename from lib/src/phy/phch/test/dlsch_nr_test.c rename to lib/src/phy/phch/test/sch_nr_test.c index 10985956f..aa3221957 100644 --- a/lib/src/phy/phch/test/dlsch_nr_test.c +++ b/lib/src/phy/phch/test/sch_nr_test.c @@ -26,10 +26,10 @@ static srslte_carrier_nr_t carrier = { 1 // max_mimo_layers }; -static uint32_t n_prb = 0; // Set to 0 for steering -static uint32_t mcs = 30; // Set to 30 for steering -static srslte_pdsch_cfg_nr_t pdsch_cfg = {}; -static srslte_pdsch_grant_nr_t pdsch_grant = {}; +static uint32_t n_prb = 0; // Set to 0 for steering +static uint32_t mcs = 30; // Set to 30 for steering +static srslte_sch_cfg_nr_t pdsch_cfg = {}; +static srslte_sch_grant_nr_t pdsch_grant = {}; void usage(char* prog) { @@ -84,7 +84,7 @@ int main(int argc, char** argv) uint8_t* data_rx = srslte_vec_u8_malloc(1024 * 1024); // Set default PDSCH configuration - pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam; + pdsch_cfg.sch_cfg.mcs_table = srslte_mcs_table_64qam; if (parse_args(argc, argv) < SRSLTE_SUCCESS) { goto clean_exit; @@ -132,8 +132,7 @@ int main(int argc, char** argv) } // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_cfg_typeA.typeA_pos, &pdsch_grant) < - SRSLTE_SUCCESS) { + if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading default grant\n"); goto clean_exit; } diff --git a/lib/src/phy/ue/ue_dl_nr.c b/lib/src/phy/ue/ue_dl_nr.c index 072e95d6b..4ebc7d21a 100644 --- a/lib/src/phy/ue/ue_dl_nr.c +++ b/lib/src/phy/ue/ue_dl_nr.c @@ -79,7 +79,7 @@ int srslte_ue_dl_nr_init(srslte_ue_dl_nr_t* q, cf_t* input[SRSLTE_MAX_PORTS], co srslte_ofdm_rx_init_cfg(&q->fft[i], &fft_cfg); } - if (srslte_dmrs_pdsch_init(&q->dmrs_pdsch, true) < SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_init(&q->dmrs_pdsch, true) < SRSLTE_SUCCESS) { ERROR("Error DMRS\n"); return SRSLTE_ERROR; } @@ -109,7 +109,7 @@ void srslte_ue_dl_nr_free(srslte_ue_dl_nr_t* q) srslte_chest_dl_res_free(&q->chest); srslte_pdsch_nr_free(&q->pdsch); - srslte_dmrs_pdsch_free(&q->dmrs_pdsch); + srslte_dmrs_sch_free(&q->dmrs_pdsch); srslte_dmrs_pdcch_estimator_free(&q->dmrs_pdcch); srslte_pdcch_nr_free(&q->pdcch); @@ -126,7 +126,7 @@ int srslte_ue_dl_nr_set_carrier(srslte_ue_dl_nr_t* q, const srslte_carrier_nr_t* return SRSLTE_ERROR; } - if (srslte_dmrs_pdsch_set_carrier(&q->dmrs_pdsch, carrier) < SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_set_carrier(&q->dmrs_pdsch, carrier) < SRSLTE_SUCCESS) { ERROR("Error DMRS\n"); return SRSLTE_ERROR; } @@ -305,14 +305,14 @@ int srslte_ue_dl_nr_find_dl_dci(srslte_ue_dl_nr_t* q, return (int)count; } -int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - srslte_pdsch_res_nr_t* res) +int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + srslte_pdsch_res_nr_t* res) { - if (srslte_dmrs_pdsch_estimate(&q->dmrs_pdsch, slot, cfg, grant, q->sf_symbols[0], &q->chest) < SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_estimate(&q->dmrs_pdsch, slot, cfg, grant, q->sf_symbols[0], &q->chest) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } @@ -329,12 +329,12 @@ int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q, return SRSLTE_SUCCESS; } -int srslte_ue_dl_nr_pdsch_info(const srslte_ue_dl_nr_t* q, - const srslte_pdsch_cfg_nr_t* cfg, - const srslte_pdsch_grant_nr_t* grant, - const srslte_pdsch_res_nr_t* res, - char* str, - uint32_t str_len) +int srslte_ue_dl_nr_pdsch_info(const srslte_ue_dl_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + const srslte_sch_grant_nr_t* grant, + const srslte_pdsch_res_nr_t* res, + char* str, + uint32_t str_len) { int len = 0; diff --git a/lib/src/phy/ue/ue_dl_nr_data.c b/lib/src/phy/ue/ue_dl_nr_data.c index 60ef76b91..bb0e7bcf8 100644 --- a/lib/src/phy/ue/ue_dl_nr_data.c +++ b/lib/src/phy/ue/ue_dl_nr_data.c @@ -55,7 +55,7 @@ static int srslte_ue_dl_nr_pdsch_time_resource_hl_B(uint32_t sliv, uint32_t* S, return SRSLTE_ERROR; } -int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocation_t* pdsch_alloc, srslte_pdsch_grant_nr_t* grant) +int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocation_t* pdsch_alloc, srslte_sch_grant_nr_t* grant) { if (pdsch_alloc == NULL || grant == NULL) { @@ -65,16 +65,16 @@ int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocation_t* pdsc grant->k0 = pdsch_alloc->k0; grant->mapping = pdsch_alloc->mapping_type; - if (pdsch_alloc->mapping_type == srslte_pdsch_mapping_type_A) { + if (pdsch_alloc->mapping_type == srslte_sch_mapping_type_A) { return srslte_ue_dl_nr_pdsch_time_resource_hl_A(pdsch_alloc->sliv, &grant->S, &grant->L); } return srslte_ue_dl_nr_pdsch_time_resource_hl_B(pdsch_alloc->sliv, &grant->S, &grant->L); } -int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t m, - srslte_dmrs_pdsch_typeA_pos_t dmrs_typeA_pos, - srslte_pdsch_grant_nr_t* grant) +int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t m, + srslte_dmrs_sch_typeA_pos_t dmrs_typeA_pos, + srslte_sch_grant_nr_t* grant) { if (grant == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; @@ -89,23 +89,23 @@ int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t grant->k0 = 0; // Select PDSCH mapping - static srslte_pdsch_mapping_type_t pdsch_mapping_lut[16] = {srslte_pdsch_mapping_type_A, - srslte_pdsch_mapping_type_A, - srslte_pdsch_mapping_type_A, - srslte_pdsch_mapping_type_A, - srslte_pdsch_mapping_type_A, - srslte_pdsch_mapping_type_B, - srslte_pdsch_mapping_type_B, - srslte_pdsch_mapping_type_B, - srslte_pdsch_mapping_type_B, - srslte_pdsch_mapping_type_B, - srslte_pdsch_mapping_type_B, - srslte_pdsch_mapping_type_A, - srslte_pdsch_mapping_type_A, - srslte_pdsch_mapping_type_A, - srslte_pdsch_mapping_type_B, - srslte_pdsch_mapping_type_B}; - grant->mapping = pdsch_mapping_lut[m]; + static srslte_sch_mapping_type_t pdsch_mapping_lut[16] = {srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B}; + grant->mapping = pdsch_mapping_lut[m]; static uint32_t S_pos2[16] = {2, 2, 2, 2, 2, 9, 4, 5, 5, 9, 12, 1, 1, 2, 4, 8}; static uint32_t L_pos2[16] = {12, 10, 9, 7, 5, 4, 4, 7, 2, 2, 2, 13, 6, 4, 7, 4}; @@ -115,11 +115,11 @@ int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t // Select start symbol (S) and length (L) switch (dmrs_typeA_pos) { - case srslte_dmrs_pdsch_typeA_pos_2: + case srslte_dmrs_sch_typeA_pos_2: grant->S = S_pos2[m]; grant->L = L_pos2[m]; break; - case srslte_dmrs_pdsch_typeA_pos_3: + case srslte_dmrs_sch_typeA_pos_3: grant->S = S_pos3[m]; grant->L = L_pos3[m]; break; @@ -131,15 +131,15 @@ int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t return SRSLTE_SUCCESS; } -int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_pdsch_cfg_nr_t* pdsch_cfg, - srslte_pdsch_grant_nr_t* grant) +int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_sch_cfg_nr_t* pdsch_cfg, + srslte_sch_grant_nr_t* grant) { if (pdsch_cfg == NULL || grant == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; } - const srslte_pdsch_dmrs_cfg_t* dmrs_cfg = - grant->mapping == srslte_pdsch_mapping_type_A ? &pdsch_cfg->dmrs_cfg_typeA : &pdsch_cfg->dmrs_cfg_typeB; + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &pdsch_cfg->dmrs_typeA : &pdsch_cfg->dmrs_typeB; /* According to TS 38.214 V15.10.0 5.1.6.1.3 CSI-RS for mobility: * When receiving PDSCH scheduled by DCI format 1_0, the UE shall assume the number of DM-RS CDM groups without data @@ -147,7 +147,7 @@ int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_pds * assume that the number of DM-RS CDM groups without data is 2 which corresponds to CDM group {0,1} for all other * cases. */ - if (dmrs_cfg->length == srslte_dmrs_pdsch_len_2) { + if (dmrs_cfg->length == srslte_dmrs_sch_len_2) { grant->nof_dmrs_cdm_groups_without_data = 1; } else { grant->nof_dmrs_cdm_groups_without_data = 2; diff --git a/lib/src/phy/ue/ue_ul_nr_data.c b/lib/src/phy/ue/ue_ul_nr_data.c new file mode 100644 index 000000000..eecb3394d --- /dev/null +++ b/lib/src/phy/ue/ue_ul_nr_data.c @@ -0,0 +1,84 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ +#include "srslte/phy/ue/ue_ul_nr_data.h" +#include "srslte/phy/utils/debug.h" + +typedef struct { + srslte_sch_mapping_type_t mapping; + uint32_t K2; + uint32_t S; + uint32_t L; +} ue_ul_time_resource_t; + +static const ue_ul_time_resource_t ue_ul_default_A_lut[16] = {{srslte_sch_mapping_type_A, 0, 0, 14}, + {srslte_sch_mapping_type_A, 0, 0, 12}, + {srslte_sch_mapping_type_A, 0, 0, 10}, + {srslte_sch_mapping_type_B, 0, 2, 10}, + {srslte_sch_mapping_type_B, 0, 4, 10}, + {srslte_sch_mapping_type_B, 0, 4, 8}, + {srslte_sch_mapping_type_B, 0, 4, 6}, + {srslte_sch_mapping_type_A, 1, 0, 14}, + {srslte_sch_mapping_type_A, 1, 0, 12}, + {srslte_sch_mapping_type_A, 1, 0, 10}, + {srslte_sch_mapping_type_A, 2, 0, 14}, + {srslte_sch_mapping_type_A, 2, 0, 12}, + {srslte_sch_mapping_type_A, 2, 0, 10}, + {srslte_sch_mapping_type_B, 0, 8, 6}, + {srslte_sch_mapping_type_A, 3, 0, 14}, + {srslte_sch_mapping_type_A, 3, 0, 10}}; + +int srslte_ue_ul_nr_pdsch_time_resource_default_A(uint32_t m, srslte_sch_grant_nr_t* grant) +{ + if (grant == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (m >= 16) { + ERROR("m (%d) is out-of-range\n", m); + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Select mapping + grant->mapping = ue_ul_default_A_lut[m].mapping; + grant->k2 = ue_ul_default_A_lut[m].K2; + grant->S = ue_ul_default_A_lut[m].S; + grant->L = ue_ul_default_A_lut[m].L; + + return SRSLTE_SUCCESS; +} + +int srslte_ue_ul_nr_nof_dmrs_cdm_groups_without_data_format_0_0(const srslte_sch_cfg_nr_t* cfg, + srslte_sch_grant_nr_t* grant) +{ + if (cfg == NULL || grant == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + /* According to TS 38.214 V15.10.0 6.2.2 UE DM-RS transmission procedure: + * For PUSCH scheduled by DCI format 0_0 or by activation DCI format 0_0 with CRC scrambled by CS-RNTI, the UE + * shall assume the number of DM-RS CDM groups without data is 1 which corresponds to CDM group 0 for the case of + * PUSCH with allocation duration of 2 or less OFDM symbols with transform precoding disabled, the UE shall assume + * that the number of DM-RS CDM groups without data is 3 which corresponds to CDM group {0,1,2} for the case of PUSCH + * scheduled by activation DCI format 0_0 and the dmrs-Type in cg-DMRS-Configuration equal to 'type2' and the PUSCH + * allocation duration being more than 2 OFDM symbols, and the UE shall assume that the number of DM-RS CDM groups + * without data is 2 which corresponds to CDM group {0,1} for all other cases. + */ + if (grant->L <= 2 && !cfg->enable_transform_precoder) { + grant->nof_dmrs_cdm_groups_without_data = 1; + // } else if (grant->L > 2 && cfg->dmrs_cg.type == srslte_dmrs_sch_type_2){ + // grant->nof_dmrs_cdm_groups_without_data = 3; + } else { + grant->nof_dmrs_cdm_groups_without_data = 2; + } + + return SRSLTE_SUCCESS; +} \ No newline at end of file diff --git a/lib/test/phy/phy_dl_nr_test.c b/lib/test/phy/phy_dl_nr_test.c index e790788d9..cd9186d90 100644 --- a/lib/test/phy/phy_dl_nr_test.c +++ b/lib/test/phy/phy_dl_nr_test.c @@ -28,12 +28,12 @@ static srslte_carrier_nr_t carrier = { }; -static uint32_t n_prb = 0; // Set to 0 for steering -static uint32_t mcs = 30; // Set to 30 for steering -static srslte_pdsch_cfg_nr_t pdsch_cfg = {}; -static srslte_pdsch_grant_nr_t pdsch_grant = {}; -static uint16_t rnti = 0x1234; -static uint32_t nof_slots = 10; +static uint32_t n_prb = 0; // Set to 0 for steering +static uint32_t mcs = 30; // Set to 30 for steering +static srslte_sch_cfg_nr_t pdsch_cfg = {}; +static srslte_sch_grant_nr_t pdsch_grant = {}; +static uint16_t rnti = 0x1234; +static uint32_t nof_slots = 10; void usage(char* prog) { @@ -254,8 +254,7 @@ int main(int argc, char** argv) } // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_cfg_typeA.typeA_pos, &pdsch_grant) < - SRSLTE_SUCCESS) { + if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading default grant\n"); goto clean_exit; } diff --git a/srsenb/hdr/phy/nr/cc_worker.h b/srsenb/hdr/phy/nr/cc_worker.h index db3a3c537..2b74a19d2 100644 --- a/srsenb/hdr/phy/nr/cc_worker.h +++ b/srsenb/hdr/phy/nr/cc_worker.h @@ -36,7 +36,7 @@ typedef struct { } phy_nr_args_t; typedef struct { - srslte_pdsch_cfg_nr_t pdsch; + srslte_sch_cfg_nr_t pdsch; } phy_nr_cfg_t; class phy_nr_state diff --git a/srsenb/src/phy/nr/cc_worker.cc b/srsenb/src/phy/nr/cc_worker.cc index b951c1055..73b64f00c 100644 --- a/srsenb/src/phy/nr/cc_worker.cc +++ b/srsenb/src/phy/nr/cc_worker.cc @@ -110,11 +110,10 @@ uint32_t cc_worker::get_buffer_len() bool cc_worker::work_dl() { - srslte_pdsch_grant_nr_t pdsch_grant = {}; - srslte_pdsch_cfg_nr_t pdsch_cfg = phy_state->cfg.pdsch; + srslte_sch_grant_nr_t pdsch_grant = {}; + srslte_sch_cfg_nr_t pdsch_cfg = phy_state->cfg.pdsch; // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_cfg_typeA.typeA_pos, &pdsch_grant) < - SRSLTE_SUCCESS) { + if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading default grant\n"); return false; } diff --git a/srsue/hdr/phy/nr/cc_worker.h b/srsue/hdr/phy/nr/cc_worker.h index d3566b790..df3100ff7 100644 --- a/srsue/hdr/phy/nr/cc_worker.h +++ b/srsue/hdr/phy/nr/cc_worker.h @@ -37,7 +37,7 @@ typedef struct { } phy_nr_args_t; typedef struct { - srslte_pdsch_cfg_nr_t pdsch; + srslte_sch_cfg_nr_t pdsch; } phy_nr_cfg_t; class phy_nr_state diff --git a/srsue/src/phy/nr/cc_worker.cc b/srsue/src/phy/nr/cc_worker.cc index a380a8bbe..e7c4fb354 100644 --- a/srsue/src/phy/nr/cc_worker.cc +++ b/srsue/src/phy/nr/cc_worker.cc @@ -107,13 +107,12 @@ uint32_t cc_worker::get_buffer_len() bool cc_worker::work_dl() { - srslte_pdsch_grant_nr_t pdsch_grant = {}; - srslte_pdsch_cfg_nr_t pdsch_cfg = phy_state->cfg.pdsch; + srslte_sch_grant_nr_t pdsch_grant = {}; + srslte_sch_cfg_nr_t pdsch_cfg = phy_state->cfg.pdsch; std::array pdsch_res = {}; // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_cfg_typeA.typeA_pos, &pdsch_grant) < - SRSLTE_SUCCESS) { + if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading default grant\n"); return false; } From 54a864e021b3c37c575eb65cb3fb60504acc2bcb Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 23 Dec 2020 17:04:14 +0100 Subject: [PATCH 015/138] Added Initial NR-PRACH configuration for preamble format 0 --- lib/include/srslte/phy/phch/prach.h | 17 ++--------------- lib/src/phy/phch/prach.c | 8 ++++++-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/lib/include/srslte/phy/phch/prach.h b/lib/include/srslte/phy/phch/prach.h index 2a34eade4..00fa4ffe1 100644 --- a/lib/include/srslte/phy/phch/prach.h +++ b/lib/include/srslte/phy/phch/prach.h @@ -45,6 +45,7 @@ typedef struct { typedef struct SRSLTE_API { // Parameters from higher layers (extracted from SIB2) + bool is_nr; uint32_t config_idx; uint32_t f; // preamble format uint32_t rsi; // rootSequenceIndex @@ -115,6 +116,7 @@ typedef enum SRSLTE_API { } srslte_prach_sfn_t; typedef struct { + bool is_nr; // Set to true if NR uint32_t config_idx; uint32_t root_seq_idx; uint32_t zero_corr_zone; @@ -167,21 +169,6 @@ SRSLTE_API void srslte_prach_sf_config(uint32_t config_idx, srslte_prach_sf_conf SRSLTE_API int srslte_prach_init(srslte_prach_t* p, uint32_t max_N_ifft_ul); -SRSLTE_API int srslte_prach_set_cell_fdd(srslte_prach_t* p, - uint32_t N_ifft_ul, - uint32_t config_idx, - uint32_t root_seq_index, - bool high_speed_flag, - uint32_t zero_corr_zone_config); - -SRSLTE_API int srslte_prach_set_cell_tdd(srslte_prach_t* p, - uint32_t N_ifft_ul, - uint32_t config_idx, - uint32_t root_seq_index, - bool high_speed_flag, - uint32_t zero_corr_zone_config, - srslte_tdd_config_t* tdd_config); - SRSLTE_API int srslte_prach_set_cfg(srslte_prach_t* p, srslte_prach_cfg_t* cfg, uint32_t nof_prb); SRSLTE_API int srslte_prach_gen(srslte_prach_t* p, uint32_t seq_index, uint32_t freq_offset, cf_t* signal); diff --git a/lib/src/phy/phch/prach.c b/lib/src/phy/phch/prach.c index 342171995..5fa3329d9 100644 --- a/lib/src/phy/phch/prach.c +++ b/lib/src/phy/phch/prach.c @@ -408,6 +408,7 @@ int srslte_prach_set_cell_(srslte_prach_t* p, } uint32_t preamble_format = srslte_prach_get_preamble_format(cfg->config_idx); + p->is_nr = cfg->is_nr; p->config_idx = cfg->config_idx; p->f = preamble_format; p->rsi = cfg->root_seq_idx; @@ -513,7 +514,10 @@ int srslte_prach_set_cell_(srslte_prach_t* p, } ret = SRSLTE_SUCCESS; } else { - ERROR("Invalid parameters\n"); + ERROR("Invalid parameters N_ifft_ul=%d; config_idx=%d; root_seq_idx=%d;\n", + N_ifft_ul, + cfg->config_idx, + cfg->root_seq_idx); } return ret; @@ -527,7 +531,7 @@ int srslte_prach_gen(srslte_prach_t* p, uint32_t seq_index, uint32_t freq_offset uint32_t N_rb_ul = srslte_nof_prb(p->N_ifft_ul); uint32_t k_0 = freq_offset * N_RB_SC - N_rb_ul * N_RB_SC / 2 + p->N_ifft_ul / 2; uint32_t K = DELTA_F / DELTA_F_RA; - uint32_t begin = PHI + (K * k_0) + (K / 2); + uint32_t begin = PHI + (K * k_0) + (p->is_nr ? 1 : (K / 2)); if (6 + freq_offset > N_rb_ul) { ERROR("Error no space for PRACH: frequency offset=%d, N_rb_ul=%d\n", freq_offset, N_rb_ul); From 63bd43fa5290f5dab386a11d449cd7ac91468894 Mon Sep 17 00:00:00 2001 From: faluco Date: Wed, 23 Dec 2020 16:09:01 +0100 Subject: [PATCH 016/138] Upgrade the swapping logic of the file sink to use the new srslog functionality. --- srsue/test/ttcn3/hdr/swappable_log.h | 37 ---------------------- srsue/test/ttcn3/hdr/swappable_sink.h | 45 +++++++++++++++++++++++++++ srsue/test/ttcn3/hdr/ttcn3_syssim.h | 7 ++--- srsue/test/ttcn3/src/ttcn3_dut.cc | 26 ++++++---------- srsue/test/ttcn3/src/ttcn3_syssim.cc | 16 ++++++---- 5 files changed, 68 insertions(+), 63 deletions(-) delete mode 100644 srsue/test/ttcn3/hdr/swappable_log.h create mode 100644 srsue/test/ttcn3/hdr/swappable_sink.h diff --git a/srsue/test/ttcn3/hdr/swappable_log.h b/srsue/test/ttcn3/hdr/swappable_log.h deleted file mode 100644 index 0ad1e76f1..000000000 --- a/srsue/test/ttcn3/hdr/swappable_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2020 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 SRSUE_TTCN3_SWAPPABLE_LOG_H -#define SRSUE_TTCN3_SWAPPABLE_LOG_H - -#include "srslte/common/logger_srslog_wrapper.h" - -/// This is a log wrapper that allows hot swapping the underlying log instance. -class swappable_log : public srslte::logger -{ -public: - explicit swappable_log(std::unique_ptr log) : l(std::move(log)) {} - - void log(unique_log_str_t msg) override - { - assert(l && "Missing log instance"); - l->log(std::move(msg)); - } - - /// Swaps the underlying log wrapper. - void swap_log(std::unique_ptr new_log) { l = std::move(new_log); } - -private: - std::unique_ptr l; -}; - -#endif // SRSUE_TTCN3_SWAPPABLE_LOG_H diff --git a/srsue/test/ttcn3/hdr/swappable_sink.h b/srsue/test/ttcn3/hdr/swappable_sink.h new file mode 100644 index 000000000..5e1f0433a --- /dev/null +++ b/srsue/test/ttcn3/hdr/swappable_sink.h @@ -0,0 +1,45 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSUE_TTCN3_SWAPPABLE_SINK_H +#define SRSUE_TTCN3_SWAPPABLE_SINK_H + +#include "srslte/srslog/sink.h" + +/// A custom sink implementation that allows hot swapping file sinks so that loggers can write to different files +/// dynamically. +class swappable_sink : public srslog::sink +{ +public: + swappable_sink(const std::string& filename, std::unique_ptr f) : + srslog::sink(std::move(f)), s(&srslog::fetch_file_sink(filename)) + {} + + /// Identifier of this custom sink. + static const char* name() { return "swappable_sink"; } + + srslog::detail::error_string write(srslog::detail::memory_buffer buffer) override { return s->write(buffer); } + + srslog::detail::error_string flush() override { return s->flush(); } + + /// Swaps the current file sink with a new sink that will write to the specified file name. + void swap_sink(const std::string& filename) + { + srslog::flush(); + s = &srslog::fetch_file_sink(filename); + } + +private: + srslog::sink* s; +}; + +#endif // SRSUE_TTCN3_SWAPPABLE_SINK_H diff --git a/srsue/test/ttcn3/hdr/ttcn3_syssim.h b/srsue/test/ttcn3/hdr/ttcn3_syssim.h index d9f4431b2..bfbfb70dc 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_syssim.h +++ b/srsue/test/ttcn3/hdr/ttcn3_syssim.h @@ -17,7 +17,6 @@ #include "srslte/test/ue_test_interfaces.h" #include "srslte/upper/pdcp.h" #include "srslte/upper/rlc.h" -#include "swappable_log.h" #include "ttcn3_common.h" #include "ttcn3_drb_interface.h" #include "ttcn3_ip_ctrl_interface.h" @@ -39,7 +38,7 @@ class ttcn3_syssim : public syssim_interface_phy, public srslte::pdu_queue::process_callback { public: - ttcn3_syssim(swappable_log& logger_file_, srslte::logger& logger_stdout_, ttcn3_ue* ue_); + ttcn3_syssim(srslte::logger& logger_file_, srslte::logger& logger_stdout_, ttcn3_ue* ue_); ~ttcn3_syssim(); @@ -211,7 +210,7 @@ private: // Logging stuff srslte::logger& logger_stdout; - swappable_log& logger_file; + srslte::logger& logger_file; srslte::logger* logger = nullptr; srslte::log_ref log; srslte::log_filter ut_log; @@ -252,7 +251,7 @@ private: // For events/actions that need to be carried out in a specific TTI typedef std::queue task_queue_t; typedef std::map tti_action_map_t; - tti_action_map_t tti_actions; + tti_action_map_t tti_actions; // Map between the cellId (name) used by 3GPP test suite and srsLTE cell struct class syssim_cell_t diff --git a/srsue/test/ttcn3/src/ttcn3_dut.cc b/srsue/test/ttcn3/src/ttcn3_dut.cc index 93df4e4c5..c7fd95e72 100644 --- a/srsue/test/ttcn3/src/ttcn3_dut.cc +++ b/srsue/test/ttcn3/src/ttcn3_dut.cc @@ -14,7 +14,7 @@ #include "srslte/common/logmap.h" #include "srslte/srslog/srslog.h" #include "srsue/hdr/ue.h" -#include "swappable_log.h" +#include "swappable_sink.h" #include "ttcn3_syssim.h" #include #include @@ -114,26 +114,20 @@ int main(int argc, char** argv) ttcn3_dut_args_t dut_args = {}; all_args_t ue_args = parse_args(&dut_args, argc, argv); - // Setup logging. - srslog::sink* log_file_sink = srslog::create_file_sink(dut_args.log_filename); - if (!log_file_sink) { + // Create a swappable sink, install it and use it as the default one. + if (!srslog::install_custom_sink(swappable_sink::name(), + std::unique_ptr(new swappable_sink( + dut_args.log_filename, srslog::get_default_log_formatter())))) { return SRSLTE_ERROR; } - srslog::log_channel* file_chan = srslog::create_log_channel("file_channel", *log_file_sink); - if (!file_chan) { - return SRSLTE_ERROR; - } - srslog::sink* stdout_sink = srslog::create_stdout_sink(); - if (!stdout_sink) { - return SRSLTE_ERROR; - } - srslog::log_channel* stdout_chan = srslog::create_log_channel("stdout_channel", *stdout_sink); - if (!stdout_chan) { + auto* default_sink = srslog::find_sink(swappable_sink::name()); + if (!default_sink) { return SRSLTE_ERROR; } + srslog::set_default_sink(*default_sink); - swappable_log file_wrapper(std::unique_ptr(new srslte::srslog_wrapper(*file_chan))); - srslte::srslog_wrapper stdout_wrapper(*stdout_chan); + srslte::srslog_wrapper file_wrapper(srslog::fetch_log_channel("file_channel")); + srslte::srslog_wrapper stdout_wrapper(srslog::fetch_log_channel("stdout_channel", srslog::fetch_stdout_sink(), {})); // Start the log backend. srslog::init(); diff --git a/srsue/test/ttcn3/src/ttcn3_syssim.cc b/srsue/test/ttcn3/src/ttcn3_syssim.cc index ed77c0e64..cc2fc890b 100644 --- a/srsue/test/ttcn3/src/ttcn3_syssim.cc +++ b/srsue/test/ttcn3/src/ttcn3_syssim.cc @@ -18,6 +18,7 @@ #include "srslte/test/ue_test_interfaces.h" #include "srslte/upper/pdcp.h" #include "srslte/upper/rlc.h" +#include "swappable_sink.h" #include "ttcn3_common.h" #include "ttcn3_drb_interface.h" #include "ttcn3_ip_ctrl_interface.h" @@ -28,7 +29,7 @@ #include "ttcn3_ut_interface.h" #include -ttcn3_syssim::ttcn3_syssim(swappable_log& logger_file_, srslte::logger& logger_stdout_, ttcn3_ue* ue_) : +ttcn3_syssim::ttcn3_syssim(srslte::logger& logger_file_, srslte::logger& logger_stdout_, ttcn3_ue* ue_) : log{"SS "}, mac_msg_ul(20, ss_mac_log), mac_msg_dl(20, ss_mac_log), @@ -395,11 +396,14 @@ void ttcn3_syssim::tc_start(const char* name) if (args.log.filename == "stdout") { logger = &logger_stdout; } else { - // Create a new log wrapper that writes to the new test case file and swap it with the old one. - const std::string& file_tc_name = get_filename_with_tc_name(local_args.log.filename, run_id, tc_name); - srslog::sink* s = srslog::create_file_sink(file_tc_name); - srslog::log_channel* c = srslog::create_log_channel(file_tc_name, *s); - logger_file.swap_log(std::unique_ptr(new srslte::srslog_wrapper(*c))); + const std::string& file_tc_name = get_filename_with_tc_name(local_args.log.filename, run_id, tc_name); + auto* swp_sink = srslog::find_sink(swappable_sink::name()); + if (!swp_sink) { + log->error("Unable to find the swappable sink\n"); + srslte::console("Unable to find the swappable sink\n"); + return; + } + static_cast(swp_sink)->swap_sink(file_tc_name); logger = &logger_file; } From 2ca894df018cf811c2eaac1964fd65c4bec28c62 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Sat, 2 Jan 2021 17:10:12 +0100 Subject: [PATCH 017/138] pdu: fortify RAR packing detected with ASAN trying to write negative number of padding bytes. The patch checks the calculated length and returns with an error if the length is negative. ================================================================= ==5759==AddressSanitizer: while reporting a bug found another one. Ignoring. m==5759==ERROR: AddressSanitizer: negative-size-param: (size=-6) --- lib/src/mac/pdu.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/src/mac/pdu.cc b/lib/src/mac/pdu.cc index 8ff97ea3f..43d3fc3f5 100644 --- a/lib/src/mac/pdu.cc +++ b/lib/src/mac/pdu.cc @@ -1068,7 +1068,18 @@ bool rar_pdu::write_packet(uint8_t* ptr) } // Set padding to zeros (if any) - bzero(ptr, (rem_len - (ptr - init_ptr)) * sizeof(uint8_t)); + int32_t payload_len = ptr - init_ptr; + int32_t pad_len = rem_len - payload_len; + if (pad_len < 0) { + if (log_h) { + log_h->error("Error packing RAR PDU (payload_len=%d, rem_len=%d)\n", payload_len, rem_len); + } else { + srslte::console("Error packing RAR PDU (payload_len=%d, rem_len=%d)\n", payload_len, rem_len); + } + return false; + } else { + bzero(ptr, pad_len * sizeof(uint8_t)); + } return true; } From 732a1089827c0973da2a8be371d31a11e3fd3a26 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Sat, 2 Jan 2021 18:02:10 +0100 Subject: [PATCH 018/138] mac: convert rar_pdu_msg[] from vector into array and protect access attempt to address ASAN detected issue: RACH: tti=821, cc=3, preamble=11, offset=0, temp_crnti=0x47 ASAN:DEADLYSIGNAL ================================================================= m==25385==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000024 (pc 0x564b19a26c93 bp 0x7fa0e5f1a8c0 sp 0x7fa0e5f1a798 T8) ==25385==The signal is caused by a WRITE memory access. ==25385==Hint: address points to the zero page. ------DL--------------------------------UL------------------------------------ rnti cqi ri mcs brate ok nok (%) snr phr mcs brate ok nok (%) bsr 46 0.10 0 0.0 0 0 0 0% 0 0.0 0 0 0 0 0% 0.0 47 0.10 0 0.0 0 0 0 0% 0 0.0 0 0 0 0 0% 0.0 #0 0x564b19a26c92 in srslte::rar_subh::set_ta_cmd(unsigned int) /mnt/data/jenkins/workspace/srslte_ogt_manual_zmq/srsLTE/lib/src/mac/pdu.cc:1136 #1 0x564b19577f7e in srsenb::mac::assemble_rar(srsenb::sched_interface::dl_sched_rar_grant_t*, unsigned int, int, unsigned int, unsigned int) /mnt/data/jenkins/workspace/srslte_ogt_manual_zmq/srsLTE/srsenb/src/stack/mac/mac.cc:837 #2 0x564b19591765 in srsenb::mac::get_dl_sched(unsigned int, std::vector >&) /mnt/data/jenkins/workspace/srslte_ogt_manual_zmq/srsLTE/srsenb/src/stack/mac/mac.cc:653 #3 0x564b19497ee2 in srsenb::lte::sf_worker::work_imp() /mnt/data/jenkins/workspace/srslte_ogt_manual_zmq/srsLTE/srsenb/src/phy/lte/sf_worker.cc:208 #4 0x564b199f8db4 in --- srsenb/hdr/stack/mac/mac.h | 4 ++-- srsenb/src/stack/mac/mac.cc | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/srsenb/hdr/stack/mac/mac.h b/srsenb/hdr/stack/mac/mac.h index 06b4b4619..6f6a72a08 100644 --- a/srsenb/hdr/stack/mac/mac.h +++ b/srsenb/hdr/stack/mac/mac.h @@ -140,12 +140,12 @@ private: uint8_t* assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, uint32_t nof_grants, - int rar_idx, + uint32_t rar_idx, uint32_t pdu_len, uint32_t tti); const static int rar_payload_len = 128; - std::vector rar_pdu_msg; + std::array rar_pdu_msg; srslte::byte_buffer_t rar_payload[sched_interface::MAX_RAR_LIST]; const static int NOF_BCCH_DLSCH_MSG = sched_interface::MAX_SIBS; diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index d7ce68e09..163cd4f17 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -28,7 +28,6 @@ using namespace asn1::rrc; namespace srsenb { mac::mac(srslte::ext_task_sched_handle task_sched_) : - rar_pdu_msg(sched_interface::MAX_RAR_LIST), rar_payload(), common_buffers(SRSLTE_MAX_CARRIERS), task_sched(task_sched_) @@ -821,12 +820,12 @@ int mac::get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, uint32_t nof_grants, - int rar_idx, + uint32_t rar_idx, uint32_t pdu_len, uint32_t tti) { uint8_t grant_buffer[64] = {}; - if (pdu_len < rar_payload_len) { + if (pdu_len < rar_payload_len && rar_idx < rar_pdu_msg.size()) { srslte::rar_pdu* pdu = &rar_pdu_msg[rar_idx]; rar_payload[rar_idx].clear(); pdu->init_tx(&rar_payload[rar_idx], pdu_len); @@ -842,7 +841,7 @@ uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, pdu->write_packet(rar_payload[rar_idx].msg); return rar_payload[rar_idx].msg; } else { - Error("Assembling RAR: pdu_len > rar_payload_len (%d>%d)\n", pdu_len, rar_payload_len); + Error("Assembling RAR: rar_idx=%d, pdu_len > rar_payload_len (%d>%d)\n", rar_idx, pdu_len, rar_payload_len); return nullptr; } } From 4fa89b7039c1cb643a21efc4d0a7e4a16142d83a Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 30 Dec 2020 17:52:53 +0100 Subject: [PATCH 019/138] pcap: make PCAP write thread-safe * offload PCAP writing to background thread * use blocking_queue between writer and clients to make it thread-safe * add basic test case this fixes point 1-3 of #2161 --- lib/include/srslte/common/mac_pcap.h | 48 ++++++---- lib/src/common/mac_pcap.cc | 138 ++++++++++++++++++--------- lib/test/mac/CMakeLists.txt | 4 + lib/test/mac/mac_pcap_test.cc | 62 ++++++++++++ 4 files changed, 193 insertions(+), 59 deletions(-) create mode 100644 lib/test/mac/mac_pcap_test.cc diff --git a/lib/include/srslte/common/mac_pcap.h b/lib/include/srslte/common/mac_pcap.h index 80d66e637..06ef6ebd4 100644 --- a/lib/include/srslte/common/mac_pcap.h +++ b/lib/include/srslte/common/mac_pcap.h @@ -13,19 +13,24 @@ #ifndef SRSLTE_MAC_PCAP_H #define SRSLTE_MAC_PCAP_H +#include "srslte/common/block_queue.h" +#include "srslte/common/buffer_pool.h" +#include "srslte/common/common.h" +#include "srslte/common/logmap.h" #include "srslte/common/pcap.h" +#include "srslte/common/threads.h" #include +#include namespace srslte { - -class mac_pcap +class mac_pcap : srslte::thread { public: mac_pcap(); ~mac_pcap(); void enable(bool en); - void open(const char* filename, uint32_t ue_id = 0); - void close(); + uint32_t open(const char* filename, uint32_t ue_id = 0); + uint32_t close(); void set_ue_id(uint16_t ue_id); @@ -46,18 +51,29 @@ public: void write_sl_crnti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t rnti, uint32_t reTX, uint32_t tti, uint8_t cc_idx); private: - bool enable_write; - FILE* pcap_file; - uint32_t ue_id; - void pack_and_write(uint8_t* pdu, - uint32_t pdu_len_bytes, - uint32_t reTX, - bool crc_ok, - uint8_t cc_idx, - uint32_t tti, - uint16_t crnti_, - uint8_t direction, - uint8_t rnti_type); + srslte::byte_buffer_pool* pool = nullptr; + srslte::log_ref log; + bool running = false; + FILE* pcap_file = nullptr; + uint32_t ue_id = 0; + void pack_and_queue(uint8_t* pdu, + uint32_t pdu_len_bytes, + uint32_t reTX, + bool crc_ok, + uint8_t cc_idx, + uint32_t tti, + uint16_t crnti_, + uint8_t direction, + uint8_t rnti_type); + + typedef struct { + MAC_Context_Info_t context; + unique_byte_buffer_t pdu; + } pcap_pdu_t; + block_queue queue; + + void write_pdu(pcap_pdu_t& pdu); + void run_thread() final; }; } // namespace srslte diff --git a/lib/src/common/mac_pcap.cc b/lib/src/common/mac_pcap.cc index 499ab63d8..8de3ab555 100644 --- a/lib/src/common/mac_pcap.cc +++ b/lib/src/common/mac_pcap.cc @@ -11,47 +11,91 @@ */ #include "srslte/common/mac_pcap.h" -#include "srslte/common/pcap.h" - -#include "srslte/srslte.h" #include namespace srslte { -mac_pcap::mac_pcap() : enable_write(false), ue_id(0), pcap_file(nullptr) {} +mac_pcap::mac_pcap() : + pool(srslte::byte_buffer_pool::get_instance()), log(srslte::logmap::get("MAC")), thread("PCAP_WRITER") +{} mac_pcap::~mac_pcap() { close(); } -void mac_pcap::enable(bool en) +void mac_pcap::enable(bool enable_) { - enable_write = true; + running = enable_; } -void mac_pcap::open(const char* filename, uint32_t ue_id) + +uint32_t mac_pcap::open(const char* filename, uint32_t ue_id_) { - pcap_file = LTE_PCAP_Open(MAC_LTE_DLT, filename); - this->ue_id = ue_id; - enable_write = true; + if (pcap_file != nullptr) { + log->error("PCAP writer already running. Close first.\n"); + return SRSLTE_ERROR; + } + + pcap_file = LTE_PCAP_Open(MAC_LTE_DLT, filename); + ue_id = ue_id_; + running = true; + + // start writer thread + start(); + + return SRSLTE_SUCCESS; } -void mac_pcap::close() + +uint32_t mac_pcap::close() { - enable_write = false; - if (pcap_file != nullptr) { - fprintf(stdout, "Saving MAC PCAP file\n"); - LTE_PCAP_Close(pcap_file); - pcap_file = nullptr; + if (running == false || pcap_file == nullptr) { + return SRSLTE_ERROR; } + + // tell writer thread to stop + running = false; + pcap_pdu_t pdu = {}; + queue.push(std::move(pdu)); + + wait_thread_finish(); + + // close file handle + srslte::console("Saving MAC PCAP file\n"); + LTE_PCAP_Close(pcap_file); + pcap_file = nullptr; + + return SRSLTE_SUCCESS; } -void mac_pcap::set_ue_id(uint16_t ue_id) +void mac_pcap::write_pdu(pcap_pdu_t& pdu) { - this->ue_id = ue_id; + if (pdu.pdu != nullptr) { + LTE_PCAP_MAC_WritePDU(pcap_file, &pdu.context, pdu.pdu->msg, pdu.pdu->N_bytes); + } } -void mac_pcap::pack_and_write(uint8_t* pdu, - uint32_t pdu_len_bytes, +void mac_pcap::run_thread() +{ + // blocking write until stopped + while (running) { + pcap_pdu_t pdu = queue.wait_pop(); + write_pdu(pdu); + } + + // write remainder of queue + pcap_pdu_t pdu = {}; + while (queue.try_pop(&pdu)) { + write_pdu(pdu); + } +} + +void mac_pcap::set_ue_id(uint16_t ue_id_) +{ + ue_id = ue_id_; +} + +void mac_pcap::pack_and_queue(uint8_t* payload, + uint32_t payload_len, uint32_t reTX, bool crc_ok, uint8_t cc_idx, @@ -60,20 +104,28 @@ void mac_pcap::pack_and_write(uint8_t* pdu, uint8_t direction, uint8_t rnti_type) { - if (enable_write) { - MAC_Context_Info_t context = {}; - context.radioType = FDD_RADIO; - context.direction = direction; - context.rntiType = rnti_type; - context.rnti = crnti; - context.ueid = (uint16_t)ue_id; - context.isRetx = (uint8_t)reTX; - context.crcStatusOK = crc_ok; - context.cc_idx = cc_idx; - context.sysFrameNumber = (uint16_t)(tti / 10); - context.subFrameNumber = (uint16_t)(tti % 10); - if (pdu) { - LTE_PCAP_MAC_WritePDU(pcap_file, &context, pdu, pdu_len_bytes); + if (running && payload != nullptr) { + pcap_pdu_t pdu = {}; + pdu.context.radioType = FDD_RADIO; + pdu.context.direction = direction; + pdu.context.rntiType = rnti_type; + pdu.context.rnti = crnti; + pdu.context.ueid = (uint16_t)ue_id; + pdu.context.isRetx = (uint8_t)reTX; + pdu.context.crcStatusOK = crc_ok; + pdu.context.cc_idx = cc_idx; + pdu.context.sysFrameNumber = (uint16_t)(tti / 10); + pdu.context.subFrameNumber = (uint16_t)(tti % 10); + + // try to allocate PDU buffer + pdu.pdu = srslte::allocate_unique_buffer(*pool); + if (pdu.pdu != nullptr && pdu.pdu->get_tailroom() >= payload_len) { + // copy payload into PDU buffer + memcpy(pdu.pdu->msg, payload, payload_len); + pdu.pdu->N_bytes = payload_len; + queue.push(std::move(pdu)); + } else { + log->info("Dropping PDU in PCAP. No buffer available or not enough space (pdu_len=%d).\n", payload_len); } } } @@ -85,7 +137,7 @@ void mac_pcap::write_dl_crnti(uint8_t* pdu, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, rnti, DIRECTION_DOWNLINK, C_RNTI); + pack_and_queue(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, rnti, DIRECTION_DOWNLINK, C_RNTI); } void mac_pcap::write_dl_ranti(uint8_t* pdu, uint32_t pdu_len_bytes, @@ -94,7 +146,7 @@ void mac_pcap::write_dl_ranti(uint8_t* pdu, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, rnti, DIRECTION_DOWNLINK, RA_RNTI); + pack_and_queue(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, rnti, DIRECTION_DOWNLINK, RA_RNTI); } void mac_pcap::write_ul_crnti(uint8_t* pdu, uint32_t pdu_len_bytes, @@ -103,7 +155,7 @@ void mac_pcap::write_ul_crnti(uint8_t* pdu, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, reTX, true, cc_idx, tti, rnti, DIRECTION_UPLINK, C_RNTI); + pack_and_queue(pdu, pdu_len_bytes, reTX, true, cc_idx, tti, rnti, DIRECTION_UPLINK, C_RNTI); } void mac_pcap::write_sl_crnti(uint8_t* pdu, @@ -113,24 +165,24 @@ void mac_pcap::write_sl_crnti(uint8_t* pdu, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, reTX, true, cc_idx, tti, rnti, DIRECTION_UPLINK, SL_RNTI); + pack_and_queue(pdu, pdu_len_bytes, reTX, true, cc_idx, tti, rnti, DIRECTION_UPLINK, SL_RNTI); } void mac_pcap::write_dl_bch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, 0, DIRECTION_DOWNLINK, NO_RNTI); + pack_and_queue(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, 0, DIRECTION_DOWNLINK, NO_RNTI); } void mac_pcap::write_dl_pch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_PRNTI, DIRECTION_DOWNLINK, P_RNTI); + pack_and_queue(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_PRNTI, DIRECTION_DOWNLINK, P_RNTI); } void mac_pcap::write_dl_mch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_MRNTI, DIRECTION_DOWNLINK, M_RNTI); + pack_and_queue(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_MRNTI, DIRECTION_DOWNLINK, M_RNTI); } void mac_pcap::write_dl_sirnti(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_SIRNTI, DIRECTION_DOWNLINK, SI_RNTI); + pack_and_queue(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_SIRNTI, DIRECTION_DOWNLINK, SI_RNTI); } void mac_pcap::write_ul_rrc_pdu(const uint8_t* input, const int32_t input_len) @@ -140,7 +192,7 @@ void mac_pcap::write_ul_rrc_pdu(const uint8_t* input, const int32_t input_len) // Size is limited by PDU buffer and MAC subheader (format 1 < 128 B) if (input_len > 128 - 7) { - printf("PDU too large.\n"); + log->error("PDU too large.\n"); return; } diff --git a/lib/test/mac/CMakeLists.txt b/lib/test/mac/CMakeLists.txt index 781545cc3..05fd654a1 100644 --- a/lib/test/mac/CMakeLists.txt +++ b/lib/test/mac/CMakeLists.txt @@ -10,6 +10,10 @@ add_executable(pdu_test pdu_test.cc) target_link_libraries(pdu_test srslte_phy srslte_common srslte_mac ${CMAKE_THREAD_LIBS_INIT}) add_test(pdu_test pdu_test) +add_executable(mac_pcap_test mac_pcap_test.cc) +target_link_libraries(mac_pcap_test srslte_common srslte_mac ${SCTP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) +add_test(mac_pcap_test mac_pcap_test) + if (ENABLE_5GNR) add_executable(mac_nr_pdu_test mac_nr_pdu_test.cc) target_link_libraries(mac_nr_pdu_test srslte_phy srslte_mac srslte_common ${CMAKE_THREAD_LIBS_INIT}) diff --git a/lib/test/mac/mac_pcap_test.cc b/lib/test/mac/mac_pcap_test.cc new file mode 100644 index 000000000..6992154d1 --- /dev/null +++ b/lib/test/mac/mac_pcap_test.cc @@ -0,0 +1,62 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/common/common.h" +#include "srslte/common/mac_pcap.h" +#include "srslte/common/test_common.h" +#include +#include + +void write_pcap_thread_function(srslte::mac_pcap* pcap_handle, const std::array& pdu, uint32_t num_pdus) +{ + for (uint32_t i = 0; i < num_pdus; i++) { + pcap_handle->write_ul_crnti(const_cast(pdu.data()), pdu.size(), 0x1001, true, 1, 0); + } + + std::cout << "Finished thread " << std::this_thread::get_id() << "\n"; +} + +int main() +{ + std::array tv = { + 0x21, 0x08, 0x22, 0x80, 0x82, 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + + uint32_t num_threads = 10; + uint32_t num_pdus_per_thread = 100; + + std::unique_ptr pcap_handle = std::unique_ptr(new srslte::mac_pcap()); + TESTASSERT(pcap_handle->open("mac_pcap_test.pcap") == SRSLTE_SUCCESS); + TESTASSERT(pcap_handle->open("mac_pcap_test.pcap") != SRSLTE_SUCCESS); // open again will fail + + std::vector writer_threads; + + for (uint32_t i = 0; i < num_threads; i++) { + writer_threads.push_back(std::thread(write_pcap_thread_function, pcap_handle.get(), tv, num_pdus_per_thread)); + } + + // wait for threads to finish + for (std::thread& thread : writer_threads) { + thread.join(); + } + + TESTASSERT(pcap_handle->close() == SRSLTE_SUCCESS); + TESTASSERT(pcap_handle->close() != 0); // closing twice will fail + + return SRSLTE_SUCCESS; +} From f0138d45feda9f058b1827e77174d6a8994cd673 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 4 Jan 2021 21:03:21 +0100 Subject: [PATCH 020/138] srsenb,phy: fix setting of PHY log level same regression that was fixed for the UE in 52da9eb46fa153bc6dea4b4c233e548e9e74d09f --- srsenb/src/phy/phy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsenb/src/phy/phy.cc b/srsenb/src/phy/phy.cc index 9f1e60170..c521f407e 100644 --- a/srsenb/src/phy/phy.cc +++ b/srsenb/src/phy/phy.cc @@ -112,7 +112,7 @@ int phy::init(const phy_args_t& args, { log_h = std::unique_ptr(new srslte::log_filter); log_h->init("PHY", logger, true); - log_h->set_level(args.log.phy_lib_level); + log_h->set_level(args.log.phy_level); log_h->set_hex_limit(args.log.phy_hex_limit); } From 2abe486e18e7a8484fa5d03ffa8877c21de2bc34 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Wed, 6 Jan 2021 19:53:54 +0000 Subject: [PATCH 021/138] separate control loops for PUCCH and PUSCH TPC --- srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h | 181 +++++++++++------------ srsenb/hdr/stack/rrc/rrc_config.h | 2 +- srsenb/src/enb_cfg_parser.cc | 4 - srsenb/src/stack/mac/sched_ue.cc | 4 +- srsenb/test/mac/sched_tpc_test.cc | 9 +- 5 files changed, 93 insertions(+), 107 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h index 1774f1236..96c6c63a9 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/tpc.h @@ -27,30 +27,36 @@ namespace srsenb { */ class tpc { - static constexpr int undefined_phr = std::numeric_limits::max(); - static constexpr float null_snr = std::numeric_limits::max(); + static constexpr int undefined_phr = std::numeric_limits::max(); + static constexpr float null_snr = std::numeric_limits::max(); + static constexpr uint32_t nof_ul_ch_code = 2; public: - static constexpr int PHR_NEG_NOF_PRB = 1; + static constexpr uint32_t PUSCH_CODE = 0, PUCCH_CODE = 1; + static constexpr int PHR_NEG_NOF_PRB = 1; - tpc(uint32_t cell_nof_prb, float target_snr_dB_ = -1.0, bool phr_handling_flag_ = false) : + explicit tpc(uint32_t cell_nof_prb, float target_snr_dB_ = -1.0, bool phr_handling_flag_ = false) : nof_prb(cell_nof_prb), target_snr_dB(target_snr_dB_), - snr_avg(0.1, target_snr_dB_), - win_pusch_tpc_values(FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS), - win_pucch_tpc_values(FDD_HARQ_DELAY_DL_MS + FDD_HARQ_DELAY_UL_MS), + snr_estim_list({ul_ch_snr_estim{target_snr_dB_}, ul_ch_snr_estim{target_snr_dB_}}), phr_handling_flag(phr_handling_flag_) { max_prbs_cached = nof_prb; } void set_cfg(float target_snr_dB_) { target_snr_dB = target_snr_dB_; } - void set_snr(float snr) { pending_snr = snr; } + void set_snr(float snr, uint32_t ul_ch_code) + { + if (ul_ch_code < nof_ul_ch_code) { + snr_estim_list[ul_ch_code].pending_snr = snr; + } + } void set_phr(int phr_) { - last_phr = phr_; - pucch_phr_flag = false; - pusch_phr_flag = false; + last_phr = phr_; + for (auto& ch_snr : snr_estim_list) { + ch_snr.phr_flag = false; + } // compute and cache the max nof UL PRBs that avoids overflowing PHR if (phr_handling_flag) { @@ -66,30 +72,27 @@ public: void new_tti() { - if (target_snr_dB < 0) { - pending_pusch_delta = 0; - pending_pucch_delta = 0; - return; - } + for (auto& ch_snr : snr_estim_list) { + if (target_snr_dB < 0) { + ch_snr.pending_delta = 0; + continue; + } - // Enqueue pending SNR measurement - if (pending_snr == null_snr) { - last_snr_sample_count++; - acc_pusch_tpc_values += win_pusch_tpc_values.oldest(); - acc_pucch_tpc_values += win_pusch_tpc_values.oldest(); - } else { - acc_pucch_tpc_values = 0; - acc_pusch_tpc_values = 0; - snr_avg.push(pending_snr, last_snr_sample_count); - last_snr_sample_count = 1; - } - pending_snr = null_snr; + // Enqueue pending UL Channel SNR measurement + if (ch_snr.pending_snr == null_snr) { + ch_snr.last_snr_sample_count++; + ch_snr.acc_tpc_values += ch_snr.win_tpc_values.oldest(); + } else { + ch_snr.acc_tpc_values = 0; + ch_snr.snr_avg.push(ch_snr.pending_snr, ch_snr.last_snr_sample_count); + ch_snr.last_snr_sample_count = 1; + } + ch_snr.pending_snr = null_snr; - // Enqueue PUSCH/PUCCH TPC sent in last TTI (zero for both Delta_PUSCH/Delta_PUCCH=0 and TPC not sent) - win_pusch_tpc_values.push(pending_pusch_delta); - pending_pusch_delta = 0; - win_pucch_tpc_values.push(pending_pucch_delta); - pending_pucch_delta = 0; + // Enqueue PUSCH/PUCCH TPC sent in last TTI (zero for both Delta_PUSCH/Delta_PUCCH=0 and TPC not sent) + ch_snr.win_tpc_values.push(ch_snr.pending_delta); + ch_snr.pending_delta = 0; + } } /** @@ -97,67 +100,14 @@ public: * @remark See TS 36.213 Section 5.1.1 * @return accumulated TPC value {-1, 0, 1, 3} */ - uint8_t encode_pusch_tpc() - { - assert(pending_pusch_delta == 0); // ensure called once per {cc,tti} - if (target_snr_dB < 0) { - // undefined target SINR case. Increase Tx power once per PHR, considering the number of allocable PRBs remains - // unchanged - if (not pusch_phr_flag) { - pending_pusch_delta = (max_prbs_cached == nof_prb) ? 1 : (last_phr < 0 ? -1 : 0); - pusch_phr_flag = true; - } - } else { - // target SINR is finite and there is power headroom - float diff = target_snr_dB - snr_avg.value(); - diff -= win_pusch_tpc_values.value() + acc_pusch_tpc_values; - int8_t diff_round = roundf(diff); - if (diff_round >= 1) { - pending_pusch_delta = diff_round > 3 ? 3 : 1; - } else if (diff_round <= -1) { - pending_pusch_delta = -1; - } - if (last_phr <= 0) { - // In case there is no headroom, forbid power increases - pending_pusch_delta = std::min(pending_pusch_delta, 0); - } - } - return encode_tpc_delta(pending_pusch_delta); - } + uint8_t encode_pusch_tpc() { return enconde_tpc(PUSCH_CODE); } /** * Called during DCI format1/2A/A encoding to set PUCCH TPC command - * Note: For now we use the same algorithm for PUCCH and PUSCH * @remark See TS 36.213 Section 5.1.2 * @return accumulated TPC value {-1, 0, 1, 3} */ - uint8_t encode_pucch_tpc() - { - assert(pending_pucch_delta == 0); // ensure called once per {cc,tti} - if (target_snr_dB < 0) { - // undefined target SINR case. Increase Tx power once per PHR, considering the number of allocable PRBs remains - // unchanged - if (not pucch_phr_flag) { - pending_pucch_delta = (max_prbs_cached == nof_prb) ? 1 : (last_phr < 0 ? -1 : 0); - pucch_phr_flag = true; - } - } else { - // target SINR is finite and there is power headroom - float diff = target_snr_dB - snr_avg.value(); - diff -= win_pucch_tpc_values.value() + acc_pucch_tpc_values; - int8_t diff_round = roundf(diff); - if (diff_round >= 1) { - pending_pucch_delta = diff_round > 3 ? 3 : 1; - } else if (diff_round <= -1) { - pending_pucch_delta = -1; - } - if (last_phr <= 0) { - // In case there is no headroom, forbid power increases - pending_pucch_delta = std::min(pending_pucch_delta, 0); - } - } - return encode_tpc_delta(pending_pucch_delta); - } + uint8_t encode_pucch_tpc() { return enconde_tpc(PUCCH_CODE); } uint32_t max_ul_prbs() const { return max_prbs_cached; } @@ -178,6 +128,34 @@ private: return 1; } } + uint8_t enconde_tpc(uint32_t cc) + { + auto& ch_snr = snr_estim_list[cc]; + assert(ch_snr.pending_delta == 0); // ensure called once per {cc,tti} + if (target_snr_dB < 0) { + // undefined target SINR case. Increase Tx power once per PHR, considering the number of allocable PRBs remains + // unchanged + if (not ch_snr.phr_flag) { + ch_snr.pending_delta = (max_prbs_cached == nof_prb) ? 1 : (last_phr < 0 ? -1 : 0); + ch_snr.phr_flag = true; + } + } else { + // target SINR is finite and there is power headroom + float diff = target_snr_dB - ch_snr.snr_avg.value(); + diff -= ch_snr.win_tpc_values.value() + ch_snr.acc_tpc_values; + int8_t diff_round = roundf(diff); + if (diff_round >= 1) { + ch_snr.pending_delta = diff_round > 3 ? 3 : 1; + } else if (diff_round <= -1) { + ch_snr.pending_delta = -1; + } + if (last_phr <= 0) { + // In case there is no headroom, forbid power increases + ch_snr.pending_delta = std::min(ch_snr.pending_delta, 0); + } + } + return encode_tpc_delta(ch_snr.pending_delta); + } uint32_t nof_prb; float target_snr_dB; @@ -186,17 +164,26 @@ private: // PHR-related variables int last_phr = undefined_phr; uint32_t max_prbs_cached = 100; - bool pusch_phr_flag = false, pucch_phr_flag = false; // SNR estimation - srslte::exp_average_irreg_sampling snr_avg; - float pending_snr = srslte::null_sliding_average::null_value(); - uint32_t last_snr_sample_count = 1; - - // Accumulation of past TPC commands - srslte::sliding_sum win_pusch_tpc_values, win_pucch_tpc_values; - int pending_pusch_delta = 0, pending_pucch_delta = 0; - int acc_pusch_tpc_values = 0, acc_pucch_tpc_values = 0; + struct ul_ch_snr_estim { + // flag used in undefined target SINR case + bool phr_flag = false; + // pending new snr sample + float pending_snr = srslte::null_sliding_average::null_value(); + // SNR average estimation with irregular sample spacing + uint32_t last_snr_sample_count = 1; // jump in spacing + srslte::exp_average_irreg_sampling snr_avg; + // Accumulation of past TPC commands + srslte::sliding_sum win_tpc_values; + int pending_delta = 0; + int acc_tpc_values = 0; + + explicit ul_ch_snr_estim(float target_ul_snr = -1) : + snr_avg(0.1, target_ul_snr), win_tpc_values(FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS) + {} + }; + std::array snr_estim_list; }; } // namespace srsenb diff --git a/srsenb/hdr/stack/rrc/rrc_config.h b/srsenb/hdr/stack/rrc/rrc_config.h index e2834c830..ee6e6b3b8 100644 --- a/srsenb/hdr/stack/rrc/rrc_config.h +++ b/srsenb/hdr/stack/rrc/rrc_config.h @@ -30,7 +30,7 @@ struct rrc_cfg_sr_t { }; typedef struct { - bool configured; + bool configured = false; asn1::rrc::lc_ch_cfg_s::ul_specific_params_s_ lc_cfg; asn1::rrc::pdcp_cfg_s pdcp_cfg; asn1::rrc::rlc_cfg_c rlc_cfg; diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 146f2e447..985e22952 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -385,10 +385,6 @@ int field_qci::parse(libconfig::Setting& root) { auto nof_qci = (uint32_t)root.getLength(); - for (uint32_t i = 0; i < MAX_NOF_QCI; i++) { - cfg->configured = false; - } - for (uint32_t i = 0; i < nof_qci; i++) { libconfig::Setting& q = root[i]; diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 70a1f82fd..0434d3cea 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -475,7 +475,7 @@ void sched_ue::set_ul_snr(tti_point tti_rx, uint32_t enb_cc_idx, float snr, uint { cc_sched_ue* c = find_ue_carrier(enb_cc_idx); if (c != nullptr and c->cc_state() != cc_st::idle) { - c->tpc_fsm.set_snr(snr); + c->tpc_fsm.set_snr(snr, ul_ch_code); c->ul_cqi = srslte_cqi_from_snr(snr); c->ul_cqi_tti_rx = tti_rx; } else { @@ -1404,7 +1404,7 @@ void cc_sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_) void cc_sched_ue::finish_tti(tti_point tti_rx) { - last_tti = tti_point{tti_rx}; + last_tti = tti_rx; // reset PIDs with pending data or blocked harq_ent.reset_pending_data(last_tti); diff --git a/srsenb/test/mac/sched_tpc_test.cc b/srsenb/test/mac/sched_tpc_test.cc index 3d09f7626..b9114918c 100644 --- a/srsenb/test/mac/sched_tpc_test.cc +++ b/srsenb/test/mac/sched_tpc_test.cc @@ -39,7 +39,8 @@ int test_finite_target_snr() // - TPC commands should be sent to decrease power // - The sum power of TPC commands should not exceed the difference between current and target SNRs int snr_diff = 10; - tpcfsm.set_snr(target_snr + snr_diff); + tpcfsm.set_snr(target_snr + snr_diff, tpc::PUSCH_CODE); + tpcfsm.set_snr(target_snr + snr_diff, tpc::PUCCH_CODE); int sum_pusch = 0, sum_pucch = 0; for (uint32_t i = 0; i < 100; ++i) { tpcfsm.new_tti(); @@ -53,7 +54,8 @@ int test_finite_target_snr() // - TPC commands should be sent to increase power // - The sum of TPC commands should not exceed the difference between current and target SNRs snr_diff = -10; - tpcfsm.set_snr(target_snr + snr_diff); + tpcfsm.set_snr(target_snr + snr_diff, tpc::PUSCH_CODE); + tpcfsm.set_snr(target_snr + snr_diff, tpc::PUCCH_CODE); sum_pusch = 0; sum_pucch = 0; for (uint32_t i = 0; i < 100; ++i) { @@ -86,7 +88,8 @@ int test_undefined_target_snr() // TEST: SNR info should not affect TPC in undefined target SNR mode int snr_info = 10; - tpcfsm.set_snr(snr_info); + tpcfsm.set_snr(snr_info, tpc::PUSCH_CODE); + tpcfsm.set_snr(snr_info, tpc::PUCCH_CODE); sum_pusch = 0; sum_pucch = 0; for (uint32_t i = 0; i < 100; ++i) { From 37fc1c59e382b9d3547303a5c1b88eadeb04c6b1 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Sun, 7 Jun 2020 15:19:42 +0200 Subject: [PATCH 022/138] fix DRB release logging this caused wrong logs because the LCID was printed based on the assumption that the DRB LCID is alwasy 2 + drb ID Use drb_id as drb_cfg key --- srsue/hdr/stack/rrc/rrc.h | 1 + srsue/src/stack/rrc/rrc.cc | 30 ++++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 7e71ab4f4..84bf7ad92 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -399,6 +399,7 @@ private: void add_drb(const asn1::rrc::drb_to_add_mod_s& drb_cnfg); void release_drb(uint32_t drb_id); uint32_t get_lcid_for_eps_bearer(const uint32_t& eps_bearer_id); + uint32_t get_drb_id_for_eps_bearer(const uint32_t& eps_bearer_id); void add_mrb(uint32_t lcid, uint32_t port); // Helpers for setting default values diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 00772e3d6..68bcf388b 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -2474,24 +2474,38 @@ void rrc::add_drb(const drb_to_add_mod_s& drb_cnfg) } mac->setup_lcid(lcid, log_chan_group, priority, prioritized_bit_rate, bucket_size_duration); - drbs[lcid] = drb_cnfg; - drb_up = true; - rrc_log->info("Added radio bearer %s (LCID=%d)\n", get_rb_name(lcid).c_str(), lcid); + drbs[drb_cnfg.drb_id] = drb_cnfg; + drb_up = true; + rrc_log->info("Added DRB Id %d (LCID=%d)\n", drb_cnfg.drb_id, lcid); } void rrc::release_drb(uint32_t drb_id) { - uint32_t lcid = RB_ID_SRB2 + drb_id; - if (drbs.find(drb_id) != drbs.end()) { - rrc_log->info("Releasing radio bearer %s\n", get_rb_name(lcid).c_str()); - drbs.erase(lcid); + rrc_log->info("Releasing DRB Id %d\n", drb_id); + drbs.erase(drb_id); } else { - rrc_log->error("Couldn't release radio bearer %s. Doesn't exist.\n", get_rb_name(lcid).c_str()); + rrc_log->error("Couldn't release DRB Id %d. Doesn't exist.\n", drb_id); } } uint32_t rrc::get_lcid_for_eps_bearer(const uint32_t& eps_bearer_id) +{ + // check if this bearer id exists and return it's LCID + uint32_t lcid = 0; + uint32_t drb_id = 0; + drb_id = get_drb_id_for_eps_bearer(eps_bearer_id); + asn1::rrc::drb_to_add_mod_s drb_cnfg = drbs[drb_id]; + if (drb_cnfg.lc_ch_id_present) { + lcid = drb_cnfg.lc_ch_id; + } else { + lcid = RB_ID_SRB2 + drb_cnfg.drb_id; + rrc_log->warning("LCID not present, using %d\n", lcid); + } + return lcid; +} + +uint32_t rrc::get_drb_id_for_eps_bearer(const uint32_t& eps_bearer_id) { // check if this bearer id exists and return it's LCID for (auto& drb : drbs) { From c02aa8f12498090ad6f41a2569dfd3c159e667a9 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 15 Jul 2019 11:24:38 +0200 Subject: [PATCH 023/138] liblte_mme: add DCNR UE capabilties packing --- lib/include/srslte/asn1/liblte_mme.h | 2 ++ lib/src/asn1/liblte_mme.cc | 48 +++++++--------------------- 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/lib/include/srslte/asn1/liblte_mme.h b/lib/include/srslte/asn1/liblte_mme.h index cea9ddd6f..99c501feb 100644 --- a/lib/include/srslte/asn1/liblte_mme.h +++ b/lib/include/srslte/asn1/liblte_mme.h @@ -1340,6 +1340,8 @@ typedef struct { bool onexsrvcc_present; bool nf; bool nf_present; + bool dc_nr; + bool dc_nr_present; } LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT; // Functions LIBLTE_ERROR_ENUM liblte_mme_pack_ue_network_capability_ie(LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT* ue_network_cap, diff --git a/lib/src/asn1/liblte_mme.cc b/lib/src/asn1/liblte_mme.cc index c65a3729d..6cde713ce 100644 --- a/lib/src/asn1/liblte_mme.cc +++ b/lib/src/asn1/liblte_mme.cc @@ -2631,14 +2631,8 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_ue_network_capability_ie(LIBLTE_MME_UE_NETWORK LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; if (ue_network_cap != NULL && ie_ptr != NULL) { - if (ue_network_cap->uea_present && (ue_network_cap->ucs2_present || ue_network_cap->uia_present) && - (ue_network_cap->lpp_present || ue_network_cap->lcs_present || ue_network_cap->onexsrvcc_present || - ue_network_cap->nf_present)) { - **ie_ptr = 5; - } else if (ue_network_cap->uea_present && (ue_network_cap->ucs2_present || ue_network_cap->uia_present)) { - **ie_ptr = 4; - } else if (ue_network_cap->uea_present) { - **ie_ptr = 3; + if (ue_network_cap->dc_nr_present) { + **ie_ptr = 7; } else { **ie_ptr = 2; } @@ -2661,34 +2655,16 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_ue_network_capability_ie(LIBLTE_MME_UE_NETWORK **ie_ptr |= ue_network_cap->eia[6] << 1; **ie_ptr |= ue_network_cap->eia[7]; *ie_ptr += 1; - if (ue_network_cap->uea_present) { - **ie_ptr = ue_network_cap->uea[0] << 7; - **ie_ptr |= ue_network_cap->uea[1] << 6; - **ie_ptr |= ue_network_cap->uea[2] << 5; - **ie_ptr |= ue_network_cap->uea[3] << 4; - **ie_ptr |= ue_network_cap->uea[4] << 3; - **ie_ptr |= ue_network_cap->uea[5] << 2; - **ie_ptr |= ue_network_cap->uea[6] << 1; - **ie_ptr |= ue_network_cap->uea[7]; - *ie_ptr += 1; - } - if (ue_network_cap->ucs2_present || ue_network_cap->uia_present) { - **ie_ptr = ue_network_cap->ucs2 << 7; - **ie_ptr |= ue_network_cap->uia[1] << 6; - **ie_ptr |= ue_network_cap->uia[2] << 5; - **ie_ptr |= ue_network_cap->uia[3] << 4; - **ie_ptr |= ue_network_cap->uia[4] << 3; - **ie_ptr |= ue_network_cap->uia[5] << 2; - **ie_ptr |= ue_network_cap->uia[6] << 1; - **ie_ptr |= ue_network_cap->uia[7]; - *ie_ptr += 1; - } - if (ue_network_cap->lpp_present || ue_network_cap->lcs_present || ue_network_cap->onexsrvcc_present || - ue_network_cap->nf_present) { - **ie_ptr = ue_network_cap->lpp << 3; - **ie_ptr |= ue_network_cap->lcs << 2; - **ie_ptr |= ue_network_cap->onexsrvcc << 1; - **ie_ptr |= ue_network_cap->nf; + + if (ue_network_cap->dc_nr_present) { + // skip empty caps + for (int i = 0; i < 4; i++) { + **ie_ptr = 0; + *ie_ptr += 1; + } + + // set dcnr bit + **ie_ptr = ue_network_cap->dc_nr << 4; *ie_ptr += 1; } From 9eb0b72cb42856bb34c08325993c1cc45c57ab1e Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Fri, 11 Dec 2020 14:04:06 +0100 Subject: [PATCH 024/138] Added rrc function has_nr_dc --- lib/include/srslte/interfaces/ue_interfaces.h | 1 + srsue/hdr/stack/rrc/rrc.h | 5 ++++- srsue/src/stack/rrc/rrc.cc | 10 ++++++++++ srsue/test/upper/nas_test.cc | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index 545df8810..ab6cebdb4 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -201,6 +201,7 @@ public: virtual void paging_completed(bool outcome) = 0; virtual std::string get_rb_name(uint32_t lcid) = 0; virtual uint32_t get_lcid_for_eps_bearer(const uint32_t& eps_bearer_id) = 0; + virtual bool has_nr_dc() = 0; }; // RRC interface for PDCP diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 84bf7ad92..5cb339b0a 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -110,10 +110,13 @@ public: bool connection_request(srslte::establishment_cause_t cause, srslte::unique_byte_buffer_t dedicated_info_nas); void set_ue_identity(srslte::s_tmsi_t s_tmsi); void paging_completed(bool outcome) final; -#ifdef HAVE_5GNR + bool has_nr_dc(); + // NR interface +#ifdef HAVE_5GNR void new_cell_meas_nr(const std::vector& meas); #endif + // PHY interface void in_sync() final; void out_of_sync() final; diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 68bcf388b..85db27320 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -2516,6 +2516,16 @@ uint32_t rrc::get_drb_id_for_eps_bearer(const uint32_t& eps_bearer_id) return 0; } +bool rrc::has_nr_dc() +{ + bool has_nr_dc = false; +#ifdef HAVE_5GNR + if (args.release >= 15) + has_nr_dc = true; +#endif + return has_nr_dc; +} + void rrc::add_mrb(uint32_t lcid, uint32_t port) { gw->add_mch_port(lcid, port); diff --git a/srsue/test/upper/nas_test.cc b/srsue/test/upper/nas_test.cc index 2813d0932..397f86e36 100644 --- a/srsue/test/upper/nas_test.cc +++ b/srsue/test/upper/nas_test.cc @@ -128,6 +128,7 @@ public: void enable_capabilities() {} uint32_t get_lcid_for_eps_bearer(const uint32_t& eps_bearer_id) { return 0; } void paging_completed(bool outcome) {} + bool has_nr_dc() { return false; } private: nas* nas_ptr; From 020d0dacc80123a92dc2ccee7f7dcd3c377137bc Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Tue, 24 Nov 2020 11:18:43 +0100 Subject: [PATCH 025/138] add the additional sec cap to NAS attach request use same capabilities that are signaled for EUTRA --- lib/include/srslte/asn1/liblte_mme.h | 2 ++ lib/src/asn1/liblte_mme.cc | 37 ++++++++++++++++++++++++++++ srsue/src/stack/upper/nas.cc | 6 +++++ 3 files changed, 45 insertions(+) diff --git a/lib/include/srslte/asn1/liblte_mme.h b/lib/include/srslte/asn1/liblte_mme.h index 99c501feb..9bab6d57f 100644 --- a/lib/include/srslte/asn1/liblte_mme.h +++ b/lib/include/srslte/asn1/liblte_mme.h @@ -2538,6 +2538,7 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_reject_msg(LIBLTE_BYTE_MSG_STRUCT* #define LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_IEI 0x5D #define LIBLTE_MME_ATTACH_REQUEST_DEVICE_PROPERTIES_IEI 0xD #define LIBLTE_MME_GUTI_TYPE_IEI 0xE +#define LIBLTE_MME_ADDITIONAL_SECURITY_CAP_IEI 0x6F // Enums // Structs typedef struct { @@ -2574,6 +2575,7 @@ typedef struct { bool voice_domain_pref_and_ue_usage_setting_present; bool device_properties_present; bool old_guti_type_present; + bool additional_security_cap_present; } LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT; // Functions LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT* attach_req, diff --git a/lib/src/asn1/liblte_mme.cc b/lib/src/asn1/liblte_mme.cc index 6cde713ce..9d4ab4c8a 100644 --- a/lib/src/asn1/liblte_mme.cc +++ b/lib/src/asn1/liblte_mme.cc @@ -5062,6 +5062,43 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_M msg_ptr++; } + if (attach_req->additional_security_cap_present) { + *msg_ptr = LIBLTE_MME_ADDITIONAL_SECURITY_CAP_IEI; + msg_ptr++; + *msg_ptr = 0x4; // Length + msg_ptr++; + + // Pack same capabilities that are used for EUTRA + *msg_ptr = attach_req->ue_network_cap.eea[0] << 7; + *msg_ptr |= attach_req->ue_network_cap.eea[1] << 6; + *msg_ptr |= attach_req->ue_network_cap.eea[2] << 5; + *msg_ptr |= attach_req->ue_network_cap.eea[3] << 4; + *msg_ptr |= attach_req->ue_network_cap.eea[4] << 3; + *msg_ptr |= attach_req->ue_network_cap.eea[5] << 2; + *msg_ptr |= attach_req->ue_network_cap.eea[6] << 1; + *msg_ptr |= attach_req->ue_network_cap.eea[7]; + msg_ptr++; + + // 0x00 (5G-EA8=0, 5G-EA9=0, 5G-EA10=0, 5G-EA11=0, 5G-EA12=0, 5G-EA13=0, 5G-EA14=0, 5G-EA15=0) + *msg_ptr = 0x00; + msg_ptr++; + + // Pack same integrity caps + *msg_ptr = attach_req->ue_network_cap.eia[0] << 7; + *msg_ptr |= attach_req->ue_network_cap.eia[1] << 6; + *msg_ptr |= attach_req->ue_network_cap.eia[2] << 5; + *msg_ptr |= attach_req->ue_network_cap.eia[3] << 4; + *msg_ptr |= attach_req->ue_network_cap.eia[4] << 3; + *msg_ptr |= attach_req->ue_network_cap.eia[5] << 2; + *msg_ptr |= attach_req->ue_network_cap.eia[6] << 1; + *msg_ptr |= attach_req->ue_network_cap.eia[7]; + msg_ptr++; + + // 0x00 (5G-IA8=0, 5G-IA9=0, 5G-IA10=0, 5G-IA11=0, 5G-IA12=0, 5G-IA13=0, 5G-IA14=0, 5G-IA15=0) + *msg_ptr = 0x00; + msg_ptr++; + } + // Fill in the number of bytes used msg->N_bytes = msg_ptr - msg->msg; diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index 3a1de6b23..cda502293 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -1702,6 +1702,12 @@ void nas::gen_attach_request(srslte::unique_byte_buffer_t& msg) attach_req.device_properties_present = false; attach_req.old_guti_type_present = false; + if (rrc->has_nr_dc()) { + attach_req.ue_network_cap.dc_nr_present = true; + attach_req.ue_network_cap.dc_nr = true; + attach_req.additional_security_cap_present = true; + } + // ESM message (PDN connectivity request) for first default bearer gen_pdn_connectivity_request(&attach_req.esm_msg); From b79eef08602a1c474c7fca8d4855f4d4d183c2a3 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Fri, 11 Dec 2020 17:54:26 +0100 Subject: [PATCH 026/138] Introducing nr_rrc <-> rrc interface for eutra and nr cap query --- lib/include/srslte/interfaces/ue_interfaces.h | 7 + srsue/hdr/stack/rrc/rrc.h | 13 +- srsue/hdr/stack/rrc/rrc_nr.h | 5 + srsue/hdr/stack/ue_stack_base.h | 1 + srsue/hdr/stack/ue_stack_lte.h | 3 + srsue/src/stack/rrc/CMakeLists.txt | 5 + srsue/src/stack/rrc/rrc.cc | 141 +++++++++++++++++- srsue/src/stack/rrc/rrc_nr.cc | 27 ++++ srsue/src/stack/ue_stack_lte.cc | 7 + srsue/test/upper/rrc_meas_test.cc | 4 + 10 files changed, 207 insertions(+), 6 deletions(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index ab6cebdb4..a8fa39515 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -260,6 +260,13 @@ public: virtual void enable_encryption(uint32_t lcid, srslte::srslte_direction_t direction = srslte::srslte_direction_t::DIRECTION_TXRX) = 0; }; +// RRC NR interface for RRC (LTE) +class rrc_nr_interface_rrc +{ +public: + virtual void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps) = 0; + virtual void get_nr_capabilities(srslte::byte_buffer_t* nr_cap) = 0; +}; // PDCP interface for RLC class pdcp_interface_rlc diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 5cb339b0a..3be8eb19d 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -79,7 +79,10 @@ public: nas_interface_rrc* nas_, usim_interface_rrc* usim_, gw_interface_rrc* gw_, - const rrc_args_t& args_); +#ifdef HAVE_5GNR + rrc_nr_interface_rrc* rrc_nr_, +#endif + const rrc_args_t& args_); void stop(); @@ -179,7 +182,9 @@ private: nas_interface_rrc* nas = nullptr; usim_interface_rrc* usim = nullptr; gw_interface_rrc* gw = nullptr; - +#ifdef HAVE_5GNR + rrc_nr_interface_rrc* rrc_nr = nullptr; +#endif srslte::unique_byte_buffer_t dedicated_info_nas; void send_ul_ccch_msg(const asn1::rrc::ul_ccch_msg_s& msg); @@ -410,6 +415,10 @@ private: void set_phy_default(); void set_mac_default(); void set_rrc_default(); + + // Helpers for nr communicaiton + asn1::rrc::ue_cap_rat_container_s get_eutra_nr_capabilities(); + asn1::rrc::ue_cap_rat_container_s get_nr_capabilities(); }; } // namespace srsue diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index 113cf45a5..054c2a361 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -41,6 +41,7 @@ struct rrc_nr_metrics_t {}; class rrc_nr final : public rrc_interface_phy_nr, public rrc_interface_pdcp, public rrc_interface_rlc, + public rrc_nr_interface_rrc, public srslte::timer_callback { public: @@ -85,6 +86,10 @@ public: void write_pdu_pcch(srslte::unique_byte_buffer_t pdu) final; void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) final; + // RRC (LTE) interface + void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps); + void get_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps); + // STACK interface void cell_search_completed(const rrc_interface_phy_lte::cell_search_ret_t& cs_ret, const phy_cell_t& found_cell); diff --git a/srsue/hdr/stack/ue_stack_base.h b/srsue/hdr/stack/ue_stack_base.h index 4deaed457..9447b79d3 100644 --- a/srsue/hdr/stack/ue_stack_base.h +++ b/srsue/hdr/stack/ue_stack_base.h @@ -19,6 +19,7 @@ #include "srsue/hdr/ue_metrics_interface.h" #include "rrc/rrc.h" +#include "rrc/rrc_nr.h" #include "upper/gw.h" #include "upper/usim.h" diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index 207a0ec40..90584f0bd 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -167,6 +167,9 @@ private: srslte::rlc rlc; srslte::pdcp pdcp; srsue::rrc rrc; +#ifdef HAVE_5GNR + srsue::rrc_nr rrc_nr; +#endif srsue::nas nas; std::unique_ptr usim; }; diff --git a/srsue/src/stack/rrc/CMakeLists.txt b/srsue/src/stack/rrc/CMakeLists.txt index be7cd97e8..91a1a3633 100644 --- a/srsue/src/stack/rrc/CMakeLists.txt +++ b/srsue/src/stack/rrc/CMakeLists.txt @@ -7,6 +7,11 @@ # set(SOURCES rrc.cc rrc_procedures.cc rrc_meas.cc rrc_cell.cc phy_controller.cc) + +if(ENABLE_5GNR) + set(SOURCES ${SOURCES} rrc_nr.cc) +endif() + add_library(srsue_rrc STATIC ${SOURCES}) if(ENABLE_5GNR) diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 85db27320..44a2d1875 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -99,7 +99,10 @@ void rrc::init(phy_interface_rrc_lte* phy_, nas_interface_rrc* nas_, usim_interface_rrc* usim_, gw_interface_rrc* gw_, - const rrc_args_t& args_) +#ifdef HAVE_5GNR + rrc_nr_interface_rrc* rrc_nr_, +#endif + const rrc_args_t& args_) { pool = byte_buffer_pool::get_instance(); phy = phy_; @@ -109,7 +112,9 @@ void rrc::init(phy_interface_rrc_lte* phy_, nas = nas_; usim = usim_; gw = gw_; - +#ifdef HAVE_5GNR + rrc_nr = rrc_nr_; +#endif args = args_; auto on_every_cell_selection = [this](uint32_t earfcn, uint32_t pci, bool csel_result) { @@ -154,7 +159,6 @@ void rrc::init(phy_interface_rrc_lte* phy_, // initiate unique procedures ue_required_sibs.assign(&required_sibs[0], &required_sibs[NOF_REQUIRED_SIBS]); - running = true; initiated = true; } @@ -1764,6 +1768,9 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) cap.feature_group_inds_present = true; cap.feature_group_inds.from_number(args.feature_group); + ue_eutra_cap_v1280_ies_s* ue_eutra_cap_v1280_ies; + ue_eutra_cap_v1360_ies_s* ue_eutra_cap_v1360_ies; + ue_eutra_cap_v1450_ies_s* ue_eutra_cap_v1450_ies; if (args.release > 8) { ue_eutra_cap_v920_ies_s cap_v920; @@ -1919,6 +1926,64 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) .non_crit_ext.non_crit_ext_present = true; cap.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext .non_crit_ext.non_crit_ext = cap_v1250; + // 12.50 + cap.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext + .non_crit_ext.non_crit_ext.non_crit_ext_present = true; + // 12.60 + cap.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext + .non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present = true; + // 12.70 + cap.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext + .non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present = true; + } + // Release 13 + if (args.release > 12) { + // 12.80 + ue_eutra_cap_v1280_ies = + &cap.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext + .non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext; + ue_eutra_cap_v1280_ies->non_crit_ext_present = true; + // 13.10 + ue_eutra_cap_v1280_ies->non_crit_ext.non_crit_ext_present = true; + // 13.20 + ue_eutra_cap_v1280_ies->non_crit_ext.non_crit_ext.non_crit_ext_present = true; + // 13.30 + ue_eutra_cap_v1280_ies->non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present = true; + // 13.40 + ue_eutra_cap_v1280_ies->non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present = true; + // 13.50 + ue_eutra_cap_v1280_ies->non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present = + true; + } + // Release 14 + if (args.release > 13) { + // 13.60 + ue_eutra_cap_v1360_ies = + &ue_eutra_cap_v1280_ies->non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext; + ue_eutra_cap_v1360_ies->non_crit_ext_present = true; + // 14.30 + ue_eutra_cap_v1360_ies->non_crit_ext.non_crit_ext_present = true; + // 14.40 + ue_eutra_cap_v1360_ies->non_crit_ext.non_crit_ext.non_crit_ext_present = true; + // 14.50 + ue_eutra_cap_v1360_ies->non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present = true; + } + // Release 15 + if (args.release > 14) { + ue_eutra_cap_v1450_ies = &ue_eutra_cap_v1360_ies->non_crit_ext.non_crit_ext.non_crit_ext; + // 14.60 + ue_eutra_cap_v1450_ies->non_crit_ext_present = true; + + irat_params_nr_r15_s irat_params_nr_r15; + irat_params_nr_r15.en_dc_r15_present = true; + irat_params_nr_r15.supported_band_list_en_dc_r15_present = true; + + supported_band_nr_r15_s supported_band_nr_r15; + supported_band_nr_r15.band_nr_r15 = 78; + + irat_params_nr_r15.supported_band_list_en_dc_r15.push_back(supported_band_nr_r15); + ue_eutra_cap_v1450_ies->non_crit_ext.non_crit_ext.irat_params_nr_r15_present = true; + ue_eutra_cap_v1450_ies->non_crit_ext.non_crit_ext.irat_params_nr_r15 = irat_params_nr_r15; } // Pack caps and copy to cap info @@ -1930,12 +1995,49 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) info->ue_cap_rat_container_list[rat_idx].ue_cap_rat_container.resize(cap_len); memcpy(info->ue_cap_rat_container_list[rat_idx].ue_cap_rat_container.data(), buf, cap_len); rat_idx++; + + } +#ifdef HAVE_5GNR + else if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().ue_cap_request[i] == rat_type_e::eutra_nr && has_nr_dc()) { + info->ue_cap_rat_container_list[rat_idx] = get_eutra_nr_capabilities(); + rrc_log->info("Including EUTRA-NR capabilities in UE Capability Info (%d B)\n", + info->ue_cap_rat_container_list[rat_idx].ue_cap_rat_container.size()); + rat_idx++; + } else if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().ue_cap_request[i] == rat_type_e::nr && has_nr_dc()) { + info->ue_cap_rat_container_list[rat_idx] = get_nr_capabilities(); + rrc_log->info("Including NR capabilities in UE Capability Info (%d B)\n", + info->ue_cap_rat_container_list[rat_idx].ue_cap_rat_container.size()); + rat_idx++; + } +#endif + else { + rrc_log->error("RAT Type of UE Cap request not supported or not configured\n"); } } - // resize container back to the actually filled items info->ue_cap_rat_container_list.resize(rat_idx); +#ifdef HAVE_5GNR + if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().non_crit_ext_present) { + if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().non_crit_ext.non_crit_ext_present) { + if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().non_crit_ext.non_crit_ext.non_crit_ext_present) { + if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present) { + if (enquiry.crit_exts.c1() + .ue_cap_enquiry_r8() + .non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present) { + if (enquiry.crit_exts.c1() + .ue_cap_enquiry_r8() + .non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext + .requested_freq_bands_nr_mrdc_r15_present) { + rrc_log->debug("Requested Freq Bands NR MRDC R15 present\n"); + } + } + } + } + } + } +#endif + send_ul_dcch_msg(RB_ID_SRB1, ul_dcch_msg); } @@ -2565,5 +2667,36 @@ void rrc::set_rrc_default() const std::string rrc::rb_id_str[] = {"SRB0", "SRB1", "SRB2", "DRB1", "DRB2", "DRB3", "DRB4", "DRB5", "DRB6", "DRB7", "DRB8"}; +// Helpers for nr communicaiton + +asn1::rrc::ue_cap_rat_container_s rrc::get_eutra_nr_capabilities() +{ + srslte::byte_buffer_t caps_buf; + asn1::rrc::ue_cap_rat_container_s cap; +#ifdef HAVE_5GNR + rrc_nr->get_eutra_nr_capabilities(&caps_buf); +#else + rrc_log->error("Not able to access get_eutra_nr_capabilities function\n"); +#endif + cap.rat_type = asn1::rrc::rat_type_e::eutra_nr; + cap.ue_cap_rat_container.resize(caps_buf.N_bytes); + memcpy(cap.ue_cap_rat_container.data(), caps_buf.msg, caps_buf.N_bytes); + return cap; +} + +asn1::rrc::ue_cap_rat_container_s rrc::get_nr_capabilities() +{ + srslte::byte_buffer_t caps_buf; + asn1::rrc::ue_cap_rat_container_s cap; +#ifdef HAVE_5GNR + rrc_nr->get_nr_capabilities(&caps_buf); +#else + rrc_log->error("Not able to access get_nr_capabilities function\n"); +#endif + cap.rat_type = asn1::rrc::rat_type_e::nr; + cap.ue_cap_rat_container.resize(caps_buf.N_bytes); + memcpy(cap.ue_cap_rat_container.data(), caps_buf.msg, caps_buf.N_bytes); + return cap; +} } // namespace srsue diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index 7ef742f50..28192fa64 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -86,6 +86,33 @@ void rrc_nr::write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t pdu) {} void rrc_nr::write_pdu_pcch(srslte::unique_byte_buffer_t pdu) {} void rrc_nr::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {} +void rrc_nr::get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps) +{ + uint8_t eutra_nr_cap_raw[] = {0x01, 0x1c, 0x04, 0x81, 0x60, 0x00, 0x1c, 0x4d, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x40, 0x04, 0x04, 0xd0, 0x10, 0x74, 0x06, 0x14, 0xe8, 0x1b, 0x10, + 0x78, 0x00, 0x00, 0x20, 0x00, 0x10, 0x08, 0x08, 0x01, 0x00, 0x20}; + + memcpy(eutra_nr_caps->msg, eutra_nr_cap_raw, sizeof(eutra_nr_cap_raw)); + eutra_nr_caps->N_bytes = sizeof(eutra_nr_cap_raw); + log_h->debug_hex( + eutra_nr_caps->msg, eutra_nr_caps->N_bytes, "EUTRA-NR capabilities (%u B)\n", eutra_nr_caps->N_bytes); + return; +} + +void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps) +{ + uint8_t nr_cap_raw[] = { + 0xe1, 0x00, 0x00, 0x00, 0x01, 0x47, 0x7a, 0x03, 0x02, 0x00, 0x00, 0x01, 0x40, 0x48, 0x07, 0x06, 0x0e, 0x02, 0x0c, + 0x00, 0x02, 0x13, 0x60, 0x10, 0x73, 0xe4, 0x20, 0xf0, 0x00, 0x80, 0xc1, 0x30, 0x08, 0x0c, 0x00, 0x00, 0x0a, 0x05, + 0x89, 0xba, 0xc2, 0x19, 0x43, 0x40, 0x88, 0x10, 0x74, 0x18, 0x60, 0x4c, 0x04, 0x41, 0x6c, 0x90, 0x14, 0x06, 0x0c, + 0x78, 0xc7, 0x3e, 0x42, 0x0f, 0x00, 0x58, 0x0c, 0x0e, 0x0e, 0x02, 0x21, 0x3c, 0x84, 0xfc, 0x4d, 0xe0, 0x00, 0x12, + 0x00, 0x00, 0x00, 0x00, 0xe5, 0x4d, 0x00, 0x01, 0x00, 0x00, 0x04, 0x18, 0x60, 0x00, 0x34, 0xaa, 0x60}; + memcpy(nr_caps->msg, nr_cap_raw, sizeof(nr_cap_raw)); + nr_caps->N_bytes = sizeof(nr_cap_raw); + log_h->debug_hex(nr_caps->msg, nr_caps->N_bytes, "NR capabilities (%u B)\n", nr_caps->N_bytes); + return; +} + // RLC interface void rrc_nr::max_retx_attempted() {} diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 98150c0aa..66a9bee8b 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -31,6 +31,9 @@ ue_stack_lte::ue_stack_lte() : rlc("RLC"), mac("MAC", &task_sched), rrc(this, &task_sched), +#ifdef HAVE_5GNR + rrc_nr(), +#endif pdcp(&task_sched, "PDCP"), nas(&task_sched), thread("STACK"), @@ -118,7 +121,11 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_) rlc.init(&pdcp, &rrc, task_sched.get_timer_handler(), 0 /* RB_ID_SRB0 */); pdcp.init(&rlc, &rrc, gw); nas.init(usim.get(), &rrc, gw, args.nas); +#ifdef HAVE_5GNR + rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &rrc_nr, args.rrc); +#else rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, args.rrc); +#endif running = true; start(STACK_MAIN_THREAD_PRIO); diff --git a/srsue/test/upper/rrc_meas_test.cc b/srsue/test/upper/rrc_meas_test.cc index db002f74f..a43368783 100644 --- a/srsue/test/upper/rrc_meas_test.cc +++ b/srsue/test/upper/rrc_meas_test.cc @@ -233,7 +233,11 @@ public: nastest = std::unique_ptr(new nas_test(&stack->task_sched)); pdcptest = std::unique_ptr(new pdcp_test(log_->get_service_name().c_str(), &stack->task_sched)); } +#ifdef HAVE_5GNR + void init() { rrc::init(&phytest, &mactest, nullptr, pdcptest.get(), nastest.get(), nullptr, nullptr, nullptr, {}); } +#else void init() { rrc::init(&phytest, &mactest, nullptr, pdcptest.get(), nastest.get(), nullptr, nullptr, {}); } +#endif void run_tti(uint32_t tti_) { From 4305929ec7c2cfd002b8ec70ef3547fd232a8b26 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 14 Dec 2020 14:30:42 +0100 Subject: [PATCH 027/138] Hardcoded NR/MRDC-Capabilities --- srsue/hdr/stack/rrc/rrc_nr.h | 6 +- srsue/src/stack/rrc/rrc_nr.cc | 163 +++++++++++++++++++++++++---- srsue/test/upper/CMakeLists.txt | 5 + srsue/test/upper/ue_rrc_nr_test.cc | 36 +++++++ 4 files changed, 189 insertions(+), 21 deletions(-) create mode 100644 srsue/test/upper/ue_rrc_nr_test.cc diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index 054c2a361..cb4548492 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -67,7 +67,11 @@ public: enum direction_t { Rx = 0, Tx }; template - void log_rrc_message(const std::string& source, direction_t dir, const srslte::byte_buffer_t* pdu, const T& msg); + void log_rrc_message(const std::string& source, + direction_t dir, + const srslte::byte_buffer_t* pdu, + const T& msg, + const std::string& msg_type); // PHY interface void in_sync() final; diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index 28192fa64..9cad8a83f 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -69,8 +69,27 @@ void rrc_nr::timer_expired(uint32_t timeout_id) {} void rrc_nr::srslte_rrc_log(const char* str) {} template -void rrc_nr::log_rrc_message(const std::string& source, direction_t dir, const srslte::byte_buffer_t* pdu, const T& msg) -{} +void rrc_nr::log_rrc_message(const std::string& source, + direction_t dir, + const srslte::byte_buffer_t* pdu, + const T& msg, + const std::string& msg_type) +{ + if (log_h->get_level() == srslte::LOG_LEVEL_INFO) { + log_h->info("%s - %s %s (%d B)\n", source.c_str(), (dir == Rx) ? "Rx" : "Tx", msg_type.c_str(), pdu->N_bytes); + } else if (log_h->get_level() >= srslte::LOG_LEVEL_DEBUG) { + asn1::json_writer json_writer; + msg.to_json(json_writer); + log_h->debug_hex(pdu->msg, + pdu->N_bytes, + "%s - %s %s (%d B)\n", + source.c_str(), + (dir == Rx) ? "Rx" : "Tx", + msg_type.c_str(), + pdu->N_bytes); + log_h->debug_long("Content:\n%s\n", json_writer.to_string().c_str()); + } +} // PHY interface void rrc_nr::in_sync() {} @@ -86,30 +105,134 @@ void rrc_nr::write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t pdu) {} void rrc_nr::write_pdu_pcch(srslte::unique_byte_buffer_t pdu) {} void rrc_nr::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {} -void rrc_nr::get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps) +void rrc_nr::get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps_pdu) { - uint8_t eutra_nr_cap_raw[] = {0x01, 0x1c, 0x04, 0x81, 0x60, 0x00, 0x1c, 0x4d, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x40, 0x04, 0x04, 0xd0, 0x10, 0x74, 0x06, 0x14, 0xe8, 0x1b, 0x10, - 0x78, 0x00, 0x00, 0x20, 0x00, 0x10, 0x08, 0x08, 0x01, 0x00, 0x20}; - - memcpy(eutra_nr_caps->msg, eutra_nr_cap_raw, sizeof(eutra_nr_cap_raw)); - eutra_nr_caps->N_bytes = sizeof(eutra_nr_cap_raw); + struct ue_mrdc_cap_s mrdc_cap; + + band_combination_s band_combination; + + struct band_params_c band_param_eutra; + band_param_eutra.set_eutra(); + band_param_eutra.eutra().ca_bw_class_dl_eutra_present = true; + band_param_eutra.eutra().ca_bw_class_ul_eutra_present = true; + band_param_eutra.eutra().band_eutra = 1; + band_param_eutra.eutra().ca_bw_class_dl_eutra = asn1::rrc_nr::ca_bw_class_eutra_opts::options::a; + band_param_eutra.eutra().ca_bw_class_ul_eutra = asn1::rrc_nr::ca_bw_class_eutra_opts::options::a; + band_combination.band_list.push_back(band_param_eutra); + + struct band_params_c band_param_nr; + band_param_nr.set_nr(); + band_param_nr.nr().ca_bw_class_dl_nr_present = true; + band_param_nr.nr().ca_bw_class_ul_nr_present = true; + band_param_nr.nr().band_nr = 78; + band_param_nr.nr().ca_bw_class_dl_nr = asn1::rrc_nr::ca_bw_class_nr_opts::options::a; + band_param_nr.nr().ca_bw_class_ul_nr = asn1::rrc_nr::ca_bw_class_nr_opts::options::a; + band_combination.band_list.push_back(band_param_nr); + + mrdc_cap.rf_params_mrdc.supported_band_combination_list.push_back(band_combination); + mrdc_cap.rf_params_mrdc.supported_band_combination_list_present = true; + + mrdc_cap.rf_params_mrdc.ext = true; + + // RF Params MRDC applied_freq_band_list_filt + freq_band_info_c band_info_eutra; + band_info_eutra.set_band_info_eutra(); + band_info_eutra.band_info_eutra().ca_bw_class_dl_eutra_present = false; + band_info_eutra.band_info_eutra().ca_bw_class_ul_eutra_present = false; + band_info_eutra.band_info_eutra().band_eutra = 1; + mrdc_cap.rf_params_mrdc.applied_freq_band_list_filt.push_back(band_info_eutra); + + freq_band_info_c band_info_nr; + band_info_nr.set_band_info_nr(); + band_info_nr.band_info_nr().band_nr = 78; + mrdc_cap.rf_params_mrdc.applied_freq_band_list_filt.push_back(band_info_nr); + + mrdc_cap.rf_params_mrdc.applied_freq_band_list_filt_present = true; + + // rf_params_mrdc supported band combination list v1540 + + band_combination_list_v1540_l* band_combination_list_v1450 = new band_combination_list_v1540_l(); + band_combination_v1540_s band_combination_v1540; + + band_params_v1540_s band_params_a; + band_params_a.srs_tx_switch_present = true; + band_params_a.srs_carrier_switch_present = false; + band_params_a.srs_tx_switch.supported_srs_tx_port_switch = + band_params_v1540_s::srs_tx_switch_s_::supported_srs_tx_port_switch_opts::not_supported; + band_combination_v1540.band_list_v1540.push_back(band_params_a); + + band_params_v1540_s band_params_b; + band_params_b.srs_tx_switch_present = true; + band_params_b.srs_tx_switch.supported_srs_tx_port_switch = + band_params_v1540_s::srs_tx_switch_s_::supported_srs_tx_port_switch_opts::t1r2; + band_params_b.srs_carrier_switch_present = false; + band_combination_v1540.band_list_v1540.push_back(band_params_b); + + // clang-format off + band_combination_v1540.ca_params_nr_v1540_present = false; + band_combination_v1540.ca_params_nr_v1540.simul_csi_reports_all_cc_present = true; + band_combination_v1540.ca_params_nr_v1540.csi_rs_im_reception_for_feedback_per_band_comb.max_num_simul_nzp_csi_rs_act_bwp_all_cc_present = true; + band_combination_v1540.ca_params_nr_v1540.csi_rs_im_reception_for_feedback_per_band_comb.max_num_simul_nzp_csi_rs_act_bwp_all_cc = 5; + band_combination_v1540.ca_params_nr_v1540.csi_rs_im_reception_for_feedback_per_band_comb.total_num_ports_simul_nzp_csi_rs_act_bwp_all_cc_present = true; + band_combination_v1540.ca_params_nr_v1540.csi_rs_im_reception_for_feedback_per_band_comb.total_num_ports_simul_nzp_csi_rs_act_bwp_all_cc = 32; + // clang-format on + band_combination_list_v1450->push_back(band_combination_v1540); + mrdc_cap.rf_params_mrdc.supported_band_combination_list_v1540.reset(band_combination_list_v1450); + + feature_set_combination_l feature_set_combination; + + feature_sets_per_band_l feature_sets_per_band; + + feature_set_c feature_set_eutra; + feature_set_eutra.set_eutra(); + feature_set_eutra.eutra().dl_set_eutra = 1; + feature_set_eutra.eutra().ul_set_eutra = 1; + feature_sets_per_band.push_back(feature_set_eutra); + + feature_set_combination.push_back(feature_sets_per_band); + + feature_set_c feature_set_nr; + feature_set_nr.set_nr(); + feature_set_nr.nr().dl_set_nr = 1; + feature_set_nr.nr().ul_set_nr = 1; + feature_sets_per_band.push_back(feature_set_nr); + + feature_set_combination.push_back(feature_sets_per_band); + + mrdc_cap.feature_set_combinations.push_back(feature_set_combination); + + mrdc_cap.feature_set_combinations_present = true; + + // Pack mrdc_cap + asn1::bit_ref bref(eutra_nr_caps_pdu->msg, eutra_nr_caps_pdu->get_tailroom()); + mrdc_cap.pack(bref); + eutra_nr_caps_pdu->N_bytes = bref.distance_bytes(); log_h->debug_hex( - eutra_nr_caps->msg, eutra_nr_caps->N_bytes, "EUTRA-NR capabilities (%u B)\n", eutra_nr_caps->N_bytes); + eutra_nr_caps_pdu->msg, eutra_nr_caps_pdu->N_bytes, "EUTRA-NR capabilities (%u B)\n", eutra_nr_caps_pdu->N_bytes); + return; } -void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps) +void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps_pdu) { - uint8_t nr_cap_raw[] = { - 0xe1, 0x00, 0x00, 0x00, 0x01, 0x47, 0x7a, 0x03, 0x02, 0x00, 0x00, 0x01, 0x40, 0x48, 0x07, 0x06, 0x0e, 0x02, 0x0c, - 0x00, 0x02, 0x13, 0x60, 0x10, 0x73, 0xe4, 0x20, 0xf0, 0x00, 0x80, 0xc1, 0x30, 0x08, 0x0c, 0x00, 0x00, 0x0a, 0x05, - 0x89, 0xba, 0xc2, 0x19, 0x43, 0x40, 0x88, 0x10, 0x74, 0x18, 0x60, 0x4c, 0x04, 0x41, 0x6c, 0x90, 0x14, 0x06, 0x0c, - 0x78, 0xc7, 0x3e, 0x42, 0x0f, 0x00, 0x58, 0x0c, 0x0e, 0x0e, 0x02, 0x21, 0x3c, 0x84, 0xfc, 0x4d, 0xe0, 0x00, 0x12, - 0x00, 0x00, 0x00, 0x00, 0xe5, 0x4d, 0x00, 0x01, 0x00, 0x00, 0x04, 0x18, 0x60, 0x00, 0x34, 0xaa, 0x60}; - memcpy(nr_caps->msg, nr_cap_raw, sizeof(nr_cap_raw)); - nr_caps->N_bytes = sizeof(nr_cap_raw); - log_h->debug_hex(nr_caps->msg, nr_caps->N_bytes, "NR capabilities (%u B)\n", nr_caps->N_bytes); + + struct ue_nr_cap_s nr_cap; + + nr_cap.access_stratum_release = access_stratum_release_opts::rel15; + // PDCP + nr_cap.pdcp_params.max_num_rohc_context_sessions = pdcp_params_s::max_num_rohc_context_sessions_opts::cs2; + + band_nr_s band_nr; + band_nr.band_nr = 78; + band_nr.ue_pwr_class_present = true; + band_nr.ue_pwr_class = band_nr_s::ue_pwr_class_opts::pc3; + nr_cap.rf_params.supported_band_list_nr.push_back(band_nr); + + // Pack nr_caps + asn1::bit_ref bref(nr_caps_pdu->msg, nr_caps_pdu->get_tailroom()); + nr_cap.pack(bref); + nr_caps_pdu->N_bytes = bref.distance_bytes(); + log_h->debug_hex(nr_caps_pdu->msg, nr_caps_pdu->N_bytes, "NR capabilities (%u B)\n", nr_caps_pdu->N_bytes); return; } diff --git a/srsue/test/upper/CMakeLists.txt b/srsue/test/upper/CMakeLists.txt index aba74d0fa..04093a152 100644 --- a/srsue/test/upper/CMakeLists.txt +++ b/srsue/test/upper/CMakeLists.txt @@ -47,6 +47,11 @@ else (ENABLE_5GNR) endif(ENABLE_5GNR) add_test(rrc_cell_test rrc_cell_test) +if (ENABLE_5GNR) + add_executable(ue_rrc_nr_test ue_rrc_nr_test.cc) + target_link_libraries(ue_rrc_nr_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1 rrc_nr_asn1) +endif(ENABLE_5GNR) + ######################################################################## # Option to run command after build (useful for remote builds) ######################################################################## diff --git a/srsue/test/upper/ue_rrc_nr_test.cc b/srsue/test/upper/ue_rrc_nr_test.cc new file mode 100644 index 000000000..d5f00a135 --- /dev/null +++ b/srsue/test/upper/ue_rrc_nr_test.cc @@ -0,0 +1,36 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/common/test_common.h" +#include "srsue/hdr/stack/rrc/rrc_nr.h" + +using namespace srsue; + +int rrc_nr_cap_request_test() +{ + + srslte::log_ref rrc_log("RRC"); + rrc_log->set_level(srslte::LOG_LEVEL_DEBUG); + rrc_log->set_hex_limit(-1); + + rrc_nr rrc_nr; + srslte::byte_buffer_t caps; + rrc_nr.get_eutra_nr_capabilities(&caps); + rrc_nr.get_nr_capabilities(&caps); + return SRSLTE_SUCCESS; +} + +int main(int argc, char** argv) +{ + TESTASSERT(rrc_nr_cap_request_test() == SRSLTE_SUCCESS); + return SRSLTE_SUCCESS; +} From f7d313147a4683329127718cbefabdfae2083bcd Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Tue, 15 Dec 2020 11:04:42 +0100 Subject: [PATCH 028/138] Added infrastrukture for measurements Init rrc_nr as part of the LTE stack --- lib/include/srslte/interfaces/ue_interfaces.h | 3 +- srsue/hdr/stack/rrc/rrc.h | 2 +- srsue/hdr/stack/rrc/rrc_nr.h | 30 +++++++----- srsue/hdr/stack/ue_stack_base.h | 1 + srsue/src/stack/rrc/rrc_meas.cc | 8 +++- srsue/src/stack/rrc/rrc_nr.cc | 48 +++++++++++-------- srsue/src/stack/ue_stack_lte.cc | 3 +- srsue/src/stack/ue_stack_nr.cc | 4 +- srsue/test/upper/rrc_meas_test.cc | 23 +++++++-- srsue/test/upper/ue_rrc_nr_test.cc | 7 +-- 10 files changed, 83 insertions(+), 46 deletions(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index a8fa39515..d7253d98a 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -151,7 +151,7 @@ typedef struct { } phy_meas_nr_t; // RRC interface for RRC NR -class rrc_interface_rrc_nr +class rrc_eutra_interface_rrc_nr { public: virtual void new_cell_meas_nr(const std::vector& meas) = 0; @@ -266,6 +266,7 @@ class rrc_nr_interface_rrc public: virtual void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps) = 0; virtual void get_nr_capabilities(srslte::byte_buffer_t* nr_cap) = 0; + virtual void phy_set_cells_to_meas(uint32_t carrier_freq_r15) = 0; }; // PDCP interface for RLC diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 3be8eb19d..3cdd7b3a1 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -63,7 +63,7 @@ class rrc : public rrc_interface_nas, public rrc_interface_mac, public rrc_interface_pdcp, #ifdef HAVE_5GNR - public rrc_interface_rrc_nr, + public rrc_eutra_interface_rrc_nr, #endif public rrc_interface_rlc, public srslte::timer_callback diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index cb4548492..11102b12b 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -45,17 +45,18 @@ class rrc_nr final : public rrc_interface_phy_nr, public srslte::timer_callback { public: - rrc_nr(); + rrc_nr(srslte::task_sched_handle task_sched_); ~rrc_nr(); - void init(phy_interface_rrc_nr* phy_, - mac_interface_rrc_nr* mac_, - rlc_interface_rrc* rlc_, - pdcp_interface_rrc* pdcp_, - gw_interface_rrc* gw_, - srslte::timer_handler* timers_, - stack_interface_rrc* stack_, - const rrc_nr_args_t& args_); + void init(phy_interface_rrc_nr* phy_, + mac_interface_rrc_nr* mac_, + rlc_interface_rrc* rlc_, + pdcp_interface_rrc* pdcp_, + gw_interface_rrc* gw_, + rrc_eutra_interface_rrc_nr* rrc_eutra_, + srslte::timer_handler* timers_, + stack_interface_rrc* stack_, + const rrc_nr_args_t& args_); void stop(); @@ -93,11 +94,13 @@ public: // RRC (LTE) interface void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps); void get_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps); + void phy_set_cells_to_meas(uint32_t carrier_freq_r15); // STACK interface void cell_search_completed(const rrc_interface_phy_lte::cell_search_ret_t& cs_ret, const phy_cell_t& found_cell); private: + srslte::task_sched_handle task_sched; struct cmd_msg_t { enum { PDU, PCCH, PDU_MCH, RLF, PDU_BCCH_DLSCH, STOP } command; srslte::unique_byte_buffer_t pdu; @@ -109,10 +112,11 @@ private: phy_interface_rrc_nr* phy = nullptr; // mac_interface_rrc* mac = nullptr; - rlc_interface_rrc* rlc = nullptr; - pdcp_interface_rrc* pdcp = nullptr; - gw_interface_rrc* gw = nullptr; - stack_interface_rrc* stack = nullptr; + rlc_interface_rrc* rlc = nullptr; + pdcp_interface_rrc* pdcp = nullptr; + gw_interface_rrc* gw = nullptr; + rrc_eutra_interface_rrc_nr* rrc_eutra = nullptr; + stack_interface_rrc* stack = nullptr; srslte::log_ref log_h; diff --git a/srsue/hdr/stack/ue_stack_base.h b/srsue/hdr/stack/ue_stack_base.h index 9447b79d3..3e4a01dc5 100644 --- a/srsue/hdr/stack/ue_stack_base.h +++ b/srsue/hdr/stack/ue_stack_base.h @@ -58,6 +58,7 @@ typedef struct { stack_log_args_t log; usim_args_t usim; rrc_args_t rrc; + rrc_nr_args_t rrc_nr; std::string ue_category_str; nas_args_t nas; gw_args_t gw; diff --git a/srsue/src/stack/rrc/rrc_meas.cc b/srsue/src/stack/rrc/rrc_meas.cc index c99a688d2..b130a0850 100644 --- a/srsue/src/stack/rrc/rrc_meas.cc +++ b/srsue/src/stack/rrc/rrc_meas.cc @@ -84,8 +84,12 @@ void rrc::rrc_meas::update_phy() rrc_ptr->phy->set_cells_to_meas(obj.meas_obj.meas_obj_eutra().carrier_freq, neighbour_pcis); break; } - case meas_obj_to_add_mod_s::meas_obj_c_::types_opts::meas_obj_nr_r15: - // Todo NR +#ifdef HAVE_5GNR + case meas_obj_to_add_mod_s::meas_obj_c_::types_opts::meas_obj_nr_r15: { + rrc_ptr->rrc_nr->phy_set_cells_to_meas(obj.meas_obj.meas_obj_nr_r15().carrier_freq_r15); + break; + } +#endif default: log_h->error("Not supported\n"); break; diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index 9cad8a83f..74c85223b 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -18,30 +18,32 @@ namespace srsue { const char* rrc_nr::rrc_nr_state_text[] = {"IDLE", "CONNECTED", "CONNECTED-INACTIVE"}; -rrc_nr::rrc_nr() : log_h("RRC") {} +rrc_nr::rrc_nr(srslte::task_sched_handle task_sched_) : log_h("RRC"), task_sched(task_sched_) {} rrc_nr::~rrc_nr() = default; -void rrc_nr::init(phy_interface_rrc_nr* phy_, - mac_interface_rrc_nr* mac_, - rlc_interface_rrc* rlc_, - pdcp_interface_rrc* pdcp_, - gw_interface_rrc* gw_, - srslte::timer_handler* timers_, - stack_interface_rrc* stack_, - const rrc_nr_args_t& args_) +void rrc_nr::init(phy_interface_rrc_nr* phy_, + mac_interface_rrc_nr* mac_, + rlc_interface_rrc* rlc_, + pdcp_interface_rrc* pdcp_, + gw_interface_rrc* gw_, + rrc_eutra_interface_rrc_nr* rrc_eutra_, + srslte::timer_handler* timers_, + stack_interface_rrc* stack_, + const rrc_nr_args_t& args_) { - phy = phy_; - rlc = rlc_; - pdcp = pdcp_; - gw = gw_; - timers = timers_; - stack = stack_; - args = args_; + phy = phy_; + rlc = rlc_; + pdcp = pdcp_; + gw = gw_; + rrc_eutra = rrc_eutra_; + timers = timers_; + stack = stack_; + args = args_; log_h->info("Creating dummy DRB on LCID=%d\n", args.coreless.drb_lcid); srslte::rlc_config_t rlc_cnfg = srslte::rlc_config_t::default_rlc_um_nr_config(6); - rlc->add_bearer(args.coreless.drb_lcid, rlc_cnfg); + // rlc->add_bearer(args.coreless.drb_lcid, rlc_cnfg); srslte::pdcp_config_t pdcp_cnfg{args.coreless.drb_lcid, srslte::PDCP_RB_IS_DRB, @@ -51,7 +53,7 @@ void rrc_nr::init(phy_interface_rrc_nr* phy_, srslte::pdcp_t_reordering_t::ms500, srslte::pdcp_discard_timer_t ::ms100}; - pdcp->add_bearer(args.coreless.drb_lcid, pdcp_cnfg); + // pdcp->add_bearer(args.coreless.drb_lcid, pdcp_cnfg); running = true; } @@ -64,7 +66,10 @@ void rrc_nr::stop() void rrc_nr::get_metrics(rrc_nr_metrics_t& m) {} // Timeout callback interface -void rrc_nr::timer_expired(uint32_t timeout_id) {} +void rrc_nr::timer_expired(uint32_t timeout_id) +{ + log_h->debug("[NR] Handling Timer Expired\n"); +} void rrc_nr::srslte_rrc_log(const char* str) {} @@ -234,6 +239,11 @@ void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps_pdu) nr_caps_pdu->N_bytes = bref.distance_bytes(); log_h->debug_hex(nr_caps_pdu->msg, nr_caps_pdu->N_bytes, "NR capabilities (%u B)\n", nr_caps_pdu->N_bytes); return; +}; + +void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15) +{ + log_h->debug("[NR] Measuring phy cell %d \n", carrier_freq_r15); } // RLC interface diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 66a9bee8b..0df20c75e 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -32,7 +32,7 @@ ue_stack_lte::ue_stack_lte() : mac("MAC", &task_sched), rrc(this, &task_sched), #ifdef HAVE_5GNR - rrc_nr(), + rrc_nr(&task_sched), #endif pdcp(&task_sched, "PDCP"), nas(&task_sched), @@ -122,6 +122,7 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_) pdcp.init(&rlc, &rrc, gw); nas.init(usim.get(), &rrc, gw, args.nas); #ifdef HAVE_5GNR + rrc_nr.init(nullptr, nullptr, nullptr, nullptr, gw, &rrc, task_sched.get_timer_handler(), nullptr, args.rrc_nr); rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &rrc_nr, args.rrc); #else rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, args.rrc); diff --git a/srsue/src/stack/ue_stack_nr.cc b/srsue/src/stack/ue_stack_nr.cc index d7db64599..0d8325ce7 100644 --- a/srsue/src/stack/ue_stack_nr.cc +++ b/srsue/src/stack/ue_stack_nr.cc @@ -28,7 +28,7 @@ ue_stack_nr::ue_stack_nr(srslte::logger* logger_) : mac.reset(new mac_nr(&task_sched)); pdcp.reset(new srslte::pdcp(&task_sched, "PDCP")); rlc.reset(new srslte::rlc("RLC")); - rrc.reset(new rrc_nr()); + rrc.reset(new rrc_nr(&task_sched)); // setup logging for pool, RLC and PDCP pool_log->set_level(srslte::LOG_LEVEL_ERROR); @@ -83,7 +83,7 @@ int ue_stack_nr::init(const stack_args_t& args_) rrc_args.log_hex_limit = args.log.rrc_hex_limit; rrc_args.coreless.drb_lcid = 4; rrc_args.coreless.ip_addr = "192.168.1.3"; - rrc->init(phy, mac.get(), rlc.get(), pdcp.get(), gw, task_sched.get_timer_handler(), this, rrc_args); + rrc->init(phy, mac.get(), rlc.get(), pdcp.get(), gw, nullptr, task_sched.get_timer_handler(), this, rrc_args); running = true; start(STACK_MAIN_THREAD_PRIO); diff --git a/srsue/test/upper/rrc_meas_test.cc b/srsue/test/upper/rrc_meas_test.cc index a43368783..180f1c4e3 100644 --- a/srsue/test/upper/rrc_meas_test.cc +++ b/srsue/test/upper/rrc_meas_test.cc @@ -18,6 +18,7 @@ #include "srslte/upper/pdcp.h" #include "srsue/hdr/stack/rrc/rrc.h" #include "srsue/hdr/stack/rrc/rrc_meas.h" +#include "srsue/hdr/stack/rrc/rrc_nr.h" #include "srsue/hdr/stack/upper/nas.h" #include @@ -161,6 +162,15 @@ public: void reset() override {} }; +class rrc_nr_test final : public srsue::rrc_nr_interface_rrc +{ +public: + ~rrc_nr_test() = default; + void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps) override{}; + void get_nr_capabilities(srslte::byte_buffer_t* nr_cap) override{}; + void phy_set_cells_to_meas(uint32_t carrier_freq_r15) override{}; +}; + class nas_test : public srsue::nas { public: @@ -229,12 +239,16 @@ public: rrc_test(srslte::log_ref log_, stack_test_dummy* stack_) : rrc(stack_, &stack_->task_sched), stack(stack_), mactest(this, &stack_->task_sched) { - pool = srslte::byte_buffer_pool::get_instance(); - nastest = std::unique_ptr(new nas_test(&stack->task_sched)); - pdcptest = std::unique_ptr(new pdcp_test(log_->get_service_name().c_str(), &stack->task_sched)); + pool = srslte::byte_buffer_pool::get_instance(); + nastest = std::unique_ptr(new nas_test(&stack->task_sched)); + pdcptest = std::unique_ptr(new pdcp_test(log_->get_service_name().c_str(), &stack->task_sched)); + rrcnrtest = std::unique_ptr(new rrc_nr_test()); } #ifdef HAVE_5GNR - void init() { rrc::init(&phytest, &mactest, nullptr, pdcptest.get(), nastest.get(), nullptr, nullptr, nullptr, {}); } + void init() + { + rrc::init(&phytest, &mactest, nullptr, pdcptest.get(), nastest.get(), nullptr, nullptr, rrcnrtest.get(), {}); + } #else void init() { rrc::init(&phytest, &mactest, nullptr, pdcptest.get(), nastest.get(), nullptr, nullptr, {}); } #endif @@ -347,6 +361,7 @@ public: private: std::unique_ptr pdcptest; std::unique_ptr nastest; + std::unique_ptr rrcnrtest; uint32_t tti = 0; srslte::byte_buffer_pool* pool = nullptr; }; diff --git a/srsue/test/upper/ue_rrc_nr_test.cc b/srsue/test/upper/ue_rrc_nr_test.cc index d5f00a135..4c035f766 100644 --- a/srsue/test/upper/ue_rrc_nr_test.cc +++ b/srsue/test/upper/ue_rrc_nr_test.cc @@ -21,9 +21,10 @@ int rrc_nr_cap_request_test() srslte::log_ref rrc_log("RRC"); rrc_log->set_level(srslte::LOG_LEVEL_DEBUG); rrc_log->set_hex_limit(-1); - - rrc_nr rrc_nr; - srslte::byte_buffer_t caps; + srslte::task_scheduler task_sched{512, 0, 100}; + srslte::task_sched_handle task_sched_handle(&task_sched); + rrc_nr rrc_nr(task_sched_handle); + srslte::byte_buffer_t caps; rrc_nr.get_eutra_nr_capabilities(&caps); rrc_nr.get_nr_capabilities(&caps); return SRSLTE_SUCCESS; From 1a10c783b586e83b46260da20917450ec2138b54 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Tue, 15 Dec 2020 13:10:46 +0100 Subject: [PATCH 029/138] Faking measurements --- srsue/hdr/stack/rrc/rrc_nr.h | 3 +++ srsue/src/stack/rrc/rrc_nr.cc | 45 ++++++++++++++++++++++++++-------- srsue/src/stack/ue_stack_nr.cc | 2 +- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index 11102b12b..ea7a72573 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -59,6 +59,7 @@ public: const rrc_nr_args_t& args_); void stop(); + void init_core_less(); void get_metrics(rrc_nr_metrics_t& m); @@ -120,6 +121,8 @@ private: srslte::log_ref log_h; + srslte::timer_handler::unique_timer fake_measurement_timer; + /// RRC states (3GPP 38.331 v15.5.1 Sec 4.2.1) enum rrc_nr_state_t { RRC_NR_STATE_IDLE = 0, diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index 74c85223b..e86418630 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -41,9 +41,20 @@ void rrc_nr::init(phy_interface_rrc_nr* phy_, stack = stack_; args = args_; + running = true; + fake_measurement_timer = task_sched.get_unique_timer(); +} + +void rrc_nr::stop() +{ + running = false; +} + +void rrc_nr::init_core_less() +{ log_h->info("Creating dummy DRB on LCID=%d\n", args.coreless.drb_lcid); srslte::rlc_config_t rlc_cnfg = srslte::rlc_config_t::default_rlc_um_nr_config(6); - // rlc->add_bearer(args.coreless.drb_lcid, rlc_cnfg); + rlc->add_bearer(args.coreless.drb_lcid, rlc_cnfg); srslte::pdcp_config_t pdcp_cnfg{args.coreless.drb_lcid, srslte::PDCP_RB_IS_DRB, @@ -53,22 +64,32 @@ void rrc_nr::init(phy_interface_rrc_nr* phy_, srslte::pdcp_t_reordering_t::ms500, srslte::pdcp_discard_timer_t ::ms100}; - // pdcp->add_bearer(args.coreless.drb_lcid, pdcp_cnfg); - - running = true; -} - -void rrc_nr::stop() -{ - running = false; + pdcp->add_bearer(args.coreless.drb_lcid, pdcp_cnfg); + return; } - void rrc_nr::get_metrics(rrc_nr_metrics_t& m) {} // Timeout callback interface void rrc_nr::timer_expired(uint32_t timeout_id) { log_h->debug("[NR] Handling Timer Expired\n"); + if (timeout_id == fake_measurement_timer.id()) { + log_h->debug("[NR] Triggered Fake Measurement\n"); + + phy_meas_nr_t fake_meas = {}; + std::vector phy_meas_nr; + fake_meas.rsrp = -60.0; + fake_meas.rsrq = -60.0; + fake_meas.cfo_hz = 1.0; + fake_meas.arfcn_nr = 632256; + fake_meas.pci_nr = 500; + phy_meas_nr.push_back(fake_meas); + rrc_eutra->new_cell_meas_nr(phy_meas_nr); + + auto timer_expire_func = [this](uint32_t tid) { timer_expired(tid); }; + fake_measurement_timer.set(10, timer_expire_func); + fake_measurement_timer.run(); + } } void rrc_nr::srslte_rrc_log(const char* str) {} @@ -244,6 +265,10 @@ void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps_pdu) void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15) { log_h->debug("[NR] Measuring phy cell %d \n", carrier_freq_r15); + // Start timer for fake measurements + auto timer_expire_func = [this](uint32_t tid) { timer_expired(tid); }; + fake_measurement_timer.set(10, timer_expire_func); + fake_measurement_timer.run(); } // RLC interface diff --git a/srsue/src/stack/ue_stack_nr.cc b/srsue/src/stack/ue_stack_nr.cc index 0d8325ce7..4647779b1 100644 --- a/srsue/src/stack/ue_stack_nr.cc +++ b/srsue/src/stack/ue_stack_nr.cc @@ -84,7 +84,7 @@ int ue_stack_nr::init(const stack_args_t& args_) rrc_args.coreless.drb_lcid = 4; rrc_args.coreless.ip_addr = "192.168.1.3"; rrc->init(phy, mac.get(), rlc.get(), pdcp.get(), gw, nullptr, task_sched.get_timer_handler(), this, rrc_args); - + rrc->init_core_less(); running = true; start(STACK_MAIN_THREAD_PRIO); From ffe513415cce59840e74b1489eefec3eedc27c16 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Thu, 7 Jan 2021 17:28:31 +0100 Subject: [PATCH 030/138] stop gw in srsue nas test --- srsue/test/upper/nas_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/srsue/test/upper/nas_test.cc b/srsue/test/upper/nas_test.cc index 397f86e36..4ffa9b8af 100644 --- a/srsue/test/upper/nas_test.cc +++ b/srsue/test/upper/nas_test.cc @@ -335,6 +335,7 @@ int mme_attach_request_test() ret = SRSLTE_SUCCESS; } // ensure buffers are deleted before pool cleanup + gw.stop(); } byte_buffer_pool::get_instance()->cleanup(); From ea8ad153c4c4edadf7ebc89e03e65c0a4f3caf61 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 7 Jan 2021 18:10:24 +0000 Subject: [PATCH 031/138] add configurable fairness parameter to pf scheduler --- .../srslte/interfaces/sched_interface.h | 1 + .../hdr/stack/mac/schedulers/sched_time_pf.h | 8 ++++--- .../hdr/stack/mac/schedulers/sched_time_rr.h | 2 +- srsenb/src/main.cc | 1 + srsenb/src/stack/mac/sched_carrier.cc | 4 ++-- .../src/stack/mac/schedulers/sched_time_pf.cc | 21 +++++++++++-------- .../src/stack/mac/schedulers/sched_time_rr.cc | 10 ++++++--- 7 files changed, 29 insertions(+), 18 deletions(-) diff --git a/lib/include/srslte/interfaces/sched_interface.h b/lib/include/srslte/interfaces/sched_interface.h index 0ef50bc7b..ebef4ceca 100644 --- a/lib/include/srslte/interfaces/sched_interface.h +++ b/lib/include/srslte/interfaces/sched_interface.h @@ -46,6 +46,7 @@ public: struct sched_args_t { std::string sched_policy = "time_pf"; + std::string sched_policy_args = "2"; int pdsch_mcs = -1; int pdsch_max_mcs = 28; int pusch_mcs = -1; diff --git a/srsenb/hdr/stack/mac/schedulers/sched_time_pf.h b/srsenb/hdr/stack/mac/schedulers/sched_time_pf.h index 9166227ac..967bdf577 100644 --- a/srsenb/hdr/stack/mac/schedulers/sched_time_pf.h +++ b/srsenb/hdr/stack/mac/schedulers/sched_time_pf.h @@ -23,19 +23,20 @@ class sched_time_pf final : public sched_base using ue_cit_t = std::map::const_iterator; public: - sched_time_pf(const sched_cell_params_t& cell_params_); + sched_time_pf(const sched_cell_params_t& cell_params_, const sched_interface::sched_args_t& sched_args); void sched_dl_users(std::map& ue_db, sf_sched* tti_sched) override; void sched_ul_users(std::map& ue_db, sf_sched* tti_sched) override; private: void new_tti(std::map& ue_db, sf_sched* tti_sched); - const sched_cell_params_t* cc_cfg = nullptr; + const sched_cell_params_t* cc_cfg = nullptr; + float fairness_coeff = 1; srslte::tti_point current_tti_rx; struct ue_ctxt { - ue_ctxt(uint16_t rnti_) : rnti(rnti_) {} + ue_ctxt(uint16_t rnti_, float fairness_coeff_) : rnti(rnti_), fairness_coeff(fairness_coeff_) {} float dl_avg_rate() const { return dl_nof_samples == 0 ? 0 : dl_avg_rate_; } float ul_avg_rate() const { return ul_nof_samples == 0 ? 0 : ul_avg_rate_; } uint32_t dl_count() const { return dl_nof_samples; } @@ -45,6 +46,7 @@ private: void save_ul_alloc(uint32_t alloc_bytes, float alpha); const uint16_t rnti; + const float fairness_coeff; int ue_cc_idx = 0; float dl_prio = 0; diff --git a/srsenb/hdr/stack/mac/schedulers/sched_time_rr.h b/srsenb/hdr/stack/mac/schedulers/sched_time_rr.h index 5cd96bbc1..29e96b99f 100644 --- a/srsenb/hdr/stack/mac/schedulers/sched_time_rr.h +++ b/srsenb/hdr/stack/mac/schedulers/sched_time_rr.h @@ -22,7 +22,7 @@ class sched_time_rr final : public sched_base const static int MAX_RBG = 25; public: - sched_time_rr(const sched_cell_params_t& cell_params_); + sched_time_rr(const sched_cell_params_t& cell_params_, const sched_interface::sched_args_t& sched_args); void sched_dl_users(std::map& ue_db, sf_sched* tti_sched) override; void sched_ul_users(std::map& ue_db, sf_sched* tti_sched) override; diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index 9353009c4..ceacca5e2 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -133,6 +133,7 @@ void parse_args(all_args_t* args, int argc, char* argv[]) /* Scheduling section */ ("scheduler.policy", bpo::value(&args->stack.mac.sched.sched_policy)->default_value("time_pf"), "DL and UL data scheduling policy (E.g. time_rr, time_pf)") + ("scheduler.policy_args", bpo::value(&args->stack.mac.sched.sched_policy_args)->default_value("2"), "Scheduler policy-specific arguments") ("scheduler.pdsch_mcs", bpo::value(&args->stack.mac.sched.pdsch_mcs)->default_value(-1), "Optional fixed PDSCH MCS (ignores reported CQIs if specified)") ("scheduler.pdsch_max_mcs", bpo::value(&args->stack.mac.sched.pdsch_max_mcs)->default_value(-1), "Optional PDSCH MCS limit") ("scheduler.pusch_mcs", bpo::value(&args->stack.mac.sched.pusch_mcs)->default_value(-1), "Optional fixed PUSCH MCS (ignores reported CQIs if specified)") diff --git a/srsenb/src/stack/mac/sched_carrier.cc b/srsenb/src/stack/mac/sched_carrier.cc index 27cbdc432..2e1e5847b 100644 --- a/srsenb/src/stack/mac/sched_carrier.cc +++ b/srsenb/src/stack/mac/sched_carrier.cc @@ -289,10 +289,10 @@ void sched::carrier_sched::carrier_cfg(const sched_cell_params_t& cell_params_) // Setup data scheduling algorithms if (cell_params_.sched_cfg->sched_policy == "time_rr") { - sched_algo.reset(new sched_time_rr{*cc_cfg}); + sched_algo.reset(new sched_time_rr{*cc_cfg, *cell_params_.sched_cfg}); log_h->info("Using time-domain RR scheduling policy for cc=%d\n", cc_cfg->enb_cc_idx); } else { - sched_algo.reset(new sched_time_pf{*cc_cfg}); + sched_algo.reset(new sched_time_pf{*cc_cfg, *cell_params_.sched_cfg}); log_h->info("Using time-domain PF scheduling policy for cc=%d\n", cc_cfg->enb_cc_idx); } diff --git a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc index df4c912fc..4ed794185 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc @@ -16,9 +16,12 @@ namespace srsenb { using srslte::tti_point; -sched_time_pf::sched_time_pf(const sched_cell_params_t& cell_params_) +sched_time_pf::sched_time_pf(const sched_cell_params_t& cell_params_, const sched_interface::sched_args_t& sched_args) { cc_cfg = &cell_params_; + if (not sched_args.sched_policy_args.empty()) { + fairness_coeff = std::stof(sched_args.sched_policy_args); + } } void sched_time_pf::new_tti(std::map& ue_db, sf_sched* tti_sched) @@ -36,7 +39,7 @@ void sched_time_pf::new_tti(std::map& ue_db, sf_sched* tti_s for (auto& u : ue_db) { auto it = ue_history_db.find(u.first); if (it == ue_history_db.end()) { - it = ue_history_db.insert(std::make_pair(u.first, ue_ctxt{u.first})).first; + it = ue_history_db.insert(std::make_pair(u.first, ue_ctxt{u.first, fairness_coeff})).first; } it->second.new_tti(*cc_cfg, u.second, tti_sched); if (it->second.dl_newtx_h != nullptr or it->second.dl_retx_h != nullptr) { @@ -162,7 +165,7 @@ void sched_time_pf::ue_ctxt::new_tti(const sched_cell_params_t& cell, sched_ue& // calculate DL PF priority float r = ue.get_expected_dl_bitrate(ue_cc_idx) / 8; float R = dl_avg_rate(); - dl_prio = (R != 0) ? r / R : (r == 0 ? 0 : std::numeric_limits::max()); + dl_prio = (R != 0) ? pow(r, fairness_coeff) / R : (r == 0 ? 0 : std::numeric_limits::max()); } // Calculate UL priority @@ -177,24 +180,24 @@ void sched_time_pf::ue_ctxt::new_tti(const sched_cell_params_t& cell, sched_ue& } } -void sched_time_pf::ue_ctxt::save_dl_alloc(uint32_t alloc_bytes, float alpha) +void sched_time_pf::ue_ctxt::save_dl_alloc(uint32_t alloc_bytes, float exp_avg_alpha) { - if (dl_nof_samples < 1 / alpha) { + if (dl_nof_samples < 1 / exp_avg_alpha) { // fast start dl_avg_rate_ = dl_avg_rate_ + (alloc_bytes - dl_avg_rate_) / (dl_nof_samples + 1); } else { - dl_avg_rate_ = (1 - alpha) * dl_avg_rate_ + (alpha)*alloc_bytes; + dl_avg_rate_ = (1 - exp_avg_alpha) * dl_avg_rate_ + (exp_avg_alpha)*alloc_bytes; } dl_nof_samples++; } -void sched_time_pf::ue_ctxt::save_ul_alloc(uint32_t alloc_bytes, float alpha) +void sched_time_pf::ue_ctxt::save_ul_alloc(uint32_t alloc_bytes, float exp_avg_alpha) { - if (ul_nof_samples < 1 / alpha) { + if (ul_nof_samples < 1 / exp_avg_alpha) { // fast start ul_avg_rate_ = ul_avg_rate_ + (alloc_bytes - ul_avg_rate_) / (ul_nof_samples + 1); } else { - ul_avg_rate_ = (1 - alpha) * ul_avg_rate_ + (alpha)*alloc_bytes; + ul_avg_rate_ = (1 - exp_avg_alpha) * ul_avg_rate_ + (exp_avg_alpha)*alloc_bytes; } ul_nof_samples++; } diff --git a/srsenb/src/stack/mac/schedulers/sched_time_rr.cc b/srsenb/src/stack/mac/schedulers/sched_time_rr.cc index baa7a5de7..b7b7660fc 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_rr.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_rr.cc @@ -15,7 +15,7 @@ namespace srsenb { -sched_time_rr::sched_time_rr(const sched_cell_params_t& cell_params_) +sched_time_rr::sched_time_rr(const sched_cell_params_t& cell_params_, const sched_interface::sched_args_t& sched_args) { cc_cfg = &cell_params_; } @@ -65,9 +65,13 @@ void sched_time_rr::sched_dl_newtxs(std::map& ue_db, sf_sche if (iter == ue_db.end()) { iter = ue_db.begin(); // wrap around } - sched_ue& user = iter->second; + sched_ue& user = iter->second; + int ue_cc_idx = user.enb_to_ue_cc_idx(cc_cfg->enb_cc_idx); + if (ue_cc_idx < 0) { + continue; + } const dl_harq_proc* h = get_dl_newtx_harq(user, tti_sched); - rbg_interval req_rbgs = user.get_required_dl_rbgs(user.enb_to_ue_cc_idx(cc_cfg->enb_cc_idx)); + rbg_interval req_rbgs = user.get_required_dl_rbgs(ue_cc_idx); // Check if there is an empty harq for the newtx if (h == nullptr or req_rbgs.stop() == 0) { continue; From f45d31d89972f0ec54b75de9ad15a481de32b791 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 7 Jan 2021 19:20:24 +0000 Subject: [PATCH 032/138] add fairness coefficient to UL. --- srsenb/src/stack/mac/schedulers/sched_time_pf.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc index 4ed794185..a97d9e133 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc @@ -165,7 +165,7 @@ void sched_time_pf::ue_ctxt::new_tti(const sched_cell_params_t& cell, sched_ue& // calculate DL PF priority float r = ue.get_expected_dl_bitrate(ue_cc_idx) / 8; float R = dl_avg_rate(); - dl_prio = (R != 0) ? pow(r, fairness_coeff) / R : (r == 0 ? 0 : std::numeric_limits::max()); + dl_prio = (R != 0) ? r / pow(R, fairness_coeff) : (r == 0 ? 0 : std::numeric_limits::max()); } // Calculate UL priority @@ -176,7 +176,7 @@ void sched_time_pf::ue_ctxt::new_tti(const sched_cell_params_t& cell, sched_ue& if (ul_h != nullptr) { float r = ue.get_expected_ul_bitrate(ue_cc_idx) / 8; float R = ul_avg_rate(); - ul_prio = (R != 0) ? r / R : (r == 0 ? 0 : std::numeric_limits::max()); + ul_prio = (R != 0) ? r / pow(R, fairness_coeff) : (r == 0 ? 0 : std::numeric_limits::max()); } } From 02d4dde1f58acec93f9ebaba4c5a27d61d12edf0 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Sat, 9 Jan 2021 20:44:48 +0000 Subject: [PATCH 033/138] issue 2170 fix: add extra check that UL harq is empty before allocating it --- srsenb/hdr/stack/mac/sched_grid.h | 11 ++++++++- srsenb/src/stack/mac/sched_grid.cc | 23 +++++++++++-------- .../src/stack/mac/schedulers/sched_time_pf.cc | 3 ++- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_grid.h b/srsenb/hdr/stack/mac/sched_grid.h index a627778fd..64c09e502 100644 --- a/srsenb/hdr/stack/mac/sched_grid.h +++ b/srsenb/hdr/stack/mac/sched_grid.h @@ -27,7 +27,16 @@ enum class alloc_type_t { DL_BC, DL_PCCH, DL_RAR, DL_DATA, UL_DATA }; //! Result of alloc attempt struct alloc_outcome_t { - enum result_enum { SUCCESS, DCI_COLLISION, RB_COLLISION, ERROR, NOF_RB_INVALID, PUCCH_COLLISION, MEASGAP_COLLISION }; + enum result_enum { + SUCCESS, + DCI_COLLISION, + RB_COLLISION, + ERROR, + NOF_RB_INVALID, + PUCCH_COLLISION, + MEASGAP_COLLISION, + ALREADY_ALLOC + }; result_enum result = ERROR; alloc_outcome_t() = default; alloc_outcome_t(result_enum e) : result(e) {} diff --git a/srsenb/src/stack/mac/sched_grid.cc b/srsenb/src/stack/mac/sched_grid.cc index 28057b2f4..f7e670db9 100644 --- a/srsenb/src/stack/mac/sched_grid.cc +++ b/srsenb/src/stack/mac/sched_grid.cc @@ -36,6 +36,8 @@ const char* alloc_outcome_t::to_string() const return "pucch_collision"; case MEASGAP_COLLISION: return "measgap_collision"; + case ALREADY_ALLOC: + return "already allocated"; } return "unknown error"; } @@ -758,14 +760,16 @@ bool is_periodic_cqi_expected(const sched_interface::ue_cfg_t& ue_cfg, tti_point alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_mask, uint32_t pid) { - if (is_dl_alloc(user->get_rnti())) { - Warning("SCHED: Attempt to assign multiple harq pids to the same user rnti=0x%x\n", user->get_rnti()); - return alloc_outcome_t::ERROR; - } if (data_allocs.size() >= sched_interface::MAX_DATA_LIST) { Warning("SCHED: Maximum number of DL allocations reached\n"); return alloc_outcome_t::ERROR; } + + if (is_dl_alloc(user->get_rnti())) { + Warning("SCHED: Attempt to assign multiple harq pids to the same user rnti=0x%x\n", user->get_rnti()); + return alloc_outcome_t::ALREADY_ALLOC; + } + auto* cc = user->find_ue_carrier(cc_cfg->enb_cc_idx); if (cc == nullptr or cc->cc_state() != cc_st::active) { return alloc_outcome_t::ERROR; @@ -824,16 +828,17 @@ alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_ma alloc_outcome_t sf_sched::alloc_ul(sched_ue* user, prb_interval alloc, ul_alloc_t::type_t alloc_type, int msg3_mcs) { - // Check whether user was already allocated - if (is_ul_alloc(user->get_rnti())) { - log_h->warning("SCHED: Attempt to assign multiple ul_harq_proc to the same user rnti=0x%x\n", user->get_rnti()); - return alloc_outcome_t::ERROR; - } if (ul_data_allocs.size() >= sched_interface::MAX_DATA_LIST) { Warning("SCHED: Maximum number of UL allocations reached\n"); return alloc_outcome_t::ERROR; } + // Check whether user was already allocated + if (is_ul_alloc(user->get_rnti())) { + log_h->warning("SCHED: Attempt to assign multiple ul_harq_proc to the same user rnti=0x%x\n", user->get_rnti()); + return alloc_outcome_t::ALREADY_ALLOC; + } + // Check if there is no collision with measGap bool needs_pdcch = alloc_type == ul_alloc_t::ADAPT_RETX or alloc_type == ul_alloc_t::NEWTX; if (not user->pusch_enabled(srslte::tti_point{get_tti_rx()}, cc_cfg->enb_cc_idx, needs_pdcch)) { diff --git a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc index a97d9e133..fdecedc0f 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc @@ -123,7 +123,8 @@ uint32_t sched_time_pf::try_ul_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* t alloc_outcome_t code = alloc_outcome_t::ERROR; if (ue_ctxt.ul_h != nullptr and ue_ctxt.ul_h->has_pending_retx()) { code = try_ul_retx_alloc(*tti_sched, ue, *ue_ctxt.ul_h); - } else if (ue_ctxt.ul_h != nullptr) { + } else if (ue_ctxt.ul_h != nullptr and not tti_sched->is_ul_alloc(ue_ctxt.rnti)) { + // Note: h->is_empty check is required, in case CA allocated a small UL grant for UCI uint32_t pending_data = ue.get_pending_ul_new_data(tti_sched->get_tti_tx_ul(), ue_ctxt.ue_cc_idx); // Check if there is a empty harq, and data to transmit if (pending_data == 0) { From 02b0f251aa5ae7fe6bca08654e733edbafda1586 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 7 Jan 2021 14:57:14 +0100 Subject: [PATCH 034/138] prach_worker: move variable to function body the variable was only used inside the run_tti() function and isn't needed elsewhere. refactor therefore. --- srsenb/hdr/phy/prach_worker.h | 2 +- srsenb/src/phy/prach_worker.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/srsenb/hdr/phy/prach_worker.h b/srsenb/hdr/phy/prach_worker.h index 0acbfa0fa..5939fb991 100644 --- a/srsenb/hdr/phy/prach_worker.h +++ b/srsenb/hdr/phy/prach_worker.h @@ -45,7 +45,7 @@ public: private: uint32_t cc_idx = 0; - uint32_t prach_nof_det = 0; + uint32_t prach_indices[165] = {}; float prach_offsets[165] = {}; float prach_p2avg[165] = {}; diff --git a/srsenb/src/phy/prach_worker.cc b/srsenb/src/phy/prach_worker.cc index 699dd8501..3fad394e7 100644 --- a/srsenb/src/phy/prach_worker.cc +++ b/srsenb/src/phy/prach_worker.cc @@ -128,6 +128,7 @@ int prach_worker::new_tti(uint32_t tti_rx, cf_t* buffer_rx) int prach_worker::run_tti(sf_buffer* b) { + uint32_t prach_nof_det = 0; if (srslte_prach_tti_opportunity(&prach, b->tti, -1)) { // Detect possible PRACHs if (srslte_prach_detect_offset(&prach, From 78b07daf3ba71f3d33ca095f4874dd6bee47eb49 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 4 Jan 2021 20:54:53 +0100 Subject: [PATCH 035/138] pcap: make public interfaces thread-safe and handle fopen returning nullptr the previous patch only introduced a thread-safe queue between PHY workers (writers) and PCAP writer thread (consumer). However, it is also required to protect the ctor (and close()) to prevent corrupted PCAP files. The patch also correctly handles the case where the PCAP couldn't be openend for writing and doesn't start the thread. --- lib/include/srslte/common/mac_pcap.h | 3 +- lib/src/common/mac_pcap.cc | 43 ++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/lib/include/srslte/common/mac_pcap.h b/lib/include/srslte/common/mac_pcap.h index 06ef6ebd4..43ecaa9b9 100644 --- a/lib/include/srslte/common/mac_pcap.h +++ b/lib/include/srslte/common/mac_pcap.h @@ -19,9 +19,9 @@ #include "srslte/common/logmap.h" #include "srslte/common/pcap.h" #include "srslte/common/threads.h" +#include #include #include - namespace srslte { class mac_pcap : srslte::thread { @@ -71,6 +71,7 @@ private: unique_byte_buffer_t pdu; } pcap_pdu_t; block_queue queue; + std::mutex mutex; void write_pdu(pcap_pdu_t& pdu); void run_thread() final; diff --git a/lib/src/common/mac_pcap.cc b/lib/src/common/mac_pcap.cc index 8de3ab555..ca5581c99 100644 --- a/lib/src/common/mac_pcap.cc +++ b/lib/src/common/mac_pcap.cc @@ -26,17 +26,24 @@ mac_pcap::~mac_pcap() void mac_pcap::enable(bool enable_) { + std::lock_guard lock(mutex); running = enable_; } uint32_t mac_pcap::open(const char* filename, uint32_t ue_id_) { + std::lock_guard lock(mutex); if (pcap_file != nullptr) { log->error("PCAP writer already running. Close first.\n"); return SRSLTE_ERROR; } pcap_file = LTE_PCAP_Open(MAC_LTE_DLT, filename); + if (pcap_file == nullptr) { + log->error("Couldn't open file to write PCAP\n"); + return SRSLTE_ERROR; + } + ue_id = ue_id_; running = true; @@ -48,21 +55,27 @@ uint32_t mac_pcap::open(const char* filename, uint32_t ue_id_) uint32_t mac_pcap::close() { - if (running == false || pcap_file == nullptr) { - return SRSLTE_ERROR; - } + { + std::lock_guard lock(mutex); + if (running == false || pcap_file == nullptr) { + return SRSLTE_ERROR; + } - // tell writer thread to stop - running = false; - pcap_pdu_t pdu = {}; - queue.push(std::move(pdu)); + // tell writer thread to stop + running = false; + pcap_pdu_t pdu = {}; + queue.push(std::move(pdu)); + } wait_thread_finish(); // close file handle - srslte::console("Saving MAC PCAP file\n"); - LTE_PCAP_Close(pcap_file); - pcap_file = nullptr; + { + std::lock_guard lock(mutex); + srslte::console("Saving MAC PCAP file\n"); + LTE_PCAP_Close(pcap_file); + pcap_file = nullptr; + } return SRSLTE_SUCCESS; } @@ -79,11 +92,15 @@ void mac_pcap::run_thread() // blocking write until stopped while (running) { pcap_pdu_t pdu = queue.wait_pop(); - write_pdu(pdu); + { + std::lock_guard lock(mutex); + write_pdu(pdu); + } } // write remainder of queue - pcap_pdu_t pdu = {}; + std::lock_guard lock(mutex); + pcap_pdu_t pdu = {}; while (queue.try_pop(&pdu)) { write_pdu(pdu); } @@ -91,9 +108,11 @@ void mac_pcap::run_thread() void mac_pcap::set_ue_id(uint16_t ue_id_) { + std::lock_guard lock(mutex); ue_id = ue_id_; } +// Function called from PHY worker context, locking not needed as PDU queue is thread-safe void mac_pcap::pack_and_queue(uint8_t* payload, uint32_t payload_len, uint32_t reTX, From da0e64c51a1820c98c40a0fd13933e04591b4d22 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 11 Jan 2021 14:26:30 +0100 Subject: [PATCH 036/138] Add non_crit_ext for irat parameter --- srsue/src/stack/rrc/rrc.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 44a2d1875..a94ba86b0 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -1973,6 +1973,7 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) ue_eutra_cap_v1450_ies = &ue_eutra_cap_v1360_ies->non_crit_ext.non_crit_ext.non_crit_ext; // 14.60 ue_eutra_cap_v1450_ies->non_crit_ext_present = true; + ue_eutra_cap_v1450_ies->non_crit_ext.non_crit_ext_present = true; irat_params_nr_r15_s irat_params_nr_r15; irat_params_nr_r15.en_dc_r15_present = true; From bc8e65c82fbc8ddca87d314caf83e388973dc815 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 11 Jan 2021 18:54:59 +0000 Subject: [PATCH 037/138] bug fix in the PF scheduler. The correct history was not being stored for newtxs --- srsenb/hdr/stack/mac/sched_ue.h | 4 +-- srsenb/src/stack/mac/sched_ue.cc | 16 ++++++----- .../src/stack/mac/schedulers/sched_time_pf.cc | 28 ++++++++++++++----- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index f208a53c1..3e4be55e0 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -147,13 +147,13 @@ public: rbg_interval get_required_dl_rbgs(uint32_t ue_cc_idx); srslte::interval get_requested_dl_bytes(uint32_t ue_cc_idx); uint32_t get_pending_dl_rlc_data() const; - uint32_t get_expected_dl_bitrate(uint32_t ue_cc_idx) const; + uint32_t get_expected_dl_bitrate(uint32_t ue_cc_idx, int nof_rbgs = -1) const; uint32_t get_pending_ul_data_total(tti_point tti_tx_ul, int this_ue_cc_idx); uint32_t get_pending_ul_new_data(tti_point tti_tx_ul, int this_ue_cc_idx); uint32_t get_pending_ul_old_data(); uint32_t get_pending_ul_old_data(uint32_t cc_idx); - uint32_t get_expected_ul_bitrate(uint32_t ue_cc_idx) const; + uint32_t get_expected_ul_bitrate(uint32_t ue_cc_idx, int nof_prbs = -1) const; dl_harq_proc* get_pending_dl_harq(tti_point tti_tx_dl, uint32_t cc_idx); dl_harq_proc* get_empty_dl_harq(tti_point tti_tx_dl, uint32_t cc_idx); diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 0434d3cea..1f690db7d 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -1011,13 +1011,14 @@ uint32_t sched_ue::get_pending_dl_rlc_data() const return pending_data; } -uint32_t sched_ue::get_expected_dl_bitrate(uint32_t ue_cc_idx) const +uint32_t sched_ue::get_expected_dl_bitrate(uint32_t ue_cc_idx, int nof_rbgs) const { - const cc_sched_ue* cc = &carriers[ue_cc_idx]; + const cc_sched_ue* cc = &carriers[ue_cc_idx]; + auto* cell_cfg = carriers[ue_cc_idx].get_cell_cfg(); + uint32_t nof_prbs_alloc = nof_rbgs < 0 ? cell_cfg->nof_prb() : std::min(nof_rbgs * cell_cfg->P, cell_cfg->nof_prb()); - auto* cell_cfg = carriers[ue_cc_idx].get_cell_cfg(); uint32_t nof_re = - srslte_ra_dl_approx_nof_re(&cell_cfg->cfg.cell, cell_cfg->nof_prb(), cell_cfg->sched_cfg->max_nof_ctrl_symbols); + srslte_ra_dl_approx_nof_re(&cell_cfg->cfg.cell, nof_prbs_alloc, cell_cfg->sched_cfg->max_nof_ctrl_symbols); float max_coderate = srslte_cqi_to_coderate(std::min(cc->dl_cqi + 1u, 15u), cfg.use_tbs_index_alt); // Inverse of srslte_coderate(tbs, nof_re) @@ -1025,13 +1026,14 @@ uint32_t sched_ue::get_expected_dl_bitrate(uint32_t ue_cc_idx) const return tbs / tti_duration_ms; } -uint32_t sched_ue::get_expected_ul_bitrate(uint32_t ue_cc_idx) const +uint32_t sched_ue::get_expected_ul_bitrate(uint32_t ue_cc_idx, int nof_prbs) const { - const cc_sched_ue* cc = &carriers[ue_cc_idx]; + const cc_sched_ue* cc = &carriers[ue_cc_idx]; + uint32_t nof_prbs_alloc = nof_prbs < 0 ? cell.nof_prb : nof_prbs; uint32_t N_srs = 0; uint32_t nof_symb = 2 * (SRSLTE_CP_NSYMB(cell.cp) - 1) - N_srs; - uint32_t nof_re = nof_symb * cell.nof_prb * SRSLTE_NRE; + uint32_t nof_re = nof_symb * nof_prbs_alloc * SRSLTE_NRE; float max_coderate = srslte_cqi_to_coderate(std::min(cc->ul_cqi + 1u, 15u), false); // Inverse of srslte_coderate(tbs, nof_re) diff --git a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc index fdecedc0f..3bd539753 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc @@ -90,7 +90,7 @@ uint32_t sched_time_pf::try_dl_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* t // empty RBGs were found code = tti_sched->alloc_dl_user(&ue, newtx_mask, ue_ctxt.dl_newtx_h->get_id()); if (code == alloc_outcome_t::SUCCESS) { - return ue_ctxt.dl_newtx_h->get_tbs(0) + ue_ctxt.dl_newtx_h->get_tbs(1); + return ue.get_expected_dl_bitrate(ue_ctxt.ue_cc_idx, newtx_mask.count()) * tti_duration_ms / 8; } } } @@ -120,10 +120,21 @@ void sched_time_pf::sched_ul_users(std::map& ue_db, sf_sched uint32_t sched_time_pf::try_ul_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* tti_sched) { - alloc_outcome_t code = alloc_outcome_t::ERROR; - if (ue_ctxt.ul_h != nullptr and ue_ctxt.ul_h->has_pending_retx()) { - code = try_ul_retx_alloc(*tti_sched, ue, *ue_ctxt.ul_h); - } else if (ue_ctxt.ul_h != nullptr and not tti_sched->is_ul_alloc(ue_ctxt.rnti)) { + if (ue_ctxt.ul_h == nullptr) { + // In case the UL HARQ could not be allocated (e.g. meas gap occurrence) + return 0; + } + if (tti_sched->is_ul_alloc(ue_ctxt.rnti)) { + // NOTE: An UL grant could have been previously allocated for UCI + return ue_ctxt.ul_h->get_pending_data(); + } + + alloc_outcome_t code; + uint32_t estim_tbs_bytes = 0; + if (ue_ctxt.ul_h->has_pending_retx()) { + code = try_ul_retx_alloc(*tti_sched, ue, *ue_ctxt.ul_h); + estim_tbs_bytes = code == alloc_outcome_t::SUCCESS ? ue_ctxt.ul_h->get_pending_data() : 0; + } else { // Note: h->is_empty check is required, in case CA allocated a small UL grant for UCI uint32_t pending_data = ue.get_pending_ul_new_data(tti_sched->get_tti_tx_ul(), ue_ctxt.ue_cc_idx); // Check if there is a empty harq, and data to transmit @@ -135,12 +146,15 @@ uint32_t sched_time_pf::try_ul_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* t if (alloc.empty()) { return 0; } - code = tti_sched->alloc_ul_user(&ue, alloc); + code = tti_sched->alloc_ul_user(&ue, alloc); + estim_tbs_bytes = code == alloc_outcome_t::SUCCESS + ? ue.get_expected_ul_bitrate(ue_ctxt.ue_cc_idx, alloc.length()) * tti_duration_ms / 8 + : 0; } if (code == alloc_outcome_t::DCI_COLLISION) { log_h->info("SCHED: Couldn't find space in PDCCH for UL retx of rnti=0x%x\n", ue.get_rnti()); } - return code == alloc_outcome_t::SUCCESS ? ue_ctxt.ul_h->get_pending_data() : 0; + return estim_tbs_bytes; } /***************************************************************** From 9883dc21716476bb4f628f4134ac31d307530ac7 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 11 Jan 2021 21:18:00 +0000 Subject: [PATCH 038/138] remove warning when RAR fails to allocate in a given TTI due to lack of space --- srsenb/src/stack/mac/sched_grid.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsenb/src/stack/mac/sched_grid.cc b/srsenb/src/stack/mac/sched_grid.cc index f7e670db9..d636bd05f 100644 --- a/srsenb/src/stack/mac/sched_grid.cc +++ b/srsenb/src/stack/mac/sched_grid.cc @@ -741,7 +741,7 @@ std::pair sf_sched::alloc_rar(uint32_t aggr_lvl, cons break; } if (ret.first != alloc_outcome_t::SUCCESS) { - log_h->warning("SCHED: Failed to allocate RAR due to lack of RBs\n"); + log_h->info("SCHED: Failed to allocate RAR due to lack of RBs\n"); } return ret; } From a73cbcdc9d2c1ca32a1d596e55d82195d357f653 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 8 Jan 2021 14:59:32 +0000 Subject: [PATCH 039/138] added mem_pool for growing object pools. Applied the mem pool to the rrc::ue creation --- lib/include/srslte/adt/mem_pool.h | 163 ++++++++++++++++++++++++++++++ srsenb/hdr/stack/rrc/rrc.h | 9 +- srsenb/src/stack/rrc/rrc.cc | 3 +- srsenb/src/stack/rrc/rrc_ue.cc | 16 +-- 4 files changed, 179 insertions(+), 12 deletions(-) create mode 100644 lib/include/srslte/adt/mem_pool.h diff --git a/lib/include/srslte/adt/mem_pool.h b/lib/include/srslte/adt/mem_pool.h new file mode 100644 index 000000000..87066487e --- /dev/null +++ b/lib/include/srslte/adt/mem_pool.h @@ -0,0 +1,163 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_MEM_POOL_H +#define SRSLTE_MEM_POOL_H + +namespace srslte { + +/// Stores provided mem blocks in a stack in an non-owning manner. Not thread-safe +class memblock_stack +{ +public: + memblock_stack() = default; + + memblock_stack(const memblock_stack&) = delete; + + memblock_stack(memblock_stack&& other) noexcept : head(other.head) { other.head = nullptr; } + + memblock_stack& operator=(const memblock_stack&) = delete; + + memblock_stack& operator=(memblock_stack&& other) noexcept + { + head = other.head; + other.head = nullptr; + return *this; + } + + void push(uint8_t* block) noexcept + { + // printf("head: %ld\n", (long)head); + node* next = ::new (block) node(head); + head = next; + } + + uint8_t* try_pop() noexcept + { + if (is_empty()) { + return nullptr; + } + node* last_head = head; + head = head->prev; + return (uint8_t*)last_head; + } + + bool is_empty() const { return head == nullptr; } + + void clear() { head = nullptr; } + +private: + struct node { + node* prev; + + explicit node(node* prev_) : prev(prev_) {} + }; + + node* head = nullptr; +}; + +/// memblock stack that mutexes pushing/popping +class mutexed_memblock_stack +{ +public: + mutexed_memblock_stack() = default; + + mutexed_memblock_stack(const mutexed_memblock_stack&) = delete; + + mutexed_memblock_stack(mutexed_memblock_stack&& other) noexcept + { + std::unique_lock lk1(other.mutex, std::defer_lock); + std::unique_lock lk2(mutex, std::defer_lock); + std::lock(lk1, lk2); + stack = std::move(other.stack); + } + + mutexed_memblock_stack& operator=(const mutexed_memblock_stack&) = delete; + + mutexed_memblock_stack& operator=(mutexed_memblock_stack&& other) noexcept + { + std::unique_lock lk1(other.mutex, std::defer_lock); + std::unique_lock lk2(mutex, std::defer_lock); + std::lock(lk1, lk2); + stack = std::move(other.stack); + return *this; + } + + void push(uint8_t* block) noexcept + { + // auto t = time_prof(push_telapsed); + std::lock_guard lock(mutex); + stack.push(block); + } + + uint8_t* try_pop() noexcept + { + // auto t = time_prof(pop_telapsed); + std::lock_guard lock(mutex); + uint8_t* block = stack.try_pop(); + return block; + } + + bool is_empty() const noexcept { return stack.is_empty(); } + + void clear() + { + std::lock_guard lock(mutex); + stack.clear(); + } + +private: + memblock_stack stack; + std::mutex mutex; +}; + +template +class single_thread_obj_pool +{ +public: + /// single-thread obj pool deleter + struct obj_deleter { + explicit obj_deleter(single_thread_obj_pool* pool_) : pool(pool_) {} + void operator()(void* block) { pool->stack.push(static_cast(block)); } + single_thread_obj_pool* pool; + }; + + using obj_ptr = std::unique_ptr; + + /// allocate object + template + obj_ptr make(Args&&... args) + { + uint8_t* block = stack.try_pop(); + if (block == nullptr) { + block = new uint8_t[sizeof(T)]; + } + new (block) T(std::forward(args)...); + return obj_ptr(reinterpret_cast(block), obj_deleter(this)); + } + + void reserve(size_t N) + { + for (size_t i = 0; i < N; ++i) { + stack.push(new uint8_t[sizeof(T)]); + } + } + +private: + memblock_stack stack; +}; +template +using unique_pool_obj = typename single_thread_obj_pool::obj_ptr; + +} // namespace srslte + +#endif // SRSLTE_MEM_POOL_H diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index 5c71a10bf..ed68daf77 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -17,6 +17,7 @@ #include "rrc_cell_cfg.h" #include "rrc_metrics.h" #include "srsenb/hdr/stack/upper/common_enb.h" +#include "srslte/adt/mem_pool.h" #include "srslte/common/block_queue.h" #include "srslte/common/buffer_pool.h" #include "srslte/common/common.h" @@ -148,9 +149,9 @@ private: std::unique_ptr cell_common_list; // state - std::unique_ptr cell_res_list; - std::map > users; // NOTE: has to have fixed addr - std::map pending_paging; + std::unique_ptr cell_res_list; + std::map > users; // NOTE: has to have fixed addr + std::map pending_paging; void process_release_complete(uint16_t rnti); void rem_user(uint16_t rnti); @@ -190,6 +191,8 @@ private: void rem_user_thread(uint16_t rnti); std::mutex paging_mutex; + + srslte::single_thread_obj_pool ue_pool; }; } // namespace srsenb diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 94d3514c7..a7a69297b 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -31,6 +31,7 @@ namespace srsenb { rrc::rrc(srslte::task_sched_handle task_sched_) : rrc_log("RRC"), task_sched(task_sched_) { pending_paging.clear(); + ue_pool.reserve(10); } rrc::~rrc() {} @@ -150,7 +151,7 @@ void rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) bool rnti_added = true; if (rnti != SRSLTE_MRNTI) { // only non-eMBMS RNTIs are present in user map - auto p = users.insert(std::make_pair(rnti, std::unique_ptr(new ue{this, rnti, sched_ue_cfg}))); + auto p = users.insert(std::make_pair(rnti, ue_pool.make(this, rnti, sched_ue_cfg))); rnti_added = p.second and p.first->second->is_allocated(); } if (rnti_added) { diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index 1df46ea74..6ffaaf314 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -347,18 +347,18 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg) old_rnti); // Cancel Handover in Target eNB if on-going - parent->users[old_rnti]->mobility_handler->trigger(rrc_mobility::ho_cancel_ev{}); + parent->users.at(old_rnti)->mobility_handler->trigger(rrc_mobility::ho_cancel_ev{}); // Recover security setup const enb_cell_common* pcell_cfg = get_ue_cc_cfg(UE_PCELL_CC_IDX); - ue_security_cfg = parent->users[old_rnti]->ue_security_cfg; + ue_security_cfg = parent->users.at(old_rnti)->ue_security_cfg; ue_security_cfg.regenerate_keys_handover(pcell_cfg->cell_cfg.pci, pcell_cfg->cell_cfg.dl_earfcn); // send reestablishment and restore bearer configuration - send_connection_reest(parent->users[old_rnti]->ue_security_cfg.get_ncc()); + send_connection_reest(parent->users.at(old_rnti)->ue_security_cfg.get_ncc()); // Get PDCP entity state (required when using RLC AM) - for (const auto& erab_pair : parent->users[old_rnti]->bearer_list.get_erabs()) { + for (const auto& erab_pair : parent->users.at(old_rnti)->bearer_list.get_erabs()) { uint16_t lcid = erab_pair.second.id - 2; old_reest_pdcp_state[lcid] = {}; parent->pdcp->get_bearer_state(old_rnti, lcid, &old_reest_pdcp_state[lcid]); @@ -374,9 +374,9 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg) } // Make sure UE capabilities are copied over to new RNTI - eutra_capabilities = parent->users[old_rnti]->eutra_capabilities; - eutra_capabilities_unpacked = parent->users[old_rnti]->eutra_capabilities_unpacked; - ue_capabilities = parent->users[old_rnti]->ue_capabilities; + eutra_capabilities = parent->users.at(old_rnti)->eutra_capabilities; + eutra_capabilities_unpacked = parent->users.at(old_rnti)->eutra_capabilities_unpacked; + ue_capabilities = parent->users.at(old_rnti)->ue_capabilities; if (parent->rrc_log->get_level() == srslte::LOG_LEVEL_DEBUG) { asn1::json_writer js{}; eutra_capabilities.to_json(js); @@ -448,7 +448,7 @@ void rrc::ue::handle_rrc_con_reest_complete(rrc_conn_reest_complete_s* msg, srsl parent->pdcp->enable_encryption(rnti, RB_ID_SRB1); // Reestablish current DRBs during ConnectionReconfiguration - for (const auto& erab_pair : parent->users[old_reest_rnti]->bearer_list.get_erabs()) { + for (const auto& erab_pair : parent->users.at(old_reest_rnti)->bearer_list.get_erabs()) { const bearer_cfg_handler::erab_t& erab = erab_pair.second; bearer_list.add_erab(erab.id, erab.qos_params, erab.address, erab.teid_out, nullptr); } From 768a4fa627be72892a26ac800125c0c4e66ac0f2 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 8 Jan 2021 15:21:55 +0000 Subject: [PATCH 040/138] added growth policy for rrc::ue memory pool. Fixed memory leak --- lib/include/srslte/adt/mem_pool.h | 19 +++++++++++++++++-- srsenb/src/stack/rrc/rrc.cc | 7 +++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/include/srslte/adt/mem_pool.h b/lib/include/srslte/adt/mem_pool.h index 87066487e..d36acfe8c 100644 --- a/lib/include/srslte/adt/mem_pool.h +++ b/lib/include/srslte/adt/mem_pool.h @@ -39,6 +39,7 @@ public: // printf("head: %ld\n", (long)head); node* next = ::new (block) node(head); head = next; + count++; } uint8_t* try_pop() noexcept @@ -48,11 +49,14 @@ public: } node* last_head = head; head = head->prev; + count--; return (uint8_t*)last_head; } bool is_empty() const { return head == nullptr; } + size_t size() const { return count; } + void clear() { head = nullptr; } private: @@ -62,7 +66,8 @@ private: explicit node(node* prev_) : prev(prev_) {} }; - node* head = nullptr; + node* head = nullptr; + size_t count = 0; }; /// memblock stack that mutexes pushing/popping @@ -130,9 +135,17 @@ public: void operator()(void* block) { pool->stack.push(static_cast(block)); } single_thread_obj_pool* pool; }; - using obj_ptr = std::unique_ptr; + ~single_thread_obj_pool() + { + uint8_t* block = stack.try_pop(); + while (block != nullptr) { + delete[] block; + block = stack.try_pop(); + } + } + /// allocate object template obj_ptr make(Args&&... args) @@ -152,6 +165,8 @@ public: } } + size_t capacity() const { return stack.size(); } + private: memblock_stack stack; }; diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index a7a69297b..6715e0715 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -31,7 +31,7 @@ namespace srsenb { rrc::rrc(srslte::task_sched_handle task_sched_) : rrc_log("RRC"), task_sched(task_sched_) { pending_paging.clear(); - ue_pool.reserve(10); + ue_pool.reserve(16); } rrc::~rrc() {} @@ -151,7 +151,10 @@ void rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) bool rnti_added = true; if (rnti != SRSLTE_MRNTI) { // only non-eMBMS RNTIs are present in user map - auto p = users.insert(std::make_pair(rnti, ue_pool.make(this, rnti, sched_ue_cfg))); + auto p = users.insert(std::make_pair(rnti, ue_pool.make(this, rnti, sched_ue_cfg))); + if (ue_pool.capacity() <= 4) { + task_sched.defer_task([this]() { ue_pool.reserve(16); }); + } rnti_added = p.second and p.first->second->is_allocated(); } if (rnti_added) { From 8912a8ce6c58bbc49ad1bb323b692d9c7fbec981 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 8 Jan 2021 18:25:03 +0000 Subject: [PATCH 041/138] added extra comments to memory pool code. generalized object pool to mutexed and non-mutexed cases --- lib/include/srslte/adt/mem_pool.h | 50 +++++++++++++++++++++---------- srsenb/hdr/stack/rrc/rrc.h | 2 +- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/lib/include/srslte/adt/mem_pool.h b/lib/include/srslte/adt/mem_pool.h index d36acfe8c..c295e035d 100644 --- a/lib/include/srslte/adt/mem_pool.h +++ b/lib/include/srslte/adt/mem_pool.h @@ -99,14 +99,12 @@ public: void push(uint8_t* block) noexcept { - // auto t = time_prof(push_telapsed); std::lock_guard lock(mutex); stack.push(block); } uint8_t* try_pop() noexcept { - // auto t = time_prof(pop_telapsed); std::lock_guard lock(mutex); uint8_t* block = stack.try_pop(); return block; @@ -114,6 +112,12 @@ public: bool is_empty() const noexcept { return stack.is_empty(); } + size_t size() const noexcept + { + std::lock_guard lock(mutex); + return stack.size(); + } + void clear() { std::lock_guard lock(mutex); @@ -121,23 +125,37 @@ public: } private: - memblock_stack stack; - std::mutex mutex; + memblock_stack stack; + mutable std::mutex mutex; }; -template -class single_thread_obj_pool +/** + * Non thread-safe object pool. Memory management is automatically handled. Relevant methods: + * - ::make(...) - create an object whose memory is automatically managed by the pool. The object dtor returns the + * allocated memory back to the pool + * - ::reserve(N) - prereserve memory slots for faster object creation + * @tparam T object type + */ +template +class obj_pool { -public: /// single-thread obj pool deleter struct obj_deleter { - explicit obj_deleter(single_thread_obj_pool* pool_) : pool(pool_) {} - void operator()(void* block) { pool->stack.push(static_cast(block)); } - single_thread_obj_pool* pool; + explicit obj_deleter(obj_pool* pool_) : pool(pool_) {} + void operator()(void* block) { pool->stack.push(static_cast(block)); } + obj_pool* pool; }; + + // memory stack type derivation (thread safe or not) + using stack_type = typename std::conditional::type; + + // memory stack to cache allocate memory chunks + stack_type stack; + +public: using obj_ptr = std::unique_ptr; - ~single_thread_obj_pool() + ~obj_pool() { uint8_t* block = stack.try_pop(); while (block != nullptr) { @@ -146,7 +164,7 @@ public: } } - /// allocate object + /// create new object with given arguments. If no memory is pre-reserved in the pool, malloc is called. template obj_ptr make(Args&&... args) { @@ -158,6 +176,7 @@ public: return obj_ptr(reinterpret_cast(block), obj_deleter(this)); } + /// Pre-reserve N memory chunks for future object allocations void reserve(size_t N) { for (size_t i = 0; i < N; ++i) { @@ -166,12 +185,11 @@ public: } size_t capacity() const { return stack.size(); } - -private: - memblock_stack stack; }; template -using unique_pool_obj = typename single_thread_obj_pool::obj_ptr; +using unique_pool_obj = typename obj_pool::obj_ptr; +template +using unique_mutexed_pool_obj = typename obj_pool::obj_ptr; } // namespace srslte diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index ed68daf77..bb518a8dd 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -192,7 +192,7 @@ private: std::mutex paging_mutex; - srslte::single_thread_obj_pool ue_pool; + srslte::obj_pool ue_pool; }; } // namespace srsenb From e96b8c263a4ee30e157afc0c8c4709e5c2c76ad2 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Sun, 10 Jan 2021 16:40:56 +0000 Subject: [PATCH 042/138] add mem pool test. fix mem pool leak bug --- lib/include/srslte/adt/mem_pool.h | 35 +++++++++++----- lib/test/adt/CMakeLists.txt | 4 ++ lib/test/adt/mem_pool_test.cc | 69 +++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 10 deletions(-) create mode 100644 lib/test/adt/mem_pool_test.cc diff --git a/lib/include/srslte/adt/mem_pool.h b/lib/include/srslte/adt/mem_pool.h index c295e035d..965c2945c 100644 --- a/lib/include/srslte/adt/mem_pool.h +++ b/lib/include/srslte/adt/mem_pool.h @@ -13,12 +13,23 @@ #ifndef SRSLTE_MEM_POOL_H #define SRSLTE_MEM_POOL_H +#include +#include +#include + namespace srslte { /// Stores provided mem blocks in a stack in an non-owning manner. Not thread-safe class memblock_stack { + struct node { + node* prev; + explicit node(node* prev_) : prev(prev_) {} + }; + public: + const static size_t min_memblock_size = sizeof(node); + memblock_stack() = default; memblock_stack(const memblock_stack&) = delete; @@ -60,12 +71,6 @@ public: void clear() { head = nullptr; } private: - struct node { - node* prev; - - explicit node(node* prev_) : prev(prev_) {} - }; - node* head = nullptr; size_t count = 0; }; @@ -136,13 +141,20 @@ private: * - ::reserve(N) - prereserve memory slots for faster object creation * @tparam T object type */ -template +template class obj_pool { + const static size_t memblock_size = sizeof(T) > memblock_stack::min_memblock_size ? sizeof(T) + : memblock_stack::min_memblock_size; + /// single-thread obj pool deleter struct obj_deleter { explicit obj_deleter(obj_pool* pool_) : pool(pool_) {} - void operator()(void* block) { pool->stack.push(static_cast(block)); } + void operator()(void* block) + { + static_cast(block)->~T(); + pool->stack.push(static_cast(block)); + } obj_pool* pool; }; @@ -170,7 +182,7 @@ public: { uint8_t* block = stack.try_pop(); if (block == nullptr) { - block = new uint8_t[sizeof(T)]; + block = new uint8_t[memblock_size]; } new (block) T(std::forward(args)...); return obj_ptr(reinterpret_cast(block), obj_deleter(this)); @@ -180,12 +192,15 @@ public: void reserve(size_t N) { for (size_t i = 0; i < N; ++i) { - stack.push(new uint8_t[sizeof(T)]); + stack.push(new uint8_t[memblock_size]); } } size_t capacity() const { return stack.size(); } }; +template +using mutexed_pool_obj = obj_pool; + template using unique_pool_obj = typename obj_pool::obj_ptr; template diff --git a/lib/test/adt/CMakeLists.txt b/lib/test/adt/CMakeLists.txt index 8b4e27aaa..357572300 100644 --- a/lib/test/adt/CMakeLists.txt +++ b/lib/test/adt/CMakeLists.txt @@ -37,3 +37,7 @@ add_test(observer_test observer_test) add_executable(bounded_vector_test bounded_vector_test.cc) target_link_libraries(bounded_vector_test srslte_common) add_test(bounded_vector_test bounded_vector_test) + +add_executable(mem_pool_test mem_pool_test.cc) +target_link_libraries(mem_pool_test srslte_common) +add_test(mem_pool_test mem_pool_test) diff --git a/lib/test/adt/mem_pool_test.cc b/lib/test/adt/mem_pool_test.cc new file mode 100644 index 000000000..0f7a94e96 --- /dev/null +++ b/lib/test/adt/mem_pool_test.cc @@ -0,0 +1,69 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/adt/mem_pool.h" +#include "srslte/common/test_common.h" + +class C +{ +public: + C() { default_ctor_counter++; } + ~C() { dtor_counter++; } + + static int default_ctor_counter; + static int dtor_counter; +}; +int C::default_ctor_counter = 0; +int C::dtor_counter = 0; + +int test_nontrivial_obj_pool() +{ + // No object creation on reservation + { + srslte::obj_pool pool; + pool.reserve(10); + } + TESTASSERT(C::default_ctor_counter == 0); + TESTASSERT(C::dtor_counter == 0); + + // default Ctor/Dtor are correctly called + { + srslte::obj_pool pool; + pool.reserve(10); + + srslte::unique_pool_obj c = pool.make(); + } + TESTASSERT(C::default_ctor_counter == 1); + TESTASSERT(C::dtor_counter == 1); + + // move of unique_ptr is correctly called + C::default_ctor_counter = 0; + C::dtor_counter = 0; + { + srslte::obj_pool pool; + pool.reserve(10); + + srslte::unique_pool_obj c = pool.make(); + srslte::unique_pool_obj c2 = std::move(c); + } + TESTASSERT(C::default_ctor_counter == 1); + TESTASSERT(C::dtor_counter == 1); + + return SRSLTE_SUCCESS; +} + +int main() +{ + TESTASSERT(test_nontrivial_obj_pool() == SRSLTE_SUCCESS); + srslte::console("Success\n"); + return 0; +} \ No newline at end of file From ea74ca67eb3d13d84c0ea96876591dbaa78f3fba Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Sun, 10 Jan 2021 18:31:13 +0000 Subject: [PATCH 043/138] resolve forward declaration compilation issue in memory pool --- lib/include/srslte/adt/mem_pool.h | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/lib/include/srslte/adt/mem_pool.h b/lib/include/srslte/adt/mem_pool.h index 965c2945c..858606265 100644 --- a/lib/include/srslte/adt/mem_pool.h +++ b/lib/include/srslte/adt/mem_pool.h @@ -28,7 +28,7 @@ class memblock_stack }; public: - const static size_t min_memblock_size = sizeof(node); + constexpr static size_t min_memblock_size() { return sizeof(node); } memblock_stack() = default; @@ -135,18 +135,17 @@ private: }; /** - * Non thread-safe object pool. Memory management is automatically handled. Relevant methods: + * Pool specialized for big objects. Created objects are of same time, and are not contiguous in memory. + * Memory management of created objects is automatically handled. Relevant methods: * - ::make(...) - create an object whose memory is automatically managed by the pool. The object dtor returns the * allocated memory back to the pool * - ::reserve(N) - prereserve memory slots for faster object creation * @tparam T object type + * @tparam ThreadSafe if object pool is thread-safe or not */ template class obj_pool { - const static size_t memblock_size = sizeof(T) > memblock_stack::min_memblock_size ? sizeof(T) - : memblock_stack::min_memblock_size; - /// single-thread obj pool deleter struct obj_deleter { explicit obj_deleter(obj_pool* pool_) : pool(pool_) {} @@ -180,10 +179,7 @@ public: template obj_ptr make(Args&&... args) { - uint8_t* block = stack.try_pop(); - if (block == nullptr) { - block = new uint8_t[memblock_size]; - } + uint8_t* block = allocate_node(); new (block) T(std::forward(args)...); return obj_ptr(reinterpret_cast(block), obj_deleter(this)); } @@ -191,12 +187,24 @@ public: /// Pre-reserve N memory chunks for future object allocations void reserve(size_t N) { + static const size_t blocksize = std::max(sizeof(T), memblock_stack::min_memblock_size()); for (size_t i = 0; i < N; ++i) { - stack.push(new uint8_t[memblock_size]); + stack.push(new uint8_t[blocksize]); } } size_t capacity() const { return stack.size(); } + +private: + uint8_t* allocate_node() + { + static const size_t blocksize = std::max(sizeof(T), memblock_stack::min_memblock_size()); + uint8_t* block = stack.try_pop(); + if (block == nullptr) { + block = new uint8_t[blocksize]; + } + return block; + } }; template using mutexed_pool_obj = obj_pool; From f8b7351e1b1aeeea5955fb6f46f56ec73af2f479 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 11 Jan 2021 14:29:54 +0000 Subject: [PATCH 044/138] implementation of object memory pool via class-specific operator new/delete --- lib/include/srslte/adt/mem_pool.h | 68 ++++++++++++------------------- lib/test/adt/mem_pool_test.cc | 26 +++++++++--- srsenb/hdr/stack/rrc/rrc.h | 8 ++-- srsenb/hdr/stack/rrc/rrc_ue.h | 5 +++ srsenb/src/stack/rrc/rrc.cc | 7 +++- srsenb/src/stack/rrc/rrc_ue.cc | 11 +++++ 6 files changed, 70 insertions(+), 55 deletions(-) diff --git a/lib/include/srslte/adt/mem_pool.h b/lib/include/srslte/adt/mem_pool.h index 858606265..a73de0249 100644 --- a/lib/include/srslte/adt/mem_pool.h +++ b/lib/include/srslte/adt/mem_pool.h @@ -13,6 +13,7 @@ #ifndef SRSLTE_MEM_POOL_H #define SRSLTE_MEM_POOL_H +#include #include #include #include @@ -135,28 +136,17 @@ private: }; /** - * Pool specialized for big objects. Created objects are of same time, and are not contiguous in memory. - * Memory management of created objects is automatically handled. Relevant methods: - * - ::make(...) - create an object whose memory is automatically managed by the pool. The object dtor returns the - * allocated memory back to the pool + * Pool specialized for big objects. Created objects are not contiguous in memory. + * Relevant methods: + * - ::allocate_node(sz) - allocate memory of sizeof(T), or reuse memory already present in cache + * - ::deallocate_node(void* p) - return memory addressed by p back to the pool to be cached. * - ::reserve(N) - prereserve memory slots for faster object creation - * @tparam T object type + * @tparam ObjSize object memory size * @tparam ThreadSafe if object pool is thread-safe or not */ template -class obj_pool +class big_obj_pool { - /// single-thread obj pool deleter - struct obj_deleter { - explicit obj_deleter(obj_pool* pool_) : pool(pool_) {} - void operator()(void* block) - { - static_cast(block)->~T(); - pool->stack.push(static_cast(block)); - } - obj_pool* pool; - }; - // memory stack type derivation (thread safe or not) using stack_type = typename std::conditional::type; @@ -164,24 +154,25 @@ class obj_pool stack_type stack; public: - using obj_ptr = std::unique_ptr; + ~big_obj_pool() { clear(); } - ~obj_pool() + /// alloc new object space. If no memory is pre-reserved in the pool, malloc is called. + void* allocate_node(size_t sz) { - uint8_t* block = stack.try_pop(); - while (block != nullptr) { - delete[] block; - block = stack.try_pop(); + assert(sz == sizeof(T)); + static const size_t blocksize = std::max(sizeof(T), memblock_stack::min_memblock_size()); + uint8_t* block = stack.try_pop(); + if (block == nullptr) { + block = new uint8_t[blocksize]; } + return block; } - /// create new object with given arguments. If no memory is pre-reserved in the pool, malloc is called. - template - obj_ptr make(Args&&... args) + void deallocate_node(void* p) { - uint8_t* block = allocate_node(); - new (block) T(std::forward(args)...); - return obj_ptr(reinterpret_cast(block), obj_deleter(this)); + if (p != nullptr) { + stack.push(static_cast(p)); + } } /// Pre-reserve N memory chunks for future object allocations @@ -195,24 +186,15 @@ public: size_t capacity() const { return stack.size(); } -private: - uint8_t* allocate_node() + void clear() { - static const size_t blocksize = std::max(sizeof(T), memblock_stack::min_memblock_size()); - uint8_t* block = stack.try_pop(); - if (block == nullptr) { - block = new uint8_t[blocksize]; + uint8_t* block = stack.try_pop(); + while (block != nullptr) { + delete[] block; + block = stack.try_pop(); } - return block; } }; -template -using mutexed_pool_obj = obj_pool; - -template -using unique_pool_obj = typename obj_pool::obj_ptr; -template -using unique_mutexed_pool_obj = typename obj_pool::obj_ptr; } // namespace srslte diff --git a/lib/test/adt/mem_pool_test.cc b/lib/test/adt/mem_pool_test.cc index 0f7a94e96..63acd5fe4 100644 --- a/lib/test/adt/mem_pool_test.cc +++ b/lib/test/adt/mem_pool_test.cc @@ -19,17 +19,31 @@ public: C() { default_ctor_counter++; } ~C() { dtor_counter++; } + void* operator new(size_t sz); + void operator delete(void* ptr)noexcept; + static int default_ctor_counter; static int dtor_counter; }; int C::default_ctor_counter = 0; int C::dtor_counter = 0; +srslte::big_obj_pool pool; + +void* C::operator new(size_t sz) +{ + return pool.allocate_node(sz); +} + +void C::operator delete(void* ptr)noexcept +{ + pool.deallocate_node(ptr); +} + int test_nontrivial_obj_pool() { // No object creation on reservation { - srslte::obj_pool pool; pool.reserve(10); } TESTASSERT(C::default_ctor_counter == 0); @@ -37,10 +51,10 @@ int test_nontrivial_obj_pool() // default Ctor/Dtor are correctly called { - srslte::obj_pool pool; + pool.clear(); pool.reserve(10); - srslte::unique_pool_obj c = pool.make(); + std::unique_ptr c(new C{}); } TESTASSERT(C::default_ctor_counter == 1); TESTASSERT(C::dtor_counter == 1); @@ -49,11 +63,11 @@ int test_nontrivial_obj_pool() C::default_ctor_counter = 0; C::dtor_counter = 0; { - srslte::obj_pool pool; + pool.clear(); pool.reserve(10); - srslte::unique_pool_obj c = pool.make(); - srslte::unique_pool_obj c2 = std::move(c); + std::unique_ptr c(new C{}); + auto c2 = std::move(c); } TESTASSERT(C::default_ctor_counter == 1); TESTASSERT(C::dtor_counter == 1); diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index bb518a8dd..ffd65e5c2 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -149,9 +149,9 @@ private: std::unique_ptr cell_common_list; // state - std::unique_ptr cell_res_list; - std::map > users; // NOTE: has to have fixed addr - std::map pending_paging; + std::unique_ptr cell_res_list; + std::map > users; // NOTE: has to have fixed addr + std::map pending_paging; void process_release_complete(uint16_t rnti); void rem_user(uint16_t rnti); @@ -192,7 +192,7 @@ private: std::mutex paging_mutex; - srslte::obj_pool ue_pool; + static srslte::big_obj_pool ue_pool; }; } // namespace srsenb diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue.h index 4a20183d3..7092c22f6 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue.h @@ -94,6 +94,11 @@ public: bool is_csfb = false; + void* operator new(size_t sz); + void* operator new[](size_t sz) = delete; + void operator delete(void* ptr)noexcept; + void operator delete[](void* ptr) = delete; + private: // args srslte::byte_buffer_pool* pool = nullptr; diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 6715e0715..f597de0d3 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -151,9 +151,9 @@ void rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) bool rnti_added = true; if (rnti != SRSLTE_MRNTI) { // only non-eMBMS RNTIs are present in user map - auto p = users.insert(std::make_pair(rnti, ue_pool.make(this, rnti, sched_ue_cfg))); + auto p = users.insert(std::make_pair(rnti, std::unique_ptr{new ue(this, rnti, sched_ue_cfg)})); if (ue_pool.capacity() <= 4) { - task_sched.defer_task([this]() { ue_pool.reserve(16); }); + task_sched.defer_task([]() { rrc::ue_pool.reserve(16); }); } rnti_added = p.second and p.first->second->is_allocated(); } @@ -962,4 +962,7 @@ void rrc::tti_clock() } } +// definition of rrc static member +srslte::big_obj_pool rrc::ue_pool; + } // namespace srsenb diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index 6ffaaf314..80ca4defe 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -14,6 +14,7 @@ #include "srsenb/hdr/stack/rrc/mac_controller.h" #include "srsenb/hdr/stack/rrc/rrc_mobility.h" #include "srsenb/hdr/stack/rrc/ue_rr_cfg.h" +#include "srslte/adt/mem_pool.h" #include "srslte/asn1/rrc_utils.h" #include "srslte/common/enb_events.h" #include "srslte/common/int_helpers.h" @@ -56,6 +57,16 @@ rrc::ue::ue(rrc* outer_rrc, uint16_t rnti_, const sched_interface::ue_cfg_t& sch rrc::ue::~ue() {} +void* rrc::ue::operator new(size_t sz) +{ + assert(sz == sizeof(ue)); + return rrc::ue_pool.allocate_node(sz); +} +void rrc::ue::operator delete(void* ptr)noexcept +{ + rrc::ue_pool.deallocate_node(ptr); +} + rrc_state_t rrc::ue::get_state() { return state; From 2866886aded088b83a410962448e27f8563dfb41 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 11 Jan 2021 16:39:03 +0000 Subject: [PATCH 045/138] fix gcc4.8 compilation issue --- lib/include/srslte/adt/move_callback.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/include/srslte/adt/move_callback.h b/lib/include/srslte/adt/move_callback.h index 2ccc024e8..f7335af83 100644 --- a/lib/include/srslte/adt/move_callback.h +++ b/lib/include/srslte/adt/move_callback.h @@ -83,7 +83,7 @@ public: R call(void* src, Args&&... args) const final { return (*static_cast(src))(std::forward(args)...); } void move(void* src, void* dest) const final { - ::new (dest) FunT{std::move(*static_cast(src))}; + ::new (dest) FunT(std::move(*static_cast(src))); static_cast(src)->~FunT(); } void dtor(void* src) const final { static_cast(src)->~FunT(); } @@ -140,7 +140,7 @@ public: using FunT = typename std::decay::type; static const task_details::smallbuffer_table_t small_oper_table{}; oper_ptr = &small_oper_table; - ::new (&buffer) FunT{std::forward(function)}; + ::new (&buffer) FunT(std::forward(function)); } //! Called when T capture does not fit the move_callback buffer From 434bdfca6804c4fae19fc126420dcdacb8c01f98 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 11 Jan 2021 11:29:05 +0000 Subject: [PATCH 046/138] decoupled srsenb rrc ue mac controller from the rrc::ue class --- srsenb/hdr/stack/rrc/mac_controller.h | 26 ++++++-- srsenb/hdr/stack/rrc/rrc_ue.h | 5 +- srsenb/src/stack/rrc/mac_controller.cc | 91 ++++++++++++++------------ srsenb/src/stack/rrc/rrc_mobility.cc | 12 ++-- srsenb/src/stack/rrc/rrc_ue.cc | 20 +++--- 5 files changed, 88 insertions(+), 66 deletions(-) diff --git a/srsenb/hdr/stack/rrc/mac_controller.h b/srsenb/hdr/stack/rrc/mac_controller.h index 6d93572b8..32d29c0a1 100644 --- a/srsenb/hdr/stack/rrc/mac_controller.h +++ b/srsenb/hdr/stack/rrc/mac_controller.h @@ -13,17 +13,25 @@ #ifndef SRSLTE_MAC_CONTROLLER_H #define SRSLTE_MAC_CONTROLLER_H -#include "rrc_ue.h" +#include "rrc_bearer_cfg.h" +#include "rrc_cell_cfg.h" +#include "srslte/interfaces/sched_interface.h" #include namespace srsenb { -class rrc::ue::mac_controller +class mac_controller { using ue_cfg_t = sched_interface::ue_cfg_t; public: - mac_controller(rrc::ue* rrc_ue, const ue_cfg_t& sched_ue_cfg); + mac_controller(uint16_t rnti_, + const ue_cell_ded_list& ue_cell_list_, + const bearer_cfg_handler& bearer_list_, + const rrc_cfg_t& rrc_cfg_, + mac_interface_rrc* mac_, + const enb_cell_common_list& cell_common_list, + const ue_cfg_t& sched_ue_cfg); // Handling of Msg4 int handle_con_setup(const asn1::rrc::rrc_conn_setup_r8_ies_s& conn_setup); @@ -56,10 +64,14 @@ private: int apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s& rr_cfg); void apply_current_bearers_cfg(); - srslte::log_ref log_h; - rrc_cfg_t* rrc_cfg = nullptr; - rrc::ue* rrc_ue = nullptr; - mac_interface_rrc* mac = nullptr; + srslte::log_ref log_h; + uint16_t rnti; + const ue_cell_ded_list& ue_cell_list; + const bearer_cfg_handler& bearer_list; + const rrc_cfg_t* rrc_cfg = nullptr; + mac_interface_rrc* mac = nullptr; + const enb_cell_common_list& cell_common_list; + /// UE configuration currently present at the MAC, including any transient disabling of bearers/scells ue_cfg_t current_sched_ue_cfg = {}; /// UE configuration once the RRC config procedure (e.g. Reconfiguration) is complete diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue.h index 7092c22f6..305e6dcef 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue.h @@ -13,6 +13,7 @@ #ifndef SRSLTE_RRC_UE_H #define SRSLTE_RRC_UE_H +#include "mac_controller.h" #include "rrc.h" namespace srsenb { @@ -132,8 +133,8 @@ private: bearer_cfg_handler bearer_list; security_cfg_handler ue_security_cfg; - class mac_controller; - std::unique_ptr mac_ctrl; + // controllers + mac_controller mac_ctrl; ///< Helper to access a cell cfg based on ue_cc_idx enb_cell_common* get_ue_cc_cfg(uint32_t ue_cc_idx); diff --git a/srsenb/src/stack/rrc/mac_controller.cc b/srsenb/src/stack/rrc/mac_controller.cc index e64d9e462..8be69f358 100644 --- a/srsenb/src/stack/rrc/mac_controller.cc +++ b/srsenb/src/stack/rrc/mac_controller.cc @@ -11,8 +11,8 @@ */ #include "srsenb/hdr/stack/rrc/mac_controller.h" +#include "srsenb/hdr/stack/upper/common_enb.h" #include "srslte/asn1/rrc_utils.h" -#include "srslte/interfaces/sched_interface.h" namespace srsenb { @@ -75,11 +75,20 @@ void ue_cfg_apply_capabilities(ue_cfg_t& ue_cfg, const rrc_cfg_t& rrc_cfg, const * MAC Controller class **************************/ -rrc::ue::mac_controller::mac_controller(rrc::ue* rrc_ue_, const ue_cfg_t& sched_ue_cfg) : +mac_controller::mac_controller(uint16_t rnti_, + const ue_cell_ded_list& ue_cell_list_, + const bearer_cfg_handler& bearer_list_, + const rrc_cfg_t& rrc_cfg_, + mac_interface_rrc* mac_, + const enb_cell_common_list& cell_common_list_, + const ue_cfg_t& sched_ue_cfg) : log_h("RRC"), - rrc_ue(rrc_ue_), - rrc_cfg(&rrc_ue_->parent->cfg), - mac(rrc_ue_->parent->mac), + rnti(rnti_), + ue_cell_list(ue_cell_list_), + bearer_list(bearer_list_), + rrc_cfg(&rrc_cfg_), + mac(mac_), + cell_common_list(cell_common_list_), current_sched_ue_cfg(sched_ue_cfg) { if (current_sched_ue_cfg.supported_cc_list.empty() or not current_sched_ue_cfg.supported_cc_list[0].active) { @@ -90,28 +99,28 @@ rrc::ue::mac_controller::mac_controller(rrc::ue* rrc_ue_, const ue_cfg_t& sched_ } } -int rrc::ue::mac_controller::handle_con_setup(const asn1::rrc::rrc_conn_setup_r8_ies_s& conn_setup) +int mac_controller::handle_con_setup(const asn1::rrc::rrc_conn_setup_r8_ies_s& conn_setup) { return apply_basic_conn_cfg(conn_setup.rr_cfg_ded); } -int rrc::ue::mac_controller::handle_con_reest(const asn1::rrc::rrc_conn_reest_r8_ies_s& conn_reest) +int mac_controller::handle_con_reest(const asn1::rrc::rrc_conn_reest_r8_ies_s& conn_reest) { return apply_basic_conn_cfg(conn_reest.rr_cfg_ded); } //! Called when ConnectionSetup or Reestablishment is rejected (e.g. no MME connection) -void rrc::ue::mac_controller::handle_con_reject() +void mac_controller::handle_con_reject() { if (not crnti_set) { crnti_set = true; // Need to schedule ConRes CE for UE to see the Reject message - mac->ue_set_crnti(rrc_ue->rnti, rrc_ue->rnti, ¤t_sched_ue_cfg); + mac->ue_set_crnti(rnti, rnti, ¤t_sched_ue_cfg); } } /// Called in case of intra-eNB Handover to activate the new PCell for the reception of the RRC Reconf Complete message -int rrc::ue::mac_controller::handle_crnti_ce(uint32_t temp_crnti) +int mac_controller::handle_crnti_ce(uint32_t temp_crnti) { // Change PCell and add SCell configurations to MAC/Scheduler current_sched_ue_cfg = next_sched_ue_cfg; @@ -129,12 +138,12 @@ int rrc::ue::mac_controller::handle_crnti_ce(uint32_t temp_crnti) current_sched_ue_cfg.ue_bearers[i] = next_sched_ue_cfg.ue_bearers[i]; } - return mac->ue_set_crnti(temp_crnti, rrc_ue->rnti, ¤t_sched_ue_cfg); + return mac->ue_set_crnti(temp_crnti, rnti, ¤t_sched_ue_cfg); } -int rrc::ue::mac_controller::apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s& rr_cfg) +int mac_controller::apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s& rr_cfg) { - const auto* pcell = rrc_ue->ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX); + const auto* pcell = ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX); // Set static config params current_sched_ue_cfg.maxharq_tx = rrc_cfg->mac_cnfg.ul_sch_cfg.max_harq_tx.to_number(); @@ -173,32 +182,32 @@ int rrc::ue::mac_controller::apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s& // Configure MAC // In case of RRC Connection Setup/Reest message (Msg4), we need to resolve the contention by sending a ConRes CE - mac->phy_config_enabled(rrc_ue->rnti, false); + mac->phy_config_enabled(rnti, false); crnti_set = true; - return mac->ue_set_crnti(rrc_ue->rnti, rrc_ue->rnti, ¤t_sched_ue_cfg); + return mac->ue_set_crnti(rnti, rnti, ¤t_sched_ue_cfg); } -void rrc::ue::mac_controller::handle_con_setup_complete() +void mac_controller::handle_con_setup_complete() { // Acknowledge Dedicated Configuration - mac->phy_config_enabled(rrc_ue->rnti, true); + mac->phy_config_enabled(rnti, true); } -void rrc::ue::mac_controller::handle_con_reest_complete() +void mac_controller::handle_con_reest_complete() { // Acknowledge Dedicated Configuration - mac->phy_config_enabled(rrc_ue->rnti, true); + mac->phy_config_enabled(rnti, true); } -void rrc::ue::mac_controller::handle_con_reconf(const asn1::rrc::rrc_conn_recfg_r8_ies_s& conn_recfg, - const srslte::rrc_ue_capabilities_t& uecaps) +void mac_controller::handle_con_reconf(const asn1::rrc::rrc_conn_recfg_r8_ies_s& conn_recfg, + const srslte::rrc_ue_capabilities_t& uecaps) { ue_cfg_apply_conn_reconf(current_sched_ue_cfg, conn_recfg, *rrc_cfg); // Store MAC updates that are applied once RRCReconfigurationComplete is received next_sched_ue_cfg = current_sched_ue_cfg; ue_cfg_apply_capabilities(next_sched_ue_cfg, *rrc_cfg, uecaps); - ue_cfg_apply_reconf_complete_updates(next_sched_ue_cfg, conn_recfg, rrc_ue->ue_cell_list); + ue_cfg_apply_reconf_complete_updates(next_sched_ue_cfg, conn_recfg, ue_cell_list); // Temporarily freeze new allocations for DRBs (SRBs are needed to send RRC Reconf Message) set_drb_activation(false); @@ -207,7 +216,7 @@ void rrc::ue::mac_controller::handle_con_reconf(const asn1::rrc::rrc_conn_recfg_ update_mac(proc_stage_t::config_tx); } -void rrc::ue::mac_controller::handle_con_reconf_complete() +void mac_controller::handle_con_reconf_complete() { current_sched_ue_cfg = next_sched_ue_cfg; @@ -218,10 +227,10 @@ void rrc::ue::mac_controller::handle_con_reconf_complete() update_mac(proc_stage_t::config_complete); } -void rrc::ue::mac_controller::apply_current_bearers_cfg() +void mac_controller::apply_current_bearers_cfg() { // Configure DRBs - const drb_to_add_mod_list_l& drbs = rrc_ue->bearer_list.get_established_drbs(); + const drb_to_add_mod_list_l& drbs = bearer_list.get_established_drbs(); for (const drb_to_add_mod_s& drb : drbs) { auto& bcfg = current_sched_ue_cfg.ue_bearers[drb.lc_ch_id]; bcfg = {}; @@ -237,34 +246,34 @@ void rrc::ue::mac_controller::apply_current_bearers_cfg() } } -void rrc::ue::mac_controller::handle_target_enb_ho_cmd(const asn1::rrc::rrc_conn_recfg_r8_ies_s& conn_recfg, - const srslte::rrc_ue_capabilities_t& uecaps) +void mac_controller::handle_target_enb_ho_cmd(const asn1::rrc::rrc_conn_recfg_r8_ies_s& conn_recfg, + const srslte::rrc_ue_capabilities_t& uecaps) { ue_cfg_apply_conn_reconf(current_sched_ue_cfg, conn_recfg, *rrc_cfg); next_sched_ue_cfg = current_sched_ue_cfg; ue_cfg_apply_capabilities(next_sched_ue_cfg, *rrc_cfg, uecaps); - ue_cfg_apply_reconf_complete_updates(next_sched_ue_cfg, conn_recfg, rrc_ue->ue_cell_list); + ue_cfg_apply_reconf_complete_updates(next_sched_ue_cfg, conn_recfg, ue_cell_list); // Temporarily freeze new allocations for DRBs (SRBs are needed to send RRC Reconf Message) set_drb_activation(false); // Apply changes to MAC scheduler - mac->ue_cfg(rrc_ue->rnti, ¤t_sched_ue_cfg); - mac->phy_config_enabled(rrc_ue->rnti, false); + mac->ue_cfg(rnti, ¤t_sched_ue_cfg); + mac->phy_config_enabled(rnti, false); } -void rrc::ue::mac_controller::handle_intraenb_ho_cmd(const asn1::rrc::rrc_conn_recfg_r8_ies_s& conn_recfg, - const srslte::rrc_ue_capabilities_t& uecaps) +void mac_controller::handle_intraenb_ho_cmd(const asn1::rrc::rrc_conn_recfg_r8_ies_s& conn_recfg, + const srslte::rrc_ue_capabilities_t& uecaps) { next_sched_ue_cfg = current_sched_ue_cfg; next_sched_ue_cfg.supported_cc_list.resize(1); next_sched_ue_cfg.supported_cc_list[0].active = true; next_sched_ue_cfg.supported_cc_list[0].enb_cc_idx = - rrc_ue->parent->cell_common_list->get_pci(conn_recfg.mob_ctrl_info.target_pci)->enb_cc_idx; + cell_common_list.get_pci(conn_recfg.mob_ctrl_info.target_pci)->enb_cc_idx; ue_cfg_apply_conn_reconf(next_sched_ue_cfg, conn_recfg, *rrc_cfg); ue_cfg_apply_capabilities(next_sched_ue_cfg, *rrc_cfg, uecaps); - ue_cfg_apply_reconf_complete_updates(next_sched_ue_cfg, conn_recfg, rrc_ue->ue_cell_list); + ue_cfg_apply_reconf_complete_updates(next_sched_ue_cfg, conn_recfg, ue_cell_list); // Freeze SCells // NOTE: this avoids that the UE receives an HOCmd retx from target cell and do an incorrect RLC-level concatenation @@ -281,7 +290,7 @@ void rrc::ue::mac_controller::handle_intraenb_ho_cmd(const asn1::rrc::rrc_conn_r update_mac(mac_controller::config_tx); } -void rrc::ue::mac_controller::handle_ho_prep(const asn1::rrc::ho_prep_info_r8_ies_s& ho_prep) +void mac_controller::handle_ho_prep(const asn1::rrc::ho_prep_info_r8_ies_s& ho_prep) { // TODO: Apply configuration in ho_prep as a base if (ho_prep.as_cfg.source_rr_cfg.srb_to_add_mod_list_present) { @@ -289,28 +298,28 @@ void rrc::ue::mac_controller::handle_ho_prep(const asn1::rrc::ho_prep_info_r8_ie } } -void rrc::ue::mac_controller::set_scell_activation(const std::bitset& scell_mask) +void mac_controller::set_scell_activation(const std::bitset& scell_mask) { for (uint32_t i = 1; i < current_sched_ue_cfg.supported_cc_list.size(); ++i) { current_sched_ue_cfg.supported_cc_list[i].active = scell_mask[i]; } } -void rrc::ue::mac_controller::set_drb_activation(bool active) +void mac_controller::set_drb_activation(bool active) { - for (const drb_to_add_mod_s& drb : rrc_ue->bearer_list.get_established_drbs()) { + for (const drb_to_add_mod_s& drb : bearer_list.get_established_drbs()) { current_sched_ue_cfg.ue_bearers[drb.drb_id + rb_id_t::RB_ID_SRB2].direction = active ? sched_interface::ue_bearer_cfg_t::BOTH : sched_interface::ue_bearer_cfg_t::IDLE; } } -void rrc::ue::mac_controller::update_mac(proc_stage_t stage) +void mac_controller::update_mac(proc_stage_t stage) { // Apply changes to MAC scheduler - mac->ue_cfg(rrc_ue->rnti, ¤t_sched_ue_cfg); + mac->ue_cfg(rnti, ¤t_sched_ue_cfg); if (stage != proc_stage_t::other) { // Acknowledge Dedicated Configuration - mac->phy_config_enabled(rrc_ue->rnti, stage == proc_stage_t::config_complete); + mac->phy_config_enabled(rnti, stage == proc_stage_t::config_complete); } } diff --git a/srsenb/src/stack/rrc/rrc_mobility.cc b/srsenb/src/stack/rrc/rrc_mobility.cc index 24b84aeba..174ee6965 100644 --- a/srsenb/src/stack/rrc/rrc_mobility.cc +++ b/srsenb/src/stack/rrc/rrc_mobility.cc @@ -573,8 +573,8 @@ void rrc::ue::rrc_mobility::s1_source_ho_st::send_ho_cmd(wait_ho_req_ack_st& s, } // Disable DRBs - parent_fsm()->rrc_ue->mac_ctrl->set_drb_activation(false); - parent_fsm()->rrc_ue->mac_ctrl->update_mac(mac_controller::proc_stage_t::other); + parent_fsm()->rrc_ue->mac_ctrl.set_drb_activation(false); + parent_fsm()->rrc_ue->mac_ctrl.update_mac(mac_controller::proc_stage_t::other); /* Send HO Command to UE */ if (not parent_fsm()->rrc_ue->send_dl_dcch(&dl_dcch_msg)) { @@ -681,7 +681,7 @@ void rrc::ue::rrc_mobility::handle_ho_req(idle_st& s, const ho_req_rx_ev& ho_req rrc_ue->apply_pdcp_srb_updates(rrc_ue->current_ue_cfg.rr_cfg); rrc_ue->apply_rlc_rb_updates(rrc_ue->current_ue_cfg.rr_cfg); // Update MAC - rrc_ue->mac_ctrl->handle_target_enb_ho_cmd(recfg_r8, rrc_ue->ue_capabilities); + rrc_ue->mac_ctrl.handle_target_enb_ho_cmd(recfg_r8, rrc_ue->ue_capabilities); // Apply PHY updates rrc_ue->apply_reconf_phy_config(recfg_r8, true); @@ -763,7 +763,7 @@ bool rrc::ue::rrc_mobility::apply_ho_prep_cfg(const ho_prep_info_r8_ies_s& ho rrc_ue->current_ue_cfg.meas_cfg = ho_prep.as_cfg.source_meas_cfg; // Save source UE MAC configuration as a base - rrc_ue->mac_ctrl->handle_ho_prep(ho_prep); + rrc_ue->mac_ctrl.handle_ho_prep(ho_prep); return true; } @@ -861,7 +861,7 @@ void rrc::ue::rrc_mobility::intraenb_ho_st::enter(rrc_mobility* f, const ho_meas rrc_conn_recfg_r8_ies_s& reconf_r8 = dl_dcch_msg.msg.c1().rrc_conn_recfg().crit_exts.c1().rrc_conn_recfg_r8(); // Apply changes to the MAC scheduler - f->rrc_ue->mac_ctrl->handle_intraenb_ho_cmd(reconf_r8, f->rrc_ue->ue_capabilities); + f->rrc_ue->mac_ctrl.handle_intraenb_ho_cmd(reconf_r8, f->rrc_ue->ue_capabilities); f->rrc_ue->apply_setup_phy_common(f->rrc_enb->cfg.sibs[1].sib2().rr_cfg_common, false); f->rrc_ue->apply_reconf_phy_config(reconf_r8, false); @@ -885,7 +885,7 @@ void rrc::ue::rrc_mobility::handle_crnti_ce(intraenb_ho_st& s, const user_crnti_ rrc_enb->rlc->reestablish(rrc_ue->rnti); // Change PCell in MAC/Scheduler - rrc_ue->mac_ctrl->handle_crnti_ce(ev.temp_crnti); + rrc_ue->mac_ctrl.handle_crnti_ce(ev.temp_crnti); // finally apply new phy changes rrc_enb->phy->set_config(rrc_ue->rnti, rrc_ue->phy_rrc_dedicated_list); diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index 80ca4defe..a7af285cb 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -37,9 +37,9 @@ rrc::ue::ue(rrc* outer_rrc, uint16_t rnti_, const sched_interface::ue_cfg_t& sch phy_rrc_dedicated_list(sched_ue_cfg.supported_cc_list.size()), ue_cell_list(parent->cfg, *outer_rrc->cell_res_list, *outer_rrc->cell_common_list), bearer_list(rnti_, parent->cfg), - ue_security_cfg(parent->cfg) + ue_security_cfg(parent->cfg), + mac_ctrl(rnti, ue_cell_list, bearer_list, parent->cfg, parent->mac, *parent->cell_common_list, sched_ue_cfg) { - mac_ctrl.reset(new mac_controller{this, sched_ue_cfg}); // Allocate cell and PUCCH resources if (ue_cell_list.add_cell(sched_ue_cfg.supported_cc_list[0].enb_cc_idx) == nullptr) { @@ -277,7 +277,7 @@ void rrc::ue::send_connection_setup() fill_rr_cfg_ded_setup(rr_cfg, parent->cfg, ue_cell_list); // Apply ConnectionSetup Configuration to MAC scheduler - mac_ctrl->handle_con_setup(setup_r8); + mac_ctrl.handle_con_setup(setup_r8); // Add SRBs/DRBs, and configure RLC+PDCP apply_pdcp_srb_updates(setup_r8.rr_cfg_ded); @@ -307,7 +307,7 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsl memcpy(pdu->msg, msg_r8->ded_info_nas.data(), pdu->N_bytes); // Signal MAC scheduler that configuration was successful - mac_ctrl->handle_con_setup_complete(); + mac_ctrl.handle_con_setup_complete(); asn1::s1ap::rrc_establishment_cause_e s1ap_cause; s1ap_cause.value = (asn1::s1ap::rrc_establishment_cause_opts::options)establishment_cause.value; @@ -324,7 +324,7 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsl void rrc::ue::send_connection_reject() { - mac_ctrl->handle_con_reject(); + mac_ctrl.handle_con_reject(); dl_ccch_msg_s dl_ccch_msg; dl_ccch_msg.msg.set_c1().set_rrc_conn_reject().crit_exts.set_c1().set_rrc_conn_reject_r8().wait_time = 10; @@ -421,7 +421,7 @@ void rrc::ue::send_connection_reest(uint8_t ncc) reest_r8.next_hop_chaining_count = ncc; // Apply ConnectionReest Configuration to MAC scheduler - mac_ctrl->handle_con_reest(reest_r8); + mac_ctrl.handle_con_reest(reest_r8); // Add SRBs/DRBs, and configure RLC+PDCP apply_pdcp_srb_updates(rr_cfg); @@ -451,7 +451,7 @@ void rrc::ue::handle_rrc_con_reest_complete(rrc_conn_reest_complete_s* msg, srsl parent->s1ap->user_mod(old_reest_rnti, rnti); // Signal MAC scheduler that configuration was successful - mac_ctrl->handle_con_reest_complete(); + mac_ctrl.handle_con_reest_complete(); // Activate security for SRB1 parent->pdcp->config_security(rnti, RB_ID_SRB1, ue_security_cfg.get_as_sec_cfg()); @@ -473,7 +473,7 @@ void rrc::ue::handle_rrc_con_reest_complete(rrc_conn_reest_complete_s* msg, srsl void rrc::ue::send_connection_reest_rej() { - mac_ctrl->handle_con_reject(); + mac_ctrl.handle_con_reject(); dl_ccch_msg_s dl_ccch_msg; dl_ccch_msg.msg.set_c1().set_rrc_conn_reest_reject().crit_exts.set_rrc_conn_reest_reject_r8(); @@ -520,7 +520,7 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu, bool phy_ apply_rlc_rb_updates(recfg_r8.rr_cfg_ded); // UE MAC scheduler updates - mac_ctrl->handle_con_reconf(recfg_r8, ue_capabilities); + mac_ctrl.handle_con_reconf(recfg_r8, ue_capabilities); // Reuse same PDU if (pdu != nullptr) { @@ -546,7 +546,7 @@ void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srslte: } // Activate SCells and bearers in the MAC scheduler that were advertised in the RRC Reconf message - mac_ctrl->handle_con_reconf_complete(); + mac_ctrl.handle_con_reconf_complete(); // If performing handover, signal its completion mobility_handler->trigger(*msg); From bc2e230461b815d09256e2d9f1a70a79aea9f2b8 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 11 Jan 2021 16:35:41 +0100 Subject: [PATCH 047/138] Enable UM mode for Amarisoft --- srsue/src/stack/rrc/rrc_nr.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index e86418630..5fcb7ab59 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -254,6 +254,10 @@ void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps_pdu) band_nr.ue_pwr_class = band_nr_s::ue_pwr_class_opts::pc3; nr_cap.rf_params.supported_band_list_nr.push_back(band_nr); + nr_cap.rlc_params_present = true; + nr_cap.rlc_params.um_with_short_sn_present = true; + nr_cap.rlc_params.um_with_long_sn_present = true; + // Pack nr_caps asn1::bit_ref bref(nr_caps_pdu->msg, nr_caps_pdu->get_tailroom()); nr_cap.pack(bref); From a89477a805d0add38e1ce131f8160782e9a42d6a Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 11 Jan 2021 16:14:27 +0100 Subject: [PATCH 048/138] Hardcoded Samsung caps can be activated with if 1 in rrc_nr.cc --- srsue/src/stack/rrc/rrc_nr.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index 5fcb7ab59..faf2aa22f 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -233,6 +233,17 @@ void rrc_nr::get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps_pdu) asn1::bit_ref bref(eutra_nr_caps_pdu->msg, eutra_nr_caps_pdu->get_tailroom()); mrdc_cap.pack(bref); eutra_nr_caps_pdu->N_bytes = bref.distance_bytes(); + +#if 0 + uint8_t eutra_nr_cap_raw[] = {0x01, 0x1c, 0x04, 0x81, 0x60, 0x00, 0x1c, 0x4d, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x40, 0x04, 0x04, 0xd0, 0x10, 0x74, 0x06, 0x14, 0xe8, 0x1b, 0x10, + 0x78, 0x00, 0x00, 0x20, 0x00, 0x10, 0x08, 0x08, 0x01, 0x00, 0x20}; + if (sizeof(eutra_nr_cap_raw) <= 2048) { + memcpy(eutra_nr_caps_pdu->msg, eutra_nr_cap_raw, sizeof(eutra_nr_cap_raw)); + eutra_nr_caps_pdu->N_bytes = sizeof(eutra_nr_cap_raw); + } +#endif + log_h->debug_hex( eutra_nr_caps_pdu->msg, eutra_nr_caps_pdu->N_bytes, "EUTRA-NR capabilities (%u B)\n", eutra_nr_caps_pdu->N_bytes); @@ -262,6 +273,20 @@ void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps_pdu) asn1::bit_ref bref(nr_caps_pdu->msg, nr_caps_pdu->get_tailroom()); nr_cap.pack(bref); nr_caps_pdu->N_bytes = bref.distance_bytes(); + +#if 0 + uint8_t nr_cap_raw[] = { + 0xe1, 0x00, 0x00, 0x00, 0x01, 0x47, 0x7a, 0x03, 0x02, 0x00, 0x00, 0x01, 0x40, 0x48, 0x07, 0x06, 0x0e, 0x02, 0x0c, + 0x00, 0x02, 0x13, 0x60, 0x10, 0x73, 0xe4, 0x20, 0xf0, 0x00, 0x80, 0xc1, 0x30, 0x08, 0x0c, 0x00, 0x00, 0x0a, 0x05, + 0x89, 0xba, 0xc2, 0x19, 0x43, 0x40, 0x88, 0x10, 0x74, 0x18, 0x60, 0x4c, 0x04, 0x41, 0x6c, 0x90, 0x14, 0x06, 0x0c, + 0x78, 0xc7, 0x3e, 0x42, 0x0f, 0x00, 0x58, 0x0c, 0x0e, 0x0e, 0x02, 0x21, 0x3c, 0x84, 0xfc, 0x4d, 0xe0, 0x00, 0x12, + 0x00, 0x00, 0x00, 0x00, 0xe5, 0x4d, 0x00, 0x01, 0x00, 0x00, 0x04, 0x18, 0x60, 0x00, 0x34, 0xaa, 0x60}; + if (sizeof(nr_cap_raw) <= 2048) { + memcpy(nr_caps_pdu->msg, nr_cap_raw, sizeof(nr_cap_raw)); + nr_caps_pdu->N_bytes = sizeof(nr_cap_raw); + } +#endif + log_h->debug_hex(nr_caps_pdu->msg, nr_caps_pdu->N_bytes, "NR capabilities (%u B)\n", nr_caps_pdu->N_bytes); return; }; From 10da7df194e40ccba247228527247f19eb022bee Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 11 Jan 2021 10:37:26 +0100 Subject: [PATCH 049/138] pdu_test: add TC with malformed RAR PDU a malformed RAR PDU should not be decoded further if the payload indicates a length beyond the actual PDU size. --- lib/test/mac/pdu_test.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/test/mac/pdu_test.cc b/lib/test/mac/pdu_test.cc index f7f348363..501117eeb 100644 --- a/lib/test/mac/pdu_test.cc +++ b/lib/test/mac/pdu_test.cc @@ -53,6 +53,7 @@ int mac_rar_pdu_unpack_test1() std::cout << rar_pdu_msg.to_string() << std::endl; TESTASSERT(not rar_pdu_msg.has_backoff()); + TESTASSERT(rar_pdu_msg.nof_subh() == 1); while (rar_pdu_msg.next()) { TESTASSERT(rar_pdu_msg.get()->get_rapid() == RAPID_TV1); TESTASSERT(rar_pdu_msg.get()->get_ta_cmd() == TA_CMD_TV1); @@ -69,6 +70,7 @@ int mac_rar_pdu_unpack_test2() rar_pdu_msg.parse_packet(rar_pdu_tv2); std::cout << rar_pdu_msg.to_string() << std::endl; + TESTASSERT(rar_pdu_msg.nof_subh() == 2); TESTASSERT(rar_pdu_msg.has_backoff()); TESTASSERT(rar_pdu_msg.get_backoff() == BACKOFF_IND_TV2); while (rar_pdu_msg.next()) { @@ -82,6 +84,24 @@ int mac_rar_pdu_unpack_test2() return SRSLTE_SUCCESS; } +// Malformed RAR PDU with two RAPIDs but incomplete content +int mac_rar_pdu_unpack_test3() +{ + // The last byte of the malformed RAR PDU is byte 11 (0x1a), we need to add 3 more bytes to the array to please ASAN + // though + uint8_t rar_pdu[] = {0xd5, 0x4e, 0x02, 0x80, 0x1a, 0x0c, 0x00, 0x47, 0x00, 0x00, 0x1a, 0xff, 0xff, 0xff}; + uint8_t rar_pdu_len = 11; + + srslte::rar_pdu rar_pdu_msg; + rar_pdu_msg.init_rx(rar_pdu_len); // only pass the 11 valid bytes + TESTASSERT(rar_pdu_msg.parse_packet(rar_pdu) != SRSLTE_SUCCESS); + TESTASSERT(rar_pdu_msg.nof_subh() == 0); + + std::cout << rar_pdu_msg.to_string() << std::endl; + + return SRSLTE_SUCCESS; +} + int mac_rar_pdu_pack_test1() { // Prepare RAR grant @@ -1044,6 +1064,7 @@ int main(int argc, char** argv) TESTASSERT(mac_rar_pdu_unpack_test1() == SRSLTE_SUCCESS); TESTASSERT(mac_rar_pdu_unpack_test2() == SRSLTE_SUCCESS); + TESTASSERT(mac_rar_pdu_unpack_test3() == SRSLTE_SUCCESS); TESTASSERT(mac_rar_pdu_pack_test1() == SRSLTE_SUCCESS); TESTASSERT(mac_rar_pdu_pack_test2() == SRSLTE_SUCCESS); From fcf481b83e32ee6c18d7938f1c0bacdc106bd07d Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 11 Jan 2021 10:39:09 +0100 Subject: [PATCH 050/138] pdu: add check when unpacking MAC PDUs to not read beyond PDU length we've checked the same when unpacking the subheaders but missed the case where the payload was read beyond the PDU length, as has been seen with a malformed RAR PDU. --- lib/include/srslte/mac/pdu.h | 24 ++++++++++++++++++++---- lib/src/mac/pdu.cc | 11 ++++++----- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/lib/include/srslte/mac/pdu.h b/lib/include/srslte/mac/pdu.h index afcd94b56..e4d4d6800 100644 --- a/lib/include/srslte/mac/pdu.h +++ b/lib/include/srslte/mac/pdu.h @@ -218,7 +218,7 @@ public: void add_sdu(uint32_t sdu_sz) { buffer_tx->N_bytes += sdu_sz; } // Section 6.1.2 - void parse_packet(uint8_t* ptr) + uint32_t parse_packet(uint8_t* ptr) { uint8_t* init_ptr = ptr; nof_subheaders = 0; @@ -230,19 +230,35 @@ public: } if (ret && ((ptr - init_ptr) >= (int32_t)pdu_len)) { - // stop processing last subheader indicates another one but all bytes are consume + // stop processing last subheader indicates another one but all bytes are consumed nof_subheaders = 0; - INFO("Corrupted MAC PDU - all bytes have been consumed (pdu_len=%d)\n", pdu_len); if (log_h) { - log_h->info_hex( + log_h->warning_hex( init_ptr, pdu_len, "Corrupted MAC PDU - all bytes have been consumed (pdu_len=%d)\n", pdu_len); + } else { + srslte::console("Corrupted MAC PDU - all bytes have been consumed (pdu_len=%d)\n", pdu_len); } + return SRSLTE_ERROR; } } while (ret && (nof_subheaders + 1) < (int)max_subheaders && ((int32_t)pdu_len > (ptr - init_ptr))); for (int i = 0; i < nof_subheaders; i++) { subheaders[i].read_payload(&ptr); + + // stop processing if we read payload beyond the PDU length + if ((ptr - init_ptr) > (int32_t)pdu_len) { + nof_subheaders = 0; + + if (log_h) { + log_h->warning_hex( + init_ptr, pdu_len, "Corrupted MAC PDU - all bytes have been consumed (pdu_len=%d)\n", pdu_len); + } else { + srslte::console("Corrupted MAC PDU - all bytes have been consumed (pdu_len=%d)\n", pdu_len); + } + return SRSLTE_ERROR; + } } + return SRSLTE_SUCCESS; } protected: diff --git a/lib/src/mac/pdu.cc b/lib/src/mac/pdu.cc index 43d3fc3f5..df17a5b68 100644 --- a/lib/src/mac/pdu.cc +++ b/lib/src/mac/pdu.cc @@ -218,9 +218,10 @@ void sch_pdu::parse_packet(uint8_t* ptr) if (n_sub >= 0) { subheaders[nof_subheaders - 1].set_payload_size(n_sub); } else { - ERROR("Corrupted MAC PDU (read_len=%d, pdu_len=%d)\n", read_len, pdu_len); if (log_h) { - log_h->info_hex(ptr, pdu_len, "Corrupted MAC PDU (read_len=%d, pdu_len=%d)\n", read_len, pdu_len); + log_h->warning_hex(ptr, pdu_len, "Corrupted MAC PDU (read_len=%d, pdu_len=%d)\n", read_len, pdu_len); + } else { + srslte::console("Corrupted MAC PDU (read_len=%d, pdu_len=%d)\n", read_len, pdu_len); } // reset PDU @@ -1017,7 +1018,7 @@ uint8_t sch_subh::phr_report_table(float phr_value) std::string rar_pdu::to_string() { - std::string msg("MAC PDU for RAR. "); + std::string msg("MAC PDU for RAR: "); msg += pdu::to_string(); return msg; } @@ -1072,7 +1073,7 @@ bool rar_pdu::write_packet(uint8_t* ptr) int32_t pad_len = rem_len - payload_len; if (pad_len < 0) { if (log_h) { - log_h->error("Error packing RAR PDU (payload_len=%d, rem_len=%d)\n", payload_len, rem_len); + log_h->warning("Error packing RAR PDU (payload_len=%d, rem_len=%d)\n", payload_len, rem_len); } else { srslte::console("Error packing RAR PDU (payload_len=%d, rem_len=%d)\n", payload_len, rem_len); } @@ -1095,7 +1096,7 @@ std::string rar_subh::to_string() char tmp[16]; srslte_vec_sprint_hex(tmp, sizeof(tmp), grant, RAR_GRANT_LEN); - ss << tmp << "\n"; + ss << tmp; return ss.str(); } From dadff1a9472c03b8c0ae80921c574c7c04d1e593 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 12 Jan 2021 11:47:40 +0100 Subject: [PATCH 051/138] pdu: default initialize pdu members with MAC log MAC PDUs are default logged using the MAC log. So this gives hex prints, etc. without having to manually set the logger for each PDU. --- lib/include/srslte/mac/pdu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/include/srslte/mac/pdu.h b/lib/include/srslte/mac/pdu.h index e4d4d6800..6fe2d082e 100644 --- a/lib/include/srslte/mac/pdu.h +++ b/lib/include/srslte/mac/pdu.h @@ -456,7 +456,7 @@ private: class rar_pdu : public pdu { public: - rar_pdu(uint32_t max_rars = 16, srslte::log_ref log_ = {}); + rar_pdu(uint32_t max_rars = 16, srslte::log_ref log_ = srslte::logmap::get("MAC")); void set_backoff(uint8_t bi); bool has_backoff(); From 0761a8f08be06bc4c6ba2ff2bd0791b6027cdff1 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 11 Jan 2021 17:56:36 +0000 Subject: [PATCH 052/138] Add RLF-Report handling functions to srsENB --- srsenb/hdr/stack/rrc/rrc_ue.h | 4 +++ srsenb/src/stack/rrc/rrc_ue.cc | 53 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue.h index 305e6dcef..34f78b680 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue.h @@ -49,6 +49,8 @@ public: void send_connection_reconf(srslte::unique_byte_buffer_t sdu = {}, bool phy_cfg_updated = true); void send_security_mode_command(); void send_ue_cap_enquiry(); + void send_ue_info_req(); + void parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer_t pdu); void handle_rrc_con_req(asn1::rrc::rrc_conn_request_s* msg); @@ -61,6 +63,7 @@ public: bool handle_ue_cap_info(asn1::rrc::ue_cap_info_s* msg); void handle_ue_init_ctxt_setup_req(const asn1::s1ap::init_context_setup_request_s& msg); bool handle_ue_ctxt_mod_req(const asn1::s1ap::ue_context_mod_request_s& msg); + void handle_ue_info_resp(const asn1::rrc::ue_info_resp_r9_s& msg); void set_bitrates(const asn1::s1ap::ue_aggregate_maximum_bitrate_s& rates); @@ -121,6 +124,7 @@ private: rrc_state_t state = RRC_STATE_IDLE; uint16_t old_reest_rnti = SRSLTE_INVALID_RNTI; std::map old_reest_pdcp_state = {}; + bool rlf_info_pending = false; asn1::s1ap::ue_aggregate_maximum_bitrate_s bitrates; bool eutra_capabilities_unpacked = false; diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index a7af285cb..0ac96cdae 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -226,6 +226,9 @@ void rrc::ue::parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) parent->rrc_log->warning("Received MeasReport but no mobility configuration is available\n"); } break; + case ul_dcch_msg_type_c::c1_c_::types::ue_info_resp_r9: + handle_ue_info_resp(ul_dcch_msg.msg.c1().ue_info_resp_r9()); + break; default: parent->rrc_log->error("Msg: %s not supported\n", ul_dcch_msg.msg.c1().type().to_string().c_str()); break; @@ -320,6 +323,16 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsl // Log event. event_logger::get().log_rrc_connected(static_cast(s1ap_cause.value)); + + // 2> if the UE has radio link failure or handover failure information available + if (msg->crit_exts.type().value == c1_or_crit_ext_opts::c1 and + msg->crit_exts.c1().type().value == + rrc_conn_setup_complete_s::crit_exts_c_::c1_c_::types_opts::rrc_conn_setup_complete_r8) { + const auto& complete_r8 = msg->crit_exts.c1().rrc_conn_setup_complete_r8(); + if (complete_r8.non_crit_ext.non_crit_ext.rlf_info_available_r10_present) { + rlf_info_pending = true; + } + } } void rrc::ue::send_connection_reject() @@ -468,6 +481,15 @@ void rrc::ue::handle_rrc_con_reest_complete(rrc_conn_reest_complete_s* msg, srsl parent->rem_user_thread(old_reest_rnti); state = RRC_STATE_REESTABLISHMENT_COMPLETE; + + // 2> if the UE has radio link failure or handover failure information available + if (msg->crit_exts.type().value == rrc_conn_reest_complete_s::crit_exts_c_::types_opts::rrc_conn_reest_complete_r8) { + const auto& complete_r8 = msg->crit_exts.rrc_conn_reest_complete_r8(); + if (complete_r8.non_crit_ext.rlf_info_available_r9_present) { + rlf_info_pending = true; + } + } + send_connection_reconf(std::move(pdu)); } @@ -550,6 +572,37 @@ void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srslte: // If performing handover, signal its completion mobility_handler->trigger(*msg); + + // 2> if the UE has radio link failure or handover failure information available + const auto& complete_r8 = msg->crit_exts.rrc_conn_recfg_complete_r8(); + if (complete_r8.non_crit_ext.non_crit_ext.rlf_info_available_r10_present or rlf_info_pending) { + rlf_info_pending = false; + send_ue_info_req(); + } +} + +void rrc::ue::send_ue_info_req() +{ + dl_dcch_msg_s msg; + auto& req_r9 = msg.msg.set_c1().set_ue_info_request_r9(); + req_r9.rrc_transaction_id = (uint8_t)((transaction_id++) % 4); + + auto& req = req_r9.crit_exts.set_c1().set_ue_info_request_r9(); + req.rlf_report_req_r9 = true; + req.rach_report_req_r9 = true; + + send_dl_dcch(&msg); +} + +void rrc::ue::handle_ue_info_resp(const asn1::rrc::ue_info_resp_r9_s& msg) +{ + auto& resp_r9 = msg.crit_exts.c1().ue_info_resp_r9(); + if (resp_r9.rlf_report_r9_present) { + // TODO: Handle RLF-Report + } + if (resp_r9.rach_report_r9_present) { + // TODO: Handle RACH-Report + } } /* From a360580999f3355895aa8145169e8f17b6d61d47 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 12 Jan 2021 12:53:47 +0100 Subject: [PATCH 053/138] Run PRACH workers before cc_workers fixes memory corruption when PRACH workers run in foreground (eg in ZMQ) --- srsenb/src/phy/txrx.cc | 10 +++++----- srsue/src/stack/mac/proc_ra.cc | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/srsenb/src/phy/txrx.cc b/srsenb/src/phy/txrx.cc index 3e601a113..9dcff5ce3 100644 --- a/srsenb/src/phy/txrx.cc +++ b/srsenb/src/phy/txrx.cc @@ -183,6 +183,11 @@ void txrx::run_thread() lte_worker->set_time(tti, tx_worker_cnt, timestamp); tx_worker_cnt = (tx_worker_cnt + 1) % nof_workers; + // Trigger prach worker execution + for (uint32_t cc = 0; cc < worker_com->get_nof_carriers_lte(); cc++) { + prach->new_tti(cc, tti, buffer.get(worker_com->get_rf_port(cc), 0, worker_com->get_nof_ports(0))); + } + // Launch NR worker only if available if (nr_worker != nullptr) { nr_worker->set_tti(tti); @@ -194,11 +199,6 @@ void txrx::run_thread() worker_com->semaphore.push(lte_worker); lte_workers->start_worker(lte_worker); - // Trigger prach worker execution - for (uint32_t cc = 0; cc < worker_com->get_nof_carriers_lte(); cc++) { - prach->new_tti(cc, tti, buffer.get(worker_com->get_rf_port(cc), 0, worker_com->get_nof_ports(0))); - } - // Advance stack in time stack->tti_clock(); } diff --git a/srsue/src/stack/mac/proc_ra.cc b/srsue/src/stack/mac/proc_ra.cc index be9a5087c..630052fc7 100644 --- a/srsue/src/stack/mac/proc_ra.cc +++ b/srsue/src/stack/mac/proc_ra.cc @@ -161,7 +161,7 @@ void ra_proc::state_pdcch_setup() ra_tti = info.tti_ra; ra_rnti = 1 + (ra_tti % 10) + (10 * info.f_id); rInfo("seq=%d, ra-rnti=0x%x, ra-tti=%d, f_id=%d\n", sel_preamble, ra_rnti, info.tti_ra, info.f_id); - srslte::console("Random Access Transmission: seq=%d, ra-rnti=0x%x\n", sel_preamble, ra_rnti); + srslte::console("Random Access Transmission: seq=%d, tti=%d, ra-rnti=0x%x\n", sel_preamble, info.tti_ra, ra_rnti); rar_window_st = ra_tti + 3; rntis->rar_rnti = ra_rnti; state = RESPONSE_RECEPTION; From 68e7df1248566bd0cd671ad1b4bbe00d43174e5d Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Wed, 13 Jan 2021 15:09:06 +0000 Subject: [PATCH 054/138] allocate PUCCH resources in RRC UE only in case UE CA is activated --- srsenb/src/stack/rrc/rrc_cell_cfg.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/srsenb/src/stack/rrc/rrc_cell_cfg.cc b/srsenb/src/stack/rrc/rrc_cell_cfg.cc index be6b163e0..10f58b15e 100644 --- a/srsenb/src/stack/rrc/rrc_cell_cfg.cc +++ b/srsenb/src/stack/rrc/rrc_cell_cfg.cc @@ -137,8 +137,8 @@ cell_res_common* freq_res_common_list::get_earfcn(uint32_t earfcn) ************************/ ue_cell_ded_list::ue_cell_ded_list(const rrc_cfg_t& cfg_, - freq_res_common_list& cell_res_list_, - const enb_cell_common_list& enb_common_list) : + freq_res_common_list& cell_res_list_, + const enb_cell_common_list& enb_common_list) : cfg(cfg_), cell_res_list(cell_res_list_), common_list(enb_common_list) { cell_list.reserve(common_list.nof_cells()); @@ -223,18 +223,22 @@ bool ue_cell_ded_list::alloc_cell_resources(uint32_t ue_cc_idx) log_h->error("Failed to allocate SR resources for PCell\n"); return false; } - if (cfg.cell_list.size() == 2) { + + ue_cell_ded* cell = get_ue_cc_idx(UE_PCELL_CC_IDX); + cell->meas_gap_period = cell->cell_common->cell_cfg.meas_cfg.meas_gap_period; + cell->meas_gap_offset = pucch_res->next_measgap_offset; + pucch_res->next_measgap_offset += 6; + } else { + if (ue_cc_idx == 1 and not n_pucch_cs_present) { // Allocate resources for Format1b CS (will be optional PUCCH3/CS) if (not alloc_pucch_cs_resources()) { log_h->error("Error allocating PUCCH Format1b CS resource for SCell\n"); return false; } + } else { + // if nof CA cells > 1, the Format1b CS is not required + dealloc_pucch_cs_resources(); } - - ue_cell_ded* cell = get_ue_cc_idx(UE_PCELL_CC_IDX); - cell->meas_gap_period = cell->cell_common->cell_cfg.meas_cfg.meas_gap_period; - cell->meas_gap_offset = pucch_res->next_measgap_offset; - pucch_res->next_measgap_offset += 6; } if (not alloc_cqi_resources(ue_cc_idx, cfg.cqi_cfg.period)) { log_h->error("Failed to allocate CQIresources for cell ue_cc_idx=%d\n", ue_cc_idx); @@ -524,7 +528,6 @@ bool ue_cell_ded_list::alloc_pucch_cs_resources() const sib_type2_s& sib2 = cell->cell_common->sib2; const uint16_t N_pucch_1 = sib2.rr_cfg_common.pucch_cfg_common.n1_pucch_an; - const uint32_t max_cce = srslte_max_cce(cfg.cell.nof_prb); // Loop through all available resources for (uint32_t i = 0; i < cell_res_common::N_PUCCH_MAX_RES; i++) { if (!pucch_res->n_pucch_cs_used[i] && (i <= N_pucch_1 && i != sr_res.sr_N_pucch)) { From 0d9ff3ecc781f0bb58004120647f30345b36739f Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Wed, 13 Jan 2021 11:15:25 +0000 Subject: [PATCH 055/138] fixed RBG<->PRB conversion. Changed PHICH logging to be single line --- srsenb/hdr/stack/mac/sched_common.h | 3 +- srsenb/hdr/stack/mac/sched_helpers.h | 66 +++++++++++++++++++++++++++ srsenb/src/stack/mac/sched_carrier.cc | 1 + srsenb/src/stack/mac/sched_grid.cc | 8 +--- srsenb/src/stack/mac/sched_helpers.cc | 36 ++++++++++----- srsenb/src/stack/mac/sched_ue.cc | 32 +++---------- 6 files changed, 102 insertions(+), 44 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_common.h b/srsenb/hdr/stack/mac/sched_common.h index b1ba52f3d..6c520d920 100644 --- a/srsenb/hdr/stack/mac/sched_common.h +++ b/srsenb/hdr/stack/mac/sched_common.h @@ -74,7 +74,6 @@ using prbmask_t = srslte::bounded_bitset<100, true>; struct prb_interval; struct rbg_interval : public srslte::interval { using interval::interval; - static rbg_interval prbs_to_rbgs(const prb_interval& prbs, uint32_t P); static rbg_interval rbgmask_to_rbgs(const rbgmask_t& mask); }; @@ -82,7 +81,7 @@ struct rbg_interval : public srslte::interval { struct prb_interval : public srslte::interval { using interval::interval; - static prb_interval rbgs_to_prbs(const rbg_interval& rbgs, uint32_t P); + static prb_interval rbgs_to_prbs(const rbg_interval& rbgs, uint32_t cell_nof_prb); static prb_interval riv_to_prbs(uint32_t riv, uint32_t nof_prbs, int nof_vrbs = -1); }; diff --git a/srsenb/hdr/stack/mac/sched_helpers.h b/srsenb/hdr/stack/mac/sched_helpers.h index 930d7a66b..ead74858d 100644 --- a/srsenb/hdr/stack/mac/sched_helpers.h +++ b/srsenb/hdr/stack/mac/sched_helpers.h @@ -38,8 +38,74 @@ inline uint32_t get_nof_retx(uint32_t rv_idx) return nof_retxs[rv_idx % 4]; } +/// convert cell nof PRBs to nof RBGs +inline uint32_t cell_nof_prb_to_rbg(uint32_t nof_prbs) +{ + switch (nof_prbs) { + case 6: + return 6; + case 15: + return 8; + case 25: + return 13; + case 50: + return 17; + case 75: + return 19; + case 100: + return 25; + default: + srslte::logmap::get("MAC")->error("Provided nof PRBs not valid"); + return 0; + } +} + +/// convert cell nof RBGs to nof PRBs +inline uint32_t cell_nof_rbg_to_prb(uint32_t nof_rbgs) +{ + switch (nof_rbgs) { + case 6: + return 6; + case 8: + return 15; + case 13: + return 25; + case 17: + return 50; + case 19: + return 75; + case 25: + return 100; + default: + srslte::logmap::get("MAC")->error("Provided nof PRBs not valid"); + return 0; + } +} + +/** + * Count number of PRBs present in a DL RBG mask + * @param cell_nof_prb cell nof prbs + * @param P cell ratio prb/rbg + * @param bitmask DL RBG mask + * @return number of prbs + */ +inline uint32_t count_prb_per_tb(const rbgmask_t& bitmask) +{ + uint32_t Nprb = cell_nof_rbg_to_prb(bitmask.size()); + uint32_t P = srslte_ra_type0_P(Nprb); + uint32_t nof_prb = P * bitmask.count(); + if (bitmask.test(bitmask.size() - 1)) { + nof_prb -= bitmask.size() * P - Nprb; + } + return nof_prb; +} + +/// Logs DL MAC PDU contents void log_dl_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::dl_sched_res_t& result); +/// Logs PHICH contents +void log_phich_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::ul_sched_res_t& result); + /** * Generate possible CCE locations a user can use to allocate DCIs * @param regs Regs data for the given cell configuration diff --git a/srsenb/src/stack/mac/sched_carrier.cc b/srsenb/src/stack/mac/sched_carrier.cc index 2e1e5847b..6f93cd2cb 100644 --- a/srsenb/src/stack/mac/sched_carrier.cc +++ b/srsenb/src/stack/mac/sched_carrier.cc @@ -362,6 +362,7 @@ const cc_sched_result& sched::carrier_sched::generate_tti_result(tti_point tti_r } log_dl_cc_results(log_h, enb_cc_idx, cc_result->dl_sched_result); + log_phich_cc_results(log_h, enb_cc_idx, cc_result->ul_sched_result); return *cc_result; } diff --git a/srsenb/src/stack/mac/sched_grid.cc b/srsenb/src/stack/mac/sched_grid.cc index d636bd05f..37cebc110 100644 --- a/srsenb/src/stack/mac/sched_grid.cc +++ b/srsenb/src/stack/mac/sched_grid.cc @@ -903,10 +903,6 @@ bool sf_sched::alloc_phich(sched_ue* user, sched_interface::ul_sched_res_t* ul_s if (h->has_pending_phich()) { phich_list.phich = h->pop_pending_phich() ? phich_t::ACK : phich_t::NACK; phich_list.rnti = user->get_rnti(); - log_h->debug("SCHED: Allocated PHICH for rnti=0x%x, value=%s\n", - user->get_rnti(), - phich_list.phich == phich_t::ACK ? "ACK" : "NACK"); - ul_sf_result->nof_phich_elems++; return true; } @@ -923,7 +919,7 @@ void sf_sched::set_bc_sched_result(const pdcch_grid_t::alloc_result_t& dci_resul bc->dci.location = dci_result[bc_alloc.dci_idx]->dci_pos; /* Generate DCI format1A */ - prb_interval prb_range = prb_interval::rbgs_to_prbs(bc_alloc.rbg_range, cc_cfg->P); + prb_interval prb_range = prb_interval::rbgs_to_prbs(bc_alloc.rbg_range, cc_cfg->nof_prb()); int tbs = generate_format1a(prb_range, bc_alloc.req_bytes, bc_alloc.rv, bc_alloc.rnti, &bc->dci); // Setup BC/Paging processes @@ -990,7 +986,7 @@ void sf_sched::set_rar_sched_result(const pdcch_grid_t::alloc_result_t& dci_resu rar->dci.location = dci_result[rar_alloc.alloc_data.dci_idx]->dci_pos; /* Generate DCI format1A */ - prb_interval prb_range = prb_interval::rbgs_to_prbs(rar_alloc.alloc_data.rbg_range, cc_cfg->P); + prb_interval prb_range = prb_interval::rbgs_to_prbs(rar_alloc.alloc_data.rbg_range, cc_cfg->nof_prb()); int tbs = generate_format1a(prb_range, rar_alloc.alloc_data.req_bytes, 0, rar_alloc.alloc_data.rnti, &rar->dci); if (tbs <= 0) { log_h->warning("SCHED: Error RAR, ra_rnti_idx=%d, rbgs=%s, dci=(%d,%d)\n", diff --git a/srsenb/src/stack/mac/sched_helpers.cc b/srsenb/src/stack/mac/sched_helpers.cc index a48851cab..54bbd89db 100644 --- a/srsenb/src/stack/mac/sched_helpers.cc +++ b/srsenb/src/stack/mac/sched_helpers.cc @@ -59,14 +59,14 @@ void fill_dl_cc_result_info(custom_mem_buffer& strbuf, const dl_sched_data_t& da return; } const char* prefix = strbuf.size() > 0 ? " | " : ""; - fmt::format_to(strbuf, "{}rnti={:0x}: [", prefix, data.dci.rnti); + fmt::format_to(strbuf, "{}rnti=0x{:0x}: [", prefix, data.dci.rnti); bool ces_found = false; for (uint32_t i = 0; i < data.nof_pdu_elems[0]; ++i) { const auto& pdu = data.pdu[0][i]; prefix = (ces_found) ? " | " : ""; srslte::dl_sch_lcid lcid = static_cast(pdu.lcid); if (srslte::is_mac_ce(lcid)) { - fmt::format_to(strbuf, "{}MAC CE \"{}\"", prefix, srslte::to_string_short(lcid)); + fmt::format_to(strbuf, "{}CE \"{}\"", prefix, srslte::to_string_short(lcid)); ces_found = true; } } @@ -79,7 +79,7 @@ void fill_dl_cc_result_debug(custom_mem_buffer& strbuf, const dl_sched_data_t& d return; } fmt::format_to(strbuf, - " > rnti={:0x}, tbs={}, f={}, mcs={}: [", + " > rnti=0x{:0x}, tbs={}, f={}, mcs={}: [", data.dci.rnti, data.tbs[0], to_string_short(data.dci.format), @@ -90,9 +90,9 @@ void fill_dl_cc_result_debug(custom_mem_buffer& strbuf, const dl_sched_data_t& d const char* prefix = (i == 0) ? "" : " | "; srslte::dl_sch_lcid lcid = static_cast(pdu.lcid); if (srslte::is_mac_ce(lcid)) { - fmt::format_to(strbuf, "{}MAC CE \"{}\"", prefix, srslte::to_string_short(lcid)); + fmt::format_to(strbuf, "{}CE \"{}\"", prefix, srslte::to_string_short(lcid)); } else { - fmt::format_to(strbuf, "{}MAC SDU lcid={}, tb={}, len={} B", prefix, pdu.lcid, tb, pdu.nbytes); + fmt::format_to(strbuf, "{}SDU lcid={}, tb={}, len={} B", prefix, pdu.lcid, tb, pdu.nbytes); } } } @@ -115,21 +115,35 @@ void log_dl_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_i } if (strbuf.size() != 0) { if (log_h->get_level() == srslte::LOG_LEVEL_DEBUG) { - log_h->debug("SCHED: MAC LCID allocs cc=%d:\n%s", enb_cc_idx, fmt::to_string(strbuf).c_str()); + log_h->debug("SCHED: DL MAC PDU payload cc=%d:\n%s", enb_cc_idx, fmt::to_string(strbuf).c_str()); } else { - log_h->info("SCHED: MAC CE allocs cc=%d: %s", enb_cc_idx, fmt::to_string(strbuf).c_str()); + log_h->info("SCHED: DL MAC CEs cc=%d: %s", enb_cc_idx, fmt::to_string(strbuf).c_str()); } } } -rbg_interval rbg_interval::prbs_to_rbgs(const prb_interval& prbs, uint32_t P) +void log_phich_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::ul_sched_res_t& result) { - return rbg_interval{srslte::ceil_div(prbs.start(), P), srslte::ceil_div(prbs.stop(), P)}; + using phich_t = sched_interface::ul_sched_phich_t; + if (log_h->get_level() < srslte::LOG_LEVEL_INFO) { + return; + } + custom_mem_buffer strbuf; + for (uint32_t i = 0; i < result.nof_phich_elems; ++i) { + const phich_t& phich = result.phich[i]; + const char* prefix = strbuf.size() > 0 ? " | " : ""; + const char* val = phich.phich == phich_t::ACK ? "ACK" : "NACK"; + fmt::format_to(strbuf, "{}rnti=0x{:0x}, val={}", prefix, phich.rnti, val); + } + if (strbuf.size() != 0) { + log_h->debug("SCHED: Allocated PHICHs, cc=%d: [%s]", enb_cc_idx, fmt::to_string(strbuf).c_str()); + } } -prb_interval prb_interval::rbgs_to_prbs(const rbg_interval& rbgs, uint32_t P) +prb_interval prb_interval::rbgs_to_prbs(const rbg_interval& rbgs, uint32_t cell_nof_prb) { - return prb_interval{rbgs.start() * P, rbgs.stop() * P}; + uint32_t P = srslte_ra_type0_P(cell_nof_prb); + return prb_interval{rbgs.start() * P, std::min(rbgs.stop() * P, cell_nof_prb)}; } rbg_interval rbg_interval::rbgmask_to_rbgs(const rbgmask_t& mask) diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 1f690db7d..6c559335b 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -48,22 +48,6 @@ uint32_t get_tbs_bytes(uint32_t mcs, uint32_t nof_alloc_prb, bool use_tbs_index_ return (uint32_t)tbs / 8U; } -/** - * Count number of PRBs present in a DL RBG mask - * @param bitmask DL RBG mask - * @return number of prbs - */ -uint32_t count_prb_per_tb(const sched_cell_params_t& cell_params, const rbgmask_t& bitmask) -{ - uint32_t nof_prb = 0; - for (uint32_t i = 0; i < bitmask.size(); i++) { - if (bitmask.test(i)) { - nof_prb += std::min(cell_params.cfg.cell.nof_prb - (i * cell_params.P), cell_params.P); - } - } - return nof_prb; -} - } // namespace sched_utils bool operator==(const sched_interface::ue_cfg_t::cc_cfg_t& lhs, const sched_interface::ue_cfg_t::cc_cfg_t& rhs) @@ -505,7 +489,7 @@ std::pair sched_ue::allocate_new_dl_mac_pdu(sched::dl_sched_data_t* da uint32_t tb) { srslte_dci_dl_t* dci = &data->dci; - uint32_t nof_prb = sched_utils::count_prb_per_tb(*carriers[ue_cc_idx].get_cell_cfg(), user_mask); + uint32_t nof_prb = count_prb_per_tb(user_mask); auto ret = compute_mcs_and_tbs(ue_cc_idx, tti_tx_dl, nof_prb, cfi, *dci); int mcs = ret.first; int tbs = ret.second; @@ -572,14 +556,12 @@ int sched_ue::generate_format1(uint32_t pid, dci->alloc_type = SRSLTE_RA_ALLOC_TYPE2; dci->type2_alloc.mode = srslte_ra_type2_t::SRSLTE_RA_TYPE2_LOC; rbg_interval rbg_int = rbg_interval::rbgmask_to_rbgs(user_mask); - uint32_t P = srslte_ra_type0_P(15); - prb_interval prb_int = prb_interval::rbgs_to_prbs(rbg_int, P); - uint32_t L_crb = - SRSLTE_MIN(sched_utils::count_prb_per_tb(*carriers[ue_cc_idx].get_cell_cfg(), user_mask), cell.nof_prb); - uint32_t RB_start = prb_int.start(); - dci->type2_alloc.riv = srslte_ra_type2_to_riv(L_crb, RB_start, cell.nof_prb); - dci->format = SRSLTE_DCI_FORMAT1A; - if (prb_int.length() != P * user_mask.count()) { + prb_interval prb_int = prb_interval::rbgs_to_prbs(rbg_int, cell.nof_prb); + uint32_t L_crb = prb_int.length(); + uint32_t RB_start = prb_int.start(); + dci->type2_alloc.riv = srslte_ra_type2_to_riv(L_crb, RB_start, cell.nof_prb); + dci->format = SRSLTE_DCI_FORMAT1A; + if (L_crb != cell_nof_rbg_to_prb(user_mask.size())) { // This happens if Type0 was using distributed allocation Warning("SCHED: Can't use distributed RA due to DCI size ambiguity\n"); } From eb515c5205793c1f431ef3209a249530107514f4 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 13 Jan 2021 11:39:28 +0100 Subject: [PATCH 056/138] enb,mac: check return value when packing RAR PDU this make sure that we only send valid MAC PDUs in the DL. --- srsenb/src/stack/mac/mac.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 163cd4f17..eebe7c2d7 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -838,12 +838,17 @@ uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, pdu->get()->set_sched_grant(grant_buffer); } } - pdu->write_packet(rar_payload[rar_idx].msg); - return rar_payload[rar_idx].msg; - } else { - Error("Assembling RAR: rar_idx=%d, pdu_len > rar_payload_len (%d>%d)\n", rar_idx, pdu_len, rar_payload_len); - return nullptr; + if (pdu->write_packet(rar_payload[rar_idx].msg)) { + return rar_payload[rar_idx].msg; + } } + + Error("Assembling RAR: rar_idx=%d, pdu_len=%d, rar_payload_len=%d, nof_grants=%d\n", + rar_idx, + pdu_len, + rar_payload_len, + nof_grants); + return nullptr; } int mac::get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res_list) From 9c7c1900742dd8e1977be02fbc35a97fa9d6c7b8 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Wed, 13 Jan 2021 17:51:47 +0000 Subject: [PATCH 057/138] when the rrc fails to allocate the ue cell resources, it should erase the ue from all stack layers --- .../srslte/interfaces/enb_interfaces.h | 2 +- srsenb/hdr/stack/rrc/rrc.h | 2 +- srsenb/hdr/stack/rrc/rrc_ue.h | 1 + srsenb/src/stack/mac/mac.cc | 6 ++++- srsenb/src/stack/rrc/rrc.cc | 23 +++++++++---------- srsenb/src/stack/rrc/rrc_ue.cc | 15 +++++++----- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index 5f32ed787..b7945afb2 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -400,7 +400,7 @@ class rrc_interface_mac { public: /* Radio Link failure */ - virtual void add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) = 0; + virtual int add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) = 0; virtual void upd_user(uint16_t new_rnti, uint16_t old_rnti) = 0; virtual void set_activity_user(uint16_t rnti) = 0; virtual bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) = 0; diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index ffd65e5c2..6aa21fc1b 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -61,7 +61,7 @@ public: void tti_clock(); // rrc_interface_mac - void add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) override; + int add_user(uint16_t rnti, const sched_interface::ue_cfg_t& init_ue_cfg) override; void upd_user(uint16_t new_rnti, uint16_t old_rnti) override; void set_activity_user(uint16_t rnti) override; bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) override; diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue.h index 34f78b680..34591fd8b 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue.h @@ -25,6 +25,7 @@ public: ue(rrc* outer_rrc, uint16_t rnti, const sched_interface::ue_cfg_t& ue_cfg); ~ue(); + int init(); bool is_connected(); bool is_idle(); diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index eebe7c2d7..84d527614 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -525,11 +525,15 @@ void mac::rach_detected(uint32_t tti, uint32_t enb_cc_idx, uint32_t preamble_idx ue_cfg.supported_cc_list[0].dl_cfg.tm = SRSLTE_TM1; if (scheduler.ue_cfg(rnti, ue_cfg) != SRSLTE_SUCCESS) { Error("Registering new user rnti=0x%x to SCHED\n", rnti); + ue_rem(rnti); return; } // Register new user in RRC - rrc_h->add_user(rnti, ue_cfg); + if (rrc_h->add_user(rnti, ue_cfg) == SRSLTE_ERROR) { + ue_rem(rnti); + return; + } // Trigger scheduler RACH scheduler.dl_rach_info(enb_cc_idx, rar_info); diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index f597de0d3..4d8c183cb 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -144,27 +144,25 @@ uint32_t rrc::get_nof_users() void rrc::max_retx_attempted(uint16_t rnti) {} // This function is called from PRACH worker (can wait) -void rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) +int rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) { auto user_it = users.find(rnti); if (user_it == users.end()) { - bool rnti_added = true; if (rnti != SRSLTE_MRNTI) { // only non-eMBMS RNTIs are present in user map - auto p = users.insert(std::make_pair(rnti, std::unique_ptr{new ue(this, rnti, sched_ue_cfg)})); + std::unique_ptr u{new ue(this, rnti, sched_ue_cfg)}; + if (not u->init()) { + rrc_log->error("Adding user rnti=0x%x - Failed to allocate user resources\n", rnti); + return SRSLTE_ERROR; + } if (ue_pool.capacity() <= 4) { task_sched.defer_task([]() { rrc::ue_pool.reserve(16); }); } - rnti_added = p.second and p.first->second->is_allocated(); - } - if (rnti_added) { - rlc->add_user(rnti); - pdcp->add_user(rnti); - rrc_log->info("Added new user rnti=0x%x\n", rnti); - } else { - mac->bearer_ue_rem(rnti, 0); - rrc_log->error("Adding user rnti=0x%x - Failed to allocate user resources\n", rnti); + users.insert(std::make_pair(rnti, std::move(u))); } + rlc->add_user(rnti); + pdcp->add_user(rnti); + rrc_log->info("Added new user rnti=0x%x\n", rnti); } else { rrc_log->error("Adding user rnti=0x%x (already exists)\n", rnti); } @@ -181,6 +179,7 @@ void rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) teid_in = gtpu->add_bearer(SRSLTE_MRNTI, lcid, 1, 1); } } + return SRSLTE_SUCCESS; } /* Function called by MAC after the reception of a C-RNTI CE indicating that the UE still has a diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index 0ac96cdae..1d1de8995 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -39,24 +39,27 @@ rrc::ue::ue(rrc* outer_rrc, uint16_t rnti_, const sched_interface::ue_cfg_t& sch bearer_list(rnti_, parent->cfg), ue_security_cfg(parent->cfg), mac_ctrl(rnti, ue_cell_list, bearer_list, parent->cfg, parent->mac, *parent->cell_common_list, sched_ue_cfg) -{ +{} + +rrc::ue::~ue() {} +int rrc::ue::init() +{ // Allocate cell and PUCCH resources - if (ue_cell_list.add_cell(sched_ue_cfg.supported_cc_list[0].enb_cc_idx) == nullptr) { - return; + if (ue_cell_list.add_cell(mac_ctrl.get_ue_sched_cfg().supported_cc_list[0].enb_cc_idx) == nullptr) { + return SRSLTE_ERROR; } // Configure apply_setup_phy_common(parent->cfg.sibs[1].sib2().rr_cfg_common, true); - activity_timer = outer_rrc->task_sched.get_unique_timer(); + activity_timer = parent->task_sched.get_unique_timer(); set_activity_timeout(MSG3_RX_TIMEOUT); // next UE response is Msg3 mobility_handler.reset(new rrc_mobility(this)); + return SRSLTE_SUCCESS; } -rrc::ue::~ue() {} - void* rrc::ue::operator new(size_t sz) { assert(sz == sizeof(ue)); From 7e6744037cea27240404a9e4fbb9d90b5c05c908 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Wed, 13 Jan 2021 17:57:13 +0000 Subject: [PATCH 058/138] fix error check in ue addition --- srsenb/src/stack/rrc/rrc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 4d8c183cb..200fb37ee 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -151,7 +151,7 @@ int rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) if (rnti != SRSLTE_MRNTI) { // only non-eMBMS RNTIs are present in user map std::unique_ptr u{new ue(this, rnti, sched_ue_cfg)}; - if (not u->init()) { + if (u->init() != SRSLTE_SUCCESS) { rrc_log->error("Adding user rnti=0x%x - Failed to allocate user resources\n", rnti); return SRSLTE_ERROR; } From 233e604cfe6bb38a7ff3fea54f469eeaa7929dae Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 14 Jan 2021 13:11:02 +0000 Subject: [PATCH 059/138] cleanup sched_ue, moving some unrelated functions to sched_helpers --- srsenb/hdr/stack/mac/sched_helpers.h | 43 +++++++++-- srsenb/hdr/stack/mac/sched_ue.h | 1 - srsenb/src/stack/mac/sched_helpers.cc | 71 ++++++++++++++++- srsenb/src/stack/mac/sched_ue.cc | 105 +++----------------------- 4 files changed, 116 insertions(+), 104 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_helpers.h b/srsenb/hdr/stack/mac/sched_helpers.h index ead74858d..4198aa49f 100644 --- a/srsenb/hdr/stack/mac/sched_helpers.h +++ b/srsenb/hdr/stack/mac/sched_helpers.h @@ -100,12 +100,6 @@ inline uint32_t count_prb_per_tb(const rbgmask_t& bitmask) return nof_prb; } -/// Logs DL MAC PDU contents -void log_dl_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::dl_sched_res_t& result); - -/// Logs PHICH contents -void log_phich_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::ul_sched_res_t& result); - /** * Generate possible CCE locations a user can use to allocate DCIs * @param regs Regs data for the given cell configuration @@ -120,6 +114,43 @@ void generate_cce_location(srslte_regs_t* regs, uint32_t sf_idx = 0, uint16_t rnti = SRSLTE_INVALID_RNTI); +/// Obtains TB size *in bytes* for a given MCS and nof allocated prbs +inline uint32_t get_tbs_bytes(uint32_t mcs, uint32_t nof_alloc_prb, bool use_tbs_index_alt, bool is_ul) +{ + int tbs_idx = srslte_ra_tbs_idx_from_mcs(mcs, use_tbs_index_alt, is_ul); + assert(tbs_idx != SRSLTE_ERROR); + + int tbs = srslte_ra_tbs_from_idx((uint32_t)tbs_idx, nof_alloc_prb); + assert(tbs != SRSLTE_ERROR); + + return (uint32_t)tbs / 8U; +} + +/// Find lowest DCI aggregation level supported by the UE spectral efficiency +uint32_t get_aggr_level(uint32_t nof_bits, + uint32_t dl_cqi, + uint32_t max_aggr_lvl, + uint32_t cell_nof_prb, + bool use_tbs_index_alt); + +/******************************************************* + * sched_interface helper functions + *******************************************************/ + +inline bool operator==(const sched_interface::ue_cfg_t::cc_cfg_t& lhs, const sched_interface::ue_cfg_t::cc_cfg_t& rhs) +{ + return lhs.enb_cc_idx == rhs.enb_cc_idx and lhs.active == rhs.active; +} + +/// sanity check the UE CC configuration +int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg); + +/// Logs DL MAC PDU contents +void log_dl_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::dl_sched_res_t& result); + +/// Logs PHICH contents +void log_phich_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::ul_sched_res_t& result); + } // namespace srsenb #endif // SRSLTE_SCHED_HELPERS_H diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index 3e4be55e0..7bcce5212 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -202,7 +202,6 @@ public: bool pusch_enabled(tti_point tti_rx, uint32_t enb_cc_idx, bool needs_pdcch) const; private: - void check_ue_cfg_correctness() const; bool is_sr_triggered(); std::pair allocate_new_dl_mac_pdu(sched_interface::dl_sched_data_t* data, diff --git a/srsenb/src/stack/mac/sched_helpers.cc b/srsenb/src/stack/mac/sched_helpers.cc index 54bbd89db..b1bd66de8 100644 --- a/srsenb/src/stack/mac/sched_helpers.cc +++ b/srsenb/src/stack/mac/sched_helpers.cc @@ -15,11 +15,13 @@ #include "srslte/srslog/bundled/fmt/format.h" #include -#define Info(fmt, ...) srslte::logmap::get("MAC")->error(fmt, ##__VA_ARGS__) -#define Error(fmt, ...) srslte::logmap::get("MAC")->error(fmt, ##__VA_ARGS__) +#define Info(fmt, ...) mac_log->error(fmt, ##__VA_ARGS__) +#define Error(fmt, ...) mac_log->error(fmt, ##__VA_ARGS__) namespace srsenb { +srslte::log_ref mac_log{"MAC"}; + using dl_sched_res_t = sched_interface::dl_sched_res_t; using dl_sched_data_t = sched_interface::dl_sched_data_t; using custom_mem_buffer = fmt::basic_memory_buffer; @@ -294,4 +296,69 @@ void generate_cce_location(srslte_regs_t* regs_, } } +/******************************************************* + * DCI-specific helper functions + *******************************************************/ + +uint32_t +get_aggr_level(uint32_t nof_bits, uint32_t dl_cqi, uint32_t max_aggr_lvl, uint32_t cell_nof_prb, bool use_tbs_index_alt) +{ + uint32_t l = 0; + float max_coderate = srslte_cqi_to_coderate(dl_cqi, use_tbs_index_alt); + float coderate; + float factor = 1.5; + uint32_t l_max = 3; + if (cell_nof_prb == 6) { + factor = 1.0; + l_max = 2; + } + l_max = SRSLTE_MIN(max_aggr_lvl, l_max); + + do { + coderate = srslte_pdcch_coderate(nof_bits, l); + l++; + } while (l < l_max && factor * coderate > max_coderate); + + mac_log->debug("SCHED: CQI=%d, l=%d, nof_bits=%d, coderate=%.2f, max_coderate=%.2f\n", + dl_cqi, + l, + nof_bits, + coderate, + max_coderate); + return l; +} + +/// sanity check the UE CC configuration +int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg) +{ + using cc_t = sched_interface::ue_cfg_t::cc_cfg_t; + const auto& cc_list = ue_cfg.supported_cc_list; + bool has_scells = std::count_if(cc_list.begin(), cc_list.end(), [](const cc_t& c) { return c.active; }) > 1; + int ret = SRSLTE_SUCCESS; + + if (has_scells) { + // In case of CA, CQI configs must exist and cannot collide in the PUCCH + for (uint32_t i = 0; i < cc_list.size(); ++i) { + const auto& cc1 = cc_list[i]; + if (not cc1.active) { + continue; + } + if (not cc1.dl_cfg.cqi_report.periodic_configured and not cc1.dl_cfg.cqi_report.aperiodic_configured) { + mac_log->warning("SCHED: No CQI configuration was provided for UE scell index=%d \n", i); + ret = SRSLTE_ERROR; + } else if (cc1.dl_cfg.cqi_report.periodic_configured) { + for (uint32_t j = i + 1; j < cc_list.size(); ++j) { + if (cc_list[j].active and cc_list[j].dl_cfg.cqi_report.periodic_configured and + cc_list[j].dl_cfg.cqi_report.pmi_idx == cc1.dl_cfg.cqi_report.pmi_idx) { + mac_log->warning( + "SCHED: The provided CQI configurations for UE scells %d and %d collide in time resources.\n", i, j); + ret = SRSLTE_ERROR; + } + } + } + } + } + return ret; +} + } // namespace srsenb diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 6c559335b..a007d65fe 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -20,7 +20,6 @@ #include "srslte/srslte.h" using srslte::tti_interval; -using srslte::tti_point; namespace srsenb { @@ -30,31 +29,6 @@ namespace srsenb { #define MAC_MIN_ALLOC_SIZE 5 -namespace sched_utils { - -/// Obtains TB size *in bytes* for a given MCS and nof allocated prbs -uint32_t get_tbs_bytes(uint32_t mcs, uint32_t nof_alloc_prb, bool use_tbs_index_alt, bool is_ul) -{ - int tbs_idx = srslte_ra_tbs_idx_from_mcs(mcs, use_tbs_index_alt, is_ul); - if (tbs_idx < SRSLTE_SUCCESS) { - tbs_idx = 0; - } - - int tbs = srslte_ra_tbs_from_idx((uint32_t)tbs_idx, nof_alloc_prb); - if (tbs < SRSLTE_SUCCESS) { - tbs = 0; - } - - return (uint32_t)tbs / 8U; -} - -} // namespace sched_utils - -bool operator==(const sched_interface::ue_cfg_t::cc_cfg_t& lhs, const sched_interface::ue_cfg_t::cc_cfg_t& rhs) -{ - return lhs.enb_cc_idx == rhs.enb_cc_idx and lhs.active == rhs.active; -} - template std::tuple false_position_method(int x1, int x2, YType y0, const Callable& f, const ErrorDetect& is_error) @@ -189,7 +163,7 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) log_h->info("SCHED: Enqueueing SCell Activation CMD for rnti=0x%x\n", rnti); } - check_ue_cfg_correctness(); + check_ue_cfg_correctness(cfg); } void sched_ue::reset() @@ -221,35 +195,6 @@ void sched_ue::new_subframe(tti_point tti_rx, uint32_t enb_cc_idx) } } -/// sanity check the UE CC configuration -void sched_ue::check_ue_cfg_correctness() const -{ - using cc_t = sched::ue_cfg_t::cc_cfg_t; - const auto& cc_list = cfg.supported_cc_list; - bool has_scells = std::count_if(cc_list.begin(), cc_list.end(), [](const cc_t& c) { return c.active; }) > 1; - - if (has_scells) { - // In case of CA, CQI configs must exist and cannot collide in the PUCCH - for (uint32_t i = 0; i < cc_list.size(); ++i) { - const auto& cc1 = cc_list[i]; - if (not cc1.active) { - continue; - } - if (not cc1.dl_cfg.cqi_report.periodic_configured and not cc1.dl_cfg.cqi_report.aperiodic_configured) { - log_h->warning("SCHED: No CQI configuration was provided for UE scell index=%d \n", i); - } else if (cc1.dl_cfg.cqi_report.periodic_configured) { - for (uint32_t j = i + 1; j < cc_list.size(); ++j) { - if (cc_list[j].active and cc_list[j].dl_cfg.cqi_report.periodic_configured and - cc_list[j].dl_cfg.cqi_report.pmi_idx == cc1.dl_cfg.cqi_report.pmi_idx) { - log_h->warning( - "SCHED: The provided CQI configurations for UE scells %d and %d collide in time resources.\n", i, j); - } - } - } - } - } -} - /******************************************************* * * FAPI-like main scheduler interface. @@ -629,8 +574,7 @@ std::pair sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_i } else { // Fixed MCS mcs = carriers[ue_cc_idx].fixed_mcs_dl; - tbs_bytes = sched_utils::get_tbs_bytes( - (uint32_t)carriers[ue_cc_idx].fixed_mcs_dl, nof_alloc_prbs, cfg.use_tbs_index_alt, false); + tbs_bytes = get_tbs_bytes((uint32_t)carriers[ue_cc_idx].fixed_mcs_dl, nof_alloc_prbs, cfg.use_tbs_index_alt, false); } if (tbs_bytes > 0 and (uint32_t) tbs_bytes < req_bytes.start() and mcs < 28) { @@ -770,7 +714,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, nof_retx = (data->needs_pdcch) ? get_max_retx() : max_msg3retx; if (mcs >= 0) { - tbs = srslte_ra_tbs_from_idx(srslte_ra_tbs_idx_from_mcs(mcs, false, true), alloc.length()) / 8; + tbs = get_tbs_bytes(mcs, alloc.length(), false, true); } else { // dynamic mcs uint32_t req_bytes = get_pending_ul_new_data(tti_tx_ul, ue_cc_idx); @@ -808,7 +752,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, } else { // retx h->new_retx(tti_tx_ul, &mcs, nullptr, alloc); - tbs = srslte_ra_tbs_from_idx(srslte_ra_tbs_idx_from_mcs(mcs, false, true), alloc.length()) / 8; + tbs = get_tbs_bytes(mcs, alloc.length(), false, true); } if (tbs >= 0) { @@ -980,17 +924,10 @@ srslte::interval sched_ue::get_requested_dl_bytes(uint32_t ue_cc_idx) return {min_data, max_data}; } -/** - * Get pending RLC DL data in RLC buffers. Header sizes not accounted - * @return - */ +/// Get pending RLC DL data in RLC buffers. Header sizes not accounted uint32_t sched_ue::get_pending_dl_rlc_data() const { - uint32_t pending_data = 0; - for (int i = 0; i < sched_interface::MAX_LC; i++) { - pending_data += lch_handler.get_dl_tx_total(i); - } - return pending_data; + return lch_handler.get_dl_tx_total(); } uint32_t sched_ue::get_expected_dl_bitrate(uint32_t ue_cc_idx, int nof_rbgs) const @@ -1403,30 +1340,9 @@ void cc_sched_ue::finish_tti(tti_point tti_rx) } } -/* Find lowest DCI aggregation level supported by the UE spectral efficiency */ uint32_t cc_sched_ue::get_aggr_level(uint32_t nof_bits) { - uint32_t l = 0; - float max_coderate = srslte_cqi_to_coderate(dl_cqi, cfg->use_tbs_index_alt); - float coderate = 99; - float factor = 1.5; - uint32_t l_max = 3; - if (cell_params->nof_prb() == 6) { - factor = 1.0; - l_max = 2; - } - l_max = SRSLTE_MIN(max_aggr_level, l_max); - do { - coderate = srslte_pdcch_coderate(nof_bits, l); - l++; - } while (l < l_max && factor * coderate > max_coderate); - Debug("SCHED: CQI=%d, l=%d, nof_bits=%d, coderate=%.2f, max_coderate=%.2f\n", - dl_cqi, - l, - nof_bits, - coderate, - max_coderate); - return l; + return srsenb::get_aggr_level(nof_bits, dl_cqi, max_aggr_level, cell_params->nof_prb(), cfg->use_tbs_index_alt); } /* In this scheduler we tend to use all the available bandwidth and select the MCS @@ -1463,8 +1379,7 @@ int cc_sched_ue::alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes // Avoid the unusual case n_prb=1, mcs=6 tbs=328 (used in voip) if (nof_prb == 1 && sel_mcs == 6) { sel_mcs--; - uint32_t tbs_idx = srslte_ra_tbs_idx_from_mcs(sel_mcs, cfg->use_tbs_index_alt, is_ul); - tbs_bytes = srslte_ra_tbs_from_idx(tbs_idx, nof_prb) / 8; + tbs_bytes = get_tbs_bytes(sel_mcs, nof_prb, cfg->use_tbs_index_alt, is_ul); } if (mcs != nullptr && tbs_bytes >= 0) { @@ -1492,7 +1407,7 @@ int cc_sched_ue::get_required_prb_dl(uint32_t req_bytes, uint32_t nof_ctrl_symbo if (fixed_mcs_dl < 0 or not dl_cqi_rx) { return alloc_tbs_dl(nof_prb, nof_re, 0, &mcs); } - return srslte_ra_tbs_from_idx(srslte_ra_tbs_idx_from_mcs(fixed_mcs_dl, cfg->use_tbs_index_alt, false), nof_prb) / 8; + return (int)get_tbs_bytes(fixed_mcs_dl, nof_prb, cfg->use_tbs_index_alt, false); }; std::tuple ret = false_position_method( @@ -1514,7 +1429,7 @@ uint32_t cc_sched_ue::get_required_prb_ul(uint32_t req_bytes) if (fixed_mcs_ul < 0) { return alloc_tbs_ul(nof_prb, nof_re, 0, &mcs); } - return srslte_ra_tbs_from_idx(srslte_ra_tbs_idx_from_mcs(fixed_mcs_ul, false, true), nof_prb) / 8; + return (int)get_tbs_bytes(fixed_mcs_ul, nof_prb, false, true); }; // find nof prbs that lead to a tbs just above req_bytes From afef5188a6aa787b15e0d43b3c1279161d2f6725 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 14 Jan 2021 13:24:57 +0000 Subject: [PATCH 060/138] move sched_harq to subfolder --- srsenb/hdr/stack/mac/sched.h | 1 - srsenb/hdr/stack/mac/sched_ue.h | 2 +- srsenb/hdr/stack/mac/{ => sched_ue_ctrl}/sched_harq.h | 0 srsenb/src/stack/mac/CMakeLists.txt | 2 +- srsenb/src/stack/mac/{ => sched_ue_ctrl}/sched_harq.cc | 0 5 files changed, 2 insertions(+), 3 deletions(-) rename srsenb/hdr/stack/mac/{ => sched_ue_ctrl}/sched_harq.h (100%) rename srsenb/src/stack/mac/{ => sched_ue_ctrl}/sched_harq.cc (100%) diff --git a/srsenb/hdr/stack/mac/sched.h b/srsenb/hdr/stack/mac/sched.h index 228cfabcd..c92fb1f9a 100644 --- a/srsenb/hdr/stack/mac/sched.h +++ b/srsenb/hdr/stack/mac/sched.h @@ -14,7 +14,6 @@ #define SRSENB_SCHEDULER_H #include "sched_grid.h" -#include "sched_harq.h" #include "sched_ue.h" #include "srslte/common/log.h" #include "srslte/interfaces/enb_interfaces.h" diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index 7bcce5212..2c10649a9 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -18,7 +18,7 @@ #include #include -#include "sched_harq.h" +#include "sched_ue_ctrl/sched_harq.h" #include "sched_ue_ctrl/sched_lch.h" #include "sched_ue_ctrl/tpc.h" #include diff --git a/srsenb/hdr/stack/mac/sched_harq.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_harq.h similarity index 100% rename from srsenb/hdr/stack/mac/sched_harq.h rename to srsenb/hdr/stack/mac/sched_ue_ctrl/sched_harq.h diff --git a/srsenb/src/stack/mac/CMakeLists.txt b/srsenb/src/stack/mac/CMakeLists.txt index 758a4c4de..04a7d4713 100644 --- a/srsenb/src/stack/mac/CMakeLists.txt +++ b/srsenb/src/stack/mac/CMakeLists.txt @@ -8,7 +8,7 @@ add_subdirectory(schedulers) -set(SOURCES mac.cc ue.cc sched.cc sched_carrier.cc sched_grid.cc sched_harq.cc sched_ue.cc +set(SOURCES mac.cc ue.cc sched.cc sched_carrier.cc sched_grid.cc sched_ue_ctrl/sched_harq.cc sched_ue.cc sched_ue_ctrl/sched_lch.cc sched_helpers.cc) add_library(srsenb_mac STATIC ${SOURCES} $) diff --git a/srsenb/src/stack/mac/sched_harq.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_harq.cc similarity index 100% rename from srsenb/src/stack/mac/sched_harq.cc rename to srsenb/src/stack/mac/sched_ue_ctrl/sched_harq.cc From 1dd211c91cb1a93161c8e72e9b58708a7e960a0f Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 14 Jan 2021 13:52:21 +0000 Subject: [PATCH 061/138] fix log initialization in sched_helpers.cc --- srsenb/hdr/stack/mac/sched_helpers.h | 2 + srsenb/hdr/stack/mac/sched_ue.h | 3 -- srsenb/src/stack/mac/sched_helpers.cc | 46 ++++++++++++++----- .../src/stack/mac/sched_ue_ctrl/sched_lch.cc | 18 +------- 4 files changed, 37 insertions(+), 32 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_helpers.h b/srsenb/hdr/stack/mac/sched_helpers.h index 4198aa49f..3006010f2 100644 --- a/srsenb/hdr/stack/mac/sched_helpers.h +++ b/srsenb/hdr/stack/mac/sched_helpers.h @@ -151,6 +151,8 @@ void log_dl_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_i /// Logs PHICH contents void log_phich_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::ul_sched_res_t& result); +const char* to_string(sched_interface::ue_bearer_cfg_t::direction_t dir); + } // namespace srsenb #endif // SRSLTE_SCHED_HELPERS_H diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index 2c10649a9..409f260be 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -87,8 +87,6 @@ private: cc_st cc_state_ = cc_st::idle; }; -const char* to_string(sched_interface::ue_bearer_cfg_t::direction_t dir); - /** This class is designed to be thread-safe because it is called from workers through scheduler thread and from * higher layers and mac threads. */ @@ -257,7 +255,6 @@ private: bool phy_config_dedicated_enabled = false; tti_point current_tti; - std::array last_ttis; std::vector carriers; ///< map of UE CellIndex to carrier configuration std::vector enb_ue_cc_idx_map; }; diff --git a/srsenb/src/stack/mac/sched_helpers.cc b/srsenb/src/stack/mac/sched_helpers.cc index b1bd66de8..e76e65dd0 100644 --- a/srsenb/src/stack/mac/sched_helpers.cc +++ b/srsenb/src/stack/mac/sched_helpers.cc @@ -15,13 +15,13 @@ #include "srslte/srslog/bundled/fmt/format.h" #include -#define Info(fmt, ...) mac_log->error(fmt, ##__VA_ARGS__) -#define Error(fmt, ...) mac_log->error(fmt, ##__VA_ARGS__) +#define Debug(fmt, ...) srslte::logmap::get("MAC")->debug(fmt, ##__VA_ARGS__) +#define Info(fmt, ...) srslte::logmap::get("MAC")->info(fmt, ##__VA_ARGS__) +#define Warning(fmt, ...) srslte::logmap::get("MAC")->warning(fmt, ##__VA_ARGS__) +#define Error(fmt, ...) srslte::logmap::get("MAC")->error(fmt, ##__VA_ARGS__) namespace srsenb { -srslte::log_ref mac_log{"MAC"}; - using dl_sched_res_t = sched_interface::dl_sched_res_t; using dl_sched_data_t = sched_interface::dl_sched_data_t; using custom_mem_buffer = fmt::basic_memory_buffer; @@ -303,6 +303,8 @@ void generate_cce_location(srslte_regs_t* regs_, uint32_t get_aggr_level(uint32_t nof_bits, uint32_t dl_cqi, uint32_t max_aggr_lvl, uint32_t cell_nof_prb, bool use_tbs_index_alt) { + static srslte::log_ref cached_log = srslte::logmap::get("MAC"); + uint32_t l = 0; float max_coderate = srslte_cqi_to_coderate(dl_cqi, use_tbs_index_alt); float coderate; @@ -319,15 +321,19 @@ get_aggr_level(uint32_t nof_bits, uint32_t dl_cqi, uint32_t max_aggr_lvl, uint32 l++; } while (l < l_max && factor * coderate > max_coderate); - mac_log->debug("SCHED: CQI=%d, l=%d, nof_bits=%d, coderate=%.2f, max_coderate=%.2f\n", - dl_cqi, - l, - nof_bits, - coderate, - max_coderate); + cached_log->debug("SCHED: CQI=%d, l=%d, nof_bits=%d, coderate=%.2f, max_coderate=%.2f\n", + dl_cqi, + l, + nof_bits, + coderate, + max_coderate); return l; } +/******************************************************* + * sched_interface helper functions + *******************************************************/ + /// sanity check the UE CC configuration int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg) { @@ -344,13 +350,13 @@ int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg) continue; } if (not cc1.dl_cfg.cqi_report.periodic_configured and not cc1.dl_cfg.cqi_report.aperiodic_configured) { - mac_log->warning("SCHED: No CQI configuration was provided for UE scell index=%d \n", i); + Warning("SCHED: No CQI configuration was provided for UE scell index=%d \n", i); ret = SRSLTE_ERROR; } else if (cc1.dl_cfg.cqi_report.periodic_configured) { for (uint32_t j = i + 1; j < cc_list.size(); ++j) { if (cc_list[j].active and cc_list[j].dl_cfg.cqi_report.periodic_configured and cc_list[j].dl_cfg.cqi_report.pmi_idx == cc1.dl_cfg.cqi_report.pmi_idx) { - mac_log->warning( + Warning( "SCHED: The provided CQI configurations for UE scells %d and %d collide in time resources.\n", i, j); ret = SRSLTE_ERROR; } @@ -361,4 +367,20 @@ int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg) return ret; } +const char* to_string(sched_interface::ue_bearer_cfg_t::direction_t dir) +{ + switch (dir) { + case sched_interface::ue_bearer_cfg_t::IDLE: + return "idle"; + case sched_interface::ue_bearer_cfg_t::BOTH: + return "bi-dir"; + case sched_interface::ue_bearer_cfg_t::DL: + return "DL"; + case sched_interface::ue_bearer_cfg_t::UL: + return "UL"; + default: + return "unrecognized direction"; + } +} + } // namespace srsenb diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_lch.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_lch.cc index 9c7270a6c..6cf176596 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_lch.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_lch.cc @@ -11,7 +11,7 @@ */ #include "srsenb/hdr/stack/mac/sched_ue_ctrl/sched_lch.h" -#include "srsenb/hdr/stack/mac/sched_common.h" +#include "srsenb/hdr/stack/mac/sched_helpers.h" #include "srslte/common/log_helper.h" namespace srsenb { @@ -54,22 +54,6 @@ uint32_t get_ul_mac_sdu_size_with_overhead(uint32_t rlc_pdu_bytes) * *******************************************************/ -const char* to_string(sched_interface::ue_bearer_cfg_t::direction_t dir) -{ - switch (dir) { - case sched_interface::ue_bearer_cfg_t::IDLE: - return "idle"; - case sched_interface::ue_bearer_cfg_t::BOTH: - return "bi-dir"; - case sched_interface::ue_bearer_cfg_t::DL: - return "DL"; - case sched_interface::ue_bearer_cfg_t::UL: - return "UL"; - default: - return "unrecognized direction"; - } -} - void lch_ue_manager::set_cfg(const sched_interface::ue_cfg_t& cfg) { for (uint32_t lcid = 0; lcid < sched_interface::MAX_LC; lcid++) { From 32c47d4fac2c056226e4db8a76ec70e99a1ce2ac Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 14 Jan 2021 17:03:30 +0000 Subject: [PATCH 062/138] change sched warning when it fails to fit srb0 data in grant to info --- srsenb/hdr/stack/mac/sched_common.h | 2 +- srsenb/src/stack/mac/sched_ue.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_common.h b/srsenb/hdr/stack/mac/sched_common.h index 6c520d920..650302fdd 100644 --- a/srsenb/hdr/stack/mac/sched_common.h +++ b/srsenb/hdr/stack/mac/sched_common.h @@ -47,7 +47,7 @@ public: const sched_interface::cell_cfg_t& cfg_, const sched_interface::sched_args_t& sched_args); // convenience getters - uint32_t prb_to_rbg(uint32_t nof_prbs) const { return (nof_prbs + (P - 1)) / P; } + uint32_t prb_to_rbg(uint32_t nof_prbs) const { return srslte::ceil_div(nof_prbs, P); } uint32_t nof_prb() const { return cfg.cell.nof_prb; } uint32_t enb_cc_idx = 0; diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index a007d65fe..702df4595 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -578,7 +578,8 @@ std::pair sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_i } if (tbs_bytes > 0 and (uint32_t) tbs_bytes < req_bytes.start() and mcs < 28) { - log_h->warning("SCHED: Could not get PRB allocation that avoids MAC CE or RLC SBR0 PDU segmentation\n"); + log_h->info("SCHED: Could not get PRB allocation that avoids MAC CE or RLC SRB0 PDU segmentation\n"); + // Note: This is not a warning, because the srb0 buffer can be updated after the ue sched decision } return {mcs, tbs_bytes}; From 8b306c81e260ec16af0bbc6df2a812e9c4ff44f5 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 14 Jan 2021 17:47:17 +0000 Subject: [PATCH 063/138] refactor tbs/mcs computation in sched --- srsenb/hdr/stack/mac/sched_ue.h | 37 ++++--- srsenb/src/stack/mac/sched_ue.cc | 180 ++++++++++++++++--------------- 2 files changed, 112 insertions(+), 105 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index 409f260be..d30ace871 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -29,6 +29,11 @@ namespace srsenb { typedef enum { UCI_PUSCH_NONE = 0, UCI_PUSCH_CQI, UCI_PUSCH_ACK, UCI_PUSCH_ACK_CQI } uci_pusch_t; enum class cc_st { active, idle, activating, deactivating }; +struct tbs_info { + int tbs_bytes = -1; + int mcs = 0; +}; + struct cc_sched_ue { const static int SCHED_MAX_HARQ_PROC = FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS; @@ -42,9 +47,9 @@ struct cc_sched_ue { void finish_tti(srslte::tti_point tti_rx); uint32_t get_aggr_level(uint32_t nof_bits); - int alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul, int* mcs); - int alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int* mcs); - int alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int* mcs); + tbs_info alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul); + tbs_info alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes); + tbs_info alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int explicit_mcs = -1); int get_required_prb_dl(uint32_t req_bytes, uint32_t nof_ctrl_symbols); uint32_t get_required_prb_ul(uint32_t req_bytes); const sched_cell_params_t* get_cell_cfg() const { return cell_params; } @@ -202,19 +207,19 @@ public: private: bool is_sr_triggered(); - std::pair allocate_new_dl_mac_pdu(sched_interface::dl_sched_data_t* data, - dl_harq_proc* h, - const rbgmask_t& user_mask, - tti_point tti_tx_dl, - uint32_t ue_cc_idx, - uint32_t cfi, - uint32_t tb); - - std::pair compute_mcs_and_tbs(uint32_t ue_cc_idx, - tti_point tti_tx_dl, - uint32_t nof_alloc_prbs, - uint32_t cfi, - const srslte_dci_dl_t& dci); + tbs_info allocate_new_dl_mac_pdu(sched_interface::dl_sched_data_t* data, + dl_harq_proc* h, + const rbgmask_t& user_mask, + tti_point tti_tx_dl, + uint32_t ue_cc_idx, + uint32_t cfi, + uint32_t tb); + + tbs_info compute_mcs_and_tbs(uint32_t ue_cc_idx, + tti_point tti_tx_dl, + uint32_t nof_alloc_prbs, + uint32_t cfi, + const srslte_dci_dl_t& dci); bool needs_cqi(uint32_t tti, uint32_t cc_idx, bool will_send = false); diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 702df4595..5ecb87d36 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -425,33 +425,32 @@ void sched_ue::set_ul_snr(tti_point tti_rx, uint32_t enb_cc_idx, float snr, uint * @param ue_cc_idx * @return pair with allocated tbs and mcs */ -std::pair sched_ue::allocate_new_dl_mac_pdu(sched::dl_sched_data_t* data, - dl_harq_proc* h, - const rbgmask_t& user_mask, - tti_point tti_tx_dl, - uint32_t ue_cc_idx, - uint32_t cfi, - uint32_t tb) +tbs_info sched_ue::allocate_new_dl_mac_pdu(sched::dl_sched_data_t* data, + dl_harq_proc* h, + const rbgmask_t& user_mask, + tti_point tti_tx_dl, + uint32_t ue_cc_idx, + uint32_t cfi, + uint32_t tb) { srslte_dci_dl_t* dci = &data->dci; uint32_t nof_prb = count_prb_per_tb(user_mask); - auto ret = compute_mcs_and_tbs(ue_cc_idx, tti_tx_dl, nof_prb, cfi, *dci); - int mcs = ret.first; - int tbs = ret.second; + tbs_info tb_info = compute_mcs_and_tbs(ue_cc_idx, tti_tx_dl, nof_prb, cfi, *dci); // Allocate MAC PDU (subheaders, CEs, and SDUS) - int rem_tbs = tbs; + int rem_tbs = tb_info.tbs_bytes; rem_tbs -= allocate_mac_ces(data, lch_handler, rem_tbs, ue_cc_idx); rem_tbs -= allocate_mac_sdus(data, lch_handler, rem_tbs, tb); // Allocate DL UE Harq - if (rem_tbs != tbs) { - h->new_tx(user_mask, tb, tti_tx_dl, mcs, tbs, data->dci.location.ncce, get_ue_cfg().maxharq_tx); + if (rem_tbs != tb_info.tbs_bytes) { + h->new_tx( + user_mask, tb, tti_tx_dl, tb_info.mcs, tb_info.tbs_bytes, data->dci.location.ncce, get_ue_cfg().maxharq_tx); } else { Warning("SCHED: Failed to allocate DL harq pid=%d\n", h->get_id()); } - return {tbs, mcs}; + return tb_info; } int sched_ue::generate_dl_dci_format(uint32_t pid, @@ -492,9 +491,6 @@ int sched_ue::generate_format1(uint32_t pid, dl_harq_proc* h = &carriers[ue_cc_idx].harq_ent.dl_harq_procs()[pid]; srslte_dci_dl_t* dci = &data->dci; - int mcs = 0; - int tbs = 0; - // If the size of Format1 and Format1A is ambiguous in the common SS, use Format1A since the UE assumes // Common SS when spaces collide if (cell.nof_prb == 15 && carriers.size() > 1) { @@ -516,28 +512,27 @@ int sched_ue::generate_format1(uint32_t pid, dci->format = SRSLTE_DCI_FORMAT1; } + tbs_info tbinfo; if (h->is_empty(0)) { - auto ret = allocate_new_dl_mac_pdu(data, h, user_mask, tti_tx_dl, ue_cc_idx, cfi, 0); - tbs = ret.first; - mcs = ret.second; + tbinfo = allocate_new_dl_mac_pdu(data, h, user_mask, tti_tx_dl, ue_cc_idx, cfi, 0); } else { - h->new_retx(user_mask, 0, tti_tx_dl, &mcs, &tbs, data->dci.location.ncce); - Debug("SCHED: Alloc format1 previous mcs=%d, tbs=%d\n", mcs, tbs); + h->new_retx(user_mask, 0, tti_tx_dl, &tbinfo.mcs, &tbinfo.tbs_bytes, data->dci.location.ncce); + Debug("SCHED: Alloc format1 previous mcs=%d, tbs=%d\n", tbinfo.mcs, tbinfo.tbs_bytes); } - if (tbs > 0) { + if (tbinfo.tbs_bytes > 0) { dci->rnti = rnti; dci->pid = h->get_id(); dci->ue_cc_idx = ue_cc_idx; - dci->tb[0].mcs_idx = (uint32_t)mcs; + dci->tb[0].mcs_idx = (uint32_t)tbinfo.mcs; dci->tb[0].rv = get_rvidx(h->nof_retx(0)); dci->tb[0].ndi = h->get_ndi(0); dci->tpc_pucch = carriers[ue_cc_idx].tpc_fsm.encode_pucch_tpc(); - data->tbs[0] = (uint32_t)tbs; + data->tbs[0] = (uint32_t)tbinfo.tbs_bytes; data->tbs[1] = 0; } - return tbs; + return tbinfo.tbs_bytes; } /** @@ -549,13 +544,12 @@ int sched_ue::generate_format1(uint32_t pid, * @param dci contains the RBG mask, and alloc type * @return pair with MCS and TBS (in bytes) */ -std::pair sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_idx, - tti_point tti_tx_dl, - uint32_t nof_alloc_prbs, - uint32_t cfi, - const srslte_dci_dl_t& dci) +tbs_info sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_idx, + tti_point tti_tx_dl, + uint32_t nof_alloc_prbs, + uint32_t cfi, + const srslte_dci_dl_t& dci) { - int mcs = 0, tbs_bytes = 0; srslte::interval req_bytes = get_requested_dl_bytes(ue_cc_idx); // Calculate exact number of RE for this PRB allocation @@ -567,22 +561,14 @@ std::pair sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_i uint32_t nof_re = srslte_ra_dl_grant_nof_re(&carriers[ue_cc_idx].get_cell_cfg()->cfg.cell, &dl_sf, &grant); // Compute MCS+TBS - // Use a higher MCS for the Msg4 to fit in the 6 PRB case - if (carriers[ue_cc_idx].fixed_mcs_dl < 0 or not carriers[ue_cc_idx].dl_cqi_rx) { - // Dynamic MCS - tbs_bytes = carriers[ue_cc_idx].alloc_tbs_dl(nof_alloc_prbs, nof_re, req_bytes.stop(), &mcs); - } else { - // Fixed MCS - mcs = carriers[ue_cc_idx].fixed_mcs_dl; - tbs_bytes = get_tbs_bytes((uint32_t)carriers[ue_cc_idx].fixed_mcs_dl, nof_alloc_prbs, cfg.use_tbs_index_alt, false); - } + tbs_info tb = carriers[ue_cc_idx].alloc_tbs_dl(nof_alloc_prbs, nof_re, req_bytes.stop()); - if (tbs_bytes > 0 and (uint32_t) tbs_bytes < req_bytes.start() and mcs < 28) { + if (tb.tbs_bytes > 0 and tb.tbs_bytes < (int)req_bytes.start()) { log_h->info("SCHED: Could not get PRB allocation that avoids MAC CE or RLC SRB0 PDU segmentation\n"); // Note: This is not a warning, because the srb0 buffer can be updated after the ue sched decision } - return {mcs, tbs_bytes}; + return tb; } // Generates a Format2a dci @@ -626,27 +612,24 @@ int sched_ue::generate_format2a(uint32_t pid, } for (uint32_t tb = 0; tb < SRSLTE_MAX_TB; tb++) { - int mcs = 0; - int tbs = 0; + tbs_info tbinfo; if (!h->is_empty(tb)) { - h->new_retx(user_mask, tb, tti_tx_dl, &mcs, &tbs, data->dci.location.ncce); + h->new_retx(user_mask, tb, tti_tx_dl, &tbinfo.mcs, &tbinfo.tbs_bytes, data->dci.location.ncce); } else if (tb_en[tb] && no_retx) { - auto ret = allocate_new_dl_mac_pdu(data, h, user_mask, tti_tx_dl, ue_cc_idx, cfi, tb); - tbs = ret.first; - mcs = ret.second; + tbinfo = allocate_new_dl_mac_pdu(data, h, user_mask, tti_tx_dl, ue_cc_idx, cfi, tb); } /* Fill DCI TB dedicated fields */ - if (tbs > 0 && tb_en[tb]) { - dci->tb[tb].mcs_idx = (uint32_t)mcs; + if (tbinfo.tbs_bytes > 0 && tb_en[tb]) { + dci->tb[tb].mcs_idx = (uint32_t)tbinfo.mcs; dci->tb[tb].rv = get_rvidx(h->nof_retx(tb)); if (!SRSLTE_DCI_IS_TB_EN(dci->tb[tb])) { dci->tb[tb].rv = 2; } dci->tb[tb].ndi = h->get_ndi(tb); dci->tb[tb].cw_idx = tb; - data->tbs[tb] = (uint32_t)tbs; + data->tbs[tb] = (uint32_t)tbinfo.tbs_bytes; } else { SRSLTE_DCI_TB_DISABLE(dci->tb[tb]); data->tbs[tb] = 0; @@ -704,8 +687,9 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, data->needs_pdcch = needs_pdcch; dci->location = dci_pos; - int mcs = (explicit_mcs >= 0) ? explicit_mcs : carriers[ue_cc_idx].fixed_mcs_ul; - int tbs = 0; + tbs_info tbinfo; + tbinfo.mcs = (explicit_mcs >= 0) ? explicit_mcs : carriers[ue_cc_idx].fixed_mcs_ul; + tbinfo.tbs_bytes = 0; bool is_newtx = h->is_empty(0); if (is_newtx) { @@ -714,15 +698,15 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, // If Msg3 set different nof retx nof_retx = (data->needs_pdcch) ? get_max_retx() : max_msg3retx; - if (mcs >= 0) { - tbs = get_tbs_bytes(mcs, alloc.length(), false, true); + if (tbinfo.mcs >= 0) { + tbinfo.tbs_bytes = get_tbs_bytes(tbinfo.mcs, alloc.length(), false, true); } else { // dynamic mcs uint32_t req_bytes = get_pending_ul_new_data(tti_tx_ul, ue_cc_idx); uint32_t N_srs = 0; uint32_t nof_symb = 2 * (SRSLTE_CP_NSYMB(cell.cp) - 1) - N_srs; uint32_t nof_re = nof_symb * alloc.length() * SRSLTE_NRE; - tbs = carriers[ue_cc_idx].alloc_tbs_ul(alloc.length(), nof_re, req_bytes, &mcs); + tbinfo = carriers[ue_cc_idx].alloc_tbs_ul(alloc.length(), nof_re, req_bytes); // Reduce MCS to fit UCI if transmitted in this grant if (uci_type != UCI_PUSCH_NONE) { @@ -731,33 +715,33 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, // Add the RE for ACK if (uci_type == UCI_PUSCH_ACK || uci_type == UCI_PUSCH_ACK_CQI) { float beta = srslte_sch_beta_ack(cfg.uci_offset.I_offset_ack); - nof_uci_re += srslte_qprime_ack_ext(alloc.length(), nof_symb, 8 * tbs, carriers.size(), beta); + nof_uci_re += srslte_qprime_ack_ext(alloc.length(), nof_symb, 8 * tbinfo.tbs_bytes, carriers.size(), beta); } // Add the RE for CQI report (RI reports are transmitted on CQI slots. We do a conservative estimate here) if (uci_type == UCI_PUSCH_CQI || uci_type == UCI_PUSCH_ACK_CQI || cqi_request) { float beta = srslte_sch_beta_cqi(cfg.uci_offset.I_offset_cqi); - nof_uci_re += srslte_qprime_cqi_ext(alloc.length(), nof_symb, 8 * tbs, beta); + nof_uci_re += srslte_qprime_cqi_ext(alloc.length(), nof_symb, 8 * tbinfo.tbs_bytes, beta); } // Recompute again the MCS and TBS with the new spectral efficiency (based on the available RE for data) if (nof_re >= nof_uci_re) { - tbs = carriers[ue_cc_idx].alloc_tbs_ul(alloc.length(), nof_re - nof_uci_re, req_bytes, &mcs); + tbinfo = carriers[ue_cc_idx].alloc_tbs_ul(alloc.length(), nof_re - nof_uci_re, req_bytes); } // NOTE: if (nof_re < nof_uci_re) we should set TBS=0 } } - h->new_tx(tti_tx_ul, mcs, tbs, alloc, nof_retx); + h->new_tx(tti_tx_ul, tbinfo.mcs, tbinfo.tbs_bytes, alloc, nof_retx); // Un-trigger the SR if data is allocated - if (tbs > 0) { + if (tbinfo.tbs_bytes > 0) { unset_sr(); } } else { // retx - h->new_retx(tti_tx_ul, &mcs, nullptr, alloc); - tbs = get_tbs_bytes(mcs, alloc.length(), false, true); + h->new_retx(tti_tx_ul, &tbinfo.mcs, nullptr, alloc); + tbinfo.tbs_bytes = get_tbs_bytes(tbinfo.mcs, alloc.length(), false, true); } - if (tbs >= 0) { - data->tbs = tbs; + if (tbinfo.tbs_bytes >= 0) { + data->tbs = tbinfo.tbs_bytes; data->current_tx_nb = h->nof_retx(0); dci->rnti = rnti; dci->format = SRSLTE_DCI_FORMAT0; @@ -771,7 +755,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, // If there are no RE available for ULSCH but there is UCI to transmit, allocate PUSCH becuase // resources have been reserved already and in CA it will be used to ACK other carriers - if (tbs == 0 && (cqi_request || uci_type != UCI_PUSCH_NONE)) { + if (tbinfo.tbs_bytes == 0 && (cqi_request || uci_type != UCI_PUSCH_NONE)) { // 8.6.1 and 8.6.2 36.213 second paragraph dci->cqi_request = true; dci->tb.mcs_idx = 29; @@ -782,21 +766,21 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, if (alloc.length() > 4) { alloc.set(alloc.start(), alloc.start() + 4); } - } else if (tbs > 0) { + } else if (tbinfo.tbs_bytes > 0) { dci->tb.rv = get_rvidx(h->nof_retx(0)); if (!is_newtx && data->needs_pdcch) { dci->tb.mcs_idx = 28 + dci->tb.rv; } else { - dci->tb.mcs_idx = mcs; + dci->tb.mcs_idx = tbinfo.mcs; } - } else if (tbs == 0) { + } else if (tbinfo.tbs_bytes == 0) { log_h->warning("SCHED: No space for ULSCH while allocating format0. Discarding grant.\n"); } else { log_h->error("SCHED: Unkown error while allocating format0\n"); } } - return tbs; + return tbinfo.tbs_bytes; } /******************************************************* @@ -1349,8 +1333,9 @@ uint32_t cc_sched_ue::get_aggr_level(uint32_t nof_bits) /* In this scheduler we tend to use all the available bandwidth and select the MCS * that approximates the minimum between the capacity and the requested rate */ -int cc_sched_ue::alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul, int* mcs) +tbs_info cc_sched_ue::alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul) { + tbs_info ret; uint32_t sel_mcs = 0; // TODO: Compute real spectral efficiency based on PUSCH-UCI configuration @@ -1383,32 +1368,53 @@ int cc_sched_ue::alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes tbs_bytes = get_tbs_bytes(sel_mcs, nof_prb, cfg->use_tbs_index_alt, is_ul); } - if (mcs != nullptr && tbs_bytes >= 0) { - *mcs = (int)sel_mcs; + ret.tbs_bytes = tbs_bytes; + if (ret.tbs_bytes >= 0) { + ret.mcs = (int)sel_mcs; } - return tbs_bytes; + return ret; } -int cc_sched_ue::alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int* mcs) +tbs_info cc_sched_ue::alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes) { - return alloc_tbs(nof_prb, nof_re, req_bytes, false, mcs); + tbs_info ret; + + // Use a higher MCS for the Msg4 to fit in the 6 PRB case + if (fixed_mcs_dl < 0 or not dl_cqi_rx) { + // Dynamic MCS + ret = alloc_tbs(nof_prb, nof_re, req_bytes, false); + } else { + // Fixed MCS + ret.mcs = fixed_mcs_dl; + ret.tbs_bytes = get_tbs_bytes((uint32_t)fixed_mcs_dl, nof_prb, cfg->use_tbs_index_alt, false); + } + return ret; } -int cc_sched_ue::alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int* mcs) +tbs_info cc_sched_ue::alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int explicit_mcs) { - return alloc_tbs(nof_prb, nof_re, req_bytes, true, mcs); + tbs_info ret; + int mcs = explicit_mcs >= 0 ? explicit_mcs : fixed_mcs_ul; + + if (mcs < 0) { + // Dynamic MCS + ret = alloc_tbs(nof_prb, nof_re, req_bytes, true); + } else { + // Fixed MCS + ret.mcs = mcs; + ret.tbs_bytes = get_tbs_bytes((uint32_t)mcs, nof_prb, false, true); + } + + return ret; } int cc_sched_ue::get_required_prb_dl(uint32_t req_bytes, uint32_t nof_ctrl_symbols) { auto compute_tbs_approx = [this, nof_ctrl_symbols](uint32_t nof_prb) { uint32_t nof_re = srslte_ra_dl_approx_nof_re(&cell_params->cfg.cell, nof_prb, nof_ctrl_symbols); - int mcs; - if (fixed_mcs_dl < 0 or not dl_cqi_rx) { - return alloc_tbs_dl(nof_prb, nof_re, 0, &mcs); - } - return (int)get_tbs_bytes(fixed_mcs_dl, nof_prb, cfg->use_tbs_index_alt, false); + tbs_info tb = alloc_tbs_dl(nof_prb, nof_re, 0); + return tb.tbs_bytes; }; std::tuple ret = false_position_method( @@ -1426,11 +1432,7 @@ uint32_t cc_sched_ue::get_required_prb_ul(uint32_t req_bytes) auto compute_tbs_approx = [this](uint32_t nof_prb) { const uint32_t N_srs = 0; uint32_t nof_re = (2 * (SRSLTE_CP_NSYMB(cell_params->cfg.cell.cp) - 1) - N_srs) * nof_prb * SRSLTE_NRE; - int mcs; - if (fixed_mcs_ul < 0) { - return alloc_tbs_ul(nof_prb, nof_re, 0, &mcs); - } - return (int)get_tbs_bytes(fixed_mcs_ul, nof_prb, false, true); + return alloc_tbs_ul(nof_prb, nof_re, 0).tbs_bytes; }; // find nof prbs that lead to a tbs just above req_bytes From d0a17b0a4075b6d48a65c8c1e5d5417177a48ffb Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 14 Jan 2021 19:54:48 +0000 Subject: [PATCH 064/138] created sched_ue_cell class that is indexed based on enb_cc_idx --- srsenb/hdr/stack/mac/sched_common.h | 2 + srsenb/hdr/stack/mac/sched_helpers.h | 2 + srsenb/hdr/stack/mac/sched_ue.h | 20 ++++----- .../stack/mac/sched_ue_ctrl/sched_ue_cell.h | 44 +++++++++++++++++++ srsenb/src/stack/mac/CMakeLists.txt | 2 +- srsenb/src/stack/mac/sched_helpers.cc | 12 +++++ srsenb/src/stack/mac/sched_ue.cc | 40 ++++++++--------- .../stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 32 ++++++++++++++ srsenb/test/mac/sched_grid_test.cc | 6 +-- 9 files changed, 124 insertions(+), 36 deletions(-) create mode 100644 srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h create mode 100644 srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc diff --git a/srsenb/hdr/stack/mac/sched_common.h b/srsenb/hdr/stack/mac/sched_common.h index 650302fdd..e1d7cda76 100644 --- a/srsenb/hdr/stack/mac/sched_common.h +++ b/srsenb/hdr/stack/mac/sched_common.h @@ -61,6 +61,8 @@ public: uint32_t nof_rbgs = 0; }; +using ue_cce_locations_table = std::array, SRSLTE_NOF_CFI>; + //! Bitmask used for CCE allocations using pdcch_mask_t = srslte::bounded_bitset; diff --git a/srsenb/hdr/stack/mac/sched_helpers.h b/srsenb/hdr/stack/mac/sched_helpers.h index 3006010f2..9da7e5fec 100644 --- a/srsenb/hdr/stack/mac/sched_helpers.h +++ b/srsenb/hdr/stack/mac/sched_helpers.h @@ -100,6 +100,8 @@ inline uint32_t count_prb_per_tb(const rbgmask_t& bitmask) return nof_prb; } +ue_cce_locations_table generate_cce_location_table(uint16_t rnti, const sched_cell_params_t& cell_cfg); + /** * Generate possible CCE locations a user can use to allocate DCIs * @param regs Regs data for the given cell configuration diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index d30ace871..697c3136a 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -20,6 +20,7 @@ #include "sched_ue_ctrl/sched_harq.h" #include "sched_ue_ctrl/sched_lch.h" +#include "sched_ue_ctrl/sched_ue_cell.h" #include "sched_ue_ctrl/tpc.h" #include #include @@ -75,9 +76,6 @@ struct cc_sched_ue { int fixed_mcs_ul = 0, fixed_mcs_dl = 0; tpc tpc_fsm; - // Allowed DCI locations per per CFI and per subframe - std::array, 3> dci_locations = {}; - private: // config srslte::log_ref log_h; @@ -190,8 +188,8 @@ public: int explicit_mcs = -1, uci_pusch_t uci_type = UCI_PUSCH_NONE); - srslte_dci_format_t get_dci_format(); - sched_dci_cce_t* get_locations(uint32_t enb_cc_idx, uint32_t current_cfi, uint32_t sf_idx); + srslte_dci_format_t get_dci_format(); + const sched_dci_cce_t* get_locations(uint32_t enb_cc_idx, uint32_t current_cfi, uint32_t sf_idx) const; cc_sched_ue* find_ue_carrier(uint32_t enb_cc_idx); size_t nof_carriers_configured() const { return carriers.size(); } @@ -243,11 +241,10 @@ private: const rbgmask_t& user_mask); /* Args */ - ue_cfg_t cfg = {}; - srslte_cell_t cell = {}; - srslte::log_ref log_h; - const std::vector* cell_params_list = nullptr; - const sched_cell_params_t* main_cc_params = nullptr; + ue_cfg_t cfg = {}; + srslte_cell_t cell = {}; + mutable srslte::log_ref log_h; + const sched_cell_params_t* main_cc_params = nullptr; /* Buffer states */ bool sr = false; @@ -261,7 +258,8 @@ private: tti_point current_tti; std::vector carriers; ///< map of UE CellIndex to carrier configuration - std::vector enb_ue_cc_idx_map; + + std::vector cells; ///< List of eNB cells that may be configured/activated/deactivated for the UE }; using sched_ue_list = std::map; diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h new file mode 100644 index 000000000..0806d745a --- /dev/null +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -0,0 +1,44 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_SCHED_UE_CELL_H +#define SRSLTE_SCHED_UE_CELL_H + +#include "../sched_common.h" + +namespace srsenb { + +struct sched_ue_cell { + using ue_cc_cfg = sched_interface::ue_cfg_t::cc_cfg_t; + + sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_); + void set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_); + + bool configured() const { return ue_cc_idx >= 0; } + int get_ue_cc_idx() const { return ue_cc_idx; } + const ue_cc_cfg* get_ue_cc_cfg() const { return configured() ? &ue_cfg->supported_cc_list[ue_cc_idx] : nullptr; } + + /// Cell const configuration + const sched_cell_params_t* cell_cfg = nullptr; + + /// Allowed DCI locations per per CFI and per subframe + const ue_cce_locations_table dci_locations; + +private: + uint16_t rnti = SRSLTE_INVALID_RNTI; + const sched_interface::ue_cfg_t* ue_cfg = nullptr; + int ue_cc_idx = -1; +}; + +} // namespace srsenb + +#endif // SRSLTE_SCHED_UE_CELL_H diff --git a/srsenb/src/stack/mac/CMakeLists.txt b/srsenb/src/stack/mac/CMakeLists.txt index 04a7d4713..7eba11378 100644 --- a/srsenb/src/stack/mac/CMakeLists.txt +++ b/srsenb/src/stack/mac/CMakeLists.txt @@ -9,7 +9,7 @@ add_subdirectory(schedulers) set(SOURCES mac.cc ue.cc sched.cc sched_carrier.cc sched_grid.cc sched_ue_ctrl/sched_harq.cc sched_ue.cc - sched_ue_ctrl/sched_lch.cc sched_helpers.cc) + sched_ue_ctrl/sched_lch.cc sched_ue_ctrl/sched_ue_cell.cc sched_helpers.cc) add_library(srsenb_mac STATIC ${SOURCES} $) if(ENABLE_5GNR) diff --git a/srsenb/src/stack/mac/sched_helpers.cc b/srsenb/src/stack/mac/sched_helpers.cc index e76e65dd0..1222597b3 100644 --- a/srsenb/src/stack/mac/sched_helpers.cc +++ b/srsenb/src/stack/mac/sched_helpers.cc @@ -272,6 +272,18 @@ bool sched_cell_params_t::set_cfg(uint32_t enb_cc_id return true; } +ue_cce_locations_table generate_cce_location_table(uint16_t rnti, const sched_cell_params_t& cell_cfg) +{ + ue_cce_locations_table dci_locations; + // Generate allowed CCE locations + for (int cfi = 0; cfi < SRSLTE_NOF_CFI; cfi++) { + for (int sf_idx = 0; sf_idx < SRSLTE_NOF_SF_X_FRAME; sf_idx++) { + generate_cce_location(cell_cfg.regs.get(), &dci_locations[cfi][sf_idx], cfi + 1, sf_idx, rnti); + } + } + return dci_locations; +} + void generate_cce_location(srslte_regs_t* regs_, sched_dci_cce_t* location, uint32_t cfi, diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 5ecb87d36..5fc9902f5 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -101,8 +101,11 @@ sched_ue::sched_ue() : log_h(srslte::logmap::get("MAC")) void sched_ue::init(uint16_t rnti_, const std::vector& cell_list_params_) { - rnti = rnti_; - cell_params_list = &cell_list_params_; + rnti = rnti_; + cells.reserve(cell_list_params_.size()); + for (auto& c : cell_list_params_) { + cells.emplace_back(rnti_, c); + } Info("SCHED: Added user rnti=0x%x\n", rnti); } @@ -117,7 +120,7 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) Warning("Primary cc idx not provided in scheduler ue_cfg. Defaulting to cc_idx=0\n"); } // setup primary cc - main_cc_params = &(*cell_params_list)[primary_cc_idx]; + main_cc_params = cells[primary_cc_idx].cell_cfg; cell = main_cc_params->cfg.cell; max_msg3retx = main_cc_params->cfg.maxharq_msg3tx; } @@ -129,6 +132,11 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) // update bearer cfgs lch_handler.set_cfg(cfg_); + // update ue cells + for (auto& c : cells) { + c.set_ue_cfg(cfg); + } + // in case carriers have been removed while (carriers.size() > cfg.supported_cc_list.size()) { // TODO: distinguish cell deactivation from reconfiguration @@ -136,18 +144,15 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) } // in case carriers have been added or modified bool scell_activation_state_changed = false; - enb_ue_cc_idx_map.clear(); - enb_ue_cc_idx_map.resize(cell_params_list->size(), -1); for (uint32_t ue_idx = 0; ue_idx < cfg.supported_cc_list.size(); ++ue_idx) { - auto& cc_cfg = cfg.supported_cc_list[ue_idx]; - enb_ue_cc_idx_map[cc_cfg.enb_cc_idx] = ue_idx; + auto& cc_cfg = cfg.supported_cc_list[ue_idx]; if (ue_idx >= prev_supported_cc_list.size()) { // New carrier needs to be added - carriers.emplace_back(cfg, (*cell_params_list)[cc_cfg.enb_cc_idx], rnti, ue_idx, current_tti); + carriers.emplace_back(cfg, *cells[cc_cfg.enb_cc_idx].cell_cfg, rnti, ue_idx, current_tti); } else if (cc_cfg.enb_cc_idx != prev_supported_cc_list[ue_idx].enb_cc_idx) { // One carrier was added in the place of another - carriers[ue_idx] = cc_sched_ue{cfg, (*cell_params_list)[cc_cfg.enb_cc_idx], rnti, ue_idx, current_tti}; + carriers[ue_idx] = cc_sched_ue{cfg, *cells[cc_cfg.enb_cc_idx].cell_cfg, rnti, ue_idx, current_tti}; if (ue_idx == 0) { log_h->info("SCHED: rnti=0x%x PCell is now enb_cc_idx=%d.\n", rnti, cc_cfg.enb_cc_idx); } @@ -189,7 +194,7 @@ void sched_ue::new_subframe(tti_point tti_rx, uint32_t enb_cc_idx) cc.harq_ent.new_tti(tti_rx); } } - int ue_cc_idx = enb_ue_cc_idx_map[enb_cc_idx]; + int ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); if (ue_cc_idx >= 0) { carriers.at(ue_cc_idx).tpc_fsm.new_tti(); } @@ -1124,13 +1129,13 @@ srslte_dci_format_t sched_ue::get_dci_format() return ret; } -sched_dci_cce_t* sched_ue::get_locations(uint32_t enb_cc_idx, uint32_t cfi, uint32_t sf_idx) +const sched_dci_cce_t* sched_ue::get_locations(uint32_t enb_cc_idx, uint32_t cfi, uint32_t sf_idx) const { if (cfi > 0 && cfi <= 3) { - return &carriers[get_active_cell_index(enb_cc_idx).second].dci_locations[cfi - 1][sf_idx]; + return &cells[enb_cc_idx].dci_locations[cfi - 1][sf_idx]; } else { Error("SCHED: Invalid CFI=%d\n", cfi); - return &carriers[get_active_cell_index(enb_cc_idx).second].dci_locations[0][sf_idx]; + return &cells[enb_cc_idx].dci_locations[0][sf_idx]; } } @@ -1153,7 +1158,7 @@ std::bitset sched_ue::scell_activation_mask() const int sched_ue::enb_to_ue_cc_idx(uint32_t enb_cc_idx) const { - return enb_ue_cc_idx_map[enb_cc_idx]; + return cells.at(enb_cc_idx).get_ue_cc_idx(); } float diff_coderate_maxcoderate(int mcs, @@ -1243,13 +1248,6 @@ cc_sched_ue::cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, // set fixed mcs fixed_mcs_dl = cell_params->sched_cfg->pdsch_mcs; fixed_mcs_ul = cell_params->sched_cfg->pusch_mcs; - - // Generate allowed CCE locations - for (int cfi = 0; cfi < 3; cfi++) { - for (int sf_idx = 0; sf_idx < 10; sf_idx++) { - generate_cce_location(cell_params->regs.get(), &dci_locations[cfi][sf_idx], cfi + 1, sf_idx, rnti); - } - } } void cc_sched_ue::reset() diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc new file mode 100644 index 000000000..34df05d5c --- /dev/null +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -0,0 +1,32 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h" +#include "srsenb/hdr/stack/mac/sched_helpers.h" + +namespace srsenb { + +sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_) : + rnti(rnti_), cell_cfg(&cell_cfg_), dci_locations(generate_cce_location_table(rnti_, cell_cfg_)) +{} + +void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) +{ + ue_cfg = &ue_cfg_; + for (size_t i = 0; i < ue_cfg_.supported_cc_list.size(); ++i) { + if (ue_cfg_.supported_cc_list[i].enb_cc_idx == cell_cfg->enb_cc_idx) { + ue_cc_idx = i; + } + } +} + +} // namespace srsenb diff --git a/srsenb/test/mac/sched_grid_test.cc b/srsenb/test/mac/sched_grid_test.cc index 5b83c5b1d..b1c927589 100644 --- a/srsenb/test/mac/sched_grid_test.cc +++ b/srsenb/test/mac/sched_grid_test.cc @@ -69,9 +69,9 @@ int test_pdcch_one_ue() sched_ue.get_locations(ENB_CC_IDX, pdcch_grid_t::MAX_CFI, to_tx_dl(tti_rx).sf_idx())->nof_loc[aggr_idx]; // allocate DL user - uint32_t prev_cfi = pdcch.get_cfi(); - srsenb::sched_dci_cce_t* dci_cce = sched_ue.get_locations(ENB_CC_IDX, prev_cfi, to_tx_dl(tti_rx).sf_idx()); - uint32_t prev_nof_cce_locs = dci_cce->nof_loc[aggr_idx]; + uint32_t prev_cfi = pdcch.get_cfi(); + const srsenb::sched_dci_cce_t* dci_cce = sched_ue.get_locations(ENB_CC_IDX, prev_cfi, to_tx_dl(tti_rx).sf_idx()); + uint32_t prev_nof_cce_locs = dci_cce->nof_loc[aggr_idx]; TESTASSERT(pdcch.alloc_dci(alloc_type_t::DL_DATA, aggr_idx, &sched_ue)); TESTASSERT(pdcch.nof_allocs() == 1); From d4242f2db78d87c4284c40e7f56c1b6f025dcc16 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 15 Jan 2021 12:31:10 +0000 Subject: [PATCH 065/138] precompute nof_re_table[sf][prb][slot][cfi] for faster nof_re computation and for more accurate lower bound nof_re computation --- lib/include/srslte/phy/phch/ra_dl.h | 2 + lib/src/phy/phch/ra_dl.c | 7 +- srsenb/hdr/stack/mac/sched_common.h | 14 ++- srsenb/hdr/stack/mac/sched_helpers.h | 6 ++ srsenb/hdr/stack/mac/sched_ue.h | 10 +-- srsenb/src/stack/mac/sched_helpers.cc | 88 +++++++++++++++++++ srsenb/src/stack/mac/sched_ue.cc | 74 +++++++--------- .../stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 5 ++ 8 files changed, 154 insertions(+), 52 deletions(-) diff --git a/lib/include/srslte/phy/phch/ra_dl.h b/lib/include/srslte/phy/phch/ra_dl.h index ba81027d1..6968fafc4 100644 --- a/lib/include/srslte/phy/phch/ra_dl.h +++ b/lib/include/srslte/phy/phch/ra_dl.h @@ -48,6 +48,8 @@ srslte_ra_dl_grant_to_grant_prb_allocation(const srslte_dci_dl_t* dci, srslte_pd /** Functions used by the eNodeB scheduler */ SRSLTE_API uint32_t srslte_ra_dl_approx_nof_re(const srslte_cell_t* cell, uint32_t nof_prb, uint32_t nof_ctrl_symbols); +SRSLTE_API uint32_t ra_re_x_prb(const srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, uint32_t slot, uint32_t prb_idx); + SRSLTE_API uint32_t srslte_ra_dl_grant_nof_re(const srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, srslte_pdsch_grant_t* grant); diff --git a/lib/src/phy/phch/ra_dl.c b/lib/src/phy/phch/ra_dl.c index 0ff038f8f..6bcb98296 100644 --- a/lib/src/phy/phch/ra_dl.c +++ b/lib/src/phy/phch/ra_dl.c @@ -29,13 +29,8 @@ const int tbs_format1c_table[32] = {40, 56, 72, 120, 136, 144, 176, 208 296, 328, 336, 392, 488, 552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1224, 1288, 1384, 1480, 1608, 1736}; -/********** - * STATIC FUNCTIONS - * - **********/ - /* Returns the number of RE in a PRB in a slot and subframe */ -static uint32_t ra_re_x_prb(const srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, uint32_t slot, uint32_t prb_idx) +uint32_t ra_re_x_prb(const srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, uint32_t slot, uint32_t prb_idx) { uint32_t subframe = sf->tti % 10; diff --git a/srsenb/hdr/stack/mac/sched_common.h b/srsenb/hdr/stack/mac/sched_common.h index e1d7cda76..bd5e50224 100644 --- a/srsenb/hdr/stack/mac/sched_common.h +++ b/srsenb/hdr/stack/mac/sched_common.h @@ -47,8 +47,10 @@ public: const sched_interface::cell_cfg_t& cfg_, const sched_interface::sched_args_t& sched_args); // convenience getters - uint32_t prb_to_rbg(uint32_t nof_prbs) const { return srslte::ceil_div(nof_prbs, P); } + uint32_t nof_prbs_to_rbgs(uint32_t nof_prbs) const { return srslte::ceil_div(nof_prbs, P); } uint32_t nof_prb() const { return cfg.cell.nof_prb; } + uint32_t get_dl_lb_nof_re(tti_point tti_tx_dl, uint32_t nof_prbs_alloc) const; + uint32_t get_dl_nof_res(srslte::tti_point tti_tx_dl, const srslte_dci_dl_t& dci, uint32_t cfi) const; uint32_t enb_cc_idx = 0; sched_interface::cell_cfg_t cfg = {}; @@ -59,6 +61,16 @@ public: std::array nof_cce_table = {}; ///< map cfix -> nof cces in PDCCH uint32_t P = 0; uint32_t nof_rbgs = 0; + + using dl_nof_re_table = srslte::bounded_vector< + std::array, SRSLTE_NOF_SLOTS_PER_SF>, SRSLTE_NOF_SF_X_FRAME>, + SRSLTE_MAX_PRB>; + using dl_lb_nof_re_table = std::array, SRSLTE_NOF_SF_X_FRAME>; + + /// Table of nof REs + dl_nof_re_table nof_re_table; + /// Cached computation of Lower bound of nof REs + dl_lb_nof_re_table nof_re_lb_table; }; using ue_cce_locations_table = std::array, SRSLTE_NOF_CFI>; diff --git a/srsenb/hdr/stack/mac/sched_helpers.h b/srsenb/hdr/stack/mac/sched_helpers.h index 9da7e5fec..4cc1b8dd2 100644 --- a/srsenb/hdr/stack/mac/sched_helpers.h +++ b/srsenb/hdr/stack/mac/sched_helpers.h @@ -100,6 +100,12 @@ inline uint32_t count_prb_per_tb(const rbgmask_t& bitmask) return nof_prb; } +inline uint32_t count_prb_per_tb_approx(uint32_t nof_rbgs, uint32_t cell_nof_prb) +{ + uint32_t P = srslte_ra_type0_P(cell_nof_prb); + return std::min(nof_rbgs * P, cell_nof_prb); +} + ue_cce_locations_table generate_cce_location_table(uint16_t rnti, const sched_cell_params_t& cell_cfg); /** diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index 697c3136a..638e48f7c 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -39,7 +39,7 @@ struct cc_sched_ue { const static int SCHED_MAX_HARQ_PROC = FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS; cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, - const sched_cell_params_t& cell_cfg_, + const sched_ue_cell& cell_ue_, uint16_t rnti_, uint32_t ue_cc_idx, srslte::tti_point current_tti); @@ -51,9 +51,9 @@ struct cc_sched_ue { tbs_info alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul); tbs_info alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes); tbs_info alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int explicit_mcs = -1); - int get_required_prb_dl(uint32_t req_bytes, uint32_t nof_ctrl_symbols); + int get_required_prb_dl(tti_point tti_tx_dl, uint32_t req_bytes); uint32_t get_required_prb_ul(uint32_t req_bytes); - const sched_cell_params_t* get_cell_cfg() const { return cell_params; } + const sched_cell_params_t* get_cell_cfg() const { return cell_ue->cell_cfg; } uint32_t get_ue_cc_idx() const { return ue_cc_idx; } void set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi); int cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint32_t* mcs); @@ -79,8 +79,8 @@ struct cc_sched_ue { private: // config srslte::log_ref log_h; - const sched_interface::ue_cfg_t* cfg = nullptr; - const sched_cell_params_t* cell_params = nullptr; + const sched_interface::ue_cfg_t* cfg = nullptr; + const sched_ue_cell* cell_ue = nullptr; uint16_t rnti; uint32_t ue_cc_idx = 0; srslte::tti_point cfg_tti; diff --git a/srsenb/src/stack/mac/sched_helpers.cc b/srsenb/src/stack/mac/sched_helpers.cc index 1222597b3..05e7a6fe4 100644 --- a/srsenb/src/stack/mac/sched_helpers.cc +++ b/srsenb/src/stack/mac/sched_helpers.cc @@ -183,6 +183,54 @@ prb_interval prb_interval::riv_to_prbs(uint32_t riv, uint32_t nof_prbs, int nof_ * Sched Params *******************************************************/ +sched_cell_params_t::dl_nof_re_table generate_nof_re_table(const srslte_cell_t& cell) +{ + sched_cell_params_t::dl_nof_re_table table(cell.nof_prb); + + srslte_dl_sf_cfg_t dl_sf = {}; + dl_sf.sf_type = SRSLTE_SF_NORM; + dl_sf.tdd_config.configured = false; + + for (uint32_t cfi = 0; cfi < SRSLTE_NOF_CFI; ++cfi) { + dl_sf.cfi = cfi + 1; + for (uint32_t sf_idx = 0; sf_idx < SRSLTE_NOF_SF_X_FRAME; ++sf_idx) { + dl_sf.tti = sf_idx; + for (uint32_t s = 0; s < SRSLTE_NOF_SLOTS_PER_SF; ++s) { + for (uint32_t n = 0; n < cell.nof_prb; ++n) { + table[n][sf_idx][s][cfi] = ra_re_x_prb(&cell, &dl_sf, s, n); + } + } + } + } + return table; +} + +sched_cell_params_t::dl_lb_nof_re_table get_lb_nof_re_x_prb(const sched_cell_params_t::dl_nof_re_table& table) +{ + sched_cell_params_t::dl_lb_nof_re_table ret; + for (uint32_t sf_idx = 0; sf_idx < SRSLTE_NOF_SF_X_FRAME; ++sf_idx) { + ret[sf_idx].resize(table.size()); + srslte::bounded_vector re_prb_vec(table.size()); + for (uint32_t p = 0; p < table.size(); ++p) { + for (uint32_t s = 0; s < SRSLTE_NOF_SLOTS_PER_SF; ++s) { + re_prb_vec[p] += table[p][sf_idx][s][SRSLTE_NOF_CFI - 1]; + } + } + srslte::bounded_vector re_prb_vec2(re_prb_vec); + ret[sf_idx][0] = *std::min_element(re_prb_vec2.begin(), re_prb_vec2.end()); + for (uint32_t p = 1; p < table.size(); ++p) { + std::transform(re_prb_vec2.begin(), + re_prb_vec2.end() - 1, + re_prb_vec.begin() + p, + re_prb_vec2.begin(), + std::plus()); + re_prb_vec2.pop_back(); + ret[sf_idx][p] = *std::min_element(re_prb_vec2.begin(), re_prb_vec2.end()); + } + } + return ret; +} + void sched_cell_params_t::regs_deleter::operator()(srslte_regs_t* p) { if (p != nullptr) { @@ -269,9 +317,49 @@ bool sched_cell_params_t::set_cfg(uint32_t enb_cc_id P = srslte_ra_type0_P(cfg.cell.nof_prb); nof_rbgs = srslte::ceil_div(cfg.cell.nof_prb, P); + nof_re_table = generate_nof_re_table(cfg.cell); + nof_re_lb_table = get_lb_nof_re_x_prb(nof_re_table); + return true; } +uint32_t sched_cell_params_t::get_dl_lb_nof_re(tti_point tti_tx_dl, uint32_t nof_prbs_alloc) const +{ + assert(nof_prbs_alloc <= nof_prb()); + if (nof_prbs_alloc == 0) { + return 0; + } + uint32_t sf_idx = tti_tx_dl.sf_idx(); + uint32_t nof_re = nof_re_lb_table[sf_idx][nof_prbs_alloc - 1]; + + // sanity check + assert(nof_re <= srslte_ra_dl_approx_nof_re(&cfg.cell, nof_prbs_alloc, SRSLTE_NOF_CFI)); + return nof_re; +} + +uint32_t +sched_cell_params_t::get_dl_nof_res(srslte::tti_point tti_tx_dl, const srslte_dci_dl_t& dci, uint32_t cfi) const +{ + srslte_pdsch_grant_t grant = {}; + srslte_dl_sf_cfg_t dl_sf = {}; + dl_sf.cfi = cfi; + dl_sf.tti = tti_tx_dl.to_uint(); + srslte_ra_dl_grant_to_grant_prb_allocation(&dci, &grant, nof_prb()); + + uint32_t nof_re = 0; + for (uint32_t p = 0; p < nof_prb(); ++p) { + for (uint32_t s = 0; s < SRSLTE_NOF_SLOTS_PER_SF; ++s) { + if (grant.prb_idx[s][p]) { + nof_re += nof_re_table[p][tti_tx_dl.sf_idx()][s][cfi - 1]; + } + } + } + + // sanity check + assert(nof_re == srslte_ra_dl_grant_nof_re(&cfg.cell, &dl_sf, &grant)); + return nof_re; +} + ue_cce_locations_table generate_cce_location_table(uint16_t rnti, const sched_cell_params_t& cell_cfg) { ue_cce_locations_table dci_locations; diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 5fc9902f5..f665a7cbd 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -149,10 +149,10 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) if (ue_idx >= prev_supported_cc_list.size()) { // New carrier needs to be added - carriers.emplace_back(cfg, *cells[cc_cfg.enb_cc_idx].cell_cfg, rnti, ue_idx, current_tti); + carriers.emplace_back(cfg, cells[cc_cfg.enb_cc_idx], rnti, ue_idx, current_tti); } else if (cc_cfg.enb_cc_idx != prev_supported_cc_list[ue_idx].enb_cc_idx) { // One carrier was added in the place of another - carriers[ue_idx] = cc_sched_ue{cfg, *cells[cc_cfg.enb_cc_idx].cell_cfg, rnti, ue_idx, current_tti}; + carriers[ue_idx] = cc_sched_ue{cfg, cells[cc_cfg.enb_cc_idx], rnti, ue_idx, current_tti}; if (ue_idx == 0) { log_h->info("SCHED: rnti=0x%x PCell is now enb_cc_idx=%d.\n", rnti, cc_cfg.enb_cc_idx); } @@ -558,12 +558,7 @@ tbs_info sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_idx, srslte::interval req_bytes = get_requested_dl_bytes(ue_cc_idx); // Calculate exact number of RE for this PRB allocation - srslte_pdsch_grant_t grant = {}; - srslte_dl_sf_cfg_t dl_sf = {}; - dl_sf.cfi = cfi; - dl_sf.tti = tti_tx_dl.to_uint(); - srslte_ra_dl_grant_to_grant_prb_allocation(&dci, &grant, carriers[ue_cc_idx].get_cell_cfg()->nof_prb()); - uint32_t nof_re = srslte_ra_dl_grant_nof_re(&carriers[ue_cc_idx].get_cell_cfg()->cfg.cell, &dl_sf, &grant); + uint32_t nof_re = carriers[ue_cc_idx].get_cell_cfg()->get_dl_nof_res(tti_tx_dl, dci, cfi); // Compute MCS+TBS tbs_info tb = carriers[ue_cc_idx].alloc_tbs_dl(nof_alloc_prbs, nof_re, req_bytes.stop()); @@ -831,9 +826,8 @@ rbg_interval sched_ue::get_required_dl_rbgs(uint32_t ue_cc_idx) if (req_bytes == srslte::interval{0, 0}) { return {0, 0}; } - const auto* cellparams = carriers[ue_cc_idx].get_cell_cfg(); - int pending_prbs = - carriers[ue_cc_idx].get_required_prb_dl(req_bytes.start(), cellparams->sched_cfg->max_nof_ctrl_symbols); + const auto* cellparams = carriers[ue_cc_idx].get_cell_cfg(); + int pending_prbs = carriers[ue_cc_idx].get_required_prb_dl(to_tx_dl(current_tti), req_bytes.start()); if (pending_prbs < 0) { // Cannot fit allocation in given PRBs log_h->error("SCHED: DL CQI=%d does now allow fitting %d non-segmentable DL tx bytes into the cell bandwidth. " @@ -842,10 +836,10 @@ rbg_interval sched_ue::get_required_dl_rbgs(uint32_t ue_cc_idx) req_bytes.start()); return {cellparams->nof_prb(), cellparams->nof_prb()}; } - uint32_t min_pending_rbg = cellparams->prb_to_rbg(pending_prbs); - pending_prbs = carriers[ue_cc_idx].get_required_prb_dl(req_bytes.stop(), cellparams->sched_cfg->max_nof_ctrl_symbols); - pending_prbs = (pending_prbs < 0) ? cellparams->nof_prb() : pending_prbs; - uint32_t max_pending_rbg = cellparams->prb_to_rbg(pending_prbs); + uint32_t min_pending_rbg = cellparams->nof_prbs_to_rbgs(pending_prbs); + pending_prbs = carriers[ue_cc_idx].get_required_prb_dl(to_tx_dl(current_tti), req_bytes.stop()); + pending_prbs = (pending_prbs < 0) ? cellparams->nof_prb() : pending_prbs; + uint32_t max_pending_rbg = cellparams->nof_prbs_to_rbgs(pending_prbs); return {min_pending_rbg, max_pending_rbg}; } @@ -922,12 +916,9 @@ uint32_t sched_ue::get_pending_dl_rlc_data() const uint32_t sched_ue::get_expected_dl_bitrate(uint32_t ue_cc_idx, int nof_rbgs) const { - const cc_sched_ue* cc = &carriers[ue_cc_idx]; - auto* cell_cfg = carriers[ue_cc_idx].get_cell_cfg(); - uint32_t nof_prbs_alloc = nof_rbgs < 0 ? cell_cfg->nof_prb() : std::min(nof_rbgs * cell_cfg->P, cell_cfg->nof_prb()); - - uint32_t nof_re = - srslte_ra_dl_approx_nof_re(&cell_cfg->cfg.cell, nof_prbs_alloc, cell_cfg->sched_cfg->max_nof_ctrl_symbols); + const cc_sched_ue* cc = &carriers[ue_cc_idx]; + uint32_t nof_re = cc->get_cell_cfg()->get_dl_lb_nof_re( + to_tx_dl(current_tti), count_prb_per_tb_approx(nof_rbgs, cc->get_cell_cfg()->nof_prb())); float max_coderate = srslte_cqi_to_coderate(std::min(cc->dl_cqi + 1u, 15u), cfg.use_tbs_index_alt); // Inverse of srslte_coderate(tbs, nof_re) @@ -1227,27 +1218,29 @@ int cc_sched_ue::cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint3 ***********************************************************************************************/ cc_sched_ue::cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, - const sched_cell_params_t& cell_cfg_, + const sched_ue_cell& cell_ue_, uint16_t rnti_, uint32_t ue_cc_idx_, tti_point current_tti) : - cell_params(&cell_cfg_), + cell_ue(&cell_ue_), rnti(rnti_), - log_h(srslte::logmap::get("MAC ")), + log_h(srslte::logmap::get("MAC")), ue_cc_idx(ue_cc_idx_), last_tti(current_tti), harq_ent(SCHED_MAX_HARQ_PROC, SCHED_MAX_HARQ_PROC), - tpc_fsm(cell_cfg_.nof_prb(), cell_cfg_.cfg.target_ul_sinr, cell_cfg_.cfg.enable_phr_handling) + tpc_fsm(cell_ue_.cell_cfg->nof_prb(), + cell_ue_.cell_cfg->cfg.target_ul_sinr, + cell_ue_.cell_cfg->cfg.enable_phr_handling) { dl_cqi_rx = false; - dl_cqi = (ue_cc_idx == 0) ? cell_params->cfg.initial_dl_cqi : 0; + dl_cqi = (ue_cc_idx == 0) ? cell_ue_.cell_cfg->cfg.initial_dl_cqi : 0; set_cfg(cfg_); - max_aggr_level = cell_params->sched_cfg->max_aggr_level >= 0 ? cell_params->sched_cfg->max_aggr_level : 3; + max_aggr_level = cell_ue->cell_cfg->sched_cfg->max_aggr_level >= 0 ? cell_ue->cell_cfg->sched_cfg->max_aggr_level : 3; // set fixed mcs - fixed_mcs_dl = cell_params->sched_cfg->pdsch_mcs; - fixed_mcs_ul = cell_params->sched_cfg->pusch_mcs; + fixed_mcs_dl = cell_ue->cell_cfg->sched_cfg->pdsch_mcs; + fixed_mcs_ul = cell_ue->cell_cfg->sched_cfg->pusch_mcs; } void cc_sched_ue::reset() @@ -1269,12 +1262,13 @@ void cc_sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_) cfg_tti = last_tti; // set max mcs - max_mcs_ul = cell_params->sched_cfg->pusch_max_mcs >= 0 ? cell_params->sched_cfg->pusch_max_mcs : 28u; - if (cell_params->cfg.enable_64qam) { + max_mcs_ul = get_cell_cfg()->sched_cfg->pusch_max_mcs >= 0 ? get_cell_cfg()->sched_cfg->pusch_max_mcs : 28u; + if (get_cell_cfg()->cfg.enable_64qam) { const uint32_t max_64qam_mcs[] = {20, 24, 28}; max_mcs_ul = std::min(max_mcs_ul, max_64qam_mcs[(size_t)cfg->support_ul64qam]); } - max_mcs_dl = cell_params->sched_cfg->pdsch_max_mcs >= 0 ? std::min(cell_params->sched_cfg->pdsch_max_mcs, 28) : 28u; + max_mcs_dl = + get_cell_cfg()->sched_cfg->pdsch_max_mcs >= 0 ? std::min(get_cell_cfg()->sched_cfg->pdsch_max_mcs, 28) : 28u; if (cfg->use_tbs_index_alt) { max_mcs_dl = std::min(max_mcs_dl, 27u); } @@ -1325,7 +1319,7 @@ void cc_sched_ue::finish_tti(tti_point tti_rx) uint32_t cc_sched_ue::get_aggr_level(uint32_t nof_bits) { - return srsenb::get_aggr_level(nof_bits, dl_cqi, max_aggr_level, cell_params->nof_prb(), cfg->use_tbs_index_alt); + return srsenb::get_aggr_level(nof_bits, dl_cqi, max_aggr_level, get_cell_cfg()->nof_prb(), cfg->use_tbs_index_alt); } /* In this scheduler we tend to use all the available bandwidth and select the MCS @@ -1407,16 +1401,16 @@ tbs_info cc_sched_ue::alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t r return ret; } -int cc_sched_ue::get_required_prb_dl(uint32_t req_bytes, uint32_t nof_ctrl_symbols) +int cc_sched_ue::get_required_prb_dl(tti_point tti_tx_dl, uint32_t req_bytes) { - auto compute_tbs_approx = [this, nof_ctrl_symbols](uint32_t nof_prb) { - uint32_t nof_re = srslte_ra_dl_approx_nof_re(&cell_params->cfg.cell, nof_prb, nof_ctrl_symbols); + auto compute_tbs_approx = [tti_tx_dl, this](uint32_t nof_prb) { + uint32_t nof_re = cell_ue->cell_cfg->get_dl_lb_nof_re(tti_tx_dl, nof_prb); tbs_info tb = alloc_tbs_dl(nof_prb, nof_re, 0); return tb.tbs_bytes; }; std::tuple ret = false_position_method( - 1u, cell_params->nof_prb(), (int)req_bytes, compute_tbs_approx, [](int y) { return y == SRSLTE_ERROR; }); + 1u, get_cell_cfg()->nof_prb(), (int)req_bytes, compute_tbs_approx, [](int y) { return y == SRSLTE_ERROR; }); int upper_tbs = std::get<3>(ret); uint32_t upper_nprb = std::get<2>(ret); return (upper_tbs < 0) ? 0 : ((upper_tbs < (int)req_bytes) ? -1 : upper_nprb); @@ -1429,17 +1423,17 @@ uint32_t cc_sched_ue::get_required_prb_ul(uint32_t req_bytes) } auto compute_tbs_approx = [this](uint32_t nof_prb) { const uint32_t N_srs = 0; - uint32_t nof_re = (2 * (SRSLTE_CP_NSYMB(cell_params->cfg.cell.cp) - 1) - N_srs) * nof_prb * SRSLTE_NRE; + uint32_t nof_re = (2 * (SRSLTE_CP_NSYMB(get_cell_cfg()->cfg.cell.cp) - 1) - N_srs) * nof_prb * SRSLTE_NRE; return alloc_tbs_ul(nof_prb, nof_re, 0).tbs_bytes; }; // find nof prbs that lead to a tbs just above req_bytes int target_tbs = req_bytes + 4; - uint32_t max_prbs = std::min(tpc_fsm.max_ul_prbs(), cell_params->nof_prb()); + uint32_t max_prbs = std::min(tpc_fsm.max_ul_prbs(), get_cell_cfg()->nof_prb()); std::tuple ret = false_position_method(1u, max_prbs, target_tbs, compute_tbs_approx, [](int y) { return y == SRSLTE_ERROR; }); uint32_t req_prbs = std::get<2>(ret); - while (!srslte_dft_precoding_valid_prb(req_prbs) && req_prbs < cell_params->nof_prb()) { + while (!srslte_dft_precoding_valid_prb(req_prbs) && req_prbs < get_cell_cfg()->nof_prb()) { req_prbs++; } return req_prbs; diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index 34df05d5c..554819cd1 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -12,9 +12,14 @@ #include "srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h" #include "srsenb/hdr/stack/mac/sched_helpers.h" +#include namespace srsenb { +/******************************************************* + * sched_ue_cell + *******************************************************/ + sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_) : rnti(rnti_), cell_cfg(&cell_cfg_), dci_locations(generate_cce_location_table(rnti_, cell_cfg_)) {} From 5391001c46d02dca2df11ed07d80a22133ffdd43 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 15 Jan 2021 13:36:43 +0000 Subject: [PATCH 066/138] remove unused variable --- srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h | 1 - srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index 0806d745a..e576cc856 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -34,7 +34,6 @@ struct sched_ue_cell { const ue_cce_locations_table dci_locations; private: - uint16_t rnti = SRSLTE_INVALID_RNTI; const sched_interface::ue_cfg_t* ue_cfg = nullptr; int ue_cc_idx = -1; }; diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index 554819cd1..80b8b8ab0 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -21,7 +21,7 @@ namespace srsenb { *******************************************************/ sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_) : - rnti(rnti_), cell_cfg(&cell_cfg_), dci_locations(generate_cce_location_table(rnti_, cell_cfg_)) + cell_cfg(&cell_cfg_), dci_locations(generate_cce_location_table(rnti_, cell_cfg_)) {} void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) From 0780f3caea442f6d6be61750b67122a814ba0001 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Fri, 15 Jan 2021 10:59:39 +0100 Subject: [PATCH 067/138] pdu_queue must be non-blocking in order to avoid the ue or enb to block in the event of a memory leak and the buffer pool running out of buffers. In that case, the null return shall be handled properly and error logged. This commit restores commit c4c44c33f41c0be8c752261c958b4b03e34d02f5. --- lib/src/mac/pdu_queue.cc | 18 ++++++++++-------- srsenb/src/stack/mac/mac.cc | 6 +++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/src/mac/pdu_queue.cc b/lib/src/mac/pdu_queue.cc index bd8628b0e..fa8b201ca 100644 --- a/lib/src/mac/pdu_queue.cc +++ b/lib/src/mac/pdu_queue.cc @@ -27,19 +27,21 @@ uint8_t* pdu_queue::request(uint32_t len) ERROR("Error request buffer of invalid size %d. Max bytes %d\n", len, MAX_PDU_LEN); return NULL; } - pdu_t* pdu = pool.allocate("pdu_queue::request", true); - if (!pdu) { + // This function must be non-blocking. In case we run out of buffers, it shall handle the error properly + pdu_t* pdu = pool.allocate("pdu_queue::request", false); + if (pdu) { + if ((void*)pdu->ptr != (void*)pdu) { + ERROR("Fatal error in memory alignment in struct pdu_queue::pdu_t\n"); + exit(-1); + } + return pdu->ptr; + } else { if (log_h) { log_h->error("Not enough buffers for MAC PDU\n"); } ERROR("Not enough buffers for MAC PDU\n"); + return nullptr; } - if ((void*)pdu->ptr != (void*)pdu) { - ERROR("Fatal error in memory alignment in struct pdu_queue::pdu_t\n"); - exit(-1); - } - - return pdu->ptr; } void pdu_queue::deallocate(const uint8_t* pdu) diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 84d527614..2b7abc3b4 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -907,7 +907,11 @@ int mac::get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res_list) srslte_softbuffer_rx_reset_tbs(phy_ul_sched_res->pusch[n].softbuffer_rx, sched_result.pusch[i].tbs * 8); } phy_ul_sched_res->pusch[n].data = ue_db[rnti]->request_buffer(sched_result.pusch[i].tbs); - phy_ul_sched_res->nof_grants++; + if (phy_ul_sched_res->pusch[n].data) { + phy_ul_sched_res->nof_grants++; + } else { + Error("Grant for rnti=0x%x could not be allocated due to lack of buffers\n", rnti); + } n++; } else { Warning("Invalid UL scheduling result. User 0x%x does not exist\n", rnti); From e413086576799fc6fb32ebc29e49695806aa9b01 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 19 Jan 2021 12:22:36 +0100 Subject: [PATCH 068/138] Limit the number of UL buffers in MAC and deallocate old ones --- srsenb/hdr/stack/mac/ue.h | 10 +++++++--- srsenb/src/stack/mac/mac.cc | 6 +++--- srsenb/src/stack/mac/ue.cc | 35 +++++++++++++++++++++++++++++------ 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/srsenb/hdr/stack/mac/ue.h b/srsenb/hdr/stack/mac/ue.h index f8e9b7b9f..3dde41198 100644 --- a/srsenb/hdr/stack/mac/ue.h +++ b/srsenb/hdr/stack/mac/ue.h @@ -15,6 +15,7 @@ #include "mac_metrics.h" #include "srslte/common/block_queue.h" +#include "srslte/adt/circular_array.h" #include "srslte/common/log.h" #include "srslte/common/mac_pcap.h" #include "srslte/interfaces/enb_interfaces.h" @@ -71,10 +72,10 @@ public: srslte_softbuffer_rx_t* get_rx_softbuffer(const uint32_t ue_cc_idx, const uint32_t tti); bool process_pdus(); - uint8_t* request_buffer(const uint32_t len); + uint8_t* request_buffer(uint32_t tti, const uint32_t len); void process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channel_t channel) override; - void push_pdu(const uint8_t* pdu_ptr, uint32_t len); - void deallocate_pdu(const uint8_t* pdu_ptr); + void push_pdu(uint32_t tti, const uint8_t* pdu_ptr, uint32_t len); + void deallocate_pdu(uint32_t tti, const uint8_t* pdu_ptr); void metrics_read(mac_ue_metrics_t* metrics_); void metrics_rx(bool crc, uint32_t tbs); @@ -122,6 +123,9 @@ private: std::vector, SRSLTE_FDD_NOF_HARQ> > tx_payload_buffer; + // Save 2 buffers per HARQ process + srslte::circular_array rx_used_buffers; + srslte::block_queue pending_ta_commands; ta ta_fsm; diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 2b7abc3b4..0d7cd86cb 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -334,11 +334,11 @@ int mac::push_pdu(uint32_t tti_rx, uint16_t rnti, const uint8_t* pdu_ptr, uint32 // push the pdu through the queue if received correctly if (crc) { Info("Pushing PDU rnti=0x%x, tti_rx=%d, nof_bytes=%d\n", rnti, tti_rx, nof_bytes); - ue_db[rnti]->push_pdu(pdu_ptr, nof_bytes); + ue_db[rnti]->push_pdu(tti_rx, pdu_ptr, nof_bytes); stack_task_queue.push([this]() { process_pdus(); }); } else { Debug("Discarting PDU rnti=0x%x, tti_rx=%d, nof_bytes=%d\n", rnti, tti_rx, nof_bytes); - ue_db[rnti]->deallocate_pdu(pdu_ptr); + ue_db[rnti]->deallocate_pdu(tti_rx, pdu_ptr); } return SRSLTE_SUCCESS; } @@ -906,7 +906,7 @@ int mac::get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res_list) if (sched_result.pusch[n].current_tx_nb == 0) { srslte_softbuffer_rx_reset_tbs(phy_ul_sched_res->pusch[n].softbuffer_rx, sched_result.pusch[i].tbs * 8); } - phy_ul_sched_res->pusch[n].data = ue_db[rnti]->request_buffer(sched_result.pusch[i].tbs); + phy_ul_sched_res->pusch[n].data = ue_db[rnti]->request_buffer(tti_tx_ul, sched_result.pusch[i].tbs); if (phy_ul_sched_res->pusch[n].data) { phy_ul_sched_res->nof_grants++; } else { diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index d0e99c2a9..ef1b32041 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -161,14 +161,27 @@ ue::get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, con return &softbuffer_tx.at(ue_cc_idx).at((harq_process * SRSLTE_MAX_TB + tb_idx) % nof_tx_harq_proc); } -uint8_t* ue::request_buffer(const uint32_t len) +uint8_t* ue::request_buffer(uint32_t tti, const uint32_t len) { + uint8_t* pdu = nullptr; if (len > 0) { - return pdus.request(len); + pdu = pdus.request(len); + if (pdu) { + // Deallocate oldest buffer if we didn't deallocate it + if (rx_used_buffers[tti] != nullptr) { + pdus.deallocate(rx_used_buffers[tti]); + rx_used_buffers[tti] = nullptr; + log_h->warning("buffers: RX PDU of rnti=0x%x and pid=%d wasn't deallocated\n", rnti, tti % nof_rx_harq_proc); + } + rx_used_buffers[tti] = pdu; + log_h->info("RX PDU saved for pid=%d\n", tti % nof_rx_harq_proc); + } else { + log_h->error("buffers: Requesting buffer from pool\n"); + } } else { - log_h->warning("Requesting buffer for zero bytes\n"); - return nullptr; + printf("buffers: Requesting buffer for zero bytes\n"); } + return pdu; } bool ue::process_pdus() @@ -293,18 +306,28 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe Debug("MAC PDU processed\n"); } -void ue::deallocate_pdu(const uint8_t* pdu_ptr) +void ue::deallocate_pdu(uint32_t tti, const uint8_t* pdu_ptr) { if (pdu_ptr) { + if (rx_used_buffers[tti] == pdu_ptr) { + rx_used_buffers[tti] = nullptr; + } else { + Warning("buffers: Unexpected RX PDU pointer in deallocate_pdu for rnti=0x%x pid=%d\n", rnti, tti % nof_rx_harq_proc); + } pdus.deallocate(pdu_ptr); } else { Error("Error deallocating PDU: null ptr\n"); } } -void ue::push_pdu(const uint8_t* pdu_ptr, uint32_t len) +void ue::push_pdu(uint32_t tti, const uint8_t* pdu_ptr, uint32_t len) { if (pdu_ptr && len > 0) { + if (rx_used_buffers[tti] == pdu_ptr) { + rx_used_buffers[tti] = nullptr; + } else { + Warning("buffers: Unexpected RX PDU pointer in push_pdu for rnti=0x%x pid=%d\n", rnti, tti % nof_rx_harq_proc); + } pdus.push(pdu_ptr, len); } else { Error("Error pushing PDU: ptr=%p, len=%d\n", pdu_ptr, len); From f7d97d0d7beb390899a6f61547d8ef46bb4a6dfe Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 19 Jan 2021 15:33:11 +0100 Subject: [PATCH 069/138] Release pointer even if length is zero --- srsenb/src/stack/mac/ue.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index ef1b32041..41ccc9425 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -322,15 +322,19 @@ void ue::deallocate_pdu(uint32_t tti, const uint8_t* pdu_ptr) void ue::push_pdu(uint32_t tti, const uint8_t* pdu_ptr, uint32_t len) { - if (pdu_ptr && len > 0) { + if (pdu_ptr) { if (rx_used_buffers[tti] == pdu_ptr) { rx_used_buffers[tti] = nullptr; } else { Warning("buffers: Unexpected RX PDU pointer in push_pdu for rnti=0x%x pid=%d\n", rnti, tti % nof_rx_harq_proc); } - pdus.push(pdu_ptr, len); + if (len > 0) { + pdus.push(pdu_ptr, len); + } else { + Error("Error pushing PDU: null length\n"); + } } else { - Error("Error pushing PDU: ptr=%p, len=%d\n", pdu_ptr, len); + Error("Error pushing PDU: null pointer\n"); } } From e5df35304d4d6574df8136c0310ff059b1a52f94 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 19 Jan 2021 16:58:56 +0100 Subject: [PATCH 070/138] Fix issue with new way of managing ul buffers not working with CA --- .../srslte/interfaces/enb_interfaces.h | 4 +- srsenb/hdr/stack/enb_stack_lte.h | 4 +- srsenb/hdr/stack/mac/mac.h | 2 +- srsenb/hdr/stack/mac/ue.h | 8 +-- srsenb/src/phy/lte/cc_worker.cc | 2 +- srsenb/src/stack/mac/mac.cc | 16 ++++-- srsenb/src/stack/mac/ue.cc | 54 +++++++++++-------- srsenb/test/phy/enb_phy_test.cc | 2 +- 8 files changed, 54 insertions(+), 38 deletions(-) diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index b7945afb2..d93a84c9c 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -177,12 +177,12 @@ public: * * @param tti the given TTI * @param rnti the UE identifier in the eNb - * @param pdu_ptr pointer to the uplink buffer + * @param enb_cc_idx the eNb Cell/Carrier identifier * @param nof_bytes the number of grants carrierd by the PUSCH message * @param crc_res the CRC check, set to true if the message was decoded succesfully * @return SRSLTE_SUCCESS if no error occurs, SRSLTE_ERROR* if an error occurs */ - virtual int push_pdu(uint32_t tti_rx, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc_res) = 0; + virtual int push_pdu(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) = 0; virtual int get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res) = 0; virtual int get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res) = 0; diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index 8929bbfc6..62d96cc68 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -80,9 +80,9 @@ public: { return mac.crc_info(tti, rnti, enb_cc_idx, nof_bytes, crc_res); } - int push_pdu(uint32_t tti, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc_res) final + int push_pdu(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) final { - return mac.push_pdu(tti, rnti, pdu_ptr, nof_bytes, crc_res); + return mac.push_pdu(tti, rnti, enb_cc_idx, nof_bytes, crc_res); } int get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res) final { return mac.get_dl_sched(tti, dl_sched_res); } int get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res) final diff --git a/srsenb/hdr/stack/mac/mac.h b/srsenb/hdr/stack/mac/mac.h index 6f6a72a08..0aa6c1832 100644 --- a/srsenb/hdr/stack/mac/mac.h +++ b/srsenb/hdr/stack/mac/mac.h @@ -56,7 +56,7 @@ public: int ta_info(uint32_t tti, uint16_t rnti, float ta_us) override; int ack_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t tb_idx, bool ack) override; int crc_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) override; - int push_pdu(uint32_t tti, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc_res) override; + int push_pdu(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) override; int get_dl_sched(uint32_t tti_tx_dl, dl_sched_list_t& dl_sched_res) override; int get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res) override; diff --git a/srsenb/hdr/stack/mac/ue.h b/srsenb/hdr/stack/mac/ue.h index 3dde41198..6eae19f1f 100644 --- a/srsenb/hdr/stack/mac/ue.h +++ b/srsenb/hdr/stack/mac/ue.h @@ -72,10 +72,10 @@ public: srslte_softbuffer_rx_t* get_rx_softbuffer(const uint32_t ue_cc_idx, const uint32_t tti); bool process_pdus(); - uint8_t* request_buffer(uint32_t tti, const uint32_t len); + uint8_t* request_buffer(uint32_t tti, uint32_t ue_cc_idx, const uint32_t len); void process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channel_t channel) override; - void push_pdu(uint32_t tti, const uint8_t* pdu_ptr, uint32_t len); - void deallocate_pdu(uint32_t tti, const uint8_t* pdu_ptr); + void push_pdu(uint32_t tti, uint32_t ue_cc_idx, uint32_t len); + void deallocate_pdu(uint32_t tti, uint32_t ue_cc_idx); void metrics_read(mac_ue_metrics_t* metrics_); void metrics_rx(bool crc, uint32_t tbs); @@ -124,7 +124,7 @@ private: tx_payload_buffer; // Save 2 buffers per HARQ process - srslte::circular_array rx_used_buffers; + std::vector > rx_used_buffers; srslte::block_queue pending_ta_commands; ta ta_fsm; diff --git a/srsenb/src/phy/lte/cc_worker.cc b/srsenb/src/phy/lte/cc_worker.cc index 0c568d39b..1d04fd282 100644 --- a/srsenb/src/phy/lte/cc_worker.cc +++ b/srsenb/src/phy/lte/cc_worker.cc @@ -374,7 +374,7 @@ void cc_worker::decode_pusch(stack_interface_phy_lte::ul_sched_grant_t* grants, // Inform MAC about the CRC result phy->stack->crc_info(tti_rx, rnti, cc_idx, ul_cfg.pusch.grant.tb.tbs / 8, pusch_res.crc); // Push PDU buffer - phy->stack->push_pdu(tti_rx, rnti, grants[i].data, ul_cfg.pusch.grant.tb.tbs / 8, pusch_res.crc); + phy->stack->push_pdu(tti_rx, rnti, cc_idx, ul_cfg.pusch.grant.tb.tbs / 8, pusch_res.crc); // Logging if (log_h->get_level() >= srslte::LOG_LEVEL_INFO) { char str[512]; diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 0d7cd86cb..953e3c116 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -323,7 +323,7 @@ int mac::crc_info(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, uint32_t return scheduler.ul_crc_info(tti_rx, rnti, enb_cc_idx, crc); } -int mac::push_pdu(uint32_t tti_rx, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc) +int mac::push_pdu(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc) { srslte::rwlock_read_guard lock(rwlock); @@ -331,14 +331,21 @@ int mac::push_pdu(uint32_t tti_rx, uint16_t rnti, const uint8_t* pdu_ptr, uint32 return SRSLTE_ERROR; } + std::array enb_ue_cc_map = scheduler.get_enb_ue_cc_map(rnti); + if (enb_ue_cc_map[enb_cc_idx] < 0) { + Error("User rnti=0x%x is not activated for carrier %d\n", rnti, enb_cc_idx); + return SRSLTE_ERROR; + } + uint32_t ue_cc_idx = enb_ue_cc_map[enb_cc_idx]; + // push the pdu through the queue if received correctly if (crc) { Info("Pushing PDU rnti=0x%x, tti_rx=%d, nof_bytes=%d\n", rnti, tti_rx, nof_bytes); - ue_db[rnti]->push_pdu(tti_rx, pdu_ptr, nof_bytes); + ue_db[rnti]->push_pdu(tti_rx, ue_cc_idx, nof_bytes); stack_task_queue.push([this]() { process_pdus(); }); } else { Debug("Discarting PDU rnti=0x%x, tti_rx=%d, nof_bytes=%d\n", rnti, tti_rx, nof_bytes); - ue_db[rnti]->deallocate_pdu(tti_rx, pdu_ptr); + ue_db[rnti]->deallocate_pdu(tti_rx, ue_cc_idx); } return SRSLTE_SUCCESS; } @@ -906,7 +913,8 @@ int mac::get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res_list) if (sched_result.pusch[n].current_tx_nb == 0) { srslte_softbuffer_rx_reset_tbs(phy_ul_sched_res->pusch[n].softbuffer_rx, sched_result.pusch[i].tbs * 8); } - phy_ul_sched_res->pusch[n].data = ue_db[rnti]->request_buffer(tti_tx_ul, sched_result.pusch[i].tbs); + phy_ul_sched_res->pusch[n].data = + ue_db[rnti]->request_buffer(tti_tx_ul, sched_result.pusch[i].dci.ue_cc_idx, sched_result.pusch[i].tbs); if (phy_ul_sched_res->pusch[n].data) { phy_ul_sched_res->nof_grants++; } else { diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index 41ccc9425..092a08c4a 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -44,6 +44,7 @@ ue::ue(uint16_t rnti_, pdus(128), nof_rx_harq_proc(nof_rx_harq_proc_), nof_tx_harq_proc(nof_tx_harq_proc_), + rx_used_buffers(nof_cells_), ta_fsm(this) { srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance(); @@ -94,6 +95,15 @@ void ue::reset() srslte_softbuffer_tx_reset(&buffer); } } + + for (auto& rx_buffers_cc : rx_used_buffers) { + for (auto& ptr : rx_buffers_cc) { + if (ptr) { + pdus.deallocate(ptr); + ptr = nullptr; + } + } + } } /** @@ -161,19 +171,19 @@ ue::get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, con return &softbuffer_tx.at(ue_cc_idx).at((harq_process * SRSLTE_MAX_TB + tb_idx) % nof_tx_harq_proc); } -uint8_t* ue::request_buffer(uint32_t tti, const uint32_t len) +uint8_t* ue::request_buffer(uint32_t tti, uint32_t cc_idx, const uint32_t len) { uint8_t* pdu = nullptr; if (len > 0) { pdu = pdus.request(len); if (pdu) { // Deallocate oldest buffer if we didn't deallocate it - if (rx_used_buffers[tti] != nullptr) { - pdus.deallocate(rx_used_buffers[tti]); - rx_used_buffers[tti] = nullptr; + if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { + pdus.deallocate(rx_used_buffers.at(cc_idx)[tti]); + rx_used_buffers.at(cc_idx)[tti] = nullptr; log_h->warning("buffers: RX PDU of rnti=0x%x and pid=%d wasn't deallocated\n", rnti, tti % nof_rx_harq_proc); } - rx_used_buffers[tti] = pdu; + rx_used_buffers.at(cc_idx)[tti] = pdu; log_h->info("RX PDU saved for pid=%d\n", tti % nof_rx_harq_proc); } else { log_h->error("buffers: Requesting buffer from pool\n"); @@ -306,35 +316,33 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe Debug("MAC PDU processed\n"); } -void ue::deallocate_pdu(uint32_t tti, const uint8_t* pdu_ptr) +void ue::deallocate_pdu(uint32_t tti, uint32_t cc_idx) { - if (pdu_ptr) { - if (rx_used_buffers[tti] == pdu_ptr) { - rx_used_buffers[tti] = nullptr; - } else { - Warning("buffers: Unexpected RX PDU pointer in deallocate_pdu for rnti=0x%x pid=%d\n", rnti, tti % nof_rx_harq_proc); - } - pdus.deallocate(pdu_ptr); + if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { + pdus.deallocate(rx_used_buffers.at(cc_idx)[tti]); + rx_used_buffers.at(cc_idx)[tti] = nullptr; } else { - Error("Error deallocating PDU: null ptr\n"); + Warning("buffers: Null RX PDU pointer in deallocate_pdu for rnti=0x%x pid=%d cc_idx=%d\n", + rnti, + tti % nof_rx_harq_proc, + cc_idx); } } -void ue::push_pdu(uint32_t tti, const uint8_t* pdu_ptr, uint32_t len) +void ue::push_pdu(uint32_t tti, uint32_t cc_idx, uint32_t len) { - if (pdu_ptr) { - if (rx_used_buffers[tti] == pdu_ptr) { - rx_used_buffers[tti] = nullptr; - } else { - Warning("buffers: Unexpected RX PDU pointer in push_pdu for rnti=0x%x pid=%d\n", rnti, tti % nof_rx_harq_proc); - } + if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { if (len > 0) { - pdus.push(pdu_ptr, len); + pdus.push(rx_used_buffers.at(cc_idx)[tti], len); } else { Error("Error pushing PDU: null length\n"); } + rx_used_buffers.at(cc_idx)[tti] = nullptr; } else { - Error("Error pushing PDU: null pointer\n"); + Warning("buffers: Null RX PDU pointer in push_pdu for rnti=0x%x pid=%d cc_idx=%d\n", + rnti, + tti % nof_rx_harq_proc, + cc_idx); } } diff --git a/srsenb/test/phy/enb_phy_test.cc b/srsenb/test/phy/enb_phy_test.cc index eee341fe8..b6c449e6f 100644 --- a/srsenb/test/phy/enb_phy_test.cc +++ b/srsenb/test/phy/enb_phy_test.cc @@ -493,7 +493,7 @@ public: return 0; } - int push_pdu(uint32_t tti, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc_res) override + int push_pdu(uint32_t tti, uint16_t rnti, uint32_t cc_idx, uint32_t nof_bytes, bool crc_res) override { log_h.info("Received push_pdu tti=%d; rnti=0x%x; ack=%d;\n", tti, rnti, crc_res); notify_push_pdu(); From 7d2c1b636b79f1b8c20c463e457abb168aa6e79a Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 19 Jan 2021 15:33:11 +0100 Subject: [PATCH 071/138] Release pointer even if length is zero --- srsenb/src/stack/mac/ue.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index ef1b32041..41ccc9425 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -322,15 +322,19 @@ void ue::deallocate_pdu(uint32_t tti, const uint8_t* pdu_ptr) void ue::push_pdu(uint32_t tti, const uint8_t* pdu_ptr, uint32_t len) { - if (pdu_ptr && len > 0) { + if (pdu_ptr) { if (rx_used_buffers[tti] == pdu_ptr) { rx_used_buffers[tti] = nullptr; } else { Warning("buffers: Unexpected RX PDU pointer in push_pdu for rnti=0x%x pid=%d\n", rnti, tti % nof_rx_harq_proc); } - pdus.push(pdu_ptr, len); + if (len > 0) { + pdus.push(pdu_ptr, len); + } else { + Error("Error pushing PDU: null length\n"); + } } else { - Error("Error pushing PDU: ptr=%p, len=%d\n", pdu_ptr, len); + Error("Error pushing PDU: null pointer\n"); } } From c1c5fa426c62005d550d498e8e958332fb45503c Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 19 Jan 2021 16:58:56 +0100 Subject: [PATCH 072/138] Fix issue with new way of managing ul buffers not working with CA --- .../srslte/interfaces/enb_interfaces.h | 4 +- srsenb/hdr/stack/enb_stack_lte.h | 4 +- srsenb/hdr/stack/mac/mac.h | 2 +- srsenb/hdr/stack/mac/ue.h | 8 +-- srsenb/src/phy/lte/cc_worker.cc | 2 +- srsenb/src/stack/mac/mac.cc | 16 ++++-- srsenb/src/stack/mac/ue.cc | 54 +++++++++++-------- srsenb/test/phy/enb_phy_test.cc | 2 +- 8 files changed, 54 insertions(+), 38 deletions(-) diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index b7945afb2..d93a84c9c 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -177,12 +177,12 @@ public: * * @param tti the given TTI * @param rnti the UE identifier in the eNb - * @param pdu_ptr pointer to the uplink buffer + * @param enb_cc_idx the eNb Cell/Carrier identifier * @param nof_bytes the number of grants carrierd by the PUSCH message * @param crc_res the CRC check, set to true if the message was decoded succesfully * @return SRSLTE_SUCCESS if no error occurs, SRSLTE_ERROR* if an error occurs */ - virtual int push_pdu(uint32_t tti_rx, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc_res) = 0; + virtual int push_pdu(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) = 0; virtual int get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res) = 0; virtual int get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res) = 0; diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index 8929bbfc6..62d96cc68 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -80,9 +80,9 @@ public: { return mac.crc_info(tti, rnti, enb_cc_idx, nof_bytes, crc_res); } - int push_pdu(uint32_t tti, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc_res) final + int push_pdu(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) final { - return mac.push_pdu(tti, rnti, pdu_ptr, nof_bytes, crc_res); + return mac.push_pdu(tti, rnti, enb_cc_idx, nof_bytes, crc_res); } int get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res) final { return mac.get_dl_sched(tti, dl_sched_res); } int get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res) final diff --git a/srsenb/hdr/stack/mac/mac.h b/srsenb/hdr/stack/mac/mac.h index 6f6a72a08..0aa6c1832 100644 --- a/srsenb/hdr/stack/mac/mac.h +++ b/srsenb/hdr/stack/mac/mac.h @@ -56,7 +56,7 @@ public: int ta_info(uint32_t tti, uint16_t rnti, float ta_us) override; int ack_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t tb_idx, bool ack) override; int crc_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) override; - int push_pdu(uint32_t tti, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc_res) override; + int push_pdu(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) override; int get_dl_sched(uint32_t tti_tx_dl, dl_sched_list_t& dl_sched_res) override; int get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res) override; diff --git a/srsenb/hdr/stack/mac/ue.h b/srsenb/hdr/stack/mac/ue.h index 3dde41198..6eae19f1f 100644 --- a/srsenb/hdr/stack/mac/ue.h +++ b/srsenb/hdr/stack/mac/ue.h @@ -72,10 +72,10 @@ public: srslte_softbuffer_rx_t* get_rx_softbuffer(const uint32_t ue_cc_idx, const uint32_t tti); bool process_pdus(); - uint8_t* request_buffer(uint32_t tti, const uint32_t len); + uint8_t* request_buffer(uint32_t tti, uint32_t ue_cc_idx, const uint32_t len); void process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channel_t channel) override; - void push_pdu(uint32_t tti, const uint8_t* pdu_ptr, uint32_t len); - void deallocate_pdu(uint32_t tti, const uint8_t* pdu_ptr); + void push_pdu(uint32_t tti, uint32_t ue_cc_idx, uint32_t len); + void deallocate_pdu(uint32_t tti, uint32_t ue_cc_idx); void metrics_read(mac_ue_metrics_t* metrics_); void metrics_rx(bool crc, uint32_t tbs); @@ -124,7 +124,7 @@ private: tx_payload_buffer; // Save 2 buffers per HARQ process - srslte::circular_array rx_used_buffers; + std::vector > rx_used_buffers; srslte::block_queue pending_ta_commands; ta ta_fsm; diff --git a/srsenb/src/phy/lte/cc_worker.cc b/srsenb/src/phy/lte/cc_worker.cc index 0c568d39b..1d04fd282 100644 --- a/srsenb/src/phy/lte/cc_worker.cc +++ b/srsenb/src/phy/lte/cc_worker.cc @@ -374,7 +374,7 @@ void cc_worker::decode_pusch(stack_interface_phy_lte::ul_sched_grant_t* grants, // Inform MAC about the CRC result phy->stack->crc_info(tti_rx, rnti, cc_idx, ul_cfg.pusch.grant.tb.tbs / 8, pusch_res.crc); // Push PDU buffer - phy->stack->push_pdu(tti_rx, rnti, grants[i].data, ul_cfg.pusch.grant.tb.tbs / 8, pusch_res.crc); + phy->stack->push_pdu(tti_rx, rnti, cc_idx, ul_cfg.pusch.grant.tb.tbs / 8, pusch_res.crc); // Logging if (log_h->get_level() >= srslte::LOG_LEVEL_INFO) { char str[512]; diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 0d7cd86cb..953e3c116 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -323,7 +323,7 @@ int mac::crc_info(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, uint32_t return scheduler.ul_crc_info(tti_rx, rnti, enb_cc_idx, crc); } -int mac::push_pdu(uint32_t tti_rx, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc) +int mac::push_pdu(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc) { srslte::rwlock_read_guard lock(rwlock); @@ -331,14 +331,21 @@ int mac::push_pdu(uint32_t tti_rx, uint16_t rnti, const uint8_t* pdu_ptr, uint32 return SRSLTE_ERROR; } + std::array enb_ue_cc_map = scheduler.get_enb_ue_cc_map(rnti); + if (enb_ue_cc_map[enb_cc_idx] < 0) { + Error("User rnti=0x%x is not activated for carrier %d\n", rnti, enb_cc_idx); + return SRSLTE_ERROR; + } + uint32_t ue_cc_idx = enb_ue_cc_map[enb_cc_idx]; + // push the pdu through the queue if received correctly if (crc) { Info("Pushing PDU rnti=0x%x, tti_rx=%d, nof_bytes=%d\n", rnti, tti_rx, nof_bytes); - ue_db[rnti]->push_pdu(tti_rx, pdu_ptr, nof_bytes); + ue_db[rnti]->push_pdu(tti_rx, ue_cc_idx, nof_bytes); stack_task_queue.push([this]() { process_pdus(); }); } else { Debug("Discarting PDU rnti=0x%x, tti_rx=%d, nof_bytes=%d\n", rnti, tti_rx, nof_bytes); - ue_db[rnti]->deallocate_pdu(tti_rx, pdu_ptr); + ue_db[rnti]->deallocate_pdu(tti_rx, ue_cc_idx); } return SRSLTE_SUCCESS; } @@ -906,7 +913,8 @@ int mac::get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res_list) if (sched_result.pusch[n].current_tx_nb == 0) { srslte_softbuffer_rx_reset_tbs(phy_ul_sched_res->pusch[n].softbuffer_rx, sched_result.pusch[i].tbs * 8); } - phy_ul_sched_res->pusch[n].data = ue_db[rnti]->request_buffer(tti_tx_ul, sched_result.pusch[i].tbs); + phy_ul_sched_res->pusch[n].data = + ue_db[rnti]->request_buffer(tti_tx_ul, sched_result.pusch[i].dci.ue_cc_idx, sched_result.pusch[i].tbs); if (phy_ul_sched_res->pusch[n].data) { phy_ul_sched_res->nof_grants++; } else { diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index 41ccc9425..092a08c4a 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -44,6 +44,7 @@ ue::ue(uint16_t rnti_, pdus(128), nof_rx_harq_proc(nof_rx_harq_proc_), nof_tx_harq_proc(nof_tx_harq_proc_), + rx_used_buffers(nof_cells_), ta_fsm(this) { srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance(); @@ -94,6 +95,15 @@ void ue::reset() srslte_softbuffer_tx_reset(&buffer); } } + + for (auto& rx_buffers_cc : rx_used_buffers) { + for (auto& ptr : rx_buffers_cc) { + if (ptr) { + pdus.deallocate(ptr); + ptr = nullptr; + } + } + } } /** @@ -161,19 +171,19 @@ ue::get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, con return &softbuffer_tx.at(ue_cc_idx).at((harq_process * SRSLTE_MAX_TB + tb_idx) % nof_tx_harq_proc); } -uint8_t* ue::request_buffer(uint32_t tti, const uint32_t len) +uint8_t* ue::request_buffer(uint32_t tti, uint32_t cc_idx, const uint32_t len) { uint8_t* pdu = nullptr; if (len > 0) { pdu = pdus.request(len); if (pdu) { // Deallocate oldest buffer if we didn't deallocate it - if (rx_used_buffers[tti] != nullptr) { - pdus.deallocate(rx_used_buffers[tti]); - rx_used_buffers[tti] = nullptr; + if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { + pdus.deallocate(rx_used_buffers.at(cc_idx)[tti]); + rx_used_buffers.at(cc_idx)[tti] = nullptr; log_h->warning("buffers: RX PDU of rnti=0x%x and pid=%d wasn't deallocated\n", rnti, tti % nof_rx_harq_proc); } - rx_used_buffers[tti] = pdu; + rx_used_buffers.at(cc_idx)[tti] = pdu; log_h->info("RX PDU saved for pid=%d\n", tti % nof_rx_harq_proc); } else { log_h->error("buffers: Requesting buffer from pool\n"); @@ -306,35 +316,33 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe Debug("MAC PDU processed\n"); } -void ue::deallocate_pdu(uint32_t tti, const uint8_t* pdu_ptr) +void ue::deallocate_pdu(uint32_t tti, uint32_t cc_idx) { - if (pdu_ptr) { - if (rx_used_buffers[tti] == pdu_ptr) { - rx_used_buffers[tti] = nullptr; - } else { - Warning("buffers: Unexpected RX PDU pointer in deallocate_pdu for rnti=0x%x pid=%d\n", rnti, tti % nof_rx_harq_proc); - } - pdus.deallocate(pdu_ptr); + if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { + pdus.deallocate(rx_used_buffers.at(cc_idx)[tti]); + rx_used_buffers.at(cc_idx)[tti] = nullptr; } else { - Error("Error deallocating PDU: null ptr\n"); + Warning("buffers: Null RX PDU pointer in deallocate_pdu for rnti=0x%x pid=%d cc_idx=%d\n", + rnti, + tti % nof_rx_harq_proc, + cc_idx); } } -void ue::push_pdu(uint32_t tti, const uint8_t* pdu_ptr, uint32_t len) +void ue::push_pdu(uint32_t tti, uint32_t cc_idx, uint32_t len) { - if (pdu_ptr) { - if (rx_used_buffers[tti] == pdu_ptr) { - rx_used_buffers[tti] = nullptr; - } else { - Warning("buffers: Unexpected RX PDU pointer in push_pdu for rnti=0x%x pid=%d\n", rnti, tti % nof_rx_harq_proc); - } + if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { if (len > 0) { - pdus.push(pdu_ptr, len); + pdus.push(rx_used_buffers.at(cc_idx)[tti], len); } else { Error("Error pushing PDU: null length\n"); } + rx_used_buffers.at(cc_idx)[tti] = nullptr; } else { - Error("Error pushing PDU: null pointer\n"); + Warning("buffers: Null RX PDU pointer in push_pdu for rnti=0x%x pid=%d cc_idx=%d\n", + rnti, + tti % nof_rx_harq_proc, + cc_idx); } } diff --git a/srsenb/test/phy/enb_phy_test.cc b/srsenb/test/phy/enb_phy_test.cc index eee341fe8..b6c449e6f 100644 --- a/srsenb/test/phy/enb_phy_test.cc +++ b/srsenb/test/phy/enb_phy_test.cc @@ -493,7 +493,7 @@ public: return 0; } - int push_pdu(uint32_t tti, uint16_t rnti, const uint8_t* pdu_ptr, uint32_t nof_bytes, bool crc_res) override + int push_pdu(uint32_t tti, uint16_t rnti, uint32_t cc_idx, uint32_t nof_bytes, bool crc_res) override { log_h.info("Received push_pdu tti=%d; rnti=0x%x; ack=%d;\n", tti, rnti, crc_res); notify_push_pdu(); From d5f06349756784247e163097e292ef3550e23635 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 19 Jan 2021 21:55:24 +0100 Subject: [PATCH 073/138] Add PUCCH SNR measurement (#2175) * Add PUCCH SNR measurement * Fix PUCCH SNR estimation * Reverted PUCCH noise estimation * use fpclassify instead of iszero Co-authored-by: Xavier Arteaga --- .../srslte/interfaces/enb_interfaces.h | 5 +- .../srslte/phy/ch_estimation/chest_ul.h | 4 + lib/include/srslte/phy/phch/pucch.h | 1 + lib/src/phy/ch_estimation/chest_ul.c | 90 +++++++++++-- lib/src/phy/enb/enb_ul.c | 1 + lib/src/phy/phch/pucch.c | 3 +- lib/src/phy/phch/test/pucch_test.c | 123 +++++++++++++++--- srsenb/hdr/phy/lte/cc_worker.h | 1 + srsenb/hdr/phy/phy_metrics.h | 4 +- srsenb/hdr/stack/enb_stack_lte.h | 4 +- srsenb/hdr/stack/mac/mac.h | 2 +- srsenb/src/main.cc | 4 +- srsenb/src/metrics_json.cc | 4 +- srsenb/src/metrics_stdout.cc | 19 ++- srsenb/src/phy/lte/cc_worker.cc | 14 +- srsenb/src/phy/lte/sf_worker.cc | 5 +- srsenb/src/phy/phy.cc | 7 +- srsenb/src/stack/mac/mac.cc | 4 +- srsenb/test/enb_metrics_test.cc | 9 +- srsenb/test/phy/enb_phy_test.cc | 2 +- 20 files changed, 248 insertions(+), 58 deletions(-) diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index b7945afb2..97e206572 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -123,6 +123,8 @@ public: */ virtual int cqi_info(uint32_t tti, uint16_t rnti, uint32_t cc_idx, uint32_t cqi_value) = 0; + typedef enum { PUSCH = 0, PUCCH, SRS } ul_channel_t; + /** * PHY callback for giving MAC the SNR in dB of an UL transmission for a given RNTI at a given carrier * @@ -130,9 +132,10 @@ public: * @param rnti The UE identifier in the eNb * @param cc_idx The eNb Cell/Carrier where the UL transmission was received * @param snr_db The actual SNR of the received signal + * @param ch Indicates uplink channel (PUSCH, PUCCH or SRS) * @return SRSLTE_SUCCESS if no error occurs, SRSLTE_ERROR* if an error occurs */ - virtual int snr_info(uint32_t tti, uint16_t rnti, uint32_t cc_idx, float snr_db) = 0; + virtual int snr_info(uint32_t tti, uint16_t rnti, uint32_t cc_idx, float snr_db, ul_channel_t ch) = 0; /** * PHY callback for giving MAC the Time Aligment information in microseconds of a given RNTI during a TTI processing diff --git a/lib/include/srslte/phy/ch_estimation/chest_ul.h b/lib/include/srslte/phy/ch_estimation/chest_ul.h index e49d4b750..b40c34014 100644 --- a/lib/include/srslte/phy/ch_estimation/chest_ul.h +++ b/lib/include/srslte/phy/ch_estimation/chest_ul.h @@ -41,6 +41,10 @@ typedef struct SRSLTE_API { uint32_t nof_re; float noise_estimate; float noise_estimate_dbm; + float rsrp; + float rsrp_dBfs; + float epre; + float epre_dBfs; float snr; float snr_db; float cfo; diff --git a/lib/include/srslte/phy/phch/pucch.h b/lib/include/srslte/phy/phch/pucch.h index 66231e1d8..558427e9b 100644 --- a/lib/include/srslte/phy/phch/pucch.h +++ b/lib/include/srslte/phy/phch/pucch.h @@ -83,6 +83,7 @@ typedef struct SRSLTE_API { typedef struct SRSLTE_API { srslte_uci_value_t uci_data; float dmrs_correlation; + float snr_db; float correlation; bool detected; diff --git a/lib/src/phy/ch_estimation/chest_ul.c b/lib/src/phy/ch_estimation/chest_ul.c index 4cbab5cfc..539b6cca8 100644 --- a/lib/src/phy/ch_estimation/chest_ul.c +++ b/lib/src/phy/ch_estimation/chest_ul.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -392,23 +393,46 @@ int srslte_chest_ul_estimate_pusch(srslte_chest_ul_t* q, return 0; } +static float +estimate_noise_pilots_pucch(srslte_chest_ul_t* q, cf_t* ce, uint32_t n_rs, uint32_t n_prb[SRSLTE_NOF_SLOTS_PER_SF]) +{ + + float power = 0; + for (int ns = 0; ns < SRSLTE_NOF_SLOTS_PER_SF; ns++) { + for (int i = 0; i < n_rs; i++) { + // All CE are the same, so pick the first symbol of the first slot always and compare with the noisy estimates + power += srslte_chest_estimate_noise_pilots( + &q->pilot_estimates[(i + ns * n_rs) * SRSLTE_NRE], + &ce[SRSLTE_RE_IDX(q->cell.nof_prb, ns * SRSLTE_CP_NSYMB(q->cell.cp), n_prb[ns] * SRSLTE_NRE)], + q->tmp_noise, + SRSLTE_NRE); + } + } + + power /= (SRSLTE_NOF_SLOTS_PER_SF * n_rs); + + if (q->smooth_filter_len == 3) { + // Calibrated for filter length 3 + float w = q->smooth_filter[0]; + float a = 7.419 * w * w + 0.1117 * w - 0.005387; + return (power / (a * 0.8)); + } else { + return power; + } +} + int srslte_chest_ul_estimate_pucch(srslte_chest_ul_t* q, srslte_ul_sf_cfg_t* sf, srslte_pucch_cfg_t* cfg, cf_t* input, srslte_chest_ul_res_t* res) { - if (!q->dmrs_signal_configured) { - ERROR("Error must call srslte_chest_ul_set_cfg() before using the UL estimator\n"); - return SRSLTE_ERROR; - } - int n_rs = srslte_refsignal_dmrs_N_rs(cfg->format, q->cell.cp); if (!n_rs) { ERROR("Error computing N_rs\n"); return SRSLTE_ERROR; } - int nrefs_sf = SRSLTE_NRE * n_rs * 2; + int nrefs_sf = SRSLTE_NRE * n_rs * SRSLTE_NOF_SLOTS_PER_SF; /* Get references from the input signal */ srslte_refsignal_dmrs_pucch_get(&q->dmrs_signal, cfg, input, q->pilot_recv_signal); @@ -446,8 +470,29 @@ int srslte_chest_ul_estimate_pucch(srslte_chest_ul_t* q, srslte_vec_prod_conj_ccc(q->pilot_recv_signal, q->pilot_known_signal, q->pilot_estimates, nrefs_sf); } - if (cfg->meas_ta_en && n_rs > 0) { - float ta_err = 0.0; + // Measure power + float rsrp_avg = 0.0f; + for (int ns = 0; ns < SRSLTE_NOF_SLOTS_PER_SF; ns++) { + for (int i = 0; i < n_rs; i++) { + cf_t corr = srslte_vec_acc_cc(q->pilot_estimates, SRSLTE_NOF_SLOTS_PER_SF * SRSLTE_NRE * n_rs) / (SRSLTE_NRE); + rsrp_avg += __real__ corr * __real__ corr + __imag__ corr * __imag__ corr; + } + } + rsrp_avg /= SRSLTE_NOF_SLOTS_PER_SF * n_rs; + float epre = srslte_vec_avg_power_cf(q->pilot_estimates, SRSLTE_NOF_SLOTS_PER_SF * SRSLTE_NRE * n_rs); + + // RSRP shall not be greater than EPRE + rsrp_avg = SRSLTE_MIN(rsrp_avg, epre); + + // Set EPRE and RSRP + res->epre = epre; + res->epre_dBfs = srslte_convert_power_to_dB(res->epre); + res->rsrp = rsrp_avg; + res->rsrp_dBfs = srslte_convert_power_to_dB(res->rsrp); + + // Estimate time alignment + if (cfg->meas_ta_en) { + float ta_err = 0.0f; for (int ns = 0; ns < SRSLTE_NOF_SLOTS_PER_SF; ns++) { for (int i = 0; i < n_rs; i++) { ta_err += srslte_vec_estimate_frequency(&q->pilot_estimates[(i + ns * n_rs) * SRSLTE_NRE], SRSLTE_NRE) / @@ -467,6 +512,8 @@ int srslte_chest_ul_estimate_pucch(srslte_chest_ul_t* q, } if (res->ce != NULL) { + uint32_t n_prb[2] = {}; + /* TODO: Currently averaging entire slot, performance good enough? */ for (int ns = 0; ns < 2; ns++) { // Average all slot @@ -490,15 +537,32 @@ int srslte_chest_ul_estimate_pucch(srslte_chest_ul_t* q, q->smooth_filter_len); // Determine n_prb - uint32_t n_prb = srslte_pucch_n_prb(&q->cell, cfg, ns); + n_prb[ns] = srslte_pucch_n_prb(&q->cell, cfg, ns); // copy estimates to slot for (int i = 0; i < SRSLTE_CP_NSYMB(q->cell.cp); i++) { - memcpy(&res->ce[SRSLTE_RE_IDX(q->cell.nof_prb, i + ns * SRSLTE_CP_NSYMB(q->cell.cp), n_prb * SRSLTE_NRE)], - &q->pilot_recv_signal[ns * n_rs * SRSLTE_NRE], - sizeof(cf_t) * SRSLTE_NRE); + srslte_vec_cf_copy( + &res->ce[SRSLTE_RE_IDX(q->cell.nof_prb, i + ns * SRSLTE_CP_NSYMB(q->cell.cp), n_prb[ns] * SRSLTE_NRE)], + &q->pilot_recv_signal[ns * n_rs * SRSLTE_NRE], + SRSLTE_NRE); } } + + // Estimate noise/interference + res->noise_estimate = estimate_noise_pilots_pucch(q, res->ce, n_rs, n_prb); + if (fpclassify(res->noise_estimate) == FP_ZERO) { + res->noise_estimate = FLT_MIN; + } + res->noise_estimate_dbm = srslte_convert_power_to_dBm(res->noise_estimate); + + // Estimate SINR + if (isnormal(res->noise_estimate)) { + res->snr = res->rsrp / res->noise_estimate; + res->snr_db = srslte_convert_power_to_dB(res->snr); + } else { + res->snr = NAN; + res->snr_db = NAN; + } } return 0; @@ -539,4 +603,4 @@ int srslte_chest_ul_estimate_srs(srslte_chest_ul_t* q, chest_ul_estimate(q, 1, n_srs_re, 1, true, false, n_prb, res); return SRSLTE_SUCCESS; -} \ No newline at end of file +} diff --git a/lib/src/phy/enb/enb_ul.c b/lib/src/phy/enb/enb_ul.c index b486e15d0..eed9fa2f7 100644 --- a/lib/src/phy/enb/enb_ul.c +++ b/lib/src/phy/enb/enb_ul.c @@ -204,6 +204,7 @@ static int get_pucch(srslte_enb_ul_t* q, srslte_ul_sf_cfg_t* ul_sf, srslte_pucch ERROR("Error estimating PUCCH DMRS\n"); return SRSLTE_ERROR; } + pucch_res.snr_db = q->chest_res.snr_db; ret = srslte_pucch_decode(&q->pucch, ul_sf, cfg, &q->chest_res, q->sf_symbols, &pucch_res); if (ret < SRSLTE_SUCCESS) { diff --git a/lib/src/phy/phch/pucch.c b/lib/src/phy/phch/pucch.c index 3905f8fcf..bd26e2b11 100644 --- a/lib/src/phy/phch/pucch.c +++ b/lib/src/phy/phch/pucch.c @@ -1380,7 +1380,8 @@ void srslte_pucch_rx_info(srslte_pucch_cfg_t* cfg, srslte_pucch_res_t* pucch_res if (pucch_res) { if (isnormal(cfg->threshold_dmrs_detection)) { - n = srslte_print_check(str, str_len, n, ", dmrs_corr=%.3f", pucch_res->dmrs_correlation); + n = srslte_print_check( + str, str_len, n, ", dmrs_corr=%.3f, snr=%.1f dB", pucch_res->dmrs_correlation, pucch_res->snr_db); } n = srslte_print_check(str, str_len, n, ", corr=%.3f", pucch_res->correlation); diff --git a/lib/src/phy/phch/test/pucch_test.c b/lib/src/phy/phch/test/pucch_test.c index a1add4ace..fc158b898 100644 --- a/lib/src/phy/phch/test/pucch_test.c +++ b/lib/src/phy/phch/test/pucch_test.c @@ -19,7 +19,7 @@ #include "srslte/srslte.h" -srslte_cell_t cell = { +static srslte_cell_t cell = { 25, // nof_prb 1, // nof_ports 1, // cell_id @@ -30,23 +30,25 @@ srslte_cell_t cell = { }; -uint32_t subframe = 0; -bool test_cqi_only = false; +static uint32_t subframe = 0; +static bool test_cqi_only = false; +static float snr_db = 20.0f; -void usage(char* prog) +static void usage(char* prog) { printf("Usage: %s [csNnv]\n", prog); printf("\t-c cell id [Default %d]\n", cell.id); printf("\t-s subframe [Default %d]\n", subframe); printf("\t-n nof_prb [Default %d]\n", cell.nof_prb); printf("\t-q Test CQI encoding/decoding only [Default %s].\n", test_cqi_only ? "yes" : "no"); + printf("\t-S Signal to Noise Ratio in dB [Default %.2f].\n", snr_db); printf("\t-v [set verbose to debug, default none]\n"); } void parse_args(int argc, char** argv) { int opt; - while ((opt = getopt(argc, argv, "csNnqv")) != -1) { + while ((opt = getopt(argc, argv, "csNnqSv")) != -1) { switch (opt) { case 's': subframe = (uint32_t)strtol(argv[optind], NULL, 10); @@ -60,6 +62,9 @@ void parse_args(int argc, char** argv) case 'q': test_cqi_only = true; break; + case 'S': + snr_db = strtof(argv[optind], NULL); + break; case 'v': srslte_verbose++; break; @@ -126,12 +131,16 @@ int test_uci_cqi_pucch(void) int main(int argc, char** argv) { - srslte_pucch_t pucch; - srslte_pucch_cfg_t pucch_cfg; + srslte_pucch_t pucch_ue = {}; + srslte_pucch_t pucch_enb = {}; + srslte_pucch_cfg_t pucch_cfg = {}; srslte_refsignal_ul_t dmrs; cf_t* sf_symbols = NULL; cf_t pucch_dmrs[2 * SRSLTE_NRE * 3]; - int ret = -1; + int ret = -1; + srslte_chest_ul_t chest = {}; + srslte_chest_ul_res_t chest_res = {}; + srslte_channel_awgn_t awgn = {}; parse_args(argc, argv); @@ -139,14 +148,30 @@ int main(int argc, char** argv) return test_uci_cqi_pucch(); } - if (srslte_pucch_init_ue(&pucch)) { + if (srslte_pucch_init_ue(&pucch_ue)) { + ERROR("Error creating PDSCH object\n"); + exit(-1); + } + if (srslte_pucch_set_cell(&pucch_ue, cell)) { + ERROR("Error creating PDSCH object\n"); + exit(-1); + } + if (srslte_pucch_set_rnti(&pucch_ue, 11)) { + ERROR("Error setting C-RNTI\n"); + goto quit; + } + if (srslte_pucch_init_enb(&pucch_enb)) { ERROR("Error creating PDSCH object\n"); exit(-1); } - if (srslte_pucch_set_cell(&pucch, cell)) { + if (srslte_pucch_set_cell(&pucch_enb, cell)) { ERROR("Error creating PDSCH object\n"); exit(-1); } + if (srslte_pucch_set_rnti(&pucch_enb, 11)) { + ERROR("Error setting C-RNTI\n"); + goto quit; + } if (srslte_refsignal_ul_init(&dmrs, cell.nof_prb)) { ERROR("Error creating PDSCH object\n"); exit(-1); @@ -156,10 +181,27 @@ int main(int argc, char** argv) exit(-1); } - bzero(&pucch_cfg, sizeof(srslte_pucch_cfg_t)); + if (srslte_chest_ul_init(&chest, cell.nof_prb) < SRSLTE_SUCCESS) { + ERROR("Error initiating channel estimator\n"); + goto quit; + } - if (srslte_pucch_set_rnti(&pucch, 11)) { - ERROR("Error setting C-RNTI\n"); + if (srslte_chest_ul_res_init(&chest_res, cell.nof_prb) < SRSLTE_SUCCESS) { + ERROR("Error initiating channel estimator result\n"); + goto quit; + } + + if (srslte_chest_ul_set_cell(&chest, cell) < SRSLTE_SUCCESS) { + ERROR("Error setting channel estimator cell\n"); + goto quit; + } + + if (srslte_channel_awgn_init(&awgn, 0x1234) < SRSLTE_SUCCESS) { + ERROR("Error initiating AWGN\n"); + goto quit; + } + if (srslte_channel_awgn_set_n0(&awgn, -snr_db) < SRSLTE_SUCCESS) { + ERROR("Error setting AWGN\n"); goto quit; } @@ -172,7 +214,7 @@ int main(int argc, char** argv) ZERO_OBJECT(ul_sf); srslte_pucch_format_t format; - for (format = 0; format <= SRSLTE_PUCCH_FORMAT_3; format++) { + for (format = 0; format < SRSLTE_PUCCH_FORMAT_ERROR; format++) { for (uint32_t d = 1; d <= 3; d++) { for (uint32_t ncs = 0; ncs < 8; ncs += d) { for (uint32_t n_pucch = 1; n_pucch < 130; n_pucch += 50) { @@ -215,8 +257,9 @@ int main(int argc, char** argv) uci_data.cfg.cqi.data_enable = true; } + // Encode PUCCH signals gettimeofday(&t[1], NULL); - if (srslte_pucch_encode(&pucch, &ul_sf, &pucch_cfg, &uci_data.value, sf_symbols)) { + if (srslte_pucch_encode(&pucch_ue, &ul_sf, &pucch_cfg, &uci_data.value, sf_symbols)) { ERROR("Error encoding PUCCH\n"); goto quit; } @@ -231,7 +274,48 @@ int main(int argc, char** argv) } gettimeofday(&t[2], NULL); get_time_interval(t); - INFO("format %d, n_pucch: %d, ncs: %d, d: %d, t_exec=%ld us\n", format, n_pucch, ncs, d, t[0].tv_usec); + uint64_t t_enc = t[0].tv_usec + t[0].tv_sec * 1000000UL; + + // Run AWGN channel + srslte_channel_awgn_run_c(&awgn, sf_symbols, sf_symbols, SRSLTE_NOF_RE(cell)); + + // Decode PUCCH signals + gettimeofday(&t[1], NULL); + if (srslte_chest_ul_estimate_pucch(&chest, &ul_sf, &pucch_cfg, sf_symbols, &chest_res) < SRSLTE_SUCCESS) { + ERROR("Error estimating PUCCH channel\n"); + goto quit; + } + + srslte_pucch_res_t res = {}; + if (srslte_pucch_decode(&pucch_enb, &ul_sf, &pucch_cfg, &chest_res, sf_symbols, &res) < SRSLTE_SUCCESS) { + ERROR("Error decoding PUCCH\n"); + goto quit; + } + gettimeofday(&t[2], NULL); + get_time_interval(t); + uint64_t t_dec = t[0].tv_usec + t[0].tv_sec * 1000000UL; + + // Check EPRE and RSRP are +/- 1 dB and SNR measurements are +/- 3dB + if (fabsf(chest_res.epre_dBfs) > 1.0 || fabsf(chest_res.rsrp_dBfs) > 1.0 || + fabsf(chest_res.snr_db - snr_db) > 3.0) { + ERROR("Invalid EPRE (%+.2f), RSRP (%+.2f) or SNR (%+.2f)\n", + chest_res.epre_dBfs, + chest_res.rsrp_dBfs, + chest_res.snr_db); + goto quit; + } + + INFO("format %d, n_pucch: %d, ncs: %d, d: %d, t_encode=%ld us, t_decode=%ld us, EPRE=%+.1f dBfs, RSRP=%+.1f " + "dBfs, SNR=%+.1f dBfs\n", + format, + n_pucch, + ncs, + d, + t_enc, + t_dec, + chest_res.epre_dBfs, + chest_res.rsrp_dBfs, + chest_res.snr_db); } } } @@ -239,9 +323,12 @@ int main(int argc, char** argv) ret = 0; quit: - srslte_pucch_free(&pucch); + srslte_pucch_free(&pucch_ue); + srslte_pucch_free(&pucch_enb); srslte_refsignal_ul_free(&dmrs); - + srslte_chest_ul_free(&chest); + srslte_chest_ul_res_free(&chest_res); + srslte_channel_awgn_free(&awgn); if (sf_symbols) { free(sf_symbols); } diff --git a/srsenb/hdr/phy/lte/cc_worker.h b/srsenb/hdr/phy/lte/cc_worker.h index 90afb0117..865b32c20 100644 --- a/srsenb/hdr/phy/lte/cc_worker.h +++ b/srsenb/hdr/phy/lte/cc_worker.h @@ -100,6 +100,7 @@ private: void metrics_read(phy_metrics_t* metrics); void metrics_dl(uint32_t mcs); void metrics_ul(uint32_t mcs, float rssi, float sinr, float turbo_iters); + void metrics_ul_pucch(float sinr); uint32_t get_rnti() const { return rnti; } private: diff --git a/srsenb/hdr/phy/phy_metrics.h b/srsenb/hdr/phy/phy_metrics.h index 0d38607e8..592cf1729 100644 --- a/srsenb/hdr/phy/phy_metrics.h +++ b/srsenb/hdr/phy/phy_metrics.h @@ -19,11 +19,13 @@ namespace srsenb { struct ul_metrics_t { float n; - float sinr; + float pusch_sinr; + float pucch_sinr; float rssi; float turbo_iters; float mcs; int n_samples; + int n_samples_pucch; }; struct dl_metrics_t { diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index 8929bbfc6..b4a2122a8 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -67,9 +67,9 @@ public: { return mac.cqi_info(tti, rnti, cc_idx, cqi_value); } - int snr_info(uint32_t tti_rx, uint16_t rnti, uint32_t cc_idx, float snr_db) final + int snr_info(uint32_t tti_rx, uint16_t rnti, uint32_t cc_idx, float snr_db, ul_channel_t ch) final { - return mac.snr_info(tti_rx, rnti, cc_idx, snr_db); + return mac.snr_info(tti_rx, rnti, cc_idx, snr_db, ch); } int ta_info(uint32_t tti, uint16_t rnti, float ta_us) override { return mac.ta_info(tti, rnti, ta_us); } int ack_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t tb_idx, bool ack) final diff --git a/srsenb/hdr/stack/mac/mac.h b/srsenb/hdr/stack/mac/mac.h index 6f6a72a08..a90ee86bc 100644 --- a/srsenb/hdr/stack/mac/mac.h +++ b/srsenb/hdr/stack/mac/mac.h @@ -52,7 +52,7 @@ public: int ri_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t ri_value) override; int pmi_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t pmi_value) override; int cqi_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t cqi_value) override; - int snr_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, float snr) override; + int snr_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, float snr, ul_channel_t ch) override; int ta_info(uint32_t tti, uint16_t rnti, float ta_us) override; int ack_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t tb_idx, bool ack) override; int crc_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t nof_bytes, bool crc_res) override; diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index ceacca5e2..40127306d 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -195,9 +195,9 @@ void parse_args(all_args_t* args, int argc, char* argv[]) ("expert.equalizer_mode", bpo::value(&args->phy.equalizer_mode)->default_value("mmse"), "Equalizer mode") ("expert.estimator_fil_w", bpo::value(&args->phy.estimator_fil_w)->default_value(0.1), "Chooses the coefficients for the 3-tap channel estimator centered filter.") ("expert.lte_sample_rates", bpo::value(&use_standard_lte_rates)->default_value(false), "Whether to use default LTE sample rates instead of shorter variants.") - ("expert.report_json_enable", bpo::value(&args->general.report_json_enable)->default_value(true), "Write eNB report to JSON file") + ("expert.report_json_enable", bpo::value(&args->general.report_json_enable)->default_value(false), "Write eNB report to JSON file") ("expert.report_json_filename", bpo::value(&args->general.report_json_filename)->default_value("/tmp/enb_report.json"), "Report JSON filename") - ("expert.alarms_log_enable", bpo::value(&args->general.alarms_log_enable)->default_value(true), "Log alarms") + ("expert.alarms_log_enable", bpo::value(&args->general.alarms_log_enable)->default_value(false), "Log alarms") ("expert.alarms_filename", bpo::value(&args->general.alarms_filename)->default_value("/tmp/enb_alarms.log"), "Alarms filename") ("expert.rrc_inactivity_timer", bpo::value(&args->general.rrc_inactivity_timer)->default_value(30000), "Inactivity timer in ms.") ("expert.print_buffer_state", bpo::value(&args->general.print_buffer_state)->default_value(false), "Prints on the console the buffer state every 10 seconds") diff --git a/srsenb/src/metrics_json.cc b/srsenb/src/metrics_json.cc index 5e9065d4e..a27fb253f 100644 --- a/srsenb/src/metrics_json.cc +++ b/srsenb/src/metrics_json.cc @@ -100,8 +100,8 @@ static void fill_ue_metrics(mset_ue_container& ue, const enb_metrics_t& m, unsig if (m.stack.mac.ues[i].tx_pkts > 0 && m.stack.mac.ues[i].tx_errors > 0) { ue.write(std::max(0.1f, (float)100 * m.stack.mac.ues[i].tx_errors / m.stack.mac.ues[i].tx_pkts)); } - if (!std::isnan(m.phy[i].ul.sinr)) { - ue.write(std::max(0.1f, m.phy[i].ul.sinr)); + if (!std::isnan(m.phy[i].ul.pusch_sinr)) { + ue.write(std::max(0.1f, m.phy[i].ul.pusch_sinr)); } if (!std::isnan(m.phy[i].ul.mcs)) { ue.write(std::max(0.1f, m.phy[i].ul.mcs)); diff --git a/srsenb/src/metrics_stdout.cc b/srsenb/src/metrics_stdout.cc index 75d1be9d2..22928554e 100644 --- a/srsenb/src/metrics_stdout.cc +++ b/srsenb/src/metrics_stdout.cc @@ -83,8 +83,8 @@ void metrics_stdout::set_metrics(const enb_metrics_t& metrics, const uint32_t pe if (++n_reports > 10) { n_reports = 0; cout << endl; - cout << "------DL--------------------------------UL------------------------------------" << endl; - cout << "rnti cqi ri mcs brate ok nok (%) snr phr mcs brate ok nok (%) bsr" << endl; + cout << "------DL-------------------------------UL--------------------------------------------" << endl; + cout << "rnti cqi ri mcs brate ok nok (%) pusch pucch phr mcs brate ok nok (%) bsr" << endl; } for (size_t i = 0; i < metrics.stack.rrc.ues.size(); i++) { @@ -122,13 +122,20 @@ void metrics_stdout::set_metrics(const enb_metrics_t& metrics, const uint32_t pe } else { cout << float_to_string(0, 1, 4) << "%"; } - cout << " "; + cout << " "; - if (not isnan(metrics.phy[i].ul.sinr)) { - cout << float_to_string(SRSLTE_MAX(0.1, metrics.phy[i].ul.sinr), 2, 4); + if (not isnan(metrics.phy[i].ul.pusch_sinr)) { + cout << float_to_string(SRSLTE_MAX(0.1, metrics.phy[i].ul.pusch_sinr), 2, 5); } else { - cout << float_to_string(0, 1, 4); + cout << float_to_string(0, 2, 5); + } + + if (not isnan(metrics.phy[i].ul.pucch_sinr)) { + cout << float_to_string(SRSLTE_MAX(0.1, metrics.phy[i].ul.pucch_sinr), 2, 5); + } else { + cout << float_to_string(0, 2, 5); } + cout << " "; cout << float_to_string(metrics.stack.mac.ues[i].phr, 2, 5); if (not isnan(metrics.phy[i].ul.mcs)) { diff --git a/srsenb/src/phy/lte/cc_worker.cc b/srsenb/src/phy/lte/cc_worker.cc index 0c568d39b..ab3b9ff3d 100644 --- a/srsenb/src/phy/lte/cc_worker.cc +++ b/srsenb/src/phy/lte/cc_worker.cc @@ -335,7 +335,7 @@ void cc_worker::decode_pusch_rnti(stack_interface_phy_lte::ul_sched_grant_t& ul_ // Notify MAC of RL status if (snr_db >= PUSCH_RL_SNR_DB_TH) { // Notify MAC UL channel quality - phy->stack->snr_info(ul_sf.tti, rnti, cc_idx, snr_db); + phy->stack->snr_info(ul_sf.tti, rnti, cc_idx, snr_db, mac_interface_phy_lte::PUSCH); // Notify MAC of Time Alignment only if it enabled and valid measurement, ignore value otherwise if (ul_cfg.pusch.meas_ta_en and not std::isnan(enb_ul.chest_res.ta_us) and not std::isinf(enb_ul.chest_res.ta_us)) { @@ -409,6 +409,7 @@ int cc_worker::decode_pucch() if (pucch_res.detected and pucch_res.ta_valid) { phy->stack->ta_info(tti_rx, rnti, pucch_res.ta_us); + phy->stack->snr_info(tti_rx, rnti, cc_idx, pucch_res.snr_db, mac_interface_phy_lte::PUCCH); } // Logging @@ -417,6 +418,9 @@ int cc_worker::decode_pucch() srslte_pucch_rx_info(&ul_cfg.pucch, &pucch_res, str, sizeof(str)); log_h->info("PUCCH: cc=%d; %s\n", cc_idx, str); } + + // Save metrics + ue_db[rnti]->metrics_ul_pucch(pucch_res.snr_db); } } } @@ -615,12 +619,18 @@ void cc_worker::ue::metrics_dl(uint32_t mcs) void cc_worker::ue::metrics_ul(uint32_t mcs, float rssi, float sinr, float turbo_iters) { metrics.ul.mcs = SRSLTE_VEC_CMA((float)mcs, metrics.ul.mcs, metrics.ul.n_samples); - metrics.ul.sinr = SRSLTE_VEC_CMA((float)sinr, metrics.ul.sinr, metrics.ul.n_samples); + metrics.ul.pusch_sinr = SRSLTE_VEC_CMA((float)sinr, metrics.ul.pusch_sinr, metrics.ul.n_samples); metrics.ul.rssi = SRSLTE_VEC_CMA((float)rssi, metrics.ul.rssi, metrics.ul.n_samples); metrics.ul.turbo_iters = SRSLTE_VEC_CMA((float)turbo_iters, metrics.ul.turbo_iters, metrics.ul.n_samples); metrics.ul.n_samples++; } +void cc_worker::ue::metrics_ul_pucch(float sinr) +{ + metrics.ul.pucch_sinr = SRSLTE_VEC_CMA((float)sinr, metrics.ul.pucch_sinr, metrics.ul.n_samples_pucch); + metrics.ul.n_samples_pucch++; +} + int cc_worker::read_ce_abs(float* ce_abs) { int sz = srslte_symbol_sz(phy->get_nof_prb(cc_idx)); diff --git a/srsenb/src/phy/lte/sf_worker.cc b/srsenb/src/phy/lte/sf_worker.cc index 6a2e443e0..ae0ca163f 100644 --- a/srsenb/src/phy/lte/sf_worker.cc +++ b/srsenb/src/phy/lte/sf_worker.cc @@ -285,11 +285,14 @@ uint32_t sf_worker::get_metrics(std::vector& metrics) m->dl.mcs = SRSLTE_VEC_PMA(m->dl.mcs, m->dl.n_samples, m_->dl.mcs, m_->dl.n_samples); m->dl.n_samples += m_->dl.n_samples; m->ul.n = SRSLTE_VEC_PMA(m->ul.n, m->ul.n_samples, m_->ul.n, m_->ul.n_samples); - m->ul.sinr = SRSLTE_VEC_PMA(m->ul.sinr, m->ul.n_samples, m_->ul.sinr, m_->ul.n_samples); + m->ul.pusch_sinr = SRSLTE_VEC_PMA(m->ul.pusch_sinr, m->ul.n_samples, m_->ul.pusch_sinr, m_->ul.n_samples); + m->ul.pucch_sinr = + SRSLTE_VEC_PMA(m->ul.pucch_sinr, m->ul.n_samples_pucch, m_->ul.pucch_sinr, m_->ul.n_samples_pucch); m->ul.mcs = SRSLTE_VEC_PMA(m->ul.mcs, m->ul.n_samples, m_->ul.mcs, m_->ul.n_samples); m->ul.rssi = SRSLTE_VEC_PMA(m->ul.rssi, m->ul.n_samples, m_->ul.rssi, m_->ul.n_samples); m->ul.turbo_iters = SRSLTE_VEC_PMA(m->ul.turbo_iters, m->ul.n_samples, m_->ul.turbo_iters, m_->ul.n_samples); m->ul.n_samples += m_->ul.n_samples; + m->ul.n_samples_pucch += m_->ul.n_samples_pucch; } } return cnt; diff --git a/srsenb/src/phy/phy.cc b/srsenb/src/phy/phy.cc index c521f407e..d49b4dd6f 100644 --- a/srsenb/src/phy/phy.cc +++ b/srsenb/src/phy/phy.cc @@ -215,10 +215,12 @@ void phy::get_metrics(std::vector& metrics) metrics[j].dl.mcs += metrics_tmp[j].dl.n_samples * metrics_tmp[j].dl.mcs; metrics[j].ul.n_samples += metrics_tmp[j].ul.n_samples; + metrics[j].ul.n_samples_pucch += metrics_tmp[j].ul.n_samples_pucch; metrics[j].ul.mcs += metrics_tmp[j].ul.n_samples * metrics_tmp[j].ul.mcs; metrics[j].ul.n += metrics_tmp[j].ul.n_samples * metrics_tmp[j].ul.n; metrics[j].ul.rssi += metrics_tmp[j].ul.n_samples * metrics_tmp[j].ul.rssi; - metrics[j].ul.sinr += metrics_tmp[j].ul.n_samples * metrics_tmp[j].ul.sinr; + metrics[j].ul.pusch_sinr += metrics_tmp[j].ul.n_samples * metrics_tmp[j].ul.pusch_sinr; + metrics[j].ul.pucch_sinr += metrics_tmp[j].ul.n_samples_pucch * metrics_tmp[j].ul.pucch_sinr; metrics[j].ul.turbo_iters += metrics_tmp[j].ul.n_samples * metrics_tmp[j].ul.turbo_iters; } } @@ -227,7 +229,8 @@ void phy::get_metrics(std::vector& metrics) metrics[j].ul.mcs /= metrics[j].ul.n_samples; metrics[j].ul.n /= metrics[j].ul.n_samples; metrics[j].ul.rssi /= metrics[j].ul.n_samples; - metrics[j].ul.sinr /= metrics[j].ul.n_samples; + metrics[j].ul.pusch_sinr /= metrics[j].ul.n_samples; + metrics[j].ul.pucch_sinr /= metrics[j].ul.n_samples_pucch; metrics[j].ul.turbo_iters /= metrics[j].ul.n_samples; } } diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 2b7abc3b4..c9c187a89 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -388,7 +388,7 @@ int mac::cqi_info(uint32_t tti, uint16_t rnti, uint32_t enb_cc_idx, uint32_t cqi return SRSLTE_SUCCESS; } -int mac::snr_info(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, float snr) +int mac::snr_info(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, float snr, ul_channel_t ch) { log_h->step(tti_rx); srslte::rwlock_read_guard lock(rwlock); @@ -397,7 +397,7 @@ int mac::snr_info(uint32_t tti_rx, uint16_t rnti, uint32_t enb_cc_idx, float snr return SRSLTE_ERROR; } - return scheduler.ul_snr_info(tti_rx, rnti, enb_cc_idx, snr, 0); + return scheduler.ul_snr_info(tti_rx, rnti, enb_cc_idx, snr, (uint32_t)ch); } int mac::ta_info(uint32_t tti, uint16_t rnti, float ta_us) diff --git a/srsenb/test/enb_metrics_test.cc b/srsenb/test/enb_metrics_test.cc index ebc3c60c0..f3e8d8f52 100644 --- a/srsenb/test/enb_metrics_test.cc +++ b/srsenb/test/enb_metrics_test.cc @@ -55,7 +55,8 @@ public: metrics[0].phy.resize(1); metrics[0].phy[0].dl.mcs = 28.0; metrics[0].phy[0].ul.mcs = 20.2; - metrics[0].phy[0].ul.sinr = 14.2; + metrics[0].phy[0].ul.pucch_sinr = 14.2; + metrics[0].phy[0].ul.pusch_sinr = 14.2; // second metrics[1].rf.rf_o = 10; @@ -77,7 +78,8 @@ public: metrics[1].phy.resize(1); metrics[1].phy[0].dl.mcs = 6.2; metrics[1].phy[0].ul.mcs = 28.0; - metrics[1].phy[0].ul.sinr = 22.2; + metrics[1].phy[0].ul.pucch_sinr = 22.2; + metrics[1].phy[0].ul.pusch_sinr = 22.2; // third entry metrics[2].rf.rf_o = 10; @@ -99,7 +101,8 @@ public: metrics[2].phy.resize(1); metrics[2].phy[0].dl.mcs = 28.0; metrics[2].phy[0].ul.mcs = 20.2; - metrics[2].phy[0].ul.sinr = 14.2; + metrics[2].phy[0].ul.pusch_sinr = 14.2; + metrics[2].phy[0].ul.pucch_sinr = 14.2; // fourth entry with incomple PHY and MAC stats metrics[3].rf.rf_o = 10; diff --git a/srsenb/test/phy/enb_phy_test.cc b/srsenb/test/phy/enb_phy_test.cc index eee341fe8..ab409dc01 100644 --- a/srsenb/test/phy/enb_phy_test.cc +++ b/srsenb/test/phy/enb_phy_test.cc @@ -454,7 +454,7 @@ public: return SRSLTE_SUCCESS; } - int snr_info(uint32_t tti, uint16_t rnti, uint32_t cc_idx, float snr_db) override + int snr_info(uint32_t tti, uint16_t rnti, uint32_t cc_idx, float snr_db, ul_channel_t ch) override { notify_snr_info(); return 0; From 8a3d70f6daa7a43f4f384d5eb6ed27b1c550c9b7 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 19 Jan 2021 18:40:39 +0100 Subject: [PATCH 074/138] Fix intra-cell measurement ringbuffer overflow --- srsue/src/phy/scell/intra_measure.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/srsue/src/phy/scell/intra_measure.cc b/srsue/src/phy/scell/intra_measure.cc index e37f2bbd4..e05206543 100644 --- a/srsue/src/phy/scell/intra_measure.cc +++ b/srsue/src/phy/scell/intra_measure.cc @@ -56,7 +56,9 @@ void intra_measure::init(uint32_t cc_idx_, phy_common* common, meas_itf* new_cel search_buffer = srslte_vec_cf_malloc(intra_freq_meas_len_ms * SRSLTE_SF_LEN_PRB(SRSLTE_MAX_PRB)); - if (srslte_ringbuffer_init(&ring_buffer, sizeof(cf_t) * intra_freq_meas_len_ms * SRSLTE_SF_LEN_PRB(SRSLTE_MAX_PRB))) { + // Initialise buffer for the maximum number of PRB + uint32_t max_required_bytes = (uint32_t)sizeof(cf_t) * intra_freq_meas_len_ms * SRSLTE_SF_LEN_PRB(SRSLTE_MAX_PRB); + if (srslte_ringbuffer_init(&ring_buffer, max_required_bytes)) { return; } @@ -127,6 +129,10 @@ void intra_measure::write(uint32_t tti, cf_t* data, uint32_t nsamples) } break; case internal_state::receive: + // As nbytes might not match the sub-frame size, make sure that buffer does not overflow + nbytes = SRSLTE_MIN(srslte_ringbuffer_space(&ring_buffer), nbytes); + + // Try writing in the buffer if (srslte_ringbuffer_write(&ring_buffer, data, nbytes) < nbytes) { Warning("INTRA: Error writing to ringbuffer (EARFCN=%d)\n", current_earfcn); From a6423442c237d84a59acc061651c0095338d5960 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 20 Jan 2021 15:46:46 +0100 Subject: [PATCH 075/138] Refactor NR RA files and fix header includes all over library (#2162) * Refactor NR resource allocation classes. Use DCI instead of grant for dummy PDSCH UE/eNB test * Minor refactors in NR workers and ue_dl * Fix include issues * fix compilation issues --- lib/include/srslte/common/common.h | 3 +- lib/include/srslte/common/common_helper.h | 1 + lib/include/srslte/common/config_file.h | 1 + lib/include/srslte/common/interfaces_common.h | 1 + lib/include/srslte/common/metrics_hub.h | 1 - lib/include/srslte/common/network_utils.h | 4 + lib/include/srslte/common/timeout.h | 2 +- lib/include/srslte/common/timers.h | 3 +- .../srslte/interfaces/gnb_interfaces.h | 35 ++- .../srslte/interfaces/pdcp_interface_types.h | 3 +- lib/include/srslte/mac/mac_nr_pdu.h | 1 + lib/include/srslte/mac/pdu.h | 1 + .../srslte/phy/ch_estimation/dmrs_pdcch.h | 11 +- .../srslte/phy/ch_estimation/dmrs_sch.h | 10 +- lib/include/srslte/phy/channel/channel.h | 4 +- lib/include/srslte/phy/channel/delay.h | 5 +- lib/include/srslte/phy/channel/fading.h | 5 +- lib/include/srslte/phy/channel/hst.h | 4 +- lib/include/srslte/phy/channel/rlf.h | 4 +- lib/include/srslte/phy/common/phy_common_nr.h | 4 + lib/include/srslte/phy/enb/enb_dl_nr.h | 38 +-- lib/include/srslte/phy/modem/evm.h | 3 +- lib/include/srslte/phy/phch/dci_nr.h | 11 +- lib/include/srslte/phy/phch/pdcch_nr.h | 3 +- lib/include/srslte/phy/phch/pdsch_nr.h | 2 + lib/include/srslte/phy/phch/phch_cfg_nr.h | 18 +- lib/include/srslte/phy/phch/pusch_nr.h | 2 + .../{ue/ue_dl_nr_data.h => phch/ra_dl_nr.h} | 52 ++-- lib/include/srslte/phy/phch/ra_nr.h | 26 +- lib/include/srslte/phy/ue/ue_dl_nr.h | 17 +- lib/include/srslte/phy/ue/ue_ul_nr_data.h | 7 - lib/include/srslte/srslte.h | 9 + lib/include/srslte/upper/ipv6.h | 2 + lib/src/common/mac_pcap.cc | 6 +- lib/src/common/security.cc | 1 + lib/src/phy/CMakeLists.txt | 4 +- lib/src/phy/ch_estimation/dmrs_pdcch.c | 7 + lib/src/phy/ch_estimation/dmrs_sch.c | 1 + .../phy/ch_estimation/test/dmrs_pdsch_test.c | 4 +- lib/src/phy/channel/hst.c | 3 + lib/src/phy/enb/enb_dl_nr.c | 54 ++-- lib/src/phy/phch/dci_nr.c | 28 ++ lib/src/phy/phch/pdcch_nr.c | 4 + lib/src/phy/phch/pdsch_nr.c | 4 + lib/src/phy/phch/pusch_nr.c | 3 + lib/src/phy/phch/ra_dl_nr.c | 256 ++++++++++++++++++ lib/src/phy/phch/ra_nr.c | 45 ++- lib/src/phy/phch/test/pdcch_nr_test.c | 1 + lib/src/phy/phch/test/pdsch_nr_test.c | 8 +- lib/src/phy/phch/test/pusch_nr_test.c | 1 + lib/src/phy/phch/test/ra_nr_test.c | 101 +++++++ lib/src/phy/phch/test/sch_nr_test.c | 4 +- lib/src/phy/ue/ue_dl_nr.c | 18 +- lib/src/phy/ue/ue_dl_nr_data.c | 157 ----------- lib/src/phy/utils/debug.c | 2 +- lib/src/upper/gtpu.cc | 2 + lib/test/asn1/nas_decoder.cc | 1 + lib/test/asn1/s1ap_test.cc | 2 + lib/test/common/timeout_test.cc | 3 + lib/test/phy/phy_dl_nr_test.c | 19 +- srsenb/hdr/phy/nr/cc_worker.h | 10 +- srsenb/hdr/phy/nr/sf_worker.h | 6 +- srsenb/hdr/stack/rrc/rrc_config.h | 1 + srsenb/src/metrics_csv.cc | 1 + srsenb/src/metrics_stdout.cc | 1 + srsenb/src/phy/nr/cc_worker.cc | 113 ++++---- srsenb/src/phy/nr/sf_worker.cc | 43 ++- srsenb/src/stack/rrc/rrc_cell_cfg.cc | 1 + srsepc/src/hss/hss.cc | 1 + srsepc/src/main.cc | 1 + srsepc/src/spgw/gtpc.cc | 1 + srsepc/src/spgw/gtpu.cc | 1 + srsue/hdr/phy/nr/cc_worker.h | 9 +- srsue/hdr/stack/rrc/rrc.h | 2 +- srsue/src/phy/nr/cc_worker.cc | 65 +++-- srsue/src/stack/rrc/rrc.cc | 2 +- srsue/src/stack/rrc/rrc_nr.cc | 4 +- srsue/src/stack/upper/tft_packet_filter.cc | 4 +- 78 files changed, 872 insertions(+), 426 deletions(-) rename lib/include/srslte/phy/{ue/ue_dl_nr_data.h => phch/ra_dl_nr.h} (54%) create mode 100644 lib/src/phy/phch/ra_dl_nr.c create mode 100644 lib/src/phy/phch/test/ra_nr_test.c delete mode 100644 lib/src/phy/ue/ue_dl_nr_data.c diff --git a/lib/include/srslte/common/common.h b/lib/include/srslte/common/common.h index 48d85cd63..4b8c727b7 100644 --- a/lib/include/srslte/common/common.h +++ b/lib/include/srslte/common/common.h @@ -22,6 +22,7 @@ #include #include #include +#include /******************************************************************************* DEFINES @@ -75,8 +76,6 @@ #define pool_allocate_blocking (srslte::allocate_unique_buffer(*pool, true)) #endif -#include "srslte/srslte.h" - /******************************************************************************* TYPEDEFS *******************************************************************************/ diff --git a/lib/include/srslte/common/common_helper.h b/lib/include/srslte/common/common_helper.h index 0e11afbdf..45c637907 100644 --- a/lib/include/srslte/common/common_helper.h +++ b/lib/include/srslte/common/common_helper.h @@ -20,6 +20,7 @@ #include "srslte/common/logmap.h" #include +#include #include namespace srslte { diff --git a/lib/include/srslte/common/config_file.h b/lib/include/srslte/common/config_file.h index 91122df1a..6882f4f33 100644 --- a/lib/include/srslte/common/config_file.h +++ b/lib/include/srslte/common/config_file.h @@ -14,6 +14,7 @@ #define SRSLTE_CONFIG_FILE_H #include "common.h" +#include "srslte/phy/common/phy_common.h" #include #include #include diff --git a/lib/include/srslte/common/interfaces_common.h b/lib/include/srslte/common/interfaces_common.h index 2efedca6b..c515afb07 100644 --- a/lib/include/srslte/common/interfaces_common.h +++ b/lib/include/srslte/common/interfaces_common.h @@ -14,6 +14,7 @@ #define SRSLTE_INTERFACES_COMMON_H #include "srslte/common/security.h" +#include "srslte/phy/common/phy_common.h" #include namespace srslte { diff --git a/lib/include/srslte/common/metrics_hub.h b/lib/include/srslte/common/metrics_hub.h index 90841d4fa..e51b903a9 100644 --- a/lib/include/srslte/common/metrics_hub.h +++ b/lib/include/srslte/common/metrics_hub.h @@ -20,7 +20,6 @@ #define SRSLTE_METRICS_HUB_H #include "srslte/common/threads.h" -#include "srslte/srslte.h" #include #include #include diff --git a/lib/include/srslte/common/network_utils.h b/lib/include/srslte/common/network_utils.h index 899fbd4ce..af56a2823 100644 --- a/lib/include/srslte/common/network_utils.h +++ b/lib/include/srslte/common/network_utils.h @@ -17,10 +17,14 @@ #include "srslte/common/logmap.h" #include "srslte/common/threads.h" +#include #include #include #include +#include #include +#include +#include #include #include #include diff --git a/lib/include/srslte/common/timeout.h b/lib/include/srslte/common/timeout.h index ca28789a8..5de6e5fab 100644 --- a/lib/include/srslte/common/timeout.h +++ b/lib/include/srslte/common/timeout.h @@ -20,7 +20,7 @@ #ifndef SRSLTE_TIMEOUT_H #define SRSLTE_TIMEOUT_H -#include "srslte/srslte.h" +#include "srslte/phy/utils/debug.h" #include #include #include diff --git a/lib/include/srslte/common/timers.h b/lib/include/srslte/common/timers.h index 81ca86c7c..7c0b0fce1 100644 --- a/lib/include/srslte/common/timers.h +++ b/lib/include/srslte/common/timers.h @@ -20,6 +20,7 @@ #ifndef SRSLTE_TIMERS_H #define SRSLTE_TIMERS_H +#include "srslte/phy/utils/debug.h" #include #include #include @@ -30,8 +31,6 @@ #include #include -#include "srslte/srslte.h" - namespace srslte { class timer_callback diff --git a/lib/include/srslte/interfaces/gnb_interfaces.h b/lib/include/srslte/interfaces/gnb_interfaces.h index 9eaa6ea14..04de849ed 100644 --- a/lib/include/srslte/interfaces/gnb_interfaces.h +++ b/lib/include/srslte/interfaces/gnb_interfaces.h @@ -13,6 +13,8 @@ #ifndef SRSLTE_GNB_INTERFACES_H #define SRSLTE_GNB_INTERFACES_H +#include "srslte/srslte.h" + #include "srslte/common/interfaces_common.h" #include "srslte/common/security.h" #include "srslte/interfaces/pdcp_interface_types.h" @@ -210,7 +212,35 @@ public: virtual void process_pdus() = 0; }; -class stack_interface_phy_nr : public srslte::stack_interface_phy_nr +class mac_interface_phy_nr +{ +public: + const static int MAX_GRANTS = 64; + + /** + * DL grant structure per UE + */ + struct dl_sched_grant_t { + srslte_dci_dl_nr_t dci = {}; + uint8_t* data[SRSLTE_MAX_TB] = {}; + srslte_softbuffer_tx_t* softbuffer_tx[SRSLTE_MAX_TB] = {}; + }; + + /** + * DL Scheduling result per cell/carrier + */ + typedef struct { + dl_sched_grant_t pdsch[MAX_GRANTS]; //< DL Grants + uint32_t nof_grants; //< Number of DL grants + } dl_sched_t; + + /** + * List of DL scheduling results, one entry per cell/carrier + */ + typedef std::vector dl_sched_list_t; +}; + +class stack_interface_phy_nr : public mac_interface_phy_nr, public srslte::stack_interface_phy_nr { public: struct rx_data_ind_t { @@ -223,9 +253,6 @@ public: virtual int rx_data_indication(rx_data_ind_t& grant) = 0; }; -class mac_interface_phy_nr -{}; - } // namespace srsenb #endif // SRSLTE_GNB_INTERFACES_H diff --git a/lib/include/srslte/interfaces/pdcp_interface_types.h b/lib/include/srslte/interfaces/pdcp_interface_types.h index bc246c69a..71b594db8 100644 --- a/lib/include/srslte/interfaces/pdcp_interface_types.h +++ b/lib/include/srslte/interfaces/pdcp_interface_types.h @@ -19,6 +19,7 @@ #define SRSLTE_PDCP_INTERFACE_TYPES_H #include "srslte/common/security.h" +#include #include namespace srslte { @@ -119,7 +120,7 @@ public: t_reordering(t_reordering_), discard_timer(discard_timer_) { - hdr_len_bytes = ceil((float)sn_len / 8); + hdr_len_bytes = ceilf((float)sn_len / 8); } uint8_t bearer_id = 1; diff --git a/lib/include/srslte/mac/mac_nr_pdu.h b/lib/include/srslte/mac/mac_nr_pdu.h index 03b0d41ca..c35e9c68e 100644 --- a/lib/include/srslte/mac/mac_nr_pdu.h +++ b/lib/include/srslte/mac/mac_nr_pdu.h @@ -15,6 +15,7 @@ #include "srslte/common/common.h" #include "srslte/common/logmap.h" +#include "srslte/config.h" #include #include #include diff --git a/lib/include/srslte/mac/pdu.h b/lib/include/srslte/mac/pdu.h index 6fe2d082e..07c14ef11 100644 --- a/lib/include/srslte/mac/pdu.h +++ b/lib/include/srslte/mac/pdu.h @@ -15,6 +15,7 @@ #include "srslte/common/interfaces_common.h" #include "srslte/common/logmap.h" +#include #include #include #include diff --git a/lib/include/srslte/phy/ch_estimation/dmrs_pdcch.h b/lib/include/srslte/phy/ch_estimation/dmrs_pdcch.h index 66ed51cea..f917f1b9f 100644 --- a/lib/include/srslte/phy/ch_estimation/dmrs_pdcch.h +++ b/lib/include/srslte/phy/ch_estimation/dmrs_pdcch.h @@ -14,12 +14,9 @@ #define SRSLTE_DMRS_PDCCH_H #include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/phch/dci_nr.h" +#include "srslte/phy/resampling/interp.h" #include "srslte/phy/resampling/resampler.h" -#include "srslte/srslte.h" - -#ifdef __cplusplus -extern "C" { -#endif /** * @brief Puts in the resource grid the DeModulation Reference Signals for decoding PDCCH. @@ -182,8 +179,4 @@ SRSLTE_API int srslte_dmrs_pdcch_get_ce(const srslte_dmrs_pdcch_estimator_t* q, const srslte_dci_location_t* location, srslte_dmrs_pdcch_ce_t* ce); -#ifdef __cplusplus -} -#endif - #endif // SRSLTE_DMRS_PDCCH_H diff --git a/lib/include/srslte/phy/ch_estimation/dmrs_sch.h b/lib/include/srslte/phy/ch_estimation/dmrs_sch.h index 56abf30a1..6dc7493f6 100644 --- a/lib/include/srslte/phy/ch_estimation/dmrs_sch.h +++ b/lib/include/srslte/phy/ch_estimation/dmrs_sch.h @@ -13,15 +13,11 @@ #ifndef SRSLTE_DMRS_SCH_H #define SRSLTE_DMRS_SCH_H +#include "srslte/phy/ch_estimation/chest_dl.h" #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/phch/phch_cfg_nr.h" -#include "srslte/srslte.h" #include -#ifdef __cplusplus -extern "C" { -#endif - #define SRSLTE_DMRS_SCH_MAX_SYMBOLS 4 /** @@ -156,8 +152,4 @@ SRSLTE_API int srslte_dmrs_sch_estimate(srslte_dmrs_sch_t* q, const cf_t* sf_symbols, srslte_chest_dl_res_t* chest_res); -#ifdef __cplusplus -} -#endif - #endif // SRSLTE_DMRS_SCH_H diff --git a/lib/include/srslte/phy/channel/channel.h b/lib/include/srslte/phy/channel/channel.h index df6a5cd90..2ba2c0d8a 100644 --- a/lib/include/srslte/phy/channel/channel.h +++ b/lib/include/srslte/phy/channel/channel.h @@ -13,12 +13,14 @@ #ifndef SRSLTE_CHANNEL_H #define SRSLTE_CHANNEL_H +#include "ch_awgn.h" #include "delay.h" #include "fading.h" #include "hst.h" #include "rlf.h" +#include "srslte/common/log_filter.h" +#include "srslte/phy/common/phy_common.h" #include -#include #include namespace srslte { diff --git a/lib/include/srslte/phy/channel/delay.h b/lib/include/srslte/phy/channel/delay.h index f85cd0418..88b9371ab 100644 --- a/lib/include/srslte/phy/channel/delay.h +++ b/lib/include/srslte/phy/channel/delay.h @@ -13,7 +13,10 @@ #ifndef SRSLTE_DELAY_H #define SRSLTE_DELAY_H -#include +#include "srslte/config.h" +#include "srslte/phy/common/timestamp.h" +#include "srslte/phy/utils/ringbuffer.h" +#include typedef struct { float delay_min_us; diff --git a/lib/include/srslte/phy/channel/fading.h b/lib/include/srslte/phy/channel/fading.h index 3a05ba82f..42fb32f25 100644 --- a/lib/include/srslte/phy/channel/fading.h +++ b/lib/include/srslte/phy/channel/fading.h @@ -13,8 +13,11 @@ #ifndef SRSLTE_FADING_H #define SRSLTE_FADING_H +#include "srslte/config.h" +#include "srslte/phy/common/timestamp.h" +#include "srslte/phy/dft/dft.h" #include -#include +#include #define SRSLTE_CHANNEL_FADING_MAXTAPS 9 #define SRSLTE_CHANNEL_FADING_NTERMS 16 diff --git a/lib/include/srslte/phy/channel/hst.h b/lib/include/srslte/phy/channel/hst.h index 9e5edc278..9b50741dc 100644 --- a/lib/include/srslte/phy/channel/hst.h +++ b/lib/include/srslte/phy/channel/hst.h @@ -13,7 +13,9 @@ #ifndef SRSLTE_HST_H_ #define SRSLTE_HST_H_ -#include +#include "srslte/config.h" +#include "srslte/phy/common/timestamp.h" +#include typedef struct { // System parameters diff --git a/lib/include/srslte/phy/channel/rlf.h b/lib/include/srslte/phy/channel/rlf.h index 59c8cc8ab..142e310b8 100644 --- a/lib/include/srslte/phy/channel/rlf.h +++ b/lib/include/srslte/phy/channel/rlf.h @@ -13,7 +13,9 @@ #ifndef SRSLTE_RLF_H #define SRSLTE_RLF_H -#include +#include "srslte/config.h" +#include "srslte/phy/common/timestamp.h" +#include typedef struct { uint32_t t_on_ms; diff --git a/lib/include/srslte/phy/common/phy_common_nr.h b/lib/include/srslte/phy/common/phy_common_nr.h index 3449f21f2..47a01866f 100644 --- a/lib/include/srslte/phy/common/phy_common_nr.h +++ b/lib/include/srslte/phy/common/phy_common_nr.h @@ -132,6 +132,10 @@ typedef enum SRSLTE_API { srslte_sch_mapping_type_A = 0, srslte_sch_mapping_type typedef enum SRSLTE_API { srslte_search_space_type_common = 0, + srslte_search_space_type_common_0, + srslte_search_space_type_common_0A, + srslte_search_space_type_common_1, + srslte_search_space_type_common_2, srslte_search_space_type_ue, } srslte_search_space_type_t; diff --git a/lib/include/srslte/phy/enb/enb_dl_nr.h b/lib/include/srslte/phy/enb/enb_dl_nr.h index 6d37f2119..e3f00255c 100644 --- a/lib/include/srslte/phy/enb/enb_dl_nr.h +++ b/lib/include/srslte/phy/enb/enb_dl_nr.h @@ -18,10 +18,6 @@ #include "srslte/phy/phch/pdcch_nr.h" #include "srslte/phy/phch/pdsch_nr.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef struct SRSLTE_API { srslte_pdsch_nr_args_t pdsch; srslte_pdcch_nr_args_t pdcch; @@ -57,27 +53,17 @@ SRSLTE_API int srslte_enb_dl_nr_base_zero(srslte_enb_dl_nr_t* q); SRSLTE_API void srslte_enb_dl_nr_gen_signal(srslte_enb_dl_nr_t* q); -SRSLTE_API int srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot_cfg, - const srslte_search_space_t* search_space, - const srslte_dci_dl_nr_t* dci_dl, - const srslte_dci_location_t* dci_location, - uint16_t rnti); - -SRSLTE_API int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot, - const srslte_sch_cfg_nr_t* cfg, - const srslte_sch_grant_nr_t* grant, - uint8_t* data[SRSLTE_MAX_TB]); - -SRSLTE_API int srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, - const srslte_sch_cfg_nr_t* cfg, - const srslte_sch_grant_nr_t* grant, - char* str, - uint32_t str_len); - -#ifdef __cplusplus -} -#endif +SRSLTE_API int srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot_cfg, + const srslte_dci_dl_nr_t* dci_dl); + +SRSLTE_API int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot, + const srslte_sch_cfg_nr_t* cfg, + uint8_t* data[SRSLTE_MAX_TB]); + +SRSLTE_API int +srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, const srslte_sch_cfg_nr_t* cfg, char* str, uint32_t str_len); + #endif // SRSLTE_ENB_DL_NR_H diff --git a/lib/include/srslte/phy/modem/evm.h b/lib/include/srslte/phy/modem/evm.h index 1aec640a7..69f81dd62 100644 --- a/lib/include/srslte/phy/modem/evm.h +++ b/lib/include/srslte/phy/modem/evm.h @@ -13,7 +13,8 @@ #ifndef SRSLTE_EVM_H_ #define SRSLTE_EVM_H_ -#include "srslte/config.h" +#include "srslte/phy/modem/mod.h" +#include "srslte/phy/modem/modem_table.h" #include "srslte/phy/phch/ra.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" diff --git a/lib/include/srslte/phy/phch/dci_nr.h b/lib/include/srslte/phy/phch/dci_nr.h index d7fe44625..bdf388c0b 100644 --- a/lib/include/srslte/phy/phch/dci_nr.h +++ b/lib/include/srslte/phy/phch/dci_nr.h @@ -28,7 +28,11 @@ typedef struct SRSLTE_API { } srslte_dci_msg_nr_t; typedef struct SRSLTE_API { - srslte_rnti_type_t rnti_type; + uint16_t rnti; + srslte_rnti_type_t rnti_type; + srslte_dci_format_nr_t format; + srslte_dci_location_t location; + srslte_search_space_t search_space; // Common fields uint32_t freq_domain_assigment; ///< Frequency domain resource assignment @@ -56,6 +60,11 @@ typedef struct SRSLTE_API { } srslte_dci_dl_nr_t; +SRSLTE_API int srslte_dci_nr_pack(const srslte_carrier_nr_t* carrier, + const srslte_coreset_t* coreset, + const srslte_dci_dl_nr_t* dci, + srslte_dci_msg_nr_t* msg); + SRSLTE_API SRSLTE_API int srslte_dci_nr_format_1_0_sizeof(const srslte_carrier_nr_t* carrier, const srslte_coreset_t* coreset, srslte_rnti_type_t rnti_type); diff --git a/lib/include/srslte/phy/phch/pdcch_nr.h b/lib/include/srslte/phy/phch/pdcch_nr.h index 1f0669064..385e9c617 100644 --- a/lib/include/srslte/phy/phch/pdcch_nr.h +++ b/lib/include/srslte/phy/phch/pdcch_nr.h @@ -22,7 +22,6 @@ #define SRSLTE_PDCCH_NR_H #include "dci_nr.h" -#include "srslte/config.h" #include "srslte/phy/ch_estimation/dmrs_pdcch.h" #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/fec/crc.h" @@ -30,6 +29,8 @@ #include "srslte/phy/fec/polar/polar_decoder.h" #include "srslte/phy/fec/polar/polar_encoder.h" #include "srslte/phy/fec/polar/polar_rm.h" +#include "srslte/phy/modem/evm.h" +#include "srslte/phy/modem/modem_table.h" /** * @brief PDCCH configuration initialization arguments diff --git a/lib/include/srslte/phy/phch/pdsch_nr.h b/lib/include/srslte/phy/phch/pdsch_nr.h index a4b079f2e..e6a96f31d 100644 --- a/lib/include/srslte/phy/phch/pdsch_nr.h +++ b/lib/include/srslte/phy/phch/pdsch_nr.h @@ -23,6 +23,8 @@ #include "srslte/config.h" #include "srslte/phy/ch_estimation/dmrs_sch.h" +#include "srslte/phy/modem/evm.h" +#include "srslte/phy/modem/modem_table.h" #include "srslte/phy/phch/phch_cfg_nr.h" #include "srslte/phy/phch/regs.h" #include "srslte/phy/phch/sch_nr.h" diff --git a/lib/include/srslte/phy/phch/phch_cfg_nr.h b/lib/include/srslte/phy/phch/phch_cfg_nr.h index 5de15cea0..aa73c9540 100644 --- a/lib/include/srslte/phy/phch/phch_cfg_nr.h +++ b/lib/include/srslte/phy/phch/phch_cfg_nr.h @@ -24,10 +24,6 @@ #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/phch/sch_cfg_nr.h" -#ifdef __cplusplus -extern "C" { -#endif - /** * @brief PDSCH DMRS type */ @@ -100,7 +96,7 @@ typedef struct SRSLTE_API { /// (SLIV). The network configures the field so that the allocation does not cross the slot boundary uint32_t sliv; -} srslte_pdsch_allocation_t; +} srslte_pdsch_time_ra_t; /** * @brief PDSCH grant information provided by the Downlink Control Information (DCI) @@ -119,6 +115,7 @@ typedef struct SRSLTE_API { /// Frequency domain resources bool prb_idx[SRSLTE_MAX_PRB_NR]; + uint32_t nof_prb; /// Number of DMRS groups without data /// Described in TS 38.214 Section 5.1.6.2 @@ -153,6 +150,13 @@ typedef struct SRSLTE_API { srslte_dmrs_sch_cfg_t dmrs_typeA; srslte_dmrs_sch_cfg_t dmrs_typeB; + srslte_sch_grant_nr_t grant; + + bool pdsch_time_is_default; ///< Set to true if pdsch_time_ra contains the configuration from pdsch-ConfigCommon or + ///< pdsch-Config + srslte_pdsch_time_ra_t pdsch_time_ra[SRSLTE_MAX_NOF_DL_ALLOCATION]; + + bool rbg_size_cfg_1; ///< RBG size configuration (1 or 2) srslte_sch_cfg_t sch_cfg; ///< Common shared channel parameters @@ -160,8 +164,4 @@ typedef struct SRSLTE_API { bool enable_transform_precoder; } srslte_sch_cfg_nr_t; -#ifdef __cplusplus -} -#endif - #endif // SRSLTE_PHCH_CFG_NR_H diff --git a/lib/include/srslte/phy/phch/pusch_nr.h b/lib/include/srslte/phy/phch/pusch_nr.h index 64b99012e..1ccf7e16d 100644 --- a/lib/include/srslte/phy/phch/pusch_nr.h +++ b/lib/include/srslte/phy/phch/pusch_nr.h @@ -15,6 +15,8 @@ #include "srslte/config.h" #include "srslte/phy/ch_estimation/dmrs_sch.h" +#include "srslte/phy/modem/evm.h" +#include "srslte/phy/modem/modem_table.h" #include "srslte/phy/phch/phch_cfg_nr.h" #include "srslte/phy/phch/regs.h" #include "srslte/phy/phch/sch_nr.h" diff --git a/lib/include/srslte/phy/ue/ue_dl_nr_data.h b/lib/include/srslte/phy/phch/ra_dl_nr.h similarity index 54% rename from lib/include/srslte/phy/ue/ue_dl_nr_data.h rename to lib/include/srslte/phy/phch/ra_dl_nr.h index b4c2266e5..5437aa962 100644 --- a/lib/include/srslte/phy/ue/ue_dl_nr_data.h +++ b/lib/include/srslte/phy/phch/ra_dl_nr.h @@ -20,28 +20,31 @@ * Reference: *****************************************************************************/ -#ifndef SRSLTE_UE_DL_NR_DATA_H -#define SRSLTE_UE_DL_NR_DATA_H +#ifndef SRSLTE_RA_DL_NR_H +#define SRSLTE_RA_DL_NR_H #include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/phch/dci_nr.h" #include "srslte/phy/phch/phch_cfg_nr.h" -#ifdef __cplusplus -extern "C" { -#endif - /** - * @brief Calculates the PDSCH time resource provided by higher layers and stores it in the provided PDSCH NR grant. + * @brief Calculates the PDSCH time resource allocation and stores it in the provided PDSCH NR grant. * * @remark Defined by TS 38.214 V15.10.0 section 5.1.2.1.1 Determination of the resource allocation table to be used for * PDSCH * - * @param pdsch_alloc Flattened PHY PDSCH allocation configuration provided from higher layers - * @param[out] grant PDSCH mapping type + * @param pdsch_cfg Flattened PDSCH configuration provided from higher layers + * @param rnti_type Type of the RNTI of the corresponding DCI + * @param ss_type Type of the SS for PDCCH + * @param m Time domain resource assignment field value m provided in DCI + * @param[out] Provides grant pointer to fill * @return Returns SRSLTE_SUCCESS if the provided allocation is valid, otherwise it returns SRSLTE_ERROR code */ -SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocation_t* pdsch_alloc, - srslte_sch_grant_nr_t* grant); +SRSLTE_API int srslte_ra_dl_nr_time(const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_rnti_type_t rnti_type, + const srslte_search_space_type_t ss_type, + const uint8_t m, + srslte_sch_grant_nr_t* grant); /** * @brief Calculates the PDSCH time resource default A and stores it in the provided PDSCH NR grant. This can be used by @@ -55,9 +58,8 @@ SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocat * @param[out] grant PDSCH mapping type * @return Returns SRSLTE_SUCCESS if the provided allocation is valid, otherwise it returns SRSLTE_ERROR code */ -SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t m, - srslte_dmrs_sch_typeA_pos_t dmrs_typeA_pos, - srslte_sch_grant_nr_t* grant); +SRSLTE_API int +srslte_ra_dl_nr_time_default_A(uint32_t m, srslte_dmrs_sch_typeA_pos_t dmrs_typeA_pos, srslte_sch_grant_nr_t* grant); /** * @brief Calculates the number of PDSCH-DMRS CDM groups without data for DCI format 1_0 * @@ -67,11 +69,23 @@ SRSLTE_API int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t * @param[out] grant Provides grant pointer to fill * @return Returns SRSLTE_SUCCESS if the provided data is valid, otherwise it returns SRSLTE_ERROR code */ -SRSLTE_API int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_sch_cfg_nr_t* pdsch_cfg, +SRSLTE_API int srslte_ra_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_sch_cfg_nr_t* pdsch_cfg, srslte_sch_grant_nr_t* grant); -#ifdef __cplusplus -} -#endif +/** + * @brief Calculates the PDSCH frequency resource allocation and stores it in the provided PDSCH NR grant. + * + * @remark Defined by TS 38.214 V15.10.0 section 5.1.2.2 + * @param carrier Carrier information + * @param cfg PDSCH NR configuration by upper layers + * @param dci_dl Unpacked DCI used to schedule the PDSCH grant + * @param[out] grant Provides grant pointer to fill + * @return + */ +SRSLTE_API int srslte_ra_dl_nr_freq(const srslte_carrier_nr_t* carrier, + const srslte_sch_cfg_nr_t* cfg, + const srslte_dci_dl_nr_t* dci_dl, + srslte_sch_grant_nr_t* grant); + -#endif // SRSLTE_UE_DL_NR_DATA_H +#endif // SRSLTE_RA_DL_NR_H diff --git a/lib/include/srslte/phy/phch/ra_nr.h b/lib/include/srslte/phy/phch/ra_nr.h index 291cabec2..5fdc0a944 100644 --- a/lib/include/srslte/phy/phch/ra_nr.h +++ b/lib/include/srslte/phy/phch/ra_nr.h @@ -26,12 +26,9 @@ #include "srslte/config.h" #include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/phch/dci_nr.h" #include "srslte/phy/phch/phch_cfg_nr.h" -#ifdef __cplusplus -extern "C" { -#endif - /** * @brief Determines target rate * @param mcs_table Configured MCS table @@ -85,9 +82,22 @@ SRSLTE_API int srslte_ra_nr_fill_tb(const srslte_sch_cfg_nr_t* pdsch_cfg, const srslte_sch_grant_nr_t* grant, uint32_t mcs_idx, srslte_sch_tb_t* tb); - -#ifdef __cplusplus -} -#endif +/** + * @brief Converts an unpacked DL DCI message to a PDSCH grant structure. + * Implements the procedures defined in Section 5 of 38.214 to compute the resource allocation (5.1.2) + * and modulation order, target rate, redundancy version and TBS (5.1.3) + * + * Note: Only TypeA PDSCH mapping type is supported + * + * @param carrier Carrier information struct + * @param pdsch_cfg PDSCH configuration indicated by higher layers + * @param dci_dl DCI downlink (format 1_0 or 1_1) + * @param pdsch_grant Generated PDSCH grant + * @return 0 on success, -1 on error + */ +SRSLTE_API int srslte_ra_dl_dci_to_grant_nr(const srslte_carrier_nr_t* carrier, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_dci_dl_nr_t* dci_dl, + srslte_sch_grant_nr_t* pdsch_grant); #endif // SRSLTE_RA_NR_H diff --git a/lib/include/srslte/phy/ue/ue_dl_nr.h b/lib/include/srslte/phy/ue/ue_dl_nr.h index 3eadf2639..df1063d28 100644 --- a/lib/include/srslte/phy/ue/ue_dl_nr.h +++ b/lib/include/srslte/phy/ue/ue_dl_nr.h @@ -20,10 +20,6 @@ #include "srslte/phy/phch/pdcch_nr.h" #include "srslte/phy/phch/pdsch_nr.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef struct SRSLTE_API { srslte_pdsch_nr_args_t pdsch; srslte_pdcch_nr_args_t pdcch; @@ -71,21 +67,16 @@ SRSLTE_API int srslte_ue_dl_nr_find_dl_dci(srslte_ue_dl_nr_t* q, srslte_dci_dl_nr_t* dci_dl_list, uint32_t nof_dci_msg); -SRSLTE_API int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot, - const srslte_sch_cfg_nr_t* cfg, - const srslte_sch_grant_nr_t* grant, - srslte_pdsch_res_nr_t* res); +SRSLTE_API int srslte_ue_dl_nr_decode_pdsch(srslte_ue_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot, + const srslte_sch_cfg_nr_t* cfg, + srslte_pdsch_res_nr_t* res); SRSLTE_API int srslte_ue_dl_nr_pdsch_info(const srslte_ue_dl_nr_t* q, const srslte_sch_cfg_nr_t* cfg, - const srslte_sch_grant_nr_t* grant, const srslte_pdsch_res_nr_t res[SRSLTE_MAX_CODEWORDS], char* str, uint32_t str_len); -#ifdef __cplusplus -} -#endif #endif // SRSLTE_UE_DL_NR_H diff --git a/lib/include/srslte/phy/ue/ue_ul_nr_data.h b/lib/include/srslte/phy/ue/ue_ul_nr_data.h index fe25f47e7..3dbcae6fd 100644 --- a/lib/include/srslte/phy/ue/ue_ul_nr_data.h +++ b/lib/include/srslte/phy/ue/ue_ul_nr_data.h @@ -26,10 +26,6 @@ #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/phch/phch_cfg_nr.h" -#ifdef __cplusplus -extern "C" { -#endif - /** * @brief Calculates the PUSCH time resource default A and stores it in the provided PUSCH NR grant. * @@ -54,8 +50,5 @@ SRSLTE_API int srslte_ue_ul_nr_pdsch_time_resource_default_A(uint32_t m, srslte_ SRSLTE_API int srslte_ue_ul_nr_nof_dmrs_cdm_groups_without_data_format_0_0(const srslte_sch_cfg_nr_t* cfg, srslte_sch_grant_nr_t* grant); -#ifdef __cplusplus -} -#endif #endif // SRSLTE_UE_UL_DATA_H diff --git a/lib/include/srslte/srslte.h b/lib/include/srslte/srslte.h index 61cbee03f..fdfbcb1d1 100644 --- a/lib/include/srslte/srslte.h +++ b/lib/include/srslte/srslte.h @@ -39,6 +39,8 @@ extern "C" { #include "srslte/phy/ch_estimation/chest_dl.h" #include "srslte/phy/ch_estimation/chest_ul.h" +#include "srslte/phy/ch_estimation/dmrs_pdcch.h" +#include "srslte/phy/ch_estimation/dmrs_sch.h" #include "srslte/phy/ch_estimation/refsignal_dl.h" #include "srslte/phy/ch_estimation/refsignal_ul.h" #include "srslte/phy/ch_estimation/wiener_dl.h" @@ -70,6 +72,7 @@ extern "C" { #include "srslte/phy/modem/demod_hard.h" #include "srslte/phy/modem/demod_soft.h" +#include "srslte/phy/modem/evm.h" #include "srslte/phy/modem/mod.h" #include "srslte/phy/modem/modem_table.h" @@ -79,9 +82,11 @@ extern "C" { #include "srslte/phy/fec/softbuffer.h" #include "srslte/phy/phch/cqi.h" #include "srslte/phy/phch/dci.h" +#include "srslte/phy/phch/dci_nr.h" #include "srslte/phy/phch/pbch.h" #include "srslte/phy/phch/pcfich.h" #include "srslte/phy/phch/pdcch.h" +#include "srslte/phy/phch/pdcch_nr.h" #include "srslte/phy/phch/pdsch.h" #include "srslte/phy/phch/phich.h" #include "srslte/phy/phch/prach.h" @@ -90,6 +95,8 @@ extern "C" { #include "srslte/phy/phch/pusch.h" #include "srslte/phy/phch/ra.h" #include "srslte/phy/phch/ra_dl.h" +#include "srslte/phy/phch/ra_dl_nr.h" +#include "srslte/phy/phch/ra_nr.h" #include "srslte/phy/phch/ra_ul.h" #include "srslte/phy/phch/regs.h" #include "srslte/phy/phch/sch.h" @@ -97,11 +104,13 @@ extern "C" { #include "srslte/phy/ue/ue_cell_search.h" #include "srslte/phy/ue/ue_dl.h" +#include "srslte/phy/ue/ue_dl_nr.h" #include "srslte/phy/ue/ue_mib.h" #include "srslte/phy/ue/ue_sync.h" #include "srslte/phy/ue/ue_ul.h" #include "srslte/phy/enb/enb_dl.h" +#include "srslte/phy/enb/enb_dl_nr.h" #include "srslte/phy/enb/enb_ul.h" #include "srslte/phy/scrambling/scrambling.h" diff --git a/lib/include/srslte/upper/ipv6.h b/lib/include/srslte/upper/ipv6.h index 66259f2a6..21fdda835 100644 --- a/lib/include/srslte/upper/ipv6.h +++ b/lib/include/srslte/upper/ipv6.h @@ -13,6 +13,8 @@ #ifndef SRSLTE_IPV6_H #define SRSLTE_IPV6_H +#include + // as of glibc 2.19, the IPv6 issue seems to be fixed https://sourceware.org/bugzilla/show_bug.cgi?id=15850 #if __GLIBC_PREREQ(2, 19) #include diff --git a/lib/src/common/mac_pcap.cc b/lib/src/common/mac_pcap.cc index ca5581c99..432b441c6 100644 --- a/lib/src/common/mac_pcap.cc +++ b/lib/src/common/mac_pcap.cc @@ -11,6 +11,8 @@ */ #include "srslte/common/mac_pcap.h" +#include "srslte/config.h" +#include "srslte/phy/common/phy_common.h" #include namespace srslte { @@ -44,8 +46,8 @@ uint32_t mac_pcap::open(const char* filename, uint32_t ue_id_) return SRSLTE_ERROR; } - ue_id = ue_id_; - running = true; + ue_id = ue_id_; + running = true; // start writer thread start(); diff --git a/lib/src/common/security.cc b/lib/src/common/security.cc index 00c61b8fe..8be620ba2 100644 --- a/lib/src/common/security.cc +++ b/lib/src/common/security.cc @@ -13,6 +13,7 @@ #include "srslte/common/security.h" #include "srslte/common/liblte_security.h" #include "srslte/common/s3g.h" +#include "srslte/config.h" #ifdef HAVE_MBEDTLS #include "mbedtls/md5.h" diff --git a/lib/src/phy/CMakeLists.txt b/lib/src/phy/CMakeLists.txt index f2dc3b6b0..d3cdd43c3 100644 --- a/lib/src/phy/CMakeLists.txt +++ b/lib/src/phy/CMakeLists.txt @@ -41,6 +41,6 @@ set(srslte_srcs $ $ ) -add_library(srslte_phy STATIC ${srslte_srcs}) +add_library(srslte_phy STATIC ${srslte_srcs} ) target_link_libraries(srslte_phy pthread m ${FFT_LIBRARIES}) -INSTALL(TARGETS srslte_phy DESTINATION ${LIBRARY_DIR}) \ No newline at end of file +INSTALL(TARGETS srslte_phy DESTINATION ${LIBRARY_DIR}) diff --git a/lib/src/phy/ch_estimation/dmrs_pdcch.c b/lib/src/phy/ch_estimation/dmrs_pdcch.c index 9daeea9dd..345e8dd17 100644 --- a/lib/src/phy/ch_estimation/dmrs_pdcch.c +++ b/lib/src/phy/ch_estimation/dmrs_pdcch.c @@ -11,6 +11,13 @@ */ #include "srslte/phy/ch_estimation/dmrs_pdcch.h" +#include "srslte/phy/ch_estimation/chest_common.h" +#include "srslte/phy/common/sequence.h" +#include "srslte/phy/utils/convolution.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/vector.h" +#include +#include /// @brief Every frequency resource is 6 Resource blocks, every resource block carries 3 pilots. So 18 possible pilots /// per frequency resource. diff --git a/lib/src/phy/ch_estimation/dmrs_sch.c b/lib/src/phy/ch_estimation/dmrs_sch.c index 4bd0eddc7..9914b3949 100644 --- a/lib/src/phy/ch_estimation/dmrs_sch.c +++ b/lib/src/phy/ch_estimation/dmrs_sch.c @@ -11,6 +11,7 @@ */ #include "srslte/phy/ch_estimation/dmrs_sch.h" +#include "srslte/phy/common/sequence.h" #include #define SRSLTE_DMRS_SCH_TYPEA_SINGLE_DURATION_MIN 3 diff --git a/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c b/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c index 00568a422..4d2ceb6b2 100644 --- a/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c +++ b/lib/src/phy/ch_estimation/test/dmrs_pdsch_test.c @@ -12,7 +12,7 @@ #include "srslte/common/test_common.h" #include "srslte/phy/ch_estimation/dmrs_sch.h" -#include "srslte/phy/ue/ue_dl_nr_data.h" +#include "srslte/phy/phch/ra_dl_nr.h" #include "srslte/srslte.h" #include #include @@ -312,7 +312,7 @@ int main(int argc, char** argv) grant.nof_dmrs_cdm_groups_without_data++) { // Load default type A grant - srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &grant); + srslte_ra_dl_nr_time_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &grant); // Copy configuration pdsch_cfg.dmrs_typeB = pdsch_cfg.dmrs_typeA; diff --git a/lib/src/phy/channel/hst.c b/lib/src/phy/channel/hst.c index 864cb08b2..bb788c74b 100644 --- a/lib/src/phy/channel/hst.c +++ b/lib/src/phy/channel/hst.c @@ -11,6 +11,9 @@ */ #include "srslte/phy/channel/hst.h" +#include "srslte/phy/utils/vector.h" +#include +#include int srslte_channel_hst_init(srslte_channel_hst_t* q, float fd_hz, float period_d, float init_time_s) { diff --git a/lib/src/phy/enb/enb_dl_nr.c b/lib/src/phy/enb/enb_dl_nr.c index 2f7a4a542..10610ca3e 100644 --- a/lib/src/phy/enb/enb_dl_nr.c +++ b/lib/src/phy/enb/enb_dl_nr.c @@ -167,37 +167,23 @@ int srslte_enb_dl_nr_base_zero(srslte_enb_dl_nr_t* q) return SRSLTE_SUCCESS; } -int srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot_cfg, - const srslte_search_space_t* search_space, - const srslte_dci_dl_nr_t* dci_dl, - const srslte_dci_location_t* dci_location, - uint16_t rnti) +int srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot_cfg, + const srslte_dci_dl_nr_t* dci_dl) { - if (q == NULL || search_space == NULL || slot_cfg == NULL || dci_dl == NULL) { + if (q == NULL || slot_cfg == NULL || dci_dl == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; } - // Hard-coded values - srslte_dci_format_nr_t dci_format = srslte_dci_format_nr_1_0; - srslte_rnti_type_t rnti_type = srslte_rnti_type_c; - // Put DMRS - if (srslte_dmrs_pdcch_put(&q->carrier, &q->coreset, slot_cfg, dci_location, q->sf_symbols[0]) < SRSLTE_SUCCESS) { + if (srslte_dmrs_pdcch_put(&q->carrier, &q->coreset, slot_cfg, &dci_dl->location, q->sf_symbols[0]) < SRSLTE_SUCCESS) { ERROR("Error putting PDCCH DMRS\n"); return SRSLTE_ERROR; } - // Initialise DCI MSG fields - srslte_dci_msg_nr_t dci_msg = {}; - dci_msg.location = *dci_location; - dci_msg.search_space = search_space->type; - dci_msg.rnti_type = rnti_type; - dci_msg.rnti = rnti; - dci_msg.format = dci_format; - // Pack DCI - if (srslte_dci_nr_format_1_0_pack(&q->carrier, &q->coreset, dci_dl, &dci_msg) < SRSLTE_SUCCESS) { + srslte_dci_msg_nr_t dci_msg = {}; + if (srslte_dci_nr_pack(&q->carrier, &q->coreset, dci_dl, &dci_msg) < SRSLTE_SUCCESS) { ERROR("Error packing DL DCI\n"); return SRSLTE_ERROR; } @@ -208,39 +194,37 @@ int srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, return SRSLTE_ERROR; } - INFO("DCI DL NR: L=%d; ncce=%d;\n", dci_location->L, dci_location->ncce); + INFO("DCI DL NR: L=%d; ncce=%d;\n", dci_dl->location.L, dci_dl->location.ncce); return SRSLTE_SUCCESS; } -int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot, - const srslte_sch_cfg_nr_t* cfg, - const srslte_sch_grant_nr_t* grant, - uint8_t* data[SRSLTE_MAX_TB]) +int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot, + const srslte_sch_cfg_nr_t* cfg, + uint8_t* data[SRSLTE_MAX_TB]) { - if (srslte_dmrs_sch_put_sf(&q->dmrs, slot, cfg, grant, q->sf_symbols[0]) < SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_put_sf(&q->dmrs, slot, cfg, &cfg->grant, q->sf_symbols[0]) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } - if (srslte_pdsch_nr_encode(&q->pdsch, cfg, grant, data, q->sf_symbols) < SRSLTE_SUCCESS) { + if (srslte_pdsch_nr_encode(&q->pdsch, cfg, &cfg->grant, data, q->sf_symbols) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } return SRSLTE_SUCCESS; } -int srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, - const srslte_sch_cfg_nr_t* cfg, - const srslte_sch_grant_nr_t* grant, - char* str, - uint32_t str_len) +int srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, + const srslte_sch_cfg_nr_t* cfg, + char* str, + uint32_t str_len) { int len = 0; // Append PDSCH info - len += srslte_pdsch_nr_tx_info(&q->pdsch, cfg, grant, &str[len], str_len - len); + len += srslte_pdsch_nr_tx_info(&q->pdsch, cfg, &cfg->grant, &str[len], str_len - len); return len; } diff --git a/lib/src/phy/phch/dci_nr.c b/lib/src/phy/phch/dci_nr.c index 62fdef55e..60c5c4932 100644 --- a/lib/src/phy/phch/dci_nr.c +++ b/lib/src/phy/phch/dci_nr.c @@ -35,6 +35,34 @@ static int dci_nr_format_1_0_freq_resource_size(const srslte_carrier_nr_t* carri return (int)ceil(log2(N_DL_BWP_RB * (N_DL_BWP_RB + 1) / 2.0)); } +int srslte_dci_nr_pack(const srslte_carrier_nr_t* carrier, + const srslte_coreset_t* coreset, + const srslte_dci_dl_nr_t* dci, + srslte_dci_msg_nr_t* msg) +{ + // Copy DCI MSG fields + msg->location = dci->location; + msg->search_space = dci->search_space.type; + msg->rnti_type = dci->rnti_type; + msg->rnti = dci->rnti; + msg->format = dci->format; + + // Pack DCI + switch (msg->format) { + case srslte_dci_format_nr_1_0: + if (srslte_dci_nr_format_1_0_pack(carrier, coreset, dci, msg) < SRSLTE_SUCCESS) { + ERROR("Error packing DL DCI\n"); + return SRSLTE_ERROR; + } + break; + default: + ERROR("Unsupported DCI format %d\n", msg->format); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + int srslte_dci_nr_format_1_0_pack(const srslte_carrier_nr_t* carrier, const srslte_coreset_t* coreset, const srslte_dci_dl_nr_t* dci, diff --git a/lib/src/phy/phch/pdcch_nr.c b/lib/src/phy/phch/pdcch_nr.c index 943276f3f..7ec569120 100644 --- a/lib/src/phy/phch/pdcch_nr.c +++ b/lib/src/phy/phch/pdcch_nr.c @@ -11,8 +11,12 @@ */ #include "srslte/phy/phch/pdcch_nr.h" +#include "srslte/phy/common/sequence.h" #include "srslte/phy/fec/polar/polar_chanalloc.h" #include "srslte/phy/fec/polar/polar_interleaver.h" +#include "srslte/phy/mimo/precoding.h" +#include "srslte/phy/modem/demod_soft.h" +#include "srslte/phy/utils/bit.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" diff --git a/lib/src/phy/phch/pdsch_nr.c b/lib/src/phy/phch/pdsch_nr.c index a6d79e926..5a17af34c 100644 --- a/lib/src/phy/phch/pdsch_nr.c +++ b/lib/src/phy/phch/pdsch_nr.c @@ -9,8 +9,12 @@ * the distribution. * */ + #include "srslte/phy/phch/pdsch_nr.h" #include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/mimo/layermap.h" +#include "srslte/phy/mimo/precoding.h" +#include "srslte/phy/modem/demod_soft.h" #include "srslte/phy/phch/ra_nr.h" int pdsch_nr_init_common(srslte_pdsch_nr_t* q, const srslte_pdsch_nr_args_t* args) diff --git a/lib/src/phy/phch/pusch_nr.c b/lib/src/phy/phch/pusch_nr.c index 0d391d804..d7f146fb0 100644 --- a/lib/src/phy/phch/pusch_nr.c +++ b/lib/src/phy/phch/pusch_nr.c @@ -11,6 +11,9 @@ */ #include "srslte/phy/phch/pusch_nr.h" #include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/mimo/layermap.h" +#include "srslte/phy/mimo/precoding.h" +#include "srslte/phy/modem/demod_soft.h" #include "srslte/phy/phch/ra_nr.h" int pusch_nr_init_common(srslte_pusch_nr_t* q, const srslte_pusch_nr_args_t* args) diff --git a/lib/src/phy/phch/ra_dl_nr.c b/lib/src/phy/phch/ra_dl_nr.c new file mode 100644 index 000000000..68b6009a2 --- /dev/null +++ b/lib/src/phy/phch/ra_dl_nr.c @@ -0,0 +1,256 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ +#include "srslte/phy/phch/ra_dl_nr.h" +#include "srslte/phy/utils/debug.h" + +static void sliv_to_s_and_l(uint32_t sliv, uint32_t* S, uint32_t* L) +{ + // S values can be 0 to 3 + uint32_t low = sliv % 14; + if (low < 7) { + *S = low; + *L = sliv / 14 + 1; + } else { + *S = 14 - 1 - low; + *L = 14 - sliv / 14 + 1; + } +} + +// Validate S and L combination for TypeA time domain resource allocation +static bool check_time_ra_typeA(uint32_t* S, uint32_t* L) +{ + // Check values using Table 5.1.2.1-1 + if (*S > 3) { + ERROR("S (%d) is out-of-range {0,1,2,3}\n", *S); + return false; + } + + if (*L < 3 || *L > 14) { + ERROR("L (%d) is out-of-range {3,...,14}\n", *L); + return false; + } + + uint32_t sum = *S + *L; + if (sum < 3) { + ERROR("The sum of S (%d) and L (%d) is lower than 3\n", *S, *L); + return false; + } + + if (sum > 14) { + ERROR("The sum of S (%d) and L (%d) is greater than 14\n", *S, *L); + return false; + } + + return true; +} + +static bool check_time_ra_typeB(uint32_t* S, uint32_t* L) +{ + ERROR("Not implemented\n"); + return false; +} + +bool srslte_ra_dl_nr_time_validate(srslte_sch_grant_nr_t* grant) +{ + if (grant->mapping == srslte_sch_mapping_type_A) { + return check_time_ra_typeA(&grant->S, &grant->L); + } else { + return check_time_ra_typeB(&grant->S, &grant->L); + } +} + +int srslte_ra_dl_nr_time_default_A(uint32_t m, srslte_dmrs_sch_typeA_pos_t dmrs_typeA_pos, srslte_sch_grant_nr_t* grant) +{ + if (grant == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (m >= SRSLTE_MAX_NOF_DL_ALLOCATION) { + ERROR("m (%d) is out-of-range\n", m); + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Select k0 + grant->k0 = 0; + + // Select PDSCH mapping + static srslte_sch_mapping_type_t pdsch_mapping_lut[16] = {srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_A, + srslte_sch_mapping_type_B, + srslte_sch_mapping_type_B}; + grant->mapping = pdsch_mapping_lut[m]; + + static uint32_t S_pos2[SRSLTE_MAX_NOF_DL_ALLOCATION] = {2, 2, 2, 2, 2, 9, 4, 5, 5, 9, 12, 1, 1, 2, 4, 8}; + static uint32_t L_pos2[SRSLTE_MAX_NOF_DL_ALLOCATION] = {12, 10, 9, 7, 5, 4, 4, 7, 2, 2, 2, 13, 6, 4, 7, 4}; + static uint32_t S_pos3[SRSLTE_MAX_NOF_DL_ALLOCATION] = {3, 3, 3, 3, 3, 10, 6, 5, 5, 9, 12, 1, 1, 2, 4, 8}; + static uint32_t L_pos3[SRSLTE_MAX_NOF_DL_ALLOCATION] = {11, 9, 8, 6, 4, 4, 4, 7, 2, 2, 2, 13, 6, 4, 7, 4}; + + // Select start symbol (S) and length (L) + switch (dmrs_typeA_pos) { + + case srslte_dmrs_sch_typeA_pos_2: + grant->S = S_pos2[m]; + grant->L = L_pos2[m]; + break; + case srslte_dmrs_sch_typeA_pos_3: + grant->S = S_pos3[m]; + grant->L = L_pos3[m]; + break; + default: + ERROR("Undefined case (%d)\n", dmrs_typeA_pos); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +void srslte_ra_dl_nr_time_hl(const srslte_pdsch_time_ra_t* hl_ra_cfg, srslte_sch_grant_nr_t* grant) +{ + // Compute S and L from SLIV from higher layers + sliv_to_s_and_l(hl_ra_cfg->sliv, &grant->S, &grant->L); + grant->k0 = hl_ra_cfg->k0; + grant->mapping = hl_ra_cfg->mapping_type; +} + +int srslte_ra_dl_nr_time(const srslte_sch_cfg_nr_t* cfg, + const srslte_rnti_type_t rnti_type, + const srslte_search_space_type_t ss_type, + const uint8_t m, + srslte_sch_grant_nr_t* grant) +{ + + if (cfg == NULL || grant == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (m >= SRSLTE_MAX_NOF_DL_ALLOCATION) { + ERROR("m (%d) is out-of-range\n", m); + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Determine which PDSCH Time domain RA configuration to apply (Table 5.1.2.1.1-1) + if (cfg->pdsch_time_is_default) { + // Note: Only Default A is supported, which corresponds SS/PBCH block and coreset mux pattern 1 + srslte_ra_dl_nr_time_default_A(m, cfg->dmrs_typeA.typeA_pos, grant); + } else { + srslte_ra_dl_nr_time_hl(&cfg->pdsch_time_ra[m], grant); + } + + // Validate S and L parameters + if (!srslte_ra_dl_nr_time_validate(grant)) { + ERROR("Invalid Time RA\n"); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +int srslte_ra_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_sch_cfg_nr_t* pdsch_cfg, + srslte_sch_grant_nr_t* grant) +{ + if (pdsch_cfg == NULL || grant == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + const srslte_dmrs_sch_cfg_t* dmrs_cfg = + grant->mapping == srslte_sch_mapping_type_A ? &pdsch_cfg->dmrs_typeA : &pdsch_cfg->dmrs_typeB; + + /* According to TS 38.214 V15.10.0 5.1.6.1.3 CSI-RS for mobility: + * When receiving PDSCH scheduled by DCI format 1_0, the UE shall assume the number of DM-RS CDM groups without data + * is 1 which corresponds to CDM group 0 for the case of PDSCH with allocation duration of 2 symbols, and the UE shall + * assume that the number of DM-RS CDM groups without data is 2 which corresponds to CDM group {0,1} for all other + * cases. + */ + if (dmrs_cfg->length == srslte_dmrs_sch_len_2) { + grant->nof_dmrs_cdm_groups_without_data = 1; + } else { + grant->nof_dmrs_cdm_groups_without_data = 2; + } + + return SRSLTE_SUCCESS; +} + +/* RBG size for type0 scheduling as in table 5.1.2.2.1-1 of 36.214 */ +uint32_t srslte_ra_dl_nr_type0_P(uint32_t bwp_size, bool config_is_1) +{ + if (bwp_size <= 36) { + return config_is_1 ? 2 : 4; + } else if (bwp_size <= 72) { + return config_is_1 ? 4 : 8; + } else if (bwp_size <= 144) { + return config_is_1 ? 8 : 16; + } else { + return 16; + } +} + +static int ra_freq_type0(const srslte_carrier_nr_t* carrier, + const srslte_sch_cfg_nr_t* cfg, + const srslte_dci_dl_nr_t* dci_dl, + srslte_sch_grant_nr_t* grant) +{ + uint32_t P = srslte_ra_dl_nr_type0_P(carrier->nof_prb, cfg->rbg_size_cfg_1); + + uint32_t N_rbg = (int)ceilf((float)(carrier->nof_prb + (carrier->start % P)) / P); + uint32_t rbg_offset = 0; + for (uint32_t i = 0; i < N_rbg; i++) { + uint32_t rbg_size = P; + if (i == 0) { + rbg_size -= (carrier->start % P); + } else if ((i == N_rbg - 1) && ((carrier->nof_prb + carrier->start) % P) > 0) { + rbg_size = (carrier->nof_prb + carrier->start) % P; + } + if (dci_dl->freq_domain_assigment & (1 << (N_rbg - i - 1))) { + for (uint32_t j = 0; j < rbg_size; j++) { + if (rbg_offset + j < carrier->nof_prb) { + grant->prb_idx[rbg_offset + j] = true; + grant->nof_prb++; + } + } + } + rbg_offset += rbg_size; + } + return 0; +} + +int srslte_ra_dl_nr_freq(const srslte_carrier_nr_t* carrier, + const srslte_sch_cfg_nr_t* cfg, + const srslte_dci_dl_nr_t* dci_dl, + srslte_sch_grant_nr_t* grant) +{ + + if (cfg == NULL || grant == NULL || dci_dl == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // RA scheme + if (dci_dl->format == srslte_dci_format_nr_1_0) { + ra_freq_type0(carrier, cfg, dci_dl, grant); + } else { + ERROR("Only DCI Format 1_0 is supported\n"); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 9ad8f5a37..8125f151d 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -12,6 +12,7 @@ #include "srslte/phy/phch/ra_nr.h" #include "srslte/phy/phch/pdsch_nr.h" +#include "srslte/phy/phch/ra_dl_nr.h" #include "srslte/phy/utils/debug.h" typedef struct { @@ -452,4 +453,46 @@ int srslte_ra_nr_fill_tb(const srslte_sch_cfg_nr_t* pdsch_cfg, tb->enabled = true; return SRSLTE_SUCCESS; -} \ No newline at end of file +} + +int srslte_ra_dl_dci_to_grant_nr(const srslte_carrier_nr_t* carrier, + const srslte_sch_cfg_nr_t* pdsch_cfg, + const srslte_dci_dl_nr_t* dci_dl, + srslte_sch_grant_nr_t* pdsch_grant) +{ + // Time domain resource allocation + if (srslte_ra_dl_nr_time( + pdsch_cfg, dci_dl->rnti_type, dci_dl->search_space.type, dci_dl->time_domain_assigment, pdsch_grant) < + SRSLTE_SUCCESS) { + ERROR("Error computing time domain resource allocation\n"); + return SRSLTE_ERROR; + } + + // Frequency domain resource allocation + if (srslte_ra_dl_nr_freq(carrier, pdsch_cfg, dci_dl, pdsch_grant) < SRSLTE_SUCCESS) { + ERROR("Error computing time domain resource allocation\n"); + return SRSLTE_ERROR; + } + + //??? + if (srslte_ra_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(pdsch_cfg, pdsch_grant) < SRSLTE_SUCCESS) { + ERROR("Error loading number of DMRS CDM groups\n"); + return SRSLTE_ERROR; + } + + pdsch_grant->nof_layers = 1; + pdsch_grant->dci_format = dci_dl->format; + pdsch_grant->rnti = dci_dl->rnti; + + for (uint32_t i = 0; i < carrier->nof_prb; i++) { + pdsch_grant->prb_idx[i] = true; + } + + // Compute TB size + if (srslte_ra_nr_fill_tb(pdsch_cfg, pdsch_grant, dci_dl->mcs, &pdsch_grant->tb[0]) < SRSLTE_SUCCESS) { + ERROR("Error filing tb\n"); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} diff --git a/lib/src/phy/phch/test/pdcch_nr_test.c b/lib/src/phy/phch/test/pdcch_nr_test.c index 9112cead2..4df7285a1 100644 --- a/lib/src/phy/phch/test/pdcch_nr_test.c +++ b/lib/src/phy/phch/test/pdcch_nr_test.c @@ -12,6 +12,7 @@ #include "srslte/common/test_common.h" #include "srslte/phy/phch/pdcch_nr.h" +#include "srslte/phy/utils/random.h" #include static srslte_carrier_nr_t carrier = { diff --git a/lib/src/phy/phch/test/pdsch_nr_test.c b/lib/src/phy/phch/test/pdsch_nr_test.c index ea6e2d9a2..b02921a95 100644 --- a/lib/src/phy/phch/test/pdsch_nr_test.c +++ b/lib/src/phy/phch/test/pdsch_nr_test.c @@ -11,12 +11,14 @@ */ #include "srslte/phy/phch/pdsch_nr.h" +#include "srslte/phy/phch/ra_dl_nr.h" #include "srslte/phy/phch/ra_nr.h" -#include "srslte/phy/ue/ue_dl_nr_data.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/random.h" #include "srslte/phy/utils/vector.h" +#include #include +#include static srslte_carrier_nr_t carrier = { 1, // cell_id @@ -151,13 +153,13 @@ int main(int argc, char** argv) } // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { + if (srslte_ra_dl_nr_time_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading default grant\n"); goto clean_exit; } // Load number of DMRS CDM groups without data - if (srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(&pdsch_cfg, &pdsch_grant) < SRSLTE_SUCCESS) { + if (srslte_ra_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(&pdsch_cfg, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading number of DMRS CDM groups without data\n"); goto clean_exit; } diff --git a/lib/src/phy/phch/test/pusch_nr_test.c b/lib/src/phy/phch/test/pusch_nr_test.c index 1002968de..097dc1f87 100644 --- a/lib/src/phy/phch/test/pusch_nr_test.c +++ b/lib/src/phy/phch/test/pusch_nr_test.c @@ -16,6 +16,7 @@ #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/random.h" #include "srslte/phy/utils/vector.h" +#include #include static srslte_carrier_nr_t carrier = { diff --git a/lib/src/phy/phch/test/ra_nr_test.c b/lib/src/phy/phch/test/ra_nr_test.c new file mode 100644 index 000000000..f43ab5c26 --- /dev/null +++ b/lib/src/phy/phch/test/ra_nr_test.c @@ -0,0 +1,101 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/common/test_common.h" +#include "srslte/phy/phch/ra_dl_nr.h" +#include "srslte/phy/phch/ra_nr.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/random.h" +#include + +static srslte_carrier_nr_t carrier = { + 1, // cell_id + 0, // numerology + SRSLTE_MAX_PRB_NR, // nof_prb + 0, // start + 1 // max_mimo_layers +}; + +int test_type0_multiple() +{ + srslte_sch_cfg_nr_t sch_cfg = {}; + srslte_dci_dl_nr_t dci_dl = {}; + srslte_sch_grant_nr_t grant = {}; + + carrier.nof_prb = 32; + carrier.start = 48; + + sch_cfg.rbg_size_cfg_1 = false; + dci_dl.format = srslte_dci_format_nr_1_0; + + dci_dl.freq_domain_assigment = 0xC0; // RBG 0 and 1 + + TESTASSERT(srslte_ra_dl_nr_freq(&carrier, &sch_cfg, &dci_dl, &grant) == SRSLTE_SUCCESS); + + TESTASSERT(grant.nof_prb == 8); // P * 2 RBG + for (uint32_t i = 0; i < grant.nof_prb; i++) { + TESTASSERT(grant.prb_idx[i] == true); + } + for (uint32_t i = grant.nof_prb; i < carrier.nof_prb; i++) { + TESTASSERT(grant.prb_idx[i] == false); + } + + return SRSLTE_SUCCESS; +} + +int test_type0_not_multiple() +{ + srslte_sch_cfg_nr_t sch_cfg = {}; + srslte_dci_dl_nr_t dci_dl = {}; + srslte_sch_grant_nr_t grant = {}; + + carrier.nof_prb = 33; + carrier.start = 49; + + sch_cfg.rbg_size_cfg_1 = false; + dci_dl.format = srslte_dci_format_nr_1_0; + + dci_dl.freq_domain_assigment = 0x1C0; // RBG 0, 1 and 2 + + TESTASSERT(srslte_ra_dl_nr_freq(&carrier, &sch_cfg, &dci_dl, &grant) == SRSLTE_SUCCESS); + + TESTASSERT(grant.nof_prb == 11); // P + (P-1) RBG + for (uint32_t i = 0; i < grant.nof_prb; i++) { + TESTASSERT(grant.prb_idx[i] == true); + } + for (uint32_t i = grant.nof_prb; i < carrier.nof_prb; i++) { + TESTASSERT(grant.prb_idx[i] == false); + } + + bzero(&grant, sizeof(srslte_sch_grant_nr_t)); + + dci_dl.freq_domain_assigment = 0x3; // RBG 8 and 9 + + TESTASSERT(srslte_ra_dl_nr_freq(&carrier, &sch_cfg, &dci_dl, &grant) == SRSLTE_SUCCESS); + + TESTASSERT(grant.nof_prb == 6); // P + (P-1) RBG + for (uint32_t i = 0; i < carrier.nof_prb - grant.nof_prb; i++) { + TESTASSERT(grant.prb_idx[i] == false); + } + for (uint32_t i = carrier.nof_prb - grant.nof_prb; i < carrier.nof_prb; i++) { + TESTASSERT(grant.prb_idx[i] == true); + } + + return SRSLTE_SUCCESS; +} + +int main(int argc, char** argv) +{ + // TESTASSERT(test_type0_multiple() == SRSLTE_SUCCESS); + TESTASSERT(test_type0_not_multiple() == SRSLTE_SUCCESS); + return SRSLTE_SUCCESS; +} diff --git a/lib/src/phy/phch/test/sch_nr_test.c b/lib/src/phy/phch/test/sch_nr_test.c index aa3221957..96f6a4589 100644 --- a/lib/src/phy/phch/test/sch_nr_test.c +++ b/lib/src/phy/phch/test/sch_nr_test.c @@ -10,9 +10,9 @@ * */ +#include "srslte/phy/phch/ra_dl_nr.h" #include "srslte/phy/phch/ra_nr.h" #include "srslte/phy/phch/sch_nr.h" -#include "srslte/phy/ue/ue_dl_nr_data.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" #include @@ -132,7 +132,7 @@ int main(int argc, char** argv) } // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { + if (srslte_ra_dl_nr_time_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading default grant\n"); goto clean_exit; } diff --git a/lib/src/phy/ue/ue_dl_nr.c b/lib/src/phy/ue/ue_dl_nr.c index 4ebc7d21a..79896631e 100644 --- a/lib/src/phy/ue/ue_dl_nr.c +++ b/lib/src/phy/ue/ue_dl_nr.c @@ -305,24 +305,23 @@ int srslte_ue_dl_nr_find_dl_dci(srslte_ue_dl_nr_t* q, return (int)count; } -int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q, - const srslte_dl_slot_cfg_t* slot, - const srslte_sch_cfg_nr_t* cfg, - const srslte_sch_grant_nr_t* grant, - srslte_pdsch_res_nr_t* res) +int srslte_ue_dl_nr_decode_pdsch(srslte_ue_dl_nr_t* q, + const srslte_dl_slot_cfg_t* slot, + const srslte_sch_cfg_nr_t* cfg, + srslte_pdsch_res_nr_t* res) { - if (srslte_dmrs_sch_estimate(&q->dmrs_pdsch, slot, cfg, grant, q->sf_symbols[0], &q->chest) < SRSLTE_SUCCESS) { + if (srslte_dmrs_sch_estimate(&q->dmrs_pdsch, slot, cfg, &cfg->grant, q->sf_symbols[0], &q->chest) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } - if (srslte_pdsch_nr_decode(&q->pdsch, cfg, grant, &q->chest, q->sf_symbols, res) < SRSLTE_SUCCESS) { + if (srslte_pdsch_nr_decode(&q->pdsch, cfg, &cfg->grant, &q->chest, q->sf_symbols, res) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { char str[512]; - srslte_ue_dl_nr_pdsch_info(q, cfg, grant, res, str, sizeof(str)); + srslte_ue_dl_nr_pdsch_info(q, cfg, res, str, sizeof(str)); INFO("PDSCH: %s\n", str); } @@ -331,7 +330,6 @@ int srslte_ue_dl_nr_pdsch_get(srslte_ue_dl_nr_t* q, int srslte_ue_dl_nr_pdsch_info(const srslte_ue_dl_nr_t* q, const srslte_sch_cfg_nr_t* cfg, - const srslte_sch_grant_nr_t* grant, const srslte_pdsch_res_nr_t* res, char* str, uint32_t str_len) @@ -342,7 +340,7 @@ int srslte_ue_dl_nr_pdsch_info(const srslte_ue_dl_nr_t* q, // ... // Append PDSCH info - len += srslte_pdsch_nr_rx_info(&q->pdsch, cfg, grant, res, &str[len], str_len - len); + len += srslte_pdsch_nr_rx_info(&q->pdsch, cfg, &cfg->grant, res, &str[len], str_len - len); return len; } diff --git a/lib/src/phy/ue/ue_dl_nr_data.c b/lib/src/phy/ue/ue_dl_nr_data.c deleted file mode 100644 index bb0e7bcf8..000000000 --- a/lib/src/phy/ue/ue_dl_nr_data.c +++ /dev/null @@ -1,157 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2020 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. - * - */ -#include "srslte/phy/ue/ue_dl_nr_data.h" -#include "srslte/phy/utils/debug.h" - -static int srslte_ue_dl_nr_pdsch_time_resource_hl_A(uint32_t sliv, uint32_t* S, uint32_t* L) -{ - // S values can be 0 to 3 - uint32_t low = sliv % 14; - if (low < 7) { - *S = low; - *L = sliv / 14 + 1; - } else { - *S = 14 - 1 - low; - *L = 14 - sliv / 14 + 1; - } - - // Check values using Table 5.1.2.1-1 - if (*S > 3) { - ERROR("Invalid SLIV %d. S (%d) is out-of-range {0,1,2,3}\n", sliv, *S); - return SRSLTE_ERROR; - } - - if (*L < 3 || *L > 14) { - ERROR("Invalid SLIV %d. L (%d) is out-of-range {3,...,14}\n", sliv, *L); - return SRSLTE_ERROR; - } - - uint32_t sum = *S + *L; - if (sum < 3) { - ERROR("Invalid SLIV %d. The sum of S (%d) and L (%d) is lower than 3\n", sliv, *S, *L); - return SRSLTE_ERROR; - } - - if (sum > 14) { - ERROR("Invalid SLIV %d. The sum of S (%d) and L (%d) is greater than 14\n", sliv, *S, *L); - return SRSLTE_ERROR; - } - - return SRSLTE_SUCCESS; -} - -static int srslte_ue_dl_nr_pdsch_time_resource_hl_B(uint32_t sliv, uint32_t* S, uint32_t* L) -{ - ERROR("Not implemented\n"); - return SRSLTE_ERROR; -} - -int srslte_ue_dl_nr_pdsch_time_resource_hl(const srslte_pdsch_allocation_t* pdsch_alloc, srslte_sch_grant_nr_t* grant) -{ - - if (pdsch_alloc == NULL || grant == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - - grant->k0 = pdsch_alloc->k0; - grant->mapping = pdsch_alloc->mapping_type; - - if (pdsch_alloc->mapping_type == srslte_sch_mapping_type_A) { - return srslte_ue_dl_nr_pdsch_time_resource_hl_A(pdsch_alloc->sliv, &grant->S, &grant->L); - } - - return srslte_ue_dl_nr_pdsch_time_resource_hl_B(pdsch_alloc->sliv, &grant->S, &grant->L); -} - -int srslte_ue_dl_nr_pdsch_time_resource_default_A(uint32_t m, - srslte_dmrs_sch_typeA_pos_t dmrs_typeA_pos, - srslte_sch_grant_nr_t* grant) -{ - if (grant == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - - if (m >= 16) { - ERROR("m (%d) is out-of-range\n", m); - return SRSLTE_ERROR_INVALID_INPUTS; - } - - // Select k0 - grant->k0 = 0; - - // Select PDSCH mapping - static srslte_sch_mapping_type_t pdsch_mapping_lut[16] = {srslte_sch_mapping_type_A, - srslte_sch_mapping_type_A, - srslte_sch_mapping_type_A, - srslte_sch_mapping_type_A, - srslte_sch_mapping_type_A, - srslte_sch_mapping_type_B, - srslte_sch_mapping_type_B, - srslte_sch_mapping_type_B, - srslte_sch_mapping_type_B, - srslte_sch_mapping_type_B, - srslte_sch_mapping_type_B, - srslte_sch_mapping_type_A, - srslte_sch_mapping_type_A, - srslte_sch_mapping_type_A, - srslte_sch_mapping_type_B, - srslte_sch_mapping_type_B}; - grant->mapping = pdsch_mapping_lut[m]; - - static uint32_t S_pos2[16] = {2, 2, 2, 2, 2, 9, 4, 5, 5, 9, 12, 1, 1, 2, 4, 8}; - static uint32_t L_pos2[16] = {12, 10, 9, 7, 5, 4, 4, 7, 2, 2, 2, 13, 6, 4, 7, 4}; - static uint32_t S_pos3[16] = {3, 3, 3, 3, 3, 10, 6, 5, 5, 9, 12, 1, 1, 2, 4, 8}; - static uint32_t L_pos3[16] = {11, 9, 8, 6, 4, 4, 4, 7, 2, 2, 2, 13, 6, 4, 7, 4}; - - // Select start symbol (S) and length (L) - switch (dmrs_typeA_pos) { - - case srslte_dmrs_sch_typeA_pos_2: - grant->S = S_pos2[m]; - grant->L = L_pos2[m]; - break; - case srslte_dmrs_sch_typeA_pos_3: - grant->S = S_pos3[m]; - grant->L = L_pos3[m]; - break; - default: - ERROR("Undefined case (%d)\n", dmrs_typeA_pos); - return SRSLTE_ERROR; - } - - return SRSLTE_SUCCESS; -} - -int srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(const srslte_sch_cfg_nr_t* pdsch_cfg, - srslte_sch_grant_nr_t* grant) -{ - if (pdsch_cfg == NULL || grant == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - - const srslte_dmrs_sch_cfg_t* dmrs_cfg = - grant->mapping == srslte_sch_mapping_type_A ? &pdsch_cfg->dmrs_typeA : &pdsch_cfg->dmrs_typeB; - - /* According to TS 38.214 V15.10.0 5.1.6.1.3 CSI-RS for mobility: - * When receiving PDSCH scheduled by DCI format 1_0, the UE shall assume the number of DM-RS CDM groups without data - * is 1 which corresponds to CDM group 0 for the case of PDSCH with allocation duration of 2 symbols, and the UE shall - * assume that the number of DM-RS CDM groups without data is 2 which corresponds to CDM group {0,1} for all other - * cases. - */ - if (dmrs_cfg->length == srslte_dmrs_sch_len_2) { - grant->nof_dmrs_cdm_groups_without_data = 1; - } else { - grant->nof_dmrs_cdm_groups_without_data = 2; - } - - return SRSLTE_SUCCESS; -} \ No newline at end of file diff --git a/lib/src/phy/utils/debug.c b/lib/src/phy/utils/debug.c index 44b3bb636..45f140e0b 100644 --- a/lib/src/phy/utils/debug.c +++ b/lib/src/phy/utils/debug.c @@ -24,4 +24,4 @@ void get_time_interval(struct timeval* tdata) tdata[0].tv_sec--; tdata[0].tv_usec += 1000000; } -} \ No newline at end of file +} diff --git a/lib/src/upper/gtpu.cc b/lib/src/upper/gtpu.cc index 8b22cbcd0..ba687a386 100644 --- a/lib/src/upper/gtpu.cc +++ b/lib/src/upper/gtpu.cc @@ -12,6 +12,8 @@ #include "srslte/upper/gtpu.h" #include "srslte/common/int_helpers.h" +#include +#include namespace srslte { diff --git a/lib/test/asn1/nas_decoder.cc b/lib/test/asn1/nas_decoder.cc index 997ee6ab9..4af0ecaf2 100644 --- a/lib/test/asn1/nas_decoder.cc +++ b/lib/test/asn1/nas_decoder.cc @@ -12,6 +12,7 @@ #include "srslte/asn1/liblte_mme.h" #include "srslte/common/common.h" +#include "srslte/phy/common/phy_common.h" #include #include diff --git a/lib/test/asn1/s1ap_test.cc b/lib/test/asn1/s1ap_test.cc index cacd6c7a5..778b08091 100644 --- a/lib/test/asn1/s1ap_test.cc +++ b/lib/test/asn1/s1ap_test.cc @@ -12,6 +12,8 @@ #include "srslte/asn1/s1ap.h" #include "srslte/common/test_common.h" +#include +#include using namespace asn1; using namespace asn1::s1ap; diff --git a/lib/test/common/timeout_test.cc b/lib/test/common/timeout_test.cc index c8ab081bd..d11970081 100644 --- a/lib/test/common/timeout_test.cc +++ b/lib/test/common/timeout_test.cc @@ -10,7 +10,10 @@ * */ +extern "C" { #include "srslte/common/timeout.h" +#include "srslte/config.h" +} #include #include diff --git a/lib/test/phy/phy_dl_nr_test.c b/lib/test/phy/phy_dl_nr_test.c index cd9186d90..a04c64757 100644 --- a/lib/test/phy/phy_dl_nr_test.c +++ b/lib/test/phy/phy_dl_nr_test.c @@ -11,9 +11,9 @@ */ #include "srslte/phy/enb/enb_dl_nr.h" +#include "srslte/phy/phch/ra_dl_nr.h" #include "srslte/phy/phch/ra_nr.h" #include "srslte/phy/ue/ue_dl_nr.h" -#include "srslte/phy/ue/ue_dl_nr_data.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/random.h" #include "srslte/phy/utils/vector.h" @@ -95,14 +95,22 @@ int work_gnb_dl(srslte_enb_dl_nr_t* enb_dl, return SRSLTE_ERROR; } + // Hard-coded values + dci_dl->format = srslte_dci_format_nr_1_0; + dci_dl->rnti_type = srslte_rnti_type_c; + dci_dl->location = *dci_location; + dci_dl->search_space = *search_space; + dci_dl->rnti = rnti; + // Put actual DCI - if (srslte_enb_dl_nr_pdcch_put(enb_dl, slot, search_space, dci_dl, dci_location, rnti) < SRSLTE_SUCCESS) { + if (srslte_enb_dl_nr_pdcch_put(enb_dl, slot, dci_dl) < SRSLTE_SUCCESS) { ERROR("Error putting PDCCH\n"); return SRSLTE_ERROR; } // Put PDSCH transmission - if (srslte_enb_dl_nr_pdsch_put(enb_dl, slot, &pdsch_cfg, &pdsch_grant, data_tx) < SRSLTE_SUCCESS) { + pdsch_cfg.grant = pdsch_grant; + if (srslte_enb_dl_nr_pdsch_put(enb_dl, slot, &pdsch_cfg, data_tx) < SRSLTE_SUCCESS) { ERROR("Error putting PDSCH\n"); return SRSLTE_ERROR; } @@ -131,7 +139,8 @@ int work_ue_dl(srslte_ue_dl_nr_t* ue_dl, return SRSLTE_ERROR; } - if (srslte_ue_dl_nr_pdsch_get(ue_dl, slot, &pdsch_cfg, &pdsch_grant, pdsch_res) < SRSLTE_SUCCESS) { + pdsch_cfg.grant = pdsch_grant; + if (srslte_ue_dl_nr_decode_pdsch(ue_dl, slot, &pdsch_cfg, pdsch_res) < SRSLTE_SUCCESS) { ERROR("Error decoding\n"); return SRSLTE_ERROR; } @@ -254,7 +263,7 @@ int main(int argc, char** argv) } // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { + if (srslte_ra_dl_nr_time_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { ERROR("Error loading default grant\n"); goto clean_exit; } diff --git a/srsenb/hdr/phy/nr/cc_worker.h b/srsenb/hdr/phy/nr/cc_worker.h index 2b74a19d2..a60cbddb0 100644 --- a/srsenb/hdr/phy/nr/cc_worker.h +++ b/srsenb/hdr/phy/nr/cc_worker.h @@ -23,6 +23,7 @@ #define SRSENB_NR_CC_WORKER_H #include "srslte/common/log.h" +#include "srslte/interfaces/gnb_interfaces.h" #include "srslte/phy/enb/enb_dl_nr.h" #include #include @@ -69,9 +70,12 @@ public: cf_t* get_rx_buffer(uint32_t antenna_idx); uint32_t get_buffer_len(); - bool work_dl(); + bool work_dl(const srslte_dl_slot_cfg_t& dl_slot_cfg, stack_interface_phy_nr::dl_sched_t& dl_grants); private: + int encode_pdsch(stack_interface_phy_nr::dl_sched_grant_t* grants, uint32_t nof_grants); + int encode_pdcch_dl(stack_interface_phy_nr::dl_sched_grant_t* grants, uint32_t nof_grants); + srslte_dl_slot_cfg_t dl_slot_cfg = {}; uint32_t cc_idx = 0; std::array tx_buffer = {}; @@ -80,10 +84,6 @@ private: phy_nr_state* phy_state; srslte_enb_dl_nr_t enb_dl = {}; srslte::log* log_h = nullptr; - - // Temporal attributes - srslte_softbuffer_tx_t softbuffer_tx = {}; - std::vector data; }; } // namespace nr diff --git a/srsenb/hdr/phy/nr/sf_worker.h b/srsenb/hdr/phy/nr/sf_worker.h index 809531467..d01a70359 100644 --- a/srsenb/hdr/phy/nr/sf_worker.h +++ b/srsenb/hdr/phy/nr/sf_worker.h @@ -41,7 +41,7 @@ class sf_worker final : public srslte::thread_pool::worker { public: sf_worker(phy_common* phy_, phy_nr_state* phy_state_, srslte::log* log); - ~sf_worker() = default; + ~sf_worker(); bool set_carrier_unlocked(uint32_t cc_idx, const srslte_carrier_nr_t* carrier_); @@ -60,6 +60,10 @@ private: phy_common* phy = nullptr; phy_nr_state* phy_state = nullptr; srslte::log* log_h = nullptr; + + // Temporal attributes + srslte_softbuffer_tx_t softbuffer_tx = {}; + std::vector data; }; } // namespace nr diff --git a/srsenb/hdr/stack/rrc/rrc_config.h b/srsenb/hdr/stack/rrc/rrc_config.h index ee6e6b3b8..fc1cded79 100644 --- a/srsenb/hdr/stack/rrc/rrc_config.h +++ b/srsenb/hdr/stack/rrc/rrc_config.h @@ -17,6 +17,7 @@ #include "srslte/asn1/rrc.h" #include "srslte/common/security.h" #include "srslte/interfaces/enb_rrc_interface_types.h" +#include "srslte/phy/common/phy_common.h" #include namespace srsenb { diff --git a/srsenb/src/metrics_csv.cc b/srsenb/src/metrics_csv.cc index 9507dffd8..6385730fb 100644 --- a/srsenb/src/metrics_csv.cc +++ b/srsenb/src/metrics_csv.cc @@ -11,6 +11,7 @@ */ #include "srsenb/hdr/metrics_csv.h" +#include "srslte/phy/utils/vector.h" #include #include diff --git a/srsenb/src/metrics_stdout.cc b/srsenb/src/metrics_stdout.cc index 22928554e..cf44bde1b 100644 --- a/srsenb/src/metrics_stdout.cc +++ b/srsenb/src/metrics_stdout.cc @@ -11,6 +11,7 @@ */ #include "srsenb/hdr/metrics_stdout.h" +#include "srslte/phy/utils/vector.h" #include #include diff --git a/srsenb/src/phy/nr/cc_worker.cc b/srsenb/src/phy/nr/cc_worker.cc index 73b64f00c..3feb80514 100644 --- a/srsenb/src/phy/nr/cc_worker.cc +++ b/srsenb/src/phy/nr/cc_worker.cc @@ -20,10 +20,7 @@ */ #include "srsenb/hdr/phy/nr/cc_worker.h" -#include "srslte/common/common.h" -#include "srslte/phy/enb/enb_dl_nr.h" -#include "srslte/phy/phch/ra_nr.h" -#include "srslte/phy/ue/ue_dl_nr_data.h" +#include "srslte/srslte.h" namespace srsenb { namespace nr { @@ -44,21 +41,11 @@ cc_worker::cc_worker(uint32_t cc_idx_, srslte::log* log, phy_nr_state* phy_state ERROR("Error initiating UE DL NR\n"); return; } - - if (srslte_softbuffer_tx_init_guru(&softbuffer_tx, SRSLTE_SCH_NR_MAX_NOF_CB_LDPC, SRSLTE_LDPC_MAX_LEN_ENCODED_CB) < - SRSLTE_SUCCESS) { - ERROR("Error init soft-buffer\n"); - return; - } - data.resize(SRSLTE_SCH_NR_MAX_NOF_CB_LDPC * SRSLTE_LDPC_MAX_LEN_ENCODED_CB / 8); - srslte_vec_u8_zero(data.data(), SRSLTE_SCH_NR_MAX_NOF_CB_LDPC * SRSLTE_LDPC_MAX_LEN_ENCODED_CB / 8); - snprintf((char*)data.data(), SRSLTE_SCH_NR_MAX_NOF_CB_LDPC * SRSLTE_LDPC_MAX_LEN_ENCODED_CB / 8, "hello world!"); } cc_worker::~cc_worker() { srslte_enb_dl_nr_free(&enb_dl); - srslte_softbuffer_tx_free(&softbuffer_tx); for (cf_t* p : rx_buffer) { if (p != nullptr) { free(p); @@ -74,6 +61,16 @@ cc_worker::~cc_worker() bool cc_worker::set_carrier(const srslte_carrier_nr_t* carrier) { if (srslte_enb_dl_nr_set_carrier(&enb_dl, carrier) < SRSLTE_SUCCESS) { + ERROR("Error setting carrier\n"); + return false; + } + + srslte_coreset_t coreset = {}; + coreset.freq_resources[0] = true; // Enable the bottom 6 PRB for PDCCH + coreset.duration = 2; + + if (srslte_enb_dl_nr_set_coreset(&enb_dl, &coreset) < SRSLTE_SUCCESS) { + ERROR("Error setting coreset\n"); return false; } @@ -108,50 +105,74 @@ uint32_t cc_worker::get_buffer_len() return tx_buffer.size(); } -bool cc_worker::work_dl() +int cc_worker::encode_pdcch_dl(stack_interface_phy_nr::dl_sched_grant_t* grants, uint32_t nof_grants) { - srslte_sch_grant_nr_t pdsch_grant = {}; - srslte_sch_cfg_nr_t pdsch_cfg = phy_state->cfg.pdsch; - // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { - ERROR("Error loading default grant\n"); - return false; - } + for (uint32_t i = 0; i < nof_grants; i++) { - if (srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(&pdsch_cfg, &pdsch_grant) < SRSLTE_SUCCESS) { - ERROR("Error loading number of DMRS CDM groups\n"); - return false; - } + // Get PHY config for UE + // ... - pdsch_grant.nof_layers = enb_dl.carrier.max_mimo_layers; - pdsch_grant.dci_format = srslte_dci_format_nr_1_0; - pdsch_grant.rnti = 0x1234; + // Put actual DCI + if (srslte_enb_dl_nr_pdcch_put(&enb_dl, &dl_slot_cfg, &grants[i].dci) < SRSLTE_SUCCESS) { + ERROR("Error putting PDCCH\n"); + return SRSLTE_ERROR; + } - for (uint32_t i = 0; i < enb_dl.carrier.nof_prb; i++) { - pdsch_grant.prb_idx[i] = true; + if (log_h->get_level() >= srslte::LOG_LEVEL_INFO) { + log_h->info("PDCCH: cc=%d, ...\n", cc_idx); + } } - if (srslte_ra_nr_fill_tb(&pdsch_cfg, &pdsch_grant, 27, &pdsch_grant.tb[0]) < SRSLTE_SUCCESS) { - ERROR("Error filing tb\n"); - return false; - } + return SRSLTE_SUCCESS; +} + +int cc_worker::encode_pdsch(stack_interface_phy_nr::dl_sched_grant_t* grants, uint32_t nof_grants) +{ + for (uint32_t i = 0; i < nof_grants; i++) { - uint8_t* data2[SRSLTE_MAX_TB] = {data.data(), data.data()}; - pdsch_grant.tb[0].softbuffer.tx = &softbuffer_tx; - srslte_softbuffer_tx_reset(pdsch_grant.tb[0].softbuffer.tx); + // Get PHY config for UE + // ... + srslte_sch_cfg_nr_t pdsch_cfg = phy_state->cfg.pdsch; - if (srslte_enb_dl_nr_pdsch_put(&enb_dl, &dl_slot_cfg, &pdsch_cfg, &pdsch_grant, data2) < SRSLTE_SUCCESS) { - ERROR("Error decoding PDSCH\n"); - return false; + // Compute DL grant + if (srslte_ra_dl_dci_to_grant_nr(&enb_dl.carrier, &pdsch_cfg, &grants[i].dci, &pdsch_cfg.grant)) { + ERROR("Computing DL grant\n"); + } + + // Set soft buffer + for (uint32_t j = 0; j < SRSLTE_MAX_CODEWORDS; j++) { + pdsch_cfg.grant.tb[j].softbuffer.tx = grants[i].softbuffer_tx[j]; + } + + if (srslte_enb_dl_nr_pdsch_put(&enb_dl, &dl_slot_cfg, &pdsch_cfg, grants[i].data) < SRSLTE_SUCCESS) { + ERROR("Error putting PDSCH\n"); + return false; + } + + // Logging + if (log_h->get_level() >= srslte::LOG_LEVEL_INFO) { + char str[512]; + srslte_enb_dl_nr_pdsch_info(&enb_dl, &pdsch_cfg, str, sizeof(str)); + log_h->info("PDSCH: cc=%d, %s\n", cc_idx, str); + } } - // Logging - if (log_h->get_level() >= srslte::LOG_LEVEL_INFO) { - char str[512]; - srslte_enb_dl_nr_pdsch_info(&enb_dl, &pdsch_cfg, &pdsch_grant, str, sizeof(str)); - log_h->info("PDSCH: cc=%d, %s\n", cc_idx, str); + return SRSLTE_SUCCESS; +} + +bool cc_worker::work_dl(const srslte_dl_slot_cfg_t& dl_sf_cfg, stack_interface_phy_nr::dl_sched_t& dl_grants) +{ + // Reset resource grid + if (srslte_enb_dl_nr_base_zero(&enb_dl) < SRSLTE_SUCCESS) { + ERROR("Error setting base to zero\n"); + return SRSLTE_ERROR; } + // Put DL grants to resource grid. PDSCH data will be encoded as well. + encode_pdcch_dl(dl_grants.pdsch, dl_grants.nof_grants); + encode_pdsch(dl_grants.pdsch, dl_grants.nof_grants); + + // Generate signal srslte_enb_dl_nr_gen_signal(&enb_dl); return true; diff --git a/srsenb/src/phy/nr/sf_worker.cc b/srsenb/src/phy/nr/sf_worker.cc index 5b0de8804..19bed3f0c 100644 --- a/srsenb/src/phy/nr/sf_worker.cc +++ b/srsenb/src/phy/nr/sf_worker.cc @@ -30,6 +30,20 @@ sf_worker::sf_worker(phy_common* phy_, phy_nr_state* phy_state_, srslte::log* lo cc_worker* w = new cc_worker(i, log, phy_state); cc_workers.push_back(std::unique_ptr(w)); } + + if (srslte_softbuffer_tx_init_guru(&softbuffer_tx, SRSLTE_SCH_NR_MAX_NOF_CB_LDPC, SRSLTE_LDPC_MAX_LEN_ENCODED_CB) < + SRSLTE_SUCCESS) { + ERROR("Error init soft-buffer\n"); + return; + } + data.resize(SRSLTE_SCH_NR_MAX_NOF_CB_LDPC * SRSLTE_LDPC_MAX_LEN_ENCODED_CB / 8); + srslte_vec_u8_zero(data.data(), SRSLTE_SCH_NR_MAX_NOF_CB_LDPC * SRSLTE_LDPC_MAX_LEN_ENCODED_CB / 8); + snprintf((char*)data.data(), SRSLTE_SCH_NR_MAX_NOF_CB_LDPC * SRSLTE_LDPC_MAX_LEN_ENCODED_CB / 8, "hello world!"); +} + +sf_worker::~sf_worker() +{ + srslte_softbuffer_tx_free(&softbuffer_tx); } bool sf_worker::set_carrier_unlocked(uint32_t cc_idx, const srslte_carrier_nr_t* carrier_) @@ -83,8 +97,35 @@ void sf_worker::work_imp() } } + // Configure user + phy_state->cfg.pdsch.rbg_size_cfg_1 = false; + phy_state->cfg.pdsch.pdsch_time_is_default = true; + + // Fill grant (this comes from the scheduler) + srslte_dl_slot_cfg_t dl_cfg = {}; + stack_interface_phy_nr::dl_sched_t grants = {}; + + grants.nof_grants = 1; + grants.pdsch[0].data[0] = data.data(); + grants.pdsch[0].softbuffer_tx[0] = &softbuffer_tx; + srslte_softbuffer_tx_reset(&softbuffer_tx); + + grants.pdsch[0].dci.rnti = 0x1234; + grants.pdsch[0].dci.format = srslte_dci_format_nr_1_0; + + grants.pdsch[0].dci.freq_domain_assigment = 0x1FFF; + grants.pdsch[0].dci.time_domain_assigment = 0; + grants.pdsch[0].dci.mcs = 27; + + grants.pdsch[0].dci.search_space.type = srslte_search_space_type_ue; + for (uint32_t L = 0; L < SRSLTE_SEARCH_SPACE_NOF_AGGREGATION_LEVELS_NR; L++) { + grants.pdsch[0].dci.search_space.nof_candidates[L] = 1; + } + grants.pdsch[0].dci.location.L = 0; + grants.pdsch[0].dci.location.ncce = 0; + for (auto& w : cc_workers) { - w->work_dl(); + w->work_dl(dl_cfg, grants); } phy->worker_end(this, tx_buffer, dummy_ts, true); diff --git a/srsenb/src/stack/rrc/rrc_cell_cfg.cc b/srsenb/src/stack/rrc/rrc_cell_cfg.cc index 10f58b15e..a71a9f471 100644 --- a/srsenb/src/stack/rrc/rrc_cell_cfg.cc +++ b/srsenb/src/stack/rrc/rrc_cell_cfg.cc @@ -11,6 +11,7 @@ */ #include "srsenb/hdr/stack/rrc/rrc_cell_cfg.h" +#include "srslte/phy/utils/vector.h" using namespace asn1::rrc; diff --git a/srsepc/src/hss/hss.cc b/srsepc/src/hss/hss.cc index ae984f0be..1528dd062 100644 --- a/srsepc/src/hss/hss.cc +++ b/srsepc/src/hss/hss.cc @@ -11,6 +11,7 @@ */ #include "srsepc/hdr/hss/hss.h" #include "srslte/common/security.h" +#include #include // for printing uint64_t #include #include diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index 36dd1be73..e6a4abccb 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -21,6 +21,7 @@ #include "srslte/common/logger_srslog_wrapper.h" #include "srslte/common/signal_handler.h" #include "srslte/srslog/srslog.h" +#include "srslte/srslte.h" #include #include #include diff --git a/srsepc/src/spgw/gtpc.cc b/srsepc/src/spgw/gtpc.cc index ed528bccf..124377e4f 100644 --- a/srsepc/src/spgw/gtpc.cc +++ b/srsepc/src/spgw/gtpc.cc @@ -12,6 +12,7 @@ #include "srsepc/hdr/spgw/gtpc.h" #include +#include #include #include #include // for printing uint64_t diff --git a/srsepc/src/spgw/gtpu.cc b/srsepc/src/spgw/gtpu.cc index cd2a21f15..cd6b19e8b 100644 --- a/srsepc/src/spgw/gtpu.cc +++ b/srsepc/src/spgw/gtpu.cc @@ -14,6 +14,7 @@ #include "srsepc/hdr/mme/mme_gtpc.h" #include "srslte/upper/gtpu.h" #include +#include #include #include // for printing uint64_t #include diff --git a/srsue/hdr/phy/nr/cc_worker.h b/srsue/hdr/phy/nr/cc_worker.h index df3100ff7..613f40107 100644 --- a/srsue/hdr/phy/nr/cc_worker.h +++ b/srsue/hdr/phy/nr/cc_worker.h @@ -23,7 +23,7 @@ #define SRSLTE_NR_CC_WORKER_H #include "srslte/common/log.h" -#include "srslte/phy/ue/ue_dl_nr.h" +#include "srslte/srslte.h" #include "srsue/hdr/phy/phy_common.h" #include #include @@ -84,6 +84,13 @@ private: // Temporal attributes srslte_softbuffer_rx_t softbuffer_rx = {}; std::vector data; + + // Current rnti + uint16_t rnti = 0; + + // Current coreset and search space + srslte_coreset_t coreset = {}; + srslte_search_space_t search_space = {}; }; } // namespace nr diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 3cdd7b3a1..74d71d6d1 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -114,7 +114,7 @@ public: void set_ue_identity(srslte::s_tmsi_t s_tmsi); void paging_completed(bool outcome) final; bool has_nr_dc(); - + // NR interface #ifdef HAVE_5GNR void new_cell_meas_nr(const std::vector& meas); diff --git a/srsue/src/phy/nr/cc_worker.cc b/srsue/src/phy/nr/cc_worker.cc index e7c4fb354..6573585b0 100644 --- a/srsue/src/phy/nr/cc_worker.cc +++ b/srsue/src/phy/nr/cc_worker.cc @@ -20,8 +20,7 @@ */ #include "srsue/hdr/phy/nr/cc_worker.h" -#include "srslte/phy/phch/ra_nr.h" -#include "srslte/phy/ue/ue_dl_nr_data.h" +#include "srslte/srslte.h" namespace srsue { namespace nr { @@ -74,7 +73,6 @@ bool cc_worker::set_carrier(const srslte_carrier_nr_t* carrier) return false; } - srslte_coreset_t coreset = {}; coreset.freq_resources[0] = true; // Enable the bottom 6 PRB for PDCCH coreset.duration = 2; @@ -83,6 +81,10 @@ bool cc_worker::set_carrier(const srslte_carrier_nr_t* carrier) return false; } + // Set default PDSCH config + phy_state->cfg.pdsch.rbg_size_cfg_1 = false; + phy_state->cfg.pdsch.pdsch_time_is_default = true; + return true; } @@ -107,41 +109,50 @@ uint32_t cc_worker::get_buffer_len() bool cc_worker::work_dl() { - srslte_sch_grant_nr_t pdsch_grant = {}; + srslte_dci_dl_nr_t dci_dl = {}; srslte_sch_cfg_nr_t pdsch_cfg = phy_state->cfg.pdsch; std::array pdsch_res = {}; - // Use grant default A time resources with m=0 - if (srslte_ue_dl_nr_pdsch_time_resource_default_A(0, pdsch_cfg.dmrs_typeA.typeA_pos, &pdsch_grant) < SRSLTE_SUCCESS) { - ERROR("Error loading default grant\n"); - return false; - } + // Run FFT + srslte_ue_dl_nr_estimate_fft(&ue_dl, &dl_slot_cfg); - if (srslte_ue_dl_nr_nof_dmrs_cdm_groups_without_data_format_1_0(&pdsch_cfg, &pdsch_grant) < SRSLTE_SUCCESS) { - ERROR("Error loading number of DMRS CDM groups\n"); - return false; - } + // Set rnti + rnti = 0x1234; - pdsch_grant.nof_layers = ue_dl.carrier.max_mimo_layers; - pdsch_grant.dci_format = srslte_dci_format_nr_1_0; - pdsch_grant.rnti = 0x1234; + // Configure Search space + search_space.type = srslte_search_space_type_ue; + for (uint32_t L = 0; L < SRSLTE_SEARCH_SPACE_NOF_AGGREGATION_LEVELS_NR; L++) { + search_space.nof_candidates[L] = srslte_pdcch_nr_max_candidates_coreset(&coreset, L); + } - for (uint32_t i = 0; i < ue_dl.carrier.nof_prb; i++) { - pdsch_grant.prb_idx[i] = true; + srslte_dci_dl_nr_t dci_dl_rx = {}; + int nof_found_dci = srslte_ue_dl_nr_find_dl_dci(&ue_dl, &search_space, &dl_slot_cfg, rnti, &dci_dl_rx, 1); + if (nof_found_dci < SRSLTE_SUCCESS) { + ERROR("Error decoding\n"); + return SRSLTE_ERROR; } - if (srslte_ra_nr_fill_tb(&pdsch_cfg, &pdsch_grant, 27, &pdsch_grant.tb[0]) < SRSLTE_SUCCESS) { - ERROR("Error filing tb\n"); - return false; + if (nof_found_dci < 1) { + ERROR("Error DCI not found\n"); } - pdsch_res[0].payload = data.data(); - pdsch_grant.tb[0].softbuffer.rx = &softbuffer_rx; - srslte_softbuffer_rx_reset(pdsch_grant.tb[0].softbuffer.rx); + dci_dl.rnti = 0x1234; + dci_dl.format = srslte_dci_format_nr_1_0; - srslte_ue_dl_nr_estimate_fft(&ue_dl, &dl_slot_cfg); + dci_dl.freq_domain_assigment = 0x1FFF; + dci_dl.time_domain_assigment = 0; + dci_dl.mcs = 27; + + // Compute DL grant + if (srslte_ra_dl_dci_to_grant_nr(&ue_dl.carrier, &pdsch_cfg, &dci_dl, &pdsch_cfg.grant)) { + ERROR("Computing DL grant\n"); + } + + pdsch_res[0].payload = data.data(); + pdsch_cfg.grant.tb[0].softbuffer.rx = &softbuffer_rx; + srslte_softbuffer_rx_reset(pdsch_cfg.grant.tb[0].softbuffer.rx); - if (srslte_ue_dl_nr_pdsch_get(&ue_dl, &dl_slot_cfg, &pdsch_cfg, &pdsch_grant, pdsch_res.data()) < SRSLTE_SUCCESS) { + if (srslte_ue_dl_nr_decode_pdsch(&ue_dl, &dl_slot_cfg, &pdsch_cfg, pdsch_res.data()) < SRSLTE_SUCCESS) { ERROR("Error decoding PDSCH\n"); return false; } @@ -149,7 +160,7 @@ bool cc_worker::work_dl() // Logging if (log_h->get_level() >= srslte::LOG_LEVEL_INFO) { char str[512]; - srslte_ue_dl_nr_pdsch_info(&ue_dl, &pdsch_cfg, &pdsch_grant, pdsch_res.data(), str, sizeof(str)); + srslte_ue_dl_nr_pdsch_info(&ue_dl, &pdsch_cfg, pdsch_res.data(), str, sizeof(str)); log_h->info("PDSCH: cc=%d, %s\n", cc_idx, str); } diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index a94ba86b0..0e32cfb47 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -1972,7 +1972,7 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) if (args.release > 14) { ue_eutra_cap_v1450_ies = &ue_eutra_cap_v1360_ies->non_crit_ext.non_crit_ext.non_crit_ext; // 14.60 - ue_eutra_cap_v1450_ies->non_crit_ext_present = true; + ue_eutra_cap_v1450_ies->non_crit_ext_present = true; ue_eutra_cap_v1450_ies->non_crit_ext.non_crit_ext_present = true; irat_params_nr_r15_s irat_params_nr_r15; diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index faf2aa22f..852e5ee92 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -181,8 +181,8 @@ void rrc_nr::get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps_pdu) band_combination_v1540_s band_combination_v1540; band_params_v1540_s band_params_a; - band_params_a.srs_tx_switch_present = true; - band_params_a.srs_carrier_switch_present = false; + band_params_a.srs_tx_switch_present = true; + band_params_a.srs_carrier_switch_present = false; band_params_a.srs_tx_switch.supported_srs_tx_port_switch = band_params_v1540_s::srs_tx_switch_s_::supported_srs_tx_port_switch_opts::not_supported; band_combination_v1540.band_list_v1540.push_back(band_params_a); diff --git a/srsue/src/stack/upper/tft_packet_filter.cc b/srsue/src/stack/upper/tft_packet_filter.cc index 8a4a8d92d..d7e2643a7 100644 --- a/srsue/src/stack/upper/tft_packet_filter.cc +++ b/srsue/src/stack/upper/tft_packet_filter.cc @@ -29,7 +29,7 @@ tft_packet_filter_t::tft_packet_filter_t(uint8_t active_filters(0), log(log_) { - int idx = 0; + int idx = 0; uint32_t length_in_bytes = 0; uint32_t remaining_bits = 0; while (idx < tft.filter_size) { @@ -237,7 +237,7 @@ bool tft_packet_filter_t::match_ip(const srslte::unique_byte_buffer_t& pdu) if (filter_contains(IPV6_REMOTE_ADDR_FLAG | IPV6_REMOTE_ADDR_LENGTH_FLAG)) { bool match = true; for (int i = 0; i < ipv6_remote_addr_length; i++) { - match &= ((ipv6_remote_addr[i] ^ ip6_pkt->daddr.__in6_u.__u6_addr8[i]) & ipv6_remote_addr_mask[i]) == 0; + match &= ((ipv6_remote_addr[i] ^ ip6_pkt->daddr.in6_u.u6_addr8[i]) & ipv6_remote_addr_mask[i]) == 0; if (!match) { return false; } From 8330793da96233cbb41208dc5be6648c746dd26a Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 20 Jan 2021 11:45:44 +0000 Subject: [PATCH 076/138] use DCI format1A in edge case where the enb has more than one cell and the nof_prbs=15 --- srsenb/src/stack/mac/sched_ue.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index f665a7cbd..1a454aedb 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -498,7 +498,7 @@ int sched_ue::generate_format1(uint32_t pid, // If the size of Format1 and Format1A is ambiguous in the common SS, use Format1A since the UE assumes // Common SS when spaces collide - if (cell.nof_prb == 15 && carriers.size() > 1) { + if (cell.nof_prb == 15 && cells.size() > 1) { dci->alloc_type = SRSLTE_RA_ALLOC_TYPE2; dci->type2_alloc.mode = srslte_ra_type2_t::SRSLTE_RA_TYPE2_LOC; rbg_interval rbg_int = rbg_interval::rbgmask_to_rbgs(user_mask); From 7f6f3f7912298fa9423a324bec2523d0b9516d31 Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 20 Jan 2021 12:27:16 +0000 Subject: [PATCH 077/138] fix sched test check for ConRes DCI format. --- srsenb/src/stack/mac/sched_ue.cc | 2 +- srsenb/test/mac/sched_ue_ded_test_suite.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 1a454aedb..23e86bd59 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -507,7 +507,7 @@ int sched_ue::generate_format1(uint32_t pid, uint32_t RB_start = prb_int.start(); dci->type2_alloc.riv = srslte_ra_type2_to_riv(L_crb, RB_start, cell.nof_prb); dci->format = SRSLTE_DCI_FORMAT1A; - if (L_crb != cell_nof_rbg_to_prb(user_mask.size())) { + if (L_crb != count_prb_per_tb(user_mask)) { // This happens if Type0 was using distributed allocation Warning("SCHED: Can't use distributed RA due to DCI size ambiguity\n"); } diff --git a/srsenb/test/mac/sched_ue_ded_test_suite.cc b/srsenb/test/mac/sched_ue_ded_test_suite.cc index a9501b9d4..a3a61c8c2 100644 --- a/srsenb/test/mac/sched_ue_ded_test_suite.cc +++ b/srsenb/test/mac/sched_ue_ded_test_suite.cc @@ -292,7 +292,9 @@ int test_ra(const sim_enb_ctxt_t& enb_ctxt, const sf_output_res_t& sf_out) for (uint32_t j = 0; j < dl_cc_res.data[i].nof_pdu_elems[0]; ++j) { if (dl_cc_res.data[i].pdu[0][j].lcid == (uint32_t)srslte::dl_sch_lcid::CON_RES_ID) { // ConRes found - CONDERROR(dl_cc_res.data[i].dci.format != SRSLTE_DCI_FORMAT1, "ConRes must be format1\n"); + CONDERROR(dl_cc_res.data[i].dci.format != SRSLTE_DCI_FORMAT1 and + dl_cc_res.data[i].dci.format != SRSLTE_DCI_FORMAT1A, + "ConRes must be format1/1a\n"); msg4_count++; } } From a09fb95c25c4dd7a4e70bcf97231b1033fb41f6e Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 13 Jan 2021 22:11:25 +0100 Subject: [PATCH 078/138] proc_ra: protect RA procedure from concurrent thread access that patch addreses issue #2199 by defering RA-related calls that are executed from within PHY workers. The time-critical bits of more complex functions such as tb_decoded() are still executed in the PHY worker thread but the state machine manipulation is defered. --- srsue/hdr/stack/mac/proc_ra.h | 110 +++++++++++++------------------- srsue/src/stack/mac/mac.cc | 3 +- srsue/src/stack/mac/proc_ra.cc | 113 ++++++++++++++++++++------------- srsue/test/mac_test.cc | 11 +++- 4 files changed, 125 insertions(+), 112 deletions(-) diff --git a/srsue/hdr/stack/mac/proc_ra.h b/srsue/hdr/stack/mac/proc_ra.h index 26f31d9f6..498c01ef2 100644 --- a/srsue/hdr/stack/mac/proc_ra.h +++ b/srsue/hdr/stack/mac/proc_ra.h @@ -13,6 +13,7 @@ #ifndef SRSUE_PROC_RA_H #define SRSUE_PROC_RA_H +#include #include #include @@ -30,30 +31,7 @@ namespace srsue { class ra_proc : public srslte::timer_callback { public: - ra_proc() : rar_pdu_msg(20) - { - bzero(&softbuffer_rar, sizeof(srslte_softbuffer_rx_t)); - pcap = NULL; - backoff_interval_start = 0; - backoff_interval = 0; - received_target_power_dbm = 0; - ra_rnti = 0; - current_ta = 0; - state = IDLE; - last_msg3_group = RA_GROUP_A; - phy_h = NULL; - mux_unit = NULL; - rrc = NULL; - transmitted_contention_id = 0; - transmitted_crnti = 0; - started_by_pdcch = false; - rar_grant_nbytes = 0; - - noncontention_enabled = false; - next_preamble_idx = 0; - next_prach_mask = 0; - current_task_id = 0; - }; + ra_proc() : rar_pdu_msg(20){}; ~ra_proc(); @@ -82,8 +60,8 @@ public: void timer_expired(uint32_t timer_id); void new_grant_dl(mac_interface_phy_lte::mac_grant_dl_t grant, mac_interface_phy_lte::tb_action_dl_t* action); void tb_decoded_ok(const uint8_t cc_idx, const uint32_t tti); + bool contention_resolution_id_received(uint64_t rx_contention_id); - bool contention_resolution_id_received(uint64_t uecri); void start_pcap(srslte::mac_pcap* pcap); void notify_ra_completed(uint32_t task_id); @@ -104,40 +82,42 @@ private: void response_error(); void complete(); + bool contention_resolution_id_received_unsafe(uint64_t rx_contention_id); + // Buffer to receive RAR PDU - static const uint32_t MAX_RAR_PDU_LEN = 2048; - uint8_t rar_pdu_buffer[MAX_RAR_PDU_LEN]; + static const uint32_t MAX_RAR_PDU_LEN = 2048; + uint8_t rar_pdu_buffer[MAX_RAR_PDU_LEN] = {}; srslte::rar_pdu rar_pdu_msg; // Random Access parameters provided by higher layers defined in 5.1.1 - srslte::rach_cfg_t rach_cfg, new_cfg; + srslte::rach_cfg_t rach_cfg = {}; - int delta_preamble_db; - uint32_t maskIndex; - int preambleIndex; - uint32_t new_ra_msg_len; + int delta_preamble_db = 0; + uint32_t maskIndex = 0; + int preambleIndex = 0; + uint32_t new_ra_msg_len = 0; - bool noncontention_enabled; - uint32_t next_preamble_idx; - uint32_t next_prach_mask; + bool noncontention_enabled = false; + uint32_t next_preamble_idx = 0; + uint32_t next_prach_mask = 0; // Internal variables - uint32_t preambleTransmissionCounter; - uint32_t backoff_param_ms; - uint32_t sel_maskIndex; - uint32_t sel_preamble; - int backoff_interval_start; - uint32_t backoff_interval; - int received_target_power_dbm; - uint32_t ra_rnti; - uint32_t ra_tti; - uint32_t current_ta; + uint32_t preambleTransmissionCounter = 0; + uint32_t backoff_param_ms = 0; + uint32_t sel_maskIndex = 0; + std::atomic sel_preamble = {0}; + int backoff_interval_start = 0; + uint32_t backoff_interval = 0; + int received_target_power_dbm = 0; + uint32_t ra_rnti = SRSLTE_INVALID_RNTI; + uint32_t ra_tti = 0; + uint32_t current_ta = 0; // The task_id is a unique number associated with each RA procedure used to track background tasks - uint32_t current_task_id; + uint32_t current_task_id = 0; - srslte_softbuffer_rx_t softbuffer_rar; + srslte_softbuffer_rx_t softbuffer_rar = {}; - enum { + enum ra_state_t { IDLE = 0, PDCCH_SETUP, RESPONSE_RECEPTION, @@ -145,36 +125,36 @@ private: CONTENTION_RESOLUTION, START_WAIT_COMPLETION, WAITING_COMPLETION - } state; + }; + std::atomic state = {IDLE}; typedef enum { RA_GROUP_A, RA_GROUP_B } ra_group_t; - ra_group_t last_msg3_group; + ra_group_t last_msg3_group = RA_GROUP_A; - uint32_t rar_window_st; + uint32_t rar_window_st = 0; void read_params(); - phy_interface_mac_lte* phy_h; - srslte::log_ref log_h; - mux* mux_unit; - srslte::mac_pcap* pcap; - rrc_interface_mac* rrc; - srslte::ext_task_sched_handle* task_sched = nullptr; + phy_interface_mac_lte* phy_h = nullptr; + srslte::log_ref log_h; + mux* mux_unit = nullptr; + srslte::mac_pcap* pcap = nullptr; + rrc_interface_mac* rrc = nullptr; + srslte::ext_task_sched_handle* task_sched = nullptr; + srslte::task_multiqueue::queue_handle task_queue; srslte::timer_handler::unique_timer* time_alignment_timer = nullptr; srslte::timer_handler::unique_timer contention_resolution_timer; - mac_interface_rrc::ue_rnti_t* rntis; - - uint64_t transmitted_contention_id; - uint16_t transmitted_crnti; + mac_interface_rrc::ue_rnti_t* rntis = nullptr; - std::mutex mutex; + std::atomic transmitted_contention_id = {0}; + std::atomic transmitted_crnti = {0}; - bool started_by_pdcch; - uint32_t rar_grant_nbytes; - bool rar_received; + bool started_by_pdcch = false; + uint32_t rar_grant_nbytes = 0; + bool rar_received = false; }; } // namespace srsue diff --git a/srsue/src/stack/mac/mac.cc b/srsue/src/stack/mac/mac.cc index e78c36184..42d918efd 100644 --- a/srsue/src/stack/mac/mac.cc +++ b/srsue/src/stack/mac/mac.cc @@ -306,7 +306,8 @@ uint16_t mac::get_dl_sched_rnti(uint32_t tti) return SRSLTE_SIRNTI; } } - if (ra_window_start > 0 && ra_window_length > 0 && is_in_window(tti, &ra_window_start, &ra_window_length)) { + if (uernti.rar_rnti && ra_window_start > 0 && ra_window_length > 0 && + is_in_window(tti, &ra_window_start, &ra_window_length)) { Debug("SCHED: Searching RAR-RNTI=0x%x, tti=%d\n", uernti.rar_rnti, tti); return uernti.rar_rnti; } diff --git a/srsue/src/stack/mac/proc_ra.cc b/srsue/src/stack/mac/proc_ra.cc index 630052fc7..9b89c4aa7 100644 --- a/srsue/src/stack/mac/proc_ra.cc +++ b/srsue/src/stack/mac/proc_ra.cc @@ -55,6 +55,8 @@ void ra_proc::init(phy_interface_mac_lte* phy_h_, rrc = rrc_; task_sched = task_sched_; + task_queue = task_sched->make_task_queue(); + time_alignment_timer = time_alignment_timer_; contention_resolution_timer = task_sched->get_unique_timer(); @@ -80,16 +82,16 @@ void ra_proc::start_pcap(srslte::mac_pcap* pcap_) pcap = pcap_; } -/* Sets a new configuration. The configuration is applied by initialization() function */ +// RRC calls to set a new PRACH configuration. +// The configuration is applied by initialization() function. void ra_proc::set_config(srslte::rach_cfg_t& rach_cfg_) { - std::unique_lock ul(mutex); - new_cfg = rach_cfg_; + rach_cfg = rach_cfg_; } +// RRC might also call this to set additional params during mobility void ra_proc::set_config_ded(uint32_t preamble_index, uint32_t prach_mask) { - std::unique_lock ul(mutex); next_preamble_idx = preamble_index; next_prach_mask = prach_mask; noncontention_enabled = true; @@ -98,10 +100,6 @@ void ra_proc::set_config_ded(uint32_t preamble_index, uint32_t prach_mask) /* Reads the configuration and configures internal variables */ void ra_proc::read_params() { - mutex.lock(); - rach_cfg = new_cfg; - mutex.unlock(); - // Read initialization parameters if (noncontention_enabled) { preambleIndex = next_preamble_idx; @@ -128,7 +126,7 @@ void ra_proc::read_params() */ void ra_proc::step(uint32_t tti_) { - switch (state) { + switch (state.load()) { case IDLE: break; case PDCCH_SETUP: @@ -160,8 +158,9 @@ void ra_proc::state_pdcch_setup() if (info.is_transmitted) { ra_tti = info.tti_ra; ra_rnti = 1 + (ra_tti % 10) + (10 * info.f_id); - rInfo("seq=%d, ra-rnti=0x%x, ra-tti=%d, f_id=%d\n", sel_preamble, ra_rnti, info.tti_ra, info.f_id); - srslte::console("Random Access Transmission: seq=%d, tti=%d, ra-rnti=0x%x\n", sel_preamble, info.tti_ra, ra_rnti); + rInfo("seq=%d, ra-rnti=0x%x, ra-tti=%d, f_id=%d\n", sel_preamble.load(), ra_rnti, info.tti_ra, info.f_id); + srslte::console( + "Random Access Transmission: seq=%d, tti=%d, ra-rnti=0x%x\n", sel_preamble.load(), info.tti_ra, ra_rnti); rar_window_st = ra_tti + 3; rntis->rar_rnti = ra_rnti; state = RESPONSE_RECEPTION; @@ -314,7 +313,7 @@ void ra_proc::resource_selection() } rDebug("Selected preambleIndex=%d maskIndex=%d GroupA=%d, GroupB=%d\n", - sel_preamble, + sel_preamble.load(), sel_maskIndex, rach_cfg.nof_groupA_preambles, nof_groupB_preambles); @@ -326,12 +325,11 @@ void ra_proc::resource_selection() /* Preamble transmission as defined in 5.1.3 */ void ra_proc::preamble_transmission() { - received_target_power_dbm = rach_cfg.iniReceivedTargetPower + delta_preamble_db + (preambleTransmissionCounter - 1) * rach_cfg.powerRampingStep; phy_h->prach_send(sel_preamble, sel_maskIndex - 1, received_target_power_dbm); - rntis->rar_rnti = 0; + rntis->rar_rnti = SRSLTE_INVALID_RNTI; ra_tti = 0; rar_received = false; backoff_interval_start = -1; @@ -385,8 +383,10 @@ void ra_proc::new_grant_dl(mac_interface_phy_lte::mac_grant_dl_t grant, mac_inte } } -/* Called upon the successful decoding of a TB addressed to RA-RNTI. - * Processes the reception of a RAR as defined in 5.1.4 +/* Called from PHY worker upon the successful decoding of a TB addressed to RA-RNTI. + * We extract the most relevant and time critical details from the RAR PDU, + * as definied in 5.1.4 and then defer the handling of the RA state machine to be + * executed on the Stack thread. */ void ra_proc::tb_decoded_ok(const uint8_t cc_idx, const uint32_t tti) { @@ -394,10 +394,12 @@ void ra_proc::tb_decoded_ok(const uint8_t cc_idx, const uint32_t tti) pcap->write_dl_ranti(rar_pdu_buffer, rar_grant_nbytes, ra_rnti, true, tti, cc_idx); } - rDebug("RAR decoded successfully TBS=%d\n", rar_grant_nbytes); - rar_pdu_msg.init_rx(rar_grant_nbytes); - rar_pdu_msg.parse_packet(rar_pdu_buffer); + if (rar_pdu_msg.parse_packet(rar_pdu_buffer) != SRSLTE_SUCCESS) { + rError("Error decoding RAR PDU\n"); + } + + rDebug("RAR decoded successfully TBS=%d\n", rar_grant_nbytes); // Set Backoff parameter if (rar_pdu_msg.has_backoff()) { @@ -417,24 +419,21 @@ void ra_proc::tb_decoded_ok(const uint8_t cc_idx, const uint32_t tti) // TODO: Indicate received target power // phy_h->set_target_power_rar(iniReceivedTargetPower, (preambleTransmissionCounter-1)*powerRampingStep); - uint8_t grant[srslte::rar_subh::RAR_GRANT_LEN]; + uint8_t grant[srslte::rar_subh::RAR_GRANT_LEN] = {}; rar_pdu_msg.get()->get_sched_grant(grant); - rntis->rar_rnti = 0; + rntis->rar_rnti = SRSLTE_INVALID_RNTI; phy_h->set_rar_grant(grant, rar_pdu_msg.get()->get_temp_crnti()); current_ta = rar_pdu_msg.get()->get_ta_cmd(); rInfo("RAPID=%d, TA=%d, T-CRNTI=0x%x\n", - sel_preamble, + sel_preamble.load(), rar_pdu_msg.get()->get_ta_cmd(), rar_pdu_msg.get()->get_temp_crnti()); - if (preambleIndex > 0) { - // Preamble selected by Network - complete(); - } else { - // Preamble selected by UE MAC + // Perform actions when preamble was selected by UE MAC + if (preambleIndex <= 0) { mux_unit->msg3_prepare(); rntis->temp_rnti = rar_pdu_msg.get()->get_temp_crnti(); @@ -446,7 +445,7 @@ void ra_proc::tb_decoded_ok(const uint8_t cc_idx, const uint32_t tti) // If we have a C-RNTI, tell Mux unit to append C-RNTI CE if no CCCH SDU transmission if (transmitted_crnti) { - rInfo("Appending C-RNTI MAC CE 0x%x in next transmission\n", transmitted_crnti); + rInfo("Appending C-RNTI MAC CE 0x%x in next transmission\n", transmitted_crnti.load()); mux_unit->append_crnti_ce_next_tx(transmitted_crnti); } } @@ -454,8 +453,13 @@ void ra_proc::tb_decoded_ok(const uint8_t cc_idx, const uint32_t tti) // Save transmitted UE contention id, as defined by higher layers transmitted_contention_id = rntis->contention_id; - rDebug("Waiting for Contention Resolution\n"); - state = CONTENTION_RESOLUTION; + task_queue.push([this]() { + rDebug("Waiting for Contention Resolution\n"); + state = CONTENTION_RESOLUTION; + }); + } else { + // Preamble selected by Network, defer result handling + task_queue.push([this]() { complete(); }); } } else { if (rar_pdu_msg.get()->has_rapid()) { @@ -549,9 +553,22 @@ void ra_proc::timer_expired(uint32_t timer_id) } /* Function called by MAC when a Contention Resolution ID CE is received. - * Performs the actions defined in 5.1.5 for Temporal C-RNTI Contention Resolution + * Since this is called from within a PHY worker thread, we enqueue the handling, + * check that the contention resolution IDs match and return so the DL TB can be acked. + * + * The RA-related actions are scheduled to be executed on the Stack thread, + * even if we realize later that we have received that in a wrong state. */ bool ra_proc::contention_resolution_id_received(uint64_t rx_contention_id) +{ + task_queue.push([this, rx_contention_id]() { contention_resolution_id_received_unsafe(rx_contention_id); }); + return (transmitted_contention_id == rx_contention_id); +} + +/* + * Performs the actions defined in 5.1.5 for Temporal C-RNTI Contention Resolution + */ +bool ra_proc::contention_resolution_id_received_unsafe(uint64_t rx_contention_id) { bool uecri_successful = false; @@ -571,7 +588,7 @@ bool ra_proc::contention_resolution_id_received(uint64_t rx_contention_id) complete(); } else { rInfo("Transmitted UE Contention Id differs from received Contention ID (0x%" PRIx64 " != 0x%" PRIx64 ")\n", - transmitted_contention_id, + transmitted_contention_id.load(), rx_contention_id); // Discard MAC PDU @@ -584,17 +601,21 @@ bool ra_proc::contention_resolution_id_received(uint64_t rx_contention_id) return uecri_successful; } +// Called from PHY worker context, defer actions therefore. void ra_proc::pdcch_to_crnti(bool is_new_uplink_transmission) { - // TS 36.321 Section 5.1.5 - rDebug("PDCCH to C-RNTI received %s new UL transmission\n", is_new_uplink_transmission ? "with" : "without"); - if ((!started_by_pdcch && is_new_uplink_transmission) || started_by_pdcch) { - rDebug("PDCCH for C-RNTI received\n"); - contention_resolution_timer.stop(); - complete(); - } + task_queue.push([this, is_new_uplink_transmission]() { + // TS 36.321 Section 5.1.5 + rDebug("PDCCH to C-RNTI received %s new UL transmission\n", is_new_uplink_transmission ? "with" : "without"); + if ((!started_by_pdcch && is_new_uplink_transmission) || started_by_pdcch) { + rDebug("PDCCH for C-RNTI received\n"); + contention_resolution_timer.stop(); + complete(); + } + }); } +// Called from the Stack thread void ra_proc::update_rar_window(int& rar_window_start, int& rar_window_length) { if (state != RESPONSE_RECEPTION) { @@ -611,13 +632,19 @@ void ra_proc::update_rar_window(int& rar_window_start, int& rar_window_length) // Restart timer at each Msg3 HARQ retransmission (5.1.5) void ra_proc::harq_retx() { - rInfo("Restarting ContentionResolutionTimer=%d ms\n", contention_resolution_timer.duration()); - contention_resolution_timer.run(); + task_queue.push([this]() { + rInfo("Restarting ContentionResolutionTimer=%d ms\n", contention_resolution_timer.duration()); + contention_resolution_timer.run(); + }); } +// Called from PHY worker thread void ra_proc::harq_max_retx() { - Warning("Contention Resolution is considered not successful. Stopping PDCCH Search and going to Response Error\n"); - response_error(); + task_queue.push([this]() { + Warning("Contention Resolution is considered not successful. Stopping PDCCH Search and going to Response Error\n"); + response_error(); + }); } + } // namespace srsue diff --git a/srsue/test/mac_test.cc b/srsue/test/mac_test.cc index 4137ab5c1..30823a5a1 100644 --- a/srsue/test/mac_test.cc +++ b/srsue/test/mac_test.cc @@ -2097,7 +2097,7 @@ int run_mac_ra_test(struct ra_test test, mac* mac, phy_dummy* phy, uint32_t* tti // Step to contention resolution. Make sure timer does not start until Msg3 is transmitted // and restarts on every retx - for (int k = 0; k < test.rach_cfg.ra_supervision_info.mac_contention_resolution_timer.to_number() - 1; k++) { + for (int k = 0; k < test.rach_cfg.ra_supervision_info.mac_contention_resolution_timer.to_number() - 2; k++) { stack->run_tti(tti); TESTASSERT(mac->get_dl_sched_rnti(tti) == (test.crnti ? test.crnti : test.temp_rnti)); tti++; @@ -2115,6 +2115,7 @@ int run_mac_ra_test(struct ra_test test, mac* mac, phy_dummy* phy, uint32_t* tti } if (test.nof_msg3_retx == test.rach_cfg.max_harq_msg3_tx) { + stack->run_tti(tti); // RNTI will be reset for next TTI TESTASSERT(mac->get_dl_sched_rnti(tti) != temp_rnti); break; } @@ -2164,6 +2165,7 @@ int run_mac_ra_test(struct ra_test test, mac* mac, phy_dummy* phy, uint32_t* tti // RA procedure should be completed here if (test.check_ra_successful) { + stack->run_tti(tti); stack->run_tti(tti); TESTASSERT(phy->get_crnti() == (test.crnti ? test.crnti : test.temp_rnti)); TESTASSERT(mac->get_dl_sched_rnti(tti) == (test.crnti ? test.crnti : test.temp_rnti)); @@ -2218,6 +2220,9 @@ int mac_random_access_test() set_mac_cfg_t_rach_cfg_common(&mac_cfg, rach_cfg); mac.set_config(mac_cfg); + uint32 tti = 0; + stack.run_tti(tti++); // make sure MAC/PRACH config is applied + // generate config for LCIDs in different LCGs than CCCH std::vector lcids; logical_channel_config_t config = {}; @@ -2239,8 +2244,6 @@ int mac_random_access_test() rlc.write_sdu(0, 6); // UL-CCCH with Msg3 rlc.write_sdu(3, 100); // DRB data on other LCG - uint32 tti = 0; - // Structure that defines the test to be executed struct ra_test my_test = {}; uint32_t test_id = 1; @@ -2339,6 +2342,7 @@ int mac_random_access_test() my_test.check_ra_successful = false; my_test.send_valid_ul_grant = false; TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack)); + stack.run_tti(tti++); // need to wait until complete RA result is signalled TESTASSERT(!rrc.ho_finish_successful); TESTASSERT(rrc.rach_problem == 2); @@ -2358,6 +2362,7 @@ int mac_random_access_test() my_test.msg4_enable = true; my_test.send_valid_ul_grant = true; TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack)); + stack.run_tti(tti++); // need to wait until complete RA result is signalled TESTASSERT(rrc.ho_finish_successful); // Test 9: Test non-Contention based HO. Used in HO but preamble is given by the network. In addition to checking From c336c3eed2ade238ac572a310a1624381348040c Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 18 Jan 2021 16:35:03 +0000 Subject: [PATCH 079/138] added to_number() conversion of rrc_nr poll_byte --- lib/include/srslte/asn1/rrc_nr.h | 2 ++ lib/src/asn1/rrc_nr.cc | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/lib/include/srslte/asn1/rrc_nr.h b/lib/include/srslte/asn1/rrc_nr.h index b71ea9f06..393395355 100644 --- a/lib/include/srslte/asn1/rrc_nr.h +++ b/lib/include/srslte/asn1/rrc_nr.h @@ -20011,8 +20011,10 @@ struct poll_byte_opts { spare1, nulltype } value; + typedef int32_t number_type; std::string to_string() const; + int32_t to_number() const; }; typedef enumerated poll_byte_e; diff --git a/lib/src/asn1/rrc_nr.cc b/lib/src/asn1/rrc_nr.cc index 2499cdf64..95b9d3660 100644 --- a/lib/src/asn1/rrc_nr.cc +++ b/lib/src/asn1/rrc_nr.cc @@ -43495,6 +43495,14 @@ std::string poll_byte_opts::to_string() const "spare4", "spare3", "spare2", "spare1"}; return convert_enum_idx(options, 64, value, "poll_byte_e"); } +int32_t poll_byte_opts::to_number() const +{ + static const int32_t options[] = {1, 2, 5, 8, 10, 15, 25, 50, 75, 100, 125, + 250, 375, 500, 750, 1000, 1250, 1500, 2000, 3000, 4000, 4500, + 5000, 5500, 6000, 6500, 7000, 7500, 8000, 9000, 10000, 11000, 12000, + 13000, 14000, 15000, 16000, 17000, 18000, 20000, 25000, 30000, 40000, -1}; + return map_enum_number(options, 44, value, "poll_byte_e"); +} // PollPDU ::= ENUMERATED std::string poll_pdu_opts::to_string() const From 44e411be2b682466d1c8f5c6184018bb858aca0e Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 20 Jan 2021 17:46:16 +0100 Subject: [PATCH 080/138] Track UL buffers per TTI instead of per PID and remove old ones periodically --- srsenb/hdr/stack/mac/ue.h | 4 +-- srsenb/src/stack/mac/mac.cc | 4 +++ srsenb/src/stack/mac/ue.cc | 67 +++++++++++++++++++++---------------- 3 files changed, 45 insertions(+), 30 deletions(-) diff --git a/srsenb/hdr/stack/mac/ue.h b/srsenb/hdr/stack/mac/ue.h index 6eae19f1f..120418d75 100644 --- a/srsenb/hdr/stack/mac/ue.h +++ b/srsenb/hdr/stack/mac/ue.h @@ -76,6 +76,7 @@ public: void process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channel_t channel) override; void push_pdu(uint32_t tti, uint32_t ue_cc_idx, uint32_t len); void deallocate_pdu(uint32_t tti, uint32_t ue_cc_idx); + void clear_old_buffers(uint32_t tti); void metrics_read(mac_ue_metrics_t* metrics_); void metrics_rx(bool crc, uint32_t tbs); @@ -123,8 +124,7 @@ private: std::vector, SRSLTE_FDD_NOF_HARQ> > tx_payload_buffer; - // Save 2 buffers per HARQ process - std::vector > rx_used_buffers; + std::vector > rx_used_buffers; srslte::block_queue pending_ta_commands; ta ta_fsm; diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 953e3c116..c136a81aa 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -940,6 +940,10 @@ int mac::get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res_list) } phy_ul_sched_res->nof_phich = sched_result.nof_phich_elems; } + // clear old buffers from all users + for (auto& u : ue_db) { + u.second->clear_old_buffers(tti_tx_ul); + } return SRSLTE_SUCCESS; } diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index 092a08c4a..c7fa6aa7a 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -77,6 +77,12 @@ ue::~ue() srslte_softbuffer_tx_free(&buffer); } } + for (auto& rx_buffers_cc : rx_used_buffers) { + for (auto& q : rx_buffers_cc) { + pdus.deallocate(q.second); + } + rx_buffers_cc.clear(); + } } void ue::reset() @@ -95,15 +101,6 @@ void ue::reset() srslte_softbuffer_tx_reset(&buffer); } } - - for (auto& rx_buffers_cc : rx_used_buffers) { - for (auto& ptr : rx_buffers_cc) { - if (ptr) { - pdus.deallocate(ptr); - ptr = nullptr; - } - } - } } /** @@ -175,25 +172,39 @@ uint8_t* ue::request_buffer(uint32_t tti, uint32_t cc_idx, const uint32_t len) { uint8_t* pdu = nullptr; if (len > 0) { - pdu = pdus.request(len); - if (pdu) { - // Deallocate oldest buffer if we didn't deallocate it - if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { - pdus.deallocate(rx_used_buffers.at(cc_idx)[tti]); - rx_used_buffers.at(cc_idx)[tti] = nullptr; - log_h->warning("buffers: RX PDU of rnti=0x%x and pid=%d wasn't deallocated\n", rnti, tti % nof_rx_harq_proc); + // Deallocate oldest buffer if we didn't deallocate it + if (!rx_used_buffers.at(cc_idx).count(tti)) { + pdu = pdus.request(len); + if (pdu) { + rx_used_buffers.at(cc_idx).emplace(tti, pdu); + } else { + Error("UE buffers: Requesting buffer from pool\n"); } - rx_used_buffers.at(cc_idx)[tti] = pdu; - log_h->info("RX PDU saved for pid=%d\n", tti % nof_rx_harq_proc); } else { - log_h->error("buffers: Requesting buffer from pool\n"); + Error("UE buffers: buffer for tti=%d already allocated\n", tti); } } else { - printf("buffers: Requesting buffer for zero bytes\n"); + Error("UE buffers: Requesting buffer for zero bytes\n"); } return pdu; } +void ue::clear_old_buffers(uint32_t tti) +{ + // remove old buffers + for (auto& rx_buffer_cc : rx_used_buffers) { + for (auto it = rx_buffer_cc.begin(); it != rx_buffer_cc.end();) { + if (srslte_tti_interval(tti, it->first) > 20) { + Warning("UE buffers: Removing old buffer tti=%d, rnti=%d, now is %d\n", it->first, rnti, tti); + pdus.deallocate(it->second); + it = rx_buffer_cc.erase(it); + } else { + ++it; + } + } + } +} + bool ue::process_pdus() { return pdus.process_pdus(); @@ -318,11 +329,11 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe void ue::deallocate_pdu(uint32_t tti, uint32_t cc_idx) { - if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { - pdus.deallocate(rx_used_buffers.at(cc_idx)[tti]); - rx_used_buffers.at(cc_idx)[tti] = nullptr; + if (rx_used_buffers.at(cc_idx).count(tti)) { + pdus.deallocate(rx_used_buffers.at(cc_idx).at(tti)); + rx_used_buffers.at(cc_idx).erase(tti); } else { - Warning("buffers: Null RX PDU pointer in deallocate_pdu for rnti=0x%x pid=%d cc_idx=%d\n", + Warning("UE buffers: Null RX PDU pointer in deallocate_pdu for rnti=0x%x pid=%d cc_idx=%d\n", rnti, tti % nof_rx_harq_proc, cc_idx); @@ -331,15 +342,15 @@ void ue::deallocate_pdu(uint32_t tti, uint32_t cc_idx) void ue::push_pdu(uint32_t tti, uint32_t cc_idx, uint32_t len) { - if (rx_used_buffers.at(cc_idx)[tti] != nullptr) { + if (rx_used_buffers.at(cc_idx).count(tti)) { if (len > 0) { - pdus.push(rx_used_buffers.at(cc_idx)[tti], len); + pdus.push(rx_used_buffers.at(cc_idx).at(tti), len); } else { Error("Error pushing PDU: null length\n"); } - rx_used_buffers.at(cc_idx)[tti] = nullptr; + rx_used_buffers.at(cc_idx).erase(tti); } else { - Warning("buffers: Null RX PDU pointer in push_pdu for rnti=0x%x pid=%d cc_idx=%d\n", + Warning("UE buffers: Null RX PDU pointer in push_pdu for rnti=0x%x pid=%d cc_idx=%d\n", rnti, tti % nof_rx_harq_proc, cc_idx); From 8c85ddea0f67087e1bc282894f85280c6b3d0d27 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 20 Jan 2021 18:10:49 +0100 Subject: [PATCH 081/138] Fix ue_cc_idx naming convention --- srsenb/src/stack/mac/ue.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index c7fa6aa7a..477d1543b 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -168,15 +168,15 @@ ue::get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, con return &softbuffer_tx.at(ue_cc_idx).at((harq_process * SRSLTE_MAX_TB + tb_idx) % nof_tx_harq_proc); } -uint8_t* ue::request_buffer(uint32_t tti, uint32_t cc_idx, const uint32_t len) +uint8_t* ue::request_buffer(uint32_t tti, uint32_t ue_cc_idx, const uint32_t len) { uint8_t* pdu = nullptr; if (len > 0) { // Deallocate oldest buffer if we didn't deallocate it - if (!rx_used_buffers.at(cc_idx).count(tti)) { + if (!rx_used_buffers.at(ue_cc_idx).count(tti)) { pdu = pdus.request(len); if (pdu) { - rx_used_buffers.at(cc_idx).emplace(tti, pdu); + rx_used_buffers.at(ue_cc_idx).emplace(tti, pdu); } else { Error("UE buffers: Requesting buffer from pool\n"); } @@ -327,33 +327,33 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe Debug("MAC PDU processed\n"); } -void ue::deallocate_pdu(uint32_t tti, uint32_t cc_idx) +void ue::deallocate_pdu(uint32_t tti, uint32_t ue_cc_idx) { - if (rx_used_buffers.at(cc_idx).count(tti)) { - pdus.deallocate(rx_used_buffers.at(cc_idx).at(tti)); - rx_used_buffers.at(cc_idx).erase(tti); + if (rx_used_buffers.at(ue_cc_idx).count(tti)) { + pdus.deallocate(rx_used_buffers.at(ue_cc_idx).at(tti)); + rx_used_buffers.at(ue_cc_idx).erase(tti); } else { Warning("UE buffers: Null RX PDU pointer in deallocate_pdu for rnti=0x%x pid=%d cc_idx=%d\n", rnti, tti % nof_rx_harq_proc, - cc_idx); + ue_cc_idx); } } -void ue::push_pdu(uint32_t tti, uint32_t cc_idx, uint32_t len) +void ue::push_pdu(uint32_t tti, uint32_t ue_cc_idx, uint32_t len) { - if (rx_used_buffers.at(cc_idx).count(tti)) { + if (rx_used_buffers.at(ue_cc_idx).count(tti)) { if (len > 0) { - pdus.push(rx_used_buffers.at(cc_idx).at(tti), len); + pdus.push(rx_used_buffers.at(ue_cc_idx).at(tti), len); } else { Error("Error pushing PDU: null length\n"); } - rx_used_buffers.at(cc_idx).erase(tti); + rx_used_buffers.at(ue_cc_idx).erase(tti); } else { Warning("UE buffers: Null RX PDU pointer in push_pdu for rnti=0x%x pid=%d cc_idx=%d\n", rnti, tti % nof_rx_harq_proc, - cc_idx); + ue_cc_idx); } } From 9ab7373251b0aae002cfa0ded647b43f096ea542 Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 20 Jan 2021 15:28:07 +0000 Subject: [PATCH 082/138] Encode correctly DCI format2A when one of the TBs is empty --- srsenb/src/stack/mac/sched_ue.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 23e86bd59..f32e026c9 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -452,7 +452,18 @@ tbs_info sched_ue::allocate_new_dl_mac_pdu(sched::dl_sched_data_t* data, h->new_tx( user_mask, tb, tti_tx_dl, tb_info.mcs, tb_info.tbs_bytes, data->dci.location.ncce, get_ue_cfg().maxharq_tx); } else { - Warning("SCHED: Failed to allocate DL harq pid=%d\n", h->get_id()); + uint32_t pending_bytes = lch_handler.get_dl_tx_total(); + if (pending_bytes > 0) { + Warning("SCHED: Failed to allocate DL TB with tb_idx=%d, tbs=%d, pid=%d. Pending DL buffer data=%d\n", + tb, + rem_tbs, + h->get_id(), + lch_handler.get_dl_tx_total()); + } else { + Info("SCHED: DL TB tb_idx=%d, tbs=%d, pid=%d did not get allocated.\n", tb, rem_tbs, h->get_id()); + } + tb_info.tbs_bytes = 0; + tb_info.mcs = 0; } return tb_info; From e27ded9e55f95e98f35bebfcaa132de4ef5d057f Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 20 Jan 2021 16:26:48 +0000 Subject: [PATCH 083/138] add comment explaining the need to warn in case of failed allocate a TB in the scheduler when there are still pending bytes --- srsenb/src/stack/mac/sched_ue.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index f32e026c9..9397eb665 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -452,13 +452,15 @@ tbs_info sched_ue::allocate_new_dl_mac_pdu(sched::dl_sched_data_t* data, h->new_tx( user_mask, tb, tti_tx_dl, tb_info.mcs, tb_info.tbs_bytes, data->dci.location.ncce, get_ue_cfg().maxharq_tx); } else { + // Note: At this point, the allocation of bytes to a TB should not fail, unless the RLC buffers have been + // emptied by another allocated tb_idx. uint32_t pending_bytes = lch_handler.get_dl_tx_total(); if (pending_bytes > 0) { Warning("SCHED: Failed to allocate DL TB with tb_idx=%d, tbs=%d, pid=%d. Pending DL buffer data=%d\n", tb, rem_tbs, h->get_id(), - lch_handler.get_dl_tx_total()); + pending_bytes); } else { Info("SCHED: DL TB tb_idx=%d, tbs=%d, pid=%d did not get allocated.\n", tb, rem_tbs, h->get_id()); } From 049ad77fcaf31dbfe00ca5ad817518324fda69d9 Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 19 Jan 2021 11:36:01 +0000 Subject: [PATCH 084/138] simplify asn1 choice types with one single type with a packer --- lib/include/srslte/asn1/rrc.h | 117 +- lib/include/srslte/asn1/rrc/bcch_msg.h | 1002 +- lib/include/srslte/asn1/rrc/common_ext.h | 9 + lib/include/srslte/asn1/rrc/dl_ccch_msg.h | 116 +- lib/include/srslte/asn1/rrc/dl_dcch_msg.h | 766 +- lib/include/srslte/asn1/rrc/ho_cmd.h | 172 +- lib/include/srslte/asn1/rrc/meascfg.h | 68 +- lib/include/srslte/asn1/rrc/paging.h | 62 +- lib/include/srslte/asn1/rrc/phy_ded.h | 102 + lib/include/srslte/asn1/rrc/rr_common.h | 84 +- lib/include/srslte/asn1/rrc/rr_ded.h | 369 +- lib/include/srslte/asn1/rrc/security.h | 51 +- lib/include/srslte/asn1/rrc/si.h | 39 +- lib/include/srslte/asn1/rrc/uecap.h | 1265 +- lib/include/srslte/asn1/rrc/ul_ccch_msg.h | 51 +- lib/include/srslte/asn1/rrc/ul_dcch_msg.h | 466 +- lib/include/srslte/asn1/rrc_nbiot.h | 886 +- lib/include/srslte/asn1/rrc_nr.h | 774 +- lib/include/srslte/asn1/s1ap.h | 21 +- lib/src/asn1/rrc.cc | 459 +- lib/src/asn1/rrc/bcch_msg.cc | 17253 ++++++++++---------- lib/src/asn1/rrc/dl_ccch_msg.cc | 382 +- lib/src/asn1/rrc/dl_dcch_msg.cc | 2439 +-- lib/src/asn1/rrc/ho_cmd.cc | 519 +- lib/src/asn1/rrc/meascfg.cc | 123 +- lib/src/asn1/rrc/paging.cc | 191 +- lib/src/asn1/rrc/rr_common.cc | 130 +- lib/src/asn1/rrc/rr_ded.cc | 506 +- lib/src/asn1/rrc/security.cc | 192 +- lib/src/asn1/rrc/si.cc | 64 +- lib/src/asn1/rrc/uecap.cc | 3748 ++--- lib/src/asn1/rrc/ul_ccch_msg.cc | 194 +- lib/src/asn1/rrc/ul_dcch_msg.cc | 1700 +- lib/src/asn1/rrc_nbiot.cc | 6301 +++---- lib/src/asn1/rrc_nr.cc | 2824 +--- lib/src/asn1/s1ap.cc | 43 +- 36 files changed, 17664 insertions(+), 25824 deletions(-) diff --git a/lib/include/srslte/asn1/rrc.h b/lib/include/srslte/asn1/rrc.h index b523157c9..d31155ea6 100644 --- a/lib/include/srslte/asn1/rrc.h +++ b/lib/include/srslte/asn1/rrc.h @@ -142,9 +142,6 @@ struct bcch_dl_sch_msg_type_mbms_r14_c { // choice methods bcch_dl_sch_msg_type_mbms_r14_c() = default; - bcch_dl_sch_msg_type_mbms_r14_c(const bcch_dl_sch_msg_type_mbms_r14_c& other); - bcch_dl_sch_msg_type_mbms_r14_c& operator=(const bcch_dl_sch_msg_type_mbms_r14_c& other); - ~bcch_dl_sch_msg_type_mbms_r14_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -154,24 +151,23 @@ struct bcch_dl_sch_msg_type_mbms_r14_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType-MBMS-r14"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType-MBMS-r14"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // BCCH-DL-SCH-Message-MBMS ::= SEQUENCE @@ -184,6 +180,9 @@ struct bcch_dl_sch_msg_mbms_s { void to_json(json_writer& j) const; }; +// ThresholdEUTRA-v1250 ::= INTEGER (0..97) +typedef uint8_t thres_eutra_v1250; + // MBMS-SessionInfo-r9 ::= SEQUENCE struct mbms_session_info_r9_s { bool ext = false; @@ -498,9 +497,6 @@ struct mcch_msg_type_c { // choice methods later_c_() = default; - later_c_(const later_c_& other); - later_c_& operator=(const later_c_& other); - ~later_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -510,24 +506,23 @@ struct mcch_msg_type_c { c2_c_& c2() { assert_choice_type("c2", type_.to_string(), "later"); - return c.get(); + return c; } const c2_c_& c2() const { assert_choice_type("c2", type_.to_string(), "later"); - return c.get(); + return c; } c2_c_& set_c2() { set(types::c2); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c2_c_ c; }; struct types_opts { enum options { c1, later, nulltype } value; @@ -1609,6 +1604,7 @@ struct sc_mcch_msg_type_r13_c { set(types::scptm_cfg_br_r14); return c; } + void set_spare() { set(types::spare); } private: types type_; @@ -1625,9 +1621,6 @@ struct sc_mcch_msg_type_r13_c { // choice methods msg_class_ext_c_() = default; - msg_class_ext_c_(const msg_class_ext_c_& other); - msg_class_ext_c_& operator=(const msg_class_ext_c_& other); - ~msg_class_ext_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -1637,24 +1630,23 @@ struct sc_mcch_msg_type_r13_c { c2_c_& c2() { assert_choice_type("c2", type_.to_string(), "messageClassExtension"); - return c.get(); + return c; } const c2_c_& c2() const { assert_choice_type("c2", type_.to_string(), "messageClassExtension"); - return c.get(); + return c; } c2_c_& set_c2() { set(types::c2); - return c.get(); + return c; } + void set_msg_class_ext_future_r14() { set(types::msg_class_ext_future_r14); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c2_c_ c; }; struct types_opts { enum options { c1, msg_class_ext, nulltype } value; @@ -1735,18 +1727,6 @@ struct fail_report_scg_v12d0_s { void to_json(json_writer& j) const; }; -// SCGFailureInformation-v12d0b-IEs ::= SEQUENCE -struct scg_fail_info_v12d0b_ies_s { - bool fail_report_scg_v12d0_present = false; - bool non_crit_ext_present = false; - fail_report_scg_v12d0_s fail_report_scg_v12d0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // MIMO-WeightedLayersCapabilities-r13 ::= SEQUENCE struct mimo_weighted_layers_cap_r13_s { struct rel_weight_two_layers_r13_opts { @@ -1843,10 +1823,11 @@ struct phy_layer_params_v13e0_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v13e0b-IEs ::= SEQUENCE -struct ue_eutra_cap_v13e0b_ies_s { - bool non_crit_ext_present = false; - phy_layer_params_v13e0_s phy_layer_params_v13e0; +// SCGFailureInformation-v12d0b-IEs ::= SEQUENCE +struct scg_fail_info_v12d0b_ies_s { + bool fail_report_scg_v12d0_present = false; + bool non_crit_ext_present = false; + fail_report_scg_v12d0_s fail_report_scg_v12d0; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -1854,11 +1835,10 @@ struct ue_eutra_cap_v13e0b_ies_s { void to_json(json_writer& j) const; }; -// SCG-Config-v12i0b-IEs ::= SEQUENCE -struct scg_cfg_v12i0b_ies_s { - bool scg_radio_cfg_v12i0_present = false; - bool non_crit_ext_present = false; - scg_cfg_part_scg_v12f0_s scg_radio_cfg_v12i0; +// UE-EUTRA-Capability-v13e0b-IEs ::= SEQUENCE +struct ue_eutra_cap_v13e0b_ies_s { + bool non_crit_ext_present = false; + phy_layer_params_v13e0_s phy_layer_params_v13e0; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -2233,6 +2213,18 @@ struct sbcch_sl_bch_msg_v2x_r14_s { void to_json(json_writer& j) const; }; +// SCG-Config-v12i0b-IEs ::= SEQUENCE +struct scg_cfg_v12i0b_ies_s { + bool scg_radio_cfg_v12i0_present = false; + bool non_crit_ext_present = false; + scg_cfg_part_scg_v12f0_s scg_radio_cfg_v12i0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // SCG-ConfigInfo-v1530-IEs ::= SEQUENCE struct scg_cfg_info_v1530_ies_s { bool drb_to_add_mod_list_scg_r15_present = false; @@ -2379,6 +2371,13 @@ struct scg_cfg_info_r12_s { set(types::scg_cfg_info_r12); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -2388,9 +2387,6 @@ struct scg_cfg_info_r12_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -2400,24 +2396,23 @@ struct scg_cfg_info_r12_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables diff --git a/lib/include/srslte/asn1/rrc/bcch_msg.h b/lib/include/srslte/asn1/rrc/bcch_msg.h index 3729a522b..91b28d785 100644 --- a/lib/include/srslte/asn1/rrc/bcch_msg.h +++ b/lib/include/srslte/asn1/rrc/bcch_msg.h @@ -42,97 +42,6 @@ struct bcch_bch_msg_s { void to_json(json_writer& j) const; }; -// SIB-Type-v12j0 ::= ENUMERATED -struct sib_type_v12j0_opts { - enum options { - sib_type19_v1250, - sib_type20_v1310, - sib_type21_v1430, - sib_type24_v1530, - sib_type25_v1530, - sib_type26_v1530, - spare10, - spare9, - spare8, - spare7, - spare6, - spare5, - spare4, - spare3, - spare2, - spare1, - // ... - nulltype - } value; - typedef uint8_t number_type; - - std::string to_string() const; - uint8_t to_number() const; -}; -typedef enumerated sib_type_v12j0_e; - -// NS-PmaxValue-v10l0 ::= SEQUENCE -struct ns_pmax_value_v10l0_s { - bool add_spec_emission_v10l0_present = false; - uint16_t add_spec_emission_v10l0 = 33; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SIB-MappingInfo-v12j0 ::= SEQUENCE (SIZE (1..31)) OF SIB-Type-v12j0 -using sib_map_info_v12j0_l = bounded_array; - -// InterFreqCarrierFreqInfo-v1360 ::= SEQUENCE -struct inter_freq_carrier_freq_info_v1360_s { - bool cell_sel_info_ce1_v1360_present = false; - cell_sel_info_ce1_v1360_s cell_sel_info_ce1_v1360; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// NS-PmaxList-v10l0 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxValue-v10l0 -using ns_pmax_list_v10l0_l = dyn_array; - -// NS-PmaxValue-r10 ::= SEQUENCE -struct ns_pmax_value_r10_s { - bool add_pmax_r10_present = false; - int8_t add_pmax_r10 = -30; - uint8_t add_spec_emission = 1; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SchedulingInfo-v12j0 ::= SEQUENCE -struct sched_info_v12j0_s { - bool sib_map_info_v12j0_present = false; - sib_map_info_v12j0_l sib_map_info_v12j0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SchedulingInfoExt-r12 ::= SEQUENCE -struct sched_info_ext_r12_s { - si_periodicity_r12_e si_periodicity_r12; - sib_map_info_v12j0_l sib_map_info_r12; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // BandClassInfoCDMA2000 ::= SEQUENCE struct band_class_info_cdma2000_s { bool ext = false; @@ -149,15 +58,6 @@ struct band_class_info_cdma2000_s { void to_json(json_writer& j) const; }; -// InterFreqCarrierFreqList-v13a0 ::= SEQUENCE (SIZE (1..8)) OF InterFreqCarrierFreqInfo-v1360 -using inter_freq_carrier_freq_list_v13a0_l = dyn_array; - -// MultiBandInfoList-v10l0 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxList-v10l0 -using multi_band_info_list_v10l0_l = dyn_array; - -// NS-PmaxList-r10 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxValue-r10 -using ns_pmax_list_r10_l = dyn_array; - // NeighCellsPerBandclassCDMA2000-r11 ::= SEQUENCE struct neigh_cells_per_bandclass_cdma2000_r11_s { using pci_list_r11_l_ = dyn_array; @@ -178,44 +78,14 @@ using pci_list_cdma2000_l = bounded_array; // PhysCellIdListCDMA2000-v920 ::= SEQUENCE (SIZE (0..24)) OF INTEGER (0..511) using pci_list_cdma2000_v920_l = bounded_array; -// SchedulingInfoList-v12j0 ::= SEQUENCE (SIZE (1..32)) OF SchedulingInfo-v12j0 -using sched_info_list_v12j0_l = dyn_array; - -// SchedulingInfoListExt-r12 ::= SEQUENCE (SIZE (1..32)) OF SchedulingInfoExt-r12 -using sched_info_list_ext_r12_l = dyn_array; - -// SystemInformationBlockType2-v13c0-IEs ::= SEQUENCE -struct sib_type2_v13c0_ies_s { - bool ul_pwr_ctrl_common_v13c0_present = false; - bool non_crit_ext_present = false; - ul_pwr_ctrl_common_v1310_s ul_pwr_ctrl_common_v13c0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // BandClassListCDMA2000 ::= SEQUENCE (SIZE (1..32)) OF BandClassInfoCDMA2000 using band_class_list_cdma2000_l = dyn_array; -// InterFreqCarrierFreqInfo-v10l0 ::= SEQUENCE -struct inter_freq_carrier_freq_info_v10l0_s { - bool freq_band_info_v10l0_present = false; - bool multi_band_info_list_v10l0_present = false; - ns_pmax_list_v10l0_l freq_band_info_v10l0; - multi_band_info_list_v10l0_l multi_band_info_list_v10l0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// MultiBandInfo-v9e0 ::= SEQUENCE -struct multi_band_info_v9e0_s { - bool freq_band_ind_v9e0_present = false; - uint16_t freq_band_ind_v9e0 = 65; +// NS-PmaxValue-r10 ::= SEQUENCE +struct ns_pmax_value_r10_s { + bool add_pmax_r10_present = false; + int8_t add_pmax_r10 = -30; + uint8_t add_spec_emission = 1; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -223,9 +93,6 @@ struct multi_band_info_v9e0_s { void to_json(json_writer& j) const; }; -// MultiBandInfoList-v10j0 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxList-r10 -using multi_band_info_list_v10j0_l = dyn_array; - // NS-PmaxValueNR-r15 ::= SEQUENCE struct ns_pmax_value_nr_r15_s { bool add_pmax_nr_r15_present = false; @@ -284,47 +151,6 @@ struct redist_neigh_cell_r13_s { void to_json(json_writer& j) const; }; -// SystemInformationBlockType1-v12j0-IEs ::= SEQUENCE -struct sib_type1_v12j0_ies_s { - bool sched_info_list_v12j0_present = false; - bool sched_info_list_ext_r12_present = false; - bool non_crit_ext_present = false; - sched_info_list_v12j0_l sched_info_list_v12j0; - sched_info_list_ext_r12_l sched_info_list_ext_r12; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType2-v10n0-IEs ::= SEQUENCE -struct sib_type2_v10n0_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - sib_type2_v13c0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType5-v13a0-IEs ::= SEQUENCE -struct sib_type5_v13a0_ies_s { - bool late_non_crit_ext_present = false; - bool inter_freq_carrier_freq_list_v13a0_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - inter_freq_carrier_freq_list_v13a0_l inter_freq_carrier_freq_list_v13a0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // AC-BarringConfig1XRTT-r9 ::= SEQUENCE struct ac_barr_cfg1_xrtt_r9_s { uint8_t ac_barr0to9_r9 = 0; @@ -391,19 +217,6 @@ struct cell_resel_params_cdma2000_r11_s { void to_json(json_writer& j) const; }; -// InterFreqCarrierFreqInfo-v10j0 ::= SEQUENCE -struct inter_freq_carrier_freq_info_v10j0_s { - bool freq_band_info_r10_present = false; - bool multi_band_info_list_v10j0_present = false; - ns_pmax_list_r10_l freq_band_info_r10; - multi_band_info_list_v10j0_l multi_band_info_list_v10j0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // InterFreqNeighCellInfo ::= SEQUENCE struct inter_freq_neigh_cell_info_s { uint16_t pci = 0; @@ -415,8 +228,8 @@ struct inter_freq_neigh_cell_info_s { void to_json(json_writer& j) const; }; -// MultiBandInfoList-v9e0 ::= SEQUENCE (SIZE (1..8)) OF MultiBandInfo-v9e0 -using multi_band_info_list_v9e0_l = dyn_array; +// NS-PmaxList-r10 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxValue-r10 +using ns_pmax_list_r10_l = dyn_array; // NS-PmaxListNR-r15 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxValueNR-r15 using ns_pmax_list_nr_r15_l = dyn_array; @@ -491,56 +304,6 @@ using redist_neigh_cell_list_r13_l = dyn_array; // SL-SyncConfigListNFreq-r13 ::= SEQUENCE (SIZE (1..16)) OF SL-SyncConfigNFreq-r13 using sl_sync_cfg_list_nfreq_r13_l = dyn_array; -// SystemInformationBlockType1-v10x0-IEs ::= SEQUENCE -struct sib_type1_v10x0_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - sib_type1_v12j0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType2-v10m0-IEs ::= SEQUENCE -struct sib_type2_v10m0_ies_s { - struct freq_info_v10l0_s_ { - uint16_t add_spec_emission_v10l0 = 33; - }; - using multi_band_info_list_v10l0_l_ = bounded_array; - - // member variables - bool freq_info_v10l0_present = false; - bool multi_band_info_list_v10l0_present = false; - bool non_crit_ext_present = false; - freq_info_v10l0_s_ freq_info_v10l0; - multi_band_info_list_v10l0_l_ multi_band_info_list_v10l0; - sib_type2_v10n0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType5-v10l0-IEs ::= SEQUENCE -struct sib_type5_v10l0_ies_s { - using inter_freq_carrier_freq_list_v10l0_l_ = dyn_array; - - // member variables - bool inter_freq_carrier_freq_list_v10l0_present = false; - bool non_crit_ext_present = false; - inter_freq_carrier_freq_list_v10l0_l_ inter_freq_carrier_freq_list_v10l0; - sib_type5_v13a0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SystemTimeInfoCDMA2000 ::= SEQUENCE struct sys_time_info_cdma2000_s { struct cdma_sys_time_c_ { @@ -624,19 +387,6 @@ struct uac_barr_per_cat_r15_s { // InterFreqBlackCellList ::= SEQUENCE (SIZE (1..16)) OF PhysCellIdRange using inter_freq_black_cell_list_l = dyn_array; -// InterFreqCarrierFreqInfo-v9e0 ::= SEQUENCE -struct inter_freq_carrier_freq_info_v9e0_s { - bool dl_carrier_freq_v9e0_present = false; - bool multi_band_info_list_v9e0_present = false; - uint32_t dl_carrier_freq_v9e0 = 65536; - multi_band_info_list_v9e0_l multi_band_info_list_v9e0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // InterFreqNeighCellList ::= SEQUENCE (SIZE (1..16)) OF InterFreqNeighCellInfo using inter_freq_neigh_cell_list_l = dyn_array; @@ -646,8 +396,8 @@ using inter_freq_neigh_hsdn_cell_list_r15_l = dyn_array; // MBMS-SAI-List-r11 ::= SEQUENCE (SIZE (1..64)) OF INTEGER (0..65535) using mbms_sai_list_r11_l = dyn_array; -// MultiBandInfoList ::= SEQUENCE (SIZE (1..8)) OF INTEGER (1..64) -using multi_band_info_list_l = bounded_array; +// MultiBandInfoList-v10j0 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxList-r10 +using multi_band_info_list_v10j0_l = dyn_array; // MultiBandNsPmaxListNR-1-v1550 ::= SEQUENCE (SIZE (1..31)) OF NS-PmaxListNR-r15 using multi_band_ns_pmax_list_nr_minus1_v1550_l = dyn_array; @@ -712,6 +462,7 @@ struct params_cdma2000_r11_s { set(types::explicit_value); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -784,66 +535,9 @@ struct sl_disc_cfg_other_inter_freq_r13_s { void to_json(json_writer& j) const; }; -// SystemInformationBlockType1-v10l0-IEs ::= SEQUENCE -struct sib_type1_v10l0_ies_s { - bool freq_band_info_v10l0_present = false; - bool multi_band_info_list_v10l0_present = false; - bool non_crit_ext_present = false; - ns_pmax_list_v10l0_l freq_band_info_v10l0; - multi_band_info_list_v10l0_l multi_band_info_list_v10l0; - sib_type1_v10x0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType2-v9i0-IEs ::= SEQUENCE -struct sib_type2_v9i0_ies_s { - bool non_crit_ext_present = false; - bool dummy_present = false; - dyn_octstring non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType5-v10j0-IEs ::= SEQUENCE -struct sib_type5_v10j0_ies_s { - using inter_freq_carrier_freq_list_v10j0_l_ = dyn_array; - - // member variables - bool inter_freq_carrier_freq_list_v10j0_present = false; - bool non_crit_ext_present = false; - inter_freq_carrier_freq_list_v10j0_l_ inter_freq_carrier_freq_list_v10j0; - sib_type5_v10l0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UAC-BarringPerCatList-r15 ::= SEQUENCE (SIZE (1..63)) OF UAC-BarringPerCat-r15 using uac_barr_per_cat_list_r15_l = dyn_array; -// CarrierFreqInfoUTRA-FDD-v8h0 ::= SEQUENCE -struct carrier_freq_info_utra_fdd_v8h0_s { - using multi_band_info_list_l_ = bounded_array; - - // member variables - bool multi_band_info_list_present = false; - multi_band_info_list_l_ multi_band_info_list; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // CarrierFreqNR-r15 ::= SEQUENCE struct carrier_freq_nr_r15_s { struct subcarrier_spacing_ssb_r15_opts { @@ -1135,6 +829,19 @@ struct inter_freq_carrier_freq_info_r12_s { void to_json(json_writer& j) const; }; +// InterFreqCarrierFreqInfo-v10j0 ::= SEQUENCE +struct inter_freq_carrier_freq_info_v10j0_s { + bool freq_band_info_r10_present = false; + bool multi_band_info_list_v10j0_present = false; + ns_pmax_list_r10_l freq_band_info_r10; + multi_band_info_list_v10j0_l multi_band_info_list_v10j0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // InterFreqCarrierFreqInfo-v1250 ::= SEQUENCE struct inter_freq_carrier_freq_info_v1250_s { bool reduced_meas_performance_r12_present = false; @@ -1175,13 +882,10 @@ struct inter_freq_carrier_freq_info_v1350_s { void to_json(json_writer& j) const; }; -// InterFreqCarrierFreqInfo-v1530 ::= SEQUENCE -struct inter_freq_carrier_freq_info_v1530_s { - bool inter_freq_neigh_hsdn_cell_list_r15_present = false; - bool cell_sel_info_ce_v1530_present = false; - bool hsdn_ind_r15 = false; - inter_freq_neigh_hsdn_cell_list_r15_l inter_freq_neigh_hsdn_cell_list_r15; - cell_sel_info_ce_v1530_s cell_sel_info_ce_v1530; +// InterFreqCarrierFreqInfo-v1360 ::= SEQUENCE +struct inter_freq_carrier_freq_info_v1360_s { + bool cell_sel_info_ce1_v1360_present = false; + cell_sel_info_ce1_v1360_s cell_sel_info_ce1_v1360; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -1189,10 +893,13 @@ struct inter_freq_carrier_freq_info_v1530_s { void to_json(json_writer& j) const; }; -// InterFreqCarrierFreqInfo-v8h0 ::= SEQUENCE -struct inter_freq_carrier_freq_info_v8h0_s { - bool multi_band_info_list_present = false; - multi_band_info_list_l multi_band_info_list; +// InterFreqCarrierFreqInfo-v1530 ::= SEQUENCE +struct inter_freq_carrier_freq_info_v1530_s { + bool inter_freq_neigh_hsdn_cell_list_r15_present = false; + bool cell_sel_info_ce_v1530_present = false; + bool hsdn_ind_r15 = false; + inter_freq_neigh_hsdn_cell_list_r15_l inter_freq_neigh_hsdn_cell_list_r15; + cell_sel_info_ce_v1530_s cell_sel_info_ce_v1530; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -1412,6 +1119,7 @@ struct sib8_per_plmn_r11_s { set(types::explicit_value); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -1475,64 +1183,6 @@ struct sl_pppp_tx_cfg_idx_r15_s { void to_json(json_writer& j) const; }; -// SystemInformationBlockType1-v10j0-IEs ::= SEQUENCE -struct sib_type1_v10j0_ies_s { - bool freq_band_info_r10_present = false; - bool multi_band_info_list_v10j0_present = false; - bool non_crit_ext_present = false; - ns_pmax_list_r10_l freq_band_info_r10; - multi_band_info_list_v10j0_l multi_band_info_list_v10j0; - sib_type1_v10l0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType2-v9e0-IEs ::= SEQUENCE -struct sib_type2_v9e0_ies_s { - bool ul_carrier_freq_v9e0_present = false; - bool non_crit_ext_present = false; - uint32_t ul_carrier_freq_v9e0 = 65536; - sib_type2_v9i0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType3-v10l0-IEs ::= SEQUENCE -struct sib_type3_v10l0_ies_s { - bool freq_band_info_v10l0_present = false; - bool multi_band_info_list_v10l0_present = false; - bool non_crit_ext_present = false; - ns_pmax_list_v10l0_l freq_band_info_v10l0; - multi_band_info_list_v10l0_l multi_band_info_list_v10l0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType5-v9e0-IEs ::= SEQUENCE -struct sib_type5_v9e0_ies_s { - using inter_freq_carrier_freq_list_v9e0_l_ = dyn_array; - - // member variables - bool inter_freq_carrier_freq_list_v9e0_present = false; - bool non_crit_ext_present = false; - inter_freq_carrier_freq_list_v9e0_l_ inter_freq_carrier_freq_list_v9e0; - sib_type5_v10j0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UAC-BarringInfoSet-r15 ::= SEQUENCE struct uac_barr_info_set_r15_s { struct uac_barr_factor_r15_opts { @@ -2278,83 +1928,6 @@ struct sl_disc_cfg_remote_ue_r13_s { // SL-SyncConfigList-r12 ::= SEQUENCE (SIZE (1..16)) OF SL-SyncConfig-r12 using sl_sync_cfg_list_r12_l = dyn_array; -// SystemInformationBlockType1-v9e0-IEs ::= SEQUENCE -struct sib_type1_v9e0_ies_s { - bool freq_band_ind_v9e0_present = false; - bool multi_band_info_list_v9e0_present = false; - bool non_crit_ext_present = false; - uint16_t freq_band_ind_v9e0 = 65; - multi_band_info_list_v9e0_l multi_band_info_list_v9e0; - sib_type1_v10j0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType2-v8h0-IEs ::= SEQUENCE -struct sib_type2_v8h0_ies_s { - using multi_band_info_list_l_ = bounded_array; - - // member variables - bool multi_band_info_list_present = false; - bool non_crit_ext_present = false; - multi_band_info_list_l_ multi_band_info_list; - sib_type2_v9e0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType3-v10j0-IEs ::= SEQUENCE -struct sib_type3_v10j0_ies_s { - bool freq_band_info_r10_present = false; - bool multi_band_info_list_v10j0_present = false; - bool non_crit_ext_present = false; - ns_pmax_list_r10_l freq_band_info_r10; - multi_band_info_list_v10j0_l multi_band_info_list_v10j0; - sib_type3_v10l0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType5-v8h0-IEs ::= SEQUENCE -struct sib_type5_v8h0_ies_s { - using inter_freq_carrier_freq_list_v8h0_l_ = dyn_array; - - // member variables - bool inter_freq_carrier_freq_list_v8h0_present = false; - bool non_crit_ext_present = false; - inter_freq_carrier_freq_list_v8h0_l_ inter_freq_carrier_freq_list_v8h0; - sib_type5_v9e0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// SystemInformationBlockType6-v8h0-IEs ::= SEQUENCE -struct sib_type6_v8h0_ies_s { - using carrier_freq_list_utra_fdd_v8h0_l_ = dyn_array; - - // member variables - bool carrier_freq_list_utra_fdd_v8h0_present = false; - bool non_crit_ext_present = false; - carrier_freq_list_utra_fdd_v8h0_l_ carrier_freq_list_utra_fdd_v8h0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UAC-AC1-SelectAssistInfo-r15 ::= ENUMERATED struct uac_ac1_select_assist_info_r15_opts { enum options { a, b, c, nulltype } value; @@ -2395,19 +1968,6 @@ struct sib_pos_r15_s { void to_json(json_writer& j) const; }; -// SystemInformationBlockType1-v8h0-IEs ::= SEQUENCE -struct sib_type1_v8h0_ies_s { - bool multi_band_info_list_present = false; - bool non_crit_ext_present = false; - multi_band_info_list_l multi_band_info_list; - sib_type1_v9e0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SystemInformationBlockType10 ::= SEQUENCE struct sib_type10_s { bool ext = false; @@ -4311,9 +3871,6 @@ struct sys_info_s { // choice methods crit_exts_future_r15_c_() = default; - crit_exts_future_r15_c_(const crit_exts_future_r15_c_& other); - crit_exts_future_r15_c_& operator=(const crit_exts_future_r15_c_& other); - ~crit_exts_future_r15_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4323,24 +3880,23 @@ struct sys_info_s { pos_sys_info_r15_ies_s& pos_sys_info_r15() { assert_choice_type("posSystemInformation-r15", type_.to_string(), "criticalExtensionsFuture-r15"); - return c.get(); + return c; } const pos_sys_info_r15_ies_s& pos_sys_info_r15() const { assert_choice_type("posSystemInformation-r15", type_.to_string(), "criticalExtensionsFuture-r15"); - return c.get(); + return c; } pos_sys_info_r15_ies_s& set_pos_sys_info_r15() { set(types::pos_sys_info_r15); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + pos_sys_info_r15_ies_s c; }; struct types_opts { enum options { sys_info_r8, crit_exts_future_r15, nulltype } value; @@ -4478,9 +4034,6 @@ struct bcch_dl_sch_msg_type_c { // choice methods bcch_dl_sch_msg_type_c() = default; - bcch_dl_sch_msg_type_c(const bcch_dl_sch_msg_type_c& other); - bcch_dl_sch_msg_type_c& operator=(const bcch_dl_sch_msg_type_c& other); - ~bcch_dl_sch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4490,25 +4043,24 @@ struct bcch_dl_sch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); -}; + types type_; + c1_c_ c; +}; // BCCH-DL-SCH-Message ::= SEQUENCE struct bcch_dl_sch_msg_s { @@ -4597,9 +4149,6 @@ struct bcch_dl_sch_msg_type_br_r13_c { // choice methods bcch_dl_sch_msg_type_br_r13_c() = default; - bcch_dl_sch_msg_type_br_r13_c(const bcch_dl_sch_msg_type_br_r13_c& other); - bcch_dl_sch_msg_type_br_r13_c& operator=(const bcch_dl_sch_msg_type_br_r13_c& other); - ~bcch_dl_sch_msg_type_br_r13_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4609,24 +4158,23 @@ struct bcch_dl_sch_msg_type_br_r13_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType-BR-r13"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType-BR-r13"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // BCCH-DL-SCH-Message-BR ::= SEQUENCE @@ -4750,6 +4298,448 @@ struct sib_type1_mbms_r14_s { void to_json(json_writer& j) const; }; +// CarrierFreqInfoUTRA-FDD-v8h0 ::= SEQUENCE +struct carrier_freq_info_utra_fdd_v8h0_s { + using multi_band_info_list_l_ = bounded_array; + + // member variables + bool multi_band_info_list_present = false; + multi_band_info_list_l_ multi_band_info_list; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// NS-PmaxValue-v10l0 ::= SEQUENCE +struct ns_pmax_value_v10l0_s { + bool add_spec_emission_v10l0_present = false; + uint16_t add_spec_emission_v10l0 = 33; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// NS-PmaxList-v10l0 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxValue-v10l0 +using ns_pmax_list_v10l0_l = dyn_array; + +// MultiBandInfoList-v10l0 ::= SEQUENCE (SIZE (1..8)) OF NS-PmaxList-v10l0 +using multi_band_info_list_v10l0_l = dyn_array; + +// InterFreqCarrierFreqInfo-v10l0 ::= SEQUENCE +struct inter_freq_carrier_freq_info_v10l0_s { + bool freq_band_info_v10l0_present = false; + bool multi_band_info_list_v10l0_present = false; + ns_pmax_list_v10l0_l freq_band_info_v10l0; + multi_band_info_list_v10l0_l multi_band_info_list_v10l0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// MultiBandInfoList ::= SEQUENCE (SIZE (1..8)) OF INTEGER (1..64) +using multi_band_info_list_l = bounded_array; + +// InterFreqCarrierFreqInfo-v8h0 ::= SEQUENCE +struct inter_freq_carrier_freq_info_v8h0_s { + bool multi_band_info_list_present = false; + multi_band_info_list_l multi_band_info_list; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// MultiBandInfo-v9e0 ::= SEQUENCE +struct multi_band_info_v9e0_s { + bool freq_band_ind_v9e0_present = false; + uint16_t freq_band_ind_v9e0 = 65; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// MultiBandInfoList-v9e0 ::= SEQUENCE (SIZE (1..8)) OF MultiBandInfo-v9e0 +using multi_band_info_list_v9e0_l = dyn_array; + +// InterFreqCarrierFreqInfo-v9e0 ::= SEQUENCE +struct inter_freq_carrier_freq_info_v9e0_s { + bool dl_carrier_freq_v9e0_present = false; + bool multi_band_info_list_v9e0_present = false; + uint32_t dl_carrier_freq_v9e0 = 65536; + multi_band_info_list_v9e0_l multi_band_info_list_v9e0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// InterFreqCarrierFreqList-v13a0 ::= SEQUENCE (SIZE (1..8)) OF InterFreqCarrierFreqInfo-v1360 +using inter_freq_carrier_freq_list_v13a0_l = dyn_array; + +// SIB-Type-v12j0 ::= ENUMERATED +struct sib_type_v12j0_opts { + enum options { + sib_type19_v1250, + sib_type20_v1310, + sib_type21_v1430, + sib_type24_v1530, + sib_type25_v1530, + sib_type26_v1530, + spare10, + spare9, + spare8, + spare7, + spare6, + spare5, + spare4, + spare3, + spare2, + spare1, + // ... + nulltype + } value; + typedef uint8_t number_type; + + std::string to_string() const; + uint8_t to_number() const; +}; +typedef enumerated sib_type_v12j0_e; + +// SIB-MappingInfo-v12j0 ::= SEQUENCE (SIZE (1..31)) OF SIB-Type-v12j0 +using sib_map_info_v12j0_l = bounded_array; + +// SchedulingInfo-v12j0 ::= SEQUENCE +struct sched_info_v12j0_s { + bool sib_map_info_v12j0_present = false; + sib_map_info_v12j0_l sib_map_info_v12j0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SchedulingInfoExt-r12 ::= SEQUENCE +struct sched_info_ext_r12_s { + si_periodicity_r12_e si_periodicity_r12; + sib_map_info_v12j0_l sib_map_info_r12; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SchedulingInfoList-v12j0 ::= SEQUENCE (SIZE (1..32)) OF SchedulingInfo-v12j0 +using sched_info_list_v12j0_l = dyn_array; + +// SchedulingInfoListExt-r12 ::= SEQUENCE (SIZE (1..32)) OF SchedulingInfoExt-r12 +using sched_info_list_ext_r12_l = dyn_array; + +// SystemInformationBlockType1-v12j0-IEs ::= SEQUENCE +struct sib_type1_v12j0_ies_s { + bool sched_info_list_v12j0_present = false; + bool sched_info_list_ext_r12_present = false; + bool non_crit_ext_present = false; + sched_info_list_v12j0_l sched_info_list_v12j0; + sched_info_list_ext_r12_l sched_info_list_ext_r12; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType1-v10x0-IEs ::= SEQUENCE +struct sib_type1_v10x0_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + sib_type1_v12j0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType1-v10l0-IEs ::= SEQUENCE +struct sib_type1_v10l0_ies_s { + bool freq_band_info_v10l0_present = false; + bool multi_band_info_list_v10l0_present = false; + bool non_crit_ext_present = false; + ns_pmax_list_v10l0_l freq_band_info_v10l0; + multi_band_info_list_v10l0_l multi_band_info_list_v10l0; + sib_type1_v10x0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType1-v10j0-IEs ::= SEQUENCE +struct sib_type1_v10j0_ies_s { + bool freq_band_info_r10_present = false; + bool multi_band_info_list_v10j0_present = false; + bool non_crit_ext_present = false; + ns_pmax_list_r10_l freq_band_info_r10; + multi_band_info_list_v10j0_l multi_band_info_list_v10j0; + sib_type1_v10l0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType1-v9e0-IEs ::= SEQUENCE +struct sib_type1_v9e0_ies_s { + bool freq_band_ind_v9e0_present = false; + bool multi_band_info_list_v9e0_present = false; + bool non_crit_ext_present = false; + uint16_t freq_band_ind_v9e0 = 65; + multi_band_info_list_v9e0_l multi_band_info_list_v9e0; + sib_type1_v10j0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType1-v8h0-IEs ::= SEQUENCE +struct sib_type1_v8h0_ies_s { + bool multi_band_info_list_present = false; + bool non_crit_ext_present = false; + multi_band_info_list_l multi_band_info_list; + sib_type1_v9e0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType2-v13c0-IEs ::= SEQUENCE +struct sib_type2_v13c0_ies_s { + bool ul_pwr_ctrl_common_v13c0_present = false; + bool non_crit_ext_present = false; + ul_pwr_ctrl_common_v1310_s ul_pwr_ctrl_common_v13c0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType2-v10n0-IEs ::= SEQUENCE +struct sib_type2_v10n0_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + sib_type2_v13c0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType2-v10m0-IEs ::= SEQUENCE +struct sib_type2_v10m0_ies_s { + struct freq_info_v10l0_s_ { + uint16_t add_spec_emission_v10l0 = 33; + }; + using multi_band_info_list_v10l0_l_ = bounded_array; + + // member variables + bool freq_info_v10l0_present = false; + bool multi_band_info_list_v10l0_present = false; + bool non_crit_ext_present = false; + freq_info_v10l0_s_ freq_info_v10l0; + multi_band_info_list_v10l0_l_ multi_band_info_list_v10l0; + sib_type2_v10n0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType2-v9i0-IEs ::= SEQUENCE +struct sib_type2_v9i0_ies_s { + bool non_crit_ext_present = false; + bool dummy_present = false; + dyn_octstring non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType2-v9e0-IEs ::= SEQUENCE +struct sib_type2_v9e0_ies_s { + bool ul_carrier_freq_v9e0_present = false; + bool non_crit_ext_present = false; + uint32_t ul_carrier_freq_v9e0 = 65536; + sib_type2_v9i0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType2-v8h0-IEs ::= SEQUENCE +struct sib_type2_v8h0_ies_s { + using multi_band_info_list_l_ = bounded_array; + + // member variables + bool multi_band_info_list_present = false; + bool non_crit_ext_present = false; + multi_band_info_list_l_ multi_band_info_list; + sib_type2_v9e0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType3-v10l0-IEs ::= SEQUENCE +struct sib_type3_v10l0_ies_s { + bool freq_band_info_v10l0_present = false; + bool multi_band_info_list_v10l0_present = false; + bool non_crit_ext_present = false; + ns_pmax_list_v10l0_l freq_band_info_v10l0; + multi_band_info_list_v10l0_l multi_band_info_list_v10l0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType3-v10j0-IEs ::= SEQUENCE +struct sib_type3_v10j0_ies_s { + bool freq_band_info_r10_present = false; + bool multi_band_info_list_v10j0_present = false; + bool non_crit_ext_present = false; + ns_pmax_list_r10_l freq_band_info_r10; + multi_band_info_list_v10j0_l multi_band_info_list_v10j0; + sib_type3_v10l0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType5-v13a0-IEs ::= SEQUENCE +struct sib_type5_v13a0_ies_s { + bool late_non_crit_ext_present = false; + bool inter_freq_carrier_freq_list_v13a0_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + inter_freq_carrier_freq_list_v13a0_l inter_freq_carrier_freq_list_v13a0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType5-v10l0-IEs ::= SEQUENCE +struct sib_type5_v10l0_ies_s { + using inter_freq_carrier_freq_list_v10l0_l_ = dyn_array; + + // member variables + bool inter_freq_carrier_freq_list_v10l0_present = false; + bool non_crit_ext_present = false; + inter_freq_carrier_freq_list_v10l0_l_ inter_freq_carrier_freq_list_v10l0; + sib_type5_v13a0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType5-v10j0-IEs ::= SEQUENCE +struct sib_type5_v10j0_ies_s { + using inter_freq_carrier_freq_list_v10j0_l_ = dyn_array; + + // member variables + bool inter_freq_carrier_freq_list_v10j0_present = false; + bool non_crit_ext_present = false; + inter_freq_carrier_freq_list_v10j0_l_ inter_freq_carrier_freq_list_v10j0; + sib_type5_v10l0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType5-v9e0-IEs ::= SEQUENCE +struct sib_type5_v9e0_ies_s { + using inter_freq_carrier_freq_list_v9e0_l_ = dyn_array; + + // member variables + bool inter_freq_carrier_freq_list_v9e0_present = false; + bool non_crit_ext_present = false; + inter_freq_carrier_freq_list_v9e0_l_ inter_freq_carrier_freq_list_v9e0; + sib_type5_v10j0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType5-v8h0-IEs ::= SEQUENCE +struct sib_type5_v8h0_ies_s { + using inter_freq_carrier_freq_list_v8h0_l_ = dyn_array; + + // member variables + bool inter_freq_carrier_freq_list_v8h0_present = false; + bool non_crit_ext_present = false; + inter_freq_carrier_freq_list_v8h0_l_ inter_freq_carrier_freq_list_v8h0; + sib_type5_v9e0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SystemInformationBlockType6-v8h0-IEs ::= SEQUENCE +struct sib_type6_v8h0_ies_s { + using carrier_freq_list_utra_fdd_v8h0_l_ = dyn_array; + + // member variables + bool carrier_freq_list_utra_fdd_v8h0_present = false; + bool non_crit_ext_present = false; + carrier_freq_list_utra_fdd_v8h0_l_ carrier_freq_list_utra_fdd_v8h0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // SystemInformationBlockType16-NB-r13 ::= SystemInformationBlockType16-r11 typedef sib_type16_r11_s sib_type16_nb_r13_s; diff --git a/lib/include/srslte/asn1/rrc/common_ext.h b/lib/include/srslte/asn1/rrc/common_ext.h index f820684a8..e1f990c8f 100644 --- a/lib/include/srslte/asn1/rrc/common_ext.h +++ b/lib/include/srslte/asn1/rrc/common_ext.h @@ -71,6 +71,7 @@ struct sl_tx_pwr_r14_c { assert_choice_type("txPower-r14", type_.to_string(), "SL-TxPower-r14"); return c; } + void set_minusinfinity_r14() { set(types::minusinfinity_r14); } int8_t& set_tx_pwr_r14() { set(types::tx_pwr_r14); @@ -918,6 +919,7 @@ struct sl_disc_res_pool_r12_s { set(types::rsrp_based_r12); return c; } + void set_random_r12() { set(types::random_r12); } private: types type_; @@ -976,6 +978,7 @@ struct sl_disc_res_pool_r12_s { assert_choice_type("setup", type_.to_string(), "discPeriod-v1310"); return c; } + void set_release() { set(types::release); } setup_e_& set_setup() { set(types::setup); @@ -1010,6 +1013,7 @@ struct sl_disc_res_pool_r12_s { assert_choice_type("setup", type_.to_string(), "rxParamsAddNeighFreq-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1073,6 +1077,7 @@ struct sl_disc_res_pool_r12_s { assert_choice_type("setup", type_.to_string(), "txParamsAddNeighFreq-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1112,6 +1117,7 @@ struct sl_disc_res_pool_r12_s { assert_choice_type("setup", type_.to_string(), "txParamsAddNeighFreq-v1370"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1397,11 +1403,14 @@ struct sl_disc_tx_res_inter_freq_r13_c { assert_choice_type("discTxPoolCommon-r13", type_.to_string(), "SL-DiscTxResourcesInterFreq-r13"); return c; } + void set_acquire_si_from_carrier_r13() { set(types::acquire_si_from_carrier_r13); } sl_disc_tx_pool_list_r12_l& set_disc_tx_pool_common_r13() { set(types::disc_tx_pool_common_r13); return c; } + void set_request_ded_r13() { set(types::request_ded_r13); } + void set_no_tx_on_carrier_r13() { set(types::no_tx_on_carrier_r13); } private: types type_; diff --git a/lib/include/srslte/asn1/rrc/dl_ccch_msg.h b/lib/include/srslte/asn1/rrc/dl_ccch_msg.h index 6bf7548ca..dbaf6d80e 100644 --- a/lib/include/srslte/asn1/rrc/dl_ccch_msg.h +++ b/lib/include/srslte/asn1/rrc/dl_ccch_msg.h @@ -578,6 +578,13 @@ struct rrc_conn_reest_s { set(types::rrc_conn_reest_r8); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -587,9 +594,6 @@ struct rrc_conn_reest_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -599,24 +603,23 @@ struct rrc_conn_reest_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -641,9 +644,6 @@ struct rrc_conn_reest_reject_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -653,24 +653,23 @@ struct rrc_conn_reest_reject_s { rrc_conn_reest_reject_r8_ies_s& rrc_conn_reest_reject_r8() { assert_choice_type("rrcConnectionReestablishmentReject-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_reest_reject_r8_ies_s& rrc_conn_reest_reject_r8() const { assert_choice_type("rrcConnectionReestablishmentReject-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_reest_reject_r8_ies_s& set_rrc_conn_reest_reject_r8() { set(types::rrc_conn_reest_reject_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_reest_reject_r8_ies_s c; }; // member variables @@ -716,6 +715,9 @@ struct rrc_conn_reject_s { set(types::rrc_conn_reject_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -725,9 +727,6 @@ struct rrc_conn_reject_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -737,24 +736,23 @@ struct rrc_conn_reject_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -800,6 +798,13 @@ struct rrc_conn_setup_s { set(types::rrc_conn_setup_r8); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -809,9 +814,6 @@ struct rrc_conn_setup_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -821,24 +823,23 @@ struct rrc_conn_setup_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -863,9 +864,6 @@ struct rrc_early_data_complete_r15_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -875,24 +873,23 @@ struct rrc_early_data_complete_r15_s { rrc_early_data_complete_r15_ies_s& rrc_early_data_complete_r15() { assert_choice_type("rrcEarlyDataComplete-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_early_data_complete_r15_ies_s& rrc_early_data_complete_r15() const { assert_choice_type("rrcEarlyDataComplete-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_early_data_complete_r15_ies_s& set_rrc_early_data_complete_r15() { set(types::rrc_early_data_complete_r15); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_early_data_complete_r15_ies_s c; }; // member variables @@ -1024,6 +1021,9 @@ struct dl_ccch_msg_type_c { set(types::rrc_early_data_complete_r15); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -1040,9 +1040,6 @@ struct dl_ccch_msg_type_c { // choice methods msg_class_ext_c_() = default; - msg_class_ext_c_(const msg_class_ext_c_& other); - msg_class_ext_c_& operator=(const msg_class_ext_c_& other); - ~msg_class_ext_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -1052,24 +1049,23 @@ struct dl_ccch_msg_type_c { c2_c_& c2() { assert_choice_type("c2", type_.to_string(), "messageClassExtension"); - return c.get(); + return c; } const c2_c_& c2() const { assert_choice_type("c2", type_.to_string(), "messageClassExtension"); - return c.get(); + return c; } c2_c_& set_c2() { set(types::c2); - return c.get(); + return c; } + void set_msg_class_ext_future_r15() { set(types::msg_class_ext_future_r15); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c2_c_ c; }; struct types_opts { enum options { c1, msg_class_ext, nulltype } value; diff --git a/lib/include/srslte/asn1/rrc/dl_dcch_msg.h b/lib/include/srslte/asn1/rrc/dl_dcch_msg.h index 1b406feb0..a6f9eeb35 100644 --- a/lib/include/srslte/asn1/rrc/dl_dcch_msg.h +++ b/lib/include/srslte/asn1/rrc/dl_dcch_msg.h @@ -439,16 +439,6 @@ struct rr_cfg_common_ps_cell_r12_s { void to_json(json_writer& j) const; }; -// RadioResourceConfigCommonPSCell-v12f0 ::= SEQUENCE -struct rr_cfg_common_ps_cell_v12f0_s { - rr_cfg_common_scell_v10l0_s basic_fields_v12f0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RadioResourceConfigCommonPSCell-v1440 ::= SEQUENCE struct rr_cfg_common_ps_cell_v1440_s { rr_cfg_common_scell_v1440_s basic_fields_v1440; @@ -508,19 +498,6 @@ struct rr_cfg_ded_ps_cell_v13c0_s { void to_json(json_writer& j) const; }; -// SCG-ConfigPartSCG-v13c0 ::= SEQUENCE -struct scg_cfg_part_scg_v13c0_s { - bool scell_to_add_mod_list_scg_v13c0_present = false; - bool scell_to_add_mod_list_scg_ext_v13c0_present = false; - scell_to_add_mod_list_v13c0_l scell_to_add_mod_list_scg_v13c0; - scell_to_add_mod_list_ext_v13c0_l scell_to_add_mod_list_scg_ext_v13c0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SL-DiscTxRefCarrierDedicated-r13 ::= CHOICE struct sl_disc_tx_ref_carrier_ded_r13_c { struct types_opts { @@ -548,6 +525,7 @@ struct sl_disc_tx_ref_carrier_ded_r13_c { assert_choice_type("sCell", type_.to_string(), "SL-DiscTxRefCarrierDedicated-r13"); return c; } + void set_pcell() { set(types::pcell); } uint8_t& set_scell() { set(types::scell); @@ -637,6 +615,7 @@ struct sl_disc_tx_res_r13_c { assert_choice_type("setup", type_.to_string(), "SL-DiscTxResource-r13"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -680,6 +659,7 @@ struct tdm_pattern_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "TDM-PatternConfig-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -840,17 +820,6 @@ struct ps_cell_to_add_mod_r12_s { void to_json(json_writer& j) const; }; -// PSCellToAddMod-v12f0 ::= SEQUENCE -struct ps_cell_to_add_mod_v12f0_s { - bool rr_cfg_common_ps_cell_r12_present = false; - rr_cfg_common_ps_cell_v12f0_s rr_cfg_common_ps_cell_r12; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // PSCellToAddMod-v1440 ::= SEQUENCE struct ps_cell_to_add_mod_v1440_s { bool rr_cfg_common_ps_cell_r14_present = false; @@ -898,6 +867,7 @@ struct rclwi_cfg_r13_s { set(types::steer_to_wlan_r13); return c; } + void set_steer_to_lte_r13() { set(types::steer_to_lte_r13); } private: types type_; @@ -945,6 +915,7 @@ struct rrc_conn_recfg_v1510_ies_s { assert_choice_type("setup", type_.to_string(), "nr-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -976,43 +947,6 @@ struct rrc_conn_recfg_v1510_ies_s { void to_json(json_writer& j) const; }; -// SCG-Configuration-v13c0 ::= CHOICE -struct scg_cfg_v13c0_c { - struct setup_s_ { - bool scg_cfg_part_scg_v13c0_present = false; - scg_cfg_part_scg_v13c0_s scg_cfg_part_scg_v13c0; - }; - typedef setup_e types; - - // choice methods - scg_cfg_v13c0_c() = default; - void set(types::options e = types::nulltype); - types type() const { return type_; } - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; - // getters - setup_s_& setup() - { - assert_choice_type("setup", type_.to_string(), "SCG-Configuration-v13c0"); - return c; - } - const setup_s_& setup() const - { - assert_choice_type("setup", type_.to_string(), "SCG-Configuration-v13c0"); - return c; - } - setup_s_& set_setup() - { - set(types::setup); - return c; - } - -private: - types type_; - setup_s_ c; -}; - // SCellToReleaseList-r10 ::= SEQUENCE (SIZE (1..4)) OF INTEGER (1..7) using scell_to_release_list_r10_l = bounded_array; @@ -1172,6 +1106,7 @@ struct sl_v2x_cfg_ded_r14_s { assert_choice_type("setup", type_.to_string(), "commTxResources-r14"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -1269,6 +1204,7 @@ struct sl_v2x_cfg_ded_r14_s { assert_choice_type("setup", type_.to_string(), "commTxResources-v1530"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -1332,6 +1268,7 @@ struct lwa_cfg_r13_c { assert_choice_type("setup", type_.to_string(), "LWA-Configuration-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1368,6 +1305,7 @@ struct lwip_cfg_r13_c { assert_choice_type("setup", type_.to_string(), "LWIP-Configuration-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1474,6 +1412,7 @@ struct rclwi_cfg_r13_c { assert_choice_type("setup", type_.to_string(), "RCLWI-Configuration-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1485,24 +1424,6 @@ private: setup_s_ c; }; -// RRCConnectionReconfiguration-v13c0-IEs ::= SEQUENCE -struct rrc_conn_recfg_v13c0_ies_s { - bool rr_cfg_ded_v13c0_present = false; - bool scell_to_add_mod_list_v13c0_present = false; - bool scell_to_add_mod_list_ext_v13c0_present = false; - bool scg_cfg_v13c0_present = false; - bool non_crit_ext_present = false; - rr_cfg_ded_v13c0_s rr_cfg_ded_v13c0; - scell_to_add_mod_list_v13c0_l scell_to_add_mod_list_v13c0; - scell_to_add_mod_list_ext_v13c0_l scell_to_add_mod_list_ext_v13c0; - scg_cfg_v13c0_c scg_cfg_v13c0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RRCConnectionReconfiguration-v1430-IEs ::= SEQUENCE struct rrc_conn_recfg_v1430_ies_s { bool sl_v2x_cfg_ded_r14_present = false; @@ -1532,17 +1453,6 @@ struct rrc_conn_release_v15b0_ies_s { void to_json(json_writer& j) const; }; -// RadioResourceConfigDedicated-v1370 ::= SEQUENCE -struct rr_cfg_ded_v1370_s { - bool phys_cfg_ded_v1370_present = false; - phys_cfg_ded_v1370_s phys_cfg_ded_v1370; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SCG-ConfigPartSCG-r12 ::= SEQUENCE struct scg_cfg_part_scg_r12_s { bool ext = false; @@ -1580,19 +1490,6 @@ struct scg_cfg_part_scg_r12_s { void to_json(json_writer& j) const; }; -// SCG-ConfigPartSCG-v12f0 ::= SEQUENCE -struct scg_cfg_part_scg_v12f0_s { - bool pscell_to_add_mod_v12f0_present = false; - bool scell_to_add_mod_list_scg_v12f0_present = false; - ps_cell_to_add_mod_v12f0_s pscell_to_add_mod_v12f0; - scell_to_add_mod_list_v10l0_l scell_to_add_mod_list_scg_v12f0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SL-CommTxPoolToAddModList-r12 ::= SEQUENCE (SIZE (1..4)) OF SL-CommTxPoolToAddMod-r12 using sl_comm_tx_pool_to_add_mod_list_r12_l = dyn_array; @@ -1731,21 +1628,6 @@ struct rrc_conn_recfg_v1310_ies_s { void to_json(json_writer& j) const; }; -// RRCConnectionReconfiguration-v1370-IEs ::= SEQUENCE -struct rrc_conn_recfg_v1370_ies_s { - bool rr_cfg_ded_v1370_present = false; - bool scell_to_add_mod_list_ext_v1370_present = false; - bool non_crit_ext_present = false; - rr_cfg_ded_v1370_s rr_cfg_ded_v1370; - scell_to_add_mod_list_ext_v1370_l scell_to_add_mod_list_ext_v1370; - rrc_conn_recfg_v13c0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RRCConnectionRelease-v1540-IEs ::= SEQUENCE struct rrc_conn_release_v1540_ies_s { bool wait_time_present = false; @@ -1797,43 +1679,7 @@ struct scg_cfg_r12_c { assert_choice_type("setup", type_.to_string(), "SCG-Configuration-r12"); return c; } - setup_s_& set_setup() - { - set(types::setup); - return c; - } - -private: - types type_; - setup_s_ c; -}; - -// SCG-Configuration-v12f0 ::= CHOICE -struct scg_cfg_v12f0_c { - struct setup_s_ { - bool scg_cfg_part_scg_v12f0_present = false; - scg_cfg_part_scg_v12f0_s scg_cfg_part_scg_v12f0; - }; - typedef setup_e types; - - // choice methods - scg_cfg_v12f0_c() = default; - void set(types::options e = types::nulltype); - types type() const { return type_; } - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; - // getters - setup_s_& setup() - { - assert_choice_type("setup", type_.to_string(), "SCG-Configuration-v12f0"); - return c; - } - const setup_s_& setup() const - { - assert_choice_type("setup", type_.to_string(), "SCG-Configuration-v12f0"); - return c; - } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1942,6 +1788,7 @@ struct sl_comm_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "commTxResources-r12"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -2044,6 +1891,7 @@ struct sl_comm_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "commTxResources-v1310"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -2170,6 +2018,7 @@ struct sl_disc_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "discTxResources-r12"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -2204,6 +2053,7 @@ struct sl_disc_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "discTF-IndexList-v1260"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2294,6 +2144,7 @@ struct sl_disc_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "discTxResourcesPS-r13"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -2333,6 +2184,7 @@ struct sl_disc_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "discTxInterFreqInfo-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2364,6 +2216,7 @@ struct sl_disc_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "discRxGapConfig-r13"); return c; } + void set_release() { set(types::release); } sl_gap_cfg_r13_s& set_setup() { set(types::setup); @@ -2395,6 +2248,7 @@ struct sl_disc_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "discTxGapConfig-r13"); return c; } + void set_release() { set(types::release); } sl_gap_cfg_r13_s& set_setup() { set(types::setup); @@ -2426,6 +2280,7 @@ struct sl_disc_cfg_r12_s { assert_choice_type("setup", type_.to_string(), "discSysInfoToReportConfig-r13"); return c; } + void set_release() { set(types::release); } sl_disc_sys_info_to_report_freq_list_r13_l& set_setup() { set(types::setup); @@ -2519,6 +2374,7 @@ struct rrc_conn_recfg_v1250_ies_s { assert_choice_type("setup", type_.to_string(), "wlan-OffloadInfo-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2550,21 +2406,6 @@ struct rrc_conn_recfg_v1250_ies_s { void to_json(json_writer& j) const; }; -// RRCConnectionReconfiguration-v12f0-IEs ::= SEQUENCE -struct rrc_conn_recfg_v12f0_ies_s { - bool scg_cfg_v12f0_present = false; - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - scg_cfg_v12f0_c scg_cfg_v12f0; - dyn_octstring late_non_crit_ext; - rrc_conn_recfg_v1370_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RRCConnectionRelease-v1530-IEs ::= SEQUENCE struct rrc_conn_release_v1530_ies_s { struct cn_type_r15_opts { @@ -2728,6 +2569,7 @@ struct idc_cfg_r11_s { assert_choice_type("setup", type_.to_string(), "idc-Indication-MRDC-r15"); return c; } + void set_release() { set(types::release); } candidate_serving_freq_list_nr_r15_l& set_setup() { set(types::setup); @@ -2822,6 +2664,7 @@ struct pwr_pref_ind_cfg_r11_c { assert_choice_type("setup", type_.to_string(), "PowerPrefIndicationConfig-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2833,23 +2676,6 @@ private: setup_s_ c; }; -// RRCConnectionReconfiguration-v10l0-IEs ::= SEQUENCE -struct rrc_conn_recfg_v10l0_ies_s { - bool mob_ctrl_info_v10l0_present = false; - bool scell_to_add_mod_list_v10l0_present = false; - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - mob_ctrl_info_v10l0_s mob_ctrl_info_v10l0; - scell_to_add_mod_list_v10l0_l scell_to_add_mod_list_v10l0; - dyn_octstring late_non_crit_ext; - rrc_conn_recfg_v12f0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RRCConnectionReconfiguration-v1130-IEs ::= SEQUENCE struct rrc_conn_recfg_v1130_ies_s { bool sib_type1_ded_r11_present = false; @@ -3042,6 +2868,7 @@ struct other_cfg_r9_s { assert_choice_type("setup", type_.to_string(), "delayBudgetReportingConfig-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3106,6 +2933,7 @@ struct other_cfg_r9_s { assert_choice_type("setup", type_.to_string(), "rlm-ReportConfig-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3169,6 +2997,7 @@ struct other_cfg_r9_s { assert_choice_type("setup", type_.to_string(), "overheatingAssistanceConfig-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3212,6 +3041,7 @@ struct other_cfg_r9_s { assert_choice_type("setup", type_.to_string(), "measConfigAppLayer-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3272,19 +3102,6 @@ struct rrc_conn_recfg_v1020_ies_s { void to_json(json_writer& j) const; }; -// RRCConnectionReconfiguration-v10i0-IEs ::= SEQUENCE -struct rrc_conn_recfg_v10i0_ies_s { - bool ant_info_ded_pcell_v10i0_present = false; - bool non_crit_ext_present = false; - ant_info_ded_v10i0_s ant_info_ded_pcell_v10i0; - rrc_conn_recfg_v10l0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RRCConnectionRelease-v1020-IEs ::= SEQUENCE struct rrc_conn_release_v1020_ies_s { bool extended_wait_time_r10_present = false; @@ -3309,16 +3126,6 @@ struct rrc_conn_resume_v1530_ies_s { void to_json(json_writer& j) const; }; -// RedirectedCarrierInfo-v9e0 ::= SEQUENCE -struct redirected_carrier_info_v9e0_s { - uint32_t eutra_v9e0 = 65536; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UEInformationRequest-v1130-IEs ::= SEQUENCE struct ue_info_request_v1130_ies_s { bool conn_est_fail_report_req_r11_present = false; @@ -3422,19 +3229,6 @@ struct mob_from_eutra_cmd_v960_ies_s { void to_json(json_writer& j) const; }; -// RRCConnectionReconfiguration-v8m0-IEs ::= SEQUENCE -struct rrc_conn_recfg_v8m0_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - rrc_conn_recfg_v10i0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RRCConnectionReconfiguration-v920-IEs ::= SEQUENCE struct rrc_conn_recfg_v920_ies_s { bool other_cfg_r9_present = false; @@ -3554,20 +3348,6 @@ struct rrc_conn_release_v920_ies_s { void to_json(json_writer& j) const; }; -// RRCConnectionRelease-v9e0-IEs ::= SEQUENCE -struct rrc_conn_release_v9e0_ies_s { - bool redirected_carrier_info_v9e0_present = false; - bool idle_mode_mob_ctrl_info_v9e0_present = false; - bool non_crit_ext_present = false; - redirected_carrier_info_v9e0_s redirected_carrier_info_v9e0; - idle_mode_mob_ctrl_info_v9e0_s idle_mode_mob_ctrl_info_v9e0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RRCConnectionResume-v1510-IEs ::= SEQUENCE struct rrc_conn_resume_v1510_ies_s { bool sk_counter_r15_present = false; @@ -4311,9 +4091,6 @@ struct rn_sf_cfg_r10_s { // choice methods demod_rs_r10_c_() = default; - demod_rs_r10_c_(const demod_rs_r10_c_& other); - demod_rs_r10_c_& operator=(const demod_rs_r10_c_& other); - ~demod_rs_r10_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4323,24 +4100,23 @@ struct rn_sf_cfg_r10_s { no_interleaving_r10_e_& no_interleaving_r10() { assert_choice_type("noInterleaving-r10", type_.to_string(), "demodulationRS-r10"); - return c.get(); + return c; } const no_interleaving_r10_e_& no_interleaving_r10() const { assert_choice_type("noInterleaving-r10", type_.to_string(), "demodulationRS-r10"); - return c.get(); + return c; } + void set_interleaving_r10() { set(types::interleaving_r10); } no_interleaving_r10_e_& set_no_interleaving_r10() { set(types::no_interleaving_r10); - return c.get(); + return c; } private: - types type_; - pod_choice_buffer_t c; - - void destroy_(); + types type_; + no_interleaving_r10_e_ c; }; struct pucch_cfg_r10_c_ { struct tdd_c_ { @@ -5229,9 +5005,6 @@ struct csfb_params_resp_cdma2000_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5241,24 +5014,23 @@ struct csfb_params_resp_cdma2000_s { csfb_params_resp_cdma2000_r8_ies_s& csfb_params_resp_cdma2000_r8() { assert_choice_type("csfbParametersResponseCDMA2000-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const csfb_params_resp_cdma2000_r8_ies_s& csfb_params_resp_cdma2000_r8() const { assert_choice_type("csfbParametersResponseCDMA2000-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } csfb_params_resp_cdma2000_r8_ies_s& set_csfb_params_resp_cdma2000_r8() { set(types::csfb_params_resp_cdma2000_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + csfb_params_resp_cdma2000_r8_ies_s c; }; // member variables @@ -5305,6 +5077,9 @@ struct counter_check_s { set(types::counter_check_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5314,9 +5089,6 @@ struct counter_check_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5326,24 +5098,23 @@ struct counter_check_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5408,6 +5179,8 @@ struct dl_info_transfer_s { set(types::dl_info_transfer_r15); return c.get(); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5419,9 +5192,6 @@ struct dl_info_transfer_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5431,24 +5201,23 @@ struct dl_info_transfer_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5495,6 +5264,9 @@ struct ho_from_eutra_prep_request_s { set(types::ho_from_eutra_prep_request_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5504,9 +5276,6 @@ struct ho_from_eutra_prep_request_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5516,24 +5285,23 @@ struct ho_from_eutra_prep_request_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5580,6 +5348,9 @@ struct logged_meas_cfg_r10_s { set(types::logged_meas_cfg_r10); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5589,9 +5360,6 @@ struct logged_meas_cfg_r10_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5601,24 +5369,23 @@ struct logged_meas_cfg_r10_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5682,6 +5449,8 @@ struct mob_from_eutra_cmd_s { set(types::mob_from_eutra_cmd_r9); return c.get(); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5693,9 +5462,6 @@ struct mob_from_eutra_cmd_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5705,24 +5471,23 @@ struct mob_from_eutra_cmd_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5769,6 +5534,9 @@ struct rn_recfg_r10_s { set(types::rn_recfg_r10); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5778,9 +5546,6 @@ struct rn_recfg_r10_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5790,24 +5555,23 @@ struct rn_recfg_r10_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5854,6 +5618,13 @@ struct rrc_conn_recfg_s { set(types::rrc_conn_recfg_r8); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5863,9 +5634,6 @@ struct rrc_conn_recfg_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5875,24 +5643,23 @@ struct rrc_conn_recfg_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5939,6 +5706,9 @@ struct rrc_conn_release_s { set(types::rrc_conn_release_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5948,9 +5718,6 @@ struct rrc_conn_release_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5960,24 +5727,23 @@ struct rrc_conn_release_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6024,6 +5790,9 @@ struct rrc_conn_resume_r13_s { set(types::rrc_conn_resume_r13); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6033,9 +5802,6 @@ struct rrc_conn_resume_r13_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6045,24 +5811,23 @@ struct rrc_conn_resume_r13_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6109,6 +5874,9 @@ struct ue_info_request_r9_s { set(types::ue_info_request_r9); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6118,9 +5886,6 @@ struct ue_info_request_r9_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6130,24 +5895,23 @@ struct ue_info_request_r9_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6396,6 +6160,9 @@ struct dl_dcch_msg_type_c { set(types::rrc_conn_resume_r13); return c.get(); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6427,9 +6194,6 @@ struct dl_dcch_msg_type_c { // choice methods dl_dcch_msg_type_c() = default; - dl_dcch_msg_type_c(const dl_dcch_msg_type_c& other); - dl_dcch_msg_type_c& operator=(const dl_dcch_msg_type_c& other); - ~dl_dcch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6439,24 +6203,23 @@ struct dl_dcch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "DL-DCCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "DL-DCCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // DL-DCCH-Message ::= SEQUENCE @@ -6469,6 +6232,255 @@ struct dl_dcch_msg_s { void to_json(json_writer& j) const; }; +// RadioResourceConfigCommonPSCell-v12f0 ::= SEQUENCE +struct rr_cfg_common_ps_cell_v12f0_s { + rr_cfg_common_scell_v10l0_s basic_fields_v12f0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// PSCellToAddMod-v12f0 ::= SEQUENCE +struct ps_cell_to_add_mod_v12f0_s { + bool rr_cfg_common_ps_cell_r12_present = false; + rr_cfg_common_ps_cell_v12f0_s rr_cfg_common_ps_cell_r12; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SCG-ConfigPartSCG-v13c0 ::= SEQUENCE +struct scg_cfg_part_scg_v13c0_s { + bool scell_to_add_mod_list_scg_v13c0_present = false; + bool scell_to_add_mod_list_scg_ext_v13c0_present = false; + scell_to_add_mod_list_v13c0_l scell_to_add_mod_list_scg_v13c0; + scell_to_add_mod_list_ext_v13c0_l scell_to_add_mod_list_scg_ext_v13c0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SCG-Configuration-v13c0 ::= CHOICE +struct scg_cfg_v13c0_c { + struct setup_s_ { + bool scg_cfg_part_scg_v13c0_present = false; + scg_cfg_part_scg_v13c0_s scg_cfg_part_scg_v13c0; + }; + typedef setup_e types; + + // choice methods + scg_cfg_v13c0_c() = default; + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + setup_s_& setup() + { + assert_choice_type("setup", type_.to_string(), "SCG-Configuration-v13c0"); + return c; + } + const setup_s_& setup() const + { + assert_choice_type("setup", type_.to_string(), "SCG-Configuration-v13c0"); + return c; + } + void set_release() { set(types::release); } + setup_s_& set_setup() + { + set(types::setup); + return c; + } + +private: + types type_; + setup_s_ c; +}; + +// RRCConnectionReconfiguration-v13c0-IEs ::= SEQUENCE +struct rrc_conn_recfg_v13c0_ies_s { + bool rr_cfg_ded_v13c0_present = false; + bool scell_to_add_mod_list_v13c0_present = false; + bool scell_to_add_mod_list_ext_v13c0_present = false; + bool scg_cfg_v13c0_present = false; + bool non_crit_ext_present = false; + rr_cfg_ded_v13c0_s rr_cfg_ded_v13c0; + scell_to_add_mod_list_v13c0_l scell_to_add_mod_list_v13c0; + scell_to_add_mod_list_ext_v13c0_l scell_to_add_mod_list_ext_v13c0; + scg_cfg_v13c0_c scg_cfg_v13c0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RadioResourceConfigDedicated-v1370 ::= SEQUENCE +struct rr_cfg_ded_v1370_s { + bool phys_cfg_ded_v1370_present = false; + phys_cfg_ded_v1370_s phys_cfg_ded_v1370; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SCG-ConfigPartSCG-v12f0 ::= SEQUENCE +struct scg_cfg_part_scg_v12f0_s { + bool pscell_to_add_mod_v12f0_present = false; + bool scell_to_add_mod_list_scg_v12f0_present = false; + ps_cell_to_add_mod_v12f0_s pscell_to_add_mod_v12f0; + scell_to_add_mod_list_v10l0_l scell_to_add_mod_list_scg_v12f0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RRCConnectionReconfiguration-v1370-IEs ::= SEQUENCE +struct rrc_conn_recfg_v1370_ies_s { + bool rr_cfg_ded_v1370_present = false; + bool scell_to_add_mod_list_ext_v1370_present = false; + bool non_crit_ext_present = false; + rr_cfg_ded_v1370_s rr_cfg_ded_v1370; + scell_to_add_mod_list_ext_v1370_l scell_to_add_mod_list_ext_v1370; + rrc_conn_recfg_v13c0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SCG-Configuration-v12f0 ::= CHOICE +struct scg_cfg_v12f0_c { + struct setup_s_ { + bool scg_cfg_part_scg_v12f0_present = false; + scg_cfg_part_scg_v12f0_s scg_cfg_part_scg_v12f0; + }; + typedef setup_e types; + + // choice methods + scg_cfg_v12f0_c() = default; + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + setup_s_& setup() + { + assert_choice_type("setup", type_.to_string(), "SCG-Configuration-v12f0"); + return c; + } + const setup_s_& setup() const + { + assert_choice_type("setup", type_.to_string(), "SCG-Configuration-v12f0"); + return c; + } + void set_release() { set(types::release); } + setup_s_& set_setup() + { + set(types::setup); + return c; + } + +private: + types type_; + setup_s_ c; +}; + +// RRCConnectionReconfiguration-v12f0-IEs ::= SEQUENCE +struct rrc_conn_recfg_v12f0_ies_s { + bool scg_cfg_v12f0_present = false; + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + scg_cfg_v12f0_c scg_cfg_v12f0; + dyn_octstring late_non_crit_ext; + rrc_conn_recfg_v1370_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RRCConnectionReconfiguration-v10l0-IEs ::= SEQUENCE +struct rrc_conn_recfg_v10l0_ies_s { + bool mob_ctrl_info_v10l0_present = false; + bool scell_to_add_mod_list_v10l0_present = false; + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + mob_ctrl_info_v10l0_s mob_ctrl_info_v10l0; + scell_to_add_mod_list_v10l0_l scell_to_add_mod_list_v10l0; + dyn_octstring late_non_crit_ext; + rrc_conn_recfg_v12f0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RRCConnectionReconfiguration-v10i0-IEs ::= SEQUENCE +struct rrc_conn_recfg_v10i0_ies_s { + bool ant_info_ded_pcell_v10i0_present = false; + bool non_crit_ext_present = false; + ant_info_ded_v10i0_s ant_info_ded_pcell_v10i0; + rrc_conn_recfg_v10l0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RRCConnectionReconfiguration-v8m0-IEs ::= SEQUENCE +struct rrc_conn_recfg_v8m0_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + rrc_conn_recfg_v10i0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RedirectedCarrierInfo-v9e0 ::= SEQUENCE +struct redirected_carrier_info_v9e0_s { + uint32_t eutra_v9e0 = 65536; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RRCConnectionRelease-v9e0-IEs ::= SEQUENCE +struct rrc_conn_release_v9e0_ies_s { + bool redirected_carrier_info_v9e0_present = false; + bool idle_mode_mob_ctrl_info_v9e0_present = false; + bool non_crit_ext_present = false; + redirected_carrier_info_v9e0_s redirected_carrier_info_v9e0; + idle_mode_mob_ctrl_info_v9e0_s idle_mode_mob_ctrl_info_v9e0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + } // namespace rrc } // namespace asn1 diff --git a/lib/include/srslte/asn1/rrc/ho_cmd.h b/lib/include/srslte/asn1/rrc/ho_cmd.h index 58035ef8d..288121642 100644 --- a/lib/include/srslte/asn1/rrc/ho_cmd.h +++ b/lib/include/srslte/asn1/rrc/ho_cmd.h @@ -142,6 +142,13 @@ struct scg_cfg_r12_s { set(types::scg_cfg_r12); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -151,9 +158,6 @@ struct scg_cfg_r12_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -163,24 +167,23 @@ struct scg_cfg_r12_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -459,6 +462,13 @@ struct ho_cmd_s { set(types::ho_cmd_r8); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -468,9 +478,6 @@ struct ho_cmd_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -480,24 +487,23 @@ struct ho_cmd_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -563,31 +569,6 @@ struct ho_prep_info_v1320_ies_s { void to_json(json_writer& j) const; }; -// HandoverPreparationInformation-v13c0-IEs ::= SEQUENCE -struct ho_prep_info_v13c0_ies_s { - bool as_cfg_v13c0_present = false; - bool non_crit_ext_present = false; - as_cfg_v13c0_s as_cfg_v13c0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// HandoverPreparationInformation-v10x0-IEs ::= SEQUENCE -struct ho_prep_info_v10x0_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - ho_prep_info_v13c0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // HandoverPreparationInformation-v1250-IEs ::= SEQUENCE struct ho_prep_info_v1250_ies_s { bool ue_supported_earfcn_r12_present = false; @@ -603,19 +584,6 @@ struct ho_prep_info_v1250_ies_s { void to_json(json_writer& j) const; }; -// HandoverPreparationInformation-v10j0-IEs ::= SEQUENCE -struct ho_prep_info_v10j0_ies_s { - bool as_cfg_v10j0_present = false; - bool non_crit_ext_present = false; - as_cfg_v10j0_s as_cfg_v10j0; - ho_prep_info_v10x0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // HandoverPreparationInformation-v1130-IEs ::= SEQUENCE struct ho_prep_info_v1130_ies_s { bool as_context_v1130_present = false; @@ -642,19 +610,6 @@ struct ho_prep_info_v9e0_ies_s { void to_json(json_writer& j) const; }; -// HandoverPreparationInformation-v9j0-IEs ::= SEQUENCE -struct ho_prep_info_v9j0_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - ho_prep_info_v10j0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // HandoverPreparationInformation-v9d0-IEs ::= SEQUENCE struct ho_prep_info_v9d0_ies_s { bool late_non_crit_ext_present = false; @@ -832,6 +787,13 @@ struct ho_prep_info_s { set(types::ho_prep_info_r8); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -841,9 +803,6 @@ struct ho_prep_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -853,24 +812,23 @@ struct ho_prep_info_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -882,6 +840,57 @@ struct ho_prep_info_s { void to_json(json_writer& j) const; }; +// HandoverPreparationInformation-v13c0-IEs ::= SEQUENCE +struct ho_prep_info_v13c0_ies_s { + bool as_cfg_v13c0_present = false; + bool non_crit_ext_present = false; + as_cfg_v13c0_s as_cfg_v13c0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// HandoverPreparationInformation-v10x0-IEs ::= SEQUENCE +struct ho_prep_info_v10x0_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + ho_prep_info_v13c0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// HandoverPreparationInformation-v10j0-IEs ::= SEQUENCE +struct ho_prep_info_v10j0_ies_s { + bool as_cfg_v10j0_present = false; + bool non_crit_ext_present = false; + as_cfg_v10j0_s as_cfg_v10j0; + ho_prep_info_v10x0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// HandoverPreparationInformation-v9j0-IEs ::= SEQUENCE +struct ho_prep_info_v9j0_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + ho_prep_info_v10j0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // VarMeasConfig ::= SEQUENCE struct var_meas_cfg_s { struct speed_state_pars_c_ { @@ -909,6 +918,7 @@ struct var_meas_cfg_s { assert_choice_type("setup", type_.to_string(), "speedStatePars"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); diff --git a/lib/include/srslte/asn1/rrc/meascfg.h b/lib/include/srslte/asn1/rrc/meascfg.h index 3eb40290f..2e0a0e2b5 100644 --- a/lib/include/srslte/asn1/rrc/meascfg.h +++ b/lib/include/srslte/asn1/rrc/meascfg.h @@ -721,6 +721,7 @@ struct bt_name_list_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "BT-NameListConfig-r15"); return c; } + void set_release() { set(types::release); } bt_name_list_r15_l& set_setup() { set(types::setup); @@ -955,6 +956,7 @@ struct meas_ds_cfg_r12_c { assert_choice_type("setup", type_.to_string(), "MeasDS-Config-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1342,6 +1344,7 @@ struct meas_gap_cfg_c { assert_choice_type("setup", type_.to_string(), "MeasGapConfig"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1420,6 +1423,7 @@ struct meas_sf_pattern_cfg_neigh_r10_c { assert_choice_type("setup", type_.to_string(), "MeasSubframePatternConfigNeigh-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1511,6 +1515,7 @@ struct rmtc_cfg_r13_c { assert_choice_type("setup", type_.to_string(), "RMTC-Config-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1555,6 +1560,7 @@ struct rs_cfg_ssb_nr_r15_s { assert_choice_type("setup", type_.to_string(), "ssb-ToMeasure-r15"); return c; } + void set_release() { set(types::release); } ssb_to_measure_r15_c& set_setup() { set(types::setup); @@ -1606,6 +1612,7 @@ struct rsrq_range_cfg_r12_c { assert_choice_type("setup", type_.to_string(), "RSRQ-RangeConfig-r12"); return c; } + void set_release() { set(types::release); } int8_t& set_setup() { set(types::setup); @@ -1962,6 +1969,7 @@ struct ul_delay_cfg_r13_c { assert_choice_type("setup", type_.to_string(), "UL-DelayConfig-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2027,6 +2035,7 @@ struct wlan_name_list_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "WLAN-NameListConfig-r15"); return c; } + void set_release() { set(types::release); } wlan_name_list_r15_l& set_setup() { set(types::setup); @@ -2110,6 +2119,7 @@ struct meas_obj_eutra_s { assert_choice_type("setup", type_.to_string(), "t312-r12"); return c; } + void set_release() { set(types::release); } setup_e_& set_setup() { set(types::setup); @@ -2232,6 +2242,7 @@ struct meas_obj_nr_r15_s { assert_choice_type("setup", type_.to_string(), "bandNR-r15"); return c; } + void set_release() { set(types::release); } uint16_t& set_setup() { set(types::setup); @@ -2926,6 +2937,7 @@ struct report_cfg_eutra_s { assert_choice_type("setup", type_.to_string(), "alternativeTimeToTrigger-r12"); return c; } + void set_release() { set(types::release); } time_to_trigger_e& set_setup() { set(types::setup); @@ -2975,6 +2987,7 @@ struct report_cfg_eutra_s { assert_choice_type("setup", type_.to_string(), "rs-sinr-Config-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3491,6 +3504,7 @@ struct report_cfg_inter_rat_s { assert_choice_type("setup", type_.to_string(), "b2-Threshold1-v1250"); return c; } + void set_release() { set(types::release); } int8_t& set_setup() { set(types::setup); @@ -4491,6 +4505,7 @@ struct meas_gap_cfg_dense_prs_r15_c { assert_choice_type("setup", type_.to_string(), "MeasGapConfigDensePRS-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4530,6 +4545,7 @@ struct meas_gap_cfg_per_cc_list_r14_c { assert_choice_type("setup", type_.to_string(), "MeasGapConfigPerCC-List-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4577,6 +4593,7 @@ struct meas_gap_sharing_cfg_r14_c { assert_choice_type("setup", type_.to_string(), "MeasGapSharingConfig-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4715,6 +4732,9 @@ struct rach_skip_r14_s { assert_choice_type("scg-STAG-r14", type_.to_string(), "targetTA-r14"); return c.get(); } + void set_ta0_r14() { set(types::ta0_r14); } + void set_mcg_ptag_r14() { set(types::mcg_ptag_r14); } + void set_scg_ptag_r14() { set(types::scg_ptag_r14); } uint8_t& set_mcg_stag_r14() { set(types::mcg_stag_r14); @@ -4793,6 +4813,7 @@ struct meas_cfg_s { assert_choice_type("setup", type_.to_string(), "speedStatePars"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4824,6 +4845,7 @@ struct meas_cfg_s { assert_choice_type("setup", type_.to_string(), "measScaleFactor-r12"); return c; } + void set_release() { set(types::release); } meas_scale_factor_r12_e& set_setup() { set(types::setup); @@ -4855,6 +4877,7 @@ struct meas_cfg_s { assert_choice_type("setup", type_.to_string(), "heightThreshRef-r15"); return c; } + void set_release() { set(types::release); } uint8_t& set_setup() { set(types::setup); @@ -4936,17 +4959,6 @@ struct carrier_freq_geran_s { void to_json(json_writer& j) const; }; -// MobilityControlInfo-v10l0 ::= SEQUENCE -struct mob_ctrl_info_v10l0_s { - bool add_spec_emission_v10l0_present = false; - uint16_t add_spec_emission_v10l0 = 33; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // LoggedMeasurementConfiguration-v1530-IEs ::= SEQUENCE struct logged_meas_cfg_v1530_ies_s { bool bt_name_list_r15_present = false; @@ -6572,6 +6584,13 @@ struct meas_report_s { set(types::meas_report_r8); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6581,9 +6600,6 @@ struct meas_report_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6593,24 +6609,23 @@ struct meas_report_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6622,6 +6637,17 @@ struct meas_report_s { void to_json(json_writer& j) const; }; +// MobilityControlInfo-v10l0 ::= SEQUENCE +struct mob_ctrl_info_v10l0_s { + bool add_spec_emission_v10l0_present = false; + uint16_t add_spec_emission_v10l0 = 33; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + } // namespace rrc } // namespace asn1 diff --git a/lib/include/srslte/asn1/rrc/paging.h b/lib/include/srslte/asn1/rrc/paging.h index ec807a2f4..89e753c77 100644 --- a/lib/include/srslte/asn1/rrc/paging.h +++ b/lib/include/srslte/asn1/rrc/paging.h @@ -265,9 +265,6 @@ struct pcch_msg_type_c { // choice methods pcch_msg_type_c() = default; - pcch_msg_type_c(const pcch_msg_type_c& other); - pcch_msg_type_c& operator=(const pcch_msg_type_c& other); - ~pcch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -277,24 +274,23 @@ struct pcch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "PCCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "PCCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // PCCH-Message ::= SEQUENCE @@ -363,6 +359,13 @@ struct ue_paging_coverage_info_s { set(types::ue_paging_coverage_info_r13); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -372,9 +375,6 @@ struct ue_paging_coverage_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -384,24 +384,23 @@ struct ue_paging_coverage_info_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -484,6 +483,13 @@ struct ue_radio_paging_info_s { set(types::ue_radio_paging_info_r12); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -493,9 +499,6 @@ struct ue_radio_paging_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -505,24 +508,23 @@ struct ue_radio_paging_info_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables diff --git a/lib/include/srslte/asn1/rrc/phy_ded.h b/lib/include/srslte/asn1/rrc/phy_ded.h index f1c6fce41..e92884ade 100644 --- a/lib/include/srslte/asn1/rrc/phy_ded.h +++ b/lib/include/srslte/asn1/rrc/phy_ded.h @@ -221,6 +221,7 @@ struct csi_rs_cfg_nzp_r11_s { assert_choice_type("setup", type_.to_string(), "mbsfn-SubframeConfigList-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -264,6 +265,7 @@ struct csi_rs_cfg_nzp_r11_s { assert_choice_type("setup", type_.to_string(), "mbsfn-SubframeConfigList-v1430"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -413,6 +415,7 @@ struct csi_rs_cfg_nzp_emimo_r13_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-ConfigNZP-EMIMO-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -524,6 +527,7 @@ struct csi_rs_cfg_emimo2_r14_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-ConfigEMIMO2-r14"); return c; } + void set_release() { set(types::release); } csi_rs_cfg_bf_r14_s& set_setup() { set(types::setup); @@ -766,6 +770,7 @@ struct cri_report_cfg_r13_c { assert_choice_type("setup", type_.to_string(), "CRI-ReportConfig-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -807,6 +812,7 @@ struct csi_rs_cfg_emimo_hybrid_r14_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-ConfigEMIMO-Hybrid-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -900,6 +906,7 @@ struct csi_rs_cfg_emimo_r13_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-ConfigEMIMO-r13"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -993,6 +1000,7 @@ struct csi_rs_cfg_emimo_v1430_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-ConfigEMIMO-v1430"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -1086,6 +1094,7 @@ struct csi_rs_cfg_emimo_v1480_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-ConfigEMIMO-v1480"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -1143,6 +1152,7 @@ struct csi_rs_cfg_emimo_v1530_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-ConfigEMIMO-v1530"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -1273,6 +1283,7 @@ struct cqi_report_periodic_proc_ext_r11_s { assert_choice_type("setup", type_.to_string(), "csi-ConfigIndex-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1382,6 +1393,7 @@ struct csi_process_r11_s { assert_choice_type("setup", type_.to_string(), "csi-IM-ConfigIdList-r12"); return c; } + void set_release() { set(types::release); } setup_l_& set_setup() { set(types::setup); @@ -1415,6 +1427,7 @@ struct csi_process_r11_s { assert_choice_type("setup", type_.to_string(), "cqi-ReportAperiodicProc2-r12"); return c; } + void set_release() { set(types::release); } cqi_report_aperiodic_proc_r11_s& set_setup() { set(types::setup); @@ -1448,6 +1461,7 @@ struct csi_process_r11_s { assert_choice_type("setup", type_.to_string(), "cqi-ReportAperiodicProc-v1310"); return c; } + void set_release() { set(types::release); } cqi_report_aperiodic_proc_v1310_s& set_setup() { set(types::setup); @@ -1481,6 +1495,7 @@ struct csi_process_r11_s { assert_choice_type("setup", type_.to_string(), "cqi-ReportAperiodicProc2-v1310"); return c; } + void set_release() { set(types::release); } cqi_report_aperiodic_proc_v1310_s& set_setup() { set(types::setup); @@ -1621,6 +1636,7 @@ struct cqi_report_aperiodic_r10_c { assert_choice_type("setup", type_.to_string(), "CQI-ReportAperiodic-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1676,6 +1692,7 @@ struct cqi_report_aperiodic_v1250_c { assert_choice_type("setup", type_.to_string(), "CQI-ReportAperiodic-v1250"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1729,6 +1746,7 @@ struct cqi_report_aperiodic_v1310_c { assert_choice_type("setup", type_.to_string(), "aperiodicCSI-Trigger2-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1768,6 +1786,7 @@ struct cqi_report_aperiodic_v1310_c { assert_choice_type("setup", type_.to_string(), "CQI-ReportAperiodic-v1310"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2052,6 +2071,7 @@ struct cqi_report_periodic_r10_c { assert_choice_type("setup", type_.to_string(), "csi-ConfigIndex-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2098,6 +2118,7 @@ struct cqi_report_periodic_r10_c { assert_choice_type("setup", type_.to_string(), "CQI-ReportPeriodic-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2249,6 +2270,7 @@ struct spdcch_elems_r15_c { assert_choice_type("setup", type_.to_string(), "SPDCCH-Elements-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2311,6 +2333,7 @@ struct spucch_elems_r15_c { assert_choice_type("setup", type_.to_string(), "SPUCCH-Elements-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2406,6 +2429,7 @@ struct zero_tx_pwr_csi_rs_conf_r12_c { assert_choice_type("setup", type_.to_string(), "ZeroTxPowerCSI-RS-Conf-r12"); return c; } + void set_release() { set(types::release); } zero_tx_pwr_csi_rs_r12_s& set_setup() { set(types::setup); @@ -2446,6 +2470,7 @@ struct cqi_report_cfg_r10_s { assert_choice_type("setup", type_.to_string(), "csi-SubframePatternConfig-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2516,6 +2541,7 @@ struct cqi_report_cfg_v1250_s { assert_choice_type("setup", type_.to_string(), "csi-SubframePatternConfig-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2637,6 +2663,7 @@ struct csi_rs_cfg_r10_s { assert_choice_type("setup", type_.to_string(), "csi-RS-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2693,6 +2720,7 @@ struct csi_rs_cfg_v1250_s { assert_choice_type("setup", type_.to_string(), "ds-ZeroTxPowerCSI-RS-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2860,6 +2888,7 @@ struct epdcch_set_cfg_r11_s { assert_choice_type("setup", type_.to_string(), "csi-RS-ConfigZPId2-r12"); return c; } + void set_release() { set(types::release); } uint8_t& set_setup() { set(types::setup); @@ -2882,6 +2911,9 @@ struct epdcch_set_cfg_r11_s { void to_json(json_writer& j) const; bool operator==(const num_prb_pairs_v1310_c_& other) const; bool operator!=(const num_prb_pairs_v1310_c_& other) const { return not(*this == other); } + // getters + void set_release() { set(types::release); } + void set_setup() { set(types::setup); } private: types type_; @@ -3015,6 +3047,7 @@ struct epdcch_set_cfg_r11_s { assert_choice_type("setup", type_.to_string(), "mpdcch-config-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3142,6 +3175,7 @@ struct enable256_qam_r14_c { assert_choice_type("setup", type_.to_string(), "Enable256QAM-r14"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -3190,6 +3224,7 @@ struct pdsch_re_map_qcl_cfg_r11_s { assert_choice_type("setup", type_.to_string(), "mbsfn-SubframeConfigList-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3242,6 +3277,7 @@ struct pdsch_re_map_qcl_cfg_r11_s { assert_choice_type("setup", type_.to_string(), "mbsfn-SubframeConfigList-v1430"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3305,6 +3341,7 @@ struct pdsch_re_map_qcl_cfg_r11_s { assert_choice_type("setup", type_.to_string(), "codewordOneConfig-v1530"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3393,6 +3430,7 @@ struct tpc_pdcch_cfg_c { assert_choice_type("setup", type_.to_string(), "TPC-PDCCH-Config"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3704,6 +3742,7 @@ struct ant_info_ded_stti_r15_c { assert_choice_type("setup", type_.to_string(), "AntennaInfoDedicatedSTTI-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3788,6 +3827,7 @@ struct cqi_report_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "CQI-ReportConfig-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3831,6 +3871,7 @@ struct cqi_report_periodic_c { assert_choice_type("subbandCQI", type_.to_string(), "cqi-FormatIndicatorPeriodic"); return c; } + void set_wideband_cqi() { set(types::wideband_cqi); } subband_cqi_s_& set_subband_cqi() { set(types::subband_cqi); @@ -3870,6 +3911,7 @@ struct cqi_report_periodic_c { assert_choice_type("setup", type_.to_string(), "CQI-ReportPeriodic"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3915,6 +3957,7 @@ struct csi_rs_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3957,6 +4000,7 @@ struct csi_rs_cfg_zp_ap_list_r14_c { assert_choice_type("setup", type_.to_string(), "CSI-RS-ConfigZP-ApList-r14"); return c; } + void set_release() { set(types::release); } setup_l_& set_setup() { set(types::setup); @@ -4002,6 +4046,7 @@ struct dmrs_cfg_r11_c { assert_choice_type("setup", type_.to_string(), "DMRS-Config-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4137,6 +4182,7 @@ struct eimta_main_cfg_r12_c { assert_choice_type("setup", type_.to_string(), "EIMTA-MainConfig-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4185,6 +4231,7 @@ struct eimta_main_cfg_serv_cell_r12_c { assert_choice_type("setup", type_.to_string(), "mbsfn-SubframeConfigList-v1250"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4223,6 +4270,7 @@ struct eimta_main_cfg_serv_cell_r12_c { assert_choice_type("setup", type_.to_string(), "EIMTA-MainConfigServCell-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4334,6 +4382,7 @@ struct pucch_format3_conf_r13_s { assert_choice_type("setup", type_.to_string(), "twoAntennaPortActivatedPUCCH-Format3-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4405,6 +4454,7 @@ struct spdcch_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "SPDCCH-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4454,6 +4504,7 @@ struct spucch_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "SPUCCH-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4637,6 +4688,7 @@ struct sched_request_cfg_v1530_c { assert_choice_type("setup", type_.to_string(), "SchedulingRequestConfig-v1530"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4726,6 +4778,7 @@ struct slot_or_subslot_pdsch_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "SlotOrSubslotPDSCH-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4791,6 +4844,7 @@ struct slot_or_subslot_pusch_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "SlotOrSubslotPUSCH-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4839,6 +4893,7 @@ struct tdd_pusch_up_pts_r14_c { assert_choice_type("setup", type_.to_string(), "TDD-PUSCH-UpPTS-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5058,6 +5113,7 @@ struct ant_info_ded_s { assert_choice_type("setup", type_.to_string(), "ue-TransmitAntennaSelection"); return c; } + void set_release() { set(types::release); } setup_e_& set_setup() { set(types::setup); @@ -5138,6 +5194,7 @@ struct ant_info_ded_r10_s { assert_choice_type("setup", type_.to_string(), "ue-TransmitAntennaSelection"); return c; } + void set_release() { set(types::release); } setup_e_& set_setup() { set(types::setup); @@ -5228,6 +5285,7 @@ struct ant_info_ded_v1530_c { assert_choice_type("ue-TxAntennaSelection-SRS-2T4R-NrOfPairs-r15", type_.to_string(), "setup"); return c; } + void set_ue_tx_ant_sel_srs_minus1_t4_r_cfg_r15() { set(types::ue_tx_ant_sel_srs_minus1_t4_r_cfg_r15); } ue_tx_ant_sel_srs_minus2_t4_r_nr_of_pairs_r15_e_& set_ue_tx_ant_sel_srs_minus2_t4_r_nr_of_pairs_r15() { set(types::ue_tx_ant_sel_srs_minus2_t4_r_nr_of_pairs_r15); @@ -5258,6 +5316,7 @@ struct ant_info_ded_v1530_c { assert_choice_type("setup", type_.to_string(), "AntennaInfoDedicated-v1530"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -5518,6 +5577,7 @@ struct epdcch_cfg_r11_s { assert_choice_type("setup", type_.to_string(), "subframePatternConfig-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5561,6 +5621,7 @@ struct epdcch_cfg_r11_s { assert_choice_type("setup", type_.to_string(), "config-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5614,6 +5675,7 @@ struct pdcch_candidate_reductions_r13_c { assert_choice_type("setup", type_.to_string(), "PDCCH-CandidateReductions-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5811,6 +5873,7 @@ struct pucch_cfg_ded_s { assert_choice_type("setup", type_.to_string(), "ackNackRepetition"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5878,6 +5941,7 @@ struct pucch_cfg_ded_r13_s { assert_choice_type("setup", type_.to_string(), "ackNackRepetition-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5926,6 +5990,7 @@ struct pucch_cfg_ded_r13_s { assert_choice_type("setup", type_.to_string(), "twoAntennaPortActivatedPUCCH-Format3-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5975,6 +6040,7 @@ struct pucch_cfg_ded_r13_s { assert_choice_type("setup", type_.to_string(), "n1PUCCH-AN-CS-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6123,6 +6189,7 @@ struct pucch_cfg_ded_r13_s { assert_choice_type("setup", type_.to_string(), "nPUCCH-Param-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6159,6 +6226,7 @@ struct pucch_cfg_ded_r13_s { assert_choice_type("setup", type_.to_string(), "nkaPUCCH-Param-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6300,6 +6368,7 @@ struct pucch_cfg_ded_r13_s { assert_choice_type("setup", type_.to_string(), "pucch-NumRepetitionCE-r13"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -6374,6 +6443,7 @@ struct pucch_cfg_ded_v1020_s { assert_choice_type("setup", type_.to_string(), "n1PUCCH-AN-CS-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6490,6 +6560,7 @@ struct pucch_cfg_ded_v1130_s { assert_choice_type("setup", type_.to_string(), "n1PUCCH-AN-CS-v1130"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6525,6 +6596,7 @@ struct pucch_cfg_ded_v1130_s { assert_choice_type("setup", type_.to_string(), "nPUCCH-Param-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6574,6 +6646,7 @@ struct pucch_cfg_ded_v1250_s { assert_choice_type("setup", type_.to_string(), "nkaPUCCH-Param-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6663,6 +6736,7 @@ struct pusch_cfg_ded_r13_s { assert_choice_type("setup", type_.to_string(), "pusch-DMRS-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6714,6 +6788,7 @@ struct pusch_cfg_ded_r13_s { assert_choice_type("setup", type_.to_string(), "uciOnPUSCH"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6798,6 +6873,7 @@ struct pusch_cfg_ded_v1130_s { assert_choice_type("setup", type_.to_string(), "pusch-DMRS-r11"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6857,6 +6933,7 @@ struct pusch_cfg_ded_v1250_s { assert_choice_type("setup", type_.to_string(), "uciOnPUSCH"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6920,6 +6997,7 @@ struct pusch_cfg_ded_v1530_s { assert_choice_type("setup", type_.to_string(), "ce-PUSCH-FlexibleStartPRB-AllocConfig-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6957,6 +7035,7 @@ struct pusch_cfg_ded_v1530_s { assert_choice_type("setup", type_.to_string(), "ce-PUSCH-SubPRB-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7081,6 +7160,7 @@ struct pusch_enhance_cfg_r14_c { assert_choice_type("setup", type_.to_string(), "PUSCH-EnhancementsConfig-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7159,6 +7239,7 @@ struct phys_cfg_ded_stti_r15_c { assert_choice_type("setup", type_.to_string(), "PhysicalConfigDedicatedSTTI-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7205,6 +7286,7 @@ struct spucch_cfg_v1550_c { assert_choice_type("setup", type_.to_string(), "SPUCCH-Config-v1550"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7250,6 +7332,7 @@ struct srs_tpc_pdcch_cfg_r14_c { assert_choice_type("setup", type_.to_string(), "SRS-TPC-PDCCH-Config-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7298,6 +7381,7 @@ struct sched_request_cfg_c { assert_choice_type("setup", type_.to_string(), "SchedulingRequestConfig"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7379,6 +7463,7 @@ struct srs_ul_cfg_ded_c { assert_choice_type("setup", type_.to_string(), "SoundingRS-UL-ConfigDedicated"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7452,6 +7537,7 @@ struct srs_ul_cfg_ded_v1310_c { assert_choice_type("setup", type_.to_string(), "SoundingRS-UL-ConfigDedicated-v1310"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7496,6 +7582,7 @@ struct srs_ul_cfg_ded_aperiodic_r10_c { assert_choice_type("setup", type_.to_string(), "srs-ActivateAp-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7536,6 +7623,7 @@ struct srs_ul_cfg_ded_aperiodic_r10_c { assert_choice_type("setup", type_.to_string(), "SoundingRS-UL-ConfigDedicatedAperiodic-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7580,6 +7668,7 @@ struct srs_ul_cfg_ded_aperiodic_v1310_c { assert_choice_type("setup", type_.to_string(), "srs-ActivateAp-v1310"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7619,6 +7708,7 @@ struct srs_ul_cfg_ded_aperiodic_v1310_c { assert_choice_type("setup", type_.to_string(), "SoundingRS-UL-ConfigDedicatedAperiodic-v1310"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7669,6 +7759,7 @@ struct srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c { assert_choice_type("setup", type_.to_string(), "srs-ActivateAp-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7710,6 +7801,7 @@ struct srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c { assert_choice_type("setup", type_.to_string(), "SoundingRS-UL-ConfigDedicatedAperiodicUpPTsExt-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7799,6 +7891,7 @@ struct srs_ul_cfg_ded_up_pts_ext_r13_c { assert_choice_type("setup", type_.to_string(), "SoundingRS-UL-ConfigDedicatedUpPTsExt-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7897,6 +7990,7 @@ struct ul_pwr_ctrl_ded_v1250_s { assert_choice_type("setup", type_.to_string(), "set2PowerControlParameter"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7967,6 +8061,7 @@ struct phys_cfg_ded_s { set(types::explicit_value); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -8003,6 +8098,7 @@ struct phys_cfg_ded_s { set(types::explicit_value_r10); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -8032,6 +8128,7 @@ struct phys_cfg_ded_s { assert_choice_type("setup", type_.to_string(), "additionalSpectrumEmissionCA-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -8069,6 +8166,7 @@ struct phys_cfg_ded_s { assert_choice_type("setup", type_.to_string(), "ce-Mode-r13"); return c; } + void set_release() { set(types::release); } setup_e_& set_setup() { set(types::setup); @@ -8101,6 +8199,7 @@ struct phys_cfg_ded_s { assert_choice_type("setup", type_.to_string(), "typeA-SRS-TPC-PDCCH-Group-r14"); return c; } + void set_release() { set(types::release); } setup_l_& set_setup() { set(types::setup); @@ -8156,6 +8255,7 @@ struct phys_cfg_ded_s { assert_choice_type("setup", type_.to_string(), "must-Config-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -8247,6 +8347,7 @@ struct phys_cfg_ded_s { assert_choice_type("setup", type_.to_string(), "semiStaticCFI-Config-r15"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -8349,6 +8450,7 @@ struct phys_cfg_ded_s { assert_choice_type("setup", type_.to_string(), "blindPDSCH-Repetition-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); diff --git a/lib/include/srslte/asn1/rrc/rr_common.h b/lib/include/srslte/asn1/rrc/rr_common.h index 97367b293..200853cb5 100644 --- a/lib/include/srslte/asn1/rrc/rr_common.h +++ b/lib/include/srslte/asn1/rrc/rr_common.h @@ -284,47 +284,6 @@ struct tdd_cfg_v1130_s { bool operator!=(const tdd_cfg_v1130_s& other) const { return not(*this == other); } }; -// UplinkPowerControlCommon-v1310 ::= SEQUENCE -struct ul_pwr_ctrl_common_v1310_s { - struct delta_f_pucch_format4_r13_opts { - enum options { - delta_f16, - delta_f15, - delta_f14, - delta_f13, - delta_f12, - delta_f11, - delta_f10, - spare1, - nulltype - } value; - typedef uint8_t number_type; - - std::string to_string() const; - uint8_t to_number() const; - }; - typedef enumerated delta_f_pucch_format4_r13_e_; - struct delta_f_pucch_format5_minus13_opts { - enum options { delta_f13, delta_f12, delta_f11, delta_f10, delta_f9, delta_f8, delta_f7, spare1, nulltype } value; - typedef uint8_t number_type; - - std::string to_string() const; - uint8_t to_number() const; - }; - typedef enumerated delta_f_pucch_format5_minus13_e_; - - // member variables - bool delta_f_pucch_format4_r13_present = false; - bool delta_f_pucch_format5_minus13_present = false; - delta_f_pucch_format4_r13_e_ delta_f_pucch_format4_r13; - delta_f_pucch_format5_minus13_e_ delta_f_pucch_format5_minus13; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // PRACH-ParametersCE-r13 ::= SEQUENCE struct prach_params_ce_r13_s { struct prach_start_sf_r13_opts { @@ -713,6 +672,7 @@ struct delta_flist_spucch_r15_c { assert_choice_type("setup", type_.to_string(), "DeltaFList-SPUCCH-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1874,6 +1834,7 @@ struct srs_ul_cfg_common_c { assert_choice_type("setup", type_.to_string(), "SoundingRS-UL-ConfigCommon"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2433,6 +2394,47 @@ struct rr_cfg_common_scell_r10_s { bool operator!=(const rr_cfg_common_scell_r10_s& other) const { return not(*this == other); } }; +// UplinkPowerControlCommon-v1310 ::= SEQUENCE +struct ul_pwr_ctrl_common_v1310_s { + struct delta_f_pucch_format4_r13_opts { + enum options { + delta_f16, + delta_f15, + delta_f14, + delta_f13, + delta_f12, + delta_f11, + delta_f10, + spare1, + nulltype + } value; + typedef uint8_t number_type; + + std::string to_string() const; + uint8_t to_number() const; + }; + typedef enumerated delta_f_pucch_format4_r13_e_; + struct delta_f_pucch_format5_minus13_opts { + enum options { delta_f13, delta_f12, delta_f11, delta_f10, delta_f9, delta_f8, delta_f7, spare1, nulltype } value; + typedef uint8_t number_type; + + std::string to_string() const; + uint8_t to_number() const; + }; + typedef enumerated delta_f_pucch_format5_minus13_e_; + + // member variables + bool delta_f_pucch_format4_r13_present = false; + bool delta_f_pucch_format5_minus13_present = false; + delta_f_pucch_format4_r13_e_ delta_f_pucch_format4_r13; + delta_f_pucch_format5_minus13_e_ delta_f_pucch_format5_minus13; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // PRACH-Config-v1310 ::= SEQUENCE struct prach_cfg_v1310_s { struct mpdcch_start_sf_css_ra_r13_c_ { diff --git a/lib/include/srslte/asn1/rrc/rr_ded.h b/lib/include/srslte/asn1/rrc/rr_ded.h index 0b0866bf0..618b3c0c7 100644 --- a/lib/include/srslte/asn1/rrc/rr_ded.h +++ b/lib/include/srslte/asn1/rrc/rr_ded.h @@ -527,6 +527,7 @@ struct lc_ch_cfg_s { assert_choice_type("setup", type_.to_string(), "allowedTTI-Lengths-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -566,6 +567,7 @@ struct lc_ch_cfg_s { assert_choice_type("setup", type_.to_string(), "logicalChannelSR-Restriction-r15"); return c; } + void set_release() { set(types::release); } setup_e_& set_setup() { set(types::setup); @@ -599,6 +601,7 @@ struct lc_ch_cfg_s { assert_choice_type("setup", type_.to_string(), "channelAccessPriority-r15"); return c; } + void set_release() { set(types::release); } uint8_t& set_setup() { set(types::setup); @@ -986,6 +989,7 @@ struct pdcp_cfg_s { assert_choice_type("rohc", type_.to_string(), "headerCompression"); return c; } + void set_not_used() { set(types::not_used); } rohc_s_& set_rohc() { set(types::rohc); @@ -1087,6 +1091,7 @@ struct pdcp_cfg_s { assert_choice_type("setup", type_.to_string(), "ul-DataSplitThreshold-r13"); return c; } + void set_release() { set(types::release); } setup_e_& set_setup() { set(types::setup); @@ -1210,6 +1215,7 @@ struct pdcp_cfg_s { assert_choice_type("setup", type_.to_string(), "statusFeedback-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1275,6 +1281,7 @@ struct pdcp_cfg_s { assert_choice_type("setup", type_.to_string(), "ul-LWA-Config-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1325,6 +1332,7 @@ struct pdcp_cfg_s { assert_choice_type("rohc-r14", type_.to_string(), "uplinkOnlyHeaderCompression-r14"); return c; } + void set_not_used_r14() { set(types::not_used_r14); } rohc_r14_s_& set_rohc_r14() { set(types::rohc_r14); @@ -1392,6 +1400,7 @@ struct pdcp_cfg_s { assert_choice_type("setup", type_.to_string(), "pdcp-DuplicationConfig-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1532,6 +1541,7 @@ struct rlc_bearer_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "RLC-BearerConfig-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1702,6 +1712,7 @@ struct rlc_cfg_v1430_c { assert_choice_type("setup", type_.to_string(), "RLC-Config-v1430"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1738,25 +1749,11 @@ struct rlc_cfg_v1530_c { bool operator==(const rlc_cfg_v1530_c& other) const; bool operator!=(const rlc_cfg_v1530_c& other) const { return not(*this == other); } // getters - setup_s_& setup() - { - assert_choice_type("setup", type_.to_string(), "RLC-Config-v1530"); - return c; - } - const setup_s_& setup() const - { - assert_choice_type("setup", type_.to_string(), "RLC-Config-v1530"); - return c; - } - setup_s_& set_setup() - { - set(types::setup); - return c; - } + void set_release() { set(types::release); } + void set_setup() { set(types::setup); } private: - types type_; - setup_s_ c; + types type_; }; // SPS-ConfigSL-r14 ::= SEQUENCE @@ -1866,6 +1863,7 @@ struct sps_cfg_ul_c { assert_choice_type("setup", type_.to_string(), "p0-PersistentSubframeSet2-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1988,6 +1986,7 @@ struct sps_cfg_ul_c { assert_choice_type("setup", type_.to_string(), "SPS-ConfigUL"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2067,6 +2066,7 @@ struct sps_cfg_ul_stti_r15_c { assert_choice_type("setup", type_.to_string(), "p0-PersistentSubframeSet2-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2163,6 +2163,7 @@ struct sps_cfg_ul_stti_r15_c { assert_choice_type("setup", type_.to_string(), "SPS-ConfigUL-STTI-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -2684,6 +2685,7 @@ struct drx_cfg_c { assert_choice_type("setup", type_.to_string(), "DRX-Config"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3003,6 +3005,7 @@ struct sps_cfg_dl_c { assert_choice_type("setup", type_.to_string(), "twoAntennaPortActivated-r10"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3052,6 +3055,7 @@ struct sps_cfg_dl_c { assert_choice_type("setup", type_.to_string(), "SPS-ConfigDL"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3116,6 +3120,7 @@ struct sps_cfg_dl_stti_r15_c { assert_choice_type("setup", type_.to_string(), "twoAntennaPortActivated-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3158,6 +3163,7 @@ struct sps_cfg_dl_stti_r15_c { assert_choice_type("setup", type_.to_string(), "SPS-ConfigDL-STTI-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3228,6 +3234,7 @@ struct srb_to_add_mod_s { set(types::explicit_value); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -3266,6 +3273,7 @@ struct srb_to_add_mod_s { set(types::explicit_value); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -3387,6 +3395,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "phr-Config"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3445,6 +3454,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "dualConnectivityPHR"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3489,6 +3499,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "logicalChannelSR-Config-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3578,6 +3589,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "eDRX-Config-CycleStartOffset-r13"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -3609,6 +3621,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "drx-Config-r13"); return c; } + void set_release() { set(types::release); } drx_cfg_r13_s& set_setup() { set(types::setup); @@ -3644,6 +3657,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "skipUplinkTx-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3678,6 +3692,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "dataInactivityTimerConfig-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3753,6 +3768,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "shortTTI-AndSPT-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3826,6 +3842,7 @@ struct mac_main_cfg_s { assert_choice_type("setup", type_.to_string(), "dormantStateTimers-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3907,6 +3924,7 @@ struct meas_sf_pattern_pcell_r10_c { assert_choice_type("setup", type_.to_string(), "MeasSubframePatternPCell-r10"); return c; } + void set_release() { set(types::release); } meas_sf_pattern_r10_c& set_setup() { set(types::setup); @@ -3950,6 +3968,7 @@ struct naics_assist_info_r12_c { assert_choice_type("setup", type_.to_string(), "NAICS-AssistanceInfo-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -3983,6 +4002,7 @@ struct neigh_cells_crs_info_r11_c { assert_choice_type("setup", type_.to_string(), "NeighCellsCRS-Info-r11"); return c; } + void set_release() { set(types::release); } crs_assist_info_list_r11_l& set_setup() { set(types::setup); @@ -4018,6 +4038,7 @@ struct neigh_cells_crs_info_r13_c { assert_choice_type("setup", type_.to_string(), "NeighCellsCRS-Info-r13"); return c; } + void set_release() { set(types::release); } crs_assist_info_list_r13_l& set_setup() { set(types::setup); @@ -4053,6 +4074,7 @@ struct neigh_cells_crs_info_r15_c { assert_choice_type("setup", type_.to_string(), "NeighCellsCRS-Info-r15"); return c; } + void set_release() { set(types::release); } crs_assist_info_list_r15_l& set_setup() { set(types::setup); @@ -4117,6 +4139,7 @@ struct rlf_timers_and_consts_r13_c { assert_choice_type("setup", type_.to_string(), "RLF-TimersAndConstants-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4201,6 +4224,7 @@ struct rlf_timers_and_consts_r9_c { assert_choice_type("setup", type_.to_string(), "RLF-TimersAndConstants-r9"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4321,6 +4345,7 @@ struct rr_cfg_ded_s { set(types::explicit_value); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -4361,6 +4386,7 @@ struct rr_cfg_ded_s { assert_choice_type("crs-IntfMitigNumPRBs", type_.to_string(), "setup"); return c; } + void set_crs_intf_mitig_enabled() { set(types::crs_intf_mitig_enabled); } crs_intf_mitig_num_prbs_e_& set_crs_intf_mitig_num_prbs() { set(types::crs_intf_mitig_num_prbs); @@ -4391,6 +4417,7 @@ struct rr_cfg_ded_s { assert_choice_type("setup", type_.to_string(), "crs-IntfMitigConfig-r15"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -4491,6 +4518,7 @@ struct pdcch_candidate_reductions_laa_ul_r14_c { assert_choice_type("setup", type_.to_string(), "PDCCH-CandidateReductionsLAA-UL-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4601,6 +4629,7 @@ struct aul_cfg_r15_c { assert_choice_type("setup", type_.to_string(), "AUL-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4642,6 +4671,7 @@ struct cqi_report_periodic_scell_r15_c { assert_choice_type("setup", type_.to_string(), "csi-SubframePatternDormant-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4770,6 +4800,7 @@ struct cqi_report_periodic_scell_r15_c { assert_choice_type("setup", type_.to_string(), "CQI-ReportPeriodicSCell-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -4939,6 +4970,7 @@ struct srs_ul_cfg_ded_aperiodic_v1430_c { assert_choice_type("setup", type_.to_string(), "SoundingRS-UL-ConfigDedicatedAperiodic-v1430"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5111,6 +5143,7 @@ struct cqi_short_cfg_scell_r15_c { assert_choice_type("setup", type_.to_string(), "CQI-ShortConfigSCell-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5333,6 +5366,7 @@ struct laa_scell_cfg_v1430_s { assert_choice_type("setup", type_.to_string(), "crossCarrierSchedulingConfig-UL-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5427,6 +5461,7 @@ struct pucch_cfg_ded_v1370_s { assert_choice_type("setup", type_.to_string(), "pucch-Format-v1370"); return c; } + void set_release() { set(types::release); } pucch_format3_conf_r13_s& set_setup() { set(types::setup); @@ -5503,6 +5538,7 @@ struct pusch_cfg_ded_scell_v1530_s { assert_choice_type("setup", type_.to_string(), "uci-OnPUSCH-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5566,6 +5602,7 @@ struct sched_request_cfg_scell_r13_c { assert_choice_type("setup", type_.to_string(), "SchedulingRequestConfigSCell-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5638,6 +5675,7 @@ struct tpc_pdcch_cfg_scell_r13_c { assert_choice_type("setup", type_.to_string(), "TPC-PDCCH-ConfigSCell-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5793,6 +5831,7 @@ struct phys_cfg_ded_scell_r10_s { assert_choice_type("setup", type_.to_string(), "pucch-SCell"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5854,6 +5893,7 @@ struct phys_cfg_ded_scell_r10_s { assert_choice_type("setup", type_.to_string(), "must-Config-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -5945,6 +5985,7 @@ struct phys_cfg_ded_scell_r10_s { assert_choice_type("setup", type_.to_string(), "semiStaticCFI-Config-r15"); return c; } + void set_release() { set(types::release); } setup_c_& set_setup() { set(types::setup); @@ -6049,6 +6090,7 @@ struct phys_cfg_ded_scell_r10_s { assert_choice_type("setup", type_.to_string(), "blindPDSCH-Repetition-Config-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6172,6 +6214,7 @@ struct phys_cfg_ded_scell_v1370_s { assert_choice_type("setup", type_.to_string(), "pucch-SCell-v1370"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6217,60 +6260,6 @@ struct ant_info_ded_v10i0_s { bool operator!=(const ant_info_ded_v10i0_s& other) const { return not(*this == other); } }; -// PUCCH-ConfigDedicated-v13c0 ::= SEQUENCE -struct pucch_cfg_ded_v13c0_s { - struct ch_sel_v13c0_s_ { - struct n1_pucch_an_cs_v13c0_c_ { - struct setup_s_ { - using n1_pucch_an_cs_list_p1_v13c0_l_ = bounded_array; - - // member variables - n1_pucch_an_cs_list_p1_v13c0_l_ n1_pucch_an_cs_list_p1_v13c0; - }; - typedef setup_e types; - - // choice methods - n1_pucch_an_cs_v13c0_c_() = default; - void set(types::options e = types::nulltype); - types type() const { return type_; } - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; - // getters - setup_s_& setup() - { - assert_choice_type("setup", type_.to_string(), "n1PUCCH-AN-CS-v13c0"); - return c; - } - const setup_s_& setup() const - { - assert_choice_type("setup", type_.to_string(), "n1PUCCH-AN-CS-v13c0"); - return c; - } - setup_s_& set_setup() - { - set(types::setup); - return c; - } - - private: - types type_; - setup_s_ c; - }; - - // member variables - n1_pucch_an_cs_v13c0_c_ n1_pucch_an_cs_v13c0; - }; - - // member variables - ch_sel_v13c0_s_ ch_sel_v13c0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RadioResourceConfigDedicatedSCell-r10 ::= SEQUENCE struct rr_cfg_ded_scell_r10_s { bool ext = false; @@ -6299,52 +6288,6 @@ struct rr_cfg_ded_scell_r10_s { bool operator!=(const rr_cfg_ded_scell_r10_s& other) const { return not(*this == other); } }; -// PhysicalConfigDedicatedSCell-v13c0 ::= SEQUENCE -struct phys_cfg_ded_scell_v13c0_s { - struct pucch_scell_v13c0_c_ { - struct setup_s_ { - pucch_cfg_ded_v13c0_s pucch_cfg_ded_v13c0; - }; - typedef setup_e types; - - // choice methods - pucch_scell_v13c0_c_() = default; - void set(types::options e = types::nulltype); - types type() const { return type_; } - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; - // getters - setup_s_& setup() - { - assert_choice_type("setup", type_.to_string(), "pucch-SCell-v13c0"); - return c; - } - const setup_s_& setup() const - { - assert_choice_type("setup", type_.to_string(), "pucch-SCell-v13c0"); - return c; - } - setup_s_& set_setup() - { - set(types::setup); - return c; - } - - private: - types type_; - setup_s_ c; - }; - - // member variables - pucch_scell_v13c0_c_ pucch_scell_v13c0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SCellToAddModExt-r13 ::= SEQUENCE struct scell_to_add_mod_ext_r13_s { struct cell_identif_r13_s_ { @@ -6369,23 +6312,57 @@ struct scell_to_add_mod_ext_r13_s { void to_json(json_writer& j) const; }; -// RadioResourceConfigDedicatedSCell-v13c0 ::= SEQUENCE -struct rr_cfg_ded_scell_v13c0_s { - phys_cfg_ded_scell_v13c0_s phys_cfg_ded_scell_v13c0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SCellToAddModListExt-r13 ::= SEQUENCE (SIZE (1..31)) OF SCellToAddModExt-r13 using scell_to_add_mod_list_ext_r13_l = dyn_array; -// SCellToAddMod-v13c0 ::= SEQUENCE -struct scell_to_add_mod_v13c0_s { - bool rr_cfg_ded_scell_v13c0_present = false; - rr_cfg_ded_scell_v13c0_s rr_cfg_ded_scell_v13c0; +// PUCCH-ConfigDedicated-v13c0 ::= SEQUENCE +struct pucch_cfg_ded_v13c0_s { + struct ch_sel_v13c0_s_ { + struct n1_pucch_an_cs_v13c0_c_ { + struct setup_s_ { + using n1_pucch_an_cs_list_p1_v13c0_l_ = bounded_array; + + // member variables + n1_pucch_an_cs_list_p1_v13c0_l_ n1_pucch_an_cs_list_p1_v13c0; + }; + typedef setup_e types; + + // choice methods + n1_pucch_an_cs_v13c0_c_() = default; + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + setup_s_& setup() + { + assert_choice_type("setup", type_.to_string(), "n1PUCCH-AN-CS-v13c0"); + return c; + } + const setup_s_& setup() const + { + assert_choice_type("setup", type_.to_string(), "n1PUCCH-AN-CS-v13c0"); + return c; + } + void set_release() { set(types::release); } + setup_s_& set_setup() + { + set(types::setup); + return c; + } + + private: + types type_; + setup_s_ c; + }; + + // member variables + n1_pucch_an_cs_v13c0_c_ n1_pucch_an_cs_v13c0; + }; + + // member variables + ch_sel_v13c0_s_ ch_sel_v13c0; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -6427,6 +6404,7 @@ struct drb_to_add_mod_scg_r12_s { assert_choice_type("scg-r12", type_.to_string(), "drb-Type-r12"); return c; } + void set_split_r12() { set(types::split_r12); } scg_r12_s_& set_scg_r12() { set(types::scg_r12); @@ -6493,12 +6471,6 @@ struct rr_cfg_common_scell_v10l0_s { void to_json(json_writer& j) const; }; -// SCellToAddModList-v13c0 ::= SEQUENCE (SIZE (1..4)) OF SCellToAddMod-v13c0 -using scell_to_add_mod_list_v13c0_l = dyn_array; - -// SCellToAddModListExt-v13c0 ::= SEQUENCE (SIZE (1..31)) OF SCellToAddMod-v13c0 -using scell_to_add_mod_list_ext_v13c0_l = dyn_array; - // DRB-ToAddModListSCG-r12 ::= SEQUENCE (SIZE (1..11)) OF DRB-ToAddModSCG-r12 using drb_to_add_mod_list_scg_r12_l = dyn_array; @@ -6560,6 +6532,7 @@ struct rlf_timers_and_consts_scg_r12_c { assert_choice_type("setup", type_.to_string(), "RLF-TimersAndConstantsSCG-r12"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -6614,17 +6587,6 @@ struct scell_to_add_mod_r10_s { bool operator!=(const scell_to_add_mod_r10_s& other) const { return not(*this == other); } }; -// SCellToAddMod-v10l0 ::= SEQUENCE -struct scell_to_add_mod_v10l0_s { - bool rr_cfg_common_scell_v10l0_present = false; - rr_cfg_common_scell_v10l0_s rr_cfg_common_scell_v10l0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SCellToAddModExt-v1370 ::= SEQUENCE struct scell_to_add_mod_ext_v1370_s { bool rr_cfg_common_scell_v1370_present = false; @@ -6663,16 +6625,6 @@ struct scell_to_add_mod_ext_v1430_s { // SRB-ToReleaseList-r15 ::= SEQUENCE (SIZE (1..2)) OF INTEGER (1..2) using srb_to_release_list_r15_l = bounded_array; -// RadioResourceConfigDedicated-v13c0 ::= SEQUENCE -struct rr_cfg_ded_v13c0_s { - phys_cfg_ded_v13c0_s phys_cfg_ded_v13c0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RadioResourceConfigDedicatedSCG-r12 ::= SEQUENCE struct rr_cfg_ded_scg_r12_s { bool ext = false; @@ -6700,15 +6652,110 @@ struct rr_cfg_ded_scg_r12_s { // SCellToAddModList-r10 ::= SEQUENCE (SIZE (1..4)) OF SCellToAddMod-r10 using scell_to_add_mod_list_r10_l = dyn_array; -// SCellToAddModList-v10l0 ::= SEQUENCE (SIZE (1..4)) OF SCellToAddMod-v10l0 -using scell_to_add_mod_list_v10l0_l = dyn_array; - // SCellToAddModListExt-v1370 ::= SEQUENCE (SIZE (1..31)) OF SCellToAddModExt-v1370 using scell_to_add_mod_list_ext_v1370_l = dyn_array; // SCellToAddModListExt-v1430 ::= SEQUENCE (SIZE (1..31)) OF SCellToAddModExt-v1430 using scell_to_add_mod_list_ext_v1430_l = dyn_array; +// PhysicalConfigDedicatedSCell-v13c0 ::= SEQUENCE +struct phys_cfg_ded_scell_v13c0_s { + struct pucch_scell_v13c0_c_ { + struct setup_s_ { + pucch_cfg_ded_v13c0_s pucch_cfg_ded_v13c0; + }; + typedef setup_e types; + + // choice methods + pucch_scell_v13c0_c_() = default; + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + setup_s_& setup() + { + assert_choice_type("setup", type_.to_string(), "pucch-SCell-v13c0"); + return c; + } + const setup_s_& setup() const + { + assert_choice_type("setup", type_.to_string(), "pucch-SCell-v13c0"); + return c; + } + void set_release() { set(types::release); } + setup_s_& set_setup() + { + set(types::setup); + return c; + } + + private: + types type_; + setup_s_ c; + }; + + // member variables + pucch_scell_v13c0_c_ pucch_scell_v13c0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RadioResourceConfigDedicatedSCell-v13c0 ::= SEQUENCE +struct rr_cfg_ded_scell_v13c0_s { + phys_cfg_ded_scell_v13c0_s phys_cfg_ded_scell_v13c0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SCellToAddMod-v13c0 ::= SEQUENCE +struct scell_to_add_mod_v13c0_s { + bool rr_cfg_ded_scell_v13c0_present = false; + rr_cfg_ded_scell_v13c0_s rr_cfg_ded_scell_v13c0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SCellToAddModList-v13c0 ::= SEQUENCE (SIZE (1..4)) OF SCellToAddMod-v13c0 +using scell_to_add_mod_list_v13c0_l = dyn_array; + +// SCellToAddModListExt-v13c0 ::= SEQUENCE (SIZE (1..31)) OF SCellToAddMod-v13c0 +using scell_to_add_mod_list_ext_v13c0_l = dyn_array; + +// SCellToAddMod-v10l0 ::= SEQUENCE +struct scell_to_add_mod_v10l0_s { + bool rr_cfg_common_scell_v10l0_present = false; + rr_cfg_common_scell_v10l0_s rr_cfg_common_scell_v10l0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RadioResourceConfigDedicated-v13c0 ::= SEQUENCE +struct rr_cfg_ded_v13c0_s { + phys_cfg_ded_v13c0_s phys_cfg_ded_v13c0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// SCellToAddModList-v10l0 ::= SEQUENCE (SIZE (1..4)) OF SCellToAddMod-v10l0 +using scell_to_add_mod_list_v10l0_l = dyn_array; + // Cell-ToAddMod-r12 ::= SEQUENCE struct cell_to_add_mod_r12_s { struct cell_identif_r12_s_ { diff --git a/lib/include/srslte/asn1/rrc/security.h b/lib/include/srslte/asn1/rrc/security.h index d0ec07865..831ea1295 100644 --- a/lib/include/srslte/asn1/rrc/security.h +++ b/lib/include/srslte/asn1/rrc/security.h @@ -300,6 +300,9 @@ struct security_mode_cmd_s { set(types::security_mode_cmd_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -309,9 +312,6 @@ struct security_mode_cmd_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -321,24 +321,23 @@ struct security_mode_cmd_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -409,9 +408,6 @@ struct security_mode_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -421,24 +417,23 @@ struct security_mode_complete_s { security_mode_complete_r8_ies_s& security_mode_complete_r8() { assert_choice_type("securityModeComplete-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const security_mode_complete_r8_ies_s& security_mode_complete_r8() const { assert_choice_type("securityModeComplete-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } security_mode_complete_r8_ies_s& set_security_mode_complete_r8() { set(types::security_mode_complete_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + security_mode_complete_r8_ies_s c; }; // member variables @@ -463,9 +458,6 @@ struct security_mode_fail_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -475,24 +467,23 @@ struct security_mode_fail_s { security_mode_fail_r8_ies_s& security_mode_fail_r8() { assert_choice_type("securityModeFailure-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const security_mode_fail_r8_ies_s& security_mode_fail_r8() const { assert_choice_type("securityModeFailure-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } security_mode_fail_r8_ies_s& set_security_mode_fail_r8() { set(types::security_mode_fail_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + security_mode_fail_r8_ies_s c; }; // member variables diff --git a/lib/include/srslte/asn1/rrc/si.h b/lib/include/srslte/asn1/rrc/si.h index 93e4b2823..2d223f223 100644 --- a/lib/include/srslte/asn1/rrc/si.h +++ b/lib/include/srslte/asn1/rrc/si.h @@ -263,6 +263,7 @@ struct sib_type1_v1530_ies_s { assert_choice_type("crs-IntfMitigNumPRBs", type_.to_string(), "crs-IntfMitigConfig-r15"); return c; } + void set_crs_intf_mitig_enabled() { set(types::crs_intf_mitig_enabled); } crs_intf_mitig_num_prbs_e_& set_crs_intf_mitig_num_prbs() { set(types::crs_intf_mitig_num_prbs); @@ -336,9 +337,12 @@ struct cell_access_related_info_r14_s { void to_json(json_writer& j) const; }; -// CellSelectionInfoCE1-v1360 ::= SEQUENCE -struct cell_sel_info_ce1_v1360_s { - int8_t delta_rx_lev_min_ce1_v1360 = -8; +// SystemInformationBlockType1-v1450-IEs ::= SEQUENCE +struct sib_type1_v1450_ies_s { + bool tdd_cfg_v1450_present = false; + bool non_crit_ext_present = false; + tdd_cfg_v1450_s tdd_cfg_v1450; + sib_type1_v1530_ies_s non_crit_ext; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -346,22 +350,9 @@ struct cell_sel_info_ce1_v1360_s { void to_json(json_writer& j) const; }; -// SI-Periodicity-r12 ::= ENUMERATED -struct si_periodicity_r12_opts { - enum options { rf8, rf16, rf32, rf64, rf128, rf256, rf512, nulltype } value; - typedef uint16_t number_type; - - std::string to_string() const; - uint16_t to_number() const; -}; -typedef enumerated si_periodicity_r12_e; - -// SystemInformationBlockType1-v1450-IEs ::= SEQUENCE -struct sib_type1_v1450_ies_s { - bool tdd_cfg_v1450_present = false; - bool non_crit_ext_present = false; - tdd_cfg_v1450_s tdd_cfg_v1450; - sib_type1_v1530_ies_s non_crit_ext; +// CellSelectionInfoCE1-v1360 ::= SEQUENCE +struct cell_sel_info_ce1_v1360_s { + int8_t delta_rx_lev_min_ce1_v1360 = -8; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -1040,6 +1031,16 @@ struct cell_sel_info_v920_s { // PLMN-InfoList-r15 ::= SEQUENCE (SIZE (1..6)) OF PLMN-Info-r15 using plmn_info_list_r15_l = dyn_array; +// SI-Periodicity-r12 ::= ENUMERATED +struct si_periodicity_r12_opts { + enum options { rf8, rf16, rf32, rf64, rf128, rf256, rf512, nulltype } value; + typedef uint16_t number_type; + + std::string to_string() const; + uint16_t to_number() const; +}; +typedef enumerated si_periodicity_r12_e; + // SIB-MappingInfo ::= SEQUENCE (SIZE (0..31)) OF SIB-Type using sib_map_info_l = bounded_array; diff --git a/lib/include/srslte/asn1/rrc/uecap.h b/lib/include/srslte/asn1/rrc/uecap.h index 4d05fd6d9..3b66bd2ab 100644 --- a/lib/include/srslte/asn1/rrc/uecap.h +++ b/lib/include/srslte/asn1/rrc/uecap.h @@ -225,6 +225,9 @@ struct ue_cap_enquiry_s { set(types::ue_cap_enquiry_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -234,9 +237,6 @@ struct ue_cap_enquiry_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -246,24 +246,23 @@ struct ue_cap_enquiry_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -403,6 +402,13 @@ struct ue_cap_info_s { set(types::ue_cap_info_r8); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -412,9 +418,6 @@ struct ue_cap_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -424,24 +427,23 @@ struct ue_cap_info_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -3326,10 +3328,9 @@ struct phy_layer_params_v1540_s { struct stti_spt_cap_v1540_s_ {}; // member variables - bool stti_spt_cap_v1540_present = false; - bool crs_im_tm1_to_tm9_one_rx_port_v1540_present = false; - bool cch_im_ref_rec_type_a_one_rx_port_v1540_present = false; - stti_spt_cap_v1540_s_ stti_spt_cap_v1540; + bool stti_spt_cap_v1540_present = false; + bool crs_im_tm1_to_tm9_one_rx_port_v1540_present = false; + bool cch_im_ref_rec_type_a_one_rx_port_v1540_present = false; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -4061,16 +4062,6 @@ struct pdcp_params_v1430_s { void to_json(json_writer& j) const; }; -// PhyLayerParameters-v14a0 ::= SEQUENCE -struct phy_layer_params_v14a0_s { - bool ssp10_tdd_only_r14_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RLC-Parameters-v1430 ::= SEQUENCE struct rlc_params_v1430_s { bool extended_poll_byte_r14_present = false; @@ -4104,18 +4095,6 @@ struct ue_eutra_cap_v1440_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v14b0-IEs ::= SEQUENCE -struct ue_eutra_cap_v14b0_ies_s { - bool rf_params_v14b0_present = false; - bool non_crit_ext_present = false; - rf_params_v14b0_s rf_params_v14b0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-CapabilityAddXDD-Mode-v1430 ::= SEQUENCE struct ue_eutra_cap_add_xdd_mode_v1430_s { bool phy_layer_params_v1430_present = false; @@ -4129,74 +4108,6 @@ struct ue_eutra_cap_add_xdd_mode_v1430_s { void to_json(json_writer& j) const; }; -// MBMS-Parameters-v1470 ::= SEQUENCE -struct mbms_params_v1470_s { - struct mbms_max_bw_r14_c_ { - struct types_opts { - enum options { implicit_value, explicit_value, nulltype } value; - - std::string to_string() const; - }; - typedef enumerated types; - - // choice methods - mbms_max_bw_r14_c_() = default; - void set(types::options e = types::nulltype); - types type() const { return type_; } - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; - // getters - uint8_t& explicit_value() - { - assert_choice_type("explicitValue", type_.to_string(), "mbms-MaxBW-r14"); - return c; - } - const uint8_t& explicit_value() const - { - assert_choice_type("explicitValue", type_.to_string(), "mbms-MaxBW-r14"); - return c; - } - uint8_t& set_explicit_value() - { - set(types::explicit_value); - return c; - } - - private: - types type_; - uint8_t c; - }; - struct mbms_scaling_factor1dot25_r14_opts { - enum options { n3, n6, n9, n12, nulltype } value; - typedef uint8_t number_type; - - std::string to_string() const; - uint8_t to_number() const; - }; - typedef enumerated mbms_scaling_factor1dot25_r14_e_; - struct mbms_scaling_factor7dot5_r14_opts { - enum options { n1, n2, n3, n4, nulltype } value; - typedef uint8_t number_type; - - std::string to_string() const; - uint8_t to_number() const; - }; - typedef enumerated mbms_scaling_factor7dot5_r14_e_; - - // member variables - bool mbms_scaling_factor1dot25_r14_present = false; - bool mbms_scaling_factor7dot5_r14_present = false; - mbms_max_bw_r14_c_ mbms_max_bw_r14; - mbms_scaling_factor1dot25_r14_e_ mbms_scaling_factor1dot25_r14; - mbms_scaling_factor7dot5_r14_e_ mbms_scaling_factor7dot5_r14; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // Other-Parameters-v1360 ::= SEQUENCE struct other_params_v1360_s { bool in_dev_coex_ind_hardware_sharing_ind_r13_present = false; @@ -4266,18 +4177,6 @@ struct ue_eutra_cap_v1430_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v14a0-IEs ::= SEQUENCE -struct ue_eutra_cap_v14a0_ies_s { - bool non_crit_ext_present = false; - phy_layer_params_v14a0_s phy_layer_params_v14a0; - ue_eutra_cap_v14b0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // CE-Parameters-v1350 ::= SEQUENCE struct ce_params_v1350_s { bool unicast_freq_hop_r13_present = false; @@ -4301,33 +4200,6 @@ struct ue_eutra_cap_v1360_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v1470-IEs ::= SEQUENCE -struct ue_eutra_cap_v1470_ies_s { - bool mbms_params_v1470_present = false; - bool phy_layer_params_v1470_present = false; - bool rf_params_v1470_present = false; - bool non_crit_ext_present = false; - mbms_params_v1470_s mbms_params_v1470; - phy_layer_params_v1470_s phy_layer_params_v1470; - rf_params_v1470_s rf_params_v1470; - ue_eutra_cap_v14a0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// CE-Parameters-v1380 ::= SEQUENCE -struct ce_params_v1380_s { - bool tm6_ce_mode_a_r13_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v1350-IEs ::= SEQUENCE struct ue_eutra_cap_v1350_ies_s { bool ue_category_dl_v1350_present = false; @@ -4342,30 +4214,6 @@ struct ue_eutra_cap_v1350_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v13e0a-IEs ::= SEQUENCE -struct ue_eutra_cap_v13e0a_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - ue_eutra_cap_v1470_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// CE-Parameters-v1370 ::= SEQUENCE -struct ce_params_v1370_s { - bool tm9_ce_mode_a_r13_present = false; - bool tm9_ce_mode_b_r13_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SCPTM-Parameters-r13 ::= SEQUENCE struct scptm_params_r13_s { bool scptm_parallel_reception_r13_present = false; @@ -4392,29 +4240,6 @@ struct ue_eutra_cap_v1340_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v1390-IEs ::= SEQUENCE -struct ue_eutra_cap_v1390_ies_s { - bool rf_params_v1390_present = false; - bool non_crit_ext_present = false; - rf_params_v1390_s rf_params_v1390; - ue_eutra_cap_v13e0a_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-EUTRA-CapabilityAddXDD-Mode-v1380 ::= SEQUENCE -struct ue_eutra_cap_add_xdd_mode_v1380_s { - ce_params_v1380_s ce_params_v1380; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // CE-Parameters-v1320 ::= SEQUENCE struct ce_params_v1320_s { bool intra_freq_a3_ce_mode_a_r13_present = false; @@ -4478,22 +4303,6 @@ struct ue_eutra_cap_v1330_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v1380-IEs ::= SEQUENCE -struct ue_eutra_cap_v1380_ies_s { - bool rf_params_v1380_present = false; - bool non_crit_ext_present = false; - rf_params_v1380_s rf_params_v1380; - ce_params_v1380_s ce_params_v1380; - ue_eutra_cap_add_xdd_mode_v1380_s fdd_add_ue_eutra_cap_v1380; - ue_eutra_cap_add_xdd_mode_v1380_s tdd_add_ue_eutra_cap_v1380; - ue_eutra_cap_v1390_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-CapabilityAddXDD-Mode-v1320 ::= SEQUENCE struct ue_eutra_cap_add_xdd_mode_v1320_s { bool phy_layer_params_v1320_present = false; @@ -4507,17 +4316,6 @@ struct ue_eutra_cap_add_xdd_mode_v1320_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-CapabilityAddXDD-Mode-v1370 ::= SEQUENCE -struct ue_eutra_cap_add_xdd_mode_v1370_s { - bool ce_params_v1370_present = false; - ce_params_v1370_s ce_params_v1370; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // CE-Parameters-r13 ::= SEQUENCE struct ce_params_r13_s { bool ce_mode_a_r13_present = false; @@ -4661,23 +4459,6 @@ struct ue_eutra_cap_v1320_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v1370-IEs ::= SEQUENCE -struct ue_eutra_cap_v1370_ies_s { - bool ce_params_v1370_present = false; - bool fdd_add_ue_eutra_cap_v1370_present = false; - bool tdd_add_ue_eutra_cap_v1370_present = false; - bool non_crit_ext_present = false; - ce_params_v1370_s ce_params_v1370; - ue_eutra_cap_add_xdd_mode_v1370_s fdd_add_ue_eutra_cap_v1370; - ue_eutra_cap_add_xdd_mode_v1370_s tdd_add_ue_eutra_cap_v1370; - ue_eutra_cap_v1380_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-CapabilityAddXDD-Mode-v1310 ::= SEQUENCE struct ue_eutra_cap_add_xdd_mode_v1310_s { bool phy_layer_params_v1310_present = false; @@ -4709,29 +4490,6 @@ struct phy_layer_params_v1280_s { void to_json(json_writer& j) const; }; -// RF-Parameters-v12b0 ::= SEQUENCE -struct rf_params_v12b0_s { - bool max_layers_mimo_ind_r12_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-EUTRA-Capability-v12x0-IEs ::= SEQUENCE -struct ue_eutra_cap_v12x0_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - ue_eutra_cap_v1370_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v1310-IEs ::= SEQUENCE struct ue_eutra_cap_v1310_ies_s { struct ue_category_dl_v1310_opts { @@ -4807,19 +4565,6 @@ struct ue_eutra_cap_v1280_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v12b0-IEs ::= SEQUENCE -struct ue_eutra_cap_v12b0_ies_s { - bool rf_params_v12b0_present = false; - bool non_crit_ext_present = false; - rf_params_v12b0_s rf_params_v12b0; - ue_eutra_cap_v12x0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // MeasParameters-v1250 ::= SEQUENCE struct meas_params_v1250_s { bool timer_t312_r12_present = false; @@ -4838,39 +4583,6 @@ struct meas_params_v1250_s { void to_json(json_writer& j) const; }; -// Other-Parameters-v11d0 ::= SEQUENCE -struct other_params_v11d0_s { - bool in_dev_coex_ind_ul_ca_r11_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// RF-Parameters-v10j0 ::= SEQUENCE -struct rf_params_v10j0_s { - bool multi_ns_pmax_r10_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-EUTRA-Capability-v11x0-IEs ::= SEQUENCE -struct ue_eutra_cap_v11x0_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - ue_eutra_cap_v12b0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v1270-IEs ::= SEQUENCE struct ue_eutra_cap_v1270_ies_s { bool rf_params_v1270_present = false; @@ -4932,33 +4644,6 @@ struct ue_based_netw_perf_meas_params_v1250_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v10j0-IEs ::= SEQUENCE -struct ue_eutra_cap_v10j0_ies_s { - bool rf_params_v10j0_present = false; - bool non_crit_ext_present = false; - rf_params_v10j0_s rf_params_v10j0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-EUTRA-Capability-v11d0-IEs ::= SEQUENCE -struct ue_eutra_cap_v11d0_ies_s { - bool rf_params_v11d0_present = false; - bool other_params_v11d0_present = false; - bool non_crit_ext_present = false; - rf_params_v11d0_s rf_params_v11d0; - other_params_v11d0_s other_params_v11d0; - ue_eutra_cap_v11x0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v1260-IEs ::= SEQUENCE struct ue_eutra_cap_v1260_ies_s { bool ue_category_dl_v1260_present = false; @@ -5017,32 +4702,6 @@ struct meas_params_v11a0_s { void to_json(json_writer& j) const; }; -// RF-Parameters-v10f0 ::= SEQUENCE -struct rf_params_v10f0_s { - bool modified_mpr_behavior_r10_present = false; - fixed_bitstring<32> modified_mpr_behavior_r10; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-EUTRA-Capability-v10i0-IEs ::= SEQUENCE -struct ue_eutra_cap_v10i0_ies_s { - bool rf_params_v10i0_present = false; - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - rf_params_v10i0_s rf_params_v10i0; - dyn_octstring late_non_crit_ext; - ue_eutra_cap_v11d0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v1250-IEs ::= SEQUENCE struct ue_eutra_cap_v1250_ies_s { bool phy_layer_params_v1250_present = false; @@ -5082,29 +4741,6 @@ struct ue_eutra_cap_v1250_ies_s { void to_json(json_writer& j) const; }; -// OTDOA-PositioningCapabilities-r10 ::= SEQUENCE -struct otdoa_positioning_cap_r10_s { - bool inter_freq_rstd_meas_r10_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-EUTRA-Capability-v10f0-IEs ::= SEQUENCE -struct ue_eutra_cap_v10f0_ies_s { - bool rf_params_v10f0_present = false; - bool non_crit_ext_present = false; - rf_params_v10f0_s rf_params_v10f0; - ue_eutra_cap_v10i0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v11a0-IEs ::= SEQUENCE struct ue_eutra_cap_v11a0_ies_s { bool ue_category_v11a0_present = false; @@ -5130,14 +4766,6 @@ struct ue_eutra_cap_add_xdd_mode_v1180_s { void to_json(json_writer& j) const; }; -// IRAT-ParametersUTRA-v9h0 ::= SEQUENCE -struct irat_params_utra_v9h0_s { - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // MeasParameters-v1130 ::= SEQUENCE struct meas_params_v1130_s { bool rsrq_meas_wideband_r11_present = false; @@ -5187,19 +4815,6 @@ struct phy_layer_params_v1170_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v10c0-IEs ::= SEQUENCE -struct ue_eutra_cap_v10c0_ies_s { - bool otdoa_positioning_cap_r10_present = false; - bool non_crit_ext_present = false; - otdoa_positioning_cap_r10_s otdoa_positioning_cap_r10; - ue_eutra_cap_v10f0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v1180-IEs ::= SEQUENCE struct ue_eutra_cap_v1180_ies_s { bool rf_params_v1180_present = false; @@ -5255,21 +4870,6 @@ struct ue_eutra_cap_v1170_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v9h0-IEs ::= SEQUENCE -struct ue_eutra_cap_v9h0_ies_s { - bool inter_rat_params_utra_v9h0_present = false; - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - irat_params_utra_v9h0_s inter_rat_params_utra_v9h0; - dyn_octstring late_non_crit_ext; - ue_eutra_cap_v10c0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-CapabilityAddXDD-Mode-v1130 ::= SEQUENCE struct ue_eutra_cap_add_xdd_mode_v1130_s { bool ext = false; @@ -5303,10 +4903,9 @@ struct irat_params_utra_tdd_v1020_s { void to_json(json_writer& j) const; }; -// PhyLayerParameters-v9d0 ::= SEQUENCE -struct phy_layer_params_v9d0_s { - bool tm5_fdd_r9_present = false; - bool tm5_tdd_r9_present = false; +// OTDOA-PositioningCapabilities-r10 ::= SEQUENCE +struct otdoa_positioning_cap_r10_s { + bool inter_freq_rstd_meas_r10_present = false; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -5336,75 +4935,6 @@ struct ue_eutra_cap_v1130_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v9e0-IEs ::= SEQUENCE -struct ue_eutra_cap_v9e0_ies_s { - bool rf_params_v9e0_present = false; - bool non_crit_ext_present = false; - rf_params_v9e0_s rf_params_v9e0; - ue_eutra_cap_v9h0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// IRAT-ParametersCDMA2000-1XRTT-v920 ::= SEQUENCE -struct irat_params_cdma2000_minus1_xrtt_v920_s { - bool e_csfb_conc_ps_mob1_xrtt_r9_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// IRAT-ParametersUTRA-v920 ::= SEQUENCE -struct irat_params_utra_v920_s { - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// IRAT-ParametersUTRA-v9c0 ::= SEQUENCE -struct irat_params_utra_v9c0_s { - bool voice_over_ps_hs_utra_fdd_r9_present = false; - bool voice_over_ps_hs_utra_tdd128_r9_present = false; - bool srvcc_from_utra_fdd_to_utra_fdd_r9_present = false; - bool srvcc_from_utra_fdd_to_geran_r9_present = false; - bool srvcc_from_utra_tdd128_to_utra_tdd128_r9_present = false; - bool srvcc_from_utra_tdd128_to_geran_r9_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// NeighCellSI-AcquisitionParameters-r9 ::= SEQUENCE -struct neigh_cell_si_acquisition_params_r9_s { - bool intra_freq_si_acquisition_for_ho_r9_present = false; - bool inter_freq_si_acquisition_for_ho_r9_present = false; - bool utran_si_acquisition_for_ho_r9_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// PhyLayerParameters ::= SEQUENCE -struct phy_layer_params_s { - bool ue_tx_ant_sel_supported = false; - bool ue_specific_ref_sigs_supported = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v1090-IEs ::= SEQUENCE struct ue_eutra_cap_v1090_ies_s { bool rf_params_v1090_present = false; @@ -5418,19 +4948,6 @@ struct ue_eutra_cap_v1090_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v9d0-IEs ::= SEQUENCE -struct ue_eutra_cap_v9d0_ies_s { - bool phy_layer_params_v9d0_present = false; - bool non_crit_ext_present = false; - phy_layer_params_v9d0_s phy_layer_params_v9d0; - ue_eutra_cap_v9e0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-CapabilityAddXDD-Mode-v1060 ::= SEQUENCE struct ue_eutra_cap_add_xdd_mode_v1060_s { bool ext = false; @@ -5480,44 +4997,6 @@ struct ue_eutra_cap_v1060_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v9c0-IEs ::= SEQUENCE -struct ue_eutra_cap_v9c0_ies_s { - bool inter_rat_params_utra_v9c0_present = false; - bool non_crit_ext_present = false; - irat_params_utra_v9c0_s inter_rat_params_utra_v9c0; - ue_eutra_cap_v9d0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-EUTRA-CapabilityAddXDD-Mode-r9 ::= SEQUENCE -struct ue_eutra_cap_add_xdd_mode_r9_s { - bool ext = false; - bool phy_layer_params_r9_present = false; - bool feature_group_inds_r9_present = false; - bool feature_group_ind_rel9_add_r9_present = false; - bool inter_rat_params_geran_r9_present = false; - bool inter_rat_params_utra_r9_present = false; - bool inter_rat_params_cdma2000_r9_present = false; - bool neigh_cell_si_acquisition_params_r9_present = false; - phy_layer_params_s phy_layer_params_r9; - fixed_bitstring<32> feature_group_inds_r9; - fixed_bitstring<32> feature_group_ind_rel9_add_r9; - irat_params_geran_s inter_rat_params_geran_r9; - irat_params_utra_v920_s inter_rat_params_utra_r9; - irat_params_cdma2000_minus1_xrtt_v920_s inter_rat_params_cdma2000_r9; - neigh_cell_si_acquisition_params_r9_s neigh_cell_si_acquisition_params_r9; - // ... - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // UE-EUTRA-Capability-v1020-IEs ::= SEQUENCE struct ue_eutra_cap_v1020_ies_s { bool ue_category_v1020_present = false; @@ -5545,16 +5024,11 @@ struct ue_eutra_cap_v1020_ies_s { void to_json(json_writer& j) const; }; -// UE-EUTRA-Capability-v9a0-IEs ::= SEQUENCE -struct ue_eutra_cap_v9a0_ies_s { - bool feature_group_ind_rel9_add_r9_present = false; - bool fdd_add_ue_eutra_cap_r9_present = false; - bool tdd_add_ue_eutra_cap_r9_present = false; - bool non_crit_ext_present = false; - fixed_bitstring<32> feature_group_ind_rel9_add_r9; - ue_eutra_cap_add_xdd_mode_r9_s fdd_add_ue_eutra_cap_r9; - ue_eutra_cap_add_xdd_mode_r9_s tdd_add_ue_eutra_cap_r9; - ue_eutra_cap_v9c0_ies_s non_crit_ext; +// CSG-ProximityIndicationParameters-r9 ::= SEQUENCE +struct csg_proximity_ind_params_r9_s { + bool intra_freq_proximity_ind_r9_present = false; + bool inter_freq_proximity_ind_r9_present = false; + bool utran_proximity_ind_r9_present = false; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -5562,11 +5036,9 @@ struct ue_eutra_cap_v9a0_ies_s { void to_json(json_writer& j) const; }; -// CSG-ProximityIndicationParameters-r9 ::= SEQUENCE -struct csg_proximity_ind_params_r9_s { - bool intra_freq_proximity_ind_r9_present = false; - bool inter_freq_proximity_ind_r9_present = false; - bool utran_proximity_ind_r9_present = false; +// IRAT-ParametersCDMA2000-1XRTT-v920 ::= SEQUENCE +struct irat_params_cdma2000_minus1_xrtt_v920_s { + bool e_csfb_conc_ps_mob1_xrtt_r9_present = false; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -5585,6 +5057,26 @@ struct irat_params_geran_v920_s { void to_json(json_writer& j) const; }; +// IRAT-ParametersUTRA-v920 ::= SEQUENCE +struct irat_params_utra_v920_s { + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// NeighCellSI-AcquisitionParameters-r9 ::= SEQUENCE +struct neigh_cell_si_acquisition_params_r9_s { + bool intra_freq_si_acquisition_for_ho_r9_present = false; + bool inter_freq_si_acquisition_for_ho_r9_present = false; + bool utran_si_acquisition_for_ho_r9_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // PhyLayerParameters-v920 ::= SEQUENCE struct phy_layer_params_v920_s { bool enhanced_dual_layer_fdd_r9_present = false; @@ -5629,6 +5121,17 @@ struct access_stratum_release_opts { }; typedef enumerated access_stratum_release_e; +// PhyLayerParameters ::= SEQUENCE +struct phy_layer_params_s { + bool ue_tx_ant_sel_supported = false; + bool ue_specific_ref_sigs_supported = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // UE-EUTRA-Capability-v920-IEs ::= SEQUENCE struct ue_eutra_cap_v920_ies_s { bool inter_rat_params_utra_v920_present = false; @@ -5688,10 +5191,9 @@ struct ue_eutra_cap_s { void to_json(json_writer& j) const; }; -// UERadioAccessCapabilityInformation-r8-IEs ::= SEQUENCE -struct ue_radio_access_cap_info_r8_ies_s { - bool non_crit_ext_present = false; - dyn_octstring ue_radio_access_cap_info; +// PhyLayerParameters-v14a0 ::= SEQUENCE +struct phy_layer_params_v14a0_s { + bool ssp10_tdd_only_r14_present = false; // sequence methods SRSASN_CODE pack(bit_ref& bref) const; @@ -5699,89 +5201,592 @@ struct ue_radio_access_cap_info_r8_ies_s { void to_json(json_writer& j) const; }; -// UERadioAccessCapabilityInformation ::= SEQUENCE -struct ue_radio_access_cap_info_s { - struct crit_exts_c_ { - struct c1_c_ { - struct types_opts { - enum options { - ue_radio_access_cap_info_r8, - spare7, - spare6, - spare5, - spare4, - spare3, - spare2, - spare1, - nulltype - } value; +// UE-EUTRA-Capability-v14b0-IEs ::= SEQUENCE +struct ue_eutra_cap_v14b0_ies_s { + bool rf_params_v14b0_present = false; + bool non_crit_ext_present = false; + rf_params_v14b0_s rf_params_v14b0; - std::string to_string() const; - }; - typedef enumerated types; + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; - // choice methods - c1_c_() = default; - void set(types::options e = types::nulltype); - types type() const { return type_; } - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; - // getters - ue_radio_access_cap_info_r8_ies_s& ue_radio_access_cap_info_r8() - { - assert_choice_type("ueRadioAccessCapabilityInformation-r8", type_.to_string(), "c1"); - return c; - } - const ue_radio_access_cap_info_r8_ies_s& ue_radio_access_cap_info_r8() const - { - assert_choice_type("ueRadioAccessCapabilityInformation-r8", type_.to_string(), "c1"); - return c; - } - ue_radio_access_cap_info_r8_ies_s& set_ue_radio_access_cap_info_r8() - { - set(types::ue_radio_access_cap_info_r8); - return c; - } +// MBMS-Parameters-v1470 ::= SEQUENCE +struct mbms_params_v1470_s { + struct mbms_max_bw_r14_c_ { + struct types_opts { + enum options { implicit_value, explicit_value, nulltype } value; - private: - types type_; - ue_radio_access_cap_info_r8_ies_s c; + std::string to_string() const; }; - typedef c1_or_crit_ext_e types; + typedef enumerated types; // choice methods - crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } + mbms_max_bw_r14_c_() = default; void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; SRSASN_CODE unpack(cbit_ref& bref); void to_json(json_writer& j) const; // getters - c1_c_& c1() + uint8_t& explicit_value() { - assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + assert_choice_type("explicitValue", type_.to_string(), "mbms-MaxBW-r14"); + return c; } - const c1_c_& c1() const + const uint8_t& explicit_value() const { - assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + assert_choice_type("explicitValue", type_.to_string(), "mbms-MaxBW-r14"); + return c; } - c1_c_& set_c1() + void set_implicit_value() { set(types::implicit_value); } + uint8_t& set_explicit_value() { - set(types::c1); - return c.get(); + set(types::explicit_value); + return c; } private: - types type_; - choice_buffer_t c; + types type_; + uint8_t c; + }; + struct mbms_scaling_factor1dot25_r14_opts { + enum options { n3, n6, n9, n12, nulltype } value; + typedef uint8_t number_type; + + std::string to_string() const; + uint8_t to_number() const; + }; + typedef enumerated mbms_scaling_factor1dot25_r14_e_; + struct mbms_scaling_factor7dot5_r14_opts { + enum options { n1, n2, n3, n4, nulltype } value; + typedef uint8_t number_type; + + std::string to_string() const; + uint8_t to_number() const; + }; + typedef enumerated mbms_scaling_factor7dot5_r14_e_; + + // member variables + bool mbms_scaling_factor1dot25_r14_present = false; + bool mbms_scaling_factor7dot5_r14_present = false; + mbms_max_bw_r14_c_ mbms_max_bw_r14; + mbms_scaling_factor1dot25_r14_e_ mbms_scaling_factor1dot25_r14; + mbms_scaling_factor7dot5_r14_e_ mbms_scaling_factor7dot5_r14; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v14a0-IEs ::= SEQUENCE +struct ue_eutra_cap_v14a0_ies_s { + bool non_crit_ext_present = false; + phy_layer_params_v14a0_s phy_layer_params_v14a0; + ue_eutra_cap_v14b0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v1470-IEs ::= SEQUENCE +struct ue_eutra_cap_v1470_ies_s { + bool mbms_params_v1470_present = false; + bool phy_layer_params_v1470_present = false; + bool rf_params_v1470_present = false; + bool non_crit_ext_present = false; + mbms_params_v1470_s mbms_params_v1470; + phy_layer_params_v1470_s phy_layer_params_v1470; + rf_params_v1470_s rf_params_v1470; + ue_eutra_cap_v14a0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// CE-Parameters-v1380 ::= SEQUENCE +struct ce_params_v1380_s { + bool tm6_ce_mode_a_r13_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v13e0a-IEs ::= SEQUENCE +struct ue_eutra_cap_v13e0a_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + ue_eutra_cap_v1470_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// CE-Parameters-v1370 ::= SEQUENCE +struct ce_params_v1370_s { + bool tm9_ce_mode_a_r13_present = false; + bool tm9_ce_mode_b_r13_present = false; - void destroy_(); + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v1390-IEs ::= SEQUENCE +struct ue_eutra_cap_v1390_ies_s { + bool rf_params_v1390_present = false; + bool non_crit_ext_present = false; + rf_params_v1390_s rf_params_v1390; + ue_eutra_cap_v13e0a_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-CapabilityAddXDD-Mode-v1380 ::= SEQUENCE +struct ue_eutra_cap_add_xdd_mode_v1380_s { + ce_params_v1380_s ce_params_v1380; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v1380-IEs ::= SEQUENCE +struct ue_eutra_cap_v1380_ies_s { + bool rf_params_v1380_present = false; + bool non_crit_ext_present = false; + rf_params_v1380_s rf_params_v1380; + ce_params_v1380_s ce_params_v1380; + ue_eutra_cap_add_xdd_mode_v1380_s fdd_add_ue_eutra_cap_v1380; + ue_eutra_cap_add_xdd_mode_v1380_s tdd_add_ue_eutra_cap_v1380; + ue_eutra_cap_v1390_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-CapabilityAddXDD-Mode-v1370 ::= SEQUENCE +struct ue_eutra_cap_add_xdd_mode_v1370_s { + bool ce_params_v1370_present = false; + ce_params_v1370_s ce_params_v1370; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v1370-IEs ::= SEQUENCE +struct ue_eutra_cap_v1370_ies_s { + bool ce_params_v1370_present = false; + bool fdd_add_ue_eutra_cap_v1370_present = false; + bool tdd_add_ue_eutra_cap_v1370_present = false; + bool non_crit_ext_present = false; + ce_params_v1370_s ce_params_v1370; + ue_eutra_cap_add_xdd_mode_v1370_s fdd_add_ue_eutra_cap_v1370; + ue_eutra_cap_add_xdd_mode_v1370_s tdd_add_ue_eutra_cap_v1370; + ue_eutra_cap_v1380_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RF-Parameters-v12b0 ::= SEQUENCE +struct rf_params_v12b0_s { + bool max_layers_mimo_ind_r12_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v12x0-IEs ::= SEQUENCE +struct ue_eutra_cap_v12x0_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + ue_eutra_cap_v1370_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v12b0-IEs ::= SEQUENCE +struct ue_eutra_cap_v12b0_ies_s { + bool rf_params_v12b0_present = false; + bool non_crit_ext_present = false; + rf_params_v12b0_s rf_params_v12b0; + ue_eutra_cap_v12x0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// Other-Parameters-v11d0 ::= SEQUENCE +struct other_params_v11d0_s { + bool in_dev_coex_ind_ul_ca_r11_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v11x0-IEs ::= SEQUENCE +struct ue_eutra_cap_v11x0_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + ue_eutra_cap_v12b0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v11d0-IEs ::= SEQUENCE +struct ue_eutra_cap_v11d0_ies_s { + bool rf_params_v11d0_present = false; + bool other_params_v11d0_present = false; + bool non_crit_ext_present = false; + rf_params_v11d0_s rf_params_v11d0; + other_params_v11d0_s other_params_v11d0; + ue_eutra_cap_v11x0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RF-Parameters-v10f0 ::= SEQUENCE +struct rf_params_v10f0_s { + bool modified_mpr_behavior_r10_present = false; + fixed_bitstring<32> modified_mpr_behavior_r10; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v10i0-IEs ::= SEQUENCE +struct ue_eutra_cap_v10i0_ies_s { + bool rf_params_v10i0_present = false; + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + rf_params_v10i0_s rf_params_v10i0; + dyn_octstring late_non_crit_ext; + ue_eutra_cap_v11d0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v10f0-IEs ::= SEQUENCE +struct ue_eutra_cap_v10f0_ies_s { + bool rf_params_v10f0_present = false; + bool non_crit_ext_present = false; + rf_params_v10f0_s rf_params_v10f0; + ue_eutra_cap_v10i0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v10c0-IEs ::= SEQUENCE +struct ue_eutra_cap_v10c0_ies_s { + bool otdoa_positioning_cap_r10_present = false; + bool non_crit_ext_present = false; + otdoa_positioning_cap_r10_s otdoa_positioning_cap_r10; + ue_eutra_cap_v10f0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RF-Parameters-v10j0 ::= SEQUENCE +struct rf_params_v10j0_s { + bool multi_ns_pmax_r10_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v10j0-IEs ::= SEQUENCE +struct ue_eutra_cap_v10j0_ies_s { + bool rf_params_v10j0_present = false; + bool non_crit_ext_present = false; + rf_params_v10j0_s rf_params_v10j0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// IRAT-ParametersUTRA-v9h0 ::= SEQUENCE +struct irat_params_utra_v9h0_s { + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v9h0-IEs ::= SEQUENCE +struct ue_eutra_cap_v9h0_ies_s { + bool inter_rat_params_utra_v9h0_present = false; + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + irat_params_utra_v9h0_s inter_rat_params_utra_v9h0; + dyn_octstring late_non_crit_ext; + ue_eutra_cap_v10c0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// PhyLayerParameters-v9d0 ::= SEQUENCE +struct phy_layer_params_v9d0_s { + bool tm5_fdd_r9_present = false; + bool tm5_tdd_r9_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v9e0-IEs ::= SEQUENCE +struct ue_eutra_cap_v9e0_ies_s { + bool rf_params_v9e0_present = false; + bool non_crit_ext_present = false; + rf_params_v9e0_s rf_params_v9e0; + ue_eutra_cap_v9h0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// IRAT-ParametersUTRA-v9c0 ::= SEQUENCE +struct irat_params_utra_v9c0_s { + bool voice_over_ps_hs_utra_fdd_r9_present = false; + bool voice_over_ps_hs_utra_tdd128_r9_present = false; + bool srvcc_from_utra_fdd_to_utra_fdd_r9_present = false; + bool srvcc_from_utra_fdd_to_geran_r9_present = false; + bool srvcc_from_utra_tdd128_to_utra_tdd128_r9_present = false; + bool srvcc_from_utra_tdd128_to_geran_r9_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v9d0-IEs ::= SEQUENCE +struct ue_eutra_cap_v9d0_ies_s { + bool phy_layer_params_v9d0_present = false; + bool non_crit_ext_present = false; + phy_layer_params_v9d0_s phy_layer_params_v9d0; + ue_eutra_cap_v9e0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v9c0-IEs ::= SEQUENCE +struct ue_eutra_cap_v9c0_ies_s { + bool inter_rat_params_utra_v9c0_present = false; + bool non_crit_ext_present = false; + irat_params_utra_v9c0_s inter_rat_params_utra_v9c0; + ue_eutra_cap_v9d0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-CapabilityAddXDD-Mode-r9 ::= SEQUENCE +struct ue_eutra_cap_add_xdd_mode_r9_s { + bool ext = false; + bool phy_layer_params_r9_present = false; + bool feature_group_inds_r9_present = false; + bool feature_group_ind_rel9_add_r9_present = false; + bool inter_rat_params_geran_r9_present = false; + bool inter_rat_params_utra_r9_present = false; + bool inter_rat_params_cdma2000_r9_present = false; + bool neigh_cell_si_acquisition_params_r9_present = false; + phy_layer_params_s phy_layer_params_r9; + fixed_bitstring<32> feature_group_inds_r9; + fixed_bitstring<32> feature_group_ind_rel9_add_r9; + irat_params_geran_s inter_rat_params_geran_r9; + irat_params_utra_v920_s inter_rat_params_utra_r9; + irat_params_cdma2000_minus1_xrtt_v920_s inter_rat_params_cdma2000_r9; + neigh_cell_si_acquisition_params_r9_s neigh_cell_si_acquisition_params_r9; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-EUTRA-Capability-v9a0-IEs ::= SEQUENCE +struct ue_eutra_cap_v9a0_ies_s { + bool feature_group_ind_rel9_add_r9_present = false; + bool fdd_add_ue_eutra_cap_r9_present = false; + bool tdd_add_ue_eutra_cap_r9_present = false; + bool non_crit_ext_present = false; + fixed_bitstring<32> feature_group_ind_rel9_add_r9; + ue_eutra_cap_add_xdd_mode_r9_s fdd_add_ue_eutra_cap_r9; + ue_eutra_cap_add_xdd_mode_r9_s tdd_add_ue_eutra_cap_r9; + ue_eutra_cap_v9c0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UERadioAccessCapabilityInformation-r8-IEs ::= SEQUENCE +struct ue_radio_access_cap_info_r8_ies_s { + bool non_crit_ext_present = false; + dyn_octstring ue_radio_access_cap_info; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UERadioAccessCapabilityInformation ::= SEQUENCE +struct ue_radio_access_cap_info_s { + struct crit_exts_c_ { + struct c1_c_ { + struct types_opts { + enum options { + ue_radio_access_cap_info_r8, + spare7, + spare6, + spare5, + spare4, + spare3, + spare2, + spare1, + nulltype + } value; + + std::string to_string() const; + }; + typedef enumerated types; + + // choice methods + c1_c_() = default; + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ue_radio_access_cap_info_r8_ies_s& ue_radio_access_cap_info_r8() + { + assert_choice_type("ueRadioAccessCapabilityInformation-r8", type_.to_string(), "c1"); + return c; + } + const ue_radio_access_cap_info_r8_ies_s& ue_radio_access_cap_info_r8() const + { + assert_choice_type("ueRadioAccessCapabilityInformation-r8", type_.to_string(), "c1"); + return c; + } + ue_radio_access_cap_info_r8_ies_s& set_ue_radio_access_cap_info_r8() + { + set(types::ue_radio_access_cap_info_r8); + return c; + } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } + + private: + types type_; + ue_radio_access_cap_info_r8_ies_s c; + }; + typedef c1_or_crit_ext_e types; + + // choice methods + crit_exts_c_() = default; + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + c1_c_& c1() + { + assert_choice_type("c1", type_.to_string(), "criticalExtensions"); + return c; + } + const c1_c_& c1() const + { + assert_choice_type("c1", type_.to_string(), "criticalExtensions"); + return c; + } + c1_c_& set_c1() + { + set(types::c1); + return c; + } + void set_crit_exts_future() { set(types::crit_exts_future); } + + private: + types type_; + c1_c_ c; }; // member variables diff --git a/lib/include/srslte/asn1/rrc/ul_ccch_msg.h b/lib/include/srslte/asn1/rrc/ul_ccch_msg.h index 5d7b0f13f..ceacd0b1a 100644 --- a/lib/include/srslte/asn1/rrc/ul_ccch_msg.h +++ b/lib/include/srslte/asn1/rrc/ul_ccch_msg.h @@ -462,9 +462,6 @@ struct rrc_conn_reest_request_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -474,24 +471,23 @@ struct rrc_conn_reest_request_s { rrc_conn_reest_request_r8_ies_s& rrc_conn_reest_request_r8() { assert_choice_type("rrcConnectionReestablishmentRequest-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_reest_request_r8_ies_s& rrc_conn_reest_request_r8() const { assert_choice_type("rrcConnectionReestablishmentRequest-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_reest_request_r8_ies_s& set_rrc_conn_reest_request_r8() { set(types::rrc_conn_reest_request_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_reest_request_r8_ies_s c; }; // member variables @@ -651,9 +647,6 @@ struct rrc_early_data_request_r15_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -663,24 +656,23 @@ struct rrc_early_data_request_r15_s { rrc_early_data_request_r15_ies_s& rrc_early_data_request_r15() { assert_choice_type("rrcEarlyDataRequest-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_early_data_request_r15_ies_s& rrc_early_data_request_r15() const { assert_choice_type("rrcEarlyDataRequest-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_early_data_request_r15_ies_s& set_rrc_early_data_request_r15() { set(types::rrc_early_data_request_r15); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_early_data_request_r15_ies_s c; }; // member variables @@ -803,6 +795,9 @@ struct ul_ccch_msg_type_c { set(types::rrc_early_data_request_r15); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -819,9 +814,6 @@ struct ul_ccch_msg_type_c { // choice methods msg_class_ext_future_r13_c_() = default; - msg_class_ext_future_r13_c_(const msg_class_ext_future_r13_c_& other); - msg_class_ext_future_r13_c_& operator=(const msg_class_ext_future_r13_c_& other); - ~msg_class_ext_future_r13_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -831,24 +823,23 @@ struct ul_ccch_msg_type_c { c3_c_& c3() { assert_choice_type("c3", type_.to_string(), "messageClassExtensionFuture-r13"); - return c.get(); + return c; } const c3_c_& c3() const { assert_choice_type("c3", type_.to_string(), "messageClassExtensionFuture-r13"); - return c.get(); + return c; } c3_c_& set_c3() { set(types::c3); - return c.get(); + return c; } + void set_msg_class_ext_future_r15() { set(types::msg_class_ext_future_r15); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c3_c_ c; }; struct types_opts { enum options { c2, msg_class_ext_future_r13, nulltype } value; diff --git a/lib/include/srslte/asn1/rrc/ul_dcch_msg.h b/lib/include/srslte/asn1/rrc/ul_dcch_msg.h index 5e76b092b..5cb9f3ad3 100644 --- a/lib/include/srslte/asn1/rrc/ul_dcch_msg.h +++ b/lib/include/srslte/asn1/rrc/ul_dcch_msg.h @@ -1068,16 +1068,6 @@ struct overheat_assist_r14_s { void to_json(json_writer& j) const; }; -// RLF-Report-v9e0 ::= SEQUENCE -struct rlf_report_v9e0_s { - meas_result_list2_eutra_v9e0_l meas_result_list_eutra_v9e0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // RRCConnectionReconfigurationComplete-v1130-IEs ::= SEQUENCE struct rrc_conn_recfg_complete_v1130_ies_s { bool conn_est_fail_info_available_r11_present = false; @@ -2053,18 +2043,6 @@ struct ue_info_resp_v1020_ies_s { void to_json(json_writer& j) const; }; -// UEInformationResponse-v9e0-IEs ::= SEQUENCE -struct ue_info_resp_v9e0_ies_s { - bool rlf_report_v9e0_present = false; - bool non_crit_ext_present = false; - rlf_report_v9e0_s rlf_report_v9e0; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // WLAN-Status-v1430 ::= ENUMERATED struct wlan_status_v1430_opts { enum options { suspended, resumed, nulltype } value; @@ -2940,6 +2918,7 @@ struct inter_freq_rstd_meas_ind_r10_ies_s { set(types::start); return c; } + void set_stop() { set(types::stop); } private: types type_; @@ -3420,9 +3399,6 @@ struct csfb_params_request_cdma2000_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -3432,24 +3408,23 @@ struct csfb_params_request_cdma2000_s { csfb_params_request_cdma2000_r8_ies_s& csfb_params_request_cdma2000_r8() { assert_choice_type("csfbParametersRequestCDMA2000-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const csfb_params_request_cdma2000_r8_ies_s& csfb_params_request_cdma2000_r8() const { assert_choice_type("csfbParametersRequestCDMA2000-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } csfb_params_request_cdma2000_r8_ies_s& set_csfb_params_request_cdma2000_r8() { set(types::csfb_params_request_cdma2000_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + csfb_params_request_cdma2000_r8_ies_s c; }; // member variables @@ -3473,9 +3448,6 @@ struct counter_check_resp_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -3485,24 +3457,23 @@ struct counter_check_resp_s { counter_check_resp_r8_ies_s& counter_check_resp_r8() { assert_choice_type("counterCheckResponse-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const counter_check_resp_r8_ies_s& counter_check_resp_r8() const { assert_choice_type("counterCheckResponse-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } counter_check_resp_r8_ies_s& set_counter_check_resp_r8() { set(types::counter_check_resp_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + counter_check_resp_r8_ies_s c; }; // member variables @@ -3560,6 +3531,9 @@ struct in_dev_coex_ind_r11_s { set(types::in_dev_coex_ind_r11); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -3569,9 +3543,6 @@ struct in_dev_coex_ind_r11_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -3581,24 +3552,23 @@ struct in_dev_coex_ind_r11_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -3644,6 +3614,9 @@ struct inter_freq_rstd_meas_ind_r10_s { set(types::inter_freq_rstd_meas_ind_r10); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -3653,9 +3626,6 @@ struct inter_freq_rstd_meas_ind_r10_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -3665,24 +3635,23 @@ struct inter_freq_rstd_meas_ind_r10_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -3728,6 +3697,9 @@ struct mbms_count_resp_r10_s { set(types::count_resp_r10); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -3737,9 +3709,6 @@ struct mbms_count_resp_r10_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -3749,24 +3718,23 @@ struct mbms_count_resp_r10_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -3812,6 +3780,9 @@ struct mbms_interest_ind_r11_s { set(types::interest_ind_r11); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -3821,9 +3792,6 @@ struct mbms_interest_ind_r11_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -3833,24 +3801,23 @@ struct mbms_interest_ind_r11_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -3874,9 +3841,6 @@ struct meas_report_app_layer_r15_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -3886,24 +3850,23 @@ struct meas_report_app_layer_r15_s { meas_report_app_layer_r15_ies_s& meas_report_app_layer_r15() { assert_choice_type("measReportAppLayer-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const meas_report_app_layer_r15_ies_s& meas_report_app_layer_r15() const { assert_choice_type("measReportAppLayer-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } meas_report_app_layer_r15_ies_s& set_meas_report_app_layer_r15() { set(types::meas_report_app_layer_r15); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + meas_report_app_layer_r15_ies_s c; }; // member variables @@ -3949,6 +3912,9 @@ struct proximity_ind_r9_s { set(types::proximity_ind_r9); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -3958,9 +3924,6 @@ struct proximity_ind_r9_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -3970,24 +3933,23 @@ struct proximity_ind_r9_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4033,6 +3995,9 @@ struct rn_recfg_complete_r10_s { set(types::rn_recfg_complete_r10); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4042,9 +4007,6 @@ struct rn_recfg_complete_r10_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4054,24 +4016,23 @@ struct rn_recfg_complete_r10_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4096,9 +4057,6 @@ struct rrc_conn_recfg_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4108,24 +4066,23 @@ struct rrc_conn_recfg_complete_s { rrc_conn_recfg_complete_r8_ies_s& rrc_conn_recfg_complete_r8() { assert_choice_type("rrcConnectionReconfigurationComplete-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_recfg_complete_r8_ies_s& rrc_conn_recfg_complete_r8() const { assert_choice_type("rrcConnectionReconfigurationComplete-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_recfg_complete_r8_ies_s& set_rrc_conn_recfg_complete_r8() { set(types::rrc_conn_recfg_complete_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_recfg_complete_r8_ies_s c; }; // member variables @@ -4150,9 +4107,6 @@ struct rrc_conn_reest_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4162,24 +4116,23 @@ struct rrc_conn_reest_complete_s { rrc_conn_reest_complete_r8_ies_s& rrc_conn_reest_complete_r8() { assert_choice_type("rrcConnectionReestablishmentComplete-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_reest_complete_r8_ies_s& rrc_conn_reest_complete_r8() const { assert_choice_type("rrcConnectionReestablishmentComplete-r8", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_reest_complete_r8_ies_s& set_rrc_conn_reest_complete_r8() { set(types::rrc_conn_reest_complete_r8); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_reest_complete_r8_ies_s c; }; // member variables @@ -4204,9 +4157,6 @@ struct rrc_conn_resume_complete_r13_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4216,24 +4166,23 @@ struct rrc_conn_resume_complete_r13_s { rrc_conn_resume_complete_r13_ies_s& rrc_conn_resume_complete_r13() { assert_choice_type("rrcConnectionResumeComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_resume_complete_r13_ies_s& rrc_conn_resume_complete_r13() const { assert_choice_type("rrcConnectionResumeComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_resume_complete_r13_ies_s& set_rrc_conn_resume_complete_r13() { set(types::rrc_conn_resume_complete_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_resume_complete_r13_ies_s c; }; // member variables @@ -4280,6 +4229,9 @@ struct rrc_conn_setup_complete_s { set(types::rrc_conn_setup_complete_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4289,9 +4241,6 @@ struct rrc_conn_setup_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4301,24 +4250,23 @@ struct rrc_conn_setup_complete_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4365,6 +4313,9 @@ struct scg_fail_info_r12_s { set(types::scg_fail_info_r12); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4374,9 +4325,6 @@ struct scg_fail_info_r12_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4386,24 +4334,23 @@ struct scg_fail_info_r12_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4449,6 +4396,9 @@ struct scg_fail_info_nr_r15_s { set(types::scg_fail_info_nr_r15); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4458,9 +4408,6 @@ struct scg_fail_info_nr_r15_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4470,24 +4417,23 @@ struct scg_fail_info_nr_r15_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4533,6 +4479,9 @@ struct sidelink_ue_info_r12_s { set(types::sidelink_ue_info_r12); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4542,9 +4491,6 @@ struct sidelink_ue_info_r12_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4554,24 +4500,23 @@ struct sidelink_ue_info_r12_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4617,6 +4562,9 @@ struct ueassist_info_r11_s { set(types::ue_assist_info_r11); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4626,9 +4574,6 @@ struct ueassist_info_r11_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4638,24 +4583,23 @@ struct ueassist_info_r11_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4701,6 +4645,9 @@ struct ue_info_resp_r9_s { set(types::ue_info_resp_r9); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4710,9 +4657,6 @@ struct ue_info_resp_r9_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4722,24 +4666,23 @@ struct ue_info_resp_r9_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4786,6 +4729,9 @@ struct ul_ho_prep_transfer_s { set(types::ul_ho_prep_transfer_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4795,9 +4741,6 @@ struct ul_ho_prep_transfer_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4807,24 +4750,23 @@ struct ul_ho_prep_transfer_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4870,6 +4812,9 @@ struct ul_info_transfer_s { set(types::ul_info_transfer_r8); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4879,9 +4824,6 @@ struct ul_info_transfer_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4891,24 +4833,23 @@ struct ul_info_transfer_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -4954,6 +4895,9 @@ struct ul_info_transfer_mrdc_r15_s { set(types::ul_info_transfer_mrdc_r15); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4963,9 +4907,6 @@ struct ul_info_transfer_mrdc_r15_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4975,24 +4916,23 @@ struct ul_info_transfer_mrdc_r15_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5038,6 +4978,9 @@ struct wlan_conn_status_report_r13_s { set(types::wlan_conn_status_report_r13); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5047,9 +4990,6 @@ struct wlan_conn_status_report_r13_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5059,24 +4999,23 @@ struct wlan_conn_status_report_r13_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5595,6 +5534,11 @@ struct ul_dcch_msg_type_c { set(types::fail_info_r15); return c.get(); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5624,9 +5568,6 @@ struct ul_dcch_msg_type_c { // choice methods msg_class_ext_c_() = default; - msg_class_ext_c_(const msg_class_ext_c_& other); - msg_class_ext_c_& operator=(const msg_class_ext_c_& other); - ~msg_class_ext_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5636,24 +5577,23 @@ struct ul_dcch_msg_type_c { c2_c_& c2() { assert_choice_type("c2", type_.to_string(), "messageClassExtension"); - return c.get(); + return c; } const c2_c_& c2() const { assert_choice_type("c2", type_.to_string(), "messageClassExtension"); - return c.get(); + return c; } c2_c_& set_c2() { set(types::c2); - return c.get(); + return c; } + void set_msg_class_ext_future_r11() { set(types::msg_class_ext_future_r11); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c2_c_ c; }; struct types_opts { enum options { c1, msg_class_ext, nulltype } value; @@ -5723,6 +5663,28 @@ struct ul_dcch_msg_s { void to_json(json_writer& j) const; }; +// RLF-Report-v9e0 ::= SEQUENCE +struct rlf_report_v9e0_s { + meas_result_list2_eutra_v9e0_l meas_result_list_eutra_v9e0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEInformationResponse-v9e0-IEs ::= SEQUENCE +struct ue_info_resp_v9e0_ies_s { + bool rlf_report_v9e0_present = false; + bool non_crit_ext_present = false; + rlf_report_v9e0_s rlf_report_v9e0; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + } // namespace rrc } // namespace asn1 diff --git a/lib/include/srslte/asn1/rrc_nbiot.h b/lib/include/srslte/asn1/rrc_nbiot.h index 3ea7b1cd8..a8f8a4009 100644 --- a/lib/include/srslte/asn1/rrc_nbiot.h +++ b/lib/include/srslte/asn1/rrc_nbiot.h @@ -342,11 +342,14 @@ struct dl_carrier_cfg_ded_nb_r13_s { assert_choice_type("explicitBitmapConfiguration-r13", type_.to_string(), "downlinkBitmapNonAnchor-r13"); return c; } + void set_use_no_bitmap_r13() { set(types::use_no_bitmap_r13); } + void set_use_anchor_bitmap_r13() { set(types::use_anchor_bitmap_r13); } dl_bitmap_nb_r13_c& set_explicit_bitmap_cfg_r13() { set(types::explicit_bitmap_cfg_r13); return c; } + void set_spare() { set(types::spare); } private: types type_; @@ -378,11 +381,14 @@ struct dl_carrier_cfg_ded_nb_r13_s { assert_choice_type("explicitGapConfiguration-r13", type_.to_string(), "dl-GapNonAnchor-r13"); return c; } + void set_use_no_gap_r13() { set(types::use_no_gap_r13); } + void set_use_anchor_gap_cfg_r13() { set(types::use_anchor_gap_cfg_r13); } dl_gap_cfg_nb_r13_s& set_explicit_gap_cfg_r13() { set(types::explicit_gap_cfg_r13); return c; } + void set_spare() { set(types::spare); } private: types type_; @@ -577,6 +583,7 @@ struct pdcp_cfg_nb_r13_s { assert_choice_type("rohc", type_.to_string(), "headerCompression-r13"); return c; } + void set_not_used() { set(types::not_used); } rohc_s_& set_rohc() { set(types::rohc); @@ -637,6 +644,9 @@ struct rlc_cfg_nb_r13_c { set(types::am); return c; } + void set_um_bi_dir_r15() { set(types::um_bi_dir_r15); } + void set_um_uni_dir_ul_r15() { set(types::um_uni_dir_ul_r15); } + void set_um_uni_dir_dl_r15() { set(types::um_uni_dir_dl_r15); } private: types type_; @@ -915,6 +925,7 @@ struct drx_cfg_nb_r13_c { assert_choice_type("setup", type_.to_string(), "DRX-Config-NB-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1074,6 +1085,7 @@ struct sr_sps_bsr_cfg_nb_r15_c { assert_choice_type("setup", type_.to_string(), "SR-SPS-BSR-Config-NB-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1113,6 +1125,7 @@ struct sr_without_harq_ack_cfg_nb_r15_c { assert_choice_type("setup", type_.to_string(), "SR-WithoutHARQ-ACK-Config-NB-r15"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1157,6 +1170,7 @@ struct srb_to_add_mod_nb_r13_s { set(types::explicit_value); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -1193,6 +1207,7 @@ struct srb_to_add_mod_nb_r13_s { set(types::explicit_value); return c; } + void set_default_value() { set(types::default_value); } private: types type_; @@ -1272,6 +1287,7 @@ struct mac_main_cfg_nb_r13_s { assert_choice_type("setup", type_.to_string(), "logicalChannelSR-Config-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1306,6 +1322,7 @@ struct mac_main_cfg_nb_r13_s { assert_choice_type("setup", type_.to_string(), "dataInactivityTimerConfig-r14"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1487,6 +1504,7 @@ struct rlf_timers_and_consts_nb_r13_c { assert_choice_type("setup", type_.to_string(), "RLF-TimersAndConstants-NB-r13"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -1550,6 +1568,7 @@ struct rr_cfg_ded_nb_r13_s { set(types::explicit_value_r13); return c; } + void set_default_value_r13() { set(types::default_value_r13); } private: types type_; @@ -2997,6 +3016,8 @@ struct dl_carrier_cfg_common_nb_r14_s { assert_choice_type("explicitBitmapConfiguration-r14", type_.to_string(), "downlinkBitmapNonAnchor-r14"); return c; } + void set_use_no_bitmap_r14() { set(types::use_no_bitmap_r14); } + void set_use_anchor_bitmap_r14() { set(types::use_anchor_bitmap_r14); } dl_bitmap_nb_r13_c& set_explicit_bitmap_cfg_r14() { set(types::explicit_bitmap_cfg_r14); @@ -3033,6 +3054,8 @@ struct dl_carrier_cfg_common_nb_r14_s { assert_choice_type("explicitGapConfiguration-r14", type_.to_string(), "dl-GapNonAnchor-r14"); return c; } + void set_use_no_gap_r14() { set(types::use_no_gap_r14); } + void set_use_anchor_gap_cfg_r14() { set(types::use_anchor_gap_cfg_r14); } dl_gap_cfg_nb_r13_s& set_explicit_gap_cfg_r14() { set(types::explicit_gap_cfg_r14); @@ -5459,9 +5482,6 @@ struct sys_info_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5471,24 +5491,23 @@ struct sys_info_nb_s { sys_info_nb_r13_ies_s& sys_info_r13() { assert_choice_type("systemInformation-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const sys_info_nb_r13_ies_s& sys_info_r13() const { assert_choice_type("systemInformation-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } sys_info_nb_r13_ies_s& set_sys_info_r13() { set(types::sys_info_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + sys_info_nb_r13_ies_s c; }; // member variables @@ -5676,9 +5695,6 @@ struct bcch_dl_sch_msg_type_nb_c { // choice methods bcch_dl_sch_msg_type_nb_c() = default; - bcch_dl_sch_msg_type_nb_c(const bcch_dl_sch_msg_type_nb_c& other); - bcch_dl_sch_msg_type_nb_c& operator=(const bcch_dl_sch_msg_type_nb_c& other); - ~bcch_dl_sch_msg_type_nb_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5688,24 +5704,23 @@ struct bcch_dl_sch_msg_type_nb_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType-NB"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType-NB"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // BCCH-DL-SCH-Message-NB ::= SEQUENCE @@ -5887,6 +5902,7 @@ struct rrc_conn_reest_nb_s { set(types::rrc_conn_reest_r13); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5896,9 +5912,6 @@ struct rrc_conn_reest_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5908,24 +5921,23 @@ struct rrc_conn_reest_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -5972,6 +5984,7 @@ struct rrc_conn_reject_nb_s { set(types::rrc_conn_reject_r13); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -5981,9 +5994,6 @@ struct rrc_conn_reject_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -5993,24 +6003,23 @@ struct rrc_conn_reject_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6056,6 +6065,7 @@ struct rrc_conn_setup_nb_s { set(types::rrc_conn_setup_r13); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6065,9 +6075,6 @@ struct rrc_conn_setup_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6077,24 +6084,23 @@ struct rrc_conn_setup_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6119,9 +6125,6 @@ struct rrc_early_data_complete_nb_r15_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6131,24 +6134,23 @@ struct rrc_early_data_complete_nb_r15_s { rrc_early_data_complete_nb_r15_ies_s& rrc_early_data_complete_r15() { assert_choice_type("rrcEarlyDataComplete-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_early_data_complete_nb_r15_ies_s& rrc_early_data_complete_r15() const { assert_choice_type("rrcEarlyDataComplete-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_early_data_complete_nb_r15_ies_s& set_rrc_early_data_complete_r15() { set(types::rrc_early_data_complete_r15); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_early_data_complete_nb_r15_ies_s c; }; // member variables @@ -6266,6 +6268,9 @@ struct dl_ccch_msg_type_nb_c { set(types::rrc_early_data_complete_r15); return c.get(); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6289,9 +6294,6 @@ struct dl_ccch_msg_type_nb_c { // choice methods dl_ccch_msg_type_nb_c() = default; - dl_ccch_msg_type_nb_c(const dl_ccch_msg_type_nb_c& other); - dl_ccch_msg_type_nb_c& operator=(const dl_ccch_msg_type_nb_c& other); - ~dl_ccch_msg_type_nb_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6301,24 +6303,23 @@ struct dl_ccch_msg_type_nb_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "DL-CCCH-MessageType-NB"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "DL-CCCH-MessageType-NB"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // DL-CCCH-Message-NB ::= SEQUENCE @@ -6510,6 +6511,7 @@ struct dl_info_transfer_nb_s { set(types::dl_info_transfer_r13); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6519,9 +6521,6 @@ struct dl_info_transfer_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6531,24 +6530,23 @@ struct dl_info_transfer_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6595,6 +6593,7 @@ struct rrc_conn_recfg_nb_s { set(types::rrc_conn_recfg_r13); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6604,9 +6603,6 @@ struct rrc_conn_recfg_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6616,24 +6612,23 @@ struct rrc_conn_recfg_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6680,6 +6675,7 @@ struct rrc_conn_release_nb_s { set(types::rrc_conn_release_r13); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6689,9 +6685,6 @@ struct rrc_conn_release_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6701,24 +6694,23 @@ struct rrc_conn_release_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6765,6 +6757,7 @@ struct rrc_conn_resume_nb_s { set(types::rrc_conn_resume_r13); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6774,9 +6767,6 @@ struct rrc_conn_resume_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6786,24 +6776,23 @@ struct rrc_conn_resume_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -6850,6 +6839,7 @@ struct ue_cap_enquiry_nb_s { set(types::ue_cap_enquiry_r13); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -6859,9 +6849,6 @@ struct ue_cap_enquiry_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -6871,24 +6858,23 @@ struct ue_cap_enquiry_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -7022,6 +7008,8 @@ struct dl_dcch_msg_type_nb_c { set(types::rrc_conn_resume_r13); return c.get(); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -7046,9 +7034,6 @@ struct dl_dcch_msg_type_nb_c { // choice methods dl_dcch_msg_type_nb_c() = default; - dl_dcch_msg_type_nb_c(const dl_dcch_msg_type_nb_c& other); - dl_dcch_msg_type_nb_c& operator=(const dl_dcch_msg_type_nb_c& other); - ~dl_dcch_msg_type_nb_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7058,24 +7043,23 @@ struct dl_dcch_msg_type_nb_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "DL-DCCH-MessageType-NB"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "DL-DCCH-MessageType-NB"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // DL-DCCH-Message-NB ::= SEQUENCE @@ -7088,142 +7072,6 @@ struct dl_dcch_msg_nb_s { void to_json(json_writer& j) const; }; -// PhyLayerParameters-NB-r13 ::= SEQUENCE -struct phy_layer_params_nb_r13_s { - bool multi_tone_r13_present = false; - bool multi_carrier_r13_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// PhyLayerParameters-NB-v1430 ::= SEQUENCE -struct phy_layer_params_nb_v1430_s { - bool multi_carrier_nprach_r14_present = false; - bool two_harq_processes_r14_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// PhyLayerParameters-NB-v1530 ::= SEQUENCE -struct phy_layer_params_nb_v1530_s { - bool mixed_operation_mode_r15_present = false; - bool sr_with_harq_ack_r15_present = false; - bool sr_without_harq_ack_r15_present = false; - bool nprach_format2_r15_present = false; - bool add_tx_sib1_r15_present = false; - bool npusch_minus3dot75k_hz_scs_tdd_r15_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// MAC-Parameters-NB-v1530 ::= SEQUENCE -struct mac_params_nb_v1530_s { - bool sr_sps_bsr_r15_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// RLC-Parameters-NB-r15 ::= SEQUENCE -struct rlc_params_nb_r15_s { - bool rlc_um_r15_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// TDD-UE-Capability-NB-r15 ::= SEQUENCE -struct tdd_ue_cap_nb_r15_s { - bool ext = false; - bool ue_category_nb_r15_present = false; - bool phy_layer_params_rel13_r15_present = false; - bool phy_layer_params_rel14_r15_present = false; - bool phy_layer_params_v1530_present = false; - phy_layer_params_nb_r13_s phy_layer_params_rel13_r15; - phy_layer_params_nb_v1430_s phy_layer_params_rel14_r15; - phy_layer_params_nb_v1530_s phy_layer_params_v1530; - // ... - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-Capability-NB-v1530-IEs ::= SEQUENCE -struct ue_cap_nb_v1530_ies_s { - bool early_data_up_r15_present = false; - bool phy_layer_params_v1530_present = false; - bool tdd_ue_cap_r15_present = false; - bool non_crit_ext_present = false; - rlc_params_nb_r15_s rlc_params_r15; - mac_params_nb_v1530_s mac_params_v1530; - phy_layer_params_nb_v1530_s phy_layer_params_v1530; - tdd_ue_cap_nb_r15_s tdd_ue_cap_r15; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// PhyLayerParameters-NB-v1440 ::= SEQUENCE -struct phy_layer_params_nb_v1440_s { - bool interference_randomisation_r14_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// UE-Capability-NB-v14x0-IEs ::= SEQUENCE -struct ue_cap_nb_v14x0_ies_s { - bool late_non_crit_ext_present = false; - bool non_crit_ext_present = false; - dyn_octstring late_non_crit_ext; - ue_cap_nb_v1530_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// MAC-Parameters-NB-r14 ::= SEQUENCE -struct mac_params_nb_r14_s { - bool data_inact_mon_r14_present = false; - bool rai_support_r14_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - -// RF-Parameters-NB-v1430 ::= SEQUENCE -struct rf_params_nb_v1430_s { - bool pwr_class_nb_minus14dbm_r14_present = false; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SupportedBand-NB-r13 ::= SEQUENCE struct supported_band_nb_r13_s { bool pwr_class_nb_minus20dbm_r13_present = false; @@ -7235,39 +7083,9 @@ struct supported_band_nb_r13_s { void to_json(json_writer& j) const; }; -// UE-Capability-NB-v1440-IEs ::= SEQUENCE -struct ue_cap_nb_v1440_ies_s { - bool phy_layer_params_v1440_present = false; - bool non_crit_ext_present = false; - phy_layer_params_nb_v1440_s phy_layer_params_v1440; - ue_cap_nb_v14x0_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // SupportedBandList-NB-r13 ::= SEQUENCE (SIZE (1..64)) OF SupportedBand-NB-r13 using supported_band_list_nb_r13_l = dyn_array; -// UE-Capability-NB-Ext-r14-IEs ::= SEQUENCE -struct ue_cap_nb_ext_r14_ies_s { - bool ue_category_nb_r14_present = false; - bool mac_params_r14_present = false; - bool phy_layer_params_v1430_present = false; - bool non_crit_ext_present = false; - mac_params_nb_r14_s mac_params_r14; - phy_layer_params_nb_v1430_s phy_layer_params_v1430; - rf_params_nb_v1430_s rf_params_v1430; - ue_cap_nb_v1440_ies_s non_crit_ext; - - // sequence methods - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; -}; - // AccessStratumRelease-NB-r13 ::= ENUMERATED struct access_stratum_release_nb_r13_opts { enum options { rel13, rel14, rel15, spare5, spare4, spare3, spare2, spare1, /*...*/ nulltype } value; @@ -7323,6 +7141,17 @@ struct pdcp_params_nb_r13_s { void to_json(json_writer& j) const; }; +// PhyLayerParameters-NB-r13 ::= SEQUENCE +struct phy_layer_params_nb_r13_s { + bool multi_tone_r13_present = false; + bool multi_carrier_r13_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // RF-Parameters-NB-r13 ::= SEQUENCE struct rf_params_nb_r13_s { bool multi_ns_pmax_r13_present = false; @@ -7502,6 +7331,9 @@ struct ho_prep_info_nb_s { set(types::ho_prep_info_r13); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -7511,9 +7343,6 @@ struct ho_prep_info_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7523,24 +7352,23 @@ struct ho_prep_info_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -7625,9 +7453,6 @@ struct pcch_msg_type_nb_c { // choice methods pcch_msg_type_nb_c() = default; - pcch_msg_type_nb_c(const pcch_msg_type_nb_c& other); - pcch_msg_type_nb_c& operator=(const pcch_msg_type_nb_c& other); - ~pcch_msg_type_nb_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7637,24 +7462,23 @@ struct pcch_msg_type_nb_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "PCCH-MessageType-NB"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "PCCH-MessageType-NB"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // PCCH-Message-NB ::= SEQUENCE @@ -7703,9 +7527,6 @@ struct rrc_conn_recfg_complete_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7715,24 +7536,23 @@ struct rrc_conn_recfg_complete_nb_s { rrc_conn_recfg_complete_nb_r13_ies_s& rrc_conn_recfg_complete_r13() { assert_choice_type("rrcConnectionReconfigurationComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_recfg_complete_nb_r13_ies_s& rrc_conn_recfg_complete_r13() const { assert_choice_type("rrcConnectionReconfigurationComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_recfg_complete_nb_r13_ies_s& set_rrc_conn_recfg_complete_r13() { set(types::rrc_conn_recfg_complete_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_recfg_complete_nb_r13_ies_s c; }; // member variables @@ -7782,9 +7602,6 @@ struct rrc_conn_reest_complete_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7794,24 +7611,23 @@ struct rrc_conn_reest_complete_nb_s { rrc_conn_reest_complete_nb_r13_ies_s& rrc_conn_reest_complete_r13() { assert_choice_type("rrcConnectionReestablishmentComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_reest_complete_nb_r13_ies_s& rrc_conn_reest_complete_r13() const { assert_choice_type("rrcConnectionReestablishmentComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_reest_complete_nb_r13_ies_s& set_rrc_conn_reest_complete_r13() { set(types::rrc_conn_reest_complete_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_reest_complete_nb_r13_ies_s c; }; // member variables @@ -7918,9 +7734,6 @@ struct rrc_conn_reest_request_nb_s { // choice methods later_c_() = default; - later_c_(const later_c_& other); - later_c_& operator=(const later_c_& other); - ~later_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7930,24 +7743,23 @@ struct rrc_conn_reest_request_nb_s { rrc_conn_reest_request_nb_r14_ies_s& rrc_conn_reest_request_r14() { assert_choice_type("rrcConnectionReestablishmentRequest-r14", type_.to_string(), "later"); - return c.get(); + return c; } const rrc_conn_reest_request_nb_r14_ies_s& rrc_conn_reest_request_r14() const { assert_choice_type("rrcConnectionReestablishmentRequest-r14", type_.to_string(), "later"); - return c.get(); + return c; } rrc_conn_reest_request_nb_r14_ies_s& set_rrc_conn_reest_request_r14() { set(types::rrc_conn_reest_request_r14); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_reest_request_nb_r14_ies_s c; }; struct types_opts { enum options { rrc_conn_reest_request_r13, later, nulltype } value; @@ -8059,10 +7871,7 @@ struct rrc_conn_request_nb_s { typedef enumerated types; // choice methods - crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } + crit_exts_c_() = default; void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8072,24 +7881,23 @@ struct rrc_conn_request_nb_s { rrc_conn_request_nb_r13_ies_s& rrc_conn_request_r13() { assert_choice_type("rrcConnectionRequest-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_request_nb_r13_ies_s& rrc_conn_request_r13() const { assert_choice_type("rrcConnectionRequest-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_request_nb_r13_ies_s& set_rrc_conn_request_r13() { set(types::rrc_conn_request_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_request_nb_r13_ies_s c; }; // member variables @@ -8142,9 +7950,6 @@ struct rrc_conn_resume_complete_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8154,24 +7959,23 @@ struct rrc_conn_resume_complete_nb_s { rrc_conn_resume_complete_nb_r13_ies_s& rrc_conn_resume_complete_r13() { assert_choice_type("rrcConnectionResumeComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_resume_complete_nb_r13_ies_s& rrc_conn_resume_complete_r13() const { assert_choice_type("rrcConnectionResumeComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_resume_complete_nb_r13_ies_s& set_rrc_conn_resume_complete_r13() { set(types::rrc_conn_resume_complete_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_resume_complete_nb_r13_ies_s c; }; // member variables @@ -8211,9 +8015,6 @@ struct rrc_conn_resume_request_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8223,24 +8024,23 @@ struct rrc_conn_resume_request_nb_s { rrc_conn_resume_request_nb_r13_ies_s& rrc_conn_resume_request_r13() { assert_choice_type("rrcConnectionResumeRequest-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_resume_request_nb_r13_ies_s& rrc_conn_resume_request_r13() const { assert_choice_type("rrcConnectionResumeRequest-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_resume_request_nb_r13_ies_s& set_rrc_conn_resume_request_r13() { set(types::rrc_conn_resume_request_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_resume_request_nb_r13_ies_s c; }; // member variables @@ -8311,9 +8111,6 @@ struct rrc_conn_setup_complete_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8323,24 +8120,23 @@ struct rrc_conn_setup_complete_nb_s { rrc_conn_setup_complete_nb_r13_ies_s& rrc_conn_setup_complete_r13() { assert_choice_type("rrcConnectionSetupComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_conn_setup_complete_nb_r13_ies_s& rrc_conn_setup_complete_r13() const { assert_choice_type("rrcConnectionSetupComplete-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_conn_setup_complete_nb_r13_ies_s& set_rrc_conn_setup_complete_r13() { set(types::rrc_conn_setup_complete_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_conn_setup_complete_nb_r13_ies_s c; }; // member variables @@ -8401,9 +8197,6 @@ struct rrc_early_data_request_nb_r15_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8413,24 +8206,23 @@ struct rrc_early_data_request_nb_r15_s { rrc_early_data_request_nb_r15_ies_s& rrc_early_data_request_r15() { assert_choice_type("rrcEarlyDataRequest-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_early_data_request_nb_r15_ies_s& rrc_early_data_request_r15() const { assert_choice_type("rrcEarlyDataRequest-r15", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_early_data_request_nb_r15_ies_s& set_rrc_early_data_request_r15() { set(types::rrc_early_data_request_r15); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_early_data_request_nb_r15_ies_s c; }; // member variables @@ -8956,9 +8748,6 @@ struct sc_mcch_msg_type_nb_c { // choice methods sc_mcch_msg_type_nb_c() = default; - sc_mcch_msg_type_nb_c(const sc_mcch_msg_type_nb_c& other); - sc_mcch_msg_type_nb_c& operator=(const sc_mcch_msg_type_nb_c& other); - ~sc_mcch_msg_type_nb_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8968,24 +8757,23 @@ struct sc_mcch_msg_type_nb_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "SC-MCCH-MessageType-NB"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "SC-MCCH-MessageType-NB"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // SC-MCCH-Message-NB ::= SEQUENCE @@ -8998,6 +8786,161 @@ struct sc_mcch_msg_nb_s { void to_json(json_writer& j) const; }; +// PhyLayerParameters-NB-v1430 ::= SEQUENCE +struct phy_layer_params_nb_v1430_s { + bool multi_carrier_nprach_r14_present = false; + bool two_harq_processes_r14_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// PhyLayerParameters-NB-v1530 ::= SEQUENCE +struct phy_layer_params_nb_v1530_s { + bool mixed_operation_mode_r15_present = false; + bool sr_with_harq_ack_r15_present = false; + bool sr_without_harq_ack_r15_present = false; + bool nprach_format2_r15_present = false; + bool add_tx_sib1_r15_present = false; + bool npusch_minus3dot75k_hz_scs_tdd_r15_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// TDD-UE-Capability-NB-r15 ::= SEQUENCE +struct tdd_ue_cap_nb_r15_s { + bool ext = false; + bool ue_category_nb_r15_present = false; + bool phy_layer_params_rel13_r15_present = false; + bool phy_layer_params_rel14_r15_present = false; + bool phy_layer_params_v1530_present = false; + phy_layer_params_nb_r13_s phy_layer_params_rel13_r15; + phy_layer_params_nb_v1430_s phy_layer_params_rel14_r15; + phy_layer_params_nb_v1530_s phy_layer_params_v1530; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// MAC-Parameters-NB-v1530 ::= SEQUENCE +struct mac_params_nb_v1530_s { + bool sr_sps_bsr_r15_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RLC-Parameters-NB-r15 ::= SEQUENCE +struct rlc_params_nb_r15_s { + bool rlc_um_r15_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-Capability-NB-v1530-IEs ::= SEQUENCE +struct ue_cap_nb_v1530_ies_s { + bool early_data_up_r15_present = false; + bool phy_layer_params_v1530_present = false; + bool tdd_ue_cap_r15_present = false; + bool non_crit_ext_present = false; + rlc_params_nb_r15_s rlc_params_r15; + mac_params_nb_v1530_s mac_params_v1530; + phy_layer_params_nb_v1530_s phy_layer_params_v1530; + tdd_ue_cap_nb_r15_s tdd_ue_cap_r15; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// PhyLayerParameters-NB-v1440 ::= SEQUENCE +struct phy_layer_params_nb_v1440_s { + bool interference_randomisation_r14_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-Capability-NB-v14x0-IEs ::= SEQUENCE +struct ue_cap_nb_v14x0_ies_s { + bool late_non_crit_ext_present = false; + bool non_crit_ext_present = false; + dyn_octstring late_non_crit_ext; + ue_cap_nb_v1530_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// MAC-Parameters-NB-r14 ::= SEQUENCE +struct mac_params_nb_r14_s { + bool data_inact_mon_r14_present = false; + bool rai_support_r14_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RF-Parameters-NB-v1430 ::= SEQUENCE +struct rf_params_nb_v1430_s { + bool pwr_class_nb_minus14dbm_r14_present = false; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-Capability-NB-v1440-IEs ::= SEQUENCE +struct ue_cap_nb_v1440_ies_s { + bool phy_layer_params_v1440_present = false; + bool non_crit_ext_present = false; + phy_layer_params_nb_v1440_s phy_layer_params_v1440; + ue_cap_nb_v14x0_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UE-Capability-NB-Ext-r14-IEs ::= SEQUENCE +struct ue_cap_nb_ext_r14_ies_s { + bool ue_category_nb_r14_present = false; + bool mac_params_r14_present = false; + bool phy_layer_params_v1430_present = false; + bool non_crit_ext_present = false; + mac_params_nb_r14_s mac_params_r14; + phy_layer_params_nb_v1430_s phy_layer_params_v1430; + rf_params_nb_v1430_s rf_params_v1430; + ue_cap_nb_v1440_ies_s non_crit_ext; + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + // UE-RadioPagingInfo-NB-r13 ::= SEQUENCE struct ue_radio_paging_info_nb_r13_s { struct wake_up_signal_min_gap_e_drx_r15_opts { @@ -9066,9 +9009,6 @@ struct ue_cap_info_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -9078,24 +9018,23 @@ struct ue_cap_info_nb_s { ue_cap_info_nb_r13_ies_s& ue_cap_info_r13() { assert_choice_type("ueCapabilityInformation-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const ue_cap_info_nb_r13_ies_s& ue_cap_info_r13() const { assert_choice_type("ueCapabilityInformation-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } ue_cap_info_nb_r13_ies_s& set_ue_cap_info_r13() { set(types::ue_cap_info_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + ue_cap_info_nb_r13_ies_s c; }; // member variables @@ -9154,6 +9093,9 @@ struct ue_paging_coverage_info_nb_s { set(types::ue_paging_coverage_info_r13); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -9163,9 +9105,6 @@ struct ue_paging_coverage_info_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -9175,24 +9114,23 @@ struct ue_paging_coverage_info_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -9275,6 +9213,9 @@ struct ue_radio_access_cap_info_nb_s { set(types::ue_radio_access_cap_info_r13); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -9284,9 +9225,6 @@ struct ue_radio_access_cap_info_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -9296,24 +9234,23 @@ struct ue_radio_access_cap_info_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -9370,6 +9307,9 @@ struct ue_radio_paging_info_nb_s { set(types::ue_radio_paging_info_r13); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -9379,9 +9319,6 @@ struct ue_radio_paging_info_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -9391,24 +9328,23 @@ struct ue_radio_paging_info_nb_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -9529,9 +9465,6 @@ struct ul_ccch_msg_type_nb_c { // choice methods ul_ccch_msg_type_nb_c() = default; - ul_ccch_msg_type_nb_c(const ul_ccch_msg_type_nb_c& other); - ul_ccch_msg_type_nb_c& operator=(const ul_ccch_msg_type_nb_c& other); - ~ul_ccch_msg_type_nb_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -9541,24 +9474,23 @@ struct ul_ccch_msg_type_nb_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "UL-CCCH-MessageType-NB"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "UL-CCCH-MessageType-NB"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // UL-CCCH-Message-NB ::= SEQUENCE @@ -9596,9 +9528,6 @@ struct ul_info_transfer_nb_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -9608,24 +9537,23 @@ struct ul_info_transfer_nb_s { ul_info_transfer_nb_r13_ies_s& ul_info_transfer_r13() { assert_choice_type("ulInformationTransfer-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const ul_info_transfer_nb_r13_ies_s& ul_info_transfer_r13() const { assert_choice_type("ulInformationTransfer-r13", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } ul_info_transfer_nb_r13_ies_s& set_ul_info_transfer_r13() { set(types::ul_info_transfer_r13); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + ul_info_transfer_nb_r13_ies_s c; }; // member variables @@ -9796,6 +9724,14 @@ struct ul_dcch_msg_type_nb_c { set(types::rrc_conn_resume_complete_r13); return c.get(); } + void set_spare8() { set(types::spare8); } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -9822,9 +9758,6 @@ struct ul_dcch_msg_type_nb_c { // choice methods ul_dcch_msg_type_nb_c() = default; - ul_dcch_msg_type_nb_c(const ul_dcch_msg_type_nb_c& other); - ul_dcch_msg_type_nb_c& operator=(const ul_dcch_msg_type_nb_c& other); - ~ul_dcch_msg_type_nb_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -9834,24 +9767,23 @@ struct ul_dcch_msg_type_nb_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "UL-DCCH-MessageType-NB"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "UL-DCCH-MessageType-NB"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // UL-DCCH-Message-NB ::= SEQUENCE diff --git a/lib/include/srslte/asn1/rrc_nr.h b/lib/include/srslte/asn1/rrc_nr.h index 393395355..54a1e7133 100644 --- a/lib/include/srslte/asn1/rrc_nr.h +++ b/lib/include/srslte/asn1/rrc_nr.h @@ -268,9 +268,6 @@ struct bcch_bch_msg_type_c { // choice methods bcch_bch_msg_type_c() = default; - bcch_bch_msg_type_c(const bcch_bch_msg_type_c& other); - bcch_bch_msg_type_c& operator=(const bcch_bch_msg_type_c& other); - ~bcch_bch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -280,24 +277,23 @@ struct bcch_bch_msg_type_c { mib_s& mib() { assert_choice_type("mib", type_.to_string(), "BCCH-BCH-MessageType"); - return c.get(); + return c; } const mib_s& mib() const { assert_choice_type("mib", type_.to_string(), "BCCH-BCH-MessageType"); - return c.get(); + return c; } mib_s& set_mib() { set(types::mib); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + mib_s c; }; // BCCH-BCH-Message ::= SEQUENCE @@ -676,6 +672,7 @@ struct ctrl_res_set_s { set(types::interleaved); return c; } + void set_non_interleaved() { set(types::non_interleaved); } private: types type_; @@ -1208,6 +1205,7 @@ struct search_space_s { assert_choice_type("sl2560", type_.to_string(), "monitoringSlotPeriodicityAndOffset"); return c.get(); } + void set_sl1() { set(types::sl1); } uint8_t& set_sl2() { set(types::sl2); @@ -2448,6 +2446,7 @@ struct setup_release_c { assert_choice_type("setup", type_.to_string(), "SetupRelease"); return c; } + void set_release() { set(types::release); } elem_type_paramT_& set_setup() { set(types::setup); @@ -2670,6 +2669,7 @@ struct pcch_cfg_s { assert_choice_type("oneSixteenthT", type_.to_string(), "nAndPagingFrameOffset"); return c.get(); } + void set_one_t() { set(types::one_t); } uint8_t& set_half_t() { set(types::half_t); @@ -4005,9 +4005,6 @@ struct sys_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4017,24 +4014,23 @@ struct sys_info_s { sys_info_ies_s& sys_info() { assert_choice_type("systemInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const sys_info_ies_s& sys_info() const { assert_choice_type("systemInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } sys_info_ies_s& set_sys_info() { set(types::sys_info); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + sys_info_ies_s c; }; // member variables @@ -4117,9 +4113,6 @@ struct bcch_dl_sch_msg_type_c { // choice methods bcch_dl_sch_msg_type_c() = default; - bcch_dl_sch_msg_type_c(const bcch_dl_sch_msg_type_c& other); - bcch_dl_sch_msg_type_c& operator=(const bcch_dl_sch_msg_type_c& other); - ~bcch_dl_sch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4129,24 +4122,23 @@ struct bcch_dl_sch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "BCCH-DL-SCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // BCCH-DL-SCH-Message ::= SEQUENCE @@ -4337,6 +4329,7 @@ struct pdcp_cfg_s { assert_choice_type("uplinkOnlyROHC", type_.to_string(), "headerCompression"); return c.get(); } + void set_not_used() { set(types::not_used); } rohc_s_& set_rohc() { set(types::rohc); @@ -4708,9 +4701,6 @@ struct rrc_reject_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4720,24 +4710,23 @@ struct rrc_reject_s { rrc_reject_ies_s& rrc_reject() { assert_choice_type("rrcReject", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_reject_ies_s& rrc_reject() const { assert_choice_type("rrcReject", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_reject_ies_s& set_rrc_reject() { set(types::rrc_reject); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_reject_ies_s c; }; // member variables @@ -4761,9 +4750,6 @@ struct rrc_setup_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4773,24 +4759,23 @@ struct rrc_setup_s { rrc_setup_ies_s& rrc_setup() { assert_choice_type("rrcSetup", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_setup_ies_s& rrc_setup() const { assert_choice_type("rrcSetup", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_setup_ies_s& set_rrc_setup() { set(types::rrc_setup); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_setup_ies_s c; }; // member variables @@ -4854,6 +4839,8 @@ struct dl_ccch_msg_type_c { set(types::rrc_setup); return c.get(); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -4872,9 +4859,6 @@ struct dl_ccch_msg_type_c { // choice methods dl_ccch_msg_type_c() = default; - dl_ccch_msg_type_c(const dl_ccch_msg_type_c& other); - dl_ccch_msg_type_c& operator=(const dl_ccch_msg_type_c& other); - ~dl_ccch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -4884,24 +4868,23 @@ struct dl_ccch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "DL-CCCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "DL-CCCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // DL-CCCH-Message ::= SEQUENCE @@ -6915,6 +6898,7 @@ struct other_cfg_s { assert_choice_type("setup", type_.to_string(), "delayBudgetReportingConfig"); return c; } + void set_release() { set(types::release); } setup_s_& set_setup() { set(types::setup); @@ -7526,9 +7510,6 @@ struct counter_check_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7538,24 +7519,23 @@ struct counter_check_s { counter_check_ies_s& counter_check() { assert_choice_type("counterCheck", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const counter_check_ies_s& counter_check() const { assert_choice_type("counterCheck", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } counter_check_ies_s& set_counter_check() { set(types::counter_check); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + counter_check_ies_s c; }; // member variables @@ -7580,9 +7560,6 @@ struct dl_info_transfer_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7592,24 +7569,23 @@ struct dl_info_transfer_s { dl_info_transfer_ies_s& dl_info_transfer() { assert_choice_type("dlInformationTransfer", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const dl_info_transfer_ies_s& dl_info_transfer() const { assert_choice_type("dlInformationTransfer", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } dl_info_transfer_ies_s& set_dl_info_transfer() { set(types::dl_info_transfer); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + dl_info_transfer_ies_s c; }; // member variables @@ -7634,9 +7610,6 @@ struct mob_from_nr_cmd_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7646,24 +7619,23 @@ struct mob_from_nr_cmd_s { mob_from_nr_cmd_ies_s& mob_from_nr_cmd() { assert_choice_type("mobilityFromNRCommand", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const mob_from_nr_cmd_ies_s& mob_from_nr_cmd() const { assert_choice_type("mobilityFromNRCommand", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } mob_from_nr_cmd_ies_s& set_mob_from_nr_cmd() { set(types::mob_from_nr_cmd); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + mob_from_nr_cmd_ies_s c; }; // member variables @@ -7688,9 +7660,6 @@ struct rrc_recfg_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7700,24 +7669,23 @@ struct rrc_recfg_s { rrc_recfg_ies_s& rrc_recfg() { assert_choice_type("rrcReconfiguration", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_recfg_ies_s& rrc_recfg() const { assert_choice_type("rrcReconfiguration", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_recfg_ies_s& set_rrc_recfg() { set(types::rrc_recfg); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_recfg_ies_s c; }; // member variables @@ -7742,9 +7710,6 @@ struct rrc_reest_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7754,24 +7719,23 @@ struct rrc_reest_s { rrc_reest_ies_s& rrc_reest() { assert_choice_type("rrcReestablishment", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_reest_ies_s& rrc_reest() const { assert_choice_type("rrcReestablishment", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_reest_ies_s& set_rrc_reest() { set(types::rrc_reest); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_reest_ies_s c; }; // member variables @@ -7796,9 +7760,6 @@ struct rrc_release_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7808,24 +7769,23 @@ struct rrc_release_s { rrc_release_ies_s& rrc_release() { assert_choice_type("rrcRelease", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_release_ies_s& rrc_release() const { assert_choice_type("rrcRelease", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_release_ies_s& set_rrc_release() { set(types::rrc_release); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_release_ies_s c; }; // member variables @@ -7850,9 +7810,6 @@ struct rrc_resume_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7862,24 +7819,23 @@ struct rrc_resume_s { rrc_resume_ies_s& rrc_resume() { assert_choice_type("rrcResume", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_resume_ies_s& rrc_resume() const { assert_choice_type("rrcResume", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_resume_ies_s& set_rrc_resume() { set(types::rrc_resume); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_resume_ies_s c; }; // member variables @@ -7904,9 +7860,6 @@ struct security_mode_cmd_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7916,24 +7869,23 @@ struct security_mode_cmd_s { security_mode_cmd_ies_s& security_mode_cmd() { assert_choice_type("securityModeCommand", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const security_mode_cmd_ies_s& security_mode_cmd() const { assert_choice_type("securityModeCommand", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } security_mode_cmd_ies_s& set_security_mode_cmd() { set(types::security_mode_cmd); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + security_mode_cmd_ies_s c; }; // member variables @@ -7958,9 +7910,6 @@ struct ue_cap_enquiry_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -7970,24 +7919,23 @@ struct ue_cap_enquiry_s { ue_cap_enquiry_ies_s& ue_cap_enquiry() { assert_choice_type("ueCapabilityEnquiry", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const ue_cap_enquiry_ies_s& ue_cap_enquiry() const { assert_choice_type("ueCapabilityEnquiry", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } ue_cap_enquiry_ies_s& set_ue_cap_enquiry() { set(types::ue_cap_enquiry); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + ue_cap_enquiry_ies_s c; }; // member variables @@ -8174,6 +8122,13 @@ struct dl_dcch_msg_type_c { set(types::mob_from_nr_cmd); return c.get(); } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -8201,9 +8156,6 @@ struct dl_dcch_msg_type_c { // choice methods dl_dcch_msg_type_c() = default; - dl_dcch_msg_type_c(const dl_dcch_msg_type_c& other); - dl_dcch_msg_type_c& operator=(const dl_dcch_msg_type_c& other); - ~dl_dcch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8213,24 +8165,23 @@ struct dl_dcch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "DL-DCCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "DL-DCCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // DL-DCCH-Message ::= SEQUENCE @@ -8366,6 +8317,7 @@ struct pcch_msg_type_c { set(types::paging); return c; } + void set_spare1() { set(types::spare1); } private: types type_; @@ -8382,9 +8334,6 @@ struct pcch_msg_type_c { // choice methods pcch_msg_type_c() = default; - pcch_msg_type_c(const pcch_msg_type_c& other); - pcch_msg_type_c& operator=(const pcch_msg_type_c& other); - ~pcch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8394,24 +8343,23 @@ struct pcch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "PCCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "PCCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // PCCH-Message ::= SEQUENCE @@ -8646,9 +8594,6 @@ struct rrc_sys_info_request_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8658,24 +8603,23 @@ struct rrc_sys_info_request_s { rrc_sys_info_request_ies_s& rrc_sys_info_request() { assert_choice_type("rrcSystemInfoRequest", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_sys_info_request_ies_s& rrc_sys_info_request() const { assert_choice_type("rrcSystemInfoRequest", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_sys_info_request_ies_s& set_rrc_sys_info_request() { set(types::rrc_sys_info_request); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_sys_info_request_ies_s c; }; // member variables @@ -8786,9 +8730,6 @@ struct ul_ccch_msg_type_c { // choice methods ul_ccch_msg_type_c() = default; - ul_ccch_msg_type_c(const ul_ccch_msg_type_c& other); - ul_ccch_msg_type_c& operator=(const ul_ccch_msg_type_c& other); - ~ul_ccch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8798,24 +8739,23 @@ struct ul_ccch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "UL-CCCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "UL-CCCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // UL-CCCH-Message ::= SEQUENCE @@ -8886,6 +8826,9 @@ struct ul_ccch1_msg_type_c { set(types::rrc_resume_request1); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -8902,9 +8845,6 @@ struct ul_ccch1_msg_type_c { // choice methods ul_ccch1_msg_type_c() = default; - ul_ccch1_msg_type_c(const ul_ccch1_msg_type_c& other); - ul_ccch1_msg_type_c& operator=(const ul_ccch1_msg_type_c& other); - ~ul_ccch1_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -8914,24 +8854,23 @@ struct ul_ccch1_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "UL-CCCH1-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "UL-CCCH1-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // UL-CCCH1-Message ::= SEQUENCE @@ -9771,6 +9710,7 @@ struct location_meas_info_c { set(types::eutra_rstd); return c; } + void set_eutra_fine_timing_detection() { set(types::eutra_fine_timing_detection); } private: types type_; @@ -10283,9 +10223,6 @@ struct counter_check_resp_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10295,24 +10232,23 @@ struct counter_check_resp_s { counter_check_resp_ies_s& counter_check_resp() { assert_choice_type("counterCheckResponse", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const counter_check_resp_ies_s& counter_check_resp() const { assert_choice_type("counterCheckResponse", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } counter_check_resp_ies_s& set_counter_check_resp() { set(types::counter_check_resp); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + counter_check_resp_ies_s c; }; // member variables @@ -10337,9 +10273,6 @@ struct fail_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10349,24 +10282,23 @@ struct fail_info_s { fail_info_ies_s& fail_info() { assert_choice_type("failureInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const fail_info_ies_s& fail_info() const { assert_choice_type("failureInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } fail_info_ies_s& set_fail_info() { set(types::fail_info); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + fail_info_ies_s c; }; // member variables @@ -10390,9 +10322,6 @@ struct location_meas_ind_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10402,24 +10331,23 @@ struct location_meas_ind_s { location_meas_ind_ies_s& location_meas_ind() { assert_choice_type("locationMeasurementIndication", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const location_meas_ind_ies_s& location_meas_ind() const { assert_choice_type("locationMeasurementIndication", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } location_meas_ind_ies_s& set_location_meas_ind() { set(types::location_meas_ind); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + location_meas_ind_ies_s c; }; // member variables @@ -10443,9 +10371,6 @@ struct meas_report_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10455,24 +10380,23 @@ struct meas_report_s { meas_report_ies_s& meas_report() { assert_choice_type("measurementReport", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const meas_report_ies_s& meas_report() const { assert_choice_type("measurementReport", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } meas_report_ies_s& set_meas_report() { set(types::meas_report); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + meas_report_ies_s c; }; // member variables @@ -10496,9 +10420,6 @@ struct rrc_recfg_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10508,24 +10429,23 @@ struct rrc_recfg_complete_s { rrc_recfg_complete_ies_s& rrc_recfg_complete() { assert_choice_type("rrcReconfigurationComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_recfg_complete_ies_s& rrc_recfg_complete() const { assert_choice_type("rrcReconfigurationComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_recfg_complete_ies_s& set_rrc_recfg_complete() { set(types::rrc_recfg_complete); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_recfg_complete_ies_s c; }; // member variables @@ -10550,9 +10470,6 @@ struct rrc_reest_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10562,24 +10479,23 @@ struct rrc_reest_complete_s { rrc_reest_complete_ies_s& rrc_reest_complete() { assert_choice_type("rrcReestablishmentComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_reest_complete_ies_s& rrc_reest_complete() const { assert_choice_type("rrcReestablishmentComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_reest_complete_ies_s& set_rrc_reest_complete() { set(types::rrc_reest_complete); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_reest_complete_ies_s c; }; // member variables @@ -10604,9 +10520,6 @@ struct rrc_resume_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10616,24 +10529,23 @@ struct rrc_resume_complete_s { rrc_resume_complete_ies_s& rrc_resume_complete() { assert_choice_type("rrcResumeComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_resume_complete_ies_s& rrc_resume_complete() const { assert_choice_type("rrcResumeComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_resume_complete_ies_s& set_rrc_resume_complete() { set(types::rrc_resume_complete); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_resume_complete_ies_s c; }; // member variables @@ -10658,9 +10570,6 @@ struct rrc_setup_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10670,24 +10579,23 @@ struct rrc_setup_complete_s { rrc_setup_complete_ies_s& rrc_setup_complete() { assert_choice_type("rrcSetupComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const rrc_setup_complete_ies_s& rrc_setup_complete() const { assert_choice_type("rrcSetupComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } rrc_setup_complete_ies_s& set_rrc_setup_complete() { set(types::rrc_setup_complete); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + rrc_setup_complete_ies_s c; }; // member variables @@ -10712,9 +10620,6 @@ struct scg_fail_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10724,24 +10629,23 @@ struct scg_fail_info_s { scg_fail_info_ies_s& scg_fail_info() { assert_choice_type("scgFailureInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const scg_fail_info_ies_s& scg_fail_info() const { assert_choice_type("scgFailureInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } scg_fail_info_ies_s& set_scg_fail_info() { set(types::scg_fail_info); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + scg_fail_info_ies_s c; }; // member variables @@ -10765,9 +10669,6 @@ struct scg_fail_info_eutra_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10777,24 +10678,23 @@ struct scg_fail_info_eutra_s { scg_fail_info_eutra_ies_s& scg_fail_info_eutra() { assert_choice_type("scgFailureInformationEUTRA", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const scg_fail_info_eutra_ies_s& scg_fail_info_eutra() const { assert_choice_type("scgFailureInformationEUTRA", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } scg_fail_info_eutra_ies_s& set_scg_fail_info_eutra() { set(types::scg_fail_info_eutra); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + scg_fail_info_eutra_ies_s c; }; // member variables @@ -10818,9 +10718,6 @@ struct security_mode_complete_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10830,24 +10727,23 @@ struct security_mode_complete_s { security_mode_complete_ies_s& security_mode_complete() { assert_choice_type("securityModeComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const security_mode_complete_ies_s& security_mode_complete() const { assert_choice_type("securityModeComplete", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } security_mode_complete_ies_s& set_security_mode_complete() { set(types::security_mode_complete); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + security_mode_complete_ies_s c; }; // member variables @@ -10872,9 +10768,6 @@ struct security_mode_fail_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10884,24 +10777,23 @@ struct security_mode_fail_s { security_mode_fail_ies_s& security_mode_fail() { assert_choice_type("securityModeFailure", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const security_mode_fail_ies_s& security_mode_fail() const { assert_choice_type("securityModeFailure", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } security_mode_fail_ies_s& set_security_mode_fail() { set(types::security_mode_fail); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + security_mode_fail_ies_s c; }; // member variables @@ -10926,9 +10818,6 @@ struct ueassist_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10938,24 +10827,23 @@ struct ueassist_info_s { ueassist_info_ies_s& ue_assist_info() { assert_choice_type("ueAssistanceInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const ueassist_info_ies_s& ue_assist_info() const { assert_choice_type("ueAssistanceInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } ueassist_info_ies_s& set_ue_assist_info() { set(types::ue_assist_info); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + ueassist_info_ies_s c; }; // member variables @@ -10979,9 +10867,6 @@ struct ue_cap_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -10991,24 +10876,23 @@ struct ue_cap_info_s { ue_cap_info_ies_s& ue_cap_info() { assert_choice_type("ueCapabilityInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const ue_cap_info_ies_s& ue_cap_info() const { assert_choice_type("ueCapabilityInformation", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } ue_cap_info_ies_s& set_ue_cap_info() { set(types::ue_cap_info); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + ue_cap_info_ies_s c; }; // member variables @@ -11033,9 +10917,6 @@ struct ul_info_transfer_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -11045,24 +10926,23 @@ struct ul_info_transfer_s { ul_info_transfer_ies_s& ul_info_transfer() { assert_choice_type("ulInformationTransfer", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const ul_info_transfer_ies_s& ul_info_transfer() const { assert_choice_type("ulInformationTransfer", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } ul_info_transfer_ies_s& set_ul_info_transfer() { set(types::ul_info_transfer); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + ul_info_transfer_ies_s c; }; // member variables @@ -11108,6 +10988,9 @@ struct ul_info_transfer_mrdc_s { set(types::ul_info_transfer_mrdc); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -11124,9 +11007,6 @@ struct ul_info_transfer_mrdc_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -11136,24 +11016,23 @@ struct ul_info_transfer_mrdc_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -11478,9 +11357,6 @@ struct ul_dcch_msg_type_c { // choice methods ul_dcch_msg_type_c() = default; - ul_dcch_msg_type_c(const ul_dcch_msg_type_c& other); - ul_dcch_msg_type_c& operator=(const ul_dcch_msg_type_c& other); - ~ul_dcch_msg_type_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -11490,24 +11366,23 @@ struct ul_dcch_msg_type_c { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "UL-DCCH-MessageType"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "UL-DCCH-MessageType"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_msg_class_ext() { set(types::msg_class_ext); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // UL-DCCH-Message ::= SEQUENCE @@ -11710,6 +11585,9 @@ struct csi_rs_res_map_s { set(types::dot5); return c; } + void set_one() { set(types::one); } + void set_three() { set(types::three); } + void set_spare() { set(types::spare); } private: types type_; @@ -13605,6 +13483,7 @@ struct srs_periodicity_and_offset_c { assert_choice_type("sl2560", type_.to_string(), "SRS-PeriodicityAndOffset"); return c.get(); } + void set_sl1() { set(types::sl1); } uint8_t& set_sl2() { set(types::sl2); @@ -14890,6 +14769,9 @@ struct sched_request_res_cfg_s { assert_choice_type("sl640", type_.to_string(), "periodicityAndOffset"); return c.get(); } + void set_sym2() { set(types::sym2); } + void set_sym6or7() { set(types::sym6or7); } + void set_sl1() { set(types::sl1); } uint8_t& set_sl2() { set(types::sl2); @@ -18717,6 +18599,7 @@ struct port_idx_for8_ranks_c { set(types::port_idx2); return c.get(); } + void set_port_idx1() { set(types::port_idx1); } private: types type_; @@ -18899,11 +18782,18 @@ struct csi_report_cfg_s { assert_choice_type("cri-RI-i1-CQI", type_.to_string(), "reportQuantity"); return c; } + void set_none() { set(types::none); } + void set_cri_ri_pmi_cqi() { set(types::cri_ri_pmi_cqi); } + void set_cri_ri_i1() { set(types::cri_ri_i1); } cri_ri_i1_cqi_s_& set_cri_ri_i1_cqi() { set(types::cri_ri_i1_cqi); return c; } + void set_cri_ri_cqi() { set(types::cri_ri_cqi); } + void set_cri_rsrp() { set(types::cri_rsrp); } + void set_ssb_idx_rsrp() { set(types::ssb_idx_rsrp); } + void set_cri_ri_li_pmi_cqi() { set(types::cri_ri_li_pmi_cqi); } private: types type_; @@ -19294,6 +19184,7 @@ struct csi_report_cfg_s { assert_choice_type("disabled", type_.to_string(), "groupBasedBeamReporting"); return c; } + void set_enabled() { set(types::enabled); } disabled_s_& set_disabled() { set(types::disabled); @@ -20458,6 +20349,8 @@ struct tdd_ul_dl_slot_cfg_s { assert_choice_type("explicit", type_.to_string(), "symbols"); return c; } + void set_all_dl() { set(types::all_dl); } + void set_all_ul() { set(types::all_ul); } explicit_s_& set_explicit_type() { set(types::explicit_type); @@ -25661,6 +25554,9 @@ struct cg_cfg_s { set(types::cg_cfg); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -25677,9 +25573,6 @@ struct cg_cfg_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -25689,24 +25582,23 @@ struct cg_cfg_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -26002,6 +25894,9 @@ struct cg_cfg_info_s { set(types::cg_cfg_info); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -26018,9 +25913,6 @@ struct cg_cfg_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -26030,24 +25922,23 @@ struct cg_cfg_info_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -26164,6 +26055,9 @@ struct ho_cmd_s { set(types::ho_cmd); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -26180,9 +26074,6 @@ struct ho_cmd_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -26192,24 +26083,23 @@ struct ho_cmd_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -26363,6 +26253,9 @@ struct ho_prep_info_s { set(types::ho_prep_info); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -26379,9 +26272,6 @@ struct ho_prep_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -26391,24 +26281,23 @@ struct ho_prep_info_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -26508,6 +26397,9 @@ struct meas_timing_cfg_s { set(types::meas_timing_conf); return c; } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -26524,9 +26416,6 @@ struct meas_timing_cfg_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -26536,24 +26425,23 @@ struct meas_timing_cfg_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -26620,6 +26508,13 @@ struct ue_radio_access_cap_info_s { set(types::ue_radio_access_cap_info); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -26636,9 +26531,6 @@ struct ue_radio_access_cap_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -26648,24 +26540,23 @@ struct ue_radio_access_cap_info_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables @@ -26726,6 +26617,13 @@ struct ue_radio_paging_info_s { set(types::ue_radio_paging_info); return c; } + void set_spare7() { set(types::spare7); } + void set_spare6() { set(types::spare6); } + void set_spare5() { set(types::spare5); } + void set_spare4() { set(types::spare4); } + void set_spare3() { set(types::spare3); } + void set_spare2() { set(types::spare2); } + void set_spare1() { set(types::spare1); } private: types type_; @@ -26742,9 +26640,6 @@ struct ue_radio_paging_info_s { // choice methods crit_exts_c_() = default; - crit_exts_c_(const crit_exts_c_& other); - crit_exts_c_& operator=(const crit_exts_c_& other); - ~crit_exts_c_() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -26754,24 +26649,23 @@ struct ue_radio_paging_info_s { c1_c_& c1() { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } const c1_c_& c1() const { assert_choice_type("c1", type_.to_string(), "criticalExtensions"); - return c.get(); + return c; } c1_c_& set_c1() { set(types::c1); - return c.get(); + return c; } + void set_crit_exts_future() { set(types::crit_exts_future); } private: - types type_; - choice_buffer_t c; - - void destroy_(); + types type_; + c1_c_ c; }; // member variables diff --git a/lib/include/srslte/asn1/s1ap.h b/lib/include/srslte/asn1/s1ap.h index c306d3bb3..bfb058965 100644 --- a/lib/include/srslte/asn1/s1ap.h +++ b/lib/include/srslte/asn1/s1ap.h @@ -455,9 +455,6 @@ struct private_ie_id_c { // choice methods private_ie_id_c() = default; - private_ie_id_c(const private_ie_id_c& other); - private_ie_id_c& operator=(const private_ie_id_c& other); - ~private_ie_id_c() { destroy_(); } void set(types::options e = types::nulltype); types type() const { return type_; } SRSASN_CODE pack(bit_ref& bref) const; @@ -467,24 +464,23 @@ struct private_ie_id_c { uint32_t& local() { assert_choice_type("local", type_.to_string(), "PrivateIE-ID"); - return c.get(); + return c; } const uint32_t& local() const { assert_choice_type("local", type_.to_string(), "PrivateIE-ID"); - return c.get(); + return c; } uint32_t& set_local() { set(types::local); - return c.get(); + return c; } + void set_global() { set(types::global); } private: - types type_; - pod_choice_buffer_t c; - - void destroy_(); + types type_; + uint32_t c; }; // PrivateIE-Field{S1AP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE{{S1AP-PRIVATE-IES}} @@ -878,6 +874,7 @@ struct area_scope_of_mdt_c { set(types::tabased); return c.get(); } + void set_plmn_wide() { set(types::plmn_wide); } tai_based_mdt_s& set_tai_based() { set(types::tai_based); @@ -18304,6 +18301,7 @@ struct so_ntransfer_request_container_c { assert_choice_type("failureEventReporting", type_.to_string(), "SONtransferRequestContainer"); return c.get(); } + void set_cell_load_report() { set(types::cell_load_report); } multi_cell_load_report_request_s& set_multi_cell_load_report() { set(types::multi_cell_load_report); @@ -18433,11 +18431,14 @@ struct so_ntransfer_resp_container_c { set(types::event_triggered_cell_load_report); return c.get(); } + void set_horeport() { set(types::horeport); } cell_activation_resp_s& set_eutran_cell_activation() { set(types::eutran_cell_activation); return c.get(); } + void set_energy_savings_ind() { set(types::energy_savings_ind); } + void set_fail_event_report() { set(types::fail_event_report); } private: types type_; diff --git a/lib/src/asn1/rrc.cc b/lib/src/asn1/rrc.cc index bafe046f1..9b3596d36 100644 --- a/lib/src/asn1/rrc.cc +++ b/lib/src/asn1/rrc.cc @@ -459,67 +459,9 @@ uint8_t bcch_dl_sch_msg_type_br_r13_c::types_opts::to_number() const } // BCCH-DL-SCH-MessageType-MBMS-r14 ::= CHOICE -void bcch_dl_sch_msg_type_mbms_r14_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void bcch_dl_sch_msg_type_mbms_r14_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c"); - } -} -bcch_dl_sch_msg_type_mbms_r14_c::bcch_dl_sch_msg_type_mbms_r14_c(const bcch_dl_sch_msg_type_mbms_r14_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c"); - } -} -bcch_dl_sch_msg_type_mbms_r14_c& -bcch_dl_sch_msg_type_mbms_r14_c::operator=(const bcch_dl_sch_msg_type_mbms_r14_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c"); - } - - return *this; } void bcch_dl_sch_msg_type_mbms_r14_c::to_json(json_writer& j) const { @@ -527,7 +469,7 @@ void bcch_dl_sch_msg_type_mbms_r14_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -541,7 +483,7 @@ SRSASN_CODE bcch_dl_sch_msg_type_mbms_r14_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -558,7 +500,7 @@ SRSASN_CODE bcch_dl_sch_msg_type_mbms_r14_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -2471,66 +2413,9 @@ std::string mcch_msg_type_c::c1_c_::types_opts::to_string() const return convert_enum_idx(options, 1, value, "mcch_msg_type_c::c1_c_::types"); } -void mcch_msg_type_c::later_c_::destroy_() -{ - switch (type_) { - case types::c2: - c.destroy(); - break; - default: - break; - } -} void mcch_msg_type_c::later_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c2: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_"); - } -} -mcch_msg_type_c::later_c_::later_c_(const mcch_msg_type_c::later_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c2: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_"); - } -} -mcch_msg_type_c::later_c_& mcch_msg_type_c::later_c_::operator=(const mcch_msg_type_c::later_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c2: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_"); - } - - return *this; } void mcch_msg_type_c::later_c_::to_json(json_writer& j) const { @@ -2538,7 +2423,7 @@ void mcch_msg_type_c::later_c_::to_json(json_writer& j) const switch (type_) { case types::c2: j.write_fieldname("c2"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -2552,7 +2437,7 @@ SRSASN_CODE mcch_msg_type_c::later_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c2: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -2569,7 +2454,7 @@ SRSASN_CODE mcch_msg_type_c::later_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c2: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -4268,67 +4153,9 @@ std::string sc_mcch_msg_type_r13_c::c1_c_::types_opts::to_string() const return convert_enum_idx(options, 1, value, "sc_mcch_msg_type_r13_c::c1_c_::types"); } -void sc_mcch_msg_type_r13_c::msg_class_ext_c_::destroy_() -{ - switch (type_) { - case types::c2: - c.destroy(); - break; - default: - break; - } -} void sc_mcch_msg_type_r13_c::msg_class_ext_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c2: - c.init(); - break; - case types::msg_class_ext_future_r14: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_"); - } -} -sc_mcch_msg_type_r13_c::msg_class_ext_c_::msg_class_ext_c_(const sc_mcch_msg_type_r13_c::msg_class_ext_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c2: - c.init(other.c.get()); - break; - case types::msg_class_ext_future_r14: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_"); - } -} -sc_mcch_msg_type_r13_c::msg_class_ext_c_& -sc_mcch_msg_type_r13_c::msg_class_ext_c_::operator=(const sc_mcch_msg_type_r13_c::msg_class_ext_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c2: - c.set(other.c.get()); - break; - case types::msg_class_ext_future_r14: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_"); - } - - return *this; } void sc_mcch_msg_type_r13_c::msg_class_ext_c_::to_json(json_writer& j) const { @@ -4336,7 +4163,7 @@ void sc_mcch_msg_type_r13_c::msg_class_ext_c_::to_json(json_writer& j) const switch (type_) { case types::c2: j.write_fieldname("c2"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext_future_r14: break; @@ -4350,7 +4177,7 @@ SRSASN_CODE sc_mcch_msg_type_r13_c::msg_class_ext_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c2: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext_future_r14: break; @@ -4367,7 +4194,7 @@ SRSASN_CODE sc_mcch_msg_type_r13_c::msg_class_ext_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c2: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext_future_r14: break; @@ -4653,40 +4480,6 @@ std::string visited_cell_info_r12_s::visited_cell_id_r12_c_::types_opts::to_stri return convert_enum_idx(options, 2, value, "visited_cell_info_r12_s::visited_cell_id_r12_c_::types"); } -// FailureReportSCG-v12d0 ::= SEQUENCE -SRSASN_CODE fail_report_scg_v12d0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(meas_result_neigh_cells_v12d0_present, 1)); - - if (meas_result_neigh_cells_v12d0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_v12d0, 1, 8)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE fail_report_scg_v12d0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(meas_result_neigh_cells_v12d0_present, 1)); - - if (meas_result_neigh_cells_v12d0_present) { - HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_v12d0, bref, 1, 8)); - } - - return SRSASN_SUCCESS; -} -void fail_report_scg_v12d0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (meas_result_neigh_cells_v12d0_present) { - j.start_array("measResultNeighCells-v12d0"); - for (const auto& e1 : meas_result_neigh_cells_v12d0) { - e1.to_json(j); - } - j.end_array(); - } - j.end_obj(); -} - std::string idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_::types_opts::to_string() const { static const char* options[] = {"subframeConfig0-r11", "subframeConfig1-5-r11", "subframeConfig6-r11"}; @@ -4729,44 +4522,6 @@ uint8_t rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::types_opts::to_numbe return map_enum_number(options, 21, value, "rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::types"); } -// SCGFailureInformation-v12d0b-IEs ::= SEQUENCE -SRSASN_CODE scg_fail_info_v12d0b_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(fail_report_scg_v12d0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (fail_report_scg_v12d0_present) { - HANDLE_CODE(fail_report_scg_v12d0.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE scg_fail_info_v12d0b_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(fail_report_scg_v12d0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (fail_report_scg_v12d0_present) { - HANDLE_CODE(fail_report_scg_v12d0.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void scg_fail_info_v12d0b_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (fail_report_scg_v12d0_present) { - j.write_fieldname("failureReportSCG-v12d0"); - fail_report_scg_v12d0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - std::string meas_results_s::meas_result_neigh_cells_c_::types_opts::to_string() const { static const char* options[] = {"measResultListEUTRA", @@ -5096,6 +4851,40 @@ band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_ options, 3, value, "band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_::types"); } +// FailureReportSCG-v12d0 ::= SEQUENCE +SRSASN_CODE fail_report_scg_v12d0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(meas_result_neigh_cells_v12d0_present, 1)); + + if (meas_result_neigh_cells_v12d0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_v12d0, 1, 8)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE fail_report_scg_v12d0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(meas_result_neigh_cells_v12d0_present, 1)); + + if (meas_result_neigh_cells_v12d0_present) { + HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_v12d0, bref, 1, 8)); + } + + return SRSASN_SUCCESS; +} +void fail_report_scg_v12d0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (meas_result_neigh_cells_v12d0_present) { + j.start_array("measResultNeighCells-v12d0"); + for (const auto& e1 : meas_result_neigh_cells_v12d0) { + e1.to_json(j); + } + j.end_array(); + } + j.end_obj(); +} + // MIMO-WeightedLayersCapabilities-r13 ::= SEQUENCE SRSASN_CODE mimo_weighted_layers_cap_r13_s::pack(bit_ref& bref) const { @@ -5320,34 +5109,36 @@ void phy_layer_params_v13e0_s::to_json(json_writer& j) const j.end_obj(); } -std::string mbms_params_v1470_s::mbms_max_bw_r14_c_::types_opts::to_string() const -{ - static const char* options[] = {"implicitValue", "explicitValue"}; - return convert_enum_idx(options, 2, value, "mbms_params_v1470_s::mbms_max_bw_r14_c_::types"); -} - -// UE-EUTRA-Capability-v13e0b-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v13e0b_ies_s::pack(bit_ref& bref) const +// SCGFailureInformation-v12d0b-IEs ::= SEQUENCE +SRSASN_CODE scg_fail_info_v12d0b_ies_s::pack(bit_ref& bref) const { + HANDLE_CODE(bref.pack(fail_report_scg_v12d0_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - HANDLE_CODE(phy_layer_params_v13e0.pack(bref)); + if (fail_report_scg_v12d0_present) { + HANDLE_CODE(fail_report_scg_v12d0.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE ue_eutra_cap_v13e0b_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE scg_fail_info_v12d0b_ies_s::unpack(cbit_ref& bref) { + HANDLE_CODE(bref.unpack(fail_report_scg_v12d0_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(phy_layer_params_v13e0.unpack(bref)); + if (fail_report_scg_v12d0_present) { + HANDLE_CODE(fail_report_scg_v12d0.unpack(bref)); + } return SRSASN_SUCCESS; } -void ue_eutra_cap_v13e0b_ies_s::to_json(json_writer& j) const +void scg_fail_info_v12d0b_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("phyLayerParameters-v13e0"); - phy_layer_params_v13e0.to_json(j); + if (fail_report_scg_v12d0_present) { + j.write_fieldname("failureReportSCG-v12d0"); + fail_report_scg_v12d0.to_json(j); + } if (non_crit_ext_present) { j.write_fieldname("nonCriticalExtension"); j.start_obj(); @@ -5356,36 +5147,34 @@ void ue_eutra_cap_v13e0b_ies_s::to_json(json_writer& j) const j.end_obj(); } -// SCG-Config-v12i0b-IEs ::= SEQUENCE -SRSASN_CODE scg_cfg_v12i0b_ies_s::pack(bit_ref& bref) const +std::string mbms_params_v1470_s::mbms_max_bw_r14_c_::types_opts::to_string() const +{ + static const char* options[] = {"implicitValue", "explicitValue"}; + return convert_enum_idx(options, 2, value, "mbms_params_v1470_s::mbms_max_bw_r14_c_::types"); +} + +// UE-EUTRA-Capability-v13e0b-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v13e0b_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(scg_radio_cfg_v12i0_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - if (scg_radio_cfg_v12i0_present) { - HANDLE_CODE(scg_radio_cfg_v12i0.pack(bref)); - } + HANDLE_CODE(phy_layer_params_v13e0.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE scg_cfg_v12i0b_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE ue_eutra_cap_v13e0b_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(scg_radio_cfg_v12i0_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - if (scg_radio_cfg_v12i0_present) { - HANDLE_CODE(scg_radio_cfg_v12i0.unpack(bref)); - } + HANDLE_CODE(phy_layer_params_v13e0.unpack(bref)); return SRSASN_SUCCESS; } -void scg_cfg_v12i0b_ies_s::to_json(json_writer& j) const +void ue_eutra_cap_v13e0b_ies_s::to_json(json_writer& j) const { j.start_obj(); - if (scg_radio_cfg_v12i0_present) { - j.write_fieldname("scg-RadioConfig-v12i0"); - scg_radio_cfg_v12i0.to_json(j); - } + j.write_fieldname("phyLayerParameters-v13e0"); + phy_layer_params_v13e0.to_json(j); if (non_crit_ext_present) { j.write_fieldname("nonCriticalExtension"); j.start_obj(); @@ -6095,6 +5884,44 @@ void sbcch_sl_bch_msg_v2x_r14_s::to_json(json_writer& j) const j.end_array(); } +// SCG-Config-v12i0b-IEs ::= SEQUENCE +SRSASN_CODE scg_cfg_v12i0b_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(scg_radio_cfg_v12i0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (scg_radio_cfg_v12i0_present) { + HANDLE_CODE(scg_radio_cfg_v12i0.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE scg_cfg_v12i0b_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(scg_radio_cfg_v12i0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (scg_radio_cfg_v12i0_present) { + HANDLE_CODE(scg_radio_cfg_v12i0.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void scg_cfg_v12i0b_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (scg_radio_cfg_v12i0_present) { + j.write_fieldname("scg-RadioConfig-v12i0"); + scg_radio_cfg_v12i0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} + // SCG-ConfigInfo-v1530-IEs ::= SEQUENCE SRSASN_CODE scg_cfg_info_v1530_ies_s::pack(bit_ref& bref) const { @@ -6606,67 +6433,9 @@ void scg_cfg_info_r12_s::to_json(json_writer& j) const j.end_obj(); } -void scg_cfg_info_r12_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void scg_cfg_info_r12_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_"); - } -} -scg_cfg_info_r12_s::crit_exts_c_::crit_exts_c_(const scg_cfg_info_r12_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_"); - } -} -scg_cfg_info_r12_s::crit_exts_c_& -scg_cfg_info_r12_s::crit_exts_c_::operator=(const scg_cfg_info_r12_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_"); - } - - return *this; } void scg_cfg_info_r12_s::crit_exts_c_::to_json(json_writer& j) const { @@ -6674,7 +6443,7 @@ void scg_cfg_info_r12_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -6688,7 +6457,7 @@ SRSASN_CODE scg_cfg_info_r12_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -6705,7 +6474,7 @@ SRSASN_CODE scg_cfg_info_r12_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; diff --git a/lib/src/asn1/rrc/bcch_msg.cc b/lib/src/asn1/rrc/bcch_msg.cc index be646a9b9..9bfdf2575 100644 --- a/lib/src/asn1/rrc/bcch_msg.cc +++ b/lib/src/asn1/rrc/bcch_msg.cc @@ -49,91 +49,71 @@ void bcch_bch_msg_s::to_json(json_writer& j) const j.end_array(); } -// SIB-Type-v12j0 ::= ENUMERATED -std::string sib_type_v12j0_opts::to_string() const -{ - static const char* options[] = {"sibType19-v1250", - "sibType20-v1310", - "sibType21-v1430", - "sibType24-v1530", - "sibType25-v1530", - "sibType26-v1530", - "spare10", - "spare9", - "spare8", - "spare7", - "spare6", - "spare5", - "spare4", - "spare3", - "spare2", - "spare1"}; - return convert_enum_idx(options, 16, value, "sib_type_v12j0_e"); -} -uint8_t sib_type_v12j0_opts::to_number() const -{ - static const uint8_t options[] = {19, 20, 21, 24, 25, 26}; - return map_enum_number(options, 6, value, "sib_type_v12j0_e"); -} - -// NS-PmaxValue-v10l0 ::= SEQUENCE -SRSASN_CODE ns_pmax_value_v10l0_s::pack(bit_ref& bref) const +// BandClassInfoCDMA2000 ::= SEQUENCE +SRSASN_CODE band_class_info_cdma2000_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(add_spec_emission_v10l0_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(cell_resel_prio_present, 1)); - if (add_spec_emission_v10l0_present) { - HANDLE_CODE(pack_integer(bref, add_spec_emission_v10l0, (uint16_t)33u, (uint16_t)288u)); + HANDLE_CODE(band_class.pack(bref)); + if (cell_resel_prio_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); } + HANDLE_CODE(pack_integer(bref, thresh_x_high, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(pack_integer(bref, thresh_x_low, (uint8_t)0u, (uint8_t)63u)); return SRSASN_SUCCESS; } -SRSASN_CODE ns_pmax_value_v10l0_s::unpack(cbit_ref& bref) +SRSASN_CODE band_class_info_cdma2000_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(add_spec_emission_v10l0_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(cell_resel_prio_present, 1)); - if (add_spec_emission_v10l0_present) { - HANDLE_CODE(unpack_integer(add_spec_emission_v10l0, bref, (uint16_t)33u, (uint16_t)288u)); + HANDLE_CODE(band_class.unpack(bref)); + if (cell_resel_prio_present) { + HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); } + HANDLE_CODE(unpack_integer(thresh_x_high, bref, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(unpack_integer(thresh_x_low, bref, (uint8_t)0u, (uint8_t)63u)); return SRSASN_SUCCESS; } -void ns_pmax_value_v10l0_s::to_json(json_writer& j) const +void band_class_info_cdma2000_s::to_json(json_writer& j) const { j.start_obj(); - if (add_spec_emission_v10l0_present) { - j.write_int("additionalSpectrumEmission-v10l0", add_spec_emission_v10l0); + j.write_str("bandClass", band_class.to_string()); + if (cell_resel_prio_present) { + j.write_int("cellReselectionPriority", cell_resel_prio); } + j.write_int("threshX-High", thresh_x_high); + j.write_int("threshX-Low", thresh_x_low); j.end_obj(); } -// InterFreqCarrierFreqInfo-v1360 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v1360_s::pack(bit_ref& bref) const +// NeighCellsPerBandclassCDMA2000-r11 ::= SEQUENCE +SRSASN_CODE neigh_cells_per_bandclass_cdma2000_r11_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(cell_sel_info_ce1_v1360_present, 1)); - - if (cell_sel_info_ce1_v1360_present) { - HANDLE_CODE(cell_sel_info_ce1_v1360.pack(bref)); - } + HANDLE_CODE(pack_integer(bref, arfcn, (uint16_t)0u, (uint16_t)2047u)); + HANDLE_CODE(pack_dyn_seq_of(bref, pci_list_r11, 1, 40, integer_packer(0, 511))); return SRSASN_SUCCESS; } -SRSASN_CODE inter_freq_carrier_freq_info_v1360_s::unpack(cbit_ref& bref) +SRSASN_CODE neigh_cells_per_bandclass_cdma2000_r11_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(cell_sel_info_ce1_v1360_present, 1)); - - if (cell_sel_info_ce1_v1360_present) { - HANDLE_CODE(cell_sel_info_ce1_v1360.unpack(bref)); - } + HANDLE_CODE(unpack_integer(arfcn, bref, (uint16_t)0u, (uint16_t)2047u)); + HANDLE_CODE(unpack_dyn_seq_of(pci_list_r11, bref, 1, 40, integer_packer(0, 511))); return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v1360_s::to_json(json_writer& j) const +void neigh_cells_per_bandclass_cdma2000_r11_s::to_json(json_writer& j) const { j.start_obj(); - if (cell_sel_info_ce1_v1360_present) { - j.write_fieldname("cellSelectionInfoCE1-v1360"); - cell_sel_info_ce1_v1360.to_json(j); + j.write_int("arfcn", arfcn); + j.start_array("physCellIdList-r11"); + for (const auto& e1 : pci_list_r11) { + j.write_int(e1); } + j.end_array(); j.end_obj(); } @@ -170,7222 +150,7478 @@ void ns_pmax_value_r10_s::to_json(json_writer& j) const j.end_obj(); } -// SchedulingInfo-v12j0 ::= SEQUENCE -SRSASN_CODE sched_info_v12j0_s::pack(bit_ref& bref) const +// NS-PmaxValueNR-r15 ::= SEQUENCE +SRSASN_CODE ns_pmax_value_nr_r15_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(sib_map_info_v12j0_present, 1)); + HANDLE_CODE(bref.pack(add_pmax_nr_r15_present, 1)); - if (sib_map_info_v12j0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, sib_map_info_v12j0, 1, 31)); + if (add_pmax_nr_r15_present) { + HANDLE_CODE(pack_integer(bref, add_pmax_nr_r15, (int8_t)-30, (int8_t)33)); } + HANDLE_CODE(pack_integer(bref, add_spec_emission_nr_r15, (uint8_t)0u, (uint8_t)7u)); return SRSASN_SUCCESS; } -SRSASN_CODE sched_info_v12j0_s::unpack(cbit_ref& bref) +SRSASN_CODE ns_pmax_value_nr_r15_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(sib_map_info_v12j0_present, 1)); + HANDLE_CODE(bref.unpack(add_pmax_nr_r15_present, 1)); - if (sib_map_info_v12j0_present) { - HANDLE_CODE(unpack_dyn_seq_of(sib_map_info_v12j0, bref, 1, 31)); + if (add_pmax_nr_r15_present) { + HANDLE_CODE(unpack_integer(add_pmax_nr_r15, bref, (int8_t)-30, (int8_t)33)); } + HANDLE_CODE(unpack_integer(add_spec_emission_nr_r15, bref, (uint8_t)0u, (uint8_t)7u)); return SRSASN_SUCCESS; } -void sched_info_v12j0_s::to_json(json_writer& j) const +void ns_pmax_value_nr_r15_s::to_json(json_writer& j) const { j.start_obj(); - if (sib_map_info_v12j0_present) { - j.start_array("sib-MappingInfo-v12j0"); - for (const auto& e1 : sib_map_info_v12j0) { - j.write_str(e1.to_string()); - } - j.end_array(); + if (add_pmax_nr_r15_present) { + j.write_int("additionalPmaxNR-r15", add_pmax_nr_r15); } + j.write_int("additionalSpectrumEmissionNR-r15", add_spec_emission_nr_r15); j.end_obj(); } -// SchedulingInfoExt-r12 ::= SEQUENCE -SRSASN_CODE sched_info_ext_r12_s::pack(bit_ref& bref) const +// NeighCellCDMA2000-r11 ::= SEQUENCE +SRSASN_CODE neigh_cell_cdma2000_r11_s::pack(bit_ref& bref) const { - HANDLE_CODE(si_periodicity_r12.pack(bref)); - HANDLE_CODE(pack_dyn_seq_of(bref, sib_map_info_r12, 1, 31)); + HANDLE_CODE(band_class.pack(bref)); + HANDLE_CODE(pack_dyn_seq_of(bref, neigh_freq_info_list_r11, 1, 16)); return SRSASN_SUCCESS; } -SRSASN_CODE sched_info_ext_r12_s::unpack(cbit_ref& bref) +SRSASN_CODE neigh_cell_cdma2000_r11_s::unpack(cbit_ref& bref) { - HANDLE_CODE(si_periodicity_r12.unpack(bref)); - HANDLE_CODE(unpack_dyn_seq_of(sib_map_info_r12, bref, 1, 31)); + HANDLE_CODE(band_class.unpack(bref)); + HANDLE_CODE(unpack_dyn_seq_of(neigh_freq_info_list_r11, bref, 1, 16)); return SRSASN_SUCCESS; } -void sched_info_ext_r12_s::to_json(json_writer& j) const +void neigh_cell_cdma2000_r11_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("si-Periodicity-r12", si_periodicity_r12.to_string()); - j.start_array("sib-MappingInfo-r12"); - for (const auto& e1 : sib_map_info_r12) { - j.write_str(e1.to_string()); + j.write_str("bandClass", band_class.to_string()); + j.start_array("neighFreqInfoList-r11"); + for (const auto& e1 : neigh_freq_info_list_r11) { + e1.to_json(j); } j.end_array(); j.end_obj(); } -// BandClassInfoCDMA2000 ::= SEQUENCE -SRSASN_CODE band_class_info_cdma2000_s::pack(bit_ref& bref) const +// NeighCellsPerBandclassCDMA2000 ::= SEQUENCE +SRSASN_CODE neigh_cells_per_bandclass_cdma2000_s::pack(bit_ref& bref) const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(cell_resel_prio_present, 1)); - - HANDLE_CODE(band_class.pack(bref)); - if (cell_resel_prio_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); - } - HANDLE_CODE(pack_integer(bref, thresh_x_high, (uint8_t)0u, (uint8_t)63u)); - HANDLE_CODE(pack_integer(bref, thresh_x_low, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(pack_integer(bref, arfcn, (uint16_t)0u, (uint16_t)2047u)); + HANDLE_CODE(pack_dyn_seq_of(bref, pci_list, 1, 16, integer_packer(0, 511))); return SRSASN_SUCCESS; } -SRSASN_CODE band_class_info_cdma2000_s::unpack(cbit_ref& bref) +SRSASN_CODE neigh_cells_per_bandclass_cdma2000_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(cell_resel_prio_present, 1)); - - HANDLE_CODE(band_class.unpack(bref)); - if (cell_resel_prio_present) { - HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); - } - HANDLE_CODE(unpack_integer(thresh_x_high, bref, (uint8_t)0u, (uint8_t)63u)); - HANDLE_CODE(unpack_integer(thresh_x_low, bref, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(unpack_integer(arfcn, bref, (uint16_t)0u, (uint16_t)2047u)); + HANDLE_CODE(unpack_dyn_seq_of(pci_list, bref, 1, 16, integer_packer(0, 511))); return SRSASN_SUCCESS; } -void band_class_info_cdma2000_s::to_json(json_writer& j) const +void neigh_cells_per_bandclass_cdma2000_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("bandClass", band_class.to_string()); - if (cell_resel_prio_present) { - j.write_int("cellReselectionPriority", cell_resel_prio); + j.write_int("arfcn", arfcn); + j.start_array("physCellIdList"); + for (const auto& e1 : pci_list) { + j.write_int(e1); } - j.write_int("threshX-High", thresh_x_high); - j.write_int("threshX-Low", thresh_x_low); + j.end_array(); j.end_obj(); } -// NeighCellsPerBandclassCDMA2000-r11 ::= SEQUENCE -SRSASN_CODE neigh_cells_per_bandclass_cdma2000_r11_s::pack(bit_ref& bref) const +// NeighCellsPerBandclassCDMA2000-v920 ::= SEQUENCE +SRSASN_CODE neigh_cells_per_bandclass_cdma2000_v920_s::pack(bit_ref& bref) const { - HANDLE_CODE(pack_integer(bref, arfcn, (uint16_t)0u, (uint16_t)2047u)); - HANDLE_CODE(pack_dyn_seq_of(bref, pci_list_r11, 1, 40, integer_packer(0, 511))); + HANDLE_CODE(pack_dyn_seq_of(bref, pci_list_v920, 0, 24, integer_packer(0, 511))); return SRSASN_SUCCESS; } -SRSASN_CODE neigh_cells_per_bandclass_cdma2000_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE neigh_cells_per_bandclass_cdma2000_v920_s::unpack(cbit_ref& bref) { - HANDLE_CODE(unpack_integer(arfcn, bref, (uint16_t)0u, (uint16_t)2047u)); - HANDLE_CODE(unpack_dyn_seq_of(pci_list_r11, bref, 1, 40, integer_packer(0, 511))); + HANDLE_CODE(unpack_dyn_seq_of(pci_list_v920, bref, 0, 24, integer_packer(0, 511))); return SRSASN_SUCCESS; } -void neigh_cells_per_bandclass_cdma2000_r11_s::to_json(json_writer& j) const +void neigh_cells_per_bandclass_cdma2000_v920_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("arfcn", arfcn); - j.start_array("physCellIdList-r11"); - for (const auto& e1 : pci_list_r11) { + j.start_array("physCellIdList-v920"); + for (const auto& e1 : pci_list_v920) { j.write_int(e1); } j.end_array(); j.end_obj(); } -// SystemInformationBlockType2-v13c0-IEs ::= SEQUENCE -SRSASN_CODE sib_type2_v13c0_ies_s::pack(bit_ref& bref) const +// RedistributionNeighCell-r13 ::= SEQUENCE +SRSASN_CODE redist_neigh_cell_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_v13c0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (ul_pwr_ctrl_common_v13c0_present) { - HANDLE_CODE(ul_pwr_ctrl_common_v13c0.pack(bref)); - } + HANDLE_CODE(pack_integer(bref, pci_r13, (uint16_t)0u, (uint16_t)503u)); + HANDLE_CODE(pack_integer(bref, redist_factor_cell_r13, (uint8_t)1u, (uint8_t)10u)); return SRSASN_SUCCESS; } -SRSASN_CODE sib_type2_v13c0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE redist_neigh_cell_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_v13c0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (ul_pwr_ctrl_common_v13c0_present) { - HANDLE_CODE(ul_pwr_ctrl_common_v13c0.unpack(bref)); - } + HANDLE_CODE(unpack_integer(pci_r13, bref, (uint16_t)0u, (uint16_t)503u)); + HANDLE_CODE(unpack_integer(redist_factor_cell_r13, bref, (uint8_t)1u, (uint8_t)10u)); return SRSASN_SUCCESS; } -void sib_type2_v13c0_ies_s::to_json(json_writer& j) const +void redist_neigh_cell_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (ul_pwr_ctrl_common_v13c0_present) { - j.write_fieldname("uplinkPowerControlCommon-v13c0"); - ul_pwr_ctrl_common_v13c0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } + j.write_int("physCellId-r13", pci_r13); + j.write_int("redistributionFactorCell-r13", redist_factor_cell_r13); j.end_obj(); } -// InterFreqCarrierFreqInfo-v10l0 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v10l0_s::pack(bit_ref& bref) const +// AC-BarringConfig1XRTT-r9 ::= SEQUENCE +SRSASN_CODE ac_barr_cfg1_xrtt_r9_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(freq_band_info_v10l0_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v10l0_present, 1)); - - if (freq_band_info_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_v10l0, 1, 8)); - } - if (multi_band_info_list_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10l0, 1, 8, SeqOfPacker(1, 8, Packer()))); - } - - return SRSASN_SUCCESS; + HANDLE_CODE(pack_integer(bref, ac_barr0to9_r9, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(pack_integer(bref, ac_barr10_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(pack_integer(bref, ac_barr11_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(pack_integer(bref, ac_barr12_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(pack_integer(bref, ac_barr13_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(pack_integer(bref, ac_barr14_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(pack_integer(bref, ac_barr15_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(pack_integer(bref, ac_barr_msg_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(pack_integer(bref, ac_barr_reg_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(pack_integer(bref, ac_barr_emg_r9, (uint8_t)0u, (uint8_t)7u)); + + return SRSASN_SUCCESS; } -SRSASN_CODE inter_freq_carrier_freq_info_v10l0_s::unpack(cbit_ref& bref) +SRSASN_CODE ac_barr_cfg1_xrtt_r9_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(freq_band_info_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v10l0_present, 1)); - - if (freq_band_info_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_v10l0, bref, 1, 8)); - } - if (multi_band_info_list_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10l0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); - } + HANDLE_CODE(unpack_integer(ac_barr0to9_r9, bref, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(unpack_integer(ac_barr10_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(unpack_integer(ac_barr11_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(unpack_integer(ac_barr12_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(unpack_integer(ac_barr13_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(unpack_integer(ac_barr14_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(unpack_integer(ac_barr15_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(unpack_integer(ac_barr_msg_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(unpack_integer(ac_barr_reg_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(unpack_integer(ac_barr_emg_r9, bref, (uint8_t)0u, (uint8_t)7u)); return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v10l0_s::to_json(json_writer& j) const +void ac_barr_cfg1_xrtt_r9_s::to_json(json_writer& j) const { j.start_obj(); - if (freq_band_info_v10l0_present) { - j.start_array("freqBandInfo-v10l0"); - for (const auto& e1 : freq_band_info_v10l0) { - e1.to_json(j); - } - j.end_array(); - } - if (multi_band_info_list_v10l0_present) { - j.start_array("multiBandInfoList-v10l0"); - for (const auto& e1 : multi_band_info_list_v10l0) { - j.start_array(); - for (const auto& e2 : e1) { - e2.to_json(j); - } - j.end_array(); - } - j.end_array(); - } + j.write_int("ac-Barring0to9-r9", ac_barr0to9_r9); + j.write_int("ac-Barring10-r9", ac_barr10_r9); + j.write_int("ac-Barring11-r9", ac_barr11_r9); + j.write_int("ac-Barring12-r9", ac_barr12_r9); + j.write_int("ac-Barring13-r9", ac_barr13_r9); + j.write_int("ac-Barring14-r9", ac_barr14_r9); + j.write_int("ac-Barring15-r9", ac_barr15_r9); + j.write_int("ac-BarringMsg-r9", ac_barr_msg_r9); + j.write_int("ac-BarringReg-r9", ac_barr_reg_r9); + j.write_int("ac-BarringEmg-r9", ac_barr_emg_r9); j.end_obj(); } -// MultiBandInfo-v9e0 ::= SEQUENCE -SRSASN_CODE multi_band_info_v9e0_s::pack(bit_ref& bref) const +// CSFB-RegistrationParam1XRTT ::= SEQUENCE +SRSASN_CODE csfb_regist_param1_xrtt_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(freq_band_ind_v9e0_present, 1)); - - if (freq_band_ind_v9e0_present) { - HANDLE_CODE(pack_integer(bref, freq_band_ind_v9e0, (uint16_t)65u, (uint16_t)256u)); - } + HANDLE_CODE(sid.pack(bref)); + HANDLE_CODE(nid.pack(bref)); + HANDLE_CODE(bref.pack(multiple_sid, 1)); + HANDLE_CODE(bref.pack(multiple_nid, 1)); + HANDLE_CODE(bref.pack(home_reg, 1)); + HANDLE_CODE(bref.pack(foreign_sid_reg, 1)); + HANDLE_CODE(bref.pack(foreign_nid_reg, 1)); + HANDLE_CODE(bref.pack(param_reg, 1)); + HANDLE_CODE(bref.pack(pwr_up_reg, 1)); + HANDLE_CODE(regist_period.pack(bref)); + HANDLE_CODE(regist_zone.pack(bref)); + HANDLE_CODE(total_zone.pack(bref)); + HANDLE_CODE(zone_timer.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE multi_band_info_v9e0_s::unpack(cbit_ref& bref) +SRSASN_CODE csfb_regist_param1_xrtt_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(freq_band_ind_v9e0_present, 1)); - - if (freq_band_ind_v9e0_present) { - HANDLE_CODE(unpack_integer(freq_band_ind_v9e0, bref, (uint16_t)65u, (uint16_t)256u)); - } + HANDLE_CODE(sid.unpack(bref)); + HANDLE_CODE(nid.unpack(bref)); + HANDLE_CODE(bref.unpack(multiple_sid, 1)); + HANDLE_CODE(bref.unpack(multiple_nid, 1)); + HANDLE_CODE(bref.unpack(home_reg, 1)); + HANDLE_CODE(bref.unpack(foreign_sid_reg, 1)); + HANDLE_CODE(bref.unpack(foreign_nid_reg, 1)); + HANDLE_CODE(bref.unpack(param_reg, 1)); + HANDLE_CODE(bref.unpack(pwr_up_reg, 1)); + HANDLE_CODE(regist_period.unpack(bref)); + HANDLE_CODE(regist_zone.unpack(bref)); + HANDLE_CODE(total_zone.unpack(bref)); + HANDLE_CODE(zone_timer.unpack(bref)); return SRSASN_SUCCESS; } -void multi_band_info_v9e0_s::to_json(json_writer& j) const +void csfb_regist_param1_xrtt_s::to_json(json_writer& j) const { j.start_obj(); - if (freq_band_ind_v9e0_present) { - j.write_int("freqBandIndicator-v9e0", freq_band_ind_v9e0); - } + j.write_str("sid", sid.to_string()); + j.write_str("nid", nid.to_string()); + j.write_bool("multipleSID", multiple_sid); + j.write_bool("multipleNID", multiple_nid); + j.write_bool("homeReg", home_reg); + j.write_bool("foreignSIDReg", foreign_sid_reg); + j.write_bool("foreignNIDReg", foreign_nid_reg); + j.write_bool("parameterReg", param_reg); + j.write_bool("powerUpReg", pwr_up_reg); + j.write_str("registrationPeriod", regist_period.to_string()); + j.write_str("registrationZone", regist_zone.to_string()); + j.write_str("totalZone", total_zone.to_string()); + j.write_str("zoneTimer", zone_timer.to_string()); j.end_obj(); } -// NS-PmaxValueNR-r15 ::= SEQUENCE -SRSASN_CODE ns_pmax_value_nr_r15_s::pack(bit_ref& bref) const +// CSFB-RegistrationParam1XRTT-v920 ::= SEQUENCE +SRSASN_CODE csfb_regist_param1_xrtt_v920_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(add_pmax_nr_r15_present, 1)); - - if (add_pmax_nr_r15_present) { - HANDLE_CODE(pack_integer(bref, add_pmax_nr_r15, (int8_t)-30, (int8_t)33)); - } - HANDLE_CODE(pack_integer(bref, add_spec_emission_nr_r15, (uint8_t)0u, (uint8_t)7u)); - return SRSASN_SUCCESS; } -SRSASN_CODE ns_pmax_value_nr_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE csfb_regist_param1_xrtt_v920_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(add_pmax_nr_r15_present, 1)); - - if (add_pmax_nr_r15_present) { - HANDLE_CODE(unpack_integer(add_pmax_nr_r15, bref, (int8_t)-30, (int8_t)33)); - } - HANDLE_CODE(unpack_integer(add_spec_emission_nr_r15, bref, (uint8_t)0u, (uint8_t)7u)); - return SRSASN_SUCCESS; } -void ns_pmax_value_nr_r15_s::to_json(json_writer& j) const +void csfb_regist_param1_xrtt_v920_s::to_json(json_writer& j) const { j.start_obj(); - if (add_pmax_nr_r15_present) { - j.write_int("additionalPmaxNR-r15", add_pmax_nr_r15); - } - j.write_int("additionalSpectrumEmissionNR-r15", add_spec_emission_nr_r15); + j.write_str("powerDownReg-r9", "true"); j.end_obj(); } -// NeighCellCDMA2000-r11 ::= SEQUENCE -SRSASN_CODE neigh_cell_cdma2000_r11_s::pack(bit_ref& bref) const +// CellReselectionParametersCDMA2000-r11 ::= SEQUENCE +SRSASN_CODE cell_resel_params_cdma2000_r11_s::pack(bit_ref& bref) const { - HANDLE_CODE(band_class.pack(bref)); - HANDLE_CODE(pack_dyn_seq_of(bref, neigh_freq_info_list_r11, 1, 16)); + HANDLE_CODE(bref.pack(t_resel_cdma2000_sf_present, 1)); + + HANDLE_CODE(pack_dyn_seq_of(bref, band_class_list, 1, 32)); + HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cell_list_r11, 1, 16)); + HANDLE_CODE(pack_integer(bref, t_resel_cdma2000, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_cdma2000_sf_present) { + HANDLE_CODE(t_resel_cdma2000_sf.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE neigh_cell_cdma2000_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE cell_resel_params_cdma2000_r11_s::unpack(cbit_ref& bref) { - HANDLE_CODE(band_class.unpack(bref)); - HANDLE_CODE(unpack_dyn_seq_of(neigh_freq_info_list_r11, bref, 1, 16)); + HANDLE_CODE(bref.unpack(t_resel_cdma2000_sf_present, 1)); + + HANDLE_CODE(unpack_dyn_seq_of(band_class_list, bref, 1, 32)); + HANDLE_CODE(unpack_dyn_seq_of(neigh_cell_list_r11, bref, 1, 16)); + HANDLE_CODE(unpack_integer(t_resel_cdma2000, bref, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_cdma2000_sf_present) { + HANDLE_CODE(t_resel_cdma2000_sf.unpack(bref)); + } return SRSASN_SUCCESS; } -void neigh_cell_cdma2000_r11_s::to_json(json_writer& j) const +void cell_resel_params_cdma2000_r11_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("bandClass", band_class.to_string()); - j.start_array("neighFreqInfoList-r11"); - for (const auto& e1 : neigh_freq_info_list_r11) { + j.start_array("bandClassList"); + for (const auto& e1 : band_class_list) { e1.to_json(j); } j.end_array(); - j.end_obj(); -} - -// NeighCellsPerBandclassCDMA2000 ::= SEQUENCE -SRSASN_CODE neigh_cells_per_bandclass_cdma2000_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pack_integer(bref, arfcn, (uint16_t)0u, (uint16_t)2047u)); - HANDLE_CODE(pack_dyn_seq_of(bref, pci_list, 1, 16, integer_packer(0, 511))); - - return SRSASN_SUCCESS; -} -SRSASN_CODE neigh_cells_per_bandclass_cdma2000_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(arfcn, bref, (uint16_t)0u, (uint16_t)2047u)); - HANDLE_CODE(unpack_dyn_seq_of(pci_list, bref, 1, 16, integer_packer(0, 511))); - - return SRSASN_SUCCESS; -} -void neigh_cells_per_bandclass_cdma2000_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("arfcn", arfcn); - j.start_array("physCellIdList"); - for (const auto& e1 : pci_list) { - j.write_int(e1); + j.start_array("neighCellList-r11"); + for (const auto& e1 : neigh_cell_list_r11) { + e1.to_json(j); } j.end_array(); + j.write_int("t-ReselectionCDMA2000", t_resel_cdma2000); + if (t_resel_cdma2000_sf_present) { + j.write_fieldname("t-ReselectionCDMA2000-SF"); + t_resel_cdma2000_sf.to_json(j); + } j.end_obj(); } -// NeighCellsPerBandclassCDMA2000-v920 ::= SEQUENCE -SRSASN_CODE neigh_cells_per_bandclass_cdma2000_v920_s::pack(bit_ref& bref) const +// InterFreqNeighCellInfo ::= SEQUENCE +SRSASN_CODE inter_freq_neigh_cell_info_s::pack(bit_ref& bref) const { - HANDLE_CODE(pack_dyn_seq_of(bref, pci_list_v920, 0, 24, integer_packer(0, 511))); + HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)503u)); + HANDLE_CODE(q_offset_cell.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE neigh_cells_per_bandclass_cdma2000_v920_s::unpack(cbit_ref& bref) +SRSASN_CODE inter_freq_neigh_cell_info_s::unpack(cbit_ref& bref) { - HANDLE_CODE(unpack_dyn_seq_of(pci_list_v920, bref, 0, 24, integer_packer(0, 511))); + HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)503u)); + HANDLE_CODE(q_offset_cell.unpack(bref)); return SRSASN_SUCCESS; } -void neigh_cells_per_bandclass_cdma2000_v920_s::to_json(json_writer& j) const +void inter_freq_neigh_cell_info_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("physCellIdList-v920"); - for (const auto& e1 : pci_list_v920) { - j.write_int(e1); - } - j.end_array(); + j.write_int("physCellId", pci); + j.write_str("q-OffsetCell", q_offset_cell.to_string()); j.end_obj(); } -// RedistributionNeighCell-r13 ::= SEQUENCE -SRSASN_CODE redist_neigh_cell_r13_s::pack(bit_ref& bref) const +// PLMN-IdentityInfo2-r12 ::= CHOICE +void plmn_id_info2_r12_c::destroy_() { - HANDLE_CODE(pack_integer(bref, pci_r13, (uint16_t)0u, (uint16_t)503u)); - HANDLE_CODE(pack_integer(bref, redist_factor_cell_r13, (uint8_t)1u, (uint8_t)10u)); - - return SRSASN_SUCCESS; + switch (type_) { + case types::plmn_id_r12: + c.destroy(); + break; + default: + break; + } } -SRSASN_CODE redist_neigh_cell_r13_s::unpack(cbit_ref& bref) +void plmn_id_info2_r12_c::set(types::options e) { - HANDLE_CODE(unpack_integer(pci_r13, bref, (uint16_t)0u, (uint16_t)503u)); - HANDLE_CODE(unpack_integer(redist_factor_cell_r13, bref, (uint8_t)1u, (uint8_t)10u)); - - return SRSASN_SUCCESS; -} -void redist_neigh_cell_r13_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("physCellId-r13", pci_r13); - j.write_int("redistributionFactorCell-r13", redist_factor_cell_r13); - j.end_obj(); + destroy_(); + type_ = e; + switch (type_) { + case types::plmn_idx_r12: + break; + case types::plmn_id_r12: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + } } - -// SystemInformationBlockType1-v12j0-IEs ::= SEQUENCE -SRSASN_CODE sib_type1_v12j0_ies_s::pack(bit_ref& bref) const +plmn_id_info2_r12_c::plmn_id_info2_r12_c(const plmn_id_info2_r12_c& other) { - HANDLE_CODE(bref.pack(sched_info_list_v12j0_present, 1)); - HANDLE_CODE(bref.pack(sched_info_list_ext_r12_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (sched_info_list_v12j0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, sched_info_list_v12j0, 1, 32)); - } - if (sched_info_list_ext_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, sched_info_list_ext_r12, 1, 32)); + type_ = other.type(); + switch (type_) { + case types::plmn_idx_r12: + c.init(other.c.get()); + break; + case types::plmn_id_r12: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); } - - return SRSASN_SUCCESS; } -SRSASN_CODE sib_type1_v12j0_ies_s::unpack(cbit_ref& bref) +plmn_id_info2_r12_c& plmn_id_info2_r12_c::operator=(const plmn_id_info2_r12_c& other) { - HANDLE_CODE(bref.unpack(sched_info_list_v12j0_present, 1)); - HANDLE_CODE(bref.unpack(sched_info_list_ext_r12_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (sched_info_list_v12j0_present) { - HANDLE_CODE(unpack_dyn_seq_of(sched_info_list_v12j0, bref, 1, 32)); + if (this == &other) { + return *this; } - if (sched_info_list_ext_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(sched_info_list_ext_r12, bref, 1, 32)); + set(other.type()); + switch (type_) { + case types::plmn_idx_r12: + c.set(other.c.get()); + break; + case types::plmn_id_r12: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); } - return SRSASN_SUCCESS; + return *this; } -void sib_type1_v12j0_ies_s::to_json(json_writer& j) const +void plmn_id_info2_r12_c::to_json(json_writer& j) const { j.start_obj(); - if (sched_info_list_v12j0_present) { - j.start_array("schedulingInfoList-v12j0"); - for (const auto& e1 : sched_info_list_v12j0) { - e1.to_json(j); - } - j.end_array(); - } - if (sched_info_list_ext_r12_present) { - j.start_array("schedulingInfoListExt-r12"); - for (const auto& e1 : sched_info_list_ext_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); + switch (type_) { + case types::plmn_idx_r12: + j.write_int("plmn-Index-r12", c.get()); + break; + case types::plmn_id_r12: + j.write_fieldname("plmnIdentity-r12"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); } j.end_obj(); } - -// SystemInformationBlockType2-v10n0-IEs ::= SEQUENCE -SRSASN_CODE sib_type2_v10n0_ies_s::pack(bit_ref& bref) const +SRSASN_CODE plmn_id_info2_r12_c::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + type_.pack(bref); + switch (type_) { + case types::plmn_idx_r12: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)1u, (uint8_t)6u)); + break; + case types::plmn_id_r12: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + return SRSASN_ERROR_ENCODE_FAIL; } - return SRSASN_SUCCESS; } -SRSASN_CODE sib_type2_v10n0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE plmn_id_info2_r12_c::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::plmn_idx_r12: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)1u, (uint8_t)6u)); + break; + case types::plmn_id_r12: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + return SRSASN_ERROR_DECODE_FAIL; } - return SRSASN_SUCCESS; } -void sib_type2_v10n0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} -// SystemInformationBlockType5-v13a0-IEs ::= SEQUENCE -SRSASN_CODE sib_type5_v13a0_ies_s::pack(bit_ref& bref) const +// SystemTimeInfoCDMA2000 ::= SEQUENCE +SRSASN_CODE sys_time_info_cdma2000_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v13a0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (inter_freq_carrier_freq_list_v13a0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v13a0, 1, 8)); - } + HANDLE_CODE(bref.pack(cdma_eutra_synchronisation, 1)); + HANDLE_CODE(cdma_sys_time.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE sib_type5_v13a0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE sys_time_info_cdma2000_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v13a0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (inter_freq_carrier_freq_list_v13a0_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v13a0, bref, 1, 8)); - } + HANDLE_CODE(bref.unpack(cdma_eutra_synchronisation, 1)); + HANDLE_CODE(cdma_sys_time.unpack(bref)); return SRSASN_SUCCESS; } -void sib_type5_v13a0_ies_s::to_json(json_writer& j) const +void sys_time_info_cdma2000_s::to_json(json_writer& j) const { j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (inter_freq_carrier_freq_list_v13a0_present) { - j.start_array("interFreqCarrierFreqList-v13a0"); - for (const auto& e1 : inter_freq_carrier_freq_list_v13a0) { - e1.to_json(j); - } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } + j.write_bool("cdma-EUTRA-Synchronisation", cdma_eutra_synchronisation); + j.write_fieldname("cdma-SystemTime"); + cdma_sys_time.to_json(j); j.end_obj(); } -// AC-BarringConfig1XRTT-r9 ::= SEQUENCE -SRSASN_CODE ac_barr_cfg1_xrtt_r9_s::pack(bit_ref& bref) const +void sys_time_info_cdma2000_s::cdma_sys_time_c_::destroy_() { - HANDLE_CODE(pack_integer(bref, ac_barr0to9_r9, (uint8_t)0u, (uint8_t)63u)); - HANDLE_CODE(pack_integer(bref, ac_barr10_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(pack_integer(bref, ac_barr11_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(pack_integer(bref, ac_barr12_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(pack_integer(bref, ac_barr13_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(pack_integer(bref, ac_barr14_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(pack_integer(bref, ac_barr15_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(pack_integer(bref, ac_barr_msg_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(pack_integer(bref, ac_barr_reg_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(pack_integer(bref, ac_barr_emg_r9, (uint8_t)0u, (uint8_t)7u)); - - return SRSASN_SUCCESS; + switch (type_) { + case types::sync_sys_time: + c.destroy >(); + break; + case types::async_sys_time: + c.destroy >(); + break; + default: + break; + } } -SRSASN_CODE ac_barr_cfg1_xrtt_r9_s::unpack(cbit_ref& bref) +void sys_time_info_cdma2000_s::cdma_sys_time_c_::set(types::options e) { - HANDLE_CODE(unpack_integer(ac_barr0to9_r9, bref, (uint8_t)0u, (uint8_t)63u)); - HANDLE_CODE(unpack_integer(ac_barr10_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(unpack_integer(ac_barr11_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(unpack_integer(ac_barr12_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(unpack_integer(ac_barr13_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(unpack_integer(ac_barr14_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(unpack_integer(ac_barr15_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(unpack_integer(ac_barr_msg_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(unpack_integer(ac_barr_reg_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(unpack_integer(ac_barr_emg_r9, bref, (uint8_t)0u, (uint8_t)7u)); - - return SRSASN_SUCCESS; -} -void ac_barr_cfg1_xrtt_r9_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("ac-Barring0to9-r9", ac_barr0to9_r9); - j.write_int("ac-Barring10-r9", ac_barr10_r9); - j.write_int("ac-Barring11-r9", ac_barr11_r9); - j.write_int("ac-Barring12-r9", ac_barr12_r9); - j.write_int("ac-Barring13-r9", ac_barr13_r9); - j.write_int("ac-Barring14-r9", ac_barr14_r9); - j.write_int("ac-Barring15-r9", ac_barr15_r9); - j.write_int("ac-BarringMsg-r9", ac_barr_msg_r9); - j.write_int("ac-BarringReg-r9", ac_barr_reg_r9); - j.write_int("ac-BarringEmg-r9", ac_barr_emg_r9); - j.end_obj(); + destroy_(); + type_ = e; + switch (type_) { + case types::sync_sys_time: + c.init >(); + break; + case types::async_sys_time: + c.init >(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + } } - -// CSFB-RegistrationParam1XRTT ::= SEQUENCE -SRSASN_CODE csfb_regist_param1_xrtt_s::pack(bit_ref& bref) const +sys_time_info_cdma2000_s::cdma_sys_time_c_::cdma_sys_time_c_(const sys_time_info_cdma2000_s::cdma_sys_time_c_& other) { - HANDLE_CODE(sid.pack(bref)); - HANDLE_CODE(nid.pack(bref)); - HANDLE_CODE(bref.pack(multiple_sid, 1)); - HANDLE_CODE(bref.pack(multiple_nid, 1)); - HANDLE_CODE(bref.pack(home_reg, 1)); - HANDLE_CODE(bref.pack(foreign_sid_reg, 1)); - HANDLE_CODE(bref.pack(foreign_nid_reg, 1)); - HANDLE_CODE(bref.pack(param_reg, 1)); - HANDLE_CODE(bref.pack(pwr_up_reg, 1)); - HANDLE_CODE(regist_period.pack(bref)); - HANDLE_CODE(regist_zone.pack(bref)); - HANDLE_CODE(total_zone.pack(bref)); - HANDLE_CODE(zone_timer.pack(bref)); - - return SRSASN_SUCCESS; + type_ = other.type(); + switch (type_) { + case types::sync_sys_time: + c.init(other.c.get >()); + break; + case types::async_sys_time: + c.init(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + } } -SRSASN_CODE csfb_regist_param1_xrtt_s::unpack(cbit_ref& bref) +sys_time_info_cdma2000_s::cdma_sys_time_c_& +sys_time_info_cdma2000_s::cdma_sys_time_c_::operator=(const sys_time_info_cdma2000_s::cdma_sys_time_c_& other) { - HANDLE_CODE(sid.unpack(bref)); - HANDLE_CODE(nid.unpack(bref)); - HANDLE_CODE(bref.unpack(multiple_sid, 1)); - HANDLE_CODE(bref.unpack(multiple_nid, 1)); - HANDLE_CODE(bref.unpack(home_reg, 1)); - HANDLE_CODE(bref.unpack(foreign_sid_reg, 1)); - HANDLE_CODE(bref.unpack(foreign_nid_reg, 1)); - HANDLE_CODE(bref.unpack(param_reg, 1)); - HANDLE_CODE(bref.unpack(pwr_up_reg, 1)); - HANDLE_CODE(regist_period.unpack(bref)); - HANDLE_CODE(regist_zone.unpack(bref)); - HANDLE_CODE(total_zone.unpack(bref)); - HANDLE_CODE(zone_timer.unpack(bref)); + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::sync_sys_time: + c.set(other.c.get >()); + break; + case types::async_sys_time: + c.set(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + } - return SRSASN_SUCCESS; + return *this; } -void csfb_regist_param1_xrtt_s::to_json(json_writer& j) const +void sys_time_info_cdma2000_s::cdma_sys_time_c_::to_json(json_writer& j) const { j.start_obj(); - j.write_str("sid", sid.to_string()); - j.write_str("nid", nid.to_string()); - j.write_bool("multipleSID", multiple_sid); - j.write_bool("multipleNID", multiple_nid); - j.write_bool("homeReg", home_reg); - j.write_bool("foreignSIDReg", foreign_sid_reg); - j.write_bool("foreignNIDReg", foreign_nid_reg); - j.write_bool("parameterReg", param_reg); - j.write_bool("powerUpReg", pwr_up_reg); - j.write_str("registrationPeriod", regist_period.to_string()); - j.write_str("registrationZone", regist_zone.to_string()); - j.write_str("totalZone", total_zone.to_string()); - j.write_str("zoneTimer", zone_timer.to_string()); + switch (type_) { + case types::sync_sys_time: + j.write_str("synchronousSystemTime", c.get >().to_string()); + break; + case types::async_sys_time: + j.write_str("asynchronousSystemTime", c.get >().to_string()); + break; + default: + log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + } j.end_obj(); } +SRSASN_CODE sys_time_info_cdma2000_s::cdma_sys_time_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::sync_sys_time: + HANDLE_CODE(c.get >().pack(bref)); + break; + case types::async_sys_time: + HANDLE_CODE(c.get >().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sys_time_info_cdma2000_s::cdma_sys_time_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::sync_sys_time: + HANDLE_CODE(c.get >().unpack(bref)); + break; + case types::async_sys_time: + HANDLE_CODE(c.get >().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} -// CSFB-RegistrationParam1XRTT-v920 ::= SEQUENCE -SRSASN_CODE csfb_regist_param1_xrtt_v920_s::pack(bit_ref& bref) const +// UAC-BarringPerCat-r15 ::= SEQUENCE +SRSASN_CODE uac_barr_per_cat_r15_s::pack(bit_ref& bref) const { + HANDLE_CODE(pack_integer(bref, access_category_r15, (uint8_t)1u, (uint8_t)63u)); + HANDLE_CODE(pack_integer(bref, uac_barr_info_set_idx_r15, (uint8_t)1u, (uint8_t)8u)); + return SRSASN_SUCCESS; } -SRSASN_CODE csfb_regist_param1_xrtt_v920_s::unpack(cbit_ref& bref) +SRSASN_CODE uac_barr_per_cat_r15_s::unpack(cbit_ref& bref) { + HANDLE_CODE(unpack_integer(access_category_r15, bref, (uint8_t)1u, (uint8_t)63u)); + HANDLE_CODE(unpack_integer(uac_barr_info_set_idx_r15, bref, (uint8_t)1u, (uint8_t)8u)); + return SRSASN_SUCCESS; } -void csfb_regist_param1_xrtt_v920_s::to_json(json_writer& j) const +void uac_barr_per_cat_r15_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("powerDownReg-r9", "true"); + j.write_int("accessCategory-r15", access_category_r15); + j.write_int("uac-barringInfoSetIndex-r15", uac_barr_info_set_idx_r15); j.end_obj(); } -// CellReselectionParametersCDMA2000-r11 ::= SEQUENCE -SRSASN_CODE cell_resel_params_cdma2000_r11_s::pack(bit_ref& bref) const +// NeighCellCDMA2000 ::= SEQUENCE +SRSASN_CODE neigh_cell_cdma2000_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(t_resel_cdma2000_sf_present, 1)); - - HANDLE_CODE(pack_dyn_seq_of(bref, band_class_list, 1, 32)); - HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cell_list_r11, 1, 16)); - HANDLE_CODE(pack_integer(bref, t_resel_cdma2000, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_cdma2000_sf_present) { - HANDLE_CODE(t_resel_cdma2000_sf.pack(bref)); - } + HANDLE_CODE(band_class.pack(bref)); + HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cells_per_freq_list, 1, 16)); return SRSASN_SUCCESS; } -SRSASN_CODE cell_resel_params_cdma2000_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE neigh_cell_cdma2000_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(t_resel_cdma2000_sf_present, 1)); - - HANDLE_CODE(unpack_dyn_seq_of(band_class_list, bref, 1, 32)); - HANDLE_CODE(unpack_dyn_seq_of(neigh_cell_list_r11, bref, 1, 16)); - HANDLE_CODE(unpack_integer(t_resel_cdma2000, bref, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_cdma2000_sf_present) { - HANDLE_CODE(t_resel_cdma2000_sf.unpack(bref)); - } + HANDLE_CODE(band_class.unpack(bref)); + HANDLE_CODE(unpack_dyn_seq_of(neigh_cells_per_freq_list, bref, 1, 16)); return SRSASN_SUCCESS; } -void cell_resel_params_cdma2000_r11_s::to_json(json_writer& j) const +void neigh_cell_cdma2000_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("bandClassList"); - for (const auto& e1 : band_class_list) { - e1.to_json(j); - } - j.end_array(); - j.start_array("neighCellList-r11"); - for (const auto& e1 : neigh_cell_list_r11) { + j.write_str("bandClass", band_class.to_string()); + j.start_array("neighCellsPerFreqList"); + for (const auto& e1 : neigh_cells_per_freq_list) { e1.to_json(j); } j.end_array(); - j.write_int("t-ReselectionCDMA2000", t_resel_cdma2000); - if (t_resel_cdma2000_sf_present) { - j.write_fieldname("t-ReselectionCDMA2000-SF"); - t_resel_cdma2000_sf.to_json(j); - } j.end_obj(); } -// InterFreqCarrierFreqInfo-v10j0 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v10j0_s::pack(bit_ref& bref) const +// NeighCellCDMA2000-v920 ::= SEQUENCE +SRSASN_CODE neigh_cell_cdma2000_v920_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(freq_band_info_r10_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v10j0_present, 1)); - - if (freq_band_info_r10_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_r10, 1, 8)); - } - if (multi_band_info_list_v10j0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10j0, 1, 8, SeqOfPacker(1, 8, Packer()))); - } + HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cells_per_freq_list_v920, 1, 16)); return SRSASN_SUCCESS; } -SRSASN_CODE inter_freq_carrier_freq_info_v10j0_s::unpack(cbit_ref& bref) +SRSASN_CODE neigh_cell_cdma2000_v920_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(freq_band_info_r10_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v10j0_present, 1)); - - if (freq_band_info_r10_present) { - HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_r10, bref, 1, 8)); - } - if (multi_band_info_list_v10j0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10j0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); - } + HANDLE_CODE(unpack_dyn_seq_of(neigh_cells_per_freq_list_v920, bref, 1, 16)); return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v10j0_s::to_json(json_writer& j) const +void neigh_cell_cdma2000_v920_s::to_json(json_writer& j) const { j.start_obj(); - if (freq_band_info_r10_present) { - j.start_array("freqBandInfo-r10"); - for (const auto& e1 : freq_band_info_r10) { - e1.to_json(j); - } - j.end_array(); - } - if (multi_band_info_list_v10j0_present) { - j.start_array("multiBandInfoList-v10j0"); - for (const auto& e1 : multi_band_info_list_v10j0) { - j.start_array(); - for (const auto& e2 : e1) { - e2.to_json(j); - } - j.end_array(); - } - j.end_array(); + j.start_array("neighCellsPerFreqList-v920"); + for (const auto& e1 : neigh_cells_per_freq_list_v920) { + e1.to_json(j); } + j.end_array(); j.end_obj(); } -// InterFreqNeighCellInfo ::= SEQUENCE -SRSASN_CODE inter_freq_neigh_cell_info_s::pack(bit_ref& bref) const +// ParametersCDMA2000-r11 ::= SEQUENCE +SRSASN_CODE params_cdma2000_r11_s::pack(bit_ref& bref) const { - HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)503u)); - HANDLE_CODE(q_offset_cell.pack(bref)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(sys_time_info_r11_present, 1)); + HANDLE_CODE(bref.pack(params_hrpd_r11_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt_r11_present, 1)); - return SRSASN_SUCCESS; -} -SRSASN_CODE inter_freq_neigh_cell_info_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)503u)); - HANDLE_CODE(q_offset_cell.unpack(bref)); + if (sys_time_info_r11_present) { + HANDLE_CODE(sys_time_info_r11.pack(bref)); + } + HANDLE_CODE(pack_integer(bref, search_win_size_r11, (uint8_t)0u, (uint8_t)15u)); + if (params_hrpd_r11_present) { + HANDLE_CODE(bref.pack(params_hrpd_r11.cell_resel_params_hrpd_r11_present, 1)); + HANDLE_CODE(params_hrpd_r11.pre_regist_info_hrpd_r11.pack(bref)); + if (params_hrpd_r11.cell_resel_params_hrpd_r11_present) { + HANDLE_CODE(params_hrpd_r11.cell_resel_params_hrpd_r11.pack(bref)); + } + } + if (params1_xrtt_r11_present) { + HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt_r11.long_code_state1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt_r11.cell_resel_params1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_dual_rx_tx_support_r11_present, 1)); + if (params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present) { + HANDLE_CODE(params1_xrtt_r11.csfb_regist_param1_xrtt_r11.pack(bref)); + } + if (params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present) { + HANDLE_CODE(params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11.pack(bref)); + } + if (params1_xrtt_r11.long_code_state1_xrtt_r11_present) { + HANDLE_CODE(params1_xrtt_r11.long_code_state1_xrtt_r11.pack(bref)); + } + if (params1_xrtt_r11.cell_resel_params1_xrtt_r11_present) { + HANDLE_CODE(params1_xrtt_r11.cell_resel_params1_xrtt_r11.pack(bref)); + } + if (params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present) { + HANDLE_CODE(params1_xrtt_r11.ac_barr_cfg1_xrtt_r11.pack(bref)); + } + if (params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present) { + HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11, 1)); + } + } return SRSASN_SUCCESS; } -void inter_freq_neigh_cell_info_s::to_json(json_writer& j) const +SRSASN_CODE params_cdma2000_r11_s::unpack(cbit_ref& bref) { - j.start_obj(); - j.write_int("physCellId", pci); - j.write_str("q-OffsetCell", q_offset_cell.to_string()); - j.end_obj(); -} + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(sys_time_info_r11_present, 1)); + HANDLE_CODE(bref.unpack(params_hrpd_r11_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt_r11_present, 1)); -// PLMN-IdentityInfo2-r12 ::= CHOICE -void plmn_id_info2_r12_c::destroy_() -{ - switch (type_) { - case types::plmn_id_r12: - c.destroy(); - break; - default: - break; + if (sys_time_info_r11_present) { + HANDLE_CODE(sys_time_info_r11.unpack(bref)); } -} -void plmn_id_info2_r12_c::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::plmn_idx_r12: - break; - case types::plmn_id_r12: - c.init(); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + HANDLE_CODE(unpack_integer(search_win_size_r11, bref, (uint8_t)0u, (uint8_t)15u)); + if (params_hrpd_r11_present) { + HANDLE_CODE(bref.unpack(params_hrpd_r11.cell_resel_params_hrpd_r11_present, 1)); + HANDLE_CODE(params_hrpd_r11.pre_regist_info_hrpd_r11.unpack(bref)); + if (params_hrpd_r11.cell_resel_params_hrpd_r11_present) { + HANDLE_CODE(params_hrpd_r11.cell_resel_params_hrpd_r11.unpack(bref)); + } } -} -plmn_id_info2_r12_c::plmn_id_info2_r12_c(const plmn_id_info2_r12_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::plmn_idx_r12: - c.init(other.c.get()); - break; - case types::plmn_id_r12: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + if (params1_xrtt_r11_present) { + HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt_r11.long_code_state1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt_r11.cell_resel_params1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_dual_rx_tx_support_r11_present, 1)); + if (params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present) { + HANDLE_CODE(params1_xrtt_r11.csfb_regist_param1_xrtt_r11.unpack(bref)); + } + if (params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present) { + HANDLE_CODE(params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11.unpack(bref)); + } + if (params1_xrtt_r11.long_code_state1_xrtt_r11_present) { + HANDLE_CODE(params1_xrtt_r11.long_code_state1_xrtt_r11.unpack(bref)); + } + if (params1_xrtt_r11.cell_resel_params1_xrtt_r11_present) { + HANDLE_CODE(params1_xrtt_r11.cell_resel_params1_xrtt_r11.unpack(bref)); + } + if (params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present) { + HANDLE_CODE(params1_xrtt_r11.ac_barr_cfg1_xrtt_r11.unpack(bref)); + } + if (params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present) { + HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11, 1)); + } } + + return SRSASN_SUCCESS; } -plmn_id_info2_r12_c& plmn_id_info2_r12_c::operator=(const plmn_id_info2_r12_c& other) +void params_cdma2000_r11_s::to_json(json_writer& j) const { - if (this == &other) { - return *this; + j.start_obj(); + if (sys_time_info_r11_present) { + j.write_fieldname("systemTimeInfo-r11"); + sys_time_info_r11.to_json(j); } - set(other.type()); - switch (type_) { - case types::plmn_idx_r12: - c.set(other.c.get()); - break; - case types::plmn_id_r12: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + j.write_int("searchWindowSize-r11", search_win_size_r11); + if (params_hrpd_r11_present) { + j.write_fieldname("parametersHRPD-r11"); + j.start_obj(); + j.write_fieldname("preRegistrationInfoHRPD-r11"); + params_hrpd_r11.pre_regist_info_hrpd_r11.to_json(j); + if (params_hrpd_r11.cell_resel_params_hrpd_r11_present) { + j.write_fieldname("cellReselectionParametersHRPD-r11"); + params_hrpd_r11.cell_resel_params_hrpd_r11.to_json(j); + } + j.end_obj(); + } + if (params1_xrtt_r11_present) { + j.write_fieldname("parameters1XRTT-r11"); + j.start_obj(); + if (params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present) { + j.write_fieldname("csfb-RegistrationParam1XRTT-r11"); + params1_xrtt_r11.csfb_regist_param1_xrtt_r11.to_json(j); + } + if (params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present) { + j.write_fieldname("csfb-RegistrationParam1XRTT-Ext-r11"); + params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11.to_json(j); + } + if (params1_xrtt_r11.long_code_state1_xrtt_r11_present) { + j.write_str("longCodeState1XRTT-r11", params1_xrtt_r11.long_code_state1_xrtt_r11.to_string()); + } + if (params1_xrtt_r11.cell_resel_params1_xrtt_r11_present) { + j.write_fieldname("cellReselectionParameters1XRTT-r11"); + params1_xrtt_r11.cell_resel_params1_xrtt_r11.to_json(j); + } + if (params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present) { + j.write_fieldname("ac-BarringConfig1XRTT-r11"); + params1_xrtt_r11.ac_barr_cfg1_xrtt_r11.to_json(j); + } + if (params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present) { + j.write_bool("csfb-SupportForDualRxUEs-r11", params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11); + } + if (params1_xrtt_r11.csfb_dual_rx_tx_support_r11_present) { + j.write_str("csfb-DualRxTxSupport-r11", "true"); + } + j.end_obj(); } + j.end_obj(); +} - return *this; +void params_cdma2000_r11_s::sys_time_info_r11_c_::set(types::options e) +{ + type_ = e; } -void plmn_id_info2_r12_c::to_json(json_writer& j) const +void params_cdma2000_r11_s::sys_time_info_r11_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::plmn_idx_r12: - j.write_int("plmn-Index-r12", c.get()); + case types::explicit_value: + j.write_fieldname("explicitValue"); + c.to_json(j); break; - case types::plmn_id_r12: - j.write_fieldname("plmnIdentity-r12"); - c.get().to_json(j); + case types::default_value: break; default: - log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + log_invalid_choice_id(type_, "params_cdma2000_r11_s::sys_time_info_r11_c_"); } j.end_obj(); } -SRSASN_CODE plmn_id_info2_r12_c::pack(bit_ref& bref) const +SRSASN_CODE params_cdma2000_r11_s::sys_time_info_r11_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::plmn_idx_r12: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)1u, (uint8_t)6u)); + case types::explicit_value: + HANDLE_CODE(c.pack(bref)); break; - case types::plmn_id_r12: - HANDLE_CODE(c.get().pack(bref)); + case types::default_value: break; default: - log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + log_invalid_choice_id(type_, "params_cdma2000_r11_s::sys_time_info_r11_c_"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE plmn_id_info2_r12_c::unpack(cbit_ref& bref) +SRSASN_CODE params_cdma2000_r11_s::sys_time_info_r11_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::plmn_idx_r12: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)1u, (uint8_t)6u)); + case types::explicit_value: + HANDLE_CODE(c.unpack(bref)); break; - case types::plmn_id_r12: - HANDLE_CODE(c.get().unpack(bref)); + case types::default_value: break; default: - log_invalid_choice_id(type_, "plmn_id_info2_r12_c"); + log_invalid_choice_id(type_, "params_cdma2000_r11_s::sys_time_info_r11_c_"); return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -// SystemInformationBlockType1-v10x0-IEs ::= SEQUENCE -SRSASN_CODE sib_type1_v10x0_ies_s::pack(bit_ref& bref) const +// RedistributionInterFreqInfo-r13 ::= SEQUENCE +SRSASN_CODE redist_inter_freq_info_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(redist_factor_freq_r13_present, 1)); + HANDLE_CODE(bref.pack(redist_neigh_cell_list_r13_present, 1)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (redist_factor_freq_r13_present) { + HANDLE_CODE(pack_integer(bref, redist_factor_freq_r13, (uint8_t)1u, (uint8_t)10u)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (redist_neigh_cell_list_r13_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, redist_neigh_cell_list_r13, 1, 16)); } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type1_v10x0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE redist_inter_freq_info_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(redist_factor_freq_r13_present, 1)); + HANDLE_CODE(bref.unpack(redist_neigh_cell_list_r13_present, 1)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); + if (redist_factor_freq_r13_present) { + HANDLE_CODE(unpack_integer(redist_factor_freq_r13, bref, (uint8_t)1u, (uint8_t)10u)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (redist_neigh_cell_list_r13_present) { + HANDLE_CODE(unpack_dyn_seq_of(redist_neigh_cell_list_r13, bref, 1, 16)); } return SRSASN_SUCCESS; } -void sib_type1_v10x0_ies_s::to_json(json_writer& j) const +void redist_inter_freq_info_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + if (redist_factor_freq_r13_present) { + j.write_int("redistributionFactorFreq-r13", redist_factor_freq_r13); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + if (redist_neigh_cell_list_r13_present) { + j.start_array("redistributionNeighCellList-r13"); + for (const auto& e1 : redist_neigh_cell_list_r13) { + e1.to_json(j); + } + j.end_array(); } j.end_obj(); } -// SystemInformationBlockType2-v10m0-IEs ::= SEQUENCE -SRSASN_CODE sib_type2_v10m0_ies_s::pack(bit_ref& bref) const +// SL-DiscConfigOtherInterFreq-r13 ::= SEQUENCE +SRSASN_CODE sl_disc_cfg_other_inter_freq_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(freq_info_v10l0_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v10l0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(tx_pwr_info_r13_present, 1)); + HANDLE_CODE(bref.pack(ref_carrier_common_r13_present, 1)); + HANDLE_CODE(bref.pack(disc_sync_cfg_r13_present, 1)); + HANDLE_CODE(bref.pack(disc_cell_sel_info_r13_present, 1)); - if (freq_info_v10l0_present) { - HANDLE_CODE(pack_integer(bref, freq_info_v10l0.add_spec_emission_v10l0, (uint16_t)33u, (uint16_t)288u)); + if (tx_pwr_info_r13_present) { + HANDLE_CODE(pack_fixed_seq_of(bref, &(tx_pwr_info_r13)[0], tx_pwr_info_r13.size())); } - if (multi_band_info_list_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10l0, 1, 8, integer_packer(33, 288))); + if (disc_sync_cfg_r13_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, disc_sync_cfg_r13, 1, 16)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (disc_cell_sel_info_r13_present) { + HANDLE_CODE(disc_cell_sel_info_r13.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type2_v10m0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE sl_disc_cfg_other_inter_freq_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(freq_info_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(tx_pwr_info_r13_present, 1)); + HANDLE_CODE(bref.unpack(ref_carrier_common_r13_present, 1)); + HANDLE_CODE(bref.unpack(disc_sync_cfg_r13_present, 1)); + HANDLE_CODE(bref.unpack(disc_cell_sel_info_r13_present, 1)); - if (freq_info_v10l0_present) { - HANDLE_CODE(unpack_integer(freq_info_v10l0.add_spec_emission_v10l0, bref, (uint16_t)33u, (uint16_t)288u)); + if (tx_pwr_info_r13_present) { + HANDLE_CODE(unpack_fixed_seq_of(&(tx_pwr_info_r13)[0], bref, tx_pwr_info_r13.size())); } - if (multi_band_info_list_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10l0, bref, 1, 8, integer_packer(33, 288))); + if (disc_sync_cfg_r13_present) { + HANDLE_CODE(unpack_dyn_seq_of(disc_sync_cfg_r13, bref, 1, 16)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (disc_cell_sel_info_r13_present) { + HANDLE_CODE(disc_cell_sel_info_r13.unpack(bref)); } return SRSASN_SUCCESS; } -void sib_type2_v10m0_ies_s::to_json(json_writer& j) const +void sl_disc_cfg_other_inter_freq_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (freq_info_v10l0_present) { - j.write_fieldname("freqInfo-v10l0"); - j.start_obj(); - j.write_int("additionalSpectrumEmission-v10l0", freq_info_v10l0.add_spec_emission_v10l0); - j.end_obj(); + if (tx_pwr_info_r13_present) { + j.start_array("txPowerInfo-r13"); + for (const auto& e1 : tx_pwr_info_r13) { + e1.to_json(j); + } + j.end_array(); } - if (multi_band_info_list_v10l0_present) { - j.start_array("multiBandInfoList-v10l0"); - for (const auto& e1 : multi_band_info_list_v10l0) { - j.write_int(e1); + if (ref_carrier_common_r13_present) { + j.write_str("refCarrierCommon-r13", "pCell"); + } + if (disc_sync_cfg_r13_present) { + j.start_array("discSyncConfig-r13"); + for (const auto& e1 : disc_sync_cfg_r13) { + e1.to_json(j); } j.end_array(); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + if (disc_cell_sel_info_r13_present) { + j.write_fieldname("discCellSelectionInfo-r13"); + disc_cell_sel_info_r13.to_json(j); } j.end_obj(); } -// SystemInformationBlockType5-v10l0-IEs ::= SEQUENCE -SRSASN_CODE sib_type5_v10l0_ies_s::pack(bit_ref& bref) const +// CarrierFreqNR-r15 ::= SEQUENCE +SRSASN_CODE carrier_freq_nr_r15_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v10l0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(multi_band_info_list_r15_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_sul_r15_present, 1)); + HANDLE_CODE(bref.pack(meas_timing_cfg_r15_present, 1)); + HANDLE_CODE(bref.pack(ss_rssi_meas_r15_present, 1)); + HANDLE_CODE(bref.pack(cell_resel_prio_r15_present, 1)); + HANDLE_CODE(bref.pack(cell_resel_sub_prio_r15_present, 1)); + HANDLE_CODE(bref.pack(thresh_x_q_r15_present, 1)); + HANDLE_CODE(bref.pack(q_rx_lev_min_sul_r15_present, 1)); + HANDLE_CODE(bref.pack(ns_pmax_list_nr_r15_present, 1)); + HANDLE_CODE(bref.pack(q_qual_min_r15_present, 1)); + HANDLE_CODE(bref.pack(max_rs_idx_cell_qual_r15_present, 1)); + HANDLE_CODE(bref.pack(thresh_rs_idx_r15_present, 1)); - if (inter_freq_carrier_freq_list_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v10l0, 1, 8)); + HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)3279165u)); + if (multi_band_info_list_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r15, 1, 32, integer_packer(1, 1024))); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (multi_band_info_list_sul_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_sul_r15, 1, 32, integer_packer(1, 1024))); } - - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type5_v10l0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (inter_freq_carrier_freq_list_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v10l0, bref, 1, 8)); + if (meas_timing_cfg_r15_present) { + HANDLE_CODE(meas_timing_cfg_r15.pack(bref)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + HANDLE_CODE(subcarrier_spacing_ssb_r15.pack(bref)); + if (ss_rssi_meas_r15_present) { + HANDLE_CODE(ss_rssi_meas_r15.pack(bref)); } - - return SRSASN_SUCCESS; -} -void sib_type5_v10l0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (inter_freq_carrier_freq_list_v10l0_present) { - j.start_array("interFreqCarrierFreqList-v10l0"); - for (const auto& e1 : inter_freq_carrier_freq_list_v10l0) { - e1.to_json(j); - } - j.end_array(); + if (cell_resel_prio_r15_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_prio_r15, (uint8_t)0u, (uint8_t)7u)); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + if (cell_resel_sub_prio_r15_present) { + HANDLE_CODE(cell_resel_sub_prio_r15.pack(bref)); + } + HANDLE_CODE(pack_integer(bref, thresh_x_high_r15, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_low_r15, (uint8_t)0u, (uint8_t)31u)); + if (thresh_x_q_r15_present) { + HANDLE_CODE(pack_integer(bref, thresh_x_q_r15.thresh_x_high_q_r15, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_q_r15.thresh_x_low_q_r15, (uint8_t)0u, (uint8_t)31u)); + } + HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r15, (int8_t)-70, (int8_t)-22)); + if (q_rx_lev_min_sul_r15_present) { + HANDLE_CODE(pack_integer(bref, q_rx_lev_min_sul_r15, (int8_t)-70, (int8_t)-22)); + } + HANDLE_CODE(pack_integer(bref, p_max_nr_r15, (int8_t)-30, (int8_t)33)); + if (ns_pmax_list_nr_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, ns_pmax_list_nr_r15, 1, 8)); + } + if (q_qual_min_r15_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_r15, (int8_t)-43, (int8_t)-12)); + } + HANDLE_CODE(bref.pack(derive_ssb_idx_from_cell_r15, 1)); + if (max_rs_idx_cell_qual_r15_present) { + HANDLE_CODE(pack_integer(bref, max_rs_idx_cell_qual_r15, (uint8_t)1u, (uint8_t)16u)); + } + if (thresh_rs_idx_r15_present) { + HANDLE_CODE(thresh_rs_idx_r15.pack(bref)); } - j.end_obj(); -} -// SystemTimeInfoCDMA2000 ::= SEQUENCE -SRSASN_CODE sys_time_info_cdma2000_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(cdma_eutra_synchronisation, 1)); - HANDLE_CODE(cdma_sys_time.pack(bref)); + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= multi_band_ns_pmax_list_nr_v1550.is_present(); + group_flags[0] |= multi_band_ns_pmax_list_nr_sul_v1550.is_present(); + group_flags[0] |= ssb_to_measure_r15.is_present(); + group_flags.pack(bref); - return SRSASN_SUCCESS; -} -SRSASN_CODE sys_time_info_cdma2000_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(cdma_eutra_synchronisation, 1)); - HANDLE_CODE(cdma_sys_time.unpack(bref)); + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(bref.pack(multi_band_ns_pmax_list_nr_v1550.is_present(), 1)); + HANDLE_CODE(bref.pack(multi_band_ns_pmax_list_nr_sul_v1550.is_present(), 1)); + HANDLE_CODE(bref.pack(ssb_to_measure_r15.is_present(), 1)); + if (multi_band_ns_pmax_list_nr_v1550.is_present()) { + HANDLE_CODE( + pack_dyn_seq_of(bref, *multi_band_ns_pmax_list_nr_v1550, 1, 31, SeqOfPacker(1, 8, Packer()))); + } + if (multi_band_ns_pmax_list_nr_sul_v1550.is_present()) { + HANDLE_CODE( + pack_dyn_seq_of(bref, *multi_band_ns_pmax_list_nr_sul_v1550, 1, 32, SeqOfPacker(1, 8, Packer()))); + } + if (ssb_to_measure_r15.is_present()) { + HANDLE_CODE(ssb_to_measure_r15->pack(bref)); + } + } + } return SRSASN_SUCCESS; } -void sys_time_info_cdma2000_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_bool("cdma-EUTRA-Synchronisation", cdma_eutra_synchronisation); - j.write_fieldname("cdma-SystemTime"); - cdma_sys_time.to_json(j); - j.end_obj(); -} - -void sys_time_info_cdma2000_s::cdma_sys_time_c_::destroy_() +SRSASN_CODE carrier_freq_nr_r15_s::unpack(cbit_ref& bref) { - switch (type_) { - case types::sync_sys_time: - c.destroy >(); - break; - case types::async_sys_time: - c.destroy >(); - break; - default: - break; + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(multi_band_info_list_r15_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_sul_r15_present, 1)); + HANDLE_CODE(bref.unpack(meas_timing_cfg_r15_present, 1)); + HANDLE_CODE(bref.unpack(ss_rssi_meas_r15_present, 1)); + HANDLE_CODE(bref.unpack(cell_resel_prio_r15_present, 1)); + HANDLE_CODE(bref.unpack(cell_resel_sub_prio_r15_present, 1)); + HANDLE_CODE(bref.unpack(thresh_x_q_r15_present, 1)); + HANDLE_CODE(bref.unpack(q_rx_lev_min_sul_r15_present, 1)); + HANDLE_CODE(bref.unpack(ns_pmax_list_nr_r15_present, 1)); + HANDLE_CODE(bref.unpack(q_qual_min_r15_present, 1)); + HANDLE_CODE(bref.unpack(max_rs_idx_cell_qual_r15_present, 1)); + HANDLE_CODE(bref.unpack(thresh_rs_idx_r15_present, 1)); + + HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)3279165u)); + if (multi_band_info_list_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r15, bref, 1, 32, integer_packer(1, 1024))); } -} -void sys_time_info_cdma2000_s::cdma_sys_time_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::sync_sys_time: - c.init >(); - break; - case types::async_sys_time: - c.init >(); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + if (multi_band_info_list_sul_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_sul_r15, bref, 1, 32, integer_packer(1, 1024))); } -} -sys_time_info_cdma2000_s::cdma_sys_time_c_::cdma_sys_time_c_(const sys_time_info_cdma2000_s::cdma_sys_time_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::sync_sys_time: - c.init(other.c.get >()); - break; - case types::async_sys_time: - c.init(other.c.get >()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + if (meas_timing_cfg_r15_present) { + HANDLE_CODE(meas_timing_cfg_r15.unpack(bref)); } -} -sys_time_info_cdma2000_s::cdma_sys_time_c_& -sys_time_info_cdma2000_s::cdma_sys_time_c_::operator=(const sys_time_info_cdma2000_s::cdma_sys_time_c_& other) -{ - if (this == &other) { - return *this; + HANDLE_CODE(subcarrier_spacing_ssb_r15.unpack(bref)); + if (ss_rssi_meas_r15_present) { + HANDLE_CODE(ss_rssi_meas_r15.unpack(bref)); } - set(other.type()); - switch (type_) { - case types::sync_sys_time: - c.set(other.c.get >()); - break; - case types::async_sys_time: - c.set(other.c.get >()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + if (cell_resel_prio_r15_present) { + HANDLE_CODE(unpack_integer(cell_resel_prio_r15, bref, (uint8_t)0u, (uint8_t)7u)); } - - return *this; -} -void sys_time_info_cdma2000_s::cdma_sys_time_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::sync_sys_time: - j.write_str("synchronousSystemTime", c.get >().to_string()); - break; - case types::async_sys_time: - j.write_str("asynchronousSystemTime", c.get >().to_string()); - break; - default: - log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); + if (cell_resel_sub_prio_r15_present) { + HANDLE_CODE(cell_resel_sub_prio_r15.unpack(bref)); } - j.end_obj(); -} -SRSASN_CODE sys_time_info_cdma2000_s::cdma_sys_time_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::sync_sys_time: - HANDLE_CODE(c.get >().pack(bref)); - break; - case types::async_sys_time: - HANDLE_CODE(c.get >().pack(bref)); - break; - default: - log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(unpack_integer(thresh_x_high_r15, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_low_r15, bref, (uint8_t)0u, (uint8_t)31u)); + if (thresh_x_q_r15_present) { + HANDLE_CODE(unpack_integer(thresh_x_q_r15.thresh_x_high_q_r15, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_q_r15.thresh_x_low_q_r15, bref, (uint8_t)0u, (uint8_t)31u)); } - return SRSASN_SUCCESS; -} -SRSASN_CODE sys_time_info_cdma2000_s::cdma_sys_time_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::sync_sys_time: - HANDLE_CODE(c.get >().unpack(bref)); - break; - case types::async_sys_time: - HANDLE_CODE(c.get >().unpack(bref)); - break; - default: - log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(unpack_integer(q_rx_lev_min_r15, bref, (int8_t)-70, (int8_t)-22)); + if (q_rx_lev_min_sul_r15_present) { + HANDLE_CODE(unpack_integer(q_rx_lev_min_sul_r15, bref, (int8_t)-70, (int8_t)-22)); } - return SRSASN_SUCCESS; -} - -// UAC-BarringPerCat-r15 ::= SEQUENCE -SRSASN_CODE uac_barr_per_cat_r15_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pack_integer(bref, access_category_r15, (uint8_t)1u, (uint8_t)63u)); - HANDLE_CODE(pack_integer(bref, uac_barr_info_set_idx_r15, (uint8_t)1u, (uint8_t)8u)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE uac_barr_per_cat_r15_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(access_category_r15, bref, (uint8_t)1u, (uint8_t)63u)); - HANDLE_CODE(unpack_integer(uac_barr_info_set_idx_r15, bref, (uint8_t)1u, (uint8_t)8u)); - - return SRSASN_SUCCESS; -} -void uac_barr_per_cat_r15_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("accessCategory-r15", access_category_r15); - j.write_int("uac-barringInfoSetIndex-r15", uac_barr_info_set_idx_r15); - j.end_obj(); -} - -// InterFreqCarrierFreqInfo-v9e0 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v9e0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(dl_carrier_freq_v9e0_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v9e0_present, 1)); - - if (dl_carrier_freq_v9e0_present) { - HANDLE_CODE(pack_integer(bref, dl_carrier_freq_v9e0, (uint32_t)65536u, (uint32_t)262143u)); + HANDLE_CODE(unpack_integer(p_max_nr_r15, bref, (int8_t)-30, (int8_t)33)); + if (ns_pmax_list_nr_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(ns_pmax_list_nr_r15, bref, 1, 8)); } - if (multi_band_info_list_v9e0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v9e0, 1, 8)); + if (q_qual_min_r15_present) { + HANDLE_CODE(unpack_integer(q_qual_min_r15, bref, (int8_t)-43, (int8_t)-12)); } - - return SRSASN_SUCCESS; -} -SRSASN_CODE inter_freq_carrier_freq_info_v9e0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(dl_carrier_freq_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v9e0_present, 1)); - - if (dl_carrier_freq_v9e0_present) { - HANDLE_CODE(unpack_integer(dl_carrier_freq_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u)); + HANDLE_CODE(bref.unpack(derive_ssb_idx_from_cell_r15, 1)); + if (max_rs_idx_cell_qual_r15_present) { + HANDLE_CODE(unpack_integer(max_rs_idx_cell_qual_r15, bref, (uint8_t)1u, (uint8_t)16u)); } - if (multi_band_info_list_v9e0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v9e0, bref, 1, 8)); + if (thresh_rs_idx_r15_present) { + HANDLE_CODE(thresh_rs_idx_r15.unpack(bref)); } + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool multi_band_ns_pmax_list_nr_v1550_present; + HANDLE_CODE(bref.unpack(multi_band_ns_pmax_list_nr_v1550_present, 1)); + multi_band_ns_pmax_list_nr_v1550.set_present(multi_band_ns_pmax_list_nr_v1550_present); + bool multi_band_ns_pmax_list_nr_sul_v1550_present; + HANDLE_CODE(bref.unpack(multi_band_ns_pmax_list_nr_sul_v1550_present, 1)); + multi_band_ns_pmax_list_nr_sul_v1550.set_present(multi_band_ns_pmax_list_nr_sul_v1550_present); + bool ssb_to_measure_r15_present; + HANDLE_CODE(bref.unpack(ssb_to_measure_r15_present, 1)); + ssb_to_measure_r15.set_present(ssb_to_measure_r15_present); + if (multi_band_ns_pmax_list_nr_v1550.is_present()) { + HANDLE_CODE( + unpack_dyn_seq_of(*multi_band_ns_pmax_list_nr_v1550, bref, 1, 31, SeqOfPacker(1, 8, Packer()))); + } + if (multi_band_ns_pmax_list_nr_sul_v1550.is_present()) { + HANDLE_CODE( + unpack_dyn_seq_of(*multi_band_ns_pmax_list_nr_sul_v1550, bref, 1, 32, SeqOfPacker(1, 8, Packer()))); + } + if (ssb_to_measure_r15.is_present()) { + HANDLE_CODE(ssb_to_measure_r15->unpack(bref)); + } + } + } return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v9e0_s::to_json(json_writer& j) const +void carrier_freq_nr_r15_s::to_json(json_writer& j) const { j.start_obj(); - if (dl_carrier_freq_v9e0_present) { - j.write_int("dl-CarrierFreq-v9e0", dl_carrier_freq_v9e0); + j.write_int("carrierFreq-r15", carrier_freq_r15); + if (multi_band_info_list_r15_present) { + j.start_array("multiBandInfoList-r15"); + for (const auto& e1 : multi_band_info_list_r15) { + j.write_int(e1); + } + j.end_array(); } - if (multi_band_info_list_v9e0_present) { - j.start_array("multiBandInfoList-v9e0"); - for (const auto& e1 : multi_band_info_list_v9e0) { - e1.to_json(j); + if (multi_band_info_list_sul_r15_present) { + j.start_array("multiBandInfoListSUL-r15"); + for (const auto& e1 : multi_band_info_list_sul_r15) { + j.write_int(e1); } j.end_array(); } - j.end_obj(); -} - -// NeighCellCDMA2000 ::= SEQUENCE -SRSASN_CODE neigh_cell_cdma2000_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(band_class.pack(bref)); - HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cells_per_freq_list, 1, 16)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE neigh_cell_cdma2000_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(band_class.unpack(bref)); - HANDLE_CODE(unpack_dyn_seq_of(neigh_cells_per_freq_list, bref, 1, 16)); - - return SRSASN_SUCCESS; -} -void neigh_cell_cdma2000_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("bandClass", band_class.to_string()); - j.start_array("neighCellsPerFreqList"); - for (const auto& e1 : neigh_cells_per_freq_list) { - e1.to_json(j); + if (meas_timing_cfg_r15_present) { + j.write_fieldname("measTimingConfig-r15"); + meas_timing_cfg_r15.to_json(j); + } + j.write_str("subcarrierSpacingSSB-r15", subcarrier_spacing_ssb_r15.to_string()); + if (ss_rssi_meas_r15_present) { + j.write_fieldname("ss-RSSI-Measurement-r15"); + ss_rssi_meas_r15.to_json(j); + } + if (cell_resel_prio_r15_present) { + j.write_int("cellReselectionPriority-r15", cell_resel_prio_r15); + } + if (cell_resel_sub_prio_r15_present) { + j.write_str("cellReselectionSubPriority-r15", cell_resel_sub_prio_r15.to_string()); + } + j.write_int("threshX-High-r15", thresh_x_high_r15); + j.write_int("threshX-Low-r15", thresh_x_low_r15); + if (thresh_x_q_r15_present) { + j.write_fieldname("threshX-Q-r15"); + j.start_obj(); + j.write_int("threshX-HighQ-r15", thresh_x_q_r15.thresh_x_high_q_r15); + j.write_int("threshX-LowQ-r15", thresh_x_q_r15.thresh_x_low_q_r15); + j.end_obj(); + } + j.write_int("q-RxLevMin-r15", q_rx_lev_min_r15); + if (q_rx_lev_min_sul_r15_present) { + j.write_int("q-RxLevMinSUL-r15", q_rx_lev_min_sul_r15); + } + j.write_int("p-MaxNR-r15", p_max_nr_r15); + if (ns_pmax_list_nr_r15_present) { + j.start_array("ns-PmaxListNR-r15"); + for (const auto& e1 : ns_pmax_list_nr_r15) { + e1.to_json(j); + } + j.end_array(); + } + if (q_qual_min_r15_present) { + j.write_int("q-QualMin-r15", q_qual_min_r15); + } + j.write_bool("deriveSSB-IndexFromCell-r15", derive_ssb_idx_from_cell_r15); + if (max_rs_idx_cell_qual_r15_present) { + j.write_int("maxRS-IndexCellQual-r15", max_rs_idx_cell_qual_r15); + } + if (thresh_rs_idx_r15_present) { + j.write_fieldname("threshRS-Index-r15"); + thresh_rs_idx_r15.to_json(j); + } + if (ext) { + if (multi_band_ns_pmax_list_nr_v1550.is_present()) { + j.start_array("multiBandNsPmaxListNR-v1550"); + for (const auto& e1 : *multi_band_ns_pmax_list_nr_v1550) { + j.start_array(); + for (const auto& e2 : e1) { + e2.to_json(j); + } + j.end_array(); + } + j.end_array(); + } + if (multi_band_ns_pmax_list_nr_sul_v1550.is_present()) { + j.start_array("multiBandNsPmaxListNR-SUL-v1550"); + for (const auto& e1 : *multi_band_ns_pmax_list_nr_sul_v1550) { + j.start_array(); + for (const auto& e2 : e1) { + e2.to_json(j); + } + j.end_array(); + } + j.end_array(); + } + if (ssb_to_measure_r15.is_present()) { + j.write_fieldname("ssb-ToMeasure-r15"); + ssb_to_measure_r15->to_json(j); + } } - j.end_array(); j.end_obj(); } -// NeighCellCDMA2000-v920 ::= SEQUENCE -SRSASN_CODE neigh_cell_cdma2000_v920_s::pack(bit_ref& bref) const +std::string carrier_freq_nr_r15_s::subcarrier_spacing_ssb_r15_opts::to_string() const { - HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cells_per_freq_list_v920, 1, 16)); + static const char* options[] = {"kHz15", "kHz30", "kHz120", "kHz240"}; + return convert_enum_idx(options, 4, value, "carrier_freq_nr_r15_s::subcarrier_spacing_ssb_r15_e_"); +} +uint8_t carrier_freq_nr_r15_s::subcarrier_spacing_ssb_r15_opts::to_number() const +{ + static const uint8_t options[] = {15, 30, 120, 240}; + return map_enum_number(options, 4, value, "carrier_freq_nr_r15_s::subcarrier_spacing_ssb_r15_e_"); +} + +// CarrierFreqUTRA-FDD ::= SEQUENCE +SRSASN_CODE carrier_freq_utra_fdd_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(cell_resel_prio_present, 1)); + + HANDLE_CODE(pack_integer(bref, carrier_freq, (uint16_t)0u, (uint16_t)16383u)); + if (cell_resel_prio_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); + } + HANDLE_CODE(pack_integer(bref, thresh_x_high, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_low, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, q_rx_lev_min, (int8_t)-60, (int8_t)-13)); + HANDLE_CODE(pack_integer(bref, p_max_utra, (int8_t)-50, (int8_t)33)); + HANDLE_CODE(pack_integer(bref, q_qual_min, (int8_t)-24, (int8_t)0)); + + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= thresh_x_q_r9.is_present(); + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(bref.pack(thresh_x_q_r9.is_present(), 1)); + if (thresh_x_q_r9.is_present()) { + HANDLE_CODE(pack_integer(bref, thresh_x_q_r9->thresh_x_high_q_r9, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_q_r9->thresh_x_low_q_r9, (uint8_t)0u, (uint8_t)31u)); + } + } + } return SRSASN_SUCCESS; } -SRSASN_CODE neigh_cell_cdma2000_v920_s::unpack(cbit_ref& bref) +SRSASN_CODE carrier_freq_utra_fdd_s::unpack(cbit_ref& bref) { - HANDLE_CODE(unpack_dyn_seq_of(neigh_cells_per_freq_list_v920, bref, 1, 16)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(cell_resel_prio_present, 1)); + + HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint16_t)0u, (uint16_t)16383u)); + if (cell_resel_prio_present) { + HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); + } + HANDLE_CODE(unpack_integer(thresh_x_high, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_low, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(q_rx_lev_min, bref, (int8_t)-60, (int8_t)-13)); + HANDLE_CODE(unpack_integer(p_max_utra, bref, (int8_t)-50, (int8_t)33)); + HANDLE_CODE(unpack_integer(q_qual_min, bref, (int8_t)-24, (int8_t)0)); + + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool thresh_x_q_r9_present; + HANDLE_CODE(bref.unpack(thresh_x_q_r9_present, 1)); + thresh_x_q_r9.set_present(thresh_x_q_r9_present); + if (thresh_x_q_r9.is_present()) { + HANDLE_CODE(unpack_integer(thresh_x_q_r9->thresh_x_high_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_q_r9->thresh_x_low_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); + } + } + } return SRSASN_SUCCESS; } -void neigh_cell_cdma2000_v920_s::to_json(json_writer& j) const +void carrier_freq_utra_fdd_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("neighCellsPerFreqList-v920"); - for (const auto& e1 : neigh_cells_per_freq_list_v920) { - e1.to_json(j); + j.write_int("carrierFreq", carrier_freq); + if (cell_resel_prio_present) { + j.write_int("cellReselectionPriority", cell_resel_prio); + } + j.write_int("threshX-High", thresh_x_high); + j.write_int("threshX-Low", thresh_x_low); + j.write_int("q-RxLevMin", q_rx_lev_min); + j.write_int("p-MaxUTRA", p_max_utra); + j.write_int("q-QualMin", q_qual_min); + if (ext) { + if (thresh_x_q_r9.is_present()) { + j.write_fieldname("threshX-Q-r9"); + j.start_obj(); + j.write_int("threshX-HighQ-r9", thresh_x_q_r9->thresh_x_high_q_r9); + j.write_int("threshX-LowQ-r9", thresh_x_q_r9->thresh_x_low_q_r9); + j.end_obj(); + } } - j.end_array(); j.end_obj(); } -// ParametersCDMA2000-r11 ::= SEQUENCE -SRSASN_CODE params_cdma2000_r11_s::pack(bit_ref& bref) const +// CarrierFreqUTRA-FDD-Ext-r12 ::= SEQUENCE +SRSASN_CODE carrier_freq_utra_fdd_ext_r12_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(sys_time_info_r11_present, 1)); - HANDLE_CODE(bref.pack(params_hrpd_r11_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.pack(cell_resel_prio_r12_present, 1)); + HANDLE_CODE(bref.pack(thresh_x_q_r12_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_r12_present, 1)); + HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); - if (sys_time_info_r11_present) { - HANDLE_CODE(sys_time_info_r11.pack(bref)); + HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint16_t)0u, (uint16_t)16383u)); + if (cell_resel_prio_r12_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_prio_r12, (uint8_t)0u, (uint8_t)7u)); } - HANDLE_CODE(pack_integer(bref, search_win_size_r11, (uint8_t)0u, (uint8_t)15u)); - if (params_hrpd_r11_present) { - HANDLE_CODE(bref.pack(params_hrpd_r11.cell_resel_params_hrpd_r11_present, 1)); - HANDLE_CODE(params_hrpd_r11.pre_regist_info_hrpd_r11.pack(bref)); - if (params_hrpd_r11.cell_resel_params_hrpd_r11_present) { - HANDLE_CODE(params_hrpd_r11.cell_resel_params_hrpd_r11.pack(bref)); - } + HANDLE_CODE(pack_integer(bref, thresh_x_high_r12, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_low_r12, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r12, (int8_t)-60, (int8_t)-13)); + HANDLE_CODE(pack_integer(bref, p_max_utra_r12, (int8_t)-50, (int8_t)33)); + HANDLE_CODE(pack_integer(bref, q_qual_min_r12, (int8_t)-24, (int8_t)0)); + if (thresh_x_q_r12_present) { + HANDLE_CODE(pack_integer(bref, thresh_x_q_r12.thresh_x_high_q_r12, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_q_r12.thresh_x_low_q_r12, (uint8_t)0u, (uint8_t)31u)); } - if (params1_xrtt_r11_present) { - HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt_r11.long_code_state1_xrtt_r11_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt_r11.cell_resel_params1_xrtt_r11_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_dual_rx_tx_support_r11_present, 1)); - if (params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present) { - HANDLE_CODE(params1_xrtt_r11.csfb_regist_param1_xrtt_r11.pack(bref)); - } - if (params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present) { - HANDLE_CODE(params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11.pack(bref)); - } - if (params1_xrtt_r11.long_code_state1_xrtt_r11_present) { - HANDLE_CODE(params1_xrtt_r11.long_code_state1_xrtt_r11.pack(bref)); - } - if (params1_xrtt_r11.cell_resel_params1_xrtt_r11_present) { - HANDLE_CODE(params1_xrtt_r11.cell_resel_params1_xrtt_r11.pack(bref)); - } - if (params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present) { - HANDLE_CODE(params1_xrtt_r11.ac_barr_cfg1_xrtt_r11.pack(bref)); - } - if (params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present) { - HANDLE_CODE(bref.pack(params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11, 1)); - } + if (multi_band_info_list_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r12, 1, 8, integer_packer(1, 86))); } return SRSASN_SUCCESS; } -SRSASN_CODE params_cdma2000_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE carrier_freq_utra_fdd_ext_r12_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(sys_time_info_r11_present, 1)); - HANDLE_CODE(bref.unpack(params_hrpd_r11_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt_r11_present, 1)); + HANDLE_CODE(bref.unpack(cell_resel_prio_r12_present, 1)); + HANDLE_CODE(bref.unpack(thresh_x_q_r12_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_r12_present, 1)); + HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); - if (sys_time_info_r11_present) { - HANDLE_CODE(sys_time_info_r11.unpack(bref)); + HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint16_t)0u, (uint16_t)16383u)); + if (cell_resel_prio_r12_present) { + HANDLE_CODE(unpack_integer(cell_resel_prio_r12, bref, (uint8_t)0u, (uint8_t)7u)); } - HANDLE_CODE(unpack_integer(search_win_size_r11, bref, (uint8_t)0u, (uint8_t)15u)); - if (params_hrpd_r11_present) { - HANDLE_CODE(bref.unpack(params_hrpd_r11.cell_resel_params_hrpd_r11_present, 1)); - HANDLE_CODE(params_hrpd_r11.pre_regist_info_hrpd_r11.unpack(bref)); - if (params_hrpd_r11.cell_resel_params_hrpd_r11_present) { - HANDLE_CODE(params_hrpd_r11.cell_resel_params_hrpd_r11.unpack(bref)); - } + HANDLE_CODE(unpack_integer(thresh_x_high_r12, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_low_r12, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(q_rx_lev_min_r12, bref, (int8_t)-60, (int8_t)-13)); + HANDLE_CODE(unpack_integer(p_max_utra_r12, bref, (int8_t)-50, (int8_t)33)); + HANDLE_CODE(unpack_integer(q_qual_min_r12, bref, (int8_t)-24, (int8_t)0)); + if (thresh_x_q_r12_present) { + HANDLE_CODE(unpack_integer(thresh_x_q_r12.thresh_x_high_q_r12, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_q_r12.thresh_x_low_q_r12, bref, (uint8_t)0u, (uint8_t)31u)); } - if (params1_xrtt_r11_present) { - HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt_r11.long_code_state1_xrtt_r11_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt_r11.cell_resel_params1_xrtt_r11_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_dual_rx_tx_support_r11_present, 1)); - if (params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present) { - HANDLE_CODE(params1_xrtt_r11.csfb_regist_param1_xrtt_r11.unpack(bref)); - } - if (params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present) { - HANDLE_CODE(params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11.unpack(bref)); - } - if (params1_xrtt_r11.long_code_state1_xrtt_r11_present) { - HANDLE_CODE(params1_xrtt_r11.long_code_state1_xrtt_r11.unpack(bref)); - } - if (params1_xrtt_r11.cell_resel_params1_xrtt_r11_present) { - HANDLE_CODE(params1_xrtt_r11.cell_resel_params1_xrtt_r11.unpack(bref)); - } - if (params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present) { - HANDLE_CODE(params1_xrtt_r11.ac_barr_cfg1_xrtt_r11.unpack(bref)); - } - if (params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present) { - HANDLE_CODE(bref.unpack(params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11, 1)); - } + if (multi_band_info_list_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r12, bref, 1, 8, integer_packer(1, 86))); } return SRSASN_SUCCESS; } -void params_cdma2000_r11_s::to_json(json_writer& j) const +void carrier_freq_utra_fdd_ext_r12_s::to_json(json_writer& j) const { j.start_obj(); - if (sys_time_info_r11_present) { - j.write_fieldname("systemTimeInfo-r11"); - sys_time_info_r11.to_json(j); + j.write_int("carrierFreq-r12", carrier_freq_r12); + if (cell_resel_prio_r12_present) { + j.write_int("cellReselectionPriority-r12", cell_resel_prio_r12); } - j.write_int("searchWindowSize-r11", search_win_size_r11); - if (params_hrpd_r11_present) { - j.write_fieldname("parametersHRPD-r11"); + j.write_int("threshX-High-r12", thresh_x_high_r12); + j.write_int("threshX-Low-r12", thresh_x_low_r12); + j.write_int("q-RxLevMin-r12", q_rx_lev_min_r12); + j.write_int("p-MaxUTRA-r12", p_max_utra_r12); + j.write_int("q-QualMin-r12", q_qual_min_r12); + if (thresh_x_q_r12_present) { + j.write_fieldname("threshX-Q-r12"); j.start_obj(); - j.write_fieldname("preRegistrationInfoHRPD-r11"); - params_hrpd_r11.pre_regist_info_hrpd_r11.to_json(j); - if (params_hrpd_r11.cell_resel_params_hrpd_r11_present) { - j.write_fieldname("cellReselectionParametersHRPD-r11"); - params_hrpd_r11.cell_resel_params_hrpd_r11.to_json(j); - } + j.write_int("threshX-HighQ-r12", thresh_x_q_r12.thresh_x_high_q_r12); + j.write_int("threshX-LowQ-r12", thresh_x_q_r12.thresh_x_low_q_r12); j.end_obj(); } - if (params1_xrtt_r11_present) { - j.write_fieldname("parameters1XRTT-r11"); - j.start_obj(); - if (params1_xrtt_r11.csfb_regist_param1_xrtt_r11_present) { - j.write_fieldname("csfb-RegistrationParam1XRTT-r11"); - params1_xrtt_r11.csfb_regist_param1_xrtt_r11.to_json(j); - } - if (params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11_present) { - j.write_fieldname("csfb-RegistrationParam1XRTT-Ext-r11"); - params1_xrtt_r11.csfb_regist_param1_xrtt_ext_r11.to_json(j); - } - if (params1_xrtt_r11.long_code_state1_xrtt_r11_present) { - j.write_str("longCodeState1XRTT-r11", params1_xrtt_r11.long_code_state1_xrtt_r11.to_string()); - } - if (params1_xrtt_r11.cell_resel_params1_xrtt_r11_present) { - j.write_fieldname("cellReselectionParameters1XRTT-r11"); - params1_xrtt_r11.cell_resel_params1_xrtt_r11.to_json(j); - } - if (params1_xrtt_r11.ac_barr_cfg1_xrtt_r11_present) { - j.write_fieldname("ac-BarringConfig1XRTT-r11"); - params1_xrtt_r11.ac_barr_cfg1_xrtt_r11.to_json(j); - } - if (params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11_present) { - j.write_bool("csfb-SupportForDualRxUEs-r11", params1_xrtt_r11.csfb_support_for_dual_rx_ues_r11); - } - if (params1_xrtt_r11.csfb_dual_rx_tx_support_r11_present) { - j.write_str("csfb-DualRxTxSupport-r11", "true"); + if (multi_band_info_list_r12_present) { + j.start_array("multiBandInfoList-r12"); + for (const auto& e1 : multi_band_info_list_r12) { + j.write_int(e1); } - j.end_obj(); + j.end_array(); + } + if (reduced_meas_performance_r12_present) { + j.write_str("reducedMeasPerformance-r12", "true"); } j.end_obj(); } -void params_cdma2000_r11_s::sys_time_info_r11_c_::set(types::options e) -{ - type_ = e; -} -void params_cdma2000_r11_s::sys_time_info_r11_c_::to_json(json_writer& j) const +// CarrierFreqUTRA-TDD ::= SEQUENCE +SRSASN_CODE carrier_freq_utra_tdd_s::pack(bit_ref& bref) const { - j.start_obj(); - switch (type_) { - case types::explicit_value: - j.write_fieldname("explicitValue"); - c.to_json(j); - break; - case types::default_value: - break; - default: - log_invalid_choice_id(type_, "params_cdma2000_r11_s::sys_time_info_r11_c_"); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(cell_resel_prio_present, 1)); + + HANDLE_CODE(pack_integer(bref, carrier_freq, (uint16_t)0u, (uint16_t)16383u)); + if (cell_resel_prio_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); } - j.end_obj(); + HANDLE_CODE(pack_integer(bref, thresh_x_high, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_low, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, q_rx_lev_min, (int8_t)-60, (int8_t)-13)); + HANDLE_CODE(pack_integer(bref, p_max_utra, (int8_t)-50, (int8_t)33)); + + return SRSASN_SUCCESS; } -SRSASN_CODE params_cdma2000_r11_s::sys_time_info_r11_c_::pack(bit_ref& bref) const +SRSASN_CODE carrier_freq_utra_tdd_s::unpack(cbit_ref& bref) { - type_.pack(bref); - switch (type_) { - case types::explicit_value: - HANDLE_CODE(c.pack(bref)); - break; - case types::default_value: - break; - default: - log_invalid_choice_id(type_, "params_cdma2000_r11_s::sys_time_info_r11_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(cell_resel_prio_present, 1)); + + HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint16_t)0u, (uint16_t)16383u)); + if (cell_resel_prio_present) { + HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); } + HANDLE_CODE(unpack_integer(thresh_x_high, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_low, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(q_rx_lev_min, bref, (int8_t)-60, (int8_t)-13)); + HANDLE_CODE(unpack_integer(p_max_utra, bref, (int8_t)-50, (int8_t)33)); + return SRSASN_SUCCESS; } -SRSASN_CODE params_cdma2000_r11_s::sys_time_info_r11_c_::unpack(cbit_ref& bref) +void carrier_freq_utra_tdd_s::to_json(json_writer& j) const { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::explicit_value: - HANDLE_CODE(c.unpack(bref)); - break; - case types::default_value: - break; - default: - log_invalid_choice_id(type_, "params_cdma2000_r11_s::sys_time_info_r11_c_"); - return SRSASN_ERROR_DECODE_FAIL; + j.start_obj(); + j.write_int("carrierFreq", carrier_freq); + if (cell_resel_prio_present) { + j.write_int("cellReselectionPriority", cell_resel_prio); } - return SRSASN_SUCCESS; + j.write_int("threshX-High", thresh_x_high); + j.write_int("threshX-Low", thresh_x_low); + j.write_int("q-RxLevMin", q_rx_lev_min); + j.write_int("p-MaxUTRA", p_max_utra); + j.end_obj(); } -// RedistributionInterFreqInfo-r13 ::= SEQUENCE -SRSASN_CODE redist_inter_freq_info_r13_s::pack(bit_ref& bref) const +// CarrierFreqUTRA-TDD-r12 ::= SEQUENCE +SRSASN_CODE carrier_freq_utra_tdd_r12_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(redist_factor_freq_r13_present, 1)); - HANDLE_CODE(bref.pack(redist_neigh_cell_list_r13_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(cell_resel_prio_r12_present, 1)); + HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); - if (redist_factor_freq_r13_present) { - HANDLE_CODE(pack_integer(bref, redist_factor_freq_r13, (uint8_t)1u, (uint8_t)10u)); - } - if (redist_neigh_cell_list_r13_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, redist_neigh_cell_list_r13, 1, 16)); + HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint16_t)0u, (uint16_t)16383u)); + if (cell_resel_prio_r12_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_prio_r12, (uint8_t)0u, (uint8_t)7u)); } + HANDLE_CODE(pack_integer(bref, thresh_x_high_r12, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_low_r12, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r12, (int8_t)-60, (int8_t)-13)); + HANDLE_CODE(pack_integer(bref, p_max_utra_r12, (int8_t)-50, (int8_t)33)); return SRSASN_SUCCESS; } -SRSASN_CODE redist_inter_freq_info_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE carrier_freq_utra_tdd_r12_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(redist_factor_freq_r13_present, 1)); - HANDLE_CODE(bref.unpack(redist_neigh_cell_list_r13_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(cell_resel_prio_r12_present, 1)); + HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); - if (redist_factor_freq_r13_present) { - HANDLE_CODE(unpack_integer(redist_factor_freq_r13, bref, (uint8_t)1u, (uint8_t)10u)); - } - if (redist_neigh_cell_list_r13_present) { - HANDLE_CODE(unpack_dyn_seq_of(redist_neigh_cell_list_r13, bref, 1, 16)); + HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint16_t)0u, (uint16_t)16383u)); + if (cell_resel_prio_r12_present) { + HANDLE_CODE(unpack_integer(cell_resel_prio_r12, bref, (uint8_t)0u, (uint8_t)7u)); } + HANDLE_CODE(unpack_integer(thresh_x_high_r12, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_low_r12, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(q_rx_lev_min_r12, bref, (int8_t)-60, (int8_t)-13)); + HANDLE_CODE(unpack_integer(p_max_utra_r12, bref, (int8_t)-50, (int8_t)33)); return SRSASN_SUCCESS; } -void redist_inter_freq_info_r13_s::to_json(json_writer& j) const +void carrier_freq_utra_tdd_r12_s::to_json(json_writer& j) const { j.start_obj(); - if (redist_factor_freq_r13_present) { - j.write_int("redistributionFactorFreq-r13", redist_factor_freq_r13); + j.write_int("carrierFreq-r12", carrier_freq_r12); + if (cell_resel_prio_r12_present) { + j.write_int("cellReselectionPriority-r12", cell_resel_prio_r12); } - if (redist_neigh_cell_list_r13_present) { - j.start_array("redistributionNeighCellList-r13"); - for (const auto& e1 : redist_neigh_cell_list_r13) { - e1.to_json(j); - } - j.end_array(); + j.write_int("threshX-High-r12", thresh_x_high_r12); + j.write_int("threshX-Low-r12", thresh_x_low_r12); + j.write_int("q-RxLevMin-r12", q_rx_lev_min_r12); + j.write_int("p-MaxUTRA-r12", p_max_utra_r12); + if (reduced_meas_performance_r12_present) { + j.write_str("reducedMeasPerformance-r12", "true"); } j.end_obj(); } -// SL-DiscConfigOtherInterFreq-r13 ::= SEQUENCE -SRSASN_CODE sl_disc_cfg_other_inter_freq_r13_s::pack(bit_ref& bref) const +// CarrierFreqsInfoGERAN ::= SEQUENCE +SRSASN_CODE carrier_freqs_info_geran_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(tx_pwr_info_r13_present, 1)); - HANDLE_CODE(bref.pack(ref_carrier_common_r13_present, 1)); - HANDLE_CODE(bref.pack(disc_sync_cfg_r13_present, 1)); - HANDLE_CODE(bref.pack(disc_cell_sel_info_r13_present, 1)); - - if (tx_pwr_info_r13_present) { - HANDLE_CODE(pack_fixed_seq_of(bref, &(tx_pwr_info_r13)[0], tx_pwr_info_r13.size())); + bref.pack(ext, 1); + HANDLE_CODE(carrier_freqs.pack(bref)); + HANDLE_CODE(bref.pack(common_info.cell_resel_prio_present, 1)); + HANDLE_CODE(bref.pack(common_info.p_max_geran_present, 1)); + if (common_info.cell_resel_prio_present) { + HANDLE_CODE(pack_integer(bref, common_info.cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); } - if (disc_sync_cfg_r13_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, disc_sync_cfg_r13, 1, 16)); - } - if (disc_cell_sel_info_r13_present) { - HANDLE_CODE(disc_cell_sel_info_r13.pack(bref)); + HANDLE_CODE(common_info.ncc_permitted.pack(bref)); + HANDLE_CODE(pack_integer(bref, common_info.q_rx_lev_min, (uint8_t)0u, (uint8_t)45u)); + if (common_info.p_max_geran_present) { + HANDLE_CODE(pack_integer(bref, common_info.p_max_geran, (uint8_t)0u, (uint8_t)39u)); } + HANDLE_CODE(pack_integer(bref, common_info.thresh_x_high, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, common_info.thresh_x_low, (uint8_t)0u, (uint8_t)31u)); return SRSASN_SUCCESS; } -SRSASN_CODE sl_disc_cfg_other_inter_freq_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE carrier_freqs_info_geran_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(tx_pwr_info_r13_present, 1)); - HANDLE_CODE(bref.unpack(ref_carrier_common_r13_present, 1)); - HANDLE_CODE(bref.unpack(disc_sync_cfg_r13_present, 1)); - HANDLE_CODE(bref.unpack(disc_cell_sel_info_r13_present, 1)); - - if (tx_pwr_info_r13_present) { - HANDLE_CODE(unpack_fixed_seq_of(&(tx_pwr_info_r13)[0], bref, tx_pwr_info_r13.size())); - } - if (disc_sync_cfg_r13_present) { - HANDLE_CODE(unpack_dyn_seq_of(disc_sync_cfg_r13, bref, 1, 16)); + bref.unpack(ext, 1); + HANDLE_CODE(carrier_freqs.unpack(bref)); + HANDLE_CODE(bref.unpack(common_info.cell_resel_prio_present, 1)); + HANDLE_CODE(bref.unpack(common_info.p_max_geran_present, 1)); + if (common_info.cell_resel_prio_present) { + HANDLE_CODE(unpack_integer(common_info.cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); } - if (disc_cell_sel_info_r13_present) { - HANDLE_CODE(disc_cell_sel_info_r13.unpack(bref)); + HANDLE_CODE(common_info.ncc_permitted.unpack(bref)); + HANDLE_CODE(unpack_integer(common_info.q_rx_lev_min, bref, (uint8_t)0u, (uint8_t)45u)); + if (common_info.p_max_geran_present) { + HANDLE_CODE(unpack_integer(common_info.p_max_geran, bref, (uint8_t)0u, (uint8_t)39u)); } + HANDLE_CODE(unpack_integer(common_info.thresh_x_high, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(common_info.thresh_x_low, bref, (uint8_t)0u, (uint8_t)31u)); return SRSASN_SUCCESS; } -void sl_disc_cfg_other_inter_freq_r13_s::to_json(json_writer& j) const +void carrier_freqs_info_geran_s::to_json(json_writer& j) const { j.start_obj(); - if (tx_pwr_info_r13_present) { - j.start_array("txPowerInfo-r13"); - for (const auto& e1 : tx_pwr_info_r13) { - e1.to_json(j); - } - j.end_array(); - } - if (ref_carrier_common_r13_present) { - j.write_str("refCarrierCommon-r13", "pCell"); - } - if (disc_sync_cfg_r13_present) { - j.start_array("discSyncConfig-r13"); - for (const auto& e1 : disc_sync_cfg_r13) { - e1.to_json(j); - } - j.end_array(); + j.write_fieldname("carrierFreqs"); + carrier_freqs.to_json(j); + j.write_fieldname("commonInfo"); + j.start_obj(); + if (common_info.cell_resel_prio_present) { + j.write_int("cellReselectionPriority", common_info.cell_resel_prio); } - if (disc_cell_sel_info_r13_present) { - j.write_fieldname("discCellSelectionInfo-r13"); - disc_cell_sel_info_r13.to_json(j); + j.write_str("ncc-Permitted", common_info.ncc_permitted.to_string()); + j.write_int("q-RxLevMin", common_info.q_rx_lev_min); + if (common_info.p_max_geran_present) { + j.write_int("p-MaxGERAN", common_info.p_max_geran); } + j.write_int("threshX-High", common_info.thresh_x_high); + j.write_int("threshX-Low", common_info.thresh_x_low); + j.end_obj(); j.end_obj(); } -// SystemInformationBlockType1-v10l0-IEs ::= SEQUENCE -SRSASN_CODE sib_type1_v10l0_ies_s::pack(bit_ref& bref) const +// EAB-Config-r11 ::= SEQUENCE +SRSASN_CODE eab_cfg_r11_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(freq_band_info_v10l0_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v10l0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (freq_band_info_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_v10l0, 1, 8)); - } - if (multi_band_info_list_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10l0, 1, 8, SeqOfPacker(1, 8, Packer()))); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } + HANDLE_CODE(eab_category_r11.pack(bref)); + HANDLE_CODE(eab_barr_bitmap_r11.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE sib_type1_v10l0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE eab_cfg_r11_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(freq_band_info_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (freq_band_info_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_v10l0, bref, 1, 8)); - } - if (multi_band_info_list_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10l0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } + HANDLE_CODE(eab_category_r11.unpack(bref)); + HANDLE_CODE(eab_barr_bitmap_r11.unpack(bref)); return SRSASN_SUCCESS; } -void sib_type1_v10l0_ies_s::to_json(json_writer& j) const +void eab_cfg_r11_s::to_json(json_writer& j) const { j.start_obj(); - if (freq_band_info_v10l0_present) { - j.start_array("freqBandInfo-v10l0"); - for (const auto& e1 : freq_band_info_v10l0) { - e1.to_json(j); - } - j.end_array(); - } - if (multi_band_info_list_v10l0_present) { - j.start_array("multiBandInfoList-v10l0"); - for (const auto& e1 : multi_band_info_list_v10l0) { - j.start_array(); - for (const auto& e2 : e1) { - e2.to_json(j); - } - j.end_array(); - } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } + j.write_str("eab-Category-r11", eab_category_r11.to_string()); + j.write_str("eab-BarringBitmap-r11", eab_barr_bitmap_r11.to_string()); j.end_obj(); } -// SystemInformationBlockType2-v9i0-IEs ::= SEQUENCE -SRSASN_CODE sib_type2_v9i0_ies_s::pack(bit_ref& bref) const +std::string eab_cfg_r11_s::eab_category_r11_opts::to_string() const { - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(dummy_present, 1)); - - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; + static const char* options[] = {"a", "b", "c"}; + return convert_enum_idx(options, 3, value, "eab_cfg_r11_s::eab_category_r11_e_"); } -SRSASN_CODE sib_type2_v9i0_ies_s::unpack(cbit_ref& bref) + +// InterFreqCarrierFreqInfo ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(dummy_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(p_max_present, 1)); + HANDLE_CODE(bref.pack(t_resel_eutra_sf_present, 1)); + HANDLE_CODE(bref.pack(cell_resel_prio_present, 1)); + HANDLE_CODE(bref.pack(q_offset_freq_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_neigh_cell_list_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_black_cell_list_present, 1)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + HANDLE_CODE(pack_integer(bref, dl_carrier_freq, (uint32_t)0u, (uint32_t)65535u)); + HANDLE_CODE(pack_integer(bref, q_rx_lev_min, (int8_t)-70, (int8_t)-22)); + if (p_max_present) { + HANDLE_CODE(pack_integer(bref, p_max, (int8_t)-30, (int8_t)33)); } - - return SRSASN_SUCCESS; -} -void sib_type2_v9i0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (non_crit_ext_present) { - j.write_str("nonCriticalExtension", non_crit_ext.to_string()); + HANDLE_CODE(pack_integer(bref, t_resel_eutra, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_eutra_sf_present) { + HANDLE_CODE(t_resel_eutra_sf.pack(bref)); } - if (dummy_present) { - j.write_fieldname("dummy"); - j.start_obj(); - j.end_obj(); + HANDLE_CODE(pack_integer(bref, thresh_x_high, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_low, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(allowed_meas_bw.pack(bref)); + HANDLE_CODE(bref.pack(presence_ant_port1, 1)); + if (cell_resel_prio_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); } - j.end_obj(); -} - -// SystemInformationBlockType5-v10j0-IEs ::= SEQUENCE -SRSASN_CODE sib_type5_v10j0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v10j0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (inter_freq_carrier_freq_list_v10j0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v10j0, 1, 8)); + HANDLE_CODE(neigh_cell_cfg.pack(bref)); + if (q_offset_freq_present) { + HANDLE_CODE(q_offset_freq.pack(bref)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (inter_freq_neigh_cell_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_neigh_cell_list, 1, 16)); + } + if (inter_freq_black_cell_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_black_cell_list, 1, 16)); } + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= q_qual_min_r9_present; + group_flags[0] |= thresh_x_q_r9.is_present(); + group_flags[1] |= q_qual_min_wb_r11_present; + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(q_qual_min_r9_present, 1)); + HANDLE_CODE(bref.pack(thresh_x_q_r9.is_present(), 1)); + if (q_qual_min_r9_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_r9, (int8_t)-34, (int8_t)-3)); + } + if (thresh_x_q_r9.is_present()) { + HANDLE_CODE(pack_integer(bref, thresh_x_q_r9->thresh_x_high_q_r9, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_q_r9->thresh_x_low_q_r9, (uint8_t)0u, (uint8_t)31u)); + } + } + if (group_flags[1]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(q_qual_min_wb_r11_present, 1)); + if (q_qual_min_wb_r11_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_wb_r11, (int8_t)-34, (int8_t)-3)); + } + } + } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type5_v10j0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE inter_freq_carrier_freq_info_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v10j0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(p_max_present, 1)); + HANDLE_CODE(bref.unpack(t_resel_eutra_sf_present, 1)); + HANDLE_CODE(bref.unpack(cell_resel_prio_present, 1)); + HANDLE_CODE(bref.unpack(q_offset_freq_present, 1)); + HANDLE_CODE(bref.unpack(inter_freq_neigh_cell_list_present, 1)); + HANDLE_CODE(bref.unpack(inter_freq_black_cell_list_present, 1)); - if (inter_freq_carrier_freq_list_v10j0_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v10j0, bref, 1, 8)); + HANDLE_CODE(unpack_integer(dl_carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u)); + HANDLE_CODE(unpack_integer(q_rx_lev_min, bref, (int8_t)-70, (int8_t)-22)); + if (p_max_present) { + HANDLE_CODE(unpack_integer(p_max, bref, (int8_t)-30, (int8_t)33)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + HANDLE_CODE(unpack_integer(t_resel_eutra, bref, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_eutra_sf_present) { + HANDLE_CODE(t_resel_eutra_sf.unpack(bref)); } - - return SRSASN_SUCCESS; -} -void sib_type5_v10j0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (inter_freq_carrier_freq_list_v10j0_present) { - j.start_array("interFreqCarrierFreqList-v10j0"); - for (const auto& e1 : inter_freq_carrier_freq_list_v10j0) { - e1.to_json(j); - } - j.end_array(); + HANDLE_CODE(unpack_integer(thresh_x_high, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_low, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(allowed_meas_bw.unpack(bref)); + HANDLE_CODE(bref.unpack(presence_ant_port1, 1)); + if (cell_resel_prio_present) { + HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + HANDLE_CODE(neigh_cell_cfg.unpack(bref)); + if (q_offset_freq_present) { + HANDLE_CODE(q_offset_freq.unpack(bref)); + } + if (inter_freq_neigh_cell_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_neigh_cell_list, bref, 1, 16)); + } + if (inter_freq_black_cell_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_black_cell_list, bref, 1, 16)); } - j.end_obj(); -} -// CarrierFreqInfoUTRA-FDD-v8h0 ::= SEQUENCE -SRSASN_CODE carrier_freq_info_utra_fdd_v8h0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(multi_band_info_list_present, 1)); + if (ext) { + ext_groups_unpacker_guard group_flags(2); + group_flags.unpack(bref); - if (multi_band_info_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer(1, 86))); - } + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); - return SRSASN_SUCCESS; -} -SRSASN_CODE carrier_freq_info_utra_fdd_v8h0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(multi_band_info_list_present, 1)); + HANDLE_CODE(bref.unpack(q_qual_min_r9_present, 1)); + bool thresh_x_q_r9_present; + HANDLE_CODE(bref.unpack(thresh_x_q_r9_present, 1)); + thresh_x_q_r9.set_present(thresh_x_q_r9_present); + if (q_qual_min_r9_present) { + HANDLE_CODE(unpack_integer(q_qual_min_r9, bref, (int8_t)-34, (int8_t)-3)); + } + if (thresh_x_q_r9.is_present()) { + HANDLE_CODE(unpack_integer(thresh_x_q_r9->thresh_x_high_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_q_r9->thresh_x_low_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); + } + } + if (group_flags[1]) { + varlength_field_unpack_guard varlen_scope(bref, false); - if (multi_band_info_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer(1, 86))); + HANDLE_CODE(bref.unpack(q_qual_min_wb_r11_present, 1)); + if (q_qual_min_wb_r11_present) { + HANDLE_CODE(unpack_integer(q_qual_min_wb_r11, bref, (int8_t)-34, (int8_t)-3)); + } + } } - return SRSASN_SUCCESS; } -void carrier_freq_info_utra_fdd_v8h0_s::to_json(json_writer& j) const +void inter_freq_carrier_freq_info_s::to_json(json_writer& j) const { j.start_obj(); - if (multi_band_info_list_present) { - j.start_array("multiBandInfoList"); - for (const auto& e1 : multi_band_info_list) { - j.write_int(e1); + j.write_int("dl-CarrierFreq", dl_carrier_freq); + j.write_int("q-RxLevMin", q_rx_lev_min); + if (p_max_present) { + j.write_int("p-Max", p_max); + } + j.write_int("t-ReselectionEUTRA", t_resel_eutra); + if (t_resel_eutra_sf_present) { + j.write_fieldname("t-ReselectionEUTRA-SF"); + t_resel_eutra_sf.to_json(j); + } + j.write_int("threshX-High", thresh_x_high); + j.write_int("threshX-Low", thresh_x_low); + j.write_str("allowedMeasBandwidth", allowed_meas_bw.to_string()); + j.write_bool("presenceAntennaPort1", presence_ant_port1); + if (cell_resel_prio_present) { + j.write_int("cellReselectionPriority", cell_resel_prio); + } + j.write_str("neighCellConfig", neigh_cell_cfg.to_string()); + if (q_offset_freq_present) { + j.write_str("q-OffsetFreq", q_offset_freq.to_string()); + } + if (inter_freq_neigh_cell_list_present) { + j.start_array("interFreqNeighCellList"); + for (const auto& e1 : inter_freq_neigh_cell_list) { + e1.to_json(j); + } + j.end_array(); + } + if (inter_freq_black_cell_list_present) { + j.start_array("interFreqBlackCellList"); + for (const auto& e1 : inter_freq_black_cell_list) { + e1.to_json(j); } j.end_array(); } + if (ext) { + if (q_qual_min_r9_present) { + j.write_int("q-QualMin-r9", q_qual_min_r9); + } + if (thresh_x_q_r9.is_present()) { + j.write_fieldname("threshX-Q-r9"); + j.start_obj(); + j.write_int("threshX-HighQ-r9", thresh_x_q_r9->thresh_x_high_q_r9); + j.write_int("threshX-LowQ-r9", thresh_x_q_r9->thresh_x_low_q_r9); + j.end_obj(); + } + if (q_qual_min_wb_r11_present) { + j.write_int("q-QualMinWB-r11", q_qual_min_wb_r11); + } + } j.end_obj(); } -// CarrierFreqNR-r15 ::= SEQUENCE -SRSASN_CODE carrier_freq_nr_r15_s::pack(bit_ref& bref) const +// InterFreqCarrierFreqInfo-r12 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_r12_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(multi_band_info_list_r15_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_sul_r15_present, 1)); - HANDLE_CODE(bref.pack(meas_timing_cfg_r15_present, 1)); - HANDLE_CODE(bref.pack(ss_rssi_meas_r15_present, 1)); - HANDLE_CODE(bref.pack(cell_resel_prio_r15_present, 1)); - HANDLE_CODE(bref.pack(cell_resel_sub_prio_r15_present, 1)); - HANDLE_CODE(bref.pack(thresh_x_q_r15_present, 1)); - HANDLE_CODE(bref.pack(q_rx_lev_min_sul_r15_present, 1)); - HANDLE_CODE(bref.pack(ns_pmax_list_nr_r15_present, 1)); - HANDLE_CODE(bref.pack(q_qual_min_r15_present, 1)); - HANDLE_CODE(bref.pack(max_rs_idx_cell_qual_r15_present, 1)); - HANDLE_CODE(bref.pack(thresh_rs_idx_r15_present, 1)); + HANDLE_CODE(bref.pack(p_max_r12_present, 1)); + HANDLE_CODE(bref.pack(t_resel_eutra_sf_r12_present, 1)); + HANDLE_CODE(bref.pack(cell_resel_prio_r12_present, 1)); + HANDLE_CODE(bref.pack(q_offset_freq_r12_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_neigh_cell_list_r12_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_black_cell_list_r12_present, 1)); + HANDLE_CODE(bref.pack(q_qual_min_r12_present, 1)); + HANDLE_CODE(bref.pack(thresh_x_q_r12_present, 1)); + HANDLE_CODE(bref.pack(q_qual_min_wb_r12_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_r12_present, 1)); + HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); + HANDLE_CODE(bref.pack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); - HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)3279165u)); - if (multi_band_info_list_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r15, 1, 32, integer_packer(1, 1024))); - } - if (multi_band_info_list_sul_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_sul_r15, 1, 32, integer_packer(1, 1024))); + HANDLE_CODE(pack_integer(bref, dl_carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u)); + HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r12, (int8_t)-70, (int8_t)-22)); + if (p_max_r12_present) { + HANDLE_CODE(pack_integer(bref, p_max_r12, (int8_t)-30, (int8_t)33)); } - if (meas_timing_cfg_r15_present) { - HANDLE_CODE(meas_timing_cfg_r15.pack(bref)); + HANDLE_CODE(pack_integer(bref, t_resel_eutra_r12, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_eutra_sf_r12_present) { + HANDLE_CODE(t_resel_eutra_sf_r12.pack(bref)); } - HANDLE_CODE(subcarrier_spacing_ssb_r15.pack(bref)); - if (ss_rssi_meas_r15_present) { - HANDLE_CODE(ss_rssi_meas_r15.pack(bref)); + HANDLE_CODE(pack_integer(bref, thresh_x_high_r12, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_low_r12, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(allowed_meas_bw_r12.pack(bref)); + HANDLE_CODE(bref.pack(presence_ant_port1_r12, 1)); + if (cell_resel_prio_r12_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_prio_r12, (uint8_t)0u, (uint8_t)7u)); } - if (cell_resel_prio_r15_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_prio_r15, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(neigh_cell_cfg_r12.pack(bref)); + if (q_offset_freq_r12_present) { + HANDLE_CODE(q_offset_freq_r12.pack(bref)); } - if (cell_resel_sub_prio_r15_present) { - HANDLE_CODE(cell_resel_sub_prio_r15.pack(bref)); + if (inter_freq_neigh_cell_list_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_neigh_cell_list_r12, 1, 16)); } - HANDLE_CODE(pack_integer(bref, thresh_x_high_r15, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_low_r15, (uint8_t)0u, (uint8_t)31u)); - if (thresh_x_q_r15_present) { - HANDLE_CODE(pack_integer(bref, thresh_x_q_r15.thresh_x_high_q_r15, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_q_r15.thresh_x_low_q_r15, (uint8_t)0u, (uint8_t)31u)); + if (inter_freq_black_cell_list_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_black_cell_list_r12, 1, 16)); } - HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r15, (int8_t)-70, (int8_t)-22)); - if (q_rx_lev_min_sul_r15_present) { - HANDLE_CODE(pack_integer(bref, q_rx_lev_min_sul_r15, (int8_t)-70, (int8_t)-22)); + if (q_qual_min_r12_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_r12, (int8_t)-34, (int8_t)-3)); } - HANDLE_CODE(pack_integer(bref, p_max_nr_r15, (int8_t)-30, (int8_t)33)); - if (ns_pmax_list_nr_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, ns_pmax_list_nr_r15, 1, 8)); + if (thresh_x_q_r12_present) { + HANDLE_CODE(pack_integer(bref, thresh_x_q_r12.thresh_x_high_q_r12, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, thresh_x_q_r12.thresh_x_low_q_r12, (uint8_t)0u, (uint8_t)31u)); } - if (q_qual_min_r15_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_r15, (int8_t)-43, (int8_t)-12)); + if (q_qual_min_wb_r12_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_wb_r12, (int8_t)-34, (int8_t)-3)); } - HANDLE_CODE(bref.pack(derive_ssb_idx_from_cell_r15, 1)); - if (max_rs_idx_cell_qual_r15_present) { - HANDLE_CODE(pack_integer(bref, max_rs_idx_cell_qual_r15, (uint8_t)1u, (uint8_t)16u)); + if (multi_band_info_list_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r12, 1, 8, integer_packer(1, 256))); } - if (thresh_rs_idx_r15_present) { - HANDLE_CODE(thresh_rs_idx_r15.pack(bref)); + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_on_all_symbols_r12, (int8_t)-34, (int8_t)-3)); } - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= multi_band_ns_pmax_list_nr_v1550.is_present(); - group_flags[0] |= multi_band_ns_pmax_list_nr_sul_v1550.is_present(); - group_flags[0] |= ssb_to_measure_r15.is_present(); - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(multi_band_ns_pmax_list_nr_v1550.is_present(), 1)); - HANDLE_CODE(bref.pack(multi_band_ns_pmax_list_nr_sul_v1550.is_present(), 1)); - HANDLE_CODE(bref.pack(ssb_to_measure_r15.is_present(), 1)); - if (multi_band_ns_pmax_list_nr_v1550.is_present()) { - HANDLE_CODE( - pack_dyn_seq_of(bref, *multi_band_ns_pmax_list_nr_v1550, 1, 31, SeqOfPacker(1, 8, Packer()))); - } - if (multi_band_ns_pmax_list_nr_sul_v1550.is_present()) { - HANDLE_CODE( - pack_dyn_seq_of(bref, *multi_band_ns_pmax_list_nr_sul_v1550, 1, 32, SeqOfPacker(1, 8, Packer()))); - } - if (ssb_to_measure_r15.is_present()) { - HANDLE_CODE(ssb_to_measure_r15->pack(bref)); - } - } - } return SRSASN_SUCCESS; } -SRSASN_CODE carrier_freq_nr_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE inter_freq_carrier_freq_info_r12_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(multi_band_info_list_r15_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_sul_r15_present, 1)); - HANDLE_CODE(bref.unpack(meas_timing_cfg_r15_present, 1)); - HANDLE_CODE(bref.unpack(ss_rssi_meas_r15_present, 1)); - HANDLE_CODE(bref.unpack(cell_resel_prio_r15_present, 1)); - HANDLE_CODE(bref.unpack(cell_resel_sub_prio_r15_present, 1)); - HANDLE_CODE(bref.unpack(thresh_x_q_r15_present, 1)); - HANDLE_CODE(bref.unpack(q_rx_lev_min_sul_r15_present, 1)); - HANDLE_CODE(bref.unpack(ns_pmax_list_nr_r15_present, 1)); - HANDLE_CODE(bref.unpack(q_qual_min_r15_present, 1)); - HANDLE_CODE(bref.unpack(max_rs_idx_cell_qual_r15_present, 1)); - HANDLE_CODE(bref.unpack(thresh_rs_idx_r15_present, 1)); + HANDLE_CODE(bref.unpack(p_max_r12_present, 1)); + HANDLE_CODE(bref.unpack(t_resel_eutra_sf_r12_present, 1)); + HANDLE_CODE(bref.unpack(cell_resel_prio_r12_present, 1)); + HANDLE_CODE(bref.unpack(q_offset_freq_r12_present, 1)); + HANDLE_CODE(bref.unpack(inter_freq_neigh_cell_list_r12_present, 1)); + HANDLE_CODE(bref.unpack(inter_freq_black_cell_list_r12_present, 1)); + HANDLE_CODE(bref.unpack(q_qual_min_r12_present, 1)); + HANDLE_CODE(bref.unpack(thresh_x_q_r12_present, 1)); + HANDLE_CODE(bref.unpack(q_qual_min_wb_r12_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_r12_present, 1)); + HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); + HANDLE_CODE(bref.unpack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); - HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)3279165u)); - if (multi_band_info_list_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r15, bref, 1, 32, integer_packer(1, 1024))); - } - if (multi_band_info_list_sul_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_sul_r15, bref, 1, 32, integer_packer(1, 1024))); + HANDLE_CODE(unpack_integer(dl_carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u)); + HANDLE_CODE(unpack_integer(q_rx_lev_min_r12, bref, (int8_t)-70, (int8_t)-22)); + if (p_max_r12_present) { + HANDLE_CODE(unpack_integer(p_max_r12, bref, (int8_t)-30, (int8_t)33)); } - if (meas_timing_cfg_r15_present) { - HANDLE_CODE(meas_timing_cfg_r15.unpack(bref)); + HANDLE_CODE(unpack_integer(t_resel_eutra_r12, bref, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_eutra_sf_r12_present) { + HANDLE_CODE(t_resel_eutra_sf_r12.unpack(bref)); } - HANDLE_CODE(subcarrier_spacing_ssb_r15.unpack(bref)); - if (ss_rssi_meas_r15_present) { - HANDLE_CODE(ss_rssi_meas_r15.unpack(bref)); + HANDLE_CODE(unpack_integer(thresh_x_high_r12, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_low_r12, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(allowed_meas_bw_r12.unpack(bref)); + HANDLE_CODE(bref.unpack(presence_ant_port1_r12, 1)); + if (cell_resel_prio_r12_present) { + HANDLE_CODE(unpack_integer(cell_resel_prio_r12, bref, (uint8_t)0u, (uint8_t)7u)); } - if (cell_resel_prio_r15_present) { - HANDLE_CODE(unpack_integer(cell_resel_prio_r15, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(neigh_cell_cfg_r12.unpack(bref)); + if (q_offset_freq_r12_present) { + HANDLE_CODE(q_offset_freq_r12.unpack(bref)); } - if (cell_resel_sub_prio_r15_present) { - HANDLE_CODE(cell_resel_sub_prio_r15.unpack(bref)); + if (inter_freq_neigh_cell_list_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_neigh_cell_list_r12, bref, 1, 16)); } - HANDLE_CODE(unpack_integer(thresh_x_high_r15, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_low_r15, bref, (uint8_t)0u, (uint8_t)31u)); - if (thresh_x_q_r15_present) { - HANDLE_CODE(unpack_integer(thresh_x_q_r15.thresh_x_high_q_r15, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_q_r15.thresh_x_low_q_r15, bref, (uint8_t)0u, (uint8_t)31u)); + if (inter_freq_black_cell_list_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_black_cell_list_r12, bref, 1, 16)); } - HANDLE_CODE(unpack_integer(q_rx_lev_min_r15, bref, (int8_t)-70, (int8_t)-22)); - if (q_rx_lev_min_sul_r15_present) { - HANDLE_CODE(unpack_integer(q_rx_lev_min_sul_r15, bref, (int8_t)-70, (int8_t)-22)); + if (q_qual_min_r12_present) { + HANDLE_CODE(unpack_integer(q_qual_min_r12, bref, (int8_t)-34, (int8_t)-3)); } - HANDLE_CODE(unpack_integer(p_max_nr_r15, bref, (int8_t)-30, (int8_t)33)); - if (ns_pmax_list_nr_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(ns_pmax_list_nr_r15, bref, 1, 8)); + if (thresh_x_q_r12_present) { + HANDLE_CODE(unpack_integer(thresh_x_q_r12.thresh_x_high_q_r12, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(thresh_x_q_r12.thresh_x_low_q_r12, bref, (uint8_t)0u, (uint8_t)31u)); } - if (q_qual_min_r15_present) { - HANDLE_CODE(unpack_integer(q_qual_min_r15, bref, (int8_t)-43, (int8_t)-12)); + if (q_qual_min_wb_r12_present) { + HANDLE_CODE(unpack_integer(q_qual_min_wb_r12, bref, (int8_t)-34, (int8_t)-3)); } - HANDLE_CODE(bref.unpack(derive_ssb_idx_from_cell_r15, 1)); - if (max_rs_idx_cell_qual_r15_present) { - HANDLE_CODE(unpack_integer(max_rs_idx_cell_qual_r15, bref, (uint8_t)1u, (uint8_t)16u)); + if (multi_band_info_list_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r12, bref, 1, 8, integer_packer(1, 256))); } - if (thresh_rs_idx_r15_present) { - HANDLE_CODE(thresh_rs_idx_r15.unpack(bref)); + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + HANDLE_CODE(unpack_integer(q_qual_min_rsrq_on_all_symbols_r12, bref, (int8_t)-34, (int8_t)-3)); } - if (ext) { - ext_groups_unpacker_guard group_flags(1); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool multi_band_ns_pmax_list_nr_v1550_present; - HANDLE_CODE(bref.unpack(multi_band_ns_pmax_list_nr_v1550_present, 1)); - multi_band_ns_pmax_list_nr_v1550.set_present(multi_band_ns_pmax_list_nr_v1550_present); - bool multi_band_ns_pmax_list_nr_sul_v1550_present; - HANDLE_CODE(bref.unpack(multi_band_ns_pmax_list_nr_sul_v1550_present, 1)); - multi_band_ns_pmax_list_nr_sul_v1550.set_present(multi_band_ns_pmax_list_nr_sul_v1550_present); - bool ssb_to_measure_r15_present; - HANDLE_CODE(bref.unpack(ssb_to_measure_r15_present, 1)); - ssb_to_measure_r15.set_present(ssb_to_measure_r15_present); - if (multi_band_ns_pmax_list_nr_v1550.is_present()) { - HANDLE_CODE( - unpack_dyn_seq_of(*multi_band_ns_pmax_list_nr_v1550, bref, 1, 31, SeqOfPacker(1, 8, Packer()))); - } - if (multi_band_ns_pmax_list_nr_sul_v1550.is_present()) { - HANDLE_CODE( - unpack_dyn_seq_of(*multi_band_ns_pmax_list_nr_sul_v1550, bref, 1, 32, SeqOfPacker(1, 8, Packer()))); - } - if (ssb_to_measure_r15.is_present()) { - HANDLE_CODE(ssb_to_measure_r15->unpack(bref)); - } - } - } return SRSASN_SUCCESS; } -void carrier_freq_nr_r15_s::to_json(json_writer& j) const +void inter_freq_carrier_freq_info_r12_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("carrierFreq-r15", carrier_freq_r15); - if (multi_band_info_list_r15_present) { - j.start_array("multiBandInfoList-r15"); - for (const auto& e1 : multi_band_info_list_r15) { - j.write_int(e1); + j.write_int("dl-CarrierFreq-r12", dl_carrier_freq_r12); + j.write_int("q-RxLevMin-r12", q_rx_lev_min_r12); + if (p_max_r12_present) { + j.write_int("p-Max-r12", p_max_r12); + } + j.write_int("t-ReselectionEUTRA-r12", t_resel_eutra_r12); + if (t_resel_eutra_sf_r12_present) { + j.write_fieldname("t-ReselectionEUTRA-SF-r12"); + t_resel_eutra_sf_r12.to_json(j); + } + j.write_int("threshX-High-r12", thresh_x_high_r12); + j.write_int("threshX-Low-r12", thresh_x_low_r12); + j.write_str("allowedMeasBandwidth-r12", allowed_meas_bw_r12.to_string()); + j.write_bool("presenceAntennaPort1-r12", presence_ant_port1_r12); + if (cell_resel_prio_r12_present) { + j.write_int("cellReselectionPriority-r12", cell_resel_prio_r12); + } + j.write_str("neighCellConfig-r12", neigh_cell_cfg_r12.to_string()); + if (q_offset_freq_r12_present) { + j.write_str("q-OffsetFreq-r12", q_offset_freq_r12.to_string()); + } + if (inter_freq_neigh_cell_list_r12_present) { + j.start_array("interFreqNeighCellList-r12"); + for (const auto& e1 : inter_freq_neigh_cell_list_r12) { + e1.to_json(j); } j.end_array(); } - if (multi_band_info_list_sul_r15_present) { - j.start_array("multiBandInfoListSUL-r15"); - for (const auto& e1 : multi_band_info_list_sul_r15) { - j.write_int(e1); + if (inter_freq_black_cell_list_r12_present) { + j.start_array("interFreqBlackCellList-r12"); + for (const auto& e1 : inter_freq_black_cell_list_r12) { + e1.to_json(j); } j.end_array(); } - if (meas_timing_cfg_r15_present) { - j.write_fieldname("measTimingConfig-r15"); - meas_timing_cfg_r15.to_json(j); - } - j.write_str("subcarrierSpacingSSB-r15", subcarrier_spacing_ssb_r15.to_string()); - if (ss_rssi_meas_r15_present) { - j.write_fieldname("ss-RSSI-Measurement-r15"); - ss_rssi_meas_r15.to_json(j); - } - if (cell_resel_prio_r15_present) { - j.write_int("cellReselectionPriority-r15", cell_resel_prio_r15); - } - if (cell_resel_sub_prio_r15_present) { - j.write_str("cellReselectionSubPriority-r15", cell_resel_sub_prio_r15.to_string()); + if (q_qual_min_r12_present) { + j.write_int("q-QualMin-r12", q_qual_min_r12); } - j.write_int("threshX-High-r15", thresh_x_high_r15); - j.write_int("threshX-Low-r15", thresh_x_low_r15); - if (thresh_x_q_r15_present) { - j.write_fieldname("threshX-Q-r15"); + if (thresh_x_q_r12_present) { + j.write_fieldname("threshX-Q-r12"); j.start_obj(); - j.write_int("threshX-HighQ-r15", thresh_x_q_r15.thresh_x_high_q_r15); - j.write_int("threshX-LowQ-r15", thresh_x_q_r15.thresh_x_low_q_r15); + j.write_int("threshX-HighQ-r12", thresh_x_q_r12.thresh_x_high_q_r12); + j.write_int("threshX-LowQ-r12", thresh_x_q_r12.thresh_x_low_q_r12); j.end_obj(); } - j.write_int("q-RxLevMin-r15", q_rx_lev_min_r15); - if (q_rx_lev_min_sul_r15_present) { - j.write_int("q-RxLevMinSUL-r15", q_rx_lev_min_sul_r15); + if (q_qual_min_wb_r12_present) { + j.write_int("q-QualMinWB-r12", q_qual_min_wb_r12); } - j.write_int("p-MaxNR-r15", p_max_nr_r15); - if (ns_pmax_list_nr_r15_present) { - j.start_array("ns-PmaxListNR-r15"); - for (const auto& e1 : ns_pmax_list_nr_r15) { - e1.to_json(j); + if (multi_band_info_list_r12_present) { + j.start_array("multiBandInfoList-r12"); + for (const auto& e1 : multi_band_info_list_r12) { + j.write_int(e1); } j.end_array(); } - if (q_qual_min_r15_present) { - j.write_int("q-QualMin-r15", q_qual_min_r15); - } - j.write_bool("deriveSSB-IndexFromCell-r15", derive_ssb_idx_from_cell_r15); - if (max_rs_idx_cell_qual_r15_present) { - j.write_int("maxRS-IndexCellQual-r15", max_rs_idx_cell_qual_r15); - } - if (thresh_rs_idx_r15_present) { - j.write_fieldname("threshRS-Index-r15"); - thresh_rs_idx_r15.to_json(j); + if (reduced_meas_performance_r12_present) { + j.write_str("reducedMeasPerformance-r12", "true"); } - if (ext) { - if (multi_band_ns_pmax_list_nr_v1550.is_present()) { - j.start_array("multiBandNsPmaxListNR-v1550"); - for (const auto& e1 : *multi_band_ns_pmax_list_nr_v1550) { - j.start_array(); - for (const auto& e2 : e1) { - e2.to_json(j); - } - j.end_array(); - } - j.end_array(); - } - if (multi_band_ns_pmax_list_nr_sul_v1550.is_present()) { - j.start_array("multiBandNsPmaxListNR-SUL-v1550"); - for (const auto& e1 : *multi_band_ns_pmax_list_nr_sul_v1550) { - j.start_array(); - for (const auto& e2 : e1) { - e2.to_json(j); - } - j.end_array(); - } - j.end_array(); - } - if (ssb_to_measure_r15.is_present()) { - j.write_fieldname("ssb-ToMeasure-r15"); - ssb_to_measure_r15->to_json(j); - } + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + j.write_int("q-QualMinRSRQ-OnAllSymbols-r12", q_qual_min_rsrq_on_all_symbols_r12); } j.end_obj(); } -std::string carrier_freq_nr_r15_s::subcarrier_spacing_ssb_r15_opts::to_string() const -{ - static const char* options[] = {"kHz15", "kHz30", "kHz120", "kHz240"}; - return convert_enum_idx(options, 4, value, "carrier_freq_nr_r15_s::subcarrier_spacing_ssb_r15_e_"); -} -uint8_t carrier_freq_nr_r15_s::subcarrier_spacing_ssb_r15_opts::to_number() const +// InterFreqCarrierFreqInfo-v10j0 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v10j0_s::pack(bit_ref& bref) const { - static const uint8_t options[] = {15, 30, 120, 240}; - return map_enum_number(options, 4, value, "carrier_freq_nr_r15_s::subcarrier_spacing_ssb_r15_e_"); -} + HANDLE_CODE(bref.pack(freq_band_info_r10_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v10j0_present, 1)); -// CarrierFreqUTRA-FDD ::= SEQUENCE -SRSASN_CODE carrier_freq_utra_fdd_s::pack(bit_ref& bref) const + if (freq_band_info_r10_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_r10, 1, 8)); + } + if (multi_band_info_list_v10j0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10j0, 1, 8, SeqOfPacker(1, 8, Packer()))); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE inter_freq_carrier_freq_info_v10j0_s::unpack(cbit_ref& bref) { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(cell_resel_prio_present, 1)); + HANDLE_CODE(bref.unpack(freq_band_info_r10_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v10j0_present, 1)); - HANDLE_CODE(pack_integer(bref, carrier_freq, (uint16_t)0u, (uint16_t)16383u)); - if (cell_resel_prio_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); + if (freq_band_info_r10_present) { + HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_r10, bref, 1, 8)); + } + if (multi_band_info_list_v10j0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10j0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); } - HANDLE_CODE(pack_integer(bref, thresh_x_high, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_low, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, q_rx_lev_min, (int8_t)-60, (int8_t)-13)); - HANDLE_CODE(pack_integer(bref, p_max_utra, (int8_t)-50, (int8_t)33)); - HANDLE_CODE(pack_integer(bref, q_qual_min, (int8_t)-24, (int8_t)0)); - - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= thresh_x_q_r9.is_present(); - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.pack(thresh_x_q_r9.is_present(), 1)); - if (thresh_x_q_r9.is_present()) { - HANDLE_CODE(pack_integer(bref, thresh_x_q_r9->thresh_x_high_q_r9, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_q_r9->thresh_x_low_q_r9, (uint8_t)0u, (uint8_t)31u)); + return SRSASN_SUCCESS; +} +void inter_freq_carrier_freq_info_v10j0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (freq_band_info_r10_present) { + j.start_array("freqBandInfo-r10"); + for (const auto& e1 : freq_band_info_r10) { + e1.to_json(j); + } + j.end_array(); + } + if (multi_band_info_list_v10j0_present) { + j.start_array("multiBandInfoList-v10j0"); + for (const auto& e1 : multi_band_info_list_v10j0) { + j.start_array(); + for (const auto& e2 : e1) { + e2.to_json(j); } + j.end_array(); } + j.end_array(); } - return SRSASN_SUCCESS; + j.end_obj(); } -SRSASN_CODE carrier_freq_utra_fdd_s::unpack(cbit_ref& bref) + +// InterFreqCarrierFreqInfo-v1250 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v1250_s::pack(bit_ref& bref) const { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(cell_resel_prio_present, 1)); + HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); + HANDLE_CODE(bref.pack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); - HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint16_t)0u, (uint16_t)16383u)); - if (cell_resel_prio_present) { - HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_on_all_symbols_r12, (int8_t)-34, (int8_t)-3)); } - HANDLE_CODE(unpack_integer(thresh_x_high, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_low, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(q_rx_lev_min, bref, (int8_t)-60, (int8_t)-13)); - HANDLE_CODE(unpack_integer(p_max_utra, bref, (int8_t)-50, (int8_t)33)); - HANDLE_CODE(unpack_integer(q_qual_min, bref, (int8_t)-24, (int8_t)0)); - if (ext) { - ext_groups_unpacker_guard group_flags(1); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); + return SRSASN_SUCCESS; +} +SRSASN_CODE inter_freq_carrier_freq_info_v1250_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); + HANDLE_CODE(bref.unpack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); - bool thresh_x_q_r9_present; - HANDLE_CODE(bref.unpack(thresh_x_q_r9_present, 1)); - thresh_x_q_r9.set_present(thresh_x_q_r9_present); - if (thresh_x_q_r9.is_present()) { - HANDLE_CODE(unpack_integer(thresh_x_q_r9->thresh_x_high_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_q_r9->thresh_x_low_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); - } - } + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + HANDLE_CODE(unpack_integer(q_qual_min_rsrq_on_all_symbols_r12, bref, (int8_t)-34, (int8_t)-3)); } + return SRSASN_SUCCESS; } -void carrier_freq_utra_fdd_s::to_json(json_writer& j) const +void inter_freq_carrier_freq_info_v1250_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("carrierFreq", carrier_freq); - if (cell_resel_prio_present) { - j.write_int("cellReselectionPriority", cell_resel_prio); + if (reduced_meas_performance_r12_present) { + j.write_str("reducedMeasPerformance-r12", "true"); } - j.write_int("threshX-High", thresh_x_high); - j.write_int("threshX-Low", thresh_x_low); - j.write_int("q-RxLevMin", q_rx_lev_min); - j.write_int("p-MaxUTRA", p_max_utra); - j.write_int("q-QualMin", q_qual_min); - if (ext) { - if (thresh_x_q_r9.is_present()) { - j.write_fieldname("threshX-Q-r9"); - j.start_obj(); - j.write_int("threshX-HighQ-r9", thresh_x_q_r9->thresh_x_high_q_r9); - j.write_int("threshX-LowQ-r9", thresh_x_q_r9->thresh_x_low_q_r9); - j.end_obj(); - } + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + j.write_int("q-QualMinRSRQ-OnAllSymbols-r12", q_qual_min_rsrq_on_all_symbols_r12); } j.end_obj(); } -// CarrierFreqUTRA-FDD-Ext-r12 ::= SEQUENCE -SRSASN_CODE carrier_freq_utra_fdd_ext_r12_s::pack(bit_ref& bref) const +// InterFreqCarrierFreqInfo-v1310 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v1310_s::pack(bit_ref& bref) const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(cell_resel_prio_r12_present, 1)); - HANDLE_CODE(bref.pack(thresh_x_q_r12_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_r12_present, 1)); - HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); + HANDLE_CODE(bref.pack(cell_resel_sub_prio_r13_present, 1)); + HANDLE_CODE(bref.pack(redist_inter_freq_info_r13_present, 1)); + HANDLE_CODE(bref.pack(cell_sel_info_ce_r13_present, 1)); + HANDLE_CODE(bref.pack(t_resel_eutra_ce_r13_present, 1)); - HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint16_t)0u, (uint16_t)16383u)); - if (cell_resel_prio_r12_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_prio_r12, (uint8_t)0u, (uint8_t)7u)); + if (cell_resel_sub_prio_r13_present) { + HANDLE_CODE(cell_resel_sub_prio_r13.pack(bref)); } - HANDLE_CODE(pack_integer(bref, thresh_x_high_r12, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_low_r12, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r12, (int8_t)-60, (int8_t)-13)); - HANDLE_CODE(pack_integer(bref, p_max_utra_r12, (int8_t)-50, (int8_t)33)); - HANDLE_CODE(pack_integer(bref, q_qual_min_r12, (int8_t)-24, (int8_t)0)); - if (thresh_x_q_r12_present) { - HANDLE_CODE(pack_integer(bref, thresh_x_q_r12.thresh_x_high_q_r12, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_q_r12.thresh_x_low_q_r12, (uint8_t)0u, (uint8_t)31u)); + if (redist_inter_freq_info_r13_present) { + HANDLE_CODE(redist_inter_freq_info_r13.pack(bref)); } - if (multi_band_info_list_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r12, 1, 8, integer_packer(1, 86))); + if (cell_sel_info_ce_r13_present) { + HANDLE_CODE(cell_sel_info_ce_r13.pack(bref)); + } + if (t_resel_eutra_ce_r13_present) { + HANDLE_CODE(pack_integer(bref, t_resel_eutra_ce_r13, (uint8_t)0u, (uint8_t)15u)); } return SRSASN_SUCCESS; } -SRSASN_CODE carrier_freq_utra_fdd_ext_r12_s::unpack(cbit_ref& bref) +SRSASN_CODE inter_freq_carrier_freq_info_v1310_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(cell_resel_prio_r12_present, 1)); - HANDLE_CODE(bref.unpack(thresh_x_q_r12_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_r12_present, 1)); - HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); + HANDLE_CODE(bref.unpack(cell_resel_sub_prio_r13_present, 1)); + HANDLE_CODE(bref.unpack(redist_inter_freq_info_r13_present, 1)); + HANDLE_CODE(bref.unpack(cell_sel_info_ce_r13_present, 1)); + HANDLE_CODE(bref.unpack(t_resel_eutra_ce_r13_present, 1)); - HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint16_t)0u, (uint16_t)16383u)); - if (cell_resel_prio_r12_present) { - HANDLE_CODE(unpack_integer(cell_resel_prio_r12, bref, (uint8_t)0u, (uint8_t)7u)); + if (cell_resel_sub_prio_r13_present) { + HANDLE_CODE(cell_resel_sub_prio_r13.unpack(bref)); } - HANDLE_CODE(unpack_integer(thresh_x_high_r12, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_low_r12, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(q_rx_lev_min_r12, bref, (int8_t)-60, (int8_t)-13)); - HANDLE_CODE(unpack_integer(p_max_utra_r12, bref, (int8_t)-50, (int8_t)33)); - HANDLE_CODE(unpack_integer(q_qual_min_r12, bref, (int8_t)-24, (int8_t)0)); - if (thresh_x_q_r12_present) { - HANDLE_CODE(unpack_integer(thresh_x_q_r12.thresh_x_high_q_r12, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_q_r12.thresh_x_low_q_r12, bref, (uint8_t)0u, (uint8_t)31u)); + if (redist_inter_freq_info_r13_present) { + HANDLE_CODE(redist_inter_freq_info_r13.unpack(bref)); } - if (multi_band_info_list_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r12, bref, 1, 8, integer_packer(1, 86))); + if (cell_sel_info_ce_r13_present) { + HANDLE_CODE(cell_sel_info_ce_r13.unpack(bref)); + } + if (t_resel_eutra_ce_r13_present) { + HANDLE_CODE(unpack_integer(t_resel_eutra_ce_r13, bref, (uint8_t)0u, (uint8_t)15u)); } return SRSASN_SUCCESS; } -void carrier_freq_utra_fdd_ext_r12_s::to_json(json_writer& j) const +void inter_freq_carrier_freq_info_v1310_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("carrierFreq-r12", carrier_freq_r12); - if (cell_resel_prio_r12_present) { - j.write_int("cellReselectionPriority-r12", cell_resel_prio_r12); + if (cell_resel_sub_prio_r13_present) { + j.write_str("cellReselectionSubPriority-r13", cell_resel_sub_prio_r13.to_string()); } - j.write_int("threshX-High-r12", thresh_x_high_r12); - j.write_int("threshX-Low-r12", thresh_x_low_r12); - j.write_int("q-RxLevMin-r12", q_rx_lev_min_r12); - j.write_int("p-MaxUTRA-r12", p_max_utra_r12); - j.write_int("q-QualMin-r12", q_qual_min_r12); - if (thresh_x_q_r12_present) { - j.write_fieldname("threshX-Q-r12"); - j.start_obj(); - j.write_int("threshX-HighQ-r12", thresh_x_q_r12.thresh_x_high_q_r12); - j.write_int("threshX-LowQ-r12", thresh_x_q_r12.thresh_x_low_q_r12); - j.end_obj(); + if (redist_inter_freq_info_r13_present) { + j.write_fieldname("redistributionInterFreqInfo-r13"); + redist_inter_freq_info_r13.to_json(j); } - if (multi_band_info_list_r12_present) { - j.start_array("multiBandInfoList-r12"); - for (const auto& e1 : multi_band_info_list_r12) { - j.write_int(e1); - } - j.end_array(); + if (cell_sel_info_ce_r13_present) { + j.write_fieldname("cellSelectionInfoCE-r13"); + cell_sel_info_ce_r13.to_json(j); } - if (reduced_meas_performance_r12_present) { - j.write_str("reducedMeasPerformance-r12", "true"); + if (t_resel_eutra_ce_r13_present) { + j.write_int("t-ReselectionEUTRA-CE-r13", t_resel_eutra_ce_r13); } j.end_obj(); } -// CarrierFreqUTRA-TDD ::= SEQUENCE -SRSASN_CODE carrier_freq_utra_tdd_s::pack(bit_ref& bref) const +// InterFreqCarrierFreqInfo-v1350 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v1350_s::pack(bit_ref& bref) const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(cell_resel_prio_present, 1)); + HANDLE_CODE(bref.pack(cell_sel_info_ce1_r13_present, 1)); - HANDLE_CODE(pack_integer(bref, carrier_freq, (uint16_t)0u, (uint16_t)16383u)); - if (cell_resel_prio_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); + if (cell_sel_info_ce1_r13_present) { + HANDLE_CODE(cell_sel_info_ce1_r13.pack(bref)); } - HANDLE_CODE(pack_integer(bref, thresh_x_high, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_low, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, q_rx_lev_min, (int8_t)-60, (int8_t)-13)); - HANDLE_CODE(pack_integer(bref, p_max_utra, (int8_t)-50, (int8_t)33)); return SRSASN_SUCCESS; } -SRSASN_CODE carrier_freq_utra_tdd_s::unpack(cbit_ref& bref) +SRSASN_CODE inter_freq_carrier_freq_info_v1350_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(cell_resel_prio_present, 1)); + HANDLE_CODE(bref.unpack(cell_sel_info_ce1_r13_present, 1)); - HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint16_t)0u, (uint16_t)16383u)); - if (cell_resel_prio_present) { - HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); + if (cell_sel_info_ce1_r13_present) { + HANDLE_CODE(cell_sel_info_ce1_r13.unpack(bref)); } - HANDLE_CODE(unpack_integer(thresh_x_high, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_low, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(q_rx_lev_min, bref, (int8_t)-60, (int8_t)-13)); - HANDLE_CODE(unpack_integer(p_max_utra, bref, (int8_t)-50, (int8_t)33)); return SRSASN_SUCCESS; } -void carrier_freq_utra_tdd_s::to_json(json_writer& j) const +void inter_freq_carrier_freq_info_v1350_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("carrierFreq", carrier_freq); - if (cell_resel_prio_present) { - j.write_int("cellReselectionPriority", cell_resel_prio); + if (cell_sel_info_ce1_r13_present) { + j.write_fieldname("cellSelectionInfoCE1-r13"); + cell_sel_info_ce1_r13.to_json(j); } - j.write_int("threshX-High", thresh_x_high); - j.write_int("threshX-Low", thresh_x_low); - j.write_int("q-RxLevMin", q_rx_lev_min); - j.write_int("p-MaxUTRA", p_max_utra); j.end_obj(); } -// CarrierFreqUTRA-TDD-r12 ::= SEQUENCE -SRSASN_CODE carrier_freq_utra_tdd_r12_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(cell_resel_prio_r12_present, 1)); - HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); +// InterFreqCarrierFreqInfo-v1360 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v1360_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(cell_sel_info_ce1_v1360_present, 1)); - HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint16_t)0u, (uint16_t)16383u)); - if (cell_resel_prio_r12_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_prio_r12, (uint8_t)0u, (uint8_t)7u)); + if (cell_sel_info_ce1_v1360_present) { + HANDLE_CODE(cell_sel_info_ce1_v1360.pack(bref)); } - HANDLE_CODE(pack_integer(bref, thresh_x_high_r12, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_low_r12, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r12, (int8_t)-60, (int8_t)-13)); - HANDLE_CODE(pack_integer(bref, p_max_utra_r12, (int8_t)-50, (int8_t)33)); return SRSASN_SUCCESS; } -SRSASN_CODE carrier_freq_utra_tdd_r12_s::unpack(cbit_ref& bref) +SRSASN_CODE inter_freq_carrier_freq_info_v1360_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(cell_resel_prio_r12_present, 1)); - HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); + HANDLE_CODE(bref.unpack(cell_sel_info_ce1_v1360_present, 1)); - HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint16_t)0u, (uint16_t)16383u)); - if (cell_resel_prio_r12_present) { - HANDLE_CODE(unpack_integer(cell_resel_prio_r12, bref, (uint8_t)0u, (uint8_t)7u)); + if (cell_sel_info_ce1_v1360_present) { + HANDLE_CODE(cell_sel_info_ce1_v1360.unpack(bref)); } - HANDLE_CODE(unpack_integer(thresh_x_high_r12, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_low_r12, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(q_rx_lev_min_r12, bref, (int8_t)-60, (int8_t)-13)); - HANDLE_CODE(unpack_integer(p_max_utra_r12, bref, (int8_t)-50, (int8_t)33)); return SRSASN_SUCCESS; } -void carrier_freq_utra_tdd_r12_s::to_json(json_writer& j) const +void inter_freq_carrier_freq_info_v1360_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("carrierFreq-r12", carrier_freq_r12); - if (cell_resel_prio_r12_present) { - j.write_int("cellReselectionPriority-r12", cell_resel_prio_r12); - } - j.write_int("threshX-High-r12", thresh_x_high_r12); - j.write_int("threshX-Low-r12", thresh_x_low_r12); - j.write_int("q-RxLevMin-r12", q_rx_lev_min_r12); - j.write_int("p-MaxUTRA-r12", p_max_utra_r12); - if (reduced_meas_performance_r12_present) { - j.write_str("reducedMeasPerformance-r12", "true"); + if (cell_sel_info_ce1_v1360_present) { + j.write_fieldname("cellSelectionInfoCE1-v1360"); + cell_sel_info_ce1_v1360.to_json(j); } j.end_obj(); } -// CarrierFreqsInfoGERAN ::= SEQUENCE -SRSASN_CODE carrier_freqs_info_geran_s::pack(bit_ref& bref) const +// InterFreqCarrierFreqInfo-v1530 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v1530_s::pack(bit_ref& bref) const { - bref.pack(ext, 1); - HANDLE_CODE(carrier_freqs.pack(bref)); - HANDLE_CODE(bref.pack(common_info.cell_resel_prio_present, 1)); - HANDLE_CODE(bref.pack(common_info.p_max_geran_present, 1)); - if (common_info.cell_resel_prio_present) { - HANDLE_CODE(pack_integer(bref, common_info.cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(bref.pack(inter_freq_neigh_hsdn_cell_list_r15_present, 1)); + HANDLE_CODE(bref.pack(cell_sel_info_ce_v1530_present, 1)); + + HANDLE_CODE(bref.pack(hsdn_ind_r15, 1)); + if (inter_freq_neigh_hsdn_cell_list_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_neigh_hsdn_cell_list_r15, 1, 16)); } - HANDLE_CODE(common_info.ncc_permitted.pack(bref)); - HANDLE_CODE(pack_integer(bref, common_info.q_rx_lev_min, (uint8_t)0u, (uint8_t)45u)); - if (common_info.p_max_geran_present) { - HANDLE_CODE(pack_integer(bref, common_info.p_max_geran, (uint8_t)0u, (uint8_t)39u)); + if (cell_sel_info_ce_v1530_present) { + HANDLE_CODE(cell_sel_info_ce_v1530.pack(bref)); } - HANDLE_CODE(pack_integer(bref, common_info.thresh_x_high, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, common_info.thresh_x_low, (uint8_t)0u, (uint8_t)31u)); return SRSASN_SUCCESS; } -SRSASN_CODE carrier_freqs_info_geran_s::unpack(cbit_ref& bref) +SRSASN_CODE inter_freq_carrier_freq_info_v1530_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(carrier_freqs.unpack(bref)); - HANDLE_CODE(bref.unpack(common_info.cell_resel_prio_present, 1)); - HANDLE_CODE(bref.unpack(common_info.p_max_geran_present, 1)); - if (common_info.cell_resel_prio_present) { - HANDLE_CODE(unpack_integer(common_info.cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(bref.unpack(inter_freq_neigh_hsdn_cell_list_r15_present, 1)); + HANDLE_CODE(bref.unpack(cell_sel_info_ce_v1530_present, 1)); + + HANDLE_CODE(bref.unpack(hsdn_ind_r15, 1)); + if (inter_freq_neigh_hsdn_cell_list_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_neigh_hsdn_cell_list_r15, bref, 1, 16)); } - HANDLE_CODE(common_info.ncc_permitted.unpack(bref)); - HANDLE_CODE(unpack_integer(common_info.q_rx_lev_min, bref, (uint8_t)0u, (uint8_t)45u)); - if (common_info.p_max_geran_present) { - HANDLE_CODE(unpack_integer(common_info.p_max_geran, bref, (uint8_t)0u, (uint8_t)39u)); + if (cell_sel_info_ce_v1530_present) { + HANDLE_CODE(cell_sel_info_ce_v1530.unpack(bref)); } - HANDLE_CODE(unpack_integer(common_info.thresh_x_high, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(common_info.thresh_x_low, bref, (uint8_t)0u, (uint8_t)31u)); return SRSASN_SUCCESS; } -void carrier_freqs_info_geran_s::to_json(json_writer& j) const +void inter_freq_carrier_freq_info_v1530_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("carrierFreqs"); - carrier_freqs.to_json(j); - j.write_fieldname("commonInfo"); - j.start_obj(); - if (common_info.cell_resel_prio_present) { - j.write_int("cellReselectionPriority", common_info.cell_resel_prio); + j.write_bool("hsdn-Indication-r15", hsdn_ind_r15); + if (inter_freq_neigh_hsdn_cell_list_r15_present) { + j.start_array("interFreqNeighHSDN-CellList-r15"); + for (const auto& e1 : inter_freq_neigh_hsdn_cell_list_r15) { + e1.to_json(j); + } + j.end_array(); } - j.write_str("ncc-Permitted", common_info.ncc_permitted.to_string()); - j.write_int("q-RxLevMin", common_info.q_rx_lev_min); - if (common_info.p_max_geran_present) { - j.write_int("p-MaxGERAN", common_info.p_max_geran); + if (cell_sel_info_ce_v1530_present) { + j.write_fieldname("cellSelectionInfoCE-v1530"); + cell_sel_info_ce_v1530.to_json(j); } - j.write_int("threshX-High", common_info.thresh_x_high); - j.write_int("threshX-Low", common_info.thresh_x_low); - j.end_obj(); j.end_obj(); } -// EAB-Config-r11 ::= SEQUENCE -SRSASN_CODE eab_cfg_r11_s::pack(bit_ref& bref) const +// IntraFreqNeighCellInfo ::= SEQUENCE +SRSASN_CODE intra_freq_neigh_cell_info_s::pack(bit_ref& bref) const { - HANDLE_CODE(eab_category_r11.pack(bref)); - HANDLE_CODE(eab_barr_bitmap_r11.pack(bref)); + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)503u)); + HANDLE_CODE(q_offset_cell.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE eab_cfg_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE intra_freq_neigh_cell_info_s::unpack(cbit_ref& bref) { - HANDLE_CODE(eab_category_r11.unpack(bref)); - HANDLE_CODE(eab_barr_bitmap_r11.unpack(bref)); + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)503u)); + HANDLE_CODE(q_offset_cell.unpack(bref)); return SRSASN_SUCCESS; } -void eab_cfg_r11_s::to_json(json_writer& j) const +void intra_freq_neigh_cell_info_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("eab-Category-r11", eab_category_r11.to_string()); - j.write_str("eab-BarringBitmap-r11", eab_barr_bitmap_r11.to_string()); + j.write_int("physCellId", pci); + j.write_str("q-OffsetCell", q_offset_cell.to_string()); j.end_obj(); } -std::string eab_cfg_r11_s::eab_category_r11_opts::to_string() const +// MBMS-CarrierType-r14 ::= SEQUENCE +SRSASN_CODE mbms_carrier_type_r14_s::pack(bit_ref& bref) const { - static const char* options[] = {"a", "b", "c"}; - return convert_enum_idx(options, 3, value, "eab_cfg_r11_s::eab_category_r11_e_"); -} + HANDLE_CODE(bref.pack(frame_offset_r14_present, 1)); -// InterFreqCarrierFreqInfo ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_s::pack(bit_ref& bref) const + HANDLE_CODE(carrier_type_r14.pack(bref)); + if (frame_offset_r14_present) { + HANDLE_CODE(pack_integer(bref, frame_offset_r14, (uint8_t)0u, (uint8_t)3u)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE mbms_carrier_type_r14_s::unpack(cbit_ref& bref) { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(p_max_present, 1)); - HANDLE_CODE(bref.pack(t_resel_eutra_sf_present, 1)); - HANDLE_CODE(bref.pack(cell_resel_prio_present, 1)); - HANDLE_CODE(bref.pack(q_offset_freq_present, 1)); - HANDLE_CODE(bref.pack(inter_freq_neigh_cell_list_present, 1)); - HANDLE_CODE(bref.pack(inter_freq_black_cell_list_present, 1)); + HANDLE_CODE(bref.unpack(frame_offset_r14_present, 1)); - HANDLE_CODE(pack_integer(bref, dl_carrier_freq, (uint32_t)0u, (uint32_t)65535u)); - HANDLE_CODE(pack_integer(bref, q_rx_lev_min, (int8_t)-70, (int8_t)-22)); - if (p_max_present) { - HANDLE_CODE(pack_integer(bref, p_max, (int8_t)-30, (int8_t)33)); - } - HANDLE_CODE(pack_integer(bref, t_resel_eutra, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_eutra_sf_present) { - HANDLE_CODE(t_resel_eutra_sf.pack(bref)); - } - HANDLE_CODE(pack_integer(bref, thresh_x_high, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_low, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(allowed_meas_bw.pack(bref)); - HANDLE_CODE(bref.pack(presence_ant_port1, 1)); - if (cell_resel_prio_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); - } - HANDLE_CODE(neigh_cell_cfg.pack(bref)); - if (q_offset_freq_present) { - HANDLE_CODE(q_offset_freq.pack(bref)); - } - if (inter_freq_neigh_cell_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_neigh_cell_list, 1, 16)); - } - if (inter_freq_black_cell_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_black_cell_list, 1, 16)); + HANDLE_CODE(carrier_type_r14.unpack(bref)); + if (frame_offset_r14_present) { + HANDLE_CODE(unpack_integer(frame_offset_r14, bref, (uint8_t)0u, (uint8_t)3u)); } - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= q_qual_min_r9_present; - group_flags[0] |= thresh_x_q_r9.is_present(); - group_flags[1] |= q_qual_min_wb_r11_present; - group_flags.pack(bref); + return SRSASN_SUCCESS; +} +void mbms_carrier_type_r14_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("carrierType-r14", carrier_type_r14.to_string()); + if (frame_offset_r14_present) { + j.write_int("frameOffset-r14", frame_offset_r14); + } + j.end_obj(); +} - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); +std::string mbms_carrier_type_r14_s::carrier_type_r14_opts::to_string() const +{ + static const char* options[] = {"mbms", "fembmsMixed", "fembmsDedicated"}; + return convert_enum_idx(options, 3, value, "mbms_carrier_type_r14_s::carrier_type_r14_e_"); +} - HANDLE_CODE(bref.pack(q_qual_min_r9_present, 1)); - HANDLE_CODE(bref.pack(thresh_x_q_r9.is_present(), 1)); - if (q_qual_min_r9_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_r9, (int8_t)-34, (int8_t)-3)); - } - if (thresh_x_q_r9.is_present()) { - HANDLE_CODE(pack_integer(bref, thresh_x_q_r9->thresh_x_high_q_r9, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_q_r9->thresh_x_low_q_r9, (uint8_t)0u, (uint8_t)31u)); - } - } - if (group_flags[1]) { - varlength_field_pack_guard varlen_scope(bref, false); +// MBMS-SAI-InterFreq-r11 ::= SEQUENCE +SRSASN_CODE mbms_sai_inter_freq_r11_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, dl_carrier_freq_r11, (uint32_t)0u, (uint32_t)262143u)); + HANDLE_CODE(pack_dyn_seq_of(bref, mbms_sai_list_r11, 1, 64, integer_packer(0, 65535))); - HANDLE_CODE(bref.pack(q_qual_min_wb_r11_present, 1)); - if (q_qual_min_wb_r11_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_wb_r11, (int8_t)-34, (int8_t)-3)); - } - } - } return SRSASN_SUCCESS; } -SRSASN_CODE inter_freq_carrier_freq_info_s::unpack(cbit_ref& bref) +SRSASN_CODE mbms_sai_inter_freq_r11_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(p_max_present, 1)); - HANDLE_CODE(bref.unpack(t_resel_eutra_sf_present, 1)); - HANDLE_CODE(bref.unpack(cell_resel_prio_present, 1)); - HANDLE_CODE(bref.unpack(q_offset_freq_present, 1)); - HANDLE_CODE(bref.unpack(inter_freq_neigh_cell_list_present, 1)); - HANDLE_CODE(bref.unpack(inter_freq_black_cell_list_present, 1)); + HANDLE_CODE(unpack_integer(dl_carrier_freq_r11, bref, (uint32_t)0u, (uint32_t)262143u)); + HANDLE_CODE(unpack_dyn_seq_of(mbms_sai_list_r11, bref, 1, 64, integer_packer(0, 65535))); - HANDLE_CODE(unpack_integer(dl_carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u)); - HANDLE_CODE(unpack_integer(q_rx_lev_min, bref, (int8_t)-70, (int8_t)-22)); - if (p_max_present) { - HANDLE_CODE(unpack_integer(p_max, bref, (int8_t)-30, (int8_t)33)); - } - HANDLE_CODE(unpack_integer(t_resel_eutra, bref, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_eutra_sf_present) { - HANDLE_CODE(t_resel_eutra_sf.unpack(bref)); - } - HANDLE_CODE(unpack_integer(thresh_x_high, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_low, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(allowed_meas_bw.unpack(bref)); - HANDLE_CODE(bref.unpack(presence_ant_port1, 1)); - if (cell_resel_prio_present) { - HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); + return SRSASN_SUCCESS; +} +void mbms_sai_inter_freq_r11_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("dl-CarrierFreq-r11", dl_carrier_freq_r11); + j.start_array("mbms-SAI-List-r11"); + for (const auto& e1 : mbms_sai_list_r11) { + j.write_int(e1); } - HANDLE_CODE(neigh_cell_cfg.unpack(bref)); - if (q_offset_freq_present) { - HANDLE_CODE(q_offset_freq.unpack(bref)); + j.end_array(); + j.end_obj(); +} + +// MBMS-SAI-InterFreq-v1140 ::= SEQUENCE +SRSASN_CODE mbms_sai_inter_freq_v1140_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(multi_band_info_list_r11_present, 1)); + + if (multi_band_info_list_r11_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r11, 1, 8, integer_packer(1, 256))); } - if (inter_freq_neigh_cell_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_neigh_cell_list, bref, 1, 16)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE mbms_sai_inter_freq_v1140_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(multi_band_info_list_r11_present, 1)); + + if (multi_band_info_list_r11_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r11, bref, 1, 8, integer_packer(1, 256))); } - if (inter_freq_black_cell_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_black_cell_list, bref, 1, 16)); + + return SRSASN_SUCCESS; +} +void mbms_sai_inter_freq_v1140_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (multi_band_info_list_r11_present) { + j.start_array("multiBandInfoList-r11"); + for (const auto& e1 : multi_band_info_list_r11) { + j.write_int(e1); + } + j.end_array(); } + j.end_obj(); +} + +// MBSFN-AreaInfo-r9 ::= SEQUENCE +SRSASN_CODE mbsfn_area_info_r9_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, mbsfn_area_id_r9, (uint16_t)0u, (uint16_t)255u)); + HANDLE_CODE(non_mbsfn_region_len.pack(bref)); + HANDLE_CODE(pack_integer(bref, notif_ind_r9, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(mcch_cfg_r9.mcch_repeat_period_r9.pack(bref)); + HANDLE_CODE(pack_integer(bref, mcch_cfg_r9.mcch_offset_r9, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(mcch_cfg_r9.mcch_mod_period_r9.pack(bref)); + HANDLE_CODE(mcch_cfg_r9.sf_alloc_info_r9.pack(bref)); + HANDLE_CODE(mcch_cfg_r9.sig_mcs_r9.pack(bref)); if (ext) { - ext_groups_unpacker_guard group_flags(2); - group_flags.unpack(bref); + ext_groups_packer_guard group_flags; + group_flags[0] |= mcch_cfg_r14.is_present(); + group_flags[0] |= subcarrier_spacing_mbms_r14_present; + group_flags.pack(bref); if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); + varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.unpack(q_qual_min_r9_present, 1)); - bool thresh_x_q_r9_present; - HANDLE_CODE(bref.unpack(thresh_x_q_r9_present, 1)); - thresh_x_q_r9.set_present(thresh_x_q_r9_present); - if (q_qual_min_r9_present) { - HANDLE_CODE(unpack_integer(q_qual_min_r9, bref, (int8_t)-34, (int8_t)-3)); + HANDLE_CODE(bref.pack(mcch_cfg_r14.is_present(), 1)); + HANDLE_CODE(bref.pack(subcarrier_spacing_mbms_r14_present, 1)); + if (mcch_cfg_r14.is_present()) { + HANDLE_CODE(bref.pack(mcch_cfg_r14->mcch_repeat_period_v1430_present, 1)); + HANDLE_CODE(bref.pack(mcch_cfg_r14->mcch_mod_period_v1430_present, 1)); + if (mcch_cfg_r14->mcch_repeat_period_v1430_present) { + HANDLE_CODE(mcch_cfg_r14->mcch_repeat_period_v1430.pack(bref)); + } + if (mcch_cfg_r14->mcch_mod_period_v1430_present) { + HANDLE_CODE(mcch_cfg_r14->mcch_mod_period_v1430.pack(bref)); + } } - if (thresh_x_q_r9.is_present()) { - HANDLE_CODE(unpack_integer(thresh_x_q_r9->thresh_x_high_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_q_r9->thresh_x_low_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); + if (subcarrier_spacing_mbms_r14_present) { + HANDLE_CODE(subcarrier_spacing_mbms_r14.pack(bref)); } } - if (group_flags[1]) { + } + return SRSASN_SUCCESS; +} +SRSASN_CODE mbsfn_area_info_r9_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(mbsfn_area_id_r9, bref, (uint16_t)0u, (uint16_t)255u)); + HANDLE_CODE(non_mbsfn_region_len.unpack(bref)); + HANDLE_CODE(unpack_integer(notif_ind_r9, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(mcch_cfg_r9.mcch_repeat_period_r9.unpack(bref)); + HANDLE_CODE(unpack_integer(mcch_cfg_r9.mcch_offset_r9, bref, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(mcch_cfg_r9.mcch_mod_period_r9.unpack(bref)); + HANDLE_CODE(mcch_cfg_r9.sf_alloc_info_r9.unpack(bref)); + HANDLE_CODE(mcch_cfg_r9.sig_mcs_r9.unpack(bref)); + + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + + if (group_flags[0]) { varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.unpack(q_qual_min_wb_r11_present, 1)); - if (q_qual_min_wb_r11_present) { - HANDLE_CODE(unpack_integer(q_qual_min_wb_r11, bref, (int8_t)-34, (int8_t)-3)); + bool mcch_cfg_r14_present; + HANDLE_CODE(bref.unpack(mcch_cfg_r14_present, 1)); + mcch_cfg_r14.set_present(mcch_cfg_r14_present); + HANDLE_CODE(bref.unpack(subcarrier_spacing_mbms_r14_present, 1)); + if (mcch_cfg_r14.is_present()) { + HANDLE_CODE(bref.unpack(mcch_cfg_r14->mcch_repeat_period_v1430_present, 1)); + HANDLE_CODE(bref.unpack(mcch_cfg_r14->mcch_mod_period_v1430_present, 1)); + if (mcch_cfg_r14->mcch_repeat_period_v1430_present) { + HANDLE_CODE(mcch_cfg_r14->mcch_repeat_period_v1430.unpack(bref)); + } + if (mcch_cfg_r14->mcch_mod_period_v1430_present) { + HANDLE_CODE(mcch_cfg_r14->mcch_mod_period_v1430.unpack(bref)); + } + } + if (subcarrier_spacing_mbms_r14_present) { + HANDLE_CODE(subcarrier_spacing_mbms_r14.unpack(bref)); } } } return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_s::to_json(json_writer& j) const +void mbsfn_area_info_r9_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("dl-CarrierFreq", dl_carrier_freq); - j.write_int("q-RxLevMin", q_rx_lev_min); - if (p_max_present) { - j.write_int("p-Max", p_max); - } - j.write_int("t-ReselectionEUTRA", t_resel_eutra); - if (t_resel_eutra_sf_present) { - j.write_fieldname("t-ReselectionEUTRA-SF"); - t_resel_eutra_sf.to_json(j); - } - j.write_int("threshX-High", thresh_x_high); - j.write_int("threshX-Low", thresh_x_low); - j.write_str("allowedMeasBandwidth", allowed_meas_bw.to_string()); - j.write_bool("presenceAntennaPort1", presence_ant_port1); - if (cell_resel_prio_present) { - j.write_int("cellReselectionPriority", cell_resel_prio); - } - j.write_str("neighCellConfig", neigh_cell_cfg.to_string()); - if (q_offset_freq_present) { - j.write_str("q-OffsetFreq", q_offset_freq.to_string()); - } - if (inter_freq_neigh_cell_list_present) { - j.start_array("interFreqNeighCellList"); - for (const auto& e1 : inter_freq_neigh_cell_list) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_black_cell_list_present) { - j.start_array("interFreqBlackCellList"); - for (const auto& e1 : inter_freq_black_cell_list) { - e1.to_json(j); - } - j.end_array(); - } + j.write_int("mbsfn-AreaId-r9", mbsfn_area_id_r9); + j.write_str("non-MBSFNregionLength", non_mbsfn_region_len.to_string()); + j.write_int("notificationIndicator-r9", notif_ind_r9); + j.write_fieldname("mcch-Config-r9"); + j.start_obj(); + j.write_str("mcch-RepetitionPeriod-r9", mcch_cfg_r9.mcch_repeat_period_r9.to_string()); + j.write_int("mcch-Offset-r9", mcch_cfg_r9.mcch_offset_r9); + j.write_str("mcch-ModificationPeriod-r9", mcch_cfg_r9.mcch_mod_period_r9.to_string()); + j.write_str("sf-AllocInfo-r9", mcch_cfg_r9.sf_alloc_info_r9.to_string()); + j.write_str("signallingMCS-r9", mcch_cfg_r9.sig_mcs_r9.to_string()); + j.end_obj(); if (ext) { - if (q_qual_min_r9_present) { - j.write_int("q-QualMin-r9", q_qual_min_r9); - } - if (thresh_x_q_r9.is_present()) { - j.write_fieldname("threshX-Q-r9"); + if (mcch_cfg_r14.is_present()) { + j.write_fieldname("mcch-Config-r14"); j.start_obj(); - j.write_int("threshX-HighQ-r9", thresh_x_q_r9->thresh_x_high_q_r9); - j.write_int("threshX-LowQ-r9", thresh_x_q_r9->thresh_x_low_q_r9); + if (mcch_cfg_r14->mcch_repeat_period_v1430_present) { + j.write_str("mcch-RepetitionPeriod-v1430", mcch_cfg_r14->mcch_repeat_period_v1430.to_string()); + } + if (mcch_cfg_r14->mcch_mod_period_v1430_present) { + j.write_str("mcch-ModificationPeriod-v1430", mcch_cfg_r14->mcch_mod_period_v1430.to_string()); + } j.end_obj(); } - if (q_qual_min_wb_r11_present) { - j.write_int("q-QualMinWB-r11", q_qual_min_wb_r11); + if (subcarrier_spacing_mbms_r14_present) { + j.write_str("subcarrierSpacingMBMS-r14", subcarrier_spacing_mbms_r14.to_string()); } } j.end_obj(); } -// InterFreqCarrierFreqInfo-r12 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_r12_s::pack(bit_ref& bref) const +std::string mbsfn_area_info_r9_s::non_mbsfn_region_len_opts::to_string() const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(p_max_r12_present, 1)); - HANDLE_CODE(bref.pack(t_resel_eutra_sf_r12_present, 1)); - HANDLE_CODE(bref.pack(cell_resel_prio_r12_present, 1)); - HANDLE_CODE(bref.pack(q_offset_freq_r12_present, 1)); - HANDLE_CODE(bref.pack(inter_freq_neigh_cell_list_r12_present, 1)); - HANDLE_CODE(bref.pack(inter_freq_black_cell_list_r12_present, 1)); - HANDLE_CODE(bref.pack(q_qual_min_r12_present, 1)); - HANDLE_CODE(bref.pack(thresh_x_q_r12_present, 1)); - HANDLE_CODE(bref.pack(q_qual_min_wb_r12_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_r12_present, 1)); - HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); - HANDLE_CODE(bref.pack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); + static const char* options[] = {"s1", "s2"}; + return convert_enum_idx(options, 2, value, "mbsfn_area_info_r9_s::non_mbsfn_region_len_e_"); +} +uint8_t mbsfn_area_info_r9_s::non_mbsfn_region_len_opts::to_number() const +{ + static const uint8_t options[] = {1, 2}; + return map_enum_number(options, 2, value, "mbsfn_area_info_r9_s::non_mbsfn_region_len_e_"); +} - HANDLE_CODE(pack_integer(bref, dl_carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u)); - HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r12, (int8_t)-70, (int8_t)-22)); - if (p_max_r12_present) { - HANDLE_CODE(pack_integer(bref, p_max_r12, (int8_t)-30, (int8_t)33)); - } - HANDLE_CODE(pack_integer(bref, t_resel_eutra_r12, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_eutra_sf_r12_present) { - HANDLE_CODE(t_resel_eutra_sf_r12.pack(bref)); - } - HANDLE_CODE(pack_integer(bref, thresh_x_high_r12, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_low_r12, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(allowed_meas_bw_r12.pack(bref)); - HANDLE_CODE(bref.pack(presence_ant_port1_r12, 1)); - if (cell_resel_prio_r12_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_prio_r12, (uint8_t)0u, (uint8_t)7u)); - } - HANDLE_CODE(neigh_cell_cfg_r12.pack(bref)); - if (q_offset_freq_r12_present) { - HANDLE_CODE(q_offset_freq_r12.pack(bref)); - } - if (inter_freq_neigh_cell_list_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_neigh_cell_list_r12, 1, 16)); - } - if (inter_freq_black_cell_list_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_black_cell_list_r12, 1, 16)); - } - if (q_qual_min_r12_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_r12, (int8_t)-34, (int8_t)-3)); - } - if (thresh_x_q_r12_present) { - HANDLE_CODE(pack_integer(bref, thresh_x_q_r12.thresh_x_high_q_r12, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, thresh_x_q_r12.thresh_x_low_q_r12, (uint8_t)0u, (uint8_t)31u)); - } - if (q_qual_min_wb_r12_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_wb_r12, (int8_t)-34, (int8_t)-3)); - } - if (multi_band_info_list_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r12, 1, 8, integer_packer(1, 256))); - } - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_on_all_symbols_r12, (int8_t)-34, (int8_t)-3)); - } +std::string mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_opts::to_string() const +{ + static const char* options[] = {"rf32", "rf64", "rf128", "rf256"}; + return convert_enum_idx(options, 4, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_e_"); +} +uint16_t mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_opts::to_number() const +{ + static const uint16_t options[] = {32, 64, 128, 256}; + return map_enum_number(options, 4, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_e_"); +} - return SRSASN_SUCCESS; +std::string mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_opts::to_string() const +{ + static const char* options[] = {"rf512", "rf1024"}; + return convert_enum_idx(options, 2, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_e_"); } -SRSASN_CODE inter_freq_carrier_freq_info_r12_s::unpack(cbit_ref& bref) +uint16_t mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_opts::to_number() const { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(p_max_r12_present, 1)); - HANDLE_CODE(bref.unpack(t_resel_eutra_sf_r12_present, 1)); - HANDLE_CODE(bref.unpack(cell_resel_prio_r12_present, 1)); - HANDLE_CODE(bref.unpack(q_offset_freq_r12_present, 1)); - HANDLE_CODE(bref.unpack(inter_freq_neigh_cell_list_r12_present, 1)); - HANDLE_CODE(bref.unpack(inter_freq_black_cell_list_r12_present, 1)); - HANDLE_CODE(bref.unpack(q_qual_min_r12_present, 1)); - HANDLE_CODE(bref.unpack(thresh_x_q_r12_present, 1)); - HANDLE_CODE(bref.unpack(q_qual_min_wb_r12_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_r12_present, 1)); - HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); - HANDLE_CODE(bref.unpack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); + static const uint16_t options[] = {512, 1024}; + return map_enum_number(options, 2, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_e_"); +} - HANDLE_CODE(unpack_integer(dl_carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u)); - HANDLE_CODE(unpack_integer(q_rx_lev_min_r12, bref, (int8_t)-70, (int8_t)-22)); - if (p_max_r12_present) { - HANDLE_CODE(unpack_integer(p_max_r12, bref, (int8_t)-30, (int8_t)33)); - } - HANDLE_CODE(unpack_integer(t_resel_eutra_r12, bref, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_eutra_sf_r12_present) { - HANDLE_CODE(t_resel_eutra_sf_r12.unpack(bref)); - } - HANDLE_CODE(unpack_integer(thresh_x_high_r12, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_low_r12, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(allowed_meas_bw_r12.unpack(bref)); - HANDLE_CODE(bref.unpack(presence_ant_port1_r12, 1)); - if (cell_resel_prio_r12_present) { - HANDLE_CODE(unpack_integer(cell_resel_prio_r12, bref, (uint8_t)0u, (uint8_t)7u)); - } - HANDLE_CODE(neigh_cell_cfg_r12.unpack(bref)); - if (q_offset_freq_r12_present) { - HANDLE_CODE(q_offset_freq_r12.unpack(bref)); - } - if (inter_freq_neigh_cell_list_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_neigh_cell_list_r12, bref, 1, 16)); - } - if (inter_freq_black_cell_list_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_black_cell_list_r12, bref, 1, 16)); - } - if (q_qual_min_r12_present) { - HANDLE_CODE(unpack_integer(q_qual_min_r12, bref, (int8_t)-34, (int8_t)-3)); - } - if (thresh_x_q_r12_present) { - HANDLE_CODE(unpack_integer(thresh_x_q_r12.thresh_x_high_q_r12, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(thresh_x_q_r12.thresh_x_low_q_r12, bref, (uint8_t)0u, (uint8_t)31u)); - } - if (q_qual_min_wb_r12_present) { - HANDLE_CODE(unpack_integer(q_qual_min_wb_r12, bref, (int8_t)-34, (int8_t)-3)); - } - if (multi_band_info_list_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r12, bref, 1, 8, integer_packer(1, 256))); - } - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - HANDLE_CODE(unpack_integer(q_qual_min_rsrq_on_all_symbols_r12, bref, (int8_t)-34, (int8_t)-3)); - } +std::string mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_opts::to_string() const +{ + static const char* options[] = {"n2", "n7", "n13", "n19"}; + return convert_enum_idx(options, 4, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_e_"); +} +uint8_t mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_opts::to_number() const +{ + static const uint8_t options[] = {2, 7, 13, 19}; + return map_enum_number(options, 4, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_e_"); +} - return SRSASN_SUCCESS; +std::string mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_repeat_period_v1430_opts::to_string() const +{ + static const char* options[] = {"rf1", "rf2", "rf4", "rf8", "rf16"}; + return convert_enum_idx(options, 5, value, "mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_repeat_period_v1430_e_"); } -void inter_freq_carrier_freq_info_r12_s::to_json(json_writer& j) const +uint8_t mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_repeat_period_v1430_opts::to_number() const { - j.start_obj(); - j.write_int("dl-CarrierFreq-r12", dl_carrier_freq_r12); - j.write_int("q-RxLevMin-r12", q_rx_lev_min_r12); - if (p_max_r12_present) { - j.write_int("p-Max-r12", p_max_r12); - } - j.write_int("t-ReselectionEUTRA-r12", t_resel_eutra_r12); - if (t_resel_eutra_sf_r12_present) { - j.write_fieldname("t-ReselectionEUTRA-SF-r12"); - t_resel_eutra_sf_r12.to_json(j); - } - j.write_int("threshX-High-r12", thresh_x_high_r12); - j.write_int("threshX-Low-r12", thresh_x_low_r12); - j.write_str("allowedMeasBandwidth-r12", allowed_meas_bw_r12.to_string()); - j.write_bool("presenceAntennaPort1-r12", presence_ant_port1_r12); - if (cell_resel_prio_r12_present) { - j.write_int("cellReselectionPriority-r12", cell_resel_prio_r12); - } - j.write_str("neighCellConfig-r12", neigh_cell_cfg_r12.to_string()); - if (q_offset_freq_r12_present) { - j.write_str("q-OffsetFreq-r12", q_offset_freq_r12.to_string()); - } - if (inter_freq_neigh_cell_list_r12_present) { - j.start_array("interFreqNeighCellList-r12"); - for (const auto& e1 : inter_freq_neigh_cell_list_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_black_cell_list_r12_present) { - j.start_array("interFreqBlackCellList-r12"); - for (const auto& e1 : inter_freq_black_cell_list_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (q_qual_min_r12_present) { - j.write_int("q-QualMin-r12", q_qual_min_r12); - } - if (thresh_x_q_r12_present) { - j.write_fieldname("threshX-Q-r12"); - j.start_obj(); - j.write_int("threshX-HighQ-r12", thresh_x_q_r12.thresh_x_high_q_r12); - j.write_int("threshX-LowQ-r12", thresh_x_q_r12.thresh_x_low_q_r12); - j.end_obj(); - } - if (q_qual_min_wb_r12_present) { - j.write_int("q-QualMinWB-r12", q_qual_min_wb_r12); - } - if (multi_band_info_list_r12_present) { - j.start_array("multiBandInfoList-r12"); - for (const auto& e1 : multi_band_info_list_r12) { - j.write_int(e1); - } - j.end_array(); - } - if (reduced_meas_performance_r12_present) { - j.write_str("reducedMeasPerformance-r12", "true"); - } - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - j.write_int("q-QualMinRSRQ-OnAllSymbols-r12", q_qual_min_rsrq_on_all_symbols_r12); - } - j.end_obj(); + static const uint8_t options[] = {1, 2, 4, 8, 16}; + return map_enum_number(options, 5, value, "mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_repeat_period_v1430_e_"); } -// InterFreqCarrierFreqInfo-v1250 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v1250_s::pack(bit_ref& bref) const +std::string mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_mod_period_v1430_opts::to_string() const { - HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); - HANDLE_CODE(bref.pack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); + static const char* options[] = {"rf1", "rf2", "rf4", "rf8", "rf16", "rf32", "rf64", "rf128", "rf256", "spare7"}; + return convert_enum_idx(options, 10, value, "mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_mod_period_v1430_e_"); +} +uint16_t mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_mod_period_v1430_opts::to_number() const +{ + static const uint16_t options[] = {1, 2, 4, 8, 16, 32, 64, 128, 256}; + return map_enum_number(options, 9, value, "mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_mod_period_v1430_e_"); +} - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_on_all_symbols_r12, (int8_t)-34, (int8_t)-3)); +std::string mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_opts::to_string() const +{ + static const char* options[] = {"kHz7dot5", "kHz1dot25"}; + return convert_enum_idx(options, 2, value, "mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_e_"); +} +float mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_opts::to_number() const +{ + static const float options[] = {7.5, 1.25}; + return map_enum_number(options, 2, value, "mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_e_"); +} +std::string mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_opts::to_number_string() const +{ + static const char* options[] = {"7.5", "1.25"}; + return convert_enum_idx(options, 2, value, "mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_e_"); +} + +// ReselectionInfoRelay-r13 ::= SEQUENCE +SRSASN_CODE resel_info_relay_r13_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(min_hyst_r13_present, 1)); + + HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r13, (int8_t)-70, (int8_t)-22)); + HANDLE_CODE(filt_coef_r13.pack(bref)); + if (min_hyst_r13_present) { + HANDLE_CODE(min_hyst_r13.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE inter_freq_carrier_freq_info_v1250_s::unpack(cbit_ref& bref) +SRSASN_CODE resel_info_relay_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); - HANDLE_CODE(bref.unpack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); + HANDLE_CODE(bref.unpack(min_hyst_r13_present, 1)); - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - HANDLE_CODE(unpack_integer(q_qual_min_rsrq_on_all_symbols_r12, bref, (int8_t)-34, (int8_t)-3)); + HANDLE_CODE(unpack_integer(q_rx_lev_min_r13, bref, (int8_t)-70, (int8_t)-22)); + HANDLE_CODE(filt_coef_r13.unpack(bref)); + if (min_hyst_r13_present) { + HANDLE_CODE(min_hyst_r13.unpack(bref)); } return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v1250_s::to_json(json_writer& j) const +void resel_info_relay_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (reduced_meas_performance_r12_present) { - j.write_str("reducedMeasPerformance-r12", "true"); - } - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - j.write_int("q-QualMinRSRQ-OnAllSymbols-r12", q_qual_min_rsrq_on_all_symbols_r12); + j.write_int("q-RxLevMin-r13", q_rx_lev_min_r13); + j.write_str("filterCoefficient-r13", filt_coef_r13.to_string()); + if (min_hyst_r13_present) { + j.write_str("minHyst-r13", min_hyst_r13.to_string()); } j.end_obj(); } -// InterFreqCarrierFreqInfo-v1310 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v1310_s::pack(bit_ref& bref) const +std::string resel_info_relay_r13_s::min_hyst_r13_opts::to_string() const { - HANDLE_CODE(bref.pack(cell_resel_sub_prio_r13_present, 1)); - HANDLE_CODE(bref.pack(redist_inter_freq_info_r13_present, 1)); - HANDLE_CODE(bref.pack(cell_sel_info_ce_r13_present, 1)); - HANDLE_CODE(bref.pack(t_resel_eutra_ce_r13_present, 1)); + static const char* options[] = {"dB0", "dB3", "dB6", "dB9", "dB12", "dBinf"}; + return convert_enum_idx(options, 6, value, "resel_info_relay_r13_s::min_hyst_r13_e_"); +} +uint8_t resel_info_relay_r13_s::min_hyst_r13_opts::to_number() const +{ + static const uint8_t options[] = {0, 3, 6, 9, 12}; + return map_enum_number(options, 5, value, "resel_info_relay_r13_s::min_hyst_r13_e_"); +} - if (cell_resel_sub_prio_r13_present) { - HANDLE_CODE(cell_resel_sub_prio_r13.pack(bref)); - } - if (redist_inter_freq_info_r13_present) { - HANDLE_CODE(redist_inter_freq_info_r13.pack(bref)); - } - if (cell_sel_info_ce_r13_present) { - HANDLE_CODE(cell_sel_info_ce_r13.pack(bref)); - } - if (t_resel_eutra_ce_r13_present) { - HANDLE_CODE(pack_integer(bref, t_resel_eutra_ce_r13, (uint8_t)0u, (uint8_t)15u)); - } +// SIB8-PerPLMN-r11 ::= SEQUENCE +SRSASN_CODE sib8_per_plmn_r11_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, plmn_id_r11, (uint8_t)1u, (uint8_t)6u)); + HANDLE_CODE(params_cdma2000_r11.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE inter_freq_carrier_freq_info_v1310_s::unpack(cbit_ref& bref) +SRSASN_CODE sib8_per_plmn_r11_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(cell_resel_sub_prio_r13_present, 1)); - HANDLE_CODE(bref.unpack(redist_inter_freq_info_r13_present, 1)); - HANDLE_CODE(bref.unpack(cell_sel_info_ce_r13_present, 1)); - HANDLE_CODE(bref.unpack(t_resel_eutra_ce_r13_present, 1)); - - if (cell_resel_sub_prio_r13_present) { - HANDLE_CODE(cell_resel_sub_prio_r13.unpack(bref)); - } - if (redist_inter_freq_info_r13_present) { - HANDLE_CODE(redist_inter_freq_info_r13.unpack(bref)); - } - if (cell_sel_info_ce_r13_present) { - HANDLE_CODE(cell_sel_info_ce_r13.unpack(bref)); - } - if (t_resel_eutra_ce_r13_present) { - HANDLE_CODE(unpack_integer(t_resel_eutra_ce_r13, bref, (uint8_t)0u, (uint8_t)15u)); - } + HANDLE_CODE(unpack_integer(plmn_id_r11, bref, (uint8_t)1u, (uint8_t)6u)); + HANDLE_CODE(params_cdma2000_r11.unpack(bref)); return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v1310_s::to_json(json_writer& j) const +void sib8_per_plmn_r11_s::to_json(json_writer& j) const { j.start_obj(); - if (cell_resel_sub_prio_r13_present) { - j.write_str("cellReselectionSubPriority-r13", cell_resel_sub_prio_r13.to_string()); - } - if (redist_inter_freq_info_r13_present) { - j.write_fieldname("redistributionInterFreqInfo-r13"); - redist_inter_freq_info_r13.to_json(j); - } - if (cell_sel_info_ce_r13_present) { - j.write_fieldname("cellSelectionInfoCE-r13"); - cell_sel_info_ce_r13.to_json(j); - } - if (t_resel_eutra_ce_r13_present) { - j.write_int("t-ReselectionEUTRA-CE-r13", t_resel_eutra_ce_r13); - } + j.write_int("plmn-Identity-r11", plmn_id_r11); + j.write_fieldname("parametersCDMA2000-r11"); + params_cdma2000_r11.to_json(j); j.end_obj(); } -// InterFreqCarrierFreqInfo-v1350 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v1350_s::pack(bit_ref& bref) const +void sib8_per_plmn_r11_s::params_cdma2000_r11_c_::set(types::options e) { - HANDLE_CODE(bref.pack(cell_sel_info_ce1_r13_present, 1)); - - if (cell_sel_info_ce1_r13_present) { - HANDLE_CODE(cell_sel_info_ce1_r13.pack(bref)); + type_ = e; +} +void sib8_per_plmn_r11_s::params_cdma2000_r11_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::explicit_value: + j.write_fieldname("explicitValue"); + c.to_json(j); + break; + case types::default_value: + break; + default: + log_invalid_choice_id(type_, "sib8_per_plmn_r11_s::params_cdma2000_r11_c_"); } - - return SRSASN_SUCCESS; + j.end_obj(); } -SRSASN_CODE inter_freq_carrier_freq_info_v1350_s::unpack(cbit_ref& bref) +SRSASN_CODE sib8_per_plmn_r11_s::params_cdma2000_r11_c_::pack(bit_ref& bref) const { - HANDLE_CODE(bref.unpack(cell_sel_info_ce1_r13_present, 1)); - - if (cell_sel_info_ce1_r13_present) { - HANDLE_CODE(cell_sel_info_ce1_r13.unpack(bref)); + type_.pack(bref); + switch (type_) { + case types::explicit_value: + HANDLE_CODE(c.pack(bref)); + break; + case types::default_value: + break; + default: + log_invalid_choice_id(type_, "sib8_per_plmn_r11_s::params_cdma2000_r11_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } - return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v1350_s::to_json(json_writer& j) const +SRSASN_CODE sib8_per_plmn_r11_s::params_cdma2000_r11_c_::unpack(cbit_ref& bref) { - j.start_obj(); - if (cell_sel_info_ce1_r13_present) { - j.write_fieldname("cellSelectionInfoCE1-r13"); - cell_sel_info_ce1_r13.to_json(j); + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::explicit_value: + HANDLE_CODE(c.unpack(bref)); + break; + case types::default_value: + break; + default: + log_invalid_choice_id(type_, "sib8_per_plmn_r11_s::params_cdma2000_r11_c_"); + return SRSASN_ERROR_DECODE_FAIL; } - j.end_obj(); + return SRSASN_SUCCESS; } -// InterFreqCarrierFreqInfo-v1530 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v1530_s::pack(bit_ref& bref) const +// SL-CarrierFreqInfo-r12 ::= SEQUENCE +SRSASN_CODE sl_carrier_freq_info_r12_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(inter_freq_neigh_hsdn_cell_list_r15_present, 1)); - HANDLE_CODE(bref.pack(cell_sel_info_ce_v1530_present, 1)); + HANDLE_CODE(bref.pack(plmn_id_list_r12_present, 1)); - HANDLE_CODE(bref.pack(hsdn_ind_r15, 1)); - if (inter_freq_neigh_hsdn_cell_list_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_neigh_hsdn_cell_list_r15, 1, 16)); - } - if (cell_sel_info_ce_v1530_present) { - HANDLE_CODE(cell_sel_info_ce_v1530.pack(bref)); + HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u)); + if (plmn_id_list_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r12, 1, 6)); } return SRSASN_SUCCESS; } -SRSASN_CODE inter_freq_carrier_freq_info_v1530_s::unpack(cbit_ref& bref) +SRSASN_CODE sl_carrier_freq_info_r12_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(inter_freq_neigh_hsdn_cell_list_r15_present, 1)); - HANDLE_CODE(bref.unpack(cell_sel_info_ce_v1530_present, 1)); + HANDLE_CODE(bref.unpack(plmn_id_list_r12_present, 1)); - HANDLE_CODE(bref.unpack(hsdn_ind_r15, 1)); - if (inter_freq_neigh_hsdn_cell_list_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_neigh_hsdn_cell_list_r15, bref, 1, 16)); - } - if (cell_sel_info_ce_v1530_present) { - HANDLE_CODE(cell_sel_info_ce_v1530.unpack(bref)); + HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u)); + if (plmn_id_list_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r12, bref, 1, 6)); } return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v1530_s::to_json(json_writer& j) const +void sl_carrier_freq_info_r12_s::to_json(json_writer& j) const { j.start_obj(); - j.write_bool("hsdn-Indication-r15", hsdn_ind_r15); - if (inter_freq_neigh_hsdn_cell_list_r15_present) { - j.start_array("interFreqNeighHSDN-CellList-r15"); - for (const auto& e1 : inter_freq_neigh_hsdn_cell_list_r15) { + j.write_int("carrierFreq-r12", carrier_freq_r12); + if (plmn_id_list_r12_present) { + j.start_array("plmn-IdentityList-r12"); + for (const auto& e1 : plmn_id_list_r12) { e1.to_json(j); } j.end_array(); } - if (cell_sel_info_ce_v1530_present) { - j.write_fieldname("cellSelectionInfoCE-v1530"); - cell_sel_info_ce_v1530.to_json(j); - } j.end_obj(); } -// InterFreqCarrierFreqInfo-v8h0 ::= SEQUENCE -SRSASN_CODE inter_freq_carrier_freq_info_v8h0_s::pack(bit_ref& bref) const +// SL-CarrierFreqInfo-v1310 ::= SEQUENCE +SRSASN_CODE sl_carrier_freq_info_v1310_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(multi_band_info_list_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(disc_res_non_ps_r13_present, 1)); + HANDLE_CODE(bref.pack(disc_res_ps_r13_present, 1)); + HANDLE_CODE(bref.pack(disc_cfg_other_r13_present, 1)); - if (multi_band_info_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer(1, 64))); + if (disc_res_non_ps_r13_present) { + HANDLE_CODE(disc_res_non_ps_r13.pack(bref)); + } + if (disc_res_ps_r13_present) { + HANDLE_CODE(disc_res_ps_r13.pack(bref)); + } + if (disc_cfg_other_r13_present) { + HANDLE_CODE(disc_cfg_other_r13.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE inter_freq_carrier_freq_info_v8h0_s::unpack(cbit_ref& bref) +SRSASN_CODE sl_carrier_freq_info_v1310_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(multi_band_info_list_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(disc_res_non_ps_r13_present, 1)); + HANDLE_CODE(bref.unpack(disc_res_ps_r13_present, 1)); + HANDLE_CODE(bref.unpack(disc_cfg_other_r13_present, 1)); - if (multi_band_info_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer(1, 64))); + if (disc_res_non_ps_r13_present) { + HANDLE_CODE(disc_res_non_ps_r13.unpack(bref)); + } + if (disc_res_ps_r13_present) { + HANDLE_CODE(disc_res_ps_r13.unpack(bref)); + } + if (disc_cfg_other_r13_present) { + HANDLE_CODE(disc_cfg_other_r13.unpack(bref)); } return SRSASN_SUCCESS; } -void inter_freq_carrier_freq_info_v8h0_s::to_json(json_writer& j) const +void sl_carrier_freq_info_v1310_s::to_json(json_writer& j) const { j.start_obj(); - if (multi_band_info_list_present) { - j.start_array("multiBandInfoList"); - for (const auto& e1 : multi_band_info_list) { - j.write_int(e1); - } - j.end_array(); + if (disc_res_non_ps_r13_present) { + j.write_fieldname("discResourcesNonPS-r13"); + disc_res_non_ps_r13.to_json(j); + } + if (disc_res_ps_r13_present) { + j.write_fieldname("discResourcesPS-r13"); + disc_res_ps_r13.to_json(j); + } + if (disc_cfg_other_r13_present) { + j.write_fieldname("discConfigOther-r13"); + disc_cfg_other_r13.to_json(j); } j.end_obj(); } -// IntraFreqNeighCellInfo ::= SEQUENCE -SRSASN_CODE intra_freq_neigh_cell_info_s::pack(bit_ref& bref) const +// SL-PPPP-TxConfigIndex-r15 ::= SEQUENCE +SRSASN_CODE sl_pppp_tx_cfg_idx_r15_s::pack(bit_ref& bref) const { - bref.pack(ext, 1); - HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)503u)); - HANDLE_CODE(q_offset_cell.pack(bref)); + HANDLE_CODE(pack_integer(bref, prio_thres_r15, (uint8_t)1u, (uint8_t)8u)); + HANDLE_CODE(pack_integer(bref, default_tx_cfg_idx_r15, (uint8_t)0u, (uint8_t)15u)); + HANDLE_CODE(pack_integer(bref, cbr_cfg_idx_r15, (uint8_t)0u, (uint8_t)3u)); + HANDLE_CODE(pack_dyn_seq_of(bref, tx_cfg_idx_list_r15, 1, 16, integer_packer(0, 63))); + HANDLE_CODE(pack_dyn_seq_of(bref, mcs_pssch_range_list_r15, 1, 16)); return SRSASN_SUCCESS; } -SRSASN_CODE intra_freq_neigh_cell_info_s::unpack(cbit_ref& bref) +SRSASN_CODE sl_pppp_tx_cfg_idx_r15_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)503u)); - HANDLE_CODE(q_offset_cell.unpack(bref)); + HANDLE_CODE(unpack_integer(prio_thres_r15, bref, (uint8_t)1u, (uint8_t)8u)); + HANDLE_CODE(unpack_integer(default_tx_cfg_idx_r15, bref, (uint8_t)0u, (uint8_t)15u)); + HANDLE_CODE(unpack_integer(cbr_cfg_idx_r15, bref, (uint8_t)0u, (uint8_t)3u)); + HANDLE_CODE(unpack_dyn_seq_of(tx_cfg_idx_list_r15, bref, 1, 16, integer_packer(0, 63))); + HANDLE_CODE(unpack_dyn_seq_of(mcs_pssch_range_list_r15, bref, 1, 16)); return SRSASN_SUCCESS; } -void intra_freq_neigh_cell_info_s::to_json(json_writer& j) const +void sl_pppp_tx_cfg_idx_r15_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("physCellId", pci); - j.write_str("q-OffsetCell", q_offset_cell.to_string()); + j.write_int("priorityThreshold-r15", prio_thres_r15); + j.write_int("defaultTxConfigIndex-r15", default_tx_cfg_idx_r15); + j.write_int("cbr-ConfigIndex-r15", cbr_cfg_idx_r15); + j.start_array("tx-ConfigIndexList-r15"); + for (const auto& e1 : tx_cfg_idx_list_r15) { + j.write_int(e1); + } + j.end_array(); + j.start_array("mcs-PSSCH-RangeList-r15"); + for (const auto& e1 : mcs_pssch_range_list_r15) { + e1.to_json(j); + } + j.end_array(); j.end_obj(); } -// MBMS-CarrierType-r14 ::= SEQUENCE -SRSASN_CODE mbms_carrier_type_r14_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(frame_offset_r14_present, 1)); - - HANDLE_CODE(carrier_type_r14.pack(bref)); - if (frame_offset_r14_present) { - HANDLE_CODE(pack_integer(bref, frame_offset_r14, (uint8_t)0u, (uint8_t)3u)); - } +// UAC-BarringInfoSet-r15 ::= SEQUENCE +SRSASN_CODE uac_barr_info_set_r15_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(uac_barr_factor_r15.pack(bref)); + HANDLE_CODE(uac_barr_time_r15.pack(bref)); + HANDLE_CODE(uac_barr_for_access_id_r15.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE mbms_carrier_type_r14_s::unpack(cbit_ref& bref) +SRSASN_CODE uac_barr_info_set_r15_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(frame_offset_r14_present, 1)); - - HANDLE_CODE(carrier_type_r14.unpack(bref)); - if (frame_offset_r14_present) { - HANDLE_CODE(unpack_integer(frame_offset_r14, bref, (uint8_t)0u, (uint8_t)3u)); - } + HANDLE_CODE(uac_barr_factor_r15.unpack(bref)); + HANDLE_CODE(uac_barr_time_r15.unpack(bref)); + HANDLE_CODE(uac_barr_for_access_id_r15.unpack(bref)); return SRSASN_SUCCESS; } -void mbms_carrier_type_r14_s::to_json(json_writer& j) const +void uac_barr_info_set_r15_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("carrierType-r14", carrier_type_r14.to_string()); - if (frame_offset_r14_present) { - j.write_int("frameOffset-r14", frame_offset_r14); - } + j.write_str("uac-BarringFactor-r15", uac_barr_factor_r15.to_string()); + j.write_str("uac-BarringTime-r15", uac_barr_time_r15.to_string()); + j.write_str("uac-BarringForAccessIdentity-r15", uac_barr_for_access_id_r15.to_string()); j.end_obj(); } -std::string mbms_carrier_type_r14_s::carrier_type_r14_opts::to_string() const +std::string uac_barr_info_set_r15_s::uac_barr_factor_r15_opts::to_string() const { - static const char* options[] = {"mbms", "fembmsMixed", "fembmsDedicated"}; - return convert_enum_idx(options, 3, value, "mbms_carrier_type_r14_s::carrier_type_r14_e_"); + static const char* options[] = { + "p00", "p05", "p10", "p15", "p20", "p25", "p30", "p40", "p50", "p60", "p70", "p75", "p80", "p85", "p90", "p95"}; + return convert_enum_idx(options, 16, value, "uac_barr_info_set_r15_s::uac_barr_factor_r15_e_"); } - -// MBMS-SAI-InterFreq-r11 ::= SEQUENCE -SRSASN_CODE mbms_sai_inter_freq_r11_s::pack(bit_ref& bref) const +float uac_barr_info_set_r15_s::uac_barr_factor_r15_opts::to_number() const { - HANDLE_CODE(pack_integer(bref, dl_carrier_freq_r11, (uint32_t)0u, (uint32_t)262143u)); - HANDLE_CODE(pack_dyn_seq_of(bref, mbms_sai_list_r11, 1, 64, integer_packer(0, 65535))); - - return SRSASN_SUCCESS; + static const float options[] = {0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5}; + return map_enum_number(options, 16, value, "uac_barr_info_set_r15_s::uac_barr_factor_r15_e_"); } -SRSASN_CODE mbms_sai_inter_freq_r11_s::unpack(cbit_ref& bref) +std::string uac_barr_info_set_r15_s::uac_barr_factor_r15_opts::to_number_string() const { - HANDLE_CODE(unpack_integer(dl_carrier_freq_r11, bref, (uint32_t)0u, (uint32_t)262143u)); - HANDLE_CODE(unpack_dyn_seq_of(mbms_sai_list_r11, bref, 1, 64, integer_packer(0, 65535))); + static const char* options[] = { + "0.0", "0.5", "1.0", "1.5", "2.0", "2.5", "3.0", "4.0", "5.0", "6.0", "7.0", "7.5", "8.0", "8.5", "9.0", "9.5"}; + return convert_enum_idx(options, 16, value, "uac_barr_info_set_r15_s::uac_barr_factor_r15_e_"); +} - return SRSASN_SUCCESS; +std::string uac_barr_info_set_r15_s::uac_barr_time_r15_opts::to_string() const +{ + static const char* options[] = {"s4", "s8", "s16", "s32", "s64", "s128", "s256", "s512"}; + return convert_enum_idx(options, 8, value, "uac_barr_info_set_r15_s::uac_barr_time_r15_e_"); } -void mbms_sai_inter_freq_r11_s::to_json(json_writer& j) const +uint16_t uac_barr_info_set_r15_s::uac_barr_time_r15_opts::to_number() const { - j.start_obj(); - j.write_int("dl-CarrierFreq-r11", dl_carrier_freq_r11); - j.start_array("mbms-SAI-List-r11"); - for (const auto& e1 : mbms_sai_list_r11) { - j.write_int(e1); - } - j.end_array(); - j.end_obj(); + static const uint16_t options[] = {4, 8, 16, 32, 64, 128, 256, 512}; + return map_enum_number(options, 8, value, "uac_barr_info_set_r15_s::uac_barr_time_r15_e_"); } -// MBMS-SAI-InterFreq-v1140 ::= SEQUENCE -SRSASN_CODE mbms_sai_inter_freq_v1140_s::pack(bit_ref& bref) const +// UAC-BarringPerPLMN-r15 ::= SEQUENCE +SRSASN_CODE uac_barr_per_plmn_r15_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(multi_band_info_list_r11_present, 1)); + HANDLE_CODE(bref.pack(uac_ac_barr_list_type_r15_present, 1)); - if (multi_band_info_list_r11_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r11, 1, 8, integer_packer(1, 256))); + HANDLE_CODE(pack_integer(bref, plmn_id_idx_r15, (uint8_t)1u, (uint8_t)6u)); + if (uac_ac_barr_list_type_r15_present) { + HANDLE_CODE(uac_ac_barr_list_type_r15.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE mbms_sai_inter_freq_v1140_s::unpack(cbit_ref& bref) +SRSASN_CODE uac_barr_per_plmn_r15_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(multi_band_info_list_r11_present, 1)); + HANDLE_CODE(bref.unpack(uac_ac_barr_list_type_r15_present, 1)); - if (multi_band_info_list_r11_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r11, bref, 1, 8, integer_packer(1, 256))); + HANDLE_CODE(unpack_integer(plmn_id_idx_r15, bref, (uint8_t)1u, (uint8_t)6u)); + if (uac_ac_barr_list_type_r15_present) { + HANDLE_CODE(uac_ac_barr_list_type_r15.unpack(bref)); } return SRSASN_SUCCESS; } -void mbms_sai_inter_freq_v1140_s::to_json(json_writer& j) const +void uac_barr_per_plmn_r15_s::to_json(json_writer& j) const { j.start_obj(); - if (multi_band_info_list_r11_present) { - j.start_array("multiBandInfoList-r11"); - for (const auto& e1 : multi_band_info_list_r11) { - j.write_int(e1); - } - j.end_array(); + j.write_int("plmn-IdentityIndex-r15", plmn_id_idx_r15); + if (uac_ac_barr_list_type_r15_present) { + j.write_fieldname("uac-AC-BarringListType-r15"); + uac_ac_barr_list_type_r15.to_json(j); } j.end_obj(); } -// MBSFN-AreaInfo-r9 ::= SEQUENCE -SRSASN_CODE mbsfn_area_info_r9_s::pack(bit_ref& bref) const +void uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::destroy_() { - bref.pack(ext, 1); - HANDLE_CODE(pack_integer(bref, mbsfn_area_id_r9, (uint16_t)0u, (uint16_t)255u)); - HANDLE_CODE(non_mbsfn_region_len.pack(bref)); - HANDLE_CODE(pack_integer(bref, notif_ind_r9, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(mcch_cfg_r9.mcch_repeat_period_r9.pack(bref)); - HANDLE_CODE(pack_integer(bref, mcch_cfg_r9.mcch_offset_r9, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(mcch_cfg_r9.mcch_mod_period_r9.pack(bref)); - HANDLE_CODE(mcch_cfg_r9.sf_alloc_info_r9.pack(bref)); - HANDLE_CODE(mcch_cfg_r9.sig_mcs_r9.pack(bref)); - - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= mcch_cfg_r14.is_present(); - group_flags[0] |= subcarrier_spacing_mbms_r14_present; - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(mcch_cfg_r14.is_present(), 1)); - HANDLE_CODE(bref.pack(subcarrier_spacing_mbms_r14_present, 1)); - if (mcch_cfg_r14.is_present()) { - HANDLE_CODE(bref.pack(mcch_cfg_r14->mcch_repeat_period_v1430_present, 1)); - HANDLE_CODE(bref.pack(mcch_cfg_r14->mcch_mod_period_v1430_present, 1)); - if (mcch_cfg_r14->mcch_repeat_period_v1430_present) { - HANDLE_CODE(mcch_cfg_r14->mcch_repeat_period_v1430.pack(bref)); - } - if (mcch_cfg_r14->mcch_mod_period_v1430_present) { - HANDLE_CODE(mcch_cfg_r14->mcch_mod_period_v1430.pack(bref)); - } - } - if (subcarrier_spacing_mbms_r14_present) { - HANDLE_CODE(subcarrier_spacing_mbms_r14.pack(bref)); - } - } + switch (type_) { + case types::uac_implicit_ac_barr_list_r15: + c.destroy(); + break; + case types::uac_explicit_ac_barr_list_r15: + c.destroy(); + break; + default: + break; } - return SRSASN_SUCCESS; } -SRSASN_CODE mbsfn_area_info_r9_s::unpack(cbit_ref& bref) +void uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::set(types::options e) { - bref.unpack(ext, 1); - HANDLE_CODE(unpack_integer(mbsfn_area_id_r9, bref, (uint16_t)0u, (uint16_t)255u)); - HANDLE_CODE(non_mbsfn_region_len.unpack(bref)); - HANDLE_CODE(unpack_integer(notif_ind_r9, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(mcch_cfg_r9.mcch_repeat_period_r9.unpack(bref)); - HANDLE_CODE(unpack_integer(mcch_cfg_r9.mcch_offset_r9, bref, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(mcch_cfg_r9.mcch_mod_period_r9.unpack(bref)); - HANDLE_CODE(mcch_cfg_r9.sf_alloc_info_r9.unpack(bref)); - HANDLE_CODE(mcch_cfg_r9.sig_mcs_r9.unpack(bref)); - - if (ext) { - ext_groups_unpacker_guard group_flags(1); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool mcch_cfg_r14_present; - HANDLE_CODE(bref.unpack(mcch_cfg_r14_present, 1)); - mcch_cfg_r14.set_present(mcch_cfg_r14_present); - HANDLE_CODE(bref.unpack(subcarrier_spacing_mbms_r14_present, 1)); - if (mcch_cfg_r14.is_present()) { - HANDLE_CODE(bref.unpack(mcch_cfg_r14->mcch_repeat_period_v1430_present, 1)); - HANDLE_CODE(bref.unpack(mcch_cfg_r14->mcch_mod_period_v1430_present, 1)); - if (mcch_cfg_r14->mcch_repeat_period_v1430_present) { - HANDLE_CODE(mcch_cfg_r14->mcch_repeat_period_v1430.unpack(bref)); - } - if (mcch_cfg_r14->mcch_mod_period_v1430_present) { - HANDLE_CODE(mcch_cfg_r14->mcch_mod_period_v1430.unpack(bref)); - } - } - if (subcarrier_spacing_mbms_r14_present) { - HANDLE_CODE(subcarrier_spacing_mbms_r14.unpack(bref)); - } - } + destroy_(); + type_ = e; + switch (type_) { + case types::uac_implicit_ac_barr_list_r15: + c.init(); + break; + case types::uac_explicit_ac_barr_list_r15: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); } - return SRSASN_SUCCESS; } -void mbsfn_area_info_r9_s::to_json(json_writer& j) const +uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::uac_ac_barr_list_type_r15_c_( + const uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_& other) { - j.start_obj(); - j.write_int("mbsfn-AreaId-r9", mbsfn_area_id_r9); - j.write_str("non-MBSFNregionLength", non_mbsfn_region_len.to_string()); - j.write_int("notificationIndicator-r9", notif_ind_r9); - j.write_fieldname("mcch-Config-r9"); - j.start_obj(); - j.write_str("mcch-RepetitionPeriod-r9", mcch_cfg_r9.mcch_repeat_period_r9.to_string()); - j.write_int("mcch-Offset-r9", mcch_cfg_r9.mcch_offset_r9); - j.write_str("mcch-ModificationPeriod-r9", mcch_cfg_r9.mcch_mod_period_r9.to_string()); - j.write_str("sf-AllocInfo-r9", mcch_cfg_r9.sf_alloc_info_r9.to_string()); - j.write_str("signallingMCS-r9", mcch_cfg_r9.sig_mcs_r9.to_string()); - j.end_obj(); - if (ext) { - if (mcch_cfg_r14.is_present()) { - j.write_fieldname("mcch-Config-r14"); - j.start_obj(); - if (mcch_cfg_r14->mcch_repeat_period_v1430_present) { - j.write_str("mcch-RepetitionPeriod-v1430", mcch_cfg_r14->mcch_repeat_period_v1430.to_string()); - } - if (mcch_cfg_r14->mcch_mod_period_v1430_present) { - j.write_str("mcch-ModificationPeriod-v1430", mcch_cfg_r14->mcch_mod_period_v1430.to_string()); - } - j.end_obj(); - } - if (subcarrier_spacing_mbms_r14_present) { - j.write_str("subcarrierSpacingMBMS-r14", subcarrier_spacing_mbms_r14.to_string()); - } + type_ = other.type(); + switch (type_) { + case types::uac_implicit_ac_barr_list_r15: + c.init(other.c.get()); + break; + case types::uac_explicit_ac_barr_list_r15: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); } - j.end_obj(); } - -std::string mbsfn_area_info_r9_s::non_mbsfn_region_len_opts::to_string() const +uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_& uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::operator=( + const uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_& other) { - static const char* options[] = {"s1", "s2"}; - return convert_enum_idx(options, 2, value, "mbsfn_area_info_r9_s::non_mbsfn_region_len_e_"); -} -uint8_t mbsfn_area_info_r9_s::non_mbsfn_region_len_opts::to_number() const + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::uac_implicit_ac_barr_list_r15: + c.set(other.c.get()); + break; + case types::uac_explicit_ac_barr_list_r15: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); + } + + return *this; +} +void uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::to_json(json_writer& j) const { - static const uint8_t options[] = {1, 2}; - return map_enum_number(options, 2, value, "mbsfn_area_info_r9_s::non_mbsfn_region_len_e_"); + j.start_obj(); + switch (type_) { + case types::uac_implicit_ac_barr_list_r15: + j.start_array("uac-ImplicitAC-BarringList-r15"); + for (const auto& e1 : c.get()) { + j.write_int(e1); + } + j.end_array(); + break; + case types::uac_explicit_ac_barr_list_r15: + j.start_array("uac-ExplicitAC-BarringList-r15"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); + } + j.end_obj(); } - -std::string mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_opts::to_string() const +SRSASN_CODE uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::pack(bit_ref& bref) const { - static const char* options[] = {"rf32", "rf64", "rf128", "rf256"}; - return convert_enum_idx(options, 4, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_e_"); + type_.pack(bref); + switch (type_) { + case types::uac_implicit_ac_barr_list_r15: + HANDLE_CODE(pack_fixed_seq_of(bref, + &(c.get())[0], + c.get().size(), + integer_packer(1, 8))); + break; + case types::uac_explicit_ac_barr_list_r15: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 63)); + break; + default: + log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; } -uint16_t mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_opts::to_number() const +SRSASN_CODE uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::unpack(cbit_ref& bref) { - static const uint16_t options[] = {32, 64, 128, 256}; - return map_enum_number(options, 4, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_repeat_period_r9_e_"); + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::uac_implicit_ac_barr_list_r15: + HANDLE_CODE(unpack_fixed_seq_of(&(c.get())[0], + bref, + c.get().size(), + integer_packer(1, 8))); + break; + case types::uac_explicit_ac_barr_list_r15: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 63)); + break; + default: + log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; } -std::string mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_opts::to_string() const +// CarrierFreqInfoUTRA-v1250 ::= SEQUENCE +SRSASN_CODE carrier_freq_info_utra_v1250_s::pack(bit_ref& bref) const { - static const char* options[] = {"rf512", "rf1024"}; - return convert_enum_idx(options, 2, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_e_"); + HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); + + return SRSASN_SUCCESS; } -uint16_t mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_opts::to_number() const +SRSASN_CODE carrier_freq_info_utra_v1250_s::unpack(cbit_ref& bref) { - static const uint16_t options[] = {512, 1024}; - return map_enum_number(options, 2, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::mcch_mod_period_r9_e_"); -} + HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); -std::string mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_opts::to_string() const -{ - static const char* options[] = {"n2", "n7", "n13", "n19"}; - return convert_enum_idx(options, 4, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_e_"); + return SRSASN_SUCCESS; } -uint8_t mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_opts::to_number() const +void carrier_freq_info_utra_v1250_s::to_json(json_writer& j) const { - static const uint8_t options[] = {2, 7, 13, 19}; - return map_enum_number(options, 4, value, "mbsfn_area_info_r9_s::mcch_cfg_r9_s_::sig_mcs_r9_e_"); + j.start_obj(); + if (reduced_meas_performance_r12_present) { + j.write_str("reducedMeasPerformance-r12", "true"); + } + j.end_obj(); } -std::string mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_repeat_period_v1430_opts::to_string() const +// CellReselectionInfoCommon-v1460 ::= SEQUENCE +SRSASN_CODE cell_resel_info_common_v1460_s::pack(bit_ref& bref) const { - static const char* options[] = {"rf1", "rf2", "rf4", "rf8", "rf16"}; - return convert_enum_idx(options, 5, value, "mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_repeat_period_v1430_e_"); + HANDLE_CODE(s_search_delta_p_r14.pack(bref)); + + return SRSASN_SUCCESS; } -uint8_t mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_repeat_period_v1430_opts::to_number() const +SRSASN_CODE cell_resel_info_common_v1460_s::unpack(cbit_ref& bref) { - static const uint8_t options[] = {1, 2, 4, 8, 16}; - return map_enum_number(options, 5, value, "mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_repeat_period_v1430_e_"); + HANDLE_CODE(s_search_delta_p_r14.unpack(bref)); + + return SRSASN_SUCCESS; +} +void cell_resel_info_common_v1460_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("s-SearchDeltaP-r14", s_search_delta_p_r14.to_string()); + j.end_obj(); } -std::string mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_mod_period_v1430_opts::to_string() const +std::string cell_resel_info_common_v1460_s::s_search_delta_p_r14_opts::to_string() const { - static const char* options[] = {"rf1", "rf2", "rf4", "rf8", "rf16", "rf32", "rf64", "rf128", "rf256", "spare7"}; - return convert_enum_idx(options, 10, value, "mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_mod_period_v1430_e_"); + static const char* options[] = {"dB6", "dB9", "dB12", "dB15"}; + return convert_enum_idx(options, 4, value, "cell_resel_info_common_v1460_s::s_search_delta_p_r14_e_"); } -uint16_t mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_mod_period_v1430_opts::to_number() const +uint8_t cell_resel_info_common_v1460_s::s_search_delta_p_r14_opts::to_number() const { - static const uint16_t options[] = {1, 2, 4, 8, 16, 32, 64, 128, 256}; - return map_enum_number(options, 9, value, "mbsfn_area_info_r9_s::mcch_cfg_r14_s_::mcch_mod_period_v1430_e_"); + static const uint8_t options[] = {6, 9, 12, 15}; + return map_enum_number(options, 4, value, "cell_resel_info_common_v1460_s::s_search_delta_p_r14_e_"); } -std::string mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_opts::to_string() const +// CellReselectionInfoHSDN-r15 ::= SEQUENCE +SRSASN_CODE cell_resel_info_hsdn_r15_s::pack(bit_ref& bref) const { - static const char* options[] = {"kHz7dot5", "kHz1dot25"}; - return convert_enum_idx(options, 2, value, "mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_e_"); + HANDLE_CODE(pack_integer(bref, cell_equivalent_size_r15, (uint8_t)2u, (uint8_t)16u)); + + return SRSASN_SUCCESS; } -float mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_opts::to_number() const +SRSASN_CODE cell_resel_info_hsdn_r15_s::unpack(cbit_ref& bref) { - static const float options[] = {7.5, 1.25}; - return map_enum_number(options, 2, value, "mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_e_"); + HANDLE_CODE(unpack_integer(cell_equivalent_size_r15, bref, (uint8_t)2u, (uint8_t)16u)); + + return SRSASN_SUCCESS; } -std::string mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_opts::to_number_string() const +void cell_resel_info_hsdn_r15_s::to_json(json_writer& j) const { - static const char* options[] = {"7.5", "1.25"}; - return convert_enum_idx(options, 2, value, "mbsfn_area_info_r9_s::subcarrier_spacing_mbms_r14_e_"); + j.start_obj(); + j.write_int("cellEquivalentSize-r15", cell_equivalent_size_r15); + j.end_obj(); } -// ReselectionInfoRelay-r13 ::= SEQUENCE -SRSASN_CODE resel_info_relay_r13_s::pack(bit_ref& bref) const +// CellReselectionParametersCDMA2000 ::= SEQUENCE +SRSASN_CODE cell_resel_params_cdma2000_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(min_hyst_r13_present, 1)); + HANDLE_CODE(bref.pack(t_resel_cdma2000_sf_present, 1)); - HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r13, (int8_t)-70, (int8_t)-22)); - HANDLE_CODE(filt_coef_r13.pack(bref)); - if (min_hyst_r13_present) { - HANDLE_CODE(min_hyst_r13.pack(bref)); + HANDLE_CODE(pack_dyn_seq_of(bref, band_class_list, 1, 32)); + HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cell_list, 1, 16)); + HANDLE_CODE(pack_integer(bref, t_resel_cdma2000, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_cdma2000_sf_present) { + HANDLE_CODE(t_resel_cdma2000_sf.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE resel_info_relay_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE cell_resel_params_cdma2000_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(min_hyst_r13_present, 1)); + HANDLE_CODE(bref.unpack(t_resel_cdma2000_sf_present, 1)); - HANDLE_CODE(unpack_integer(q_rx_lev_min_r13, bref, (int8_t)-70, (int8_t)-22)); - HANDLE_CODE(filt_coef_r13.unpack(bref)); - if (min_hyst_r13_present) { - HANDLE_CODE(min_hyst_r13.unpack(bref)); + HANDLE_CODE(unpack_dyn_seq_of(band_class_list, bref, 1, 32)); + HANDLE_CODE(unpack_dyn_seq_of(neigh_cell_list, bref, 1, 16)); + HANDLE_CODE(unpack_integer(t_resel_cdma2000, bref, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_cdma2000_sf_present) { + HANDLE_CODE(t_resel_cdma2000_sf.unpack(bref)); } return SRSASN_SUCCESS; } -void resel_info_relay_r13_s::to_json(json_writer& j) const +void cell_resel_params_cdma2000_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("q-RxLevMin-r13", q_rx_lev_min_r13); - j.write_str("filterCoefficient-r13", filt_coef_r13.to_string()); - if (min_hyst_r13_present) { - j.write_str("minHyst-r13", min_hyst_r13.to_string()); + j.start_array("bandClassList"); + for (const auto& e1 : band_class_list) { + e1.to_json(j); + } + j.end_array(); + j.start_array("neighCellList"); + for (const auto& e1 : neigh_cell_list) { + e1.to_json(j); + } + j.end_array(); + j.write_int("t-ReselectionCDMA2000", t_resel_cdma2000); + if (t_resel_cdma2000_sf_present) { + j.write_fieldname("t-ReselectionCDMA2000-SF"); + t_resel_cdma2000_sf.to_json(j); } j.end_obj(); } -std::string resel_info_relay_r13_s::min_hyst_r13_opts::to_string() const -{ - static const char* options[] = {"dB0", "dB3", "dB6", "dB9", "dB12", "dBinf"}; - return convert_enum_idx(options, 6, value, "resel_info_relay_r13_s::min_hyst_r13_e_"); -} -uint8_t resel_info_relay_r13_s::min_hyst_r13_opts::to_number() const -{ - static const uint8_t options[] = {0, 3, 6, 9, 12}; - return map_enum_number(options, 5, value, "resel_info_relay_r13_s::min_hyst_r13_e_"); -} - -// SIB8-PerPLMN-r11 ::= SEQUENCE -SRSASN_CODE sib8_per_plmn_r11_s::pack(bit_ref& bref) const +// CellReselectionParametersCDMA2000-v920 ::= SEQUENCE +SRSASN_CODE cell_resel_params_cdma2000_v920_s::pack(bit_ref& bref) const { - HANDLE_CODE(pack_integer(bref, plmn_id_r11, (uint8_t)1u, (uint8_t)6u)); - HANDLE_CODE(params_cdma2000_r11.pack(bref)); + HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cell_list_v920, 1, 16)); return SRSASN_SUCCESS; } -SRSASN_CODE sib8_per_plmn_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE cell_resel_params_cdma2000_v920_s::unpack(cbit_ref& bref) { - HANDLE_CODE(unpack_integer(plmn_id_r11, bref, (uint8_t)1u, (uint8_t)6u)); - HANDLE_CODE(params_cdma2000_r11.unpack(bref)); + HANDLE_CODE(unpack_dyn_seq_of(neigh_cell_list_v920, bref, 1, 16)); return SRSASN_SUCCESS; } -void sib8_per_plmn_r11_s::to_json(json_writer& j) const +void cell_resel_params_cdma2000_v920_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("plmn-Identity-r11", plmn_id_r11); - j.write_fieldname("parametersCDMA2000-r11"); - params_cdma2000_r11.to_json(j); + j.start_array("neighCellList-v920"); + for (const auto& e1 : neigh_cell_list_v920) { + e1.to_json(j); + } + j.end_array(); j.end_obj(); } -void sib8_per_plmn_r11_s::params_cdma2000_r11_c_::set(types::options e) +// CellReselectionServingFreqInfo-v1310 ::= SEQUENCE +SRSASN_CODE cell_resel_serving_freq_info_v1310_s::pack(bit_ref& bref) const { - type_ = e; + HANDLE_CODE(cell_resel_sub_prio_r13.pack(bref)); + + return SRSASN_SUCCESS; } -void sib8_per_plmn_r11_s::params_cdma2000_r11_c_::to_json(json_writer& j) const +SRSASN_CODE cell_resel_serving_freq_info_v1310_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(cell_resel_sub_prio_r13.unpack(bref)); + + return SRSASN_SUCCESS; +} +void cell_resel_serving_freq_info_v1310_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::explicit_value: - j.write_fieldname("explicitValue"); - c.to_json(j); - break; - case types::default_value: - break; - default: - log_invalid_choice_id(type_, "sib8_per_plmn_r11_s::params_cdma2000_r11_c_"); - } + j.write_str("cellReselectionSubPriority-r13", cell_resel_sub_prio_r13.to_string()); j.end_obj(); } -SRSASN_CODE sib8_per_plmn_r11_s::params_cdma2000_r11_c_::pack(bit_ref& bref) const + +// EAB-ConfigPLMN-r11 ::= SEQUENCE +SRSASN_CODE eab_cfg_plmn_r11_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::explicit_value: - HANDLE_CODE(c.pack(bref)); - break; - case types::default_value: - break; - default: - log_invalid_choice_id(type_, "sib8_per_plmn_r11_s::params_cdma2000_r11_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(eab_cfg_r11_present, 1)); + + if (eab_cfg_r11_present) { + HANDLE_CODE(eab_cfg_r11.pack(bref)); } + return SRSASN_SUCCESS; } -SRSASN_CODE sib8_per_plmn_r11_s::params_cdma2000_r11_c_::unpack(cbit_ref& bref) +SRSASN_CODE eab_cfg_plmn_r11_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::explicit_value: - HANDLE_CODE(c.unpack(bref)); - break; - case types::default_value: - break; - default: - log_invalid_choice_id(type_, "sib8_per_plmn_r11_s::params_cdma2000_r11_c_"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(eab_cfg_r11_present, 1)); + + if (eab_cfg_r11_present) { + HANDLE_CODE(eab_cfg_r11.unpack(bref)); } + return SRSASN_SUCCESS; } - -// SL-CarrierFreqInfo-r12 ::= SEQUENCE -SRSASN_CODE sl_carrier_freq_info_r12_s::pack(bit_ref& bref) const +void eab_cfg_plmn_r11_s::to_json(json_writer& j) const { - HANDLE_CODE(bref.pack(plmn_id_list_r12_present, 1)); - - HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u)); - if (plmn_id_list_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r12, 1, 6)); + j.start_obj(); + if (eab_cfg_r11_present) { + j.write_fieldname("eab-Config-r11"); + eab_cfg_r11.to_json(j); } + j.end_obj(); +} + +// MBMS-NotificationConfig-r9 ::= SEQUENCE +SRSASN_CODE mbms_notif_cfg_r9_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(notif_repeat_coeff_r9.pack(bref)); + HANDLE_CODE(pack_integer(bref, notif_offset_r9, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(pack_integer(bref, notif_sf_idx_r9, (uint8_t)1u, (uint8_t)6u)); return SRSASN_SUCCESS; } -SRSASN_CODE sl_carrier_freq_info_r12_s::unpack(cbit_ref& bref) +SRSASN_CODE mbms_notif_cfg_r9_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(plmn_id_list_r12_present, 1)); - - HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u)); - if (plmn_id_list_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r12, bref, 1, 6)); - } + HANDLE_CODE(notif_repeat_coeff_r9.unpack(bref)); + HANDLE_CODE(unpack_integer(notif_offset_r9, bref, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(unpack_integer(notif_sf_idx_r9, bref, (uint8_t)1u, (uint8_t)6u)); return SRSASN_SUCCESS; } -void sl_carrier_freq_info_r12_s::to_json(json_writer& j) const +void mbms_notif_cfg_r9_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("carrierFreq-r12", carrier_freq_r12); - if (plmn_id_list_r12_present) { - j.start_array("plmn-IdentityList-r12"); - for (const auto& e1 : plmn_id_list_r12) { - e1.to_json(j); - } - j.end_array(); - } + j.write_str("notificationRepetitionCoeff-r9", notif_repeat_coeff_r9.to_string()); + j.write_int("notificationOffset-r9", notif_offset_r9); + j.write_int("notificationSF-Index-r9", notif_sf_idx_r9); j.end_obj(); } -// SL-CarrierFreqInfo-v1310 ::= SEQUENCE -SRSASN_CODE sl_carrier_freq_info_v1310_s::pack(bit_ref& bref) const +std::string mbms_notif_cfg_r9_s::notif_repeat_coeff_r9_opts::to_string() const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(disc_res_non_ps_r13_present, 1)); - HANDLE_CODE(bref.pack(disc_res_ps_r13_present, 1)); - HANDLE_CODE(bref.pack(disc_cfg_other_r13_present, 1)); + static const char* options[] = {"n2", "n4"}; + return convert_enum_idx(options, 2, value, "mbms_notif_cfg_r9_s::notif_repeat_coeff_r9_e_"); +} +uint8_t mbms_notif_cfg_r9_s::notif_repeat_coeff_r9_opts::to_number() const +{ + static const uint8_t options[] = {2, 4}; + return map_enum_number(options, 2, value, "mbms_notif_cfg_r9_s::notif_repeat_coeff_r9_e_"); +} - if (disc_res_non_ps_r13_present) { - HANDLE_CODE(disc_res_non_ps_r13.pack(bref)); - } - if (disc_res_ps_r13_present) { - HANDLE_CODE(disc_res_ps_r13.pack(bref)); - } - if (disc_cfg_other_r13_present) { - HANDLE_CODE(disc_cfg_other_r13.pack(bref)); - } +// MBMS-NotificationConfig-v1430 ::= SEQUENCE +SRSASN_CODE mbms_notif_cfg_v1430_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, notif_sf_idx_v1430, (uint8_t)7u, (uint8_t)10u)); return SRSASN_SUCCESS; } -SRSASN_CODE sl_carrier_freq_info_v1310_s::unpack(cbit_ref& bref) +SRSASN_CODE mbms_notif_cfg_v1430_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(disc_res_non_ps_r13_present, 1)); - HANDLE_CODE(bref.unpack(disc_res_ps_r13_present, 1)); - HANDLE_CODE(bref.unpack(disc_cfg_other_r13_present, 1)); - - if (disc_res_non_ps_r13_present) { - HANDLE_CODE(disc_res_non_ps_r13.unpack(bref)); - } - if (disc_res_ps_r13_present) { - HANDLE_CODE(disc_res_ps_r13.unpack(bref)); - } - if (disc_cfg_other_r13_present) { - HANDLE_CODE(disc_cfg_other_r13.unpack(bref)); - } + HANDLE_CODE(unpack_integer(notif_sf_idx_v1430, bref, (uint8_t)7u, (uint8_t)10u)); return SRSASN_SUCCESS; } -void sl_carrier_freq_info_v1310_s::to_json(json_writer& j) const +void mbms_notif_cfg_v1430_s::to_json(json_writer& j) const { j.start_obj(); - if (disc_res_non_ps_r13_present) { - j.write_fieldname("discResourcesNonPS-r13"); - disc_res_non_ps_r13.to_json(j); - } - if (disc_res_ps_r13_present) { - j.write_fieldname("discResourcesPS-r13"); - disc_res_ps_r13.to_json(j); - } - if (disc_cfg_other_r13_present) { - j.write_fieldname("discConfigOther-r13"); - disc_cfg_other_r13.to_json(j); - } + j.write_int("notificationSF-Index-v1430", notif_sf_idx_v1430); j.end_obj(); } -// SL-PPPP-TxConfigIndex-r15 ::= SEQUENCE -SRSASN_CODE sl_pppp_tx_cfg_idx_r15_s::pack(bit_ref& bref) const +// MeasIdleConfigSIB-r15 ::= SEQUENCE +SRSASN_CODE meas_idle_cfg_sib_r15_s::pack(bit_ref& bref) const { - HANDLE_CODE(pack_integer(bref, prio_thres_r15, (uint8_t)1u, (uint8_t)8u)); - HANDLE_CODE(pack_integer(bref, default_tx_cfg_idx_r15, (uint8_t)0u, (uint8_t)15u)); - HANDLE_CODE(pack_integer(bref, cbr_cfg_idx_r15, (uint8_t)0u, (uint8_t)3u)); - HANDLE_CODE(pack_dyn_seq_of(bref, tx_cfg_idx_list_r15, 1, 16, integer_packer(0, 63))); - HANDLE_CODE(pack_dyn_seq_of(bref, mcs_pssch_range_list_r15, 1, 16)); + bref.pack(ext, 1); + HANDLE_CODE(pack_dyn_seq_of(bref, meas_idle_carrier_list_eutra_r15, 1, 8)); return SRSASN_SUCCESS; } -SRSASN_CODE sl_pppp_tx_cfg_idx_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE meas_idle_cfg_sib_r15_s::unpack(cbit_ref& bref) { - HANDLE_CODE(unpack_integer(prio_thres_r15, bref, (uint8_t)1u, (uint8_t)8u)); - HANDLE_CODE(unpack_integer(default_tx_cfg_idx_r15, bref, (uint8_t)0u, (uint8_t)15u)); - HANDLE_CODE(unpack_integer(cbr_cfg_idx_r15, bref, (uint8_t)0u, (uint8_t)3u)); - HANDLE_CODE(unpack_dyn_seq_of(tx_cfg_idx_list_r15, bref, 1, 16, integer_packer(0, 63))); - HANDLE_CODE(unpack_dyn_seq_of(mcs_pssch_range_list_r15, bref, 1, 16)); + bref.unpack(ext, 1); + HANDLE_CODE(unpack_dyn_seq_of(meas_idle_carrier_list_eutra_r15, bref, 1, 8)); return SRSASN_SUCCESS; } -void sl_pppp_tx_cfg_idx_r15_s::to_json(json_writer& j) const +void meas_idle_cfg_sib_r15_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("priorityThreshold-r15", prio_thres_r15); - j.write_int("defaultTxConfigIndex-r15", default_tx_cfg_idx_r15); - j.write_int("cbr-ConfigIndex-r15", cbr_cfg_idx_r15); - j.start_array("tx-ConfigIndexList-r15"); - for (const auto& e1 : tx_cfg_idx_list_r15) { - j.write_int(e1); - } - j.end_array(); - j.start_array("mcs-PSSCH-RangeList-r15"); - for (const auto& e1 : mcs_pssch_range_list_r15) { + j.start_array("measIdleCarrierListEUTRA-r15"); + for (const auto& e1 : meas_idle_carrier_list_eutra_r15) { e1.to_json(j); } j.end_array(); j.end_obj(); } -// SystemInformationBlockType1-v10j0-IEs ::= SEQUENCE -SRSASN_CODE sib_type1_v10j0_ies_s::pack(bit_ref& bref) const +// RedistributionServingInfo-r13 ::= SEQUENCE +SRSASN_CODE redist_serving_info_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(freq_band_info_r10_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v10j0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(redist_factor_cell_r13_present, 1)); + HANDLE_CODE(bref.pack(redistr_on_paging_only_r13_present, 1)); - if (freq_band_info_r10_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_r10, 1, 8)); - } - if (multi_band_info_list_v10j0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10j0, 1, 8, SeqOfPacker(1, 8, Packer()))); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } + HANDLE_CODE(pack_integer(bref, redist_factor_serving_r13, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(t360_r13.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE sib_type1_v10j0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE redist_serving_info_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(freq_band_info_r10_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v10j0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(redist_factor_cell_r13_present, 1)); + HANDLE_CODE(bref.unpack(redistr_on_paging_only_r13_present, 1)); - if (freq_band_info_r10_present) { - HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_r10, bref, 1, 8)); - } - if (multi_band_info_list_v10j0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10j0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } + HANDLE_CODE(unpack_integer(redist_factor_serving_r13, bref, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(t360_r13.unpack(bref)); return SRSASN_SUCCESS; } -void sib_type1_v10j0_ies_s::to_json(json_writer& j) const +void redist_serving_info_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (freq_band_info_r10_present) { - j.start_array("freqBandInfo-r10"); - for (const auto& e1 : freq_band_info_r10) { - e1.to_json(j); - } - j.end_array(); + j.write_int("redistributionFactorServing-r13", redist_factor_serving_r13); + if (redist_factor_cell_r13_present) { + j.write_str("redistributionFactorCell-r13", "true"); } - if (multi_band_info_list_v10j0_present) { - j.start_array("multiBandInfoList-v10j0"); - for (const auto& e1 : multi_band_info_list_v10j0) { - j.start_array(); - for (const auto& e2 : e1) { - e2.to_json(j); - } - j.end_array(); - } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// SystemInformationBlockType2-v9e0-IEs ::= SEQUENCE -SRSASN_CODE sib_type2_v9e0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ul_carrier_freq_v9e0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (ul_carrier_freq_v9e0_present) { - HANDLE_CODE(pack_integer(bref, ul_carrier_freq_v9e0, (uint32_t)65536u, (uint32_t)262143u)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type2_v9e0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(ul_carrier_freq_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (ul_carrier_freq_v9e0_present) { - HANDLE_CODE(unpack_integer(ul_carrier_freq_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void sib_type2_v9e0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (ul_carrier_freq_v9e0_present) { - j.write_int("ul-CarrierFreq-v9e0", ul_carrier_freq_v9e0); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// SystemInformationBlockType3-v10l0-IEs ::= SEQUENCE -SRSASN_CODE sib_type3_v10l0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(freq_band_info_v10l0_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v10l0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (freq_band_info_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_v10l0, 1, 8)); - } - if (multi_band_info_list_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10l0, 1, 8, SeqOfPacker(1, 8, Packer()))); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type3_v10l0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(freq_band_info_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (freq_band_info_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_v10l0, bref, 1, 8)); - } - if (multi_band_info_list_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10l0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); - } - - return SRSASN_SUCCESS; -} -void sib_type3_v10l0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (freq_band_info_v10l0_present) { - j.start_array("freqBandInfo-v10l0"); - for (const auto& e1 : freq_band_info_v10l0) { - e1.to_json(j); - } - j.end_array(); - } - if (multi_band_info_list_v10l0_present) { - j.start_array("multiBandInfoList-v10l0"); - for (const auto& e1 : multi_band_info_list_v10l0) { - j.start_array(); - for (const auto& e2 : e1) { - e2.to_json(j); - } - j.end_array(); - } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); + j.write_str("t360-r13", t360_r13.to_string()); + if (redistr_on_paging_only_r13_present) { + j.write_str("redistrOnPagingOnly-r13", "true"); } j.end_obj(); } -// SystemInformationBlockType5-v9e0-IEs ::= SEQUENCE -SRSASN_CODE sib_type5_v9e0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v9e0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (inter_freq_carrier_freq_list_v9e0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v9e0, 1, 8)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type5_v9e0_ies_s::unpack(cbit_ref& bref) +std::string redist_serving_info_r13_s::t360_r13_opts::to_string() const { - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (inter_freq_carrier_freq_list_v9e0_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v9e0, bref, 1, 8)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; + static const char* options[] = {"min4", "min8", "min16", "min32", "infinity", "spare3", "spare2", "spare1"}; + return convert_enum_idx(options, 8, value, "redist_serving_info_r13_s::t360_r13_e_"); } -void sib_type5_v9e0_ies_s::to_json(json_writer& j) const +int8_t redist_serving_info_r13_s::t360_r13_opts::to_number() const { - j.start_obj(); - if (inter_freq_carrier_freq_list_v9e0_present) { - j.start_array("interFreqCarrierFreqList-v9e0"); - for (const auto& e1 : inter_freq_carrier_freq_list_v9e0) { - e1.to_json(j); - } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); + static const int8_t options[] = {4, 8, 16, 32, -1}; + return map_enum_number(options, 5, value, "redist_serving_info_r13_s::t360_r13_e_"); } -// UAC-BarringInfoSet-r15 ::= SEQUENCE -SRSASN_CODE uac_barr_info_set_r15_s::pack(bit_ref& bref) const +// SC-MCCH-SchedulingInfo-r14 ::= SEQUENCE +SRSASN_CODE sc_mcch_sched_info_r14_s::pack(bit_ref& bref) const { - HANDLE_CODE(uac_barr_factor_r15.pack(bref)); - HANDLE_CODE(uac_barr_time_r15.pack(bref)); - HANDLE_CODE(uac_barr_for_access_id_r15.pack(bref)); + bref.pack(ext, 1); + HANDLE_CODE(on_dur_timer_scptm_r14.pack(bref)); + HANDLE_CODE(drx_inactivity_timer_scptm_r14.pack(bref)); + HANDLE_CODE(sched_period_start_offset_scptm_r14.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE uac_barr_info_set_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE sc_mcch_sched_info_r14_s::unpack(cbit_ref& bref) { - HANDLE_CODE(uac_barr_factor_r15.unpack(bref)); - HANDLE_CODE(uac_barr_time_r15.unpack(bref)); - HANDLE_CODE(uac_barr_for_access_id_r15.unpack(bref)); + bref.unpack(ext, 1); + HANDLE_CODE(on_dur_timer_scptm_r14.unpack(bref)); + HANDLE_CODE(drx_inactivity_timer_scptm_r14.unpack(bref)); + HANDLE_CODE(sched_period_start_offset_scptm_r14.unpack(bref)); return SRSASN_SUCCESS; } -void uac_barr_info_set_r15_s::to_json(json_writer& j) const +void sc_mcch_sched_info_r14_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("uac-BarringFactor-r15", uac_barr_factor_r15.to_string()); - j.write_str("uac-BarringTime-r15", uac_barr_time_r15.to_string()); - j.write_str("uac-BarringForAccessIdentity-r15", uac_barr_for_access_id_r15.to_string()); + j.write_str("onDurationTimerSCPTM-r14", on_dur_timer_scptm_r14.to_string()); + j.write_str("drx-InactivityTimerSCPTM-r14", drx_inactivity_timer_scptm_r14.to_string()); + j.write_fieldname("schedulingPeriodStartOffsetSCPTM-r14"); + sched_period_start_offset_scptm_r14.to_json(j); j.end_obj(); } -std::string uac_barr_info_set_r15_s::uac_barr_factor_r15_opts::to_string() const -{ - static const char* options[] = { - "p00", "p05", "p10", "p15", "p20", "p25", "p30", "p40", "p50", "p60", "p70", "p75", "p80", "p85", "p90", "p95"}; - return convert_enum_idx(options, 16, value, "uac_barr_info_set_r15_s::uac_barr_factor_r15_e_"); -} -float uac_barr_info_set_r15_s::uac_barr_factor_r15_opts::to_number() const +std::string sc_mcch_sched_info_r14_s::on_dur_timer_scptm_r14_opts::to_string() const { - static const float options[] = {0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5}; - return map_enum_number(options, 16, value, "uac_barr_info_set_r15_s::uac_barr_factor_r15_e_"); + static const char* options[] = {"psf10", "psf20", "psf100", "psf300", "psf500", "psf1000", "psf1200", "psf1600"}; + return convert_enum_idx(options, 8, value, "sc_mcch_sched_info_r14_s::on_dur_timer_scptm_r14_e_"); } -std::string uac_barr_info_set_r15_s::uac_barr_factor_r15_opts::to_number_string() const +uint16_t sc_mcch_sched_info_r14_s::on_dur_timer_scptm_r14_opts::to_number() const { - static const char* options[] = { - "0.0", "0.5", "1.0", "1.5", "2.0", "2.5", "3.0", "4.0", "5.0", "6.0", "7.0", "7.5", "8.0", "8.5", "9.0", "9.5"}; - return convert_enum_idx(options, 16, value, "uac_barr_info_set_r15_s::uac_barr_factor_r15_e_"); + static const uint16_t options[] = {10, 20, 100, 300, 500, 1000, 1200, 1600}; + return map_enum_number(options, 8, value, "sc_mcch_sched_info_r14_s::on_dur_timer_scptm_r14_e_"); } -std::string uac_barr_info_set_r15_s::uac_barr_time_r15_opts::to_string() const +std::string sc_mcch_sched_info_r14_s::drx_inactivity_timer_scptm_r14_opts::to_string() const { - static const char* options[] = {"s4", "s8", "s16", "s32", "s64", "s128", "s256", "s512"}; - return convert_enum_idx(options, 8, value, "uac_barr_info_set_r15_s::uac_barr_time_r15_e_"); + static const char* options[] = {"psf0", + "psf1", + "psf2", + "psf4", + "psf8", + "psf16", + "psf32", + "psf64", + "psf128", + "psf256", + "ps512", + "psf1024", + "psf2048", + "psf4096", + "psf8192", + "psf16384"}; + return convert_enum_idx(options, 16, value, "sc_mcch_sched_info_r14_s::drx_inactivity_timer_scptm_r14_e_"); } -uint16_t uac_barr_info_set_r15_s::uac_barr_time_r15_opts::to_number() const +uint16_t sc_mcch_sched_info_r14_s::drx_inactivity_timer_scptm_r14_opts::to_number() const { - static const uint16_t options[] = {4, 8, 16, 32, 64, 128, 256, 512}; - return map_enum_number(options, 8, value, "uac_barr_info_set_r15_s::uac_barr_time_r15_e_"); + static const uint16_t options[] = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384}; + return map_enum_number(options, 16, value, "sc_mcch_sched_info_r14_s::drx_inactivity_timer_scptm_r14_e_"); } -// UAC-BarringPerPLMN-r15 ::= SEQUENCE -SRSASN_CODE uac_barr_per_plmn_r15_s::pack(bit_ref& bref) const +void sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::destroy_() {} +void sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::set(types::options e) { - HANDLE_CODE(bref.pack(uac_ac_barr_list_type_r15_present, 1)); - - HANDLE_CODE(pack_integer(bref, plmn_id_idx_r15, (uint8_t)1u, (uint8_t)6u)); - if (uac_ac_barr_list_type_r15_present) { - HANDLE_CODE(uac_ac_barr_list_type_r15.pack(bref)); - } - - return SRSASN_SUCCESS; + destroy_(); + type_ = e; } -SRSASN_CODE uac_barr_per_plmn_r15_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(uac_ac_barr_list_type_r15_present, 1)); - - HANDLE_CODE(unpack_integer(plmn_id_idx_r15, bref, (uint8_t)1u, (uint8_t)6u)); - if (uac_ac_barr_list_type_r15_present) { - HANDLE_CODE(uac_ac_barr_list_type_r15.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void uac_barr_per_plmn_r15_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("plmn-IdentityIndex-r15", plmn_id_idx_r15); - if (uac_ac_barr_list_type_r15_present) { - j.write_fieldname("uac-AC-BarringListType-r15"); - uac_ac_barr_list_type_r15.to_json(j); - } - j.end_obj(); -} - -void uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::destroy_() +sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::sched_period_start_offset_scptm_r14_c_( + const sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_& other) { + type_ = other.type(); switch (type_) { - case types::uac_implicit_ac_barr_list_r15: - c.destroy(); + case types::sf10: + c.init(other.c.get()); break; - case types::uac_explicit_ac_barr_list_r15: - c.destroy(); + case types::sf20: + c.init(other.c.get()); break; - default: + case types::sf32: + c.init(other.c.get()); break; - } -} -void uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::uac_implicit_ac_barr_list_r15: - c.init(); + case types::sf40: + c.init(other.c.get()); break; - case types::uac_explicit_ac_barr_list_r15: - c.init(); + case types::sf64: + c.init(other.c.get()); break; - case types::nulltype: + case types::sf80: + c.init(other.c.get()); break; - default: - log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); - } -} -uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::uac_ac_barr_list_type_r15_c_( - const uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::uac_implicit_ac_barr_list_r15: - c.init(other.c.get()); + case types::sf128: + c.init(other.c.get()); break; - case types::uac_explicit_ac_barr_list_r15: - c.init(other.c.get()); + case types::sf160: + c.init(other.c.get()); + break; + case types::sf256: + c.init(other.c.get()); + break; + case types::sf320: + c.init(other.c.get()); + break; + case types::sf512: + c.init(other.c.get()); + break; + case types::sf640: + c.init(other.c.get()); + break; + case types::sf1024: + c.init(other.c.get()); + break; + case types::sf2048: + c.init(other.c.get()); + break; + case types::sf4096: + c.init(other.c.get()); + break; + case types::sf8192: + c.init(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); + log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); } } -uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_& uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::operator=( - const uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_& other) +sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_& +sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::operator=( + const sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_& other) { if (this == &other) { return *this; } set(other.type()); switch (type_) { - case types::uac_implicit_ac_barr_list_r15: - c.set(other.c.get()); + case types::sf10: + c.set(other.c.get()); break; - case types::uac_explicit_ac_barr_list_r15: - c.set(other.c.get()); + case types::sf20: + c.set(other.c.get()); + break; + case types::sf32: + c.set(other.c.get()); + break; + case types::sf40: + c.set(other.c.get()); + break; + case types::sf64: + c.set(other.c.get()); + break; + case types::sf80: + c.set(other.c.get()); + break; + case types::sf128: + c.set(other.c.get()); + break; + case types::sf160: + c.set(other.c.get()); + break; + case types::sf256: + c.set(other.c.get()); + break; + case types::sf320: + c.set(other.c.get()); + break; + case types::sf512: + c.set(other.c.get()); + break; + case types::sf640: + c.set(other.c.get()); + break; + case types::sf1024: + c.set(other.c.get()); + break; + case types::sf2048: + c.set(other.c.get()); + break; + case types::sf4096: + c.set(other.c.get()); + break; + case types::sf8192: + c.set(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); + log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); } return *this; } -void uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::to_json(json_writer& j) const +void sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::uac_implicit_ac_barr_list_r15: - j.start_array("uac-ImplicitAC-BarringList-r15"); - for (const auto& e1 : c.get()) { - j.write_int(e1); - } - j.end_array(); + case types::sf10: + j.write_int("sf10", c.get()); break; - case types::uac_explicit_ac_barr_list_r15: - j.start_array("uac-ExplicitAC-BarringList-r15"); - for (const auto& e1 : c.get()) { - e1.to_json(j); - } - j.end_array(); + case types::sf20: + j.write_int("sf20", c.get()); + break; + case types::sf32: + j.write_int("sf32", c.get()); + break; + case types::sf40: + j.write_int("sf40", c.get()); + break; + case types::sf64: + j.write_int("sf64", c.get()); + break; + case types::sf80: + j.write_int("sf80", c.get()); + break; + case types::sf128: + j.write_int("sf128", c.get()); + break; + case types::sf160: + j.write_int("sf160", c.get()); + break; + case types::sf256: + j.write_int("sf256", c.get()); + break; + case types::sf320: + j.write_int("sf320", c.get()); + break; + case types::sf512: + j.write_int("sf512", c.get()); + break; + case types::sf640: + j.write_int("sf640", c.get()); + break; + case types::sf1024: + j.write_int("sf1024", c.get()); + break; + case types::sf2048: + j.write_int("sf2048", c.get()); + break; + case types::sf4096: + j.write_int("sf4096", c.get()); + break; + case types::sf8192: + j.write_int("sf8192", c.get()); break; default: - log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); + log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); } j.end_obj(); } -SRSASN_CODE uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::pack(bit_ref& bref) const +SRSASN_CODE sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::uac_implicit_ac_barr_list_r15: - HANDLE_CODE(pack_fixed_seq_of(bref, - &(c.get())[0], - c.get().size(), - integer_packer(1, 8))); + case types::sf10: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)9u)); break; - case types::uac_explicit_ac_barr_list_r15: - HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 63)); + case types::sf20: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)19u)); break; - default: - log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::uac_implicit_ac_barr_list_r15: - HANDLE_CODE(unpack_fixed_seq_of(&(c.get())[0], - bref, - c.get().size(), - integer_packer(1, 8))); + case types::sf32: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)31u)); break; - case types::uac_explicit_ac_barr_list_r15: - HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 63)); + case types::sf40: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)39u)); break; - default: - log_invalid_choice_id(type_, "uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -// CarrierFreqInfoUTRA-v1250 ::= SEQUENCE -SRSASN_CODE carrier_freq_info_utra_v1250_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE carrier_freq_info_utra_v1250_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1)); - + case types::sf64: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)63u)); + break; + case types::sf80: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)79u)); + break; + case types::sf128: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)127u)); + break; + case types::sf160: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)159u)); + break; + case types::sf256: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u)); + break; + case types::sf320: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)319u)); + break; + case types::sf512: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)511u)); + break; + case types::sf640: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)639u)); + break; + case types::sf1024: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)1023u)); + break; + case types::sf2048: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)2047u)); + break; + case types::sf4096: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u)); + break; + case types::sf8192: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)8191u)); + break; + default: + log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } return SRSASN_SUCCESS; } -void carrier_freq_info_utra_v1250_s::to_json(json_writer& j) const +SRSASN_CODE sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::unpack(cbit_ref& bref) { - j.start_obj(); - if (reduced_meas_performance_r12_present) { - j.write_str("reducedMeasPerformance-r12", "true"); + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::sf10: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)9u)); + break; + case types::sf20: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)19u)); + break; + case types::sf32: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)31u)); + break; + case types::sf40: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)39u)); + break; + case types::sf64: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)63u)); + break; + case types::sf80: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)79u)); + break; + case types::sf128: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)127u)); + break; + case types::sf160: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)159u)); + break; + case types::sf256: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u)); + break; + case types::sf320: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)319u)); + break; + case types::sf512: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)511u)); + break; + case types::sf640: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)639u)); + break; + case types::sf1024: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)1023u)); + break; + case types::sf2048: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)2047u)); + break; + case types::sf4096: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u)); + break; + case types::sf8192: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)8191u)); + break; + default: + log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); + return SRSASN_ERROR_DECODE_FAIL; } - j.end_obj(); + return SRSASN_SUCCESS; } -// CellReselectionInfoCommon-v1460 ::= SEQUENCE -SRSASN_CODE cell_resel_info_common_v1460_s::pack(bit_ref& bref) const +// SL-DiscConfigRelayUE-r13 ::= SEQUENCE +SRSASN_CODE sl_disc_cfg_relay_ue_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(s_search_delta_p_r14.pack(bref)); + HANDLE_CODE(bref.pack(thresh_high_r13_present, 1)); + HANDLE_CODE(bref.pack(thresh_low_r13_present, 1)); + HANDLE_CODE(bref.pack(hyst_max_r13_present, 1)); + HANDLE_CODE(bref.pack(hyst_min_r13_present, 1)); + + if (thresh_high_r13_present) { + HANDLE_CODE(pack_integer(bref, thresh_high_r13, (uint8_t)0u, (uint8_t)49u)); + } + if (thresh_low_r13_present) { + HANDLE_CODE(pack_integer(bref, thresh_low_r13, (uint8_t)0u, (uint8_t)49u)); + } + if (hyst_max_r13_present) { + HANDLE_CODE(hyst_max_r13.pack(bref)); + } + if (hyst_min_r13_present) { + HANDLE_CODE(hyst_min_r13.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE cell_resel_info_common_v1460_s::unpack(cbit_ref& bref) +SRSASN_CODE sl_disc_cfg_relay_ue_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(s_search_delta_p_r14.unpack(bref)); + HANDLE_CODE(bref.unpack(thresh_high_r13_present, 1)); + HANDLE_CODE(bref.unpack(thresh_low_r13_present, 1)); + HANDLE_CODE(bref.unpack(hyst_max_r13_present, 1)); + HANDLE_CODE(bref.unpack(hyst_min_r13_present, 1)); + + if (thresh_high_r13_present) { + HANDLE_CODE(unpack_integer(thresh_high_r13, bref, (uint8_t)0u, (uint8_t)49u)); + } + if (thresh_low_r13_present) { + HANDLE_CODE(unpack_integer(thresh_low_r13, bref, (uint8_t)0u, (uint8_t)49u)); + } + if (hyst_max_r13_present) { + HANDLE_CODE(hyst_max_r13.unpack(bref)); + } + if (hyst_min_r13_present) { + HANDLE_CODE(hyst_min_r13.unpack(bref)); + } return SRSASN_SUCCESS; } -void cell_resel_info_common_v1460_s::to_json(json_writer& j) const +void sl_disc_cfg_relay_ue_r13_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("s-SearchDeltaP-r14", s_search_delta_p_r14.to_string()); + if (thresh_high_r13_present) { + j.write_int("threshHigh-r13", thresh_high_r13); + } + if (thresh_low_r13_present) { + j.write_int("threshLow-r13", thresh_low_r13); + } + if (hyst_max_r13_present) { + j.write_str("hystMax-r13", hyst_max_r13.to_string()); + } + if (hyst_min_r13_present) { + j.write_str("hystMin-r13", hyst_min_r13.to_string()); + } j.end_obj(); } -std::string cell_resel_info_common_v1460_s::s_search_delta_p_r14_opts::to_string() const +std::string sl_disc_cfg_relay_ue_r13_s::hyst_max_r13_opts::to_string() const { - static const char* options[] = {"dB6", "dB9", "dB12", "dB15"}; - return convert_enum_idx(options, 4, value, "cell_resel_info_common_v1460_s::s_search_delta_p_r14_e_"); + static const char* options[] = {"dB0", "dB3", "dB6", "dB9", "dB12", "dBinf"}; + return convert_enum_idx(options, 6, value, "sl_disc_cfg_relay_ue_r13_s::hyst_max_r13_e_"); } -uint8_t cell_resel_info_common_v1460_s::s_search_delta_p_r14_opts::to_number() const +uint8_t sl_disc_cfg_relay_ue_r13_s::hyst_max_r13_opts::to_number() const { - static const uint8_t options[] = {6, 9, 12, 15}; - return map_enum_number(options, 4, value, "cell_resel_info_common_v1460_s::s_search_delta_p_r14_e_"); + static const uint8_t options[] = {0, 3, 6, 9, 12}; + return map_enum_number(options, 5, value, "sl_disc_cfg_relay_ue_r13_s::hyst_max_r13_e_"); } -// CellReselectionInfoHSDN-r15 ::= SEQUENCE -SRSASN_CODE cell_resel_info_hsdn_r15_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pack_integer(bref, cell_equivalent_size_r15, (uint8_t)2u, (uint8_t)16u)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE cell_resel_info_hsdn_r15_s::unpack(cbit_ref& bref) +std::string sl_disc_cfg_relay_ue_r13_s::hyst_min_r13_opts::to_string() const { - HANDLE_CODE(unpack_integer(cell_equivalent_size_r15, bref, (uint8_t)2u, (uint8_t)16u)); - - return SRSASN_SUCCESS; + static const char* options[] = {"dB0", "dB3", "dB6", "dB9", "dB12"}; + return convert_enum_idx(options, 5, value, "sl_disc_cfg_relay_ue_r13_s::hyst_min_r13_e_"); } -void cell_resel_info_hsdn_r15_s::to_json(json_writer& j) const +uint8_t sl_disc_cfg_relay_ue_r13_s::hyst_min_r13_opts::to_number() const { - j.start_obj(); - j.write_int("cellEquivalentSize-r15", cell_equivalent_size_r15); - j.end_obj(); + static const uint8_t options[] = {0, 3, 6, 9, 12}; + return map_enum_number(options, 5, value, "sl_disc_cfg_relay_ue_r13_s::hyst_min_r13_e_"); } -// CellReselectionParametersCDMA2000 ::= SEQUENCE -SRSASN_CODE cell_resel_params_cdma2000_s::pack(bit_ref& bref) const +// SL-DiscConfigRemoteUE-r13 ::= SEQUENCE +SRSASN_CODE sl_disc_cfg_remote_ue_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(t_resel_cdma2000_sf_present, 1)); + HANDLE_CODE(bref.pack(thresh_high_r13_present, 1)); + HANDLE_CODE(bref.pack(hyst_max_r13_present, 1)); - HANDLE_CODE(pack_dyn_seq_of(bref, band_class_list, 1, 32)); - HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cell_list, 1, 16)); - HANDLE_CODE(pack_integer(bref, t_resel_cdma2000, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_cdma2000_sf_present) { - HANDLE_CODE(t_resel_cdma2000_sf.pack(bref)); + if (thresh_high_r13_present) { + HANDLE_CODE(pack_integer(bref, thresh_high_r13, (uint8_t)0u, (uint8_t)49u)); + } + if (hyst_max_r13_present) { + HANDLE_CODE(hyst_max_r13.pack(bref)); } + HANDLE_CODE(resel_info_ic_r13.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE cell_resel_params_cdma2000_s::unpack(cbit_ref& bref) +SRSASN_CODE sl_disc_cfg_remote_ue_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(t_resel_cdma2000_sf_present, 1)); + HANDLE_CODE(bref.unpack(thresh_high_r13_present, 1)); + HANDLE_CODE(bref.unpack(hyst_max_r13_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(band_class_list, bref, 1, 32)); - HANDLE_CODE(unpack_dyn_seq_of(neigh_cell_list, bref, 1, 16)); - HANDLE_CODE(unpack_integer(t_resel_cdma2000, bref, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_cdma2000_sf_present) { - HANDLE_CODE(t_resel_cdma2000_sf.unpack(bref)); + if (thresh_high_r13_present) { + HANDLE_CODE(unpack_integer(thresh_high_r13, bref, (uint8_t)0u, (uint8_t)49u)); + } + if (hyst_max_r13_present) { + HANDLE_CODE(hyst_max_r13.unpack(bref)); } + HANDLE_CODE(resel_info_ic_r13.unpack(bref)); return SRSASN_SUCCESS; } -void cell_resel_params_cdma2000_s::to_json(json_writer& j) const +void sl_disc_cfg_remote_ue_r13_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("bandClassList"); - for (const auto& e1 : band_class_list) { - e1.to_json(j); - } - j.end_array(); - j.start_array("neighCellList"); - for (const auto& e1 : neigh_cell_list) { - e1.to_json(j); + if (thresh_high_r13_present) { + j.write_int("threshHigh-r13", thresh_high_r13); } - j.end_array(); - j.write_int("t-ReselectionCDMA2000", t_resel_cdma2000); - if (t_resel_cdma2000_sf_present) { - j.write_fieldname("t-ReselectionCDMA2000-SF"); - t_resel_cdma2000_sf.to_json(j); + if (hyst_max_r13_present) { + j.write_str("hystMax-r13", hyst_max_r13.to_string()); } + j.write_fieldname("reselectionInfoIC-r13"); + resel_info_ic_r13.to_json(j); j.end_obj(); } -// CellReselectionParametersCDMA2000-v920 ::= SEQUENCE -SRSASN_CODE cell_resel_params_cdma2000_v920_s::pack(bit_ref& bref) const +std::string sl_disc_cfg_remote_ue_r13_s::hyst_max_r13_opts::to_string() const { - HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cell_list_v920, 1, 16)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE cell_resel_params_cdma2000_v920_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_dyn_seq_of(neigh_cell_list_v920, bref, 1, 16)); - - return SRSASN_SUCCESS; -} -void cell_resel_params_cdma2000_v920_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.start_array("neighCellList-v920"); - for (const auto& e1 : neigh_cell_list_v920) { - e1.to_json(j); - } - j.end_array(); - j.end_obj(); + static const char* options[] = {"dB0", "dB3", "dB6", "dB9", "dB12"}; + return convert_enum_idx(options, 5, value, "sl_disc_cfg_remote_ue_r13_s::hyst_max_r13_e_"); } - -// CellReselectionServingFreqInfo-v1310 ::= SEQUENCE -SRSASN_CODE cell_resel_serving_freq_info_v1310_s::pack(bit_ref& bref) const +uint8_t sl_disc_cfg_remote_ue_r13_s::hyst_max_r13_opts::to_number() const { - HANDLE_CODE(cell_resel_sub_prio_r13.pack(bref)); - - return SRSASN_SUCCESS; + static const uint8_t options[] = {0, 3, 6, 9, 12}; + return map_enum_number(options, 5, value, "sl_disc_cfg_remote_ue_r13_s::hyst_max_r13_e_"); } -SRSASN_CODE cell_resel_serving_freq_info_v1310_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(cell_resel_sub_prio_r13.unpack(bref)); - return SRSASN_SUCCESS; -} -void cell_resel_serving_freq_info_v1310_s::to_json(json_writer& j) const +// UAC-AC1-SelectAssistInfo-r15 ::= ENUMERATED +std::string uac_ac1_select_assist_info_r15_opts::to_string() const { - j.start_obj(); - j.write_str("cellReselectionSubPriority-r13", cell_resel_sub_prio_r13.to_string()); - j.end_obj(); + static const char* options[] = {"a", "b", "c"}; + return convert_enum_idx(options, 3, value, "uac_ac1_select_assist_info_r15_e"); } -// EAB-ConfigPLMN-r11 ::= SEQUENCE -SRSASN_CODE eab_cfg_plmn_r11_s::pack(bit_ref& bref) const +// SystemInformation-v8a0-IEs ::= SEQUENCE +SRSASN_CODE sys_info_v8a0_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(eab_cfg_r11_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - if (eab_cfg_r11_present) { - HANDLE_CODE(eab_cfg_r11.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE eab_cfg_plmn_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE sys_info_v8a0_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(eab_cfg_r11_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - if (eab_cfg_r11_present) { - HANDLE_CODE(eab_cfg_r11.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } return SRSASN_SUCCESS; } -void eab_cfg_plmn_r11_s::to_json(json_writer& j) const +void sys_info_v8a0_ies_s::to_json(json_writer& j) const { j.start_obj(); - if (eab_cfg_r11_present) { - j.write_fieldname("eab-Config-r11"); - eab_cfg_r11.to_json(j); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } j.end_obj(); } -// MBMS-NotificationConfig-r9 ::= SEQUENCE -SRSASN_CODE mbms_notif_cfg_r9_s::pack(bit_ref& bref) const +// SystemInformationBlockPos-r15 ::= SEQUENCE +SRSASN_CODE sib_pos_r15_s::pack(bit_ref& bref) const { - HANDLE_CODE(notif_repeat_coeff_r9.pack(bref)); - HANDLE_CODE(pack_integer(bref, notif_offset_r9, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(pack_integer(bref, notif_sf_idx_r9, (uint8_t)1u, (uint8_t)6u)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - return SRSASN_SUCCESS; -} -SRSASN_CODE mbms_notif_cfg_r9_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(notif_repeat_coeff_r9.unpack(bref)); - HANDLE_CODE(unpack_integer(notif_offset_r9, bref, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(unpack_integer(notif_sf_idx_r9, bref, (uint8_t)1u, (uint8_t)6u)); + HANDLE_CODE(assist_data_sib_elem_r15.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } return SRSASN_SUCCESS; } -void mbms_notif_cfg_r9_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("notificationRepetitionCoeff-r9", notif_repeat_coeff_r9.to_string()); - j.write_int("notificationOffset-r9", notif_offset_r9); - j.write_int("notificationSF-Index-r9", notif_sf_idx_r9); - j.end_obj(); -} - -std::string mbms_notif_cfg_r9_s::notif_repeat_coeff_r9_opts::to_string() const -{ - static const char* options[] = {"n2", "n4"}; - return convert_enum_idx(options, 2, value, "mbms_notif_cfg_r9_s::notif_repeat_coeff_r9_e_"); -} -uint8_t mbms_notif_cfg_r9_s::notif_repeat_coeff_r9_opts::to_number() const -{ - static const uint8_t options[] = {2, 4}; - return map_enum_number(options, 2, value, "mbms_notif_cfg_r9_s::notif_repeat_coeff_r9_e_"); -} - -// MBMS-NotificationConfig-v1430 ::= SEQUENCE -SRSASN_CODE mbms_notif_cfg_v1430_s::pack(bit_ref& bref) const +SRSASN_CODE sib_pos_r15_s::unpack(cbit_ref& bref) { - HANDLE_CODE(pack_integer(bref, notif_sf_idx_v1430, (uint8_t)7u, (uint8_t)10u)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - return SRSASN_SUCCESS; -} -SRSASN_CODE mbms_notif_cfg_v1430_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(notif_sf_idx_v1430, bref, (uint8_t)7u, (uint8_t)10u)); + HANDLE_CODE(assist_data_sib_elem_r15.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } return SRSASN_SUCCESS; } -void mbms_notif_cfg_v1430_s::to_json(json_writer& j) const +void sib_pos_r15_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("notificationSF-Index-v1430", notif_sf_idx_v1430); + j.write_str("assistanceDataSIB-Element-r15", assist_data_sib_elem_r15.to_string()); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } j.end_obj(); } -// MeasIdleConfigSIB-r15 ::= SEQUENCE -SRSASN_CODE meas_idle_cfg_sib_r15_s::pack(bit_ref& bref) const +// SystemInformationBlockType10 ::= SEQUENCE +SRSASN_CODE sib_type10_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(pack_dyn_seq_of(bref, meas_idle_carrier_list_eutra_r15, 1, 8)); + HANDLE_CODE(bref.pack(dummy_present, 1)); + + HANDLE_CODE(msg_id.pack(bref)); + HANDLE_CODE(serial_num.pack(bref)); + HANDLE_CODE(warning_type.pack(bref)); + if (dummy_present) { + HANDLE_CODE(dummy.pack(bref)); + } + if (ext) { + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + } return SRSASN_SUCCESS; } -SRSASN_CODE meas_idle_cfg_sib_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type10_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(unpack_dyn_seq_of(meas_idle_carrier_list_eutra_r15, bref, 1, 8)); + HANDLE_CODE(bref.unpack(dummy_present, 1)); + + HANDLE_CODE(msg_id.unpack(bref)); + HANDLE_CODE(serial_num.unpack(bref)); + HANDLE_CODE(warning_type.unpack(bref)); + if (dummy_present) { + HANDLE_CODE(dummy.unpack(bref)); + } + + if (ext) { + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + } return SRSASN_SUCCESS; } -void meas_idle_cfg_sib_r15_s::to_json(json_writer& j) const +void sib_type10_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("measIdleCarrierListEUTRA-r15"); - for (const auto& e1 : meas_idle_carrier_list_eutra_r15) { - e1.to_json(j); + j.write_str("messageIdentifier", msg_id.to_string()); + j.write_str("serialNumber", serial_num.to_string()); + j.write_str("warningType", warning_type.to_string()); + if (dummy_present) { + j.write_str("dummy", dummy.to_string()); + } + if (ext) { + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } } - j.end_array(); j.end_obj(); } -// RedistributionServingInfo-r13 ::= SEQUENCE -SRSASN_CODE redist_serving_info_r13_s::pack(bit_ref& bref) const +// SystemInformationBlockType11 ::= SEQUENCE +SRSASN_CODE sib_type11_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(redist_factor_cell_r13_present, 1)); - HANDLE_CODE(bref.pack(redistr_on_paging_only_r13_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(data_coding_scheme_present, 1)); - HANDLE_CODE(pack_integer(bref, redist_factor_serving_r13, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(t360_r13.pack(bref)); + HANDLE_CODE(msg_id.pack(bref)); + HANDLE_CODE(serial_num.pack(bref)); + HANDLE_CODE(warning_msg_segment_type.pack(bref)); + HANDLE_CODE(pack_integer(bref, warning_msg_segment_num, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(warning_msg_segment.pack(bref)); + if (data_coding_scheme_present) { + HANDLE_CODE(data_coding_scheme.pack(bref)); + } + + if (ext) { + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + } return SRSASN_SUCCESS; } -SRSASN_CODE redist_serving_info_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type11_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(redist_factor_cell_r13_present, 1)); - HANDLE_CODE(bref.unpack(redistr_on_paging_only_r13_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(data_coding_scheme_present, 1)); - HANDLE_CODE(unpack_integer(redist_factor_serving_r13, bref, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(t360_r13.unpack(bref)); + HANDLE_CODE(msg_id.unpack(bref)); + HANDLE_CODE(serial_num.unpack(bref)); + HANDLE_CODE(warning_msg_segment_type.unpack(bref)); + HANDLE_CODE(unpack_integer(warning_msg_segment_num, bref, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(warning_msg_segment.unpack(bref)); + if (data_coding_scheme_present) { + HANDLE_CODE(data_coding_scheme.unpack(bref)); + } + + if (ext) { + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + } return SRSASN_SUCCESS; } -void redist_serving_info_r13_s::to_json(json_writer& j) const +void sib_type11_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("redistributionFactorServing-r13", redist_factor_serving_r13); - if (redist_factor_cell_r13_present) { - j.write_str("redistributionFactorCell-r13", "true"); + j.write_str("messageIdentifier", msg_id.to_string()); + j.write_str("serialNumber", serial_num.to_string()); + j.write_str("warningMessageSegmentType", warning_msg_segment_type.to_string()); + j.write_int("warningMessageSegmentNumber", warning_msg_segment_num); + j.write_str("warningMessageSegment", warning_msg_segment.to_string()); + if (data_coding_scheme_present) { + j.write_str("dataCodingScheme", data_coding_scheme.to_string()); } - j.write_str("t360-r13", t360_r13.to_string()); - if (redistr_on_paging_only_r13_present) { - j.write_str("redistrOnPagingOnly-r13", "true"); + if (ext) { + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } } j.end_obj(); } -std::string redist_serving_info_r13_s::t360_r13_opts::to_string() const -{ - static const char* options[] = {"min4", "min8", "min16", "min32", "infinity", "spare3", "spare2", "spare1"}; - return convert_enum_idx(options, 8, value, "redist_serving_info_r13_s::t360_r13_e_"); -} -int8_t redist_serving_info_r13_s::t360_r13_opts::to_number() const +std::string sib_type11_s::warning_msg_segment_type_opts::to_string() const { - static const int8_t options[] = {4, 8, 16, 32, -1}; - return map_enum_number(options, 5, value, "redist_serving_info_r13_s::t360_r13_e_"); + static const char* options[] = {"notLastSegment", "lastSegment"}; + return convert_enum_idx(options, 2, value, "sib_type11_s::warning_msg_segment_type_e_"); } -// SC-MCCH-SchedulingInfo-r14 ::= SEQUENCE -SRSASN_CODE sc_mcch_sched_info_r14_s::pack(bit_ref& bref) const +// SystemInformationBlockType12-r9 ::= SEQUENCE +SRSASN_CODE sib_type12_r9_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(on_dur_timer_scptm_r14.pack(bref)); - HANDLE_CODE(drx_inactivity_timer_scptm_r14.pack(bref)); - HANDLE_CODE(sched_period_start_offset_scptm_r14.pack(bref)); + HANDLE_CODE(bref.pack(data_coding_scheme_r9_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + + HANDLE_CODE(msg_id_r9.pack(bref)); + HANDLE_CODE(serial_num_r9.pack(bref)); + HANDLE_CODE(warning_msg_segment_type_r9.pack(bref)); + HANDLE_CODE(pack_integer(bref, warning_msg_segment_num_r9, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(warning_msg_segment_r9.pack(bref)); + if (data_coding_scheme_r9_present) { + HANDLE_CODE(data_coding_scheme_r9.pack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= warning_area_coordinates_segment_r15_present; + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(warning_area_coordinates_segment_r15_present, 1)); + if (warning_area_coordinates_segment_r15_present) { + HANDLE_CODE(warning_area_coordinates_segment_r15.pack(bref)); + } + } + } return SRSASN_SUCCESS; } -SRSASN_CODE sc_mcch_sched_info_r14_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type12_r9_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(on_dur_timer_scptm_r14.unpack(bref)); - HANDLE_CODE(drx_inactivity_timer_scptm_r14.unpack(bref)); - HANDLE_CODE(sched_period_start_offset_scptm_r14.unpack(bref)); + HANDLE_CODE(bref.unpack(data_coding_scheme_r9_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + + HANDLE_CODE(msg_id_r9.unpack(bref)); + HANDLE_CODE(serial_num_r9.unpack(bref)); + HANDLE_CODE(warning_msg_segment_type_r9.unpack(bref)); + HANDLE_CODE(unpack_integer(warning_msg_segment_num_r9, bref, (uint8_t)0u, (uint8_t)63u)); + HANDLE_CODE(warning_msg_segment_r9.unpack(bref)); + if (data_coding_scheme_r9_present) { + HANDLE_CODE(data_coding_scheme_r9.unpack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(bref.unpack(warning_area_coordinates_segment_r15_present, 1)); + if (warning_area_coordinates_segment_r15_present) { + HANDLE_CODE(warning_area_coordinates_segment_r15.unpack(bref)); + } + } + } return SRSASN_SUCCESS; } -void sc_mcch_sched_info_r14_s::to_json(json_writer& j) const +void sib_type12_r9_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("onDurationTimerSCPTM-r14", on_dur_timer_scptm_r14.to_string()); - j.write_str("drx-InactivityTimerSCPTM-r14", drx_inactivity_timer_scptm_r14.to_string()); - j.write_fieldname("schedulingPeriodStartOffsetSCPTM-r14"); - sched_period_start_offset_scptm_r14.to_json(j); + j.write_str("messageIdentifier-r9", msg_id_r9.to_string()); + j.write_str("serialNumber-r9", serial_num_r9.to_string()); + j.write_str("warningMessageSegmentType-r9", warning_msg_segment_type_r9.to_string()); + j.write_int("warningMessageSegmentNumber-r9", warning_msg_segment_num_r9); + j.write_str("warningMessageSegment-r9", warning_msg_segment_r9.to_string()); + if (data_coding_scheme_r9_present) { + j.write_str("dataCodingScheme-r9", data_coding_scheme_r9.to_string()); + } + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (ext) { + if (warning_area_coordinates_segment_r15_present) { + j.write_str("warningAreaCoordinatesSegment-r15", warning_area_coordinates_segment_r15.to_string()); + } + } j.end_obj(); } -std::string sc_mcch_sched_info_r14_s::on_dur_timer_scptm_r14_opts::to_string() const +std::string sib_type12_r9_s::warning_msg_segment_type_r9_opts::to_string() const { - static const char* options[] = {"psf10", "psf20", "psf100", "psf300", "psf500", "psf1000", "psf1200", "psf1600"}; - return convert_enum_idx(options, 8, value, "sc_mcch_sched_info_r14_s::on_dur_timer_scptm_r14_e_"); + static const char* options[] = {"notLastSegment", "lastSegment"}; + return convert_enum_idx(options, 2, value, "sib_type12_r9_s::warning_msg_segment_type_r9_e_"); } -uint16_t sc_mcch_sched_info_r14_s::on_dur_timer_scptm_r14_opts::to_number() const + +// SystemInformationBlockType13-r9 ::= SEQUENCE +SRSASN_CODE sib_type13_r9_s::pack(bit_ref& bref) const { - static const uint16_t options[] = {10, 20, 100, 300, 500, 1000, 1200, 1600}; - return map_enum_number(options, 8, value, "sc_mcch_sched_info_r14_s::on_dur_timer_scptm_r14_e_"); -} + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); -std::string sc_mcch_sched_info_r14_s::drx_inactivity_timer_scptm_r14_opts::to_string() const + HANDLE_CODE(pack_dyn_seq_of(bref, mbsfn_area_info_list_r9, 1, 8)); + HANDLE_CODE(notif_cfg_r9.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= notif_cfg_v1430.is_present(); + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(notif_cfg_v1430.is_present(), 1)); + if (notif_cfg_v1430.is_present()) { + HANDLE_CODE(notif_cfg_v1430->pack(bref)); + } + } + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sib_type13_r9_s::unpack(cbit_ref& bref) { - static const char* options[] = {"psf0", - "psf1", - "psf2", - "psf4", - "psf8", - "psf16", - "psf32", - "psf64", - "psf128", - "psf256", - "ps512", - "psf1024", - "psf2048", - "psf4096", - "psf8192", - "psf16384"}; - return convert_enum_idx(options, 16, value, "sc_mcch_sched_info_r14_s::drx_inactivity_timer_scptm_r14_e_"); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + + HANDLE_CODE(unpack_dyn_seq_of(mbsfn_area_info_list_r9, bref, 1, 8)); + HANDLE_CODE(notif_cfg_r9.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool notif_cfg_v1430_present; + HANDLE_CODE(bref.unpack(notif_cfg_v1430_present, 1)); + notif_cfg_v1430.set_present(notif_cfg_v1430_present); + if (notif_cfg_v1430.is_present()) { + HANDLE_CODE(notif_cfg_v1430->unpack(bref)); + } + } + } + return SRSASN_SUCCESS; } -uint16_t sc_mcch_sched_info_r14_s::drx_inactivity_timer_scptm_r14_opts::to_number() const +void sib_type13_r9_s::to_json(json_writer& j) const { - static const uint16_t options[] = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384}; - return map_enum_number(options, 16, value, "sc_mcch_sched_info_r14_s::drx_inactivity_timer_scptm_r14_e_"); + j.start_obj(); + j.start_array("mbsfn-AreaInfoList-r9"); + for (const auto& e1 : mbsfn_area_info_list_r9) { + e1.to_json(j); + } + j.end_array(); + j.write_fieldname("notificationConfig-r9"); + notif_cfg_r9.to_json(j); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (ext) { + if (notif_cfg_v1430.is_present()) { + j.write_fieldname("notificationConfig-v1430"); + notif_cfg_v1430->to_json(j); + } + } + j.end_obj(); } -void sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::destroy_() {} -void sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::set(types::options e) +// SystemInformationBlockType14-r11 ::= SEQUENCE +SRSASN_CODE sib_type14_r11_s::pack(bit_ref& bref) const { - destroy_(); - type_ = e; + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(eab_param_r11_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + + if (eab_param_r11_present) { + HANDLE_CODE(eab_param_r11.pack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= eab_per_rsrp_r15_present; + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(eab_per_rsrp_r15_present, 1)); + if (eab_per_rsrp_r15_present) { + HANDLE_CODE(eab_per_rsrp_r15.pack(bref)); + } + } + } + return SRSASN_SUCCESS; } -sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::sched_period_start_offset_scptm_r14_c_( - const sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_& other) +SRSASN_CODE sib_type14_r11_s::unpack(cbit_ref& bref) { - type_ = other.type(); - switch (type_) { - case types::sf10: - c.init(other.c.get()); - break; - case types::sf20: - c.init(other.c.get()); - break; - case types::sf32: - c.init(other.c.get()); - break; - case types::sf40: - c.init(other.c.get()); - break; - case types::sf64: - c.init(other.c.get()); - break; - case types::sf80: - c.init(other.c.get()); - break; - case types::sf128: - c.init(other.c.get()); - break; - case types::sf160: - c.init(other.c.get()); - break; - case types::sf256: - c.init(other.c.get()); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(eab_param_r11_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + + if (eab_param_r11_present) { + HANDLE_CODE(eab_param_r11.unpack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.unpack(eab_per_rsrp_r15_present, 1)); + if (eab_per_rsrp_r15_present) { + HANDLE_CODE(eab_per_rsrp_r15.unpack(bref)); + } + } + } + return SRSASN_SUCCESS; +} +void sib_type14_r11_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (eab_param_r11_present) { + j.write_fieldname("eab-Param-r11"); + eab_param_r11.to_json(j); + } + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (ext) { + if (eab_per_rsrp_r15_present) { + j.write_str("eab-PerRSRP-r15", eab_per_rsrp_r15.to_string()); + } + } + j.end_obj(); +} + +void sib_type14_r11_s::eab_param_r11_c_::destroy_() +{ + switch (type_) { + case types::eab_common_r11: + c.destroy(); break; - case types::sf320: - c.init(other.c.get()); + case types::eab_per_plmn_list_r11: + c.destroy(); break; - case types::sf512: - c.init(other.c.get()); + default: break; - case types::sf640: - c.init(other.c.get()); + } +} +void sib_type14_r11_s::eab_param_r11_c_::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::eab_common_r11: + c.init(); break; - case types::sf1024: - c.init(other.c.get()); + case types::eab_per_plmn_list_r11: + c.init(); break; - case types::sf2048: - c.init(other.c.get()); + case types::nulltype: break; - case types::sf4096: - c.init(other.c.get()); + default: + log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + } +} +sib_type14_r11_s::eab_param_r11_c_::eab_param_r11_c_(const sib_type14_r11_s::eab_param_r11_c_& other) +{ + type_ = other.type(); + switch (type_) { + case types::eab_common_r11: + c.init(other.c.get()); break; - case types::sf8192: - c.init(other.c.get()); + case types::eab_per_plmn_list_r11: + c.init(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); + log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); } } -sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_& -sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::operator=( - const sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_& other) +sib_type14_r11_s::eab_param_r11_c_& +sib_type14_r11_s::eab_param_r11_c_::operator=(const sib_type14_r11_s::eab_param_r11_c_& other) { if (this == &other) { return *this; } set(other.type()); switch (type_) { - case types::sf10: - c.set(other.c.get()); - break; - case types::sf20: - c.set(other.c.get()); - break; - case types::sf32: - c.set(other.c.get()); - break; - case types::sf40: - c.set(other.c.get()); - break; - case types::sf64: - c.set(other.c.get()); - break; - case types::sf80: - c.set(other.c.get()); - break; - case types::sf128: - c.set(other.c.get()); - break; - case types::sf160: - c.set(other.c.get()); - break; - case types::sf256: - c.set(other.c.get()); - break; - case types::sf320: - c.set(other.c.get()); - break; - case types::sf512: - c.set(other.c.get()); - break; - case types::sf640: - c.set(other.c.get()); - break; - case types::sf1024: - c.set(other.c.get()); - break; - case types::sf2048: - c.set(other.c.get()); - break; - case types::sf4096: - c.set(other.c.get()); + case types::eab_common_r11: + c.set(other.c.get()); break; - case types::sf8192: - c.set(other.c.get()); + case types::eab_per_plmn_list_r11: + c.set(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); + log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); } return *this; } -void sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::to_json(json_writer& j) const +void sib_type14_r11_s::eab_param_r11_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::sf10: - j.write_int("sf10", c.get()); - break; - case types::sf20: - j.write_int("sf20", c.get()); - break; - case types::sf32: - j.write_int("sf32", c.get()); - break; - case types::sf40: - j.write_int("sf40", c.get()); - break; - case types::sf64: - j.write_int("sf64", c.get()); - break; - case types::sf80: - j.write_int("sf80", c.get()); - break; - case types::sf128: - j.write_int("sf128", c.get()); - break; - case types::sf160: - j.write_int("sf160", c.get()); - break; - case types::sf256: - j.write_int("sf256", c.get()); - break; - case types::sf320: - j.write_int("sf320", c.get()); - break; - case types::sf512: - j.write_int("sf512", c.get()); - break; - case types::sf640: - j.write_int("sf640", c.get()); - break; - case types::sf1024: - j.write_int("sf1024", c.get()); - break; - case types::sf2048: - j.write_int("sf2048", c.get()); - break; - case types::sf4096: - j.write_int("sf4096", c.get()); + case types::eab_common_r11: + j.write_fieldname("eab-Common-r11"); + c.get().to_json(j); break; - case types::sf8192: - j.write_int("sf8192", c.get()); + case types::eab_per_plmn_list_r11: + j.start_array("eab-PerPLMN-List-r11"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); break; default: - log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); + log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); } j.end_obj(); } -SRSASN_CODE sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::pack(bit_ref& bref) const +SRSASN_CODE sib_type14_r11_s::eab_param_r11_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::sf10: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)9u)); - break; - case types::sf20: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)19u)); - break; - case types::sf32: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)31u)); + case types::eab_common_r11: + HANDLE_CODE(c.get().pack(bref)); break; - case types::sf40: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)39u)); + case types::eab_per_plmn_list_r11: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 6)); break; - case types::sf64: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)63u)); + default: + log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sib_type14_r11_s::eab_param_r11_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::eab_common_r11: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::sf80: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)79u)); - break; - case types::sf128: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)127u)); - break; - case types::sf160: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)159u)); - break; - case types::sf256: - HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u)); - break; - case types::sf320: - HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)319u)); - break; - case types::sf512: - HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)511u)); - break; - case types::sf640: - HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)639u)); - break; - case types::sf1024: - HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)1023u)); - break; - case types::sf2048: - HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)2047u)); - break; - case types::sf4096: - HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u)); - break; - case types::sf8192: - HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)8191u)); + case types::eab_per_plmn_list_r11: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 6)); break; default: - log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::unpack(cbit_ref& bref) + +std::string sib_type14_r11_s::eab_per_rsrp_r15_opts::to_string() const { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::sf10: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)9u)); - break; - case types::sf20: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)19u)); - break; - case types::sf32: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)31u)); - break; - case types::sf40: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)39u)); - break; - case types::sf64: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)63u)); - break; - case types::sf80: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)79u)); - break; - case types::sf128: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)127u)); - break; - case types::sf160: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)159u)); - break; - case types::sf256: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u)); - break; - case types::sf320: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)319u)); - break; - case types::sf512: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)511u)); - break; - case types::sf640: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)639u)); - break; - case types::sf1024: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)1023u)); - break; - case types::sf2048: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)2047u)); - break; - case types::sf4096: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u)); - break; - case types::sf8192: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)8191u)); - break; - default: - log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; + static const char* options[] = {"thresh0", "thresh1", "thresh2", "thresh3"}; + return convert_enum_idx(options, 4, value, "sib_type14_r11_s::eab_per_rsrp_r15_e_"); +} +uint8_t sib_type14_r11_s::eab_per_rsrp_r15_opts::to_number() const +{ + static const uint8_t options[] = {0, 1, 2, 3}; + return map_enum_number(options, 4, value, "sib_type14_r11_s::eab_per_rsrp_r15_e_"); } -// SL-DiscConfigRelayUE-r13 ::= SEQUENCE -SRSASN_CODE sl_disc_cfg_relay_ue_r13_s::pack(bit_ref& bref) const +// SystemInformationBlockType15-r11 ::= SEQUENCE +SRSASN_CODE sib_type15_r11_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(thresh_high_r13_present, 1)); - HANDLE_CODE(bref.pack(thresh_low_r13_present, 1)); - HANDLE_CODE(bref.pack(hyst_max_r13_present, 1)); - HANDLE_CODE(bref.pack(hyst_min_r13_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(mbms_sai_intra_freq_r11_present, 1)); + HANDLE_CODE(bref.pack(mbms_sai_inter_freq_list_r11_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - if (thresh_high_r13_present) { - HANDLE_CODE(pack_integer(bref, thresh_high_r13, (uint8_t)0u, (uint8_t)49u)); - } - if (thresh_low_r13_present) { - HANDLE_CODE(pack_integer(bref, thresh_low_r13, (uint8_t)0u, (uint8_t)49u)); + if (mbms_sai_intra_freq_r11_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, mbms_sai_intra_freq_r11, 1, 64, integer_packer(0, 65535))); } - if (hyst_max_r13_present) { - HANDLE_CODE(hyst_max_r13.pack(bref)); + if (mbms_sai_inter_freq_list_r11_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, mbms_sai_inter_freq_list_r11, 1, 8)); } - if (hyst_min_r13_present) { - HANDLE_CODE(hyst_min_r13.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= mbms_sai_inter_freq_list_v1140.is_present(); + group_flags[1] |= mbms_intra_freq_carrier_type_r14.is_present(); + group_flags[1] |= mbms_inter_freq_carrier_type_list_r14.is_present(); + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(mbms_sai_inter_freq_list_v1140.is_present(), 1)); + if (mbms_sai_inter_freq_list_v1140.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *mbms_sai_inter_freq_list_v1140, 1, 8)); + } + } + if (group_flags[1]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(mbms_intra_freq_carrier_type_r14.is_present(), 1)); + HANDLE_CODE(bref.pack(mbms_inter_freq_carrier_type_list_r14.is_present(), 1)); + if (mbms_intra_freq_carrier_type_r14.is_present()) { + HANDLE_CODE(mbms_intra_freq_carrier_type_r14->pack(bref)); + } + if (mbms_inter_freq_carrier_type_list_r14.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *mbms_inter_freq_carrier_type_list_r14, 1, 8)); + } + } + } return SRSASN_SUCCESS; } -SRSASN_CODE sl_disc_cfg_relay_ue_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type15_r11_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(thresh_high_r13_present, 1)); - HANDLE_CODE(bref.unpack(thresh_low_r13_present, 1)); - HANDLE_CODE(bref.unpack(hyst_max_r13_present, 1)); - HANDLE_CODE(bref.unpack(hyst_min_r13_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(mbms_sai_intra_freq_r11_present, 1)); + HANDLE_CODE(bref.unpack(mbms_sai_inter_freq_list_r11_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - if (thresh_high_r13_present) { - HANDLE_CODE(unpack_integer(thresh_high_r13, bref, (uint8_t)0u, (uint8_t)49u)); - } - if (thresh_low_r13_present) { - HANDLE_CODE(unpack_integer(thresh_low_r13, bref, (uint8_t)0u, (uint8_t)49u)); + if (mbms_sai_intra_freq_r11_present) { + HANDLE_CODE(unpack_dyn_seq_of(mbms_sai_intra_freq_r11, bref, 1, 64, integer_packer(0, 65535))); } - if (hyst_max_r13_present) { - HANDLE_CODE(hyst_max_r13.unpack(bref)); + if (mbms_sai_inter_freq_list_r11_present) { + HANDLE_CODE(unpack_dyn_seq_of(mbms_sai_inter_freq_list_r11, bref, 1, 8)); } - if (hyst_min_r13_present) { - HANDLE_CODE(hyst_min_r13.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } + if (ext) { + ext_groups_unpacker_guard group_flags(2); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool mbms_sai_inter_freq_list_v1140_present; + HANDLE_CODE(bref.unpack(mbms_sai_inter_freq_list_v1140_present, 1)); + mbms_sai_inter_freq_list_v1140.set_present(mbms_sai_inter_freq_list_v1140_present); + if (mbms_sai_inter_freq_list_v1140.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*mbms_sai_inter_freq_list_v1140, bref, 1, 8)); + } + } + if (group_flags[1]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool mbms_intra_freq_carrier_type_r14_present; + HANDLE_CODE(bref.unpack(mbms_intra_freq_carrier_type_r14_present, 1)); + mbms_intra_freq_carrier_type_r14.set_present(mbms_intra_freq_carrier_type_r14_present); + bool mbms_inter_freq_carrier_type_list_r14_present; + HANDLE_CODE(bref.unpack(mbms_inter_freq_carrier_type_list_r14_present, 1)); + mbms_inter_freq_carrier_type_list_r14.set_present(mbms_inter_freq_carrier_type_list_r14_present); + if (mbms_intra_freq_carrier_type_r14.is_present()) { + HANDLE_CODE(mbms_intra_freq_carrier_type_r14->unpack(bref)); + } + if (mbms_inter_freq_carrier_type_list_r14.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*mbms_inter_freq_carrier_type_list_r14, bref, 1, 8)); + } + } + } return SRSASN_SUCCESS; } -void sl_disc_cfg_relay_ue_r13_s::to_json(json_writer& j) const +void sib_type15_r11_s::to_json(json_writer& j) const { j.start_obj(); - if (thresh_high_r13_present) { - j.write_int("threshHigh-r13", thresh_high_r13); + if (mbms_sai_intra_freq_r11_present) { + j.start_array("mbms-SAI-IntraFreq-r11"); + for (const auto& e1 : mbms_sai_intra_freq_r11) { + j.write_int(e1); + } + j.end_array(); } - if (thresh_low_r13_present) { - j.write_int("threshLow-r13", thresh_low_r13); + if (mbms_sai_inter_freq_list_r11_present) { + j.start_array("mbms-SAI-InterFreqList-r11"); + for (const auto& e1 : mbms_sai_inter_freq_list_r11) { + e1.to_json(j); + } + j.end_array(); } - if (hyst_max_r13_present) { - j.write_str("hystMax-r13", hyst_max_r13.to_string()); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - if (hyst_min_r13_present) { - j.write_str("hystMin-r13", hyst_min_r13.to_string()); + if (ext) { + if (mbms_sai_inter_freq_list_v1140.is_present()) { + j.start_array("mbms-SAI-InterFreqList-v1140"); + for (const auto& e1 : *mbms_sai_inter_freq_list_v1140) { + e1.to_json(j); + } + j.end_array(); + } + if (mbms_intra_freq_carrier_type_r14.is_present()) { + j.write_fieldname("mbms-IntraFreqCarrierType-r14"); + mbms_intra_freq_carrier_type_r14->to_json(j); + } + if (mbms_inter_freq_carrier_type_list_r14.is_present()) { + j.start_array("mbms-InterFreqCarrierTypeList-r14"); + for (const auto& e1 : *mbms_inter_freq_carrier_type_list_r14) { + e1.to_json(j); + } + j.end_array(); + } } j.end_obj(); } -std::string sl_disc_cfg_relay_ue_r13_s::hyst_max_r13_opts::to_string() const +// SystemInformationBlockType16-r11 ::= SEQUENCE +SRSASN_CODE sib_type16_r11_s::pack(bit_ref& bref) const { - static const char* options[] = {"dB0", "dB3", "dB6", "dB9", "dB12", "dBinf"}; - return convert_enum_idx(options, 6, value, "sl_disc_cfg_relay_ue_r13_s::hyst_max_r13_e_"); -} -uint8_t sl_disc_cfg_relay_ue_r13_s::hyst_max_r13_opts::to_number() const -{ - static const uint8_t options[] = {0, 3, 6, 9, 12}; - return map_enum_number(options, 5, value, "sl_disc_cfg_relay_ue_r13_s::hyst_max_r13_e_"); -} - -std::string sl_disc_cfg_relay_ue_r13_s::hyst_min_r13_opts::to_string() const -{ - static const char* options[] = {"dB0", "dB3", "dB6", "dB9", "dB12"}; - return convert_enum_idx(options, 5, value, "sl_disc_cfg_relay_ue_r13_s::hyst_min_r13_e_"); -} -uint8_t sl_disc_cfg_relay_ue_r13_s::hyst_min_r13_opts::to_number() const -{ - static const uint8_t options[] = {0, 3, 6, 9, 12}; - return map_enum_number(options, 5, value, "sl_disc_cfg_relay_ue_r13_s::hyst_min_r13_e_"); -} - -// SL-DiscConfigRemoteUE-r13 ::= SEQUENCE -SRSASN_CODE sl_disc_cfg_remote_ue_r13_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(thresh_high_r13_present, 1)); - HANDLE_CODE(bref.pack(hyst_max_r13_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(time_info_r11_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - if (thresh_high_r13_present) { - HANDLE_CODE(pack_integer(bref, thresh_high_r13, (uint8_t)0u, (uint8_t)49u)); + if (time_info_r11_present) { + HANDLE_CODE(bref.pack(time_info_r11.day_light_saving_time_r11_present, 1)); + HANDLE_CODE(bref.pack(time_info_r11.leap_seconds_r11_present, 1)); + HANDLE_CODE(bref.pack(time_info_r11.local_time_offset_r11_present, 1)); + HANDLE_CODE(pack_integer(bref, time_info_r11.time_info_utc_r11, (uint64_t)0u, (uint64_t)549755813887u)); + if (time_info_r11.day_light_saving_time_r11_present) { + HANDLE_CODE(time_info_r11.day_light_saving_time_r11.pack(bref)); + } + if (time_info_r11.leap_seconds_r11_present) { + HANDLE_CODE(pack_integer(bref, time_info_r11.leap_seconds_r11, (int16_t)-127, (int16_t)128)); + } + if (time_info_r11.local_time_offset_r11_present) { + HANDLE_CODE(pack_integer(bref, time_info_r11.local_time_offset_r11, (int8_t)-63, (int8_t)64)); + } } - if (hyst_max_r13_present) { - HANDLE_CODE(hyst_max_r13.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } - HANDLE_CODE(resel_info_ic_r13.pack(bref)); + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= time_ref_info_r15.is_present(); + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(time_ref_info_r15.is_present(), 1)); + if (time_ref_info_r15.is_present()) { + HANDLE_CODE(time_ref_info_r15->pack(bref)); + } + } + } return SRSASN_SUCCESS; } -SRSASN_CODE sl_disc_cfg_remote_ue_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type16_r11_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(thresh_high_r13_present, 1)); - HANDLE_CODE(bref.unpack(hyst_max_r13_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(time_info_r11_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - if (thresh_high_r13_present) { - HANDLE_CODE(unpack_integer(thresh_high_r13, bref, (uint8_t)0u, (uint8_t)49u)); + if (time_info_r11_present) { + HANDLE_CODE(bref.unpack(time_info_r11.day_light_saving_time_r11_present, 1)); + HANDLE_CODE(bref.unpack(time_info_r11.leap_seconds_r11_present, 1)); + HANDLE_CODE(bref.unpack(time_info_r11.local_time_offset_r11_present, 1)); + HANDLE_CODE(unpack_integer(time_info_r11.time_info_utc_r11, bref, (uint64_t)0u, (uint64_t)549755813887u)); + if (time_info_r11.day_light_saving_time_r11_present) { + HANDLE_CODE(time_info_r11.day_light_saving_time_r11.unpack(bref)); + } + if (time_info_r11.leap_seconds_r11_present) { + HANDLE_CODE(unpack_integer(time_info_r11.leap_seconds_r11, bref, (int16_t)-127, (int16_t)128)); + } + if (time_info_r11.local_time_offset_r11_present) { + HANDLE_CODE(unpack_integer(time_info_r11.local_time_offset_r11, bref, (int8_t)-63, (int8_t)64)); + } } - if (hyst_max_r13_present) { - HANDLE_CODE(hyst_max_r13.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - HANDLE_CODE(resel_info_ic_r13.unpack(bref)); + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool time_ref_info_r15_present; + HANDLE_CODE(bref.unpack(time_ref_info_r15_present, 1)); + time_ref_info_r15.set_present(time_ref_info_r15_present); + if (time_ref_info_r15.is_present()) { + HANDLE_CODE(time_ref_info_r15->unpack(bref)); + } + } + } return SRSASN_SUCCESS; } -void sl_disc_cfg_remote_ue_r13_s::to_json(json_writer& j) const +void sib_type16_r11_s::to_json(json_writer& j) const { j.start_obj(); - if (thresh_high_r13_present) { - j.write_int("threshHigh-r13", thresh_high_r13); + if (time_info_r11_present) { + j.write_fieldname("timeInfo-r11"); + j.start_obj(); + j.write_int("timeInfoUTC-r11", time_info_r11.time_info_utc_r11); + if (time_info_r11.day_light_saving_time_r11_present) { + j.write_str("dayLightSavingTime-r11", time_info_r11.day_light_saving_time_r11.to_string()); + } + if (time_info_r11.leap_seconds_r11_present) { + j.write_int("leapSeconds-r11", time_info_r11.leap_seconds_r11); + } + if (time_info_r11.local_time_offset_r11_present) { + j.write_int("localTimeOffset-r11", time_info_r11.local_time_offset_r11); + } + j.end_obj(); } - if (hyst_max_r13_present) { - j.write_str("hystMax-r13", hyst_max_r13.to_string()); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (ext) { + if (time_ref_info_r15.is_present()) { + j.write_fieldname("timeReferenceInfo-r15"); + time_ref_info_r15->to_json(j); + } } - j.write_fieldname("reselectionInfoIC-r13"); - resel_info_ic_r13.to_json(j); j.end_obj(); } -std::string sl_disc_cfg_remote_ue_r13_s::hyst_max_r13_opts::to_string() const -{ - static const char* options[] = {"dB0", "dB3", "dB6", "dB9", "dB12"}; - return convert_enum_idx(options, 5, value, "sl_disc_cfg_remote_ue_r13_s::hyst_max_r13_e_"); -} -uint8_t sl_disc_cfg_remote_ue_r13_s::hyst_max_r13_opts::to_number() const -{ - static const uint8_t options[] = {0, 3, 6, 9, 12}; - return map_enum_number(options, 5, value, "sl_disc_cfg_remote_ue_r13_s::hyst_max_r13_e_"); -} - -// SystemInformationBlockType1-v9e0-IEs ::= SEQUENCE -SRSASN_CODE sib_type1_v9e0_ies_s::pack(bit_ref& bref) const +// SystemInformationBlockType17-r12 ::= SEQUENCE +SRSASN_CODE sib_type17_r12_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(freq_band_ind_v9e0_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v9e0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(wlan_offload_info_per_plmn_list_r12_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - if (freq_band_ind_v9e0_present) { - HANDLE_CODE(pack_integer(bref, freq_band_ind_v9e0, (uint16_t)65u, (uint16_t)256u)); - } - if (multi_band_info_list_v9e0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v9e0, 1, 8)); + if (wlan_offload_info_per_plmn_list_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, wlan_offload_info_per_plmn_list_r12, 1, 6)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type1_v9e0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type17_r12_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(freq_band_ind_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(wlan_offload_info_per_plmn_list_r12_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - if (freq_band_ind_v9e0_present) { - HANDLE_CODE(unpack_integer(freq_band_ind_v9e0, bref, (uint16_t)65u, (uint16_t)256u)); - } - if (multi_band_info_list_v9e0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v9e0, bref, 1, 8)); + if (wlan_offload_info_per_plmn_list_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(wlan_offload_info_per_plmn_list_r12, bref, 1, 6)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } return SRSASN_SUCCESS; } -void sib_type1_v9e0_ies_s::to_json(json_writer& j) const +void sib_type17_r12_s::to_json(json_writer& j) const { j.start_obj(); - if (freq_band_ind_v9e0_present) { - j.write_int("freqBandIndicator-v9e0", freq_band_ind_v9e0); - } - if (multi_band_info_list_v9e0_present) { - j.start_array("multiBandInfoList-v9e0"); - for (const auto& e1 : multi_band_info_list_v9e0) { + if (wlan_offload_info_per_plmn_list_r12_present) { + j.start_array("wlan-OffloadInfoPerPLMN-List-r12"); + for (const auto& e1 : wlan_offload_info_per_plmn_list_r12) { e1.to_json(j); } j.end_array(); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } j.end_obj(); } -// SystemInformationBlockType2-v8h0-IEs ::= SEQUENCE -SRSASN_CODE sib_type2_v8h0_ies_s::pack(bit_ref& bref) const +// SystemInformationBlockType18-r12 ::= SEQUENCE +SRSASN_CODE sib_type18_r12_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(multi_band_info_list_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(comm_cfg_r12_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - if (multi_band_info_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer(1, 32))); + if (comm_cfg_r12_present) { + HANDLE_CODE(bref.pack(comm_cfg_r12.comm_tx_pool_normal_common_r12_present, 1)); + HANDLE_CODE(bref.pack(comm_cfg_r12.comm_tx_pool_exceptional_r12_present, 1)); + HANDLE_CODE(bref.pack(comm_cfg_r12.comm_sync_cfg_r12_present, 1)); + HANDLE_CODE(pack_dyn_seq_of(bref, comm_cfg_r12.comm_rx_pool_r12, 1, 16)); + if (comm_cfg_r12.comm_tx_pool_normal_common_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, comm_cfg_r12.comm_tx_pool_normal_common_r12, 1, 4)); + } + if (comm_cfg_r12.comm_tx_pool_exceptional_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, comm_cfg_r12.comm_tx_pool_exceptional_r12, 1, 4)); + } + if (comm_cfg_r12.comm_sync_cfg_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, comm_cfg_r12.comm_sync_cfg_r12, 1, 16)); + } } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= comm_tx_pool_normal_common_ext_r13.is_present(); + group_flags[0] |= comm_tx_res_uc_req_allowed_r13_present; + group_flags[0] |= comm_tx_allow_relay_common_r13_present; + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(comm_tx_pool_normal_common_ext_r13.is_present(), 1)); + HANDLE_CODE(bref.pack(comm_tx_res_uc_req_allowed_r13_present, 1)); + HANDLE_CODE(bref.pack(comm_tx_allow_relay_common_r13_present, 1)); + if (comm_tx_pool_normal_common_ext_r13.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *comm_tx_pool_normal_common_ext_r13, 1, 4)); + } + } + } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type2_v8h0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type18_r12_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(multi_band_info_list_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (multi_band_info_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer(1, 32))); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(comm_cfg_r12_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + + if (comm_cfg_r12_present) { + HANDLE_CODE(bref.unpack(comm_cfg_r12.comm_tx_pool_normal_common_r12_present, 1)); + HANDLE_CODE(bref.unpack(comm_cfg_r12.comm_tx_pool_exceptional_r12_present, 1)); + HANDLE_CODE(bref.unpack(comm_cfg_r12.comm_sync_cfg_r12_present, 1)); + HANDLE_CODE(unpack_dyn_seq_of(comm_cfg_r12.comm_rx_pool_r12, bref, 1, 16)); + if (comm_cfg_r12.comm_tx_pool_normal_common_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(comm_cfg_r12.comm_tx_pool_normal_common_r12, bref, 1, 4)); + } + if (comm_cfg_r12.comm_tx_pool_exceptional_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(comm_cfg_r12.comm_tx_pool_exceptional_r12, bref, 1, 4)); + } + if (comm_cfg_r12.comm_sync_cfg_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(comm_cfg_r12.comm_sync_cfg_r12, bref, 1, 16)); + } } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool comm_tx_pool_normal_common_ext_r13_present; + HANDLE_CODE(bref.unpack(comm_tx_pool_normal_common_ext_r13_present, 1)); + comm_tx_pool_normal_common_ext_r13.set_present(comm_tx_pool_normal_common_ext_r13_present); + HANDLE_CODE(bref.unpack(comm_tx_res_uc_req_allowed_r13_present, 1)); + HANDLE_CODE(bref.unpack(comm_tx_allow_relay_common_r13_present, 1)); + if (comm_tx_pool_normal_common_ext_r13.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*comm_tx_pool_normal_common_ext_r13, bref, 1, 4)); + } + } + } return SRSASN_SUCCESS; } -void sib_type2_v8h0_ies_s::to_json(json_writer& j) const +void sib_type18_r12_s::to_json(json_writer& j) const { j.start_obj(); - if (multi_band_info_list_present) { - j.start_array("multiBandInfoList"); - for (const auto& e1 : multi_band_info_list) { - j.write_int(e1); + if (comm_cfg_r12_present) { + j.write_fieldname("commConfig-r12"); + j.start_obj(); + j.start_array("commRxPool-r12"); + for (const auto& e1 : comm_cfg_r12.comm_rx_pool_r12) { + e1.to_json(j); } j.end_array(); + if (comm_cfg_r12.comm_tx_pool_normal_common_r12_present) { + j.start_array("commTxPoolNormalCommon-r12"); + for (const auto& e1 : comm_cfg_r12.comm_tx_pool_normal_common_r12) { + e1.to_json(j); + } + j.end_array(); + } + if (comm_cfg_r12.comm_tx_pool_exceptional_r12_present) { + j.start_array("commTxPoolExceptional-r12"); + for (const auto& e1 : comm_cfg_r12.comm_tx_pool_exceptional_r12) { + e1.to_json(j); + } + j.end_array(); + } + if (comm_cfg_r12.comm_sync_cfg_r12_present) { + j.start_array("commSyncConfig-r12"); + for (const auto& e1 : comm_cfg_r12.comm_sync_cfg_r12) { + e1.to_json(j); + } + j.end_array(); + } + j.end_obj(); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (ext) { + if (comm_tx_pool_normal_common_ext_r13.is_present()) { + j.start_array("commTxPoolNormalCommonExt-r13"); + for (const auto& e1 : *comm_tx_pool_normal_common_ext_r13) { + e1.to_json(j); + } + j.end_array(); + } + if (comm_tx_res_uc_req_allowed_r13_present) { + j.write_str("commTxResourceUC-ReqAllowed-r13", "true"); + } + if (comm_tx_allow_relay_common_r13_present) { + j.write_str("commTxAllowRelayCommon-r13", "true"); + } } j.end_obj(); } -// SystemInformationBlockType3-v10j0-IEs ::= SEQUENCE -SRSASN_CODE sib_type3_v10j0_ies_s::pack(bit_ref& bref) const +// SystemInformationBlockType19-r12 ::= SEQUENCE +SRSASN_CODE sib_type19_r12_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(freq_band_info_r10_present, 1)); - HANDLE_CODE(bref.pack(multi_band_info_list_v10j0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(disc_cfg_r12_present, 1)); + HANDLE_CODE(bref.pack(disc_inter_freq_list_r12_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - if (freq_band_info_r10_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_r10, 1, 8)); + if (disc_cfg_r12_present) { + HANDLE_CODE(bref.pack(disc_cfg_r12.disc_tx_pool_common_r12_present, 1)); + HANDLE_CODE(bref.pack(disc_cfg_r12.disc_tx_pwr_info_r12_present, 1)); + HANDLE_CODE(bref.pack(disc_cfg_r12.disc_sync_cfg_r12_present, 1)); + HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_r12.disc_rx_pool_r12, 1, 16)); + if (disc_cfg_r12.disc_tx_pool_common_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_r12.disc_tx_pool_common_r12, 1, 4)); + } + if (disc_cfg_r12.disc_tx_pwr_info_r12_present) { + HANDLE_CODE( + pack_fixed_seq_of(bref, &(disc_cfg_r12.disc_tx_pwr_info_r12)[0], disc_cfg_r12.disc_tx_pwr_info_r12.size())); + } + if (disc_cfg_r12.disc_sync_cfg_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_r12.disc_sync_cfg_r12, 1, 16)); + } } - if (multi_band_info_list_v10j0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10j0, 1, 8, SeqOfPacker(1, 8, Packer()))); + if (disc_inter_freq_list_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, disc_inter_freq_list_r12, 1, 8)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= disc_cfg_v1310.is_present(); + group_flags[0] |= disc_cfg_relay_r13.is_present(); + group_flags[0] |= disc_cfg_ps_minus13.is_present(); + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(disc_cfg_v1310.is_present(), 1)); + HANDLE_CODE(bref.pack(disc_cfg_relay_r13.is_present(), 1)); + HANDLE_CODE(bref.pack(disc_cfg_ps_minus13.is_present(), 1)); + if (disc_cfg_v1310.is_present()) { + HANDLE_CODE(bref.pack(disc_cfg_v1310->disc_inter_freq_list_v1310_present, 1)); + HANDLE_CODE(bref.pack(disc_cfg_v1310->gap_requests_allowed_common_present, 1)); + if (disc_cfg_v1310->disc_inter_freq_list_v1310_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_v1310->disc_inter_freq_list_v1310, 1, 8)); + } + } + if (disc_cfg_relay_r13.is_present()) { + HANDLE_CODE(disc_cfg_relay_r13->relay_ue_cfg_r13.pack(bref)); + HANDLE_CODE(disc_cfg_relay_r13->remote_ue_cfg_r13.pack(bref)); + } + if (disc_cfg_ps_minus13.is_present()) { + HANDLE_CODE(bref.pack(disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present, 1)); + HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_ps_minus13->disc_rx_pool_ps_r13, 1, 16)); + if (disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13, 1, 4)); + } + } + } + } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type3_v10j0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type19_r12_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(freq_band_info_r10_present, 1)); - HANDLE_CODE(bref.unpack(multi_band_info_list_v10j0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(disc_cfg_r12_present, 1)); + HANDLE_CODE(bref.unpack(disc_inter_freq_list_r12_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - if (freq_band_info_r10_present) { - HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_r10, bref, 1, 8)); + if (disc_cfg_r12_present) { + HANDLE_CODE(bref.unpack(disc_cfg_r12.disc_tx_pool_common_r12_present, 1)); + HANDLE_CODE(bref.unpack(disc_cfg_r12.disc_tx_pwr_info_r12_present, 1)); + HANDLE_CODE(bref.unpack(disc_cfg_r12.disc_sync_cfg_r12_present, 1)); + HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_r12.disc_rx_pool_r12, bref, 1, 16)); + if (disc_cfg_r12.disc_tx_pool_common_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_r12.disc_tx_pool_common_r12, bref, 1, 4)); + } + if (disc_cfg_r12.disc_tx_pwr_info_r12_present) { + HANDLE_CODE( + unpack_fixed_seq_of(&(disc_cfg_r12.disc_tx_pwr_info_r12)[0], bref, disc_cfg_r12.disc_tx_pwr_info_r12.size())); + } + if (disc_cfg_r12.disc_sync_cfg_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_r12.disc_sync_cfg_r12, bref, 1, 16)); + } } - if (multi_band_info_list_v10j0_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10j0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); + if (disc_inter_freq_list_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(disc_inter_freq_list_r12, bref, 1, 8)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } + if (ext) { + ext_groups_unpacker_guard group_flags(1); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool disc_cfg_v1310_present; + HANDLE_CODE(bref.unpack(disc_cfg_v1310_present, 1)); + disc_cfg_v1310.set_present(disc_cfg_v1310_present); + bool disc_cfg_relay_r13_present; + HANDLE_CODE(bref.unpack(disc_cfg_relay_r13_present, 1)); + disc_cfg_relay_r13.set_present(disc_cfg_relay_r13_present); + bool disc_cfg_ps_minus13_present; + HANDLE_CODE(bref.unpack(disc_cfg_ps_minus13_present, 1)); + disc_cfg_ps_minus13.set_present(disc_cfg_ps_minus13_present); + if (disc_cfg_v1310.is_present()) { + HANDLE_CODE(bref.unpack(disc_cfg_v1310->disc_inter_freq_list_v1310_present, 1)); + HANDLE_CODE(bref.unpack(disc_cfg_v1310->gap_requests_allowed_common_present, 1)); + if (disc_cfg_v1310->disc_inter_freq_list_v1310_present) { + HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_v1310->disc_inter_freq_list_v1310, bref, 1, 8)); + } + } + if (disc_cfg_relay_r13.is_present()) { + HANDLE_CODE(disc_cfg_relay_r13->relay_ue_cfg_r13.unpack(bref)); + HANDLE_CODE(disc_cfg_relay_r13->remote_ue_cfg_r13.unpack(bref)); + } + if (disc_cfg_ps_minus13.is_present()) { + HANDLE_CODE(bref.unpack(disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present, 1)); + HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_ps_minus13->disc_rx_pool_ps_r13, bref, 1, 16)); + if (disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present) { + HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13, bref, 1, 4)); + } + } + } + } return SRSASN_SUCCESS; } -void sib_type3_v10j0_ies_s::to_json(json_writer& j) const +void sib_type19_r12_s::to_json(json_writer& j) const { j.start_obj(); - if (freq_band_info_r10_present) { - j.start_array("freqBandInfo-r10"); - for (const auto& e1 : freq_band_info_r10) { + if (disc_cfg_r12_present) { + j.write_fieldname("discConfig-r12"); + j.start_obj(); + j.start_array("discRxPool-r12"); + for (const auto& e1 : disc_cfg_r12.disc_rx_pool_r12) { e1.to_json(j); } j.end_array(); - } - if (multi_band_info_list_v10j0_present) { - j.start_array("multiBandInfoList-v10j0"); - for (const auto& e1 : multi_band_info_list_v10j0) { - j.start_array(); - for (const auto& e2 : e1) { - e2.to_json(j); + if (disc_cfg_r12.disc_tx_pool_common_r12_present) { + j.start_array("discTxPoolCommon-r12"); + for (const auto& e1 : disc_cfg_r12.disc_tx_pool_common_r12) { + e1.to_json(j); } j.end_array(); } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// SystemInformationBlockType5-v8h0-IEs ::= SEQUENCE -SRSASN_CODE sib_type5_v8h0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v8h0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (inter_freq_carrier_freq_list_v8h0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v8h0, 1, 8)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type5_v8h0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v8h0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (inter_freq_carrier_freq_list_v8h0_present) { - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v8h0, bref, 1, 8)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (disc_cfg_r12.disc_tx_pwr_info_r12_present) { + j.start_array("discTxPowerInfo-r12"); + for (const auto& e1 : disc_cfg_r12.disc_tx_pwr_info_r12) { + e1.to_json(j); + } + j.end_array(); + } + if (disc_cfg_r12.disc_sync_cfg_r12_present) { + j.start_array("discSyncConfig-r12"); + for (const auto& e1 : disc_cfg_r12.disc_sync_cfg_r12) { + e1.to_json(j); + } + j.end_array(); + } + j.end_obj(); } - - return SRSASN_SUCCESS; -} -void sib_type5_v8h0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (inter_freq_carrier_freq_list_v8h0_present) { - j.start_array("interFreqCarrierFreqList-v8h0"); - for (const auto& e1 : inter_freq_carrier_freq_list_v8h0) { + if (disc_inter_freq_list_r12_present) { + j.start_array("discInterFreqList-r12"); + for (const auto& e1 : disc_inter_freq_list_r12) { e1.to_json(j); } j.end_array(); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// SystemInformationBlockType6-v8h0-IEs ::= SEQUENCE -SRSASN_CODE sib_type6_v8h0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(carrier_freq_list_utra_fdd_v8h0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (carrier_freq_list_utra_fdd_v8h0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freq_list_utra_fdd_v8h0, 1, 16)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type6_v8h0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(carrier_freq_list_utra_fdd_v8h0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (carrier_freq_list_utra_fdd_v8h0_present) { - HANDLE_CODE(unpack_dyn_seq_of(carrier_freq_list_utra_fdd_v8h0, bref, 1, 16)); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - - return SRSASN_SUCCESS; -} -void sib_type6_v8h0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (carrier_freq_list_utra_fdd_v8h0_present) { - j.start_array("carrierFreqListUTRA-FDD-v8h0"); - for (const auto& e1 : carrier_freq_list_utra_fdd_v8h0) { - e1.to_json(j); + if (ext) { + if (disc_cfg_v1310.is_present()) { + j.write_fieldname("discConfig-v1310"); + j.start_obj(); + if (disc_cfg_v1310->disc_inter_freq_list_v1310_present) { + j.start_array("discInterFreqList-v1310"); + for (const auto& e1 : disc_cfg_v1310->disc_inter_freq_list_v1310) { + e1.to_json(j); + } + j.end_array(); + } + if (disc_cfg_v1310->gap_requests_allowed_common_present) { + j.write_str("gapRequestsAllowedCommon", "true"); + } + j.end_obj(); + } + if (disc_cfg_relay_r13.is_present()) { + j.write_fieldname("discConfigRelay-r13"); + j.start_obj(); + j.write_fieldname("relayUE-Config-r13"); + disc_cfg_relay_r13->relay_ue_cfg_r13.to_json(j); + j.write_fieldname("remoteUE-Config-r13"); + disc_cfg_relay_r13->remote_ue_cfg_r13.to_json(j); + j.end_obj(); + } + if (disc_cfg_ps_minus13.is_present()) { + j.write_fieldname("discConfigPS-13"); + j.start_obj(); + j.start_array("discRxPoolPS-r13"); + for (const auto& e1 : disc_cfg_ps_minus13->disc_rx_pool_ps_r13) { + e1.to_json(j); + } + j.end_array(); + if (disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present) { + j.start_array("discTxPoolPS-Common-r13"); + for (const auto& e1 : disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13) { + e1.to_json(j); + } + j.end_array(); + } + j.end_obj(); } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); } j.end_obj(); } -// UAC-AC1-SelectAssistInfo-r15 ::= ENUMERATED -std::string uac_ac1_select_assist_info_r15_opts::to_string() const -{ - static const char* options[] = {"a", "b", "c"}; - return convert_enum_idx(options, 3, value, "uac_ac1_select_assist_info_r15_e"); -} - -// SystemInformation-v8a0-IEs ::= SEQUENCE -SRSASN_CODE sys_info_v8a0_ies_s::pack(bit_ref& bref) const +// SystemInformationBlockType20-r13 ::= SEQUENCE +SRSASN_CODE sib_type20_r13_s::pack(bit_ref& bref) const { + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(sc_mcch_dur_r13_present, 1)); HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(sc_mcch_repeat_period_r13.pack(bref)); + HANDLE_CODE(pack_integer(bref, sc_mcch_offset_r13, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(pack_integer(bref, sc_mcch_first_sf_r13, (uint8_t)0u, (uint8_t)9u)); + if (sc_mcch_dur_r13_present) { + HANDLE_CODE(pack_integer(bref, sc_mcch_dur_r13, (uint8_t)2u, (uint8_t)9u)); + } + HANDLE_CODE(sc_mcch_mod_period_r13.pack(bref)); if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.pack(bref)); } - return SRSASN_SUCCESS; -} -SRSASN_CODE sys_info_v8a0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= br_bcch_cfg_r14.is_present(); + group_flags[0] |= sc_mcch_sched_info_r14.is_present(); + group_flags[0] |= pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present; + group_flags[0] |= pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present; + group_flags[1] |= sc_mcch_repeat_period_v1470_present; + group_flags[1] |= sc_mcch_mod_period_v1470_present; + group_flags.pack(bref); - return SRSASN_SUCCESS; -} -void sys_info_v8a0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); -// SystemInformationBlockPos-r15 ::= SEQUENCE -SRSASN_CODE sib_pos_r15_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(br_bcch_cfg_r14.is_present(), 1)); + HANDLE_CODE(bref.pack(sc_mcch_sched_info_r14.is_present(), 1)); + HANDLE_CODE(bref.pack(pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present, 1)); + HANDLE_CODE(bref.pack(pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present, 1)); + if (br_bcch_cfg_r14.is_present()) { + HANDLE_CODE(pack_integer(bref, br_bcch_cfg_r14->mpdcch_nb_sc_mcch_r14, (uint8_t)1u, (uint8_t)16u)); + HANDLE_CODE(br_bcch_cfg_r14->mpdcch_num_repeat_sc_mcch_r14.pack(bref)); + HANDLE_CODE(br_bcch_cfg_r14->mpdcch_start_sf_sc_mcch_r14.pack(bref)); + HANDLE_CODE(br_bcch_cfg_r14->mpdcch_pdsch_hop_cfg_sc_mcch_r14.pack(bref)); + HANDLE_CODE(pack_integer(bref, br_bcch_cfg_r14->sc_mcch_carrier_freq_r14, (uint32_t)0u, (uint32_t)262143u)); + HANDLE_CODE(pack_integer(bref, br_bcch_cfg_r14->sc_mcch_offset_br_r14, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(br_bcch_cfg_r14->sc_mcch_repeat_period_br_r14.pack(bref)); + HANDLE_CODE(br_bcch_cfg_r14->sc_mcch_mod_period_br_r14.pack(bref)); + } + if (sc_mcch_sched_info_r14.is_present()) { + HANDLE_CODE(sc_mcch_sched_info_r14->pack(bref)); + } + if (pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present) { + HANDLE_CODE(pdsch_max_num_repeat_cemode_a_sc_mtch_r14.pack(bref)); + } + if (pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present) { + HANDLE_CODE(pdsch_max_num_repeat_cemode_b_sc_mtch_r14.pack(bref)); + } + } + if (group_flags[1]) { + varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(assist_data_sib_elem_r15.pack(bref)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + HANDLE_CODE(bref.pack(sc_mcch_repeat_period_v1470_present, 1)); + HANDLE_CODE(bref.pack(sc_mcch_mod_period_v1470_present, 1)); + } } - return SRSASN_SUCCESS; } -SRSASN_CODE sib_pos_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type20_r13_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(sc_mcch_dur_r13_present, 1)); HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(assist_data_sib_elem_r15.unpack(bref)); + HANDLE_CODE(sc_mcch_repeat_period_r13.unpack(bref)); + HANDLE_CODE(unpack_integer(sc_mcch_offset_r13, bref, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(unpack_integer(sc_mcch_first_sf_r13, bref, (uint8_t)0u, (uint8_t)9u)); + if (sc_mcch_dur_r13_present) { + HANDLE_CODE(unpack_integer(sc_mcch_dur_r13, bref, (uint8_t)2u, (uint8_t)9u)); + } + HANDLE_CODE(sc_mcch_mod_period_r13.unpack(bref)); if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - return SRSASN_SUCCESS; -} -void sib_pos_r15_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("assistanceDataSIB-Element-r15", assist_data_sib_elem_r15.to_string()); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - j.end_obj(); -} - -// SystemInformationBlockType1-v8h0-IEs ::= SEQUENCE -SRSASN_CODE sib_type1_v8h0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(multi_band_info_list_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + if (ext) { + ext_groups_unpacker_guard group_flags(2); + group_flags.unpack(bref); - if (multi_band_info_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer(1, 64))); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type1_v8h0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(multi_band_info_list_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + bool br_bcch_cfg_r14_present; + HANDLE_CODE(bref.unpack(br_bcch_cfg_r14_present, 1)); + br_bcch_cfg_r14.set_present(br_bcch_cfg_r14_present); + bool sc_mcch_sched_info_r14_present; + HANDLE_CODE(bref.unpack(sc_mcch_sched_info_r14_present, 1)); + sc_mcch_sched_info_r14.set_present(sc_mcch_sched_info_r14_present); + HANDLE_CODE(bref.unpack(pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present, 1)); + HANDLE_CODE(bref.unpack(pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present, 1)); + if (br_bcch_cfg_r14.is_present()) { + HANDLE_CODE(unpack_integer(br_bcch_cfg_r14->mpdcch_nb_sc_mcch_r14, bref, (uint8_t)1u, (uint8_t)16u)); + HANDLE_CODE(br_bcch_cfg_r14->mpdcch_num_repeat_sc_mcch_r14.unpack(bref)); + HANDLE_CODE(br_bcch_cfg_r14->mpdcch_start_sf_sc_mcch_r14.unpack(bref)); + HANDLE_CODE(br_bcch_cfg_r14->mpdcch_pdsch_hop_cfg_sc_mcch_r14.unpack(bref)); + HANDLE_CODE(unpack_integer(br_bcch_cfg_r14->sc_mcch_carrier_freq_r14, bref, (uint32_t)0u, (uint32_t)262143u)); + HANDLE_CODE(unpack_integer(br_bcch_cfg_r14->sc_mcch_offset_br_r14, bref, (uint8_t)0u, (uint8_t)10u)); + HANDLE_CODE(br_bcch_cfg_r14->sc_mcch_repeat_period_br_r14.unpack(bref)); + HANDLE_CODE(br_bcch_cfg_r14->sc_mcch_mod_period_br_r14.unpack(bref)); + } + if (sc_mcch_sched_info_r14.is_present()) { + HANDLE_CODE(sc_mcch_sched_info_r14->unpack(bref)); + } + if (pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present) { + HANDLE_CODE(pdsch_max_num_repeat_cemode_a_sc_mtch_r14.unpack(bref)); + } + if (pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present) { + HANDLE_CODE(pdsch_max_num_repeat_cemode_b_sc_mtch_r14.unpack(bref)); + } + } + if (group_flags[1]) { + varlength_field_unpack_guard varlen_scope(bref, false); - if (multi_band_info_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer(1, 64))); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + HANDLE_CODE(bref.unpack(sc_mcch_repeat_period_v1470_present, 1)); + HANDLE_CODE(bref.unpack(sc_mcch_mod_period_v1470_present, 1)); + } } - return SRSASN_SUCCESS; } -void sib_type1_v8h0_ies_s::to_json(json_writer& j) const +void sib_type20_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (multi_band_info_list_present) { - j.start_array("multiBandInfoList"); - for (const auto& e1 : multi_band_info_list) { - j.write_int(e1); - } - j.end_array(); + j.write_str("sc-mcch-RepetitionPeriod-r13", sc_mcch_repeat_period_r13.to_string()); + j.write_int("sc-mcch-Offset-r13", sc_mcch_offset_r13); + j.write_int("sc-mcch-FirstSubframe-r13", sc_mcch_first_sf_r13); + if (sc_mcch_dur_r13_present) { + j.write_int("sc-mcch-duration-r13", sc_mcch_dur_r13); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + j.write_str("sc-mcch-ModificationPeriod-r13", sc_mcch_mod_period_r13.to_string()); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (ext) { + if (br_bcch_cfg_r14.is_present()) { + j.write_fieldname("br-BCCH-Config-r14"); + j.start_obj(); + j.write_str("dummy", "rf1"); + j.write_str("dummy2", "rf1"); + j.write_int("mpdcch-Narrowband-SC-MCCH-r14", br_bcch_cfg_r14->mpdcch_nb_sc_mcch_r14); + j.write_str("mpdcch-NumRepetition-SC-MCCH-r14", br_bcch_cfg_r14->mpdcch_num_repeat_sc_mcch_r14.to_string()); + j.write_fieldname("mpdcch-StartSF-SC-MCCH-r14"); + br_bcch_cfg_r14->mpdcch_start_sf_sc_mcch_r14.to_json(j); + j.write_str("mpdcch-PDSCH-HoppingConfig-SC-MCCH-r14", + br_bcch_cfg_r14->mpdcch_pdsch_hop_cfg_sc_mcch_r14.to_string()); + j.write_int("sc-mcch-CarrierFreq-r14", br_bcch_cfg_r14->sc_mcch_carrier_freq_r14); + j.write_int("sc-mcch-Offset-BR-r14", br_bcch_cfg_r14->sc_mcch_offset_br_r14); + j.write_str("sc-mcch-RepetitionPeriod-BR-r14", br_bcch_cfg_r14->sc_mcch_repeat_period_br_r14.to_string()); + j.write_str("sc-mcch-ModificationPeriod-BR-r14", br_bcch_cfg_r14->sc_mcch_mod_period_br_r14.to_string()); + j.end_obj(); + } + if (sc_mcch_sched_info_r14.is_present()) { + j.write_fieldname("sc-mcch-SchedulingInfo-r14"); + sc_mcch_sched_info_r14->to_json(j); + } + if (pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present) { + j.write_str("pdsch-maxNumRepetitionCEmodeA-SC-MTCH-r14", pdsch_max_num_repeat_cemode_a_sc_mtch_r14.to_string()); + } + if (pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present) { + j.write_str("pdsch-maxNumRepetitionCEmodeB-SC-MTCH-r14", pdsch_max_num_repeat_cemode_b_sc_mtch_r14.to_string()); + } + if (sc_mcch_repeat_period_v1470_present) { + j.write_str("sc-mcch-RepetitionPeriod-v1470", "rf1"); + } + if (sc_mcch_mod_period_v1470_present) { + j.write_str("sc-mcch-ModificationPeriod-v1470", "rf1"); + } } j.end_obj(); } -// SystemInformationBlockType10 ::= SEQUENCE -SRSASN_CODE sib_type10_s::pack(bit_ref& bref) const +std::string sib_type20_r13_s::sc_mcch_repeat_period_r13_opts::to_string() const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(dummy_present, 1)); - - HANDLE_CODE(msg_id.pack(bref)); - HANDLE_CODE(serial_num.pack(bref)); - HANDLE_CODE(warning_type.pack(bref)); - if (dummy_present) { - HANDLE_CODE(dummy.pack(bref)); - } - - if (ext) { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - } - return SRSASN_SUCCESS; + static const char* options[] = {"rf2", "rf4", "rf8", "rf16", "rf32", "rf64", "rf128", "rf256"}; + return convert_enum_idx(options, 8, value, "sib_type20_r13_s::sc_mcch_repeat_period_r13_e_"); } -SRSASN_CODE sib_type10_s::unpack(cbit_ref& bref) +uint16_t sib_type20_r13_s::sc_mcch_repeat_period_r13_opts::to_number() const { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(dummy_present, 1)); - - HANDLE_CODE(msg_id.unpack(bref)); - HANDLE_CODE(serial_num.unpack(bref)); - HANDLE_CODE(warning_type.unpack(bref)); - if (dummy_present) { - HANDLE_CODE(dummy.unpack(bref)); - } - - if (ext) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + static const uint16_t options[] = {2, 4, 8, 16, 32, 64, 128, 256}; + return map_enum_number(options, 8, value, "sib_type20_r13_s::sc_mcch_repeat_period_r13_e_"); +} - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - } - return SRSASN_SUCCESS; +std::string sib_type20_r13_s::sc_mcch_mod_period_r13_opts::to_string() const +{ + static const char* options[] = {"rf2", + "rf4", + "rf8", + "rf16", + "rf32", + "rf64", + "rf128", + "rf256", + "rf512", + "rf1024", + "r2048", + "rf4096", + "rf8192", + "rf16384", + "rf32768", + "rf65536"}; + return convert_enum_idx(options, 16, value, "sib_type20_r13_s::sc_mcch_mod_period_r13_e_"); } -void sib_type10_s::to_json(json_writer& j) const +uint32_t sib_type20_r13_s::sc_mcch_mod_period_r13_opts::to_number() const { - j.start_obj(); - j.write_str("messageIdentifier", msg_id.to_string()); - j.write_str("serialNumber", serial_num.to_string()); - j.write_str("warningType", warning_type.to_string()); - if (dummy_present) { - j.write_str("dummy", dummy.to_string()); - } - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - } - j.end_obj(); + static const uint32_t options[] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536}; + return map_enum_number(options, 16, value, "sib_type20_r13_s::sc_mcch_mod_period_r13_e_"); } -// SystemInformationBlockType11 ::= SEQUENCE -SRSASN_CODE sib_type11_s::pack(bit_ref& bref) const +std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_num_repeat_sc_mcch_r14_opts::to_string() const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(data_coding_scheme_present, 1)); - - HANDLE_CODE(msg_id.pack(bref)); - HANDLE_CODE(serial_num.pack(bref)); - HANDLE_CODE(warning_msg_segment_type.pack(bref)); - HANDLE_CODE(pack_integer(bref, warning_msg_segment_num, (uint8_t)0u, (uint8_t)63u)); - HANDLE_CODE(warning_msg_segment.pack(bref)); - if (data_coding_scheme_present) { - HANDLE_CODE(data_coding_scheme.pack(bref)); - } - - if (ext) { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - } - return SRSASN_SUCCESS; + static const char* options[] = {"r1", "r2", "r4", "r8", "r16", "r32", "r64", "r128", "r256"}; + return convert_enum_idx(options, 9, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_num_repeat_sc_mcch_r14_e_"); } -SRSASN_CODE sib_type11_s::unpack(cbit_ref& bref) +uint16_t sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_num_repeat_sc_mcch_r14_opts::to_number() const { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(data_coding_scheme_present, 1)); - - HANDLE_CODE(msg_id.unpack(bref)); - HANDLE_CODE(serial_num.unpack(bref)); - HANDLE_CODE(warning_msg_segment_type.unpack(bref)); - HANDLE_CODE(unpack_integer(warning_msg_segment_num, bref, (uint8_t)0u, (uint8_t)63u)); - HANDLE_CODE(warning_msg_segment.unpack(bref)); - if (data_coding_scheme_present) { - HANDLE_CODE(data_coding_scheme.unpack(bref)); - } - - if (ext) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - } - return SRSASN_SUCCESS; + static const uint16_t options[] = {1, 2, 4, 8, 16, 32, 64, 128, 256}; + return map_enum_number(options, 9, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_num_repeat_sc_mcch_r14_e_"); } -void sib_type11_s::to_json(json_writer& j) const + +void sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::destroy_() {} +void sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::set(types::options e) { - j.start_obj(); - j.write_str("messageIdentifier", msg_id.to_string()); - j.write_str("serialNumber", serial_num.to_string()); - j.write_str("warningMessageSegmentType", warning_msg_segment_type.to_string()); - j.write_int("warningMessageSegmentNumber", warning_msg_segment_num); - j.write_str("warningMessageSegment", warning_msg_segment.to_string()); - if (data_coding_scheme_present) { - j.write_str("dataCodingScheme", data_coding_scheme.to_string()); + destroy_(); + type_ = e; +} +sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::mpdcch_start_sf_sc_mcch_r14_c_( + const sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_& other) +{ + type_ = other.type(); + switch (type_) { + case types::fdd_r14: + c.init(other.c.get()); + break; + case types::tdd_r14: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); } - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } +} +sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_& +sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::operator=( + const sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::fdd_r14: + c.set(other.c.get()); + break; + case types::tdd_r14: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); + } + + return *this; +} +void sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::fdd_r14: + j.write_str("fdd-r14", c.get().to_string()); + break; + case types::tdd_r14: + j.write_str("tdd-r14", c.get().to_string()); + break; + default: + log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); } j.end_obj(); } +SRSASN_CODE sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::fdd_r14: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::tdd_r14: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::fdd_r14: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::tdd_r14: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} -std::string sib_type11_s::warning_msg_segment_type_opts::to_string() const +std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_opts::to_string() const { - static const char* options[] = {"notLastSegment", "lastSegment"}; - return convert_enum_idx(options, 2, value, "sib_type11_s::warning_msg_segment_type_e_"); + static const char* options[] = {"v1", "v1dot5", "v2", "v2dot5", "v4", "v5", "v8", "v10"}; + return convert_enum_idx( + options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_e_"); +} +float sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_opts::to_number() const +{ + static const float options[] = {1.0, 1.5, 2.0, 2.5, 4.0, 5.0, 8.0, 10.0}; + return map_enum_number( + options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_e_"); +} +std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_opts::to_number_string() const +{ + static const char* options[] = {"1", "1.5", "2", "2.5", "4", "5", "8", "10"}; + return convert_enum_idx( + options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_e_"); } -// SystemInformationBlockType12-r9 ::= SEQUENCE -SRSASN_CODE sib_type12_r9_s::pack(bit_ref& bref) const +std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::tdd_r14_opts::to_string() const +{ + static const char* options[] = {"v1", "v2", "v4", "v5", "v8", "v10", "v20"}; + return convert_enum_idx( + options, 7, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::tdd_r14_e_"); +} +uint8_t sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::tdd_r14_opts::to_number() const +{ + static const uint8_t options[] = {1, 2, 4, 5, 8, 10, 20}; + return map_enum_number( + options, 7, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::tdd_r14_e_"); +} + +std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_pdsch_hop_cfg_sc_mcch_r14_opts::to_string() const +{ + static const char* options[] = {"off", "ce-ModeA", "ce-ModeB"}; + return convert_enum_idx( + options, 3, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_pdsch_hop_cfg_sc_mcch_r14_e_"); +} + +std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_repeat_period_br_r14_opts::to_string() const +{ + static const char* options[] = {"rf32", "rf128", "rf512", "rf1024", "rf2048", "rf4096", "rf8192", "rf16384"}; + return convert_enum_idx(options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_repeat_period_br_r14_e_"); +} +uint16_t sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_repeat_period_br_r14_opts::to_number() const +{ + static const uint16_t options[] = {32, 128, 512, 1024, 2048, 4096, 8192, 16384}; + return map_enum_number(options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_repeat_period_br_r14_e_"); +} + +std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_mod_period_br_r14_opts::to_string() const +{ + static const char* options[] = {"rf32", + "rf128", + "rf256", + "rf512", + "rf1024", + "rf2048", + "rf4096", + "rf8192", + "rf16384", + "rf32768", + "rf65536", + "rf131072", + "rf262144", + "rf524288", + "rf1048576"}; + return convert_enum_idx(options, 15, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_mod_period_br_r14_e_"); +} +uint32_t sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_mod_period_br_r14_opts::to_number() const +{ + static const uint32_t options[] = { + 32, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576}; + return map_enum_number(options, 15, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_mod_period_br_r14_e_"); +} + +std::string sib_type20_r13_s::pdsch_max_num_repeat_cemode_a_sc_mtch_r14_opts::to_string() const +{ + static const char* options[] = {"r16", "r32"}; + return convert_enum_idx(options, 2, value, "sib_type20_r13_s::pdsch_max_num_repeat_cemode_a_sc_mtch_r14_e_"); +} +uint8_t sib_type20_r13_s::pdsch_max_num_repeat_cemode_a_sc_mtch_r14_opts::to_number() const +{ + static const uint8_t options[] = {16, 32}; + return map_enum_number(options, 2, value, "sib_type20_r13_s::pdsch_max_num_repeat_cemode_a_sc_mtch_r14_e_"); +} + +std::string sib_type20_r13_s::pdsch_max_num_repeat_cemode_b_sc_mtch_r14_opts::to_string() const +{ + static const char* options[] = {"r192", "r256", "r384", "r512", "r768", "r1024", "r1536", "r2048"}; + return convert_enum_idx(options, 8, value, "sib_type20_r13_s::pdsch_max_num_repeat_cemode_b_sc_mtch_r14_e_"); +} +uint16_t sib_type20_r13_s::pdsch_max_num_repeat_cemode_b_sc_mtch_r14_opts::to_number() const +{ + static const uint16_t options[] = {192, 256, 384, 512, 768, 1024, 1536, 2048}; + return map_enum_number(options, 8, value, "sib_type20_r13_s::pdsch_max_num_repeat_cemode_b_sc_mtch_r14_e_"); +} + +// SystemInformationBlockType21-r14 ::= SEQUENCE +SRSASN_CODE sib_type21_r14_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(data_coding_scheme_r9_present, 1)); + HANDLE_CODE(bref.pack(sl_v2x_cfg_common_r14_present, 1)); HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(msg_id_r9.pack(bref)); - HANDLE_CODE(serial_num_r9.pack(bref)); - HANDLE_CODE(warning_msg_segment_type_r9.pack(bref)); - HANDLE_CODE(pack_integer(bref, warning_msg_segment_num_r9, (uint8_t)0u, (uint8_t)63u)); - HANDLE_CODE(warning_msg_segment_r9.pack(bref)); - if (data_coding_scheme_r9_present) { - HANDLE_CODE(data_coding_scheme_r9.pack(bref)); + if (sl_v2x_cfg_common_r14_present) { + HANDLE_CODE(sl_v2x_cfg_common_r14.pack(bref)); } if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.pack(bref)); } - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= warning_area_coordinates_segment_r15_present; - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(warning_area_coordinates_segment_r15_present, 1)); - if (warning_area_coordinates_segment_r15_present) { - HANDLE_CODE(warning_area_coordinates_segment_r15.pack(bref)); - } - } - } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type12_r9_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type21_r14_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(data_coding_scheme_r9_present, 1)); + HANDLE_CODE(bref.unpack(sl_v2x_cfg_common_r14_present, 1)); HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(msg_id_r9.unpack(bref)); - HANDLE_CODE(serial_num_r9.unpack(bref)); - HANDLE_CODE(warning_msg_segment_type_r9.unpack(bref)); - HANDLE_CODE(unpack_integer(warning_msg_segment_num_r9, bref, (uint8_t)0u, (uint8_t)63u)); - HANDLE_CODE(warning_msg_segment_r9.unpack(bref)); - if (data_coding_scheme_r9_present) { - HANDLE_CODE(data_coding_scheme_r9.unpack(bref)); + if (sl_v2x_cfg_common_r14_present) { + HANDLE_CODE(sl_v2x_cfg_common_r14.unpack(bref)); } if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - if (ext) { - ext_groups_unpacker_guard group_flags(1); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(warning_area_coordinates_segment_r15_present, 1)); - if (warning_area_coordinates_segment_r15_present) { - HANDLE_CODE(warning_area_coordinates_segment_r15.unpack(bref)); - } - } - } return SRSASN_SUCCESS; } -void sib_type12_r9_s::to_json(json_writer& j) const +void sib_type21_r14_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("messageIdentifier-r9", msg_id_r9.to_string()); - j.write_str("serialNumber-r9", serial_num_r9.to_string()); - j.write_str("warningMessageSegmentType-r9", warning_msg_segment_type_r9.to_string()); - j.write_int("warningMessageSegmentNumber-r9", warning_msg_segment_num_r9); - j.write_str("warningMessageSegment-r9", warning_msg_segment_r9.to_string()); - if (data_coding_scheme_r9_present) { - j.write_str("dataCodingScheme-r9", data_coding_scheme_r9.to_string()); + if (sl_v2x_cfg_common_r14_present) { + j.write_fieldname("sl-V2X-ConfigCommon-r14"); + sl_v2x_cfg_common_r14.to_json(j); } if (late_non_crit_ext_present) { j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - if (ext) { - if (warning_area_coordinates_segment_r15_present) { - j.write_str("warningAreaCoordinatesSegment-r15", warning_area_coordinates_segment_r15.to_string()); - } - } j.end_obj(); } -std::string sib_type12_r9_s::warning_msg_segment_type_r9_opts::to_string() const -{ - static const char* options[] = {"notLastSegment", "lastSegment"}; - return convert_enum_idx(options, 2, value, "sib_type12_r9_s::warning_msg_segment_type_r9_e_"); -} - -// SystemInformationBlockType13-r9 ::= SEQUENCE -SRSASN_CODE sib_type13_r9_s::pack(bit_ref& bref) const +// SystemInformationBlockType24-r15 ::= SEQUENCE +SRSASN_CODE sib_type24_r15_s::pack(bit_ref& bref) const { bref.pack(ext, 1); + HANDLE_CODE(bref.pack(carrier_freq_list_nr_r15_present, 1)); + HANDLE_CODE(bref.pack(t_resel_nr_sf_r15_present, 1)); HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(pack_dyn_seq_of(bref, mbsfn_area_info_list_r9, 1, 8)); - HANDLE_CODE(notif_cfg_r9.pack(bref)); + if (carrier_freq_list_nr_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freq_list_nr_r15, 1, 8)); + } + HANDLE_CODE(pack_integer(bref, t_resel_nr_r15, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_nr_sf_r15_present) { + HANDLE_CODE(t_resel_nr_sf_r15.pack(bref)); + } if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.pack(bref)); } - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= notif_cfg_v1430.is_present(); - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(notif_cfg_v1430.is_present(), 1)); - if (notif_cfg_v1430.is_present()) { - HANDLE_CODE(notif_cfg_v1430->pack(bref)); - } - } - } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type13_r9_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type24_r15_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(carrier_freq_list_nr_r15_present, 1)); + HANDLE_CODE(bref.unpack(t_resel_nr_sf_r15_present, 1)); HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(mbsfn_area_info_list_r9, bref, 1, 8)); - HANDLE_CODE(notif_cfg_r9.unpack(bref)); + if (carrier_freq_list_nr_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(carrier_freq_list_nr_r15, bref, 1, 8)); + } + HANDLE_CODE(unpack_integer(t_resel_nr_r15, bref, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_nr_sf_r15_present) { + HANDLE_CODE(t_resel_nr_sf_r15.unpack(bref)); + } if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - if (ext) { - ext_groups_unpacker_guard group_flags(1); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool notif_cfg_v1430_present; - HANDLE_CODE(bref.unpack(notif_cfg_v1430_present, 1)); - notif_cfg_v1430.set_present(notif_cfg_v1430_present); - if (notif_cfg_v1430.is_present()) { - HANDLE_CODE(notif_cfg_v1430->unpack(bref)); - } - } - } return SRSASN_SUCCESS; } -void sib_type13_r9_s::to_json(json_writer& j) const +void sib_type24_r15_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("mbsfn-AreaInfoList-r9"); - for (const auto& e1 : mbsfn_area_info_list_r9) { - e1.to_json(j); + if (carrier_freq_list_nr_r15_present) { + j.start_array("carrierFreqListNR-r15"); + for (const auto& e1 : carrier_freq_list_nr_r15) { + e1.to_json(j); + } + j.end_array(); + } + j.write_int("t-ReselectionNR-r15", t_resel_nr_r15); + if (t_resel_nr_sf_r15_present) { + j.write_fieldname("t-ReselectionNR-SF-r15"); + t_resel_nr_sf_r15.to_json(j); } - j.end_array(); - j.write_fieldname("notificationConfig-r9"); - notif_cfg_r9.to_json(j); if (late_non_crit_ext_present) { j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - if (ext) { - if (notif_cfg_v1430.is_present()) { - j.write_fieldname("notificationConfig-v1430"); - notif_cfg_v1430->to_json(j); - } - } j.end_obj(); } -// SystemInformationBlockType14-r11 ::= SEQUENCE -SRSASN_CODE sib_type14_r11_s::pack(bit_ref& bref) const +// SystemInformationBlockType25-r15 ::= SEQUENCE +SRSASN_CODE sib_type25_r15_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(eab_param_r11_present, 1)); + HANDLE_CODE(bref.pack(uac_barr_for_common_r15_present, 1)); + HANDLE_CODE(bref.pack(uac_barr_per_plmn_list_r15_present, 1)); + HANDLE_CODE(bref.pack(uac_ac1_select_assist_info_r15_present, 1)); HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - if (eab_param_r11_present) { - HANDLE_CODE(eab_param_r11.pack(bref)); + if (uac_barr_for_common_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, uac_barr_for_common_r15, 1, 63)); + } + if (uac_barr_per_plmn_list_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, uac_barr_per_plmn_list_r15, 1, 6)); + } + HANDLE_CODE(pack_dyn_seq_of(bref, uac_barr_info_set_list_r15, 1, 8)); + if (uac_ac1_select_assist_info_r15_present) { + HANDLE_CODE(uac_ac1_select_assist_info_r15.pack(bref)); } if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.pack(bref)); } - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= eab_per_rsrp_r15_present; - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(eab_per_rsrp_r15_present, 1)); - if (eab_per_rsrp_r15_present) { - HANDLE_CODE(eab_per_rsrp_r15.pack(bref)); - } - } - } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type14_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type25_r15_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(eab_param_r11_present, 1)); + HANDLE_CODE(bref.unpack(uac_barr_for_common_r15_present, 1)); + HANDLE_CODE(bref.unpack(uac_barr_per_plmn_list_r15_present, 1)); + HANDLE_CODE(bref.unpack(uac_ac1_select_assist_info_r15_present, 1)); HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - if (eab_param_r11_present) { - HANDLE_CODE(eab_param_r11.unpack(bref)); + if (uac_barr_for_common_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(uac_barr_for_common_r15, bref, 1, 63)); + } + if (uac_barr_per_plmn_list_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(uac_barr_per_plmn_list_r15, bref, 1, 6)); + } + HANDLE_CODE(unpack_dyn_seq_of(uac_barr_info_set_list_r15, bref, 1, 8)); + if (uac_ac1_select_assist_info_r15_present) { + HANDLE_CODE(uac_ac1_select_assist_info_r15.unpack(bref)); } if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - if (ext) { - ext_groups_unpacker_guard group_flags(1); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(eab_per_rsrp_r15_present, 1)); - if (eab_per_rsrp_r15_present) { - HANDLE_CODE(eab_per_rsrp_r15.unpack(bref)); - } - } - } return SRSASN_SUCCESS; } -void sib_type14_r11_s::to_json(json_writer& j) const +void sib_type25_r15_s::to_json(json_writer& j) const { j.start_obj(); - if (eab_param_r11_present) { - j.write_fieldname("eab-Param-r11"); - eab_param_r11.to_json(j); + if (uac_barr_for_common_r15_present) { + j.start_array("uac-BarringForCommon-r15"); + for (const auto& e1 : uac_barr_for_common_r15) { + e1.to_json(j); + } + j.end_array(); + } + if (uac_barr_per_plmn_list_r15_present) { + j.start_array("uac-BarringPerPLMN-List-r15"); + for (const auto& e1 : uac_barr_per_plmn_list_r15) { + e1.to_json(j); + } + j.end_array(); + } + j.start_array("uac-BarringInfoSetList-r15"); + for (const auto& e1 : uac_barr_info_set_list_r15) { + e1.to_json(j); + } + j.end_array(); + if (uac_ac1_select_assist_info_r15_present) { + j.write_fieldname("uac-AC1-SelectAssistInfo-r15"); + uac_ac1_select_assist_info_r15.to_json(j); } if (late_non_crit_ext_present) { j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - if (ext) { - if (eab_per_rsrp_r15_present) { - j.write_str("eab-PerRSRP-r15", eab_per_rsrp_r15.to_string()); - } - } j.end_obj(); } -void sib_type14_r11_s::eab_param_r11_c_::destroy_() +void sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::destroy_() { switch (type_) { - case types::eab_common_r11: - c.destroy(); - break; - case types::eab_per_plmn_list_r11: - c.destroy(); + case types::individual_plmn_list_r15: + c.destroy(); break; default: break; } } -void sib_type14_r11_s::eab_param_r11_c_::set(types::options e) +void sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::set(types::options e) { destroy_(); type_ = e; switch (type_) { - case types::eab_common_r11: - c.init(); + case types::plmn_common_r15: break; - case types::eab_per_plmn_list_r11: - c.init(); + case types::individual_plmn_list_r15: + c.init(); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); } } -sib_type14_r11_s::eab_param_r11_c_::eab_param_r11_c_(const sib_type14_r11_s::eab_param_r11_c_& other) +sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::uac_ac1_select_assist_info_r15_c_( + const sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_& other) { type_ = other.type(); switch (type_) { - case types::eab_common_r11: - c.init(other.c.get()); + case types::plmn_common_r15: + c.init(other.c.get()); break; - case types::eab_per_plmn_list_r11: - c.init(other.c.get()); + case types::individual_plmn_list_r15: + c.init(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); } } -sib_type14_r11_s::eab_param_r11_c_& -sib_type14_r11_s::eab_param_r11_c_::operator=(const sib_type14_r11_s::eab_param_r11_c_& other) +sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_& sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::operator=( + const sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_& other) { if (this == &other) { return *this; } set(other.type()); switch (type_) { - case types::eab_common_r11: - c.set(other.c.get()); + case types::plmn_common_r15: + c.set(other.c.get()); break; - case types::eab_per_plmn_list_r11: - c.set(other.c.get()); + case types::individual_plmn_list_r15: + c.set(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); } return *this; } -void sib_type14_r11_s::eab_param_r11_c_::to_json(json_writer& j) const +void sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::eab_common_r11: - j.write_fieldname("eab-Common-r11"); - c.get().to_json(j); + case types::plmn_common_r15: + j.write_str("plmnCommon-r15", c.get().to_string()); break; - case types::eab_per_plmn_list_r11: - j.start_array("eab-PerPLMN-List-r11"); - for (const auto& e1 : c.get()) { - e1.to_json(j); - } - j.end_array(); + case types::individual_plmn_list_r15: + j.start_array("individualPLMNList-r15"); + for (const auto& e1 : c.get()) { + j.write_str(e1.to_string()); + } + j.end_array(); break; default: - log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); } j.end_obj(); } -SRSASN_CODE sib_type14_r11_s::eab_param_r11_c_::pack(bit_ref& bref) const +SRSASN_CODE sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::eab_common_r11: - HANDLE_CODE(c.get().pack(bref)); + case types::plmn_common_r15: + HANDLE_CODE(c.get().pack(bref)); break; - case types::eab_per_plmn_list_r11: - HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 6)); + case types::individual_plmn_list_r15: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 2, 6)); break; default: - log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type14_r11_s::eab_param_r11_c_::unpack(cbit_ref& bref) +SRSASN_CODE sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::eab_common_r11: - HANDLE_CODE(c.get().unpack(bref)); + case types::plmn_common_r15: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::eab_per_plmn_list_r11: - HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 6)); + case types::individual_plmn_list_r15: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 2, 6)); break; default: - log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_"); + log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -std::string sib_type14_r11_s::eab_per_rsrp_r15_opts::to_string() const -{ - static const char* options[] = {"thresh0", "thresh1", "thresh2", "thresh3"}; - return convert_enum_idx(options, 4, value, "sib_type14_r11_s::eab_per_rsrp_r15_e_"); -} -uint8_t sib_type14_r11_s::eab_per_rsrp_r15_opts::to_number() const -{ - static const uint8_t options[] = {0, 1, 2, 3}; - return map_enum_number(options, 4, value, "sib_type14_r11_s::eab_per_rsrp_r15_e_"); -} - -// SystemInformationBlockType15-r11 ::= SEQUENCE -SRSASN_CODE sib_type15_r11_s::pack(bit_ref& bref) const +// SystemInformationBlockType26-r15 ::= SEQUENCE +SRSASN_CODE sib_type26_r15_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(mbms_sai_intra_freq_r11_present, 1)); - HANDLE_CODE(bref.pack(mbms_sai_inter_freq_list_r11_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(v2x_inter_freq_info_list_r15_present, 1)); + HANDLE_CODE(bref.pack(cbr_pssch_tx_cfg_list_r15_present, 1)); + HANDLE_CODE(bref.pack(v2x_packet_dupl_cfg_r15_present, 1)); + HANDLE_CODE(bref.pack(sync_freq_list_r15_present, 1)); + HANDLE_CODE(bref.pack(slss_tx_multi_freq_r15_present, 1)); + HANDLE_CODE(bref.pack(v2x_freq_sel_cfg_list_r15_present, 1)); + HANDLE_CODE(bref.pack(thresh_s_rssi_cbr_r15_present, 1)); - if (mbms_sai_intra_freq_r11_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, mbms_sai_intra_freq_r11, 1, 64, integer_packer(0, 65535))); + if (v2x_inter_freq_info_list_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, v2x_inter_freq_info_list_r15, 0, 7)); } - if (mbms_sai_inter_freq_list_r11_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, mbms_sai_inter_freq_list_r11, 1, 8)); + if (cbr_pssch_tx_cfg_list_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, cbr_pssch_tx_cfg_list_r15, 1, 8)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (v2x_packet_dupl_cfg_r15_present) { + HANDLE_CODE(v2x_packet_dupl_cfg_r15.pack(bref)); + } + if (sync_freq_list_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, sync_freq_list_r15, 1, 8, integer_packer(0, 262143))); + } + if (v2x_freq_sel_cfg_list_r15_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, v2x_freq_sel_cfg_list_r15, 1, 8)); + } + if (thresh_s_rssi_cbr_r15_present) { + HANDLE_CODE(pack_integer(bref, thresh_s_rssi_cbr_r15, (uint8_t)0u, (uint8_t)45u)); } if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= mbms_sai_inter_freq_list_v1140.is_present(); - group_flags[1] |= mbms_intra_freq_carrier_type_r14.is_present(); - group_flags[1] |= mbms_inter_freq_carrier_type_list_r14.is_present(); - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(mbms_sai_inter_freq_list_v1140.is_present(), 1)); - if (mbms_sai_inter_freq_list_v1140.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *mbms_sai_inter_freq_list_v1140, 1, 8)); - } - } - if (group_flags[1]) { - varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(mbms_intra_freq_carrier_type_r14.is_present(), 1)); - HANDLE_CODE(bref.pack(mbms_inter_freq_carrier_type_list_r14.is_present(), 1)); - if (mbms_intra_freq_carrier_type_r14.is_present()) { - HANDLE_CODE(mbms_intra_freq_carrier_type_r14->pack(bref)); - } - if (mbms_inter_freq_carrier_type_list_r14.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *mbms_inter_freq_carrier_type_list_r14, 1, 8)); - } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type15_r11_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type26_r15_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(mbms_sai_intra_freq_r11_present, 1)); - HANDLE_CODE(bref.unpack(mbms_sai_inter_freq_list_r11_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(v2x_inter_freq_info_list_r15_present, 1)); + HANDLE_CODE(bref.unpack(cbr_pssch_tx_cfg_list_r15_present, 1)); + HANDLE_CODE(bref.unpack(v2x_packet_dupl_cfg_r15_present, 1)); + HANDLE_CODE(bref.unpack(sync_freq_list_r15_present, 1)); + HANDLE_CODE(bref.unpack(slss_tx_multi_freq_r15_present, 1)); + HANDLE_CODE(bref.unpack(v2x_freq_sel_cfg_list_r15_present, 1)); + HANDLE_CODE(bref.unpack(thresh_s_rssi_cbr_r15_present, 1)); - if (mbms_sai_intra_freq_r11_present) { - HANDLE_CODE(unpack_dyn_seq_of(mbms_sai_intra_freq_r11, bref, 1, 64, integer_packer(0, 65535))); + if (v2x_inter_freq_info_list_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(v2x_inter_freq_info_list_r15, bref, 0, 7)); } - if (mbms_sai_inter_freq_list_r11_present) { - HANDLE_CODE(unpack_dyn_seq_of(mbms_sai_inter_freq_list_r11, bref, 1, 8)); + if (cbr_pssch_tx_cfg_list_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(cbr_pssch_tx_cfg_list_r15, bref, 1, 8)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); + if (v2x_packet_dupl_cfg_r15_present) { + HANDLE_CODE(v2x_packet_dupl_cfg_r15.unpack(bref)); + } + if (sync_freq_list_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(sync_freq_list_r15, bref, 1, 8, integer_packer(0, 262143))); + } + if (v2x_freq_sel_cfg_list_r15_present) { + HANDLE_CODE(unpack_dyn_seq_of(v2x_freq_sel_cfg_list_r15, bref, 1, 8)); + } + if (thresh_s_rssi_cbr_r15_present) { + HANDLE_CODE(unpack_integer(thresh_s_rssi_cbr_r15, bref, (uint8_t)0u, (uint8_t)45u)); } if (ext) { - ext_groups_unpacker_guard group_flags(2); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool mbms_sai_inter_freq_list_v1140_present; - HANDLE_CODE(bref.unpack(mbms_sai_inter_freq_list_v1140_present, 1)); - mbms_sai_inter_freq_list_v1140.set_present(mbms_sai_inter_freq_list_v1140_present); - if (mbms_sai_inter_freq_list_v1140.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*mbms_sai_inter_freq_list_v1140, bref, 1, 8)); - } - } - if (group_flags[1]) { - varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - bool mbms_intra_freq_carrier_type_r14_present; - HANDLE_CODE(bref.unpack(mbms_intra_freq_carrier_type_r14_present, 1)); - mbms_intra_freq_carrier_type_r14.set_present(mbms_intra_freq_carrier_type_r14_present); - bool mbms_inter_freq_carrier_type_list_r14_present; - HANDLE_CODE(bref.unpack(mbms_inter_freq_carrier_type_list_r14_present, 1)); - mbms_inter_freq_carrier_type_list_r14.set_present(mbms_inter_freq_carrier_type_list_r14_present); - if (mbms_intra_freq_carrier_type_r14.is_present()) { - HANDLE_CODE(mbms_intra_freq_carrier_type_r14->unpack(bref)); - } - if (mbms_inter_freq_carrier_type_list_r14.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*mbms_inter_freq_carrier_type_list_r14, bref, 1, 8)); - } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } } return SRSASN_SUCCESS; } -void sib_type15_r11_s::to_json(json_writer& j) const +void sib_type26_r15_s::to_json(json_writer& j) const { j.start_obj(); - if (mbms_sai_intra_freq_r11_present) { - j.start_array("mbms-SAI-IntraFreq-r11"); - for (const auto& e1 : mbms_sai_intra_freq_r11) { - j.write_int(e1); + if (v2x_inter_freq_info_list_r15_present) { + j.start_array("v2x-InterFreqInfoList-r15"); + for (const auto& e1 : v2x_inter_freq_info_list_r15) { + e1.to_json(j); } j.end_array(); } - if (mbms_sai_inter_freq_list_r11_present) { - j.start_array("mbms-SAI-InterFreqList-r11"); - for (const auto& e1 : mbms_sai_inter_freq_list_r11) { + if (cbr_pssch_tx_cfg_list_r15_present) { + j.start_array("cbr-pssch-TxConfigList-r15"); + for (const auto& e1 : cbr_pssch_tx_cfg_list_r15) { e1.to_json(j); } j.end_array(); } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + if (v2x_packet_dupl_cfg_r15_present) { + j.write_fieldname("v2x-PacketDuplicationConfig-r15"); + v2x_packet_dupl_cfg_r15.to_json(j); } - if (ext) { - if (mbms_sai_inter_freq_list_v1140.is_present()) { - j.start_array("mbms-SAI-InterFreqList-v1140"); - for (const auto& e1 : *mbms_sai_inter_freq_list_v1140) { - e1.to_json(j); - } - j.end_array(); + if (sync_freq_list_r15_present) { + j.start_array("syncFreqList-r15"); + for (const auto& e1 : sync_freq_list_r15) { + j.write_int(e1); } - if (mbms_intra_freq_carrier_type_r14.is_present()) { - j.write_fieldname("mbms-IntraFreqCarrierType-r14"); - mbms_intra_freq_carrier_type_r14->to_json(j); + j.end_array(); + } + if (slss_tx_multi_freq_r15_present) { + j.write_str("slss-TxMultiFreq-r15", "true"); + } + if (v2x_freq_sel_cfg_list_r15_present) { + j.start_array("v2x-FreqSelectionConfigList-r15"); + for (const auto& e1 : v2x_freq_sel_cfg_list_r15) { + e1.to_json(j); } - if (mbms_inter_freq_carrier_type_list_r14.is_present()) { - j.start_array("mbms-InterFreqCarrierTypeList-r14"); - for (const auto& e1 : *mbms_inter_freq_carrier_type_list_r14) { - e1.to_json(j); - } - j.end_array(); + j.end_array(); + } + if (thresh_s_rssi_cbr_r15_present) { + j.write_int("threshS-RSSI-CBR-r15", thresh_s_rssi_cbr_r15); + } + if (ext) { + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } } j.end_obj(); } -// SystemInformationBlockType16-r11 ::= SEQUENCE -SRSASN_CODE sib_type16_r11_s::pack(bit_ref& bref) const +// SystemInformationBlockType3 ::= SEQUENCE +SRSASN_CODE sib_type3_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(time_info_r11_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - if (time_info_r11_present) { - HANDLE_CODE(bref.pack(time_info_r11.day_light_saving_time_r11_present, 1)); - HANDLE_CODE(bref.pack(time_info_r11.leap_seconds_r11_present, 1)); - HANDLE_CODE(bref.pack(time_info_r11.local_time_offset_r11_present, 1)); - HANDLE_CODE(pack_integer(bref, time_info_r11.time_info_utc_r11, (uint64_t)0u, (uint64_t)549755813887u)); - if (time_info_r11.day_light_saving_time_r11_present) { - HANDLE_CODE(time_info_r11.day_light_saving_time_r11.pack(bref)); - } - if (time_info_r11.leap_seconds_r11_present) { - HANDLE_CODE(pack_integer(bref, time_info_r11.leap_seconds_r11, (int16_t)-127, (int16_t)128)); - } - if (time_info_r11.local_time_offset_r11_present) { - HANDLE_CODE(pack_integer(bref, time_info_r11.local_time_offset_r11, (int8_t)-63, (int8_t)64)); - } - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + HANDLE_CODE(bref.pack(cell_resel_info_common.speed_state_resel_pars_present, 1)); + HANDLE_CODE(cell_resel_info_common.q_hyst.pack(bref)); + if (cell_resel_info_common.speed_state_resel_pars_present) { + HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.mob_state_params.pack(bref)); + HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_medium.pack(bref)); + HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_high.pack(bref)); + } + HANDLE_CODE(bref.pack(cell_resel_serving_freq_info.s_non_intra_search_present, 1)); + if (cell_resel_serving_freq_info.s_non_intra_search_present) { + HANDLE_CODE(pack_integer(bref, cell_resel_serving_freq_info.s_non_intra_search, (uint8_t)0u, (uint8_t)31u)); + } + HANDLE_CODE(pack_integer(bref, cell_resel_serving_freq_info.thresh_serving_low, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, cell_resel_serving_freq_info.cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.p_max_present, 1)); + HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.s_intra_search_present, 1)); + HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.allowed_meas_bw_present, 1)); + HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.t_resel_eutra_sf_present, 1)); + HANDLE_CODE(pack_integer(bref, intra_freq_cell_resel_info.q_rx_lev_min, (int8_t)-70, (int8_t)-22)); + if (intra_freq_cell_resel_info.p_max_present) { + HANDLE_CODE(pack_integer(bref, intra_freq_cell_resel_info.p_max, (int8_t)-30, (int8_t)33)); + } + if (intra_freq_cell_resel_info.s_intra_search_present) { + HANDLE_CODE(pack_integer(bref, intra_freq_cell_resel_info.s_intra_search, (uint8_t)0u, (uint8_t)31u)); + } + if (intra_freq_cell_resel_info.allowed_meas_bw_present) { + HANDLE_CODE(intra_freq_cell_resel_info.allowed_meas_bw.pack(bref)); + } + HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.presence_ant_port1, 1)); + HANDLE_CODE(intra_freq_cell_resel_info.neigh_cell_cfg.pack(bref)); + HANDLE_CODE(pack_integer(bref, intra_freq_cell_resel_info.t_resel_eutra, (uint8_t)0u, (uint8_t)7u)); + if (intra_freq_cell_resel_info.t_resel_eutra_sf_present) { + HANDLE_CODE(intra_freq_cell_resel_info.t_resel_eutra_sf.pack(bref)); } if (ext) { ext_groups_packer_guard group_flags; - group_flags[0] |= time_ref_info_r15.is_present(); + group_flags[0] |= late_non_crit_ext_present; + group_flags[1] |= s_intra_search_v920.is_present(); + group_flags[1] |= s_non_intra_search_v920.is_present(); + group_flags[1] |= q_qual_min_r9_present; + group_flags[1] |= thresh_serving_low_q_r9_present; + group_flags[2] |= q_qual_min_wb_r11_present; + group_flags[3] |= q_qual_min_rsrq_on_all_symbols_r12_present; + group_flags[4] |= cell_resel_serving_freq_info_v1310.is_present(); + group_flags[4] |= redist_serving_info_r13.is_present(); + group_flags[4] |= cell_sel_info_ce_r13.is_present(); + group_flags[4] |= t_resel_eutra_ce_r13_present; + group_flags[5] |= cell_sel_info_ce1_r13.is_present(); + group_flags[6] |= cell_sel_info_ce1_v1360.is_present(); + group_flags[7] |= cell_resel_info_common_v1460.is_present(); + group_flags[8] |= cell_resel_info_hsdn_r15.is_present(); + group_flags[8] |= cell_sel_info_ce_v1530.is_present(); + group_flags[8] |= crs_intf_mitig_neigh_cells_ce_r15_present; group_flags.pack(bref); if (group_flags[0]) { varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.pack(time_ref_info_r15.is_present(), 1)); - if (time_ref_info_r15.is_present()) { - HANDLE_CODE(time_ref_info_r15->pack(bref)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(s_intra_search_v920.is_present(), 1)); + HANDLE_CODE(bref.pack(s_non_intra_search_v920.is_present(), 1)); + HANDLE_CODE(bref.pack(q_qual_min_r9_present, 1)); + HANDLE_CODE(bref.pack(thresh_serving_low_q_r9_present, 1)); + if (s_intra_search_v920.is_present()) { + HANDLE_CODE(pack_integer(bref, s_intra_search_v920->s_intra_search_p_r9, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, s_intra_search_v920->s_intra_search_q_r9, (uint8_t)0u, (uint8_t)31u)); + } + if (s_non_intra_search_v920.is_present()) { + HANDLE_CODE(pack_integer(bref, s_non_intra_search_v920->s_non_intra_search_p_r9, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(pack_integer(bref, s_non_intra_search_v920->s_non_intra_search_q_r9, (uint8_t)0u, (uint8_t)31u)); + } + if (q_qual_min_r9_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_r9, (int8_t)-34, (int8_t)-3)); + } + if (thresh_serving_low_q_r9_present) { + HANDLE_CODE(pack_integer(bref, thresh_serving_low_q_r9, (uint8_t)0u, (uint8_t)31u)); } } - } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type16_r11_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(time_info_r11_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + if (group_flags[2]) { + varlength_field_pack_guard varlen_scope(bref, false); - if (time_info_r11_present) { - HANDLE_CODE(bref.unpack(time_info_r11.day_light_saving_time_r11_present, 1)); - HANDLE_CODE(bref.unpack(time_info_r11.leap_seconds_r11_present, 1)); - HANDLE_CODE(bref.unpack(time_info_r11.local_time_offset_r11_present, 1)); - HANDLE_CODE(unpack_integer(time_info_r11.time_info_utc_r11, bref, (uint64_t)0u, (uint64_t)549755813887u)); - if (time_info_r11.day_light_saving_time_r11_present) { - HANDLE_CODE(time_info_r11.day_light_saving_time_r11.unpack(bref)); + HANDLE_CODE(bref.pack(q_qual_min_wb_r11_present, 1)); + if (q_qual_min_wb_r11_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_wb_r11, (int8_t)-34, (int8_t)-3)); + } } - if (time_info_r11.leap_seconds_r11_present) { - HANDLE_CODE(unpack_integer(time_info_r11.leap_seconds_r11, bref, (int16_t)-127, (int16_t)128)); + if (group_flags[3]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_on_all_symbols_r12, (int8_t)-34, (int8_t)-3)); + } } - if (time_info_r11.local_time_offset_r11_present) { - HANDLE_CODE(unpack_integer(time_info_r11.local_time_offset_r11, bref, (int8_t)-63, (int8_t)64)); + if (group_flags[4]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(cell_resel_serving_freq_info_v1310.is_present(), 1)); + HANDLE_CODE(bref.pack(redist_serving_info_r13.is_present(), 1)); + HANDLE_CODE(bref.pack(cell_sel_info_ce_r13.is_present(), 1)); + HANDLE_CODE(bref.pack(t_resel_eutra_ce_r13_present, 1)); + if (cell_resel_serving_freq_info_v1310.is_present()) { + HANDLE_CODE(cell_resel_serving_freq_info_v1310->pack(bref)); + } + if (redist_serving_info_r13.is_present()) { + HANDLE_CODE(redist_serving_info_r13->pack(bref)); + } + if (cell_sel_info_ce_r13.is_present()) { + HANDLE_CODE(cell_sel_info_ce_r13->pack(bref)); + } + if (t_resel_eutra_ce_r13_present) { + HANDLE_CODE(pack_integer(bref, t_resel_eutra_ce_r13, (uint8_t)0u, (uint8_t)15u)); + } } - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } + if (group_flags[5]) { + varlength_field_pack_guard varlen_scope(bref, false); - if (ext) { - ext_groups_unpacker_guard group_flags(1); - group_flags.unpack(bref); + HANDLE_CODE(bref.pack(cell_sel_info_ce1_r13.is_present(), 1)); + if (cell_sel_info_ce1_r13.is_present()) { + HANDLE_CODE(cell_sel_info_ce1_r13->pack(bref)); + } + } + if (group_flags[6]) { + varlength_field_pack_guard varlen_scope(bref, false); - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(bref.pack(cell_sel_info_ce1_v1360.is_present(), 1)); + if (cell_sel_info_ce1_v1360.is_present()) { + HANDLE_CODE(cell_sel_info_ce1_v1360->pack(bref)); + } + } + if (group_flags[7]) { + varlength_field_pack_guard varlen_scope(bref, false); - bool time_ref_info_r15_present; - HANDLE_CODE(bref.unpack(time_ref_info_r15_present, 1)); - time_ref_info_r15.set_present(time_ref_info_r15_present); - if (time_ref_info_r15.is_present()) { - HANDLE_CODE(time_ref_info_r15->unpack(bref)); + HANDLE_CODE(bref.pack(cell_resel_info_common_v1460.is_present(), 1)); + if (cell_resel_info_common_v1460.is_present()) { + HANDLE_CODE(cell_resel_info_common_v1460->pack(bref)); + } + } + if (group_flags[8]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(cell_resel_info_hsdn_r15.is_present(), 1)); + HANDLE_CODE(bref.pack(cell_sel_info_ce_v1530.is_present(), 1)); + HANDLE_CODE(bref.pack(crs_intf_mitig_neigh_cells_ce_r15_present, 1)); + if (cell_resel_info_hsdn_r15.is_present()) { + HANDLE_CODE(cell_resel_info_hsdn_r15->pack(bref)); + } + if (cell_sel_info_ce_v1530.is_present()) { + HANDLE_CODE(cell_sel_info_ce_v1530->pack(bref)); } } } return SRSASN_SUCCESS; } -void sib_type16_r11_s::to_json(json_writer& j) const +SRSASN_CODE sib_type3_s::unpack(cbit_ref& bref) { - j.start_obj(); - if (time_info_r11_present) { - j.write_fieldname("timeInfo-r11"); - j.start_obj(); - j.write_int("timeInfoUTC-r11", time_info_r11.time_info_utc_r11); - if (time_info_r11.day_light_saving_time_r11_present) { - j.write_str("dayLightSavingTime-r11", time_info_r11.day_light_saving_time_r11.to_string()); - } - if (time_info_r11.leap_seconds_r11_present) { - j.write_int("leapSeconds-r11", time_info_r11.leap_seconds_r11); - } - if (time_info_r11.local_time_offset_r11_present) { - j.write_int("localTimeOffset-r11", time_info_r11.local_time_offset_r11); - } - j.end_obj(); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(cell_resel_info_common.speed_state_resel_pars_present, 1)); + HANDLE_CODE(cell_resel_info_common.q_hyst.unpack(bref)); + if (cell_resel_info_common.speed_state_resel_pars_present) { + HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.mob_state_params.unpack(bref)); + HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_medium.unpack(bref)); + HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_high.unpack(bref)); } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + HANDLE_CODE(bref.unpack(cell_resel_serving_freq_info.s_non_intra_search_present, 1)); + if (cell_resel_serving_freq_info.s_non_intra_search_present) { + HANDLE_CODE(unpack_integer(cell_resel_serving_freq_info.s_non_intra_search, bref, (uint8_t)0u, (uint8_t)31u)); } - if (ext) { - if (time_ref_info_r15.is_present()) { - j.write_fieldname("timeReferenceInfo-r15"); - time_ref_info_r15->to_json(j); - } + HANDLE_CODE(unpack_integer(cell_resel_serving_freq_info.thresh_serving_low, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(cell_resel_serving_freq_info.cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.p_max_present, 1)); + HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.s_intra_search_present, 1)); + HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.allowed_meas_bw_present, 1)); + HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.t_resel_eutra_sf_present, 1)); + HANDLE_CODE(unpack_integer(intra_freq_cell_resel_info.q_rx_lev_min, bref, (int8_t)-70, (int8_t)-22)); + if (intra_freq_cell_resel_info.p_max_present) { + HANDLE_CODE(unpack_integer(intra_freq_cell_resel_info.p_max, bref, (int8_t)-30, (int8_t)33)); } - j.end_obj(); -} - -// SystemInformationBlockType17-r12 ::= SEQUENCE -SRSASN_CODE sib_type17_r12_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(wlan_offload_info_per_plmn_list_r12_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - if (wlan_offload_info_per_plmn_list_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, wlan_offload_info_per_plmn_list_r12, 1, 6)); + if (intra_freq_cell_resel_info.s_intra_search_present) { + HANDLE_CODE(unpack_integer(intra_freq_cell_resel_info.s_intra_search, bref, (uint8_t)0u, (uint8_t)31u)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (intra_freq_cell_resel_info.allowed_meas_bw_present) { + HANDLE_CODE(intra_freq_cell_resel_info.allowed_meas_bw.unpack(bref)); + } + HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.presence_ant_port1, 1)); + HANDLE_CODE(intra_freq_cell_resel_info.neigh_cell_cfg.unpack(bref)); + HANDLE_CODE(unpack_integer(intra_freq_cell_resel_info.t_resel_eutra, bref, (uint8_t)0u, (uint8_t)7u)); + if (intra_freq_cell_resel_info.t_resel_eutra_sf_present) { + HANDLE_CODE(intra_freq_cell_resel_info.t_resel_eutra_sf.unpack(bref)); } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type17_r12_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(wlan_offload_info_per_plmn_list_r12_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + if (ext) { + ext_groups_unpacker_guard group_flags(9); + group_flags.unpack(bref); - if (wlan_offload_info_per_plmn_list_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(wlan_offload_info_per_plmn_list_r12, bref, 1, 6)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); - return SRSASN_SUCCESS; -} -void sib_type17_r12_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (wlan_offload_info_per_plmn_list_r12_present) { - j.start_array("wlan-OffloadInfoPerPLMN-List-r12"); - for (const auto& e1 : wlan_offload_info_per_plmn_list_r12) { - e1.to_json(j); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); } - j.end_array(); - } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - j.end_obj(); -} - -// SystemInformationBlockType18-r12 ::= SEQUENCE -SRSASN_CODE sib_type18_r12_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(comm_cfg_r12_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + if (group_flags[1]) { + varlength_field_unpack_guard varlen_scope(bref, false); - if (comm_cfg_r12_present) { - HANDLE_CODE(bref.pack(comm_cfg_r12.comm_tx_pool_normal_common_r12_present, 1)); - HANDLE_CODE(bref.pack(comm_cfg_r12.comm_tx_pool_exceptional_r12_present, 1)); - HANDLE_CODE(bref.pack(comm_cfg_r12.comm_sync_cfg_r12_present, 1)); - HANDLE_CODE(pack_dyn_seq_of(bref, comm_cfg_r12.comm_rx_pool_r12, 1, 16)); - if (comm_cfg_r12.comm_tx_pool_normal_common_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, comm_cfg_r12.comm_tx_pool_normal_common_r12, 1, 4)); - } - if (comm_cfg_r12.comm_tx_pool_exceptional_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, comm_cfg_r12.comm_tx_pool_exceptional_r12, 1, 4)); - } - if (comm_cfg_r12.comm_sync_cfg_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, comm_cfg_r12.comm_sync_cfg_r12, 1, 16)); + bool s_intra_search_v920_present; + HANDLE_CODE(bref.unpack(s_intra_search_v920_present, 1)); + s_intra_search_v920.set_present(s_intra_search_v920_present); + bool s_non_intra_search_v920_present; + HANDLE_CODE(bref.unpack(s_non_intra_search_v920_present, 1)); + s_non_intra_search_v920.set_present(s_non_intra_search_v920_present); + HANDLE_CODE(bref.unpack(q_qual_min_r9_present, 1)); + HANDLE_CODE(bref.unpack(thresh_serving_low_q_r9_present, 1)); + if (s_intra_search_v920.is_present()) { + HANDLE_CODE(unpack_integer(s_intra_search_v920->s_intra_search_p_r9, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(s_intra_search_v920->s_intra_search_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); + } + if (s_non_intra_search_v920.is_present()) { + HANDLE_CODE(unpack_integer(s_non_intra_search_v920->s_non_intra_search_p_r9, bref, (uint8_t)0u, (uint8_t)31u)); + HANDLE_CODE(unpack_integer(s_non_intra_search_v920->s_non_intra_search_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); + } + if (q_qual_min_r9_present) { + HANDLE_CODE(unpack_integer(q_qual_min_r9, bref, (int8_t)-34, (int8_t)-3)); + } + if (thresh_serving_low_q_r9_present) { + HANDLE_CODE(unpack_integer(thresh_serving_low_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); + } } - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= comm_tx_pool_normal_common_ext_r13.is_present(); - group_flags[0] |= comm_tx_res_uc_req_allowed_r13_present; - group_flags[0] |= comm_tx_allow_relay_common_r13_present; - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); + if (group_flags[2]) { + varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.pack(comm_tx_pool_normal_common_ext_r13.is_present(), 1)); - HANDLE_CODE(bref.pack(comm_tx_res_uc_req_allowed_r13_present, 1)); - HANDLE_CODE(bref.pack(comm_tx_allow_relay_common_r13_present, 1)); - if (comm_tx_pool_normal_common_ext_r13.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *comm_tx_pool_normal_common_ext_r13, 1, 4)); + HANDLE_CODE(bref.unpack(q_qual_min_wb_r11_present, 1)); + if (q_qual_min_wb_r11_present) { + HANDLE_CODE(unpack_integer(q_qual_min_wb_r11, bref, (int8_t)-34, (int8_t)-3)); } } - } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type18_r12_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(comm_cfg_r12_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + if (group_flags[3]) { + varlength_field_unpack_guard varlen_scope(bref, false); - if (comm_cfg_r12_present) { - HANDLE_CODE(bref.unpack(comm_cfg_r12.comm_tx_pool_normal_common_r12_present, 1)); - HANDLE_CODE(bref.unpack(comm_cfg_r12.comm_tx_pool_exceptional_r12_present, 1)); - HANDLE_CODE(bref.unpack(comm_cfg_r12.comm_sync_cfg_r12_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(comm_cfg_r12.comm_rx_pool_r12, bref, 1, 16)); - if (comm_cfg_r12.comm_tx_pool_normal_common_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(comm_cfg_r12.comm_tx_pool_normal_common_r12, bref, 1, 4)); + HANDLE_CODE(bref.unpack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + HANDLE_CODE(unpack_integer(q_qual_min_rsrq_on_all_symbols_r12, bref, (int8_t)-34, (int8_t)-3)); + } } - if (comm_cfg_r12.comm_tx_pool_exceptional_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(comm_cfg_r12.comm_tx_pool_exceptional_r12, bref, 1, 4)); + if (group_flags[4]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool cell_resel_serving_freq_info_v1310_present; + HANDLE_CODE(bref.unpack(cell_resel_serving_freq_info_v1310_present, 1)); + cell_resel_serving_freq_info_v1310.set_present(cell_resel_serving_freq_info_v1310_present); + bool redist_serving_info_r13_present; + HANDLE_CODE(bref.unpack(redist_serving_info_r13_present, 1)); + redist_serving_info_r13.set_present(redist_serving_info_r13_present); + bool cell_sel_info_ce_r13_present; + HANDLE_CODE(bref.unpack(cell_sel_info_ce_r13_present, 1)); + cell_sel_info_ce_r13.set_present(cell_sel_info_ce_r13_present); + HANDLE_CODE(bref.unpack(t_resel_eutra_ce_r13_present, 1)); + if (cell_resel_serving_freq_info_v1310.is_present()) { + HANDLE_CODE(cell_resel_serving_freq_info_v1310->unpack(bref)); + } + if (redist_serving_info_r13.is_present()) { + HANDLE_CODE(redist_serving_info_r13->unpack(bref)); + } + if (cell_sel_info_ce_r13.is_present()) { + HANDLE_CODE(cell_sel_info_ce_r13->unpack(bref)); + } + if (t_resel_eutra_ce_r13_present) { + HANDLE_CODE(unpack_integer(t_resel_eutra_ce_r13, bref, (uint8_t)0u, (uint8_t)15u)); + } } - if (comm_cfg_r12.comm_sync_cfg_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(comm_cfg_r12.comm_sync_cfg_r12, bref, 1, 16)); + if (group_flags[5]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool cell_sel_info_ce1_r13_present; + HANDLE_CODE(bref.unpack(cell_sel_info_ce1_r13_present, 1)); + cell_sel_info_ce1_r13.set_present(cell_sel_info_ce1_r13_present); + if (cell_sel_info_ce1_r13.is_present()) { + HANDLE_CODE(cell_sel_info_ce1_r13->unpack(bref)); + } } - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } + if (group_flags[6]) { + varlength_field_unpack_guard varlen_scope(bref, false); - if (ext) { - ext_groups_unpacker_guard group_flags(1); - group_flags.unpack(bref); + bool cell_sel_info_ce1_v1360_present; + HANDLE_CODE(bref.unpack(cell_sel_info_ce1_v1360_present, 1)); + cell_sel_info_ce1_v1360.set_present(cell_sel_info_ce1_v1360_present); + if (cell_sel_info_ce1_v1360.is_present()) { + HANDLE_CODE(cell_sel_info_ce1_v1360->unpack(bref)); + } + } + if (group_flags[7]) { + varlength_field_unpack_guard varlen_scope(bref, false); - if (group_flags[0]) { + bool cell_resel_info_common_v1460_present; + HANDLE_CODE(bref.unpack(cell_resel_info_common_v1460_present, 1)); + cell_resel_info_common_v1460.set_present(cell_resel_info_common_v1460_present); + if (cell_resel_info_common_v1460.is_present()) { + HANDLE_CODE(cell_resel_info_common_v1460->unpack(bref)); + } + } + if (group_flags[8]) { varlength_field_unpack_guard varlen_scope(bref, false); - bool comm_tx_pool_normal_common_ext_r13_present; - HANDLE_CODE(bref.unpack(comm_tx_pool_normal_common_ext_r13_present, 1)); - comm_tx_pool_normal_common_ext_r13.set_present(comm_tx_pool_normal_common_ext_r13_present); - HANDLE_CODE(bref.unpack(comm_tx_res_uc_req_allowed_r13_present, 1)); - HANDLE_CODE(bref.unpack(comm_tx_allow_relay_common_r13_present, 1)); - if (comm_tx_pool_normal_common_ext_r13.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*comm_tx_pool_normal_common_ext_r13, bref, 1, 4)); + bool cell_resel_info_hsdn_r15_present; + HANDLE_CODE(bref.unpack(cell_resel_info_hsdn_r15_present, 1)); + cell_resel_info_hsdn_r15.set_present(cell_resel_info_hsdn_r15_present); + bool cell_sel_info_ce_v1530_present; + HANDLE_CODE(bref.unpack(cell_sel_info_ce_v1530_present, 1)); + cell_sel_info_ce_v1530.set_present(cell_sel_info_ce_v1530_present); + HANDLE_CODE(bref.unpack(crs_intf_mitig_neigh_cells_ce_r15_present, 1)); + if (cell_resel_info_hsdn_r15.is_present()) { + HANDLE_CODE(cell_resel_info_hsdn_r15->unpack(bref)); + } + if (cell_sel_info_ce_v1530.is_present()) { + HANDLE_CODE(cell_sel_info_ce_v1530->unpack(bref)); } } } return SRSASN_SUCCESS; } -void sib_type18_r12_s::to_json(json_writer& j) const +void sib_type3_s::to_json(json_writer& j) const { j.start_obj(); - if (comm_cfg_r12_present) { - j.write_fieldname("commConfig-r12"); + j.write_fieldname("cellReselectionInfoCommon"); + j.start_obj(); + j.write_str("q-Hyst", cell_resel_info_common.q_hyst.to_string()); + if (cell_resel_info_common.speed_state_resel_pars_present) { + j.write_fieldname("speedStateReselectionPars"); j.start_obj(); - j.start_array("commRxPool-r12"); - for (const auto& e1 : comm_cfg_r12.comm_rx_pool_r12) { - e1.to_json(j); - } - j.end_array(); - if (comm_cfg_r12.comm_tx_pool_normal_common_r12_present) { - j.start_array("commTxPoolNormalCommon-r12"); - for (const auto& e1 : comm_cfg_r12.comm_tx_pool_normal_common_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (comm_cfg_r12.comm_tx_pool_exceptional_r12_present) { - j.start_array("commTxPoolExceptional-r12"); - for (const auto& e1 : comm_cfg_r12.comm_tx_pool_exceptional_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (comm_cfg_r12.comm_sync_cfg_r12_present) { - j.start_array("commSyncConfig-r12"); - for (const auto& e1 : comm_cfg_r12.comm_sync_cfg_r12) { - e1.to_json(j); - } - j.end_array(); - } + j.write_fieldname("mobilityStateParameters"); + cell_resel_info_common.speed_state_resel_pars.mob_state_params.to_json(j); + j.write_fieldname("q-HystSF"); + j.start_obj(); + j.write_str("sf-Medium", cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_medium.to_string()); + j.write_str("sf-High", cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_high.to_string()); + j.end_obj(); j.end_obj(); } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (ext) { - if (comm_tx_pool_normal_common_ext_r13.is_present()) { - j.start_array("commTxPoolNormalCommonExt-r13"); - for (const auto& e1 : *comm_tx_pool_normal_common_ext_r13) { - e1.to_json(j); - } - j.end_array(); - } - if (comm_tx_res_uc_req_allowed_r13_present) { - j.write_str("commTxResourceUC-ReqAllowed-r13", "true"); - } - if (comm_tx_allow_relay_common_r13_present) { - j.write_str("commTxAllowRelayCommon-r13", "true"); - } + j.end_obj(); + j.write_fieldname("cellReselectionServingFreqInfo"); + j.start_obj(); + if (cell_resel_serving_freq_info.s_non_intra_search_present) { + j.write_int("s-NonIntraSearch", cell_resel_serving_freq_info.s_non_intra_search); } + j.write_int("threshServingLow", cell_resel_serving_freq_info.thresh_serving_low); + j.write_int("cellReselectionPriority", cell_resel_serving_freq_info.cell_resel_prio); j.end_obj(); -} - -// SystemInformationBlockType19-r12 ::= SEQUENCE -SRSASN_CODE sib_type19_r12_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(disc_cfg_r12_present, 1)); - HANDLE_CODE(bref.pack(disc_inter_freq_list_r12_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - if (disc_cfg_r12_present) { - HANDLE_CODE(bref.pack(disc_cfg_r12.disc_tx_pool_common_r12_present, 1)); - HANDLE_CODE(bref.pack(disc_cfg_r12.disc_tx_pwr_info_r12_present, 1)); - HANDLE_CODE(bref.pack(disc_cfg_r12.disc_sync_cfg_r12_present, 1)); - HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_r12.disc_rx_pool_r12, 1, 16)); - if (disc_cfg_r12.disc_tx_pool_common_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_r12.disc_tx_pool_common_r12, 1, 4)); + j.write_fieldname("intraFreqCellReselectionInfo"); + j.start_obj(); + j.write_int("q-RxLevMin", intra_freq_cell_resel_info.q_rx_lev_min); + if (intra_freq_cell_resel_info.p_max_present) { + j.write_int("p-Max", intra_freq_cell_resel_info.p_max); + } + if (intra_freq_cell_resel_info.s_intra_search_present) { + j.write_int("s-IntraSearch", intra_freq_cell_resel_info.s_intra_search); + } + if (intra_freq_cell_resel_info.allowed_meas_bw_present) { + j.write_str("allowedMeasBandwidth", intra_freq_cell_resel_info.allowed_meas_bw.to_string()); + } + j.write_bool("presenceAntennaPort1", intra_freq_cell_resel_info.presence_ant_port1); + j.write_str("neighCellConfig", intra_freq_cell_resel_info.neigh_cell_cfg.to_string()); + j.write_int("t-ReselectionEUTRA", intra_freq_cell_resel_info.t_resel_eutra); + if (intra_freq_cell_resel_info.t_resel_eutra_sf_present) { + j.write_fieldname("t-ReselectionEUTRA-SF"); + intra_freq_cell_resel_info.t_resel_eutra_sf.to_json(j); + } + j.end_obj(); + if (ext) { + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - if (disc_cfg_r12.disc_tx_pwr_info_r12_present) { - HANDLE_CODE( - pack_fixed_seq_of(bref, &(disc_cfg_r12.disc_tx_pwr_info_r12)[0], disc_cfg_r12.disc_tx_pwr_info_r12.size())); + if (s_intra_search_v920.is_present()) { + j.write_fieldname("s-IntraSearch-v920"); + j.start_obj(); + j.write_int("s-IntraSearchP-r9", s_intra_search_v920->s_intra_search_p_r9); + j.write_int("s-IntraSearchQ-r9", s_intra_search_v920->s_intra_search_q_r9); + j.end_obj(); } - if (disc_cfg_r12.disc_sync_cfg_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_r12.disc_sync_cfg_r12, 1, 16)); + if (s_non_intra_search_v920.is_present()) { + j.write_fieldname("s-NonIntraSearch-v920"); + j.start_obj(); + j.write_int("s-NonIntraSearchP-r9", s_non_intra_search_v920->s_non_intra_search_p_r9); + j.write_int("s-NonIntraSearchQ-r9", s_non_intra_search_v920->s_non_intra_search_q_r9); + j.end_obj(); + } + if (q_qual_min_r9_present) { + j.write_int("q-QualMin-r9", q_qual_min_r9); + } + if (thresh_serving_low_q_r9_present) { + j.write_int("threshServingLowQ-r9", thresh_serving_low_q_r9); + } + if (q_qual_min_wb_r11_present) { + j.write_int("q-QualMinWB-r11", q_qual_min_wb_r11); + } + if (q_qual_min_rsrq_on_all_symbols_r12_present) { + j.write_int("q-QualMinRSRQ-OnAllSymbols-r12", q_qual_min_rsrq_on_all_symbols_r12); + } + if (cell_resel_serving_freq_info_v1310.is_present()) { + j.write_fieldname("cellReselectionServingFreqInfo-v1310"); + cell_resel_serving_freq_info_v1310->to_json(j); + } + if (redist_serving_info_r13.is_present()) { + j.write_fieldname("redistributionServingInfo-r13"); + redist_serving_info_r13->to_json(j); + } + if (cell_sel_info_ce_r13.is_present()) { + j.write_fieldname("cellSelectionInfoCE-r13"); + cell_sel_info_ce_r13->to_json(j); + } + if (t_resel_eutra_ce_r13_present) { + j.write_int("t-ReselectionEUTRA-CE-r13", t_resel_eutra_ce_r13); + } + if (cell_sel_info_ce1_r13.is_present()) { + j.write_fieldname("cellSelectionInfoCE1-r13"); + cell_sel_info_ce1_r13->to_json(j); + } + if (cell_sel_info_ce1_v1360.is_present()) { + j.write_fieldname("cellSelectionInfoCE1-v1360"); + cell_sel_info_ce1_v1360->to_json(j); + } + if (cell_resel_info_common_v1460.is_present()) { + j.write_fieldname("cellReselectionInfoCommon-v1460"); + cell_resel_info_common_v1460->to_json(j); + } + if (cell_resel_info_hsdn_r15.is_present()) { + j.write_fieldname("cellReselectionInfoHSDN-r15"); + cell_resel_info_hsdn_r15->to_json(j); + } + if (cell_sel_info_ce_v1530.is_present()) { + j.write_fieldname("cellSelectionInfoCE-v1530"); + cell_sel_info_ce_v1530->to_json(j); + } + if (crs_intf_mitig_neigh_cells_ce_r15_present) { + j.write_str("crs-IntfMitigNeighCellsCE-r15", "enabled"); } } - if (disc_inter_freq_list_r12_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, disc_inter_freq_list_r12, 1, 8)); + j.end_obj(); +} + +std::string sib_type3_s::cell_resel_info_common_s_::q_hyst_opts::to_string() const +{ + static const char* options[] = {"dB0", + "dB1", + "dB2", + "dB3", + "dB4", + "dB5", + "dB6", + "dB8", + "dB10", + "dB12", + "dB14", + "dB16", + "dB18", + "dB20", + "dB22", + "dB24"}; + return convert_enum_idx(options, 16, value, "sib_type3_s::cell_resel_info_common_s_::q_hyst_e_"); +} +uint8_t sib_type3_s::cell_resel_info_common_s_::q_hyst_opts::to_number() const +{ + static const uint8_t options[] = {0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24}; + return map_enum_number(options, 16, value, "sib_type3_s::cell_resel_info_common_s_::q_hyst_e_"); +} + +std::string +sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_medium_opts::to_string() const +{ + static const char* options[] = {"dB-6", "dB-4", "dB-2", "dB0"}; + return convert_enum_idx( + options, + 4, + value, + "sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_medium_e_"); +} +int8_t +sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_medium_opts::to_number() const +{ + static const int8_t options[] = {-6, -4, -2, 0}; + return map_enum_number( + options, + 4, + value, + "sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_medium_e_"); +} + +std::string +sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_high_opts::to_string() const +{ + static const char* options[] = {"dB-6", "dB-4", "dB-2", "dB0"}; + return convert_enum_idx( + options, 4, value, "sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_high_e_"); +} +int8_t sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_high_opts::to_number() const +{ + static const int8_t options[] = {-6, -4, -2, 0}; + return map_enum_number( + options, 4, value, "sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_high_e_"); +} + +// SystemInformationBlockType4 ::= SEQUENCE +SRSASN_CODE sib_type4_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(intra_freq_neigh_cell_list_present, 1)); + HANDLE_CODE(bref.pack(intra_freq_black_cell_list_present, 1)); + HANDLE_CODE(bref.pack(csg_pci_range_present, 1)); + + if (intra_freq_neigh_cell_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, intra_freq_neigh_cell_list, 1, 16)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (intra_freq_black_cell_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, intra_freq_black_cell_list, 1, 16)); + } + if (csg_pci_range_present) { + HANDLE_CODE(csg_pci_range.pack(bref)); } if (ext) { ext_groups_packer_guard group_flags; - group_flags[0] |= disc_cfg_v1310.is_present(); - group_flags[0] |= disc_cfg_relay_r13.is_present(); - group_flags[0] |= disc_cfg_ps_minus13.is_present(); + group_flags[0] |= late_non_crit_ext_present; + group_flags[1] |= intra_freq_neigh_hsdn_cell_list_r15.is_present(); group_flags.pack(bref); if (group_flags[0]) { varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.pack(disc_cfg_v1310.is_present(), 1)); - HANDLE_CODE(bref.pack(disc_cfg_relay_r13.is_present(), 1)); - HANDLE_CODE(bref.pack(disc_cfg_ps_minus13.is_present(), 1)); - if (disc_cfg_v1310.is_present()) { - HANDLE_CODE(bref.pack(disc_cfg_v1310->disc_inter_freq_list_v1310_present, 1)); - HANDLE_CODE(bref.pack(disc_cfg_v1310->gap_requests_allowed_common_present, 1)); - if (disc_cfg_v1310->disc_inter_freq_list_v1310_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_v1310->disc_inter_freq_list_v1310, 1, 8)); - } - } - if (disc_cfg_relay_r13.is_present()) { - HANDLE_CODE(disc_cfg_relay_r13->relay_ue_cfg_r13.pack(bref)); - HANDLE_CODE(disc_cfg_relay_r13->remote_ue_cfg_r13.pack(bref)); - } - if (disc_cfg_ps_minus13.is_present()) { - HANDLE_CODE(bref.pack(disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present, 1)); - HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_ps_minus13->disc_rx_pool_ps_r13, 1, 16)); - if (disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13, 1, 4)); - } + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(intra_freq_neigh_hsdn_cell_list_r15.is_present(), 1)); + if (intra_freq_neigh_hsdn_cell_list_r15.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *intra_freq_neigh_hsdn_cell_list_r15, 1, 16)); } } } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type19_r12_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type4_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(disc_cfg_r12_present, 1)); - HANDLE_CODE(bref.unpack(disc_inter_freq_list_r12_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(intra_freq_neigh_cell_list_present, 1)); + HANDLE_CODE(bref.unpack(intra_freq_black_cell_list_present, 1)); + HANDLE_CODE(bref.unpack(csg_pci_range_present, 1)); - if (disc_cfg_r12_present) { - HANDLE_CODE(bref.unpack(disc_cfg_r12.disc_tx_pool_common_r12_present, 1)); - HANDLE_CODE(bref.unpack(disc_cfg_r12.disc_tx_pwr_info_r12_present, 1)); - HANDLE_CODE(bref.unpack(disc_cfg_r12.disc_sync_cfg_r12_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_r12.disc_rx_pool_r12, bref, 1, 16)); - if (disc_cfg_r12.disc_tx_pool_common_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_r12.disc_tx_pool_common_r12, bref, 1, 4)); - } - if (disc_cfg_r12.disc_tx_pwr_info_r12_present) { - HANDLE_CODE( - unpack_fixed_seq_of(&(disc_cfg_r12.disc_tx_pwr_info_r12)[0], bref, disc_cfg_r12.disc_tx_pwr_info_r12.size())); - } - if (disc_cfg_r12.disc_sync_cfg_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_r12.disc_sync_cfg_r12, bref, 1, 16)); - } + if (intra_freq_neigh_cell_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(intra_freq_neigh_cell_list, bref, 1, 16)); } - if (disc_inter_freq_list_r12_present) { - HANDLE_CODE(unpack_dyn_seq_of(disc_inter_freq_list_r12, bref, 1, 8)); + if (intra_freq_black_cell_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(intra_freq_black_cell_list, bref, 1, 16)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); + if (csg_pci_range_present) { + HANDLE_CODE(csg_pci_range.unpack(bref)); } if (ext) { - ext_groups_unpacker_guard group_flags(1); + ext_groups_unpacker_guard group_flags(2); group_flags.unpack(bref); if (group_flags[0]) { varlength_field_unpack_guard varlen_scope(bref, false); - bool disc_cfg_v1310_present; - HANDLE_CODE(bref.unpack(disc_cfg_v1310_present, 1)); - disc_cfg_v1310.set_present(disc_cfg_v1310_present); - bool disc_cfg_relay_r13_present; - HANDLE_CODE(bref.unpack(disc_cfg_relay_r13_present, 1)); - disc_cfg_relay_r13.set_present(disc_cfg_relay_r13_present); - bool disc_cfg_ps_minus13_present; - HANDLE_CODE(bref.unpack(disc_cfg_ps_minus13_present, 1)); - disc_cfg_ps_minus13.set_present(disc_cfg_ps_minus13_present); - if (disc_cfg_v1310.is_present()) { - HANDLE_CODE(bref.unpack(disc_cfg_v1310->disc_inter_freq_list_v1310_present, 1)); - HANDLE_CODE(bref.unpack(disc_cfg_v1310->gap_requests_allowed_common_present, 1)); - if (disc_cfg_v1310->disc_inter_freq_list_v1310_present) { - HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_v1310->disc_inter_freq_list_v1310, bref, 1, 8)); - } - } - if (disc_cfg_relay_r13.is_present()) { - HANDLE_CODE(disc_cfg_relay_r13->relay_ue_cfg_r13.unpack(bref)); - HANDLE_CODE(disc_cfg_relay_r13->remote_ue_cfg_r13.unpack(bref)); - } - if (disc_cfg_ps_minus13.is_present()) { - HANDLE_CODE(bref.unpack(disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_ps_minus13->disc_rx_pool_ps_r13, bref, 1, 16)); - if (disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present) { - HANDLE_CODE(unpack_dyn_seq_of(disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13, bref, 1, 4)); - } + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool intra_freq_neigh_hsdn_cell_list_r15_present; + HANDLE_CODE(bref.unpack(intra_freq_neigh_hsdn_cell_list_r15_present, 1)); + intra_freq_neigh_hsdn_cell_list_r15.set_present(intra_freq_neigh_hsdn_cell_list_r15_present); + if (intra_freq_neigh_hsdn_cell_list_r15.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*intra_freq_neigh_hsdn_cell_list_r15, bref, 1, 16)); } } } return SRSASN_SUCCESS; } -void sib_type19_r12_s::to_json(json_writer& j) const +void sib_type4_s::to_json(json_writer& j) const { j.start_obj(); - if (disc_cfg_r12_present) { - j.write_fieldname("discConfig-r12"); - j.start_obj(); - j.start_array("discRxPool-r12"); - for (const auto& e1 : disc_cfg_r12.disc_rx_pool_r12) { + if (intra_freq_neigh_cell_list_present) { + j.start_array("intraFreqNeighCellList"); + for (const auto& e1 : intra_freq_neigh_cell_list) { e1.to_json(j); } j.end_array(); - if (disc_cfg_r12.disc_tx_pool_common_r12_present) { - j.start_array("discTxPoolCommon-r12"); - for (const auto& e1 : disc_cfg_r12.disc_tx_pool_common_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (disc_cfg_r12.disc_tx_pwr_info_r12_present) { - j.start_array("discTxPowerInfo-r12"); - for (const auto& e1 : disc_cfg_r12.disc_tx_pwr_info_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (disc_cfg_r12.disc_sync_cfg_r12_present) { - j.start_array("discSyncConfig-r12"); - for (const auto& e1 : disc_cfg_r12.disc_sync_cfg_r12) { - e1.to_json(j); - } - j.end_array(); - } - j.end_obj(); } - if (disc_inter_freq_list_r12_present) { - j.start_array("discInterFreqList-r12"); - for (const auto& e1 : disc_inter_freq_list_r12) { + if (intra_freq_black_cell_list_present) { + j.start_array("intraFreqBlackCellList"); + for (const auto& e1 : intra_freq_black_cell_list) { e1.to_json(j); } j.end_array(); } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + if (csg_pci_range_present) { + j.write_fieldname("csg-PhysCellIdRange"); + csg_pci_range.to_json(j); } if (ext) { - if (disc_cfg_v1310.is_present()) { - j.write_fieldname("discConfig-v1310"); - j.start_obj(); - if (disc_cfg_v1310->disc_inter_freq_list_v1310_present) { - j.start_array("discInterFreqList-v1310"); - for (const auto& e1 : disc_cfg_v1310->disc_inter_freq_list_v1310) { - e1.to_json(j); - } - j.end_array(); - } - if (disc_cfg_v1310->gap_requests_allowed_common_present) { - j.write_str("gapRequestsAllowedCommon", "true"); - } - j.end_obj(); - } - if (disc_cfg_relay_r13.is_present()) { - j.write_fieldname("discConfigRelay-r13"); - j.start_obj(); - j.write_fieldname("relayUE-Config-r13"); - disc_cfg_relay_r13->relay_ue_cfg_r13.to_json(j); - j.write_fieldname("remoteUE-Config-r13"); - disc_cfg_relay_r13->remote_ue_cfg_r13.to_json(j); - j.end_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - if (disc_cfg_ps_minus13.is_present()) { - j.write_fieldname("discConfigPS-13"); - j.start_obj(); - j.start_array("discRxPoolPS-r13"); - for (const auto& e1 : disc_cfg_ps_minus13->disc_rx_pool_ps_r13) { + if (intra_freq_neigh_hsdn_cell_list_r15.is_present()) { + j.start_array("intraFreqNeighHSDN-CellList-r15"); + for (const auto& e1 : *intra_freq_neigh_hsdn_cell_list_r15) { e1.to_json(j); } j.end_array(); - if (disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13_present) { - j.start_array("discTxPoolPS-Common-r13"); - for (const auto& e1 : disc_cfg_ps_minus13->disc_tx_pool_ps_common_r13) { - e1.to_json(j); - } - j.end_array(); - } - j.end_obj(); } } j.end_obj(); } -// SystemInformationBlockType20-r13 ::= SEQUENCE -SRSASN_CODE sib_type20_r13_s::pack(bit_ref& bref) const +// SystemInformationBlockType5 ::= SEQUENCE +SRSASN_CODE sib_type5_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(sc_mcch_dur_r13_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - HANDLE_CODE(sc_mcch_repeat_period_r13.pack(bref)); - HANDLE_CODE(pack_integer(bref, sc_mcch_offset_r13, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(pack_integer(bref, sc_mcch_first_sf_r13, (uint8_t)0u, (uint8_t)9u)); - if (sc_mcch_dur_r13_present) { - HANDLE_CODE(pack_integer(bref, sc_mcch_dur_r13, (uint8_t)2u, (uint8_t)9u)); - } - HANDLE_CODE(sc_mcch_mod_period_r13.pack(bref)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list, 1, 8)); if (ext) { ext_groups_packer_guard group_flags; - group_flags[0] |= br_bcch_cfg_r14.is_present(); - group_flags[0] |= sc_mcch_sched_info_r14.is_present(); - group_flags[0] |= pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present; - group_flags[0] |= pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present; - group_flags[1] |= sc_mcch_repeat_period_v1470_present; - group_flags[1] |= sc_mcch_mod_period_v1470_present; + group_flags[0] |= late_non_crit_ext_present; + group_flags[1] |= inter_freq_carrier_freq_list_v1250.is_present(); + group_flags[1] |= inter_freq_carrier_freq_list_ext_r12.is_present(); + group_flags[2] |= inter_freq_carrier_freq_list_ext_v1280.is_present(); + group_flags[3] |= inter_freq_carrier_freq_list_v1310.is_present(); + group_flags[3] |= inter_freq_carrier_freq_list_ext_v1310.is_present(); + group_flags[4] |= inter_freq_carrier_freq_list_v1350.is_present(); + group_flags[4] |= inter_freq_carrier_freq_list_ext_v1350.is_present(); + group_flags[5] |= inter_freq_carrier_freq_list_ext_v1360.is_present(); + group_flags[6] |= scptm_freq_offset_r14_present; + group_flags[7] |= inter_freq_carrier_freq_list_v1530.is_present(); + group_flags[7] |= inter_freq_carrier_freq_list_ext_v1530.is_present(); + group_flags[7] |= meas_idle_cfg_sib_r15.is_present(); group_flags.pack(bref); if (group_flags[0]) { varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.pack(br_bcch_cfg_r14.is_present(), 1)); - HANDLE_CODE(bref.pack(sc_mcch_sched_info_r14.is_present(), 1)); - HANDLE_CODE(bref.pack(pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present, 1)); - HANDLE_CODE(bref.pack(pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present, 1)); - if (br_bcch_cfg_r14.is_present()) { - HANDLE_CODE(pack_integer(bref, br_bcch_cfg_r14->mpdcch_nb_sc_mcch_r14, (uint8_t)1u, (uint8_t)16u)); - HANDLE_CODE(br_bcch_cfg_r14->mpdcch_num_repeat_sc_mcch_r14.pack(bref)); - HANDLE_CODE(br_bcch_cfg_r14->mpdcch_start_sf_sc_mcch_r14.pack(bref)); - HANDLE_CODE(br_bcch_cfg_r14->mpdcch_pdsch_hop_cfg_sc_mcch_r14.pack(bref)); - HANDLE_CODE(pack_integer(bref, br_bcch_cfg_r14->sc_mcch_carrier_freq_r14, (uint32_t)0u, (uint32_t)262143u)); - HANDLE_CODE(pack_integer(bref, br_bcch_cfg_r14->sc_mcch_offset_br_r14, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(br_bcch_cfg_r14->sc_mcch_repeat_period_br_r14.pack(bref)); - HANDLE_CODE(br_bcch_cfg_r14->sc_mcch_mod_period_br_r14.pack(bref)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v1250.is_present(), 1)); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_r12.is_present(), 1)); + if (inter_freq_carrier_freq_list_v1250.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_v1250, 1, 8)); } - if (sc_mcch_sched_info_r14.is_present()) { - HANDLE_CODE(sc_mcch_sched_info_r14->pack(bref)); + if (inter_freq_carrier_freq_list_ext_r12.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_r12, 1, 8)); } - if (pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present) { - HANDLE_CODE(pdsch_max_num_repeat_cemode_a_sc_mtch_r14.pack(bref)); + } + if (group_flags[2]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1280.is_present(), 1)); + if (inter_freq_carrier_freq_list_ext_v1280.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1280, 1, 8)); } - if (pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present) { - HANDLE_CODE(pdsch_max_num_repeat_cemode_b_sc_mtch_r14.pack(bref)); + } + if (group_flags[3]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v1310.is_present(), 1)); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1310.is_present(), 1)); + if (inter_freq_carrier_freq_list_v1310.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_v1310, 1, 8)); + } + if (inter_freq_carrier_freq_list_ext_v1310.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1310, 1, 8)); } } - if (group_flags[1]) { + if (group_flags[4]) { varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.pack(sc_mcch_repeat_period_v1470_present, 1)); - HANDLE_CODE(bref.pack(sc_mcch_mod_period_v1470_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v1350.is_present(), 1)); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1350.is_present(), 1)); + if (inter_freq_carrier_freq_list_v1350.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_v1350, 1, 8)); + } + if (inter_freq_carrier_freq_list_ext_v1350.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1350, 1, 8)); + } + } + if (group_flags[5]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1360.is_present(), 1)); + if (inter_freq_carrier_freq_list_ext_v1360.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1360, 1, 8)); + } + } + if (group_flags[6]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(scptm_freq_offset_r14_present, 1)); + if (scptm_freq_offset_r14_present) { + HANDLE_CODE(pack_integer(bref, scptm_freq_offset_r14, (uint8_t)1u, (uint8_t)8u)); + } + } + if (group_flags[7]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v1530.is_present(), 1)); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1530.is_present(), 1)); + HANDLE_CODE(bref.pack(meas_idle_cfg_sib_r15.is_present(), 1)); + if (inter_freq_carrier_freq_list_v1530.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_v1530, 1, 8)); + } + if (inter_freq_carrier_freq_list_ext_v1530.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1530, 1, 8)); + } + if (meas_idle_cfg_sib_r15.is_present()) { + HANDLE_CODE(meas_idle_cfg_sib_r15->pack(bref)); + } } } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type20_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type5_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(sc_mcch_dur_r13_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - - HANDLE_CODE(sc_mcch_repeat_period_r13.unpack(bref)); - HANDLE_CODE(unpack_integer(sc_mcch_offset_r13, bref, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(unpack_integer(sc_mcch_first_sf_r13, bref, (uint8_t)0u, (uint8_t)9u)); - if (sc_mcch_dur_r13_present) { - HANDLE_CODE(unpack_integer(sc_mcch_dur_r13, bref, (uint8_t)2u, (uint8_t)9u)); - } - HANDLE_CODE(sc_mcch_mod_period_r13.unpack(bref)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list, bref, 1, 8)); if (ext) { - ext_groups_unpacker_guard group_flags(2); + ext_groups_unpacker_guard group_flags(8); group_flags.unpack(bref); if (group_flags[0]) { varlength_field_unpack_guard varlen_scope(bref, false); - bool br_bcch_cfg_r14_present; - HANDLE_CODE(bref.unpack(br_bcch_cfg_r14_present, 1)); - br_bcch_cfg_r14.set_present(br_bcch_cfg_r14_present); - bool sc_mcch_sched_info_r14_present; - HANDLE_CODE(bref.unpack(sc_mcch_sched_info_r14_present, 1)); - sc_mcch_sched_info_r14.set_present(sc_mcch_sched_info_r14_present); - HANDLE_CODE(bref.unpack(pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present, 1)); - HANDLE_CODE(bref.unpack(pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present, 1)); - if (br_bcch_cfg_r14.is_present()) { - HANDLE_CODE(unpack_integer(br_bcch_cfg_r14->mpdcch_nb_sc_mcch_r14, bref, (uint8_t)1u, (uint8_t)16u)); - HANDLE_CODE(br_bcch_cfg_r14->mpdcch_num_repeat_sc_mcch_r14.unpack(bref)); - HANDLE_CODE(br_bcch_cfg_r14->mpdcch_start_sf_sc_mcch_r14.unpack(bref)); - HANDLE_CODE(br_bcch_cfg_r14->mpdcch_pdsch_hop_cfg_sc_mcch_r14.unpack(bref)); - HANDLE_CODE(unpack_integer(br_bcch_cfg_r14->sc_mcch_carrier_freq_r14, bref, (uint32_t)0u, (uint32_t)262143u)); - HANDLE_CODE(unpack_integer(br_bcch_cfg_r14->sc_mcch_offset_br_r14, bref, (uint8_t)0u, (uint8_t)10u)); - HANDLE_CODE(br_bcch_cfg_r14->sc_mcch_repeat_period_br_r14.unpack(bref)); - HANDLE_CODE(br_bcch_cfg_r14->sc_mcch_mod_period_br_r14.unpack(bref)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool inter_freq_carrier_freq_list_v1250_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v1250_present, 1)); + inter_freq_carrier_freq_list_v1250.set_present(inter_freq_carrier_freq_list_v1250_present); + bool inter_freq_carrier_freq_list_ext_r12_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_r12_present, 1)); + inter_freq_carrier_freq_list_ext_r12.set_present(inter_freq_carrier_freq_list_ext_r12_present); + if (inter_freq_carrier_freq_list_v1250.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_v1250, bref, 1, 8)); } - if (sc_mcch_sched_info_r14.is_present()) { - HANDLE_CODE(sc_mcch_sched_info_r14->unpack(bref)); + if (inter_freq_carrier_freq_list_ext_r12.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_r12, bref, 1, 8)); } - if (pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present) { - HANDLE_CODE(pdsch_max_num_repeat_cemode_a_sc_mtch_r14.unpack(bref)); + } + if (group_flags[2]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool inter_freq_carrier_freq_list_ext_v1280_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1280_present, 1)); + inter_freq_carrier_freq_list_ext_v1280.set_present(inter_freq_carrier_freq_list_ext_v1280_present); + if (inter_freq_carrier_freq_list_ext_v1280.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1280, bref, 1, 8)); } - if (pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present) { - HANDLE_CODE(pdsch_max_num_repeat_cemode_b_sc_mtch_r14.unpack(bref)); + } + if (group_flags[3]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool inter_freq_carrier_freq_list_v1310_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v1310_present, 1)); + inter_freq_carrier_freq_list_v1310.set_present(inter_freq_carrier_freq_list_v1310_present); + bool inter_freq_carrier_freq_list_ext_v1310_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1310_present, 1)); + inter_freq_carrier_freq_list_ext_v1310.set_present(inter_freq_carrier_freq_list_ext_v1310_present); + if (inter_freq_carrier_freq_list_v1310.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_v1310, bref, 1, 8)); + } + if (inter_freq_carrier_freq_list_ext_v1310.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1310, bref, 1, 8)); } } - if (group_flags[1]) { + if (group_flags[4]) { varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.unpack(sc_mcch_repeat_period_v1470_present, 1)); - HANDLE_CODE(bref.unpack(sc_mcch_mod_period_v1470_present, 1)); + bool inter_freq_carrier_freq_list_v1350_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v1350_present, 1)); + inter_freq_carrier_freq_list_v1350.set_present(inter_freq_carrier_freq_list_v1350_present); + bool inter_freq_carrier_freq_list_ext_v1350_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1350_present, 1)); + inter_freq_carrier_freq_list_ext_v1350.set_present(inter_freq_carrier_freq_list_ext_v1350_present); + if (inter_freq_carrier_freq_list_v1350.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_v1350, bref, 1, 8)); + } + if (inter_freq_carrier_freq_list_ext_v1350.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1350, bref, 1, 8)); + } + } + if (group_flags[5]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool inter_freq_carrier_freq_list_ext_v1360_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1360_present, 1)); + inter_freq_carrier_freq_list_ext_v1360.set_present(inter_freq_carrier_freq_list_ext_v1360_present); + if (inter_freq_carrier_freq_list_ext_v1360.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1360, bref, 1, 8)); + } + } + if (group_flags[6]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.unpack(scptm_freq_offset_r14_present, 1)); + if (scptm_freq_offset_r14_present) { + HANDLE_CODE(unpack_integer(scptm_freq_offset_r14, bref, (uint8_t)1u, (uint8_t)8u)); + } + } + if (group_flags[7]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool inter_freq_carrier_freq_list_v1530_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v1530_present, 1)); + inter_freq_carrier_freq_list_v1530.set_present(inter_freq_carrier_freq_list_v1530_present); + bool inter_freq_carrier_freq_list_ext_v1530_present; + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1530_present, 1)); + inter_freq_carrier_freq_list_ext_v1530.set_present(inter_freq_carrier_freq_list_ext_v1530_present); + bool meas_idle_cfg_sib_r15_present; + HANDLE_CODE(bref.unpack(meas_idle_cfg_sib_r15_present, 1)); + meas_idle_cfg_sib_r15.set_present(meas_idle_cfg_sib_r15_present); + if (inter_freq_carrier_freq_list_v1530.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_v1530, bref, 1, 8)); + } + if (inter_freq_carrier_freq_list_ext_v1530.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1530, bref, 1, 8)); + } + if (meas_idle_cfg_sib_r15.is_present()) { + HANDLE_CODE(meas_idle_cfg_sib_r15->unpack(bref)); + } } } return SRSASN_SUCCESS; } -void sib_type20_r13_s::to_json(json_writer& j) const +void sib_type5_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("sc-mcch-RepetitionPeriod-r13", sc_mcch_repeat_period_r13.to_string()); - j.write_int("sc-mcch-Offset-r13", sc_mcch_offset_r13); - j.write_int("sc-mcch-FirstSubframe-r13", sc_mcch_first_sf_r13); - if (sc_mcch_dur_r13_present) { - j.write_int("sc-mcch-duration-r13", sc_mcch_dur_r13); - } - j.write_str("sc-mcch-ModificationPeriod-r13", sc_mcch_mod_period_r13.to_string()); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + j.start_array("interFreqCarrierFreqList"); + for (const auto& e1 : inter_freq_carrier_freq_list) { + e1.to_json(j); } + j.end_array(); if (ext) { - if (br_bcch_cfg_r14.is_present()) { - j.write_fieldname("br-BCCH-Config-r14"); - j.start_obj(); - j.write_str("dummy", "rf1"); - j.write_str("dummy2", "rf1"); - j.write_int("mpdcch-Narrowband-SC-MCCH-r14", br_bcch_cfg_r14->mpdcch_nb_sc_mcch_r14); - j.write_str("mpdcch-NumRepetition-SC-MCCH-r14", br_bcch_cfg_r14->mpdcch_num_repeat_sc_mcch_r14.to_string()); - j.write_fieldname("mpdcch-StartSF-SC-MCCH-r14"); - br_bcch_cfg_r14->mpdcch_start_sf_sc_mcch_r14.to_json(j); - j.write_str("mpdcch-PDSCH-HoppingConfig-SC-MCCH-r14", - br_bcch_cfg_r14->mpdcch_pdsch_hop_cfg_sc_mcch_r14.to_string()); - j.write_int("sc-mcch-CarrierFreq-r14", br_bcch_cfg_r14->sc_mcch_carrier_freq_r14); - j.write_int("sc-mcch-Offset-BR-r14", br_bcch_cfg_r14->sc_mcch_offset_br_r14); - j.write_str("sc-mcch-RepetitionPeriod-BR-r14", br_bcch_cfg_r14->sc_mcch_repeat_period_br_r14.to_string()); - j.write_str("sc-mcch-ModificationPeriod-BR-r14", br_bcch_cfg_r14->sc_mcch_mod_period_br_r14.to_string()); - j.end_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - if (sc_mcch_sched_info_r14.is_present()) { - j.write_fieldname("sc-mcch-SchedulingInfo-r14"); - sc_mcch_sched_info_r14->to_json(j); + if (inter_freq_carrier_freq_list_v1250.is_present()) { + j.start_array("interFreqCarrierFreqList-v1250"); + for (const auto& e1 : *inter_freq_carrier_freq_list_v1250) { + e1.to_json(j); + } + j.end_array(); } - if (pdsch_max_num_repeat_cemode_a_sc_mtch_r14_present) { - j.write_str("pdsch-maxNumRepetitionCEmodeA-SC-MTCH-r14", pdsch_max_num_repeat_cemode_a_sc_mtch_r14.to_string()); + if (inter_freq_carrier_freq_list_ext_r12.is_present()) { + j.start_array("interFreqCarrierFreqListExt-r12"); + for (const auto& e1 : *inter_freq_carrier_freq_list_ext_r12) { + e1.to_json(j); + } + j.end_array(); } - if (pdsch_max_num_repeat_cemode_b_sc_mtch_r14_present) { - j.write_str("pdsch-maxNumRepetitionCEmodeB-SC-MTCH-r14", pdsch_max_num_repeat_cemode_b_sc_mtch_r14.to_string()); + if (inter_freq_carrier_freq_list_ext_v1280.is_present()) { + j.start_array("interFreqCarrierFreqListExt-v1280"); + for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1280) { + e1.to_json(j); + } + j.end_array(); } - if (sc_mcch_repeat_period_v1470_present) { - j.write_str("sc-mcch-RepetitionPeriod-v1470", "rf1"); + if (inter_freq_carrier_freq_list_v1310.is_present()) { + j.start_array("interFreqCarrierFreqList-v1310"); + for (const auto& e1 : *inter_freq_carrier_freq_list_v1310) { + e1.to_json(j); + } + j.end_array(); } - if (sc_mcch_mod_period_v1470_present) { - j.write_str("sc-mcch-ModificationPeriod-v1470", "rf1"); + if (inter_freq_carrier_freq_list_ext_v1310.is_present()) { + j.start_array("interFreqCarrierFreqListExt-v1310"); + for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1310) { + e1.to_json(j); + } + j.end_array(); + } + if (inter_freq_carrier_freq_list_v1350.is_present()) { + j.start_array("interFreqCarrierFreqList-v1350"); + for (const auto& e1 : *inter_freq_carrier_freq_list_v1350) { + e1.to_json(j); + } + j.end_array(); + } + if (inter_freq_carrier_freq_list_ext_v1350.is_present()) { + j.start_array("interFreqCarrierFreqListExt-v1350"); + for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1350) { + e1.to_json(j); + } + j.end_array(); + } + if (inter_freq_carrier_freq_list_ext_v1360.is_present()) { + j.start_array("interFreqCarrierFreqListExt-v1360"); + for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1360) { + e1.to_json(j); + } + j.end_array(); + } + if (scptm_freq_offset_r14_present) { + j.write_int("scptm-FreqOffset-r14", scptm_freq_offset_r14); + } + if (inter_freq_carrier_freq_list_v1530.is_present()) { + j.start_array("interFreqCarrierFreqList-v1530"); + for (const auto& e1 : *inter_freq_carrier_freq_list_v1530) { + e1.to_json(j); + } + j.end_array(); + } + if (inter_freq_carrier_freq_list_ext_v1530.is_present()) { + j.start_array("interFreqCarrierFreqListExt-v1530"); + for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1530) { + e1.to_json(j); + } + j.end_array(); + } + if (meas_idle_cfg_sib_r15.is_present()) { + j.write_fieldname("measIdleConfigSIB-r15"); + meas_idle_cfg_sib_r15->to_json(j); } } j.end_obj(); } -std::string sib_type20_r13_s::sc_mcch_repeat_period_r13_opts::to_string() const -{ - static const char* options[] = {"rf2", "rf4", "rf8", "rf16", "rf32", "rf64", "rf128", "rf256"}; - return convert_enum_idx(options, 8, value, "sib_type20_r13_s::sc_mcch_repeat_period_r13_e_"); -} -uint16_t sib_type20_r13_s::sc_mcch_repeat_period_r13_opts::to_number() const -{ - static const uint16_t options[] = {2, 4, 8, 16, 32, 64, 128, 256}; - return map_enum_number(options, 8, value, "sib_type20_r13_s::sc_mcch_repeat_period_r13_e_"); -} - -std::string sib_type20_r13_s::sc_mcch_mod_period_r13_opts::to_string() const +// SystemInformationBlockType6 ::= SEQUENCE +SRSASN_CODE sib_type6_s::pack(bit_ref& bref) const { - static const char* options[] = {"rf2", - "rf4", - "rf8", - "rf16", - "rf32", - "rf64", - "rf128", - "rf256", - "rf512", - "rf1024", - "r2048", - "rf4096", - "rf8192", - "rf16384", - "rf32768", - "rf65536"}; - return convert_enum_idx(options, 16, value, "sib_type20_r13_s::sc_mcch_mod_period_r13_e_"); -} -uint32_t sib_type20_r13_s::sc_mcch_mod_period_r13_opts::to_number() const -{ - static const uint32_t options[] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536}; - return map_enum_number(options, 16, value, "sib_type20_r13_s::sc_mcch_mod_period_r13_e_"); -} - -std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_num_repeat_sc_mcch_r14_opts::to_string() const -{ - static const char* options[] = {"r1", "r2", "r4", "r8", "r16", "r32", "r64", "r128", "r256"}; - return convert_enum_idx(options, 9, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_num_repeat_sc_mcch_r14_e_"); -} -uint16_t sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_num_repeat_sc_mcch_r14_opts::to_number() const -{ - static const uint16_t options[] = {1, 2, 4, 8, 16, 32, 64, 128, 256}; - return map_enum_number(options, 9, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_num_repeat_sc_mcch_r14_e_"); -} + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(carrier_freq_list_utra_fdd_present, 1)); + HANDLE_CODE(bref.pack(carrier_freq_list_utra_tdd_present, 1)); + HANDLE_CODE(bref.pack(t_resel_utra_sf_present, 1)); -void sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::destroy_() {} -void sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::set(types::options e) -{ - destroy_(); - type_ = e; -} -sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::mpdcch_start_sf_sc_mcch_r14_c_( - const sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::fdd_r14: - c.init(other.c.get()); - break; - case types::tdd_r14: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); + if (carrier_freq_list_utra_fdd_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freq_list_utra_fdd, 1, 16)); } -} -sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_& -sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::operator=( - const sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_& other) -{ - if (this == &other) { - return *this; + if (carrier_freq_list_utra_tdd_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freq_list_utra_tdd, 1, 16)); } - set(other.type()); - switch (type_) { - case types::fdd_r14: - c.set(other.c.get()); - break; - case types::tdd_r14: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); + HANDLE_CODE(pack_integer(bref, t_resel_utra, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_utra_sf_present) { + HANDLE_CODE(t_resel_utra_sf.pack(bref)); } - return *this; -} -void sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::fdd_r14: - j.write_str("fdd-r14", c.get().to_string()); - break; - case types::tdd_r14: - j.write_str("tdd-r14", c.get().to_string()); - break; - default: - log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); - } - j.end_obj(); -} -SRSASN_CODE sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::fdd_r14: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::tdd_r14: - HANDLE_CODE(c.get().pack(bref)); - break; - default: - log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= late_non_crit_ext_present; + group_flags[1] |= carrier_freq_list_utra_fdd_v1250.is_present(); + group_flags[1] |= carrier_freq_list_utra_tdd_v1250.is_present(); + group_flags[1] |= carrier_freq_list_utra_fdd_ext_r12.is_present(); + group_flags[1] |= carrier_freq_list_utra_tdd_ext_r12.is_present(); + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(carrier_freq_list_utra_fdd_v1250.is_present(), 1)); + HANDLE_CODE(bref.pack(carrier_freq_list_utra_tdd_v1250.is_present(), 1)); + HANDLE_CODE(bref.pack(carrier_freq_list_utra_fdd_ext_r12.is_present(), 1)); + HANDLE_CODE(bref.pack(carrier_freq_list_utra_tdd_ext_r12.is_present(), 1)); + if (carrier_freq_list_utra_fdd_v1250.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *carrier_freq_list_utra_fdd_v1250, 1, 16)); + } + if (carrier_freq_list_utra_tdd_v1250.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *carrier_freq_list_utra_tdd_v1250, 1, 16)); + } + if (carrier_freq_list_utra_fdd_ext_r12.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *carrier_freq_list_utra_fdd_ext_r12, 1, 16)); + } + if (carrier_freq_list_utra_tdd_ext_r12.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *carrier_freq_list_utra_tdd_ext_r12, 1, 16)); + } + } } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::unpack(cbit_ref& bref) +SRSASN_CODE sib_type6_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::fdd_r14: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::tdd_r14: - HANDLE_CODE(c.get().unpack(bref)); - break; - default: - log_invalid_choice_id(type_, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_"); - return SRSASN_ERROR_DECODE_FAIL; + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(carrier_freq_list_utra_fdd_present, 1)); + HANDLE_CODE(bref.unpack(carrier_freq_list_utra_tdd_present, 1)); + HANDLE_CODE(bref.unpack(t_resel_utra_sf_present, 1)); + + if (carrier_freq_list_utra_fdd_present) { + HANDLE_CODE(unpack_dyn_seq_of(carrier_freq_list_utra_fdd, bref, 1, 16)); + } + if (carrier_freq_list_utra_tdd_present) { + HANDLE_CODE(unpack_dyn_seq_of(carrier_freq_list_utra_tdd, bref, 1, 16)); + } + HANDLE_CODE(unpack_integer(t_resel_utra, bref, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_utra_sf_present) { + HANDLE_CODE(t_resel_utra_sf.unpack(bref)); } - return SRSASN_SUCCESS; -} -std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_opts::to_string() const -{ - static const char* options[] = {"v1", "v1dot5", "v2", "v2dot5", "v4", "v5", "v8", "v10"}; - return convert_enum_idx( - options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_e_"); -} -float sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_opts::to_number() const -{ - static const float options[] = {1.0, 1.5, 2.0, 2.5, 4.0, 5.0, 8.0, 10.0}; - return map_enum_number( - options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_e_"); -} -std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_opts::to_number_string() const -{ - static const char* options[] = {"1", "1.5", "2", "2.5", "4", "5", "8", "10"}; - return convert_enum_idx( - options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::fdd_r14_e_"); -} + if (ext) { + ext_groups_unpacker_guard group_flags(2); + group_flags.unpack(bref); -std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::tdd_r14_opts::to_string() const -{ - static const char* options[] = {"v1", "v2", "v4", "v5", "v8", "v10", "v20"}; - return convert_enum_idx( - options, 7, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::tdd_r14_e_"); -} -uint8_t sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::tdd_r14_opts::to_number() const -{ - static const uint8_t options[] = {1, 2, 4, 5, 8, 10, 20}; - return map_enum_number( - options, 7, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_start_sf_sc_mcch_r14_c_::tdd_r14_e_"); -} + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); -std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_pdsch_hop_cfg_sc_mcch_r14_opts::to_string() const -{ - static const char* options[] = {"off", "ce-ModeA", "ce-ModeB"}; - return convert_enum_idx( - options, 3, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::mpdcch_pdsch_hop_cfg_sc_mcch_r14_e_"); -} + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_unpack_guard varlen_scope(bref, false); -std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_repeat_period_br_r14_opts::to_string() const -{ - static const char* options[] = {"rf32", "rf128", "rf512", "rf1024", "rf2048", "rf4096", "rf8192", "rf16384"}; - return convert_enum_idx(options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_repeat_period_br_r14_e_"); + bool carrier_freq_list_utra_fdd_v1250_present; + HANDLE_CODE(bref.unpack(carrier_freq_list_utra_fdd_v1250_present, 1)); + carrier_freq_list_utra_fdd_v1250.set_present(carrier_freq_list_utra_fdd_v1250_present); + bool carrier_freq_list_utra_tdd_v1250_present; + HANDLE_CODE(bref.unpack(carrier_freq_list_utra_tdd_v1250_present, 1)); + carrier_freq_list_utra_tdd_v1250.set_present(carrier_freq_list_utra_tdd_v1250_present); + bool carrier_freq_list_utra_fdd_ext_r12_present; + HANDLE_CODE(bref.unpack(carrier_freq_list_utra_fdd_ext_r12_present, 1)); + carrier_freq_list_utra_fdd_ext_r12.set_present(carrier_freq_list_utra_fdd_ext_r12_present); + bool carrier_freq_list_utra_tdd_ext_r12_present; + HANDLE_CODE(bref.unpack(carrier_freq_list_utra_tdd_ext_r12_present, 1)); + carrier_freq_list_utra_tdd_ext_r12.set_present(carrier_freq_list_utra_tdd_ext_r12_present); + if (carrier_freq_list_utra_fdd_v1250.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*carrier_freq_list_utra_fdd_v1250, bref, 1, 16)); + } + if (carrier_freq_list_utra_tdd_v1250.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*carrier_freq_list_utra_tdd_v1250, bref, 1, 16)); + } + if (carrier_freq_list_utra_fdd_ext_r12.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*carrier_freq_list_utra_fdd_ext_r12, bref, 1, 16)); + } + if (carrier_freq_list_utra_tdd_ext_r12.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*carrier_freq_list_utra_tdd_ext_r12, bref, 1, 16)); + } + } + } + return SRSASN_SUCCESS; } -uint16_t sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_repeat_period_br_r14_opts::to_number() const -{ - static const uint16_t options[] = {32, 128, 512, 1024, 2048, 4096, 8192, 16384}; - return map_enum_number(options, 8, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_repeat_period_br_r14_e_"); -} - -std::string sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_mod_period_br_r14_opts::to_string() const -{ - static const char* options[] = {"rf32", - "rf128", - "rf256", - "rf512", - "rf1024", - "rf2048", - "rf4096", - "rf8192", - "rf16384", - "rf32768", - "rf65536", - "rf131072", - "rf262144", - "rf524288", - "rf1048576"}; - return convert_enum_idx(options, 15, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_mod_period_br_r14_e_"); -} -uint32_t sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_mod_period_br_r14_opts::to_number() const -{ - static const uint32_t options[] = { - 32, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576}; - return map_enum_number(options, 15, value, "sib_type20_r13_s::br_bcch_cfg_r14_s_::sc_mcch_mod_period_br_r14_e_"); -} - -std::string sib_type20_r13_s::pdsch_max_num_repeat_cemode_a_sc_mtch_r14_opts::to_string() const -{ - static const char* options[] = {"r16", "r32"}; - return convert_enum_idx(options, 2, value, "sib_type20_r13_s::pdsch_max_num_repeat_cemode_a_sc_mtch_r14_e_"); -} -uint8_t sib_type20_r13_s::pdsch_max_num_repeat_cemode_a_sc_mtch_r14_opts::to_number() const -{ - static const uint8_t options[] = {16, 32}; - return map_enum_number(options, 2, value, "sib_type20_r13_s::pdsch_max_num_repeat_cemode_a_sc_mtch_r14_e_"); -} - -std::string sib_type20_r13_s::pdsch_max_num_repeat_cemode_b_sc_mtch_r14_opts::to_string() const -{ - static const char* options[] = {"r192", "r256", "r384", "r512", "r768", "r1024", "r1536", "r2048"}; - return convert_enum_idx(options, 8, value, "sib_type20_r13_s::pdsch_max_num_repeat_cemode_b_sc_mtch_r14_e_"); -} -uint16_t sib_type20_r13_s::pdsch_max_num_repeat_cemode_b_sc_mtch_r14_opts::to_number() const -{ - static const uint16_t options[] = {192, 256, 384, 512, 768, 1024, 1536, 2048}; - return map_enum_number(options, 8, value, "sib_type20_r13_s::pdsch_max_num_repeat_cemode_b_sc_mtch_r14_e_"); -} - -// SystemInformationBlockType21-r14 ::= SEQUENCE -SRSASN_CODE sib_type21_r14_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(sl_v2x_cfg_common_r14_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - if (sl_v2x_cfg_common_r14_present) { - HANDLE_CODE(sl_v2x_cfg_common_r14.pack(bref)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type21_r14_s::unpack(cbit_ref& bref) +void sib_type6_s::to_json(json_writer& j) const { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(sl_v2x_cfg_common_r14_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - - if (sl_v2x_cfg_common_r14_present) { - HANDLE_CODE(sl_v2x_cfg_common_r14.unpack(bref)); + j.start_obj(); + if (carrier_freq_list_utra_fdd_present) { + j.start_array("carrierFreqListUTRA-FDD"); + for (const auto& e1 : carrier_freq_list_utra_fdd) { + e1.to_json(j); + } + j.end_array(); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); + if (carrier_freq_list_utra_tdd_present) { + j.start_array("carrierFreqListUTRA-TDD"); + for (const auto& e1 : carrier_freq_list_utra_tdd) { + e1.to_json(j); + } + j.end_array(); } - - return SRSASN_SUCCESS; -} -void sib_type21_r14_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (sl_v2x_cfg_common_r14_present) { - j.write_fieldname("sl-V2X-ConfigCommon-r14"); - sl_v2x_cfg_common_r14.to_json(j); + j.write_int("t-ReselectionUTRA", t_resel_utra); + if (t_resel_utra_sf_present) { + j.write_fieldname("t-ReselectionUTRA-SF"); + t_resel_utra_sf.to_json(j); } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + if (ext) { + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (carrier_freq_list_utra_fdd_v1250.is_present()) { + j.start_array("carrierFreqListUTRA-FDD-v1250"); + for (const auto& e1 : *carrier_freq_list_utra_fdd_v1250) { + e1.to_json(j); + } + j.end_array(); + } + if (carrier_freq_list_utra_tdd_v1250.is_present()) { + j.start_array("carrierFreqListUTRA-TDD-v1250"); + for (const auto& e1 : *carrier_freq_list_utra_tdd_v1250) { + e1.to_json(j); + } + j.end_array(); + } + if (carrier_freq_list_utra_fdd_ext_r12.is_present()) { + j.start_array("carrierFreqListUTRA-FDD-Ext-r12"); + for (const auto& e1 : *carrier_freq_list_utra_fdd_ext_r12) { + e1.to_json(j); + } + j.end_array(); + } + if (carrier_freq_list_utra_tdd_ext_r12.is_present()) { + j.start_array("carrierFreqListUTRA-TDD-Ext-r12"); + for (const auto& e1 : *carrier_freq_list_utra_tdd_ext_r12) { + e1.to_json(j); + } + j.end_array(); + } } j.end_obj(); } -// SystemInformationBlockType24-r15 ::= SEQUENCE -SRSASN_CODE sib_type24_r15_s::pack(bit_ref& bref) const +// SystemInformationBlockType7 ::= SEQUENCE +SRSASN_CODE sib_type7_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(carrier_freq_list_nr_r15_present, 1)); - HANDLE_CODE(bref.pack(t_resel_nr_sf_r15_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(t_resel_geran_sf_present, 1)); + HANDLE_CODE(bref.pack(carrier_freqs_info_list_present, 1)); - if (carrier_freq_list_nr_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freq_list_nr_r15, 1, 8)); - } - HANDLE_CODE(pack_integer(bref, t_resel_nr_r15, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_nr_sf_r15_present) { - HANDLE_CODE(t_resel_nr_sf_r15.pack(bref)); + HANDLE_CODE(pack_integer(bref, t_resel_geran, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_geran_sf_present) { + HANDLE_CODE(t_resel_geran_sf.pack(bref)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (carrier_freqs_info_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freqs_info_list, 1, 16)); } + if (ext) { + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type24_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type7_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(carrier_freq_list_nr_r15_present, 1)); - HANDLE_CODE(bref.unpack(t_resel_nr_sf_r15_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(t_resel_geran_sf_present, 1)); + HANDLE_CODE(bref.unpack(carrier_freqs_info_list_present, 1)); - if (carrier_freq_list_nr_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(carrier_freq_list_nr_r15, bref, 1, 8)); - } - HANDLE_CODE(unpack_integer(t_resel_nr_r15, bref, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_nr_sf_r15_present) { - HANDLE_CODE(t_resel_nr_sf_r15.unpack(bref)); + HANDLE_CODE(unpack_integer(t_resel_geran, bref, (uint8_t)0u, (uint8_t)7u)); + if (t_resel_geran_sf_present) { + HANDLE_CODE(t_resel_geran_sf.unpack(bref)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); + if (carrier_freqs_info_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(carrier_freqs_info_list, bref, 1, 16)); } + if (ext) { + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + } return SRSASN_SUCCESS; } -void sib_type24_r15_s::to_json(json_writer& j) const +void sib_type7_s::to_json(json_writer& j) const { j.start_obj(); - if (carrier_freq_list_nr_r15_present) { - j.start_array("carrierFreqListNR-r15"); - for (const auto& e1 : carrier_freq_list_nr_r15) { + j.write_int("t-ReselectionGERAN", t_resel_geran); + if (t_resel_geran_sf_present) { + j.write_fieldname("t-ReselectionGERAN-SF"); + t_resel_geran_sf.to_json(j); + } + if (carrier_freqs_info_list_present) { + j.start_array("carrierFreqsInfoList"); + for (const auto& e1 : carrier_freqs_info_list) { e1.to_json(j); } j.end_array(); } - j.write_int("t-ReselectionNR-r15", t_resel_nr_r15); - if (t_resel_nr_sf_r15_present) { - j.write_fieldname("t-ReselectionNR-SF-r15"); - t_resel_nr_sf_r15.to_json(j); - } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + if (ext) { + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } } j.end_obj(); } -// SystemInformationBlockType25-r15 ::= SEQUENCE -SRSASN_CODE sib_type25_r15_s::pack(bit_ref& bref) const +// SystemInformationBlockType8 ::= SEQUENCE +SRSASN_CODE sib_type8_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(uac_barr_for_common_r15_present, 1)); - HANDLE_CODE(bref.pack(uac_barr_per_plmn_list_r15_present, 1)); - HANDLE_CODE(bref.pack(uac_ac1_select_assist_info_r15_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(sys_time_info_present, 1)); + HANDLE_CODE(bref.pack(search_win_size_present, 1)); + HANDLE_CODE(bref.pack(params_hrpd_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt_present, 1)); - if (uac_barr_for_common_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, uac_barr_for_common_r15, 1, 63)); - } - if (uac_barr_per_plmn_list_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, uac_barr_per_plmn_list_r15, 1, 6)); + if (sys_time_info_present) { + HANDLE_CODE(sys_time_info.pack(bref)); } - HANDLE_CODE(pack_dyn_seq_of(bref, uac_barr_info_set_list_r15, 1, 8)); - if (uac_ac1_select_assist_info_r15_present) { - HANDLE_CODE(uac_ac1_select_assist_info_r15.pack(bref)); + if (search_win_size_present) { + HANDLE_CODE(pack_integer(bref, search_win_size, (uint8_t)0u, (uint8_t)15u)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (params_hrpd_present) { + HANDLE_CODE(bref.pack(params_hrpd.cell_resel_params_hrpd_present, 1)); + HANDLE_CODE(params_hrpd.pre_regist_info_hrpd.pack(bref)); + if (params_hrpd.cell_resel_params_hrpd_present) { + HANDLE_CODE(params_hrpd.cell_resel_params_hrpd.pack(bref)); + } } - - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type25_r15_s::unpack(cbit_ref& bref) + if (params1_xrtt_present) { + HANDLE_CODE(bref.pack(params1_xrtt.csfb_regist_param1_xrtt_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt.long_code_state1_xrtt_present, 1)); + HANDLE_CODE(bref.pack(params1_xrtt.cell_resel_params1_xrtt_present, 1)); + if (params1_xrtt.csfb_regist_param1_xrtt_present) { + HANDLE_CODE(params1_xrtt.csfb_regist_param1_xrtt.pack(bref)); + } + if (params1_xrtt.long_code_state1_xrtt_present) { + HANDLE_CODE(params1_xrtt.long_code_state1_xrtt.pack(bref)); + } + if (params1_xrtt.cell_resel_params1_xrtt_present) { + HANDLE_CODE(params1_xrtt.cell_resel_params1_xrtt.pack(bref)); + } + } + + if (ext) { + ext_groups_packer_guard group_flags; + group_flags[0] |= late_non_crit_ext_present; + group_flags[1] |= csfb_support_for_dual_rx_ues_r9_present; + group_flags[1] |= cell_resel_params_hrpd_v920.is_present(); + group_flags[1] |= cell_resel_params1_xrtt_v920.is_present(); + group_flags[1] |= csfb_regist_param1_xrtt_v920.is_present(); + group_flags[1] |= ac_barr_cfg1_xrtt_r9.is_present(); + group_flags[2] |= csfb_dual_rx_tx_support_r10_present; + group_flags[3] |= sib8_per_plmn_list_r11.is_present(); + group_flags.pack(bref); + + if (group_flags[0]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(csfb_support_for_dual_rx_ues_r9_present, 1)); + HANDLE_CODE(bref.pack(cell_resel_params_hrpd_v920.is_present(), 1)); + HANDLE_CODE(bref.pack(cell_resel_params1_xrtt_v920.is_present(), 1)); + HANDLE_CODE(bref.pack(csfb_regist_param1_xrtt_v920.is_present(), 1)); + HANDLE_CODE(bref.pack(ac_barr_cfg1_xrtt_r9.is_present(), 1)); + if (csfb_support_for_dual_rx_ues_r9_present) { + HANDLE_CODE(bref.pack(csfb_support_for_dual_rx_ues_r9, 1)); + } + if (cell_resel_params_hrpd_v920.is_present()) { + HANDLE_CODE(cell_resel_params_hrpd_v920->pack(bref)); + } + if (cell_resel_params1_xrtt_v920.is_present()) { + HANDLE_CODE(cell_resel_params1_xrtt_v920->pack(bref)); + } + if (csfb_regist_param1_xrtt_v920.is_present()) { + HANDLE_CODE(csfb_regist_param1_xrtt_v920->pack(bref)); + } + if (ac_barr_cfg1_xrtt_r9.is_present()) { + HANDLE_CODE(ac_barr_cfg1_xrtt_r9->pack(bref)); + } + } + if (group_flags[2]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(csfb_dual_rx_tx_support_r10_present, 1)); + } + if (group_flags[3]) { + varlength_field_pack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.pack(sib8_per_plmn_list_r11.is_present(), 1)); + if (sib8_per_plmn_list_r11.is_present()) { + HANDLE_CODE(pack_dyn_seq_of(bref, *sib8_per_plmn_list_r11, 1, 6)); + } + } + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sib_type8_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(uac_barr_for_common_r15_present, 1)); - HANDLE_CODE(bref.unpack(uac_barr_per_plmn_list_r15_present, 1)); - HANDLE_CODE(bref.unpack(uac_ac1_select_assist_info_r15_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(sys_time_info_present, 1)); + HANDLE_CODE(bref.unpack(search_win_size_present, 1)); + HANDLE_CODE(bref.unpack(params_hrpd_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt_present, 1)); - if (uac_barr_for_common_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(uac_barr_for_common_r15, bref, 1, 63)); + if (sys_time_info_present) { + HANDLE_CODE(sys_time_info.unpack(bref)); } - if (uac_barr_per_plmn_list_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(uac_barr_per_plmn_list_r15, bref, 1, 6)); + if (search_win_size_present) { + HANDLE_CODE(unpack_integer(search_win_size, bref, (uint8_t)0u, (uint8_t)15u)); } - HANDLE_CODE(unpack_dyn_seq_of(uac_barr_info_set_list_r15, bref, 1, 8)); - if (uac_ac1_select_assist_info_r15_present) { - HANDLE_CODE(uac_ac1_select_assist_info_r15.unpack(bref)); + if (params_hrpd_present) { + HANDLE_CODE(bref.unpack(params_hrpd.cell_resel_params_hrpd_present, 1)); + HANDLE_CODE(params_hrpd.pre_regist_info_hrpd.unpack(bref)); + if (params_hrpd.cell_resel_params_hrpd_present) { + HANDLE_CODE(params_hrpd.cell_resel_params_hrpd.unpack(bref)); + } } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); + if (params1_xrtt_present) { + HANDLE_CODE(bref.unpack(params1_xrtt.csfb_regist_param1_xrtt_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt.long_code_state1_xrtt_present, 1)); + HANDLE_CODE(bref.unpack(params1_xrtt.cell_resel_params1_xrtt_present, 1)); + if (params1_xrtt.csfb_regist_param1_xrtt_present) { + HANDLE_CODE(params1_xrtt.csfb_regist_param1_xrtt.unpack(bref)); + } + if (params1_xrtt.long_code_state1_xrtt_present) { + HANDLE_CODE(params1_xrtt.long_code_state1_xrtt.unpack(bref)); + } + if (params1_xrtt.cell_resel_params1_xrtt_present) { + HANDLE_CODE(params1_xrtt.cell_resel_params1_xrtt.unpack(bref)); + } } + if (ext) { + ext_groups_unpacker_guard group_flags(4); + group_flags.unpack(bref); + + if (group_flags[0]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + } + if (group_flags[1]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.unpack(csfb_support_for_dual_rx_ues_r9_present, 1)); + bool cell_resel_params_hrpd_v920_present; + HANDLE_CODE(bref.unpack(cell_resel_params_hrpd_v920_present, 1)); + cell_resel_params_hrpd_v920.set_present(cell_resel_params_hrpd_v920_present); + bool cell_resel_params1_xrtt_v920_present; + HANDLE_CODE(bref.unpack(cell_resel_params1_xrtt_v920_present, 1)); + cell_resel_params1_xrtt_v920.set_present(cell_resel_params1_xrtt_v920_present); + bool csfb_regist_param1_xrtt_v920_present; + HANDLE_CODE(bref.unpack(csfb_regist_param1_xrtt_v920_present, 1)); + csfb_regist_param1_xrtt_v920.set_present(csfb_regist_param1_xrtt_v920_present); + bool ac_barr_cfg1_xrtt_r9_present; + HANDLE_CODE(bref.unpack(ac_barr_cfg1_xrtt_r9_present, 1)); + ac_barr_cfg1_xrtt_r9.set_present(ac_barr_cfg1_xrtt_r9_present); + if (csfb_support_for_dual_rx_ues_r9_present) { + HANDLE_CODE(bref.unpack(csfb_support_for_dual_rx_ues_r9, 1)); + } + if (cell_resel_params_hrpd_v920.is_present()) { + HANDLE_CODE(cell_resel_params_hrpd_v920->unpack(bref)); + } + if (cell_resel_params1_xrtt_v920.is_present()) { + HANDLE_CODE(cell_resel_params1_xrtt_v920->unpack(bref)); + } + if (csfb_regist_param1_xrtt_v920.is_present()) { + HANDLE_CODE(csfb_regist_param1_xrtt_v920->unpack(bref)); + } + if (ac_barr_cfg1_xrtt_r9.is_present()) { + HANDLE_CODE(ac_barr_cfg1_xrtt_r9->unpack(bref)); + } + } + if (group_flags[2]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + HANDLE_CODE(bref.unpack(csfb_dual_rx_tx_support_r10_present, 1)); + } + if (group_flags[3]) { + varlength_field_unpack_guard varlen_scope(bref, false); + + bool sib8_per_plmn_list_r11_present; + HANDLE_CODE(bref.unpack(sib8_per_plmn_list_r11_present, 1)); + sib8_per_plmn_list_r11.set_present(sib8_per_plmn_list_r11_present); + if (sib8_per_plmn_list_r11.is_present()) { + HANDLE_CODE(unpack_dyn_seq_of(*sib8_per_plmn_list_r11, bref, 1, 6)); + } + } + } return SRSASN_SUCCESS; } -void sib_type25_r15_s::to_json(json_writer& j) const +void sib_type8_s::to_json(json_writer& j) const { j.start_obj(); - if (uac_barr_for_common_r15_present) { - j.start_array("uac-BarringForCommon-r15"); - for (const auto& e1 : uac_barr_for_common_r15) { - e1.to_json(j); - } - j.end_array(); + if (sys_time_info_present) { + j.write_fieldname("systemTimeInfo"); + sys_time_info.to_json(j); } - if (uac_barr_per_plmn_list_r15_present) { - j.start_array("uac-BarringPerPLMN-List-r15"); - for (const auto& e1 : uac_barr_per_plmn_list_r15) { - e1.to_json(j); - } - j.end_array(); + if (search_win_size_present) { + j.write_int("searchWindowSize", search_win_size); } - j.start_array("uac-BarringInfoSetList-r15"); - for (const auto& e1 : uac_barr_info_set_list_r15) { - e1.to_json(j); + if (params_hrpd_present) { + j.write_fieldname("parametersHRPD"); + j.start_obj(); + j.write_fieldname("preRegistrationInfoHRPD"); + params_hrpd.pre_regist_info_hrpd.to_json(j); + if (params_hrpd.cell_resel_params_hrpd_present) { + j.write_fieldname("cellReselectionParametersHRPD"); + params_hrpd.cell_resel_params_hrpd.to_json(j); + } + j.end_obj(); } - j.end_array(); - if (uac_ac1_select_assist_info_r15_present) { - j.write_fieldname("uac-AC1-SelectAssistInfo-r15"); - uac_ac1_select_assist_info_r15.to_json(j); + if (params1_xrtt_present) { + j.write_fieldname("parameters1XRTT"); + j.start_obj(); + if (params1_xrtt.csfb_regist_param1_xrtt_present) { + j.write_fieldname("csfb-RegistrationParam1XRTT"); + params1_xrtt.csfb_regist_param1_xrtt.to_json(j); + } + if (params1_xrtt.long_code_state1_xrtt_present) { + j.write_str("longCodeState1XRTT", params1_xrtt.long_code_state1_xrtt.to_string()); + } + if (params1_xrtt.cell_resel_params1_xrtt_present) { + j.write_fieldname("cellReselectionParameters1XRTT"); + params1_xrtt.cell_resel_params1_xrtt.to_json(j); + } + j.end_obj(); } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + if (ext) { + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (csfb_support_for_dual_rx_ues_r9_present) { + j.write_bool("csfb-SupportForDualRxUEs-r9", csfb_support_for_dual_rx_ues_r9); + } + if (cell_resel_params_hrpd_v920.is_present()) { + j.write_fieldname("cellReselectionParametersHRPD-v920"); + cell_resel_params_hrpd_v920->to_json(j); + } + if (cell_resel_params1_xrtt_v920.is_present()) { + j.write_fieldname("cellReselectionParameters1XRTT-v920"); + cell_resel_params1_xrtt_v920->to_json(j); + } + if (csfb_regist_param1_xrtt_v920.is_present()) { + j.write_fieldname("csfb-RegistrationParam1XRTT-v920"); + csfb_regist_param1_xrtt_v920->to_json(j); + } + if (ac_barr_cfg1_xrtt_r9.is_present()) { + j.write_fieldname("ac-BarringConfig1XRTT-r9"); + ac_barr_cfg1_xrtt_r9->to_json(j); + } + if (csfb_dual_rx_tx_support_r10_present) { + j.write_str("csfb-DualRxTxSupport-r10", "true"); + } + if (sib8_per_plmn_list_r11.is_present()) { + j.start_array("sib8-PerPLMN-List-r11"); + for (const auto& e1 : *sib8_per_plmn_list_r11) { + e1.to_json(j); + } + j.end_array(); + } } j.end_obj(); } -void sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::destroy_() -{ - switch (type_) { - case types::individual_plmn_list_r15: - c.destroy(); - break; - default: - break; - } -} -void sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::plmn_common_r15: - break; - case types::individual_plmn_list_r15: - c.init(); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); - } -} -sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::uac_ac1_select_assist_info_r15_c_( - const sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::plmn_common_r15: - c.init(other.c.get()); - break; - case types::individual_plmn_list_r15: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); - } -} -sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_& sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::operator=( - const sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::plmn_common_r15: - c.set(other.c.get()); - break; - case types::individual_plmn_list_r15: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); - } - - return *this; -} -void sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::plmn_common_r15: - j.write_str("plmnCommon-r15", c.get().to_string()); - break; - case types::individual_plmn_list_r15: - j.start_array("individualPLMNList-r15"); - for (const auto& e1 : c.get()) { - j.write_str(e1.to_string()); - } - j.end_array(); - break; - default: - log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); - } - j.end_obj(); -} -SRSASN_CODE sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::plmn_common_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::individual_plmn_list_r15: - HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 2, 6)); - break; - default: - log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::plmn_common_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::individual_plmn_list_r15: - HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 2, 6)); - break; - default: - log_invalid_choice_id(type_, "sib_type25_r15_s::uac_ac1_select_assist_info_r15_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -// SystemInformationBlockType26-r15 ::= SEQUENCE -SRSASN_CODE sib_type26_r15_s::pack(bit_ref& bref) const +// SystemInformationBlockType9 ::= SEQUENCE +SRSASN_CODE sib_type9_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(v2x_inter_freq_info_list_r15_present, 1)); - HANDLE_CODE(bref.pack(cbr_pssch_tx_cfg_list_r15_present, 1)); - HANDLE_CODE(bref.pack(v2x_packet_dupl_cfg_r15_present, 1)); - HANDLE_CODE(bref.pack(sync_freq_list_r15_present, 1)); - HANDLE_CODE(bref.pack(slss_tx_multi_freq_r15_present, 1)); - HANDLE_CODE(bref.pack(v2x_freq_sel_cfg_list_r15_present, 1)); - HANDLE_CODE(bref.pack(thresh_s_rssi_cbr_r15_present, 1)); + HANDLE_CODE(bref.pack(hnb_name_present, 1)); - if (v2x_inter_freq_info_list_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, v2x_inter_freq_info_list_r15, 0, 7)); - } - if (cbr_pssch_tx_cfg_list_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, cbr_pssch_tx_cfg_list_r15, 1, 8)); - } - if (v2x_packet_dupl_cfg_r15_present) { - HANDLE_CODE(v2x_packet_dupl_cfg_r15.pack(bref)); - } - if (sync_freq_list_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, sync_freq_list_r15, 1, 8, integer_packer(0, 262143))); - } - if (v2x_freq_sel_cfg_list_r15_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, v2x_freq_sel_cfg_list_r15, 1, 8)); - } - if (thresh_s_rssi_cbr_r15_present) { - HANDLE_CODE(pack_integer(bref, thresh_s_rssi_cbr_r15, (uint8_t)0u, (uint8_t)45u)); + if (hnb_name_present) { + HANDLE_CODE(hnb_name.pack(bref)); } if (ext) { @@ -7397,34 +7633,13 @@ SRSASN_CODE sib_type26_r15_s::pack(bit_ref& bref) const } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type26_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type9_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(v2x_inter_freq_info_list_r15_present, 1)); - HANDLE_CODE(bref.unpack(cbr_pssch_tx_cfg_list_r15_present, 1)); - HANDLE_CODE(bref.unpack(v2x_packet_dupl_cfg_r15_present, 1)); - HANDLE_CODE(bref.unpack(sync_freq_list_r15_present, 1)); - HANDLE_CODE(bref.unpack(slss_tx_multi_freq_r15_present, 1)); - HANDLE_CODE(bref.unpack(v2x_freq_sel_cfg_list_r15_present, 1)); - HANDLE_CODE(bref.unpack(thresh_s_rssi_cbr_r15_present, 1)); + HANDLE_CODE(bref.unpack(hnb_name_present, 1)); - if (v2x_inter_freq_info_list_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(v2x_inter_freq_info_list_r15, bref, 0, 7)); - } - if (cbr_pssch_tx_cfg_list_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(cbr_pssch_tx_cfg_list_r15, bref, 1, 8)); - } - if (v2x_packet_dupl_cfg_r15_present) { - HANDLE_CODE(v2x_packet_dupl_cfg_r15.unpack(bref)); - } - if (sync_freq_list_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(sync_freq_list_r15, bref, 1, 8, integer_packer(0, 262143))); - } - if (v2x_freq_sel_cfg_list_r15_present) { - HANDLE_CODE(unpack_dyn_seq_of(v2x_freq_sel_cfg_list_r15, bref, 1, 8)); - } - if (thresh_s_rssi_cbr_r15_present) { - HANDLE_CODE(unpack_integer(thresh_s_rssi_cbr_r15, bref, (uint8_t)0u, (uint8_t)45u)); + if (hnb_name_present) { + HANDLE_CODE(hnb_name.unpack(bref)); } if (ext) { @@ -7436,46 +7651,11 @@ SRSASN_CODE sib_type26_r15_s::unpack(cbit_ref& bref) } return SRSASN_SUCCESS; } -void sib_type26_r15_s::to_json(json_writer& j) const +void sib_type9_s::to_json(json_writer& j) const { j.start_obj(); - if (v2x_inter_freq_info_list_r15_present) { - j.start_array("v2x-InterFreqInfoList-r15"); - for (const auto& e1 : v2x_inter_freq_info_list_r15) { - e1.to_json(j); - } - j.end_array(); - } - if (cbr_pssch_tx_cfg_list_r15_present) { - j.start_array("cbr-pssch-TxConfigList-r15"); - for (const auto& e1 : cbr_pssch_tx_cfg_list_r15) { - e1.to_json(j); - } - j.end_array(); - } - if (v2x_packet_dupl_cfg_r15_present) { - j.write_fieldname("v2x-PacketDuplicationConfig-r15"); - v2x_packet_dupl_cfg_r15.to_json(j); - } - if (sync_freq_list_r15_present) { - j.start_array("syncFreqList-r15"); - for (const auto& e1 : sync_freq_list_r15) { - j.write_int(e1); - } - j.end_array(); - } - if (slss_tx_multi_freq_r15_present) { - j.write_str("slss-TxMultiFreq-r15", "true"); - } - if (v2x_freq_sel_cfg_list_r15_present) { - j.start_array("v2x-FreqSelectionConfigList-r15"); - for (const auto& e1 : v2x_freq_sel_cfg_list_r15) { - e1.to_json(j); - } - j.end_array(); - } - if (thresh_s_rssi_cbr_r15_present) { - j.write_int("threshS-RSSI-CBR-r15", thresh_s_rssi_cbr_r15); + if (hnb_name_present) { + j.write_str("hnb-Name", hnb_name.to_string()); } if (ext) { if (late_non_crit_ext_present) { @@ -7485,3819 +7665,3477 @@ void sib_type26_r15_s::to_json(json_writer& j) const j.end_obj(); } -// SystemInformationBlockType3 ::= SEQUENCE -SRSASN_CODE sib_type3_s::pack(bit_ref& bref) const +// PosSystemInformation-r15-IEs ::= SEQUENCE +SRSASN_CODE pos_sys_info_r15_ies_s::pack(bit_ref& bref) const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(cell_resel_info_common.speed_state_resel_pars_present, 1)); - HANDLE_CODE(cell_resel_info_common.q_hyst.pack(bref)); - if (cell_resel_info_common.speed_state_resel_pars_present) { - HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.mob_state_params.pack(bref)); - HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_medium.pack(bref)); - HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_high.pack(bref)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(pack_dyn_seq_of(bref, pos_sib_type_and_info_r15, 1, 32)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } - HANDLE_CODE(bref.pack(cell_resel_serving_freq_info.s_non_intra_search_present, 1)); - if (cell_resel_serving_freq_info.s_non_intra_search_present) { - HANDLE_CODE(pack_integer(bref, cell_resel_serving_freq_info.s_non_intra_search, (uint8_t)0u, (uint8_t)31u)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE pos_sys_info_r15_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + HANDLE_CODE(unpack_dyn_seq_of(pos_sib_type_and_info_r15, bref, 1, 32)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - HANDLE_CODE(pack_integer(bref, cell_resel_serving_freq_info.thresh_serving_low, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, cell_resel_serving_freq_info.cell_resel_prio, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.p_max_present, 1)); - HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.s_intra_search_present, 1)); - HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.allowed_meas_bw_present, 1)); - HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.t_resel_eutra_sf_present, 1)); - HANDLE_CODE(pack_integer(bref, intra_freq_cell_resel_info.q_rx_lev_min, (int8_t)-70, (int8_t)-22)); - if (intra_freq_cell_resel_info.p_max_present) { - HANDLE_CODE(pack_integer(bref, intra_freq_cell_resel_info.p_max, (int8_t)-30, (int8_t)33)); - } - if (intra_freq_cell_resel_info.s_intra_search_present) { - HANDLE_CODE(pack_integer(bref, intra_freq_cell_resel_info.s_intra_search, (uint8_t)0u, (uint8_t)31u)); - } - if (intra_freq_cell_resel_info.allowed_meas_bw_present) { - HANDLE_CODE(intra_freq_cell_resel_info.allowed_meas_bw.pack(bref)); - } - HANDLE_CODE(bref.pack(intra_freq_cell_resel_info.presence_ant_port1, 1)); - HANDLE_CODE(intra_freq_cell_resel_info.neigh_cell_cfg.pack(bref)); - HANDLE_CODE(pack_integer(bref, intra_freq_cell_resel_info.t_resel_eutra, (uint8_t)0u, (uint8_t)7u)); - if (intra_freq_cell_resel_info.t_resel_eutra_sf_present) { - HANDLE_CODE(intra_freq_cell_resel_info.t_resel_eutra_sf.pack(bref)); - } - - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= late_non_crit_ext_present; - group_flags[1] |= s_intra_search_v920.is_present(); - group_flags[1] |= s_non_intra_search_v920.is_present(); - group_flags[1] |= q_qual_min_r9_present; - group_flags[1] |= thresh_serving_low_q_r9_present; - group_flags[2] |= q_qual_min_wb_r11_present; - group_flags[3] |= q_qual_min_rsrq_on_all_symbols_r12_present; - group_flags[4] |= cell_resel_serving_freq_info_v1310.is_present(); - group_flags[4] |= redist_serving_info_r13.is_present(); - group_flags[4] |= cell_sel_info_ce_r13.is_present(); - group_flags[4] |= t_resel_eutra_ce_r13_present; - group_flags[5] |= cell_sel_info_ce1_r13.is_present(); - group_flags[6] |= cell_sel_info_ce1_v1360.is_present(); - group_flags[7] |= cell_resel_info_common_v1460.is_present(); - group_flags[8] |= cell_resel_info_hsdn_r15.is_present(); - group_flags[8] |= cell_sel_info_ce_v1530.is_present(); - group_flags[8] |= crs_intf_mitig_neigh_cells_ce_r15_present; - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(s_intra_search_v920.is_present(), 1)); - HANDLE_CODE(bref.pack(s_non_intra_search_v920.is_present(), 1)); - HANDLE_CODE(bref.pack(q_qual_min_r9_present, 1)); - HANDLE_CODE(bref.pack(thresh_serving_low_q_r9_present, 1)); - if (s_intra_search_v920.is_present()) { - HANDLE_CODE(pack_integer(bref, s_intra_search_v920->s_intra_search_p_r9, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, s_intra_search_v920->s_intra_search_q_r9, (uint8_t)0u, (uint8_t)31u)); - } - if (s_non_intra_search_v920.is_present()) { - HANDLE_CODE(pack_integer(bref, s_non_intra_search_v920->s_non_intra_search_p_r9, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(pack_integer(bref, s_non_intra_search_v920->s_non_intra_search_q_r9, (uint8_t)0u, (uint8_t)31u)); - } - if (q_qual_min_r9_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_r9, (int8_t)-34, (int8_t)-3)); - } - if (thresh_serving_low_q_r9_present) { - HANDLE_CODE(pack_integer(bref, thresh_serving_low_q_r9, (uint8_t)0u, (uint8_t)31u)); - } - } - if (group_flags[2]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(q_qual_min_wb_r11_present, 1)); - if (q_qual_min_wb_r11_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_wb_r11, (int8_t)-34, (int8_t)-3)); - } - } - if (group_flags[3]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_on_all_symbols_r12, (int8_t)-34, (int8_t)-3)); - } - } - if (group_flags[4]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(cell_resel_serving_freq_info_v1310.is_present(), 1)); - HANDLE_CODE(bref.pack(redist_serving_info_r13.is_present(), 1)); - HANDLE_CODE(bref.pack(cell_sel_info_ce_r13.is_present(), 1)); - HANDLE_CODE(bref.pack(t_resel_eutra_ce_r13_present, 1)); - if (cell_resel_serving_freq_info_v1310.is_present()) { - HANDLE_CODE(cell_resel_serving_freq_info_v1310->pack(bref)); - } - if (redist_serving_info_r13.is_present()) { - HANDLE_CODE(redist_serving_info_r13->pack(bref)); - } - if (cell_sel_info_ce_r13.is_present()) { - HANDLE_CODE(cell_sel_info_ce_r13->pack(bref)); - } - if (t_resel_eutra_ce_r13_present) { - HANDLE_CODE(pack_integer(bref, t_resel_eutra_ce_r13, (uint8_t)0u, (uint8_t)15u)); - } - } - if (group_flags[5]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(cell_sel_info_ce1_r13.is_present(), 1)); - if (cell_sel_info_ce1_r13.is_present()) { - HANDLE_CODE(cell_sel_info_ce1_r13->pack(bref)); - } - } - if (group_flags[6]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(cell_sel_info_ce1_v1360.is_present(), 1)); - if (cell_sel_info_ce1_v1360.is_present()) { - HANDLE_CODE(cell_sel_info_ce1_v1360->pack(bref)); - } - } - if (group_flags[7]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(cell_resel_info_common_v1460.is_present(), 1)); - if (cell_resel_info_common_v1460.is_present()) { - HANDLE_CODE(cell_resel_info_common_v1460->pack(bref)); - } - } - if (group_flags[8]) { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(bref.pack(cell_resel_info_hsdn_r15.is_present(), 1)); - HANDLE_CODE(bref.pack(cell_sel_info_ce_v1530.is_present(), 1)); - HANDLE_CODE(bref.pack(crs_intf_mitig_neigh_cells_ce_r15_present, 1)); - if (cell_resel_info_hsdn_r15.is_present()) { - HANDLE_CODE(cell_resel_info_hsdn_r15->pack(bref)); - } - if (cell_sel_info_ce_v1530.is_present()) { - HANDLE_CODE(cell_sel_info_ce_v1530->pack(bref)); - } - } - } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type3_s::unpack(cbit_ref& bref) +void pos_sys_info_r15_ies_s::to_json(json_writer& j) const { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(cell_resel_info_common.speed_state_resel_pars_present, 1)); - HANDLE_CODE(cell_resel_info_common.q_hyst.unpack(bref)); - if (cell_resel_info_common.speed_state_resel_pars_present) { - HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.mob_state_params.unpack(bref)); - HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_medium.unpack(bref)); - HANDLE_CODE(cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_high.unpack(bref)); - } - HANDLE_CODE(bref.unpack(cell_resel_serving_freq_info.s_non_intra_search_present, 1)); - if (cell_resel_serving_freq_info.s_non_intra_search_present) { - HANDLE_CODE(unpack_integer(cell_resel_serving_freq_info.s_non_intra_search, bref, (uint8_t)0u, (uint8_t)31u)); - } - HANDLE_CODE(unpack_integer(cell_resel_serving_freq_info.thresh_serving_low, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(cell_resel_serving_freq_info.cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.p_max_present, 1)); - HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.s_intra_search_present, 1)); - HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.allowed_meas_bw_present, 1)); - HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.t_resel_eutra_sf_present, 1)); - HANDLE_CODE(unpack_integer(intra_freq_cell_resel_info.q_rx_lev_min, bref, (int8_t)-70, (int8_t)-22)); - if (intra_freq_cell_resel_info.p_max_present) { - HANDLE_CODE(unpack_integer(intra_freq_cell_resel_info.p_max, bref, (int8_t)-30, (int8_t)33)); - } - if (intra_freq_cell_resel_info.s_intra_search_present) { - HANDLE_CODE(unpack_integer(intra_freq_cell_resel_info.s_intra_search, bref, (uint8_t)0u, (uint8_t)31u)); + j.start_obj(); + j.start_array("posSIB-TypeAndInfo-r15"); + for (const auto& e1 : pos_sib_type_and_info_r15) { + e1.to_json(j); } - if (intra_freq_cell_resel_info.allowed_meas_bw_present) { - HANDLE_CODE(intra_freq_cell_resel_info.allowed_meas_bw.unpack(bref)); + j.end_array(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } - HANDLE_CODE(bref.unpack(intra_freq_cell_resel_info.presence_ant_port1, 1)); - HANDLE_CODE(intra_freq_cell_resel_info.neigh_cell_cfg.unpack(bref)); - HANDLE_CODE(unpack_integer(intra_freq_cell_resel_info.t_resel_eutra, bref, (uint8_t)0u, (uint8_t)7u)); - if (intra_freq_cell_resel_info.t_resel_eutra_sf_present) { - HANDLE_CODE(intra_freq_cell_resel_info.t_resel_eutra_sf.unpack(bref)); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } + j.end_obj(); +} - if (ext) { - ext_groups_unpacker_guard group_flags(9); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool s_intra_search_v920_present; - HANDLE_CODE(bref.unpack(s_intra_search_v920_present, 1)); - s_intra_search_v920.set_present(s_intra_search_v920_present); - bool s_non_intra_search_v920_present; - HANDLE_CODE(bref.unpack(s_non_intra_search_v920_present, 1)); - s_non_intra_search_v920.set_present(s_non_intra_search_v920_present); - HANDLE_CODE(bref.unpack(q_qual_min_r9_present, 1)); - HANDLE_CODE(bref.unpack(thresh_serving_low_q_r9_present, 1)); - if (s_intra_search_v920.is_present()) { - HANDLE_CODE(unpack_integer(s_intra_search_v920->s_intra_search_p_r9, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(s_intra_search_v920->s_intra_search_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); - } - if (s_non_intra_search_v920.is_present()) { - HANDLE_CODE(unpack_integer(s_non_intra_search_v920->s_non_intra_search_p_r9, bref, (uint8_t)0u, (uint8_t)31u)); - HANDLE_CODE(unpack_integer(s_non_intra_search_v920->s_non_intra_search_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); - } - if (q_qual_min_r9_present) { - HANDLE_CODE(unpack_integer(q_qual_min_r9, bref, (int8_t)-34, (int8_t)-3)); - } - if (thresh_serving_low_q_r9_present) { - HANDLE_CODE(unpack_integer(thresh_serving_low_q_r9, bref, (uint8_t)0u, (uint8_t)31u)); - } - } - if (group_flags[2]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(q_qual_min_wb_r11_present, 1)); - if (q_qual_min_wb_r11_present) { - HANDLE_CODE(unpack_integer(q_qual_min_wb_r11, bref, (int8_t)-34, (int8_t)-3)); - } - } - if (group_flags[3]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(q_qual_min_rsrq_on_all_symbols_r12_present, 1)); - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - HANDLE_CODE(unpack_integer(q_qual_min_rsrq_on_all_symbols_r12, bref, (int8_t)-34, (int8_t)-3)); - } - } - if (group_flags[4]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool cell_resel_serving_freq_info_v1310_present; - HANDLE_CODE(bref.unpack(cell_resel_serving_freq_info_v1310_present, 1)); - cell_resel_serving_freq_info_v1310.set_present(cell_resel_serving_freq_info_v1310_present); - bool redist_serving_info_r13_present; - HANDLE_CODE(bref.unpack(redist_serving_info_r13_present, 1)); - redist_serving_info_r13.set_present(redist_serving_info_r13_present); - bool cell_sel_info_ce_r13_present; - HANDLE_CODE(bref.unpack(cell_sel_info_ce_r13_present, 1)); - cell_sel_info_ce_r13.set_present(cell_sel_info_ce_r13_present); - HANDLE_CODE(bref.unpack(t_resel_eutra_ce_r13_present, 1)); - if (cell_resel_serving_freq_info_v1310.is_present()) { - HANDLE_CODE(cell_resel_serving_freq_info_v1310->unpack(bref)); - } - if (redist_serving_info_r13.is_present()) { - HANDLE_CODE(redist_serving_info_r13->unpack(bref)); - } - if (cell_sel_info_ce_r13.is_present()) { - HANDLE_CODE(cell_sel_info_ce_r13->unpack(bref)); - } - if (t_resel_eutra_ce_r13_present) { - HANDLE_CODE(unpack_integer(t_resel_eutra_ce_r13, bref, (uint8_t)0u, (uint8_t)15u)); - } - } - if (group_flags[5]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool cell_sel_info_ce1_r13_present; - HANDLE_CODE(bref.unpack(cell_sel_info_ce1_r13_present, 1)); - cell_sel_info_ce1_r13.set_present(cell_sel_info_ce1_r13_present); - if (cell_sel_info_ce1_r13.is_present()) { - HANDLE_CODE(cell_sel_info_ce1_r13->unpack(bref)); - } - } - if (group_flags[6]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool cell_sel_info_ce1_v1360_present; - HANDLE_CODE(bref.unpack(cell_sel_info_ce1_v1360_present, 1)); - cell_sel_info_ce1_v1360.set_present(cell_sel_info_ce1_v1360_present); - if (cell_sel_info_ce1_v1360.is_present()) { - HANDLE_CODE(cell_sel_info_ce1_v1360->unpack(bref)); - } - } - if (group_flags[7]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool cell_resel_info_common_v1460_present; - HANDLE_CODE(bref.unpack(cell_resel_info_common_v1460_present, 1)); - cell_resel_info_common_v1460.set_present(cell_resel_info_common_v1460_present); - if (cell_resel_info_common_v1460.is_present()) { - HANDLE_CODE(cell_resel_info_common_v1460->unpack(bref)); - } - } - if (group_flags[8]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool cell_resel_info_hsdn_r15_present; - HANDLE_CODE(bref.unpack(cell_resel_info_hsdn_r15_present, 1)); - cell_resel_info_hsdn_r15.set_present(cell_resel_info_hsdn_r15_present); - bool cell_sel_info_ce_v1530_present; - HANDLE_CODE(bref.unpack(cell_sel_info_ce_v1530_present, 1)); - cell_sel_info_ce_v1530.set_present(cell_sel_info_ce_v1530_present); - HANDLE_CODE(bref.unpack(crs_intf_mitig_neigh_cells_ce_r15_present, 1)); - if (cell_resel_info_hsdn_r15.is_present()) { - HANDLE_CODE(cell_resel_info_hsdn_r15->unpack(bref)); - } - if (cell_sel_info_ce_v1530.is_present()) { - HANDLE_CODE(cell_sel_info_ce_v1530->unpack(bref)); - } - } +void pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::destroy_() +{ + switch (type_) { + case types::pos_sib1_minus1_r15: + c.destroy(); + break; + case types::pos_sib1_minus2_r15: + c.destroy(); + break; + case types::pos_sib1_minus3_r15: + c.destroy(); + break; + case types::pos_sib1_minus4_r15: + c.destroy(); + break; + case types::pos_sib1_minus5_r15: + c.destroy(); + break; + case types::pos_sib1_minus6_r15: + c.destroy(); + break; + case types::pos_sib1_minus7_r15: + c.destroy(); + break; + case types::pos_sib2_minus1_r15: + c.destroy(); + break; + case types::pos_sib2_minus2_r15: + c.destroy(); + break; + case types::pos_sib2_minus3_r15: + c.destroy(); + break; + case types::pos_sib2_minus4_r15: + c.destroy(); + break; + case types::pos_sib2_minus5_r15: + c.destroy(); + break; + case types::pos_sib2_minus6_r15: + c.destroy(); + break; + case types::pos_sib2_minus7_r15: + c.destroy(); + break; + case types::pos_sib2_minus8_r15: + c.destroy(); + break; + case types::pos_sib2_minus9_r15: + c.destroy(); + break; + case types::pos_sib2_minus10_r15: + c.destroy(); + break; + case types::pos_sib2_minus11_r15: + c.destroy(); + break; + case types::pos_sib2_minus12_r15: + c.destroy(); + break; + case types::pos_sib2_minus13_r15: + c.destroy(); + break; + case types::pos_sib2_minus14_r15: + c.destroy(); + break; + case types::pos_sib2_minus15_r15: + c.destroy(); + break; + case types::pos_sib2_minus16_r15: + c.destroy(); + break; + case types::pos_sib2_minus17_r15: + c.destroy(); + break; + case types::pos_sib2_minus18_r15: + c.destroy(); + break; + case types::pos_sib2_minus19_r15: + c.destroy(); + break; + case types::pos_sib3_minus1_r15: + c.destroy(); + break; + default: + break; } - return SRSASN_SUCCESS; } -void sib_type3_s::to_json(json_writer& j) const +void pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::set(types::options e) { - j.start_obj(); - j.write_fieldname("cellReselectionInfoCommon"); - j.start_obj(); - j.write_str("q-Hyst", cell_resel_info_common.q_hyst.to_string()); - if (cell_resel_info_common.speed_state_resel_pars_present) { - j.write_fieldname("speedStateReselectionPars"); - j.start_obj(); - j.write_fieldname("mobilityStateParameters"); - cell_resel_info_common.speed_state_resel_pars.mob_state_params.to_json(j); - j.write_fieldname("q-HystSF"); - j.start_obj(); - j.write_str("sf-Medium", cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_medium.to_string()); - j.write_str("sf-High", cell_resel_info_common.speed_state_resel_pars.q_hyst_sf.sf_high.to_string()); - j.end_obj(); - j.end_obj(); - } - j.end_obj(); - j.write_fieldname("cellReselectionServingFreqInfo"); - j.start_obj(); - if (cell_resel_serving_freq_info.s_non_intra_search_present) { - j.write_int("s-NonIntraSearch", cell_resel_serving_freq_info.s_non_intra_search); + destroy_(); + type_ = e; + switch (type_) { + case types::pos_sib1_minus1_r15: + c.init(); + break; + case types::pos_sib1_minus2_r15: + c.init(); + break; + case types::pos_sib1_minus3_r15: + c.init(); + break; + case types::pos_sib1_minus4_r15: + c.init(); + break; + case types::pos_sib1_minus5_r15: + c.init(); + break; + case types::pos_sib1_minus6_r15: + c.init(); + break; + case types::pos_sib1_minus7_r15: + c.init(); + break; + case types::pos_sib2_minus1_r15: + c.init(); + break; + case types::pos_sib2_minus2_r15: + c.init(); + break; + case types::pos_sib2_minus3_r15: + c.init(); + break; + case types::pos_sib2_minus4_r15: + c.init(); + break; + case types::pos_sib2_minus5_r15: + c.init(); + break; + case types::pos_sib2_minus6_r15: + c.init(); + break; + case types::pos_sib2_minus7_r15: + c.init(); + break; + case types::pos_sib2_minus8_r15: + c.init(); + break; + case types::pos_sib2_minus9_r15: + c.init(); + break; + case types::pos_sib2_minus10_r15: + c.init(); + break; + case types::pos_sib2_minus11_r15: + c.init(); + break; + case types::pos_sib2_minus12_r15: + c.init(); + break; + case types::pos_sib2_minus13_r15: + c.init(); + break; + case types::pos_sib2_minus14_r15: + c.init(); + break; + case types::pos_sib2_minus15_r15: + c.init(); + break; + case types::pos_sib2_minus16_r15: + c.init(); + break; + case types::pos_sib2_minus17_r15: + c.init(); + break; + case types::pos_sib2_minus18_r15: + c.init(); + break; + case types::pos_sib2_minus19_r15: + c.init(); + break; + case types::pos_sib3_minus1_r15: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); } - j.write_int("threshServingLow", cell_resel_serving_freq_info.thresh_serving_low); - j.write_int("cellReselectionPriority", cell_resel_serving_freq_info.cell_resel_prio); - j.end_obj(); - j.write_fieldname("intraFreqCellReselectionInfo"); - j.start_obj(); - j.write_int("q-RxLevMin", intra_freq_cell_resel_info.q_rx_lev_min); - if (intra_freq_cell_resel_info.p_max_present) { - j.write_int("p-Max", intra_freq_cell_resel_info.p_max); - } - if (intra_freq_cell_resel_info.s_intra_search_present) { - j.write_int("s-IntraSearch", intra_freq_cell_resel_info.s_intra_search); - } - if (intra_freq_cell_resel_info.allowed_meas_bw_present) { - j.write_str("allowedMeasBandwidth", intra_freq_cell_resel_info.allowed_meas_bw.to_string()); - } - j.write_bool("presenceAntennaPort1", intra_freq_cell_resel_info.presence_ant_port1); - j.write_str("neighCellConfig", intra_freq_cell_resel_info.neigh_cell_cfg.to_string()); - j.write_int("t-ReselectionEUTRA", intra_freq_cell_resel_info.t_resel_eutra); - if (intra_freq_cell_resel_info.t_resel_eutra_sf_present) { - j.write_fieldname("t-ReselectionEUTRA-SF"); - intra_freq_cell_resel_info.t_resel_eutra_sf.to_json(j); - } - j.end_obj(); - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (s_intra_search_v920.is_present()) { - j.write_fieldname("s-IntraSearch-v920"); - j.start_obj(); - j.write_int("s-IntraSearchP-r9", s_intra_search_v920->s_intra_search_p_r9); - j.write_int("s-IntraSearchQ-r9", s_intra_search_v920->s_intra_search_q_r9); - j.end_obj(); - } - if (s_non_intra_search_v920.is_present()) { - j.write_fieldname("s-NonIntraSearch-v920"); - j.start_obj(); - j.write_int("s-NonIntraSearchP-r9", s_non_intra_search_v920->s_non_intra_search_p_r9); - j.write_int("s-NonIntraSearchQ-r9", s_non_intra_search_v920->s_non_intra_search_q_r9); - j.end_obj(); - } - if (q_qual_min_r9_present) { - j.write_int("q-QualMin-r9", q_qual_min_r9); - } - if (thresh_serving_low_q_r9_present) { - j.write_int("threshServingLowQ-r9", thresh_serving_low_q_r9); - } - if (q_qual_min_wb_r11_present) { - j.write_int("q-QualMinWB-r11", q_qual_min_wb_r11); - } - if (q_qual_min_rsrq_on_all_symbols_r12_present) { - j.write_int("q-QualMinRSRQ-OnAllSymbols-r12", q_qual_min_rsrq_on_all_symbols_r12); - } - if (cell_resel_serving_freq_info_v1310.is_present()) { - j.write_fieldname("cellReselectionServingFreqInfo-v1310"); - cell_resel_serving_freq_info_v1310->to_json(j); - } - if (redist_serving_info_r13.is_present()) { - j.write_fieldname("redistributionServingInfo-r13"); - redist_serving_info_r13->to_json(j); - } - if (cell_sel_info_ce_r13.is_present()) { - j.write_fieldname("cellSelectionInfoCE-r13"); - cell_sel_info_ce_r13->to_json(j); - } - if (t_resel_eutra_ce_r13_present) { - j.write_int("t-ReselectionEUTRA-CE-r13", t_resel_eutra_ce_r13); - } - if (cell_sel_info_ce1_r13.is_present()) { - j.write_fieldname("cellSelectionInfoCE1-r13"); - cell_sel_info_ce1_r13->to_json(j); - } - if (cell_sel_info_ce1_v1360.is_present()) { - j.write_fieldname("cellSelectionInfoCE1-v1360"); - cell_sel_info_ce1_v1360->to_json(j); - } - if (cell_resel_info_common_v1460.is_present()) { - j.write_fieldname("cellReselectionInfoCommon-v1460"); - cell_resel_info_common_v1460->to_json(j); - } - if (cell_resel_info_hsdn_r15.is_present()) { - j.write_fieldname("cellReselectionInfoHSDN-r15"); - cell_resel_info_hsdn_r15->to_json(j); - } - if (cell_sel_info_ce_v1530.is_present()) { - j.write_fieldname("cellSelectionInfoCE-v1530"); - cell_sel_info_ce_v1530->to_json(j); - } - if (crs_intf_mitig_neigh_cells_ce_r15_present) { - j.write_str("crs-IntfMitigNeighCellsCE-r15", "enabled"); - } - } - j.end_obj(); -} - -std::string sib_type3_s::cell_resel_info_common_s_::q_hyst_opts::to_string() const -{ - static const char* options[] = {"dB0", - "dB1", - "dB2", - "dB3", - "dB4", - "dB5", - "dB6", - "dB8", - "dB10", - "dB12", - "dB14", - "dB16", - "dB18", - "dB20", - "dB22", - "dB24"}; - return convert_enum_idx(options, 16, value, "sib_type3_s::cell_resel_info_common_s_::q_hyst_e_"); -} -uint8_t sib_type3_s::cell_resel_info_common_s_::q_hyst_opts::to_number() const -{ - static const uint8_t options[] = {0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24}; - return map_enum_number(options, 16, value, "sib_type3_s::cell_resel_info_common_s_::q_hyst_e_"); -} - -std::string -sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_medium_opts::to_string() const -{ - static const char* options[] = {"dB-6", "dB-4", "dB-2", "dB0"}; - return convert_enum_idx( - options, - 4, - value, - "sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_medium_e_"); -} -int8_t -sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_medium_opts::to_number() const -{ - static const int8_t options[] = {-6, -4, -2, 0}; - return map_enum_number( - options, - 4, - value, - "sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_medium_e_"); -} - -std::string -sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_high_opts::to_string() const -{ - static const char* options[] = {"dB-6", "dB-4", "dB-2", "dB0"}; - return convert_enum_idx( - options, 4, value, "sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_high_e_"); -} -int8_t sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_high_opts::to_number() const -{ - static const int8_t options[] = {-6, -4, -2, 0}; - return map_enum_number( - options, 4, value, "sib_type3_s::cell_resel_info_common_s_::speed_state_resel_pars_s_::q_hyst_sf_s_::sf_high_e_"); -} - -// SystemInformationBlockType4 ::= SEQUENCE -SRSASN_CODE sib_type4_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(intra_freq_neigh_cell_list_present, 1)); - HANDLE_CODE(bref.pack(intra_freq_black_cell_list_present, 1)); - HANDLE_CODE(bref.pack(csg_pci_range_present, 1)); - - if (intra_freq_neigh_cell_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, intra_freq_neigh_cell_list, 1, 16)); - } - if (intra_freq_black_cell_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, intra_freq_black_cell_list, 1, 16)); - } - if (csg_pci_range_present) { - HANDLE_CODE(csg_pci_range.pack(bref)); - } - - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= late_non_crit_ext_present; - group_flags[1] |= intra_freq_neigh_hsdn_cell_list_r15.is_present(); - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(intra_freq_neigh_hsdn_cell_list_r15.is_present(), 1)); - if (intra_freq_neigh_hsdn_cell_list_r15.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *intra_freq_neigh_hsdn_cell_list_r15, 1, 16)); - } - } - } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type4_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(intra_freq_neigh_cell_list_present, 1)); - HANDLE_CODE(bref.unpack(intra_freq_black_cell_list_present, 1)); - HANDLE_CODE(bref.unpack(csg_pci_range_present, 1)); - - if (intra_freq_neigh_cell_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(intra_freq_neigh_cell_list, bref, 1, 16)); - } - if (intra_freq_black_cell_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(intra_freq_black_cell_list, bref, 1, 16)); - } - if (csg_pci_range_present) { - HANDLE_CODE(csg_pci_range.unpack(bref)); - } - - if (ext) { - ext_groups_unpacker_guard group_flags(2); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool intra_freq_neigh_hsdn_cell_list_r15_present; - HANDLE_CODE(bref.unpack(intra_freq_neigh_hsdn_cell_list_r15_present, 1)); - intra_freq_neigh_hsdn_cell_list_r15.set_present(intra_freq_neigh_hsdn_cell_list_r15_present); - if (intra_freq_neigh_hsdn_cell_list_r15.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*intra_freq_neigh_hsdn_cell_list_r15, bref, 1, 16)); - } - } - } - return SRSASN_SUCCESS; -} -void sib_type4_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (intra_freq_neigh_cell_list_present) { - j.start_array("intraFreqNeighCellList"); - for (const auto& e1 : intra_freq_neigh_cell_list) { - e1.to_json(j); - } - j.end_array(); - } - if (intra_freq_black_cell_list_present) { - j.start_array("intraFreqBlackCellList"); - for (const auto& e1 : intra_freq_black_cell_list) { - e1.to_json(j); - } - j.end_array(); - } - if (csg_pci_range_present) { - j.write_fieldname("csg-PhysCellIdRange"); - csg_pci_range.to_json(j); - } - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (intra_freq_neigh_hsdn_cell_list_r15.is_present()) { - j.start_array("intraFreqNeighHSDN-CellList-r15"); - for (const auto& e1 : *intra_freq_neigh_hsdn_cell_list_r15) { - e1.to_json(j); - } - j.end_array(); - } - } - j.end_obj(); -} - -// SystemInformationBlockType5 ::= SEQUENCE -SRSASN_CODE sib_type5_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list, 1, 8)); - - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= late_non_crit_ext_present; - group_flags[1] |= inter_freq_carrier_freq_list_v1250.is_present(); - group_flags[1] |= inter_freq_carrier_freq_list_ext_r12.is_present(); - group_flags[2] |= inter_freq_carrier_freq_list_ext_v1280.is_present(); - group_flags[3] |= inter_freq_carrier_freq_list_v1310.is_present(); - group_flags[3] |= inter_freq_carrier_freq_list_ext_v1310.is_present(); - group_flags[4] |= inter_freq_carrier_freq_list_v1350.is_present(); - group_flags[4] |= inter_freq_carrier_freq_list_ext_v1350.is_present(); - group_flags[5] |= inter_freq_carrier_freq_list_ext_v1360.is_present(); - group_flags[6] |= scptm_freq_offset_r14_present; - group_flags[7] |= inter_freq_carrier_freq_list_v1530.is_present(); - group_flags[7] |= inter_freq_carrier_freq_list_ext_v1530.is_present(); - group_flags[7] |= meas_idle_cfg_sib_r15.is_present(); - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v1250.is_present(), 1)); - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_r12.is_present(), 1)); - if (inter_freq_carrier_freq_list_v1250.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_v1250, 1, 8)); - } - if (inter_freq_carrier_freq_list_ext_r12.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_r12, 1, 8)); - } - } - if (group_flags[2]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1280.is_present(), 1)); - if (inter_freq_carrier_freq_list_ext_v1280.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1280, 1, 8)); - } - } - if (group_flags[3]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v1310.is_present(), 1)); - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1310.is_present(), 1)); - if (inter_freq_carrier_freq_list_v1310.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_v1310, 1, 8)); - } - if (inter_freq_carrier_freq_list_ext_v1310.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1310, 1, 8)); - } - } - if (group_flags[4]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v1350.is_present(), 1)); - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1350.is_present(), 1)); - if (inter_freq_carrier_freq_list_v1350.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_v1350, 1, 8)); - } - if (inter_freq_carrier_freq_list_ext_v1350.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1350, 1, 8)); - } - } - if (group_flags[5]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1360.is_present(), 1)); - if (inter_freq_carrier_freq_list_ext_v1360.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1360, 1, 8)); - } - } - if (group_flags[6]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(scptm_freq_offset_r14_present, 1)); - if (scptm_freq_offset_r14_present) { - HANDLE_CODE(pack_integer(bref, scptm_freq_offset_r14, (uint8_t)1u, (uint8_t)8u)); - } - } - if (group_flags[7]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v1530.is_present(), 1)); - HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_ext_v1530.is_present(), 1)); - HANDLE_CODE(bref.pack(meas_idle_cfg_sib_r15.is_present(), 1)); - if (inter_freq_carrier_freq_list_v1530.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_v1530, 1, 8)); - } - if (inter_freq_carrier_freq_list_ext_v1530.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *inter_freq_carrier_freq_list_ext_v1530, 1, 8)); - } - if (meas_idle_cfg_sib_r15.is_present()) { - HANDLE_CODE(meas_idle_cfg_sib_r15->pack(bref)); - } - } - } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type5_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list, bref, 1, 8)); - - if (ext) { - ext_groups_unpacker_guard group_flags(8); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool inter_freq_carrier_freq_list_v1250_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v1250_present, 1)); - inter_freq_carrier_freq_list_v1250.set_present(inter_freq_carrier_freq_list_v1250_present); - bool inter_freq_carrier_freq_list_ext_r12_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_r12_present, 1)); - inter_freq_carrier_freq_list_ext_r12.set_present(inter_freq_carrier_freq_list_ext_r12_present); - if (inter_freq_carrier_freq_list_v1250.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_v1250, bref, 1, 8)); - } - if (inter_freq_carrier_freq_list_ext_r12.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_r12, bref, 1, 8)); - } - } - if (group_flags[2]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool inter_freq_carrier_freq_list_ext_v1280_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1280_present, 1)); - inter_freq_carrier_freq_list_ext_v1280.set_present(inter_freq_carrier_freq_list_ext_v1280_present); - if (inter_freq_carrier_freq_list_ext_v1280.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1280, bref, 1, 8)); - } - } - if (group_flags[3]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool inter_freq_carrier_freq_list_v1310_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v1310_present, 1)); - inter_freq_carrier_freq_list_v1310.set_present(inter_freq_carrier_freq_list_v1310_present); - bool inter_freq_carrier_freq_list_ext_v1310_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1310_present, 1)); - inter_freq_carrier_freq_list_ext_v1310.set_present(inter_freq_carrier_freq_list_ext_v1310_present); - if (inter_freq_carrier_freq_list_v1310.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_v1310, bref, 1, 8)); - } - if (inter_freq_carrier_freq_list_ext_v1310.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1310, bref, 1, 8)); - } - } - if (group_flags[4]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool inter_freq_carrier_freq_list_v1350_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v1350_present, 1)); - inter_freq_carrier_freq_list_v1350.set_present(inter_freq_carrier_freq_list_v1350_present); - bool inter_freq_carrier_freq_list_ext_v1350_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1350_present, 1)); - inter_freq_carrier_freq_list_ext_v1350.set_present(inter_freq_carrier_freq_list_ext_v1350_present); - if (inter_freq_carrier_freq_list_v1350.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_v1350, bref, 1, 8)); - } - if (inter_freq_carrier_freq_list_ext_v1350.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1350, bref, 1, 8)); - } - } - if (group_flags[5]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool inter_freq_carrier_freq_list_ext_v1360_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1360_present, 1)); - inter_freq_carrier_freq_list_ext_v1360.set_present(inter_freq_carrier_freq_list_ext_v1360_present); - if (inter_freq_carrier_freq_list_ext_v1360.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1360, bref, 1, 8)); - } - } - if (group_flags[6]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(scptm_freq_offset_r14_present, 1)); - if (scptm_freq_offset_r14_present) { - HANDLE_CODE(unpack_integer(scptm_freq_offset_r14, bref, (uint8_t)1u, (uint8_t)8u)); - } - } - if (group_flags[7]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool inter_freq_carrier_freq_list_v1530_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v1530_present, 1)); - inter_freq_carrier_freq_list_v1530.set_present(inter_freq_carrier_freq_list_v1530_present); - bool inter_freq_carrier_freq_list_ext_v1530_present; - HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_ext_v1530_present, 1)); - inter_freq_carrier_freq_list_ext_v1530.set_present(inter_freq_carrier_freq_list_ext_v1530_present); - bool meas_idle_cfg_sib_r15_present; - HANDLE_CODE(bref.unpack(meas_idle_cfg_sib_r15_present, 1)); - meas_idle_cfg_sib_r15.set_present(meas_idle_cfg_sib_r15_present); - if (inter_freq_carrier_freq_list_v1530.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_v1530, bref, 1, 8)); - } - if (inter_freq_carrier_freq_list_ext_v1530.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*inter_freq_carrier_freq_list_ext_v1530, bref, 1, 8)); - } - if (meas_idle_cfg_sib_r15.is_present()) { - HANDLE_CODE(meas_idle_cfg_sib_r15->unpack(bref)); - } - } - } - return SRSASN_SUCCESS; -} -void sib_type5_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.start_array("interFreqCarrierFreqList"); - for (const auto& e1 : inter_freq_carrier_freq_list) { - e1.to_json(j); - } - j.end_array(); - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (inter_freq_carrier_freq_list_v1250.is_present()) { - j.start_array("interFreqCarrierFreqList-v1250"); - for (const auto& e1 : *inter_freq_carrier_freq_list_v1250) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_carrier_freq_list_ext_r12.is_present()) { - j.start_array("interFreqCarrierFreqListExt-r12"); - for (const auto& e1 : *inter_freq_carrier_freq_list_ext_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_carrier_freq_list_ext_v1280.is_present()) { - j.start_array("interFreqCarrierFreqListExt-v1280"); - for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1280) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_carrier_freq_list_v1310.is_present()) { - j.start_array("interFreqCarrierFreqList-v1310"); - for (const auto& e1 : *inter_freq_carrier_freq_list_v1310) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_carrier_freq_list_ext_v1310.is_present()) { - j.start_array("interFreqCarrierFreqListExt-v1310"); - for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1310) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_carrier_freq_list_v1350.is_present()) { - j.start_array("interFreqCarrierFreqList-v1350"); - for (const auto& e1 : *inter_freq_carrier_freq_list_v1350) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_carrier_freq_list_ext_v1350.is_present()) { - j.start_array("interFreqCarrierFreqListExt-v1350"); - for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1350) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_carrier_freq_list_ext_v1360.is_present()) { - j.start_array("interFreqCarrierFreqListExt-v1360"); - for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1360) { - e1.to_json(j); - } - j.end_array(); - } - if (scptm_freq_offset_r14_present) { - j.write_int("scptm-FreqOffset-r14", scptm_freq_offset_r14); - } - if (inter_freq_carrier_freq_list_v1530.is_present()) { - j.start_array("interFreqCarrierFreqList-v1530"); - for (const auto& e1 : *inter_freq_carrier_freq_list_v1530) { - e1.to_json(j); - } - j.end_array(); - } - if (inter_freq_carrier_freq_list_ext_v1530.is_present()) { - j.start_array("interFreqCarrierFreqListExt-v1530"); - for (const auto& e1 : *inter_freq_carrier_freq_list_ext_v1530) { - e1.to_json(j); - } - j.end_array(); - } - if (meas_idle_cfg_sib_r15.is_present()) { - j.write_fieldname("measIdleConfigSIB-r15"); - meas_idle_cfg_sib_r15->to_json(j); - } - } - j.end_obj(); -} - -// SystemInformationBlockType6 ::= SEQUENCE -SRSASN_CODE sib_type6_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(carrier_freq_list_utra_fdd_present, 1)); - HANDLE_CODE(bref.pack(carrier_freq_list_utra_tdd_present, 1)); - HANDLE_CODE(bref.pack(t_resel_utra_sf_present, 1)); - - if (carrier_freq_list_utra_fdd_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freq_list_utra_fdd, 1, 16)); - } - if (carrier_freq_list_utra_tdd_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freq_list_utra_tdd, 1, 16)); - } - HANDLE_CODE(pack_integer(bref, t_resel_utra, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_utra_sf_present) { - HANDLE_CODE(t_resel_utra_sf.pack(bref)); - } - - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= late_non_crit_ext_present; - group_flags[1] |= carrier_freq_list_utra_fdd_v1250.is_present(); - group_flags[1] |= carrier_freq_list_utra_tdd_v1250.is_present(); - group_flags[1] |= carrier_freq_list_utra_fdd_ext_r12.is_present(); - group_flags[1] |= carrier_freq_list_utra_tdd_ext_r12.is_present(); - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(carrier_freq_list_utra_fdd_v1250.is_present(), 1)); - HANDLE_CODE(bref.pack(carrier_freq_list_utra_tdd_v1250.is_present(), 1)); - HANDLE_CODE(bref.pack(carrier_freq_list_utra_fdd_ext_r12.is_present(), 1)); - HANDLE_CODE(bref.pack(carrier_freq_list_utra_tdd_ext_r12.is_present(), 1)); - if (carrier_freq_list_utra_fdd_v1250.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *carrier_freq_list_utra_fdd_v1250, 1, 16)); - } - if (carrier_freq_list_utra_tdd_v1250.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *carrier_freq_list_utra_tdd_v1250, 1, 16)); - } - if (carrier_freq_list_utra_fdd_ext_r12.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *carrier_freq_list_utra_fdd_ext_r12, 1, 16)); - } - if (carrier_freq_list_utra_tdd_ext_r12.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *carrier_freq_list_utra_tdd_ext_r12, 1, 16)); - } - } - } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type6_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(carrier_freq_list_utra_fdd_present, 1)); - HANDLE_CODE(bref.unpack(carrier_freq_list_utra_tdd_present, 1)); - HANDLE_CODE(bref.unpack(t_resel_utra_sf_present, 1)); - - if (carrier_freq_list_utra_fdd_present) { - HANDLE_CODE(unpack_dyn_seq_of(carrier_freq_list_utra_fdd, bref, 1, 16)); - } - if (carrier_freq_list_utra_tdd_present) { - HANDLE_CODE(unpack_dyn_seq_of(carrier_freq_list_utra_tdd, bref, 1, 16)); - } - HANDLE_CODE(unpack_integer(t_resel_utra, bref, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_utra_sf_present) { - HANDLE_CODE(t_resel_utra_sf.unpack(bref)); - } - - if (ext) { - ext_groups_unpacker_guard group_flags(2); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool carrier_freq_list_utra_fdd_v1250_present; - HANDLE_CODE(bref.unpack(carrier_freq_list_utra_fdd_v1250_present, 1)); - carrier_freq_list_utra_fdd_v1250.set_present(carrier_freq_list_utra_fdd_v1250_present); - bool carrier_freq_list_utra_tdd_v1250_present; - HANDLE_CODE(bref.unpack(carrier_freq_list_utra_tdd_v1250_present, 1)); - carrier_freq_list_utra_tdd_v1250.set_present(carrier_freq_list_utra_tdd_v1250_present); - bool carrier_freq_list_utra_fdd_ext_r12_present; - HANDLE_CODE(bref.unpack(carrier_freq_list_utra_fdd_ext_r12_present, 1)); - carrier_freq_list_utra_fdd_ext_r12.set_present(carrier_freq_list_utra_fdd_ext_r12_present); - bool carrier_freq_list_utra_tdd_ext_r12_present; - HANDLE_CODE(bref.unpack(carrier_freq_list_utra_tdd_ext_r12_present, 1)); - carrier_freq_list_utra_tdd_ext_r12.set_present(carrier_freq_list_utra_tdd_ext_r12_present); - if (carrier_freq_list_utra_fdd_v1250.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*carrier_freq_list_utra_fdd_v1250, bref, 1, 16)); - } - if (carrier_freq_list_utra_tdd_v1250.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*carrier_freq_list_utra_tdd_v1250, bref, 1, 16)); - } - if (carrier_freq_list_utra_fdd_ext_r12.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*carrier_freq_list_utra_fdd_ext_r12, bref, 1, 16)); - } - if (carrier_freq_list_utra_tdd_ext_r12.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*carrier_freq_list_utra_tdd_ext_r12, bref, 1, 16)); - } - } - } - return SRSASN_SUCCESS; -} -void sib_type6_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (carrier_freq_list_utra_fdd_present) { - j.start_array("carrierFreqListUTRA-FDD"); - for (const auto& e1 : carrier_freq_list_utra_fdd) { - e1.to_json(j); - } - j.end_array(); - } - if (carrier_freq_list_utra_tdd_present) { - j.start_array("carrierFreqListUTRA-TDD"); - for (const auto& e1 : carrier_freq_list_utra_tdd) { - e1.to_json(j); - } - j.end_array(); - } - j.write_int("t-ReselectionUTRA", t_resel_utra); - if (t_resel_utra_sf_present) { - j.write_fieldname("t-ReselectionUTRA-SF"); - t_resel_utra_sf.to_json(j); - } - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (carrier_freq_list_utra_fdd_v1250.is_present()) { - j.start_array("carrierFreqListUTRA-FDD-v1250"); - for (const auto& e1 : *carrier_freq_list_utra_fdd_v1250) { - e1.to_json(j); - } - j.end_array(); - } - if (carrier_freq_list_utra_tdd_v1250.is_present()) { - j.start_array("carrierFreqListUTRA-TDD-v1250"); - for (const auto& e1 : *carrier_freq_list_utra_tdd_v1250) { - e1.to_json(j); - } - j.end_array(); - } - if (carrier_freq_list_utra_fdd_ext_r12.is_present()) { - j.start_array("carrierFreqListUTRA-FDD-Ext-r12"); - for (const auto& e1 : *carrier_freq_list_utra_fdd_ext_r12) { - e1.to_json(j); - } - j.end_array(); - } - if (carrier_freq_list_utra_tdd_ext_r12.is_present()) { - j.start_array("carrierFreqListUTRA-TDD-Ext-r12"); - for (const auto& e1 : *carrier_freq_list_utra_tdd_ext_r12) { - e1.to_json(j); - } - j.end_array(); - } - } - j.end_obj(); -} - -// SystemInformationBlockType7 ::= SEQUENCE -SRSASN_CODE sib_type7_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(t_resel_geran_sf_present, 1)); - HANDLE_CODE(bref.pack(carrier_freqs_info_list_present, 1)); - - HANDLE_CODE(pack_integer(bref, t_resel_geran, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_geran_sf_present) { - HANDLE_CODE(t_resel_geran_sf.pack(bref)); - } - if (carrier_freqs_info_list_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freqs_info_list, 1, 16)); - } - - if (ext) { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type7_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(t_resel_geran_sf_present, 1)); - HANDLE_CODE(bref.unpack(carrier_freqs_info_list_present, 1)); - - HANDLE_CODE(unpack_integer(t_resel_geran, bref, (uint8_t)0u, (uint8_t)7u)); - if (t_resel_geran_sf_present) { - HANDLE_CODE(t_resel_geran_sf.unpack(bref)); - } - if (carrier_freqs_info_list_present) { - HANDLE_CODE(unpack_dyn_seq_of(carrier_freqs_info_list, bref, 1, 16)); - } - - if (ext) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - } - return SRSASN_SUCCESS; -} -void sib_type7_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("t-ReselectionGERAN", t_resel_geran); - if (t_resel_geran_sf_present) { - j.write_fieldname("t-ReselectionGERAN-SF"); - t_resel_geran_sf.to_json(j); - } - if (carrier_freqs_info_list_present) { - j.start_array("carrierFreqsInfoList"); - for (const auto& e1 : carrier_freqs_info_list) { - e1.to_json(j); - } - j.end_array(); - } - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - } - j.end_obj(); -} - -// SystemInformationBlockType8 ::= SEQUENCE -SRSASN_CODE sib_type8_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(sys_time_info_present, 1)); - HANDLE_CODE(bref.pack(search_win_size_present, 1)); - HANDLE_CODE(bref.pack(params_hrpd_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt_present, 1)); - - if (sys_time_info_present) { - HANDLE_CODE(sys_time_info.pack(bref)); - } - if (search_win_size_present) { - HANDLE_CODE(pack_integer(bref, search_win_size, (uint8_t)0u, (uint8_t)15u)); - } - if (params_hrpd_present) { - HANDLE_CODE(bref.pack(params_hrpd.cell_resel_params_hrpd_present, 1)); - HANDLE_CODE(params_hrpd.pre_regist_info_hrpd.pack(bref)); - if (params_hrpd.cell_resel_params_hrpd_present) { - HANDLE_CODE(params_hrpd.cell_resel_params_hrpd.pack(bref)); - } - } - if (params1_xrtt_present) { - HANDLE_CODE(bref.pack(params1_xrtt.csfb_regist_param1_xrtt_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt.long_code_state1_xrtt_present, 1)); - HANDLE_CODE(bref.pack(params1_xrtt.cell_resel_params1_xrtt_present, 1)); - if (params1_xrtt.csfb_regist_param1_xrtt_present) { - HANDLE_CODE(params1_xrtt.csfb_regist_param1_xrtt.pack(bref)); - } - if (params1_xrtt.long_code_state1_xrtt_present) { - HANDLE_CODE(params1_xrtt.long_code_state1_xrtt.pack(bref)); - } - if (params1_xrtt.cell_resel_params1_xrtt_present) { - HANDLE_CODE(params1_xrtt.cell_resel_params1_xrtt.pack(bref)); - } - } - - if (ext) { - ext_groups_packer_guard group_flags; - group_flags[0] |= late_non_crit_ext_present; - group_flags[1] |= csfb_support_for_dual_rx_ues_r9_present; - group_flags[1] |= cell_resel_params_hrpd_v920.is_present(); - group_flags[1] |= cell_resel_params1_xrtt_v920.is_present(); - group_flags[1] |= csfb_regist_param1_xrtt_v920.is_present(); - group_flags[1] |= ac_barr_cfg1_xrtt_r9.is_present(); - group_flags[2] |= csfb_dual_rx_tx_support_r10_present; - group_flags[3] |= sib8_per_plmn_list_r11.is_present(); - group_flags.pack(bref); - - if (group_flags[0]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(csfb_support_for_dual_rx_ues_r9_present, 1)); - HANDLE_CODE(bref.pack(cell_resel_params_hrpd_v920.is_present(), 1)); - HANDLE_CODE(bref.pack(cell_resel_params1_xrtt_v920.is_present(), 1)); - HANDLE_CODE(bref.pack(csfb_regist_param1_xrtt_v920.is_present(), 1)); - HANDLE_CODE(bref.pack(ac_barr_cfg1_xrtt_r9.is_present(), 1)); - if (csfb_support_for_dual_rx_ues_r9_present) { - HANDLE_CODE(bref.pack(csfb_support_for_dual_rx_ues_r9, 1)); - } - if (cell_resel_params_hrpd_v920.is_present()) { - HANDLE_CODE(cell_resel_params_hrpd_v920->pack(bref)); - } - if (cell_resel_params1_xrtt_v920.is_present()) { - HANDLE_CODE(cell_resel_params1_xrtt_v920->pack(bref)); - } - if (csfb_regist_param1_xrtt_v920.is_present()) { - HANDLE_CODE(csfb_regist_param1_xrtt_v920->pack(bref)); - } - if (ac_barr_cfg1_xrtt_r9.is_present()) { - HANDLE_CODE(ac_barr_cfg1_xrtt_r9->pack(bref)); - } - } - if (group_flags[2]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(csfb_dual_rx_tx_support_r10_present, 1)); - } - if (group_flags[3]) { - varlength_field_pack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.pack(sib8_per_plmn_list_r11.is_present(), 1)); - if (sib8_per_plmn_list_r11.is_present()) { - HANDLE_CODE(pack_dyn_seq_of(bref, *sib8_per_plmn_list_r11, 1, 6)); - } - } - } - return SRSASN_SUCCESS; } -SRSASN_CODE sib_type8_s::unpack(cbit_ref& bref) +pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::pos_sib_type_and_info_r15_item_c_( + const pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_& other) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(sys_time_info_present, 1)); - HANDLE_CODE(bref.unpack(search_win_size_present, 1)); - HANDLE_CODE(bref.unpack(params_hrpd_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt_present, 1)); - - if (sys_time_info_present) { - HANDLE_CODE(sys_time_info.unpack(bref)); - } - if (search_win_size_present) { - HANDLE_CODE(unpack_integer(search_win_size, bref, (uint8_t)0u, (uint8_t)15u)); - } - if (params_hrpd_present) { - HANDLE_CODE(bref.unpack(params_hrpd.cell_resel_params_hrpd_present, 1)); - HANDLE_CODE(params_hrpd.pre_regist_info_hrpd.unpack(bref)); - if (params_hrpd.cell_resel_params_hrpd_present) { - HANDLE_CODE(params_hrpd.cell_resel_params_hrpd.unpack(bref)); - } - } - if (params1_xrtt_present) { - HANDLE_CODE(bref.unpack(params1_xrtt.csfb_regist_param1_xrtt_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt.long_code_state1_xrtt_present, 1)); - HANDLE_CODE(bref.unpack(params1_xrtt.cell_resel_params1_xrtt_present, 1)); - if (params1_xrtt.csfb_regist_param1_xrtt_present) { - HANDLE_CODE(params1_xrtt.csfb_regist_param1_xrtt.unpack(bref)); - } - if (params1_xrtt.long_code_state1_xrtt_present) { - HANDLE_CODE(params1_xrtt.long_code_state1_xrtt.unpack(bref)); - } - if (params1_xrtt.cell_resel_params1_xrtt_present) { - HANDLE_CODE(params1_xrtt.cell_resel_params1_xrtt.unpack(bref)); - } - } - - if (ext) { - ext_groups_unpacker_guard group_flags(4); - group_flags.unpack(bref); - - if (group_flags[0]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - } - if (group_flags[1]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(csfb_support_for_dual_rx_ues_r9_present, 1)); - bool cell_resel_params_hrpd_v920_present; - HANDLE_CODE(bref.unpack(cell_resel_params_hrpd_v920_present, 1)); - cell_resel_params_hrpd_v920.set_present(cell_resel_params_hrpd_v920_present); - bool cell_resel_params1_xrtt_v920_present; - HANDLE_CODE(bref.unpack(cell_resel_params1_xrtt_v920_present, 1)); - cell_resel_params1_xrtt_v920.set_present(cell_resel_params1_xrtt_v920_present); - bool csfb_regist_param1_xrtt_v920_present; - HANDLE_CODE(bref.unpack(csfb_regist_param1_xrtt_v920_present, 1)); - csfb_regist_param1_xrtt_v920.set_present(csfb_regist_param1_xrtt_v920_present); - bool ac_barr_cfg1_xrtt_r9_present; - HANDLE_CODE(bref.unpack(ac_barr_cfg1_xrtt_r9_present, 1)); - ac_barr_cfg1_xrtt_r9.set_present(ac_barr_cfg1_xrtt_r9_present); - if (csfb_support_for_dual_rx_ues_r9_present) { - HANDLE_CODE(bref.unpack(csfb_support_for_dual_rx_ues_r9, 1)); - } - if (cell_resel_params_hrpd_v920.is_present()) { - HANDLE_CODE(cell_resel_params_hrpd_v920->unpack(bref)); - } - if (cell_resel_params1_xrtt_v920.is_present()) { - HANDLE_CODE(cell_resel_params1_xrtt_v920->unpack(bref)); - } - if (csfb_regist_param1_xrtt_v920.is_present()) { - HANDLE_CODE(csfb_regist_param1_xrtt_v920->unpack(bref)); - } - if (ac_barr_cfg1_xrtt_r9.is_present()) { - HANDLE_CODE(ac_barr_cfg1_xrtt_r9->unpack(bref)); - } - } - if (group_flags[2]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - HANDLE_CODE(bref.unpack(csfb_dual_rx_tx_support_r10_present, 1)); - } - if (group_flags[3]) { - varlength_field_unpack_guard varlen_scope(bref, false); - - bool sib8_per_plmn_list_r11_present; - HANDLE_CODE(bref.unpack(sib8_per_plmn_list_r11_present, 1)); - sib8_per_plmn_list_r11.set_present(sib8_per_plmn_list_r11_present); - if (sib8_per_plmn_list_r11.is_present()) { - HANDLE_CODE(unpack_dyn_seq_of(*sib8_per_plmn_list_r11, bref, 1, 6)); - } - } + type_ = other.type(); + switch (type_) { + case types::pos_sib1_minus1_r15: + c.init(other.c.get()); + break; + case types::pos_sib1_minus2_r15: + c.init(other.c.get()); + break; + case types::pos_sib1_minus3_r15: + c.init(other.c.get()); + break; + case types::pos_sib1_minus4_r15: + c.init(other.c.get()); + break; + case types::pos_sib1_minus5_r15: + c.init(other.c.get()); + break; + case types::pos_sib1_minus6_r15: + c.init(other.c.get()); + break; + case types::pos_sib1_minus7_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus1_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus2_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus3_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus4_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus5_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus6_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus7_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus8_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus9_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus10_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus11_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus12_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus13_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus14_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus15_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus16_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus17_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus18_r15: + c.init(other.c.get()); + break; + case types::pos_sib2_minus19_r15: + c.init(other.c.get()); + break; + case types::pos_sib3_minus1_r15: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); } - return SRSASN_SUCCESS; } -void sib_type8_s::to_json(json_writer& j) const +pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_& +pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::operator=( + const pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_& other) { - j.start_obj(); - if (sys_time_info_present) { - j.write_fieldname("systemTimeInfo"); - sys_time_info.to_json(j); - } - if (search_win_size_present) { - j.write_int("searchWindowSize", search_win_size); - } - if (params_hrpd_present) { - j.write_fieldname("parametersHRPD"); - j.start_obj(); - j.write_fieldname("preRegistrationInfoHRPD"); - params_hrpd.pre_regist_info_hrpd.to_json(j); - if (params_hrpd.cell_resel_params_hrpd_present) { - j.write_fieldname("cellReselectionParametersHRPD"); - params_hrpd.cell_resel_params_hrpd.to_json(j); - } - j.end_obj(); + if (this == &other) { + return *this; } - if (params1_xrtt_present) { - j.write_fieldname("parameters1XRTT"); - j.start_obj(); - if (params1_xrtt.csfb_regist_param1_xrtt_present) { - j.write_fieldname("csfb-RegistrationParam1XRTT"); - params1_xrtt.csfb_regist_param1_xrtt.to_json(j); - } - if (params1_xrtt.long_code_state1_xrtt_present) { - j.write_str("longCodeState1XRTT", params1_xrtt.long_code_state1_xrtt.to_string()); - } - if (params1_xrtt.cell_resel_params1_xrtt_present) { - j.write_fieldname("cellReselectionParameters1XRTT"); - params1_xrtt.cell_resel_params1_xrtt.to_json(j); - } - j.end_obj(); + set(other.type()); + switch (type_) { + case types::pos_sib1_minus1_r15: + c.set(other.c.get()); + break; + case types::pos_sib1_minus2_r15: + c.set(other.c.get()); + break; + case types::pos_sib1_minus3_r15: + c.set(other.c.get()); + break; + case types::pos_sib1_minus4_r15: + c.set(other.c.get()); + break; + case types::pos_sib1_minus5_r15: + c.set(other.c.get()); + break; + case types::pos_sib1_minus6_r15: + c.set(other.c.get()); + break; + case types::pos_sib1_minus7_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus1_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus2_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus3_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus4_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus5_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus6_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus7_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus8_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus9_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus10_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus11_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus12_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus13_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus14_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus15_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus16_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus17_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus18_r15: + c.set(other.c.get()); + break; + case types::pos_sib2_minus19_r15: + c.set(other.c.get()); + break; + case types::pos_sib3_minus1_r15: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); } - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (csfb_support_for_dual_rx_ues_r9_present) { - j.write_bool("csfb-SupportForDualRxUEs-r9", csfb_support_for_dual_rx_ues_r9); - } - if (cell_resel_params_hrpd_v920.is_present()) { - j.write_fieldname("cellReselectionParametersHRPD-v920"); - cell_resel_params_hrpd_v920->to_json(j); - } - if (cell_resel_params1_xrtt_v920.is_present()) { - j.write_fieldname("cellReselectionParameters1XRTT-v920"); - cell_resel_params1_xrtt_v920->to_json(j); - } - if (csfb_regist_param1_xrtt_v920.is_present()) { - j.write_fieldname("csfb-RegistrationParam1XRTT-v920"); - csfb_regist_param1_xrtt_v920->to_json(j); - } - if (ac_barr_cfg1_xrtt_r9.is_present()) { - j.write_fieldname("ac-BarringConfig1XRTT-r9"); - ac_barr_cfg1_xrtt_r9->to_json(j); - } - if (csfb_dual_rx_tx_support_r10_present) { - j.write_str("csfb-DualRxTxSupport-r10", "true"); - } - if (sib8_per_plmn_list_r11.is_present()) { - j.start_array("sib8-PerPLMN-List-r11"); - for (const auto& e1 : *sib8_per_plmn_list_r11) { - e1.to_json(j); - } - j.end_array(); - } + + return *this; +} +void pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::pos_sib1_minus1_r15: + j.write_fieldname("posSib1-1-r15"); + c.get().to_json(j); + break; + case types::pos_sib1_minus2_r15: + j.write_fieldname("posSib1-2-r15"); + c.get().to_json(j); + break; + case types::pos_sib1_minus3_r15: + j.write_fieldname("posSib1-3-r15"); + c.get().to_json(j); + break; + case types::pos_sib1_minus4_r15: + j.write_fieldname("posSib1-4-r15"); + c.get().to_json(j); + break; + case types::pos_sib1_minus5_r15: + j.write_fieldname("posSib1-5-r15"); + c.get().to_json(j); + break; + case types::pos_sib1_minus6_r15: + j.write_fieldname("posSib1-6-r15"); + c.get().to_json(j); + break; + case types::pos_sib1_minus7_r15: + j.write_fieldname("posSib1-7-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus1_r15: + j.write_fieldname("posSib2-1-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus2_r15: + j.write_fieldname("posSib2-2-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus3_r15: + j.write_fieldname("posSib2-3-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus4_r15: + j.write_fieldname("posSib2-4-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus5_r15: + j.write_fieldname("posSib2-5-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus6_r15: + j.write_fieldname("posSib2-6-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus7_r15: + j.write_fieldname("posSib2-7-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus8_r15: + j.write_fieldname("posSib2-8-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus9_r15: + j.write_fieldname("posSib2-9-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus10_r15: + j.write_fieldname("posSib2-10-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus11_r15: + j.write_fieldname("posSib2-11-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus12_r15: + j.write_fieldname("posSib2-12-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus13_r15: + j.write_fieldname("posSib2-13-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus14_r15: + j.write_fieldname("posSib2-14-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus15_r15: + j.write_fieldname("posSib2-15-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus16_r15: + j.write_fieldname("posSib2-16-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus17_r15: + j.write_fieldname("posSib2-17-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus18_r15: + j.write_fieldname("posSib2-18-r15"); + c.get().to_json(j); + break; + case types::pos_sib2_minus19_r15: + j.write_fieldname("posSib2-19-r15"); + c.get().to_json(j); + break; + case types::pos_sib3_minus1_r15: + j.write_fieldname("posSib3-1-r15"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); } j.end_obj(); } - -// SystemInformationBlockType9 ::= SEQUENCE -SRSASN_CODE sib_type9_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(hnb_name_present, 1)); - - if (hnb_name_present) { - HANDLE_CODE(hnb_name.pack(bref)); - } - - if (ext) { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - } - return SRSASN_SUCCESS; -} -SRSASN_CODE sib_type9_s::unpack(cbit_ref& bref) +SRSASN_CODE pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::pack(bit_ref& bref) const { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(hnb_name_present, 1)); - - if (hnb_name_present) { - HANDLE_CODE(hnb_name.unpack(bref)); - } - - if (ext) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } + type_.pack(bref); + switch (type_) { + case types::pos_sib1_minus1_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib1_minus2_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib1_minus3_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib1_minus4_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib1_minus5_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib1_minus6_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib1_minus7_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus1_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus2_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus3_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus4_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus5_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus6_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus7_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus8_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus9_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus10_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus11_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus12_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus13_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus14_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus15_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus16_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus17_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus18_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib2_minus19_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::pos_sib3_minus1_r15: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -void sib_type9_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (hnb_name_present) { - j.write_str("hnb-Name", hnb_name.to_string()); - } - if (ext) { - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - } - j.end_obj(); -} - -// PosSystemInformation-r15-IEs ::= SEQUENCE -SRSASN_CODE pos_sys_info_r15_ies_s::pack(bit_ref& bref) const +SRSASN_CODE pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - HANDLE_CODE(pack_dyn_seq_of(bref, pos_sib_type_and_info_r15, 1, 32)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::pos_sib1_minus1_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib1_minus2_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib1_minus3_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib1_minus4_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib1_minus5_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib1_minus6_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib1_minus7_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus1_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus2_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus3_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus4_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus5_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus6_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus7_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus8_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus9_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus10_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus11_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus12_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus13_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus14_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus15_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus16_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus17_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus18_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib2_minus19_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::pos_sib3_minus1_r15: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); + return SRSASN_ERROR_DECODE_FAIL; } - return SRSASN_SUCCESS; } -SRSASN_CODE pos_sys_info_r15_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(pos_sib_type_and_info_r15, bref, 1, 32)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); +void sib_info_item_c::destroy_() +{ + switch (type_) { + case types::sib2: + c.destroy(); + break; + case types::sib3: + c.destroy(); + break; + case types::sib4: + c.destroy(); + break; + case types::sib5: + c.destroy(); + break; + case types::sib6: + c.destroy(); + break; + case types::sib7: + c.destroy(); + break; + case types::sib8: + c.destroy(); + break; + case types::sib9: + c.destroy(); + break; + case types::sib10: + c.destroy(); + break; + case types::sib11: + c.destroy(); + break; + case types::sib12_v920: + c.destroy(); + break; + case types::sib13_v920: + c.destroy(); + break; + case types::sib14_v1130: + c.destroy(); + break; + case types::sib15_v1130: + c.destroy(); + break; + case types::sib16_v1130: + c.destroy(); + break; + case types::sib17_v1250: + c.destroy(); + break; + case types::sib18_v1250: + c.destroy(); + break; + case types::sib19_v1250: + c.destroy(); + break; + case types::sib20_v1310: + c.destroy(); + break; + case types::sib21_v1430: + c.destroy(); + break; + case types::sib24_v1530: + c.destroy(); + break; + case types::sib25_v1530: + c.destroy(); + break; + case types::sib26_v1530: + c.destroy(); + break; + default: + break; } - - return SRSASN_SUCCESS; } -void pos_sys_info_r15_ies_s::to_json(json_writer& j) const +void sib_info_item_c::set(types::options e) { - j.start_obj(); - j.start_array("posSIB-TypeAndInfo-r15"); - for (const auto& e1 : pos_sib_type_and_info_r15) { - e1.to_json(j); - } - j.end_array(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + destroy_(); + type_ = e; + switch (type_) { + case types::sib2: + c.init(); + break; + case types::sib3: + c.init(); + break; + case types::sib4: + c.init(); + break; + case types::sib5: + c.init(); + break; + case types::sib6: + c.init(); + break; + case types::sib7: + c.init(); + break; + case types::sib8: + c.init(); + break; + case types::sib9: + c.init(); + break; + case types::sib10: + c.init(); + break; + case types::sib11: + c.init(); + break; + case types::sib12_v920: + c.init(); + break; + case types::sib13_v920: + c.init(); + break; + case types::sib14_v1130: + c.init(); + break; + case types::sib15_v1130: + c.init(); + break; + case types::sib16_v1130: + c.init(); + break; + case types::sib17_v1250: + c.init(); + break; + case types::sib18_v1250: + c.init(); + break; + case types::sib19_v1250: + c.init(); + break; + case types::sib20_v1310: + c.init(); + break; + case types::sib21_v1430: + c.init(); + break; + case types::sib24_v1530: + c.init(); + break; + case types::sib25_v1530: + c.init(); + break; + case types::sib26_v1530: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "sib_info_item_c"); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); +} +sib_info_item_c::sib_info_item_c(const sib_info_item_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::sib2: + c.init(other.c.get()); + break; + case types::sib3: + c.init(other.c.get()); + break; + case types::sib4: + c.init(other.c.get()); + break; + case types::sib5: + c.init(other.c.get()); + break; + case types::sib6: + c.init(other.c.get()); + break; + case types::sib7: + c.init(other.c.get()); + break; + case types::sib8: + c.init(other.c.get()); + break; + case types::sib9: + c.init(other.c.get()); + break; + case types::sib10: + c.init(other.c.get()); + break; + case types::sib11: + c.init(other.c.get()); + break; + case types::sib12_v920: + c.init(other.c.get()); + break; + case types::sib13_v920: + c.init(other.c.get()); + break; + case types::sib14_v1130: + c.init(other.c.get()); + break; + case types::sib15_v1130: + c.init(other.c.get()); + break; + case types::sib16_v1130: + c.init(other.c.get()); + break; + case types::sib17_v1250: + c.init(other.c.get()); + break; + case types::sib18_v1250: + c.init(other.c.get()); + break; + case types::sib19_v1250: + c.init(other.c.get()); + break; + case types::sib20_v1310: + c.init(other.c.get()); + break; + case types::sib21_v1430: + c.init(other.c.get()); + break; + case types::sib24_v1530: + c.init(other.c.get()); + break; + case types::sib25_v1530: + c.init(other.c.get()); + break; + case types::sib26_v1530: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "sib_info_item_c"); } - j.end_obj(); } - -void pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::destroy_() +sib_info_item_c& sib_info_item_c::operator=(const sib_info_item_c& other) { + if (this == &other) { + return *this; + } + set(other.type()); switch (type_) { - case types::pos_sib1_minus1_r15: - c.destroy(); - break; - case types::pos_sib1_minus2_r15: - c.destroy(); - break; - case types::pos_sib1_minus3_r15: - c.destroy(); - break; - case types::pos_sib1_minus4_r15: - c.destroy(); + case types::sib2: + c.set(other.c.get()); break; - case types::pos_sib1_minus5_r15: - c.destroy(); + case types::sib3: + c.set(other.c.get()); break; - case types::pos_sib1_minus6_r15: - c.destroy(); + case types::sib4: + c.set(other.c.get()); break; - case types::pos_sib1_minus7_r15: - c.destroy(); + case types::sib5: + c.set(other.c.get()); break; - case types::pos_sib2_minus1_r15: - c.destroy(); + case types::sib6: + c.set(other.c.get()); break; - case types::pos_sib2_minus2_r15: - c.destroy(); + case types::sib7: + c.set(other.c.get()); break; - case types::pos_sib2_minus3_r15: - c.destroy(); + case types::sib8: + c.set(other.c.get()); break; - case types::pos_sib2_minus4_r15: - c.destroy(); + case types::sib9: + c.set(other.c.get()); break; - case types::pos_sib2_minus5_r15: - c.destroy(); + case types::sib10: + c.set(other.c.get()); break; - case types::pos_sib2_minus6_r15: - c.destroy(); + case types::sib11: + c.set(other.c.get()); break; - case types::pos_sib2_minus7_r15: - c.destroy(); + case types::sib12_v920: + c.set(other.c.get()); break; - case types::pos_sib2_minus8_r15: - c.destroy(); + case types::sib13_v920: + c.set(other.c.get()); break; - case types::pos_sib2_minus9_r15: - c.destroy(); + case types::sib14_v1130: + c.set(other.c.get()); break; - case types::pos_sib2_minus10_r15: - c.destroy(); + case types::sib15_v1130: + c.set(other.c.get()); break; - case types::pos_sib2_minus11_r15: - c.destroy(); + case types::sib16_v1130: + c.set(other.c.get()); break; - case types::pos_sib2_minus12_r15: - c.destroy(); + case types::sib17_v1250: + c.set(other.c.get()); break; - case types::pos_sib2_minus13_r15: - c.destroy(); + case types::sib18_v1250: + c.set(other.c.get()); break; - case types::pos_sib2_minus14_r15: - c.destroy(); + case types::sib19_v1250: + c.set(other.c.get()); break; - case types::pos_sib2_minus15_r15: - c.destroy(); + case types::sib20_v1310: + c.set(other.c.get()); break; - case types::pos_sib2_minus16_r15: - c.destroy(); + case types::sib21_v1430: + c.set(other.c.get()); break; - case types::pos_sib2_minus17_r15: - c.destroy(); + case types::sib24_v1530: + c.set(other.c.get()); break; - case types::pos_sib2_minus18_r15: - c.destroy(); + case types::sib25_v1530: + c.set(other.c.get()); break; - case types::pos_sib2_minus19_r15: - c.destroy(); + case types::sib26_v1530: + c.set(other.c.get()); break; - case types::pos_sib3_minus1_r15: - c.destroy(); + case types::nulltype: break; default: - break; + log_invalid_choice_id(type_, "sib_info_item_c"); } + + return *this; } -void pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::set(types::options e) +void sib_info_item_c::to_json(json_writer& j) const { - destroy_(); - type_ = e; + j.start_obj(); switch (type_) { - case types::pos_sib1_minus1_r15: - c.init(); - break; - case types::pos_sib1_minus2_r15: - c.init(); - break; - case types::pos_sib1_minus3_r15: - c.init(); - break; - case types::pos_sib1_minus4_r15: - c.init(); - break; - case types::pos_sib1_minus5_r15: - c.init(); - break; - case types::pos_sib1_minus6_r15: - c.init(); + case types::sib2: + j.write_fieldname("sib2"); + c.get().to_json(j); break; - case types::pos_sib1_minus7_r15: - c.init(); + case types::sib3: + j.write_fieldname("sib3"); + c.get().to_json(j); break; - case types::pos_sib2_minus1_r15: - c.init(); + case types::sib4: + j.write_fieldname("sib4"); + c.get().to_json(j); break; - case types::pos_sib2_minus2_r15: - c.init(); + case types::sib5: + j.write_fieldname("sib5"); + c.get().to_json(j); break; - case types::pos_sib2_minus3_r15: - c.init(); + case types::sib6: + j.write_fieldname("sib6"); + c.get().to_json(j); break; - case types::pos_sib2_minus4_r15: - c.init(); + case types::sib7: + j.write_fieldname("sib7"); + c.get().to_json(j); break; - case types::pos_sib2_minus5_r15: - c.init(); + case types::sib8: + j.write_fieldname("sib8"); + c.get().to_json(j); break; - case types::pos_sib2_minus6_r15: - c.init(); + case types::sib9: + j.write_fieldname("sib9"); + c.get().to_json(j); break; - case types::pos_sib2_minus7_r15: - c.init(); + case types::sib10: + j.write_fieldname("sib10"); + c.get().to_json(j); break; - case types::pos_sib2_minus8_r15: - c.init(); + case types::sib11: + j.write_fieldname("sib11"); + c.get().to_json(j); break; - case types::pos_sib2_minus9_r15: - c.init(); + case types::sib12_v920: + j.write_fieldname("sib12-v920"); + c.get().to_json(j); break; - case types::pos_sib2_minus10_r15: - c.init(); + case types::sib13_v920: + j.write_fieldname("sib13-v920"); + c.get().to_json(j); break; - case types::pos_sib2_minus11_r15: - c.init(); + case types::sib14_v1130: + j.write_fieldname("sib14-v1130"); + c.get().to_json(j); break; - case types::pos_sib2_minus12_r15: - c.init(); + case types::sib15_v1130: + j.write_fieldname("sib15-v1130"); + c.get().to_json(j); break; - case types::pos_sib2_minus13_r15: - c.init(); + case types::sib16_v1130: + j.write_fieldname("sib16-v1130"); + c.get().to_json(j); break; - case types::pos_sib2_minus14_r15: - c.init(); + case types::sib17_v1250: + j.write_fieldname("sib17-v1250"); + c.get().to_json(j); break; - case types::pos_sib2_minus15_r15: - c.init(); + case types::sib18_v1250: + j.write_fieldname("sib18-v1250"); + c.get().to_json(j); break; - case types::pos_sib2_minus16_r15: - c.init(); + case types::sib19_v1250: + j.write_fieldname("sib19-v1250"); + c.get().to_json(j); break; - case types::pos_sib2_minus17_r15: - c.init(); + case types::sib20_v1310: + j.write_fieldname("sib20-v1310"); + c.get().to_json(j); break; - case types::pos_sib2_minus18_r15: - c.init(); + case types::sib21_v1430: + j.write_fieldname("sib21-v1430"); + c.get().to_json(j); break; - case types::pos_sib2_minus19_r15: - c.init(); + case types::sib24_v1530: + j.write_fieldname("sib24-v1530"); + c.get().to_json(j); break; - case types::pos_sib3_minus1_r15: - c.init(); + case types::sib25_v1530: + j.write_fieldname("sib25-v1530"); + c.get().to_json(j); break; - case types::nulltype: + case types::sib26_v1530: + j.write_fieldname("sib26-v1530"); + c.get().to_json(j); break; default: - log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); + log_invalid_choice_id(type_, "sib_info_item_c"); } + j.end_obj(); } -pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::pos_sib_type_and_info_r15_item_c_( - const pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_& other) +SRSASN_CODE sib_info_item_c::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { - case types::pos_sib1_minus1_r15: - c.init(other.c.get()); + case types::sib2: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus2_r15: - c.init(other.c.get()); + case types::sib3: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus3_r15: - c.init(other.c.get()); + case types::sib4: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus4_r15: - c.init(other.c.get()); + case types::sib5: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus5_r15: - c.init(other.c.get()); + case types::sib6: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus6_r15: - c.init(other.c.get()); + case types::sib7: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus7_r15: - c.init(other.c.get()); + case types::sib8: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib2_minus1_r15: - c.init(other.c.get()); + case types::sib9: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib2_minus2_r15: - c.init(other.c.get()); + case types::sib10: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib2_minus3_r15: - c.init(other.c.get()); + case types::sib11: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib2_minus4_r15: - c.init(other.c.get()); + case types::sib12_v920: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib13_v920: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib14_v1130: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib15_v1130: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib16_v1130: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib17_v1250: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib18_v1250: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib19_v1250: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib20_v1310: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib21_v1430: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib24_v1530: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib25_v1530: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + case types::sib26_v1530: { + varlength_field_pack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().pack(bref)); + } break; + default: + log_invalid_choice_id(type_, "sib_info_item_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sib_info_item_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::sib2: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus5_r15: - c.init(other.c.get()); + case types::sib3: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus6_r15: - c.init(other.c.get()); + case types::sib4: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus7_r15: - c.init(other.c.get()); + case types::sib5: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus8_r15: - c.init(other.c.get()); + case types::sib6: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus9_r15: - c.init(other.c.get()); + case types::sib7: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus10_r15: - c.init(other.c.get()); + case types::sib8: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus11_r15: - c.init(other.c.get()); + case types::sib9: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus12_r15: - c.init(other.c.get()); + case types::sib10: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus13_r15: - c.init(other.c.get()); + case types::sib11: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::sib12_v920: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib13_v920: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib14_v1130: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib15_v1130: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib16_v1130: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib17_v1250: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib18_v1250: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib19_v1250: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib20_v1310: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib21_v1430: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib24_v1530: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib25_v1530: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + case types::sib26_v1530: { + varlength_field_unpack_guard varlen_scope(bref, false); + HANDLE_CODE(c.get().unpack(bref)); + } break; + default: + log_invalid_choice_id(type_, "sib_info_item_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +// SystemInformation-r8-IEs ::= SEQUENCE +SRSASN_CODE sys_info_r8_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(pack_dyn_seq_of(bref, sib_type_and_info, 1, 32)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE sys_info_r8_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + HANDLE_CODE(unpack_dyn_seq_of(sib_type_and_info, bref, 1, 32)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void sys_info_r8_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.start_array("sib-TypeAndInfo"); + for (const auto& e1 : sib_type_and_info) { + e1.to_json(j); + } + j.end_array(); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// SystemInformation ::= SEQUENCE +SRSASN_CODE sys_info_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(crit_exts.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE sys_info_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(crit_exts.unpack(bref)); + + return SRSASN_SUCCESS; +} +void sys_info_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} + +void sys_info_s::crit_exts_c_::destroy_() +{ + switch (type_) { + case types::sys_info_r8: + c.destroy(); break; - case types::pos_sib2_minus14_r15: - c.init(other.c.get()); + case types::crit_exts_future_r15: + c.destroy(); break; - case types::pos_sib2_minus15_r15: - c.init(other.c.get()); + default: break; - case types::pos_sib2_minus16_r15: - c.init(other.c.get()); + } +} +void sys_info_s::crit_exts_c_::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::sys_info_r8: + c.init(); break; - case types::pos_sib2_minus17_r15: - c.init(other.c.get()); + case types::crit_exts_future_r15: + c.init(); break; - case types::pos_sib2_minus18_r15: - c.init(other.c.get()); + case types::nulltype: break; - case types::pos_sib2_minus19_r15: - c.init(other.c.get()); + default: + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + } +} +sys_info_s::crit_exts_c_::crit_exts_c_(const sys_info_s::crit_exts_c_& other) +{ + type_ = other.type(); + switch (type_) { + case types::sys_info_r8: + c.init(other.c.get()); break; - case types::pos_sib3_minus1_r15: - c.init(other.c.get()); + case types::crit_exts_future_r15: + c.init(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); } } -pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_& -pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::operator=( - const pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_& other) +sys_info_s::crit_exts_c_& sys_info_s::crit_exts_c_::operator=(const sys_info_s::crit_exts_c_& other) { if (this == &other) { return *this; } set(other.type()); switch (type_) { - case types::pos_sib1_minus1_r15: - c.set(other.c.get()); + case types::sys_info_r8: + c.set(other.c.get()); break; - case types::pos_sib1_minus2_r15: - c.set(other.c.get()); + case types::crit_exts_future_r15: + c.set(other.c.get()); break; - case types::pos_sib1_minus3_r15: - c.set(other.c.get()); + case types::nulltype: break; - case types::pos_sib1_minus4_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + } + + return *this; +} +void sys_info_s::crit_exts_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::sys_info_r8: + j.write_fieldname("systemInformation-r8"); + c.get().to_json(j); break; - case types::pos_sib1_minus5_r15: - c.set(other.c.get()); + case types::crit_exts_future_r15: + j.write_fieldname("criticalExtensionsFuture-r15"); + c.get().to_json(j); break; - case types::pos_sib1_minus6_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + } + j.end_obj(); +} +SRSASN_CODE sys_info_s::crit_exts_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::sys_info_r8: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus7_r15: - c.set(other.c.get()); + case types::crit_exts_future_r15: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib2_minus1_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sys_info_s::crit_exts_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::sys_info_r8: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus2_r15: - c.set(other.c.get()); + case types::crit_exts_future_r15: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib2_minus3_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +void sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::set(types::options e) +{ + type_ = e; +} +void sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::pos_sys_info_r15: + j.write_fieldname("posSystemInformation-r15"); + c.to_json(j); break; - case types::pos_sib2_minus4_r15: - c.set(other.c.get()); + case types::crit_exts_future: break; - case types::pos_sib2_minus5_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); + } + j.end_obj(); +} +SRSASN_CODE sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::pos_sys_info_r15: + HANDLE_CODE(c.pack(bref)); break; - case types::pos_sib2_minus6_r15: - c.set(other.c.get()); + case types::crit_exts_future: break; - case types::pos_sib2_minus7_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::pos_sys_info_r15: + HANDLE_CODE(c.unpack(bref)); break; - case types::pos_sib2_minus8_r15: - c.set(other.c.get()); + case types::crit_exts_future: break; - case types::pos_sib2_minus9_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +// BCCH-DL-SCH-MessageType ::= CHOICE +void bcch_dl_sch_msg_type_c::set(types::options e) +{ + type_ = e; +} +void bcch_dl_sch_msg_type_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::c1: + j.write_fieldname("c1"); + c.to_json(j); break; - case types::pos_sib2_minus10_r15: - c.set(other.c.get()); + case types::msg_class_ext: break; - case types::pos_sib2_minus11_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); + } + j.end_obj(); +} +SRSASN_CODE bcch_dl_sch_msg_type_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::c1: + HANDLE_CODE(c.pack(bref)); break; - case types::pos_sib2_minus12_r15: - c.set(other.c.get()); + case types::msg_class_ext: + break; + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE bcch_dl_sch_msg_type_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::c1: + HANDLE_CODE(c.unpack(bref)); + break; + case types::msg_class_ext: + break; + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +void bcch_dl_sch_msg_type_c::c1_c_::destroy_() +{ + switch (type_) { + case types::sys_info: + c.destroy(); + break; + case types::sib_type1: + c.destroy(); break; - case types::pos_sib2_minus13_r15: - c.set(other.c.get()); + default: break; - case types::pos_sib2_minus14_r15: - c.set(other.c.get()); + } +} +void bcch_dl_sch_msg_type_c::c1_c_::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::sys_info: + c.init(); break; - case types::pos_sib2_minus15_r15: - c.set(other.c.get()); + case types::sib_type1: + c.init(); break; - case types::pos_sib2_minus16_r15: - c.set(other.c.get()); + case types::nulltype: break; - case types::pos_sib2_minus17_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + } +} +bcch_dl_sch_msg_type_c::c1_c_::c1_c_(const bcch_dl_sch_msg_type_c::c1_c_& other) +{ + type_ = other.type(); + switch (type_) { + case types::sys_info: + c.init(other.c.get()); break; - case types::pos_sib2_minus18_r15: - c.set(other.c.get()); + case types::sib_type1: + c.init(other.c.get()); break; - case types::pos_sib2_minus19_r15: - c.set(other.c.get()); + case types::nulltype: break; - case types::pos_sib3_minus1_r15: - c.set(other.c.get()); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + } +} +bcch_dl_sch_msg_type_c::c1_c_& bcch_dl_sch_msg_type_c::c1_c_::operator=(const bcch_dl_sch_msg_type_c::c1_c_& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::sys_info: + c.set(other.c.get()); + break; + case types::sib_type1: + c.set(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); } return *this; } -void pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::to_json(json_writer& j) const +void bcch_dl_sch_msg_type_c::c1_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::pos_sib1_minus1_r15: - j.write_fieldname("posSib1-1-r15"); - c.get().to_json(j); + case types::sys_info: + j.write_fieldname("systemInformation"); + c.get().to_json(j); break; - case types::pos_sib1_minus2_r15: - j.write_fieldname("posSib1-2-r15"); - c.get().to_json(j); + case types::sib_type1: + j.write_fieldname("systemInformationBlockType1"); + c.get().to_json(j); break; - case types::pos_sib1_minus3_r15: - j.write_fieldname("posSib1-3-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + } + j.end_obj(); +} +SRSASN_CODE bcch_dl_sch_msg_type_c::c1_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::sys_info: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus4_r15: - j.write_fieldname("posSib1-4-r15"); - c.get().to_json(j); + case types::sib_type1: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib1_minus5_r15: - j.write_fieldname("posSib1-5-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE bcch_dl_sch_msg_type_c::c1_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::sys_info: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib1_minus6_r15: - j.write_fieldname("posSib1-6-r15"); - c.get().to_json(j); + case types::sib_type1: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib1_minus7_r15: - j.write_fieldname("posSib1-7-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +// BCCH-DL-SCH-Message ::= SEQUENCE +SRSASN_CODE bcch_dl_sch_msg_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(msg.pack(bref)); + + bref.align_bytes_zero(); + + return SRSASN_SUCCESS; +} +SRSASN_CODE bcch_dl_sch_msg_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(msg.unpack(bref)); + + bref.align_bytes(); + + return SRSASN_SUCCESS; +} +void bcch_dl_sch_msg_s::to_json(json_writer& j) const +{ + j.start_array(); + j.start_obj(); + j.start_obj("BCCH-DL-SCH-Message"); + j.write_fieldname("message"); + msg.to_json(j); + j.end_obj(); + j.end_obj(); + j.end_array(); +} + +// BCCH-DL-SCH-MessageType-BR-r13 ::= CHOICE +void bcch_dl_sch_msg_type_br_r13_c::set(types::options e) +{ + type_ = e; +} +void bcch_dl_sch_msg_type_br_r13_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::c1: + j.write_fieldname("c1"); + c.to_json(j); break; - case types::pos_sib2_minus1_r15: - j.write_fieldname("posSib2-1-r15"); - c.get().to_json(j); + case types::msg_class_ext: break; - case types::pos_sib2_minus2_r15: - j.write_fieldname("posSib2-2-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); + } + j.end_obj(); +} +SRSASN_CODE bcch_dl_sch_msg_type_br_r13_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::c1: + HANDLE_CODE(c.pack(bref)); break; - case types::pos_sib2_minus3_r15: - j.write_fieldname("posSib2-3-r15"); - c.get().to_json(j); + case types::msg_class_ext: break; - case types::pos_sib2_minus4_r15: - j.write_fieldname("posSib2-4-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE bcch_dl_sch_msg_type_br_r13_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::c1: + HANDLE_CODE(c.unpack(bref)); break; - case types::pos_sib2_minus5_r15: - j.write_fieldname("posSib2-5-r15"); - c.get().to_json(j); + case types::msg_class_ext: break; - case types::pos_sib2_minus6_r15: - j.write_fieldname("posSib2-6-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +void bcch_dl_sch_msg_type_br_r13_c::c1_c_::destroy_() +{ + switch (type_) { + case types::sys_info_br_r13: + c.destroy(); break; - case types::pos_sib2_minus7_r15: - j.write_fieldname("posSib2-7-r15"); - c.get().to_json(j); + case types::sib_type1_br_r13: + c.destroy(); break; - case types::pos_sib2_minus8_r15: - j.write_fieldname("posSib2-8-r15"); - c.get().to_json(j); + default: break; - case types::pos_sib2_minus9_r15: - j.write_fieldname("posSib2-9-r15"); - c.get().to_json(j); + } +} +void bcch_dl_sch_msg_type_br_r13_c::c1_c_::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::sys_info_br_r13: + c.init(); + break; + case types::sib_type1_br_r13: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + } +} +bcch_dl_sch_msg_type_br_r13_c::c1_c_::c1_c_(const bcch_dl_sch_msg_type_br_r13_c::c1_c_& other) +{ + type_ = other.type(); + switch (type_) { + case types::sys_info_br_r13: + c.init(other.c.get()); break; - case types::pos_sib2_minus10_r15: - j.write_fieldname("posSib2-10-r15"); - c.get().to_json(j); + case types::sib_type1_br_r13: + c.init(other.c.get()); break; - case types::pos_sib2_minus11_r15: - j.write_fieldname("posSib2-11-r15"); - c.get().to_json(j); + case types::nulltype: break; - case types::pos_sib2_minus12_r15: - j.write_fieldname("posSib2-12-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + } +} +bcch_dl_sch_msg_type_br_r13_c::c1_c_& +bcch_dl_sch_msg_type_br_r13_c::c1_c_::operator=(const bcch_dl_sch_msg_type_br_r13_c::c1_c_& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::sys_info_br_r13: + c.set(other.c.get()); break; - case types::pos_sib2_minus13_r15: - j.write_fieldname("posSib2-13-r15"); - c.get().to_json(j); + case types::sib_type1_br_r13: + c.set(other.c.get()); break; - case types::pos_sib2_minus14_r15: - j.write_fieldname("posSib2-14-r15"); - c.get().to_json(j); + case types::nulltype: break; - case types::pos_sib2_minus15_r15: - j.write_fieldname("posSib2-15-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + } + + return *this; +} +void bcch_dl_sch_msg_type_br_r13_c::c1_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::sys_info_br_r13: + j.write_fieldname("systemInformation-BR-r13"); + c.get().to_json(j); break; - case types::pos_sib2_minus16_r15: - j.write_fieldname("posSib2-16-r15"); - c.get().to_json(j); + case types::sib_type1_br_r13: + j.write_fieldname("systemInformationBlockType1-BR-r13"); + c.get().to_json(j); break; - case types::pos_sib2_minus17_r15: - j.write_fieldname("posSib2-17-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + } + j.end_obj(); +} +SRSASN_CODE bcch_dl_sch_msg_type_br_r13_c::c1_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::sys_info_br_r13: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib2_minus18_r15: - j.write_fieldname("posSib2-18-r15"); - c.get().to_json(j); + case types::sib_type1_br_r13: + HANDLE_CODE(c.get().pack(bref)); break; - case types::pos_sib2_minus19_r15: - j.write_fieldname("posSib2-19-r15"); - c.get().to_json(j); + default: + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE bcch_dl_sch_msg_type_br_r13_c::c1_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::sys_info_br_r13: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::pos_sib3_minus1_r15: - j.write_fieldname("posSib3-1-r15"); - c.get().to_json(j); + case types::sib_type1_br_r13: + HANDLE_CODE(c.get().unpack(bref)); break; default: - log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); + log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +// BCCH-DL-SCH-Message-BR ::= SEQUENCE +SRSASN_CODE bcch_dl_sch_msg_br_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(msg.pack(bref)); + + bref.align_bytes_zero(); + + return SRSASN_SUCCESS; +} +SRSASN_CODE bcch_dl_sch_msg_br_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(msg.unpack(bref)); + + bref.align_bytes(); + + return SRSASN_SUCCESS; +} +void bcch_dl_sch_msg_br_s::to_json(json_writer& j) const +{ + j.start_array(); + j.start_obj(); + j.start_obj("BCCH-DL-SCH-Message-BR"); + j.write_fieldname("message"); + msg.to_json(j); + j.end_obj(); + j.end_obj(); + j.end_array(); +} + +// SIB-Type-MBMS-r14 ::= ENUMERATED +std::string sib_type_mbms_r14_opts::to_string() const +{ + static const char* options[] = { + "sibType10", "sibType11", "sibType12-v920", "sibType13-v920", "sibType15-v1130", "sibType16-v1130"}; + return convert_enum_idx(options, 6, value, "sib_type_mbms_r14_e"); +} +uint8_t sib_type_mbms_r14_opts::to_number() const +{ + static const uint8_t options[] = {10, 11, 12, 13, 15, 16}; + return map_enum_number(options, 6, value, "sib_type_mbms_r14_e"); +} + +// SchedulingInfo-MBMS-r14 ::= SEQUENCE +SRSASN_CODE sched_info_mbms_r14_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(si_periodicity_r14.pack(bref)); + HANDLE_CODE(pack_dyn_seq_of(bref, sib_map_info_r14, 0, 31)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE sched_info_mbms_r14_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(si_periodicity_r14.unpack(bref)); + HANDLE_CODE(unpack_dyn_seq_of(sib_map_info_r14, bref, 0, 31)); + + return SRSASN_SUCCESS; +} +void sched_info_mbms_r14_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("si-Periodicity-r14", si_periodicity_r14.to_string()); + j.start_array("sib-MappingInfo-r14"); + for (const auto& e1 : sib_map_info_r14) { + j.write_str(e1.to_string()); } + j.end_array(); + j.end_obj(); +} + +std::string sched_info_mbms_r14_s::si_periodicity_r14_opts::to_string() const +{ + static const char* options[] = {"rf16", "rf32", "rf64", "rf128", "rf256", "rf512"}; + return convert_enum_idx(options, 6, value, "sched_info_mbms_r14_s::si_periodicity_r14_e_"); +} +uint16_t sched_info_mbms_r14_s::si_periodicity_r14_opts::to_number() const +{ + static const uint16_t options[] = {16, 32, 64, 128, 256, 512}; + return map_enum_number(options, 6, value, "sched_info_mbms_r14_s::si_periodicity_r14_e_"); +} + +// NonMBSFN-SubframeConfig-r14 ::= SEQUENCE +SRSASN_CODE non_mbsfn_sf_cfg_r14_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(radio_frame_alloc_period_r14.pack(bref)); + HANDLE_CODE(pack_integer(bref, radio_frame_alloc_offset_r14, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(sf_alloc_r14.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE non_mbsfn_sf_cfg_r14_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(radio_frame_alloc_period_r14.unpack(bref)); + HANDLE_CODE(unpack_integer(radio_frame_alloc_offset_r14, bref, (uint8_t)0u, (uint8_t)7u)); + HANDLE_CODE(sf_alloc_r14.unpack(bref)); + + return SRSASN_SUCCESS; +} +void non_mbsfn_sf_cfg_r14_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("radioFrameAllocationPeriod-r14", radio_frame_alloc_period_r14.to_string()); + j.write_int("radioFrameAllocationOffset-r14", radio_frame_alloc_offset_r14); + j.write_str("subframeAllocation-r14", sf_alloc_r14.to_string()); j.end_obj(); } -SRSASN_CODE pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::pack(bit_ref& bref) const + +std::string non_mbsfn_sf_cfg_r14_s::radio_frame_alloc_period_r14_opts::to_string() const +{ + static const char* options[] = {"rf4", "rf8", "rf16", "rf32", "rf64", "rf128", "rf512"}; + return convert_enum_idx(options, 7, value, "non_mbsfn_sf_cfg_r14_s::radio_frame_alloc_period_r14_e_"); +} +uint16_t non_mbsfn_sf_cfg_r14_s::radio_frame_alloc_period_r14_opts::to_number() const +{ + static const uint16_t options[] = {4, 8, 16, 32, 64, 128, 512}; + return map_enum_number(options, 7, value, "non_mbsfn_sf_cfg_r14_s::radio_frame_alloc_period_r14_e_"); +} + +// SystemInformationBlockType1-MBMS-r14 ::= SEQUENCE +SRSASN_CODE sib_type1_mbms_r14_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(multi_band_info_list_r14_present, 1)); + HANDLE_CODE(bref.pack(non_mbsfn_sf_cfg_r14_present, 1)); + HANDLE_CODE(bref.pack(sib_type13_r14_present, 1)); + HANDLE_CODE(bref.pack(cell_access_related_info_list_r14_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(pack_dyn_seq_of(bref, cell_access_related_info_r14.plmn_id_list_r14, 1, 6)); + HANDLE_CODE(cell_access_related_info_r14.tac_r14.pack(bref)); + HANDLE_CODE(cell_access_related_info_r14.cell_id_r14.pack(bref)); + HANDLE_CODE(pack_integer(bref, freq_band_ind_r14, (uint16_t)1u, (uint16_t)256u)); + if (multi_band_info_list_r14_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r14, 1, 8, integer_packer(1, 256))); + } + HANDLE_CODE(pack_dyn_seq_of(bref, sched_info_list_mbms_r14, 1, 32)); + HANDLE_CODE(si_win_len_r14.pack(bref)); + HANDLE_CODE(pack_integer(bref, sys_info_value_tag_r14, (uint8_t)0u, (uint8_t)31u)); + if (non_mbsfn_sf_cfg_r14_present) { + HANDLE_CODE(non_mbsfn_sf_cfg_r14.pack(bref)); + } + HANDLE_CODE(pdsch_cfg_common_r14.pack(bref)); + if (sib_type13_r14_present) { + HANDLE_CODE(sib_type13_r14.pack(bref)); + } + if (cell_access_related_info_list_r14_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, cell_access_related_info_list_r14, 1, 5)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE sib_type1_mbms_r14_s::unpack(cbit_ref& bref) { - type_.pack(bref); - switch (type_) { - case types::pos_sib1_minus1_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib1_minus2_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib1_minus3_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib1_minus4_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib1_minus5_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib1_minus6_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib1_minus7_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus1_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus2_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus3_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus4_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus5_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus6_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus7_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus8_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus9_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus10_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus11_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus12_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus13_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus14_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus15_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus16_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus17_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus18_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib2_minus19_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::pos_sib3_minus1_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - default: - log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.unpack(multi_band_info_list_r14_present, 1)); + HANDLE_CODE(bref.unpack(non_mbsfn_sf_cfg_r14_present, 1)); + HANDLE_CODE(bref.unpack(sib_type13_r14_present, 1)); + HANDLE_CODE(bref.unpack(cell_access_related_info_list_r14_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + HANDLE_CODE(unpack_dyn_seq_of(cell_access_related_info_r14.plmn_id_list_r14, bref, 1, 6)); + HANDLE_CODE(cell_access_related_info_r14.tac_r14.unpack(bref)); + HANDLE_CODE(cell_access_related_info_r14.cell_id_r14.unpack(bref)); + HANDLE_CODE(unpack_integer(freq_band_ind_r14, bref, (uint16_t)1u, (uint16_t)256u)); + if (multi_band_info_list_r14_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r14, bref, 1, 8, integer_packer(1, 256))); + } + HANDLE_CODE(unpack_dyn_seq_of(sched_info_list_mbms_r14, bref, 1, 32)); + HANDLE_CODE(si_win_len_r14.unpack(bref)); + HANDLE_CODE(unpack_integer(sys_info_value_tag_r14, bref, (uint8_t)0u, (uint8_t)31u)); + if (non_mbsfn_sf_cfg_r14_present) { + HANDLE_CODE(non_mbsfn_sf_cfg_r14.unpack(bref)); + } + HANDLE_CODE(pdsch_cfg_common_r14.unpack(bref)); + if (sib_type13_r14_present) { + HANDLE_CODE(sib_type13_r14.unpack(bref)); + } + if (cell_access_related_info_list_r14_present) { + HANDLE_CODE(unpack_dyn_seq_of(cell_access_related_info_list_r14, bref, 1, 5)); } + return SRSASN_SUCCESS; } -SRSASN_CODE pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::unpack(cbit_ref& bref) +void sib_type1_mbms_r14_s::to_json(json_writer& j) const { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::pos_sib1_minus1_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib1_minus2_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib1_minus3_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib1_minus4_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib1_minus5_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib1_minus6_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib1_minus7_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus1_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus2_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus3_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus4_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus5_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus6_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus7_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus8_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus9_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus10_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus11_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus12_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus13_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus14_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus15_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus16_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus17_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus18_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib2_minus19_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::pos_sib3_minus1_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - default: - log_invalid_choice_id(type_, "pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_"); - return SRSASN_ERROR_DECODE_FAIL; + j.start_obj(); + j.write_fieldname("cellAccessRelatedInfo-r14"); + j.start_obj(); + j.start_array("plmn-IdentityList-r14"); + for (const auto& e1 : cell_access_related_info_r14.plmn_id_list_r14) { + e1.to_json(j); } - return SRSASN_SUCCESS; + j.end_array(); + j.write_str("trackingAreaCode-r14", cell_access_related_info_r14.tac_r14.to_string()); + j.write_str("cellIdentity-r14", cell_access_related_info_r14.cell_id_r14.to_string()); + j.end_obj(); + j.write_int("freqBandIndicator-r14", freq_band_ind_r14); + if (multi_band_info_list_r14_present) { + j.start_array("multiBandInfoList-r14"); + for (const auto& e1 : multi_band_info_list_r14) { + j.write_int(e1); + } + j.end_array(); + } + j.start_array("schedulingInfoList-MBMS-r14"); + for (const auto& e1 : sched_info_list_mbms_r14) { + e1.to_json(j); + } + j.end_array(); + j.write_str("si-WindowLength-r14", si_win_len_r14.to_string()); + j.write_int("systemInfoValueTag-r14", sys_info_value_tag_r14); + if (non_mbsfn_sf_cfg_r14_present) { + j.write_fieldname("nonMBSFN-SubframeConfig-r14"); + non_mbsfn_sf_cfg_r14.to_json(j); + } + j.write_fieldname("pdsch-ConfigCommon-r14"); + pdsch_cfg_common_r14.to_json(j); + if (sib_type13_r14_present) { + j.write_fieldname("systemInformationBlockType13-r14"); + sib_type13_r14.to_json(j); + } + if (cell_access_related_info_list_r14_present) { + j.start_array("cellAccessRelatedInfoList-r14"); + for (const auto& e1 : cell_access_related_info_list_r14) { + e1.to_json(j); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} + +std::string sib_type1_mbms_r14_s::si_win_len_r14_opts::to_string() const +{ + static const char* options[] = {"ms1", "ms2", "ms5", "ms10", "ms15", "ms20", "ms40", "ms80"}; + return convert_enum_idx(options, 8, value, "sib_type1_mbms_r14_s::si_win_len_r14_e_"); +} +uint8_t sib_type1_mbms_r14_s::si_win_len_r14_opts::to_number() const +{ + static const uint8_t options[] = {1, 2, 5, 10, 15, 20, 40, 80}; + return map_enum_number(options, 8, value, "sib_type1_mbms_r14_s::si_win_len_r14_e_"); } -void sib_info_item_c::destroy_() +// CarrierFreqInfoUTRA-FDD-v8h0 ::= SEQUENCE +SRSASN_CODE carrier_freq_info_utra_fdd_v8h0_s::pack(bit_ref& bref) const { - switch (type_) { - case types::sib2: - c.destroy(); - break; - case types::sib3: - c.destroy(); - break; - case types::sib4: - c.destroy(); - break; - case types::sib5: - c.destroy(); - break; - case types::sib6: - c.destroy(); - break; - case types::sib7: - c.destroy(); - break; - case types::sib8: - c.destroy(); - break; - case types::sib9: - c.destroy(); - break; - case types::sib10: - c.destroy(); - break; - case types::sib11: - c.destroy(); - break; - case types::sib12_v920: - c.destroy(); - break; - case types::sib13_v920: - c.destroy(); - break; - case types::sib14_v1130: - c.destroy(); - break; - case types::sib15_v1130: - c.destroy(); - break; - case types::sib16_v1130: - c.destroy(); - break; - case types::sib17_v1250: - c.destroy(); - break; - case types::sib18_v1250: - c.destroy(); - break; - case types::sib19_v1250: - c.destroy(); - break; - case types::sib20_v1310: - c.destroy(); - break; - case types::sib21_v1430: - c.destroy(); - break; - case types::sib24_v1530: - c.destroy(); - break; - case types::sib25_v1530: - c.destroy(); - break; - case types::sib26_v1530: - c.destroy(); - break; - default: - break; + HANDLE_CODE(bref.pack(multi_band_info_list_present, 1)); + + if (multi_band_info_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer(1, 86))); } + + return SRSASN_SUCCESS; } -void sib_info_item_c::set(types::options e) +SRSASN_CODE carrier_freq_info_utra_fdd_v8h0_s::unpack(cbit_ref& bref) { - destroy_(); - type_ = e; - switch (type_) { - case types::sib2: - c.init(); - break; - case types::sib3: - c.init(); - break; - case types::sib4: - c.init(); - break; - case types::sib5: - c.init(); - break; - case types::sib6: - c.init(); - break; - case types::sib7: - c.init(); - break; - case types::sib8: - c.init(); - break; - case types::sib9: - c.init(); - break; - case types::sib10: - c.init(); - break; - case types::sib11: - c.init(); - break; - case types::sib12_v920: - c.init(); - break; - case types::sib13_v920: - c.init(); - break; - case types::sib14_v1130: - c.init(); - break; - case types::sib15_v1130: - c.init(); - break; - case types::sib16_v1130: - c.init(); - break; - case types::sib17_v1250: - c.init(); - break; - case types::sib18_v1250: - c.init(); - break; - case types::sib19_v1250: - c.init(); - break; - case types::sib20_v1310: - c.init(); - break; - case types::sib21_v1430: - c.init(); - break; - case types::sib24_v1530: - c.init(); - break; - case types::sib25_v1530: - c.init(); - break; - case types::sib26_v1530: - c.init(); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sib_info_item_c"); + HANDLE_CODE(bref.unpack(multi_band_info_list_present, 1)); + + if (multi_band_info_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer(1, 86))); } + + return SRSASN_SUCCESS; } -sib_info_item_c::sib_info_item_c(const sib_info_item_c& other) +void carrier_freq_info_utra_fdd_v8h0_s::to_json(json_writer& j) const { - type_ = other.type(); - switch (type_) { - case types::sib2: - c.init(other.c.get()); - break; - case types::sib3: - c.init(other.c.get()); - break; - case types::sib4: - c.init(other.c.get()); - break; - case types::sib5: - c.init(other.c.get()); - break; - case types::sib6: - c.init(other.c.get()); - break; - case types::sib7: - c.init(other.c.get()); - break; - case types::sib8: - c.init(other.c.get()); - break; - case types::sib9: - c.init(other.c.get()); - break; - case types::sib10: - c.init(other.c.get()); - break; - case types::sib11: - c.init(other.c.get()); - break; - case types::sib12_v920: - c.init(other.c.get()); - break; - case types::sib13_v920: - c.init(other.c.get()); - break; - case types::sib14_v1130: - c.init(other.c.get()); - break; - case types::sib15_v1130: - c.init(other.c.get()); - break; - case types::sib16_v1130: - c.init(other.c.get()); - break; - case types::sib17_v1250: - c.init(other.c.get()); - break; - case types::sib18_v1250: - c.init(other.c.get()); - break; - case types::sib19_v1250: - c.init(other.c.get()); - break; - case types::sib20_v1310: - c.init(other.c.get()); - break; - case types::sib21_v1430: - c.init(other.c.get()); - break; - case types::sib24_v1530: - c.init(other.c.get()); - break; - case types::sib25_v1530: - c.init(other.c.get()); - break; - case types::sib26_v1530: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sib_info_item_c"); + j.start_obj(); + if (multi_band_info_list_present) { + j.start_array("multiBandInfoList"); + for (const auto& e1 : multi_band_info_list) { + j.write_int(e1); + } + j.end_array(); } + j.end_obj(); } -sib_info_item_c& sib_info_item_c::operator=(const sib_info_item_c& other) + +// NS-PmaxValue-v10l0 ::= SEQUENCE +SRSASN_CODE ns_pmax_value_v10l0_s::pack(bit_ref& bref) const { - if (this == &other) { - return *this; + HANDLE_CODE(bref.pack(add_spec_emission_v10l0_present, 1)); + + if (add_spec_emission_v10l0_present) { + HANDLE_CODE(pack_integer(bref, add_spec_emission_v10l0, (uint16_t)33u, (uint16_t)288u)); } - set(other.type()); - switch (type_) { - case types::sib2: - c.set(other.c.get()); - break; - case types::sib3: - c.set(other.c.get()); - break; - case types::sib4: - c.set(other.c.get()); - break; - case types::sib5: - c.set(other.c.get()); - break; - case types::sib6: - c.set(other.c.get()); - break; - case types::sib7: - c.set(other.c.get()); - break; - case types::sib8: - c.set(other.c.get()); - break; - case types::sib9: - c.set(other.c.get()); - break; - case types::sib10: - c.set(other.c.get()); - break; - case types::sib11: - c.set(other.c.get()); - break; - case types::sib12_v920: - c.set(other.c.get()); - break; - case types::sib13_v920: - c.set(other.c.get()); - break; - case types::sib14_v1130: - c.set(other.c.get()); - break; - case types::sib15_v1130: - c.set(other.c.get()); - break; - case types::sib16_v1130: - c.set(other.c.get()); - break; - case types::sib17_v1250: - c.set(other.c.get()); - break; - case types::sib18_v1250: - c.set(other.c.get()); - break; - case types::sib19_v1250: - c.set(other.c.get()); - break; - case types::sib20_v1310: - c.set(other.c.get()); - break; - case types::sib21_v1430: - c.set(other.c.get()); - break; - case types::sib24_v1530: - c.set(other.c.get()); - break; - case types::sib25_v1530: - c.set(other.c.get()); - break; - case types::sib26_v1530: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sib_info_item_c"); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ns_pmax_value_v10l0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(add_spec_emission_v10l0_present, 1)); + + if (add_spec_emission_v10l0_present) { + HANDLE_CODE(unpack_integer(add_spec_emission_v10l0, bref, (uint16_t)33u, (uint16_t)288u)); } - return *this; + return SRSASN_SUCCESS; } -void sib_info_item_c::to_json(json_writer& j) const +void ns_pmax_value_v10l0_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::sib2: - j.write_fieldname("sib2"); - c.get().to_json(j); - break; - case types::sib3: - j.write_fieldname("sib3"); - c.get().to_json(j); - break; - case types::sib4: - j.write_fieldname("sib4"); - c.get().to_json(j); - break; - case types::sib5: - j.write_fieldname("sib5"); - c.get().to_json(j); - break; - case types::sib6: - j.write_fieldname("sib6"); - c.get().to_json(j); - break; - case types::sib7: - j.write_fieldname("sib7"); - c.get().to_json(j); - break; - case types::sib8: - j.write_fieldname("sib8"); - c.get().to_json(j); - break; - case types::sib9: - j.write_fieldname("sib9"); - c.get().to_json(j); - break; - case types::sib10: - j.write_fieldname("sib10"); - c.get().to_json(j); - break; - case types::sib11: - j.write_fieldname("sib11"); - c.get().to_json(j); - break; - case types::sib12_v920: - j.write_fieldname("sib12-v920"); - c.get().to_json(j); - break; - case types::sib13_v920: - j.write_fieldname("sib13-v920"); - c.get().to_json(j); - break; - case types::sib14_v1130: - j.write_fieldname("sib14-v1130"); - c.get().to_json(j); - break; - case types::sib15_v1130: - j.write_fieldname("sib15-v1130"); - c.get().to_json(j); - break; - case types::sib16_v1130: - j.write_fieldname("sib16-v1130"); - c.get().to_json(j); - break; - case types::sib17_v1250: - j.write_fieldname("sib17-v1250"); - c.get().to_json(j); - break; - case types::sib18_v1250: - j.write_fieldname("sib18-v1250"); - c.get().to_json(j); - break; - case types::sib19_v1250: - j.write_fieldname("sib19-v1250"); - c.get().to_json(j); - break; - case types::sib20_v1310: - j.write_fieldname("sib20-v1310"); - c.get().to_json(j); - break; - case types::sib21_v1430: - j.write_fieldname("sib21-v1430"); - c.get().to_json(j); - break; - case types::sib24_v1530: - j.write_fieldname("sib24-v1530"); - c.get().to_json(j); - break; - case types::sib25_v1530: - j.write_fieldname("sib25-v1530"); - c.get().to_json(j); - break; - case types::sib26_v1530: - j.write_fieldname("sib26-v1530"); - c.get().to_json(j); - break; - default: - log_invalid_choice_id(type_, "sib_info_item_c"); + if (add_spec_emission_v10l0_present) { + j.write_int("additionalSpectrumEmission-v10l0", add_spec_emission_v10l0); + } + j.end_obj(); +} + +// InterFreqCarrierFreqInfo-v10l0 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v10l0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(freq_band_info_v10l0_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v10l0_present, 1)); + + if (freq_band_info_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_v10l0, 1, 8)); + } + if (multi_band_info_list_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10l0, 1, 8, SeqOfPacker(1, 8, Packer()))); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE inter_freq_carrier_freq_info_v10l0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(freq_band_info_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v10l0_present, 1)); + + if (freq_band_info_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_v10l0, bref, 1, 8)); + } + if (multi_band_info_list_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10l0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); + } + + return SRSASN_SUCCESS; +} +void inter_freq_carrier_freq_info_v10l0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (freq_band_info_v10l0_present) { + j.start_array("freqBandInfo-v10l0"); + for (const auto& e1 : freq_band_info_v10l0) { + e1.to_json(j); + } + j.end_array(); + } + if (multi_band_info_list_v10l0_present) { + j.start_array("multiBandInfoList-v10l0"); + for (const auto& e1 : multi_band_info_list_v10l0) { + j.start_array(); + for (const auto& e2 : e1) { + e2.to_json(j); + } + j.end_array(); + } + j.end_array(); + } + j.end_obj(); +} + +// InterFreqCarrierFreqInfo-v8h0 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v8h0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(multi_band_info_list_present, 1)); + + if (multi_band_info_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer(1, 64))); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE inter_freq_carrier_freq_info_v8h0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(multi_band_info_list_present, 1)); + + if (multi_band_info_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer(1, 64))); + } + + return SRSASN_SUCCESS; +} +void inter_freq_carrier_freq_info_v8h0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (multi_band_info_list_present) { + j.start_array("multiBandInfoList"); + for (const auto& e1 : multi_band_info_list) { + j.write_int(e1); + } + j.end_array(); } j.end_obj(); } -SRSASN_CODE sib_info_item_c::pack(bit_ref& bref) const + +// MultiBandInfo-v9e0 ::= SEQUENCE +SRSASN_CODE multi_band_info_v9e0_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::sib2: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib3: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib4: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib5: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib6: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib7: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib8: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib9: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib10: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib11: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib12_v920: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib13_v920: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib14_v1130: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib15_v1130: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib16_v1130: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib17_v1250: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib18_v1250: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib19_v1250: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib20_v1310: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib21_v1430: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib24_v1530: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib25_v1530: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - case types::sib26_v1530: { - varlength_field_pack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().pack(bref)); - } break; - default: - log_invalid_choice_id(type_, "sib_info_item_c"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(freq_band_ind_v9e0_present, 1)); + + if (freq_band_ind_v9e0_present) { + HANDLE_CODE(pack_integer(bref, freq_band_ind_v9e0, (uint16_t)65u, (uint16_t)256u)); } + return SRSASN_SUCCESS; } -SRSASN_CODE sib_info_item_c::unpack(cbit_ref& bref) +SRSASN_CODE multi_band_info_v9e0_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::sib2: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib3: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib4: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib5: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib6: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib7: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib8: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib9: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib10: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib11: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib12_v920: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib13_v920: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib14_v1130: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib15_v1130: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib16_v1130: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib17_v1250: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib18_v1250: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib19_v1250: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib20_v1310: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib21_v1430: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib24_v1530: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib25_v1530: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - case types::sib26_v1530: { - varlength_field_unpack_guard varlen_scope(bref, false); - HANDLE_CODE(c.get().unpack(bref)); - } break; - default: - log_invalid_choice_id(type_, "sib_info_item_c"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(freq_band_ind_v9e0_present, 1)); + + if (freq_band_ind_v9e0_present) { + HANDLE_CODE(unpack_integer(freq_band_ind_v9e0, bref, (uint16_t)65u, (uint16_t)256u)); + } + + return SRSASN_SUCCESS; +} +void multi_band_info_v9e0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (freq_band_ind_v9e0_present) { + j.write_int("freqBandIndicator-v9e0", freq_band_ind_v9e0); + } + j.end_obj(); +} + +// InterFreqCarrierFreqInfo-v9e0 ::= SEQUENCE +SRSASN_CODE inter_freq_carrier_freq_info_v9e0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(dl_carrier_freq_v9e0_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v9e0_present, 1)); + + if (dl_carrier_freq_v9e0_present) { + HANDLE_CODE(pack_integer(bref, dl_carrier_freq_v9e0, (uint32_t)65536u, (uint32_t)262143u)); + } + if (multi_band_info_list_v9e0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v9e0, 1, 8)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE inter_freq_carrier_freq_info_v9e0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(dl_carrier_freq_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v9e0_present, 1)); + + if (dl_carrier_freq_v9e0_present) { + HANDLE_CODE(unpack_integer(dl_carrier_freq_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u)); + } + if (multi_band_info_list_v9e0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v9e0, bref, 1, 8)); } + return SRSASN_SUCCESS; } +void inter_freq_carrier_freq_info_v9e0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (dl_carrier_freq_v9e0_present) { + j.write_int("dl-CarrierFreq-v9e0", dl_carrier_freq_v9e0); + } + if (multi_band_info_list_v9e0_present) { + j.start_array("multiBandInfoList-v9e0"); + for (const auto& e1 : multi_band_info_list_v9e0) { + e1.to_json(j); + } + j.end_array(); + } + j.end_obj(); +} -// SystemInformation-r8-IEs ::= SEQUENCE -SRSASN_CODE sys_info_r8_ies_s::pack(bit_ref& bref) const +// SIB-Type-v12j0 ::= ENUMERATED +std::string sib_type_v12j0_opts::to_string() const { - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + static const char* options[] = {"sibType19-v1250", + "sibType20-v1310", + "sibType21-v1430", + "sibType24-v1530", + "sibType25-v1530", + "sibType26-v1530", + "spare10", + "spare9", + "spare8", + "spare7", + "spare6", + "spare5", + "spare4", + "spare3", + "spare2", + "spare1"}; + return convert_enum_idx(options, 16, value, "sib_type_v12j0_e"); +} +uint8_t sib_type_v12j0_opts::to_number() const +{ + static const uint8_t options[] = {19, 20, 21, 24, 25, 26}; + return map_enum_number(options, 6, value, "sib_type_v12j0_e"); +} - HANDLE_CODE(pack_dyn_seq_of(bref, sib_type_and_info, 1, 32)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); +// SchedulingInfo-v12j0 ::= SEQUENCE +SRSASN_CODE sched_info_v12j0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(sib_map_info_v12j0_present, 1)); + + if (sib_map_info_v12j0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, sib_map_info_v12j0, 1, 31)); } return SRSASN_SUCCESS; } -SRSASN_CODE sys_info_r8_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE sched_info_v12j0_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(sib_map_info_v12j0_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(sib_type_and_info, bref, 1, 32)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (sib_map_info_v12j0_present) { + HANDLE_CODE(unpack_dyn_seq_of(sib_map_info_v12j0, bref, 1, 31)); } return SRSASN_SUCCESS; } -void sys_info_r8_ies_s::to_json(json_writer& j) const +void sched_info_v12j0_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("sib-TypeAndInfo"); - for (const auto& e1 : sib_type_and_info) { - e1.to_json(j); - } - j.end_array(); - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + if (sib_map_info_v12j0_present) { + j.start_array("sib-MappingInfo-v12j0"); + for (const auto& e1 : sib_map_info_v12j0) { + j.write_str(e1.to_string()); + } + j.end_array(); } j.end_obj(); } -// SystemInformation ::= SEQUENCE -SRSASN_CODE sys_info_s::pack(bit_ref& bref) const +// SchedulingInfoExt-r12 ::= SEQUENCE +SRSASN_CODE sched_info_ext_r12_s::pack(bit_ref& bref) const { - HANDLE_CODE(crit_exts.pack(bref)); + HANDLE_CODE(si_periodicity_r12.pack(bref)); + HANDLE_CODE(pack_dyn_seq_of(bref, sib_map_info_r12, 1, 31)); return SRSASN_SUCCESS; } -SRSASN_CODE sys_info_s::unpack(cbit_ref& bref) +SRSASN_CODE sched_info_ext_r12_s::unpack(cbit_ref& bref) { - HANDLE_CODE(crit_exts.unpack(bref)); + HANDLE_CODE(si_periodicity_r12.unpack(bref)); + HANDLE_CODE(unpack_dyn_seq_of(sib_map_info_r12, bref, 1, 31)); return SRSASN_SUCCESS; } -void sys_info_s::to_json(json_writer& j) const +void sched_info_ext_r12_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); + j.write_str("si-Periodicity-r12", si_periodicity_r12.to_string()); + j.start_array("sib-MappingInfo-r12"); + for (const auto& e1 : sib_map_info_r12) { + j.write_str(e1.to_string()); + } + j.end_array(); j.end_obj(); } -void sys_info_s::crit_exts_c_::destroy_() +// SystemInformationBlockType1-v12j0-IEs ::= SEQUENCE +SRSASN_CODE sib_type1_v12j0_ies_s::pack(bit_ref& bref) const { - switch (type_) { - case types::sys_info_r8: - c.destroy(); - break; - case types::crit_exts_future_r15: - c.destroy(); - break; - default: - break; + HANDLE_CODE(bref.pack(sched_info_list_v12j0_present, 1)); + HANDLE_CODE(bref.pack(sched_info_list_ext_r12_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (sched_info_list_v12j0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, sched_info_list_v12j0, 1, 32)); } + if (sched_info_list_ext_r12_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, sched_info_list_ext_r12, 1, 32)); + } + + return SRSASN_SUCCESS; } -void sys_info_s::crit_exts_c_::set(types::options e) +SRSASN_CODE sib_type1_v12j0_ies_s::unpack(cbit_ref& bref) { - destroy_(); - type_ = e; - switch (type_) { - case types::sys_info_r8: - c.init(); - break; - case types::crit_exts_future_r15: - c.init(); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + HANDLE_CODE(bref.unpack(sched_info_list_v12j0_present, 1)); + HANDLE_CODE(bref.unpack(sched_info_list_ext_r12_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (sched_info_list_v12j0_present) { + HANDLE_CODE(unpack_dyn_seq_of(sched_info_list_v12j0, bref, 1, 32)); + } + if (sched_info_list_ext_r12_present) { + HANDLE_CODE(unpack_dyn_seq_of(sched_info_list_ext_r12, bref, 1, 32)); } + + return SRSASN_SUCCESS; } -sys_info_s::crit_exts_c_::crit_exts_c_(const sys_info_s::crit_exts_c_& other) +void sib_type1_v12j0_ies_s::to_json(json_writer& j) const { - type_ = other.type(); - switch (type_) { - case types::sys_info_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future_r15: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + j.start_obj(); + if (sched_info_list_v12j0_present) { + j.start_array("schedulingInfoList-v12j0"); + for (const auto& e1 : sched_info_list_v12j0) { + e1.to_json(j); + } + j.end_array(); + } + if (sched_info_list_ext_r12_present) { + j.start_array("schedulingInfoListExt-r12"); + for (const auto& e1 : sched_info_list_ext_r12) { + e1.to_json(j); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } + j.end_obj(); } -sys_info_s::crit_exts_c_& sys_info_s::crit_exts_c_::operator=(const sys_info_s::crit_exts_c_& other) + +// SystemInformationBlockType1-v10x0-IEs ::= SEQUENCE +SRSASN_CODE sib_type1_v10x0_ies_s::pack(bit_ref& bref) const { - if (this == &other) { - return *this; + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } - set(other.type()); - switch (type_) { - case types::sys_info_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future_r15: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); } - return *this; + return SRSASN_SUCCESS; } -void sys_info_s::crit_exts_c_::to_json(json_writer& j) const +SRSASN_CODE sib_type1_v10x0_ies_s::unpack(cbit_ref& bref) { - j.start_obj(); - switch (type_) { - case types::sys_info_r8: - j.write_fieldname("systemInformation-r8"); - c.get().to_json(j); - break; - case types::crit_exts_future_r15: - j.write_fieldname("criticalExtensionsFuture-r15"); - c.get().to_json(j); - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - j.end_obj(); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; } -SRSASN_CODE sys_info_s::crit_exts_c_::pack(bit_ref& bref) const +void sib_type1_v10x0_ies_s::to_json(json_writer& j) const { - type_.pack(bref); - switch (type_) { - case types::sys_info_r8: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } - return SRSASN_SUCCESS; + j.end_obj(); } -SRSASN_CODE sys_info_s::crit_exts_c_::unpack(cbit_ref& bref) + +// SystemInformationBlockType1-v10l0-IEs ::= SEQUENCE +SRSASN_CODE sib_type1_v10l0_ies_s::pack(bit_ref& bref) const { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::sys_info_r8: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.pack(freq_band_info_v10l0_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v10l0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (freq_band_info_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_v10l0, 1, 8)); + } + if (multi_band_info_list_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10l0, 1, 8, SeqOfPacker(1, 8, Packer()))); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); } + return SRSASN_SUCCESS; } - -void sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::destroy_() +SRSASN_CODE sib_type1_v10l0_ies_s::unpack(cbit_ref& bref) { - switch (type_) { - case types::pos_sys_info_r15: - c.destroy(); - break; - default: - break; + HANDLE_CODE(bref.unpack(freq_band_info_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (freq_band_info_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_v10l0, bref, 1, 8)); + } + if (multi_band_info_list_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10l0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } + + return SRSASN_SUCCESS; } -void sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::set(types::options e) +void sib_type1_v10l0_ies_s::to_json(json_writer& j) const { - destroy_(); - type_ = e; - switch (type_) { - case types::pos_sys_info_r15: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); + j.start_obj(); + if (freq_band_info_v10l0_present) { + j.start_array("freqBandInfo-v10l0"); + for (const auto& e1 : freq_band_info_v10l0) { + e1.to_json(j); + } + j.end_array(); + } + if (multi_band_info_list_v10l0_present) { + j.start_array("multiBandInfoList-v10l0"); + for (const auto& e1 : multi_band_info_list_v10l0) { + j.start_array(); + for (const auto& e2 : e1) { + e2.to_json(j); + } + j.end_array(); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } + j.end_obj(); } -sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::crit_exts_future_r15_c_( - const sys_info_s::crit_exts_c_::crit_exts_future_r15_c_& other) + +// SystemInformationBlockType1-v10j0-IEs ::= SEQUENCE +SRSASN_CODE sib_type1_v10j0_ies_s::pack(bit_ref& bref) const { - type_ = other.type(); - switch (type_) { - case types::pos_sys_info_r15: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); + HANDLE_CODE(bref.pack(freq_band_info_r10_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v10j0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (freq_band_info_r10_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_r10, 1, 8)); + } + if (multi_band_info_list_v10j0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10j0, 1, 8, SeqOfPacker(1, 8, Packer()))); } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; } -sys_info_s::crit_exts_c_::crit_exts_future_r15_c_& sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::operator=( - const sys_info_s::crit_exts_c_::crit_exts_future_r15_c_& other) +SRSASN_CODE sib_type1_v10j0_ies_s::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; + HANDLE_CODE(bref.unpack(freq_band_info_r10_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v10j0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (freq_band_info_r10_present) { + HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_r10, bref, 1, 8)); } - set(other.type()); - switch (type_) { - case types::pos_sys_info_r15: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); + if (multi_band_info_list_v10j0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10j0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } - return *this; + return SRSASN_SUCCESS; } -void sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::to_json(json_writer& j) const +void sib_type1_v10j0_ies_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::pos_sys_info_r15: - j.write_fieldname("posSystemInformation-r15"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); + if (freq_band_info_r10_present) { + j.start_array("freqBandInfo-r10"); + for (const auto& e1 : freq_band_info_r10) { + e1.to_json(j); + } + j.end_array(); + } + if (multi_band_info_list_v10j0_present) { + j.start_array("multiBandInfoList-v10j0"); + for (const auto& e1 : multi_band_info_list_v10j0) { + j.start_array(); + for (const auto& e2 : e1) { + e2.to_json(j); + } + j.end_array(); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } j.end_obj(); } -SRSASN_CODE sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::pack(bit_ref& bref) const + +// SystemInformationBlockType1-v9e0-IEs ::= SEQUENCE +SRSASN_CODE sib_type1_v9e0_ies_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::pos_sys_info_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(freq_band_ind_v9e0_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v9e0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (freq_band_ind_v9e0_present) { + HANDLE_CODE(pack_integer(bref, freq_band_ind_v9e0, (uint16_t)65u, (uint16_t)256u)); + } + if (multi_band_info_list_v9e0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v9e0, 1, 8)); } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + return SRSASN_SUCCESS; } -SRSASN_CODE sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::unpack(cbit_ref& bref) +SRSASN_CODE sib_type1_v9e0_ies_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::pos_sys_info_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_::crit_exts_future_r15_c_"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(freq_band_ind_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (freq_band_ind_v9e0_present) { + HANDLE_CODE(unpack_integer(freq_band_ind_v9e0, bref, (uint16_t)65u, (uint16_t)256u)); + } + if (multi_band_info_list_v9e0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v9e0, bref, 1, 8)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } + return SRSASN_SUCCESS; } - -// BCCH-DL-SCH-MessageType ::= CHOICE -void bcch_dl_sch_msg_type_c::destroy_() +void sib_type1_v9e0_ies_s::to_json(json_writer& j) const { - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; + j.start_obj(); + if (freq_band_ind_v9e0_present) { + j.write_int("freqBandIndicator-v9e0", freq_band_ind_v9e0); } -} -void bcch_dl_sch_msg_type_c::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); + if (multi_band_info_list_v9e0_present) { + j.start_array("multiBandInfoList-v9e0"); + for (const auto& e1 : multi_band_info_list_v9e0) { + e1.to_json(j); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } + j.end_obj(); } -bcch_dl_sch_msg_type_c::bcch_dl_sch_msg_type_c(const bcch_dl_sch_msg_type_c& other) + +// SystemInformationBlockType1-v8h0-IEs ::= SEQUENCE +SRSASN_CODE sib_type1_v8h0_ies_s::pack(bit_ref& bref) const { - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); + HANDLE_CODE(bref.pack(multi_band_info_list_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (multi_band_info_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer(1, 64))); } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; } -bcch_dl_sch_msg_type_c& bcch_dl_sch_msg_type_c::operator=(const bcch_dl_sch_msg_type_c& other) +SRSASN_CODE sib_type1_v8h0_ies_s::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; + HANDLE_CODE(bref.unpack(multi_band_info_list_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (multi_band_info_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer(1, 64))); } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } - return *this; + return SRSASN_SUCCESS; } -void bcch_dl_sch_msg_type_c::to_json(json_writer& j) const +void sib_type1_v8h0_ies_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); + if (multi_band_info_list_present) { + j.start_array("multiBandInfoList"); + for (const auto& e1 : multi_band_info_list) { + j.write_int(e1); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } j.end_obj(); } -SRSASN_CODE bcch_dl_sch_msg_type_c::pack(bit_ref& bref) const + +// SystemInformationBlockType2-v13c0-IEs ::= SEQUENCE +SRSASN_CODE sib_type2_v13c0_ies_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_v13c0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (ul_pwr_ctrl_common_v13c0_present) { + HANDLE_CODE(ul_pwr_ctrl_common_v13c0.pack(bref)); } + return SRSASN_SUCCESS; } -SRSASN_CODE bcch_dl_sch_msg_type_c::unpack(cbit_ref& bref) +SRSASN_CODE sib_type2_v13c0_ies_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_v13c0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (ul_pwr_ctrl_common_v13c0_present) { + HANDLE_CODE(ul_pwr_ctrl_common_v13c0.unpack(bref)); } + return SRSASN_SUCCESS; } - -void bcch_dl_sch_msg_type_c::c1_c_::destroy_() +void sib_type2_v13c0_ies_s::to_json(json_writer& j) const { - switch (type_) { - case types::sys_info: - c.destroy(); - break; - case types::sib_type1: - c.destroy(); - break; - default: - break; + j.start_obj(); + if (ul_pwr_ctrl_common_v13c0_present) { + j.write_fieldname("uplinkPowerControlCommon-v13c0"); + ul_pwr_ctrl_common_v13c0.to_json(j); } -} -void bcch_dl_sch_msg_type_c::c1_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::sys_info: - c.init(); - break; - case types::sib_type1: - c.init(); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } + j.end_obj(); } -bcch_dl_sch_msg_type_c::c1_c_::c1_c_(const bcch_dl_sch_msg_type_c::c1_c_& other) + +// SystemInformationBlockType2-v10n0-IEs ::= SEQUENCE +SRSASN_CODE sib_type2_v10n0_ies_s::pack(bit_ref& bref) const { - type_ = other.type(); - switch (type_) { - case types::sys_info: - c.init(other.c.get()); - break; - case types::sib_type1: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); } + + return SRSASN_SUCCESS; } -bcch_dl_sch_msg_type_c::c1_c_& bcch_dl_sch_msg_type_c::c1_c_::operator=(const bcch_dl_sch_msg_type_c::c1_c_& other) +SRSASN_CODE sib_type2_v10n0_ies_s::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - set(other.type()); - switch (type_) { - case types::sys_info: - c.set(other.c.get()); - break; - case types::sib_type1: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } - return *this; + return SRSASN_SUCCESS; } -void bcch_dl_sch_msg_type_c::c1_c_::to_json(json_writer& j) const +void sib_type2_v10n0_ies_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::sys_info: - j.write_fieldname("systemInformation"); - c.get().to_json(j); - break; - case types::sib_type1: - j.write_fieldname("systemInformationBlockType1"); - c.get().to_json(j); - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } j.end_obj(); } -SRSASN_CODE bcch_dl_sch_msg_type_c::c1_c_::pack(bit_ref& bref) const + +// SystemInformationBlockType2-v10m0-IEs ::= SEQUENCE +SRSASN_CODE sib_type2_v10m0_ies_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::sys_info: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib_type1: - HANDLE_CODE(c.get().pack(bref)); - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(freq_info_v10l0_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v10l0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (freq_info_v10l0_present) { + HANDLE_CODE(pack_integer(bref, freq_info_v10l0.add_spec_emission_v10l0, (uint16_t)33u, (uint16_t)288u)); + } + if (multi_band_info_list_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10l0, 1, 8, integer_packer(33, 288))); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE sib_type2_v10m0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(freq_info_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (freq_info_v10l0_present) { + HANDLE_CODE(unpack_integer(freq_info_v10l0.add_spec_emission_v10l0, bref, (uint16_t)33u, (uint16_t)288u)); + } + if (multi_band_info_list_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10l0, bref, 1, 8, integer_packer(33, 288))); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } + return SRSASN_SUCCESS; } -SRSASN_CODE bcch_dl_sch_msg_type_c::c1_c_::unpack(cbit_ref& bref) +void sib_type2_v10m0_ies_s::to_json(json_writer& j) const { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::sys_info: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib_type1: - HANDLE_CODE(c.get().unpack(bref)); - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_"); - return SRSASN_ERROR_DECODE_FAIL; + j.start_obj(); + if (freq_info_v10l0_present) { + j.write_fieldname("freqInfo-v10l0"); + j.start_obj(); + j.write_int("additionalSpectrumEmission-v10l0", freq_info_v10l0.add_spec_emission_v10l0); + j.end_obj(); } - return SRSASN_SUCCESS; + if (multi_band_info_list_v10l0_present) { + j.start_array("multiBandInfoList-v10l0"); + for (const auto& e1 : multi_band_info_list_v10l0) { + j.write_int(e1); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); } -// BCCH-DL-SCH-Message ::= SEQUENCE -SRSASN_CODE bcch_dl_sch_msg_s::pack(bit_ref& bref) const +// SystemInformationBlockType2-v9i0-IEs ::= SEQUENCE +SRSASN_CODE sib_type2_v9i0_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(msg.pack(bref)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(dummy_present, 1)); - bref.align_bytes_zero(); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE bcch_dl_sch_msg_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type2_v9i0_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(msg.unpack(bref)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(dummy_present, 1)); - bref.align_bytes(); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } return SRSASN_SUCCESS; } -void bcch_dl_sch_msg_s::to_json(json_writer& j) const +void sib_type2_v9i0_ies_s::to_json(json_writer& j) const { - j.start_array(); j.start_obj(); - j.start_obj("BCCH-DL-SCH-Message"); - j.write_fieldname("message"); - msg.to_json(j); - j.end_obj(); + if (non_crit_ext_present) { + j.write_str("nonCriticalExtension", non_crit_ext.to_string()); + } + if (dummy_present) { + j.write_fieldname("dummy"); + j.start_obj(); + j.end_obj(); + } j.end_obj(); - j.end_array(); } -// BCCH-DL-SCH-MessageType-BR-r13 ::= CHOICE -void bcch_dl_sch_msg_type_br_r13_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} -void bcch_dl_sch_msg_type_br_r13_c::set(types::options e) +// SystemInformationBlockType2-v9e0-IEs ::= SEQUENCE +SRSASN_CODE sib_type2_v9e0_ies_s::pack(bit_ref& bref) const { - destroy_(); - type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); + HANDLE_CODE(bref.pack(ul_carrier_freq_v9e0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (ul_carrier_freq_v9e0_present) { + HANDLE_CODE(pack_integer(bref, ul_carrier_freq_v9e0, (uint32_t)65536u, (uint32_t)262143u)); } -} -bcch_dl_sch_msg_type_br_r13_c::bcch_dl_sch_msg_type_br_r13_c(const bcch_dl_sch_msg_type_br_r13_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); } + + return SRSASN_SUCCESS; } -bcch_dl_sch_msg_type_br_r13_c& bcch_dl_sch_msg_type_br_r13_c::operator=(const bcch_dl_sch_msg_type_br_r13_c& other) +SRSASN_CODE sib_type2_v9e0_ies_s::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; + HANDLE_CODE(bref.unpack(ul_carrier_freq_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (ul_carrier_freq_v9e0_present) { + HANDLE_CODE(unpack_integer(ul_carrier_freq_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u)); } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } - return *this; + return SRSASN_SUCCESS; } -void bcch_dl_sch_msg_type_br_r13_c::to_json(json_writer& j) const +void sib_type2_v9e0_ies_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); + if (ul_carrier_freq_v9e0_present) { + j.write_int("ul-CarrierFreq-v9e0", ul_carrier_freq_v9e0); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } j.end_obj(); } -SRSASN_CODE bcch_dl_sch_msg_type_br_r13_c::pack(bit_ref& bref) const + +// SystemInformationBlockType2-v8h0-IEs ::= SEQUENCE +SRSASN_CODE sib_type2_v8h0_ies_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(multi_band_info_list_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (multi_band_info_list_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer(1, 32))); } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + return SRSASN_SUCCESS; } -SRSASN_CODE bcch_dl_sch_msg_type_br_r13_c::unpack(cbit_ref& bref) +SRSASN_CODE sib_type2_v8h0_ies_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(multi_band_info_list_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (multi_band_info_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer(1, 32))); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } + return SRSASN_SUCCESS; } - -void bcch_dl_sch_msg_type_br_r13_c::c1_c_::destroy_() +void sib_type2_v8h0_ies_s::to_json(json_writer& j) const { - switch (type_) { - case types::sys_info_br_r13: - c.destroy(); - break; - case types::sib_type1_br_r13: - c.destroy(); - break; - default: - break; + j.start_obj(); + if (multi_band_info_list_present) { + j.start_array("multiBandInfoList"); + for (const auto& e1 : multi_band_info_list) { + j.write_int(e1); + } + j.end_array(); } -} -void bcch_dl_sch_msg_type_br_r13_c::c1_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::sys_info_br_r13: - c.init(); - break; - case types::sib_type1_br_r13: - c.init(); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } + j.end_obj(); } -bcch_dl_sch_msg_type_br_r13_c::c1_c_::c1_c_(const bcch_dl_sch_msg_type_br_r13_c::c1_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::sys_info_br_r13: - c.init(other.c.get()); - break; - case types::sib_type1_br_r13: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + +// SystemInformationBlockType3-v10l0-IEs ::= SEQUENCE +SRSASN_CODE sib_type3_v10l0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(freq_band_info_v10l0_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v10l0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (freq_band_info_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_v10l0, 1, 8)); + } + if (multi_band_info_list_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10l0, 1, 8, SeqOfPacker(1, 8, Packer()))); } + + return SRSASN_SUCCESS; } -bcch_dl_sch_msg_type_br_r13_c::c1_c_& -bcch_dl_sch_msg_type_br_r13_c::c1_c_::operator=(const bcch_dl_sch_msg_type_br_r13_c::c1_c_& other) +SRSASN_CODE sib_type3_v10l0_ies_s::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; + HANDLE_CODE(bref.unpack(freq_band_info_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (freq_band_info_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_v10l0, bref, 1, 8)); } - set(other.type()); - switch (type_) { - case types::sys_info_br_r13: - c.set(other.c.get()); - break; - case types::sib_type1_br_r13: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + if (multi_band_info_list_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10l0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); } - return *this; + return SRSASN_SUCCESS; } -void bcch_dl_sch_msg_type_br_r13_c::c1_c_::to_json(json_writer& j) const +void sib_type3_v10l0_ies_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::sys_info_br_r13: - j.write_fieldname("systemInformation-BR-r13"); - c.get().to_json(j); - break; - case types::sib_type1_br_r13: - j.write_fieldname("systemInformationBlockType1-BR-r13"); - c.get().to_json(j); - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); + if (freq_band_info_v10l0_present) { + j.start_array("freqBandInfo-v10l0"); + for (const auto& e1 : freq_band_info_v10l0) { + e1.to_json(j); + } + j.end_array(); + } + if (multi_band_info_list_v10l0_present) { + j.start_array("multiBandInfoList-v10l0"); + for (const auto& e1 : multi_band_info_list_v10l0) { + j.start_array(); + for (const auto& e2 : e1) { + e2.to_json(j); + } + j.end_array(); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } j.end_obj(); } -SRSASN_CODE bcch_dl_sch_msg_type_br_r13_c::c1_c_::pack(bit_ref& bref) const + +// SystemInformationBlockType3-v10j0-IEs ::= SEQUENCE +SRSASN_CODE sib_type3_v10j0_ies_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::sys_info_br_r13: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::sib_type1_br_r13: - HANDLE_CODE(c.get().pack(bref)); - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(freq_band_info_r10_present, 1)); + HANDLE_CODE(bref.pack(multi_band_info_list_v10j0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (freq_band_info_r10_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_info_r10, 1, 8)); + } + if (multi_band_info_list_v10j0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_v10j0, 1, 8, SeqOfPacker(1, 8, Packer()))); } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + return SRSASN_SUCCESS; } -SRSASN_CODE bcch_dl_sch_msg_type_br_r13_c::c1_c_::unpack(cbit_ref& bref) +SRSASN_CODE sib_type3_v10j0_ies_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::sys_info_br_r13: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::sib_type1_br_r13: - HANDLE_CODE(c.get().unpack(bref)); - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_br_r13_c::c1_c_"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(freq_band_info_r10_present, 1)); + HANDLE_CODE(bref.unpack(multi_band_info_list_v10j0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (freq_band_info_r10_present) { + HANDLE_CODE(unpack_dyn_seq_of(freq_band_info_r10, bref, 1, 8)); + } + if (multi_band_info_list_v10j0_present) { + HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_v10j0, bref, 1, 8, SeqOfPacker(1, 8, Packer()))); } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + return SRSASN_SUCCESS; } +void sib_type3_v10j0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (freq_band_info_r10_present) { + j.start_array("freqBandInfo-r10"); + for (const auto& e1 : freq_band_info_r10) { + e1.to_json(j); + } + j.end_array(); + } + if (multi_band_info_list_v10j0_present) { + j.start_array("multiBandInfoList-v10j0"); + for (const auto& e1 : multi_band_info_list_v10j0) { + j.start_array(); + for (const auto& e2 : e1) { + e2.to_json(j); + } + j.end_array(); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} -// BCCH-DL-SCH-Message-BR ::= SEQUENCE -SRSASN_CODE bcch_dl_sch_msg_br_s::pack(bit_ref& bref) const +// SystemInformationBlockType5-v13a0-IEs ::= SEQUENCE +SRSASN_CODE sib_type5_v13a0_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(msg.pack(bref)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v13a0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - bref.align_bytes_zero(); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (inter_freq_carrier_freq_list_v13a0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v13a0, 1, 8)); + } return SRSASN_SUCCESS; } -SRSASN_CODE bcch_dl_sch_msg_br_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type5_v13a0_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(msg.unpack(bref)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v13a0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - bref.align_bytes(); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (inter_freq_carrier_freq_list_v13a0_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v13a0, bref, 1, 8)); + } return SRSASN_SUCCESS; } -void bcch_dl_sch_msg_br_s::to_json(json_writer& j) const +void sib_type5_v13a0_ies_s::to_json(json_writer& j) const { - j.start_array(); j.start_obj(); - j.start_obj("BCCH-DL-SCH-Message-BR"); - j.write_fieldname("message"); - msg.to_json(j); - j.end_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (inter_freq_carrier_freq_list_v13a0_present) { + j.start_array("interFreqCarrierFreqList-v13a0"); + for (const auto& e1 : inter_freq_carrier_freq_list_v13a0) { + e1.to_json(j); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } j.end_obj(); - j.end_array(); } -// SIB-Type-MBMS-r14 ::= ENUMERATED -std::string sib_type_mbms_r14_opts::to_string() const +// SystemInformationBlockType5-v10l0-IEs ::= SEQUENCE +SRSASN_CODE sib_type5_v10l0_ies_s::pack(bit_ref& bref) const { - static const char* options[] = { - "sibType10", "sibType11", "sibType12-v920", "sibType13-v920", "sibType15-v1130", "sibType16-v1130"}; - return convert_enum_idx(options, 6, value, "sib_type_mbms_r14_e"); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v10l0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (inter_freq_carrier_freq_list_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v10l0, 1, 8)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; } -uint8_t sib_type_mbms_r14_opts::to_number() const +SRSASN_CODE sib_type5_v10l0_ies_s::unpack(cbit_ref& bref) { - static const uint8_t options[] = {10, 11, 12, 13, 15, 16}; - return map_enum_number(options, 6, value, "sib_type_mbms_r14_e"); + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (inter_freq_carrier_freq_list_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v10l0, bref, 1, 8)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void sib_type5_v10l0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (inter_freq_carrier_freq_list_v10l0_present) { + j.start_array("interFreqCarrierFreqList-v10l0"); + for (const auto& e1 : inter_freq_carrier_freq_list_v10l0) { + e1.to_json(j); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); } -// SchedulingInfo-MBMS-r14 ::= SEQUENCE -SRSASN_CODE sched_info_mbms_r14_s::pack(bit_ref& bref) const +// SystemInformationBlockType5-v10j0-IEs ::= SEQUENCE +SRSASN_CODE sib_type5_v10j0_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(si_periodicity_r14.pack(bref)); - HANDLE_CODE(pack_dyn_seq_of(bref, sib_map_info_r14, 0, 31)); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v10j0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (inter_freq_carrier_freq_list_v10j0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v10j0, 1, 8)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE sched_info_mbms_r14_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type5_v10j0_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(si_periodicity_r14.unpack(bref)); - HANDLE_CODE(unpack_dyn_seq_of(sib_map_info_r14, bref, 0, 31)); + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v10j0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (inter_freq_carrier_freq_list_v10j0_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v10j0, bref, 1, 8)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } return SRSASN_SUCCESS; } -void sched_info_mbms_r14_s::to_json(json_writer& j) const +void sib_type5_v10j0_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("si-Periodicity-r14", si_periodicity_r14.to_string()); - j.start_array("sib-MappingInfo-r14"); - for (const auto& e1 : sib_map_info_r14) { - j.write_str(e1.to_string()); + if (inter_freq_carrier_freq_list_v10j0_present) { + j.start_array("interFreqCarrierFreqList-v10j0"); + for (const auto& e1 : inter_freq_carrier_freq_list_v10j0) { + e1.to_json(j); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } - j.end_array(); j.end_obj(); } -std::string sched_info_mbms_r14_s::si_periodicity_r14_opts::to_string() const -{ - static const char* options[] = {"rf16", "rf32", "rf64", "rf128", "rf256", "rf512"}; - return convert_enum_idx(options, 6, value, "sched_info_mbms_r14_s::si_periodicity_r14_e_"); -} -uint16_t sched_info_mbms_r14_s::si_periodicity_r14_opts::to_number() const +// SystemInformationBlockType5-v9e0-IEs ::= SEQUENCE +SRSASN_CODE sib_type5_v9e0_ies_s::pack(bit_ref& bref) const { - static const uint16_t options[] = {16, 32, 64, 128, 256, 512}; - return map_enum_number(options, 6, value, "sched_info_mbms_r14_s::si_periodicity_r14_e_"); -} + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v9e0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); -// NonMBSFN-SubframeConfig-r14 ::= SEQUENCE -SRSASN_CODE non_mbsfn_sf_cfg_r14_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(radio_frame_alloc_period_r14.pack(bref)); - HANDLE_CODE(pack_integer(bref, radio_frame_alloc_offset_r14, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(sf_alloc_r14.pack(bref)); + if (inter_freq_carrier_freq_list_v9e0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v9e0, 1, 8)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE non_mbsfn_sf_cfg_r14_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type5_v9e0_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(radio_frame_alloc_period_r14.unpack(bref)); - HANDLE_CODE(unpack_integer(radio_frame_alloc_offset_r14, bref, (uint8_t)0u, (uint8_t)7u)); - HANDLE_CODE(sf_alloc_r14.unpack(bref)); + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (inter_freq_carrier_freq_list_v9e0_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v9e0, bref, 1, 8)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } return SRSASN_SUCCESS; } -void non_mbsfn_sf_cfg_r14_s::to_json(json_writer& j) const +void sib_type5_v9e0_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("radioFrameAllocationPeriod-r14", radio_frame_alloc_period_r14.to_string()); - j.write_int("radioFrameAllocationOffset-r14", radio_frame_alloc_offset_r14); - j.write_str("subframeAllocation-r14", sf_alloc_r14.to_string()); + if (inter_freq_carrier_freq_list_v9e0_present) { + j.start_array("interFreqCarrierFreqList-v9e0"); + for (const auto& e1 : inter_freq_carrier_freq_list_v9e0) { + e1.to_json(j); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } j.end_obj(); } -std::string non_mbsfn_sf_cfg_r14_s::radio_frame_alloc_period_r14_opts::to_string() const -{ - static const char* options[] = {"rf4", "rf8", "rf16", "rf32", "rf64", "rf128", "rf512"}; - return convert_enum_idx(options, 7, value, "non_mbsfn_sf_cfg_r14_s::radio_frame_alloc_period_r14_e_"); -} -uint16_t non_mbsfn_sf_cfg_r14_s::radio_frame_alloc_period_r14_opts::to_number() const -{ - static const uint16_t options[] = {4, 8, 16, 32, 64, 128, 512}; - return map_enum_number(options, 7, value, "non_mbsfn_sf_cfg_r14_s::radio_frame_alloc_period_r14_e_"); -} - -// SystemInformationBlockType1-MBMS-r14 ::= SEQUENCE -SRSASN_CODE sib_type1_mbms_r14_s::pack(bit_ref& bref) const +// SystemInformationBlockType5-v8h0-IEs ::= SEQUENCE +SRSASN_CODE sib_type5_v8h0_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(multi_band_info_list_r14_present, 1)); - HANDLE_CODE(bref.pack(non_mbsfn_sf_cfg_r14_present, 1)); - HANDLE_CODE(bref.pack(sib_type13_r14_present, 1)); - HANDLE_CODE(bref.pack(cell_access_related_info_list_r14_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_carrier_freq_list_v8h0_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - HANDLE_CODE(pack_dyn_seq_of(bref, cell_access_related_info_r14.plmn_id_list_r14, 1, 6)); - HANDLE_CODE(cell_access_related_info_r14.tac_r14.pack(bref)); - HANDLE_CODE(cell_access_related_info_r14.cell_id_r14.pack(bref)); - HANDLE_CODE(pack_integer(bref, freq_band_ind_r14, (uint16_t)1u, (uint16_t)256u)); - if (multi_band_info_list_r14_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r14, 1, 8, integer_packer(1, 256))); - } - HANDLE_CODE(pack_dyn_seq_of(bref, sched_info_list_mbms_r14, 1, 32)); - HANDLE_CODE(si_win_len_r14.pack(bref)); - HANDLE_CODE(pack_integer(bref, sys_info_value_tag_r14, (uint8_t)0u, (uint8_t)31u)); - if (non_mbsfn_sf_cfg_r14_present) { - HANDLE_CODE(non_mbsfn_sf_cfg_r14.pack(bref)); - } - HANDLE_CODE(pdsch_cfg_common_r14.pack(bref)); - if (sib_type13_r14_present) { - HANDLE_CODE(sib_type13_r14.pack(bref)); + if (inter_freq_carrier_freq_list_v8h0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_carrier_freq_list_v8h0, 1, 8)); } - if (cell_access_related_info_list_r14_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, cell_access_related_info_list_r14, 1, 5)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE sib_type1_mbms_r14_s::unpack(cbit_ref& bref) +SRSASN_CODE sib_type5_v8h0_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(multi_band_info_list_r14_present, 1)); - HANDLE_CODE(bref.unpack(non_mbsfn_sf_cfg_r14_present, 1)); - HANDLE_CODE(bref.unpack(sib_type13_r14_present, 1)); - HANDLE_CODE(bref.unpack(cell_access_related_info_list_r14_present, 1)); + HANDLE_CODE(bref.unpack(inter_freq_carrier_freq_list_v8h0_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(cell_access_related_info_r14.plmn_id_list_r14, bref, 1, 6)); - HANDLE_CODE(cell_access_related_info_r14.tac_r14.unpack(bref)); - HANDLE_CODE(cell_access_related_info_r14.cell_id_r14.unpack(bref)); - HANDLE_CODE(unpack_integer(freq_band_ind_r14, bref, (uint16_t)1u, (uint16_t)256u)); - if (multi_band_info_list_r14_present) { - HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r14, bref, 1, 8, integer_packer(1, 256))); - } - HANDLE_CODE(unpack_dyn_seq_of(sched_info_list_mbms_r14, bref, 1, 32)); - HANDLE_CODE(si_win_len_r14.unpack(bref)); - HANDLE_CODE(unpack_integer(sys_info_value_tag_r14, bref, (uint8_t)0u, (uint8_t)31u)); - if (non_mbsfn_sf_cfg_r14_present) { - HANDLE_CODE(non_mbsfn_sf_cfg_r14.unpack(bref)); - } - HANDLE_CODE(pdsch_cfg_common_r14.unpack(bref)); - if (sib_type13_r14_present) { - HANDLE_CODE(sib_type13_r14.unpack(bref)); + if (inter_freq_carrier_freq_list_v8h0_present) { + HANDLE_CODE(unpack_dyn_seq_of(inter_freq_carrier_freq_list_v8h0, bref, 1, 8)); } - if (cell_access_related_info_list_r14_present) { - HANDLE_CODE(unpack_dyn_seq_of(cell_access_related_info_list_r14, bref, 1, 5)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } return SRSASN_SUCCESS; } -void sib_type1_mbms_r14_s::to_json(json_writer& j) const +void sib_type5_v8h0_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("cellAccessRelatedInfo-r14"); - j.start_obj(); - j.start_array("plmn-IdentityList-r14"); - for (const auto& e1 : cell_access_related_info_r14.plmn_id_list_r14) { - e1.to_json(j); - } - j.end_array(); - j.write_str("trackingAreaCode-r14", cell_access_related_info_r14.tac_r14.to_string()); - j.write_str("cellIdentity-r14", cell_access_related_info_r14.cell_id_r14.to_string()); - j.end_obj(); - j.write_int("freqBandIndicator-r14", freq_band_ind_r14); - if (multi_band_info_list_r14_present) { - j.start_array("multiBandInfoList-r14"); - for (const auto& e1 : multi_band_info_list_r14) { - j.write_int(e1); + if (inter_freq_carrier_freq_list_v8h0_present) { + j.start_array("interFreqCarrierFreqList-v8h0"); + for (const auto& e1 : inter_freq_carrier_freq_list_v8h0) { + e1.to_json(j); } j.end_array(); } - j.start_array("schedulingInfoList-MBMS-r14"); - for (const auto& e1 : sched_info_list_mbms_r14) { - e1.to_json(j); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } - j.end_array(); - j.write_str("si-WindowLength-r14", si_win_len_r14.to_string()); - j.write_int("systemInfoValueTag-r14", sys_info_value_tag_r14); - if (non_mbsfn_sf_cfg_r14_present) { - j.write_fieldname("nonMBSFN-SubframeConfig-r14"); - non_mbsfn_sf_cfg_r14.to_json(j); + j.end_obj(); +} + +// SystemInformationBlockType6-v8h0-IEs ::= SEQUENCE +SRSASN_CODE sib_type6_v8h0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(carrier_freq_list_utra_fdd_v8h0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (carrier_freq_list_utra_fdd_v8h0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, carrier_freq_list_utra_fdd_v8h0, 1, 16)); } - j.write_fieldname("pdsch-ConfigCommon-r14"); - pdsch_cfg_common_r14.to_json(j); - if (sib_type13_r14_present) { - j.write_fieldname("systemInformationBlockType13-r14"); - sib_type13_r14.to_json(j); + + return SRSASN_SUCCESS; +} +SRSASN_CODE sib_type6_v8h0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(carrier_freq_list_utra_fdd_v8h0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (carrier_freq_list_utra_fdd_v8h0_present) { + HANDLE_CODE(unpack_dyn_seq_of(carrier_freq_list_utra_fdd_v8h0, bref, 1, 16)); } - if (cell_access_related_info_list_r14_present) { - j.start_array("cellAccessRelatedInfoList-r14"); - for (const auto& e1 : cell_access_related_info_list_r14) { + + return SRSASN_SUCCESS; +} +void sib_type6_v8h0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (carrier_freq_list_utra_fdd_v8h0_present) { + j.start_array("carrierFreqListUTRA-FDD-v8h0"); + for (const auto& e1 : carrier_freq_list_utra_fdd_v8h0) { e1.to_json(j); } j.end_array(); @@ -11309,14 +11147,3 @@ void sib_type1_mbms_r14_s::to_json(json_writer& j) const } j.end_obj(); } - -std::string sib_type1_mbms_r14_s::si_win_len_r14_opts::to_string() const -{ - static const char* options[] = {"ms1", "ms2", "ms5", "ms10", "ms15", "ms20", "ms40", "ms80"}; - return convert_enum_idx(options, 8, value, "sib_type1_mbms_r14_s::si_win_len_r14_e_"); -} -uint8_t sib_type1_mbms_r14_s::si_win_len_r14_opts::to_number() const -{ - static const uint8_t options[] = {1, 2, 5, 10, 15, 20, 40, 80}; - return map_enum_number(options, 8, value, "sib_type1_mbms_r14_s::si_win_len_r14_e_"); -} diff --git a/lib/src/asn1/rrc/dl_ccch_msg.cc b/lib/src/asn1/rrc/dl_ccch_msg.cc index 936caa189..c39159781 100644 --- a/lib/src/asn1/rrc/dl_ccch_msg.cc +++ b/lib/src/asn1/rrc/dl_ccch_msg.cc @@ -1327,66 +1327,9 @@ void rrc_conn_reest_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_reest_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_reest_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_"); - } -} -rrc_conn_reest_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reest_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_"); - } -} -rrc_conn_reest_s::crit_exts_c_& rrc_conn_reest_s::crit_exts_c_::operator=(const rrc_conn_reest_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_reest_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1394,7 +1337,7 @@ void rrc_conn_reest_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1408,7 +1351,7 @@ SRSASN_CODE rrc_conn_reest_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1425,7 +1368,7 @@ SRSASN_CODE rrc_conn_reest_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -1545,67 +1488,9 @@ void rrc_conn_reest_reject_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_reest_reject_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_reest_reject_r8: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_reest_reject_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_conn_reest_reject_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_reject_s::crit_exts_c_"); - } -} -rrc_conn_reest_reject_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reest_reject_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_reest_reject_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_reject_s::crit_exts_c_"); - } -} -rrc_conn_reest_reject_s::crit_exts_c_& -rrc_conn_reest_reject_s::crit_exts_c_::operator=(const rrc_conn_reest_reject_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_reest_reject_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_reject_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_reest_reject_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1613,7 +1498,7 @@ void rrc_conn_reest_reject_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_conn_reest_reject_r8: j.write_fieldname("rrcConnectionReestablishmentReject-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1627,7 +1512,7 @@ SRSASN_CODE rrc_conn_reest_reject_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_conn_reest_reject_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1644,7 +1529,7 @@ SRSASN_CODE rrc_conn_reest_reject_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_conn_reest_reject_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -1676,67 +1561,9 @@ void rrc_conn_reject_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_reject_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_reject_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_"); - } -} -rrc_conn_reject_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reject_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_"); - } -} -rrc_conn_reject_s::crit_exts_c_& -rrc_conn_reject_s::crit_exts_c_::operator=(const rrc_conn_reject_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_reject_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1744,7 +1571,7 @@ void rrc_conn_reject_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1758,7 +1585,7 @@ SRSASN_CODE rrc_conn_reject_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1775,7 +1602,7 @@ SRSASN_CODE rrc_conn_reject_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -1874,66 +1701,9 @@ void rrc_conn_setup_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_setup_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_setup_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_"); - } -} -rrc_conn_setup_s::crit_exts_c_::crit_exts_c_(const rrc_conn_setup_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_"); - } -} -rrc_conn_setup_s::crit_exts_c_& rrc_conn_setup_s::crit_exts_c_::operator=(const rrc_conn_setup_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_setup_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1941,7 +1711,7 @@ void rrc_conn_setup_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1955,7 +1725,7 @@ SRSASN_CODE rrc_conn_setup_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1972,7 +1742,7 @@ SRSASN_CODE rrc_conn_setup_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -2092,67 +1862,9 @@ void rrc_early_data_complete_r15_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_early_data_complete_r15_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_early_data_complete_r15: - c.destroy(); - break; - default: - break; - } -} void rrc_early_data_complete_r15_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_early_data_complete_r15: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_complete_r15_s::crit_exts_c_"); - } -} -rrc_early_data_complete_r15_s::crit_exts_c_::crit_exts_c_(const rrc_early_data_complete_r15_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_early_data_complete_r15: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_complete_r15_s::crit_exts_c_"); - } -} -rrc_early_data_complete_r15_s::crit_exts_c_& -rrc_early_data_complete_r15_s::crit_exts_c_::operator=(const rrc_early_data_complete_r15_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_early_data_complete_r15: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_complete_r15_s::crit_exts_c_"); - } - - return *this; } void rrc_early_data_complete_r15_s::crit_exts_c_::to_json(json_writer& j) const { @@ -2160,7 +1872,7 @@ void rrc_early_data_complete_r15_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_early_data_complete_r15: j.write_fieldname("rrcEarlyDataComplete-r15"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -2174,7 +1886,7 @@ SRSASN_CODE rrc_early_data_complete_r15_s::crit_exts_c_::pack(bit_ref& bref) con type_.pack(bref); switch (type_) { case types::rrc_early_data_complete_r15: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -2191,7 +1903,7 @@ SRSASN_CODE rrc_early_data_complete_r15_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_early_data_complete_r15: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -2485,67 +2197,9 @@ SRSASN_CODE dl_ccch_msg_type_c::c1_c_::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -void dl_ccch_msg_type_c::msg_class_ext_c_::destroy_() -{ - switch (type_) { - case types::c2: - c.destroy(); - break; - default: - break; - } -} void dl_ccch_msg_type_c::msg_class_ext_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c2: - c.init(); - break; - case types::msg_class_ext_future_r15: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_"); - } -} -dl_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_c_(const dl_ccch_msg_type_c::msg_class_ext_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c2: - c.init(other.c.get()); - break; - case types::msg_class_ext_future_r15: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_"); - } -} -dl_ccch_msg_type_c::msg_class_ext_c_& -dl_ccch_msg_type_c::msg_class_ext_c_::operator=(const dl_ccch_msg_type_c::msg_class_ext_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c2: - c.set(other.c.get()); - break; - case types::msg_class_ext_future_r15: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_"); - } - - return *this; } void dl_ccch_msg_type_c::msg_class_ext_c_::to_json(json_writer& j) const { @@ -2553,7 +2207,7 @@ void dl_ccch_msg_type_c::msg_class_ext_c_::to_json(json_writer& j) const switch (type_) { case types::c2: j.write_fieldname("c2"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext_future_r15: break; @@ -2567,7 +2221,7 @@ SRSASN_CODE dl_ccch_msg_type_c::msg_class_ext_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c2: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext_future_r15: break; @@ -2584,7 +2238,7 @@ SRSASN_CODE dl_ccch_msg_type_c::msg_class_ext_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c2: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext_future_r15: break; diff --git a/lib/src/asn1/rrc/dl_dcch_msg.cc b/lib/src/asn1/rrc/dl_dcch_msg.cc index 98b8571bf..8592dbdac 100644 --- a/lib/src/asn1/rrc/dl_dcch_msg.cc +++ b/lib/src/asn1/rrc/dl_dcch_msg.cc @@ -1022,27 +1022,6 @@ void rr_cfg_common_ps_cell_r12_s::to_json(json_writer& j) const j.end_obj(); } -// RadioResourceConfigCommonPSCell-v12f0 ::= SEQUENCE -SRSASN_CODE rr_cfg_common_ps_cell_v12f0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(basic_fields_v12f0.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rr_cfg_common_ps_cell_v12f0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(basic_fields_v12f0.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rr_cfg_common_ps_cell_v12f0_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("basicFields-v12f0"); - basic_fields_v12f0.to_json(j); - j.end_obj(); -} - // RadioResourceConfigCommonPSCell-v1440 ::= SEQUENCE SRSASN_CODE rr_cfg_common_ps_cell_v1440_s::pack(bit_ref& bref) const { @@ -1304,55 +1283,6 @@ void rr_cfg_ded_ps_cell_v13c0_s::to_json(json_writer& j) const j.end_obj(); } -// SCG-ConfigPartSCG-v13c0 ::= SEQUENCE -SRSASN_CODE scg_cfg_part_scg_v13c0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_v13c0_present, 1)); - HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_ext_v13c0_present, 1)); - - if (scell_to_add_mod_list_scg_v13c0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_v13c0, 1, 4)); - } - if (scell_to_add_mod_list_scg_ext_v13c0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_ext_v13c0, 1, 31)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE scg_cfg_part_scg_v13c0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_v13c0_present, 1)); - HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_ext_v13c0_present, 1)); - - if (scell_to_add_mod_list_scg_v13c0_present) { - HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_v13c0, bref, 1, 4)); - } - if (scell_to_add_mod_list_scg_ext_v13c0_present) { - HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_ext_v13c0, bref, 1, 31)); - } - - return SRSASN_SUCCESS; -} -void scg_cfg_part_scg_v13c0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (scell_to_add_mod_list_scg_v13c0_present) { - j.start_array("sCellToAddModListSCG-v13c0"); - for (const auto& e1 : scell_to_add_mod_list_scg_v13c0) { - e1.to_json(j); - } - j.end_array(); - } - if (scell_to_add_mod_list_scg_ext_v13c0_present) { - j.start_array("sCellToAddModListSCG-Ext-v13c0"); - for (const auto& e1 : scell_to_add_mod_list_scg_ext_v13c0) { - e1.to_json(j); - } - j.end_array(); - } - j.end_obj(); -} - // SL-DiscTxRefCarrierDedicated-r13 ::= CHOICE void sl_disc_tx_ref_carrier_ded_r13_c::set(types::options e) { @@ -2204,37 +2134,6 @@ void ps_cell_to_add_mod_r12_s::to_json(json_writer& j) const j.end_obj(); } -// PSCellToAddMod-v12f0 ::= SEQUENCE -SRSASN_CODE ps_cell_to_add_mod_v12f0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rr_cfg_common_ps_cell_r12_present, 1)); - - if (rr_cfg_common_ps_cell_r12_present) { - HANDLE_CODE(rr_cfg_common_ps_cell_r12.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ps_cell_to_add_mod_v12f0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rr_cfg_common_ps_cell_r12_present, 1)); - - if (rr_cfg_common_ps_cell_r12_present) { - HANDLE_CODE(rr_cfg_common_ps_cell_r12.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ps_cell_to_add_mod_v12f0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rr_cfg_common_ps_cell_r12_present) { - j.write_fieldname("radioResourceConfigCommonPSCell-r12"); - rr_cfg_common_ps_cell_r12.to_json(j); - } - j.end_obj(); -} - // PSCellToAddMod-v1440 ::= SEQUENCE SRSASN_CODE ps_cell_to_add_mod_v1440_s::pack(bit_ref& bref) const { @@ -2511,70 +2410,6 @@ SRSASN_CODE rrc_conn_recfg_v1510_ies_s::nr_cfg_r15_c_::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -// SCG-Configuration-v13c0 ::= CHOICE -void scg_cfg_v13c0_c::set(types::options e) -{ - type_ = e; -} -void scg_cfg_v13c0_c::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::release: - break; - case types::setup: - j.write_fieldname("setup"); - j.start_obj(); - if (c.scg_cfg_part_scg_v13c0_present) { - j.write_fieldname("scg-ConfigPartSCG-v13c0"); - c.scg_cfg_part_scg_v13c0.to_json(j); - } - j.end_obj(); - break; - default: - log_invalid_choice_id(type_, "scg_cfg_v13c0_c"); - } - j.end_obj(); -} -SRSASN_CODE scg_cfg_v13c0_c::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::release: - break; - case types::setup: - HANDLE_CODE(bref.pack(c.scg_cfg_part_scg_v13c0_present, 1)); - if (c.scg_cfg_part_scg_v13c0_present) { - HANDLE_CODE(c.scg_cfg_part_scg_v13c0.pack(bref)); - } - break; - default: - log_invalid_choice_id(type_, "scg_cfg_v13c0_c"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE scg_cfg_v13c0_c::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::release: - break; - case types::setup: - HANDLE_CODE(bref.unpack(c.scg_cfg_part_scg_v13c0_present, 1)); - if (c.scg_cfg_part_scg_v13c0_present) { - HANDLE_CODE(c.scg_cfg_part_scg_v13c0.unpack(bref)); - } - break; - default: - log_invalid_choice_id(type_, "scg_cfg_v13c0_c"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - // SL-CommTxPoolToAddMod-r12 ::= SEQUENCE SRSASN_CODE sl_comm_tx_pool_to_add_mod_r12_s::pack(bit_ref& bref) const { @@ -3732,86 +3567,6 @@ SRSASN_CODE rclwi_cfg_r13_c::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -// RRCConnectionReconfiguration-v13c0-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_recfg_v13c0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rr_cfg_ded_v13c0_present, 1)); - HANDLE_CODE(bref.pack(scell_to_add_mod_list_v13c0_present, 1)); - HANDLE_CODE(bref.pack(scell_to_add_mod_list_ext_v13c0_present, 1)); - HANDLE_CODE(bref.pack(scg_cfg_v13c0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rr_cfg_ded_v13c0_present) { - HANDLE_CODE(rr_cfg_ded_v13c0.pack(bref)); - } - if (scell_to_add_mod_list_v13c0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_v13c0, 1, 4)); - } - if (scell_to_add_mod_list_ext_v13c0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_ext_v13c0, 1, 31)); - } - if (scg_cfg_v13c0_present) { - HANDLE_CODE(scg_cfg_v13c0.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_recfg_v13c0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rr_cfg_ded_v13c0_present, 1)); - HANDLE_CODE(bref.unpack(scell_to_add_mod_list_v13c0_present, 1)); - HANDLE_CODE(bref.unpack(scell_to_add_mod_list_ext_v13c0_present, 1)); - HANDLE_CODE(bref.unpack(scg_cfg_v13c0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rr_cfg_ded_v13c0_present) { - HANDLE_CODE(rr_cfg_ded_v13c0.unpack(bref)); - } - if (scell_to_add_mod_list_v13c0_present) { - HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_v13c0, bref, 1, 4)); - } - if (scell_to_add_mod_list_ext_v13c0_present) { - HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_ext_v13c0, bref, 1, 31)); - } - if (scg_cfg_v13c0_present) { - HANDLE_CODE(scg_cfg_v13c0.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_recfg_v13c0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rr_cfg_ded_v13c0_present) { - j.write_fieldname("radioResourceConfigDedicated-v13c0"); - rr_cfg_ded_v13c0.to_json(j); - } - if (scell_to_add_mod_list_v13c0_present) { - j.start_array("sCellToAddModList-v13c0"); - for (const auto& e1 : scell_to_add_mod_list_v13c0) { - e1.to_json(j); - } - j.end_array(); - } - if (scell_to_add_mod_list_ext_v13c0_present) { - j.start_array("sCellToAddModListExt-v13c0"); - for (const auto& e1 : scell_to_add_mod_list_ext_v13c0) { - e1.to_json(j); - } - j.end_array(); - } - if (scg_cfg_v13c0_present) { - j.write_fieldname("scg-Configuration-v13c0"); - scg_cfg_v13c0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - // RRCConnectionReconfiguration-v1430-IEs ::= SEQUENCE SRSASN_CODE rrc_conn_recfg_v1430_ies_s::pack(bit_ref& bref) const { @@ -3915,46 +3670,15 @@ void rrc_conn_release_v15b0_ies_s::to_json(json_writer& j) const j.end_obj(); } -// RadioResourceConfigDedicated-v1370 ::= SEQUENCE -SRSASN_CODE rr_cfg_ded_v1370_s::pack(bit_ref& bref) const +// SCG-ConfigPartSCG-r12 ::= SEQUENCE +SRSASN_CODE scg_cfg_part_scg_r12_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(phys_cfg_ded_v1370_present, 1)); - - if (phys_cfg_ded_v1370_present) { - HANDLE_CODE(phys_cfg_ded_v1370.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rr_cfg_ded_v1370_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(phys_cfg_ded_v1370_present, 1)); - - if (phys_cfg_ded_v1370_present) { - HANDLE_CODE(phys_cfg_ded_v1370.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rr_cfg_ded_v1370_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (phys_cfg_ded_v1370_present) { - j.write_fieldname("physicalConfigDedicated-v1370"); - phys_cfg_ded_v1370.to_json(j); - } - j.end_obj(); -} - -// SCG-ConfigPartSCG-r12 ::= SEQUENCE -SRSASN_CODE scg_cfg_part_scg_r12_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(rr_cfg_ded_scg_r12_present, 1)); - HANDLE_CODE(bref.pack(scell_to_release_list_scg_r12_present, 1)); - HANDLE_CODE(bref.pack(pscell_to_add_mod_r12_present, 1)); - HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_r12_present, 1)); - HANDLE_CODE(bref.pack(mob_ctrl_info_scg_r12_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(rr_cfg_ded_scg_r12_present, 1)); + HANDLE_CODE(bref.pack(scell_to_release_list_scg_r12_present, 1)); + HANDLE_CODE(bref.pack(pscell_to_add_mod_r12_present, 1)); + HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_r12_present, 1)); + HANDLE_CODE(bref.pack(mob_ctrl_info_scg_r12_present, 1)); if (rr_cfg_ded_scg_r12_present) { HANDLE_CODE(rr_cfg_ded_scg_r12.pack(bref)); @@ -4240,52 +3964,6 @@ void scg_cfg_part_scg_r12_s::to_json(json_writer& j) const j.end_obj(); } -// SCG-ConfigPartSCG-v12f0 ::= SEQUENCE -SRSASN_CODE scg_cfg_part_scg_v12f0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(pscell_to_add_mod_v12f0_present, 1)); - HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_v12f0_present, 1)); - - if (pscell_to_add_mod_v12f0_present) { - HANDLE_CODE(pscell_to_add_mod_v12f0.pack(bref)); - } - if (scell_to_add_mod_list_scg_v12f0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_v12f0, 1, 4)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE scg_cfg_part_scg_v12f0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(pscell_to_add_mod_v12f0_present, 1)); - HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_v12f0_present, 1)); - - if (pscell_to_add_mod_v12f0_present) { - HANDLE_CODE(pscell_to_add_mod_v12f0.unpack(bref)); - } - if (scell_to_add_mod_list_scg_v12f0_present) { - HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_v12f0, bref, 1, 4)); - } - - return SRSASN_SUCCESS; -} -void scg_cfg_part_scg_v12f0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (pscell_to_add_mod_v12f0_present) { - j.write_fieldname("pSCellToAddMod-v12f0"); - pscell_to_add_mod_v12f0.to_json(j); - } - if (scell_to_add_mod_list_scg_v12f0_present) { - j.start_array("sCellToAddModListSCG-v12f0"); - for (const auto& e1 : scell_to_add_mod_list_scg_v12f0) { - e1.to_json(j); - } - j.end_array(); - } - j.end_obj(); -} - // SL-DiscTxInfoInterFreqListAdd-r13 ::= SEQUENCE SRSASN_CODE sl_disc_tx_info_inter_freq_list_add_r13_s::pack(bit_ref& bref) const { @@ -4634,64 +4312,6 @@ void rrc_conn_recfg_v1310_ies_s::to_json(json_writer& j) const j.end_obj(); } -// RRCConnectionReconfiguration-v1370-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_recfg_v1370_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rr_cfg_ded_v1370_present, 1)); - HANDLE_CODE(bref.pack(scell_to_add_mod_list_ext_v1370_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rr_cfg_ded_v1370_present) { - HANDLE_CODE(rr_cfg_ded_v1370.pack(bref)); - } - if (scell_to_add_mod_list_ext_v1370_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_ext_v1370, 1, 31)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_recfg_v1370_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rr_cfg_ded_v1370_present, 1)); - HANDLE_CODE(bref.unpack(scell_to_add_mod_list_ext_v1370_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rr_cfg_ded_v1370_present) { - HANDLE_CODE(rr_cfg_ded_v1370.unpack(bref)); - } - if (scell_to_add_mod_list_ext_v1370_present) { - HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_ext_v1370, bref, 1, 31)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_recfg_v1370_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rr_cfg_ded_v1370_present) { - j.write_fieldname("radioResourceConfigDedicated-v1370"); - rr_cfg_ded_v1370.to_json(j); - } - if (scell_to_add_mod_list_ext_v1370_present) { - j.start_array("sCellToAddModListExt-v1370"); - for (const auto& e1 : scell_to_add_mod_list_ext_v1370) { - e1.to_json(j); - } - j.end_array(); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // RRCConnectionRelease-v1540-IEs ::= SEQUENCE SRSASN_CODE rrc_conn_release_v1540_ies_s::pack(bit_ref& bref) const { @@ -4834,70 +4454,6 @@ SRSASN_CODE scg_cfg_r12_c::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -// SCG-Configuration-v12f0 ::= CHOICE -void scg_cfg_v12f0_c::set(types::options e) -{ - type_ = e; -} -void scg_cfg_v12f0_c::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::release: - break; - case types::setup: - j.write_fieldname("setup"); - j.start_obj(); - if (c.scg_cfg_part_scg_v12f0_present) { - j.write_fieldname("scg-ConfigPartSCG-v12f0"); - c.scg_cfg_part_scg_v12f0.to_json(j); - } - j.end_obj(); - break; - default: - log_invalid_choice_id(type_, "scg_cfg_v12f0_c"); - } - j.end_obj(); -} -SRSASN_CODE scg_cfg_v12f0_c::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::release: - break; - case types::setup: - HANDLE_CODE(bref.pack(c.scg_cfg_part_scg_v12f0_present, 1)); - if (c.scg_cfg_part_scg_v12f0_present) { - HANDLE_CODE(c.scg_cfg_part_scg_v12f0.pack(bref)); - } - break; - default: - log_invalid_choice_id(type_, "scg_cfg_v12f0_c"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE scg_cfg_v12f0_c::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::release: - break; - case types::setup: - HANDLE_CODE(bref.unpack(c.scg_cfg_part_scg_v12f0_present, 1)); - if (c.scg_cfg_part_scg_v12f0_present) { - HANDLE_CODE(c.scg_cfg_part_scg_v12f0.unpack(bref)); - } - break; - default: - log_invalid_choice_id(type_, "scg_cfg_v12f0_c"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - // SL-CommConfig-r12 ::= SEQUENCE SRSASN_CODE sl_comm_cfg_r12_s::pack(bit_ref& bref) const { @@ -6563,18 +6119,27 @@ uint8_t rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_c_::setup_s_::t350_r12 options, 7, value, "rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_c_::setup_s_::t350_r12_e_"); } -// RRCConnectionReconfiguration-v12f0-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_recfg_v12f0_ies_s::pack(bit_ref& bref) const +// RRCConnectionRelease-v1530-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_release_v1530_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(scg_cfg_v12f0_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(drb_continue_rohc_r15_present, 1)); + HANDLE_CODE(bref.pack(next_hop_chaining_count_r15_present, 1)); + HANDLE_CODE(bref.pack(meas_idle_cfg_r15_present, 1)); + HANDLE_CODE(bref.pack(rrc_inactive_cfg_r15_present, 1)); + HANDLE_CODE(bref.pack(cn_type_r15_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - if (scg_cfg_v12f0_present) { - HANDLE_CODE(scg_cfg_v12f0.pack(bref)); + if (next_hop_chaining_count_r15_present) { + HANDLE_CODE(pack_integer(bref, next_hop_chaining_count_r15, (uint8_t)0u, (uint8_t)7u)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (meas_idle_cfg_r15_present) { + HANDLE_CODE(meas_idle_cfg_r15.pack(bref)); + } + if (rrc_inactive_cfg_r15_present) { + HANDLE_CODE(rrc_inactive_cfg_r15.pack(bref)); + } + if (cn_type_r15_present) { + HANDLE_CODE(cn_type_r15.pack(bref)); } if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.pack(bref)); @@ -6582,17 +6147,26 @@ SRSASN_CODE rrc_conn_recfg_v12f0_ies_s::pack(bit_ref& bref) const return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_recfg_v12f0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_release_v1530_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(scg_cfg_v12f0_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(drb_continue_rohc_r15_present, 1)); + HANDLE_CODE(bref.unpack(next_hop_chaining_count_r15_present, 1)); + HANDLE_CODE(bref.unpack(meas_idle_cfg_r15_present, 1)); + HANDLE_CODE(bref.unpack(rrc_inactive_cfg_r15_present, 1)); + HANDLE_CODE(bref.unpack(cn_type_r15_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - if (scg_cfg_v12f0_present) { - HANDLE_CODE(scg_cfg_v12f0.unpack(bref)); + if (next_hop_chaining_count_r15_present) { + HANDLE_CODE(unpack_integer(next_hop_chaining_count_r15, bref, (uint8_t)0u, (uint8_t)7u)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); + if (meas_idle_cfg_r15_present) { + HANDLE_CODE(meas_idle_cfg_r15.unpack(bref)); + } + if (rrc_inactive_cfg_r15_present) { + HANDLE_CODE(rrc_inactive_cfg_r15.unpack(bref)); + } + if (cn_type_r15_present) { + HANDLE_CODE(cn_type_r15.unpack(bref)); } if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.unpack(bref)); @@ -6600,79 +6174,7 @@ SRSASN_CODE rrc_conn_recfg_v12f0_ies_s::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -void rrc_conn_recfg_v12f0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (scg_cfg_v12f0_present) { - j.write_fieldname("scg-Configuration-v12f0"); - scg_cfg_v12f0.to_json(j); - } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// RRCConnectionRelease-v1530-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_release_v1530_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(drb_continue_rohc_r15_present, 1)); - HANDLE_CODE(bref.pack(next_hop_chaining_count_r15_present, 1)); - HANDLE_CODE(bref.pack(meas_idle_cfg_r15_present, 1)); - HANDLE_CODE(bref.pack(rrc_inactive_cfg_r15_present, 1)); - HANDLE_CODE(bref.pack(cn_type_r15_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (next_hop_chaining_count_r15_present) { - HANDLE_CODE(pack_integer(bref, next_hop_chaining_count_r15, (uint8_t)0u, (uint8_t)7u)); - } - if (meas_idle_cfg_r15_present) { - HANDLE_CODE(meas_idle_cfg_r15.pack(bref)); - } - if (rrc_inactive_cfg_r15_present) { - HANDLE_CODE(rrc_inactive_cfg_r15.pack(bref)); - } - if (cn_type_r15_present) { - HANDLE_CODE(cn_type_r15.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_release_v1530_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(drb_continue_rohc_r15_present, 1)); - HANDLE_CODE(bref.unpack(next_hop_chaining_count_r15_present, 1)); - HANDLE_CODE(bref.unpack(meas_idle_cfg_r15_present, 1)); - HANDLE_CODE(bref.unpack(rrc_inactive_cfg_r15_present, 1)); - HANDLE_CODE(bref.unpack(cn_type_r15_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (next_hop_chaining_count_r15_present) { - HANDLE_CODE(unpack_integer(next_hop_chaining_count_r15, bref, (uint8_t)0u, (uint8_t)7u)); - } - if (meas_idle_cfg_r15_present) { - HANDLE_CODE(meas_idle_cfg_r15.unpack(bref)); - } - if (rrc_inactive_cfg_r15_present) { - HANDLE_CODE(rrc_inactive_cfg_r15.unpack(bref)); - } - if (cn_type_r15_present) { - HANDLE_CODE(cn_type_r15.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_release_v1530_ies_s::to_json(json_writer& j) const +void rrc_conn_release_v1530_ies_s::to_json(json_writer& j) const { j.start_obj(); if (drb_continue_rohc_r15_present) { @@ -7217,75 +6719,6 @@ std::string pwr_pref_ind_cfg_r11_c::setup_s_::pwr_pref_ind_timer_r11_opts::to_nu return convert_enum_idx(options, 16, value, "pwr_pref_ind_cfg_r11_c::setup_s_::pwr_pref_ind_timer_r11_e_"); } -// RRCConnectionReconfiguration-v10l0-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_recfg_v10l0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(mob_ctrl_info_v10l0_present, 1)); - HANDLE_CODE(bref.pack(scell_to_add_mod_list_v10l0_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (mob_ctrl_info_v10l0_present) { - HANDLE_CODE(mob_ctrl_info_v10l0.pack(bref)); - } - if (scell_to_add_mod_list_v10l0_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_v10l0, 1, 4)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_recfg_v10l0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(mob_ctrl_info_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(scell_to_add_mod_list_v10l0_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (mob_ctrl_info_v10l0_present) { - HANDLE_CODE(mob_ctrl_info_v10l0.unpack(bref)); - } - if (scell_to_add_mod_list_v10l0_present) { - HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_v10l0, bref, 1, 4)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_recfg_v10l0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (mob_ctrl_info_v10l0_present) { - j.write_fieldname("mobilityControlInfo-v10l0"); - mob_ctrl_info_v10l0.to_json(j); - } - if (scell_to_add_mod_list_v10l0_present) { - j.start_array("sCellToAddModList-v10l0"); - for (const auto& e1 : scell_to_add_mod_list_v10l0) { - e1.to_json(j); - } - j.end_array(); - } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // RRCConnectionReconfiguration-v1130-IEs ::= SEQUENCE SRSASN_CODE rrc_conn_recfg_v1130_ies_s::pack(bit_ref& bref) const { @@ -8277,49 +7710,6 @@ void rrc_conn_recfg_v1020_ies_s::to_json(json_writer& j) const j.end_obj(); } -// RRCConnectionReconfiguration-v10i0-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_recfg_v10i0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ant_info_ded_pcell_v10i0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (ant_info_ded_pcell_v10i0_present) { - HANDLE_CODE(ant_info_ded_pcell_v10i0.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_recfg_v10i0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(ant_info_ded_pcell_v10i0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (ant_info_ded_pcell_v10i0_present) { - HANDLE_CODE(ant_info_ded_pcell_v10i0.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_recfg_v10i0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (ant_info_ded_pcell_v10i0_present) { - j.write_fieldname("antennaInfoDedicatedPCell-v10i0"); - ant_info_ded_pcell_v10i0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // RRCConnectionRelease-v1020-IEs ::= SEQUENCE SRSASN_CODE rrc_conn_release_v1020_ies_s::pack(bit_ref& bref) const { @@ -8391,26 +7781,6 @@ void rrc_conn_resume_v1530_ies_s::to_json(json_writer& j) const j.end_obj(); } -// RedirectedCarrierInfo-v9e0 ::= SEQUENCE -SRSASN_CODE redirected_carrier_info_v9e0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pack_integer(bref, eutra_v9e0, (uint32_t)65536u, (uint32_t)262143u)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE redirected_carrier_info_v9e0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(eutra_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u)); - - return SRSASN_SUCCESS; -} -void redirected_carrier_info_v9e0_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("eutra-v9e0", eutra_v9e0); - j.end_obj(); -} - // UEInformationRequest-v1130-IEs ::= SEQUENCE SRSASN_CODE ue_info_request_v1130_ies_s::pack(bit_ref& bref) const { @@ -8715,48 +8085,6 @@ void mob_from_eutra_cmd_v960_ies_s::to_json(json_writer& j) const j.end_obj(); } -// RRCConnectionReconfiguration-v8m0-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_recfg_v8m0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_recfg_v8m0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_recfg_v8m0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // RRCConnectionReconfiguration-v920-IEs ::= SEQUENCE SRSASN_CODE rrc_conn_recfg_v920_ies_s::pack(bit_ref& bref) const { @@ -9027,62 +8355,12 @@ SRSASN_CODE rrc_conn_release_v920_ies_s::cell_info_list_r9_c_::unpack(cbit_ref& return SRSASN_SUCCESS; } -// RRCConnectionRelease-v9e0-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_release_v9e0_ies_s::pack(bit_ref& bref) const +// RRCConnectionResume-v1510-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_resume_v1510_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(redirected_carrier_info_v9e0_present, 1)); - HANDLE_CODE(bref.pack(idle_mode_mob_ctrl_info_v9e0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (redirected_carrier_info_v9e0_present) { - HANDLE_CODE(redirected_carrier_info_v9e0.pack(bref)); - } - if (idle_mode_mob_ctrl_info_v9e0_present) { - HANDLE_CODE(idle_mode_mob_ctrl_info_v9e0.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_release_v9e0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(redirected_carrier_info_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(idle_mode_mob_ctrl_info_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (redirected_carrier_info_v9e0_present) { - HANDLE_CODE(redirected_carrier_info_v9e0.unpack(bref)); - } - if (idle_mode_mob_ctrl_info_v9e0_present) { - HANDLE_CODE(idle_mode_mob_ctrl_info_v9e0.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_release_v9e0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (redirected_carrier_info_v9e0_present) { - j.write_fieldname("redirectedCarrierInfo-v9e0"); - redirected_carrier_info_v9e0.to_json(j); - } - if (idle_mode_mob_ctrl_info_v9e0_present) { - j.write_fieldname("idleModeMobilityControlInfo-v9e0"); - idle_mode_mob_ctrl_info_v9e0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - -// RRCConnectionResume-v1510-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_resume_v1510_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(sk_counter_r15_present, 1)); - HANDLE_CODE(bref.pack(nr_radio_bearer_cfg1_r15_present, 1)); - HANDLE_CODE(bref.pack(nr_radio_bearer_cfg2_r15_present, 1)); + HANDLE_CODE(bref.pack(sk_counter_r15_present, 1)); + HANDLE_CODE(bref.pack(nr_radio_bearer_cfg1_r15_present, 1)); + HANDLE_CODE(bref.pack(nr_radio_bearer_cfg2_r15_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); if (sk_counter_r15_present) { @@ -10667,49 +9945,10 @@ SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r return SRSASN_SUCCESS; } -void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::destroy_() {} void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::set(types::options e) { - destroy_(); type_ = e; } -rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::demod_rs_r10_c_( - const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::interleaving_r10: - break; - case types::no_interleaving_r10: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_"); - } -} -rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_& rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::operator=( - const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::interleaving_r10: - break; - case types::no_interleaving_r10: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_"); - } - - return *this; -} void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::to_json(json_writer& j) const { j.start_obj(); @@ -10717,7 +9956,7 @@ void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::to_json(json_writer& j case types::interleaving_r10: break; case types::no_interleaving_r10: - j.write_str("noInterleaving-r10", c.get().to_string()); + j.write_str("noInterleaving-r10", c.to_string()); break; default: log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_"); @@ -10731,7 +9970,7 @@ SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::pack(bit_ref& b case types::interleaving_r10: break; case types::no_interleaving_r10: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; default: log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_"); @@ -10748,7 +9987,7 @@ SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::unpack(cbit_ref case types::interleaving_r10: break; case types::no_interleaving_r10: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; default: log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_"); @@ -12772,67 +12011,9 @@ void csfb_params_resp_cdma2000_s::to_json(json_writer& j) const j.end_obj(); } -void csfb_params_resp_cdma2000_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::csfb_params_resp_cdma2000_r8: - c.destroy(); - break; - default: - break; - } -} void csfb_params_resp_cdma2000_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::csfb_params_resp_cdma2000_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "csfb_params_resp_cdma2000_s::crit_exts_c_"); - } -} -csfb_params_resp_cdma2000_s::crit_exts_c_::crit_exts_c_(const csfb_params_resp_cdma2000_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::csfb_params_resp_cdma2000_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "csfb_params_resp_cdma2000_s::crit_exts_c_"); - } -} -csfb_params_resp_cdma2000_s::crit_exts_c_& -csfb_params_resp_cdma2000_s::crit_exts_c_::operator=(const csfb_params_resp_cdma2000_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::csfb_params_resp_cdma2000_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "csfb_params_resp_cdma2000_s::crit_exts_c_"); - } - - return *this; } void csfb_params_resp_cdma2000_s::crit_exts_c_::to_json(json_writer& j) const { @@ -12840,7 +12021,7 @@ void csfb_params_resp_cdma2000_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::csfb_params_resp_cdma2000_r8: j.write_fieldname("csfbParametersResponseCDMA2000-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -12854,7 +12035,7 @@ SRSASN_CODE csfb_params_resp_cdma2000_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::csfb_params_resp_cdma2000_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -12871,7 +12052,7 @@ SRSASN_CODE csfb_params_resp_cdma2000_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::csfb_params_resp_cdma2000_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -12906,66 +12087,9 @@ void counter_check_s::to_json(json_writer& j) const j.end_obj(); } -void counter_check_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void counter_check_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_"); - } -} -counter_check_s::crit_exts_c_::crit_exts_c_(const counter_check_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_"); - } -} -counter_check_s::crit_exts_c_& counter_check_s::crit_exts_c_::operator=(const counter_check_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_"); - } - - return *this; } void counter_check_s::crit_exts_c_::to_json(json_writer& j) const { @@ -12973,7 +12097,7 @@ void counter_check_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -12987,7 +12111,7 @@ SRSASN_CODE counter_check_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -13004,7 +12128,7 @@ SRSASN_CODE counter_check_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -13103,67 +12227,9 @@ void dl_info_transfer_s::to_json(json_writer& j) const j.end_obj(); } -void dl_info_transfer_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void dl_info_transfer_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_"); - } -} -dl_info_transfer_s::crit_exts_c_::crit_exts_c_(const dl_info_transfer_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_"); - } -} -dl_info_transfer_s::crit_exts_c_& -dl_info_transfer_s::crit_exts_c_::operator=(const dl_info_transfer_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_"); - } - - return *this; } void dl_info_transfer_s::crit_exts_c_::to_json(json_writer& j) const { @@ -13171,7 +12237,7 @@ void dl_info_transfer_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -13185,7 +12251,7 @@ SRSASN_CODE dl_info_transfer_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -13202,7 +12268,7 @@ SRSASN_CODE dl_info_transfer_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -13381,75 +12447,17 @@ void ho_from_eutra_prep_request_s::to_json(json_writer& j) const j.end_obj(); } -void ho_from_eutra_prep_request_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ho_from_eutra_prep_request_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; +} +void ho_from_eutra_prep_request_s::crit_exts_c_::to_json(json_writer& j) const +{ + j.start_obj(); switch (type_) { case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_from_eutra_prep_request_s::crit_exts_c_"); - } -} -ho_from_eutra_prep_request_s::crit_exts_c_::crit_exts_c_(const ho_from_eutra_prep_request_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_from_eutra_prep_request_s::crit_exts_c_"); - } -} -ho_from_eutra_prep_request_s::crit_exts_c_& -ho_from_eutra_prep_request_s::crit_exts_c_::operator=(const ho_from_eutra_prep_request_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_from_eutra_prep_request_s::crit_exts_c_"); - } - - return *this; -} -void ho_from_eutra_prep_request_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); + j.write_fieldname("c1"); + c.to_json(j); break; case types::crit_exts_future: break; @@ -13463,7 +12471,7 @@ SRSASN_CODE ho_from_eutra_prep_request_s::crit_exts_c_::pack(bit_ref& bref) cons type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -13480,7 +12488,7 @@ SRSASN_CODE ho_from_eutra_prep_request_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -13576,67 +12584,9 @@ void logged_meas_cfg_r10_s::to_json(json_writer& j) const j.end_obj(); } -void logged_meas_cfg_r10_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void logged_meas_cfg_r10_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_"); - } -} -logged_meas_cfg_r10_s::crit_exts_c_::crit_exts_c_(const logged_meas_cfg_r10_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_"); - } -} -logged_meas_cfg_r10_s::crit_exts_c_& -logged_meas_cfg_r10_s::crit_exts_c_::operator=(const logged_meas_cfg_r10_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_"); - } - - return *this; } void logged_meas_cfg_r10_s::crit_exts_c_::to_json(json_writer& j) const { @@ -13644,7 +12594,7 @@ void logged_meas_cfg_r10_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -13658,7 +12608,7 @@ SRSASN_CODE logged_meas_cfg_r10_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -13675,7 +12625,7 @@ SRSASN_CODE logged_meas_cfg_r10_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -13774,67 +12724,9 @@ void mob_from_eutra_cmd_s::to_json(json_writer& j) const j.end_obj(); } -void mob_from_eutra_cmd_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void mob_from_eutra_cmd_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_"); - } -} -mob_from_eutra_cmd_s::crit_exts_c_::crit_exts_c_(const mob_from_eutra_cmd_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_"); - } -} -mob_from_eutra_cmd_s::crit_exts_c_& -mob_from_eutra_cmd_s::crit_exts_c_::operator=(const mob_from_eutra_cmd_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_"); - } - - return *this; } void mob_from_eutra_cmd_s::crit_exts_c_::to_json(json_writer& j) const { @@ -13842,7 +12734,7 @@ void mob_from_eutra_cmd_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -13856,7 +12748,7 @@ SRSASN_CODE mob_from_eutra_cmd_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -13873,7 +12765,7 @@ SRSASN_CODE mob_from_eutra_cmd_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14052,66 +12944,9 @@ void rn_recfg_r10_s::to_json(json_writer& j) const j.end_obj(); } -void rn_recfg_r10_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rn_recfg_r10_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_"); - } -} -rn_recfg_r10_s::crit_exts_c_::crit_exts_c_(const rn_recfg_r10_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_"); - } -} -rn_recfg_r10_s::crit_exts_c_& rn_recfg_r10_s::crit_exts_c_::operator=(const rn_recfg_r10_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_"); - } - - return *this; } void rn_recfg_r10_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14119,7 +12954,7 @@ void rn_recfg_r10_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14133,7 +12968,7 @@ SRSASN_CODE rn_recfg_r10_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14150,7 +12985,7 @@ SRSASN_CODE rn_recfg_r10_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14249,120 +13084,63 @@ void rrc_conn_recfg_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_recfg_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_recfg_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; +} +void rrc_conn_recfg_s::crit_exts_c_::to_json(json_writer& j) const +{ + j.start_obj(); switch (type_) { case types::c1: - c.init(); + j.write_fieldname("c1"); + c.to_json(j); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_"); } + j.end_obj(); } -rrc_conn_recfg_s::crit_exts_c_::crit_exts_c_(const rrc_conn_recfg_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_recfg_s::crit_exts_c_::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { case types::c1: - c.init(other.c.get()); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } + return SRSASN_SUCCESS; } -rrc_conn_recfg_s::crit_exts_c_& rrc_conn_recfg_s::crit_exts_c_::operator=(const rrc_conn_recfg_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_recfg_s::crit_exts_c_::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; - } - set(other.type()); + types e; + e.unpack(bref); + set(e); switch (type_) { case types::c1: - c.set(other.c.get()); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_"); + return SRSASN_ERROR_DECODE_FAIL; } + return SRSASN_SUCCESS; +} - return *this; +void rrc_conn_recfg_s::crit_exts_c_::c1_c_::set(types::options e) +{ + type_ = e; } -void rrc_conn_recfg_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_"); - } - j.end_obj(); -} -SRSASN_CODE rrc_conn_recfg_s::crit_exts_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_recfg_s::crit_exts_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -void rrc_conn_recfg_s::crit_exts_c_::c1_c_::set(types::options e) -{ - type_ = e; -} -void rrc_conn_recfg_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const +void rrc_conn_recfg_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { @@ -14470,67 +13248,9 @@ void rrc_conn_release_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_release_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_release_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_"); - } -} -rrc_conn_release_s::crit_exts_c_::crit_exts_c_(const rrc_conn_release_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_"); - } -} -rrc_conn_release_s::crit_exts_c_& -rrc_conn_release_s::crit_exts_c_::operator=(const rrc_conn_release_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_release_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14538,7 +13258,7 @@ void rrc_conn_release_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14552,7 +13272,7 @@ SRSASN_CODE rrc_conn_release_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14569,7 +13289,7 @@ SRSASN_CODE rrc_conn_release_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14668,67 +13388,9 @@ void rrc_conn_resume_r13_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_resume_r13_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_resume_r13_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_r13_s::crit_exts_c_"); - } -} -rrc_conn_resume_r13_s::crit_exts_c_::crit_exts_c_(const rrc_conn_resume_r13_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_r13_s::crit_exts_c_"); - } -} -rrc_conn_resume_r13_s::crit_exts_c_& -rrc_conn_resume_r13_s::crit_exts_c_::operator=(const rrc_conn_resume_r13_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_r13_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_resume_r13_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14736,7 +13398,7 @@ void rrc_conn_resume_r13_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14750,7 +13412,7 @@ SRSASN_CODE rrc_conn_resume_r13_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14767,7 +13429,7 @@ SRSASN_CODE rrc_conn_resume_r13_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14866,67 +13528,9 @@ void ue_info_request_r9_s::to_json(json_writer& j) const j.end_obj(); } -void ue_info_request_r9_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_info_request_r9_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_"); - } -} -ue_info_request_r9_s::crit_exts_c_::crit_exts_c_(const ue_info_request_r9_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_"); - } -} -ue_info_request_r9_s::crit_exts_c_& -ue_info_request_r9_s::crit_exts_c_::operator=(const ue_info_request_r9_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_"); - } - - return *this; } void ue_info_request_r9_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14934,7 +13538,7 @@ void ue_info_request_r9_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14948,7 +13552,7 @@ SRSASN_CODE ue_info_request_r9_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14965,7 +13569,7 @@ SRSASN_CODE ue_info_request_r9_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -15041,120 +13645,63 @@ SRSASN_CODE ue_info_request_r9_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref) } // DL-DCCH-MessageType ::= CHOICE -void dl_dcch_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void dl_dcch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; +} +void dl_dcch_msg_type_c::to_json(json_writer& j) const +{ + j.start_obj(); switch (type_) { case types::c1: - c.init(); + j.write_fieldname("c1"); + c.to_json(j); break; case types::msg_class_ext: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); } + j.end_obj(); } -dl_dcch_msg_type_c::dl_dcch_msg_type_c(const dl_dcch_msg_type_c& other) +SRSASN_CODE dl_dcch_msg_type_c::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { case types::c1: - c.init(other.c.get()); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); + return SRSASN_ERROR_ENCODE_FAIL; } + return SRSASN_SUCCESS; } -dl_dcch_msg_type_c& dl_dcch_msg_type_c::operator=(const dl_dcch_msg_type_c& other) +SRSASN_CODE dl_dcch_msg_type_c::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; - } - set(other.type()); + types e; + e.unpack(bref); + set(e); switch (type_) { case types::c1: - c.set(other.c.get()); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); + return SRSASN_ERROR_DECODE_FAIL; } - - return *this; + return SRSASN_SUCCESS; } -void dl_dcch_msg_type_c::to_json(json_writer& j) const + +void dl_dcch_msg_type_c::c1_c_::destroy_() { - j.start_obj(); switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); - } - j.end_obj(); -} -SRSASN_CODE dl_dcch_msg_type_c::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE dl_dcch_msg_type_c::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -void dl_dcch_msg_type_c::c1_c_::destroy_() -{ - switch (type_) { - case types::csfb_params_resp_cdma2000: - c.destroy(); + case types::csfb_params_resp_cdma2000: + c.destroy(); break; case types::dl_info_transfer: c.destroy(); @@ -15575,3 +14122,725 @@ void dl_dcch_msg_s::to_json(json_writer& j) const j.end_obj(); j.end_array(); } + +// RadioResourceConfigCommonPSCell-v12f0 ::= SEQUENCE +SRSASN_CODE rr_cfg_common_ps_cell_v12f0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(basic_fields_v12f0.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rr_cfg_common_ps_cell_v12f0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(basic_fields_v12f0.unpack(bref)); + + return SRSASN_SUCCESS; +} +void rr_cfg_common_ps_cell_v12f0_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("basicFields-v12f0"); + basic_fields_v12f0.to_json(j); + j.end_obj(); +} + +// PSCellToAddMod-v12f0 ::= SEQUENCE +SRSASN_CODE ps_cell_to_add_mod_v12f0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rr_cfg_common_ps_cell_r12_present, 1)); + + if (rr_cfg_common_ps_cell_r12_present) { + HANDLE_CODE(rr_cfg_common_ps_cell_r12.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ps_cell_to_add_mod_v12f0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rr_cfg_common_ps_cell_r12_present, 1)); + + if (rr_cfg_common_ps_cell_r12_present) { + HANDLE_CODE(rr_cfg_common_ps_cell_r12.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ps_cell_to_add_mod_v12f0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rr_cfg_common_ps_cell_r12_present) { + j.write_fieldname("radioResourceConfigCommonPSCell-r12"); + rr_cfg_common_ps_cell_r12.to_json(j); + } + j.end_obj(); +} + +// SCG-ConfigPartSCG-v13c0 ::= SEQUENCE +SRSASN_CODE scg_cfg_part_scg_v13c0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_v13c0_present, 1)); + HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_ext_v13c0_present, 1)); + + if (scell_to_add_mod_list_scg_v13c0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_v13c0, 1, 4)); + } + if (scell_to_add_mod_list_scg_ext_v13c0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_ext_v13c0, 1, 31)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE scg_cfg_part_scg_v13c0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_v13c0_present, 1)); + HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_ext_v13c0_present, 1)); + + if (scell_to_add_mod_list_scg_v13c0_present) { + HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_v13c0, bref, 1, 4)); + } + if (scell_to_add_mod_list_scg_ext_v13c0_present) { + HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_ext_v13c0, bref, 1, 31)); + } + + return SRSASN_SUCCESS; +} +void scg_cfg_part_scg_v13c0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (scell_to_add_mod_list_scg_v13c0_present) { + j.start_array("sCellToAddModListSCG-v13c0"); + for (const auto& e1 : scell_to_add_mod_list_scg_v13c0) { + e1.to_json(j); + } + j.end_array(); + } + if (scell_to_add_mod_list_scg_ext_v13c0_present) { + j.start_array("sCellToAddModListSCG-Ext-v13c0"); + for (const auto& e1 : scell_to_add_mod_list_scg_ext_v13c0) { + e1.to_json(j); + } + j.end_array(); + } + j.end_obj(); +} + +// SCG-Configuration-v13c0 ::= CHOICE +void scg_cfg_v13c0_c::set(types::options e) +{ + type_ = e; +} +void scg_cfg_v13c0_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::release: + break; + case types::setup: + j.write_fieldname("setup"); + j.start_obj(); + if (c.scg_cfg_part_scg_v13c0_present) { + j.write_fieldname("scg-ConfigPartSCG-v13c0"); + c.scg_cfg_part_scg_v13c0.to_json(j); + } + j.end_obj(); + break; + default: + log_invalid_choice_id(type_, "scg_cfg_v13c0_c"); + } + j.end_obj(); +} +SRSASN_CODE scg_cfg_v13c0_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::release: + break; + case types::setup: + HANDLE_CODE(bref.pack(c.scg_cfg_part_scg_v13c0_present, 1)); + if (c.scg_cfg_part_scg_v13c0_present) { + HANDLE_CODE(c.scg_cfg_part_scg_v13c0.pack(bref)); + } + break; + default: + log_invalid_choice_id(type_, "scg_cfg_v13c0_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE scg_cfg_v13c0_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::release: + break; + case types::setup: + HANDLE_CODE(bref.unpack(c.scg_cfg_part_scg_v13c0_present, 1)); + if (c.scg_cfg_part_scg_v13c0_present) { + HANDLE_CODE(c.scg_cfg_part_scg_v13c0.unpack(bref)); + } + break; + default: + log_invalid_choice_id(type_, "scg_cfg_v13c0_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +// RRCConnectionReconfiguration-v13c0-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_recfg_v13c0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rr_cfg_ded_v13c0_present, 1)); + HANDLE_CODE(bref.pack(scell_to_add_mod_list_v13c0_present, 1)); + HANDLE_CODE(bref.pack(scell_to_add_mod_list_ext_v13c0_present, 1)); + HANDLE_CODE(bref.pack(scg_cfg_v13c0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rr_cfg_ded_v13c0_present) { + HANDLE_CODE(rr_cfg_ded_v13c0.pack(bref)); + } + if (scell_to_add_mod_list_v13c0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_v13c0, 1, 4)); + } + if (scell_to_add_mod_list_ext_v13c0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_ext_v13c0, 1, 31)); + } + if (scg_cfg_v13c0_present) { + HANDLE_CODE(scg_cfg_v13c0.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_recfg_v13c0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rr_cfg_ded_v13c0_present, 1)); + HANDLE_CODE(bref.unpack(scell_to_add_mod_list_v13c0_present, 1)); + HANDLE_CODE(bref.unpack(scell_to_add_mod_list_ext_v13c0_present, 1)); + HANDLE_CODE(bref.unpack(scg_cfg_v13c0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rr_cfg_ded_v13c0_present) { + HANDLE_CODE(rr_cfg_ded_v13c0.unpack(bref)); + } + if (scell_to_add_mod_list_v13c0_present) { + HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_v13c0, bref, 1, 4)); + } + if (scell_to_add_mod_list_ext_v13c0_present) { + HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_ext_v13c0, bref, 1, 31)); + } + if (scg_cfg_v13c0_present) { + HANDLE_CODE(scg_cfg_v13c0.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rrc_conn_recfg_v13c0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rr_cfg_ded_v13c0_present) { + j.write_fieldname("radioResourceConfigDedicated-v13c0"); + rr_cfg_ded_v13c0.to_json(j); + } + if (scell_to_add_mod_list_v13c0_present) { + j.start_array("sCellToAddModList-v13c0"); + for (const auto& e1 : scell_to_add_mod_list_v13c0) { + e1.to_json(j); + } + j.end_array(); + } + if (scell_to_add_mod_list_ext_v13c0_present) { + j.start_array("sCellToAddModListExt-v13c0"); + for (const auto& e1 : scell_to_add_mod_list_ext_v13c0) { + e1.to_json(j); + } + j.end_array(); + } + if (scg_cfg_v13c0_present) { + j.write_fieldname("scg-Configuration-v13c0"); + scg_cfg_v13c0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} + +// RadioResourceConfigDedicated-v1370 ::= SEQUENCE +SRSASN_CODE rr_cfg_ded_v1370_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(phys_cfg_ded_v1370_present, 1)); + + if (phys_cfg_ded_v1370_present) { + HANDLE_CODE(phys_cfg_ded_v1370.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rr_cfg_ded_v1370_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(phys_cfg_ded_v1370_present, 1)); + + if (phys_cfg_ded_v1370_present) { + HANDLE_CODE(phys_cfg_ded_v1370.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rr_cfg_ded_v1370_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (phys_cfg_ded_v1370_present) { + j.write_fieldname("physicalConfigDedicated-v1370"); + phys_cfg_ded_v1370.to_json(j); + } + j.end_obj(); +} + +// SCG-ConfigPartSCG-v12f0 ::= SEQUENCE +SRSASN_CODE scg_cfg_part_scg_v12f0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(pscell_to_add_mod_v12f0_present, 1)); + HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_v12f0_present, 1)); + + if (pscell_to_add_mod_v12f0_present) { + HANDLE_CODE(pscell_to_add_mod_v12f0.pack(bref)); + } + if (scell_to_add_mod_list_scg_v12f0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_v12f0, 1, 4)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE scg_cfg_part_scg_v12f0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(pscell_to_add_mod_v12f0_present, 1)); + HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_v12f0_present, 1)); + + if (pscell_to_add_mod_v12f0_present) { + HANDLE_CODE(pscell_to_add_mod_v12f0.unpack(bref)); + } + if (scell_to_add_mod_list_scg_v12f0_present) { + HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_v12f0, bref, 1, 4)); + } + + return SRSASN_SUCCESS; +} +void scg_cfg_part_scg_v12f0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (pscell_to_add_mod_v12f0_present) { + j.write_fieldname("pSCellToAddMod-v12f0"); + pscell_to_add_mod_v12f0.to_json(j); + } + if (scell_to_add_mod_list_scg_v12f0_present) { + j.start_array("sCellToAddModListSCG-v12f0"); + for (const auto& e1 : scell_to_add_mod_list_scg_v12f0) { + e1.to_json(j); + } + j.end_array(); + } + j.end_obj(); +} + +// RRCConnectionReconfiguration-v1370-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_recfg_v1370_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rr_cfg_ded_v1370_present, 1)); + HANDLE_CODE(bref.pack(scell_to_add_mod_list_ext_v1370_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rr_cfg_ded_v1370_present) { + HANDLE_CODE(rr_cfg_ded_v1370.pack(bref)); + } + if (scell_to_add_mod_list_ext_v1370_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_ext_v1370, 1, 31)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_recfg_v1370_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rr_cfg_ded_v1370_present, 1)); + HANDLE_CODE(bref.unpack(scell_to_add_mod_list_ext_v1370_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rr_cfg_ded_v1370_present) { + HANDLE_CODE(rr_cfg_ded_v1370.unpack(bref)); + } + if (scell_to_add_mod_list_ext_v1370_present) { + HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_ext_v1370, bref, 1, 31)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rrc_conn_recfg_v1370_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rr_cfg_ded_v1370_present) { + j.write_fieldname("radioResourceConfigDedicated-v1370"); + rr_cfg_ded_v1370.to_json(j); + } + if (scell_to_add_mod_list_ext_v1370_present) { + j.start_array("sCellToAddModListExt-v1370"); + for (const auto& e1 : scell_to_add_mod_list_ext_v1370) { + e1.to_json(j); + } + j.end_array(); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// SCG-Configuration-v12f0 ::= CHOICE +void scg_cfg_v12f0_c::set(types::options e) +{ + type_ = e; +} +void scg_cfg_v12f0_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::release: + break; + case types::setup: + j.write_fieldname("setup"); + j.start_obj(); + if (c.scg_cfg_part_scg_v12f0_present) { + j.write_fieldname("scg-ConfigPartSCG-v12f0"); + c.scg_cfg_part_scg_v12f0.to_json(j); + } + j.end_obj(); + break; + default: + log_invalid_choice_id(type_, "scg_cfg_v12f0_c"); + } + j.end_obj(); +} +SRSASN_CODE scg_cfg_v12f0_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::release: + break; + case types::setup: + HANDLE_CODE(bref.pack(c.scg_cfg_part_scg_v12f0_present, 1)); + if (c.scg_cfg_part_scg_v12f0_present) { + HANDLE_CODE(c.scg_cfg_part_scg_v12f0.pack(bref)); + } + break; + default: + log_invalid_choice_id(type_, "scg_cfg_v12f0_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE scg_cfg_v12f0_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::release: + break; + case types::setup: + HANDLE_CODE(bref.unpack(c.scg_cfg_part_scg_v12f0_present, 1)); + if (c.scg_cfg_part_scg_v12f0_present) { + HANDLE_CODE(c.scg_cfg_part_scg_v12f0.unpack(bref)); + } + break; + default: + log_invalid_choice_id(type_, "scg_cfg_v12f0_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +// RRCConnectionReconfiguration-v12f0-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_recfg_v12f0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(scg_cfg_v12f0_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (scg_cfg_v12f0_present) { + HANDLE_CODE(scg_cfg_v12f0.pack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_recfg_v12f0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(scg_cfg_v12f0_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (scg_cfg_v12f0_present) { + HANDLE_CODE(scg_cfg_v12f0.unpack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rrc_conn_recfg_v12f0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (scg_cfg_v12f0_present) { + j.write_fieldname("scg-Configuration-v12f0"); + scg_cfg_v12f0.to_json(j); + } + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// RRCConnectionReconfiguration-v10l0-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_recfg_v10l0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(mob_ctrl_info_v10l0_present, 1)); + HANDLE_CODE(bref.pack(scell_to_add_mod_list_v10l0_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (mob_ctrl_info_v10l0_present) { + HANDLE_CODE(mob_ctrl_info_v10l0.pack(bref)); + } + if (scell_to_add_mod_list_v10l0_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_v10l0, 1, 4)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_recfg_v10l0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(mob_ctrl_info_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(scell_to_add_mod_list_v10l0_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (mob_ctrl_info_v10l0_present) { + HANDLE_CODE(mob_ctrl_info_v10l0.unpack(bref)); + } + if (scell_to_add_mod_list_v10l0_present) { + HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_v10l0, bref, 1, 4)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rrc_conn_recfg_v10l0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (mob_ctrl_info_v10l0_present) { + j.write_fieldname("mobilityControlInfo-v10l0"); + mob_ctrl_info_v10l0.to_json(j); + } + if (scell_to_add_mod_list_v10l0_present) { + j.start_array("sCellToAddModList-v10l0"); + for (const auto& e1 : scell_to_add_mod_list_v10l0) { + e1.to_json(j); + } + j.end_array(); + } + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// RRCConnectionReconfiguration-v10i0-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_recfg_v10i0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(ant_info_ded_pcell_v10i0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (ant_info_ded_pcell_v10i0_present) { + HANDLE_CODE(ant_info_ded_pcell_v10i0.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_recfg_v10i0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(ant_info_ded_pcell_v10i0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (ant_info_ded_pcell_v10i0_present) { + HANDLE_CODE(ant_info_ded_pcell_v10i0.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rrc_conn_recfg_v10i0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (ant_info_ded_pcell_v10i0_present) { + j.write_fieldname("antennaInfoDedicatedPCell-v10i0"); + ant_info_ded_pcell_v10i0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// RRCConnectionReconfiguration-v8m0-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_recfg_v8m0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_recfg_v8m0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rrc_conn_recfg_v8m0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// RedirectedCarrierInfo-v9e0 ::= SEQUENCE +SRSASN_CODE redirected_carrier_info_v9e0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, eutra_v9e0, (uint32_t)65536u, (uint32_t)262143u)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE redirected_carrier_info_v9e0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(unpack_integer(eutra_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u)); + + return SRSASN_SUCCESS; +} +void redirected_carrier_info_v9e0_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("eutra-v9e0", eutra_v9e0); + j.end_obj(); +} + +// RRCConnectionRelease-v9e0-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_release_v9e0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(redirected_carrier_info_v9e0_present, 1)); + HANDLE_CODE(bref.pack(idle_mode_mob_ctrl_info_v9e0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (redirected_carrier_info_v9e0_present) { + HANDLE_CODE(redirected_carrier_info_v9e0.pack(bref)); + } + if (idle_mode_mob_ctrl_info_v9e0_present) { + HANDLE_CODE(idle_mode_mob_ctrl_info_v9e0.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_release_v9e0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(redirected_carrier_info_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(idle_mode_mob_ctrl_info_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (redirected_carrier_info_v9e0_present) { + HANDLE_CODE(redirected_carrier_info_v9e0.unpack(bref)); + } + if (idle_mode_mob_ctrl_info_v9e0_present) { + HANDLE_CODE(idle_mode_mob_ctrl_info_v9e0.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rrc_conn_release_v9e0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (redirected_carrier_info_v9e0_present) { + j.write_fieldname("redirectedCarrierInfo-v9e0"); + redirected_carrier_info_v9e0.to_json(j); + } + if (idle_mode_mob_ctrl_info_v9e0_present) { + j.write_fieldname("idleModeMobilityControlInfo-v9e0"); + idle_mode_mob_ctrl_info_v9e0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} diff --git a/lib/src/asn1/rrc/ho_cmd.cc b/lib/src/asn1/rrc/ho_cmd.cc index f4ceae81c..67ece2006 100644 --- a/lib/src/asn1/rrc/ho_cmd.cc +++ b/lib/src/asn1/rrc/ho_cmd.cc @@ -279,66 +279,9 @@ void scg_cfg_r12_s::to_json(json_writer& j) const j.end_obj(); } -void scg_cfg_r12_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void scg_cfg_r12_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_"); - } -} -scg_cfg_r12_s::crit_exts_c_::crit_exts_c_(const scg_cfg_r12_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_"); - } -} -scg_cfg_r12_s::crit_exts_c_& scg_cfg_r12_s::crit_exts_c_::operator=(const scg_cfg_r12_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_"); - } - - return *this; } void scg_cfg_r12_s::crit_exts_c_::to_json(json_writer& j) const { @@ -346,7 +289,7 @@ void scg_cfg_r12_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -360,7 +303,7 @@ SRSASN_CODE scg_cfg_r12_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -377,7 +320,7 @@ SRSASN_CODE scg_cfg_r12_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -1393,66 +1336,9 @@ void ho_cmd_s::to_json(json_writer& j) const j.end_obj(); } -void ho_cmd_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ho_cmd_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_"); - } -} -ho_cmd_s::crit_exts_c_::crit_exts_c_(const ho_cmd_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_"); - } -} -ho_cmd_s::crit_exts_c_& ho_cmd_s::crit_exts_c_::operator=(const ho_cmd_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_"); - } - - return *this; } void ho_cmd_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1460,7 +1346,7 @@ void ho_cmd_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1474,7 +1360,7 @@ SRSASN_CODE ho_cmd_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1491,7 +1377,7 @@ SRSASN_CODE ho_cmd_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -1773,86 +1659,6 @@ void ho_prep_info_v1320_ies_s::to_json(json_writer& j) const j.end_obj(); } -// HandoverPreparationInformation-v13c0-IEs ::= SEQUENCE -SRSASN_CODE ho_prep_info_v13c0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(as_cfg_v13c0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (as_cfg_v13c0_present) { - HANDLE_CODE(as_cfg_v13c0.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ho_prep_info_v13c0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(as_cfg_v13c0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (as_cfg_v13c0_present) { - HANDLE_CODE(as_cfg_v13c0.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ho_prep_info_v13c0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (as_cfg_v13c0_present) { - j.write_fieldname("as-Config-v13c0"); - as_cfg_v13c0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - -// HandoverPreparationInformation-v10x0-IEs ::= SEQUENCE -SRSASN_CODE ho_prep_info_v10x0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ho_prep_info_v10x0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ho_prep_info_v10x0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // HandoverPreparationInformation-v1250-IEs ::= SEQUENCE SRSASN_CODE ho_prep_info_v1250_ies_s::pack(bit_ref& bref) const { @@ -1907,49 +1713,6 @@ void ho_prep_info_v1250_ies_s::to_json(json_writer& j) const j.end_obj(); } -// HandoverPreparationInformation-v10j0-IEs ::= SEQUENCE -SRSASN_CODE ho_prep_info_v10j0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(as_cfg_v10j0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (as_cfg_v10j0_present) { - HANDLE_CODE(as_cfg_v10j0.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ho_prep_info_v10j0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(as_cfg_v10j0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (as_cfg_v10j0_present) { - HANDLE_CODE(as_cfg_v10j0.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ho_prep_info_v10j0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (as_cfg_v10j0_present) { - j.write_fieldname("as-Config-v10j0"); - as_cfg_v10j0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // HandoverPreparationInformation-v1130-IEs ::= SEQUENCE SRSASN_CODE ho_prep_info_v1130_ies_s::pack(bit_ref& bref) const { @@ -2036,48 +1799,6 @@ void ho_prep_info_v9e0_ies_s::to_json(json_writer& j) const j.end_obj(); } -// HandoverPreparationInformation-v9j0-IEs ::= SEQUENCE -SRSASN_CODE ho_prep_info_v9j0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ho_prep_info_v9j0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ho_prep_info_v9j0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // HandoverPreparationInformation-v9d0-IEs ::= SEQUENCE SRSASN_CODE ho_prep_info_v9d0_ies_s::pack(bit_ref& bref) const { @@ -2373,66 +2094,9 @@ void ho_prep_info_s::to_json(json_writer& j) const j.end_obj(); } -void ho_prep_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ho_prep_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_"); - } -} -ho_prep_info_s::crit_exts_c_::crit_exts_c_(const ho_prep_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_"); - } -} -ho_prep_info_s::crit_exts_c_& ho_prep_info_s::crit_exts_c_::operator=(const ho_prep_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_"); - } - - return *this; } void ho_prep_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -2440,7 +2104,7 @@ void ho_prep_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -2454,7 +2118,7 @@ SRSASN_CODE ho_prep_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -2471,7 +2135,7 @@ SRSASN_CODE ho_prep_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -2570,6 +2234,171 @@ SRSASN_CODE ho_prep_info_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } +// HandoverPreparationInformation-v13c0-IEs ::= SEQUENCE +SRSASN_CODE ho_prep_info_v13c0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(as_cfg_v13c0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (as_cfg_v13c0_present) { + HANDLE_CODE(as_cfg_v13c0.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ho_prep_info_v13c0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(as_cfg_v13c0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (as_cfg_v13c0_present) { + HANDLE_CODE(as_cfg_v13c0.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ho_prep_info_v13c0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (as_cfg_v13c0_present) { + j.write_fieldname("as-Config-v13c0"); + as_cfg_v13c0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} + +// HandoverPreparationInformation-v10x0-IEs ::= SEQUENCE +SRSASN_CODE ho_prep_info_v10x0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ho_prep_info_v10x0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ho_prep_info_v10x0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// HandoverPreparationInformation-v10j0-IEs ::= SEQUENCE +SRSASN_CODE ho_prep_info_v10j0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(as_cfg_v10j0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (as_cfg_v10j0_present) { + HANDLE_CODE(as_cfg_v10j0.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ho_prep_info_v10j0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(as_cfg_v10j0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (as_cfg_v10j0_present) { + HANDLE_CODE(as_cfg_v10j0.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ho_prep_info_v10j0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (as_cfg_v10j0_present) { + j.write_fieldname("as-Config-v10j0"); + as_cfg_v10j0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// HandoverPreparationInformation-v9j0-IEs ::= SEQUENCE +SRSASN_CODE ho_prep_info_v9j0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ho_prep_info_v9j0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ho_prep_info_v9j0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + // VarMeasConfig ::= SEQUENCE SRSASN_CODE var_meas_cfg_s::pack(bit_ref& bref) const { diff --git a/lib/src/asn1/rrc/meascfg.cc b/lib/src/asn1/rrc/meascfg.cc index 38d83532a..4e62da7f7 100644 --- a/lib/src/asn1/rrc/meascfg.cc +++ b/lib/src/asn1/rrc/meascfg.cc @@ -10235,36 +10235,6 @@ void carrier_freq_geran_s::to_json(json_writer& j) const j.end_obj(); } -// MobilityControlInfo-v10l0 ::= SEQUENCE -SRSASN_CODE mob_ctrl_info_v10l0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(add_spec_emission_v10l0_present, 1)); - - if (add_spec_emission_v10l0_present) { - HANDLE_CODE(pack_integer(bref, add_spec_emission_v10l0, (uint16_t)33u, (uint16_t)288u)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE mob_ctrl_info_v10l0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(add_spec_emission_v10l0_present, 1)); - - if (add_spec_emission_v10l0_present) { - HANDLE_CODE(unpack_integer(add_spec_emission_v10l0, bref, (uint16_t)33u, (uint16_t)288u)); - } - - return SRSASN_SUCCESS; -} -void mob_ctrl_info_v10l0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (add_spec_emission_v10l0_present) { - j.write_int("additionalSpectrumEmission-v10l0", add_spec_emission_v10l0); - } - j.end_obj(); -} - // LoggedMeasurementConfiguration-v1530-IEs ::= SEQUENCE SRSASN_CODE logged_meas_cfg_v1530_ies_s::pack(bit_ref& bref) const { @@ -14691,66 +14661,9 @@ void meas_report_s::to_json(json_writer& j) const j.end_obj(); } -void meas_report_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void meas_report_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_"); - } -} -meas_report_s::crit_exts_c_::crit_exts_c_(const meas_report_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_"); - } -} -meas_report_s::crit_exts_c_& meas_report_s::crit_exts_c_::operator=(const meas_report_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_"); - } - - return *this; } void meas_report_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14758,7 +14671,7 @@ void meas_report_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14772,7 +14685,7 @@ SRSASN_CODE meas_report_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14789,7 +14702,7 @@ SRSASN_CODE meas_report_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14887,3 +14800,33 @@ SRSASN_CODE meas_report_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref) } return SRSASN_SUCCESS; } + +// MobilityControlInfo-v10l0 ::= SEQUENCE +SRSASN_CODE mob_ctrl_info_v10l0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(add_spec_emission_v10l0_present, 1)); + + if (add_spec_emission_v10l0_present) { + HANDLE_CODE(pack_integer(bref, add_spec_emission_v10l0, (uint16_t)33u, (uint16_t)288u)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE mob_ctrl_info_v10l0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(add_spec_emission_v10l0_present, 1)); + + if (add_spec_emission_v10l0_present) { + HANDLE_CODE(unpack_integer(add_spec_emission_v10l0, bref, (uint16_t)33u, (uint16_t)288u)); + } + + return SRSASN_SUCCESS; +} +void mob_ctrl_info_v10l0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (add_spec_emission_v10l0_present) { + j.write_int("additionalSpectrumEmission-v10l0", add_spec_emission_v10l0); + } + j.end_obj(); +} diff --git a/lib/src/asn1/rrc/paging.cc b/lib/src/asn1/rrc/paging.cc index e48bcfb76..cadc233ce 100644 --- a/lib/src/asn1/rrc/paging.cc +++ b/lib/src/asn1/rrc/paging.cc @@ -485,66 +485,9 @@ void paging_s::to_json(json_writer& j) const } // PCCH-MessageType ::= CHOICE -void pcch_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void pcch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "pcch_msg_type_c"); - } -} -pcch_msg_type_c::pcch_msg_type_c(const pcch_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "pcch_msg_type_c"); - } -} -pcch_msg_type_c& pcch_msg_type_c::operator=(const pcch_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "pcch_msg_type_c"); - } - - return *this; } void pcch_msg_type_c::to_json(json_writer& j) const { @@ -552,7 +495,7 @@ void pcch_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -566,7 +509,7 @@ SRSASN_CODE pcch_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -583,7 +526,7 @@ SRSASN_CODE pcch_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -699,67 +642,9 @@ void ue_paging_coverage_info_s::to_json(json_writer& j) const j.end_obj(); } -void ue_paging_coverage_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_paging_coverage_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_"); - } -} -ue_paging_coverage_info_s::crit_exts_c_::crit_exts_c_(const ue_paging_coverage_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_"); - } -} -ue_paging_coverage_info_s::crit_exts_c_& -ue_paging_coverage_info_s::crit_exts_c_::operator=(const ue_paging_coverage_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_"); - } - - return *this; } void ue_paging_coverage_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -767,7 +652,7 @@ void ue_paging_coverage_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -781,7 +666,7 @@ SRSASN_CODE ue_paging_coverage_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -798,7 +683,7 @@ SRSASN_CODE ue_paging_coverage_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -995,67 +880,9 @@ void ue_radio_paging_info_s::to_json(json_writer& j) const j.end_obj(); } -void ue_radio_paging_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_radio_paging_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_"); - } -} -ue_radio_paging_info_s::crit_exts_c_::crit_exts_c_(const ue_radio_paging_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_"); - } -} -ue_radio_paging_info_s::crit_exts_c_& -ue_radio_paging_info_s::crit_exts_c_::operator=(const ue_radio_paging_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_"); - } - - return *this; } void ue_radio_paging_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1063,7 +890,7 @@ void ue_radio_paging_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1077,7 +904,7 @@ SRSASN_CODE ue_radio_paging_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1094,7 +921,7 @@ SRSASN_CODE ue_radio_paging_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; diff --git a/lib/src/asn1/rrc/rr_common.cc b/lib/src/asn1/rrc/rr_common.cc index 5da38c960..8d6e4cb7e 100644 --- a/lib/src/asn1/rrc/rr_common.cc +++ b/lib/src/asn1/rrc/rr_common.cc @@ -498,71 +498,6 @@ uint8_t tdd_cfg_v1130_s::special_sf_patterns_v1130_opts::to_number() const return map_enum_number(options, 2, value, "tdd_cfg_v1130_s::special_sf_patterns_v1130_e_"); } -// UplinkPowerControlCommon-v1310 ::= SEQUENCE -SRSASN_CODE ul_pwr_ctrl_common_v1310_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(delta_f_pucch_format4_r13_present, 1)); - HANDLE_CODE(bref.pack(delta_f_pucch_format5_minus13_present, 1)); - - if (delta_f_pucch_format4_r13_present) { - HANDLE_CODE(delta_f_pucch_format4_r13.pack(bref)); - } - if (delta_f_pucch_format5_minus13_present) { - HANDLE_CODE(delta_f_pucch_format5_minus13.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ul_pwr_ctrl_common_v1310_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(delta_f_pucch_format4_r13_present, 1)); - HANDLE_CODE(bref.unpack(delta_f_pucch_format5_minus13_present, 1)); - - if (delta_f_pucch_format4_r13_present) { - HANDLE_CODE(delta_f_pucch_format4_r13.unpack(bref)); - } - if (delta_f_pucch_format5_minus13_present) { - HANDLE_CODE(delta_f_pucch_format5_minus13.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ul_pwr_ctrl_common_v1310_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (delta_f_pucch_format4_r13_present) { - j.write_str("deltaF-PUCCH-Format4-r13", delta_f_pucch_format4_r13.to_string()); - } - if (delta_f_pucch_format5_minus13_present) { - j.write_str("deltaF-PUCCH-Format5-13", delta_f_pucch_format5_minus13.to_string()); - } - j.end_obj(); -} - -std::string ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format4_r13_opts::to_string() const -{ - static const char* options[] = { - "deltaF16", "deltaF15", "deltaF14", "deltaF13", "deltaF12", "deltaF11", "deltaF10", "spare1"}; - return convert_enum_idx(options, 8, value, "ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format4_r13_e_"); -} -uint8_t ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format4_r13_opts::to_number() const -{ - static const uint8_t options[] = {16, 15, 14, 13, 12, 11, 10}; - return map_enum_number(options, 7, value, "ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format4_r13_e_"); -} - -std::string ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format5_minus13_opts::to_string() const -{ - static const char* options[] = { - "deltaF13", "deltaF12", "deltaF11", "deltaF10", "deltaF9", "deltaF8", "deltaF7", "spare1"}; - return convert_enum_idx(options, 8, value, "ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format5_minus13_e_"); -} -uint8_t ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format5_minus13_opts::to_number() const -{ - static const uint8_t options[] = {13, 12, 11, 10, 9, 8, 7}; - return map_enum_number(options, 7, value, "ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format5_minus13_e_"); -} - // PRACH-ParametersCE-r13 ::= SEQUENCE SRSASN_CODE prach_params_ce_r13_s::pack(bit_ref& bref) const { @@ -5127,6 +5062,71 @@ uint8_t rr_cfg_common_scell_r10_s::harq_ref_cfg_r14_opts::to_number() const return map_enum_number(options, 3, value, "rr_cfg_common_scell_r10_s::harq_ref_cfg_r14_e_"); } +// UplinkPowerControlCommon-v1310 ::= SEQUENCE +SRSASN_CODE ul_pwr_ctrl_common_v1310_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(delta_f_pucch_format4_r13_present, 1)); + HANDLE_CODE(bref.pack(delta_f_pucch_format5_minus13_present, 1)); + + if (delta_f_pucch_format4_r13_present) { + HANDLE_CODE(delta_f_pucch_format4_r13.pack(bref)); + } + if (delta_f_pucch_format5_minus13_present) { + HANDLE_CODE(delta_f_pucch_format5_minus13.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ul_pwr_ctrl_common_v1310_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(delta_f_pucch_format4_r13_present, 1)); + HANDLE_CODE(bref.unpack(delta_f_pucch_format5_minus13_present, 1)); + + if (delta_f_pucch_format4_r13_present) { + HANDLE_CODE(delta_f_pucch_format4_r13.unpack(bref)); + } + if (delta_f_pucch_format5_minus13_present) { + HANDLE_CODE(delta_f_pucch_format5_minus13.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ul_pwr_ctrl_common_v1310_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (delta_f_pucch_format4_r13_present) { + j.write_str("deltaF-PUCCH-Format4-r13", delta_f_pucch_format4_r13.to_string()); + } + if (delta_f_pucch_format5_minus13_present) { + j.write_str("deltaF-PUCCH-Format5-13", delta_f_pucch_format5_minus13.to_string()); + } + j.end_obj(); +} + +std::string ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format4_r13_opts::to_string() const +{ + static const char* options[] = { + "deltaF16", "deltaF15", "deltaF14", "deltaF13", "deltaF12", "deltaF11", "deltaF10", "spare1"}; + return convert_enum_idx(options, 8, value, "ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format4_r13_e_"); +} +uint8_t ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format4_r13_opts::to_number() const +{ + static const uint8_t options[] = {16, 15, 14, 13, 12, 11, 10}; + return map_enum_number(options, 7, value, "ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format4_r13_e_"); +} + +std::string ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format5_minus13_opts::to_string() const +{ + static const char* options[] = { + "deltaF13", "deltaF12", "deltaF11", "deltaF10", "deltaF9", "deltaF8", "deltaF7", "spare1"}; + return convert_enum_idx(options, 8, value, "ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format5_minus13_e_"); +} +uint8_t ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format5_minus13_opts::to_number() const +{ + static const uint8_t options[] = {13, 12, 11, 10, 9, 8, 7}; + return map_enum_number(options, 7, value, "ul_pwr_ctrl_common_v1310_s::delta_f_pucch_format5_minus13_e_"); +} + // PRACH-Config-v1310 ::= SEQUENCE SRSASN_CODE prach_cfg_v1310_s::pack(bit_ref& bref) const { diff --git a/lib/src/asn1/rrc/rr_ded.cc b/lib/src/asn1/rrc/rr_ded.cc index fa48e7f56..b256bd612 100644 --- a/lib/src/asn1/rrc/rr_ded.cc +++ b/lib/src/asn1/rrc/rr_ded.cc @@ -2953,32 +2953,11 @@ void rlc_cfg_v1530_c::set(types::options e) void rlc_cfg_v1530_c::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::release: - break; - case types::setup: - j.write_fieldname("setup"); - j.start_obj(); - j.write_str("rlc-OutOfOrderDelivery-r15", "true"); - j.end_obj(); - break; - default: - log_invalid_choice_id(type_, "rlc_cfg_v1530_c"); - } j.end_obj(); } SRSASN_CODE rlc_cfg_v1530_c::pack(bit_ref& bref) const { type_.pack(bref); - switch (type_) { - case types::release: - break; - case types::setup: - break; - default: - log_invalid_choice_id(type_, "rlc_cfg_v1530_c"); - return SRSASN_ERROR_ENCODE_FAIL; - } return SRSASN_SUCCESS; } SRSASN_CODE rlc_cfg_v1530_c::unpack(cbit_ref& bref) @@ -2986,15 +2965,6 @@ SRSASN_CODE rlc_cfg_v1530_c::unpack(cbit_ref& bref) types e; e.unpack(bref); set(e); - switch (type_) { - case types::release: - break; - case types::setup: - break; - default: - log_invalid_choice_id(type_, "rlc_cfg_v1530_c"); - return SRSASN_ERROR_DECODE_FAIL; - } return SRSASN_SUCCESS; } bool rlc_cfg_v1530_c::operator==(const rlc_cfg_v1530_c& other) const @@ -13486,88 +13456,6 @@ uint8_t ant_info_ded_v10i0_s::max_layers_mimo_r10_opts::to_number() const return map_enum_number(options, 3, value, "ant_info_ded_v10i0_s::max_layers_mimo_r10_e_"); } -// PUCCH-ConfigDedicated-v13c0 ::= SEQUENCE -SRSASN_CODE pucch_cfg_ded_v13c0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(ch_sel_v13c0.n1_pucch_an_cs_v13c0.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE pucch_cfg_ded_v13c0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(ch_sel_v13c0.n1_pucch_an_cs_v13c0.unpack(bref)); - - return SRSASN_SUCCESS; -} -void pucch_cfg_ded_v13c0_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("channelSelection-v13c0"); - j.start_obj(); - j.write_fieldname("n1PUCCH-AN-CS-v13c0"); - ch_sel_v13c0.n1_pucch_an_cs_v13c0.to_json(j); - j.end_obj(); - j.end_obj(); -} - -void pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_::set(types::options e) -{ - type_ = e; -} -void pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::release: - break; - case types::setup: - j.write_fieldname("setup"); - j.start_obj(); - j.start_array("n1PUCCH-AN-CS-ListP1-v13c0"); - for (const auto& e1 : c.n1_pucch_an_cs_list_p1_v13c0) { - j.write_int(e1); - } - j.end_array(); - j.end_obj(); - break; - default: - log_invalid_choice_id(type_, "pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_"); - } - j.end_obj(); -} -SRSASN_CODE pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::release: - break; - case types::setup: - HANDLE_CODE(pack_dyn_seq_of(bref, c.n1_pucch_an_cs_list_p1_v13c0, 2, 4, integer_packer(0, 2047))); - break; - default: - log_invalid_choice_id(type_, "pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::release: - break; - case types::setup: - HANDLE_CODE(unpack_dyn_seq_of(c.n1_pucch_an_cs_list_p1_v13c0, bref, 2, 4, integer_packer(0, 2047))); - break; - default: - log_invalid_choice_id(type_, "pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - // RadioResourceConfigDedicatedSCell-r10 ::= SEQUENCE SRSASN_CODE rr_cfg_ded_scell_r10_s::pack(bit_ref& bref) const { @@ -13779,82 +13667,6 @@ bool rr_cfg_ded_scell_r10_s::operator==(const rr_cfg_ded_scell_r10_s& other) con (not sps_cfg_v1530.is_present() or *sps_cfg_v1530 == *other.sps_cfg_v1530))); } -// PhysicalConfigDedicatedSCell-v13c0 ::= SEQUENCE -SRSASN_CODE phys_cfg_ded_scell_v13c0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pucch_scell_v13c0.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE phys_cfg_ded_scell_v13c0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(pucch_scell_v13c0.unpack(bref)); - - return SRSASN_SUCCESS; -} -void phys_cfg_ded_scell_v13c0_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("pucch-SCell-v13c0"); - pucch_scell_v13c0.to_json(j); - j.end_obj(); -} - -void phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_::set(types::options e) -{ - type_ = e; -} -void phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::release: - break; - case types::setup: - j.write_fieldname("setup"); - j.start_obj(); - j.write_fieldname("pucch-ConfigDedicated-v13c0"); - c.pucch_cfg_ded_v13c0.to_json(j); - j.end_obj(); - break; - default: - log_invalid_choice_id(type_, "phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_"); - } - j.end_obj(); -} -SRSASN_CODE phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::release: - break; - case types::setup: - HANDLE_CODE(c.pucch_cfg_ded_v13c0.pack(bref)); - break; - default: - log_invalid_choice_id(type_, "phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::release: - break; - case types::setup: - HANDLE_CODE(c.pucch_cfg_ded_v13c0.unpack(bref)); - break; - default: - log_invalid_choice_id(type_, "phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - // SCellToAddModExt-r13 ::= SEQUENCE SRSASN_CODE scell_to_add_mod_ext_r13_s::pack(bit_ref& bref) const { @@ -13930,56 +13742,86 @@ void scell_to_add_mod_ext_r13_s::to_json(json_writer& j) const j.end_obj(); } -// RadioResourceConfigDedicatedSCell-v13c0 ::= SEQUENCE -SRSASN_CODE rr_cfg_ded_scell_v13c0_s::pack(bit_ref& bref) const +// PUCCH-ConfigDedicated-v13c0 ::= SEQUENCE +SRSASN_CODE pucch_cfg_ded_v13c0_s::pack(bit_ref& bref) const { - HANDLE_CODE(phys_cfg_ded_scell_v13c0.pack(bref)); + HANDLE_CODE(ch_sel_v13c0.n1_pucch_an_cs_v13c0.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE rr_cfg_ded_scell_v13c0_s::unpack(cbit_ref& bref) +SRSASN_CODE pucch_cfg_ded_v13c0_s::unpack(cbit_ref& bref) { - HANDLE_CODE(phys_cfg_ded_scell_v13c0.unpack(bref)); + HANDLE_CODE(ch_sel_v13c0.n1_pucch_an_cs_v13c0.unpack(bref)); return SRSASN_SUCCESS; } -void rr_cfg_ded_scell_v13c0_s::to_json(json_writer& j) const +void pucch_cfg_ded_v13c0_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("physicalConfigDedicatedSCell-v13c0"); - phys_cfg_ded_scell_v13c0.to_json(j); + j.write_fieldname("channelSelection-v13c0"); + j.start_obj(); + j.write_fieldname("n1PUCCH-AN-CS-v13c0"); + ch_sel_v13c0.n1_pucch_an_cs_v13c0.to_json(j); + j.end_obj(); j.end_obj(); } -// SCellToAddMod-v13c0 ::= SEQUENCE -SRSASN_CODE scell_to_add_mod_v13c0_s::pack(bit_ref& bref) const +void pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_::set(types::options e) { - HANDLE_CODE(bref.pack(rr_cfg_ded_scell_v13c0_present, 1)); - - if (rr_cfg_ded_scell_v13c0_present) { - HANDLE_CODE(rr_cfg_ded_scell_v13c0.pack(bref)); + type_ = e; +} +void pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::release: + break; + case types::setup: + j.write_fieldname("setup"); + j.start_obj(); + j.start_array("n1PUCCH-AN-CS-ListP1-v13c0"); + for (const auto& e1 : c.n1_pucch_an_cs_list_p1_v13c0) { + j.write_int(e1); + } + j.end_array(); + j.end_obj(); + break; + default: + log_invalid_choice_id(type_, "pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_"); } - - return SRSASN_SUCCESS; + j.end_obj(); } -SRSASN_CODE scell_to_add_mod_v13c0_s::unpack(cbit_ref& bref) +SRSASN_CODE pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_::pack(bit_ref& bref) const { - HANDLE_CODE(bref.unpack(rr_cfg_ded_scell_v13c0_present, 1)); - - if (rr_cfg_ded_scell_v13c0_present) { - HANDLE_CODE(rr_cfg_ded_scell_v13c0.unpack(bref)); + type_.pack(bref); + switch (type_) { + case types::release: + break; + case types::setup: + HANDLE_CODE(pack_dyn_seq_of(bref, c.n1_pucch_an_cs_list_p1_v13c0, 2, 4, integer_packer(0, 2047))); + break; + default: + log_invalid_choice_id(type_, "pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } - return SRSASN_SUCCESS; } -void scell_to_add_mod_v13c0_s::to_json(json_writer& j) const +SRSASN_CODE pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_::unpack(cbit_ref& bref) { - j.start_obj(); - if (rr_cfg_ded_scell_v13c0_present) { - j.write_fieldname("radioResourceConfigDedicatedSCell-v13c0"); - rr_cfg_ded_scell_v13c0.to_json(j); + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::release: + break; + case types::setup: + HANDLE_CODE(unpack_dyn_seq_of(c.n1_pucch_an_cs_list_p1_v13c0, bref, 2, 4, integer_packer(0, 2047))); + break; + default: + log_invalid_choice_id(type_, "pucch_cfg_ded_v13c0_s::ch_sel_v13c0_s_::n1_pucch_an_cs_v13c0_c_"); + return SRSASN_ERROR_DECODE_FAIL; } - j.end_obj(); + return SRSASN_SUCCESS; } // DRB-ToAddModSCG-r12 ::= SEQUENCE @@ -14573,37 +14415,6 @@ std::string scell_to_add_mod_r10_s::scell_state_r15_opts::to_string() const return convert_enum_idx(options, 2, value, "scell_to_add_mod_r10_s::scell_state_r15_e_"); } -// SCellToAddMod-v10l0 ::= SEQUENCE -SRSASN_CODE scell_to_add_mod_v10l0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rr_cfg_common_scell_v10l0_present, 1)); - - if (rr_cfg_common_scell_v10l0_present) { - HANDLE_CODE(rr_cfg_common_scell_v10l0.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE scell_to_add_mod_v10l0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rr_cfg_common_scell_v10l0_present, 1)); - - if (rr_cfg_common_scell_v10l0_present) { - HANDLE_CODE(rr_cfg_common_scell_v10l0.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void scell_to_add_mod_v10l0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rr_cfg_common_scell_v10l0_present) { - j.write_fieldname("radioResourceConfigCommonSCell-v10l0"); - rr_cfg_common_scell_v10l0.to_json(j); - } - j.end_obj(); -} - // SCellToAddModExt-v1370 ::= SEQUENCE SRSASN_CODE scell_to_add_mod_ext_v1370_s::pack(bit_ref& bref) const { @@ -14705,27 +14516,6 @@ std::string scell_to_add_mod_ext_v1430_s::scell_state_r15_opts::to_string() cons return convert_enum_idx(options, 2, value, "scell_to_add_mod_ext_v1430_s::scell_state_r15_e_"); } -// RadioResourceConfigDedicated-v13c0 ::= SEQUENCE -SRSASN_CODE rr_cfg_ded_v13c0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(phys_cfg_ded_v13c0.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rr_cfg_ded_v13c0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(phys_cfg_ded_v13c0.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rr_cfg_ded_v13c0_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("physicalConfigDedicated-v13c0"); - phys_cfg_ded_v13c0.to_json(j); - j.end_obj(); -} - // RadioResourceConfigDedicatedSCG-r12 ::= SEQUENCE SRSASN_CODE rr_cfg_ded_scg_r12_s::pack(bit_ref& bref) const { @@ -14894,6 +14684,186 @@ void rr_cfg_ded_scg_r12_s::to_json(json_writer& j) const j.end_obj(); } +// PhysicalConfigDedicatedSCell-v13c0 ::= SEQUENCE +SRSASN_CODE phys_cfg_ded_scell_v13c0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pucch_scell_v13c0.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE phys_cfg_ded_scell_v13c0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(pucch_scell_v13c0.unpack(bref)); + + return SRSASN_SUCCESS; +} +void phys_cfg_ded_scell_v13c0_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("pucch-SCell-v13c0"); + pucch_scell_v13c0.to_json(j); + j.end_obj(); +} + +void phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_::set(types::options e) +{ + type_ = e; +} +void phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::release: + break; + case types::setup: + j.write_fieldname("setup"); + j.start_obj(); + j.write_fieldname("pucch-ConfigDedicated-v13c0"); + c.pucch_cfg_ded_v13c0.to_json(j); + j.end_obj(); + break; + default: + log_invalid_choice_id(type_, "phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_"); + } + j.end_obj(); +} +SRSASN_CODE phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::release: + break; + case types::setup: + HANDLE_CODE(c.pucch_cfg_ded_v13c0.pack(bref)); + break; + default: + log_invalid_choice_id(type_, "phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::release: + break; + case types::setup: + HANDLE_CODE(c.pucch_cfg_ded_v13c0.unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "phys_cfg_ded_scell_v13c0_s::pucch_scell_v13c0_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +// RadioResourceConfigDedicatedSCell-v13c0 ::= SEQUENCE +SRSASN_CODE rr_cfg_ded_scell_v13c0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(phys_cfg_ded_scell_v13c0.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rr_cfg_ded_scell_v13c0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(phys_cfg_ded_scell_v13c0.unpack(bref)); + + return SRSASN_SUCCESS; +} +void rr_cfg_ded_scell_v13c0_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("physicalConfigDedicatedSCell-v13c0"); + phys_cfg_ded_scell_v13c0.to_json(j); + j.end_obj(); +} + +// SCellToAddMod-v13c0 ::= SEQUENCE +SRSASN_CODE scell_to_add_mod_v13c0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rr_cfg_ded_scell_v13c0_present, 1)); + + if (rr_cfg_ded_scell_v13c0_present) { + HANDLE_CODE(rr_cfg_ded_scell_v13c0.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE scell_to_add_mod_v13c0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rr_cfg_ded_scell_v13c0_present, 1)); + + if (rr_cfg_ded_scell_v13c0_present) { + HANDLE_CODE(rr_cfg_ded_scell_v13c0.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void scell_to_add_mod_v13c0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rr_cfg_ded_scell_v13c0_present) { + j.write_fieldname("radioResourceConfigDedicatedSCell-v13c0"); + rr_cfg_ded_scell_v13c0.to_json(j); + } + j.end_obj(); +} + +// SCellToAddMod-v10l0 ::= SEQUENCE +SRSASN_CODE scell_to_add_mod_v10l0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rr_cfg_common_scell_v10l0_present, 1)); + + if (rr_cfg_common_scell_v10l0_present) { + HANDLE_CODE(rr_cfg_common_scell_v10l0.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE scell_to_add_mod_v10l0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rr_cfg_common_scell_v10l0_present, 1)); + + if (rr_cfg_common_scell_v10l0_present) { + HANDLE_CODE(rr_cfg_common_scell_v10l0.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void scell_to_add_mod_v10l0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rr_cfg_common_scell_v10l0_present) { + j.write_fieldname("radioResourceConfigCommonSCell-v10l0"); + rr_cfg_common_scell_v10l0.to_json(j); + } + j.end_obj(); +} + +// RadioResourceConfigDedicated-v13c0 ::= SEQUENCE +SRSASN_CODE rr_cfg_ded_v13c0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(phys_cfg_ded_v13c0.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rr_cfg_ded_v13c0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(phys_cfg_ded_v13c0.unpack(bref)); + + return SRSASN_SUCCESS; +} +void rr_cfg_ded_v13c0_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("physicalConfigDedicated-v13c0"); + phys_cfg_ded_v13c0.to_json(j); + j.end_obj(); +} + // Cell-ToAddMod-r12 ::= SEQUENCE SRSASN_CODE cell_to_add_mod_r12_s::pack(bit_ref& bref) const { diff --git a/lib/src/asn1/rrc/security.cc b/lib/src/asn1/rrc/security.cc index 14ac2ea3e..dd54d3761 100644 --- a/lib/src/asn1/rrc/security.cc +++ b/lib/src/asn1/rrc/security.cc @@ -548,67 +548,9 @@ void security_mode_cmd_s::to_json(json_writer& j) const j.end_obj(); } -void security_mode_cmd_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void security_mode_cmd_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_"); - } -} -security_mode_cmd_s::crit_exts_c_::crit_exts_c_(const security_mode_cmd_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_"); - } -} -security_mode_cmd_s::crit_exts_c_& -security_mode_cmd_s::crit_exts_c_::operator=(const security_mode_cmd_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_"); - } - - return *this; } void security_mode_cmd_s::crit_exts_c_::to_json(json_writer& j) const { @@ -616,7 +558,7 @@ void security_mode_cmd_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -630,7 +572,7 @@ SRSASN_CODE security_mode_cmd_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -647,7 +589,7 @@ SRSASN_CODE security_mode_cmd_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -882,67 +824,9 @@ void security_mode_complete_s::to_json(json_writer& j) const j.end_obj(); } -void security_mode_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::security_mode_complete_r8: - c.destroy(); - break; - default: - break; - } -} void security_mode_complete_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::security_mode_complete_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_"); - } -} -security_mode_complete_s::crit_exts_c_::crit_exts_c_(const security_mode_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::security_mode_complete_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_"); - } -} -security_mode_complete_s::crit_exts_c_& -security_mode_complete_s::crit_exts_c_::operator=(const security_mode_complete_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::security_mode_complete_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_"); - } - - return *this; } void security_mode_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -950,7 +834,7 @@ void security_mode_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::security_mode_complete_r8: j.write_fieldname("securityModeComplete-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -964,7 +848,7 @@ SRSASN_CODE security_mode_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::security_mode_complete_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -981,7 +865,7 @@ SRSASN_CODE security_mode_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::security_mode_complete_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -1016,67 +900,9 @@ void security_mode_fail_s::to_json(json_writer& j) const j.end_obj(); } -void security_mode_fail_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::security_mode_fail_r8: - c.destroy(); - break; - default: - break; - } -} void security_mode_fail_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::security_mode_fail_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_"); - } -} -security_mode_fail_s::crit_exts_c_::crit_exts_c_(const security_mode_fail_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::security_mode_fail_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_"); - } -} -security_mode_fail_s::crit_exts_c_& -security_mode_fail_s::crit_exts_c_::operator=(const security_mode_fail_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::security_mode_fail_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_"); - } - - return *this; } void security_mode_fail_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1084,7 +910,7 @@ void security_mode_fail_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::security_mode_fail_r8: j.write_fieldname("securityModeFailure-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1098,7 +924,7 @@ SRSASN_CODE security_mode_fail_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::security_mode_fail_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1115,7 +941,7 @@ SRSASN_CODE security_mode_fail_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::security_mode_fail_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; diff --git a/lib/src/asn1/rrc/si.cc b/lib/src/asn1/rrc/si.cc index fdb36111a..2011d358b 100644 --- a/lib/src/asn1/rrc/si.cc +++ b/lib/src/asn1/rrc/si.cc @@ -563,38 +563,6 @@ void cell_access_related_info_r14_s::to_json(json_writer& j) const j.end_obj(); } -// CellSelectionInfoCE1-v1360 ::= SEQUENCE -SRSASN_CODE cell_sel_info_ce1_v1360_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pack_integer(bref, delta_rx_lev_min_ce1_v1360, (int8_t)-8, (int8_t)-1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE cell_sel_info_ce1_v1360_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(delta_rx_lev_min_ce1_v1360, bref, (int8_t)-8, (int8_t)-1)); - - return SRSASN_SUCCESS; -} -void cell_sel_info_ce1_v1360_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("delta-RxLevMinCE1-v1360", delta_rx_lev_min_ce1_v1360); - j.end_obj(); -} - -// SI-Periodicity-r12 ::= ENUMERATED -std::string si_periodicity_r12_opts::to_string() const -{ - static const char* options[] = {"rf8", "rf16", "rf32", "rf64", "rf128", "rf256", "rf512"}; - return convert_enum_idx(options, 7, value, "si_periodicity_r12_e"); -} -uint16_t si_periodicity_r12_opts::to_number() const -{ - static const uint16_t options[] = {8, 16, 32, 64, 128, 256, 512}; - return map_enum_number(options, 7, value, "si_periodicity_r12_e"); -} - // SystemInformationBlockType1-v1450-IEs ::= SEQUENCE SRSASN_CODE sib_type1_v1450_ies_s::pack(bit_ref& bref) const { @@ -638,6 +606,26 @@ void sib_type1_v1450_ies_s::to_json(json_writer& j) const j.end_obj(); } +// CellSelectionInfoCE1-v1360 ::= SEQUENCE +SRSASN_CODE cell_sel_info_ce1_v1360_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, delta_rx_lev_min_ce1_v1360, (int8_t)-8, (int8_t)-1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE cell_sel_info_ce1_v1360_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(unpack_integer(delta_rx_lev_min_ce1_v1360, bref, (int8_t)-8, (int8_t)-1)); + + return SRSASN_SUCCESS; +} +void cell_sel_info_ce1_v1360_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("delta-RxLevMinCE1-v1360", delta_rx_lev_min_ce1_v1360); + j.end_obj(); +} + // SystemInformationBlockType1-v1430-IEs ::= SEQUENCE SRSASN_CODE sib_type1_v1430_ies_s::pack(bit_ref& bref) const { @@ -2171,6 +2159,18 @@ void cell_sel_info_v920_s::to_json(json_writer& j) const j.end_obj(); } +// SI-Periodicity-r12 ::= ENUMERATED +std::string si_periodicity_r12_opts::to_string() const +{ + static const char* options[] = {"rf8", "rf16", "rf32", "rf64", "rf128", "rf256", "rf512"}; + return convert_enum_idx(options, 7, value, "si_periodicity_r12_e"); +} +uint16_t si_periodicity_r12_opts::to_number() const +{ + static const uint16_t options[] = {8, 16, 32, 64, 128, 256, 512}; + return map_enum_number(options, 7, value, "si_periodicity_r12_e"); +} + // SystemInformationBlockType1-v1130-IEs ::= SEQUENCE SRSASN_CODE sib_type1_v1130_ies_s::pack(bit_ref& bref) const { diff --git a/lib/src/asn1/rrc/uecap.cc b/lib/src/asn1/rrc/uecap.cc index 4339792a9..e180b131d 100644 --- a/lib/src/asn1/rrc/uecap.cc +++ b/lib/src/asn1/rrc/uecap.cc @@ -511,66 +511,9 @@ void ue_cap_enquiry_s::to_json(json_writer& j) const j.end_obj(); } -void ue_cap_enquiry_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_cap_enquiry_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_"); - } -} -ue_cap_enquiry_s::crit_exts_c_::crit_exts_c_(const ue_cap_enquiry_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_"); - } -} -ue_cap_enquiry_s::crit_exts_c_& ue_cap_enquiry_s::crit_exts_c_::operator=(const ue_cap_enquiry_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_"); - } - - return *this; } void ue_cap_enquiry_s::crit_exts_c_::to_json(json_writer& j) const { @@ -578,7 +521,7 @@ void ue_cap_enquiry_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -592,7 +535,7 @@ SRSASN_CODE ue_cap_enquiry_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -609,7 +552,7 @@ SRSASN_CODE ue_cap_enquiry_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -985,66 +928,9 @@ void ue_cap_info_s::to_json(json_writer& j) const j.end_obj(); } -void ue_cap_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_cap_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_"); - } -} -ue_cap_info_s::crit_exts_c_::crit_exts_c_(const ue_cap_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_"); - } -} -ue_cap_info_s::crit_exts_c_& ue_cap_info_s::crit_exts_c_::operator=(const ue_cap_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_"); - } - - return *this; } void ue_cap_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1052,7 +938,7 @@ void ue_cap_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1066,7 +952,7 @@ SRSASN_CODE ue_cap_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1083,7 +969,7 @@ SRSASN_CODE ue_cap_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -8440,9 +8326,6 @@ SRSASN_CODE phy_layer_params_v1540_s::pack(bit_ref& bref) const HANDLE_CODE(bref.pack(crs_im_tm1_to_tm9_one_rx_port_v1540_present, 1)); HANDLE_CODE(bref.pack(cch_im_ref_rec_type_a_one_rx_port_v1540_present, 1)); - if (stti_spt_cap_v1540_present) { - } - return SRSASN_SUCCESS; } SRSASN_CODE phy_layer_params_v1540_s::unpack(cbit_ref& bref) @@ -8451,9 +8334,6 @@ SRSASN_CODE phy_layer_params_v1540_s::unpack(cbit_ref& bref) HANDLE_CODE(bref.unpack(crs_im_tm1_to_tm9_one_rx_port_v1540_present, 1)); HANDLE_CODE(bref.unpack(cch_im_ref_rec_type_a_one_rx_port_v1540_present, 1)); - if (stti_spt_cap_v1540_present) { - } - return SRSASN_SUCCESS; } void phy_layer_params_v1540_s::to_json(json_writer& j) const @@ -10614,28 +10494,6 @@ uint16_t pdcp_params_v1430_s::max_num_rohc_context_sessions_r14_opts::to_number( return map_enum_number(options, 14, value, "pdcp_params_v1430_s::max_num_rohc_context_sessions_r14_e_"); } -// PhyLayerParameters-v14a0 ::= SEQUENCE -SRSASN_CODE phy_layer_params_v14a0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ssp10_tdd_only_r14_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE phy_layer_params_v14a0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(ssp10_tdd_only_r14_present, 1)); - - return SRSASN_SUCCESS; -} -void phy_layer_params_v14a0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (ssp10_tdd_only_r14_present) { - j.write_str("ssp10-TDD-Only-r14", "supported"); - } - j.end_obj(); -} - // RLC-Parameters-v1430 ::= SEQUENCE SRSASN_CODE rlc_params_v1430_s::pack(bit_ref& bref) const { @@ -10719,44 +10577,6 @@ void ue_eutra_cap_v1440_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v14b0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v14b0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rf_params_v14b0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rf_params_v14b0_present) { - HANDLE_CODE(rf_params_v14b0.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v14b0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rf_params_v14b0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rf_params_v14b0_present) { - HANDLE_CODE(rf_params_v14b0.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v14b0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rf_params_v14b0_present) { - j.write_fieldname("rf-Parameters-v14b0"); - rf_params_v14b0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - // UE-EUTRA-CapabilityAddXDD-Mode-v1430 ::= SEQUENCE SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1430_s::pack(bit_ref& bref) const { @@ -10800,172 +10620,54 @@ void ue_eutra_cap_add_xdd_mode_v1430_s::to_json(json_writer& j) const j.end_obj(); } -// MBMS-Parameters-v1470 ::= SEQUENCE -SRSASN_CODE mbms_params_v1470_s::pack(bit_ref& bref) const +// Other-Parameters-v1360 ::= SEQUENCE +SRSASN_CODE other_params_v1360_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(mbms_scaling_factor1dot25_r14_present, 1)); - HANDLE_CODE(bref.pack(mbms_scaling_factor7dot5_r14_present, 1)); - - HANDLE_CODE(mbms_max_bw_r14.pack(bref)); - if (mbms_scaling_factor1dot25_r14_present) { - HANDLE_CODE(mbms_scaling_factor1dot25_r14.pack(bref)); - } - if (mbms_scaling_factor7dot5_r14_present) { - HANDLE_CODE(mbms_scaling_factor7dot5_r14.pack(bref)); - } + HANDLE_CODE(bref.pack(in_dev_coex_ind_hardware_sharing_ind_r13_present, 1)); return SRSASN_SUCCESS; } -SRSASN_CODE mbms_params_v1470_s::unpack(cbit_ref& bref) +SRSASN_CODE other_params_v1360_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(mbms_scaling_factor1dot25_r14_present, 1)); - HANDLE_CODE(bref.unpack(mbms_scaling_factor7dot5_r14_present, 1)); - - HANDLE_CODE(mbms_max_bw_r14.unpack(bref)); - if (mbms_scaling_factor1dot25_r14_present) { - HANDLE_CODE(mbms_scaling_factor1dot25_r14.unpack(bref)); - } - if (mbms_scaling_factor7dot5_r14_present) { - HANDLE_CODE(mbms_scaling_factor7dot5_r14.unpack(bref)); - } + HANDLE_CODE(bref.unpack(in_dev_coex_ind_hardware_sharing_ind_r13_present, 1)); return SRSASN_SUCCESS; } -void mbms_params_v1470_s::to_json(json_writer& j) const +void other_params_v1360_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("mbms-MaxBW-r14"); - mbms_max_bw_r14.to_json(j); - if (mbms_scaling_factor1dot25_r14_present) { - j.write_str("mbms-ScalingFactor1dot25-r14", mbms_scaling_factor1dot25_r14.to_string()); - } - if (mbms_scaling_factor7dot5_r14_present) { - j.write_str("mbms-ScalingFactor7dot5-r14", mbms_scaling_factor7dot5_r14.to_string()); + if (in_dev_coex_ind_hardware_sharing_ind_r13_present) { + j.write_str("inDeviceCoexInd-HardwareSharingInd-r13", "supported"); } j.end_obj(); } -void mbms_params_v1470_s::mbms_max_bw_r14_c_::set(types::options e) -{ - type_ = e; -} -void mbms_params_v1470_s::mbms_max_bw_r14_c_::to_json(json_writer& j) const +// UE-EUTRA-Capability-v1430-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1430_ies_s::pack(bit_ref& bref) const { - j.start_obj(); - switch (type_) { - case types::implicit_value: - break; - case types::explicit_value: - j.write_int("explicitValue", c); - break; - default: - log_invalid_choice_id(type_, "mbms_params_v1470_s::mbms_max_bw_r14_c_"); - } - j.end_obj(); -} -SRSASN_CODE mbms_params_v1470_s::mbms_max_bw_r14_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::implicit_value: - break; - case types::explicit_value: - HANDLE_CODE(pack_integer(bref, c, (uint8_t)2u, (uint8_t)20u)); - break; - default: - log_invalid_choice_id(type_, "mbms_params_v1470_s::mbms_max_bw_r14_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE mbms_params_v1470_s::mbms_max_bw_r14_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::implicit_value: - break; - case types::explicit_value: - HANDLE_CODE(unpack_integer(c, bref, (uint8_t)2u, (uint8_t)20u)); - break; - default: - log_invalid_choice_id(type_, "mbms_params_v1470_s::mbms_max_bw_r14_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -std::string mbms_params_v1470_s::mbms_scaling_factor1dot25_r14_opts::to_string() const -{ - static const char* options[] = {"n3", "n6", "n9", "n12"}; - return convert_enum_idx(options, 4, value, "mbms_params_v1470_s::mbms_scaling_factor1dot25_r14_e_"); -} -uint8_t mbms_params_v1470_s::mbms_scaling_factor1dot25_r14_opts::to_number() const -{ - static const uint8_t options[] = {3, 6, 9, 12}; - return map_enum_number(options, 4, value, "mbms_params_v1470_s::mbms_scaling_factor1dot25_r14_e_"); -} - -std::string mbms_params_v1470_s::mbms_scaling_factor7dot5_r14_opts::to_string() const -{ - static const char* options[] = {"n1", "n2", "n3", "n4"}; - return convert_enum_idx(options, 4, value, "mbms_params_v1470_s::mbms_scaling_factor7dot5_r14_e_"); -} -uint8_t mbms_params_v1470_s::mbms_scaling_factor7dot5_r14_opts::to_number() const -{ - static const uint8_t options[] = {1, 2, 3, 4}; - return map_enum_number(options, 4, value, "mbms_params_v1470_s::mbms_scaling_factor7dot5_r14_e_"); -} - -// Other-Parameters-v1360 ::= SEQUENCE -SRSASN_CODE other_params_v1360_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(in_dev_coex_ind_hardware_sharing_ind_r13_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE other_params_v1360_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(in_dev_coex_ind_hardware_sharing_ind_r13_present, 1)); - - return SRSASN_SUCCESS; -} -void other_params_v1360_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (in_dev_coex_ind_hardware_sharing_ind_r13_present) { - j.write_str("inDeviceCoexInd-HardwareSharingInd-r13", "supported"); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v1430-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1430_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ue_category_dl_v1430_present, 1)); - HANDLE_CODE(bref.pack(ue_category_ul_v1430_present, 1)); - HANDLE_CODE(bref.pack(ue_category_ul_v1430b_present, 1)); - HANDLE_CODE(bref.pack(mac_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(meas_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(pdcp_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(rf_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(laa_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(lwa_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(lwip_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(mmtel_params_r14_present, 1)); - HANDLE_CODE(bref.pack(mob_params_r14_present, 1)); - HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1430_present, 1)); - HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1430_present, 1)); - HANDLE_CODE(bref.pack(mbms_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(sl_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(ue_based_netw_perf_meas_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(high_speed_enh_params_r14_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - HANDLE_CODE(phy_layer_params_v1430.pack(bref)); - if (ue_category_ul_v1430_present) { - HANDLE_CODE(ue_category_ul_v1430.pack(bref)); + HANDLE_CODE(bref.pack(ue_category_dl_v1430_present, 1)); + HANDLE_CODE(bref.pack(ue_category_ul_v1430_present, 1)); + HANDLE_CODE(bref.pack(ue_category_ul_v1430b_present, 1)); + HANDLE_CODE(bref.pack(mac_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(meas_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(pdcp_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(rf_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(laa_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(lwa_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(lwip_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(mmtel_params_r14_present, 1)); + HANDLE_CODE(bref.pack(mob_params_r14_present, 1)); + HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1430_present, 1)); + HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1430_present, 1)); + HANDLE_CODE(bref.pack(mbms_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(sl_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(ue_based_netw_perf_meas_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(high_speed_enh_params_r14_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(phy_layer_params_v1430.pack(bref)); + if (ue_category_ul_v1430_present) { + HANDLE_CODE(ue_category_ul_v1430.pack(bref)); } if (mac_params_v1430_present) { HANDLE_CODE(mac_params_v1430.pack(bref)); @@ -11199,41 +10901,6 @@ uint8_t ue_eutra_cap_v1430_ies_s::ue_category_ul_v1430_opts::to_number() const return map_enum_number(options, 6, value, "ue_eutra_cap_v1430_ies_s::ue_category_ul_v1430_e_"); } -// UE-EUTRA-Capability-v14a0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v14a0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - HANDLE_CODE(phy_layer_params_v14a0.pack(bref)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v14a0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - HANDLE_CODE(phy_layer_params_v14a0.unpack(bref)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v14a0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("phyLayerParameters-v14a0"); - phy_layer_params_v14a0.to_json(j); - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // CE-Parameters-v1350 ::= SEQUENCE SRSASN_CODE ce_params_v1350_s::pack(bit_ref& bref) const { @@ -11299,66 +10966,44 @@ void ue_eutra_cap_v1360_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v1470-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1470_ies_s::pack(bit_ref& bref) const +// UE-EUTRA-Capability-v1350-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1350_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(mbms_params_v1470_present, 1)); - HANDLE_CODE(bref.pack(phy_layer_params_v1470_present, 1)); - HANDLE_CODE(bref.pack(rf_params_v1470_present, 1)); + HANDLE_CODE(bref.pack(ue_category_dl_v1350_present, 1)); + HANDLE_CODE(bref.pack(ue_category_ul_v1350_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - if (mbms_params_v1470_present) { - HANDLE_CODE(mbms_params_v1470.pack(bref)); - } - if (phy_layer_params_v1470_present) { - HANDLE_CODE(phy_layer_params_v1470.pack(bref)); - } - if (rf_params_v1470_present) { - HANDLE_CODE(rf_params_v1470.pack(bref)); - } + HANDLE_CODE(ce_params_v1350.pack(bref)); if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE ue_eutra_cap_v1470_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE ue_eutra_cap_v1350_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(mbms_params_v1470_present, 1)); - HANDLE_CODE(bref.unpack(phy_layer_params_v1470_present, 1)); - HANDLE_CODE(bref.unpack(rf_params_v1470_present, 1)); + HANDLE_CODE(bref.unpack(ue_category_dl_v1350_present, 1)); + HANDLE_CODE(bref.unpack(ue_category_ul_v1350_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - if (mbms_params_v1470_present) { - HANDLE_CODE(mbms_params_v1470.unpack(bref)); - } - if (phy_layer_params_v1470_present) { - HANDLE_CODE(phy_layer_params_v1470.unpack(bref)); - } - if (rf_params_v1470_present) { - HANDLE_CODE(rf_params_v1470.unpack(bref)); - } + HANDLE_CODE(ce_params_v1350.unpack(bref)); if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.unpack(bref)); } return SRSASN_SUCCESS; } -void ue_eutra_cap_v1470_ies_s::to_json(json_writer& j) const +void ue_eutra_cap_v1350_ies_s::to_json(json_writer& j) const { j.start_obj(); - if (mbms_params_v1470_present) { - j.write_fieldname("mbms-Parameters-v1470"); - mbms_params_v1470.to_json(j); - } - if (phy_layer_params_v1470_present) { - j.write_fieldname("phyLayerParameters-v1470"); - phy_layer_params_v1470.to_json(j); + if (ue_category_dl_v1350_present) { + j.write_str("ue-CategoryDL-v1350", "oneBis"); } - if (rf_params_v1470_present) { - j.write_fieldname("rf-Parameters-v1470"); - rf_params_v1470.to_json(j); + if (ue_category_ul_v1350_present) { + j.write_str("ue-CategoryUL-v1350", "oneBis"); } + j.write_fieldname("ce-Parameters-v1350"); + ce_params_v1350.to_json(j); if (non_crit_ext_present) { j.write_fieldname("nonCriticalExtension"); non_crit_ext.to_json(j); @@ -11366,66 +11011,78 @@ void ue_eutra_cap_v1470_ies_s::to_json(json_writer& j) const j.end_obj(); } -// CE-Parameters-v1380 ::= SEQUENCE -SRSASN_CODE ce_params_v1380_s::pack(bit_ref& bref) const +// SCPTM-Parameters-r13 ::= SEQUENCE +SRSASN_CODE scptm_params_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(tm6_ce_mode_a_r13_present, 1)); + HANDLE_CODE(bref.pack(scptm_parallel_reception_r13_present, 1)); + HANDLE_CODE(bref.pack(scptm_scell_r13_present, 1)); + HANDLE_CODE(bref.pack(scptm_non_serving_cell_r13_present, 1)); + HANDLE_CODE(bref.pack(scptm_async_dc_r13_present, 1)); return SRSASN_SUCCESS; } -SRSASN_CODE ce_params_v1380_s::unpack(cbit_ref& bref) +SRSASN_CODE scptm_params_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(tm6_ce_mode_a_r13_present, 1)); + HANDLE_CODE(bref.unpack(scptm_parallel_reception_r13_present, 1)); + HANDLE_CODE(bref.unpack(scptm_scell_r13_present, 1)); + HANDLE_CODE(bref.unpack(scptm_non_serving_cell_r13_present, 1)); + HANDLE_CODE(bref.unpack(scptm_async_dc_r13_present, 1)); return SRSASN_SUCCESS; } -void ce_params_v1380_s::to_json(json_writer& j) const +void scptm_params_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (tm6_ce_mode_a_r13_present) { - j.write_str("tm6-CE-ModeA-r13", "supported"); + if (scptm_parallel_reception_r13_present) { + j.write_str("scptm-ParallelReception-r13", "supported"); + } + if (scptm_scell_r13_present) { + j.write_str("scptm-SCell-r13", "supported"); + } + if (scptm_non_serving_cell_r13_present) { + j.write_str("scptm-NonServingCell-r13", "supported"); + } + if (scptm_async_dc_r13_present) { + j.write_str("scptm-AsyncDC-r13", "supported"); } j.end_obj(); } -// UE-EUTRA-Capability-v1350-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1350_ies_s::pack(bit_ref& bref) const +// UE-EUTRA-Capability-v1340-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1340_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(ue_category_dl_v1350_present, 1)); - HANDLE_CODE(bref.pack(ue_category_ul_v1350_present, 1)); + HANDLE_CODE(bref.pack(ue_category_ul_v1340_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - HANDLE_CODE(ce_params_v1350.pack(bref)); + if (ue_category_ul_v1340_present) { + HANDLE_CODE(pack_integer(bref, ue_category_ul_v1340, (uint8_t)15u, (uint8_t)15u)); + } if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE ue_eutra_cap_v1350_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE ue_eutra_cap_v1340_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(ue_category_dl_v1350_present, 1)); - HANDLE_CODE(bref.unpack(ue_category_ul_v1350_present, 1)); + HANDLE_CODE(bref.unpack(ue_category_ul_v1340_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(ce_params_v1350.unpack(bref)); + if (ue_category_ul_v1340_present) { + HANDLE_CODE(unpack_integer(ue_category_ul_v1340, bref, (uint8_t)15u, (uint8_t)15u)); + } if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.unpack(bref)); } return SRSASN_SUCCESS; } -void ue_eutra_cap_v1350_ies_s::to_json(json_writer& j) const +void ue_eutra_cap_v1340_ies_s::to_json(json_writer& j) const { j.start_obj(); - if (ue_category_dl_v1350_present) { - j.write_str("ue-CategoryDL-v1350", "oneBis"); - } - if (ue_category_ul_v1350_present) { - j.write_str("ue-CategoryUL-v1350", "oneBis"); + if (ue_category_ul_v1340_present) { + j.write_int("ue-CategoryUL-v1340", ue_category_ul_v1340); } - j.write_fieldname("ce-Parameters-v1350"); - ce_params_v1350.to_json(j); if (non_crit_ext_present) { j.write_fieldname("nonCriticalExtension"); non_crit_ext.to_json(j); @@ -11433,220 +11090,8 @@ void ue_eutra_cap_v1350_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v13e0a-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v13e0a_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v13e0a_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v13e0a_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// CE-Parameters-v1370 ::= SEQUENCE -SRSASN_CODE ce_params_v1370_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(tm9_ce_mode_a_r13_present, 1)); - HANDLE_CODE(bref.pack(tm9_ce_mode_b_r13_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE ce_params_v1370_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(tm9_ce_mode_a_r13_present, 1)); - HANDLE_CODE(bref.unpack(tm9_ce_mode_b_r13_present, 1)); - - return SRSASN_SUCCESS; -} -void ce_params_v1370_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (tm9_ce_mode_a_r13_present) { - j.write_str("tm9-CE-ModeA-r13", "supported"); - } - if (tm9_ce_mode_b_r13_present) { - j.write_str("tm9-CE-ModeB-r13", "supported"); - } - j.end_obj(); -} - -// SCPTM-Parameters-r13 ::= SEQUENCE -SRSASN_CODE scptm_params_r13_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(scptm_parallel_reception_r13_present, 1)); - HANDLE_CODE(bref.pack(scptm_scell_r13_present, 1)); - HANDLE_CODE(bref.pack(scptm_non_serving_cell_r13_present, 1)); - HANDLE_CODE(bref.pack(scptm_async_dc_r13_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE scptm_params_r13_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(scptm_parallel_reception_r13_present, 1)); - HANDLE_CODE(bref.unpack(scptm_scell_r13_present, 1)); - HANDLE_CODE(bref.unpack(scptm_non_serving_cell_r13_present, 1)); - HANDLE_CODE(bref.unpack(scptm_async_dc_r13_present, 1)); - - return SRSASN_SUCCESS; -} -void scptm_params_r13_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (scptm_parallel_reception_r13_present) { - j.write_str("scptm-ParallelReception-r13", "supported"); - } - if (scptm_scell_r13_present) { - j.write_str("scptm-SCell-r13", "supported"); - } - if (scptm_non_serving_cell_r13_present) { - j.write_str("scptm-NonServingCell-r13", "supported"); - } - if (scptm_async_dc_r13_present) { - j.write_str("scptm-AsyncDC-r13", "supported"); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v1340-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1340_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ue_category_ul_v1340_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (ue_category_ul_v1340_present) { - HANDLE_CODE(pack_integer(bref, ue_category_ul_v1340, (uint8_t)15u, (uint8_t)15u)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v1340_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(ue_category_ul_v1340_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (ue_category_ul_v1340_present) { - HANDLE_CODE(unpack_integer(ue_category_ul_v1340, bref, (uint8_t)15u, (uint8_t)15u)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v1340_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (ue_category_ul_v1340_present) { - j.write_int("ue-CategoryUL-v1340", ue_category_ul_v1340); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v1390-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1390_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rf_params_v1390_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rf_params_v1390_present) { - HANDLE_CODE(rf_params_v1390.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v1390_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rf_params_v1390_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rf_params_v1390_present) { - HANDLE_CODE(rf_params_v1390.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v1390_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rf_params_v1390_present) { - j.write_fieldname("rf-Parameters-v1390"); - rf_params_v1390.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// UE-EUTRA-CapabilityAddXDD-Mode-v1380 ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1380_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(ce_params_v1380.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1380_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(ce_params_v1380.unpack(bref)); - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_add_xdd_mode_v1380_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("ce-Parameters-v1380"); - ce_params_v1380.to_json(j); - j.end_obj(); -} - -// CE-Parameters-v1320 ::= SEQUENCE -SRSASN_CODE ce_params_v1320_s::pack(bit_ref& bref) const +// CE-Parameters-v1320 ::= SEQUENCE +SRSASN_CODE ce_params_v1320_s::pack(bit_ref& bref) const { HANDLE_CODE(bref.pack(intra_freq_a3_ce_mode_a_r13_present, 1)); HANDLE_CODE(bref.pack(intra_freq_a3_ce_mode_b_r13_present, 1)); @@ -11870,96 +11315,41 @@ void ue_eutra_cap_v1330_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v1380-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1380_ies_s::pack(bit_ref& bref) const +// UE-EUTRA-CapabilityAddXDD-Mode-v1320 ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1320_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(rf_params_v1380_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_v1320_present, 1)); + HANDLE_CODE(bref.pack(scptm_params_r13_present, 1)); - if (rf_params_v1380_present) { - HANDLE_CODE(rf_params_v1380.pack(bref)); + if (phy_layer_params_v1320_present) { + HANDLE_CODE(phy_layer_params_v1320.pack(bref)); } - HANDLE_CODE(ce_params_v1380.pack(bref)); - HANDLE_CODE(fdd_add_ue_eutra_cap_v1380.pack(bref)); - HANDLE_CODE(tdd_add_ue_eutra_cap_v1380.pack(bref)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (scptm_params_r13_present) { + HANDLE_CODE(scptm_params_r13.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE ue_eutra_cap_v1380_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1320_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(rf_params_v1380_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(phy_layer_params_v1320_present, 1)); + HANDLE_CODE(bref.unpack(scptm_params_r13_present, 1)); - if (rf_params_v1380_present) { - HANDLE_CODE(rf_params_v1380.unpack(bref)); + if (phy_layer_params_v1320_present) { + HANDLE_CODE(phy_layer_params_v1320.unpack(bref)); } - HANDLE_CODE(ce_params_v1380.unpack(bref)); - HANDLE_CODE(fdd_add_ue_eutra_cap_v1380.unpack(bref)); - HANDLE_CODE(tdd_add_ue_eutra_cap_v1380.unpack(bref)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (scptm_params_r13_present) { + HANDLE_CODE(scptm_params_r13.unpack(bref)); } return SRSASN_SUCCESS; } -void ue_eutra_cap_v1380_ies_s::to_json(json_writer& j) const +void ue_eutra_cap_add_xdd_mode_v1320_s::to_json(json_writer& j) const { j.start_obj(); - if (rf_params_v1380_present) { - j.write_fieldname("rf-Parameters-v1380"); - rf_params_v1380.to_json(j); - } - j.write_fieldname("ce-Parameters-v1380"); - ce_params_v1380.to_json(j); - j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1380"); - fdd_add_ue_eutra_cap_v1380.to_json(j); - j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1380"); - tdd_add_ue_eutra_cap_v1380.to_json(j); - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// UE-EUTRA-CapabilityAddXDD-Mode-v1320 ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1320_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(phy_layer_params_v1320_present, 1)); - HANDLE_CODE(bref.pack(scptm_params_r13_present, 1)); - - if (phy_layer_params_v1320_present) { - HANDLE_CODE(phy_layer_params_v1320.pack(bref)); - } - if (scptm_params_r13_present) { - HANDLE_CODE(scptm_params_r13.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1320_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(phy_layer_params_v1320_present, 1)); - HANDLE_CODE(bref.unpack(scptm_params_r13_present, 1)); - - if (phy_layer_params_v1320_present) { - HANDLE_CODE(phy_layer_params_v1320.unpack(bref)); - } - if (scptm_params_r13_present) { - HANDLE_CODE(scptm_params_r13.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_add_xdd_mode_v1320_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (phy_layer_params_v1320_present) { - j.write_fieldname("phyLayerParameters-v1320"); - phy_layer_params_v1320.to_json(j); + if (phy_layer_params_v1320_present) { + j.write_fieldname("phyLayerParameters-v1320"); + phy_layer_params_v1320.to_json(j); } if (scptm_params_r13_present) { j.write_fieldname("scptm-Parameters-r13"); @@ -11968,37 +11358,6 @@ void ue_eutra_cap_add_xdd_mode_v1320_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-CapabilityAddXDD-Mode-v1370 ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1370_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ce_params_v1370_present, 1)); - - if (ce_params_v1370_present) { - HANDLE_CODE(ce_params_v1370.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1370_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(ce_params_v1370_present, 1)); - - if (ce_params_v1370_present) { - HANDLE_CODE(ce_params_v1370.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_add_xdd_mode_v1370_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (ce_params_v1370_present) { - j.write_fieldname("ce-Parameters-v1370"); - ce_params_v1370.to_json(j); - } - j.end_obj(); -} - // CE-Parameters-r13 ::= SEQUENCE SRSASN_CODE ce_params_r13_s::pack(bit_ref& bref) const { @@ -12423,73 +11782,6 @@ void ue_eutra_cap_v1320_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v1370-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1370_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ce_params_v1370_present, 1)); - HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1370_present, 1)); - HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1370_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (ce_params_v1370_present) { - HANDLE_CODE(ce_params_v1370.pack(bref)); - } - if (fdd_add_ue_eutra_cap_v1370_present) { - HANDLE_CODE(fdd_add_ue_eutra_cap_v1370.pack(bref)); - } - if (tdd_add_ue_eutra_cap_v1370_present) { - HANDLE_CODE(tdd_add_ue_eutra_cap_v1370.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v1370_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(ce_params_v1370_present, 1)); - HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1370_present, 1)); - HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1370_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (ce_params_v1370_present) { - HANDLE_CODE(ce_params_v1370.unpack(bref)); - } - if (fdd_add_ue_eutra_cap_v1370_present) { - HANDLE_CODE(fdd_add_ue_eutra_cap_v1370.unpack(bref)); - } - if (tdd_add_ue_eutra_cap_v1370_present) { - HANDLE_CODE(tdd_add_ue_eutra_cap_v1370.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v1370_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (ce_params_v1370_present) { - j.write_fieldname("ce-Parameters-v1370"); - ce_params_v1370.to_json(j); - } - if (fdd_add_ue_eutra_cap_v1370_present) { - j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1370"); - fdd_add_ue_eutra_cap_v1370.to_json(j); - } - if (tdd_add_ue_eutra_cap_v1370_present) { - j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1370"); - tdd_add_ue_eutra_cap_v1370.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // UE-EUTRA-CapabilityAddXDD-Mode-v1310 ::= SEQUENCE SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1310_s::pack(bit_ref& bref) const { @@ -12565,70 +11857,6 @@ void phy_layer_params_v1280_s::to_json(json_writer& j) const j.end_obj(); } -// RF-Parameters-v12b0 ::= SEQUENCE -SRSASN_CODE rf_params_v12b0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(max_layers_mimo_ind_r12_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rf_params_v12b0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(max_layers_mimo_ind_r12_present, 1)); - - return SRSASN_SUCCESS; -} -void rf_params_v12b0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (max_layers_mimo_ind_r12_present) { - j.write_str("maxLayersMIMO-Indication-r12", "supported"); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v12x0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v12x0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v12x0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v12x0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // UE-EUTRA-Capability-v1310-IEs ::= SEQUENCE SRSASN_CODE ue_eutra_cap_v1310_ies_s::pack(bit_ref& bref) const { @@ -12911,49 +12139,6 @@ void ue_eutra_cap_v1280_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v12b0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v12b0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rf_params_v12b0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rf_params_v12b0_present) { - HANDLE_CODE(rf_params_v12b0.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v12b0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rf_params_v12b0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rf_params_v12b0_present) { - HANDLE_CODE(rf_params_v12b0.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v12b0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rf_params_v12b0_present) { - j.write_fieldname("rf-Parameters-v12b0"); - rf_params_v12b0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // MeasParameters-v1250 ::= SEQUENCE SRSASN_CODE meas_params_v1250_s::pack(bit_ref& bref) const { @@ -13016,92 +12201,6 @@ void meas_params_v1250_s::to_json(json_writer& j) const j.end_obj(); } -// Other-Parameters-v11d0 ::= SEQUENCE -SRSASN_CODE other_params_v11d0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(in_dev_coex_ind_ul_ca_r11_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE other_params_v11d0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(in_dev_coex_ind_ul_ca_r11_present, 1)); - - return SRSASN_SUCCESS; -} -void other_params_v11d0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (in_dev_coex_ind_ul_ca_r11_present) { - j.write_str("inDeviceCoexInd-UL-CA-r11", "supported"); - } - j.end_obj(); -} - -// RF-Parameters-v10j0 ::= SEQUENCE -SRSASN_CODE rf_params_v10j0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(multi_ns_pmax_r10_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rf_params_v10j0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(multi_ns_pmax_r10_present, 1)); - - return SRSASN_SUCCESS; -} -void rf_params_v10j0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (multi_ns_pmax_r10_present) { - j.write_str("multiNS-Pmax-r10", "supported"); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v11x0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v11x0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v11x0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v11x0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // UE-EUTRA-Capability-v1270-IEs ::= SEQUENCE SRSASN_CODE ue_eutra_cap_v1270_ies_s::pack(bit_ref& bref) const { @@ -13253,99 +12352,6 @@ void ue_based_netw_perf_meas_params_v1250_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v10j0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v10j0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rf_params_v10j0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rf_params_v10j0_present) { - HANDLE_CODE(rf_params_v10j0.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v10j0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rf_params_v10j0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rf_params_v10j0_present) { - HANDLE_CODE(rf_params_v10j0.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v10j0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rf_params_v10j0_present) { - j.write_fieldname("rf-Parameters-v10j0"); - rf_params_v10j0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v11d0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v11d0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rf_params_v11d0_present, 1)); - HANDLE_CODE(bref.pack(other_params_v11d0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rf_params_v11d0_present) { - HANDLE_CODE(rf_params_v11d0.pack(bref)); - } - if (other_params_v11d0_present) { - HANDLE_CODE(other_params_v11d0.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v11d0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rf_params_v11d0_present, 1)); - HANDLE_CODE(bref.unpack(other_params_v11d0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rf_params_v11d0_present) { - HANDLE_CODE(rf_params_v11d0.unpack(bref)); - } - if (other_params_v11d0_present) { - HANDLE_CODE(other_params_v11d0.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v11d0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rf_params_v11d0_present) { - j.write_fieldname("rf-Parameters-v11d0"); - rf_params_v11d0.to_json(j); - } - if (other_params_v11d0_present) { - j.write_fieldname("otherParameters-v11d0"); - other_params_v11d0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // UE-EUTRA-Capability-v1260-IEs ::= SEQUENCE SRSASN_CODE ue_eutra_cap_v1260_ies_s::pack(bit_ref& bref) const { @@ -13507,129 +12513,45 @@ void meas_params_v11a0_s::to_json(json_writer& j) const j.end_obj(); } -// RF-Parameters-v10f0 ::= SEQUENCE -SRSASN_CODE rf_params_v10f0_s::pack(bit_ref& bref) const +// UE-EUTRA-Capability-v1250-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1250_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(modified_mpr_behavior_r10_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_v1250_present, 1)); + HANDLE_CODE(bref.pack(rf_params_v1250_present, 1)); + HANDLE_CODE(bref.pack(rlc_params_r12_present, 1)); + HANDLE_CODE(bref.pack(ue_based_netw_perf_meas_params_v1250_present, 1)); + HANDLE_CODE(bref.pack(ue_category_dl_r12_present, 1)); + HANDLE_CODE(bref.pack(ue_category_ul_r12_present, 1)); + HANDLE_CODE(bref.pack(wlan_iw_params_r12_present, 1)); + HANDLE_CODE(bref.pack(meas_params_v1250_present, 1)); + HANDLE_CODE(bref.pack(dc_params_r12_present, 1)); + HANDLE_CODE(bref.pack(mbms_params_v1250_present, 1)); + HANDLE_CODE(bref.pack(mac_params_r12_present, 1)); + HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1250_present, 1)); + HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1250_present, 1)); + HANDLE_CODE(bref.pack(sl_params_r12_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - if (modified_mpr_behavior_r10_present) { - HANDLE_CODE(modified_mpr_behavior_r10.pack(bref)); + if (phy_layer_params_v1250_present) { + HANDLE_CODE(phy_layer_params_v1250.pack(bref)); } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rf_params_v10f0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(modified_mpr_behavior_r10_present, 1)); - - if (modified_mpr_behavior_r10_present) { - HANDLE_CODE(modified_mpr_behavior_r10.unpack(bref)); + if (rf_params_v1250_present) { + HANDLE_CODE(rf_params_v1250.pack(bref)); } - - return SRSASN_SUCCESS; -} -void rf_params_v10f0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (modified_mpr_behavior_r10_present) { - j.write_str("modifiedMPR-Behavior-r10", modified_mpr_behavior_r10.to_string()); + if (rlc_params_r12_present) { + HANDLE_CODE(rlc_params_r12.pack(bref)); } - j.end_obj(); -} - -// UE-EUTRA-Capability-v10i0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v10i0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rf_params_v10i0_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rf_params_v10i0_present) { - HANDLE_CODE(rf_params_v10i0.pack(bref)); + if (ue_based_netw_perf_meas_params_v1250_present) { + HANDLE_CODE(ue_based_netw_perf_meas_params_v1250.pack(bref)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (ue_category_dl_r12_present) { + HANDLE_CODE(pack_integer(bref, ue_category_dl_r12, (uint8_t)0u, (uint8_t)14u)); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (ue_category_ul_r12_present) { + HANDLE_CODE(pack_integer(bref, ue_category_ul_r12, (uint8_t)0u, (uint8_t)13u)); } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v10i0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rf_params_v10i0_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rf_params_v10i0_present) { - HANDLE_CODE(rf_params_v10i0.unpack(bref)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v10i0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rf_params_v10i0_present) { - j.write_fieldname("rf-Parameters-v10i0"); - rf_params_v10i0.to_json(j); - } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v1250-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1250_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(phy_layer_params_v1250_present, 1)); - HANDLE_CODE(bref.pack(rf_params_v1250_present, 1)); - HANDLE_CODE(bref.pack(rlc_params_r12_present, 1)); - HANDLE_CODE(bref.pack(ue_based_netw_perf_meas_params_v1250_present, 1)); - HANDLE_CODE(bref.pack(ue_category_dl_r12_present, 1)); - HANDLE_CODE(bref.pack(ue_category_ul_r12_present, 1)); - HANDLE_CODE(bref.pack(wlan_iw_params_r12_present, 1)); - HANDLE_CODE(bref.pack(meas_params_v1250_present, 1)); - HANDLE_CODE(bref.pack(dc_params_r12_present, 1)); - HANDLE_CODE(bref.pack(mbms_params_v1250_present, 1)); - HANDLE_CODE(bref.pack(mac_params_r12_present, 1)); - HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1250_present, 1)); - HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1250_present, 1)); - HANDLE_CODE(bref.pack(sl_params_r12_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (phy_layer_params_v1250_present) { - HANDLE_CODE(phy_layer_params_v1250.pack(bref)); - } - if (rf_params_v1250_present) { - HANDLE_CODE(rf_params_v1250.pack(bref)); - } - if (rlc_params_r12_present) { - HANDLE_CODE(rlc_params_r12.pack(bref)); - } - if (ue_based_netw_perf_meas_params_v1250_present) { - HANDLE_CODE(ue_based_netw_perf_meas_params_v1250.pack(bref)); - } - if (ue_category_dl_r12_present) { - HANDLE_CODE(pack_integer(bref, ue_category_dl_r12, (uint8_t)0u, (uint8_t)14u)); - } - if (ue_category_ul_r12_present) { - HANDLE_CODE(pack_integer(bref, ue_category_ul_r12, (uint8_t)0u, (uint8_t)13u)); - } - if (wlan_iw_params_r12_present) { - HANDLE_CODE(wlan_iw_params_r12.pack(bref)); + if (wlan_iw_params_r12_present) { + HANDLE_CODE(wlan_iw_params_r12.pack(bref)); } if (meas_params_v1250_present) { HANDLE_CODE(meas_params_v1250.pack(bref)); @@ -13788,72 +12710,6 @@ void ue_eutra_cap_v1250_ies_s::to_json(json_writer& j) const j.end_obj(); } -// OTDOA-PositioningCapabilities-r10 ::= SEQUENCE -SRSASN_CODE otdoa_positioning_cap_r10_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(inter_freq_rstd_meas_r10_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE otdoa_positioning_cap_r10_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(inter_freq_rstd_meas_r10_present, 1)); - - return SRSASN_SUCCESS; -} -void otdoa_positioning_cap_r10_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("otdoa-UE-Assisted-r10", "supported"); - if (inter_freq_rstd_meas_r10_present) { - j.write_str("interFreqRSTD-Measurement-r10", "supported"); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v10f0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v10f0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rf_params_v10f0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rf_params_v10f0_present) { - HANDLE_CODE(rf_params_v10f0.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v10f0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rf_params_v10f0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rf_params_v10f0_present) { - HANDLE_CODE(rf_params_v10f0.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v10f0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rf_params_v10f0_present) { - j.write_fieldname("rf-Parameters-v10f0"); - rf_params_v10f0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // UE-EUTRA-Capability-v11a0-IEs ::= SEQUENCE SRSASN_CODE ue_eutra_cap_v11a0_ies_s::pack(bit_ref& bref) const { @@ -13929,22 +12785,6 @@ void ue_eutra_cap_add_xdd_mode_v1180_s::to_json(json_writer& j) const j.end_obj(); } -// IRAT-ParametersUTRA-v9h0 ::= SEQUENCE -SRSASN_CODE irat_params_utra_v9h0_s::pack(bit_ref& bref) const -{ - return SRSASN_SUCCESS; -} -SRSASN_CODE irat_params_utra_v9h0_s::unpack(cbit_ref& bref) -{ - return SRSASN_SUCCESS; -} -void irat_params_utra_v9h0_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("mfbi-UTRA-r9", "supported"); - j.end_obj(); -} - // MeasParameters-v1130 ::= SEQUENCE SRSASN_CODE meas_params_v1130_s::pack(bit_ref& bref) const { @@ -14081,49 +12921,6 @@ void phy_layer_params_v1170_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v10c0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v10c0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(otdoa_positioning_cap_r10_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (otdoa_positioning_cap_r10_present) { - HANDLE_CODE(otdoa_positioning_cap_r10.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v10c0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(otdoa_positioning_cap_r10_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (otdoa_positioning_cap_r10_present) { - HANDLE_CODE(otdoa_positioning_cap_r10.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v10c0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (otdoa_positioning_cap_r10_present) { - j.write_fieldname("otdoa-PositioningCapabilities-r10"); - otdoa_positioning_cap_r10.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // UE-EUTRA-Capability-v1180-IEs ::= SEQUENCE SRSASN_CODE ue_eutra_cap_v1180_ies_s::pack(bit_ref& bref) const { @@ -14306,60 +13103,6 @@ void ue_eutra_cap_v1170_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v9h0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v9h0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(inter_rat_params_utra_v9h0_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (inter_rat_params_utra_v9h0_present) { - HANDLE_CODE(inter_rat_params_utra_v9h0.pack(bref)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v9h0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(inter_rat_params_utra_v9h0_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (inter_rat_params_utra_v9h0_present) { - HANDLE_CODE(inter_rat_params_utra_v9h0.unpack(bref)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v9h0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (inter_rat_params_utra_v9h0_present) { - j.write_fieldname("interRAT-ParametersUTRA-v9h0"); - inter_rat_params_utra_v9h0.to_json(j); - } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // UE-EUTRA-CapabilityAddXDD-Mode-v1130 ::= SEQUENCE SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1130_s::pack(bit_ref& bref) const { @@ -14449,29 +13192,25 @@ void irat_params_utra_tdd_v1020_s::to_json(json_writer& j) const j.end_obj(); } -// PhyLayerParameters-v9d0 ::= SEQUENCE -SRSASN_CODE phy_layer_params_v9d0_s::pack(bit_ref& bref) const +// OTDOA-PositioningCapabilities-r10 ::= SEQUENCE +SRSASN_CODE otdoa_positioning_cap_r10_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(tm5_fdd_r9_present, 1)); - HANDLE_CODE(bref.pack(tm5_tdd_r9_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_rstd_meas_r10_present, 1)); return SRSASN_SUCCESS; } -SRSASN_CODE phy_layer_params_v9d0_s::unpack(cbit_ref& bref) +SRSASN_CODE otdoa_positioning_cap_r10_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(tm5_fdd_r9_present, 1)); - HANDLE_CODE(bref.unpack(tm5_tdd_r9_present, 1)); + HANDLE_CODE(bref.unpack(inter_freq_rstd_meas_r10_present, 1)); return SRSASN_SUCCESS; } -void phy_layer_params_v9d0_s::to_json(json_writer& j) const +void otdoa_positioning_cap_r10_s::to_json(json_writer& j) const { j.start_obj(); - if (tm5_fdd_r9_present) { - j.write_str("tm5-FDD-r9", "supported"); - } - if (tm5_tdd_r9_present) { - j.write_str("tm5-TDD-r9", "supported"); + j.write_str("otdoa-UE-Assisted-r10", "supported"); + if (inter_freq_rstd_meas_r10_present) { + j.write_str("interFreqRSTD-Measurement-r10", "supported"); } j.end_obj(); } @@ -14563,190 +13302,6 @@ void ue_eutra_cap_v1130_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v9e0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v9e0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rf_params_v9e0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rf_params_v9e0_present) { - HANDLE_CODE(rf_params_v9e0.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v9e0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rf_params_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rf_params_v9e0_present) { - HANDLE_CODE(rf_params_v9e0.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v9e0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rf_params_v9e0_present) { - j.write_fieldname("rf-Parameters-v9e0"); - rf_params_v9e0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// IRAT-ParametersCDMA2000-1XRTT-v920 ::= SEQUENCE -SRSASN_CODE irat_params_cdma2000_minus1_xrtt_v920_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(e_csfb_conc_ps_mob1_xrtt_r9_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE irat_params_cdma2000_minus1_xrtt_v920_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(e_csfb_conc_ps_mob1_xrtt_r9_present, 1)); - - return SRSASN_SUCCESS; -} -void irat_params_cdma2000_minus1_xrtt_v920_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("e-CSFB-1XRTT-r9", "supported"); - if (e_csfb_conc_ps_mob1_xrtt_r9_present) { - j.write_str("e-CSFB-ConcPS-Mob1XRTT-r9", "supported"); - } - j.end_obj(); -} - -// IRAT-ParametersUTRA-v920 ::= SEQUENCE -SRSASN_CODE irat_params_utra_v920_s::pack(bit_ref& bref) const -{ - return SRSASN_SUCCESS; -} -SRSASN_CODE irat_params_utra_v920_s::unpack(cbit_ref& bref) -{ - return SRSASN_SUCCESS; -} -void irat_params_utra_v920_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("e-RedirectionUTRA-r9", "supported"); - j.end_obj(); -} - -// IRAT-ParametersUTRA-v9c0 ::= SEQUENCE -SRSASN_CODE irat_params_utra_v9c0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(voice_over_ps_hs_utra_fdd_r9_present, 1)); - HANDLE_CODE(bref.pack(voice_over_ps_hs_utra_tdd128_r9_present, 1)); - HANDLE_CODE(bref.pack(srvcc_from_utra_fdd_to_utra_fdd_r9_present, 1)); - HANDLE_CODE(bref.pack(srvcc_from_utra_fdd_to_geran_r9_present, 1)); - HANDLE_CODE(bref.pack(srvcc_from_utra_tdd128_to_utra_tdd128_r9_present, 1)); - HANDLE_CODE(bref.pack(srvcc_from_utra_tdd128_to_geran_r9_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE irat_params_utra_v9c0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(voice_over_ps_hs_utra_fdd_r9_present, 1)); - HANDLE_CODE(bref.unpack(voice_over_ps_hs_utra_tdd128_r9_present, 1)); - HANDLE_CODE(bref.unpack(srvcc_from_utra_fdd_to_utra_fdd_r9_present, 1)); - HANDLE_CODE(bref.unpack(srvcc_from_utra_fdd_to_geran_r9_present, 1)); - HANDLE_CODE(bref.unpack(srvcc_from_utra_tdd128_to_utra_tdd128_r9_present, 1)); - HANDLE_CODE(bref.unpack(srvcc_from_utra_tdd128_to_geran_r9_present, 1)); - - return SRSASN_SUCCESS; -} -void irat_params_utra_v9c0_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (voice_over_ps_hs_utra_fdd_r9_present) { - j.write_str("voiceOverPS-HS-UTRA-FDD-r9", "supported"); - } - if (voice_over_ps_hs_utra_tdd128_r9_present) { - j.write_str("voiceOverPS-HS-UTRA-TDD128-r9", "supported"); - } - if (srvcc_from_utra_fdd_to_utra_fdd_r9_present) { - j.write_str("srvcc-FromUTRA-FDD-ToUTRA-FDD-r9", "supported"); - } - if (srvcc_from_utra_fdd_to_geran_r9_present) { - j.write_str("srvcc-FromUTRA-FDD-ToGERAN-r9", "supported"); - } - if (srvcc_from_utra_tdd128_to_utra_tdd128_r9_present) { - j.write_str("srvcc-FromUTRA-TDD128-ToUTRA-TDD128-r9", "supported"); - } - if (srvcc_from_utra_tdd128_to_geran_r9_present) { - j.write_str("srvcc-FromUTRA-TDD128-ToGERAN-r9", "supported"); - } - j.end_obj(); -} - -// NeighCellSI-AcquisitionParameters-r9 ::= SEQUENCE -SRSASN_CODE neigh_cell_si_acquisition_params_r9_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(intra_freq_si_acquisition_for_ho_r9_present, 1)); - HANDLE_CODE(bref.pack(inter_freq_si_acquisition_for_ho_r9_present, 1)); - HANDLE_CODE(bref.pack(utran_si_acquisition_for_ho_r9_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE neigh_cell_si_acquisition_params_r9_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(intra_freq_si_acquisition_for_ho_r9_present, 1)); - HANDLE_CODE(bref.unpack(inter_freq_si_acquisition_for_ho_r9_present, 1)); - HANDLE_CODE(bref.unpack(utran_si_acquisition_for_ho_r9_present, 1)); - - return SRSASN_SUCCESS; -} -void neigh_cell_si_acquisition_params_r9_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (intra_freq_si_acquisition_for_ho_r9_present) { - j.write_str("intraFreqSI-AcquisitionForHO-r9", "supported"); - } - if (inter_freq_si_acquisition_for_ho_r9_present) { - j.write_str("interFreqSI-AcquisitionForHO-r9", "supported"); - } - if (utran_si_acquisition_for_ho_r9_present) { - j.write_str("utran-SI-AcquisitionForHO-r9", "supported"); - } - j.end_obj(); -} - -// PhyLayerParameters ::= SEQUENCE -SRSASN_CODE phy_layer_params_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ue_tx_ant_sel_supported, 1)); - HANDLE_CODE(bref.pack(ue_specific_ref_sigs_supported, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE phy_layer_params_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(ue_tx_ant_sel_supported, 1)); - HANDLE_CODE(bref.unpack(ue_specific_ref_sigs_supported, 1)); - - return SRSASN_SUCCESS; -} -void phy_layer_params_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_bool("ue-TxAntennaSelectionSupported", ue_tx_ant_sel_supported); - j.write_bool("ue-SpecificRefSigsSupported", ue_specific_ref_sigs_supported); - j.end_obj(); -} - // UE-EUTRA-Capability-v1090-IEs ::= SEQUENCE SRSASN_CODE ue_eutra_cap_v1090_ies_s::pack(bit_ref& bref) const { @@ -14790,49 +13345,6 @@ void ue_eutra_cap_v1090_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v9d0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v9d0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(phy_layer_params_v9d0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (phy_layer_params_v9d0_present) { - HANDLE_CODE(phy_layer_params_v9d0.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v9d0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(phy_layer_params_v9d0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (phy_layer_params_v9d0_present) { - HANDLE_CODE(phy_layer_params_v9d0.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v9d0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (phy_layer_params_v9d0_present) { - j.write_fieldname("phyLayerParameters-v9d0"); - phy_layer_params_v9d0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // UE-EUTRA-CapabilityAddXDD-Mode-v1060 ::= SEQUENCE SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1060_s::pack(bit_ref& bref) const { @@ -15030,167 +13542,21 @@ void ue_eutra_cap_v1060_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v9c0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v9c0_ies_s::pack(bit_ref& bref) const +// UE-EUTRA-Capability-v1020-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1020_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(inter_rat_params_utra_v9c0_present, 1)); + HANDLE_CODE(bref.pack(ue_category_v1020_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_v1020_present, 1)); + HANDLE_CODE(bref.pack(rf_params_v1020_present, 1)); + HANDLE_CODE(bref.pack(meas_params_v1020_present, 1)); + HANDLE_CODE(bref.pack(feature_group_ind_rel10_r10_present, 1)); + HANDLE_CODE(bref.pack(inter_rat_params_cdma2000_v1020_present, 1)); + HANDLE_CODE(bref.pack(ue_based_netw_perf_meas_params_r10_present, 1)); + HANDLE_CODE(bref.pack(inter_rat_params_utra_tdd_v1020_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - if (inter_rat_params_utra_v9c0_present) { - HANDLE_CODE(inter_rat_params_utra_v9c0.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v9c0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(inter_rat_params_utra_v9c0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (inter_rat_params_utra_v9c0_present) { - HANDLE_CODE(inter_rat_params_utra_v9c0.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v9c0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (inter_rat_params_utra_v9c0_present) { - j.write_fieldname("interRAT-ParametersUTRA-v9c0"); - inter_rat_params_utra_v9c0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// UE-EUTRA-CapabilityAddXDD-Mode-r9 ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_add_xdd_mode_r9_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(phy_layer_params_r9_present, 1)); - HANDLE_CODE(bref.pack(feature_group_inds_r9_present, 1)); - HANDLE_CODE(bref.pack(feature_group_ind_rel9_add_r9_present, 1)); - HANDLE_CODE(bref.pack(inter_rat_params_geran_r9_present, 1)); - HANDLE_CODE(bref.pack(inter_rat_params_utra_r9_present, 1)); - HANDLE_CODE(bref.pack(inter_rat_params_cdma2000_r9_present, 1)); - HANDLE_CODE(bref.pack(neigh_cell_si_acquisition_params_r9_present, 1)); - - if (phy_layer_params_r9_present) { - HANDLE_CODE(phy_layer_params_r9.pack(bref)); - } - if (feature_group_inds_r9_present) { - HANDLE_CODE(feature_group_inds_r9.pack(bref)); - } - if (feature_group_ind_rel9_add_r9_present) { - HANDLE_CODE(feature_group_ind_rel9_add_r9.pack(bref)); - } - if (inter_rat_params_geran_r9_present) { - HANDLE_CODE(inter_rat_params_geran_r9.pack(bref)); - } - if (inter_rat_params_utra_r9_present) { - HANDLE_CODE(inter_rat_params_utra_r9.pack(bref)); - } - if (inter_rat_params_cdma2000_r9_present) { - HANDLE_CODE(inter_rat_params_cdma2000_r9.pack(bref)); - } - if (neigh_cell_si_acquisition_params_r9_present) { - HANDLE_CODE(neigh_cell_si_acquisition_params_r9.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_add_xdd_mode_r9_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(phy_layer_params_r9_present, 1)); - HANDLE_CODE(bref.unpack(feature_group_inds_r9_present, 1)); - HANDLE_CODE(bref.unpack(feature_group_ind_rel9_add_r9_present, 1)); - HANDLE_CODE(bref.unpack(inter_rat_params_geran_r9_present, 1)); - HANDLE_CODE(bref.unpack(inter_rat_params_utra_r9_present, 1)); - HANDLE_CODE(bref.unpack(inter_rat_params_cdma2000_r9_present, 1)); - HANDLE_CODE(bref.unpack(neigh_cell_si_acquisition_params_r9_present, 1)); - - if (phy_layer_params_r9_present) { - HANDLE_CODE(phy_layer_params_r9.unpack(bref)); - } - if (feature_group_inds_r9_present) { - HANDLE_CODE(feature_group_inds_r9.unpack(bref)); - } - if (feature_group_ind_rel9_add_r9_present) { - HANDLE_CODE(feature_group_ind_rel9_add_r9.unpack(bref)); - } - if (inter_rat_params_geran_r9_present) { - HANDLE_CODE(inter_rat_params_geran_r9.unpack(bref)); - } - if (inter_rat_params_utra_r9_present) { - HANDLE_CODE(inter_rat_params_utra_r9.unpack(bref)); - } - if (inter_rat_params_cdma2000_r9_present) { - HANDLE_CODE(inter_rat_params_cdma2000_r9.unpack(bref)); - } - if (neigh_cell_si_acquisition_params_r9_present) { - HANDLE_CODE(neigh_cell_si_acquisition_params_r9.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_add_xdd_mode_r9_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (phy_layer_params_r9_present) { - j.write_fieldname("phyLayerParameters-r9"); - phy_layer_params_r9.to_json(j); - } - if (feature_group_inds_r9_present) { - j.write_str("featureGroupIndicators-r9", feature_group_inds_r9.to_string()); - } - if (feature_group_ind_rel9_add_r9_present) { - j.write_str("featureGroupIndRel9Add-r9", feature_group_ind_rel9_add_r9.to_string()); - } - if (inter_rat_params_geran_r9_present) { - j.write_fieldname("interRAT-ParametersGERAN-r9"); - inter_rat_params_geran_r9.to_json(j); - } - if (inter_rat_params_utra_r9_present) { - j.write_fieldname("interRAT-ParametersUTRA-r9"); - inter_rat_params_utra_r9.to_json(j); - } - if (inter_rat_params_cdma2000_r9_present) { - j.write_fieldname("interRAT-ParametersCDMA2000-r9"); - inter_rat_params_cdma2000_r9.to_json(j); - } - if (neigh_cell_si_acquisition_params_r9_present) { - j.write_fieldname("neighCellSI-AcquisitionParameters-r9"); - neigh_cell_si_acquisition_params_r9.to_json(j); - } - j.end_obj(); -} - -// UE-EUTRA-Capability-v1020-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v1020_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(ue_category_v1020_present, 1)); - HANDLE_CODE(bref.pack(phy_layer_params_v1020_present, 1)); - HANDLE_CODE(bref.pack(rf_params_v1020_present, 1)); - HANDLE_CODE(bref.pack(meas_params_v1020_present, 1)); - HANDLE_CODE(bref.pack(feature_group_ind_rel10_r10_present, 1)); - HANDLE_CODE(bref.pack(inter_rat_params_cdma2000_v1020_present, 1)); - HANDLE_CODE(bref.pack(ue_based_netw_perf_meas_params_r10_present, 1)); - HANDLE_CODE(bref.pack(inter_rat_params_utra_tdd_v1020_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (ue_category_v1020_present) { - HANDLE_CODE(pack_integer(bref, ue_category_v1020, (uint8_t)6u, (uint8_t)8u)); + if (ue_category_v1020_present) { + HANDLE_CODE(pack_integer(bref, ue_category_v1020, (uint8_t)6u, (uint8_t)8u)); } if (phy_layer_params_v1020_present) { HANDLE_CODE(phy_layer_params_v1020.pack(bref)); @@ -15301,72 +13667,6 @@ void ue_eutra_cap_v1020_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-EUTRA-Capability-v9a0-IEs ::= SEQUENCE -SRSASN_CODE ue_eutra_cap_v9a0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(feature_group_ind_rel9_add_r9_present, 1)); - HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_r9_present, 1)); - HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_r9_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (feature_group_ind_rel9_add_r9_present) { - HANDLE_CODE(feature_group_ind_rel9_add_r9.pack(bref)); - } - if (fdd_add_ue_eutra_cap_r9_present) { - HANDLE_CODE(fdd_add_ue_eutra_cap_r9.pack(bref)); - } - if (tdd_add_ue_eutra_cap_r9_present) { - HANDLE_CODE(tdd_add_ue_eutra_cap_r9.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_eutra_cap_v9a0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(feature_group_ind_rel9_add_r9_present, 1)); - HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_r9_present, 1)); - HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_r9_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (feature_group_ind_rel9_add_r9_present) { - HANDLE_CODE(feature_group_ind_rel9_add_r9.unpack(bref)); - } - if (fdd_add_ue_eutra_cap_r9_present) { - HANDLE_CODE(fdd_add_ue_eutra_cap_r9.unpack(bref)); - } - if (tdd_add_ue_eutra_cap_r9_present) { - HANDLE_CODE(tdd_add_ue_eutra_cap_r9.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_eutra_cap_v9a0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (feature_group_ind_rel9_add_r9_present) { - j.write_str("featureGroupIndRel9Add-r9", feature_group_ind_rel9_add_r9.to_string()); - } - if (fdd_add_ue_eutra_cap_r9_present) { - j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-r9"); - fdd_add_ue_eutra_cap_r9.to_json(j); - } - if (tdd_add_ue_eutra_cap_r9_present) { - j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-r9"); - tdd_add_ue_eutra_cap_r9.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - // CSG-ProximityIndicationParameters-r9 ::= SEQUENCE SRSASN_CODE csg_proximity_ind_params_r9_s::pack(bit_ref& bref) const { @@ -15399,6 +13699,29 @@ void csg_proximity_ind_params_r9_s::to_json(json_writer& j) const j.end_obj(); } +// IRAT-ParametersCDMA2000-1XRTT-v920 ::= SEQUENCE +SRSASN_CODE irat_params_cdma2000_minus1_xrtt_v920_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(e_csfb_conc_ps_mob1_xrtt_r9_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE irat_params_cdma2000_minus1_xrtt_v920_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(e_csfb_conc_ps_mob1_xrtt_r9_present, 1)); + + return SRSASN_SUCCESS; +} +void irat_params_cdma2000_minus1_xrtt_v920_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("e-CSFB-1XRTT-r9", "supported"); + if (e_csfb_conc_ps_mob1_xrtt_r9_present) { + j.write_str("e-CSFB-ConcPS-Mob1XRTT-r9", "supported"); + } + j.end_obj(); +} + // IRAT-ParametersGERAN-v920 ::= SEQUENCE SRSASN_CODE irat_params_geran_v920_s::pack(bit_ref& bref) const { @@ -15426,25 +13749,73 @@ void irat_params_geran_v920_s::to_json(json_writer& j) const j.end_obj(); } -// PhyLayerParameters-v920 ::= SEQUENCE -SRSASN_CODE phy_layer_params_v920_s::pack(bit_ref& bref) const +// IRAT-ParametersUTRA-v920 ::= SEQUENCE +SRSASN_CODE irat_params_utra_v920_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(enhanced_dual_layer_fdd_r9_present, 1)); - HANDLE_CODE(bref.pack(enhanced_dual_layer_tdd_r9_present, 1)); - return SRSASN_SUCCESS; } -SRSASN_CODE phy_layer_params_v920_s::unpack(cbit_ref& bref) +SRSASN_CODE irat_params_utra_v920_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(enhanced_dual_layer_fdd_r9_present, 1)); - HANDLE_CODE(bref.unpack(enhanced_dual_layer_tdd_r9_present, 1)); - return SRSASN_SUCCESS; } -void phy_layer_params_v920_s::to_json(json_writer& j) const +void irat_params_utra_v920_s::to_json(json_writer& j) const { j.start_obj(); - if (enhanced_dual_layer_fdd_r9_present) { + j.write_str("e-RedirectionUTRA-r9", "supported"); + j.end_obj(); +} + +// NeighCellSI-AcquisitionParameters-r9 ::= SEQUENCE +SRSASN_CODE neigh_cell_si_acquisition_params_r9_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(intra_freq_si_acquisition_for_ho_r9_present, 1)); + HANDLE_CODE(bref.pack(inter_freq_si_acquisition_for_ho_r9_present, 1)); + HANDLE_CODE(bref.pack(utran_si_acquisition_for_ho_r9_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE neigh_cell_si_acquisition_params_r9_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(intra_freq_si_acquisition_for_ho_r9_present, 1)); + HANDLE_CODE(bref.unpack(inter_freq_si_acquisition_for_ho_r9_present, 1)); + HANDLE_CODE(bref.unpack(utran_si_acquisition_for_ho_r9_present, 1)); + + return SRSASN_SUCCESS; +} +void neigh_cell_si_acquisition_params_r9_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (intra_freq_si_acquisition_for_ho_r9_present) { + j.write_str("intraFreqSI-AcquisitionForHO-r9", "supported"); + } + if (inter_freq_si_acquisition_for_ho_r9_present) { + j.write_str("interFreqSI-AcquisitionForHO-r9", "supported"); + } + if (utran_si_acquisition_for_ho_r9_present) { + j.write_str("utran-SI-AcquisitionForHO-r9", "supported"); + } + j.end_obj(); +} + +// PhyLayerParameters-v920 ::= SEQUENCE +SRSASN_CODE phy_layer_params_v920_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(enhanced_dual_layer_fdd_r9_present, 1)); + HANDLE_CODE(bref.pack(enhanced_dual_layer_tdd_r9_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE phy_layer_params_v920_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(enhanced_dual_layer_fdd_r9_present, 1)); + HANDLE_CODE(bref.unpack(enhanced_dual_layer_tdd_r9_present, 1)); + + return SRSASN_SUCCESS; +} +void phy_layer_params_v920_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (enhanced_dual_layer_fdd_r9_present) { j.write_str("enhancedDualLayerFDD-r9", "supported"); } if (enhanced_dual_layer_tdd_r9_present) { @@ -15529,6 +13900,29 @@ uint8_t access_stratum_release_opts::to_number() const return map_enum_number(options, 8, value, "access_stratum_release_e"); } +// PhyLayerParameters ::= SEQUENCE +SRSASN_CODE phy_layer_params_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(ue_tx_ant_sel_supported, 1)); + HANDLE_CODE(bref.pack(ue_specific_ref_sigs_supported, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE phy_layer_params_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(ue_tx_ant_sel_supported, 1)); + HANDLE_CODE(bref.unpack(ue_specific_ref_sigs_supported, 1)); + + return SRSASN_SUCCESS; +} +void phy_layer_params_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_bool("ue-TxAntennaSelectionSupported", ue_tx_ant_sel_supported); + j.write_bool("ue-SpecificRefSigsSupported", ue_specific_ref_sigs_supported); + j.end_obj(); +} + // UE-EUTRA-Capability-v920-IEs ::= SEQUENCE SRSASN_CODE ue_eutra_cap_v920_ies_s::pack(bit_ref& bref) const { @@ -15760,156 +14154,1584 @@ void ue_eutra_cap_s::to_json(json_writer& j) const j.end_obj(); } -// UERadioAccessCapabilityInformation-r8-IEs ::= SEQUENCE -SRSASN_CODE ue_radio_access_cap_info_r8_ies_s::pack(bit_ref& bref) const +// PhyLayerParameters-v14a0 ::= SEQUENCE +SRSASN_CODE phy_layer_params_v14a0_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - HANDLE_CODE(ue_radio_access_cap_info.pack(bref)); + HANDLE_CODE(bref.pack(ssp10_tdd_only_r14_present, 1)); return SRSASN_SUCCESS; } -SRSASN_CODE ue_radio_access_cap_info_r8_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE phy_layer_params_v14a0_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - HANDLE_CODE(ue_radio_access_cap_info.unpack(bref)); + HANDLE_CODE(bref.unpack(ssp10_tdd_only_r14_present, 1)); return SRSASN_SUCCESS; } -void ue_radio_access_cap_info_r8_ies_s::to_json(json_writer& j) const +void phy_layer_params_v14a0_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("ue-RadioAccessCapabilityInfo", ue_radio_access_cap_info.to_string()); - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); + if (ssp10_tdd_only_r14_present) { + j.write_str("ssp10-TDD-Only-r14", "supported"); } j.end_obj(); } -// UERadioAccessCapabilityInformation ::= SEQUENCE -SRSASN_CODE ue_radio_access_cap_info_s::pack(bit_ref& bref) const +// UE-EUTRA-Capability-v14b0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v14b0_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(crit_exts.pack(bref)); + HANDLE_CODE(bref.pack(rf_params_v14b0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v14b0_present) { + HANDLE_CODE(rf_params_v14b0.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE ue_radio_access_cap_info_s::unpack(cbit_ref& bref) +SRSASN_CODE ue_eutra_cap_v14b0_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(crit_exts.unpack(bref)); + HANDLE_CODE(bref.unpack(rf_params_v14b0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v14b0_present) { + HANDLE_CODE(rf_params_v14b0.unpack(bref)); + } return SRSASN_SUCCESS; } -void ue_radio_access_cap_info_s::to_json(json_writer& j) const +void ue_eutra_cap_v14b0_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); + if (rf_params_v14b0_present) { + j.write_fieldname("rf-Parameters-v14b0"); + rf_params_v14b0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } j.end_obj(); } -void ue_radio_access_cap_info_s::crit_exts_c_::destroy_() +// MBMS-Parameters-v1470 ::= SEQUENCE +SRSASN_CODE mbms_params_v1470_s::pack(bit_ref& bref) const { - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; + HANDLE_CODE(bref.pack(mbms_scaling_factor1dot25_r14_present, 1)); + HANDLE_CODE(bref.pack(mbms_scaling_factor7dot5_r14_present, 1)); + + HANDLE_CODE(mbms_max_bw_r14.pack(bref)); + if (mbms_scaling_factor1dot25_r14_present) { + HANDLE_CODE(mbms_scaling_factor1dot25_r14.pack(bref)); } -} -void ue_radio_access_cap_info_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); + if (mbms_scaling_factor7dot5_r14_present) { + HANDLE_CODE(mbms_scaling_factor7dot5_r14.pack(bref)); } + + return SRSASN_SUCCESS; } -ue_radio_access_cap_info_s::crit_exts_c_::crit_exts_c_(const ue_radio_access_cap_info_s::crit_exts_c_& other) +SRSASN_CODE mbms_params_v1470_s::unpack(cbit_ref& bref) { - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); + HANDLE_CODE(bref.unpack(mbms_scaling_factor1dot25_r14_present, 1)); + HANDLE_CODE(bref.unpack(mbms_scaling_factor7dot5_r14_present, 1)); + + HANDLE_CODE(mbms_max_bw_r14.unpack(bref)); + if (mbms_scaling_factor1dot25_r14_present) { + HANDLE_CODE(mbms_scaling_factor1dot25_r14.unpack(bref)); + } + if (mbms_scaling_factor7dot5_r14_present) { + HANDLE_CODE(mbms_scaling_factor7dot5_r14.unpack(bref)); } + + return SRSASN_SUCCESS; } -ue_radio_access_cap_info_s::crit_exts_c_& -ue_radio_access_cap_info_s::crit_exts_c_::operator=(const ue_radio_access_cap_info_s::crit_exts_c_& other) +void mbms_params_v1470_s::to_json(json_writer& j) const { - if (this == &other) { - return *this; + j.start_obj(); + j.write_fieldname("mbms-MaxBW-r14"); + mbms_max_bw_r14.to_json(j); + if (mbms_scaling_factor1dot25_r14_present) { + j.write_str("mbms-ScalingFactor1dot25-r14", mbms_scaling_factor1dot25_r14.to_string()); } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); + if (mbms_scaling_factor7dot5_r14_present) { + j.write_str("mbms-ScalingFactor7dot5-r14", mbms_scaling_factor7dot5_r14.to_string()); } + j.end_obj(); +} - return *this; +void mbms_params_v1470_s::mbms_max_bw_r14_c_::set(types::options e) +{ + type_ = e; } -void ue_radio_access_cap_info_s::crit_exts_c_::to_json(json_writer& j) const +void mbms_params_v1470_s::mbms_max_bw_r14_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); + case types::implicit_value: break; - case types::crit_exts_future: + case types::explicit_value: + j.write_int("explicitValue", c); break; default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); + log_invalid_choice_id(type_, "mbms_params_v1470_s::mbms_max_bw_r14_c_"); } j.end_obj(); } -SRSASN_CODE ue_radio_access_cap_info_s::crit_exts_c_::pack(bit_ref& bref) const +SRSASN_CODE mbms_params_v1470_s::mbms_max_bw_r14_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); + case types::implicit_value: break; - case types::crit_exts_future: + case types::explicit_value: + HANDLE_CODE(pack_integer(bref, c, (uint8_t)2u, (uint8_t)20u)); break; default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); + log_invalid_choice_id(type_, "mbms_params_v1470_s::mbms_max_bw_r14_c_"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE ue_radio_access_cap_info_s::crit_exts_c_::unpack(cbit_ref& bref) +SRSASN_CODE mbms_params_v1470_s::mbms_max_bw_r14_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + case types::implicit_value: + break; + case types::explicit_value: + HANDLE_CODE(unpack_integer(c, bref, (uint8_t)2u, (uint8_t)20u)); + break; + default: + log_invalid_choice_id(type_, "mbms_params_v1470_s::mbms_max_bw_r14_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +std::string mbms_params_v1470_s::mbms_scaling_factor1dot25_r14_opts::to_string() const +{ + static const char* options[] = {"n3", "n6", "n9", "n12"}; + return convert_enum_idx(options, 4, value, "mbms_params_v1470_s::mbms_scaling_factor1dot25_r14_e_"); +} +uint8_t mbms_params_v1470_s::mbms_scaling_factor1dot25_r14_opts::to_number() const +{ + static const uint8_t options[] = {3, 6, 9, 12}; + return map_enum_number(options, 4, value, "mbms_params_v1470_s::mbms_scaling_factor1dot25_r14_e_"); +} + +std::string mbms_params_v1470_s::mbms_scaling_factor7dot5_r14_opts::to_string() const +{ + static const char* options[] = {"n1", "n2", "n3", "n4"}; + return convert_enum_idx(options, 4, value, "mbms_params_v1470_s::mbms_scaling_factor7dot5_r14_e_"); +} +uint8_t mbms_params_v1470_s::mbms_scaling_factor7dot5_r14_opts::to_number() const +{ + static const uint8_t options[] = {1, 2, 3, 4}; + return map_enum_number(options, 4, value, "mbms_params_v1470_s::mbms_scaling_factor7dot5_r14_e_"); +} + +// UE-EUTRA-Capability-v14a0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v14a0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(phy_layer_params_v14a0.pack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v14a0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + HANDLE_CODE(phy_layer_params_v14a0.unpack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v14a0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("phyLayerParameters-v14a0"); + phy_layer_params_v14a0.to_json(j); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v1470-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1470_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(mbms_params_v1470_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_v1470_present, 1)); + HANDLE_CODE(bref.pack(rf_params_v1470_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (mbms_params_v1470_present) { + HANDLE_CODE(mbms_params_v1470.pack(bref)); + } + if (phy_layer_params_v1470_present) { + HANDLE_CODE(phy_layer_params_v1470.pack(bref)); + } + if (rf_params_v1470_present) { + HANDLE_CODE(rf_params_v1470.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v1470_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(mbms_params_v1470_present, 1)); + HANDLE_CODE(bref.unpack(phy_layer_params_v1470_present, 1)); + HANDLE_CODE(bref.unpack(rf_params_v1470_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (mbms_params_v1470_present) { + HANDLE_CODE(mbms_params_v1470.unpack(bref)); + } + if (phy_layer_params_v1470_present) { + HANDLE_CODE(phy_layer_params_v1470.unpack(bref)); + } + if (rf_params_v1470_present) { + HANDLE_CODE(rf_params_v1470.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v1470_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (mbms_params_v1470_present) { + j.write_fieldname("mbms-Parameters-v1470"); + mbms_params_v1470.to_json(j); + } + if (phy_layer_params_v1470_present) { + j.write_fieldname("phyLayerParameters-v1470"); + phy_layer_params_v1470.to_json(j); + } + if (rf_params_v1470_present) { + j.write_fieldname("rf-Parameters-v1470"); + rf_params_v1470.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// CE-Parameters-v1380 ::= SEQUENCE +SRSASN_CODE ce_params_v1380_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(tm6_ce_mode_a_r13_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ce_params_v1380_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(tm6_ce_mode_a_r13_present, 1)); + + return SRSASN_SUCCESS; +} +void ce_params_v1380_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (tm6_ce_mode_a_r13_present) { + j.write_str("tm6-CE-ModeA-r13", "supported"); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v13e0a-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v13e0a_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v13e0a_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v13e0a_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// CE-Parameters-v1370 ::= SEQUENCE +SRSASN_CODE ce_params_v1370_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(tm9_ce_mode_a_r13_present, 1)); + HANDLE_CODE(bref.pack(tm9_ce_mode_b_r13_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ce_params_v1370_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(tm9_ce_mode_a_r13_present, 1)); + HANDLE_CODE(bref.unpack(tm9_ce_mode_b_r13_present, 1)); + + return SRSASN_SUCCESS; +} +void ce_params_v1370_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (tm9_ce_mode_a_r13_present) { + j.write_str("tm9-CE-ModeA-r13", "supported"); + } + if (tm9_ce_mode_b_r13_present) { + j.write_str("tm9-CE-ModeB-r13", "supported"); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v1390-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1390_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rf_params_v1390_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v1390_present) { + HANDLE_CODE(rf_params_v1390.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v1390_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rf_params_v1390_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v1390_present) { + HANDLE_CODE(rf_params_v1390.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v1390_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rf_params_v1390_present) { + j.write_fieldname("rf-Parameters-v1390"); + rf_params_v1390.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-CapabilityAddXDD-Mode-v1380 ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1380_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(ce_params_v1380.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1380_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(ce_params_v1380.unpack(bref)); + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_add_xdd_mode_v1380_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("ce-Parameters-v1380"); + ce_params_v1380.to_json(j); + j.end_obj(); +} + +// UE-EUTRA-Capability-v1380-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1380_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rf_params_v1380_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v1380_present) { + HANDLE_CODE(rf_params_v1380.pack(bref)); + } + HANDLE_CODE(ce_params_v1380.pack(bref)); + HANDLE_CODE(fdd_add_ue_eutra_cap_v1380.pack(bref)); + HANDLE_CODE(tdd_add_ue_eutra_cap_v1380.pack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v1380_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rf_params_v1380_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v1380_present) { + HANDLE_CODE(rf_params_v1380.unpack(bref)); + } + HANDLE_CODE(ce_params_v1380.unpack(bref)); + HANDLE_CODE(fdd_add_ue_eutra_cap_v1380.unpack(bref)); + HANDLE_CODE(tdd_add_ue_eutra_cap_v1380.unpack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v1380_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rf_params_v1380_present) { + j.write_fieldname("rf-Parameters-v1380"); + rf_params_v1380.to_json(j); + } + j.write_fieldname("ce-Parameters-v1380"); + ce_params_v1380.to_json(j); + j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1380"); + fdd_add_ue_eutra_cap_v1380.to_json(j); + j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1380"); + tdd_add_ue_eutra_cap_v1380.to_json(j); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-CapabilityAddXDD-Mode-v1370 ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1370_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(ce_params_v1370_present, 1)); + + if (ce_params_v1370_present) { + HANDLE_CODE(ce_params_v1370.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1370_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(ce_params_v1370_present, 1)); + + if (ce_params_v1370_present) { + HANDLE_CODE(ce_params_v1370.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_add_xdd_mode_v1370_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (ce_params_v1370_present) { + j.write_fieldname("ce-Parameters-v1370"); + ce_params_v1370.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v1370-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v1370_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(ce_params_v1370_present, 1)); + HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1370_present, 1)); + HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1370_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (ce_params_v1370_present) { + HANDLE_CODE(ce_params_v1370.pack(bref)); + } + if (fdd_add_ue_eutra_cap_v1370_present) { + HANDLE_CODE(fdd_add_ue_eutra_cap_v1370.pack(bref)); + } + if (tdd_add_ue_eutra_cap_v1370_present) { + HANDLE_CODE(tdd_add_ue_eutra_cap_v1370.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v1370_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(ce_params_v1370_present, 1)); + HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1370_present, 1)); + HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1370_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (ce_params_v1370_present) { + HANDLE_CODE(ce_params_v1370.unpack(bref)); + } + if (fdd_add_ue_eutra_cap_v1370_present) { + HANDLE_CODE(fdd_add_ue_eutra_cap_v1370.unpack(bref)); + } + if (tdd_add_ue_eutra_cap_v1370_present) { + HANDLE_CODE(tdd_add_ue_eutra_cap_v1370.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v1370_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (ce_params_v1370_present) { + j.write_fieldname("ce-Parameters-v1370"); + ce_params_v1370.to_json(j); + } + if (fdd_add_ue_eutra_cap_v1370_present) { + j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1370"); + fdd_add_ue_eutra_cap_v1370.to_json(j); + } + if (tdd_add_ue_eutra_cap_v1370_present) { + j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1370"); + tdd_add_ue_eutra_cap_v1370.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// RF-Parameters-v12b0 ::= SEQUENCE +SRSASN_CODE rf_params_v12b0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(max_layers_mimo_ind_r12_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rf_params_v12b0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(max_layers_mimo_ind_r12_present, 1)); + + return SRSASN_SUCCESS; +} +void rf_params_v12b0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (max_layers_mimo_ind_r12_present) { + j.write_str("maxLayersMIMO-Indication-r12", "supported"); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v12x0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v12x0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v12x0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v12x0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v12b0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v12b0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rf_params_v12b0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v12b0_present) { + HANDLE_CODE(rf_params_v12b0.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v12b0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rf_params_v12b0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v12b0_present) { + HANDLE_CODE(rf_params_v12b0.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v12b0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rf_params_v12b0_present) { + j.write_fieldname("rf-Parameters-v12b0"); + rf_params_v12b0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// Other-Parameters-v11d0 ::= SEQUENCE +SRSASN_CODE other_params_v11d0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(in_dev_coex_ind_ul_ca_r11_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE other_params_v11d0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(in_dev_coex_ind_ul_ca_r11_present, 1)); + + return SRSASN_SUCCESS; +} +void other_params_v11d0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (in_dev_coex_ind_ul_ca_r11_present) { + j.write_str("inDeviceCoexInd-UL-CA-r11", "supported"); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v11x0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v11x0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v11x0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v11x0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v11d0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v11d0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rf_params_v11d0_present, 1)); + HANDLE_CODE(bref.pack(other_params_v11d0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v11d0_present) { + HANDLE_CODE(rf_params_v11d0.pack(bref)); + } + if (other_params_v11d0_present) { + HANDLE_CODE(other_params_v11d0.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v11d0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rf_params_v11d0_present, 1)); + HANDLE_CODE(bref.unpack(other_params_v11d0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v11d0_present) { + HANDLE_CODE(rf_params_v11d0.unpack(bref)); + } + if (other_params_v11d0_present) { + HANDLE_CODE(other_params_v11d0.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v11d0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rf_params_v11d0_present) { + j.write_fieldname("rf-Parameters-v11d0"); + rf_params_v11d0.to_json(j); + } + if (other_params_v11d0_present) { + j.write_fieldname("otherParameters-v11d0"); + other_params_v11d0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// RF-Parameters-v10f0 ::= SEQUENCE +SRSASN_CODE rf_params_v10f0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(modified_mpr_behavior_r10_present, 1)); + + if (modified_mpr_behavior_r10_present) { + HANDLE_CODE(modified_mpr_behavior_r10.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rf_params_v10f0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(modified_mpr_behavior_r10_present, 1)); + + if (modified_mpr_behavior_r10_present) { + HANDLE_CODE(modified_mpr_behavior_r10.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rf_params_v10f0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (modified_mpr_behavior_r10_present) { + j.write_str("modifiedMPR-Behavior-r10", modified_mpr_behavior_r10.to_string()); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v10i0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v10i0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rf_params_v10i0_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v10i0_present) { + HANDLE_CODE(rf_params_v10i0.pack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v10i0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rf_params_v10i0_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v10i0_present) { + HANDLE_CODE(rf_params_v10i0.unpack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v10i0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rf_params_v10i0_present) { + j.write_fieldname("rf-Parameters-v10i0"); + rf_params_v10i0.to_json(j); + } + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v10f0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v10f0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rf_params_v10f0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v10f0_present) { + HANDLE_CODE(rf_params_v10f0.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v10f0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rf_params_v10f0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v10f0_present) { + HANDLE_CODE(rf_params_v10f0.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v10f0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rf_params_v10f0_present) { + j.write_fieldname("rf-Parameters-v10f0"); + rf_params_v10f0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v10c0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v10c0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(otdoa_positioning_cap_r10_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (otdoa_positioning_cap_r10_present) { + HANDLE_CODE(otdoa_positioning_cap_r10.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v10c0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(otdoa_positioning_cap_r10_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (otdoa_positioning_cap_r10_present) { + HANDLE_CODE(otdoa_positioning_cap_r10.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v10c0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (otdoa_positioning_cap_r10_present) { + j.write_fieldname("otdoa-PositioningCapabilities-r10"); + otdoa_positioning_cap_r10.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// RF-Parameters-v10j0 ::= SEQUENCE +SRSASN_CODE rf_params_v10j0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(multi_ns_pmax_r10_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rf_params_v10j0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(multi_ns_pmax_r10_present, 1)); + + return SRSASN_SUCCESS; +} +void rf_params_v10j0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (multi_ns_pmax_r10_present) { + j.write_str("multiNS-Pmax-r10", "supported"); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v10j0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v10j0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rf_params_v10j0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v10j0_present) { + HANDLE_CODE(rf_params_v10j0.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v10j0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rf_params_v10j0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v10j0_present) { + HANDLE_CODE(rf_params_v10j0.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v10j0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rf_params_v10j0_present) { + j.write_fieldname("rf-Parameters-v10j0"); + rf_params_v10j0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} + +// IRAT-ParametersUTRA-v9h0 ::= SEQUENCE +SRSASN_CODE irat_params_utra_v9h0_s::pack(bit_ref& bref) const +{ + return SRSASN_SUCCESS; +} +SRSASN_CODE irat_params_utra_v9h0_s::unpack(cbit_ref& bref) +{ + return SRSASN_SUCCESS; +} +void irat_params_utra_v9h0_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("mfbi-UTRA-r9", "supported"); + j.end_obj(); +} + +// UE-EUTRA-Capability-v9h0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v9h0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(inter_rat_params_utra_v9h0_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (inter_rat_params_utra_v9h0_present) { + HANDLE_CODE(inter_rat_params_utra_v9h0.pack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v9h0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(inter_rat_params_utra_v9h0_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (inter_rat_params_utra_v9h0_present) { + HANDLE_CODE(inter_rat_params_utra_v9h0.unpack(bref)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v9h0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (inter_rat_params_utra_v9h0_present) { + j.write_fieldname("interRAT-ParametersUTRA-v9h0"); + inter_rat_params_utra_v9h0.to_json(j); + } + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// PhyLayerParameters-v9d0 ::= SEQUENCE +SRSASN_CODE phy_layer_params_v9d0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(tm5_fdd_r9_present, 1)); + HANDLE_CODE(bref.pack(tm5_tdd_r9_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE phy_layer_params_v9d0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(tm5_fdd_r9_present, 1)); + HANDLE_CODE(bref.unpack(tm5_tdd_r9_present, 1)); + + return SRSASN_SUCCESS; +} +void phy_layer_params_v9d0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (tm5_fdd_r9_present) { + j.write_str("tm5-FDD-r9", "supported"); + } + if (tm5_tdd_r9_present) { + j.write_str("tm5-TDD-r9", "supported"); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v9e0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v9e0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rf_params_v9e0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rf_params_v9e0_present) { + HANDLE_CODE(rf_params_v9e0.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v9e0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rf_params_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rf_params_v9e0_present) { + HANDLE_CODE(rf_params_v9e0.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v9e0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rf_params_v9e0_present) { + j.write_fieldname("rf-Parameters-v9e0"); + rf_params_v9e0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// IRAT-ParametersUTRA-v9c0 ::= SEQUENCE +SRSASN_CODE irat_params_utra_v9c0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(voice_over_ps_hs_utra_fdd_r9_present, 1)); + HANDLE_CODE(bref.pack(voice_over_ps_hs_utra_tdd128_r9_present, 1)); + HANDLE_CODE(bref.pack(srvcc_from_utra_fdd_to_utra_fdd_r9_present, 1)); + HANDLE_CODE(bref.pack(srvcc_from_utra_fdd_to_geran_r9_present, 1)); + HANDLE_CODE(bref.pack(srvcc_from_utra_tdd128_to_utra_tdd128_r9_present, 1)); + HANDLE_CODE(bref.pack(srvcc_from_utra_tdd128_to_geran_r9_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE irat_params_utra_v9c0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(voice_over_ps_hs_utra_fdd_r9_present, 1)); + HANDLE_CODE(bref.unpack(voice_over_ps_hs_utra_tdd128_r9_present, 1)); + HANDLE_CODE(bref.unpack(srvcc_from_utra_fdd_to_utra_fdd_r9_present, 1)); + HANDLE_CODE(bref.unpack(srvcc_from_utra_fdd_to_geran_r9_present, 1)); + HANDLE_CODE(bref.unpack(srvcc_from_utra_tdd128_to_utra_tdd128_r9_present, 1)); + HANDLE_CODE(bref.unpack(srvcc_from_utra_tdd128_to_geran_r9_present, 1)); + + return SRSASN_SUCCESS; +} +void irat_params_utra_v9c0_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (voice_over_ps_hs_utra_fdd_r9_present) { + j.write_str("voiceOverPS-HS-UTRA-FDD-r9", "supported"); + } + if (voice_over_ps_hs_utra_tdd128_r9_present) { + j.write_str("voiceOverPS-HS-UTRA-TDD128-r9", "supported"); + } + if (srvcc_from_utra_fdd_to_utra_fdd_r9_present) { + j.write_str("srvcc-FromUTRA-FDD-ToUTRA-FDD-r9", "supported"); + } + if (srvcc_from_utra_fdd_to_geran_r9_present) { + j.write_str("srvcc-FromUTRA-FDD-ToGERAN-r9", "supported"); + } + if (srvcc_from_utra_tdd128_to_utra_tdd128_r9_present) { + j.write_str("srvcc-FromUTRA-TDD128-ToUTRA-TDD128-r9", "supported"); + } + if (srvcc_from_utra_tdd128_to_geran_r9_present) { + j.write_str("srvcc-FromUTRA-TDD128-ToGERAN-r9", "supported"); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v9d0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v9d0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(phy_layer_params_v9d0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (phy_layer_params_v9d0_present) { + HANDLE_CODE(phy_layer_params_v9d0.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v9d0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(phy_layer_params_v9d0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (phy_layer_params_v9d0_present) { + HANDLE_CODE(phy_layer_params_v9d0.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v9d0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (phy_layer_params_v9d0_present) { + j.write_fieldname("phyLayerParameters-v9d0"); + phy_layer_params_v9d0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v9c0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v9c0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(inter_rat_params_utra_v9c0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (inter_rat_params_utra_v9c0_present) { + HANDLE_CODE(inter_rat_params_utra_v9c0.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v9c0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(inter_rat_params_utra_v9c0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (inter_rat_params_utra_v9c0_present) { + HANDLE_CODE(inter_rat_params_utra_v9c0.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v9c0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (inter_rat_params_utra_v9c0_present) { + j.write_fieldname("interRAT-ParametersUTRA-v9c0"); + inter_rat_params_utra_v9c0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-CapabilityAddXDD-Mode-r9 ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_add_xdd_mode_r9_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(phy_layer_params_r9_present, 1)); + HANDLE_CODE(bref.pack(feature_group_inds_r9_present, 1)); + HANDLE_CODE(bref.pack(feature_group_ind_rel9_add_r9_present, 1)); + HANDLE_CODE(bref.pack(inter_rat_params_geran_r9_present, 1)); + HANDLE_CODE(bref.pack(inter_rat_params_utra_r9_present, 1)); + HANDLE_CODE(bref.pack(inter_rat_params_cdma2000_r9_present, 1)); + HANDLE_CODE(bref.pack(neigh_cell_si_acquisition_params_r9_present, 1)); + + if (phy_layer_params_r9_present) { + HANDLE_CODE(phy_layer_params_r9.pack(bref)); + } + if (feature_group_inds_r9_present) { + HANDLE_CODE(feature_group_inds_r9.pack(bref)); + } + if (feature_group_ind_rel9_add_r9_present) { + HANDLE_CODE(feature_group_ind_rel9_add_r9.pack(bref)); + } + if (inter_rat_params_geran_r9_present) { + HANDLE_CODE(inter_rat_params_geran_r9.pack(bref)); + } + if (inter_rat_params_utra_r9_present) { + HANDLE_CODE(inter_rat_params_utra_r9.pack(bref)); + } + if (inter_rat_params_cdma2000_r9_present) { + HANDLE_CODE(inter_rat_params_cdma2000_r9.pack(bref)); + } + if (neigh_cell_si_acquisition_params_r9_present) { + HANDLE_CODE(neigh_cell_si_acquisition_params_r9.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_add_xdd_mode_r9_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(phy_layer_params_r9_present, 1)); + HANDLE_CODE(bref.unpack(feature_group_inds_r9_present, 1)); + HANDLE_CODE(bref.unpack(feature_group_ind_rel9_add_r9_present, 1)); + HANDLE_CODE(bref.unpack(inter_rat_params_geran_r9_present, 1)); + HANDLE_CODE(bref.unpack(inter_rat_params_utra_r9_present, 1)); + HANDLE_CODE(bref.unpack(inter_rat_params_cdma2000_r9_present, 1)); + HANDLE_CODE(bref.unpack(neigh_cell_si_acquisition_params_r9_present, 1)); + + if (phy_layer_params_r9_present) { + HANDLE_CODE(phy_layer_params_r9.unpack(bref)); + } + if (feature_group_inds_r9_present) { + HANDLE_CODE(feature_group_inds_r9.unpack(bref)); + } + if (feature_group_ind_rel9_add_r9_present) { + HANDLE_CODE(feature_group_ind_rel9_add_r9.unpack(bref)); + } + if (inter_rat_params_geran_r9_present) { + HANDLE_CODE(inter_rat_params_geran_r9.unpack(bref)); + } + if (inter_rat_params_utra_r9_present) { + HANDLE_CODE(inter_rat_params_utra_r9.unpack(bref)); + } + if (inter_rat_params_cdma2000_r9_present) { + HANDLE_CODE(inter_rat_params_cdma2000_r9.unpack(bref)); + } + if (neigh_cell_si_acquisition_params_r9_present) { + HANDLE_CODE(neigh_cell_si_acquisition_params_r9.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_add_xdd_mode_r9_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (phy_layer_params_r9_present) { + j.write_fieldname("phyLayerParameters-r9"); + phy_layer_params_r9.to_json(j); + } + if (feature_group_inds_r9_present) { + j.write_str("featureGroupIndicators-r9", feature_group_inds_r9.to_string()); + } + if (feature_group_ind_rel9_add_r9_present) { + j.write_str("featureGroupIndRel9Add-r9", feature_group_ind_rel9_add_r9.to_string()); + } + if (inter_rat_params_geran_r9_present) { + j.write_fieldname("interRAT-ParametersGERAN-r9"); + inter_rat_params_geran_r9.to_json(j); + } + if (inter_rat_params_utra_r9_present) { + j.write_fieldname("interRAT-ParametersUTRA-r9"); + inter_rat_params_utra_r9.to_json(j); + } + if (inter_rat_params_cdma2000_r9_present) { + j.write_fieldname("interRAT-ParametersCDMA2000-r9"); + inter_rat_params_cdma2000_r9.to_json(j); + } + if (neigh_cell_si_acquisition_params_r9_present) { + j.write_fieldname("neighCellSI-AcquisitionParameters-r9"); + neigh_cell_si_acquisition_params_r9.to_json(j); + } + j.end_obj(); +} + +// UE-EUTRA-Capability-v9a0-IEs ::= SEQUENCE +SRSASN_CODE ue_eutra_cap_v9a0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(feature_group_ind_rel9_add_r9_present, 1)); + HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_r9_present, 1)); + HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_r9_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (feature_group_ind_rel9_add_r9_present) { + HANDLE_CODE(feature_group_ind_rel9_add_r9.pack(bref)); + } + if (fdd_add_ue_eutra_cap_r9_present) { + HANDLE_CODE(fdd_add_ue_eutra_cap_r9.pack(bref)); + } + if (tdd_add_ue_eutra_cap_r9_present) { + HANDLE_CODE(tdd_add_ue_eutra_cap_r9.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_eutra_cap_v9a0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(feature_group_ind_rel9_add_r9_present, 1)); + HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_r9_present, 1)); + HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_r9_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (feature_group_ind_rel9_add_r9_present) { + HANDLE_CODE(feature_group_ind_rel9_add_r9.unpack(bref)); + } + if (fdd_add_ue_eutra_cap_r9_present) { + HANDLE_CODE(fdd_add_ue_eutra_cap_r9.unpack(bref)); + } + if (tdd_add_ue_eutra_cap_r9_present) { + HANDLE_CODE(tdd_add_ue_eutra_cap_r9.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_eutra_cap_v9a0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (feature_group_ind_rel9_add_r9_present) { + j.write_str("featureGroupIndRel9Add-r9", feature_group_ind_rel9_add_r9.to_string()); + } + if (fdd_add_ue_eutra_cap_r9_present) { + j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-r9"); + fdd_add_ue_eutra_cap_r9.to_json(j); + } + if (tdd_add_ue_eutra_cap_r9_present) { + j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-r9"); + tdd_add_ue_eutra_cap_r9.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} + +// UERadioAccessCapabilityInformation-r8-IEs ::= SEQUENCE +SRSASN_CODE ue_radio_access_cap_info_r8_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(ue_radio_access_cap_info.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_radio_access_cap_info_r8_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + HANDLE_CODE(ue_radio_access_cap_info.unpack(bref)); + + return SRSASN_SUCCESS; +} +void ue_radio_access_cap_info_r8_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("ue-RadioAccessCapabilityInfo", ue_radio_access_cap_info.to_string()); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} + +// UERadioAccessCapabilityInformation ::= SEQUENCE +SRSASN_CODE ue_radio_access_cap_info_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(crit_exts.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_radio_access_cap_info_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(crit_exts.unpack(bref)); + + return SRSASN_SUCCESS; +} +void ue_radio_access_cap_info_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} + +void ue_radio_access_cap_info_s::crit_exts_c_::set(types::options e) +{ + type_ = e; +} +void ue_radio_access_cap_info_s::crit_exts_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::c1: + j.write_fieldname("c1"); + c.to_json(j); + break; + case types::crit_exts_future: + break; + default: + log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); + } + j.end_obj(); +} +SRSASN_CODE ue_radio_access_cap_info_s::crit_exts_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::c1: + HANDLE_CODE(c.pack(bref)); + break; + case types::crit_exts_future: + break; + default: + log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_radio_access_cap_info_s::crit_exts_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::c1: + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; diff --git a/lib/src/asn1/rrc/ul_ccch_msg.cc b/lib/src/asn1/rrc/ul_ccch_msg.cc index 9d73adc8a..da391ce0f 100644 --- a/lib/src/asn1/rrc/ul_ccch_msg.cc +++ b/lib/src/asn1/rrc/ul_ccch_msg.cc @@ -825,67 +825,9 @@ void rrc_conn_reest_request_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_reest_request_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_reest_request_r8: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_reest_request_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_conn_reest_request_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_s::crit_exts_c_"); - } -} -rrc_conn_reest_request_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reest_request_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_reest_request_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_s::crit_exts_c_"); - } -} -rrc_conn_reest_request_s::crit_exts_c_& -rrc_conn_reest_request_s::crit_exts_c_::operator=(const rrc_conn_reest_request_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_reest_request_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_reest_request_s::crit_exts_c_::to_json(json_writer& j) const { @@ -893,7 +835,7 @@ void rrc_conn_reest_request_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_conn_reest_request_r8: j.write_fieldname("rrcConnectionReestablishmentRequest-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -907,7 +849,7 @@ SRSASN_CODE rrc_conn_reest_request_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_conn_reest_request_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -924,7 +866,7 @@ SRSASN_CODE rrc_conn_reest_request_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_conn_reest_request_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -1238,67 +1180,9 @@ void rrc_early_data_request_r15_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_early_data_request_r15_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_early_data_request_r15: - c.destroy(); - break; - default: - break; - } -} void rrc_early_data_request_r15_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_early_data_request_r15: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_r15_s::crit_exts_c_"); - } -} -rrc_early_data_request_r15_s::crit_exts_c_::crit_exts_c_(const rrc_early_data_request_r15_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_early_data_request_r15: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_r15_s::crit_exts_c_"); - } -} -rrc_early_data_request_r15_s::crit_exts_c_& -rrc_early_data_request_r15_s::crit_exts_c_::operator=(const rrc_early_data_request_r15_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_early_data_request_r15: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_r15_s::crit_exts_c_"); - } - - return *this; } void rrc_early_data_request_r15_s::crit_exts_c_::to_json(json_writer& j) const { @@ -1306,7 +1190,7 @@ void rrc_early_data_request_r15_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_early_data_request_r15: j.write_fieldname("rrcEarlyDataRequest-r15"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -1320,7 +1204,7 @@ SRSASN_CODE rrc_early_data_request_r15_s::crit_exts_c_::pack(bit_ref& bref) cons type_.pack(bref); switch (type_) { case types::rrc_early_data_request_r15: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -1337,7 +1221,7 @@ SRSASN_CODE rrc_early_data_request_r15_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_early_data_request_r15: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -1725,69 +1609,9 @@ SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -void ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::destroy_() -{ - switch (type_) { - case types::c3: - c.destroy(); - break; - default: - break; - } -} void ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c3: - c.init(); - break; - case types::msg_class_ext_future_r15: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_"); - } -} -ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::msg_class_ext_future_r13_c_( - const ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c3: - c.init(other.c.get()); - break; - case types::msg_class_ext_future_r15: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_"); - } -} -ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_& -ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::operator=( - const ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c3: - c.set(other.c.get()); - break; - case types::msg_class_ext_future_r15: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_"); - } - - return *this; } void ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::to_json(json_writer& j) const { @@ -1795,7 +1619,7 @@ void ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::to_json( switch (type_) { case types::c3: j.write_fieldname("c3"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext_future_r15: break; @@ -1809,7 +1633,7 @@ SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::p type_.pack(bref); switch (type_) { case types::c3: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext_future_r15: break; @@ -1826,7 +1650,7 @@ SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::u set(e); switch (type_) { case types::c3: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext_future_r15: break; diff --git a/lib/src/asn1/rrc/ul_dcch_msg.cc b/lib/src/asn1/rrc/ul_dcch_msg.cc index 6c055dc7c..e2726795a 100644 --- a/lib/src/asn1/rrc/ul_dcch_msg.cc +++ b/lib/src/asn1/rrc/ul_dcch_msg.cc @@ -2626,30 +2626,6 @@ void overheat_assist_r14_s::to_json(json_writer& j) const j.end_obj(); } -// RLF-Report-v9e0 ::= SEQUENCE -SRSASN_CODE rlf_report_v9e0_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_list_eutra_v9e0, 1, 8)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rlf_report_v9e0_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_dyn_seq_of(meas_result_list_eutra_v9e0, bref, 1, 8)); - - return SRSASN_SUCCESS; -} -void rlf_report_v9e0_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.start_array("measResultListEUTRA-v9e0"); - for (const auto& e1 : meas_result_list_eutra_v9e0) { - e1.to_json(j); - } - j.end_array(); - j.end_obj(); -} - // RRCConnectionReconfigurationComplete-v1130-IEs ::= SEQUENCE SRSASN_CODE rrc_conn_recfg_complete_v1130_ies_s::pack(bit_ref& bref) const { @@ -4565,44 +4541,6 @@ void ue_info_resp_v1020_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UEInformationResponse-v9e0-IEs ::= SEQUENCE -SRSASN_CODE ue_info_resp_v9e0_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(rlf_report_v9e0_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (rlf_report_v9e0_present) { - HANDLE_CODE(rlf_report_v9e0.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_info_resp_v9e0_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(rlf_report_v9e0_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (rlf_report_v9e0_present) { - HANDLE_CODE(rlf_report_v9e0.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void ue_info_resp_v9e0_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (rlf_report_v9e0_present) { - j.write_fieldname("rlf-Report-v9e0"); - rlf_report_v9e0.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - // WLAN-Status-v1430 ::= ENUMERATED std::string wlan_status_v1430_opts::to_string() const { @@ -8304,67 +8242,9 @@ void csfb_params_request_cdma2000_s::to_json(json_writer& j) const j.end_obj(); } -void csfb_params_request_cdma2000_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::csfb_params_request_cdma2000_r8: - c.destroy(); - break; - default: - break; - } -} void csfb_params_request_cdma2000_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::csfb_params_request_cdma2000_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "csfb_params_request_cdma2000_s::crit_exts_c_"); - } -} -csfb_params_request_cdma2000_s::crit_exts_c_::crit_exts_c_(const csfb_params_request_cdma2000_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::csfb_params_request_cdma2000_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "csfb_params_request_cdma2000_s::crit_exts_c_"); - } -} -csfb_params_request_cdma2000_s::crit_exts_c_& -csfb_params_request_cdma2000_s::crit_exts_c_::operator=(const csfb_params_request_cdma2000_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::csfb_params_request_cdma2000_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "csfb_params_request_cdma2000_s::crit_exts_c_"); - } - - return *this; } void csfb_params_request_cdma2000_s::crit_exts_c_::to_json(json_writer& j) const { @@ -8372,7 +8252,7 @@ void csfb_params_request_cdma2000_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::csfb_params_request_cdma2000_r8: j.write_fieldname("csfbParametersRequestCDMA2000-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -8386,7 +8266,7 @@ SRSASN_CODE csfb_params_request_cdma2000_s::crit_exts_c_::pack(bit_ref& bref) co type_.pack(bref); switch (type_) { case types::csfb_params_request_cdma2000_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -8403,7 +8283,7 @@ SRSASN_CODE csfb_params_request_cdma2000_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::csfb_params_request_cdma2000_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -8438,67 +8318,9 @@ void counter_check_resp_s::to_json(json_writer& j) const j.end_obj(); } -void counter_check_resp_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::counter_check_resp_r8: - c.destroy(); - break; - default: - break; - } -} void counter_check_resp_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::counter_check_resp_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_"); - } -} -counter_check_resp_s::crit_exts_c_::crit_exts_c_(const counter_check_resp_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::counter_check_resp_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_"); - } -} -counter_check_resp_s::crit_exts_c_& -counter_check_resp_s::crit_exts_c_::operator=(const counter_check_resp_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::counter_check_resp_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_"); - } - - return *this; } void counter_check_resp_s::crit_exts_c_::to_json(json_writer& j) const { @@ -8506,7 +8328,7 @@ void counter_check_resp_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::counter_check_resp_r8: j.write_fieldname("counterCheckResponse-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -8520,7 +8342,7 @@ SRSASN_CODE counter_check_resp_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::counter_check_resp_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -8537,7 +8359,7 @@ SRSASN_CODE counter_check_resp_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::counter_check_resp_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -8600,67 +8422,9 @@ void in_dev_coex_ind_r11_s::to_json(json_writer& j) const j.end_obj(); } -void in_dev_coex_ind_r11_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void in_dev_coex_ind_r11_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_"); - } -} -in_dev_coex_ind_r11_s::crit_exts_c_::crit_exts_c_(const in_dev_coex_ind_r11_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_"); - } -} -in_dev_coex_ind_r11_s::crit_exts_c_& -in_dev_coex_ind_r11_s::crit_exts_c_::operator=(const in_dev_coex_ind_r11_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_"); - } - - return *this; } void in_dev_coex_ind_r11_s::crit_exts_c_::to_json(json_writer& j) const { @@ -8668,7 +8432,7 @@ void in_dev_coex_ind_r11_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -8682,7 +8446,7 @@ SRSASN_CODE in_dev_coex_ind_r11_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -8699,7 +8463,7 @@ SRSASN_CODE in_dev_coex_ind_r11_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -8795,95 +8559,37 @@ void inter_freq_rstd_meas_ind_r10_s::to_json(json_writer& j) const j.end_obj(); } -void inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; +} +void inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::to_json(json_writer& j) const +{ + j.start_obj(); switch (type_) { case types::c1: - c.init(); + j.write_fieldname("c1"); + c.to_json(j); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_s::crit_exts_c_"); } + j.end_obj(); } -inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::crit_exts_c_(const inter_freq_rstd_meas_ind_r10_s::crit_exts_c_& other) +SRSASN_CODE inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { case types::c1: - c.init(other.c.get()); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_s::crit_exts_c_"); - } -} -inter_freq_rstd_meas_ind_r10_s::crit_exts_c_& -inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::operator=(const inter_freq_rstd_meas_ind_r10_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_s::crit_exts_c_"); - } - - return *this; -} -void inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_s::crit_exts_c_"); - } - j.end_obj(); -} -SRSASN_CODE inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } @@ -8894,7 +8600,7 @@ SRSASN_CODE inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -8990,67 +8696,9 @@ void mbms_count_resp_r10_s::to_json(json_writer& j) const j.end_obj(); } -void mbms_count_resp_r10_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void mbms_count_resp_r10_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_"); - } -} -mbms_count_resp_r10_s::crit_exts_c_::crit_exts_c_(const mbms_count_resp_r10_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_"); - } -} -mbms_count_resp_r10_s::crit_exts_c_& -mbms_count_resp_r10_s::crit_exts_c_::operator=(const mbms_count_resp_r10_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_"); - } - - return *this; } void mbms_count_resp_r10_s::crit_exts_c_::to_json(json_writer& j) const { @@ -9058,7 +8706,7 @@ void mbms_count_resp_r10_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -9072,7 +8720,7 @@ SRSASN_CODE mbms_count_resp_r10_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -9089,7 +8737,7 @@ SRSASN_CODE mbms_count_resp_r10_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -9185,67 +8833,9 @@ void mbms_interest_ind_r11_s::to_json(json_writer& j) const j.end_obj(); } -void mbms_interest_ind_r11_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void mbms_interest_ind_r11_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_"); - } -} -mbms_interest_ind_r11_s::crit_exts_c_::crit_exts_c_(const mbms_interest_ind_r11_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_"); - } -} -mbms_interest_ind_r11_s::crit_exts_c_& -mbms_interest_ind_r11_s::crit_exts_c_::operator=(const mbms_interest_ind_r11_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_"); - } - - return *this; } void mbms_interest_ind_r11_s::crit_exts_c_::to_json(json_writer& j) const { @@ -9253,7 +8843,7 @@ void mbms_interest_ind_r11_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -9267,7 +8857,7 @@ SRSASN_CODE mbms_interest_ind_r11_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -9284,7 +8874,7 @@ SRSASN_CODE mbms_interest_ind_r11_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -9380,67 +8970,9 @@ void meas_report_app_layer_r15_s::to_json(json_writer& j) const j.end_obj(); } -void meas_report_app_layer_r15_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::meas_report_app_layer_r15: - c.destroy(); - break; - default: - break; - } -} void meas_report_app_layer_r15_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::meas_report_app_layer_r15: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_app_layer_r15_s::crit_exts_c_"); - } -} -meas_report_app_layer_r15_s::crit_exts_c_::crit_exts_c_(const meas_report_app_layer_r15_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::meas_report_app_layer_r15: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_app_layer_r15_s::crit_exts_c_"); - } -} -meas_report_app_layer_r15_s::crit_exts_c_& -meas_report_app_layer_r15_s::crit_exts_c_::operator=(const meas_report_app_layer_r15_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::meas_report_app_layer_r15: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_app_layer_r15_s::crit_exts_c_"); - } - - return *this; } void meas_report_app_layer_r15_s::crit_exts_c_::to_json(json_writer& j) const { @@ -9448,7 +8980,7 @@ void meas_report_app_layer_r15_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::meas_report_app_layer_r15: j.write_fieldname("measReportAppLayer-r15"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -9462,7 +8994,7 @@ SRSASN_CODE meas_report_app_layer_r15_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::meas_report_app_layer_r15: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -9479,7 +9011,7 @@ SRSASN_CODE meas_report_app_layer_r15_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::meas_report_app_layer_r15: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -9511,106 +9043,48 @@ void proximity_ind_r9_s::to_json(json_writer& j) const j.end_obj(); } -void proximity_ind_r9_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void proximity_ind_r9_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; +} +void proximity_ind_r9_s::crit_exts_c_::to_json(json_writer& j) const +{ + j.start_obj(); switch (type_) { case types::c1: - c.init(); + j.write_fieldname("c1"); + c.to_json(j); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_"); } + j.end_obj(); } -proximity_ind_r9_s::crit_exts_c_::crit_exts_c_(const proximity_ind_r9_s::crit_exts_c_& other) +SRSASN_CODE proximity_ind_r9_s::crit_exts_c_::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { case types::c1: - c.init(other.c.get()); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } + return SRSASN_SUCCESS; } -proximity_ind_r9_s::crit_exts_c_& -proximity_ind_r9_s::crit_exts_c_::operator=(const proximity_ind_r9_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_"); - } - - return *this; -} -void proximity_ind_r9_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_"); - } - j.end_obj(); -} -SRSASN_CODE proximity_ind_r9_s::crit_exts_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE proximity_ind_r9_s::crit_exts_c_::unpack(cbit_ref& bref) +SRSASN_CODE proximity_ind_r9_s::crit_exts_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -9709,67 +9183,9 @@ void rn_recfg_complete_r10_s::to_json(json_writer& j) const j.end_obj(); } -void rn_recfg_complete_r10_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rn_recfg_complete_r10_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_"); - } -} -rn_recfg_complete_r10_s::crit_exts_c_::crit_exts_c_(const rn_recfg_complete_r10_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_"); - } -} -rn_recfg_complete_r10_s::crit_exts_c_& -rn_recfg_complete_r10_s::crit_exts_c_::operator=(const rn_recfg_complete_r10_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_"); - } - - return *this; } void rn_recfg_complete_r10_s::crit_exts_c_::to_json(json_writer& j) const { @@ -9777,7 +9193,7 @@ void rn_recfg_complete_r10_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -9791,7 +9207,7 @@ SRSASN_CODE rn_recfg_complete_r10_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -9808,7 +9224,7 @@ SRSASN_CODE rn_recfg_complete_r10_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -9907,67 +9323,9 @@ void rrc_conn_recfg_complete_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_recfg_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_recfg_complete_r8: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_recfg_complete_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_conn_recfg_complete_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_s::crit_exts_c_"); - } -} -rrc_conn_recfg_complete_s::crit_exts_c_::crit_exts_c_(const rrc_conn_recfg_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_recfg_complete_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_s::crit_exts_c_"); - } -} -rrc_conn_recfg_complete_s::crit_exts_c_& -rrc_conn_recfg_complete_s::crit_exts_c_::operator=(const rrc_conn_recfg_complete_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_recfg_complete_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_recfg_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -9975,7 +9333,7 @@ void rrc_conn_recfg_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_conn_recfg_complete_r8: j.write_fieldname("rrcConnectionReconfigurationComplete-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -9989,7 +9347,7 @@ SRSASN_CODE rrc_conn_recfg_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_conn_recfg_complete_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -10006,7 +9364,7 @@ SRSASN_CODE rrc_conn_recfg_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_conn_recfg_complete_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -10041,67 +9399,9 @@ void rrc_conn_reest_complete_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_reest_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_reest_complete_r8: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_reest_complete_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_conn_reest_complete_r8: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_s::crit_exts_c_"); - } -} -rrc_conn_reest_complete_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reest_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_reest_complete_r8: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_s::crit_exts_c_"); - } -} -rrc_conn_reest_complete_s::crit_exts_c_& -rrc_conn_reest_complete_s::crit_exts_c_::operator=(const rrc_conn_reest_complete_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_reest_complete_r8: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_reest_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -10109,7 +9409,7 @@ void rrc_conn_reest_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_conn_reest_complete_r8: j.write_fieldname("rrcConnectionReestablishmentComplete-r8"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -10123,7 +9423,7 @@ SRSASN_CODE rrc_conn_reest_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_conn_reest_complete_r8: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -10140,7 +9440,7 @@ SRSASN_CODE rrc_conn_reest_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_conn_reest_complete_r8: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -10162,80 +9462,22 @@ SRSASN_CODE rrc_conn_resume_complete_r13_s::pack(bit_ref& bref) const SRSASN_CODE rrc_conn_resume_complete_r13_s::unpack(cbit_ref& bref) { HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rrc_conn_resume_complete_r13_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); -} - -void rrc_conn_resume_complete_r13_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_resume_complete_r13: - c.destroy(); - break; - default: - break; - } -} -void rrc_conn_resume_complete_r13_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::rrc_conn_resume_complete_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_r13_s::crit_exts_c_"); - } -} -rrc_conn_resume_complete_r13_s::crit_exts_c_::crit_exts_c_(const rrc_conn_resume_complete_r13_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_resume_complete_r13: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_r13_s::crit_exts_c_"); - } -} -rrc_conn_resume_complete_r13_s::crit_exts_c_& -rrc_conn_resume_complete_r13_s::crit_exts_c_::operator=(const rrc_conn_resume_complete_r13_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_resume_complete_r13: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_r13_s::crit_exts_c_"); - } + HANDLE_CODE(crit_exts.unpack(bref)); - return *this; + return SRSASN_SUCCESS; +} +void rrc_conn_resume_complete_r13_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} + +void rrc_conn_resume_complete_r13_s::crit_exts_c_::set(types::options e) +{ + type_ = e; } void rrc_conn_resume_complete_r13_s::crit_exts_c_::to_json(json_writer& j) const { @@ -10243,7 +9485,7 @@ void rrc_conn_resume_complete_r13_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_conn_resume_complete_r13: j.write_fieldname("rrcConnectionResumeComplete-r13"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -10257,7 +9499,7 @@ SRSASN_CODE rrc_conn_resume_complete_r13_s::crit_exts_c_::pack(bit_ref& bref) co type_.pack(bref); switch (type_) { case types::rrc_conn_resume_complete_r13: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -10274,7 +9516,7 @@ SRSASN_CODE rrc_conn_resume_complete_r13_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_conn_resume_complete_r13: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -10309,67 +9551,9 @@ void rrc_conn_setup_complete_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_setup_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_setup_complete_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_"); - } -} -rrc_conn_setup_complete_s::crit_exts_c_::crit_exts_c_(const rrc_conn_setup_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_"); - } -} -rrc_conn_setup_complete_s::crit_exts_c_& -rrc_conn_setup_complete_s::crit_exts_c_::operator=(const rrc_conn_setup_complete_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_setup_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -10377,7 +9561,7 @@ void rrc_conn_setup_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -10391,7 +9575,7 @@ SRSASN_CODE rrc_conn_setup_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -10408,7 +9592,7 @@ SRSASN_CODE rrc_conn_setup_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -10504,67 +9688,9 @@ void scg_fail_info_r12_s::to_json(json_writer& j) const j.end_obj(); } -void scg_fail_info_r12_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void scg_fail_info_r12_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_"); - } -} -scg_fail_info_r12_s::crit_exts_c_::crit_exts_c_(const scg_fail_info_r12_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_"); - } -} -scg_fail_info_r12_s::crit_exts_c_& -scg_fail_info_r12_s::crit_exts_c_::operator=(const scg_fail_info_r12_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_"); - } - - return *this; } void scg_fail_info_r12_s::crit_exts_c_::to_json(json_writer& j) const { @@ -10572,7 +9698,7 @@ void scg_fail_info_r12_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -10586,7 +9712,7 @@ SRSASN_CODE scg_fail_info_r12_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -10603,7 +9729,7 @@ SRSASN_CODE scg_fail_info_r12_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -10699,67 +9825,9 @@ void scg_fail_info_nr_r15_s::to_json(json_writer& j) const j.end_obj(); } -void scg_fail_info_nr_r15_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void scg_fail_info_nr_r15_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_"); - } -} -scg_fail_info_nr_r15_s::crit_exts_c_::crit_exts_c_(const scg_fail_info_nr_r15_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_"); - } -} -scg_fail_info_nr_r15_s::crit_exts_c_& -scg_fail_info_nr_r15_s::crit_exts_c_::operator=(const scg_fail_info_nr_r15_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_"); - } - - return *this; } void scg_fail_info_nr_r15_s::crit_exts_c_::to_json(json_writer& j) const { @@ -10767,7 +9835,7 @@ void scg_fail_info_nr_r15_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -10781,7 +9849,7 @@ SRSASN_CODE scg_fail_info_nr_r15_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -10798,7 +9866,7 @@ SRSASN_CODE scg_fail_info_nr_r15_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -10894,67 +9962,9 @@ void sidelink_ue_info_r12_s::to_json(json_writer& j) const j.end_obj(); } -void sidelink_ue_info_r12_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} -void sidelink_ue_info_r12_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_"); - } -} -sidelink_ue_info_r12_s::crit_exts_c_::crit_exts_c_(const sidelink_ue_info_r12_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_"); - } -} -sidelink_ue_info_r12_s::crit_exts_c_& -sidelink_ue_info_r12_s::crit_exts_c_::operator=(const sidelink_ue_info_r12_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_"); - } - - return *this; +void sidelink_ue_info_r12_s::crit_exts_c_::set(types::options e) +{ + type_ = e; } void sidelink_ue_info_r12_s::crit_exts_c_::to_json(json_writer& j) const { @@ -10962,7 +9972,7 @@ void sidelink_ue_info_r12_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -10976,7 +9986,7 @@ SRSASN_CODE sidelink_ue_info_r12_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -10993,7 +10003,7 @@ SRSASN_CODE sidelink_ue_info_r12_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -11089,67 +10099,9 @@ void ueassist_info_r11_s::to_json(json_writer& j) const j.end_obj(); } -void ueassist_info_r11_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ueassist_info_r11_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_"); - } -} -ueassist_info_r11_s::crit_exts_c_::crit_exts_c_(const ueassist_info_r11_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_"); - } -} -ueassist_info_r11_s::crit_exts_c_& -ueassist_info_r11_s::crit_exts_c_::operator=(const ueassist_info_r11_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_"); - } - - return *this; } void ueassist_info_r11_s::crit_exts_c_::to_json(json_writer& j) const { @@ -11157,7 +10109,7 @@ void ueassist_info_r11_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -11171,7 +10123,7 @@ SRSASN_CODE ueassist_info_r11_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -11188,7 +10140,7 @@ SRSASN_CODE ueassist_info_r11_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -11287,67 +10239,9 @@ void ue_info_resp_r9_s::to_json(json_writer& j) const j.end_obj(); } -void ue_info_resp_r9_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_info_resp_r9_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_"); - } -} -ue_info_resp_r9_s::crit_exts_c_::crit_exts_c_(const ue_info_resp_r9_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_"); - } -} -ue_info_resp_r9_s::crit_exts_c_& -ue_info_resp_r9_s::crit_exts_c_::operator=(const ue_info_resp_r9_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_"); - } - - return *this; } void ue_info_resp_r9_s::crit_exts_c_::to_json(json_writer& j) const { @@ -11355,7 +10249,7 @@ void ue_info_resp_r9_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -11369,7 +10263,7 @@ SRSASN_CODE ue_info_resp_r9_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -11386,7 +10280,7 @@ SRSASN_CODE ue_info_resp_r9_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -11482,67 +10376,9 @@ void ul_ho_prep_transfer_s::to_json(json_writer& j) const j.end_obj(); } -void ul_ho_prep_transfer_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ul_ho_prep_transfer_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_"); - } -} -ul_ho_prep_transfer_s::crit_exts_c_::crit_exts_c_(const ul_ho_prep_transfer_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_"); - } -} -ul_ho_prep_transfer_s::crit_exts_c_& -ul_ho_prep_transfer_s::crit_exts_c_::operator=(const ul_ho_prep_transfer_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_"); - } - - return *this; } void ul_ho_prep_transfer_s::crit_exts_c_::to_json(json_writer& j) const { @@ -11550,7 +10386,7 @@ void ul_ho_prep_transfer_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -11564,7 +10400,7 @@ SRSASN_CODE ul_ho_prep_transfer_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -11581,7 +10417,7 @@ SRSASN_CODE ul_ho_prep_transfer_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -11665,79 +10501,21 @@ SRSASN_CODE ul_info_transfer_s::pack(bit_ref& bref) const } SRSASN_CODE ul_info_transfer_s::unpack(cbit_ref& bref) { - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; -} -void ul_info_transfer_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); -} - -void ul_info_transfer_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} -void ul_info_transfer_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_"); - } -} -ul_info_transfer_s::crit_exts_c_::crit_exts_c_(const ul_info_transfer_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_"); - } -} -ul_info_transfer_s::crit_exts_c_& -ul_info_transfer_s::crit_exts_c_::operator=(const ul_info_transfer_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_"); - } + HANDLE_CODE(crit_exts.unpack(bref)); - return *this; + return SRSASN_SUCCESS; +} +void ul_info_transfer_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} + +void ul_info_transfer_s::crit_exts_c_::set(types::options e) +{ + type_ = e; } void ul_info_transfer_s::crit_exts_c_::to_json(json_writer& j) const { @@ -11745,7 +10523,7 @@ void ul_info_transfer_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -11759,7 +10537,7 @@ SRSASN_CODE ul_info_transfer_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -11776,7 +10554,7 @@ SRSASN_CODE ul_info_transfer_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -11872,67 +10650,9 @@ void ul_info_transfer_mrdc_r15_s::to_json(json_writer& j) const j.end_obj(); } -void ul_info_transfer_mrdc_r15_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ul_info_transfer_mrdc_r15_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_"); - } -} -ul_info_transfer_mrdc_r15_s::crit_exts_c_::crit_exts_c_(const ul_info_transfer_mrdc_r15_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_"); - } -} -ul_info_transfer_mrdc_r15_s::crit_exts_c_& -ul_info_transfer_mrdc_r15_s::crit_exts_c_::operator=(const ul_info_transfer_mrdc_r15_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_"); - } - - return *this; } void ul_info_transfer_mrdc_r15_s::crit_exts_c_::to_json(json_writer& j) const { @@ -11940,7 +10660,7 @@ void ul_info_transfer_mrdc_r15_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -11954,7 +10674,7 @@ SRSASN_CODE ul_info_transfer_mrdc_r15_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -11971,7 +10691,7 @@ SRSASN_CODE ul_info_transfer_mrdc_r15_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -12067,67 +10787,9 @@ void wlan_conn_status_report_r13_s::to_json(json_writer& j) const j.end_obj(); } -void wlan_conn_status_report_r13_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void wlan_conn_status_report_r13_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "wlan_conn_status_report_r13_s::crit_exts_c_"); - } -} -wlan_conn_status_report_r13_s::crit_exts_c_::crit_exts_c_(const wlan_conn_status_report_r13_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "wlan_conn_status_report_r13_s::crit_exts_c_"); - } -} -wlan_conn_status_report_r13_s::crit_exts_c_& -wlan_conn_status_report_r13_s::crit_exts_c_::operator=(const wlan_conn_status_report_r13_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "wlan_conn_status_report_r13_s::crit_exts_c_"); - } - - return *this; } void wlan_conn_status_report_r13_s::crit_exts_c_::to_json(json_writer& j) const { @@ -12135,7 +10797,7 @@ void wlan_conn_status_report_r13_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -12149,7 +10811,7 @@ SRSASN_CODE wlan_conn_status_report_r13_s::crit_exts_c_::pack(bit_ref& bref) con type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -12166,7 +10828,7 @@ SRSASN_CODE wlan_conn_status_report_r13_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -12788,67 +11450,9 @@ SRSASN_CODE ul_dcch_msg_type_c::c1_c_::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -void ul_dcch_msg_type_c::msg_class_ext_c_::destroy_() -{ - switch (type_) { - case types::c2: - c.destroy(); - break; - default: - break; - } -} void ul_dcch_msg_type_c::msg_class_ext_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c2: - c.init(); - break; - case types::msg_class_ext_future_r11: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_"); - } -} -ul_dcch_msg_type_c::msg_class_ext_c_::msg_class_ext_c_(const ul_dcch_msg_type_c::msg_class_ext_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c2: - c.init(other.c.get()); - break; - case types::msg_class_ext_future_r11: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_"); - } -} -ul_dcch_msg_type_c::msg_class_ext_c_& -ul_dcch_msg_type_c::msg_class_ext_c_::operator=(const ul_dcch_msg_type_c::msg_class_ext_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c2: - c.set(other.c.get()); - break; - case types::msg_class_ext_future_r11: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_"); - } - - return *this; } void ul_dcch_msg_type_c::msg_class_ext_c_::to_json(json_writer& j) const { @@ -12856,7 +11460,7 @@ void ul_dcch_msg_type_c::msg_class_ext_c_::to_json(json_writer& j) const switch (type_) { case types::c2: j.write_fieldname("c2"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext_future_r11: break; @@ -12870,7 +11474,7 @@ SRSASN_CODE ul_dcch_msg_type_c::msg_class_ext_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c2: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext_future_r11: break; @@ -12887,7 +11491,7 @@ SRSASN_CODE ul_dcch_msg_type_c::msg_class_ext_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c2: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext_future_r11: break; @@ -13304,3 +11908,65 @@ void ul_dcch_msg_s::to_json(json_writer& j) const j.end_obj(); j.end_array(); } + +// RLF-Report-v9e0 ::= SEQUENCE +SRSASN_CODE rlf_report_v9e0_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_list_eutra_v9e0, 1, 8)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rlf_report_v9e0_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(unpack_dyn_seq_of(meas_result_list_eutra_v9e0, bref, 1, 8)); + + return SRSASN_SUCCESS; +} +void rlf_report_v9e0_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.start_array("measResultListEUTRA-v9e0"); + for (const auto& e1 : meas_result_list_eutra_v9e0) { + e1.to_json(j); + } + j.end_array(); + j.end_obj(); +} + +// UEInformationResponse-v9e0-IEs ::= SEQUENCE +SRSASN_CODE ue_info_resp_v9e0_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(rlf_report_v9e0_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (rlf_report_v9e0_present) { + HANDLE_CODE(rlf_report_v9e0.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ue_info_resp_v9e0_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(rlf_report_v9e0_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (rlf_report_v9e0_present) { + HANDLE_CODE(rlf_report_v9e0.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ue_info_resp_v9e0_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (rlf_report_v9e0_present) { + j.write_fieldname("rlf-Report-v9e0"); + rlf_report_v9e0.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} diff --git a/lib/src/asn1/rrc_nbiot.cc b/lib/src/asn1/rrc_nbiot.cc index 10883403d..3f1716054 100644 --- a/lib/src/asn1/rrc_nbiot.cc +++ b/lib/src/asn1/rrc_nbiot.cc @@ -11366,66 +11366,9 @@ void sys_info_nb_s::to_json(json_writer& j) const j.end_obj(); } -void sys_info_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::sys_info_r13: - c.destroy(); - break; - default: - break; - } -} void sys_info_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::sys_info_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_nb_s::crit_exts_c_"); - } -} -sys_info_nb_s::crit_exts_c_::crit_exts_c_(const sys_info_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::sys_info_r13: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_nb_s::crit_exts_c_"); - } -} -sys_info_nb_s::crit_exts_c_& sys_info_nb_s::crit_exts_c_::operator=(const sys_info_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::sys_info_r13: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_nb_s::crit_exts_c_"); - } - - return *this; } void sys_info_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -11433,7 +11376,7 @@ void sys_info_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::sys_info_r13: j.write_fieldname("systemInformation-r13"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -11447,7 +11390,7 @@ SRSASN_CODE sys_info_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::sys_info_r13: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -11464,7 +11407,7 @@ SRSASN_CODE sys_info_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::sys_info_r13: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -11740,66 +11683,9 @@ uint16_t sib_type1_nb_s::si_win_len_r13_opts::to_number() const } // BCCH-DL-SCH-MessageType-NB ::= CHOICE -void bcch_dl_sch_msg_type_nb_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void bcch_dl_sch_msg_type_nb_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_nb_c"); - } -} -bcch_dl_sch_msg_type_nb_c::bcch_dl_sch_msg_type_nb_c(const bcch_dl_sch_msg_type_nb_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_nb_c"); - } -} -bcch_dl_sch_msg_type_nb_c& bcch_dl_sch_msg_type_nb_c::operator=(const bcch_dl_sch_msg_type_nb_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_nb_c"); - } - - return *this; } void bcch_dl_sch_msg_type_nb_c::to_json(json_writer& j) const { @@ -11807,7 +11693,7 @@ void bcch_dl_sch_msg_type_nb_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -11821,7 +11707,7 @@ SRSASN_CODE bcch_dl_sch_msg_type_nb_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -11838,7 +11724,7 @@ SRSASN_CODE bcch_dl_sch_msg_type_nb_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -12395,67 +12281,9 @@ void rrc_conn_reest_nb_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_reest_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_reest_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_nb_s::crit_exts_c_"); - } -} -rrc_conn_reest_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reest_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_nb_s::crit_exts_c_"); - } -} -rrc_conn_reest_nb_s::crit_exts_c_& -rrc_conn_reest_nb_s::crit_exts_c_::operator=(const rrc_conn_reest_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_nb_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_reest_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -12463,7 +12291,7 @@ void rrc_conn_reest_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -12477,7 +12305,7 @@ SRSASN_CODE rrc_conn_reest_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -12494,7 +12322,7 @@ SRSASN_CODE rrc_conn_reest_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -12584,67 +12412,9 @@ void rrc_conn_reject_nb_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_reject_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_reject_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reject_nb_s::crit_exts_c_"); - } -} -rrc_conn_reject_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reject_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reject_nb_s::crit_exts_c_"); - } -} -rrc_conn_reject_nb_s::crit_exts_c_& -rrc_conn_reject_nb_s::crit_exts_c_::operator=(const rrc_conn_reject_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reject_nb_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_reject_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -12652,7 +12422,7 @@ void rrc_conn_reject_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -12666,7 +12436,7 @@ SRSASN_CODE rrc_conn_reject_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -12683,7 +12453,7 @@ SRSASN_CODE rrc_conn_reject_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -12776,117 +12546,59 @@ void rrc_conn_setup_nb_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_setup_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_setup_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; +} +void rrc_conn_setup_nb_s::crit_exts_c_::to_json(json_writer& j) const +{ + j.start_obj(); switch (type_) { case types::c1: - c.init(); + j.write_fieldname("c1"); + c.to_json(j); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "rrc_conn_setup_nb_s::crit_exts_c_"); } + j.end_obj(); } -rrc_conn_setup_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_setup_nb_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_setup_nb_s::crit_exts_c_::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { case types::c1: - c.init(other.c.get()); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "rrc_conn_setup_nb_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } + return SRSASN_SUCCESS; } -rrc_conn_setup_nb_s::crit_exts_c_& -rrc_conn_setup_nb_s::crit_exts_c_::operator=(const rrc_conn_setup_nb_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_setup_nb_s::crit_exts_c_::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; - } - set(other.type()); + types e; + e.unpack(bref); + set(e); switch (type_) { case types::c1: - c.set(other.c.get()); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: log_invalid_choice_id(type_, "rrc_conn_setup_nb_s::crit_exts_c_"); + return SRSASN_ERROR_DECODE_FAIL; } - - return *this; + return SRSASN_SUCCESS; } -void rrc_conn_setup_nb_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_nb_s::crit_exts_c_"); - } - j.end_obj(); -} -SRSASN_CODE rrc_conn_setup_nb_s::crit_exts_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_nb_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_setup_nb_s::crit_exts_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_nb_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -void rrc_conn_setup_nb_s::crit_exts_c_::c1_c_::set(types::options e) + +void rrc_conn_setup_nb_s::crit_exts_c_::c1_c_::set(types::options e) { type_ = e; } @@ -12965,68 +12677,9 @@ void rrc_early_data_complete_nb_r15_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_early_data_complete_nb_r15_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_early_data_complete_r15: - c.destroy(); - break; - default: - break; - } -} void rrc_early_data_complete_nb_r15_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_early_data_complete_r15: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_complete_nb_r15_s::crit_exts_c_"); - } -} -rrc_early_data_complete_nb_r15_s::crit_exts_c_::crit_exts_c_( - const rrc_early_data_complete_nb_r15_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_early_data_complete_r15: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_complete_nb_r15_s::crit_exts_c_"); - } -} -rrc_early_data_complete_nb_r15_s::crit_exts_c_& -rrc_early_data_complete_nb_r15_s::crit_exts_c_::operator=(const rrc_early_data_complete_nb_r15_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_early_data_complete_r15: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_complete_nb_r15_s::crit_exts_c_"); - } - - return *this; } void rrc_early_data_complete_nb_r15_s::crit_exts_c_::to_json(json_writer& j) const { @@ -13034,7 +12687,7 @@ void rrc_early_data_complete_nb_r15_s::crit_exts_c_::to_json(json_writer& j) con switch (type_) { case types::rrc_early_data_complete_r15: j.write_fieldname("rrcEarlyDataComplete-r15"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -13048,7 +12701,7 @@ SRSASN_CODE rrc_early_data_complete_nb_r15_s::crit_exts_c_::pack(bit_ref& bref) type_.pack(bref); switch (type_) { case types::rrc_early_data_complete_r15: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -13065,7 +12718,7 @@ SRSASN_CODE rrc_early_data_complete_nb_r15_s::crit_exts_c_::unpack(cbit_ref& bre set(e); switch (type_) { case types::rrc_early_data_complete_r15: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -13083,66 +12736,9 @@ std::string rrc_early_data_complete_nb_r15_s::crit_exts_c_::types_opts::to_strin } // DL-CCCH-MessageType-NB ::= CHOICE -void dl_ccch_msg_type_nb_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void dl_ccch_msg_type_nb_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_nb_c"); - } -} -dl_ccch_msg_type_nb_c::dl_ccch_msg_type_nb_c(const dl_ccch_msg_type_nb_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_nb_c"); - } -} -dl_ccch_msg_type_nb_c& dl_ccch_msg_type_nb_c::operator=(const dl_ccch_msg_type_nb_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_nb_c"); - } - - return *this; } void dl_ccch_msg_type_nb_c::to_json(json_writer& j) const { @@ -13150,7 +12746,7 @@ void dl_ccch_msg_type_nb_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -13164,7 +12760,7 @@ SRSASN_CODE dl_ccch_msg_type_nb_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -13181,7 +12777,7 @@ SRSASN_CODE dl_ccch_msg_type_nb_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -13952,67 +13548,9 @@ void dl_info_transfer_nb_s::to_json(json_writer& j) const j.end_obj(); } -void dl_info_transfer_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void dl_info_transfer_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_nb_s::crit_exts_c_"); - } -} -dl_info_transfer_nb_s::crit_exts_c_::crit_exts_c_(const dl_info_transfer_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_nb_s::crit_exts_c_"); - } -} -dl_info_transfer_nb_s::crit_exts_c_& -dl_info_transfer_nb_s::crit_exts_c_::operator=(const dl_info_transfer_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_nb_s::crit_exts_c_"); - } - - return *this; } void dl_info_transfer_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14020,7 +13558,7 @@ void dl_info_transfer_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14034,7 +13572,7 @@ SRSASN_CODE dl_info_transfer_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14051,7 +13589,7 @@ SRSASN_CODE dl_info_transfer_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14144,67 +13682,9 @@ void rrc_conn_recfg_nb_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_recfg_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_recfg_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_nb_s::crit_exts_c_"); - } -} -rrc_conn_recfg_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_recfg_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_nb_s::crit_exts_c_"); - } -} -rrc_conn_recfg_nb_s::crit_exts_c_& -rrc_conn_recfg_nb_s::crit_exts_c_::operator=(const rrc_conn_recfg_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_nb_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_recfg_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14212,7 +13692,7 @@ void rrc_conn_recfg_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14226,7 +13706,7 @@ SRSASN_CODE rrc_conn_recfg_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14243,7 +13723,7 @@ SRSASN_CODE rrc_conn_recfg_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14336,67 +13816,9 @@ void rrc_conn_release_nb_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_release_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_release_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_release_nb_s::crit_exts_c_"); - } -} -rrc_conn_release_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_release_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_release_nb_s::crit_exts_c_"); - } -} -rrc_conn_release_nb_s::crit_exts_c_& -rrc_conn_release_nb_s::crit_exts_c_::operator=(const rrc_conn_release_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_release_nb_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_release_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14404,7 +13826,7 @@ void rrc_conn_release_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14418,7 +13840,7 @@ SRSASN_CODE rrc_conn_release_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14435,7 +13857,7 @@ SRSASN_CODE rrc_conn_release_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14528,67 +13950,9 @@ void rrc_conn_resume_nb_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_resume_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void rrc_conn_resume_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_nb_s::crit_exts_c_"); - } -} -rrc_conn_resume_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_resume_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_nb_s::crit_exts_c_"); - } -} -rrc_conn_resume_nb_s::crit_exts_c_& -rrc_conn_resume_nb_s::crit_exts_c_::operator=(const rrc_conn_resume_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_nb_s::crit_exts_c_"); - } - - return *this; } void rrc_conn_resume_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14596,7 +13960,7 @@ void rrc_conn_resume_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14610,7 +13974,7 @@ SRSASN_CODE rrc_conn_resume_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14627,7 +13991,7 @@ SRSASN_CODE rrc_conn_resume_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14720,67 +14084,9 @@ void ue_cap_enquiry_nb_s::to_json(json_writer& j) const j.end_obj(); } -void ue_cap_enquiry_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_cap_enquiry_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_nb_s::crit_exts_c_"); - } -} -ue_cap_enquiry_nb_s::crit_exts_c_::crit_exts_c_(const ue_cap_enquiry_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_nb_s::crit_exts_c_"); - } -} -ue_cap_enquiry_nb_s::crit_exts_c_& -ue_cap_enquiry_nb_s::crit_exts_c_::operator=(const ue_cap_enquiry_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_nb_s::crit_exts_c_"); - } - - return *this; } void ue_cap_enquiry_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -14788,7 +14094,7 @@ void ue_cap_enquiry_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -14802,7 +14108,7 @@ SRSASN_CODE ue_cap_enquiry_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -14819,7 +14125,7 @@ SRSASN_CODE ue_cap_enquiry_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -14889,66 +14195,9 @@ std::string ue_cap_enquiry_nb_s::crit_exts_c_::c1_c_::types_opts::to_string() co } // DL-DCCH-MessageType-NB ::= CHOICE -void dl_dcch_msg_type_nb_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void dl_dcch_msg_type_nb_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_nb_c"); - } -} -dl_dcch_msg_type_nb_c::dl_dcch_msg_type_nb_c(const dl_dcch_msg_type_nb_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_nb_c"); - } -} -dl_dcch_msg_type_nb_c& dl_dcch_msg_type_nb_c::operator=(const dl_dcch_msg_type_nb_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_nb_c"); - } - - return *this; } void dl_dcch_msg_type_nb_c::to_json(json_writer& j) const { @@ -14956,7 +14205,7 @@ void dl_dcch_msg_type_nb_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -14970,7 +14219,7 @@ SRSASN_CODE dl_dcch_msg_type_nb_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -14987,7 +14236,7 @@ SRSASN_CODE dl_dcch_msg_type_nb_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -15282,424 +14531,367 @@ void dl_dcch_msg_nb_s::to_json(json_writer& j) const j.end_array(); } -// PhyLayerParameters-NB-r13 ::= SEQUENCE -SRSASN_CODE phy_layer_params_nb_r13_s::pack(bit_ref& bref) const +// SupportedBand-NB-r13 ::= SEQUENCE +SRSASN_CODE supported_band_nb_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(multi_tone_r13_present, 1)); - HANDLE_CODE(bref.pack(multi_carrier_r13_present, 1)); + HANDLE_CODE(bref.pack(pwr_class_nb_minus20dbm_r13_present, 1)); + + HANDLE_CODE(pack_integer(bref, band_r13, (uint16_t)1u, (uint16_t)256u)); return SRSASN_SUCCESS; } -SRSASN_CODE phy_layer_params_nb_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE supported_band_nb_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(multi_tone_r13_present, 1)); - HANDLE_CODE(bref.unpack(multi_carrier_r13_present, 1)); + HANDLE_CODE(bref.unpack(pwr_class_nb_minus20dbm_r13_present, 1)); + + HANDLE_CODE(unpack_integer(band_r13, bref, (uint16_t)1u, (uint16_t)256u)); return SRSASN_SUCCESS; } -void phy_layer_params_nb_r13_s::to_json(json_writer& j) const +void supported_band_nb_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (multi_tone_r13_present) { - j.write_str("multiTone-r13", "supported"); - } - if (multi_carrier_r13_present) { - j.write_str("multiCarrier-r13", "supported"); + j.write_int("band-r13", band_r13); + if (pwr_class_nb_minus20dbm_r13_present) { + j.write_str("powerClassNB-20dBm-r13", "supported"); } j.end_obj(); } -// PhyLayerParameters-NB-v1430 ::= SEQUENCE -SRSASN_CODE phy_layer_params_nb_v1430_s::pack(bit_ref& bref) const +// AccessStratumRelease-NB-r13 ::= ENUMERATED +std::string access_stratum_release_nb_r13_opts::to_string() const { - HANDLE_CODE(bref.pack(multi_carrier_nprach_r14_present, 1)); - HANDLE_CODE(bref.pack(two_harq_processes_r14_present, 1)); - - return SRSASN_SUCCESS; + static const char* options[] = {"rel13", "rel14", "rel15", "spare5", "spare4", "spare3", "spare2", "spare1"}; + return convert_enum_idx(options, 8, value, "access_stratum_release_nb_r13_e"); } -SRSASN_CODE phy_layer_params_nb_v1430_s::unpack(cbit_ref& bref) +uint8_t access_stratum_release_nb_r13_opts::to_number() const { - HANDLE_CODE(bref.unpack(multi_carrier_nprach_r14_present, 1)); - HANDLE_CODE(bref.unpack(two_harq_processes_r14_present, 1)); + static const uint8_t options[] = {13, 14, 15}; + return map_enum_number(options, 3, value, "access_stratum_release_nb_r13_e"); +} - return SRSASN_SUCCESS; -} -void phy_layer_params_nb_v1430_s::to_json(json_writer& j) const +// HandoverPreparationInformation-NB-Ext-r14-IEs ::= SEQUENCE +SRSASN_CODE ho_prep_info_nb_ext_r14_ies_s::pack(bit_ref& bref) const { - j.start_obj(); - if (multi_carrier_nprach_r14_present) { - j.write_str("multiCarrier-NPRACH-r14", "supported"); - } - if (two_harq_processes_r14_present) { - j.write_str("twoHARQ-Processes-r14", "supported"); - } - j.end_obj(); -} + HANDLE_CODE(bref.pack(ue_radio_access_cap_info_ext_r14_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); -// PhyLayerParameters-NB-v1530 ::= SEQUENCE -SRSASN_CODE phy_layer_params_nb_v1530_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(mixed_operation_mode_r15_present, 1)); - HANDLE_CODE(bref.pack(sr_with_harq_ack_r15_present, 1)); - HANDLE_CODE(bref.pack(sr_without_harq_ack_r15_present, 1)); - HANDLE_CODE(bref.pack(nprach_format2_r15_present, 1)); - HANDLE_CODE(bref.pack(add_tx_sib1_r15_present, 1)); - HANDLE_CODE(bref.pack(npusch_minus3dot75k_hz_scs_tdd_r15_present, 1)); + if (ue_radio_access_cap_info_ext_r14_present) { + HANDLE_CODE(ue_radio_access_cap_info_ext_r14.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE phy_layer_params_nb_v1530_s::unpack(cbit_ref& bref) +SRSASN_CODE ho_prep_info_nb_ext_r14_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(mixed_operation_mode_r15_present, 1)); - HANDLE_CODE(bref.unpack(sr_with_harq_ack_r15_present, 1)); - HANDLE_CODE(bref.unpack(sr_without_harq_ack_r15_present, 1)); - HANDLE_CODE(bref.unpack(nprach_format2_r15_present, 1)); - HANDLE_CODE(bref.unpack(add_tx_sib1_r15_present, 1)); - HANDLE_CODE(bref.unpack(npusch_minus3dot75k_hz_scs_tdd_r15_present, 1)); + HANDLE_CODE(bref.unpack(ue_radio_access_cap_info_ext_r14_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (ue_radio_access_cap_info_ext_r14_present) { + HANDLE_CODE(ue_radio_access_cap_info_ext_r14.unpack(bref)); + } return SRSASN_SUCCESS; } -void phy_layer_params_nb_v1530_s::to_json(json_writer& j) const +void ho_prep_info_nb_ext_r14_ies_s::to_json(json_writer& j) const { j.start_obj(); - if (mixed_operation_mode_r15_present) { - j.write_str("mixedOperationMode-r15", "supported"); - } - if (sr_with_harq_ack_r15_present) { - j.write_str("sr-WithHARQ-ACK-r15", "supported"); - } - if (sr_without_harq_ack_r15_present) { - j.write_str("sr-WithoutHARQ-ACK-r15", "supported"); - } - if (nprach_format2_r15_present) { - j.write_str("nprach-Format2-r15", "supported"); - } - if (add_tx_sib1_r15_present) { - j.write_str("additionalTransmissionSIB1-r15", "supported"); + if (ue_radio_access_cap_info_ext_r14_present) { + j.write_str("ue-RadioAccessCapabilityInfoExt-r14", ue_radio_access_cap_info_ext_r14.to_string()); } - if (npusch_minus3dot75k_hz_scs_tdd_r15_present) { - j.write_str("npusch-3dot75kHz-SCS-TDD-r15", "supported"); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } j.end_obj(); } -// MAC-Parameters-NB-v1530 ::= SEQUENCE -SRSASN_CODE mac_params_nb_v1530_s::pack(bit_ref& bref) const +// PDCP-Parameters-NB-r13 ::= SEQUENCE +SRSASN_CODE pdcp_params_nb_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(sr_sps_bsr_r15_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(max_num_rohc_context_sessions_r13_present, 1)); + + HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0002, 1)); + HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0003, 1)); + HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0004, 1)); + HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0006, 1)); + HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0102, 1)); + HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0103, 1)); + HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0104, 1)); + if (max_num_rohc_context_sessions_r13_present) { + HANDLE_CODE(max_num_rohc_context_sessions_r13.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE mac_params_nb_v1530_s::unpack(cbit_ref& bref) +SRSASN_CODE pdcp_params_nb_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(sr_sps_bsr_r15_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(max_num_rohc_context_sessions_r13_present, 1)); + + HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0002, 1)); + HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0003, 1)); + HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0004, 1)); + HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0006, 1)); + HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0102, 1)); + HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0103, 1)); + HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0104, 1)); + if (max_num_rohc_context_sessions_r13_present) { + HANDLE_CODE(max_num_rohc_context_sessions_r13.unpack(bref)); + } return SRSASN_SUCCESS; } -void mac_params_nb_v1530_s::to_json(json_writer& j) const +void pdcp_params_nb_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (sr_sps_bsr_r15_present) { - j.write_str("sr-SPS-BSR-r15", "supported"); + j.write_fieldname("supportedROHC-Profiles-r13"); + j.start_obj(); + j.write_bool("profile0x0002", supported_rohc_profiles_r13.profile0x0002); + j.write_bool("profile0x0003", supported_rohc_profiles_r13.profile0x0003); + j.write_bool("profile0x0004", supported_rohc_profiles_r13.profile0x0004); + j.write_bool("profile0x0006", supported_rohc_profiles_r13.profile0x0006); + j.write_bool("profile0x0102", supported_rohc_profiles_r13.profile0x0102); + j.write_bool("profile0x0103", supported_rohc_profiles_r13.profile0x0103); + j.write_bool("profile0x0104", supported_rohc_profiles_r13.profile0x0104); + j.end_obj(); + if (max_num_rohc_context_sessions_r13_present) { + j.write_str("maxNumberROHC-ContextSessions-r13", max_num_rohc_context_sessions_r13.to_string()); } j.end_obj(); } -// RLC-Parameters-NB-r15 ::= SEQUENCE -SRSASN_CODE rlc_params_nb_r15_s::pack(bit_ref& bref) const +std::string pdcp_params_nb_r13_s::max_num_rohc_context_sessions_r13_opts::to_string() const { - HANDLE_CODE(bref.pack(rlc_um_r15_present, 1)); + static const char* options[] = {"cs2", "cs4", "cs8", "cs12"}; + return convert_enum_idx(options, 4, value, "pdcp_params_nb_r13_s::max_num_rohc_context_sessions_r13_e_"); +} +uint8_t pdcp_params_nb_r13_s::max_num_rohc_context_sessions_r13_opts::to_number() const +{ + static const uint8_t options[] = {2, 4, 8, 12}; + return map_enum_number(options, 4, value, "pdcp_params_nb_r13_s::max_num_rohc_context_sessions_r13_e_"); +} + +// PhyLayerParameters-NB-r13 ::= SEQUENCE +SRSASN_CODE phy_layer_params_nb_r13_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(multi_tone_r13_present, 1)); + HANDLE_CODE(bref.pack(multi_carrier_r13_present, 1)); return SRSASN_SUCCESS; } -SRSASN_CODE rlc_params_nb_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE phy_layer_params_nb_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(rlc_um_r15_present, 1)); + HANDLE_CODE(bref.unpack(multi_tone_r13_present, 1)); + HANDLE_CODE(bref.unpack(multi_carrier_r13_present, 1)); return SRSASN_SUCCESS; } -void rlc_params_nb_r15_s::to_json(json_writer& j) const +void phy_layer_params_nb_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (rlc_um_r15_present) { - j.write_str("rlc-UM-r15", "supported"); + if (multi_tone_r13_present) { + j.write_str("multiTone-r13", "supported"); + } + if (multi_carrier_r13_present) { + j.write_str("multiCarrier-r13", "supported"); } j.end_obj(); } -// TDD-UE-Capability-NB-r15 ::= SEQUENCE -SRSASN_CODE tdd_ue_cap_nb_r15_s::pack(bit_ref& bref) const +// RF-Parameters-NB-r13 ::= SEQUENCE +SRSASN_CODE rf_params_nb_r13_s::pack(bit_ref& bref) const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(ue_category_nb_r15_present, 1)); - HANDLE_CODE(bref.pack(phy_layer_params_rel13_r15_present, 1)); - HANDLE_CODE(bref.pack(phy_layer_params_rel14_r15_present, 1)); - HANDLE_CODE(bref.pack(phy_layer_params_v1530_present, 1)); + HANDLE_CODE(bref.pack(multi_ns_pmax_r13_present, 1)); - if (phy_layer_params_rel13_r15_present) { - HANDLE_CODE(phy_layer_params_rel13_r15.pack(bref)); - } - if (phy_layer_params_rel14_r15_present) { - HANDLE_CODE(phy_layer_params_rel14_r15.pack(bref)); - } - if (phy_layer_params_v1530_present) { - HANDLE_CODE(phy_layer_params_v1530.pack(bref)); - } + HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_r13, 1, 64)); return SRSASN_SUCCESS; } -SRSASN_CODE tdd_ue_cap_nb_r15_s::unpack(cbit_ref& bref) +SRSASN_CODE rf_params_nb_r13_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(ue_category_nb_r15_present, 1)); - HANDLE_CODE(bref.unpack(phy_layer_params_rel13_r15_present, 1)); - HANDLE_CODE(bref.unpack(phy_layer_params_rel14_r15_present, 1)); - HANDLE_CODE(bref.unpack(phy_layer_params_v1530_present, 1)); + HANDLE_CODE(bref.unpack(multi_ns_pmax_r13_present, 1)); - if (phy_layer_params_rel13_r15_present) { - HANDLE_CODE(phy_layer_params_rel13_r15.unpack(bref)); - } - if (phy_layer_params_rel14_r15_present) { - HANDLE_CODE(phy_layer_params_rel14_r15.unpack(bref)); - } - if (phy_layer_params_v1530_present) { - HANDLE_CODE(phy_layer_params_v1530.unpack(bref)); - } + HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_r13, bref, 1, 64)); return SRSASN_SUCCESS; } -void tdd_ue_cap_nb_r15_s::to_json(json_writer& j) const +void rf_params_nb_r13_s::to_json(json_writer& j) const { j.start_obj(); - if (ue_category_nb_r15_present) { - j.write_str("ue-Category-NB-r15", "nb2"); - } - if (phy_layer_params_rel13_r15_present) { - j.write_fieldname("phyLayerParametersRel13-r15"); - phy_layer_params_rel13_r15.to_json(j); - } - if (phy_layer_params_rel14_r15_present) { - j.write_fieldname("phyLayerParametersRel14-r15"); - phy_layer_params_rel14_r15.to_json(j); + j.start_array("supportedBandList-r13"); + for (const auto& e1 : supported_band_list_r13) { + e1.to_json(j); } - if (phy_layer_params_v1530_present) { - j.write_fieldname("phyLayerParameters-v1530"); - phy_layer_params_v1530.to_json(j); + j.end_array(); + if (multi_ns_pmax_r13_present) { + j.write_str("multiNS-Pmax-r13", "supported"); } j.end_obj(); } -// UE-Capability-NB-v1530-IEs ::= SEQUENCE -SRSASN_CODE ue_cap_nb_v1530_ies_s::pack(bit_ref& bref) const +// HandoverPreparationInformation-NB-v1380-IEs ::= SEQUENCE +SRSASN_CODE ho_prep_info_nb_v1380_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(early_data_up_r15_present, 1)); - HANDLE_CODE(bref.pack(phy_layer_params_v1530_present, 1)); - HANDLE_CODE(bref.pack(tdd_ue_cap_r15_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - HANDLE_CODE(rlc_params_r15.pack(bref)); - HANDLE_CODE(mac_params_v1530.pack(bref)); - if (phy_layer_params_v1530_present) { - HANDLE_CODE(phy_layer_params_v1530.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } - if (tdd_ue_cap_r15_present) { - HANDLE_CODE(tdd_ue_cap_r15.pack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE ue_cap_nb_v1530_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE ho_prep_info_nb_v1380_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(early_data_up_r15_present, 1)); - HANDLE_CODE(bref.unpack(phy_layer_params_v1530_present, 1)); - HANDLE_CODE(bref.unpack(tdd_ue_cap_r15_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(rlc_params_r15.unpack(bref)); - HANDLE_CODE(mac_params_v1530.unpack(bref)); - if (phy_layer_params_v1530_present) { - HANDLE_CODE(phy_layer_params_v1530.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - if (tdd_ue_cap_r15_present) { - HANDLE_CODE(tdd_ue_cap_r15.unpack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } return SRSASN_SUCCESS; } -void ue_cap_nb_v1530_ies_s::to_json(json_writer& j) const +void ho_prep_info_nb_v1380_ies_s::to_json(json_writer& j) const { j.start_obj(); - if (early_data_up_r15_present) { - j.write_str("earlyData-UP-r15", "supported"); - } - j.write_fieldname("rlc-Parameters-r15"); - rlc_params_r15.to_json(j); - j.write_fieldname("mac-Parameters-v1530"); - mac_params_v1530.to_json(j); - if (phy_layer_params_v1530_present) { - j.write_fieldname("phyLayerParameters-v1530"); - phy_layer_params_v1530.to_json(j); - } - if (tdd_ue_cap_r15_present) { - j.write_fieldname("tdd-UE-Capability-r15"); - tdd_ue_cap_r15.to_json(j); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } if (non_crit_ext_present) { j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - -// PhyLayerParameters-NB-v1440 ::= SEQUENCE -SRSASN_CODE phy_layer_params_nb_v1440_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(interference_randomisation_r14_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE phy_layer_params_nb_v1440_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(interference_randomisation_r14_present, 1)); - - return SRSASN_SUCCESS; -} -void phy_layer_params_nb_v1440_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (interference_randomisation_r14_present) { - j.write_str("interferenceRandomisation-r14", "supported"); + non_crit_ext.to_json(j); } j.end_obj(); } -// UE-Capability-NB-v14x0-IEs ::= SEQUENCE -SRSASN_CODE ue_cap_nb_v14x0_ies_s::pack(bit_ref& bref) const +// RRM-Config-NB ::= SEQUENCE +SRSASN_CODE rrm_cfg_nb_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(ue_inactive_time_present, 1)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (ue_inactive_time_present) { + HANDLE_CODE(ue_inactive_time.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE ue_cap_nb_v14x0_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE rrm_cfg_nb_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(ue_inactive_time_present, 1)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (ue_inactive_time_present) { + HANDLE_CODE(ue_inactive_time.unpack(bref)); } return SRSASN_SUCCESS; } -void ue_cap_nb_v14x0_ies_s::to_json(json_writer& j) const +void rrm_cfg_nb_s::to_json(json_writer& j) const { j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + if (ue_inactive_time_present) { + j.write_str("ue-InactiveTime", ue_inactive_time.to_string()); } j.end_obj(); } -// MAC-Parameters-NB-r14 ::= SEQUENCE -SRSASN_CODE mac_params_nb_r14_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(data_inact_mon_r14_present, 1)); - HANDLE_CODE(bref.pack(rai_support_r14_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE mac_params_nb_r14_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(data_inact_mon_r14_present, 1)); - HANDLE_CODE(bref.unpack(rai_support_r14_present, 1)); - - return SRSASN_SUCCESS; -} -void mac_params_nb_r14_s::to_json(json_writer& j) const +std::string rrm_cfg_nb_s::ue_inactive_time_opts::to_string() const { - j.start_obj(); - if (data_inact_mon_r14_present) { - j.write_str("dataInactMon-r14", "supported"); - } - if (rai_support_r14_present) { - j.write_str("rai-Support-r14", "supported"); - } - j.end_obj(); + static const char* options[] = { + "s1", "s2", "s3", "s5", "s7", "s10", "s15", "s20", "s25", "s30", + "s40", "s50", "min1", "min1s20", "min1s40", "min2", "min2s30", "min3", "min3s30", "min4", + "min5", "min6", "min7", "min8", "min9", "min10", "min12", "min14", "min17", "min20", + "min24", "min28", "min33", "min38", "min44", "min50", "hr1", "hr1min30", "hr2", "hr2min30", + "hr3", "hr3min30", "hr4", "hr5", "hr6", "hr8", "hr10", "hr13", "hr16", "hr20", + "day1", "day1hr12", "day2", "day2hr12", "day3", "day4", "day5", "day7", "day10", "day14", + "day19", "day24", "day30", "dayMoreThan30"}; + return convert_enum_idx(options, 64, value, "rrm_cfg_nb_s::ue_inactive_time_e_"); } -// RF-Parameters-NB-v1430 ::= SEQUENCE -SRSASN_CODE rf_params_nb_v1430_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(pwr_class_nb_minus14dbm_r14_present, 1)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rf_params_nb_v1430_s::unpack(cbit_ref& bref) +// UE-Capability-NB-r13 ::= SEQUENCE +SRSASN_CODE ue_cap_nb_r13_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.unpack(pwr_class_nb_minus14dbm_r14_present, 1)); + HANDLE_CODE(bref.pack(ue_category_nb_r13_present, 1)); + HANDLE_CODE(bref.pack(multiple_drb_r13_present, 1)); + HANDLE_CODE(bref.pack(pdcp_params_r13_present, 1)); + HANDLE_CODE(bref.pack(dummy_present, 1)); - return SRSASN_SUCCESS; -} -void rf_params_nb_v1430_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (pwr_class_nb_minus14dbm_r14_present) { - j.write_str("powerClassNB-14dBm-r14", "supported"); + HANDLE_CODE(access_stratum_release_r13.pack(bref)); + if (pdcp_params_r13_present) { + HANDLE_CODE(pdcp_params_r13.pack(bref)); } - j.end_obj(); -} - -// SupportedBand-NB-r13 ::= SEQUENCE -SRSASN_CODE supported_band_nb_r13_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(pwr_class_nb_minus20dbm_r13_present, 1)); - - HANDLE_CODE(pack_integer(bref, band_r13, (uint16_t)1u, (uint16_t)256u)); + HANDLE_CODE(phy_layer_params_r13.pack(bref)); + HANDLE_CODE(rf_params_r13.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE supported_band_nb_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE ue_cap_nb_r13_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(pwr_class_nb_minus20dbm_r13_present, 1)); + HANDLE_CODE(bref.unpack(ue_category_nb_r13_present, 1)); + HANDLE_CODE(bref.unpack(multiple_drb_r13_present, 1)); + HANDLE_CODE(bref.unpack(pdcp_params_r13_present, 1)); + HANDLE_CODE(bref.unpack(dummy_present, 1)); - HANDLE_CODE(unpack_integer(band_r13, bref, (uint16_t)1u, (uint16_t)256u)); + HANDLE_CODE(access_stratum_release_r13.unpack(bref)); + if (pdcp_params_r13_present) { + HANDLE_CODE(pdcp_params_r13.unpack(bref)); + } + HANDLE_CODE(phy_layer_params_r13.unpack(bref)); + HANDLE_CODE(rf_params_r13.unpack(bref)); return SRSASN_SUCCESS; } -void supported_band_nb_r13_s::to_json(json_writer& j) const +void ue_cap_nb_r13_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("band-r13", band_r13); - if (pwr_class_nb_minus20dbm_r13_present) { - j.write_str("powerClassNB-20dBm-r13", "supported"); + j.write_str("accessStratumRelease-r13", access_stratum_release_r13.to_string()); + if (ue_category_nb_r13_present) { + j.write_str("ue-Category-NB-r13", "nb1"); + } + if (multiple_drb_r13_present) { + j.write_str("multipleDRB-r13", "supported"); + } + if (pdcp_params_r13_present) { + j.write_fieldname("pdcp-Parameters-r13"); + pdcp_params_r13.to_json(j); + } + j.write_fieldname("phyLayerParameters-r13"); + phy_layer_params_r13.to_json(j); + j.write_fieldname("rf-Parameters-r13"); + rf_params_r13.to_json(j); + if (dummy_present) { + j.write_fieldname("dummy"); + j.start_obj(); + j.end_obj(); } j.end_obj(); } -// UE-Capability-NB-v1440-IEs ::= SEQUENCE -SRSASN_CODE ue_cap_nb_v1440_ies_s::pack(bit_ref& bref) const +// HandoverPreparationInformation-NB-IEs ::= SEQUENCE +SRSASN_CODE ho_prep_info_nb_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(phy_layer_params_v1440_present, 1)); + HANDLE_CODE(bref.pack(rrm_cfg_r13_present, 1)); + HANDLE_CODE(bref.pack(as_context_r13_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - if (phy_layer_params_v1440_present) { - HANDLE_CODE(phy_layer_params_v1440.pack(bref)); + HANDLE_CODE(ue_radio_access_cap_info_r13.pack(bref)); + HANDLE_CODE(as_cfg_r13.pack(bref)); + if (rrm_cfg_r13_present) { + HANDLE_CODE(rrm_cfg_r13.pack(bref)); + } + if (as_context_r13_present) { + HANDLE_CODE(as_context_r13.pack(bref)); } if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.pack(bref)); @@ -15707,13 +14899,19 @@ SRSASN_CODE ue_cap_nb_v1440_ies_s::pack(bit_ref& bref) const return SRSASN_SUCCESS; } -SRSASN_CODE ue_cap_nb_v1440_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE ho_prep_info_nb_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(phy_layer_params_v1440_present, 1)); + HANDLE_CODE(bref.unpack(rrm_cfg_r13_present, 1)); + HANDLE_CODE(bref.unpack(as_context_r13_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - if (phy_layer_params_v1440_present) { - HANDLE_CODE(phy_layer_params_v1440.unpack(bref)); + HANDLE_CODE(ue_radio_access_cap_info_r13.unpack(bref)); + HANDLE_CODE(as_cfg_r13.unpack(bref)); + if (rrm_cfg_r13_present) { + HANDLE_CODE(rrm_cfg_r13.unpack(bref)); + } + if (as_context_r13_present) { + HANDLE_CODE(as_context_r13.unpack(bref)); } if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.unpack(bref)); @@ -15721,12 +14919,20 @@ SRSASN_CODE ue_cap_nb_v1440_ies_s::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -void ue_cap_nb_v1440_ies_s::to_json(json_writer& j) const +void ho_prep_info_nb_ies_s::to_json(json_writer& j) const { j.start_obj(); - if (phy_layer_params_v1440_present) { - j.write_fieldname("phyLayerParameters-v1440"); - phy_layer_params_v1440.to_json(j); + j.write_fieldname("ue-RadioAccessCapabilityInfo-r13"); + ue_radio_access_cap_info_r13.to_json(j); + j.write_fieldname("as-Config-r13"); + as_cfg_r13.to_json(j); + if (rrm_cfg_r13_present) { + j.write_fieldname("rrm-Config-r13"); + rrm_cfg_r13.to_json(j); + } + if (as_context_r13_present) { + j.write_fieldname("as-Context-r13"); + as_context_r13.to_json(j); } if (non_crit_ext_present) { j.write_fieldname("nonCriticalExtension"); @@ -15735,1111 +14941,1163 @@ void ue_cap_nb_v1440_ies_s::to_json(json_writer& j) const j.end_obj(); } -// UE-Capability-NB-Ext-r14-IEs ::= SEQUENCE -SRSASN_CODE ue_cap_nb_ext_r14_ies_s::pack(bit_ref& bref) const +// HandoverPreparationInformation-NB ::= SEQUENCE +SRSASN_CODE ho_prep_info_nb_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(ue_category_nb_r14_present, 1)); - HANDLE_CODE(bref.pack(mac_params_r14_present, 1)); - HANDLE_CODE(bref.pack(phy_layer_params_v1430_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(crit_exts.pack(bref)); - if (mac_params_r14_present) { - HANDLE_CODE(mac_params_r14.pack(bref)); - } - if (phy_layer_params_v1430_present) { - HANDLE_CODE(phy_layer_params_v1430.pack(bref)); - } - HANDLE_CODE(rf_params_v1430.pack(bref)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } + return SRSASN_SUCCESS; +} +SRSASN_CODE ho_prep_info_nb_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(crit_exts.unpack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE ue_cap_nb_ext_r14_ies_s::unpack(cbit_ref& bref) +void ho_prep_info_nb_s::to_json(json_writer& j) const { - HANDLE_CODE(bref.unpack(ue_category_nb_r14_present, 1)); - HANDLE_CODE(bref.unpack(mac_params_r14_present, 1)); - HANDLE_CODE(bref.unpack(phy_layer_params_v1430_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + j.start_obj(); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} - if (mac_params_r14_present) { - HANDLE_CODE(mac_params_r14.unpack(bref)); +void ho_prep_info_nb_s::crit_exts_c_::set(types::options e) +{ + type_ = e; +} +void ho_prep_info_nb_s::crit_exts_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::c1: + j.write_fieldname("c1"); + c.to_json(j); + break; + case types::crit_exts_future: + break; + default: + log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); } - if (phy_layer_params_v1430_present) { - HANDLE_CODE(phy_layer_params_v1430.unpack(bref)); + j.end_obj(); +} +SRSASN_CODE ho_prep_info_nb_s::crit_exts_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::c1: + HANDLE_CODE(c.pack(bref)); + break; + case types::crit_exts_future: + break; + default: + log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } - HANDLE_CODE(rf_params_v1430.unpack(bref)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ho_prep_info_nb_s::crit_exts_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::c1: + HANDLE_CODE(c.unpack(bref)); + break; + case types::crit_exts_future: + break; + default: + log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); + return SRSASN_ERROR_DECODE_FAIL; } - return SRSASN_SUCCESS; } -void ue_cap_nb_ext_r14_ies_s::to_json(json_writer& j) const + +void ho_prep_info_nb_s::crit_exts_c_::c1_c_::set(types::options e) +{ + type_ = e; +} +void ho_prep_info_nb_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const { j.start_obj(); - if (ue_category_nb_r14_present) { - j.write_str("ue-Category-NB-r14", "nb2"); - } - if (mac_params_r14_present) { - j.write_fieldname("mac-Parameters-r14"); - mac_params_r14.to_json(j); - } - if (phy_layer_params_v1430_present) { - j.write_fieldname("phyLayerParameters-v1430"); - phy_layer_params_v1430.to_json(j); - } - j.write_fieldname("rf-Parameters-v1430"); - rf_params_v1430.to_json(j); - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + switch (type_) { + case types::ho_prep_info_r13: + j.write_fieldname("handoverPreparationInformation-r13"); + c.to_json(j); + break; + case types::spare3: + break; + case types::spare2: + break; + case types::spare1: + break; + default: + log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_::c1_c_"); } j.end_obj(); } - -// AccessStratumRelease-NB-r13 ::= ENUMERATED -std::string access_stratum_release_nb_r13_opts::to_string() const +SRSASN_CODE ho_prep_info_nb_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const { - static const char* options[] = {"rel13", "rel14", "rel15", "spare5", "spare4", "spare3", "spare2", "spare1"}; - return convert_enum_idx(options, 8, value, "access_stratum_release_nb_r13_e"); + type_.pack(bref); + switch (type_) { + case types::ho_prep_info_r13: + HANDLE_CODE(c.pack(bref)); + break; + case types::spare3: + break; + case types::spare2: + break; + case types::spare1: + break; + default: + log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_::c1_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; } -uint8_t access_stratum_release_nb_r13_opts::to_number() const +SRSASN_CODE ho_prep_info_nb_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref) { - static const uint8_t options[] = {13, 14, 15}; - return map_enum_number(options, 3, value, "access_stratum_release_nb_r13_e"); + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::ho_prep_info_r13: + HANDLE_CODE(c.unpack(bref)); + break; + case types::spare3: + break; + case types::spare2: + break; + case types::spare1: + break; + default: + log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_::c1_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; } -// HandoverPreparationInformation-NB-Ext-r14-IEs ::= SEQUENCE -SRSASN_CODE ho_prep_info_nb_ext_r14_ies_s::pack(bit_ref& bref) const +std::string ho_prep_info_nb_s::crit_exts_c_::c1_c_::types_opts::to_string() const { - HANDLE_CODE(bref.pack(ue_radio_access_cap_info_ext_r14_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + static const char* options[] = {"handoverPreparationInformation-r13", "spare3", "spare2", "spare1"}; + return convert_enum_idx(options, 4, value, "ho_prep_info_nb_s::crit_exts_c_::c1_c_::types"); +} - if (ue_radio_access_cap_info_ext_r14_present) { - HANDLE_CODE(ue_radio_access_cap_info_ext_r14.pack(bref)); - } +// MeasResultServCell-NB-r14 ::= SEQUENCE +SRSASN_CODE meas_result_serv_cell_nb_r14_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, nrsrp_result_r14, (uint8_t)0u, (uint8_t)113u)); + HANDLE_CODE(pack_integer(bref, nrsrq_result_r14, (int8_t)-30, (int8_t)46)); return SRSASN_SUCCESS; } -SRSASN_CODE ho_prep_info_nb_ext_r14_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE meas_result_serv_cell_nb_r14_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(ue_radio_access_cap_info_ext_r14_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (ue_radio_access_cap_info_ext_r14_present) { - HANDLE_CODE(ue_radio_access_cap_info_ext_r14.unpack(bref)); - } + HANDLE_CODE(unpack_integer(nrsrp_result_r14, bref, (uint8_t)0u, (uint8_t)113u)); + HANDLE_CODE(unpack_integer(nrsrq_result_r14, bref, (int8_t)-30, (int8_t)46)); return SRSASN_SUCCESS; } -void ho_prep_info_nb_ext_r14_ies_s::to_json(json_writer& j) const +void meas_result_serv_cell_nb_r14_s::to_json(json_writer& j) const { j.start_obj(); - if (ue_radio_access_cap_info_ext_r14_present) { - j.write_str("ue-RadioAccessCapabilityInfoExt-r14", ue_radio_access_cap_info_ext_r14.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } + j.write_int("nrsrpResult-r14", nrsrp_result_r14); + j.write_int("nrsrqResult-r14", nrsrq_result_r14); j.end_obj(); } -// PDCP-Parameters-NB-r13 ::= SEQUENCE -SRSASN_CODE pdcp_params_nb_r13_s::pack(bit_ref& bref) const +// PagingRecord-NB-r13 ::= SEQUENCE +SRSASN_CODE paging_record_nb_r13_s::pack(bit_ref& bref) const { bref.pack(ext, 1); - HANDLE_CODE(bref.pack(max_num_rohc_context_sessions_r13_present, 1)); - - HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0002, 1)); - HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0003, 1)); - HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0004, 1)); - HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0006, 1)); - HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0102, 1)); - HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0103, 1)); - HANDLE_CODE(bref.pack(supported_rohc_profiles_r13.profile0x0104, 1)); - if (max_num_rohc_context_sessions_r13_present) { - HANDLE_CODE(max_num_rohc_context_sessions_r13.pack(bref)); - } + HANDLE_CODE(ue_id_r13.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE pdcp_params_nb_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE paging_record_nb_r13_s::unpack(cbit_ref& bref) { bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(max_num_rohc_context_sessions_r13_present, 1)); - - HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0002, 1)); - HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0003, 1)); - HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0004, 1)); - HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0006, 1)); - HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0102, 1)); - HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0103, 1)); - HANDLE_CODE(bref.unpack(supported_rohc_profiles_r13.profile0x0104, 1)); - if (max_num_rohc_context_sessions_r13_present) { - HANDLE_CODE(max_num_rohc_context_sessions_r13.unpack(bref)); - } + HANDLE_CODE(ue_id_r13.unpack(bref)); return SRSASN_SUCCESS; } -void pdcp_params_nb_r13_s::to_json(json_writer& j) const +void paging_record_nb_r13_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("supportedROHC-Profiles-r13"); - j.start_obj(); - j.write_bool("profile0x0002", supported_rohc_profiles_r13.profile0x0002); - j.write_bool("profile0x0003", supported_rohc_profiles_r13.profile0x0003); - j.write_bool("profile0x0004", supported_rohc_profiles_r13.profile0x0004); - j.write_bool("profile0x0006", supported_rohc_profiles_r13.profile0x0006); - j.write_bool("profile0x0102", supported_rohc_profiles_r13.profile0x0102); - j.write_bool("profile0x0103", supported_rohc_profiles_r13.profile0x0103); - j.write_bool("profile0x0104", supported_rohc_profiles_r13.profile0x0104); - j.end_obj(); - if (max_num_rohc_context_sessions_r13_present) { - j.write_str("maxNumberROHC-ContextSessions-r13", max_num_rohc_context_sessions_r13.to_string()); - } + j.write_fieldname("ue-Identity-r13"); + ue_id_r13.to_json(j); j.end_obj(); } -std::string pdcp_params_nb_r13_s::max_num_rohc_context_sessions_r13_opts::to_string() const -{ - static const char* options[] = {"cs2", "cs4", "cs8", "cs12"}; - return convert_enum_idx(options, 4, value, "pdcp_params_nb_r13_s::max_num_rohc_context_sessions_r13_e_"); -} -uint8_t pdcp_params_nb_r13_s::max_num_rohc_context_sessions_r13_opts::to_number() const -{ - static const uint8_t options[] = {2, 4, 8, 12}; - return map_enum_number(options, 4, value, "pdcp_params_nb_r13_s::max_num_rohc_context_sessions_r13_e_"); -} - -// RF-Parameters-NB-r13 ::= SEQUENCE -SRSASN_CODE rf_params_nb_r13_s::pack(bit_ref& bref) const +// Paging-NB ::= SEQUENCE +SRSASN_CODE paging_nb_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(multi_ns_pmax_r13_present, 1)); + HANDLE_CODE(bref.pack(paging_record_list_r13_present, 1)); + HANDLE_CODE(bref.pack(sys_info_mod_r13_present, 1)); + HANDLE_CODE(bref.pack(sys_info_mod_e_drx_r13_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_r13, 1, 64)); + if (paging_record_list_r13_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, paging_record_list_r13, 1, 16)); + } return SRSASN_SUCCESS; } -SRSASN_CODE rf_params_nb_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE paging_nb_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(multi_ns_pmax_r13_present, 1)); + HANDLE_CODE(bref.unpack(paging_record_list_r13_present, 1)); + HANDLE_CODE(bref.unpack(sys_info_mod_r13_present, 1)); + HANDLE_CODE(bref.unpack(sys_info_mod_e_drx_r13_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_r13, bref, 1, 64)); + if (paging_record_list_r13_present) { + HANDLE_CODE(unpack_dyn_seq_of(paging_record_list_r13, bref, 1, 16)); + } return SRSASN_SUCCESS; } -void rf_params_nb_r13_s::to_json(json_writer& j) const +void paging_nb_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("supportedBandList-r13"); - for (const auto& e1 : supported_band_list_r13) { - e1.to_json(j); + if (paging_record_list_r13_present) { + j.start_array("pagingRecordList-r13"); + for (const auto& e1 : paging_record_list_r13) { + e1.to_json(j); + } + j.end_array(); } - j.end_array(); - if (multi_ns_pmax_r13_present) { - j.write_str("multiNS-Pmax-r13", "supported"); + if (sys_info_mod_r13_present) { + j.write_str("systemInfoModification-r13", "true"); + } + if (sys_info_mod_e_drx_r13_present) { + j.write_str("systemInfoModification-eDRX-r13", "true"); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } j.end_obj(); } -// HandoverPreparationInformation-NB-v1380-IEs ::= SEQUENCE -SRSASN_CODE ho_prep_info_nb_v1380_ies_s::pack(bit_ref& bref) const +// PCCH-MessageType-NB ::= CHOICE +void pcch_msg_type_nb_c::set(types::options e) { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + type_ = e; +} +void pcch_msg_type_nb_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::c1: + j.write_fieldname("c1"); + c.to_json(j); + break; + case types::msg_class_ext: + break; + default: + log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + j.end_obj(); +} +SRSASN_CODE pcch_msg_type_nb_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::c1: + HANDLE_CODE(c.pack(bref)); + break; + case types::msg_class_ext: + break; + default: + log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); + return SRSASN_ERROR_ENCODE_FAIL; } - return SRSASN_SUCCESS; } -SRSASN_CODE ho_prep_info_nb_v1380_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE pcch_msg_type_nb_c::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::c1: + HANDLE_CODE(c.unpack(bref)); + break; + case types::msg_class_ext: + break; + default: + log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); + return SRSASN_ERROR_DECODE_FAIL; } - return SRSASN_SUCCESS; } -void ho_prep_info_nb_v1380_ies_s::to_json(json_writer& j) const + +void pcch_msg_type_nb_c::c1_c_::to_json(json_writer& j) const { j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } + j.write_fieldname("paging-r13"); + c.to_json(j); j.end_obj(); } +SRSASN_CODE pcch_msg_type_nb_c::c1_c_::pack(bit_ref& bref) const +{ + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE pcch_msg_type_nb_c::c1_c_::unpack(cbit_ref& bref) +{ + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} -// RRM-Config-NB ::= SEQUENCE -SRSASN_CODE rrm_cfg_nb_s::pack(bit_ref& bref) const +std::string pcch_msg_type_nb_c::c1_c_::types_opts::to_string() const { - bref.pack(ext, 1); - HANDLE_CODE(bref.pack(ue_inactive_time_present, 1)); + static const char* options[] = {"paging-r13"}; + return convert_enum_idx(options, 1, value, "pcch_msg_type_nb_c::c1_c_::types"); +} - if (ue_inactive_time_present) { - HANDLE_CODE(ue_inactive_time.pack(bref)); - } +std::string pcch_msg_type_nb_c::types_opts::to_string() const +{ + static const char* options[] = {"c1", "messageClassExtension"}; + return convert_enum_idx(options, 2, value, "pcch_msg_type_nb_c::types"); +} +uint8_t pcch_msg_type_nb_c::types_opts::to_number() const +{ + static const uint8_t options[] = {1}; + return map_enum_number(options, 1, value, "pcch_msg_type_nb_c::types"); +} + +// PCCH-Message-NB ::= SEQUENCE +SRSASN_CODE pcch_msg_nb_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(msg.pack(bref)); + + bref.align_bytes_zero(); return SRSASN_SUCCESS; } -SRSASN_CODE rrm_cfg_nb_s::unpack(cbit_ref& bref) +SRSASN_CODE pcch_msg_nb_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); - HANDLE_CODE(bref.unpack(ue_inactive_time_present, 1)); + HANDLE_CODE(msg.unpack(bref)); - if (ue_inactive_time_present) { - HANDLE_CODE(ue_inactive_time.unpack(bref)); - } + bref.align_bytes(); return SRSASN_SUCCESS; } -void rrm_cfg_nb_s::to_json(json_writer& j) const +void pcch_msg_nb_s::to_json(json_writer& j) const { + j.start_array(); j.start_obj(); - if (ue_inactive_time_present) { - j.write_str("ue-InactiveTime", ue_inactive_time.to_string()); - } + j.start_obj("PCCH-Message-NB"); + j.write_fieldname("message"); + msg.to_json(j); j.end_obj(); + j.end_obj(); + j.end_array(); } -std::string rrm_cfg_nb_s::ue_inactive_time_opts::to_string() const -{ - static const char* options[] = { - "s1", "s2", "s3", "s5", "s7", "s10", "s15", "s20", "s25", "s30", - "s40", "s50", "min1", "min1s20", "min1s40", "min2", "min2s30", "min3", "min3s30", "min4", - "min5", "min6", "min7", "min8", "min9", "min10", "min12", "min14", "min17", "min20", - "min24", "min28", "min33", "min38", "min44", "min50", "hr1", "hr1min30", "hr2", "hr2min30", - "hr3", "hr3min30", "hr4", "hr5", "hr6", "hr8", "hr10", "hr13", "hr16", "hr20", - "day1", "day1hr12", "day2", "day2hr12", "day3", "day4", "day5", "day7", "day10", "day14", - "day19", "day24", "day30", "dayMoreThan30"}; - return convert_enum_idx(options, 64, value, "rrm_cfg_nb_s::ue_inactive_time_e_"); -} - -// UE-Capability-NB-r13 ::= SEQUENCE -SRSASN_CODE ue_cap_nb_r13_s::pack(bit_ref& bref) const +// PCI-ARFCN-NB-r14 ::= SEQUENCE +SRSASN_CODE pci_arfcn_nb_r14_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(ue_category_nb_r13_present, 1)); - HANDLE_CODE(bref.pack(multiple_drb_r13_present, 1)); - HANDLE_CODE(bref.pack(pdcp_params_r13_present, 1)); - HANDLE_CODE(bref.pack(dummy_present, 1)); + HANDLE_CODE(bref.pack(carrier_freq_r14_present, 1)); - HANDLE_CODE(access_stratum_release_r13.pack(bref)); - if (pdcp_params_r13_present) { - HANDLE_CODE(pdcp_params_r13.pack(bref)); + HANDLE_CODE(pack_integer(bref, pci_r14, (uint16_t)0u, (uint16_t)503u)); + if (carrier_freq_r14_present) { + HANDLE_CODE(carrier_freq_r14.pack(bref)); } - HANDLE_CODE(phy_layer_params_r13.pack(bref)); - HANDLE_CODE(rf_params_r13.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE ue_cap_nb_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE pci_arfcn_nb_r14_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(ue_category_nb_r13_present, 1)); - HANDLE_CODE(bref.unpack(multiple_drb_r13_present, 1)); - HANDLE_CODE(bref.unpack(pdcp_params_r13_present, 1)); - HANDLE_CODE(bref.unpack(dummy_present, 1)); + HANDLE_CODE(bref.unpack(carrier_freq_r14_present, 1)); - HANDLE_CODE(access_stratum_release_r13.unpack(bref)); - if (pdcp_params_r13_present) { - HANDLE_CODE(pdcp_params_r13.unpack(bref)); + HANDLE_CODE(unpack_integer(pci_r14, bref, (uint16_t)0u, (uint16_t)503u)); + if (carrier_freq_r14_present) { + HANDLE_CODE(carrier_freq_r14.unpack(bref)); } - HANDLE_CODE(phy_layer_params_r13.unpack(bref)); - HANDLE_CODE(rf_params_r13.unpack(bref)); return SRSASN_SUCCESS; } -void ue_cap_nb_r13_s::to_json(json_writer& j) const +void pci_arfcn_nb_r14_s::to_json(json_writer& j) const { j.start_obj(); - j.write_str("accessStratumRelease-r13", access_stratum_release_r13.to_string()); - if (ue_category_nb_r13_present) { - j.write_str("ue-Category-NB-r13", "nb1"); - } - if (multiple_drb_r13_present) { - j.write_str("multipleDRB-r13", "supported"); - } - if (pdcp_params_r13_present) { - j.write_fieldname("pdcp-Parameters-r13"); - pdcp_params_r13.to_json(j); - } - j.write_fieldname("phyLayerParameters-r13"); - phy_layer_params_r13.to_json(j); - j.write_fieldname("rf-Parameters-r13"); - rf_params_r13.to_json(j); - if (dummy_present) { - j.write_fieldname("dummy"); - j.start_obj(); - j.end_obj(); + j.write_int("physCellId-r14", pci_r14); + if (carrier_freq_r14_present) { + j.write_fieldname("carrierFreq-r14"); + carrier_freq_r14.to_json(j); } j.end_obj(); } -// HandoverPreparationInformation-NB-IEs ::= SEQUENCE -SRSASN_CODE ho_prep_info_nb_ies_s::pack(bit_ref& bref) const +// RRCConnectionReconfigurationComplete-NB-r13-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_recfg_complete_nb_r13_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(rrm_cfg_r13_present, 1)); - HANDLE_CODE(bref.pack(as_context_r13_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - HANDLE_CODE(ue_radio_access_cap_info_r13.pack(bref)); - HANDLE_CODE(as_cfg_r13.pack(bref)); - if (rrm_cfg_r13_present) { - HANDLE_CODE(rrm_cfg_r13.pack(bref)); - } - if (as_context_r13_present) { - HANDLE_CODE(as_context_r13.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE ho_prep_info_nb_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_recfg_complete_nb_r13_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(rrm_cfg_r13_present, 1)); - HANDLE_CODE(bref.unpack(as_context_r13_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(ue_radio_access_cap_info_r13.unpack(bref)); - HANDLE_CODE(as_cfg_r13.unpack(bref)); - if (rrm_cfg_r13_present) { - HANDLE_CODE(rrm_cfg_r13.unpack(bref)); - } - if (as_context_r13_present) { - HANDLE_CODE(as_context_r13.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } return SRSASN_SUCCESS; } -void ho_prep_info_nb_ies_s::to_json(json_writer& j) const +void rrc_conn_recfg_complete_nb_r13_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("ue-RadioAccessCapabilityInfo-r13"); - ue_radio_access_cap_info_r13.to_json(j); - j.write_fieldname("as-Config-r13"); - as_cfg_r13.to_json(j); - if (rrm_cfg_r13_present) { - j.write_fieldname("rrm-Config-r13"); - rrm_cfg_r13.to_json(j); - } - if (as_context_r13_present) { - j.write_fieldname("as-Context-r13"); - as_context_r13.to_json(j); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } if (non_crit_ext_present) { j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); + j.start_obj(); + j.end_obj(); } j.end_obj(); } -// HandoverPreparationInformation-NB ::= SEQUENCE -SRSASN_CODE ho_prep_info_nb_s::pack(bit_ref& bref) const +// RRCConnectionReconfigurationComplete-NB ::= SEQUENCE +SRSASN_CODE rrc_conn_recfg_complete_nb_s::pack(bit_ref& bref) const { + HANDLE_CODE(pack_integer(bref, rrc_transaction_id, (uint8_t)0u, (uint8_t)3u)); HANDLE_CODE(crit_exts.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE ho_prep_info_nb_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_recfg_complete_nb_s::unpack(cbit_ref& bref) { + HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); HANDLE_CODE(crit_exts.unpack(bref)); return SRSASN_SUCCESS; } -void ho_prep_info_nb_s::to_json(json_writer& j) const +void rrc_conn_recfg_complete_nb_s::to_json(json_writer& j) const { j.start_obj(); + j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); j.write_fieldname("criticalExtensions"); crit_exts.to_json(j); j.end_obj(); } -void ho_prep_info_nb_s::crit_exts_c_::destroy_() +void rrc_conn_recfg_complete_nb_s::crit_exts_c_::set(types::options e) { - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } + type_ = e; } -void ho_prep_info_nb_s::crit_exts_c_::set(types::options e) +void rrc_conn_recfg_complete_nb_s::crit_exts_c_::to_json(json_writer& j) const { - destroy_(); - type_ = e; + j.start_obj(); switch (type_) { - case types::c1: - c.init(); + case types::rrc_conn_recfg_complete_r13: + j.write_fieldname("rrcConnectionReconfigurationComplete-r13"); + c.to_json(j); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); } + j.end_obj(); } -ho_prep_info_nb_s::crit_exts_c_::crit_exts_c_(const ho_prep_info_nb_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_recfg_complete_nb_s::crit_exts_c_::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { - case types::c1: - c.init(other.c.get()); + case types::rrc_conn_recfg_complete_r13: + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } + return SRSASN_SUCCESS; } -ho_prep_info_nb_s::crit_exts_c_& -ho_prep_info_nb_s::crit_exts_c_::operator=(const ho_prep_info_nb_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_recfg_complete_nb_s::crit_exts_c_::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; - } - set(other.type()); + types e; + e.unpack(bref); + set(e); switch (type_) { - case types::c1: - c.set(other.c.get()); + case types::rrc_conn_recfg_complete_r13: + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); + return SRSASN_ERROR_DECODE_FAIL; } + return SRSASN_SUCCESS; +} - return *this; +std::string rrc_conn_recfg_complete_nb_s::crit_exts_c_::types_opts::to_string() const +{ + static const char* options[] = {"rrcConnectionReconfigurationComplete-r13", "criticalExtensionsFuture"}; + return convert_enum_idx(options, 2, value, "rrc_conn_recfg_complete_nb_s::crit_exts_c_::types"); } -void ho_prep_info_nb_s::crit_exts_c_::to_json(json_writer& j) const + +// RRCConnectionReestablishmentComplete-NB-v1470-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_reest_complete_nb_v1470_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(meas_result_serv_cell_r14_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (meas_result_serv_cell_r14_present) { + HANDLE_CODE(meas_result_serv_cell_r14.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_reest_complete_nb_v1470_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(meas_result_serv_cell_r14_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (meas_result_serv_cell_r14_present) { + HANDLE_CODE(meas_result_serv_cell_r14.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void rrc_conn_reest_complete_nb_v1470_ies_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); + if (meas_result_serv_cell_r14_present) { + j.write_fieldname("measResultServCell-r14"); + meas_result_serv_cell_r14.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } j.end_obj(); } -SRSASN_CODE ho_prep_info_nb_s::crit_exts_c_::pack(bit_ref& bref) const + +// RRCConnectionReestablishmentComplete-NB-r13-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_reest_complete_nb_r13_ies_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + return SRSASN_SUCCESS; } -SRSASN_CODE ho_prep_info_nb_s::crit_exts_c_::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_reest_complete_nb_r13_ies_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } + return SRSASN_SUCCESS; } +void rrc_conn_reest_complete_nb_r13_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); +} -void ho_prep_info_nb_s::crit_exts_c_::c1_c_::set(types::options e) +// RRCConnectionReestablishmentComplete-NB ::= SEQUENCE +SRSASN_CODE rrc_conn_reest_complete_nb_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, rrc_transaction_id, (uint8_t)0u, (uint8_t)3u)); + HANDLE_CODE(crit_exts.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_reest_complete_nb_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); + HANDLE_CODE(crit_exts.unpack(bref)); + + return SRSASN_SUCCESS; +} +void rrc_conn_reest_complete_nb_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} + +void rrc_conn_reest_complete_nb_s::crit_exts_c_::set(types::options e) { type_ = e; } -void ho_prep_info_nb_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const +void rrc_conn_reest_complete_nb_s::crit_exts_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::ho_prep_info_r13: - j.write_fieldname("handoverPreparationInformation-r13"); + case types::rrc_conn_reest_complete_r13: + j.write_fieldname("rrcConnectionReestablishmentComplete-r13"); c.to_json(j); break; - case types::spare3: - break; - case types::spare2: - break; - case types::spare1: + case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_::c1_c_"); + log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); } j.end_obj(); } -SRSASN_CODE ho_prep_info_nb_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const +SRSASN_CODE rrc_conn_reest_complete_nb_s::crit_exts_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::ho_prep_info_r13: + case types::rrc_conn_reest_complete_r13: HANDLE_CODE(c.pack(bref)); break; - case types::spare3: - break; - case types::spare2: - break; - case types::spare1: + case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_::c1_c_"); + log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE ho_prep_info_nb_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_reest_complete_nb_s::crit_exts_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::ho_prep_info_r13: + case types::rrc_conn_reest_complete_r13: HANDLE_CODE(c.unpack(bref)); break; - case types::spare3: - break; - case types::spare2: - break; - case types::spare1: + case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "ho_prep_info_nb_s::crit_exts_c_::c1_c_"); + log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -std::string ho_prep_info_nb_s::crit_exts_c_::c1_c_::types_opts::to_string() const +std::string rrc_conn_reest_complete_nb_s::crit_exts_c_::types_opts::to_string() const { - static const char* options[] = {"handoverPreparationInformation-r13", "spare3", "spare2", "spare1"}; - return convert_enum_idx(options, 4, value, "ho_prep_info_nb_s::crit_exts_c_::c1_c_::types"); + static const char* options[] = {"rrcConnectionReestablishmentComplete-r13", "criticalExtensionsFuture"}; + return convert_enum_idx(options, 2, value, "rrc_conn_reest_complete_nb_s::crit_exts_c_::types"); } -// MeasResultServCell-NB-r14 ::= SEQUENCE -SRSASN_CODE meas_result_serv_cell_nb_r14_s::pack(bit_ref& bref) const +// CQI-NPDCCH-NB-r14 ::= ENUMERATED +std::string cqi_npdcch_nb_r14_opts::to_string() const { - HANDLE_CODE(pack_integer(bref, nrsrp_result_r14, (uint8_t)0u, (uint8_t)113u)); - HANDLE_CODE(pack_integer(bref, nrsrq_result_r14, (int8_t)-30, (int8_t)46)); + static const char* options[] = {"noMeasurements", + "candidateRep-A", + "candidateRep-B", + "candidateRep-C", + "candidateRep-D", + "candidateRep-E", + "candidateRep-F", + "candidateRep-G", + "candidateRep-H", + "candidateRep-I", + "candidateRep-J", + "candidateRep-K", + "candidateRep-L"}; + return convert_enum_idx(options, 13, value, "cqi_npdcch_nb_r14_e"); +} + +// CQI-NPDCCH-Short-NB-r14 ::= ENUMERATED +std::string cqi_npdcch_short_nb_r14_opts::to_string() const +{ + static const char* options[] = {"noMeasurements", "candidateRep-1", "candidateRep-2", "candidateRep-3"}; + return convert_enum_idx(options, 4, value, "cqi_npdcch_short_nb_r14_e"); +} +int8_t cqi_npdcch_short_nb_r14_opts::to_number() const +{ + switch (value) { + case candidate_rep_minus1: + return -1; + case candidate_rep_minus2: + return -2; + case candidate_rep_minus3: + return -3; + default: + invalid_enum_number(value, "cqi_npdcch_short_nb_r14_e"); + } + return 0; +} + +// ReestabUE-Identity-CP-NB-r14 ::= SEQUENCE +SRSASN_CODE reestab_ue_id_cp_nb_r14_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(s_tmsi_r14.pack(bref)); + HANDLE_CODE(ul_nas_mac_r14.pack(bref)); + HANDLE_CODE(ul_nas_count_r14.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE meas_result_serv_cell_nb_r14_s::unpack(cbit_ref& bref) +SRSASN_CODE reestab_ue_id_cp_nb_r14_s::unpack(cbit_ref& bref) { - HANDLE_CODE(unpack_integer(nrsrp_result_r14, bref, (uint8_t)0u, (uint8_t)113u)); - HANDLE_CODE(unpack_integer(nrsrq_result_r14, bref, (int8_t)-30, (int8_t)46)); + HANDLE_CODE(s_tmsi_r14.unpack(bref)); + HANDLE_CODE(ul_nas_mac_r14.unpack(bref)); + HANDLE_CODE(ul_nas_count_r14.unpack(bref)); return SRSASN_SUCCESS; } -void meas_result_serv_cell_nb_r14_s::to_json(json_writer& j) const +void reestab_ue_id_cp_nb_r14_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("nrsrpResult-r14", nrsrp_result_r14); - j.write_int("nrsrqResult-r14", nrsrq_result_r14); + j.write_fieldname("s-TMSI-r14"); + s_tmsi_r14.to_json(j); + j.write_str("ul-NAS-MAC-r14", ul_nas_mac_r14.to_string()); + j.write_str("ul-NAS-Count-r14", ul_nas_count_r14.to_string()); j.end_obj(); } -// PagingRecord-NB-r13 ::= SEQUENCE -SRSASN_CODE paging_record_nb_r13_s::pack(bit_ref& bref) const +// ReestablishmentCause-NB-r13 ::= ENUMERATED +std::string reest_cause_nb_r13_opts::to_string() const +{ + static const char* options[] = {"reconfigurationFailure", "otherFailure", "spare2", "spare1"}; + return convert_enum_idx(options, 4, value, "reest_cause_nb_r13_e"); +} + +// RRCConnectionReestablishmentRequest-NB-r13-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_reest_request_nb_r13_ies_s::pack(bit_ref& bref) const { - bref.pack(ext, 1); HANDLE_CODE(ue_id_r13.pack(bref)); + HANDLE_CODE(reest_cause_r13.pack(bref)); + HANDLE_CODE(cqi_npdcch_r14.pack(bref)); + HANDLE_CODE(bref.pack(early_contention_resolution_r14, 1)); + HANDLE_CODE(spare.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE paging_record_nb_r13_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_reest_request_nb_r13_ies_s::unpack(cbit_ref& bref) { - bref.unpack(ext, 1); HANDLE_CODE(ue_id_r13.unpack(bref)); + HANDLE_CODE(reest_cause_r13.unpack(bref)); + HANDLE_CODE(cqi_npdcch_r14.unpack(bref)); + HANDLE_CODE(bref.unpack(early_contention_resolution_r14, 1)); + HANDLE_CODE(spare.unpack(bref)); return SRSASN_SUCCESS; } -void paging_record_nb_r13_s::to_json(json_writer& j) const +void rrc_conn_reest_request_nb_r13_ies_s::to_json(json_writer& j) const { j.start_obj(); j.write_fieldname("ue-Identity-r13"); ue_id_r13.to_json(j); + j.write_str("reestablishmentCause-r13", reest_cause_r13.to_string()); + j.write_str("cqi-NPDCCH-r14", cqi_npdcch_r14.to_string()); + j.write_bool("earlyContentionResolution-r14", early_contention_resolution_r14); + j.write_str("spare", spare.to_string()); j.end_obj(); } -// Paging-NB ::= SEQUENCE -SRSASN_CODE paging_nb_s::pack(bit_ref& bref) const +// RRCConnectionReestablishmentRequest-NB-r14-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_reest_request_nb_r14_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(paging_record_list_r13_present, 1)); - HANDLE_CODE(bref.pack(sys_info_mod_r13_present, 1)); - HANDLE_CODE(bref.pack(sys_info_mod_e_drx_r13_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(ue_id_r14.pack(bref)); + HANDLE_CODE(reest_cause_r14.pack(bref)); + HANDLE_CODE(cqi_npdcch_r14.pack(bref)); + HANDLE_CODE(bref.pack(early_contention_resolution_r14, 1)); + HANDLE_CODE(spare.pack(bref)); - if (paging_record_list_r13_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, paging_record_list_r13, 1, 16)); - } + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_reest_request_nb_r14_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(ue_id_r14.unpack(bref)); + HANDLE_CODE(reest_cause_r14.unpack(bref)); + HANDLE_CODE(cqi_npdcch_r14.unpack(bref)); + HANDLE_CODE(bref.unpack(early_contention_resolution_r14, 1)); + HANDLE_CODE(spare.unpack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE paging_nb_s::unpack(cbit_ref& bref) +void rrc_conn_reest_request_nb_r14_ies_s::to_json(json_writer& j) const { - HANDLE_CODE(bref.unpack(paging_record_list_r13_present, 1)); - HANDLE_CODE(bref.unpack(sys_info_mod_r13_present, 1)); - HANDLE_CODE(bref.unpack(sys_info_mod_e_drx_r13_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + j.start_obj(); + j.write_fieldname("ue-Identity-r14"); + ue_id_r14.to_json(j); + j.write_str("reestablishmentCause-r14", reest_cause_r14.to_string()); + j.write_str("cqi-NPDCCH-r14", cqi_npdcch_r14.to_string()); + j.write_bool("earlyContentionResolution-r14", early_contention_resolution_r14); + j.write_str("spare", spare.to_string()); + j.end_obj(); +} - if (paging_record_list_r13_present) { - HANDLE_CODE(unpack_dyn_seq_of(paging_record_list_r13, bref, 1, 16)); - } +// RRCConnectionReestablishmentRequest-NB ::= SEQUENCE +SRSASN_CODE rrc_conn_reest_request_nb_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(crit_exts.pack(bref)); return SRSASN_SUCCESS; } -void paging_nb_s::to_json(json_writer& j) const +SRSASN_CODE rrc_conn_reest_request_nb_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(crit_exts.unpack(bref)); + + return SRSASN_SUCCESS; +} +void rrc_conn_reest_request_nb_s::to_json(json_writer& j) const { j.start_obj(); - if (paging_record_list_r13_present) { - j.start_array("pagingRecordList-r13"); - for (const auto& e1 : paging_record_list_r13) { - e1.to_json(j); - } - j.end_array(); - } - if (sys_info_mod_r13_present) { - j.write_str("systemInfoModification-r13", "true"); - } - if (sys_info_mod_e_drx_r13_present) { - j.write_str("systemInfoModification-eDRX-r13", "true"); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); j.end_obj(); } -// PCCH-MessageType-NB ::= CHOICE -void pcch_msg_type_nb_c::destroy_() +void rrc_conn_reest_request_nb_s::crit_exts_c_::destroy_() { switch (type_) { - case types::c1: - c.destroy(); + case types::rrc_conn_reest_request_r13: + c.destroy(); + break; + case types::later: + c.destroy(); break; default: break; } } -void pcch_msg_type_nb_c::set(types::options e) +void rrc_conn_reest_request_nb_s::crit_exts_c_::set(types::options e) { destroy_(); type_ = e; switch (type_) { - case types::c1: - c.init(); + case types::rrc_conn_reest_request_r13: + c.init(); break; - case types::msg_class_ext: + case types::later: + c.init(); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); } } -pcch_msg_type_nb_c::pcch_msg_type_nb_c(const pcch_msg_type_nb_c& other) +rrc_conn_reest_request_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reest_request_nb_s::crit_exts_c_& other) { type_ = other.type(); switch (type_) { - case types::c1: - c.init(other.c.get()); + case types::rrc_conn_reest_request_r13: + c.init(other.c.get()); break; - case types::msg_class_ext: + case types::later: + c.init(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); } } -pcch_msg_type_nb_c& pcch_msg_type_nb_c::operator=(const pcch_msg_type_nb_c& other) +rrc_conn_reest_request_nb_s::crit_exts_c_& +rrc_conn_reest_request_nb_s::crit_exts_c_::operator=(const rrc_conn_reest_request_nb_s::crit_exts_c_& other) { if (this == &other) { return *this; } set(other.type()); switch (type_) { - case types::c1: - c.set(other.c.get()); + case types::rrc_conn_reest_request_r13: + c.set(other.c.get()); break; - case types::msg_class_ext: + case types::later: + c.set(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); } return *this; } -void pcch_msg_type_nb_c::to_json(json_writer& j) const +void rrc_conn_reest_request_nb_s::crit_exts_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); + case types::rrc_conn_reest_request_r13: + j.write_fieldname("rrcConnectionReestablishmentRequest-r13"); + c.get().to_json(j); break; - case types::msg_class_ext: + case types::later: + j.write_fieldname("later"); + c.get().to_json(j); break; default: - log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); } j.end_obj(); } -SRSASN_CODE pcch_msg_type_nb_c::pack(bit_ref& bref) const +SRSASN_CODE rrc_conn_reest_request_nb_s::crit_exts_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); + case types::rrc_conn_reest_request_r13: + HANDLE_CODE(c.get().pack(bref)); break; - case types::msg_class_ext: + case types::later: + HANDLE_CODE(c.get().pack(bref)); break; default: - log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE pcch_msg_type_nb_c::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_reest_request_nb_s::crit_exts_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + case types::rrc_conn_reest_request_r13: + HANDLE_CODE(c.get().unpack(bref)); break; - case types::msg_class_ext: + case types::later: + HANDLE_CODE(c.get().unpack(bref)); break; default: - log_invalid_choice_id(type_, "pcch_msg_type_nb_c"); + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -void pcch_msg_type_nb_c::c1_c_::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("paging-r13"); - c.to_json(j); - j.end_obj(); -} -SRSASN_CODE pcch_msg_type_nb_c::c1_c_::pack(bit_ref& bref) const +void rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::set(types::options e) { - HANDLE_CODE(c.pack(bref)); - return SRSASN_SUCCESS; + type_ = e; } -SRSASN_CODE pcch_msg_type_nb_c::c1_c_::unpack(cbit_ref& bref) +void rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::to_json(json_writer& j) const { - HANDLE_CODE(c.unpack(bref)); - return SRSASN_SUCCESS; -} - -std::string pcch_msg_type_nb_c::c1_c_::types_opts::to_string() const -{ - static const char* options[] = {"paging-r13"}; - return convert_enum_idx(options, 1, value, "pcch_msg_type_nb_c::c1_c_::types"); -} - -std::string pcch_msg_type_nb_c::types_opts::to_string() const -{ - static const char* options[] = {"c1", "messageClassExtension"}; - return convert_enum_idx(options, 2, value, "pcch_msg_type_nb_c::types"); -} -uint8_t pcch_msg_type_nb_c::types_opts::to_number() const -{ - static const uint8_t options[] = {1}; - return map_enum_number(options, 1, value, "pcch_msg_type_nb_c::types"); + j.start_obj(); + switch (type_) { + case types::rrc_conn_reest_request_r14: + j.write_fieldname("rrcConnectionReestablishmentRequest-r14"); + c.to_json(j); + break; + case types::crit_exts_future: + break; + default: + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + } + j.end_obj(); } - -// PCCH-Message-NB ::= SEQUENCE -SRSASN_CODE pcch_msg_nb_s::pack(bit_ref& bref) const +SRSASN_CODE rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::pack(bit_ref& bref) const { - HANDLE_CODE(msg.pack(bref)); - - bref.align_bytes_zero(); - + type_.pack(bref); + switch (type_) { + case types::rrc_conn_reest_request_r14: + HANDLE_CODE(c.pack(bref)); + break; + case types::crit_exts_future: + break; + default: + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } return SRSASN_SUCCESS; } -SRSASN_CODE pcch_msg_nb_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::unpack(cbit_ref& bref) { - HANDLE_CODE(msg.unpack(bref)); - - bref.align_bytes(); - + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::rrc_conn_reest_request_r14: + HANDLE_CODE(c.unpack(bref)); + break; + case types::crit_exts_future: + break; + default: + log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } return SRSASN_SUCCESS; } -void pcch_msg_nb_s::to_json(json_writer& j) const + +std::string rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::types_opts::to_string() const { - j.start_array(); - j.start_obj(); - j.start_obj("PCCH-Message-NB"); - j.write_fieldname("message"); - msg.to_json(j); - j.end_obj(); - j.end_obj(); - j.end_array(); + static const char* options[] = {"rrcConnectionReestablishmentRequest-r14", "criticalExtensionsFuture"}; + return convert_enum_idx(options, 2, value, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::types"); } -// PCI-ARFCN-NB-r14 ::= SEQUENCE -SRSASN_CODE pci_arfcn_nb_r14_s::pack(bit_ref& bref) const +std::string rrc_conn_reest_request_nb_s::crit_exts_c_::types_opts::to_string() const { - HANDLE_CODE(bref.pack(carrier_freq_r14_present, 1)); - - HANDLE_CODE(pack_integer(bref, pci_r14, (uint16_t)0u, (uint16_t)503u)); - if (carrier_freq_r14_present) { - HANDLE_CODE(carrier_freq_r14.pack(bref)); - } - - return SRSASN_SUCCESS; + static const char* options[] = {"rrcConnectionReestablishmentRequest-r13", "later"}; + return convert_enum_idx(options, 2, value, "rrc_conn_reest_request_nb_s::crit_exts_c_::types"); } -SRSASN_CODE pci_arfcn_nb_r14_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(carrier_freq_r14_present, 1)); - - HANDLE_CODE(unpack_integer(pci_r14, bref, (uint16_t)0u, (uint16_t)503u)); - if (carrier_freq_r14_present) { - HANDLE_CODE(carrier_freq_r14.unpack(bref)); - } - return SRSASN_SUCCESS; -} -void pci_arfcn_nb_r14_s::to_json(json_writer& j) const +// EstablishmentCause-NB-r13 ::= ENUMERATED +std::string establishment_cause_nb_r13_opts::to_string() const { - j.start_obj(); - j.write_int("physCellId-r14", pci_r14); - if (carrier_freq_r14_present) { - j.write_fieldname("carrierFreq-r14"); - carrier_freq_r14.to_json(j); - } - j.end_obj(); + static const char* options[] = {"mt-Access", + "mo-Signalling", + "mo-Data", + "mo-ExceptionData", + "delayTolerantAccess-v1330", + "spare3", + "spare2", + "spare1"}; + return convert_enum_idx(options, 8, value, "establishment_cause_nb_r13_e"); } -// RRCConnectionReconfigurationComplete-NB-r13-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_recfg_complete_nb_r13_ies_s::pack(bit_ref& bref) const +// RRCConnectionRequest-NB-r13-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_request_nb_r13_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(multi_tone_support_r13_present, 1)); + HANDLE_CODE(bref.pack(multi_carrier_support_r13_present, 1)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } + HANDLE_CODE(ue_id_r13.pack(bref)); + HANDLE_CODE(establishment_cause_r13.pack(bref)); + HANDLE_CODE(bref.pack(early_contention_resolution_r14, 1)); + HANDLE_CODE(cqi_npdcch_r14.pack(bref)); + HANDLE_CODE(spare.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_recfg_complete_nb_r13_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_request_nb_r13_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(multi_tone_support_r13_present, 1)); + HANDLE_CODE(bref.unpack(multi_carrier_support_r13_present, 1)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } + HANDLE_CODE(ue_id_r13.unpack(bref)); + HANDLE_CODE(establishment_cause_r13.unpack(bref)); + HANDLE_CODE(bref.unpack(early_contention_resolution_r14, 1)); + HANDLE_CODE(cqi_npdcch_r14.unpack(bref)); + HANDLE_CODE(spare.unpack(bref)); return SRSASN_SUCCESS; } -void rrc_conn_recfg_complete_nb_r13_ies_s::to_json(json_writer& j) const +void rrc_conn_request_nb_r13_ies_s::to_json(json_writer& j) const { j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + j.write_fieldname("ue-Identity-r13"); + ue_id_r13.to_json(j); + j.write_str("establishmentCause-r13", establishment_cause_r13.to_string()); + if (multi_tone_support_r13_present) { + j.write_str("multiToneSupport-r13", "true"); } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); + if (multi_carrier_support_r13_present) { + j.write_str("multiCarrierSupport-r13", "true"); } + j.write_bool("earlyContentionResolution-r14", early_contention_resolution_r14); + j.write_str("cqi-NPDCCH-r14", cqi_npdcch_r14.to_string()); + j.write_str("spare", spare.to_string()); j.end_obj(); } -// RRCConnectionReconfigurationComplete-NB ::= SEQUENCE -SRSASN_CODE rrc_conn_recfg_complete_nb_s::pack(bit_ref& bref) const +// RRCConnectionRequest-NB ::= SEQUENCE +SRSASN_CODE rrc_conn_request_nb_s::pack(bit_ref& bref) const { - HANDLE_CODE(pack_integer(bref, rrc_transaction_id, (uint8_t)0u, (uint8_t)3u)); HANDLE_CODE(crit_exts.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_recfg_complete_nb_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_request_nb_s::unpack(cbit_ref& bref) { - HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); HANDLE_CODE(crit_exts.unpack(bref)); return SRSASN_SUCCESS; } -void rrc_conn_recfg_complete_nb_s::to_json(json_writer& j) const +void rrc_conn_request_nb_s::to_json(json_writer& j) const { j.start_obj(); - j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); j.write_fieldname("criticalExtensions"); crit_exts.to_json(j); j.end_obj(); } -void rrc_conn_recfg_complete_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_recfg_complete_r13: - c.destroy(); - break; - default: - break; - } -} -void rrc_conn_recfg_complete_nb_s::crit_exts_c_::set(types::options e) +void rrc_conn_request_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_conn_recfg_complete_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); - } -} -rrc_conn_recfg_complete_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_recfg_complete_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_recfg_complete_r13: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); - } -} -rrc_conn_recfg_complete_nb_s::crit_exts_c_& -rrc_conn_recfg_complete_nb_s::crit_exts_c_::operator=(const rrc_conn_recfg_complete_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_recfg_complete_r13: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); - } - - return *this; } -void rrc_conn_recfg_complete_nb_s::crit_exts_c_::to_json(json_writer& j) const +void rrc_conn_request_nb_s::crit_exts_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::rrc_conn_recfg_complete_r13: - j.write_fieldname("rrcConnectionReconfigurationComplete-r13"); - c.get().to_json(j); + case types::rrc_conn_request_r13: + j.write_fieldname("rrcConnectionRequest-r13"); + c.to_json(j); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); } j.end_obj(); } -SRSASN_CODE rrc_conn_recfg_complete_nb_s::crit_exts_c_::pack(bit_ref& bref) const +SRSASN_CODE rrc_conn_request_nb_s::crit_exts_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::rrc_conn_recfg_complete_r13: - HANDLE_CODE(c.get().pack(bref)); + case types::rrc_conn_request_r13: + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_recfg_complete_nb_s::crit_exts_c_::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_request_nb_s::crit_exts_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::rrc_conn_recfg_complete_r13: - HANDLE_CODE(c.get().unpack(bref)); + case types::rrc_conn_request_r13: + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_recfg_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -std::string rrc_conn_recfg_complete_nb_s::crit_exts_c_::types_opts::to_string() const +std::string rrc_conn_request_nb_s::crit_exts_c_::types_opts::to_string() const { - static const char* options[] = {"rrcConnectionReconfigurationComplete-r13", "criticalExtensionsFuture"}; - return convert_enum_idx(options, 2, value, "rrc_conn_recfg_complete_nb_s::crit_exts_c_::types"); + static const char* options[] = {"rrcConnectionRequest-r13", "criticalExtensionsFuture"}; + return convert_enum_idx(options, 2, value, "rrc_conn_request_nb_s::crit_exts_c_::types"); } -// RRCConnectionReestablishmentComplete-NB-v1470-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_reest_complete_nb_v1470_ies_s::pack(bit_ref& bref) const +// RRCConnectionResumeComplete-NB-v1470-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_resume_complete_nb_v1470_ies_s::pack(bit_ref& bref) const { HANDLE_CODE(bref.pack(meas_result_serv_cell_r14_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); @@ -16850,7 +16108,7 @@ SRSASN_CODE rrc_conn_reest_complete_nb_v1470_ies_s::pack(bit_ref& bref) const return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_complete_nb_v1470_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_resume_complete_nb_v1470_ies_s::unpack(cbit_ref& bref) { HANDLE_CODE(bref.unpack(meas_result_serv_cell_r14_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); @@ -16861,7 +16119,7 @@ SRSASN_CODE rrc_conn_reest_complete_nb_v1470_ies_s::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -void rrc_conn_reest_complete_nb_v1470_ies_s::to_json(json_writer& j) const +void rrc_conn_resume_complete_nb_v1470_ies_s::to_json(json_writer& j) const { j.start_obj(); if (meas_result_serv_cell_r14_present) { @@ -16876,12 +16134,20 @@ void rrc_conn_reest_complete_nb_v1470_ies_s::to_json(json_writer& j) const j.end_obj(); } -// RRCConnectionReestablishmentComplete-NB-r13-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_reest_complete_nb_r13_ies_s::pack(bit_ref& bref) const +// RRCConnectionResumeComplete-NB-r13-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_resume_complete_nb_r13_ies_s::pack(bit_ref& bref) const { + HANDLE_CODE(bref.pack(sel_plmn_id_r13_present, 1)); + HANDLE_CODE(bref.pack(ded_info_nas_r13_present, 1)); HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + if (sel_plmn_id_r13_present) { + HANDLE_CODE(pack_integer(bref, sel_plmn_id_r13, (uint8_t)1u, (uint8_t)6u)); + } + if (ded_info_nas_r13_present) { + HANDLE_CODE(ded_info_nas_r13.pack(bref)); + } if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.pack(bref)); } @@ -16891,11 +16157,19 @@ SRSASN_CODE rrc_conn_reest_complete_nb_r13_ies_s::pack(bit_ref& bref) const return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_complete_nb_r13_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_resume_complete_nb_r13_ies_s::unpack(cbit_ref& bref) { + HANDLE_CODE(bref.unpack(sel_plmn_id_r13_present, 1)); + HANDLE_CODE(bref.unpack(ded_info_nas_r13_present, 1)); HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + if (sel_plmn_id_r13_present) { + HANDLE_CODE(unpack_integer(sel_plmn_id_r13, bref, (uint8_t)1u, (uint8_t)6u)); + } + if (ded_info_nas_r13_present) { + HANDLE_CODE(ded_info_nas_r13.unpack(bref)); + } if (late_non_crit_ext_present) { HANDLE_CODE(late_non_crit_ext.unpack(bref)); } @@ -16905,9 +16179,15 @@ SRSASN_CODE rrc_conn_reest_complete_nb_r13_ies_s::unpack(cbit_ref& bref) return SRSASN_SUCCESS; } -void rrc_conn_reest_complete_nb_r13_ies_s::to_json(json_writer& j) const +void rrc_conn_resume_complete_nb_r13_ies_s::to_json(json_writer& j) const { j.start_obj(); + if (sel_plmn_id_r13_present) { + j.write_int("selectedPLMN-Identity-r13", sel_plmn_id_r13); + } + if (ded_info_nas_r13_present) { + j.write_str("dedicatedInfoNAS-r13", ded_info_nas_r13.to_string()); + } if (late_non_crit_ext_present) { j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); } @@ -16918,22 +16198,22 @@ void rrc_conn_reest_complete_nb_r13_ies_s::to_json(json_writer& j) const j.end_obj(); } -// RRCConnectionReestablishmentComplete-NB ::= SEQUENCE -SRSASN_CODE rrc_conn_reest_complete_nb_s::pack(bit_ref& bref) const +// RRCConnectionResumeComplete-NB ::= SEQUENCE +SRSASN_CODE rrc_conn_resume_complete_nb_s::pack(bit_ref& bref) const { HANDLE_CODE(pack_integer(bref, rrc_transaction_id, (uint8_t)0u, (uint8_t)3u)); HANDLE_CODE(crit_exts.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_complete_nb_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_resume_complete_nb_s::unpack(cbit_ref& bref) { HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); HANDLE_CODE(crit_exts.unpack(bref)); return SRSASN_SUCCESS; } -void rrc_conn_reest_complete_nb_s::to_json(json_writer& j) const +void rrc_conn_resume_complete_nb_s::to_json(json_writer& j) const { j.start_obj(); j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); @@ -16942,1922 +16222,848 @@ void rrc_conn_reest_complete_nb_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_conn_reest_complete_nb_s::crit_exts_c_::destroy_() +void rrc_conn_resume_complete_nb_s::crit_exts_c_::set(types::options e) { - switch (type_) { - case types::rrc_conn_reest_complete_r13: - c.destroy(); - break; - default: - break; - } + type_ = e; } -void rrc_conn_reest_complete_nb_s::crit_exts_c_::set(types::options e) +void rrc_conn_resume_complete_nb_s::crit_exts_c_::to_json(json_writer& j) const { - destroy_(); - type_ = e; + j.start_obj(); switch (type_) { - case types::rrc_conn_reest_complete_r13: - c.init(); + case types::rrc_conn_resume_complete_r13: + j.write_fieldname("rrcConnectionResumeComplete-r13"); + c.to_json(j); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); } + j.end_obj(); } -rrc_conn_reest_complete_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reest_complete_nb_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_resume_complete_nb_s::crit_exts_c_::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { - case types::rrc_conn_reest_complete_r13: - c.init(other.c.get()); + case types::rrc_conn_resume_complete_r13: + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } + return SRSASN_SUCCESS; } -rrc_conn_reest_complete_nb_s::crit_exts_c_& -rrc_conn_reest_complete_nb_s::crit_exts_c_::operator=(const rrc_conn_reest_complete_nb_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_resume_complete_nb_s::crit_exts_c_::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; - } - set(other.type()); + types e; + e.unpack(bref); + set(e); switch (type_) { - case types::rrc_conn_reest_complete_r13: - c.set(other.c.get()); + case types::rrc_conn_resume_complete_r13: + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; - case types::nulltype: - break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); + return SRSASN_ERROR_DECODE_FAIL; } + return SRSASN_SUCCESS; +} - return *this; +std::string rrc_conn_resume_complete_nb_s::crit_exts_c_::types_opts::to_string() const +{ + static const char* options[] = {"rrcConnectionResumeComplete-r13", "criticalExtensionsFuture"}; + return convert_enum_idx(options, 2, value, "rrc_conn_resume_complete_nb_s::crit_exts_c_::types"); } -void rrc_conn_reest_complete_nb_s::crit_exts_c_::to_json(json_writer& j) const + +// RRCConnectionResumeRequest-NB-r13-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_resume_request_nb_r13_ies_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(resume_id_r13.pack(bref)); + HANDLE_CODE(short_resume_mac_i_r13.pack(bref)); + HANDLE_CODE(resume_cause_r13.pack(bref)); + HANDLE_CODE(bref.pack(early_contention_resolution_r14, 1)); + HANDLE_CODE(cqi_npdcch_r14.pack(bref)); + HANDLE_CODE(spare.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_resume_request_nb_r13_ies_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(resume_id_r13.unpack(bref)); + HANDLE_CODE(short_resume_mac_i_r13.unpack(bref)); + HANDLE_CODE(resume_cause_r13.unpack(bref)); + HANDLE_CODE(bref.unpack(early_contention_resolution_r14, 1)); + HANDLE_CODE(cqi_npdcch_r14.unpack(bref)); + HANDLE_CODE(spare.unpack(bref)); + + return SRSASN_SUCCESS; +} +void rrc_conn_resume_request_nb_r13_ies_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("resumeID-r13", resume_id_r13.to_string()); + j.write_str("shortResumeMAC-I-r13", short_resume_mac_i_r13.to_string()); + j.write_str("resumeCause-r13", resume_cause_r13.to_string()); + j.write_bool("earlyContentionResolution-r14", early_contention_resolution_r14); + j.write_str("cqi-NPDCCH-r14", cqi_npdcch_r14.to_string()); + j.write_str("spare", spare.to_string()); + j.end_obj(); +} + +// RRCConnectionResumeRequest-NB ::= SEQUENCE +SRSASN_CODE rrc_conn_resume_request_nb_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(crit_exts.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_conn_resume_request_nb_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(crit_exts.unpack(bref)); + + return SRSASN_SUCCESS; +} +void rrc_conn_resume_request_nb_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} + +void rrc_conn_resume_request_nb_s::crit_exts_c_::set(types::options e) +{ + type_ = e; +} +void rrc_conn_resume_request_nb_s::crit_exts_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::rrc_conn_reest_complete_r13: - j.write_fieldname("rrcConnectionReestablishmentComplete-r13"); - c.get().to_json(j); + case types::rrc_conn_resume_request_r13: + j.write_fieldname("rrcConnectionResumeRequest-r13"); + c.to_json(j); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); } j.end_obj(); } -SRSASN_CODE rrc_conn_reest_complete_nb_s::crit_exts_c_::pack(bit_ref& bref) const +SRSASN_CODE rrc_conn_resume_request_nb_s::crit_exts_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::rrc_conn_reest_complete_r13: - HANDLE_CODE(c.get().pack(bref)); + case types::rrc_conn_resume_request_r13: + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_complete_nb_s::crit_exts_c_::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_resume_request_nb_s::crit_exts_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::rrc_conn_reest_complete_r13: - HANDLE_CODE(c.get().unpack(bref)); + case types::rrc_conn_resume_request_r13: + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_complete_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -std::string rrc_conn_reest_complete_nb_s::crit_exts_c_::types_opts::to_string() const +std::string rrc_conn_resume_request_nb_s::crit_exts_c_::types_opts::to_string() const { - static const char* options[] = {"rrcConnectionReestablishmentComplete-r13", "criticalExtensionsFuture"}; - return convert_enum_idx(options, 2, value, "rrc_conn_reest_complete_nb_s::crit_exts_c_::types"); + static const char* options[] = {"rrcConnectionResumeRequest-r13", "criticalExtensionsFuture"}; + return convert_enum_idx(options, 2, value, "rrc_conn_resume_request_nb_s::crit_exts_c_::types"); } -// CQI-NPDCCH-NB-r14 ::= ENUMERATED -std::string cqi_npdcch_nb_r14_opts::to_string() const +// RRCConnectionSetupComplete-NB-v1470-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_setup_complete_nb_v1470_ies_s::pack(bit_ref& bref) const { - static const char* options[] = {"noMeasurements", - "candidateRep-A", - "candidateRep-B", - "candidateRep-C", - "candidateRep-D", - "candidateRep-E", - "candidateRep-F", - "candidateRep-G", - "candidateRep-H", - "candidateRep-I", - "candidateRep-J", - "candidateRep-K", - "candidateRep-L"}; - return convert_enum_idx(options, 13, value, "cqi_npdcch_nb_r14_e"); -} + HANDLE_CODE(bref.pack(meas_result_serv_cell_r14_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); -// CQI-NPDCCH-Short-NB-r14 ::= ENUMERATED -std::string cqi_npdcch_short_nb_r14_opts::to_string() const -{ - static const char* options[] = {"noMeasurements", "candidateRep-1", "candidateRep-2", "candidateRep-3"}; - return convert_enum_idx(options, 4, value, "cqi_npdcch_short_nb_r14_e"); -} -int8_t cqi_npdcch_short_nb_r14_opts::to_number() const -{ - switch (value) { - case candidate_rep_minus1: - return -1; - case candidate_rep_minus2: - return -2; - case candidate_rep_minus3: - return -3; - default: - invalid_enum_number(value, "cqi_npdcch_short_nb_r14_e"); + if (meas_result_serv_cell_r14_present) { + HANDLE_CODE(meas_result_serv_cell_r14.pack(bref)); } - return 0; -} - -// ReestabUE-Identity-CP-NB-r14 ::= SEQUENCE -SRSASN_CODE reestab_ue_id_cp_nb_r14_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(s_tmsi_r14.pack(bref)); - HANDLE_CODE(ul_nas_mac_r14.pack(bref)); - HANDLE_CODE(ul_nas_count_r14.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE reestab_ue_id_cp_nb_r14_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_setup_complete_nb_v1470_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(s_tmsi_r14.unpack(bref)); - HANDLE_CODE(ul_nas_mac_r14.unpack(bref)); - HANDLE_CODE(ul_nas_count_r14.unpack(bref)); - + HANDLE_CODE(bref.unpack(meas_result_serv_cell_r14_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (meas_result_serv_cell_r14_present) { + HANDLE_CODE(meas_result_serv_cell_r14.unpack(bref)); + } + return SRSASN_SUCCESS; } -void reestab_ue_id_cp_nb_r14_s::to_json(json_writer& j) const +void rrc_conn_setup_complete_nb_v1470_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("s-TMSI-r14"); - s_tmsi_r14.to_json(j); - j.write_str("ul-NAS-MAC-r14", ul_nas_mac_r14.to_string()); - j.write_str("ul-NAS-Count-r14", ul_nas_count_r14.to_string()); + if (meas_result_serv_cell_r14_present) { + j.write_fieldname("measResultServCell-r14"); + meas_result_serv_cell_r14.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } j.end_obj(); } -// ReestablishmentCause-NB-r13 ::= ENUMERATED -std::string reest_cause_nb_r13_opts::to_string() const +// RRCConnectionSetupComplete-NB-v1430-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_setup_complete_nb_v1430_ies_s::pack(bit_ref& bref) const { - static const char* options[] = {"reconfigurationFailure", "otherFailure", "spare2", "spare1"}; - return convert_enum_idx(options, 4, value, "reest_cause_nb_r13_e"); -} + HANDLE_CODE(bref.pack(gummei_type_r14_present, 1)); + HANDLE_CODE(bref.pack(dcn_id_r14_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); -// RRCConnectionReestablishmentRequest-NB-r13-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_reest_request_nb_r13_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(ue_id_r13.pack(bref)); - HANDLE_CODE(reest_cause_r13.pack(bref)); - HANDLE_CODE(cqi_npdcch_r14.pack(bref)); - HANDLE_CODE(bref.pack(early_contention_resolution_r14, 1)); - HANDLE_CODE(spare.pack(bref)); + if (dcn_id_r14_present) { + HANDLE_CODE(pack_integer(bref, dcn_id_r14, (uint32_t)0u, (uint32_t)65535u)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_request_nb_r13_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_setup_complete_nb_v1430_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(ue_id_r13.unpack(bref)); - HANDLE_CODE(reest_cause_r13.unpack(bref)); - HANDLE_CODE(cqi_npdcch_r14.unpack(bref)); - HANDLE_CODE(bref.unpack(early_contention_resolution_r14, 1)); - HANDLE_CODE(spare.unpack(bref)); + HANDLE_CODE(bref.unpack(gummei_type_r14_present, 1)); + HANDLE_CODE(bref.unpack(dcn_id_r14_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (dcn_id_r14_present) { + HANDLE_CODE(unpack_integer(dcn_id_r14, bref, (uint32_t)0u, (uint32_t)65535u)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } return SRSASN_SUCCESS; } -void rrc_conn_reest_request_nb_r13_ies_s::to_json(json_writer& j) const +void rrc_conn_setup_complete_nb_v1430_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("ue-Identity-r13"); - ue_id_r13.to_json(j); - j.write_str("reestablishmentCause-r13", reest_cause_r13.to_string()); - j.write_str("cqi-NPDCCH-r14", cqi_npdcch_r14.to_string()); - j.write_bool("earlyContentionResolution-r14", early_contention_resolution_r14); - j.write_str("spare", spare.to_string()); + if (gummei_type_r14_present) { + j.write_str("gummei-Type-r14", "mapped"); + } + if (dcn_id_r14_present) { + j.write_int("dcn-ID-r14", dcn_id_r14); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } j.end_obj(); } -// RRCConnectionReestablishmentRequest-NB-r14-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_reest_request_nb_r14_ies_s::pack(bit_ref& bref) const +// RRCConnectionSetupComplete-NB-r13-IEs ::= SEQUENCE +SRSASN_CODE rrc_conn_setup_complete_nb_r13_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(ue_id_r14.pack(bref)); - HANDLE_CODE(reest_cause_r14.pack(bref)); - HANDLE_CODE(cqi_npdcch_r14.pack(bref)); - HANDLE_CODE(bref.pack(early_contention_resolution_r14, 1)); - HANDLE_CODE(spare.pack(bref)); + HANDLE_CODE(bref.pack(s_tmsi_r13_present, 1)); + HANDLE_CODE(bref.pack(registered_mme_r13_present, 1)); + HANDLE_CODE(bref.pack(attach_without_pdn_connect_r13_present, 1)); + HANDLE_CODE(bref.pack(up_cio_t_eps_optim_r13_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(pack_integer(bref, sel_plmn_id_r13, (uint8_t)1u, (uint8_t)6u)); + if (s_tmsi_r13_present) { + HANDLE_CODE(s_tmsi_r13.pack(bref)); + } + if (registered_mme_r13_present) { + HANDLE_CODE(registered_mme_r13.pack(bref)); + } + HANDLE_CODE(ded_info_nas_r13.pack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_request_nb_r14_ies_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_setup_complete_nb_r13_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(ue_id_r14.unpack(bref)); - HANDLE_CODE(reest_cause_r14.unpack(bref)); - HANDLE_CODE(cqi_npdcch_r14.unpack(bref)); - HANDLE_CODE(bref.unpack(early_contention_resolution_r14, 1)); - HANDLE_CODE(spare.unpack(bref)); + HANDLE_CODE(bref.unpack(s_tmsi_r13_present, 1)); + HANDLE_CODE(bref.unpack(registered_mme_r13_present, 1)); + HANDLE_CODE(bref.unpack(attach_without_pdn_connect_r13_present, 1)); + HANDLE_CODE(bref.unpack(up_cio_t_eps_optim_r13_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + HANDLE_CODE(unpack_integer(sel_plmn_id_r13, bref, (uint8_t)1u, (uint8_t)6u)); + if (s_tmsi_r13_present) { + HANDLE_CODE(s_tmsi_r13.unpack(bref)); + } + if (registered_mme_r13_present) { + HANDLE_CODE(registered_mme_r13.unpack(bref)); + } + HANDLE_CODE(ded_info_nas_r13.unpack(bref)); + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } return SRSASN_SUCCESS; } -void rrc_conn_reest_request_nb_r14_ies_s::to_json(json_writer& j) const +void rrc_conn_setup_complete_nb_r13_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("ue-Identity-r14"); - ue_id_r14.to_json(j); - j.write_str("reestablishmentCause-r14", reest_cause_r14.to_string()); - j.write_str("cqi-NPDCCH-r14", cqi_npdcch_r14.to_string()); - j.write_bool("earlyContentionResolution-r14", early_contention_resolution_r14); - j.write_str("spare", spare.to_string()); + j.write_int("selectedPLMN-Identity-r13", sel_plmn_id_r13); + if (s_tmsi_r13_present) { + j.write_fieldname("s-TMSI-r13"); + s_tmsi_r13.to_json(j); + } + if (registered_mme_r13_present) { + j.write_fieldname("registeredMME-r13"); + registered_mme_r13.to_json(j); + } + j.write_str("dedicatedInfoNAS-r13", ded_info_nas_r13.to_string()); + if (attach_without_pdn_connect_r13_present) { + j.write_str("attachWithoutPDN-Connectivity-r13", "true"); + } + if (up_cio_t_eps_optim_r13_present) { + j.write_str("up-CIoT-EPS-Optimisation-r13", "true"); + } + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } j.end_obj(); } -// RRCConnectionReestablishmentRequest-NB ::= SEQUENCE -SRSASN_CODE rrc_conn_reest_request_nb_s::pack(bit_ref& bref) const +// RRCConnectionSetupComplete-NB ::= SEQUENCE +SRSASN_CODE rrc_conn_setup_complete_nb_s::pack(bit_ref& bref) const { + HANDLE_CODE(pack_integer(bref, rrc_transaction_id, (uint8_t)0u, (uint8_t)3u)); HANDLE_CODE(crit_exts.pack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_request_nb_s::unpack(cbit_ref& bref) +SRSASN_CODE rrc_conn_setup_complete_nb_s::unpack(cbit_ref& bref) { + HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); HANDLE_CODE(crit_exts.unpack(bref)); return SRSASN_SUCCESS; } -void rrc_conn_reest_request_nb_s::to_json(json_writer& j) const +void rrc_conn_setup_complete_nb_s::to_json(json_writer& j) const { j.start_obj(); + j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); j.write_fieldname("criticalExtensions"); crit_exts.to_json(j); j.end_obj(); } -void rrc_conn_reest_request_nb_s::crit_exts_c_::destroy_() +void rrc_conn_setup_complete_nb_s::crit_exts_c_::set(types::options e) { - switch (type_) { - case types::rrc_conn_reest_request_r13: - c.destroy(); - break; - case types::later: - c.destroy(); - break; - default: - break; - } + type_ = e; } -void rrc_conn_reest_request_nb_s::crit_exts_c_::set(types::options e) +void rrc_conn_setup_complete_nb_s::crit_exts_c_::to_json(json_writer& j) const { - destroy_(); - type_ = e; + j.start_obj(); switch (type_) { - case types::rrc_conn_reest_request_r13: - c.init(); - break; - case types::later: - c.init(); + case types::rrc_conn_setup_complete_r13: + j.write_fieldname("rrcConnectionSetupComplete-r13"); + c.to_json(j); break; - case types::nulltype: + case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); } + j.end_obj(); } -rrc_conn_reest_request_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_reest_request_nb_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_setup_complete_nb_s::crit_exts_c_::pack(bit_ref& bref) const { - type_ = other.type(); + type_.pack(bref); switch (type_) { - case types::rrc_conn_reest_request_r13: - c.init(other.c.get()); - break; - case types::later: - c.init(other.c.get()); + case types::rrc_conn_setup_complete_r13: + HANDLE_CODE(c.pack(bref)); break; - case types::nulltype: + case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); + return SRSASN_ERROR_ENCODE_FAIL; } + return SRSASN_SUCCESS; } -rrc_conn_reest_request_nb_s::crit_exts_c_& -rrc_conn_reest_request_nb_s::crit_exts_c_::operator=(const rrc_conn_reest_request_nb_s::crit_exts_c_& other) +SRSASN_CODE rrc_conn_setup_complete_nb_s::crit_exts_c_::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; - } - set(other.type()); + types e; + e.unpack(bref); + set(e); switch (type_) { - case types::rrc_conn_reest_request_r13: - c.set(other.c.get()); - break; - case types::later: - c.set(other.c.get()); + case types::rrc_conn_setup_complete_r13: + HANDLE_CODE(c.unpack(bref)); break; - case types::nulltype: + case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); + return SRSASN_ERROR_DECODE_FAIL; } - - return *this; + return SRSASN_SUCCESS; } -void rrc_conn_reest_request_nb_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::rrc_conn_reest_request_r13: - j.write_fieldname("rrcConnectionReestablishmentRequest-r13"); - c.get().to_json(j); - break; - case types::later: - j.write_fieldname("later"); - c.get().to_json(j); - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); - } - j.end_obj(); + +std::string rrc_conn_setup_complete_nb_s::crit_exts_c_::types_opts::to_string() const +{ + static const char* options[] = {"rrcConnectionSetupComplete-r13", "criticalExtensionsFuture"}; + return convert_enum_idx(options, 2, value, "rrc_conn_setup_complete_nb_s::crit_exts_c_::types"); } -SRSASN_CODE rrc_conn_reest_request_nb_s::crit_exts_c_::pack(bit_ref& bref) const + +// RRCEarlyDataRequest-NB-v1590-IEs ::= SEQUENCE +SRSASN_CODE rrc_early_data_request_nb_v1590_ies_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::rrc_conn_reest_request_r13: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::later: - HANDLE_CODE(c.get().pack(bref)); - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); } + return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_request_nb_s::crit_exts_c_::unpack(cbit_ref& bref) +SRSASN_CODE rrc_early_data_request_nb_v1590_ies_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::rrc_conn_reest_request_r13: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::later: - HANDLE_CODE(c.get().unpack(bref)); - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } + return SRSASN_SUCCESS; } - -void rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::destroy_() +void rrc_early_data_request_nb_v1590_ies_s::to_json(json_writer& j) const { - switch (type_) { - case types::rrc_conn_reest_request_r14: - c.destroy(); - break; - default: - break; + j.start_obj(); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); } + j.end_obj(); } -void rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::set(types::options e) + +// RRCEarlyDataRequest-NB-r15-IEs ::= SEQUENCE +SRSASN_CODE rrc_early_data_request_nb_r15_ies_s::pack(bit_ref& bref) const { - destroy_(); - type_ = e; - switch (type_) { - case types::rrc_conn_reest_request_r14: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + HANDLE_CODE(bref.pack(cqi_npdcch_r15_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(s_tmsi_r15.pack(bref)); + HANDLE_CODE(establishment_cause_r15.pack(bref)); + if (cqi_npdcch_r15_present) { + HANDLE_CODE(cqi_npdcch_r15.pack(bref)); + } + HANDLE_CODE(ded_info_nas_r15.pack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); } + + return SRSASN_SUCCESS; } -rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::later_c_( - const rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_& other) +SRSASN_CODE rrc_early_data_request_nb_r15_ies_s::unpack(cbit_ref& bref) { - type_ = other.type(); - switch (type_) { - case types::rrc_conn_reest_request_r14: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + HANDLE_CODE(bref.unpack(cqi_npdcch_r15_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + HANDLE_CODE(s_tmsi_r15.unpack(bref)); + HANDLE_CODE(establishment_cause_r15.unpack(bref)); + if (cqi_npdcch_r15_present) { + HANDLE_CODE(cqi_npdcch_r15.unpack(bref)); + } + HANDLE_CODE(ded_info_nas_r15.unpack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } + + return SRSASN_SUCCESS; } -rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_& rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::operator=( - const rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_& other) +void rrc_early_data_request_nb_r15_ies_s::to_json(json_writer& j) const { - if (this == &other) { - return *this; + j.start_obj(); + j.write_fieldname("s-TMSI-r15"); + s_tmsi_r15.to_json(j); + j.write_str("establishmentCause-r15", establishment_cause_r15.to_string()); + if (cqi_npdcch_r15_present) { + j.write_str("cqi-NPDCCH-r15", cqi_npdcch_r15.to_string()); } - set(other.type()); - switch (type_) { - case types::rrc_conn_reest_request_r14: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + j.write_str("dedicatedInfoNAS-r15", ded_info_nas_r15.to_string()); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } + j.end_obj(); +} - return *this; +std::string rrc_early_data_request_nb_r15_ies_s::establishment_cause_r15_opts::to_string() const +{ + static const char* options[] = {"mo-Data", "mo-ExceptionData", "delayTolerantAccess", "spare1"}; + return convert_enum_idx(options, 4, value, "rrc_early_data_request_nb_r15_ies_s::establishment_cause_r15_e_"); } -void rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::to_json(json_writer& j) const + +// RRCEarlyDataRequest-NB-r15 ::= SEQUENCE +SRSASN_CODE rrc_early_data_request_nb_r15_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(crit_exts.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_early_data_request_nb_r15_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(crit_exts.unpack(bref)); + + return SRSASN_SUCCESS; +} +void rrc_early_data_request_nb_r15_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} + +void rrc_early_data_request_nb_r15_s::crit_exts_c_::set(types::options e) +{ + type_ = e; +} +void rrc_early_data_request_nb_r15_s::crit_exts_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::rrc_conn_reest_request_r14: - j.write_fieldname("rrcConnectionReestablishmentRequest-r14"); - c.get().to_json(j); + case types::rrc_early_data_request_r15: + j.write_fieldname("rrcEarlyDataRequest-r15"); + c.to_json(j); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); } j.end_obj(); } -SRSASN_CODE rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::pack(bit_ref& bref) const +SRSASN_CODE rrc_early_data_request_nb_r15_s::crit_exts_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::rrc_conn_reest_request_r14: - HANDLE_CODE(c.get().pack(bref)); + case types::rrc_early_data_request_r15: + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::unpack(cbit_ref& bref) +SRSASN_CODE rrc_early_data_request_nb_r15_s::crit_exts_c_::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::rrc_conn_reest_request_r14: - HANDLE_CODE(c.get().unpack(bref)); + case types::rrc_early_data_request_r15: + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; default: - log_invalid_choice_id(type_, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_"); + log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -std::string rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::types_opts::to_string() const +std::string rrc_early_data_request_nb_r15_s::crit_exts_c_::types_opts::to_string() const { - static const char* options[] = {"rrcConnectionReestablishmentRequest-r14", "criticalExtensionsFuture"}; - return convert_enum_idx(options, 2, value, "rrc_conn_reest_request_nb_s::crit_exts_c_::later_c_::types"); + static const char* options[] = {"rrcEarlyDataRequest-r15", "criticalExtensionsFuture"}; + return convert_enum_idx(options, 2, value, "rrc_early_data_request_nb_r15_s::crit_exts_c_::types"); } -std::string rrc_conn_reest_request_nb_s::crit_exts_c_::types_opts::to_string() const +// SC-MTCH-SchedulingInfo-NB-r14 ::= SEQUENCE +SRSASN_CODE sc_mtch_sched_info_nb_r14_s::pack(bit_ref& bref) const { - static const char* options[] = {"rrcConnectionReestablishmentRequest-r13", "later"}; - return convert_enum_idx(options, 2, value, "rrc_conn_reest_request_nb_s::crit_exts_c_::types"); -} + bref.pack(ext, 1); + HANDLE_CODE(on_dur_timer_scptm_r14.pack(bref)); + HANDLE_CODE(drx_inactivity_timer_scptm_r14.pack(bref)); + HANDLE_CODE(sched_period_start_offset_scptm_r14.pack(bref)); -// EstablishmentCause-NB-r13 ::= ENUMERATED -std::string establishment_cause_nb_r13_opts::to_string() const -{ - static const char* options[] = {"mt-Access", - "mo-Signalling", - "mo-Data", - "mo-ExceptionData", - "delayTolerantAccess-v1330", - "spare3", - "spare2", - "spare1"}; - return convert_enum_idx(options, 8, value, "establishment_cause_nb_r13_e"); + return SRSASN_SUCCESS; } - -// RRCConnectionRequest-NB-r13-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_request_nb_r13_ies_s::pack(bit_ref& bref) const +SRSASN_CODE sc_mtch_sched_info_nb_r14_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.pack(multi_tone_support_r13_present, 1)); - HANDLE_CODE(bref.pack(multi_carrier_support_r13_present, 1)); - - HANDLE_CODE(ue_id_r13.pack(bref)); - HANDLE_CODE(establishment_cause_r13.pack(bref)); - HANDLE_CODE(bref.pack(early_contention_resolution_r14, 1)); - HANDLE_CODE(cqi_npdcch_r14.pack(bref)); - HANDLE_CODE(spare.pack(bref)); + bref.unpack(ext, 1); + HANDLE_CODE(on_dur_timer_scptm_r14.unpack(bref)); + HANDLE_CODE(drx_inactivity_timer_scptm_r14.unpack(bref)); + HANDLE_CODE(sched_period_start_offset_scptm_r14.unpack(bref)); return SRSASN_SUCCESS; } -SRSASN_CODE rrc_conn_request_nb_r13_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(multi_tone_support_r13_present, 1)); - HANDLE_CODE(bref.unpack(multi_carrier_support_r13_present, 1)); - - HANDLE_CODE(ue_id_r13.unpack(bref)); - HANDLE_CODE(establishment_cause_r13.unpack(bref)); - HANDLE_CODE(bref.unpack(early_contention_resolution_r14, 1)); - HANDLE_CODE(cqi_npdcch_r14.unpack(bref)); - HANDLE_CODE(spare.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rrc_conn_request_nb_r13_ies_s::to_json(json_writer& j) const +void sc_mtch_sched_info_nb_r14_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("ue-Identity-r13"); - ue_id_r13.to_json(j); - j.write_str("establishmentCause-r13", establishment_cause_r13.to_string()); - if (multi_tone_support_r13_present) { - j.write_str("multiToneSupport-r13", "true"); - } - if (multi_carrier_support_r13_present) { - j.write_str("multiCarrierSupport-r13", "true"); - } - j.write_bool("earlyContentionResolution-r14", early_contention_resolution_r14); - j.write_str("cqi-NPDCCH-r14", cqi_npdcch_r14.to_string()); - j.write_str("spare", spare.to_string()); + j.write_str("onDurationTimerSCPTM-r14", on_dur_timer_scptm_r14.to_string()); + j.write_str("drx-InactivityTimerSCPTM-r14", drx_inactivity_timer_scptm_r14.to_string()); + j.write_fieldname("schedulingPeriodStartOffsetSCPTM-r14"); + sched_period_start_offset_scptm_r14.to_json(j); j.end_obj(); } -// RRCConnectionRequest-NB ::= SEQUENCE -SRSASN_CODE rrc_conn_request_nb_s::pack(bit_ref& bref) const +std::string sc_mtch_sched_info_nb_r14_s::on_dur_timer_scptm_r14_opts::to_string() const { - HANDLE_CODE(crit_exts.pack(bref)); - - return SRSASN_SUCCESS; + static const char* options[] = {"pp1", "pp2", "pp3", "pp4", "pp8", "pp16", "pp32", "spare"}; + return convert_enum_idx(options, 8, value, "sc_mtch_sched_info_nb_r14_s::on_dur_timer_scptm_r14_e_"); } -SRSASN_CODE rrc_conn_request_nb_s::unpack(cbit_ref& bref) +uint8_t sc_mtch_sched_info_nb_r14_s::on_dur_timer_scptm_r14_opts::to_number() const { - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; + static const uint8_t options[] = {1, 2, 3, 4, 8, 16, 32}; + return map_enum_number(options, 7, value, "sc_mtch_sched_info_nb_r14_s::on_dur_timer_scptm_r14_e_"); } -void rrc_conn_request_nb_s::to_json(json_writer& j) const + +std::string sc_mtch_sched_info_nb_r14_s::drx_inactivity_timer_scptm_r14_opts::to_string() const { - j.start_obj(); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); + static const char* options[] = {"pp0", "pp1", "pp2", "pp3", "pp4", "pp8", "pp16", "pp32"}; + return convert_enum_idx(options, 8, value, "sc_mtch_sched_info_nb_r14_s::drx_inactivity_timer_scptm_r14_e_"); } - -void rrc_conn_request_nb_s::crit_exts_c_::destroy_() +uint8_t sc_mtch_sched_info_nb_r14_s::drx_inactivity_timer_scptm_r14_opts::to_number() const { - switch (type_) { - case types::rrc_conn_request_r13: - c.destroy(); - break; - default: - break; - } + static const uint8_t options[] = {0, 1, 2, 3, 4, 8, 16, 32}; + return map_enum_number(options, 8, value, "sc_mtch_sched_info_nb_r14_s::drx_inactivity_timer_scptm_r14_e_"); } -void rrc_conn_request_nb_s::crit_exts_c_::set(types::options e) + +void sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::destroy_() {} +void sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::set(types::options e) { destroy_(); type_ = e; - switch (type_) { - case types::rrc_conn_request_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); - } } -rrc_conn_request_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_request_nb_s::crit_exts_c_& other) +sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::sched_period_start_offset_scptm_r14_c_( + const sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_& other) { type_ = other.type(); switch (type_) { - case types::rrc_conn_request_r13: - c.init(other.c.get()); + case types::sf10: + c.init(other.c.get()); break; - case types::crit_exts_future: + case types::sf20: + c.init(other.c.get()); + break; + case types::sf32: + c.init(other.c.get()); + break; + case types::sf40: + c.init(other.c.get()); + break; + case types::sf64: + c.init(other.c.get()); + break; + case types::sf80: + c.init(other.c.get()); + break; + case types::sf128: + c.init(other.c.get()); + break; + case types::sf160: + c.init(other.c.get()); + break; + case types::sf256: + c.init(other.c.get()); + break; + case types::sf320: + c.init(other.c.get()); + break; + case types::sf512: + c.init(other.c.get()); + break; + case types::sf640: + c.init(other.c.get()); + break; + case types::sf1024: + c.init(other.c.get()); + break; + case types::sf2048: + c.init(other.c.get()); + break; + case types::sf4096: + c.init(other.c.get()); + break; + case types::sf8192: + c.init(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_"); } } -rrc_conn_request_nb_s::crit_exts_c_& -rrc_conn_request_nb_s::crit_exts_c_::operator=(const rrc_conn_request_nb_s::crit_exts_c_& other) +sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_& +sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::operator=( + const sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_& other) { if (this == &other) { return *this; } set(other.type()); switch (type_) { - case types::rrc_conn_request_r13: - c.set(other.c.get()); + case types::sf10: + c.set(other.c.get()); break; - case types::crit_exts_future: + case types::sf20: + c.set(other.c.get()); + break; + case types::sf32: + c.set(other.c.get()); + break; + case types::sf40: + c.set(other.c.get()); + break; + case types::sf64: + c.set(other.c.get()); + break; + case types::sf80: + c.set(other.c.get()); + break; + case types::sf128: + c.set(other.c.get()); + break; + case types::sf160: + c.set(other.c.get()); + break; + case types::sf256: + c.set(other.c.get()); + break; + case types::sf320: + c.set(other.c.get()); + break; + case types::sf512: + c.set(other.c.get()); + break; + case types::sf640: + c.set(other.c.get()); + break; + case types::sf1024: + c.set(other.c.get()); + break; + case types::sf2048: + c.set(other.c.get()); + break; + case types::sf4096: + c.set(other.c.get()); + break; + case types::sf8192: + c.set(other.c.get()); break; case types::nulltype: break; default: - log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_"); } return *this; } -void rrc_conn_request_nb_s::crit_exts_c_::to_json(json_writer& j) const +void sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::to_json(json_writer& j) const { j.start_obj(); switch (type_) { - case types::rrc_conn_request_r13: - j.write_fieldname("rrcConnectionRequest-r13"); - c.get().to_json(j); + case types::sf10: + j.write_int("sf10", c.get()); break; - case types::crit_exts_future: + case types::sf20: + j.write_int("sf20", c.get()); + break; + case types::sf32: + j.write_int("sf32", c.get()); + break; + case types::sf40: + j.write_int("sf40", c.get()); + break; + case types::sf64: + j.write_int("sf64", c.get()); + break; + case types::sf80: + j.write_int("sf80", c.get()); + break; + case types::sf128: + j.write_int("sf128", c.get()); + break; + case types::sf160: + j.write_int("sf160", c.get()); + break; + case types::sf256: + j.write_int("sf256", c.get()); + break; + case types::sf320: + j.write_int("sf320", c.get()); + break; + case types::sf512: + j.write_int("sf512", c.get()); + break; + case types::sf640: + j.write_int("sf640", c.get()); + break; + case types::sf1024: + j.write_int("sf1024", c.get()); + break; + case types::sf2048: + j.write_int("sf2048", c.get()); + break; + case types::sf4096: + j.write_int("sf4096", c.get()); + break; + case types::sf8192: + j.write_int("sf8192", c.get()); break; default: - log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); + log_invalid_choice_id(type_, "sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_"); } j.end_obj(); } -SRSASN_CODE rrc_conn_request_nb_s::crit_exts_c_::pack(bit_ref& bref) const +SRSASN_CODE sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::pack(bit_ref& bref) const { type_.pack(bref); switch (type_) { - case types::rrc_conn_request_r13: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: + case types::sf10: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)9u)); break; - default: - log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_request_nb_s::crit_exts_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::rrc_conn_request_r13: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_request_nb_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -std::string rrc_conn_request_nb_s::crit_exts_c_::types_opts::to_string() const -{ - static const char* options[] = {"rrcConnectionRequest-r13", "criticalExtensionsFuture"}; - return convert_enum_idx(options, 2, value, "rrc_conn_request_nb_s::crit_exts_c_::types"); -} - -// RRCConnectionResumeComplete-NB-v1470-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_resume_complete_nb_v1470_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(meas_result_serv_cell_r14_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (meas_result_serv_cell_r14_present) { - HANDLE_CODE(meas_result_serv_cell_r14.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_resume_complete_nb_v1470_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(meas_result_serv_cell_r14_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (meas_result_serv_cell_r14_present) { - HANDLE_CODE(meas_result_serv_cell_r14.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_resume_complete_nb_v1470_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (meas_result_serv_cell_r14_present) { - j.write_fieldname("measResultServCell-r14"); - meas_result_serv_cell_r14.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - -// RRCConnectionResumeComplete-NB-r13-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_resume_complete_nb_r13_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(sel_plmn_id_r13_present, 1)); - HANDLE_CODE(bref.pack(ded_info_nas_r13_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (sel_plmn_id_r13_present) { - HANDLE_CODE(pack_integer(bref, sel_plmn_id_r13, (uint8_t)1u, (uint8_t)6u)); - } - if (ded_info_nas_r13_present) { - HANDLE_CODE(ded_info_nas_r13.pack(bref)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_resume_complete_nb_r13_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(sel_plmn_id_r13_present, 1)); - HANDLE_CODE(bref.unpack(ded_info_nas_r13_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (sel_plmn_id_r13_present) { - HANDLE_CODE(unpack_integer(sel_plmn_id_r13, bref, (uint8_t)1u, (uint8_t)6u)); - } - if (ded_info_nas_r13_present) { - HANDLE_CODE(ded_info_nas_r13.unpack(bref)); - } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_resume_complete_nb_r13_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (sel_plmn_id_r13_present) { - j.write_int("selectedPLMN-Identity-r13", sel_plmn_id_r13); - } - if (ded_info_nas_r13_present) { - j.write_str("dedicatedInfoNAS-r13", ded_info_nas_r13.to_string()); - } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// RRCConnectionResumeComplete-NB ::= SEQUENCE -SRSASN_CODE rrc_conn_resume_complete_nb_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pack_integer(bref, rrc_transaction_id, (uint8_t)0u, (uint8_t)3u)); - HANDLE_CODE(crit_exts.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_resume_complete_nb_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rrc_conn_resume_complete_nb_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); -} - -void rrc_conn_resume_complete_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_resume_complete_r13: - c.destroy(); - break; - default: - break; - } -} -void rrc_conn_resume_complete_nb_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::rrc_conn_resume_complete_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); - } -} -rrc_conn_resume_complete_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_resume_complete_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_resume_complete_r13: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); - } -} -rrc_conn_resume_complete_nb_s::crit_exts_c_& -rrc_conn_resume_complete_nb_s::crit_exts_c_::operator=(const rrc_conn_resume_complete_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_resume_complete_r13: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); - } - - return *this; -} -void rrc_conn_resume_complete_nb_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::rrc_conn_resume_complete_r13: - j.write_fieldname("rrcConnectionResumeComplete-r13"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); - } - j.end_obj(); -} -SRSASN_CODE rrc_conn_resume_complete_nb_s::crit_exts_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::rrc_conn_resume_complete_r13: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_resume_complete_nb_s::crit_exts_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::rrc_conn_resume_complete_r13: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_complete_nb_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -std::string rrc_conn_resume_complete_nb_s::crit_exts_c_::types_opts::to_string() const -{ - static const char* options[] = {"rrcConnectionResumeComplete-r13", "criticalExtensionsFuture"}; - return convert_enum_idx(options, 2, value, "rrc_conn_resume_complete_nb_s::crit_exts_c_::types"); -} - -// RRCConnectionResumeRequest-NB-r13-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_resume_request_nb_r13_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(resume_id_r13.pack(bref)); - HANDLE_CODE(short_resume_mac_i_r13.pack(bref)); - HANDLE_CODE(resume_cause_r13.pack(bref)); - HANDLE_CODE(bref.pack(early_contention_resolution_r14, 1)); - HANDLE_CODE(cqi_npdcch_r14.pack(bref)); - HANDLE_CODE(spare.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_resume_request_nb_r13_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(resume_id_r13.unpack(bref)); - HANDLE_CODE(short_resume_mac_i_r13.unpack(bref)); - HANDLE_CODE(resume_cause_r13.unpack(bref)); - HANDLE_CODE(bref.unpack(early_contention_resolution_r14, 1)); - HANDLE_CODE(cqi_npdcch_r14.unpack(bref)); - HANDLE_CODE(spare.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rrc_conn_resume_request_nb_r13_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("resumeID-r13", resume_id_r13.to_string()); - j.write_str("shortResumeMAC-I-r13", short_resume_mac_i_r13.to_string()); - j.write_str("resumeCause-r13", resume_cause_r13.to_string()); - j.write_bool("earlyContentionResolution-r14", early_contention_resolution_r14); - j.write_str("cqi-NPDCCH-r14", cqi_npdcch_r14.to_string()); - j.write_str("spare", spare.to_string()); - j.end_obj(); -} - -// RRCConnectionResumeRequest-NB ::= SEQUENCE -SRSASN_CODE rrc_conn_resume_request_nb_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(crit_exts.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_resume_request_nb_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rrc_conn_resume_request_nb_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); -} - -void rrc_conn_resume_request_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_resume_request_r13: - c.destroy(); - break; - default: - break; - } -} -void rrc_conn_resume_request_nb_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::rrc_conn_resume_request_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); - } -} -rrc_conn_resume_request_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_resume_request_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_resume_request_r13: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); - } -} -rrc_conn_resume_request_nb_s::crit_exts_c_& -rrc_conn_resume_request_nb_s::crit_exts_c_::operator=(const rrc_conn_resume_request_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_resume_request_r13: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); - } - - return *this; -} -void rrc_conn_resume_request_nb_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::rrc_conn_resume_request_r13: - j.write_fieldname("rrcConnectionResumeRequest-r13"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); - } - j.end_obj(); -} -SRSASN_CODE rrc_conn_resume_request_nb_s::crit_exts_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::rrc_conn_resume_request_r13: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_resume_request_nb_s::crit_exts_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::rrc_conn_resume_request_r13: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_resume_request_nb_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -std::string rrc_conn_resume_request_nb_s::crit_exts_c_::types_opts::to_string() const -{ - static const char* options[] = {"rrcConnectionResumeRequest-r13", "criticalExtensionsFuture"}; - return convert_enum_idx(options, 2, value, "rrc_conn_resume_request_nb_s::crit_exts_c_::types"); -} - -// RRCConnectionSetupComplete-NB-v1470-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_setup_complete_nb_v1470_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(meas_result_serv_cell_r14_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (meas_result_serv_cell_r14_present) { - HANDLE_CODE(meas_result_serv_cell_r14.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_setup_complete_nb_v1470_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(meas_result_serv_cell_r14_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (meas_result_serv_cell_r14_present) { - HANDLE_CODE(meas_result_serv_cell_r14.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_setup_complete_nb_v1470_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (meas_result_serv_cell_r14_present) { - j.write_fieldname("measResultServCell-r14"); - meas_result_serv_cell_r14.to_json(j); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - -// RRCConnectionSetupComplete-NB-v1430-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_setup_complete_nb_v1430_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(gummei_type_r14_present, 1)); - HANDLE_CODE(bref.pack(dcn_id_r14_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (dcn_id_r14_present) { - HANDLE_CODE(pack_integer(bref, dcn_id_r14, (uint32_t)0u, (uint32_t)65535u)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_setup_complete_nb_v1430_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(gummei_type_r14_present, 1)); - HANDLE_CODE(bref.unpack(dcn_id_r14_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (dcn_id_r14_present) { - HANDLE_CODE(unpack_integer(dcn_id_r14, bref, (uint32_t)0u, (uint32_t)65535u)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_setup_complete_nb_v1430_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (gummei_type_r14_present) { - j.write_str("gummei-Type-r14", "mapped"); - } - if (dcn_id_r14_present) { - j.write_int("dcn-ID-r14", dcn_id_r14); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// RRCConnectionSetupComplete-NB-r13-IEs ::= SEQUENCE -SRSASN_CODE rrc_conn_setup_complete_nb_r13_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(s_tmsi_r13_present, 1)); - HANDLE_CODE(bref.pack(registered_mme_r13_present, 1)); - HANDLE_CODE(bref.pack(attach_without_pdn_connect_r13_present, 1)); - HANDLE_CODE(bref.pack(up_cio_t_eps_optim_r13_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - HANDLE_CODE(pack_integer(bref, sel_plmn_id_r13, (uint8_t)1u, (uint8_t)6u)); - if (s_tmsi_r13_present) { - HANDLE_CODE(s_tmsi_r13.pack(bref)); - } - if (registered_mme_r13_present) { - HANDLE_CODE(registered_mme_r13.pack(bref)); - } - HANDLE_CODE(ded_info_nas_r13.pack(bref)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_setup_complete_nb_r13_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(s_tmsi_r13_present, 1)); - HANDLE_CODE(bref.unpack(registered_mme_r13_present, 1)); - HANDLE_CODE(bref.unpack(attach_without_pdn_connect_r13_present, 1)); - HANDLE_CODE(bref.unpack(up_cio_t_eps_optim_r13_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - HANDLE_CODE(unpack_integer(sel_plmn_id_r13, bref, (uint8_t)1u, (uint8_t)6u)); - if (s_tmsi_r13_present) { - HANDLE_CODE(s_tmsi_r13.unpack(bref)); - } - if (registered_mme_r13_present) { - HANDLE_CODE(registered_mme_r13.unpack(bref)); - } - HANDLE_CODE(ded_info_nas_r13.unpack(bref)); - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_conn_setup_complete_nb_r13_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("selectedPLMN-Identity-r13", sel_plmn_id_r13); - if (s_tmsi_r13_present) { - j.write_fieldname("s-TMSI-r13"); - s_tmsi_r13.to_json(j); - } - if (registered_mme_r13_present) { - j.write_fieldname("registeredMME-r13"); - registered_mme_r13.to_json(j); - } - j.write_str("dedicatedInfoNAS-r13", ded_info_nas_r13.to_string()); - if (attach_without_pdn_connect_r13_present) { - j.write_str("attachWithoutPDN-Connectivity-r13", "true"); - } - if (up_cio_t_eps_optim_r13_present) { - j.write_str("up-CIoT-EPS-Optimisation-r13", "true"); - } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -// RRCConnectionSetupComplete-NB ::= SEQUENCE -SRSASN_CODE rrc_conn_setup_complete_nb_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(pack_integer(bref, rrc_transaction_id, (uint8_t)0u, (uint8_t)3u)); - HANDLE_CODE(crit_exts.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_setup_complete_nb_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rrc_conn_setup_complete_nb_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); -} - -void rrc_conn_setup_complete_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_conn_setup_complete_r13: - c.destroy(); - break; - default: - break; - } -} -void rrc_conn_setup_complete_nb_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::rrc_conn_setup_complete_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); - } -} -rrc_conn_setup_complete_nb_s::crit_exts_c_::crit_exts_c_(const rrc_conn_setup_complete_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_conn_setup_complete_r13: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); - } -} -rrc_conn_setup_complete_nb_s::crit_exts_c_& -rrc_conn_setup_complete_nb_s::crit_exts_c_::operator=(const rrc_conn_setup_complete_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_conn_setup_complete_r13: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); - } - - return *this; -} -void rrc_conn_setup_complete_nb_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::rrc_conn_setup_complete_r13: - j.write_fieldname("rrcConnectionSetupComplete-r13"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); - } - j.end_obj(); -} -SRSASN_CODE rrc_conn_setup_complete_nb_s::crit_exts_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::rrc_conn_setup_complete_r13: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_conn_setup_complete_nb_s::crit_exts_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::rrc_conn_setup_complete_r13: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_conn_setup_complete_nb_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -std::string rrc_conn_setup_complete_nb_s::crit_exts_c_::types_opts::to_string() const -{ - static const char* options[] = {"rrcConnectionSetupComplete-r13", "criticalExtensionsFuture"}; - return convert_enum_idx(options, 2, value, "rrc_conn_setup_complete_nb_s::crit_exts_c_::types"); -} - -// RRCEarlyDataRequest-NB-v1590-IEs ::= SEQUENCE -SRSASN_CODE rrc_early_data_request_nb_v1590_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_early_data_request_nb_v1590_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_early_data_request_nb_v1590_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); - } - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - j.start_obj(); - j.end_obj(); - } - j.end_obj(); -} - -// RRCEarlyDataRequest-NB-r15-IEs ::= SEQUENCE -SRSASN_CODE rrc_early_data_request_nb_r15_ies_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(bref.pack(cqi_npdcch_r15_present, 1)); - HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - - HANDLE_CODE(s_tmsi_r15.pack(bref)); - HANDLE_CODE(establishment_cause_r15.pack(bref)); - if (cqi_npdcch_r15_present) { - HANDLE_CODE(cqi_npdcch_r15.pack(bref)); - } - HANDLE_CODE(ded_info_nas_r15.pack(bref)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.pack(bref)); - } - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_early_data_request_nb_r15_ies_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(bref.unpack(cqi_npdcch_r15_present, 1)); - HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - - HANDLE_CODE(s_tmsi_r15.unpack(bref)); - HANDLE_CODE(establishment_cause_r15.unpack(bref)); - if (cqi_npdcch_r15_present) { - HANDLE_CODE(cqi_npdcch_r15.unpack(bref)); - } - HANDLE_CODE(ded_info_nas_r15.unpack(bref)); - if (non_crit_ext_present) { - HANDLE_CODE(non_crit_ext.unpack(bref)); - } - - return SRSASN_SUCCESS; -} -void rrc_early_data_request_nb_r15_ies_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("s-TMSI-r15"); - s_tmsi_r15.to_json(j); - j.write_str("establishmentCause-r15", establishment_cause_r15.to_string()); - if (cqi_npdcch_r15_present) { - j.write_str("cqi-NPDCCH-r15", cqi_npdcch_r15.to_string()); - } - j.write_str("dedicatedInfoNAS-r15", ded_info_nas_r15.to_string()); - if (non_crit_ext_present) { - j.write_fieldname("nonCriticalExtension"); - non_crit_ext.to_json(j); - } - j.end_obj(); -} - -std::string rrc_early_data_request_nb_r15_ies_s::establishment_cause_r15_opts::to_string() const -{ - static const char* options[] = {"mo-Data", "mo-ExceptionData", "delayTolerantAccess", "spare1"}; - return convert_enum_idx(options, 4, value, "rrc_early_data_request_nb_r15_ies_s::establishment_cause_r15_e_"); -} - -// RRCEarlyDataRequest-NB-r15 ::= SEQUENCE -SRSASN_CODE rrc_early_data_request_nb_r15_s::pack(bit_ref& bref) const -{ - HANDLE_CODE(crit_exts.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_early_data_request_nb_r15_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rrc_early_data_request_nb_r15_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); -} - -void rrc_early_data_request_nb_r15_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_early_data_request_r15: - c.destroy(); - break; - default: - break; - } -} -void rrc_early_data_request_nb_r15_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::rrc_early_data_request_r15: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); - } -} -rrc_early_data_request_nb_r15_s::crit_exts_c_::crit_exts_c_(const rrc_early_data_request_nb_r15_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_early_data_request_r15: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); - } -} -rrc_early_data_request_nb_r15_s::crit_exts_c_& -rrc_early_data_request_nb_r15_s::crit_exts_c_::operator=(const rrc_early_data_request_nb_r15_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_early_data_request_r15: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); - } - - return *this; -} -void rrc_early_data_request_nb_r15_s::crit_exts_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::rrc_early_data_request_r15: - j.write_fieldname("rrcEarlyDataRequest-r15"); - c.get().to_json(j); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); - } - j.end_obj(); -} -SRSASN_CODE rrc_early_data_request_nb_r15_s::crit_exts_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::rrc_early_data_request_r15: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -SRSASN_CODE rrc_early_data_request_nb_r15_s::crit_exts_c_::unpack(cbit_ref& bref) -{ - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::rrc_early_data_request_r15: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::crit_exts_future: - break; - default: - log_invalid_choice_id(type_, "rrc_early_data_request_nb_r15_s::crit_exts_c_"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - -std::string rrc_early_data_request_nb_r15_s::crit_exts_c_::types_opts::to_string() const -{ - static const char* options[] = {"rrcEarlyDataRequest-r15", "criticalExtensionsFuture"}; - return convert_enum_idx(options, 2, value, "rrc_early_data_request_nb_r15_s::crit_exts_c_::types"); -} - -// SC-MTCH-SchedulingInfo-NB-r14 ::= SEQUENCE -SRSASN_CODE sc_mtch_sched_info_nb_r14_s::pack(bit_ref& bref) const -{ - bref.pack(ext, 1); - HANDLE_CODE(on_dur_timer_scptm_r14.pack(bref)); - HANDLE_CODE(drx_inactivity_timer_scptm_r14.pack(bref)); - HANDLE_CODE(sched_period_start_offset_scptm_r14.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE sc_mtch_sched_info_nb_r14_s::unpack(cbit_ref& bref) -{ - bref.unpack(ext, 1); - HANDLE_CODE(on_dur_timer_scptm_r14.unpack(bref)); - HANDLE_CODE(drx_inactivity_timer_scptm_r14.unpack(bref)); - HANDLE_CODE(sched_period_start_offset_scptm_r14.unpack(bref)); - - return SRSASN_SUCCESS; -} -void sc_mtch_sched_info_nb_r14_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_str("onDurationTimerSCPTM-r14", on_dur_timer_scptm_r14.to_string()); - j.write_str("drx-InactivityTimerSCPTM-r14", drx_inactivity_timer_scptm_r14.to_string()); - j.write_fieldname("schedulingPeriodStartOffsetSCPTM-r14"); - sched_period_start_offset_scptm_r14.to_json(j); - j.end_obj(); -} - -std::string sc_mtch_sched_info_nb_r14_s::on_dur_timer_scptm_r14_opts::to_string() const -{ - static const char* options[] = {"pp1", "pp2", "pp3", "pp4", "pp8", "pp16", "pp32", "spare"}; - return convert_enum_idx(options, 8, value, "sc_mtch_sched_info_nb_r14_s::on_dur_timer_scptm_r14_e_"); -} -uint8_t sc_mtch_sched_info_nb_r14_s::on_dur_timer_scptm_r14_opts::to_number() const -{ - static const uint8_t options[] = {1, 2, 3, 4, 8, 16, 32}; - return map_enum_number(options, 7, value, "sc_mtch_sched_info_nb_r14_s::on_dur_timer_scptm_r14_e_"); -} - -std::string sc_mtch_sched_info_nb_r14_s::drx_inactivity_timer_scptm_r14_opts::to_string() const -{ - static const char* options[] = {"pp0", "pp1", "pp2", "pp3", "pp4", "pp8", "pp16", "pp32"}; - return convert_enum_idx(options, 8, value, "sc_mtch_sched_info_nb_r14_s::drx_inactivity_timer_scptm_r14_e_"); -} -uint8_t sc_mtch_sched_info_nb_r14_s::drx_inactivity_timer_scptm_r14_opts::to_number() const -{ - static const uint8_t options[] = {0, 1, 2, 3, 4, 8, 16, 32}; - return map_enum_number(options, 8, value, "sc_mtch_sched_info_nb_r14_s::drx_inactivity_timer_scptm_r14_e_"); -} - -void sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::destroy_() {} -void sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::set(types::options e) -{ - destroy_(); - type_ = e; -} -sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::sched_period_start_offset_scptm_r14_c_( - const sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::sf10: - c.init(other.c.get()); - break; - case types::sf20: - c.init(other.c.get()); - break; - case types::sf32: - c.init(other.c.get()); - break; - case types::sf40: - c.init(other.c.get()); - break; - case types::sf64: - c.init(other.c.get()); - break; - case types::sf80: - c.init(other.c.get()); - break; - case types::sf128: - c.init(other.c.get()); - break; - case types::sf160: - c.init(other.c.get()); - break; - case types::sf256: - c.init(other.c.get()); - break; - case types::sf320: - c.init(other.c.get()); - break; - case types::sf512: - c.init(other.c.get()); - break; - case types::sf640: - c.init(other.c.get()); - break; - case types::sf1024: - c.init(other.c.get()); - break; - case types::sf2048: - c.init(other.c.get()); - break; - case types::sf4096: - c.init(other.c.get()); - break; - case types::sf8192: - c.init(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_"); - } -} -sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_& -sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::operator=( - const sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::sf10: - c.set(other.c.get()); - break; - case types::sf20: - c.set(other.c.get()); - break; - case types::sf32: - c.set(other.c.get()); - break; - case types::sf40: - c.set(other.c.get()); - break; - case types::sf64: - c.set(other.c.get()); - break; - case types::sf80: - c.set(other.c.get()); - break; - case types::sf128: - c.set(other.c.get()); - break; - case types::sf160: - c.set(other.c.get()); - break; - case types::sf256: - c.set(other.c.get()); - break; - case types::sf320: - c.set(other.c.get()); - break; - case types::sf512: - c.set(other.c.get()); - break; - case types::sf640: - c.set(other.c.get()); - break; - case types::sf1024: - c.set(other.c.get()); - break; - case types::sf2048: - c.set(other.c.get()); - break; - case types::sf4096: - c.set(other.c.get()); - break; - case types::sf8192: - c.set(other.c.get()); - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_"); - } - - return *this; -} -void sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::sf10: - j.write_int("sf10", c.get()); - break; - case types::sf20: - j.write_int("sf20", c.get()); - break; - case types::sf32: - j.write_int("sf32", c.get()); - break; - case types::sf40: - j.write_int("sf40", c.get()); - break; - case types::sf64: - j.write_int("sf64", c.get()); - break; - case types::sf80: - j.write_int("sf80", c.get()); - break; - case types::sf128: - j.write_int("sf128", c.get()); - break; - case types::sf160: - j.write_int("sf160", c.get()); - break; - case types::sf256: - j.write_int("sf256", c.get()); - break; - case types::sf320: - j.write_int("sf320", c.get()); - break; - case types::sf512: - j.write_int("sf512", c.get()); - break; - case types::sf640: - j.write_int("sf640", c.get()); - break; - case types::sf1024: - j.write_int("sf1024", c.get()); - break; - case types::sf2048: - j.write_int("sf2048", c.get()); - break; - case types::sf4096: - j.write_int("sf4096", c.get()); - break; - case types::sf8192: - j.write_int("sf8192", c.get()); - break; - default: - log_invalid_choice_id(type_, "sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_"); - } - j.end_obj(); -} -SRSASN_CODE sc_mtch_sched_info_nb_r14_s::sched_period_start_offset_scptm_r14_c_::pack(bit_ref& bref) const -{ - type_.pack(bref); - switch (type_) { - case types::sf10: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)9u)); - break; - case types::sf20: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)19u)); + case types::sf20: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)19u)); break; case types::sf32: HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)31u)); @@ -19151,160 +17357,520 @@ SRSASN_CODE sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_::pack(bit_ref& bre case types::dl_carrier_cfg_r14: HANDLE_CODE(c.get().pack(bref)); break; - case types::dl_carrier_idx_r14: - HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)15u)); + case types::dl_carrier_idx_r14: + HANDLE_CODE(pack_integer(bref, c.get(), (uint8_t)0u, (uint8_t)15u)); + break; + default: + log_invalid_choice_id(type_, "sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::dl_carrier_cfg_r14: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::dl_carrier_idx_r14: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)15u)); + break; + default: + log_invalid_choice_id(type_, "sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +std::string sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_::types_opts::to_string() const +{ + static const char* options[] = {"dl-CarrierConfig-r14", "dl-CarrierIndex-r14"}; + return convert_enum_idx(options, 2, value, "sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_::types"); +} + +std::string sc_mtch_info_nb_r14_s::npdcch_npdsch_max_tbs_sc_mtch_r14_opts::to_string() const +{ + static const char* options[] = {"n680", "n2536"}; + return convert_enum_idx(options, 2, value, "sc_mtch_info_nb_r14_s::npdcch_npdsch_max_tbs_sc_mtch_r14_e_"); +} +uint16_t sc_mtch_info_nb_r14_s::npdcch_npdsch_max_tbs_sc_mtch_r14_opts::to_number() const +{ + static const uint16_t options[] = {680, 2536}; + return map_enum_number(options, 2, value, "sc_mtch_info_nb_r14_s::npdcch_npdsch_max_tbs_sc_mtch_r14_e_"); +} + +std::string sc_mtch_info_nb_r14_s::npdcch_num_repeats_sc_mtch_r14_opts::to_string() const +{ + static const char* options[] = {"r1", + "r2", + "r4", + "r8", + "r16", + "r32", + "r64", + "r128", + "r256", + "r512", + "r1024", + "r2048", + "spare4", + "spare3", + "spare2", + "spare1"}; + return convert_enum_idx(options, 16, value, "sc_mtch_info_nb_r14_s::npdcch_num_repeats_sc_mtch_r14_e_"); +} +uint16_t sc_mtch_info_nb_r14_s::npdcch_num_repeats_sc_mtch_r14_opts::to_number() const +{ + static const uint16_t options[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048}; + return map_enum_number(options, 12, value, "sc_mtch_info_nb_r14_s::npdcch_num_repeats_sc_mtch_r14_e_"); +} + +std::string sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_opts::to_string() const +{ + static const char* options[] = {"v1dot5", "v2", "v4", "v8", "v16", "v32", "v48", "v64"}; + return convert_enum_idx(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_e_"); +} +float sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_opts::to_number() const +{ + static const float options[] = {1.5, 2.0, 4.0, 8.0, 16.0, 32.0, 48.0, 64.0}; + return map_enum_number(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_e_"); +} +std::string sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_opts::to_number_string() const +{ + static const char* options[] = {"1.5", "2", "4", "8", "16", "32", "48", "64"}; + return convert_enum_idx(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_e_"); +} + +std::string sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_opts::to_string() const +{ + static const char* options[] = { + "zero", "oneEighth", "oneQuarter", "threeEighth", "oneHalf", "fiveEighth", "threeQuarter", "sevenEighth"}; + return convert_enum_idx(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_e_"); +} +float sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_opts::to_number() const +{ + static const float options[] = {0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875}; + return map_enum_number(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_e_"); +} +std::string sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_opts::to_number_string() const +{ + static const char* options[] = {"0", "1/8", "1/4", "3/8", "1/2", "5/8", "3/4", "7/8"}; + return convert_enum_idx(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_e_"); +} + +// SCPTMConfiguration-NB-r14 ::= SEQUENCE +SRSASN_CODE scptm_cfg_nb_r14_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(scptm_neighbour_cell_list_r14_present, 1)); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + HANDLE_CODE(pack_dyn_seq_of(bref, sc_mtch_info_list_r14, 0, 64)); + if (scptm_neighbour_cell_list_r14_present) { + HANDLE_CODE(pack_dyn_seq_of(bref, scptm_neighbour_cell_list_r14, 1, 8)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE scptm_cfg_nb_r14_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(scptm_neighbour_cell_list_r14_present, 1)); + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + HANDLE_CODE(unpack_dyn_seq_of(sc_mtch_info_list_r14, bref, 0, 64)); + if (scptm_neighbour_cell_list_r14_present) { + HANDLE_CODE(unpack_dyn_seq_of(scptm_neighbour_cell_list_r14, bref, 1, 8)); + } + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void scptm_cfg_nb_r14_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.start_array("sc-mtch-InfoList-r14"); + for (const auto& e1 : sc_mtch_info_list_r14) { + e1.to_json(j); + } + j.end_array(); + if (scptm_neighbour_cell_list_r14_present) { + j.start_array("scptm-NeighbourCellList-r14"); + for (const auto& e1 : scptm_neighbour_cell_list_r14) { + e1.to_json(j); + } + j.end_array(); + } + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + j.start_obj(); + j.end_obj(); + } + j.end_obj(); +} + +// SC-MCCH-MessageType-NB ::= CHOICE +void sc_mcch_msg_type_nb_c::set(types::options e) +{ + type_ = e; +} +void sc_mcch_msg_type_nb_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::c1: + j.write_fieldname("c1"); + c.to_json(j); + break; + case types::msg_class_ext: + break; + default: + log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); + } + j.end_obj(); +} +SRSASN_CODE sc_mcch_msg_type_nb_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::c1: + HANDLE_CODE(c.pack(bref)); + break; + case types::msg_class_ext: break; default: - log_invalid_choice_id(type_, "sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_"); + log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); return SRSASN_ERROR_ENCODE_FAIL; } return SRSASN_SUCCESS; } -SRSASN_CODE sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_::unpack(cbit_ref& bref) +SRSASN_CODE sc_mcch_msg_type_nb_c::unpack(cbit_ref& bref) { types e; e.unpack(bref); set(e); switch (type_) { - case types::dl_carrier_cfg_r14: - HANDLE_CODE(c.get().unpack(bref)); + case types::c1: + HANDLE_CODE(c.unpack(bref)); break; - case types::dl_carrier_idx_r14: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint8_t)0u, (uint8_t)15u)); + case types::msg_class_ext: break; default: - log_invalid_choice_id(type_, "sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_"); + log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); return SRSASN_ERROR_DECODE_FAIL; } return SRSASN_SUCCESS; } -std::string sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_::types_opts::to_string() const +void sc_mcch_msg_type_nb_c::c1_c_::to_json(json_writer& j) const { - static const char* options[] = {"dl-CarrierConfig-r14", "dl-CarrierIndex-r14"}; - return convert_enum_idx(options, 2, value, "sc_mtch_info_nb_r14_s::sc_mtch_carrier_cfg_r14_c_::types"); + j.start_obj(); + j.write_fieldname("scptmConfiguration-r14"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE sc_mcch_msg_type_nb_c::c1_c_::pack(bit_ref& bref) const +{ + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE sc_mcch_msg_type_nb_c::c1_c_::unpack(cbit_ref& bref) +{ + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; } -std::string sc_mtch_info_nb_r14_s::npdcch_npdsch_max_tbs_sc_mtch_r14_opts::to_string() const +std::string sc_mcch_msg_type_nb_c::c1_c_::types_opts::to_string() const { - static const char* options[] = {"n680", "n2536"}; - return convert_enum_idx(options, 2, value, "sc_mtch_info_nb_r14_s::npdcch_npdsch_max_tbs_sc_mtch_r14_e_"); + static const char* options[] = {"scptmConfiguration-r14"}; + return convert_enum_idx(options, 1, value, "sc_mcch_msg_type_nb_c::c1_c_::types"); } -uint16_t sc_mtch_info_nb_r14_s::npdcch_npdsch_max_tbs_sc_mtch_r14_opts::to_number() const + +std::string sc_mcch_msg_type_nb_c::types_opts::to_string() const { - static const uint16_t options[] = {680, 2536}; - return map_enum_number(options, 2, value, "sc_mtch_info_nb_r14_s::npdcch_npdsch_max_tbs_sc_mtch_r14_e_"); + static const char* options[] = {"c1", "messageClassExtension"}; + return convert_enum_idx(options, 2, value, "sc_mcch_msg_type_nb_c::types"); +} +uint8_t sc_mcch_msg_type_nb_c::types_opts::to_number() const +{ + static const uint8_t options[] = {1}; + return map_enum_number(options, 1, value, "sc_mcch_msg_type_nb_c::types"); } -std::string sc_mtch_info_nb_r14_s::npdcch_num_repeats_sc_mtch_r14_opts::to_string() const +// SC-MCCH-Message-NB ::= SEQUENCE +SRSASN_CODE sc_mcch_msg_nb_s::pack(bit_ref& bref) const { - static const char* options[] = {"r1", - "r2", - "r4", - "r8", - "r16", - "r32", - "r64", - "r128", - "r256", - "r512", - "r1024", - "r2048", - "spare4", - "spare3", - "spare2", - "spare1"}; - return convert_enum_idx(options, 16, value, "sc_mtch_info_nb_r14_s::npdcch_num_repeats_sc_mtch_r14_e_"); + HANDLE_CODE(msg.pack(bref)); + + bref.align_bytes_zero(); + + return SRSASN_SUCCESS; } -uint16_t sc_mtch_info_nb_r14_s::npdcch_num_repeats_sc_mtch_r14_opts::to_number() const +SRSASN_CODE sc_mcch_msg_nb_s::unpack(cbit_ref& bref) { - static const uint16_t options[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048}; - return map_enum_number(options, 12, value, "sc_mtch_info_nb_r14_s::npdcch_num_repeats_sc_mtch_r14_e_"); + HANDLE_CODE(msg.unpack(bref)); + + bref.align_bytes(); + + return SRSASN_SUCCESS; +} +void sc_mcch_msg_nb_s::to_json(json_writer& j) const +{ + j.start_array(); + j.start_obj(); + j.start_obj("SC-MCCH-Message-NB"); + j.write_fieldname("message"); + msg.to_json(j); + j.end_obj(); + j.end_obj(); + j.end_array(); } -std::string sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_opts::to_string() const +// PhyLayerParameters-NB-v1430 ::= SEQUENCE +SRSASN_CODE phy_layer_params_nb_v1430_s::pack(bit_ref& bref) const { - static const char* options[] = {"v1dot5", "v2", "v4", "v8", "v16", "v32", "v48", "v64"}; - return convert_enum_idx(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_e_"); + HANDLE_CODE(bref.pack(multi_carrier_nprach_r14_present, 1)); + HANDLE_CODE(bref.pack(two_harq_processes_r14_present, 1)); + + return SRSASN_SUCCESS; } -float sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_opts::to_number() const +SRSASN_CODE phy_layer_params_nb_v1430_s::unpack(cbit_ref& bref) { - static const float options[] = {1.5, 2.0, 4.0, 8.0, 16.0, 32.0, 48.0, 64.0}; - return map_enum_number(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_e_"); + HANDLE_CODE(bref.unpack(multi_carrier_nprach_r14_present, 1)); + HANDLE_CODE(bref.unpack(two_harq_processes_r14_present, 1)); + + return SRSASN_SUCCESS; } -std::string sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_opts::to_number_string() const +void phy_layer_params_nb_v1430_s::to_json(json_writer& j) const { - static const char* options[] = {"1.5", "2", "4", "8", "16", "32", "48", "64"}; - return convert_enum_idx(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_start_sf_sc_mtch_r14_e_"); + j.start_obj(); + if (multi_carrier_nprach_r14_present) { + j.write_str("multiCarrier-NPRACH-r14", "supported"); + } + if (two_harq_processes_r14_present) { + j.write_str("twoHARQ-Processes-r14", "supported"); + } + j.end_obj(); +} + +// PhyLayerParameters-NB-v1530 ::= SEQUENCE +SRSASN_CODE phy_layer_params_nb_v1530_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(mixed_operation_mode_r15_present, 1)); + HANDLE_CODE(bref.pack(sr_with_harq_ack_r15_present, 1)); + HANDLE_CODE(bref.pack(sr_without_harq_ack_r15_present, 1)); + HANDLE_CODE(bref.pack(nprach_format2_r15_present, 1)); + HANDLE_CODE(bref.pack(add_tx_sib1_r15_present, 1)); + HANDLE_CODE(bref.pack(npusch_minus3dot75k_hz_scs_tdd_r15_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE phy_layer_params_nb_v1530_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(mixed_operation_mode_r15_present, 1)); + HANDLE_CODE(bref.unpack(sr_with_harq_ack_r15_present, 1)); + HANDLE_CODE(bref.unpack(sr_without_harq_ack_r15_present, 1)); + HANDLE_CODE(bref.unpack(nprach_format2_r15_present, 1)); + HANDLE_CODE(bref.unpack(add_tx_sib1_r15_present, 1)); + HANDLE_CODE(bref.unpack(npusch_minus3dot75k_hz_scs_tdd_r15_present, 1)); + + return SRSASN_SUCCESS; +} +void phy_layer_params_nb_v1530_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (mixed_operation_mode_r15_present) { + j.write_str("mixedOperationMode-r15", "supported"); + } + if (sr_with_harq_ack_r15_present) { + j.write_str("sr-WithHARQ-ACK-r15", "supported"); + } + if (sr_without_harq_ack_r15_present) { + j.write_str("sr-WithoutHARQ-ACK-r15", "supported"); + } + if (nprach_format2_r15_present) { + j.write_str("nprach-Format2-r15", "supported"); + } + if (add_tx_sib1_r15_present) { + j.write_str("additionalTransmissionSIB1-r15", "supported"); + } + if (npusch_minus3dot75k_hz_scs_tdd_r15_present) { + j.write_str("npusch-3dot75kHz-SCS-TDD-r15", "supported"); + } + j.end_obj(); +} + +// TDD-UE-Capability-NB-r15 ::= SEQUENCE +SRSASN_CODE tdd_ue_cap_nb_r15_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(ue_category_nb_r15_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_rel13_r15_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_rel14_r15_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_v1530_present, 1)); + + if (phy_layer_params_rel13_r15_present) { + HANDLE_CODE(phy_layer_params_rel13_r15.pack(bref)); + } + if (phy_layer_params_rel14_r15_present) { + HANDLE_CODE(phy_layer_params_rel14_r15.pack(bref)); + } + if (phy_layer_params_v1530_present) { + HANDLE_CODE(phy_layer_params_v1530.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE tdd_ue_cap_nb_r15_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(ue_category_nb_r15_present, 1)); + HANDLE_CODE(bref.unpack(phy_layer_params_rel13_r15_present, 1)); + HANDLE_CODE(bref.unpack(phy_layer_params_rel14_r15_present, 1)); + HANDLE_CODE(bref.unpack(phy_layer_params_v1530_present, 1)); + + if (phy_layer_params_rel13_r15_present) { + HANDLE_CODE(phy_layer_params_rel13_r15.unpack(bref)); + } + if (phy_layer_params_rel14_r15_present) { + HANDLE_CODE(phy_layer_params_rel14_r15.unpack(bref)); + } + if (phy_layer_params_v1530_present) { + HANDLE_CODE(phy_layer_params_v1530.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void tdd_ue_cap_nb_r15_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (ue_category_nb_r15_present) { + j.write_str("ue-Category-NB-r15", "nb2"); + } + if (phy_layer_params_rel13_r15_present) { + j.write_fieldname("phyLayerParametersRel13-r15"); + phy_layer_params_rel13_r15.to_json(j); + } + if (phy_layer_params_rel14_r15_present) { + j.write_fieldname("phyLayerParametersRel14-r15"); + phy_layer_params_rel14_r15.to_json(j); + } + if (phy_layer_params_v1530_present) { + j.write_fieldname("phyLayerParameters-v1530"); + phy_layer_params_v1530.to_json(j); + } + j.end_obj(); +} + +// MAC-Parameters-NB-v1530 ::= SEQUENCE +SRSASN_CODE mac_params_nb_v1530_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(sr_sps_bsr_r15_present, 1)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE mac_params_nb_v1530_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(sr_sps_bsr_r15_present, 1)); + + return SRSASN_SUCCESS; +} +void mac_params_nb_v1530_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (sr_sps_bsr_r15_present) { + j.write_str("sr-SPS-BSR-r15", "supported"); + } + j.end_obj(); } -std::string sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_opts::to_string() const +// RLC-Parameters-NB-r15 ::= SEQUENCE +SRSASN_CODE rlc_params_nb_r15_s::pack(bit_ref& bref) const { - static const char* options[] = { - "zero", "oneEighth", "oneQuarter", "threeEighth", "oneHalf", "fiveEighth", "threeQuarter", "sevenEighth"}; - return convert_enum_idx(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_e_"); + HANDLE_CODE(bref.pack(rlc_um_r15_present, 1)); + + return SRSASN_SUCCESS; } -float sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_opts::to_number() const +SRSASN_CODE rlc_params_nb_r15_s::unpack(cbit_ref& bref) { - static const float options[] = {0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875}; - return map_enum_number(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_e_"); + HANDLE_CODE(bref.unpack(rlc_um_r15_present, 1)); + + return SRSASN_SUCCESS; } -std::string sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_opts::to_number_string() const +void rlc_params_nb_r15_s::to_json(json_writer& j) const { - static const char* options[] = {"0", "1/8", "1/4", "3/8", "1/2", "5/8", "3/4", "7/8"}; - return convert_enum_idx(options, 8, value, "sc_mtch_info_nb_r14_s::npdcch_offset_sc_mtch_r14_e_"); + j.start_obj(); + if (rlc_um_r15_present) { + j.write_str("rlc-UM-r15", "supported"); + } + j.end_obj(); } -// SCPTMConfiguration-NB-r14 ::= SEQUENCE -SRSASN_CODE scptm_cfg_nb_r14_s::pack(bit_ref& bref) const +// UE-Capability-NB-v1530-IEs ::= SEQUENCE +SRSASN_CODE ue_cap_nb_v1530_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(bref.pack(scptm_neighbour_cell_list_r14_present, 1)); - HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(early_data_up_r15_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_v1530_present, 1)); + HANDLE_CODE(bref.pack(tdd_ue_cap_r15_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - HANDLE_CODE(pack_dyn_seq_of(bref, sc_mtch_info_list_r14, 0, 64)); - if (scptm_neighbour_cell_list_r14_present) { - HANDLE_CODE(pack_dyn_seq_of(bref, scptm_neighbour_cell_list_r14, 1, 8)); + HANDLE_CODE(rlc_params_r15.pack(bref)); + HANDLE_CODE(mac_params_v1530.pack(bref)); + if (phy_layer_params_v1530_present) { + HANDLE_CODE(phy_layer_params_v1530.pack(bref)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.pack(bref)); + if (tdd_ue_cap_r15_present) { + HANDLE_CODE(tdd_ue_cap_r15.pack(bref)); } return SRSASN_SUCCESS; } -SRSASN_CODE scptm_cfg_nb_r14_s::unpack(cbit_ref& bref) +SRSASN_CODE ue_cap_nb_v1530_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(bref.unpack(scptm_neighbour_cell_list_r14_present, 1)); - HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(early_data_up_r15_present, 1)); + HANDLE_CODE(bref.unpack(phy_layer_params_v1530_present, 1)); + HANDLE_CODE(bref.unpack(tdd_ue_cap_r15_present, 1)); HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - HANDLE_CODE(unpack_dyn_seq_of(sc_mtch_info_list_r14, bref, 0, 64)); - if (scptm_neighbour_cell_list_r14_present) { - HANDLE_CODE(unpack_dyn_seq_of(scptm_neighbour_cell_list_r14, bref, 1, 8)); + HANDLE_CODE(rlc_params_r15.unpack(bref)); + HANDLE_CODE(mac_params_v1530.unpack(bref)); + if (phy_layer_params_v1530_present) { + HANDLE_CODE(phy_layer_params_v1530.unpack(bref)); } - if (late_non_crit_ext_present) { - HANDLE_CODE(late_non_crit_ext.unpack(bref)); + if (tdd_ue_cap_r15_present) { + HANDLE_CODE(tdd_ue_cap_r15.unpack(bref)); } return SRSASN_SUCCESS; } -void scptm_cfg_nb_r14_s::to_json(json_writer& j) const +void ue_cap_nb_v1530_ies_s::to_json(json_writer& j) const { j.start_obj(); - j.start_array("sc-mtch-InfoList-r14"); - for (const auto& e1 : sc_mtch_info_list_r14) { - e1.to_json(j); + if (early_data_up_r15_present) { + j.write_str("earlyData-UP-r15", "supported"); } - j.end_array(); - if (scptm_neighbour_cell_list_r14_present) { - j.start_array("scptm-NeighbourCellList-r14"); - for (const auto& e1 : scptm_neighbour_cell_list_r14) { - e1.to_json(j); - } - j.end_array(); + j.write_fieldname("rlc-Parameters-r15"); + rlc_params_r15.to_json(j); + j.write_fieldname("mac-Parameters-v1530"); + mac_params_v1530.to_json(j); + if (phy_layer_params_v1530_present) { + j.write_fieldname("phyLayerParameters-v1530"); + phy_layer_params_v1530.to_json(j); } - if (late_non_crit_ext_present) { - j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + if (tdd_ue_cap_r15_present) { + j.write_fieldname("tdd-UE-Capability-r15"); + tdd_ue_cap_r15.to_json(j); } if (non_crit_ext_present) { j.write_fieldname("nonCriticalExtension"); @@ -19314,178 +17880,224 @@ void scptm_cfg_nb_r14_s::to_json(json_writer& j) const j.end_obj(); } -// SC-MCCH-MessageType-NB ::= CHOICE -void sc_mcch_msg_type_nb_c::destroy_() +// PhyLayerParameters-NB-v1440 ::= SEQUENCE +SRSASN_CODE phy_layer_params_nb_v1440_s::pack(bit_ref& bref) const { - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } + HANDLE_CODE(bref.pack(interference_randomisation_r14_present, 1)); + + return SRSASN_SUCCESS; } -void sc_mcch_msg_type_nb_c::set(types::options e) +SRSASN_CODE phy_layer_params_nb_v1440_s::unpack(cbit_ref& bref) { - destroy_(); - type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); + HANDLE_CODE(bref.unpack(interference_randomisation_r14_present, 1)); + + return SRSASN_SUCCESS; +} +void phy_layer_params_nb_v1440_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (interference_randomisation_r14_present) { + j.write_str("interferenceRandomisation-r14", "supported"); } + j.end_obj(); } -sc_mcch_msg_type_nb_c::sc_mcch_msg_type_nb_c(const sc_mcch_msg_type_nb_c& other) + +// UE-Capability-NB-v14x0-IEs ::= SEQUENCE +SRSASN_CODE ue_cap_nb_v14x0_ies_s::pack(bit_ref& bref) const { - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); + HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); } + + return SRSASN_SUCCESS; } -sc_mcch_msg_type_nb_c& sc_mcch_msg_type_nb_c::operator=(const sc_mcch_msg_type_nb_c& other) +SRSASN_CODE ue_cap_nb_v14x0_ies_s::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; + HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); + + if (late_non_crit_ext_present) { + HANDLE_CODE(late_non_crit_ext.unpack(bref)); } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); } - return *this; + return SRSASN_SUCCESS; } -void sc_mcch_msg_type_nb_c::to_json(json_writer& j) const +void ue_cap_nb_v14x0_ies_s::to_json(json_writer& j) const { j.start_obj(); - switch (type_) { - case types::c1: - j.write_fieldname("c1"); - c.get().to_json(j); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); + if (late_non_crit_ext_present) { + j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string()); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); } j.end_obj(); } -SRSASN_CODE sc_mcch_msg_type_nb_c::pack(bit_ref& bref) const + +// MAC-Parameters-NB-r14 ::= SEQUENCE +SRSASN_CODE mac_params_nb_r14_s::pack(bit_ref& bref) const { - type_.pack(bref); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().pack(bref)); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); - return SRSASN_ERROR_ENCODE_FAIL; - } + HANDLE_CODE(bref.pack(data_inact_mon_r14_present, 1)); + HANDLE_CODE(bref.pack(rai_support_r14_present, 1)); + return SRSASN_SUCCESS; } -SRSASN_CODE sc_mcch_msg_type_nb_c::unpack(cbit_ref& bref) +SRSASN_CODE mac_params_nb_r14_s::unpack(cbit_ref& bref) { - types e; - e.unpack(bref); - set(e); - switch (type_) { - case types::c1: - HANDLE_CODE(c.get().unpack(bref)); - break; - case types::msg_class_ext: - break; - default: - log_invalid_choice_id(type_, "sc_mcch_msg_type_nb_c"); - return SRSASN_ERROR_DECODE_FAIL; + HANDLE_CODE(bref.unpack(data_inact_mon_r14_present, 1)); + HANDLE_CODE(bref.unpack(rai_support_r14_present, 1)); + + return SRSASN_SUCCESS; +} +void mac_params_nb_r14_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (data_inact_mon_r14_present) { + j.write_str("dataInactMon-r14", "supported"); + } + if (rai_support_r14_present) { + j.write_str("rai-Support-r14", "supported"); } + j.end_obj(); +} + +// RF-Parameters-NB-v1430 ::= SEQUENCE +SRSASN_CODE rf_params_nb_v1430_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(bref.pack(pwr_class_nb_minus14dbm_r14_present, 1)); + return SRSASN_SUCCESS; } +SRSASN_CODE rf_params_nb_v1430_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(bref.unpack(pwr_class_nb_minus14dbm_r14_present, 1)); -void sc_mcch_msg_type_nb_c::c1_c_::to_json(json_writer& j) const + return SRSASN_SUCCESS; +} +void rf_params_nb_v1430_s::to_json(json_writer& j) const { j.start_obj(); - j.write_fieldname("scptmConfiguration-r14"); - c.to_json(j); + if (pwr_class_nb_minus14dbm_r14_present) { + j.write_str("powerClassNB-14dBm-r14", "supported"); + } j.end_obj(); } -SRSASN_CODE sc_mcch_msg_type_nb_c::c1_c_::pack(bit_ref& bref) const + +// UE-Capability-NB-v1440-IEs ::= SEQUENCE +SRSASN_CODE ue_cap_nb_v1440_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(c.pack(bref)); + HANDLE_CODE(bref.pack(phy_layer_params_v1440_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); + + if (phy_layer_params_v1440_present) { + HANDLE_CODE(phy_layer_params_v1440.pack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } + return SRSASN_SUCCESS; } -SRSASN_CODE sc_mcch_msg_type_nb_c::c1_c_::unpack(cbit_ref& bref) +SRSASN_CODE ue_cap_nb_v1440_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(c.unpack(bref)); - return SRSASN_SUCCESS; -} + HANDLE_CODE(bref.unpack(phy_layer_params_v1440_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); -std::string sc_mcch_msg_type_nb_c::c1_c_::types_opts::to_string() const -{ - static const char* options[] = {"scptmConfiguration-r14"}; - return convert_enum_idx(options, 1, value, "sc_mcch_msg_type_nb_c::c1_c_::types"); -} + if (phy_layer_params_v1440_present) { + HANDLE_CODE(phy_layer_params_v1440.unpack(bref)); + } + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } -std::string sc_mcch_msg_type_nb_c::types_opts::to_string() const -{ - static const char* options[] = {"c1", "messageClassExtension"}; - return convert_enum_idx(options, 2, value, "sc_mcch_msg_type_nb_c::types"); + return SRSASN_SUCCESS; } -uint8_t sc_mcch_msg_type_nb_c::types_opts::to_number() const +void ue_cap_nb_v1440_ies_s::to_json(json_writer& j) const { - static const uint8_t options[] = {1}; - return map_enum_number(options, 1, value, "sc_mcch_msg_type_nb_c::types"); + j.start_obj(); + if (phy_layer_params_v1440_present) { + j.write_fieldname("phyLayerParameters-v1440"); + phy_layer_params_v1440.to_json(j); + } + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } + j.end_obj(); } -// SC-MCCH-Message-NB ::= SEQUENCE -SRSASN_CODE sc_mcch_msg_nb_s::pack(bit_ref& bref) const +// UE-Capability-NB-Ext-r14-IEs ::= SEQUENCE +SRSASN_CODE ue_cap_nb_ext_r14_ies_s::pack(bit_ref& bref) const { - HANDLE_CODE(msg.pack(bref)); + HANDLE_CODE(bref.pack(ue_category_nb_r14_present, 1)); + HANDLE_CODE(bref.pack(mac_params_r14_present, 1)); + HANDLE_CODE(bref.pack(phy_layer_params_v1430_present, 1)); + HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); - bref.align_bytes_zero(); + if (mac_params_r14_present) { + HANDLE_CODE(mac_params_r14.pack(bref)); + } + if (phy_layer_params_v1430_present) { + HANDLE_CODE(phy_layer_params_v1430.pack(bref)); + } + HANDLE_CODE(rf_params_v1430.pack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.pack(bref)); + } return SRSASN_SUCCESS; } -SRSASN_CODE sc_mcch_msg_nb_s::unpack(cbit_ref& bref) +SRSASN_CODE ue_cap_nb_ext_r14_ies_s::unpack(cbit_ref& bref) { - HANDLE_CODE(msg.unpack(bref)); + HANDLE_CODE(bref.unpack(ue_category_nb_r14_present, 1)); + HANDLE_CODE(bref.unpack(mac_params_r14_present, 1)); + HANDLE_CODE(bref.unpack(phy_layer_params_v1430_present, 1)); + HANDLE_CODE(bref.unpack(non_crit_ext_present, 1)); - bref.align_bytes(); + if (mac_params_r14_present) { + HANDLE_CODE(mac_params_r14.unpack(bref)); + } + if (phy_layer_params_v1430_present) { + HANDLE_CODE(phy_layer_params_v1430.unpack(bref)); + } + HANDLE_CODE(rf_params_v1430.unpack(bref)); + if (non_crit_ext_present) { + HANDLE_CODE(non_crit_ext.unpack(bref)); + } return SRSASN_SUCCESS; } -void sc_mcch_msg_nb_s::to_json(json_writer& j) const +void ue_cap_nb_ext_r14_ies_s::to_json(json_writer& j) const { - j.start_array(); j.start_obj(); - j.start_obj("SC-MCCH-Message-NB"); - j.write_fieldname("message"); - msg.to_json(j); - j.end_obj(); + if (ue_category_nb_r14_present) { + j.write_str("ue-Category-NB-r14", "nb2"); + } + if (mac_params_r14_present) { + j.write_fieldname("mac-Parameters-r14"); + mac_params_r14.to_json(j); + } + if (phy_layer_params_v1430_present) { + j.write_fieldname("phyLayerParameters-v1430"); + phy_layer_params_v1430.to_json(j); + } + j.write_fieldname("rf-Parameters-v1430"); + rf_params_v1430.to_json(j); + if (non_crit_ext_present) { + j.write_fieldname("nonCriticalExtension"); + non_crit_ext.to_json(j); + } j.end_obj(); - j.end_array(); } // UE-RadioPagingInfo-NB-r13 ::= SEQUENCE @@ -19690,66 +18302,9 @@ void ue_cap_info_nb_s::to_json(json_writer& j) const j.end_obj(); } -void ue_cap_info_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::ue_cap_info_r13: - c.destroy(); - break; - default: - break; - } -} void ue_cap_info_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::ue_cap_info_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_nb_s::crit_exts_c_"); - } -} -ue_cap_info_nb_s::crit_exts_c_::crit_exts_c_(const ue_cap_info_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::ue_cap_info_r13: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_nb_s::crit_exts_c_"); - } -} -ue_cap_info_nb_s::crit_exts_c_& ue_cap_info_nb_s::crit_exts_c_::operator=(const ue_cap_info_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::ue_cap_info_r13: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_nb_s::crit_exts_c_"); - } - - return *this; } void ue_cap_info_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -19757,7 +18312,7 @@ void ue_cap_info_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::ue_cap_info_r13: j.write_fieldname("ueCapabilityInformation-r13"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -19771,7 +18326,7 @@ SRSASN_CODE ue_cap_info_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::ue_cap_info_r13: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -19788,7 +18343,7 @@ SRSASN_CODE ue_cap_info_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::ue_cap_info_r13: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -19863,67 +18418,9 @@ void ue_paging_coverage_info_nb_s::to_json(json_writer& j) const j.end_obj(); } -void ue_paging_coverage_info_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_paging_coverage_info_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_paging_coverage_info_nb_s::crit_exts_c_"); - } -} -ue_paging_coverage_info_nb_s::crit_exts_c_::crit_exts_c_(const ue_paging_coverage_info_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_paging_coverage_info_nb_s::crit_exts_c_"); - } -} -ue_paging_coverage_info_nb_s::crit_exts_c_& -ue_paging_coverage_info_nb_s::crit_exts_c_::operator=(const ue_paging_coverage_info_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_paging_coverage_info_nb_s::crit_exts_c_"); - } - - return *this; } void ue_paging_coverage_info_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -19931,7 +18428,7 @@ void ue_paging_coverage_info_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -19945,7 +18442,7 @@ SRSASN_CODE ue_paging_coverage_info_nb_s::crit_exts_c_::pack(bit_ref& bref) cons type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -19962,7 +18459,7 @@ SRSASN_CODE ue_paging_coverage_info_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -20160,84 +18657,26 @@ void ue_radio_access_cap_info_nb_ies_s::to_json(json_writer& j) const SRSASN_CODE ue_radio_access_cap_info_nb_s::pack(bit_ref& bref) const { HANDLE_CODE(crit_exts.pack(bref)); - - return SRSASN_SUCCESS; -} -SRSASN_CODE ue_radio_access_cap_info_nb_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; -} -void ue_radio_access_cap_info_nb_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); -} - -void ue_radio_access_cap_info_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} -void ue_radio_access_cap_info_nb_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_nb_s::crit_exts_c_"); - } + + return SRSASN_SUCCESS; } -ue_radio_access_cap_info_nb_s::crit_exts_c_::crit_exts_c_(const ue_radio_access_cap_info_nb_s::crit_exts_c_& other) +SRSASN_CODE ue_radio_access_cap_info_nb_s::unpack(cbit_ref& bref) { - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_nb_s::crit_exts_c_"); - } + HANDLE_CODE(crit_exts.unpack(bref)); + + return SRSASN_SUCCESS; } -ue_radio_access_cap_info_nb_s::crit_exts_c_& -ue_radio_access_cap_info_nb_s::crit_exts_c_::operator=(const ue_radio_access_cap_info_nb_s::crit_exts_c_& other) +void ue_radio_access_cap_info_nb_s::to_json(json_writer& j) const { - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_nb_s::crit_exts_c_"); - } + j.start_obj(); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} - return *this; +void ue_radio_access_cap_info_nb_s::crit_exts_c_::set(types::options e) +{ + type_ = e; } void ue_radio_access_cap_info_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -20245,7 +18684,7 @@ void ue_radio_access_cap_info_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -20259,7 +18698,7 @@ SRSASN_CODE ue_radio_access_cap_info_nb_s::crit_exts_c_::pack(bit_ref& bref) con type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -20276,7 +18715,7 @@ SRSASN_CODE ue_radio_access_cap_info_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -20407,67 +18846,9 @@ void ue_radio_paging_info_nb_s::to_json(json_writer& j) const j.end_obj(); } -void ue_radio_paging_info_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_radio_paging_info_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_nb_s::crit_exts_c_"); - } -} -ue_radio_paging_info_nb_s::crit_exts_c_::crit_exts_c_(const ue_radio_paging_info_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_nb_s::crit_exts_c_"); - } -} -ue_radio_paging_info_nb_s::crit_exts_c_& -ue_radio_paging_info_nb_s::crit_exts_c_::operator=(const ue_radio_paging_info_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_nb_s::crit_exts_c_"); - } - - return *this; } void ue_radio_paging_info_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -20475,7 +18856,7 @@ void ue_radio_paging_info_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -20489,7 +18870,7 @@ SRSASN_CODE ue_radio_paging_info_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -20506,7 +18887,7 @@ SRSASN_CODE ue_radio_paging_info_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -20588,66 +18969,9 @@ std::string ue_radio_paging_info_nb_s::crit_exts_c_::c1_c_::types_opts::to_strin } // UL-CCCH-MessageType-NB ::= CHOICE -void ul_ccch_msg_type_nb_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ul_ccch_msg_type_nb_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_nb_c"); - } -} -ul_ccch_msg_type_nb_c::ul_ccch_msg_type_nb_c(const ul_ccch_msg_type_nb_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_nb_c"); - } -} -ul_ccch_msg_type_nb_c& ul_ccch_msg_type_nb_c::operator=(const ul_ccch_msg_type_nb_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_nb_c"); - } - - return *this; } void ul_ccch_msg_type_nb_c::to_json(json_writer& j) const { @@ -20655,7 +18979,7 @@ void ul_ccch_msg_type_nb_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -20669,7 +18993,7 @@ SRSASN_CODE ul_ccch_msg_type_nb_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -20686,7 +19010,7 @@ SRSASN_CODE ul_ccch_msg_type_nb_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -20970,67 +19294,9 @@ void ul_info_transfer_nb_s::to_json(json_writer& j) const j.end_obj(); } -void ul_info_transfer_nb_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::ul_info_transfer_r13: - c.destroy(); - break; - default: - break; - } -} void ul_info_transfer_nb_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::ul_info_transfer_r13: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_nb_s::crit_exts_c_"); - } -} -ul_info_transfer_nb_s::crit_exts_c_::crit_exts_c_(const ul_info_transfer_nb_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::ul_info_transfer_r13: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_nb_s::crit_exts_c_"); - } -} -ul_info_transfer_nb_s::crit_exts_c_& -ul_info_transfer_nb_s::crit_exts_c_::operator=(const ul_info_transfer_nb_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::ul_info_transfer_r13: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_nb_s::crit_exts_c_"); - } - - return *this; } void ul_info_transfer_nb_s::crit_exts_c_::to_json(json_writer& j) const { @@ -21038,7 +19304,7 @@ void ul_info_transfer_nb_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::ul_info_transfer_r13: j.write_fieldname("ulInformationTransfer-r13"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -21052,7 +19318,7 @@ SRSASN_CODE ul_info_transfer_nb_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::ul_info_transfer_r13: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -21069,7 +19335,7 @@ SRSASN_CODE ul_info_transfer_nb_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::ul_info_transfer_r13: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -21087,66 +19353,9 @@ std::string ul_info_transfer_nb_s::crit_exts_c_::types_opts::to_string() const } // UL-DCCH-MessageType-NB ::= CHOICE -void ul_dcch_msg_type_nb_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ul_dcch_msg_type_nb_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_nb_c"); - } -} -ul_dcch_msg_type_nb_c::ul_dcch_msg_type_nb_c(const ul_dcch_msg_type_nb_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_nb_c"); - } -} -ul_dcch_msg_type_nb_c& ul_dcch_msg_type_nb_c::operator=(const ul_dcch_msg_type_nb_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_nb_c"); - } - - return *this; } void ul_dcch_msg_type_nb_c::to_json(json_writer& j) const { @@ -21154,7 +19363,7 @@ void ul_dcch_msg_type_nb_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -21168,7 +19377,7 @@ SRSASN_CODE ul_dcch_msg_type_nb_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -21185,7 +19394,7 @@ SRSASN_CODE ul_dcch_msg_type_nb_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; diff --git a/lib/src/asn1/rrc_nr.cc b/lib/src/asn1/rrc_nr.cc index 95b9d3660..f8df642bd 100644 --- a/lib/src/asn1/rrc_nr.cc +++ b/lib/src/asn1/rrc_nr.cc @@ -120,66 +120,9 @@ std::string mib_s::intra_freq_resel_opts::to_string() const } // BCCH-BCH-MessageType ::= CHOICE -void bcch_bch_msg_type_c::destroy_() -{ - switch (type_) { - case types::mib: - c.destroy(); - break; - default: - break; - } -} void bcch_bch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::mib: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_bch_msg_type_c"); - } -} -bcch_bch_msg_type_c::bcch_bch_msg_type_c(const bcch_bch_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::mib: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_bch_msg_type_c"); - } -} -bcch_bch_msg_type_c& bcch_bch_msg_type_c::operator=(const bcch_bch_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::mib: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_bch_msg_type_c"); - } - - return *this; } void bcch_bch_msg_type_c::to_json(json_writer& j) const { @@ -187,7 +130,7 @@ void bcch_bch_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::mib: j.write_fieldname("mib"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -201,7 +144,7 @@ SRSASN_CODE bcch_bch_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::mib: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -218,7 +161,7 @@ SRSASN_CODE bcch_bch_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::mib: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -7751,66 +7694,9 @@ void sys_info_s::to_json(json_writer& j) const j.end_obj(); } -void sys_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::sys_info: - c.destroy(); - break; - default: - break; - } -} void sys_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::sys_info: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); - } -} -sys_info_s::crit_exts_c_::crit_exts_c_(const sys_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::sys_info: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); - } -} -sys_info_s::crit_exts_c_& sys_info_s::crit_exts_c_::operator=(const sys_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::sys_info: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "sys_info_s::crit_exts_c_"); - } - - return *this; } void sys_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -7818,7 +7704,7 @@ void sys_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::sys_info: j.write_fieldname("systemInformation"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -7832,7 +7718,7 @@ SRSASN_CODE sys_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::sys_info: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -7849,7 +7735,7 @@ SRSASN_CODE sys_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::sys_info: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -7867,66 +7753,9 @@ std::string sys_info_s::crit_exts_c_::types_opts::to_string() const } // BCCH-DL-SCH-MessageType ::= CHOICE -void bcch_dl_sch_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void bcch_dl_sch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); - } -} -bcch_dl_sch_msg_type_c::bcch_dl_sch_msg_type_c(const bcch_dl_sch_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); - } -} -bcch_dl_sch_msg_type_c& bcch_dl_sch_msg_type_c::operator=(const bcch_dl_sch_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c"); - } - - return *this; } void bcch_dl_sch_msg_type_c::to_json(json_writer& j) const { @@ -7934,7 +7763,7 @@ void bcch_dl_sch_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -7948,7 +7777,7 @@ SRSASN_CODE bcch_dl_sch_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -7965,7 +7794,7 @@ SRSASN_CODE bcch_dl_sch_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -9222,66 +9051,9 @@ void rrc_reject_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_reject_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_reject: - c.destroy(); - break; - default: - break; - } -} void rrc_reject_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_reject: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reject_s::crit_exts_c_"); - } -} -rrc_reject_s::crit_exts_c_::crit_exts_c_(const rrc_reject_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_reject: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reject_s::crit_exts_c_"); - } -} -rrc_reject_s::crit_exts_c_& rrc_reject_s::crit_exts_c_::operator=(const rrc_reject_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_reject: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reject_s::crit_exts_c_"); - } - - return *this; } void rrc_reject_s::crit_exts_c_::to_json(json_writer& j) const { @@ -9289,7 +9061,7 @@ void rrc_reject_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_reject: j.write_fieldname("rrcReject"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -9303,7 +9075,7 @@ SRSASN_CODE rrc_reject_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_reject: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -9320,7 +9092,7 @@ SRSASN_CODE rrc_reject_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_reject: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -9361,66 +9133,9 @@ void rrc_setup_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_setup_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_setup: - c.destroy(); - break; - default: - break; - } -} void rrc_setup_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_setup: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_setup_s::crit_exts_c_"); - } -} -rrc_setup_s::crit_exts_c_::crit_exts_c_(const rrc_setup_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_setup: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_setup_s::crit_exts_c_"); - } -} -rrc_setup_s::crit_exts_c_& rrc_setup_s::crit_exts_c_::operator=(const rrc_setup_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_setup: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_setup_s::crit_exts_c_"); - } - - return *this; } void rrc_setup_s::crit_exts_c_::to_json(json_writer& j) const { @@ -9428,7 +9143,7 @@ void rrc_setup_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_setup: j.write_fieldname("rrcSetup"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -9442,7 +9157,7 @@ SRSASN_CODE rrc_setup_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_setup: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -9459,7 +9174,7 @@ SRSASN_CODE rrc_setup_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_setup: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -9477,66 +9192,9 @@ std::string rrc_setup_s::crit_exts_c_::types_opts::to_string() const } // DL-CCCH-MessageType ::= CHOICE -void dl_ccch_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void dl_ccch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_c"); - } -} -dl_ccch_msg_type_c::dl_ccch_msg_type_c(const dl_ccch_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_c"); - } -} -dl_ccch_msg_type_c& dl_ccch_msg_type_c::operator=(const dl_ccch_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_ccch_msg_type_c"); - } - - return *this; } void dl_ccch_msg_type_c::to_json(json_writer& j) const { @@ -9544,7 +9202,7 @@ void dl_ccch_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -9558,7 +9216,7 @@ SRSASN_CODE dl_ccch_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -9575,7 +9233,7 @@ SRSASN_CODE dl_ccch_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -15753,66 +15411,9 @@ void counter_check_s::to_json(json_writer& j) const j.end_obj(); } -void counter_check_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::counter_check: - c.destroy(); - break; - default: - break; - } -} void counter_check_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::counter_check: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_"); - } -} -counter_check_s::crit_exts_c_::crit_exts_c_(const counter_check_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::counter_check: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_"); - } -} -counter_check_s::crit_exts_c_& counter_check_s::crit_exts_c_::operator=(const counter_check_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::counter_check: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_"); - } - - return *this; } void counter_check_s::crit_exts_c_::to_json(json_writer& j) const { @@ -15820,7 +15421,7 @@ void counter_check_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::counter_check: j.write_fieldname("counterCheck"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -15834,7 +15435,7 @@ SRSASN_CODE counter_check_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::counter_check: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -15851,7 +15452,7 @@ SRSASN_CODE counter_check_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::counter_check: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -15892,67 +15493,9 @@ void dl_info_transfer_s::to_json(json_writer& j) const j.end_obj(); } -void dl_info_transfer_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::dl_info_transfer: - c.destroy(); - break; - default: - break; - } -} void dl_info_transfer_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::dl_info_transfer: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_"); - } -} -dl_info_transfer_s::crit_exts_c_::crit_exts_c_(const dl_info_transfer_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::dl_info_transfer: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_"); - } -} -dl_info_transfer_s::crit_exts_c_& -dl_info_transfer_s::crit_exts_c_::operator=(const dl_info_transfer_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::dl_info_transfer: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_"); - } - - return *this; } void dl_info_transfer_s::crit_exts_c_::to_json(json_writer& j) const { @@ -15960,7 +15503,7 @@ void dl_info_transfer_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::dl_info_transfer: j.write_fieldname("dlInformationTransfer"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -15974,7 +15517,7 @@ SRSASN_CODE dl_info_transfer_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::dl_info_transfer: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -15991,7 +15534,7 @@ SRSASN_CODE dl_info_transfer_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::dl_info_transfer: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -16032,67 +15575,9 @@ void mob_from_nr_cmd_s::to_json(json_writer& j) const j.end_obj(); } -void mob_from_nr_cmd_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::mob_from_nr_cmd: - c.destroy(); - break; - default: - break; - } -} void mob_from_nr_cmd_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::mob_from_nr_cmd: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mob_from_nr_cmd_s::crit_exts_c_"); - } -} -mob_from_nr_cmd_s::crit_exts_c_::crit_exts_c_(const mob_from_nr_cmd_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::mob_from_nr_cmd: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mob_from_nr_cmd_s::crit_exts_c_"); - } -} -mob_from_nr_cmd_s::crit_exts_c_& -mob_from_nr_cmd_s::crit_exts_c_::operator=(const mob_from_nr_cmd_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::mob_from_nr_cmd: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "mob_from_nr_cmd_s::crit_exts_c_"); - } - - return *this; } void mob_from_nr_cmd_s::crit_exts_c_::to_json(json_writer& j) const { @@ -16100,7 +15585,7 @@ void mob_from_nr_cmd_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::mob_from_nr_cmd: j.write_fieldname("mobilityFromNRCommand"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -16114,7 +15599,7 @@ SRSASN_CODE mob_from_nr_cmd_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::mob_from_nr_cmd: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -16131,7 +15616,7 @@ SRSASN_CODE mob_from_nr_cmd_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::mob_from_nr_cmd: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -16172,66 +15657,9 @@ void rrc_recfg_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_recfg_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_recfg: - c.destroy(); - break; - default: - break; - } -} void rrc_recfg_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_recfg: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_recfg_s::crit_exts_c_"); - } -} -rrc_recfg_s::crit_exts_c_::crit_exts_c_(const rrc_recfg_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_recfg: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_recfg_s::crit_exts_c_"); - } -} -rrc_recfg_s::crit_exts_c_& rrc_recfg_s::crit_exts_c_::operator=(const rrc_recfg_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_recfg: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_recfg_s::crit_exts_c_"); - } - - return *this; } void rrc_recfg_s::crit_exts_c_::to_json(json_writer& j) const { @@ -16239,7 +15667,7 @@ void rrc_recfg_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_recfg: j.write_fieldname("rrcReconfiguration"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -16253,7 +15681,7 @@ SRSASN_CODE rrc_recfg_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_recfg: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -16270,7 +15698,7 @@ SRSASN_CODE rrc_recfg_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_recfg: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -16311,66 +15739,9 @@ void rrc_reest_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_reest_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_reest: - c.destroy(); - break; - default: - break; - } -} void rrc_reest_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_reest: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reest_s::crit_exts_c_"); - } -} -rrc_reest_s::crit_exts_c_::crit_exts_c_(const rrc_reest_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_reest: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reest_s::crit_exts_c_"); - } -} -rrc_reest_s::crit_exts_c_& rrc_reest_s::crit_exts_c_::operator=(const rrc_reest_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_reest: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reest_s::crit_exts_c_"); - } - - return *this; } void rrc_reest_s::crit_exts_c_::to_json(json_writer& j) const { @@ -16378,7 +15749,7 @@ void rrc_reest_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_reest: j.write_fieldname("rrcReestablishment"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -16392,7 +15763,7 @@ SRSASN_CODE rrc_reest_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_reest: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -16409,7 +15780,7 @@ SRSASN_CODE rrc_reest_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_reest: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -16450,66 +15821,9 @@ void rrc_release_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_release_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_release: - c.destroy(); - break; - default: - break; - } -} void rrc_release_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_release: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_release_s::crit_exts_c_"); - } -} -rrc_release_s::crit_exts_c_::crit_exts_c_(const rrc_release_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_release: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_release_s::crit_exts_c_"); - } -} -rrc_release_s::crit_exts_c_& rrc_release_s::crit_exts_c_::operator=(const rrc_release_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_release: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_release_s::crit_exts_c_"); - } - - return *this; } void rrc_release_s::crit_exts_c_::to_json(json_writer& j) const { @@ -16517,7 +15831,7 @@ void rrc_release_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_release: j.write_fieldname("rrcRelease"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -16531,7 +15845,7 @@ SRSASN_CODE rrc_release_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_release: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -16548,7 +15862,7 @@ SRSASN_CODE rrc_release_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_release: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -16589,66 +15903,9 @@ void rrc_resume_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_resume_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_resume: - c.destroy(); - break; - default: - break; - } -} void rrc_resume_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_resume: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_resume_s::crit_exts_c_"); - } -} -rrc_resume_s::crit_exts_c_::crit_exts_c_(const rrc_resume_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_resume: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_resume_s::crit_exts_c_"); - } -} -rrc_resume_s::crit_exts_c_& rrc_resume_s::crit_exts_c_::operator=(const rrc_resume_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_resume: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_resume_s::crit_exts_c_"); - } - - return *this; } void rrc_resume_s::crit_exts_c_::to_json(json_writer& j) const { @@ -16656,7 +15913,7 @@ void rrc_resume_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_resume: j.write_fieldname("rrcResume"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -16670,7 +15927,7 @@ SRSASN_CODE rrc_resume_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_resume: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -16687,7 +15944,7 @@ SRSASN_CODE rrc_resume_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_resume: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -16728,67 +15985,9 @@ void security_mode_cmd_s::to_json(json_writer& j) const j.end_obj(); } -void security_mode_cmd_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::security_mode_cmd: - c.destroy(); - break; - default: - break; - } -} void security_mode_cmd_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::security_mode_cmd: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_"); - } -} -security_mode_cmd_s::crit_exts_c_::crit_exts_c_(const security_mode_cmd_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::security_mode_cmd: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_"); - } -} -security_mode_cmd_s::crit_exts_c_& -security_mode_cmd_s::crit_exts_c_::operator=(const security_mode_cmd_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::security_mode_cmd: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_"); - } - - return *this; } void security_mode_cmd_s::crit_exts_c_::to_json(json_writer& j) const { @@ -16796,7 +15995,7 @@ void security_mode_cmd_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::security_mode_cmd: j.write_fieldname("securityModeCommand"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -16810,7 +16009,7 @@ SRSASN_CODE security_mode_cmd_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::security_mode_cmd: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -16827,7 +16026,7 @@ SRSASN_CODE security_mode_cmd_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::security_mode_cmd: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -16868,66 +16067,9 @@ void ue_cap_enquiry_s::to_json(json_writer& j) const j.end_obj(); } -void ue_cap_enquiry_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::ue_cap_enquiry: - c.destroy(); - break; - default: - break; - } -} void ue_cap_enquiry_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::ue_cap_enquiry: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_"); - } -} -ue_cap_enquiry_s::crit_exts_c_::crit_exts_c_(const ue_cap_enquiry_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::ue_cap_enquiry: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_"); - } -} -ue_cap_enquiry_s::crit_exts_c_& ue_cap_enquiry_s::crit_exts_c_::operator=(const ue_cap_enquiry_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::ue_cap_enquiry: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_"); - } - - return *this; } void ue_cap_enquiry_s::crit_exts_c_::to_json(json_writer& j) const { @@ -16935,7 +16077,7 @@ void ue_cap_enquiry_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::ue_cap_enquiry: j.write_fieldname("ueCapabilityEnquiry"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -16949,7 +16091,7 @@ SRSASN_CODE ue_cap_enquiry_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::ue_cap_enquiry: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -16966,7 +16108,7 @@ SRSASN_CODE ue_cap_enquiry_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::ue_cap_enquiry: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -16984,66 +16126,9 @@ std::string ue_cap_enquiry_s::crit_exts_c_::types_opts::to_string() const } // DL-DCCH-MessageType ::= CHOICE -void dl_dcch_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void dl_dcch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); - } -} -dl_dcch_msg_type_c::dl_dcch_msg_type_c(const dl_dcch_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); - } -} -dl_dcch_msg_type_c& dl_dcch_msg_type_c::operator=(const dl_dcch_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "dl_dcch_msg_type_c"); - } - - return *this; } void dl_dcch_msg_type_c::to_json(json_writer& j) const { @@ -17051,7 +16136,7 @@ void dl_dcch_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -17065,7 +16150,7 @@ SRSASN_CODE dl_dcch_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -17082,7 +16167,7 @@ SRSASN_CODE dl_dcch_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -17723,66 +16808,9 @@ void paging_s::to_json(json_writer& j) const } // PCCH-MessageType ::= CHOICE -void pcch_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void pcch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "pcch_msg_type_c"); - } -} -pcch_msg_type_c::pcch_msg_type_c(const pcch_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "pcch_msg_type_c"); - } -} -pcch_msg_type_c& pcch_msg_type_c::operator=(const pcch_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "pcch_msg_type_c"); - } - - return *this; } void pcch_msg_type_c::to_json(json_writer& j) const { @@ -17790,7 +16818,7 @@ void pcch_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -17804,7 +16832,7 @@ SRSASN_CODE pcch_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -17821,7 +16849,7 @@ SRSASN_CODE pcch_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -18326,67 +17354,9 @@ void rrc_sys_info_request_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_sys_info_request_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_sys_info_request: - c.destroy(); - break; - default: - break; - } -} void rrc_sys_info_request_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_sys_info_request: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_sys_info_request_s::crit_exts_c_"); - } -} -rrc_sys_info_request_s::crit_exts_c_::crit_exts_c_(const rrc_sys_info_request_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_sys_info_request: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_sys_info_request_s::crit_exts_c_"); - } -} -rrc_sys_info_request_s::crit_exts_c_& -rrc_sys_info_request_s::crit_exts_c_::operator=(const rrc_sys_info_request_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_sys_info_request: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_sys_info_request_s::crit_exts_c_"); - } - - return *this; } void rrc_sys_info_request_s::crit_exts_c_::to_json(json_writer& j) const { @@ -18394,7 +17364,7 @@ void rrc_sys_info_request_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_sys_info_request: j.write_fieldname("rrcSystemInfoRequest"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -18408,7 +17378,7 @@ SRSASN_CODE rrc_sys_info_request_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_sys_info_request: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -18425,7 +17395,7 @@ SRSASN_CODE rrc_sys_info_request_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_sys_info_request: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -18443,66 +17413,9 @@ std::string rrc_sys_info_request_s::crit_exts_c_::types_opts::to_string() const } // UL-CCCH-MessageType ::= CHOICE -void ul_ccch_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ul_ccch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_c"); - } -} -ul_ccch_msg_type_c::ul_ccch_msg_type_c(const ul_ccch_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_c"); - } -} -ul_ccch_msg_type_c& ul_ccch_msg_type_c::operator=(const ul_ccch_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch_msg_type_c"); - } - - return *this; } void ul_ccch_msg_type_c::to_json(json_writer& j) const { @@ -18510,7 +17423,7 @@ void ul_ccch_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -18524,7 +17437,7 @@ SRSASN_CODE ul_ccch_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -18541,7 +17454,7 @@ SRSASN_CODE ul_ccch_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -18813,66 +17726,9 @@ void rrc_resume_request1_s::to_json(json_writer& j) const } // UL-CCCH1-MessageType ::= CHOICE -void ul_ccch1_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ul_ccch1_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch1_msg_type_c"); - } -} -ul_ccch1_msg_type_c::ul_ccch1_msg_type_c(const ul_ccch1_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch1_msg_type_c"); - } -} -ul_ccch1_msg_type_c& ul_ccch1_msg_type_c::operator=(const ul_ccch1_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_ccch1_msg_type_c"); - } - - return *this; } void ul_ccch1_msg_type_c::to_json(json_writer& j) const { @@ -18880,7 +17736,7 @@ void ul_ccch1_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -18894,7 +17750,7 @@ SRSASN_CODE ul_ccch1_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -18911,7 +17767,7 @@ SRSASN_CODE ul_ccch1_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -22425,67 +21281,9 @@ void counter_check_resp_s::to_json(json_writer& j) const j.end_obj(); } -void counter_check_resp_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::counter_check_resp: - c.destroy(); - break; - default: - break; - } -} void counter_check_resp_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::counter_check_resp: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_"); - } -} -counter_check_resp_s::crit_exts_c_::crit_exts_c_(const counter_check_resp_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::counter_check_resp: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_"); - } -} -counter_check_resp_s::crit_exts_c_& -counter_check_resp_s::crit_exts_c_::operator=(const counter_check_resp_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::counter_check_resp: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_"); - } - - return *this; } void counter_check_resp_s::crit_exts_c_::to_json(json_writer& j) const { @@ -22493,7 +21291,7 @@ void counter_check_resp_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::counter_check_resp: j.write_fieldname("counterCheckResponse"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -22507,7 +21305,7 @@ SRSASN_CODE counter_check_resp_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::counter_check_resp: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -22524,7 +21322,7 @@ SRSASN_CODE counter_check_resp_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::counter_check_resp: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -22562,66 +21360,9 @@ void fail_info_s::to_json(json_writer& j) const j.end_obj(); } -void fail_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::fail_info: - c.destroy(); - break; - default: - break; - } -} void fail_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::fail_info: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "fail_info_s::crit_exts_c_"); - } -} -fail_info_s::crit_exts_c_::crit_exts_c_(const fail_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::fail_info: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "fail_info_s::crit_exts_c_"); - } -} -fail_info_s::crit_exts_c_& fail_info_s::crit_exts_c_::operator=(const fail_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::fail_info: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "fail_info_s::crit_exts_c_"); - } - - return *this; } void fail_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -22629,7 +21370,7 @@ void fail_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::fail_info: j.write_fieldname("failureInformation"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -22643,7 +21384,7 @@ SRSASN_CODE fail_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::fail_info: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -22660,7 +21401,7 @@ SRSASN_CODE fail_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::fail_info: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -22698,67 +21439,9 @@ void location_meas_ind_s::to_json(json_writer& j) const j.end_obj(); } -void location_meas_ind_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::location_meas_ind: - c.destroy(); - break; - default: - break; - } -} void location_meas_ind_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::location_meas_ind: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "location_meas_ind_s::crit_exts_c_"); - } -} -location_meas_ind_s::crit_exts_c_::crit_exts_c_(const location_meas_ind_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::location_meas_ind: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "location_meas_ind_s::crit_exts_c_"); - } -} -location_meas_ind_s::crit_exts_c_& -location_meas_ind_s::crit_exts_c_::operator=(const location_meas_ind_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::location_meas_ind: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "location_meas_ind_s::crit_exts_c_"); - } - - return *this; } void location_meas_ind_s::crit_exts_c_::to_json(json_writer& j) const { @@ -22766,7 +21449,7 @@ void location_meas_ind_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::location_meas_ind: j.write_fieldname("locationMeasurementIndication"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -22780,7 +21463,7 @@ SRSASN_CODE location_meas_ind_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::location_meas_ind: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -22797,7 +21480,7 @@ SRSASN_CODE location_meas_ind_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::location_meas_ind: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -22835,66 +21518,9 @@ void meas_report_s::to_json(json_writer& j) const j.end_obj(); } -void meas_report_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::meas_report: - c.destroy(); - break; - default: - break; - } -} void meas_report_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::meas_report: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_"); - } -} -meas_report_s::crit_exts_c_::crit_exts_c_(const meas_report_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::meas_report: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_"); - } -} -meas_report_s::crit_exts_c_& meas_report_s::crit_exts_c_::operator=(const meas_report_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::meas_report: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_"); - } - - return *this; } void meas_report_s::crit_exts_c_::to_json(json_writer& j) const { @@ -22902,7 +21528,7 @@ void meas_report_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::meas_report: j.write_fieldname("measurementReport"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -22916,7 +21542,7 @@ SRSASN_CODE meas_report_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::meas_report: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -22933,7 +21559,7 @@ SRSASN_CODE meas_report_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::meas_report: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -22958,83 +21584,25 @@ SRSASN_CODE rrc_recfg_complete_s::pack(bit_ref& bref) const return SRSASN_SUCCESS; } -SRSASN_CODE rrc_recfg_complete_s::unpack(cbit_ref& bref) -{ - HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); - HANDLE_CODE(crit_exts.unpack(bref)); - - return SRSASN_SUCCESS; -} -void rrc_recfg_complete_s::to_json(json_writer& j) const -{ - j.start_obj(); - j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); - j.write_fieldname("criticalExtensions"); - crit_exts.to_json(j); - j.end_obj(); -} - -void rrc_recfg_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_recfg_complete: - c.destroy(); - break; - default: - break; - } -} -void rrc_recfg_complete_s::crit_exts_c_::set(types::options e) -{ - destroy_(); - type_ = e; - switch (type_) { - case types::rrc_recfg_complete: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_recfg_complete_s::crit_exts_c_"); - } -} -rrc_recfg_complete_s::crit_exts_c_::crit_exts_c_(const rrc_recfg_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_recfg_complete: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_recfg_complete_s::crit_exts_c_"); - } -} -rrc_recfg_complete_s::crit_exts_c_& -rrc_recfg_complete_s::crit_exts_c_::operator=(const rrc_recfg_complete_s::crit_exts_c_& other) +SRSASN_CODE rrc_recfg_complete_s::unpack(cbit_ref& bref) { - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_recfg_complete: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_recfg_complete_s::crit_exts_c_"); - } + HANDLE_CODE(unpack_integer(rrc_transaction_id, bref, (uint8_t)0u, (uint8_t)3u)); + HANDLE_CODE(crit_exts.unpack(bref)); - return *this; + return SRSASN_SUCCESS; +} +void rrc_recfg_complete_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("rrc-TransactionIdentifier", rrc_transaction_id); + j.write_fieldname("criticalExtensions"); + crit_exts.to_json(j); + j.end_obj(); +} + +void rrc_recfg_complete_s::crit_exts_c_::set(types::options e) +{ + type_ = e; } void rrc_recfg_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -23042,7 +21610,7 @@ void rrc_recfg_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_recfg_complete: j.write_fieldname("rrcReconfigurationComplete"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -23056,7 +21624,7 @@ SRSASN_CODE rrc_recfg_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_recfg_complete: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -23073,7 +21641,7 @@ SRSASN_CODE rrc_recfg_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_recfg_complete: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -23114,67 +21682,9 @@ void rrc_reest_complete_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_reest_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_reest_complete: - c.destroy(); - break; - default: - break; - } -} void rrc_reest_complete_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_reest_complete: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reest_complete_s::crit_exts_c_"); - } -} -rrc_reest_complete_s::crit_exts_c_::crit_exts_c_(const rrc_reest_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_reest_complete: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reest_complete_s::crit_exts_c_"); - } -} -rrc_reest_complete_s::crit_exts_c_& -rrc_reest_complete_s::crit_exts_c_::operator=(const rrc_reest_complete_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_reest_complete: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_reest_complete_s::crit_exts_c_"); - } - - return *this; } void rrc_reest_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -23182,7 +21692,7 @@ void rrc_reest_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_reest_complete: j.write_fieldname("rrcReestablishmentComplete"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -23196,7 +21706,7 @@ SRSASN_CODE rrc_reest_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_reest_complete: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -23213,7 +21723,7 @@ SRSASN_CODE rrc_reest_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_reest_complete: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -23254,67 +21764,9 @@ void rrc_resume_complete_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_resume_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_resume_complete: - c.destroy(); - break; - default: - break; - } -} void rrc_resume_complete_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_resume_complete: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_resume_complete_s::crit_exts_c_"); - } -} -rrc_resume_complete_s::crit_exts_c_::crit_exts_c_(const rrc_resume_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_resume_complete: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_resume_complete_s::crit_exts_c_"); - } -} -rrc_resume_complete_s::crit_exts_c_& -rrc_resume_complete_s::crit_exts_c_::operator=(const rrc_resume_complete_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_resume_complete: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_resume_complete_s::crit_exts_c_"); - } - - return *this; } void rrc_resume_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -23322,7 +21774,7 @@ void rrc_resume_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_resume_complete: j.write_fieldname("rrcResumeComplete"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -23336,7 +21788,7 @@ SRSASN_CODE rrc_resume_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_resume_complete: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -23353,7 +21805,7 @@ SRSASN_CODE rrc_resume_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_resume_complete: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -23394,67 +21846,9 @@ void rrc_setup_complete_s::to_json(json_writer& j) const j.end_obj(); } -void rrc_setup_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::rrc_setup_complete: - c.destroy(); - break; - default: - break; - } -} void rrc_setup_complete_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::rrc_setup_complete: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_setup_complete_s::crit_exts_c_"); - } -} -rrc_setup_complete_s::crit_exts_c_::crit_exts_c_(const rrc_setup_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::rrc_setup_complete: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_setup_complete_s::crit_exts_c_"); - } -} -rrc_setup_complete_s::crit_exts_c_& -rrc_setup_complete_s::crit_exts_c_::operator=(const rrc_setup_complete_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::rrc_setup_complete: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "rrc_setup_complete_s::crit_exts_c_"); - } - - return *this; } void rrc_setup_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -23462,7 +21856,7 @@ void rrc_setup_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::rrc_setup_complete: j.write_fieldname("rrcSetupComplete"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -23476,7 +21870,7 @@ SRSASN_CODE rrc_setup_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::rrc_setup_complete: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -23493,7 +21887,7 @@ SRSASN_CODE rrc_setup_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::rrc_setup_complete: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -23531,66 +21925,9 @@ void scg_fail_info_s::to_json(json_writer& j) const j.end_obj(); } -void scg_fail_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::scg_fail_info: - c.destroy(); - break; - default: - break; - } -} void scg_fail_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::scg_fail_info: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_s::crit_exts_c_"); - } -} -scg_fail_info_s::crit_exts_c_::crit_exts_c_(const scg_fail_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::scg_fail_info: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_s::crit_exts_c_"); - } -} -scg_fail_info_s::crit_exts_c_& scg_fail_info_s::crit_exts_c_::operator=(const scg_fail_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::scg_fail_info: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_s::crit_exts_c_"); - } - - return *this; } void scg_fail_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -23598,7 +21935,7 @@ void scg_fail_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::scg_fail_info: j.write_fieldname("scgFailureInformation"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -23612,7 +21949,7 @@ SRSASN_CODE scg_fail_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::scg_fail_info: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -23629,7 +21966,7 @@ SRSASN_CODE scg_fail_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::scg_fail_info: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -23667,67 +22004,9 @@ void scg_fail_info_eutra_s::to_json(json_writer& j) const j.end_obj(); } -void scg_fail_info_eutra_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::scg_fail_info_eutra: - c.destroy(); - break; - default: - break; - } -} void scg_fail_info_eutra_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::scg_fail_info_eutra: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_eutra_s::crit_exts_c_"); - } -} -scg_fail_info_eutra_s::crit_exts_c_::crit_exts_c_(const scg_fail_info_eutra_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::scg_fail_info_eutra: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_eutra_s::crit_exts_c_"); - } -} -scg_fail_info_eutra_s::crit_exts_c_& -scg_fail_info_eutra_s::crit_exts_c_::operator=(const scg_fail_info_eutra_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::scg_fail_info_eutra: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "scg_fail_info_eutra_s::crit_exts_c_"); - } - - return *this; } void scg_fail_info_eutra_s::crit_exts_c_::to_json(json_writer& j) const { @@ -23735,7 +22014,7 @@ void scg_fail_info_eutra_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::scg_fail_info_eutra: j.write_fieldname("scgFailureInformationEUTRA"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -23749,7 +22028,7 @@ SRSASN_CODE scg_fail_info_eutra_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::scg_fail_info_eutra: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -23766,7 +22045,7 @@ SRSASN_CODE scg_fail_info_eutra_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::scg_fail_info_eutra: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -23807,67 +22086,9 @@ void security_mode_complete_s::to_json(json_writer& j) const j.end_obj(); } -void security_mode_complete_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::security_mode_complete: - c.destroy(); - break; - default: - break; - } -} void security_mode_complete_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::security_mode_complete: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_"); - } -} -security_mode_complete_s::crit_exts_c_::crit_exts_c_(const security_mode_complete_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::security_mode_complete: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_"); - } -} -security_mode_complete_s::crit_exts_c_& -security_mode_complete_s::crit_exts_c_::operator=(const security_mode_complete_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::security_mode_complete: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_"); - } - - return *this; } void security_mode_complete_s::crit_exts_c_::to_json(json_writer& j) const { @@ -23875,7 +22096,7 @@ void security_mode_complete_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::security_mode_complete: j.write_fieldname("securityModeComplete"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -23889,7 +22110,7 @@ SRSASN_CODE security_mode_complete_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::security_mode_complete: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -23906,7 +22127,7 @@ SRSASN_CODE security_mode_complete_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::security_mode_complete: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -23947,67 +22168,9 @@ void security_mode_fail_s::to_json(json_writer& j) const j.end_obj(); } -void security_mode_fail_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::security_mode_fail: - c.destroy(); - break; - default: - break; - } -} void security_mode_fail_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::security_mode_fail: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_"); - } -} -security_mode_fail_s::crit_exts_c_::crit_exts_c_(const security_mode_fail_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::security_mode_fail: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_"); - } -} -security_mode_fail_s::crit_exts_c_& -security_mode_fail_s::crit_exts_c_::operator=(const security_mode_fail_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::security_mode_fail: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_"); - } - - return *this; } void security_mode_fail_s::crit_exts_c_::to_json(json_writer& j) const { @@ -24015,7 +22178,7 @@ void security_mode_fail_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::security_mode_fail: j.write_fieldname("securityModeFailure"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -24029,7 +22192,7 @@ SRSASN_CODE security_mode_fail_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::security_mode_fail: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -24046,7 +22209,7 @@ SRSASN_CODE security_mode_fail_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::security_mode_fail: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -24084,66 +22247,9 @@ void ueassist_info_s::to_json(json_writer& j) const j.end_obj(); } -void ueassist_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::ue_assist_info: - c.destroy(); - break; - default: - break; - } -} void ueassist_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::ue_assist_info: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ueassist_info_s::crit_exts_c_"); - } -} -ueassist_info_s::crit_exts_c_::crit_exts_c_(const ueassist_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::ue_assist_info: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ueassist_info_s::crit_exts_c_"); - } -} -ueassist_info_s::crit_exts_c_& ueassist_info_s::crit_exts_c_::operator=(const ueassist_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::ue_assist_info: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ueassist_info_s::crit_exts_c_"); - } - - return *this; } void ueassist_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -24151,7 +22257,7 @@ void ueassist_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::ue_assist_info: j.write_fieldname("ueAssistanceInformation"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -24165,7 +22271,7 @@ SRSASN_CODE ueassist_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::ue_assist_info: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -24182,7 +22288,7 @@ SRSASN_CODE ueassist_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::ue_assist_info: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -24223,66 +22329,9 @@ void ue_cap_info_s::to_json(json_writer& j) const j.end_obj(); } -void ue_cap_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::ue_cap_info: - c.destroy(); - break; - default: - break; - } -} void ue_cap_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::ue_cap_info: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_"); - } -} -ue_cap_info_s::crit_exts_c_::crit_exts_c_(const ue_cap_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::ue_cap_info: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_"); - } -} -ue_cap_info_s::crit_exts_c_& ue_cap_info_s::crit_exts_c_::operator=(const ue_cap_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::ue_cap_info: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_"); - } - - return *this; } void ue_cap_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -24290,7 +22339,7 @@ void ue_cap_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::ue_cap_info: j.write_fieldname("ueCapabilityInformation"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -24304,7 +22353,7 @@ SRSASN_CODE ue_cap_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::ue_cap_info: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -24321,7 +22370,7 @@ SRSASN_CODE ue_cap_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::ue_cap_info: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -24359,67 +22408,9 @@ void ul_info_transfer_s::to_json(json_writer& j) const j.end_obj(); } -void ul_info_transfer_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::ul_info_transfer: - c.destroy(); - break; - default: - break; - } -} void ul_info_transfer_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::ul_info_transfer: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_"); - } -} -ul_info_transfer_s::crit_exts_c_::crit_exts_c_(const ul_info_transfer_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::ul_info_transfer: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_"); - } -} -ul_info_transfer_s::crit_exts_c_& -ul_info_transfer_s::crit_exts_c_::operator=(const ul_info_transfer_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::ul_info_transfer: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_"); - } - - return *this; } void ul_info_transfer_s::crit_exts_c_::to_json(json_writer& j) const { @@ -24427,7 +22418,7 @@ void ul_info_transfer_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::ul_info_transfer: j.write_fieldname("ulInformationTransfer"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -24441,7 +22432,7 @@ SRSASN_CODE ul_info_transfer_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::ul_info_transfer: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -24458,7 +22449,7 @@ SRSASN_CODE ul_info_transfer_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::ul_info_transfer: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -24496,67 +22487,9 @@ void ul_info_transfer_mrdc_s::to_json(json_writer& j) const j.end_obj(); } -void ul_info_transfer_mrdc_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ul_info_transfer_mrdc_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_mrdc_s::crit_exts_c_"); - } -} -ul_info_transfer_mrdc_s::crit_exts_c_::crit_exts_c_(const ul_info_transfer_mrdc_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_mrdc_s::crit_exts_c_"); - } -} -ul_info_transfer_mrdc_s::crit_exts_c_& -ul_info_transfer_mrdc_s::crit_exts_c_::operator=(const ul_info_transfer_mrdc_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_info_transfer_mrdc_s::crit_exts_c_"); - } - - return *this; } void ul_info_transfer_mrdc_s::crit_exts_c_::to_json(json_writer& j) const { @@ -24564,7 +22497,7 @@ void ul_info_transfer_mrdc_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -24578,7 +22511,7 @@ SRSASN_CODE ul_info_transfer_mrdc_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -24595,7 +22528,7 @@ SRSASN_CODE ul_info_transfer_mrdc_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -24688,66 +22621,9 @@ uint8_t ul_info_transfer_mrdc_s::crit_exts_c_::types_opts::to_number() const } // UL-DCCH-MessageType ::= CHOICE -void ul_dcch_msg_type_c::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ul_dcch_msg_type_c::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_c"); - } -} -ul_dcch_msg_type_c::ul_dcch_msg_type_c(const ul_dcch_msg_type_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_c"); - } -} -ul_dcch_msg_type_c& ul_dcch_msg_type_c::operator=(const ul_dcch_msg_type_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::msg_class_ext: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ul_dcch_msg_type_c"); - } - - return *this; } void ul_dcch_msg_type_c::to_json(json_writer& j) const { @@ -24755,7 +22631,7 @@ void ul_dcch_msg_type_c::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::msg_class_ext: break; @@ -24769,7 +22645,7 @@ SRSASN_CODE ul_dcch_msg_type_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::msg_class_ext: break; @@ -24786,7 +22662,7 @@ SRSASN_CODE ul_dcch_msg_type_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::msg_class_ext: break; @@ -56648,66 +54524,9 @@ void cg_cfg_s::to_json(json_writer& j) const j.end_obj(); } -void cg_cfg_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void cg_cfg_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "cg_cfg_s::crit_exts_c_"); - } -} -cg_cfg_s::crit_exts_c_::crit_exts_c_(const cg_cfg_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "cg_cfg_s::crit_exts_c_"); - } -} -cg_cfg_s::crit_exts_c_& cg_cfg_s::crit_exts_c_::operator=(const cg_cfg_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "cg_cfg_s::crit_exts_c_"); - } - - return *this; } void cg_cfg_s::crit_exts_c_::to_json(json_writer& j) const { @@ -56715,7 +54534,7 @@ void cg_cfg_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -56729,7 +54548,7 @@ SRSASN_CODE cg_cfg_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -56746,7 +54565,7 @@ SRSASN_CODE cg_cfg_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -57597,66 +55416,9 @@ void cg_cfg_info_s::to_json(json_writer& j) const j.end_obj(); } -void cg_cfg_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void cg_cfg_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "cg_cfg_info_s::crit_exts_c_"); - } -} -cg_cfg_info_s::crit_exts_c_::crit_exts_c_(const cg_cfg_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "cg_cfg_info_s::crit_exts_c_"); - } -} -cg_cfg_info_s::crit_exts_c_& cg_cfg_info_s::crit_exts_c_::operator=(const cg_cfg_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "cg_cfg_info_s::crit_exts_c_"); - } - - return *this; } void cg_cfg_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -57664,7 +55426,7 @@ void cg_cfg_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -57678,7 +55440,7 @@ SRSASN_CODE cg_cfg_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -57695,7 +55457,7 @@ SRSASN_CODE cg_cfg_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -57936,66 +55698,9 @@ void ho_cmd_s::to_json(json_writer& j) const j.end_obj(); } -void ho_cmd_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ho_cmd_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_"); - } -} -ho_cmd_s::crit_exts_c_::crit_exts_c_(const ho_cmd_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_"); - } -} -ho_cmd_s::crit_exts_c_& ho_cmd_s::crit_exts_c_::operator=(const ho_cmd_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_"); - } - - return *this; } void ho_cmd_s::crit_exts_c_::to_json(json_writer& j) const { @@ -58003,7 +55708,7 @@ void ho_cmd_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -58017,7 +55722,7 @@ SRSASN_CODE ho_cmd_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -58034,7 +55739,7 @@ SRSASN_CODE ho_cmd_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -58314,66 +56019,9 @@ void ho_prep_info_s::to_json(json_writer& j) const j.end_obj(); } -void ho_prep_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ho_prep_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_"); - } -} -ho_prep_info_s::crit_exts_c_::crit_exts_c_(const ho_prep_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_"); - } -} -ho_prep_info_s::crit_exts_c_& ho_prep_info_s::crit_exts_c_::operator=(const ho_prep_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_"); - } - - return *this; } void ho_prep_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -58381,7 +56029,7 @@ void ho_prep_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -58395,7 +56043,7 @@ SRSASN_CODE ho_prep_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -58412,7 +56060,7 @@ SRSASN_CODE ho_prep_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -58704,67 +56352,9 @@ void meas_timing_cfg_s::to_json(json_writer& j) const j.end_obj(); } -void meas_timing_cfg_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void meas_timing_cfg_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_timing_cfg_s::crit_exts_c_"); - } -} -meas_timing_cfg_s::crit_exts_c_::crit_exts_c_(const meas_timing_cfg_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_timing_cfg_s::crit_exts_c_"); - } -} -meas_timing_cfg_s::crit_exts_c_& -meas_timing_cfg_s::crit_exts_c_::operator=(const meas_timing_cfg_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "meas_timing_cfg_s::crit_exts_c_"); - } - - return *this; } void meas_timing_cfg_s::crit_exts_c_::to_json(json_writer& j) const { @@ -58772,7 +56362,7 @@ void meas_timing_cfg_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -58786,7 +56376,7 @@ SRSASN_CODE meas_timing_cfg_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -58803,7 +56393,7 @@ SRSASN_CODE meas_timing_cfg_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -58945,67 +56535,9 @@ void ue_radio_access_cap_info_s::to_json(json_writer& j) const j.end_obj(); } -void ue_radio_access_cap_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_radio_access_cap_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); - } -} -ue_radio_access_cap_info_s::crit_exts_c_::crit_exts_c_(const ue_radio_access_cap_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); - } -} -ue_radio_access_cap_info_s::crit_exts_c_& -ue_radio_access_cap_info_s::crit_exts_c_::operator=(const ue_radio_access_cap_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_"); - } - - return *this; } void ue_radio_access_cap_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -59013,7 +56545,7 @@ void ue_radio_access_cap_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -59027,7 +56559,7 @@ SRSASN_CODE ue_radio_access_cap_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -59044,7 +56576,7 @@ SRSASN_CODE ue_radio_access_cap_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; @@ -59223,67 +56755,9 @@ void ue_radio_paging_info_s::to_json(json_writer& j) const j.end_obj(); } -void ue_radio_paging_info_s::crit_exts_c_::destroy_() -{ - switch (type_) { - case types::c1: - c.destroy(); - break; - default: - break; - } -} void ue_radio_paging_info_s::crit_exts_c_::set(types::options e) { - destroy_(); type_ = e; - switch (type_) { - case types::c1: - c.init(); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_"); - } -} -ue_radio_paging_info_s::crit_exts_c_::crit_exts_c_(const ue_radio_paging_info_s::crit_exts_c_& other) -{ - type_ = other.type(); - switch (type_) { - case types::c1: - c.init(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_"); - } -} -ue_radio_paging_info_s::crit_exts_c_& -ue_radio_paging_info_s::crit_exts_c_::operator=(const ue_radio_paging_info_s::crit_exts_c_& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::c1: - c.set(other.c.get()); - break; - case types::crit_exts_future: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_"); - } - - return *this; } void ue_radio_paging_info_s::crit_exts_c_::to_json(json_writer& j) const { @@ -59291,7 +56765,7 @@ void ue_radio_paging_info_s::crit_exts_c_::to_json(json_writer& j) const switch (type_) { case types::c1: j.write_fieldname("c1"); - c.get().to_json(j); + c.to_json(j); break; case types::crit_exts_future: break; @@ -59305,7 +56779,7 @@ SRSASN_CODE ue_radio_paging_info_s::crit_exts_c_::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::c1: - HANDLE_CODE(c.get().pack(bref)); + HANDLE_CODE(c.pack(bref)); break; case types::crit_exts_future: break; @@ -59322,7 +56796,7 @@ SRSASN_CODE ue_radio_paging_info_s::crit_exts_c_::unpack(cbit_ref& bref) set(e); switch (type_) { case types::c1: - HANDLE_CODE(c.get().unpack(bref)); + HANDLE_CODE(c.unpack(bref)); break; case types::crit_exts_future: break; diff --git a/lib/src/asn1/s1ap.cc b/lib/src/asn1/s1ap.cc index f11d42ca4..9cfa6f92a 100644 --- a/lib/src/asn1/s1ap.cc +++ b/lib/src/asn1/s1ap.cc @@ -35,53 +35,16 @@ std::string presence_opts::to_string() const } // PrivateIE-ID ::= CHOICE -void private_ie_id_c::destroy_() {} void private_ie_id_c::set(types::options e) { - destroy_(); type_ = e; } -private_ie_id_c::private_ie_id_c(const private_ie_id_c& other) -{ - type_ = other.type(); - switch (type_) { - case types::local: - c.init(other.c.get()); - break; - case types::global: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "private_ie_id_c"); - } -} -private_ie_id_c& private_ie_id_c::operator=(const private_ie_id_c& other) -{ - if (this == &other) { - return *this; - } - set(other.type()); - switch (type_) { - case types::local: - c.set(other.c.get()); - break; - case types::global: - break; - case types::nulltype: - break; - default: - log_invalid_choice_id(type_, "private_ie_id_c"); - } - - return *this; -} void private_ie_id_c::to_json(json_writer& j) const { j.start_obj(); switch (type_) { case types::local: - j.write_int("local", c.get()); + j.write_int("local", c); break; case types::global: break; @@ -95,7 +58,7 @@ SRSASN_CODE private_ie_id_c::pack(bit_ref& bref) const type_.pack(bref); switch (type_) { case types::local: - HANDLE_CODE(pack_integer(bref, c.get(), (uint32_t)0u, (uint32_t)65535u, false, true)); + HANDLE_CODE(pack_integer(bref, c, (uint32_t)0u, (uint32_t)65535u, false, true)); break; case types::global: break; @@ -112,7 +75,7 @@ SRSASN_CODE private_ie_id_c::unpack(cbit_ref& bref) set(e); switch (type_) { case types::local: - HANDLE_CODE(unpack_integer(c.get(), bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + HANDLE_CODE(unpack_integer(c, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); break; case types::global: break; From b45fdd4f10b837a07f388805a60a832386b86ade Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 19 Jan 2021 11:47:35 +0000 Subject: [PATCH 085/138] use using keyword in asn1 rather than typedef --- lib/include/srslte/asn1/rrc.h | 18 +- lib/include/srslte/asn1/rrc/bcch_msg.h | 12 +- lib/include/srslte/asn1/rrc/common_ext.h | 8 +- lib/include/srslte/asn1/rrc/dl_ccch_msg.h | 6 +- lib/include/srslte/asn1/rrc/dl_dcch_msg.h | 74 ++-- lib/include/srslte/asn1/rrc/ho_cmd.h | 8 +- lib/include/srslte/asn1/rrc/meascfg.h | 44 +- lib/include/srslte/asn1/rrc/paging.h | 4 +- lib/include/srslte/asn1/rrc/phy_ded.h | 192 ++++----- lib/include/srslte/asn1/rrc/rr_common.h | 4 +- lib/include/srslte/asn1/rrc/rr_ded.h | 110 ++--- lib/include/srslte/asn1/rrc/security.h | 2 +- lib/include/srslte/asn1/rrc/uecap.h | 10 +- lib/include/srslte/asn1/rrc/ul_dcch_msg.h | 34 +- lib/include/srslte/asn1/rrc_nbiot.h | 44 +- lib/include/srslte/asn1/rrc_nr.h | 2 +- lib/include/srslte/asn1/s1ap.h | 494 +++++++++++----------- 17 files changed, 533 insertions(+), 533 deletions(-) diff --git a/lib/include/srslte/asn1/rrc.h b/lib/include/srslte/asn1/rrc.h index d31155ea6..b31e98a42 100644 --- a/lib/include/srslte/asn1/rrc.h +++ b/lib/include/srslte/asn1/rrc.h @@ -56,7 +56,7 @@ struct mib_mbms_r14_s { }; // BCCH-BCH-MessageType-MBMS-r14 ::= MasterInformationBlock-MBMS-r14 -typedef mib_mbms_r14_s bcch_bch_msg_type_mbms_r14_s; +using bcch_bch_msg_type_mbms_r14_s = mib_mbms_r14_s; // BCCH-BCH-Message-MBMS ::= SEQUENCE struct bcch_bch_msg_mbms_s { @@ -69,7 +69,7 @@ struct bcch_bch_msg_mbms_s { }; // SystemInformation-MBMS-r14 ::= SystemInformation -typedef sys_info_s sys_info_mbms_r14_s; +using sys_info_mbms_r14_s = sys_info_s; // BCCH-DL-SCH-MessageType-MBMS-r14 ::= CHOICE struct bcch_dl_sch_msg_type_mbms_r14_c { @@ -181,7 +181,7 @@ struct bcch_dl_sch_msg_mbms_s { }; // ThresholdEUTRA-v1250 ::= INTEGER (0..97) -typedef uint8_t thres_eutra_v1250; +using thres_eutra_v1250 = uint8_t; // MBMS-SessionInfo-r9 ::= SEQUENCE struct mbms_session_info_r9_s { @@ -2188,7 +2188,7 @@ using meas_result_serv_cell_list_scg_ext_r13_l = dyn_array; // SBCCH-SL-BCH-MessageType ::= MasterInformationBlock-SL -typedef mib_sl_s sbcch_sl_bch_msg_type_s; +using sbcch_sl_bch_msg_type_s = mib_sl_s; // SBCCH-SL-BCH-Message ::= SEQUENCE struct sbcch_sl_bch_msg_s { @@ -2201,7 +2201,7 @@ struct sbcch_sl_bch_msg_s { }; // SBCCH-SL-BCH-MessageType-V2X-r14 ::= MasterInformationBlock-SL-V2X-r14 -typedef mib_sl_v2x_r14_s sbcch_sl_bch_msg_type_v2x_r14_s; +using sbcch_sl_bch_msg_type_v2x_r14_s = mib_sl_v2x_r14_s; // SBCCH-SL-BCH-Message-V2X-r14 ::= SEQUENCE struct sbcch_sl_bch_msg_v2x_r14_s { @@ -2383,7 +2383,7 @@ struct scg_cfg_info_r12_s { types type_; scg_cfg_info_r12_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -3073,7 +3073,7 @@ using var_meas_report_list_l = dyn_array; using var_meas_report_list_r12_l = dyn_array; // VarMobilityHistoryReport-r12 ::= VisitedCellInfoList-r12 -typedef visited_cell_info_list_r12_l var_mob_history_report_r12_l; +using var_mob_history_report_r12_l = visited_cell_info_list_r12_l; // VarRLF-Report-r10 ::= SEQUENCE struct var_rlf_report_r10_s { @@ -3110,7 +3110,7 @@ struct var_short_inactive_mac_input_r15_s { }; // VarShortMAC-Input-NB-r13 ::= VarShortMAC-Input -typedef var_short_mac_input_s var_short_mac_input_nb_r13_s; +using var_short_mac_input_nb_r13_s = var_short_mac_input_s; // VarShortResumeMAC-Input-r13 ::= SEQUENCE struct var_short_resume_mac_input_r13_s { @@ -3126,7 +3126,7 @@ struct var_short_resume_mac_input_r13_s { }; // VarShortResumeMAC-Input-NB-r13 ::= VarShortResumeMAC-Input-r13 -typedef var_short_resume_mac_input_r13_s var_short_resume_mac_input_nb_r13_s; +using var_short_resume_mac_input_nb_r13_s = var_short_resume_mac_input_r13_s; // VarWLAN-MobilityConfig ::= SEQUENCE struct var_wlan_mob_cfg_s { diff --git a/lib/include/srslte/asn1/rrc/bcch_msg.h b/lib/include/srslte/asn1/rrc/bcch_msg.h index 91b28d785..36e7fef1e 100644 --- a/lib/include/srslte/asn1/rrc/bcch_msg.h +++ b/lib/include/srslte/asn1/rrc/bcch_msg.h @@ -30,7 +30,7 @@ namespace rrc { ******************************************************************************/ // BCCH-BCH-MessageType ::= MasterInformationBlock -typedef mib_s bcch_bch_msg_type_s; +using bcch_bch_msg_type_s = mib_s; // BCCH-BCH-Message ::= SEQUENCE struct bcch_bch_msg_s { @@ -3844,8 +3844,8 @@ private: // SystemInformation-r8-IEs ::= SEQUENCE struct sys_info_r8_ies_s { - typedef sib_info_item_c sib_type_and_info_item_c_; - using sib_type_and_info_l_ = dyn_array; + using sib_type_and_info_item_c_ = sib_info_item_c; + using sib_type_and_info_l_ = dyn_array; // member variables bool non_crit_ext_present = false; @@ -4073,10 +4073,10 @@ struct bcch_dl_sch_msg_s { }; // SystemInformation-BR-r13 ::= SystemInformation -typedef sys_info_s sys_info_br_r13_s; +using sys_info_br_r13_s = sys_info_s; // SystemInformationBlockType1-BR-r13 ::= SystemInformationBlockType1 -typedef sib_type1_s sib_type1_br_r13_s; +using sib_type1_br_r13_s = sib_type1_s; // BCCH-DL-SCH-MessageType-BR-r13 ::= CHOICE struct bcch_dl_sch_msg_type_br_r13_c { @@ -4741,7 +4741,7 @@ struct sib_type6_v8h0_ies_s { }; // SystemInformationBlockType16-NB-r13 ::= SystemInformationBlockType16-r11 -typedef sib_type16_r11_s sib_type16_nb_r13_s; +using sib_type16_nb_r13_s = sib_type16_r11_s; } // namespace rrc } // namespace asn1 diff --git a/lib/include/srslte/asn1/rrc/common_ext.h b/lib/include/srslte/asn1/rrc/common_ext.h index e1f990c8f..77d0235d1 100644 --- a/lib/include/srslte/asn1/rrc/common_ext.h +++ b/lib/include/srslte/asn1/rrc/common_ext.h @@ -958,7 +958,7 @@ struct sl_disc_res_pool_r12_s { uint8_t to_number() const; }; typedef enumerated setup_e_; - typedef setup_e types; + using types = setup_e; // choice methods disc_period_v1310_c_() = default; @@ -993,7 +993,7 @@ struct sl_disc_res_pool_r12_s { struct setup_s_ { pci_list_r13_l pci_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods rx_params_add_neigh_freq_r13_c_() = default; @@ -1057,7 +1057,7 @@ struct sl_disc_res_pool_r12_s { int8_t ref_sig_pwr = -60; uint8_t sync_cfg_idx_r13 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods tx_params_add_neigh_freq_r13_c_() = default; @@ -1097,7 +1097,7 @@ struct sl_disc_res_pool_r12_s { // member variables freq_info_v1370_s_ freq_info_v1370; }; - typedef setup_e types; + using types = setup_e; // choice methods tx_params_add_neigh_freq_v1370_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/dl_ccch_msg.h b/lib/include/srslte/asn1/rrc/dl_ccch_msg.h index dbaf6d80e..fc99cfb9b 100644 --- a/lib/include/srslte/asn1/rrc/dl_ccch_msg.h +++ b/lib/include/srslte/asn1/rrc/dl_ccch_msg.h @@ -590,7 +590,7 @@ struct rrc_conn_reest_s { types type_; rrc_conn_reest_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -723,7 +723,7 @@ struct rrc_conn_reject_s { types type_; rrc_conn_reject_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -810,7 +810,7 @@ struct rrc_conn_setup_s { types type_; rrc_conn_setup_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/dl_dcch_msg.h b/lib/include/srslte/asn1/rrc/dl_dcch_msg.h index a6f9eeb35..9334ea7f0 100644 --- a/lib/include/srslte/asn1/rrc/dl_dcch_msg.h +++ b/lib/include/srslte/asn1/rrc/dl_dcch_msg.h @@ -595,7 +595,7 @@ struct sl_disc_tx_res_r13_c { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods sl_disc_tx_res_r13_c() = default; @@ -639,7 +639,7 @@ struct tdm_pattern_cfg_r15_c { sf_assign_r15_e sf_assign_r15; uint8_t harq_offset_r15 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods tdm_pattern_cfg_r15_c() = default; @@ -895,7 +895,7 @@ struct rrc_conn_recfg_v1510_ies_s { dyn_octstring nr_secondary_cell_group_cfg_r15; int8_t p_max_eutra_r15 = -30; }; - typedef setup_e types; + using types = setup_e; // choice methods nr_cfg_r15_c_() = default; @@ -1086,7 +1086,7 @@ struct sl_v2x_cfg_ded_r14_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods comm_tx_res_r14_c_() = default; @@ -1184,7 +1184,7 @@ struct sl_v2x_cfg_ded_r14_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods comm_tx_res_v1530_c_() = default; @@ -1248,7 +1248,7 @@ struct lwa_cfg_r13_c { struct setup_s_ { lwa_cfg_r13_s lwa_cfg_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods lwa_cfg_r13_c() = default; @@ -1285,7 +1285,7 @@ struct lwip_cfg_r13_c { struct setup_s_ { lwip_cfg_r13_s lwip_cfg_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods lwip_cfg_r13_c() = default; @@ -1392,7 +1392,7 @@ struct rclwi_cfg_r13_c { struct setup_s_ { rclwi_cfg_r13_s rclwi_cfg_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods rclwi_cfg_r13_c() = default; @@ -1659,7 +1659,7 @@ struct scg_cfg_r12_c { scg_cfg_part_mcg_r12_s_ scg_cfg_part_mcg_r12; scg_cfg_part_scg_r12_s scg_cfg_part_scg_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods scg_cfg_r12_c() = default; @@ -1768,7 +1768,7 @@ struct sl_comm_cfg_r12_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods comm_tx_res_r12_c_() = default; @@ -1871,7 +1871,7 @@ struct sl_comm_cfg_r12_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods comm_tx_res_v1310_c_() = default; @@ -1998,7 +1998,7 @@ struct sl_disc_cfg_r12_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods disc_tx_res_r12_c_() = default; @@ -2033,7 +2033,7 @@ struct sl_disc_cfg_r12_s { struct setup_s_ { sl_tf_idx_pair_list_r12b_l disc_tf_idx_list_r12b; }; - typedef setup_e types; + using types = setup_e; // choice methods disc_tf_idx_list_v1260_c_() = default; @@ -2124,7 +2124,7 @@ struct sl_disc_cfg_r12_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods disc_tx_res_ps_r13_c_() = default; @@ -2164,7 +2164,7 @@ struct sl_disc_cfg_r12_s { sl_disc_tx_ref_carrier_ded_r13_c disc_tx_ref_carrier_ded_r13; sl_disc_tx_info_inter_freq_list_add_r13_s disc_tx_info_inter_freq_list_add_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods disc_tx_inter_freq_info_r13_c_() = default; @@ -2196,7 +2196,7 @@ struct sl_disc_cfg_r12_s { setup_s_ c; }; struct disc_rx_gap_cfg_r13_c_ { - typedef setup_e types; + using types = setup_e; // choice methods disc_rx_gap_cfg_r13_c_() = default; @@ -2228,7 +2228,7 @@ struct sl_disc_cfg_r12_s { sl_gap_cfg_r13_s c; }; struct disc_tx_gap_cfg_r13_c_ { - typedef setup_e types; + using types = setup_e; // choice methods disc_tx_gap_cfg_r13_c_() = default; @@ -2260,7 +2260,7 @@ struct sl_disc_cfg_r12_s { sl_gap_cfg_r13_s c; }; struct disc_sys_info_to_report_cfg_r13_c_ { - typedef setup_e types; + using types = setup_e; // choice methods disc_sys_info_to_report_cfg_r13_c_() = default; @@ -2354,7 +2354,7 @@ struct rrc_conn_recfg_v1250_ies_s { wlan_offload_cfg_r12_s wlan_offload_cfg_ded_r12; t350_r12_e_ t350_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods wlan_offload_info_r12_c_() = default; @@ -2549,7 +2549,7 @@ struct idc_cfg_r11_s { autonomous_denial_validity_r11_e_ autonomous_denial_validity_r11; }; struct idc_ind_mrdc_r15_c_ { - typedef setup_e types; + using types = setup_e; // choice methods idc_ind_mrdc_r15_c_() = default; @@ -2644,7 +2644,7 @@ struct pwr_pref_ind_cfg_r11_c { // member variables pwr_pref_ind_timer_r11_e_ pwr_pref_ind_timer_r11; }; - typedef setup_e types; + using types = setup_e; // choice methods pwr_pref_ind_cfg_r11_c() = default; @@ -2848,7 +2848,7 @@ struct other_cfg_r9_s { // member variables delay_budget_report_prohibit_timer_r14_e_ delay_budget_report_prohibit_timer_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods delay_budget_report_cfg_r14_c_() = default; @@ -2913,7 +2913,7 @@ struct other_cfg_r9_s { bool rlm_report_rep_mpdcch_r14_present = false; rlm_report_timer_r14_e_ rlm_report_timer_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods rlm_report_cfg_r14_c_() = default; @@ -2977,7 +2977,7 @@ struct other_cfg_r9_s { // member variables overheat_ind_prohibit_timer_r14_e_ overheat_ind_prohibit_timer_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods overheat_assist_cfg_r14_c_() = default; @@ -3021,7 +3021,7 @@ struct other_cfg_r9_s { bounded_octstring<1, 1000> meas_cfg_app_layer_container_r15; service_type_r15_e_ service_type_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods meas_cfg_app_layer_r15_c_() = default; @@ -5085,7 +5085,7 @@ struct counter_check_s { types type_; counter_check_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5188,7 +5188,7 @@ struct dl_info_transfer_s { void destroy_(); }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5272,7 +5272,7 @@ struct ho_from_eutra_prep_request_s { types type_; ho_from_eutra_prep_request_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5356,7 +5356,7 @@ struct logged_meas_cfg_r10_s { types type_; logged_meas_cfg_r10_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5458,7 +5458,7 @@ struct mob_from_eutra_cmd_s { void destroy_(); }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5542,7 +5542,7 @@ struct rn_recfg_r10_s { types type_; rn_recfg_r10_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5630,7 +5630,7 @@ struct rrc_conn_recfg_s { types type_; rrc_conn_recfg_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5714,7 +5714,7 @@ struct rrc_conn_release_s { types type_; rrc_conn_release_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5798,7 +5798,7 @@ struct rrc_conn_resume_r13_s { types type_; rrc_conn_resume_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5882,7 +5882,7 @@ struct ue_info_request_r9_s { types type_; ue_info_request_r9_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -6272,7 +6272,7 @@ struct scg_cfg_v13c0_c { bool scg_cfg_part_scg_v13c0_present = false; scg_cfg_part_scg_v13c0_s scg_cfg_part_scg_v13c0; }; - typedef setup_e types; + using types = setup_e; // choice methods scg_cfg_v13c0_c() = default; @@ -6367,7 +6367,7 @@ struct scg_cfg_v12f0_c { bool scg_cfg_part_scg_v12f0_present = false; scg_cfg_part_scg_v12f0_s scg_cfg_part_scg_v12f0; }; - typedef setup_e types; + using types = setup_e; // choice methods scg_cfg_v12f0_c() = default; diff --git a/lib/include/srslte/asn1/rrc/ho_cmd.h b/lib/include/srslte/asn1/rrc/ho_cmd.h index 288121642..263e41de0 100644 --- a/lib/include/srslte/asn1/rrc/ho_cmd.h +++ b/lib/include/srslte/asn1/rrc/ho_cmd.h @@ -154,7 +154,7 @@ struct scg_cfg_r12_s { types type_; scg_cfg_r12_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -474,7 +474,7 @@ struct ho_cmd_s { types type_; ho_cmd_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -799,7 +799,7 @@ struct ho_prep_info_s { types type_; ho_prep_info_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -898,7 +898,7 @@ struct var_meas_cfg_s { mob_state_params_s mob_state_params; speed_state_scale_factors_s time_to_trigger_sf; }; - typedef setup_e types; + using types = setup_e; // choice methods speed_state_pars_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/meascfg.h b/lib/include/srslte/asn1/rrc/meascfg.h index 2e0a0e2b5..7e6d1c50c 100644 --- a/lib/include/srslte/asn1/rrc/meascfg.h +++ b/lib/include/srslte/asn1/rrc/meascfg.h @@ -699,7 +699,7 @@ using alt_ttt_cells_to_add_mod_list_r12_l = dyn_array subcarrier_spacing_ssb_r15_e_; struct ssb_to_measure_r15_c_ { - typedef setup_e types; + using types = setup_e; // choice methods ssb_to_measure_r15_c_() = default; @@ -1590,7 +1590,7 @@ struct rs_cfg_ssb_nr_r15_s { // RSRQ-RangeConfig-r12 ::= CHOICE struct rsrq_range_cfg_r12_c { - typedef setup_e types; + using types = setup_e; // choice methods rsrq_range_cfg_r12_c() = default; @@ -1947,7 +1947,7 @@ struct ul_delay_cfg_r13_c { // member variables delay_thres_r13_e_ delay_thres_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods ul_delay_cfg_r13_c() = default; @@ -2013,7 +2013,7 @@ using wlan_id_list_r13_l = dyn_array; // WLAN-NameListConfig-r15 ::= CHOICE struct wlan_name_list_cfg_r15_c { - typedef setup_e types; + using types = setup_e; // choice methods wlan_name_list_cfg_r15_c() = default; @@ -2097,7 +2097,7 @@ struct meas_obj_eutra_s { uint16_t to_number() const; }; typedef enumerated setup_e_; - typedef setup_e types; + using types = setup_e; // choice methods t312_r12_c_() = default; @@ -2220,7 +2220,7 @@ struct meas_obj_geran_s { struct meas_obj_nr_r15_s { using cells_for_which_to_report_sftd_r15_l_ = bounded_array; struct band_nr_r15_c_ { - typedef setup_e types; + using types = setup_e; // choice methods band_nr_r15_c_() = default; @@ -2825,7 +2825,7 @@ struct eutra_event_s { // ReportConfigEUTRA ::= SEQUENCE struct report_cfg_eutra_s { struct trigger_type_c_ { - typedef eutra_event_s event_s_; + using event_s_ = eutra_event_s; struct periodical_s_ { struct purpose_opts { enum options { report_strongest_cells, report_cgi, nulltype } value; @@ -2915,7 +2915,7 @@ struct report_cfg_eutra_s { }; typedef enumerated report_amount_e_; struct alt_time_to_trigger_r12_c_ { - typedef setup_e types; + using types = setup_e; // choice methods alt_time_to_trigger_r12_c_() = default; @@ -2965,7 +2965,7 @@ struct report_cfg_eutra_s { uint8_t a5_thres2_r13 = 0; report_quant_v1310_e_ report_quant_v1310; }; - typedef setup_e types; + using types = setup_e; // choice methods rs_sinr_cfg_r13_c_() = default; @@ -3482,7 +3482,7 @@ struct report_cfg_inter_rat_s { }; typedef enumerated report_amount_e_; struct b2_thres1_v1250_c_ { - typedef setup_e types; + using types = setup_e; // choice methods b2_thres1_v1250_c_() = default; @@ -4485,7 +4485,7 @@ struct meas_gap_cfg_dense_prs_r15_c { // member variables gap_offset_dense_prs_r15_c_ gap_offset_dense_prs_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods meas_gap_cfg_dense_prs_r15_c() = default; @@ -4525,7 +4525,7 @@ struct meas_gap_cfg_per_cc_list_r14_c { meas_gap_cfg_to_rem_list_r14_l meas_gap_cfg_to_rem_list_r14; meas_gap_cfg_to_add_mod_list_r14_l meas_gap_cfg_to_add_mod_list_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods meas_gap_cfg_per_cc_list_r14_c() = default; @@ -4573,7 +4573,7 @@ struct meas_gap_sharing_cfg_r14_c { // member variables meas_gap_sharing_scheme_r14_e_ meas_gap_sharing_scheme_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods meas_gap_sharing_cfg_r14_c() = default; @@ -4793,7 +4793,7 @@ struct meas_cfg_s { mob_state_params_s mob_state_params; speed_state_scale_factors_s time_to_trigger_sf; }; - typedef setup_e types; + using types = setup_e; // choice methods speed_state_pars_c_() = default; @@ -4825,7 +4825,7 @@ struct meas_cfg_s { setup_s_ c; }; struct meas_scale_factor_r12_c_ { - typedef setup_e types; + using types = setup_e; // choice methods meas_scale_factor_r12_c_() = default; @@ -4857,7 +4857,7 @@ struct meas_cfg_s { meas_scale_factor_r12_e c; }; struct height_thresh_ref_r15_c_ { - typedef setup_e types; + using types = setup_e; // choice methods height_thresh_ref_r15_c_() = default; @@ -6596,7 +6596,7 @@ struct meas_report_s { types type_; meas_report_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/paging.h b/lib/include/srslte/asn1/rrc/paging.h index 89e753c77..7f521eebc 100644 --- a/lib/include/srslte/asn1/rrc/paging.h +++ b/lib/include/srslte/asn1/rrc/paging.h @@ -371,7 +371,7 @@ struct ue_paging_coverage_info_s { types type_; ue_paging_coverage_info_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -495,7 +495,7 @@ struct ue_radio_paging_info_s { types type_; ue_radio_paging_info_r12_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/phy_ded.h b/lib/include/srslte/asn1/rrc/phy_ded.h index e92884ade..faf5b1815 100644 --- a/lib/include/srslte/asn1/rrc/phy_ded.h +++ b/lib/include/srslte/asn1/rrc/phy_ded.h @@ -199,7 +199,7 @@ struct csi_rs_cfg_nzp_r11_s { struct setup_s_ { mbsfn_sf_cfg_list_l sf_cfg_list; }; - typedef setup_e types; + using types = setup_e; // choice methods mbsfn_sf_cfg_list_r11_c_() = default; @@ -243,7 +243,7 @@ struct csi_rs_cfg_nzp_r11_s { struct setup_s_ { mbsfn_sf_cfg_list_v1430_l sf_cfg_list_v1430; }; - typedef setup_e types; + using types = setup_e; // choice methods mbsfn_sf_cfg_list_v1430_c_() = default; @@ -393,7 +393,7 @@ struct csi_rs_cfg_nzp_emimo_r13_c { nzp_res_cfg_list_r13_l_ nzp_res_cfg_list_r13; cdm_type_r13_e_ cdm_type_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_nzp_emimo_r13_c() = default; @@ -505,7 +505,7 @@ struct csi_rs_cfg_bf_v1430_s { // CSI-RS-ConfigEMIMO2-r14 ::= CHOICE struct csi_rs_cfg_emimo2_r14_c { - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_emimo2_r14_c() = default; @@ -748,7 +748,7 @@ struct cri_report_cfg_r13_c { uint16_t cri_cfg_idx_r13 = 0; uint16_t cri_cfg_idx2_r13 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods cri_report_cfg_r13_c() = default; @@ -790,7 +790,7 @@ struct csi_rs_cfg_emimo_hybrid_r14_c { uint16_t periodicity_offset_idx_r14 = 0; csi_rs_cfg_emimo2_r14_c emimo_type2_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_emimo_hybrid_r14_c() = default; @@ -884,7 +884,7 @@ struct csi_rs_cfg_emimo_r13_c { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_emimo_r13_c() = default; @@ -978,7 +978,7 @@ struct csi_rs_cfg_emimo_v1430_c { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_emimo_v1430_c() = default; @@ -1072,7 +1072,7 @@ struct csi_rs_cfg_emimo_v1480_c { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_emimo_v1480_c() = default; @@ -1130,7 +1130,7 @@ struct csi_rs_cfg_emimo_v1530_c { private: csi_rs_cfg_non_precoded_v1530_s c; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_emimo_v1530_c() = default; @@ -1261,7 +1261,7 @@ struct cqi_report_periodic_proc_ext_r11_s { uint16_t cqi_pmi_cfg_idx2_r11 = 0; uint16_t ri_cfg_idx2_r11 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_cfg_idx_r11_c_() = default; @@ -1371,7 +1371,7 @@ struct csi_im_cfg_ext_r12_s { struct csi_process_r11_s { struct csi_im_cfg_id_list_r12_c_ { using setup_l_ = bounded_array; - typedef setup_e types; + using types = setup_e; // choice methods csi_im_cfg_id_list_r12_c_() = default; @@ -1405,7 +1405,7 @@ struct csi_process_r11_s { setup_l_ c; }; struct cqi_report_aperiodic_proc2_r12_c_ { - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_aperiodic_proc2_r12_c_() = default; @@ -1439,7 +1439,7 @@ struct csi_process_r11_s { cqi_report_aperiodic_proc_r11_s c; }; struct cqi_report_aperiodic_proc_v1310_c_ { - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_aperiodic_proc_v1310_c_() = default; @@ -1473,7 +1473,7 @@ struct csi_process_r11_s { cqi_report_aperiodic_proc_v1310_s c; }; struct cqi_report_aperiodic_proc2_v1310_c_ { - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_aperiodic_proc2_v1310_c_() = default; @@ -1614,7 +1614,7 @@ struct cqi_report_aperiodic_r10_c { cqi_report_mode_aperiodic_e cqi_report_mode_aperiodic_r10; aperiodic_csi_trigger_r10_s_ aperiodic_csi_trigger_r10; }; - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_aperiodic_r10_c() = default; @@ -1670,7 +1670,7 @@ struct cqi_report_aperiodic_v1250_c { // member variables aperiodic_csi_trigger_v1250_s_ aperiodic_csi_trigger_v1250; }; - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_aperiodic_v1250_c() = default; @@ -1724,7 +1724,7 @@ struct cqi_report_aperiodic_v1310_c { fixed_bitstring<32> trigger5_sf_set_ind_r13; fixed_bitstring<32> trigger6_sf_set_ind_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods aperiodic_csi_trigger2_r13_c_() = default; @@ -1764,7 +1764,7 @@ struct cqi_report_aperiodic_v1310_c { aperiodic_csi_trigger_v1310_s_ aperiodic_csi_trigger_v1310; aperiodic_csi_trigger2_r13_c_ aperiodic_csi_trigger2_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_aperiodic_v1310_c() = default; @@ -2049,7 +2049,7 @@ struct cqi_report_periodic_r10_c { uint16_t cqi_pmi_cfg_idx2_r10 = 0; uint16_t ri_cfg_idx2_r10 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_cfg_idx_r10_c_() = default; @@ -2096,7 +2096,7 @@ struct cqi_report_periodic_r10_c { bool simul_ack_nack_and_cqi = false; csi_cfg_idx_r10_c_ csi_cfg_idx_r10; }; - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_periodic_r10_c() = default; @@ -2248,7 +2248,7 @@ struct spdcch_elems_r15_c { rate_matching_mode_r15_e_ rate_matching_mode_r15; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods spdcch_elems_r15_c() = default; @@ -2311,7 +2311,7 @@ struct spucch_elems_r15_c { uint8_t n4max_coderate_multi_res_slot_pucch_r15 = 0; uint8_t n4max_coderate_multi_res_subslot_pucch_r15 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods spucch_elems_r15_c() = default; @@ -2407,7 +2407,7 @@ private: // ZeroTxPowerCSI-RS-Conf-r12 ::= CHOICE struct zero_tx_pwr_csi_rs_conf_r12_c { - typedef setup_e types; + using types = setup_e; // choice methods zero_tx_pwr_csi_rs_conf_r12_c() = default; @@ -2448,7 +2448,7 @@ struct cqi_report_cfg_r10_s { meas_sf_pattern_r10_c csi_meas_sf_set1_r10; meas_sf_pattern_r10_c csi_meas_sf_set2_r10; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_sf_pattern_cfg_r10_c_() = default; @@ -2519,7 +2519,7 @@ struct cqi_report_cfg_v1250_s { struct setup_s_ { fixed_bitstring<10> csi_meas_sf_sets_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_sf_pattern_cfg_r12_c_() = default; @@ -2641,7 +2641,7 @@ struct csi_rs_cfg_r10_s { uint8_t sf_cfg_r10 = 0; int8_t p_c_r10 = -8; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_r10_c_() = default; @@ -2698,7 +2698,7 @@ struct csi_rs_cfg_v1250_s { // member variables zero_tx_pwr_csi_rs_list_r12_l_ zero_tx_pwr_csi_rs_list_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods ds_zero_tx_pwr_csi_rs_r12_c_() = default; @@ -2866,7 +2866,7 @@ struct epdcch_set_cfg_r11_s { bounded_bitstring<4, 38> res_block_assign_r11; }; struct csi_rs_cfg_zp_id2_r12_c_ { - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_zp_id2_r12_c_() = default; @@ -2900,7 +2900,7 @@ struct epdcch_set_cfg_r11_s { uint8_t c; }; struct num_prb_pairs_v1310_c_ { - typedef setup_e types; + using types = setup_e; // choice methods num_prb_pairs_v1310_c_() = default; @@ -3025,7 +3025,7 @@ struct epdcch_set_cfg_r11_s { mpdcch_num_repeat_r13_e_ mpdcch_num_repeat_r13; uint8_t mpdcch_nb_r13 = 1; }; - typedef setup_e types; + using types = setup_e; // choice methods mpdcch_cfg_r13_c_() = default; @@ -3153,7 +3153,7 @@ struct enable256_qam_r14_c { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods enable256_qam_r14_c() = default; @@ -3202,7 +3202,7 @@ struct pdsch_re_map_qcl_cfg_r11_s { struct setup_s_ { mbsfn_sf_cfg_list_l sf_cfg_list; }; - typedef setup_e types; + using types = setup_e; // choice methods mbsfn_sf_cfg_list_r11_c_() = default; @@ -3255,7 +3255,7 @@ struct pdsch_re_map_qcl_cfg_r11_s { struct setup_s_ { mbsfn_sf_cfg_list_v1430_l sf_cfg_list_v1430; }; - typedef setup_e types; + using types = setup_e; // choice methods mbsfn_sf_cfg_list_v1430_c_() = default; @@ -3319,7 +3319,7 @@ struct pdsch_re_map_qcl_cfg_r11_s { uint8_t csi_rs_cfg_zp_id_v1530 = 1; uint8_t qcl_csi_rs_cfg_nzp_id_v1530 = 1; }; - typedef setup_e types; + using types = setup_e; // choice methods codeword_one_cfg_v1530_c_() = default; @@ -3408,7 +3408,7 @@ struct tpc_pdcch_cfg_c { fixed_bitstring<16> tpc_rnti; tpc_idx_c tpc_idx; }; - typedef setup_e types; + using types = setup_e; // choice methods tpc_pdcch_cfg_c() = default; @@ -3720,7 +3720,7 @@ struct ant_info_ded_stti_r15_c { bool slot_subslot_pdsch_tx_div_minus2_layer_r15 = false; bool slot_subslot_pdsch_tx_div_minus4_layer_r15 = false; }; - typedef setup_e types; + using types = setup_e; // choice methods ant_info_ded_stti_r15_c() = default; @@ -3805,7 +3805,7 @@ struct cqi_report_cfg_r15_c { cqi_report_cfg_v1430_s cqi_report_cfg_v1430; alt_cqi_table_minus1024_qam_r15_e_ alt_cqi_table_minus1024_qam_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_cfg_r15_c() = default; @@ -3891,7 +3891,7 @@ struct cqi_report_periodic_c { uint16_t ri_cfg_idx = 0; bool simul_ack_nack_and_cqi = false; }; - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_periodic_c() = default; @@ -3935,7 +3935,7 @@ struct csi_rs_cfg_r15_c { csi_rs_cfg_v1310_s csi_rs_cfg_v1310; csi_rs_cfg_v1430_s csi_rs_cfg_v1430; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_r15_c() = default; @@ -3978,7 +3978,7 @@ using csi_rs_cfg_nzp_to_release_list_r15_l = bounded_array; // CSI-RS-ConfigZP-ApList-r14 ::= CHOICE struct csi_rs_cfg_zp_ap_list_r14_c { using setup_l_ = dyn_array; - typedef setup_e types; + using types = setup_e; // choice methods csi_rs_cfg_zp_ap_list_r14_c() = default; @@ -4024,7 +4024,7 @@ struct dmrs_cfg_r11_c { uint16_t scrambling_id_r11 = 0; uint16_t scrambling_id2_r11 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods dmrs_cfg_r11_c() = default; @@ -4160,7 +4160,7 @@ struct eimta_main_cfg_r12_c { eimta_cmd_periodicity_r12_e_ eimta_cmd_periodicity_r12; fixed_bitstring<10> eimta_cmd_sf_set_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods eimta_main_cfg_r12_c() = default; @@ -4209,7 +4209,7 @@ struct eimta_main_cfg_serv_cell_r12_c { struct setup_s_ { mbsfn_sf_cfg_list_l sf_cfg_list_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods mbsfn_sf_cfg_list_v1250_c_() = default; @@ -4248,7 +4248,7 @@ struct eimta_main_cfg_serv_cell_r12_c { eimta_harq_ref_cfg_r12_e_ eimta_harq_ref_cfg_r12; mbsfn_sf_cfg_list_v1250_c_ mbsfn_sf_cfg_list_v1250; }; - typedef setup_e types; + using types = setup_e; // choice methods eimta_main_cfg_serv_cell_r12_c() = default; @@ -4360,7 +4360,7 @@ struct pucch_format3_conf_r13_s { // member variables n3_pucch_an_list_p1_r13_l_ n3_pucch_an_list_p1_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods two_ant_port_activ_pucch_format3_r13_c_() = default; @@ -4432,7 +4432,7 @@ struct spdcch_cfg_r15_c { spdcch_l1_reuse_ind_r15_e_ spdcch_l1_reuse_ind_r15; spdcch_set_r15_l spdcch_set_cfg_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods spdcch_cfg_r15_c() = default; @@ -4482,7 +4482,7 @@ struct spucch_cfg_r15_c { spucch_set_r15_l spucch_set_r15; dummy_s_ dummy; }; - typedef setup_e types; + using types = setup_e; // choice methods spucch_cfg_r15_c() = default; @@ -4666,7 +4666,7 @@ struct sched_request_cfg_v1530_c { uint8_t sr_cfg_idx_subslot_r15 = 0; dssr_trans_max_r15_e_ dssr_trans_max_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods sched_request_cfg_v1530_c() = default; @@ -4756,7 +4756,7 @@ struct slot_or_subslot_pdsch_cfg_r15_c { res_alloc_r15_e_ res_alloc_r15; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods slot_or_subslot_pdsch_cfg_r15_c() = default; @@ -4822,7 +4822,7 @@ struct slot_or_subslot_pusch_cfg_r15_c { bool ul_dmrs_ifdma_slot_or_subslot_r15 = false; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods slot_or_subslot_pusch_cfg_r15_c() = default; @@ -4873,7 +4873,7 @@ struct tdd_pusch_up_pts_r14_c { bool dmrs_less_up_pts_cfg_r14_present = false; sym_pusch_up_pts_r14_e_ sym_pusch_up_pts_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods tdd_pusch_up_pts_r14_c() = default; @@ -5093,7 +5093,7 @@ struct ant_info_ded_s { std::string to_string() const; }; typedef enumerated setup_e_; - typedef setup_e types; + using types = setup_e; // choice methods ue_tx_ant_sel_c_() = default; @@ -5172,7 +5172,7 @@ struct ant_info_ded_r10_s { std::string to_string() const; }; typedef enumerated setup_e_; - typedef setup_e types; + using types = setup_e; // choice methods ue_tx_ant_sel_c_() = default; @@ -5296,7 +5296,7 @@ struct ant_info_ded_v1530_c { types type_; ue_tx_ant_sel_srs_minus2_t4_r_nr_of_pairs_r15_e_ c; }; - typedef setup_e types; + using types = setup_e; // choice methods ant_info_ded_v1530_c() = default; @@ -5555,7 +5555,7 @@ struct epdcch_cfg_r11_s { struct setup_s_ { meas_sf_pattern_r10_c sf_pattern_r11; }; - typedef setup_e types; + using types = setup_e; // choice methods sf_pattern_cfg_r11_c_() = default; @@ -5599,7 +5599,7 @@ struct epdcch_cfg_r11_s { epdcch_set_cfg_to_release_list_r11_l set_cfg_to_release_list_r11; epdcch_set_cfg_to_add_mod_list_r11_l set_cfg_to_add_mod_list_r11; }; - typedef setup_e types; + using types = setup_e; // choice methods cfg_r11_c_() = default; @@ -5653,7 +5653,7 @@ struct pdcch_candidate_reductions_r13_c { pdcch_candidate_reduction_value_r13_e pdcch_candidate_reduction_al4_r13; pdcch_candidate_reduction_value_r13_e pdcch_candidate_reduction_al5_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods pdcch_candidate_reductions_r13_c() = default; @@ -5853,7 +5853,7 @@ struct pucch_cfg_ded_s { repeat_factor_e_ repeat_factor; uint16_t n1_pucch_an_rep = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods ack_nack_repeat_c_() = default; @@ -5919,7 +5919,7 @@ struct pucch_cfg_ded_r13_s { repeat_factor_r13_e_ repeat_factor_r13; uint16_t n1_pucch_an_rep_r13 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods ack_nack_repeat_r13_c_() = default; @@ -5968,7 +5968,7 @@ struct pucch_cfg_ded_r13_s { // member variables n3_pucch_an_list_p1_r13_l_ n3_pucch_an_list_p1_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods two_ant_port_activ_pucch_format3_r13_c_() = default; @@ -6018,7 +6018,7 @@ struct pucch_cfg_ded_r13_s { n1_pucch_an_cs_list_r13_l_ n1_pucch_an_cs_list_r13; dummy1_l_ dummy1; }; - typedef setup_e types; + using types = setup_e; // choice methods n1_pucch_an_cs_r13_c_() = default; @@ -6167,7 +6167,7 @@ struct pucch_cfg_ded_r13_s { uint16_t npucch_id_r13 = 0; uint16_t n1_pucch_an_r13 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods npucch_param_r13_c_() = default; @@ -6204,7 +6204,7 @@ struct pucch_cfg_ded_r13_s { struct setup_s_ { uint16_t nka_pucch_an_r13 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods nka_pucch_param_r13_c_() = default; @@ -6346,7 +6346,7 @@ struct pucch_cfg_ded_r13_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods pucch_num_repeat_ce_r13_c_() = default; @@ -6423,7 +6423,7 @@ struct pucch_cfg_ded_v1020_s { // member variables n1_pucch_an_cs_list_r10_l_ n1_pucch_an_cs_list_r10; }; - typedef setup_e types; + using types = setup_e; // choice methods n1_pucch_an_cs_r10_c_() = default; @@ -6540,7 +6540,7 @@ struct pucch_cfg_ded_v1130_s { // member variables n1_pucch_an_cs_list_p1_r11_l_ n1_pucch_an_cs_list_p1_r11; }; - typedef setup_e types; + using types = setup_e; // choice methods n1_pucch_an_cs_v1130_c_() = default; @@ -6576,7 +6576,7 @@ struct pucch_cfg_ded_v1130_s { uint16_t npucch_id_r11 = 0; uint16_t n1_pucch_an_r11 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods npucch_param_r11_c_() = default; @@ -6626,7 +6626,7 @@ struct pucch_cfg_ded_v1250_s { struct setup_s_ { uint16_t nka_pucch_an_r12 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods nka_pucch_param_r12_c_() = default; @@ -6714,7 +6714,7 @@ struct pusch_cfg_ded_r13_s { uint16_t npusch_id_r13 = 0; uint16_t ndmrs_csh_id_r13 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods pusch_dmrs_r11_c_() = default; @@ -6766,7 +6766,7 @@ struct pusch_cfg_ded_r13_s { uint8_t beta_offset_cqi_idx_sf_set2_r13 = 0; beta_offset_mc_r12_s_ beta_offset_mc_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods uci_on_pusch_c_() = default; @@ -6851,7 +6851,7 @@ struct pusch_cfg_ded_v1130_s { uint16_t npusch_id_r11 = 0; uint16_t ndmrs_csh_id_r11 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods pusch_dmrs_r11_c_() = default; @@ -6913,7 +6913,7 @@ struct pusch_cfg_ded_v1250_s { uint8_t beta_offset_cqi_idx_sf_set2_r12 = 0; beta_offset_mc_r12_s_ beta_offset_mc_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods uci_on_pusch_c_() = default; @@ -6977,7 +6977,7 @@ struct pusch_cfg_ded_v1530_s { bool offset_ce_mode_b_r15_present = false; int8_t offset_ce_mode_b_r15 = -1; }; - typedef setup_e types; + using types = setup_e; // choice methods ce_pusch_flex_start_prb_alloc_cfg_r15_c_() = default; @@ -7015,7 +7015,7 @@ struct pusch_cfg_ded_v1530_s { uint8_t six_tone_cyclic_shift_r15 = 0; uint8_t three_tone_cyclic_shift_r15 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods ce_pusch_sub_prb_cfg_r15_c_() = default; @@ -7140,7 +7140,7 @@ struct pusch_enhance_cfg_r14_c { uint8_t pusch_hop_offset_pusch_enh_r14 = 1; interv_ul_hop_pusch_enh_r14_c_ interv_ul_hop_pusch_enh_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods pusch_enhance_cfg_r14_c() = default; @@ -7217,7 +7217,7 @@ struct phys_cfg_ded_stti_r15_c { bool short_processing_time_r15 = false; short_tti_r15_s short_tti_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods phys_cfg_ded_stti_r15_c() = default; @@ -7264,7 +7264,7 @@ struct spucch_cfg_v1550_c { // member variables two_ant_port_activ_spucch_format3_v1550_s_ two_ant_port_activ_spucch_format3_v1550; }; - typedef setup_e types; + using types = setup_e; // choice methods spucch_cfg_v1550_c() = default; @@ -7310,7 +7310,7 @@ struct srs_tpc_pdcch_cfg_r14_c { uint8_t field_type_format3_b_r14 = 1; srs_cc_set_idxlist_r14_l_ srs_cc_set_idxlist_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_tpc_pdcch_cfg_r14_c() = default; @@ -7361,7 +7361,7 @@ struct sched_request_cfg_c { uint8_t sr_cfg_idx = 0; dsr_trans_max_e_ dsr_trans_max; }; - typedef setup_e types; + using types = setup_e; // choice methods sched_request_cfg_c() = default; @@ -7441,7 +7441,7 @@ struct srs_ul_cfg_ded_c { uint8_t tx_comb = 0; cyclic_shift_e_ cyclic_shift; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_ul_cfg_ded_c() = default; @@ -7515,7 +7515,7 @@ struct srs_ul_cfg_ded_v1310_c { cyclic_shift_v1310_e_ cyclic_shift_v1310; tx_comb_num_r13_e_ tx_comb_num_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_ul_cfg_ded_v1310_c() = default; @@ -7560,7 +7560,7 @@ struct srs_ul_cfg_ded_aperiodic_r10_c { srs_cfg_ap_r10_s srs_cfg_ap_dci_format1a2b2c_r10; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods srs_activ_ap_r10_c_() = default; @@ -7601,7 +7601,7 @@ struct srs_ul_cfg_ded_aperiodic_r10_c { srs_cfg_ap_dci_format4_r10_l_ srs_cfg_ap_dci_format4_r10; srs_activ_ap_r10_c_ srs_activ_ap_r10; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_ul_cfg_ded_aperiodic_r10_c() = default; @@ -7646,7 +7646,7 @@ struct srs_ul_cfg_ded_aperiodic_v1310_c { srs_cfg_ap_v1310_s srs_cfg_ap_dci_format0_v1310; srs_cfg_ap_v1310_s srs_cfg_ap_dci_format1a2b2c_v1310; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_activ_ap_v1310_c_() = default; @@ -7686,7 +7686,7 @@ struct srs_ul_cfg_ded_aperiodic_v1310_c { srs_cfg_ap_dci_format4_v1310_l_ srs_cfg_ap_dci_format4_v1310; srs_activ_ap_v1310_c_ srs_activ_ap_v1310; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_ul_cfg_ded_aperiodic_v1310_c() = default; @@ -7737,7 +7737,7 @@ struct srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c { srs_cfg_ap_r13_s srs_cfg_ap_dci_format0_r13; srs_cfg_ap_r13_s srs_cfg_ap_dci_format1a2b2c_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_activ_ap_r13_c_() = default; @@ -7779,7 +7779,7 @@ struct srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c { srs_cfg_ap_dci_format4_r13_l_ srs_cfg_ap_dci_format4_r13; srs_activ_ap_r13_c_ srs_activ_ap_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c() = default; @@ -7869,7 +7869,7 @@ struct srs_ul_cfg_ded_up_pts_ext_r13_c { srs_ant_port_e srs_ant_port_r13; tx_comb_num_r13_e_ tx_comb_num_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_ul_cfg_ded_up_pts_ext_r13_c() = default; @@ -7968,7 +7968,7 @@ struct ul_pwr_ctrl_ded_v1250_s { alpha_r12_e alpha_sf_set2_r12; int8_t p0_ue_pusch_sf_set2_r12 = -8; }; - typedef setup_e types; + using types = setup_e; // choice methods set2_pwr_ctrl_param_c_() = default; @@ -8108,7 +8108,7 @@ struct phys_cfg_ded_s { struct setup_s_ { uint8_t add_spec_emission_pcell_r10 = 1; }; - typedef setup_e types; + using types = setup_e; // choice methods add_spec_emission_ca_r10_c_() = default; @@ -8146,7 +8146,7 @@ struct phys_cfg_ded_s { std::string to_string() const; }; typedef enumerated setup_e_; - typedef setup_e types; + using types = setup_e; // choice methods ce_mode_r13_c_() = default; @@ -8179,7 +8179,7 @@ struct phys_cfg_ded_s { }; struct type_a_srs_tpc_pdcch_group_r14_c_ { using setup_l_ = dyn_array; - typedef setup_e types; + using types = setup_e; // choice methods type_a_srs_tpc_pdcch_group_r14_c_() = default; @@ -8235,7 +8235,7 @@ struct phys_cfg_ded_s { k_max_r14_e_ k_max_r14; p_a_must_r14_e_ p_a_must_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods must_cfg_r14_c_() = default; @@ -8327,7 +8327,7 @@ struct phys_cfg_ded_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods semi_static_cfi_cfg_r15_c_() = default; @@ -8430,7 +8430,7 @@ struct phys_cfg_ded_s { mcs_restrict_sf_pdsch_repeats_r15_e_ mcs_restrict_sf_pdsch_repeats_r15; mcs_restrict_slot_subslot_pdsch_repeats_r15_e_ mcs_restrict_slot_subslot_pdsch_repeats_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods blind_pdsch_repeat_cfg_r15_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/rr_common.h b/lib/include/srslte/asn1/rrc/rr_common.h index 200853cb5..708808ffd 100644 --- a/lib/include/srslte/asn1/rrc/rr_common.h +++ b/lib/include/srslte/asn1/rrc/rr_common.h @@ -650,7 +650,7 @@ struct delta_flist_spucch_r15_c { delta_f_subslot_spucch_tbcc_format4_r15_e_ delta_f_subslot_spucch_tbcc_format4_r15; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods delta_flist_spucch_r15_c() = default; @@ -1812,7 +1812,7 @@ struct srs_ul_cfg_common_c { srs_sf_cfg_e_ srs_sf_cfg; bool ack_nack_srs_simul_tx = false; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_ul_cfg_common_c() = default; diff --git a/lib/include/srslte/asn1/rrc/rr_ded.h b/lib/include/srslte/asn1/rrc/rr_ded.h index 618b3c0c7..ca8cd4b06 100644 --- a/lib/include/srslte/asn1/rrc/rr_ded.h +++ b/lib/include/srslte/asn1/rrc/rr_ded.h @@ -505,7 +505,7 @@ struct lc_ch_cfg_s { bool short_tti_r15 = false; bool sf_tti_r15 = false; }; - typedef setup_e types; + using types = setup_e; // choice methods allowed_tti_lens_r15_c_() = default; @@ -545,7 +545,7 @@ struct lc_ch_cfg_s { std::string to_string() const; }; typedef enumerated setup_e_; - typedef setup_e types; + using types = setup_e; // choice methods lc_ch_sr_restrict_r15_c_() = default; @@ -579,7 +579,7 @@ struct lc_ch_cfg_s { setup_e_ c; }; struct ch_access_prio_r15_c_ { - typedef setup_e types; + using types = setup_e; // choice methods ch_access_prio_r15_c_() = default; @@ -1069,7 +1069,7 @@ struct pdcp_cfg_s { uint32_t to_number() const; }; typedef enumerated setup_e_; - typedef setup_e types; + using types = setup_e; // choice methods ul_data_split_thres_r13_c_() = default; @@ -1193,7 +1193,7 @@ struct pdcp_cfg_s { status_pdu_periodicity_type2_r13_e_ status_pdu_periodicity_type2_r13; status_pdu_periodicity_offset_r13_e_ status_pdu_periodicity_offset_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods status_feedback_r13_c_() = default; @@ -1259,7 +1259,7 @@ struct pdcp_cfg_s { bool ul_lwa_drb_via_wlan_r14 = false; ul_lwa_data_split_thres_r14_e_ ul_lwa_data_split_thres_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods ul_lwa_cfg_r14_c_() = default; @@ -1378,7 +1378,7 @@ struct pdcp_cfg_s { // member variables pdcp_dupl_r15_e_ pdcp_dupl_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods pdcp_dupl_cfg_r15_c_() = default; @@ -1519,7 +1519,7 @@ struct rlc_bearer_cfg_r15_c { lc_ch_id_cfg_r15_c_ lc_ch_id_cfg_r15; lc_ch_cfg_s lc_ch_cfg_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods rlc_bearer_cfg_r15_c() = default; @@ -1690,7 +1690,7 @@ struct rlc_cfg_v1430_c { struct setup_s_ { poll_byte_r14_e poll_byte_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods rlc_cfg_v1430_c() = default; @@ -1737,7 +1737,7 @@ struct rlc_cfg_v1510_s { // RLC-Config-v1530 ::= CHOICE struct rlc_cfg_v1530_c { struct setup_s_ {}; - typedef setup_e types; + using types = setup_e; // choice methods rlc_cfg_v1530_c() = default; @@ -1841,7 +1841,7 @@ struct sps_cfg_ul_c { int8_t p0_nominal_pusch_persistent_sf_set2_r12 = -126; int8_t p0_ue_pusch_persistent_sf_set2_r12 = -8; }; - typedef setup_e types; + using types = setup_e; // choice methods p0_persistent_sf_set2_r12_c_() = default; @@ -1964,7 +1964,7 @@ struct sps_cfg_ul_c { bool operator==(const setup_s_& other) const; bool operator!=(const setup_s_& other) const { return not(*this == other); } }; - typedef setup_e types; + using types = setup_e; // choice methods sps_cfg_ul_c() = default; @@ -2044,7 +2044,7 @@ struct sps_cfg_ul_stti_r15_c { int8_t p0_nominal_spusch_persistent_sf_set2_r15 = -126; int8_t p0_ue_spusch_persistent_sf_set2_r15 = -8; }; - typedef setup_e types; + using types = setup_e; // choice methods p0_persistent_sf_set2_r15_c_() = default; @@ -2141,7 +2141,7 @@ struct sps_cfg_ul_stti_r15_c { total_num_pusch_sps_stti_ul_repeats_r15_e_ total_num_pusch_sps_stti_ul_repeats_r15; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods sps_cfg_ul_stti_r15_c() = default; @@ -2665,7 +2665,7 @@ struct drx_cfg_c { long_drx_cycle_start_offset_c_ long_drx_cycle_start_offset; short_drx_s_ short_drx; }; - typedef setup_e types; + using types = setup_e; // choice methods drx_cfg_c() = default; @@ -2983,7 +2983,7 @@ struct sps_cfg_dl_c { struct setup_s_ { n1_pucch_an_persistent_list_l n1_pucch_an_persistent_list_p1_r10; }; - typedef setup_e types; + using types = setup_e; // choice methods two_ant_port_activ_r10_c_() = default; @@ -3033,7 +3033,7 @@ struct sps_cfg_dl_c { bool operator==(const setup_s_& other) const; bool operator!=(const setup_s_& other) const { return not(*this == other); } }; - typedef setup_e types; + using types = setup_e; // choice methods sps_cfg_dl_c() = default; @@ -3100,7 +3100,7 @@ struct sps_cfg_dl_stti_r15_c { struct setup_s_ { n1_spucch_an_persistent_list_r15_l n1_spucch_an_persistent_list_p1_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods two_ant_port_activ_r15_c_() = default; @@ -3143,7 +3143,7 @@ struct sps_cfg_dl_stti_r15_c { tpc_pdcch_cfg_c tpc_pdcch_cfg_pucch_sps_r15; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods sps_cfg_dl_stti_r15_c() = default; @@ -3375,7 +3375,7 @@ struct mac_main_cfg_s { prohibit_phr_timer_e_ prohibit_phr_timer; dl_pathloss_change_e_ dl_pathloss_change; }; - typedef setup_e types; + using types = setup_e; // choice methods phr_cfg_c_() = default; @@ -3434,7 +3434,7 @@ struct mac_main_cfg_s { // member variables phr_mode_other_cg_r12_e_ phr_mode_other_cg_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods dual_connect_phr_c_() = default; @@ -3479,7 +3479,7 @@ struct mac_main_cfg_s { // member variables lc_ch_sr_prohibit_timer_r12_e_ lc_ch_sr_prohibit_timer_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods lc_ch_sr_cfg_r12_c_() = default; @@ -3569,7 +3569,7 @@ struct mac_main_cfg_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods edrx_cfg_cycle_start_offset_r13_c_() = default; @@ -3601,7 +3601,7 @@ struct mac_main_cfg_s { setup_c_ c; }; struct drx_cfg_r13_c_ { - typedef setup_e types; + using types = setup_e; // choice methods drx_cfg_r13_c_() = default; @@ -3637,7 +3637,7 @@ struct mac_main_cfg_s { bool skip_ul_tx_sps_r14_present = false; bool skip_ul_tx_dynamic_r14_present = false; }; - typedef setup_e types; + using types = setup_e; // choice methods skip_ul_tx_r14_c_() = default; @@ -3672,7 +3672,7 @@ struct mac_main_cfg_s { struct setup_s_ { data_inactivity_timer_r14_e data_inactivity_timer_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods data_inactivity_timer_cfg_r14_c_() = default; @@ -3748,7 +3748,7 @@ struct mac_main_cfg_s { proc_timeline_r15_e_ proc_timeline_r15; uint8_t ssr_prohibit_timer_r15 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods short_tti_and_spt_r15_c_() = default; @@ -3822,7 +3822,7 @@ struct mac_main_cfg_s { scell_hibernation_timer_r15_e_ scell_hibernation_timer_r15; dormant_scell_deactivation_timer_r15_e_ dormant_scell_deactivation_timer_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods dormant_state_timers_r15_c_() = default; @@ -3904,7 +3904,7 @@ struct mac_main_cfg_s { // MeasSubframePatternPCell-r10 ::= CHOICE struct meas_sf_pattern_pcell_r10_c { - typedef setup_e types; + using types = setup_e; // choice methods meas_sf_pattern_pcell_r10_c() = default; @@ -3946,7 +3946,7 @@ struct naics_assist_info_r12_c { neigh_cells_to_add_mod_list_r12_l neigh_cells_to_add_mod_list_r12; p_a_e serv_cellp_a_r12; }; - typedef setup_e types; + using types = setup_e; // choice methods naics_assist_info_r12_c() = default; @@ -3982,7 +3982,7 @@ private: // NeighCellsCRS-Info-r11 ::= CHOICE struct neigh_cells_crs_info_r11_c { - typedef setup_e types; + using types = setup_e; // choice methods neigh_cells_crs_info_r11_c() = default; @@ -4016,7 +4016,7 @@ private: // NeighCellsCRS-Info-r13 ::= CHOICE struct neigh_cells_crs_info_r13_c { - typedef setup_e types; + using types = setup_e; // choice methods neigh_cells_crs_info_r13_c() = default; @@ -4052,7 +4052,7 @@ private: // NeighCellsCRS-Info-r15 ::= CHOICE struct neigh_cells_crs_info_r15_c { - typedef setup_e types; + using types = setup_e; // choice methods neigh_cells_crs_info_r15_c() = default; @@ -4119,7 +4119,7 @@ struct rlf_timers_and_consts_r13_c { SRSASN_CODE unpack(cbit_ref& bref); void to_json(json_writer& j) const; }; - typedef setup_e types; + using types = setup_e; // choice methods rlf_timers_and_consts_r13_c() = default; @@ -4204,7 +4204,7 @@ struct rlf_timers_and_consts_r9_c { n311_r9_e_ n311_r9; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods rlf_timers_and_consts_r9_c() = default; @@ -4397,7 +4397,7 @@ struct rr_cfg_ded_s { types type_; crs_intf_mitig_num_prbs_e_ c; }; - typedef setup_e types; + using types = setup_e; // choice methods crs_intf_mitig_cfg_r15_c_() = default; @@ -4496,7 +4496,7 @@ struct pdcch_candidate_reductions_laa_ul_r14_c { pdcch_candidate_reduction_value_r14_e pdcch_candidate_reduction_al4_r14; pdcch_candidate_reduction_value_r14_e pdcch_candidate_reduction_al5_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods pdcch_candidate_reductions_laa_ul_r14_c() = default; @@ -4607,7 +4607,7 @@ struct aul_cfg_r15_c { uint8_t sf_offset_cot_sharing_r15 = 2; contention_win_size_timer_r15_e_ contention_win_size_timer_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods aul_cfg_r15_c() = default; @@ -4649,7 +4649,7 @@ struct cqi_report_periodic_scell_r15_c { meas_sf_pattern_r10_c csi_meas_sf_set1_r15; meas_sf_pattern_r10_c csi_meas_sf_set2_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods csi_sf_pattern_dormant_r15_c_() = default; @@ -4778,7 +4778,7 @@ struct cqi_report_periodic_scell_r15_c { csi_sf_pattern_dormant_r15_c_ csi_sf_pattern_dormant_r15; cqi_format_ind_dormant_r15_c_ cqi_format_ind_dormant_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods cqi_report_periodic_scell_r15_c() = default; @@ -4948,7 +4948,7 @@ struct srs_ul_cfg_ded_aperiodic_v1430_c { bool srs_sf_ind_r14_present = false; uint8_t srs_sf_ind_r14 = 1; }; - typedef setup_e types; + using types = setup_e; // choice methods srs_ul_cfg_ded_aperiodic_v1430_c() = default; @@ -5121,7 +5121,7 @@ struct cqi_short_cfg_scell_r15_c { uint16_t ri_cfg_idx_short_r15 = 0; cqi_format_ind_short_r15_c_ cqi_format_ind_short_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods cqi_short_cfg_scell_r15_c() = default; @@ -5344,7 +5344,7 @@ struct laa_scell_cfg_v1430_s { struct setup_s_ { cross_carrier_sched_cfg_laa_ul_r14_s cross_carrier_sched_cfg_laa_ul_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods cross_carrier_sched_cfg_ul_r14_c_() = default; @@ -5439,7 +5439,7 @@ struct pdsch_cfg_ded_scell_v1430_s { // PUCCH-ConfigDedicated-v1370 ::= SEQUENCE struct pucch_cfg_ded_v1370_s { struct pucch_format_v1370_c_ { - typedef setup_e types; + using types = setup_e; // choice methods pucch_format_v1370_c_() = default; @@ -5516,7 +5516,7 @@ struct pusch_cfg_ded_scell_v1530_s { struct setup_s_ { uint8_t beta_offset_aul_r15 = 0; }; - typedef setup_e types; + using types = setup_e; // choice methods uci_on_pusch_r15_c_() = default; @@ -5580,7 +5580,7 @@ struct sched_request_cfg_scell_r13_c { uint8_t sr_cfg_idx_r13 = 0; dsr_trans_max_r13_e_ dsr_trans_max_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods sched_request_cfg_scell_r13_c() = default; @@ -5653,7 +5653,7 @@ struct tpc_pdcch_cfg_scell_r13_c { struct setup_s_ { tpc_idx_c tpc_idx_pucch_scell_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods tpc_pdcch_cfg_scell_r13_c() = default; @@ -5809,7 +5809,7 @@ struct phys_cfg_ded_scell_r10_s { pusch_cfg_ded_r13_s pusch_cfg_ded_r13; ul_pwr_ctrl_ded_scell_v1310_s ul_pwr_ctrl_ded_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods pucch_scell_c_() = default; @@ -5871,7 +5871,7 @@ struct phys_cfg_ded_scell_r10_s { k_max_r14_e_ k_max_r14; p_a_must_r14_e_ p_a_must_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods must_cfg_r14_c_() = default; @@ -5963,7 +5963,7 @@ struct phys_cfg_ded_scell_r10_s { void destroy_(); }; - typedef setup_e types; + using types = setup_e; // choice methods semi_static_cfi_cfg_r15_c_() = default; @@ -6068,7 +6068,7 @@ struct phys_cfg_ded_scell_r10_s { mcs_restrict_sf_pdsch_repeats_r15_e_ mcs_restrict_sf_pdsch_repeats_r15; mcs_restrict_slot_subslot_pdsch_repeats_r15_e_ mcs_restrict_slot_subslot_pdsch_repeats_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods blind_pdsch_repeat_cfg_r15_c_() = default; @@ -6192,7 +6192,7 @@ struct phys_cfg_ded_scell_v1370_s { bool pucch_cfg_ded_v1370_present = false; pucch_cfg_ded_v1370_s pucch_cfg_ded_v1370; }; - typedef setup_e types; + using types = setup_e; // choice methods pucch_scell_v1370_c_() = default; @@ -6325,7 +6325,7 @@ struct pucch_cfg_ded_v13c0_s { // member variables n1_pucch_an_cs_list_p1_v13c0_l_ n1_pucch_an_cs_list_p1_v13c0; }; - typedef setup_e types; + using types = setup_e; // choice methods n1_pucch_an_cs_v13c0_c_() = default; @@ -6512,7 +6512,7 @@ struct rlf_timers_and_consts_scg_r12_c { n314_r12_e_ n314_r12; // ... }; - typedef setup_e types; + using types = setup_e; // choice methods rlf_timers_and_consts_scg_r12_c() = default; @@ -6664,7 +6664,7 @@ struct phys_cfg_ded_scell_v13c0_s { struct setup_s_ { pucch_cfg_ded_v13c0_s pucch_cfg_ded_v13c0; }; - typedef setup_e types; + using types = setup_e; // choice methods pucch_scell_v13c0_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/security.h b/lib/include/srslte/asn1/rrc/security.h index 831ea1295..a01ab04bb 100644 --- a/lib/include/srslte/asn1/rrc/security.h +++ b/lib/include/srslte/asn1/rrc/security.h @@ -308,7 +308,7 @@ struct security_mode_cmd_s { types type_; security_mode_cmd_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/uecap.h b/lib/include/srslte/asn1/rrc/uecap.h index 3b66bd2ab..fc1cdecf6 100644 --- a/lib/include/srslte/asn1/rrc/uecap.h +++ b/lib/include/srslte/asn1/rrc/uecap.h @@ -233,7 +233,7 @@ struct ue_cap_enquiry_s { types type_; ue_cap_enquiry_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -414,7 +414,7 @@ struct ue_cap_info_s { types type_; ue_cap_info_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -652,10 +652,10 @@ struct ca_mimo_params_dl_r13_s { }; // BandParametersDL-r13 ::= CA-MIMO-ParametersDL-r13 -typedef ca_mimo_params_dl_r13_s band_params_dl_r13_s; +using band_params_dl_r13_s = ca_mimo_params_dl_r13_s; // BandParametersUL-r13 ::= CA-MIMO-ParametersUL-r10 -typedef ca_mimo_params_ul_r10_s band_params_ul_r13_s; +using band_params_ul_r13_s = ca_mimo_params_ul_r10_s; // BandParameters-r13 ::= SEQUENCE struct band_params_r13_s { @@ -5757,7 +5757,7 @@ struct ue_radio_access_cap_info_s { types type_; ue_radio_access_cap_info_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; diff --git a/lib/include/srslte/asn1/rrc/ul_dcch_msg.h b/lib/include/srslte/asn1/rrc/ul_dcch_msg.h index 5cb9f3ad3..1665cc69e 100644 --- a/lib/include/srslte/asn1/rrc/ul_dcch_msg.h +++ b/lib/include/srslte/asn1/rrc/ul_dcch_msg.h @@ -593,7 +593,7 @@ struct mrdc_assist_info_r15_s { }; // MobilityHistoryReport-r12 ::= VisitedCellInfoList-r12 -typedef visited_cell_info_list_r12_l mob_history_report_r12_l; +using mob_history_report_r12_l = visited_cell_info_list_r12_l; // RRCConnectionReconfigurationComplete-v1430-IEs ::= SEQUENCE struct rrc_conn_recfg_complete_v1430_ies_s { @@ -3539,7 +3539,7 @@ struct in_dev_coex_ind_r11_s { types type_; in_dev_coex_ind_r11_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -3622,7 +3622,7 @@ struct inter_freq_rstd_meas_ind_r10_s { types type_; inter_freq_rstd_meas_ind_r10_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -3705,7 +3705,7 @@ struct mbms_count_resp_r10_s { types type_; mbms_count_resp_r10_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -3788,7 +3788,7 @@ struct mbms_interest_ind_r11_s { types type_; mbms_interest_ind_r11_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -3920,7 +3920,7 @@ struct proximity_ind_r9_s { types type_; proximity_ind_r9_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4003,7 +4003,7 @@ struct rn_recfg_complete_r10_s { types type_; rn_recfg_complete_r10_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4237,7 +4237,7 @@ struct rrc_conn_setup_complete_s { types type_; rrc_conn_setup_complete_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4321,7 +4321,7 @@ struct scg_fail_info_r12_s { types type_; scg_fail_info_r12_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4404,7 +4404,7 @@ struct scg_fail_info_nr_r15_s { types type_; scg_fail_info_nr_r15_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4487,7 +4487,7 @@ struct sidelink_ue_info_r12_s { types type_; sidelink_ue_info_r12_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4570,7 +4570,7 @@ struct ueassist_info_r11_s { types type_; ueassist_info_r11_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4653,7 +4653,7 @@ struct ue_info_resp_r9_s { types type_; ue_info_resp_r9_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4737,7 +4737,7 @@ struct ul_ho_prep_transfer_s { types type_; ul_ho_prep_transfer_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4820,7 +4820,7 @@ struct ul_info_transfer_s { types type_; ul_info_transfer_r8_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4903,7 +4903,7 @@ struct ul_info_transfer_mrdc_r15_s { types type_; ul_info_transfer_mrdc_r15_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -4986,7 +4986,7 @@ struct wlan_conn_status_report_r13_s { types type_; wlan_conn_status_report_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; diff --git a/lib/include/srslte/asn1/rrc_nbiot.h b/lib/include/srslte/asn1/rrc_nbiot.h index a8f8a4009..de1d82d09 100644 --- a/lib/include/srslte/asn1/rrc_nbiot.h +++ b/lib/include/srslte/asn1/rrc_nbiot.h @@ -905,7 +905,7 @@ struct drx_cfg_nb_r13_c { uint16_t drx_start_offset_r13 = 0; drx_ul_retx_timer_r13_e_ drx_ul_retx_timer_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods drx_cfg_nb_r13_c() = default; @@ -1065,7 +1065,7 @@ struct sr_sps_bsr_cfg_nb_r15_c { fixed_bitstring<16> semi_persist_sched_c_rnti_r15; semi_persist_sched_interv_ul_r15_e_ semi_persist_sched_interv_ul_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods sr_sps_bsr_cfg_nb_r15_c() = default; @@ -1105,7 +1105,7 @@ struct sr_without_harq_ack_cfg_nb_r15_c { uint8_t sr_prohibit_timer_r15 = 0; sr_nprach_res_nb_r15_s sr_nprach_res_r15; }; - typedef setup_e types; + using types = setup_e; // choice methods sr_without_harq_ack_cfg_nb_r15_c() = default; @@ -1267,7 +1267,7 @@ struct mac_main_cfg_nb_r13_s { // member variables lc_ch_sr_prohibit_timer_r13_e_ lc_ch_sr_prohibit_timer_r13; }; - typedef setup_e types; + using types = setup_e; // choice methods lc_ch_sr_cfg_r13_c_() = default; @@ -1302,7 +1302,7 @@ struct mac_main_cfg_nb_r13_s { struct setup_s_ { data_inactivity_timer_r14_e data_inactivity_timer_r14; }; - typedef setup_e types; + using types = setup_e; // choice methods data_inactivity_timer_cfg_r14_c_() = default; @@ -1484,7 +1484,7 @@ struct rlf_timers_and_consts_nb_r13_c { SRSASN_CODE unpack(cbit_ref& bref); void to_json(json_writer& j) const; }; - typedef setup_e types; + using types = setup_e; // choice methods rlf_timers_and_consts_nb_r13_c() = default; @@ -1819,7 +1819,7 @@ struct mib_nb_s { }; // BCCH-BCH-MessageType-NB ::= MasterInformationBlock-NB -typedef mib_nb_s bcch_bch_msg_type_nb_s; +using bcch_bch_msg_type_nb_s = mib_nb_s; // BCCH-BCH-Message-NB ::= SEQUENCE struct bcch_bch_msg_nb_s { @@ -2192,7 +2192,7 @@ struct mib_tdd_nb_r15_s { }; // BCCH-BCH-MessageType-TDD-NB-r15 ::= MasterInformationBlock-TDD-NB-r15 -typedef mib_tdd_nb_r15_s bcch_bch_msg_type_tdd_nb_r15_s; +using bcch_bch_msg_type_tdd_nb_r15_s = mib_tdd_nb_r15_s; // BCCH-BCH-Message-TDD-NB ::= SEQUENCE struct bcch_bch_msg_tdd_nb_s { @@ -5758,7 +5758,7 @@ struct rrc_early_data_complete_nb_v1590_ies_s { }; // RedirectedCarrierInfo-NB-r13 ::= CarrierFreq-NB-r13 -typedef carrier_freq_nb_r13_s redirected_carrier_info_nb_r13_s; +using redirected_carrier_info_nb_r13_s = carrier_freq_nb_r13_s; // RedirectedCarrierInfo-NB-v1430 ::= SEQUENCE struct redirected_carrier_info_nb_v1430_s { @@ -5908,7 +5908,7 @@ struct rrc_conn_reest_nb_s { types type_; rrc_conn_reest_nb_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -5990,7 +5990,7 @@ struct rrc_conn_reject_nb_s { types type_; rrc_conn_reject_nb_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -6071,7 +6071,7 @@ struct rrc_conn_setup_nb_s { types type_; rrc_conn_setup_nb_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -6344,7 +6344,7 @@ struct rrc_conn_release_nb_v15b0_ies_s { }; // RedirectedCarrierInfo-NB-v1550 ::= CarrierFreq-NB-v1550 -typedef carrier_freq_nb_v1550_s redirected_carrier_info_nb_v1550_s; +using redirected_carrier_info_nb_v1550_s = carrier_freq_nb_v1550_s; // RRCConnectionRelease-NB-v1550-IEs ::= SEQUENCE struct rrc_conn_release_nb_v1550_ies_s { @@ -6517,7 +6517,7 @@ struct dl_info_transfer_nb_s { types type_; dl_info_transfer_nb_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -6599,7 +6599,7 @@ struct rrc_conn_recfg_nb_s { types type_; rrc_conn_recfg_nb_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -6681,7 +6681,7 @@ struct rrc_conn_release_nb_s { types type_; rrc_conn_release_nb_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -6763,7 +6763,7 @@ struct rrc_conn_resume_nb_s { types type_; rrc_conn_resume_nb_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -6845,7 +6845,7 @@ struct ue_cap_enquiry_nb_s { types type_; ue_cap_enquiry_nb_r13_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -7339,7 +7339,7 @@ struct ho_prep_info_nb_s { types type_; ho_prep_info_nb_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -9101,7 +9101,7 @@ struct ue_paging_coverage_info_nb_s { types type_; ue_paging_coverage_info_nb_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -9221,7 +9221,7 @@ struct ue_radio_access_cap_info_nb_s { types type_; ue_radio_access_cap_info_nb_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; @@ -9315,7 +9315,7 @@ struct ue_radio_paging_info_nb_s { types type_; ue_radio_paging_info_nb_ies_s c; }; - typedef c1_or_crit_ext_e types; + using types = c1_or_crit_ext_e; // choice methods crit_exts_c_() = default; diff --git a/lib/include/srslte/asn1/rrc_nr.h b/lib/include/srslte/asn1/rrc_nr.h index 54a1e7133..4993276c5 100644 --- a/lib/include/srslte/asn1/rrc_nr.h +++ b/lib/include/srslte/asn1/rrc_nr.h @@ -2949,7 +2949,7 @@ struct plmn_id_info_s { }; // RangeToBestCell ::= Q-OffsetRange -typedef q_offset_range_e range_to_best_cell_e; +using range_to_best_cell_e = q_offset_range_e; // SI-RequestResources ::= SEQUENCE struct si_request_res_s { diff --git a/lib/include/srslte/asn1/s1ap.h b/lib/include/srslte/asn1/s1ap.h index bfb058965..c3f501f1e 100644 --- a/lib/include/srslte/asn1/s1ap.h +++ b/lib/include/srslte/asn1/s1ap.h @@ -606,13 +606,13 @@ struct s1ap_protocol_ext_empty_o { static presence_e get_presence(const uint32_t& id); }; // GUMMEI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o gummei_ext_ies_o; +using gummei_ext_ies_o = s1ap_protocol_ext_empty_o; // PLMNidentity ::= OCTET STRING -typedef fixed_octstring<3, true> plm_nid; +using plm_nid = fixed_octstring<3, true>; // Additional-GUTI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o add_guti_ext_ies_o; +using add_guti_ext_ies_o = s1ap_protocol_ext_empty_o; template struct protocol_ext_container_item_s { @@ -636,7 +636,7 @@ struct protocol_ext_container_empty_l { SRSASN_CODE unpack(cbit_ref& bref); void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l gummei_ext_ies_container; +using gummei_ext_ies_container = protocol_ext_container_empty_l; // GUMMEI ::= SEQUENCE struct gummei_s { @@ -654,7 +654,7 @@ struct gummei_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l add_guti_ext_ies_container; +using add_guti_ext_ies_container = protocol_ext_container_empty_l; // Additional-GUTI ::= SEQUENCE struct add_guti_s { @@ -672,7 +672,7 @@ struct add_guti_s { }; // AllocationAndRetentionPriority-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o alloc_and_retention_prio_ext_ies_o; +using alloc_and_retention_prio_ext_ies_o = s1ap_protocol_ext_empty_o; // Pre-emptionCapability ::= ENUMERATED struct pre_emption_cap_opts { @@ -690,7 +690,7 @@ struct pre_emption_vulnerability_opts { }; typedef enumerated pre_emption_vulnerability_e; -typedef protocol_ext_container_empty_l alloc_and_retention_prio_ext_ies_container; +using alloc_and_retention_prio_ext_ies_container = protocol_ext_container_empty_l; // AllocationAndRetentionPriority ::= SEQUENCE struct alloc_and_retention_prio_s { @@ -709,12 +709,12 @@ struct alloc_and_retention_prio_s { }; // EUTRAN-CGI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o eutran_cgi_ext_ies_o; +using eutran_cgi_ext_ies_o = s1ap_protocol_ext_empty_o; // TAI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o tai_ext_ies_o; +using tai_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l eutran_cgi_ext_ies_container; +using eutran_cgi_ext_ies_container = protocol_ext_container_empty_l; // EUTRAN-CGI ::= SEQUENCE struct eutran_cgi_s { @@ -731,7 +731,7 @@ struct eutran_cgi_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l tai_ext_ies_container; +using tai_ext_ies_container = protocol_ext_container_empty_l; // TAI ::= SEQUENCE struct tai_s { @@ -749,16 +749,16 @@ struct tai_s { }; // CellBasedMDT-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cell_based_mdt_ext_ies_o; +using cell_based_mdt_ext_ies_o = s1ap_protocol_ext_empty_o; // CellIdListforMDT ::= SEQUENCE (SIZE (1..32)) OF EUTRAN-CGI using cell_id_listfor_mdt_l = dyn_array; // TABasedMDT-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ta_based_mdt_ext_ies_o; +using ta_based_mdt_ext_ies_o = s1ap_protocol_ext_empty_o; // TAIBasedMDT-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o tai_based_mdt_ext_ies_o; +using tai_based_mdt_ext_ies_o = s1ap_protocol_ext_empty_o; // TAIListforMDT ::= SEQUENCE (SIZE (1..8)) OF TAI using tai_listfor_mdt_l = dyn_array; @@ -766,7 +766,7 @@ using tai_listfor_mdt_l = dyn_array; // TAListforMDT ::= SEQUENCE (SIZE (1..8)) OF OCTET STRING (SIZE (2)) using ta_listfor_mdt_l = bounded_array, 8>; -typedef protocol_ext_container_empty_l cell_based_mdt_ext_ies_container; +using cell_based_mdt_ext_ies_container = protocol_ext_container_empty_l; // CellBasedMDT ::= SEQUENCE struct cell_based_mdt_s { @@ -782,7 +782,7 @@ struct cell_based_mdt_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l ta_based_mdt_ext_ies_container; +using ta_based_mdt_ext_ies_container = protocol_ext_container_empty_l; // TABasedMDT ::= SEQUENCE struct ta_based_mdt_s { @@ -798,7 +798,7 @@ struct ta_based_mdt_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l tai_based_mdt_ext_ies_container; +using tai_based_mdt_ext_ies_container = protocol_ext_container_empty_l; // TAIBasedMDT ::= SEQUENCE struct tai_based_mdt_s { @@ -889,22 +889,22 @@ private: }; // CellBasedQMC-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cell_based_qmc_ext_ies_o; +using cell_based_qmc_ext_ies_o = s1ap_protocol_ext_empty_o; // CellIdListforQMC ::= SEQUENCE (SIZE (1..32)) OF EUTRAN-CGI using cell_id_listfor_qmc_l = dyn_array; // PLMNAreaBasedQMC-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o plmn_area_based_qmc_ext_ies_o; +using plmn_area_based_qmc_ext_ies_o = s1ap_protocol_ext_empty_o; // PLMNListforQMC ::= SEQUENCE (SIZE (1..16)) OF OCTET STRING (SIZE (3)) using plmn_listfor_qmc_l = bounded_array, 16>; // TABasedQMC-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ta_based_qmc_ext_ies_o; +using ta_based_qmc_ext_ies_o = s1ap_protocol_ext_empty_o; // TAIBasedQMC-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o tai_based_qmc_ext_ies_o; +using tai_based_qmc_ext_ies_o = s1ap_protocol_ext_empty_o; // TAIListforQMC ::= SEQUENCE (SIZE (1..8)) OF TAI using tai_listfor_qmc_l = dyn_array; @@ -912,7 +912,7 @@ using tai_listfor_qmc_l = dyn_array; // TAListforQMC ::= SEQUENCE (SIZE (1..8)) OF OCTET STRING (SIZE (2)) using ta_listfor_qmc_l = bounded_array, 8>; -typedef protocol_ext_container_empty_l cell_based_qmc_ext_ies_container; +using cell_based_qmc_ext_ies_container = protocol_ext_container_empty_l; // CellBasedQMC ::= SEQUENCE struct cell_based_qmc_s { @@ -928,7 +928,7 @@ struct cell_based_qmc_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l plmn_area_based_qmc_ext_ies_container; +using plmn_area_based_qmc_ext_ies_container = protocol_ext_container_empty_l; // PLMNAreaBasedQMC ::= SEQUENCE struct plmn_area_based_qmc_s { @@ -944,7 +944,7 @@ struct plmn_area_based_qmc_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l ta_based_qmc_ext_ies_container; +using ta_based_qmc_ext_ies_container = protocol_ext_container_empty_l; // TABasedQMC ::= SEQUENCE struct ta_based_qmc_s { @@ -960,7 +960,7 @@ struct ta_based_qmc_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l tai_based_qmc_ext_ies_container; +using tai_based_qmc_ext_ies_container = protocol_ext_container_empty_l; // TAIBasedQMC ::= SEQUENCE struct tai_based_qmc_s { @@ -1065,9 +1065,9 @@ private: }; // CellIdentifierAndCELevelForCECapableUEs-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cell_id_and_ce_level_for_ce_capable_ues_ext_ies_o; +using cell_id_and_ce_level_for_ce_capable_ues_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l cell_id_and_ce_level_for_ce_capable_ues_ext_ies_container; +using cell_id_and_ce_level_for_ce_capable_ues_ext_ies_container = protocol_ext_container_empty_l; // CellIdentifierAndCELevelForCECapableUEs ::= SEQUENCE struct cell_id_and_ce_level_for_ce_capable_ues_s { @@ -1085,9 +1085,9 @@ struct cell_id_and_ce_level_for_ce_capable_ues_s { }; // InformationForCECapableUEs-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o info_for_ce_capable_ues_ext_ies_o; +using info_for_ce_capable_ues_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l info_for_ce_capable_ues_ext_ies_container; +using info_for_ce_capable_ues_ext_ies_container = protocol_ext_container_empty_l; // AssistanceDataForCECapableUEs ::= SEQUENCE struct assist_data_for_ce_capable_ues_s { @@ -1104,9 +1104,9 @@ struct assist_data_for_ce_capable_ues_s { }; // RecommendedCellsForPagingItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o recommended_cells_for_paging_item_ext_ies_o; +using recommended_cells_for_paging_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l recommended_cells_for_paging_item_ext_ies_container; +using recommended_cells_for_paging_item_ext_ies_container = protocol_ext_container_empty_l; // RecommendedCellItem ::= SEQUENCE struct recommended_cell_item_s { @@ -1160,10 +1160,10 @@ struct recommended_cell_item_ies_o { using recommended_cell_list_l = bounded_array, 16>; // RecommendedCellsForPaging-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o recommended_cells_for_paging_ext_ies_o; +using recommended_cells_for_paging_ext_ies_o = s1ap_protocol_ext_empty_o; // AssistanceDataForRecommendedCells-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o assist_data_for_recommended_cells_ext_ies_o; +using assist_data_for_recommended_cells_ext_ies_o = s1ap_protocol_ext_empty_o; // NextPagingAreaScope ::= ENUMERATED struct next_paging_area_scope_opts { @@ -1174,9 +1174,9 @@ struct next_paging_area_scope_opts { typedef enumerated next_paging_area_scope_e; // PagingAttemptInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o paging_attempt_info_ext_ies_o; +using paging_attempt_info_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l recommended_cells_for_paging_ext_ies_container; +using recommended_cells_for_paging_ext_ies_container = protocol_ext_container_empty_l; // RecommendedCellsForPaging ::= SEQUENCE struct recommended_cells_for_paging_s { @@ -1193,9 +1193,9 @@ struct recommended_cells_for_paging_s { }; // AssistanceDataForPaging-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o assist_data_for_paging_ext_ies_o; +using assist_data_for_paging_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l assist_data_for_recommended_cells_ext_ies_container; +using assist_data_for_recommended_cells_ext_ies_container = protocol_ext_container_empty_l; // AssistanceDataForRecommendedCells ::= SEQUENCE struct assist_data_for_recommended_cells_s { @@ -1211,7 +1211,7 @@ struct assist_data_for_recommended_cells_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l paging_attempt_info_ext_ies_container; +using paging_attempt_info_ext_ies_container = protocol_ext_container_empty_l; // PagingAttemptInformation ::= SEQUENCE struct paging_attempt_info_s { @@ -1230,7 +1230,7 @@ struct paging_attempt_info_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l assist_data_for_paging_ext_ies_container; +using assist_data_for_paging_ext_ies_container = protocol_ext_container_empty_l; // AssistanceDataForPaging ::= SEQUENCE struct assist_data_for_paging_s { @@ -1255,12 +1255,12 @@ struct assist_data_for_paging_s { using bplmns_l = bounded_array, 6>; // COUNTValueExtended-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o count_value_extended_ext_ies_o; +using count_value_extended_ext_ies_o = s1ap_protocol_ext_empty_o; // COUNTvaluePDCP-SNlength18-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o coun_tvalue_pdcp_snlen18_ext_ies_o; +using coun_tvalue_pdcp_snlen18_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l count_value_extended_ext_ies_container; +using count_value_extended_ext_ies_container = protocol_ext_container_empty_l; // COUNTValueExtended ::= SEQUENCE struct count_value_extended_s { @@ -1278,9 +1278,9 @@ struct count_value_extended_s { }; // COUNTvalue-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o coun_tvalue_ext_ies_o; +using coun_tvalue_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l coun_tvalue_pdcp_snlen18_ext_ies_container; +using coun_tvalue_pdcp_snlen18_ext_ies_container = protocol_ext_container_empty_l; // COUNTvaluePDCP-SNlength18 ::= SEQUENCE struct coun_tvalue_pdcp_snlen18_s { @@ -1359,7 +1359,7 @@ struct bearers_subject_to_status_transfer_item_ext_ies_o { static presence_e get_presence(const uint32_t& id); }; -typedef protocol_ext_container_empty_l coun_tvalue_ext_ies_container; +using coun_tvalue_ext_ies_container = protocol_ext_container_empty_l; // COUNTvalue ::= SEQUENCE struct coun_tvalue_s { @@ -1468,9 +1468,9 @@ struct bluetooth_meas_cfg_opts { typedef enumerated bluetooth_meas_cfg_e; // BluetoothMeasurementConfiguration-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o bluetooth_meas_cfg_ext_ies_o; +using bluetooth_meas_cfg_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l bluetooth_meas_cfg_ext_ies_container; +using bluetooth_meas_cfg_ext_ies_container = protocol_ext_container_empty_l; // BluetoothMeasurementConfiguration ::= SEQUENCE struct bluetooth_meas_cfg_s { @@ -1499,12 +1499,12 @@ struct bluetooth_meas_cfg_s { }; // CancelledCellinEAI-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cancelled_cellin_eai_item_ext_ies_o; +using cancelled_cellin_eai_item_ext_ies_o = s1ap_protocol_ext_empty_o; // CancelledCellinTAI-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cancelled_cellin_tai_item_ext_ies_o; +using cancelled_cellin_tai_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l cancelled_cellin_eai_item_ext_ies_container; +using cancelled_cellin_eai_item_ext_ies_container = protocol_ext_container_empty_l; // CancelledCellinEAI-Item ::= SEQUENCE struct cancelled_cellin_eai_item_s { @@ -1521,7 +1521,7 @@ struct cancelled_cellin_eai_item_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l cancelled_cellin_tai_item_ext_ies_container; +using cancelled_cellin_tai_item_ext_ies_container = protocol_ext_container_empty_l; // CancelledCellinTAI-Item ::= SEQUENCE struct cancelled_cellin_tai_item_s { @@ -1545,15 +1545,15 @@ using cancelled_cellin_eai_l = dyn_array; using cancelled_cellin_tai_l = dyn_array; // CellID-Cancelled-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cell_id_cancelled_item_ext_ies_o; +using cell_id_cancelled_item_ext_ies_o = s1ap_protocol_ext_empty_o; // EmergencyAreaID-Cancelled-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o emergency_area_id_cancelled_item_ext_ies_o; +using emergency_area_id_cancelled_item_ext_ies_o = s1ap_protocol_ext_empty_o; // TAI-Cancelled-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o tai_cancelled_item_ext_ies_o; +using tai_cancelled_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l cell_id_cancelled_item_ext_ies_container; +using cell_id_cancelled_item_ext_ies_container = protocol_ext_container_empty_l; // CellID-Cancelled-Item ::= SEQUENCE struct cell_id_cancelled_item_s { @@ -1570,7 +1570,7 @@ struct cell_id_cancelled_item_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l emergency_area_id_cancelled_item_ext_ies_container; +using emergency_area_id_cancelled_item_ext_ies_container = protocol_ext_container_empty_l; // EmergencyAreaID-Cancelled-Item ::= SEQUENCE struct emergency_area_id_cancelled_item_s { @@ -1587,7 +1587,7 @@ struct emergency_area_id_cancelled_item_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l tai_cancelled_item_ext_ies_container; +using tai_cancelled_item_ext_ies_container = protocol_ext_container_empty_l; // TAI-Cancelled-Item ::= SEQUENCE struct tai_cancelled_item_s { @@ -1687,12 +1687,12 @@ private: }; // CompletedCellinEAI-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o completed_cellin_eai_item_ext_ies_o; +using completed_cellin_eai_item_ext_ies_o = s1ap_protocol_ext_empty_o; // CompletedCellinTAI-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o completed_cellin_tai_item_ext_ies_o; +using completed_cellin_tai_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l completed_cellin_eai_item_ext_ies_container; +using completed_cellin_eai_item_ext_ies_container = protocol_ext_container_empty_l; // CompletedCellinEAI-Item ::= SEQUENCE struct completed_cellin_eai_item_s { @@ -1708,7 +1708,7 @@ struct completed_cellin_eai_item_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l completed_cellin_tai_item_ext_ies_container; +using completed_cellin_tai_item_ext_ies_container = protocol_ext_container_empty_l; // CompletedCellinTAI-Item ::= SEQUENCE struct completed_cellin_tai_item_s { @@ -1725,7 +1725,7 @@ struct completed_cellin_tai_item_s { }; // CellID-Broadcast-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cell_id_broadcast_item_ext_ies_o; +using cell_id_broadcast_item_ext_ies_o = s1ap_protocol_ext_empty_o; // CompletedCellinEAI ::= SEQUENCE (SIZE (1..65535)) OF CompletedCellinEAI-Item using completed_cellin_eai_l = dyn_array; @@ -1734,12 +1734,12 @@ using completed_cellin_eai_l = dyn_array; using completed_cellin_tai_l = dyn_array; // EmergencyAreaID-Broadcast-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o emergency_area_id_broadcast_item_ext_ies_o; +using emergency_area_id_broadcast_item_ext_ies_o = s1ap_protocol_ext_empty_o; // TAI-Broadcast-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o tai_broadcast_item_ext_ies_o; +using tai_broadcast_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l cell_id_broadcast_item_ext_ies_container; +using cell_id_broadcast_item_ext_ies_container = protocol_ext_container_empty_l; // CellID-Broadcast-Item ::= SEQUENCE struct cell_id_broadcast_item_s { @@ -1755,7 +1755,7 @@ struct cell_id_broadcast_item_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l emergency_area_id_broadcast_item_ext_ies_container; +using emergency_area_id_broadcast_item_ext_ies_container = protocol_ext_container_empty_l; // EmergencyAreaID-Broadcast-Item ::= SEQUENCE struct emergency_area_id_broadcast_item_s { @@ -1772,7 +1772,7 @@ struct emergency_area_id_broadcast_item_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l tai_broadcast_item_ext_ies_container; +using tai_broadcast_item_ext_ies_container = protocol_ext_container_empty_l; // TAI-Broadcast-Item ::= SEQUENCE struct tai_broadcast_item_s { @@ -1872,9 +1872,9 @@ private: }; // CGI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cgi_ext_ies_o; +using cgi_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l cgi_ext_ies_container; +using cgi_ext_ies_container = protocol_ext_container_empty_l; // CGI ::= SEQUENCE struct cgi_s { @@ -1905,9 +1905,9 @@ struct cn_type_opts { typedef enumerated cn_type_e; // CNTypeRestrictions-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cn_type_restricts_item_ext_ies_o; +using cn_type_restricts_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l cn_type_restricts_item_ext_ies_container; +using cn_type_restricts_item_ext_ies_container = protocol_ext_container_empty_l; // CNTypeRestrictions-Item ::= SEQUENCE struct cn_type_restricts_item_s { @@ -1928,9 +1928,9 @@ struct cn_type_restricts_item_s { using cn_type_restricts_l = dyn_array; // CSG-IdList-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o csg_id_list_item_ext_ies_o; +using csg_id_list_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l csg_id_list_item_ext_ies_container; +using csg_id_list_item_ext_ies_container = protocol_ext_container_empty_l; // CSG-IdList-Item ::= SEQUENCE struct csg_id_list_item_s { @@ -1950,7 +1950,7 @@ struct csg_id_list_item_s { using csg_id_list_l = dyn_array; // CSGMembershipInfo-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o csg_membership_info_ext_ies_o; +using csg_membership_info_ext_ies_o = s1ap_protocol_ext_empty_o; // CSGMembershipStatus ::= ENUMERATED struct csg_membership_status_opts { @@ -1968,7 +1968,7 @@ struct cell_access_mode_opts { }; typedef enumerated cell_access_mode_e; -typedef protocol_ext_container_empty_l csg_membership_info_ext_ies_container; +using csg_membership_info_ext_ies_container = protocol_ext_container_empty_l; // CSGMembershipInfo ::= SEQUENCE struct csg_membership_info_s { @@ -2311,9 +2311,9 @@ private: }; // Cdma2000OneXSRVCCInfo-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cdma2000_one_xsrvcc_info_ext_ies_o; +using cdma2000_one_xsrvcc_info_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l cdma2000_one_xsrvcc_info_ext_ies_container; +using cdma2000_one_xsrvcc_info_ext_ies_container = protocol_ext_container_empty_l; // Cdma2000OneXSRVCCInfo ::= SEQUENCE struct cdma2000_one_xsrvcc_info_s { @@ -2654,9 +2654,9 @@ struct cell_size_opts { typedef enumerated cell_size_e; // CellType-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o cell_type_ext_ies_o; +using cell_type_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l cell_type_ext_ies_container; +using cell_type_ext_ies_container = protocol_ext_container_empty_l; // CellType ::= SEQUENCE struct cell_type_s { @@ -2728,12 +2728,12 @@ struct supported_tas_item_s { }; // ConnectedengNBItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o connectedeng_nb_item_ext_ies_o; +using connectedeng_nb_item_ext_ies_o = s1ap_protocol_ext_empty_o; // SupportedTAs ::= SEQUENCE (SIZE (1..256)) OF SupportedTAs-Item using supported_tas_l = dyn_array; -typedef protocol_ext_container_empty_l connectedeng_nb_item_ext_ies_container; +using connectedeng_nb_item_ext_ies_container = protocol_ext_container_empty_l; // ConnectedengNBItem ::= SEQUENCE struct connectedeng_nb_item_s { @@ -2806,10 +2806,10 @@ struct gbr_qos_info_ext_ies_o { }; // ScheduledCommunicationTime-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o sched_communication_time_ext_ies_o; +using sched_communication_time_ext_ies_o = s1ap_protocol_ext_empty_o; // DL-CP-SecurityInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o dl_cp_security_info_ext_ies_o; +using dl_cp_security_info_ext_ies_o = s1ap_protocol_ext_empty_o; // E-RABQoSParameters-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION struct erab_qos_params_ext_ies_o { @@ -2891,7 +2891,7 @@ struct gbr_qos_info_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l sched_communication_time_ext_ies_container; +using sched_communication_time_ext_ies_container = protocol_ext_container_empty_l; // ScheduledCommunicationTime ::= SEQUENCE struct sched_communication_time_s { @@ -2913,7 +2913,7 @@ struct sched_communication_time_s { }; // Subscription-Based-UE-DifferentiationInfo-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o subscription_based_ue_differentiation_info_ext_ies_o; +using subscription_based_ue_differentiation_info_ext_ies_o = s1ap_protocol_ext_empty_o; // CE-ModeBRestricted ::= ENUMERATED struct ce_mode_brestricted_opts { @@ -2923,7 +2923,7 @@ struct ce_mode_brestricted_opts { }; typedef enumerated ce_mode_brestricted_e; -typedef protocol_ext_container_empty_l dl_cp_security_info_ext_ies_container; +using dl_cp_security_info_ext_ies_container = protocol_ext_container_empty_l; // DL-CP-SecurityInformation ::= SEQUENCE struct dl_cp_security_info_s { @@ -2989,7 +2989,7 @@ struct enhanced_coverage_restricted_opts { }; typedef enumerated enhanced_coverage_restricted_e; -typedef protocol_ext_container_empty_l subscription_based_ue_differentiation_info_ext_ies_container; +using subscription_based_ue_differentiation_info_ext_ies_container = protocol_ext_container_empty_l; // Subscription-Based-UE-DifferentiationInfo ::= SEQUENCE struct subscription_based_ue_differentiation_info_s { @@ -3270,15 +3270,15 @@ private: }; // Global-GNB-ID-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o global_gnb_id_ext_ies_o; +using global_gnb_id_ext_ies_o = s1ap_protocol_ext_empty_o; // GlobalENB-ID-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o global_enb_id_ext_ies_o; +using global_enb_id_ext_ies_o = s1ap_protocol_ext_empty_o; // GNB-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o gnb_ext_ies_o; +using gnb_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l global_enb_id_ext_ies_container; +using global_enb_id_ext_ies_container = protocol_ext_container_empty_l; // Global-ENB-ID ::= SEQUENCE struct global_enb_id_s { @@ -3295,7 +3295,7 @@ struct global_enb_id_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l global_gnb_id_ext_ies_container; +using global_gnb_id_ext_ies_container = protocol_ext_container_empty_l; // Global-GNB-ID ::= SEQUENCE struct global_gnb_id_s { @@ -3313,9 +3313,9 @@ struct global_gnb_id_s { }; // NG-eNB-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ng_enb_ext_ies_o; +using ng_enb_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l gnb_ext_ies_container; +using gnb_ext_ies_container = protocol_ext_container_empty_l; // GNB ::= SEQUENCE struct gnb_s { @@ -3331,7 +3331,7 @@ struct gnb_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l ng_enb_ext_ies_container; +using ng_enb_ext_ies_container = protocol_ext_container_empty_l; // NG-eNB ::= SEQUENCE struct ng_enb_s { @@ -3348,7 +3348,7 @@ struct ng_enb_s { }; // ContextatSource-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o contextat_source_ext_ies_o; +using contextat_source_ext_ies_o = s1ap_protocol_ext_empty_o; // Global-RAN-NODE-ID ::= CHOICE struct global_ran_node_id_c { @@ -3408,7 +3408,7 @@ private: void destroy_(); }; -typedef protocol_ext_container_empty_l contextat_source_ext_ies_container; +using contextat_source_ext_ies_container = protocol_ext_container_empty_l; // ContextatSource ::= SEQUENCE struct contextat_source_s { @@ -3426,7 +3426,7 @@ struct contextat_source_s { }; // CriticalityDiagnostics-IE-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o crit_diagnostics_ie_item_ext_ies_o; +using crit_diagnostics_ie_item_ext_ies_o = s1ap_protocol_ext_empty_o; // TypeOfError ::= ENUMERATED struct type_of_error_opts { @@ -3436,7 +3436,7 @@ struct type_of_error_opts { }; typedef enumerated type_of_error_e; -typedef protocol_ext_container_empty_l crit_diagnostics_ie_item_ext_ies_container; +using crit_diagnostics_ie_item_ext_ies_container = protocol_ext_container_empty_l; // CriticalityDiagnostics-IE-Item ::= SEQUENCE struct crit_diagnostics_ie_item_s { @@ -3455,7 +3455,7 @@ struct crit_diagnostics_ie_item_s { }; // CriticalityDiagnostics-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o crit_diagnostics_ext_ies_o; +using crit_diagnostics_ext_ies_o = s1ap_protocol_ext_empty_o; // CriticalityDiagnostics-IE-List ::= SEQUENCE (SIZE (1..256)) OF CriticalityDiagnostics-IE-Item using crit_diagnostics_ie_list_l = dyn_array; @@ -3468,7 +3468,7 @@ struct trigger_msg_opts { }; typedef enumerated trigger_msg_e; -typedef protocol_ext_container_empty_l crit_diagnostics_ext_ies_container; +using crit_diagnostics_ext_ies_container = protocol_ext_container_empty_l; // CriticalityDiagnostics ::= SEQUENCE struct crit_diagnostics_s { @@ -3567,15 +3567,15 @@ struct deactiv_trace_s { using forbidden_lacs_l = dyn_array >; // ForbiddenLAs-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o forbidden_las_item_ext_ies_o; +using forbidden_las_item_ext_ies_o = s1ap_protocol_ext_empty_o; // ForbiddenTACs ::= SEQUENCE (SIZE (1..4096)) OF OCTET STRING (SIZE (2)) using forbidden_tacs_l = dyn_array >; // ForbiddenTAs-Item-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o forbidden_tas_item_ext_ies_o; +using forbidden_tas_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l forbidden_las_item_ext_ies_container; +using forbidden_las_item_ext_ies_container = protocol_ext_container_empty_l; // ForbiddenLAs-Item ::= SEQUENCE struct forbidden_las_item_s { @@ -3592,7 +3592,7 @@ struct forbidden_las_item_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l forbidden_tas_item_ext_ies_container; +using forbidden_tas_item_ext_ies_container = protocol_ext_container_empty_l; // ForbiddenTAs-Item ::= SEQUENCE struct forbidden_tas_item_s { @@ -3710,7 +3710,7 @@ struct ho_restrict_list_ext_ies_o { }; // NRUESecurityCapabilities-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o nrue_security_cap_ext_ies_o; +using nrue_security_cap_ext_ies_o = s1ap_protocol_ext_empty_o; // DLNASPDUDeliveryAckRequest ::= ENUMERATED struct dlnaspdu_delivery_ack_request_opts { @@ -3765,7 +3765,7 @@ struct ho_restrict_list_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l nrue_security_cap_ext_ies_container; +using nrue_security_cap_ext_ies_container = protocol_ext_container_empty_l; // NRUESecurityCapabilities ::= SEQUENCE struct nrue_security_cap_s { @@ -4025,9 +4025,9 @@ struct dl_non_ueassociated_lp_pa_transport_s { }; // E-RABDataForwardingItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_data_forwarding_item_ext_ies_o; +using erab_data_forwarding_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_data_forwarding_item_ext_ies_container; +using erab_data_forwarding_item_ext_ies_container = protocol_ext_container_empty_l; // E-RABDataForwardingItem ::= SEQUENCE struct erab_data_forwarding_item_s { @@ -4287,9 +4287,9 @@ using erab_ie_container_pair_list_l = dyn_seq_of, 0, 65535, true>, 1, 256>; // E-RABAdmittedItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_admitted_item_ext_ies_o; +using erab_admitted_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_admitted_item_ext_ies_container; +using erab_admitted_item_ext_ies_container = protocol_ext_container_empty_l; // E-RABAdmittedItem ::= SEQUENCE struct erab_admitted_item_s { @@ -4348,9 +4348,9 @@ struct erab_admitted_item_ies_o { }; // E-RABFailedToResumeItemResumeReq-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_failed_to_resume_item_resume_req_ext_ies_o; +using erab_failed_to_resume_item_resume_req_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_failed_to_resume_item_resume_req_ext_ies_container; +using erab_failed_to_resume_item_resume_req_ext_ies_container = protocol_ext_container_empty_l; // E-RABFailedToResumeItemResumeReq ::= SEQUENCE struct erab_failed_to_resume_item_resume_req_s { @@ -4400,9 +4400,9 @@ struct erab_failed_to_resume_item_resume_req_ies_o { }; // E-RABFailedToResumeItemResumeRes-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_failed_to_resume_item_resume_res_ext_ies_o; +using erab_failed_to_resume_item_resume_res_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_failed_to_resume_item_resume_res_ext_ies_container; +using erab_failed_to_resume_item_resume_res_ext_ies_container = protocol_ext_container_empty_l; // E-RABFailedToResumeItemResumeRes ::= SEQUENCE struct erab_failed_to_resume_item_resume_res_s { @@ -4452,9 +4452,9 @@ struct erab_failed_to_resume_item_resume_res_ies_o { }; // E-RABFailedToSetupItemHOReqAckExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_failed_to_setup_item_ho_req_ack_ext_ies_o; +using erab_failed_to_setup_item_ho_req_ack_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_failed_to_setup_item_ho_req_ack_ext_ies_container; +using erab_failed_to_setup_item_ho_req_ack_ext_ies_container = protocol_ext_container_empty_l; // E-RABFailedToSetupItemHOReqAck ::= SEQUENCE struct erab_failed_to_setup_item_ho_req_ack_s { @@ -4512,9 +4512,9 @@ struct dl_forwarding_opts { typedef enumerated dl_forwarding_e; // E-RABInformationListItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_info_list_item_ext_ies_o; +using erab_info_list_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_info_list_item_ext_ies_container; +using erab_info_list_item_ext_ies_container = protocol_ext_container_empty_l; // E-RABInformationListItem ::= SEQUENCE struct erab_info_list_item_s { @@ -4568,9 +4568,9 @@ struct erab_info_list_ies_o { using erab_info_list_l = dyn_array >; // E-RABItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_item_ext_ies_o; +using erab_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_item_ext_ies_container; +using erab_item_ext_ies_container = protocol_ext_container_empty_l; // E-RABItem ::= SEQUENCE struct erab_item_s { @@ -4623,9 +4623,9 @@ struct erab_item_ies_o { using erab_list_l = dyn_array >; // E-RABModifyItemBearerModConfExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_modify_item_bearer_mod_conf_ext_ies_o; +using erab_modify_item_bearer_mod_conf_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_modify_item_bearer_mod_conf_ext_ies_container; +using erab_modify_item_bearer_mod_conf_ext_ies_container = protocol_ext_container_empty_l; // E-RABModifyItemBearerModConf ::= SEQUENCE struct erab_modify_item_bearer_mod_conf_s { @@ -4780,9 +4780,9 @@ struct erab_mod_confirm_s { }; // E-RABUsageReportItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erabusage_report_item_ext_ies_o; +using erabusage_report_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erabusage_report_item_ext_ies_container; +using erabusage_report_item_ext_ies_container = protocol_ext_container_empty_l; // E-RABUsageReportItem ::= SEQUENCE struct erabusage_report_item_s { @@ -4834,18 +4834,18 @@ struct erabusage_report_item_ies_o { }; // NR-CGI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o nr_cgi_ext_ies_o; +using nr_cgi_ext_ies_o = s1ap_protocol_ext_empty_o; // E-RABNotToBeModifiedItemBearerModInd-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_not_to_be_modified_item_bearer_mod_ind_ext_ies_o; +using erab_not_to_be_modified_item_bearer_mod_ind_ext_ies_o = s1ap_protocol_ext_empty_o; // E-RABToBeModifiedItemBearerModInd-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_to_be_modified_item_bearer_mod_ind_ext_ies_o; +using erab_to_be_modified_item_bearer_mod_ind_ext_ies_o = s1ap_protocol_ext_empty_o; // E-RABUsageReportList ::= SEQUENCE (SIZE (1..2)) OF ProtocolIE-SingleContainer{S1AP-PROTOCOL-IES : IEsSetParam} using erabusage_report_list_l = bounded_array, 2>; -typedef protocol_ext_container_empty_l nr_cgi_ext_ies_container; +using nr_cgi_ext_ies_container = protocol_ext_container_empty_l; // NR-CGI ::= SEQUENCE struct nr_cgi_s { @@ -4863,10 +4863,10 @@ struct nr_cgi_s { }; // PSCellInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ps_cell_info_ext_ies_o; +using ps_cell_info_ext_ies_o = s1ap_protocol_ext_empty_o; // SecondaryRATDataUsageReportItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o secondary_rat_data_usage_report_item_ext_ies_o; +using secondary_rat_data_usage_report_item_ext_ies_o = s1ap_protocol_ext_empty_o; // SecondaryRATType ::= ENUMERATED struct secondary_rat_type_opts { @@ -4876,7 +4876,7 @@ struct secondary_rat_type_opts { }; typedef enumerated secondary_rat_type_e; -typedef protocol_ext_container_empty_l erab_not_to_be_modified_item_bearer_mod_ind_ext_ies_container; +using erab_not_to_be_modified_item_bearer_mod_ind_ext_ies_container = protocol_ext_container_empty_l; // E-RABNotToBeModifiedItemBearerModInd ::= SEQUENCE struct erab_not_to_be_modified_item_bearer_mod_ind_s { @@ -4894,7 +4894,7 @@ struct erab_not_to_be_modified_item_bearer_mod_ind_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l erab_to_be_modified_item_bearer_mod_ind_ext_ies_container; +using erab_to_be_modified_item_bearer_mod_ind_ext_ies_container = protocol_ext_container_empty_l; // E-RABToBeModifiedItemBearerModInd ::= SEQUENCE struct erab_to_be_modified_item_bearer_mod_ind_s { @@ -4912,7 +4912,7 @@ struct erab_to_be_modified_item_bearer_mod_ind_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l ps_cell_info_ext_ies_container; +using ps_cell_info_ext_ies_container = protocol_ext_container_empty_l; // PSCellInformation ::= SEQUENCE struct ps_cell_info_s { @@ -4928,7 +4928,7 @@ struct ps_cell_info_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l secondary_rat_data_usage_report_item_ext_ies_container; +using secondary_rat_data_usage_report_item_ext_ies_container = protocol_ext_container_empty_l; // SecondaryRATDataUsageReportItem ::= SEQUENCE struct secondary_rat_data_usage_report_item_s { @@ -5046,7 +5046,7 @@ struct secondary_rat_data_usage_report_item_ies_o { }; // Tunnel-Information-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o tunnel_info_ext_ies_o; +using tunnel_info_ext_ies_o = s1ap_protocol_ext_empty_o; // UserLocationInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION struct user_location_info_ext_ies_o { @@ -5085,7 +5085,7 @@ struct user_location_info_ext_ies_o { using secondary_rat_data_usage_report_list_l = dyn_array >; -typedef protocol_ext_container_empty_l tunnel_info_ext_ies_container; +using tunnel_info_ext_ies_container = protocol_ext_container_empty_l; // TunnelInformation ::= SEQUENCE struct tunnel_info_s { @@ -5233,9 +5233,9 @@ struct erab_mod_ind_s { }; // E-RABModifyItemBearerModResExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_modify_item_bearer_mod_res_ext_ies_o; +using erab_modify_item_bearer_mod_res_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_modify_item_bearer_mod_res_ext_ies_container; +using erab_modify_item_bearer_mod_res_ext_ies_container = protocol_ext_container_empty_l; // E-RABModifyItemBearerModRes ::= SEQUENCE struct erab_modify_item_bearer_mod_res_s { @@ -5835,9 +5835,9 @@ struct erab_release_ind_s { }; // E-RABReleaseItemBearerRelCompExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_release_item_bearer_rel_comp_ext_ies_o; +using erab_release_item_bearer_rel_comp_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_release_item_bearer_rel_comp_ext_ies_container; +using erab_release_item_bearer_rel_comp_ext_ies_container = protocol_ext_container_empty_l; // E-RABReleaseItemBearerRelComp ::= SEQUENCE struct erab_release_item_bearer_rel_comp_s { @@ -5996,9 +5996,9 @@ struct erab_release_resp_s { }; // E-RABSetupItemBearerSUResExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_setup_item_bearer_su_res_ext_ies_o; +using erab_setup_item_bearer_su_res_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_setup_item_bearer_su_res_ext_ies_container; +using erab_setup_item_bearer_su_res_ext_ies_container = protocol_ext_container_empty_l; // E-RABSetupItemBearerSURes ::= SEQUENCE struct erab_setup_item_bearer_su_res_s { @@ -6049,9 +6049,9 @@ struct erab_setup_item_bearer_su_res_ies_o { }; // E-RABSetupItemCtxtSUResExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_setup_item_ctxt_su_res_ext_ies_o; +using erab_setup_item_ctxt_su_res_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_setup_item_ctxt_su_res_ext_ies_container; +using erab_setup_item_ctxt_su_res_ext_ies_container = protocol_ext_container_empty_l; // E-RABSetupItemCtxtSURes ::= SEQUENCE struct erab_setup_item_ctxt_su_res_s { @@ -6642,9 +6642,9 @@ using erab_to_be_setup_list_ctxt_su_req_l = dyn_array >; // E-RABToBeSwitchedDLItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_to_be_switched_dl_item_ext_ies_o; +using erab_to_be_switched_dl_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_to_be_switched_dl_item_ext_ies_container; +using erab_to_be_switched_dl_item_ext_ies_container = protocol_ext_container_empty_l; // E-RABToBeSwitchedDLItem ::= SEQUENCE struct erab_to_be_switched_dl_item_s { @@ -6695,9 +6695,9 @@ struct erab_to_be_switched_dl_item_ies_o { }; // E-RABToBeSwitchedULItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o erab_to_be_switched_ul_item_ext_ies_o; +using erab_to_be_switched_ul_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l erab_to_be_switched_ul_item_ext_ies_container; +using erab_to_be_switched_ul_item_ext_ies_container = protocol_ext_container_empty_l; // E-RABToBeSwitchedULItem ::= SEQUENCE struct erab_to_be_switched_ul_item_s { @@ -6767,12 +6767,12 @@ struct ehrpd_multi_sector_load_report_resp_item_s { }; // ENBX2ExtTLA-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o enbx2_ext_tla_ext_ies_o; +using enbx2_ext_tla_ext_ies_o = s1ap_protocol_ext_empty_o; // ENBX2GTPTLAs ::= SEQUENCE (SIZE (1..16)) OF BIT STRING (SIZE (1..160,...)) using enbx2_gtptlas_l = bounded_array, 16>; -typedef protocol_ext_container_empty_l enbx2_ext_tla_ext_ies_container; +using enbx2_ext_tla_ext_ies_container = protocol_ext_container_empty_l; // ENBX2ExtTLA ::= SEQUENCE struct enbx2_ext_tla_s { @@ -6800,7 +6800,7 @@ struct muting_availability_ind_opts { typedef enumerated muting_availability_ind_e; // RLFReportInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o rlf_report_info_ext_ies_o; +using rlf_report_info_ext_ies_o = s1ap_protocol_ext_empty_o; // ENBIndirectX2TransportLayerAddresses ::= SEQUENCE (SIZE (1..2)) OF BIT STRING (SIZE (1..160,...)) using enb_indirect_x2_transport_layer_addresses_l = bounded_array, 2>; @@ -6809,12 +6809,12 @@ using enb_indirect_x2_transport_layer_addresses_l = bounded_array; // Global-en-gNB-ID-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o global_en_g_nb_id_ext_ies_o; +using global_en_g_nb_id_ext_ies_o = s1ap_protocol_ext_empty_o; // MutingPatternInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o muting_pattern_info_ext_ies_o; +using muting_pattern_info_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l rlf_report_info_ext_ies_container; +using rlf_report_info_ext_ies_container = protocol_ext_container_empty_l; // RLFReportInformation ::= SEQUENCE struct rlf_report_info_s { @@ -6873,18 +6873,18 @@ struct time_synchronisation_info_ext_ies_o { }; // EN-DCSONeNBIdentification-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o en_dcso_nenb_identif_ext_ies_o; +using en_dcso_nenb_identif_ext_ies_o = s1ap_protocol_ext_empty_o; // EN-DCSONengNBIdentification-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o en_dcso_neng_nb_identif_ext_ies_o; +using en_dcso_neng_nb_identif_ext_ies_o = s1ap_protocol_ext_empty_o; // ENBX2TLAs ::= SEQUENCE (SIZE (1..2)) OF BIT STRING (SIZE (1..160,...)) using enbx2_tlas_l = bounded_array, 2>; // FiveGSTAI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o five_gstai_ext_ies_o; +using five_gstai_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l global_en_g_nb_id_ext_ies_container; +using global_en_g_nb_id_ext_ies_container = protocol_ext_container_empty_l; // Global-en-gNB-ID ::= SEQUENCE struct global_en_g_nb_id_s { @@ -6901,7 +6901,7 @@ struct global_en_g_nb_id_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l muting_pattern_info_ext_ies_container; +using muting_pattern_info_ext_ies_container = protocol_ext_container_empty_l; // MutingPatternInformation ::= SEQUENCE struct muting_pattern_info_s { @@ -7012,7 +7012,7 @@ struct x2_tnl_cfg_info_ext_ies_o { static presence_e get_presence(const uint32_t& id); }; -typedef protocol_ext_container_empty_l en_dcso_nenb_identif_ext_ies_container; +using en_dcso_nenb_identif_ext_ies_container = protocol_ext_container_empty_l; // EN-DCSONeNBIdentification ::= SEQUENCE struct en_dcso_nenb_identif_s { @@ -7029,7 +7029,7 @@ struct en_dcso_nenb_identif_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l en_dcso_neng_nb_identif_ext_ies_container; +using en_dcso_neng_nb_identif_ext_ies_container = protocol_ext_container_empty_l; // EN-DCSONengNBIdentification ::= SEQUENCE struct en_dcso_neng_nb_identif_s { @@ -7047,12 +7047,12 @@ struct en_dcso_neng_nb_identif_s { }; // EN-DCTransferTypeReply-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o en_dc_transfer_type_reply_ext_ies_o; +using en_dc_transfer_type_reply_ext_ies_o = s1ap_protocol_ext_empty_o; // EN-DCTransferTypeRequest-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o en_dc_transfer_type_request_ext_ies_o; +using en_dc_transfer_type_request_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l five_gstai_ext_ies_container; +using five_gstai_ext_ies_container = protocol_ext_container_empty_l; // FiveGSTAI ::= SEQUENCE struct five_gstai_s { @@ -7164,7 +7164,7 @@ struct x2_tnl_cfg_info_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l en_dc_transfer_type_reply_ext_ies_container; +using en_dc_transfer_type_reply_ext_ies_container = protocol_ext_container_empty_l; // EN-DCTransferTypeReply ::= SEQUENCE struct en_dc_transfer_type_reply_s { @@ -7181,7 +7181,7 @@ struct en_dc_transfer_type_reply_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l en_dc_transfer_type_request_ext_ies_container; +using en_dc_transfer_type_request_ext_ies_container = protocol_ext_container_empty_l; // EN-DCTransferTypeRequest ::= SEQUENCE struct en_dc_transfer_type_request_s { @@ -7230,7 +7230,7 @@ struct son_info_request_opts { typedef enumerated son_info_request_e; // EN-DCSONConfigurationTransfer-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o en_dcson_cfg_transfer_ext_ies_o; +using en_dcson_cfg_transfer_ext_ies_o = s1ap_protocol_ext_empty_o; // EN-DCSONTransferType ::= CHOICE struct en_dcson_transfer_type_c { @@ -7363,7 +7363,7 @@ private: void destroy_(); }; -typedef protocol_ext_container_empty_l en_dcson_cfg_transfer_ext_ies_container; +using en_dcson_cfg_transfer_ext_ies_container = protocol_ext_container_empty_l; // EN-DCSONConfigurationTransfer ::= SEQUENCE struct en_dcson_cfg_transfer_s { @@ -7383,9 +7383,9 @@ struct en_dcson_cfg_transfer_s { }; // ENB-StatusTransfer-TransparentContainer-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o enb_status_transfer_transparent_container_ext_ies_o; +using enb_status_transfer_transparent_container_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l enb_status_transfer_transparent_container_ext_ies_container; +using enb_status_transfer_transparent_container_ext_ies_container = protocol_ext_container_empty_l; // ENB-StatusTransfer-TransparentContainer ::= SEQUENCE struct enb_status_transfer_transparent_container_s { @@ -7402,12 +7402,12 @@ struct enb_status_transfer_transparent_container_s { }; // S-TMSI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o s_tmsi_ext_ies_o; +using s_tmsi_ext_ies_o = s1ap_protocol_ext_empty_o; // UL-CP-SecurityInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ul_cp_security_info_ext_ies_o; +using ul_cp_security_info_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l s_tmsi_ext_ies_container; +using s_tmsi_ext_ies_container = protocol_ext_container_empty_l; // S-TMSI ::= SEQUENCE struct s_tmsi_s { @@ -7424,7 +7424,7 @@ struct s_tmsi_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l ul_cp_security_info_ext_ies_container; +using ul_cp_security_info_ext_ies_container = protocol_ext_container_empty_l; // UL-CP-SecurityInformation ::= SEQUENCE struct ul_cp_security_info_s { @@ -7522,9 +7522,9 @@ struct enbcp_relocation_ind_s { }; // ListeningSubframePattern-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o listening_sf_pattern_ext_ies_o; +using listening_sf_pattern_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l listening_sf_pattern_ext_ies_container; +using listening_sf_pattern_ext_ies_container = protocol_ext_container_empty_l; // ListeningSubframePattern ::= SEQUENCE struct listening_sf_pattern_s { @@ -7552,12 +7552,12 @@ struct listening_sf_pattern_s { }; // SynchronisationInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o synchronisation_info_ext_ies_o; +using synchronisation_info_ext_ies_o = s1ap_protocol_ext_empty_o; // SourceeNB-ID-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o sourceenb_id_ext_ies_o; +using sourceenb_id_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l synchronisation_info_ext_ies_container; +using synchronisation_info_ext_ies_container = protocol_ext_container_empty_l; // SynchronisationInformation ::= SEQUENCE struct synchronisation_info_s { @@ -7579,7 +7579,7 @@ struct synchronisation_info_s { }; // TargeteNB-ID-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o targetenb_id_ext_ies_o; +using targetenb_id_ext_ies_o = s1ap_protocol_ext_empty_o; // SONConfigurationTransfer-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION struct son_cfg_transfer_ext_ies_o { @@ -7625,7 +7625,7 @@ struct son_cfg_transfer_ext_ies_o { static presence_e get_presence(const uint32_t& id); }; -typedef protocol_ext_container_empty_l sourceenb_id_ext_ies_container; +using sourceenb_id_ext_ies_container = protocol_ext_container_empty_l; // SourceeNB-ID ::= SEQUENCE struct sourceenb_id_s { @@ -7640,7 +7640,7 @@ struct sourceenb_id_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l targetenb_id_ext_ies_container; +using targetenb_id_ext_ies_container = protocol_ext_container_empty_l; // TargeteNB-ID ::= SEQUENCE struct targetenb_id_s { @@ -8010,12 +8010,12 @@ struct enb_cfg_upd_fail_s { }; // LAI-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o lai_ext_ies_o; +using lai_ext_ies_o = s1ap_protocol_ext_empty_o; // GERAN-Cell-ID-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o geran_cell_id_ext_ies_o; +using geran_cell_id_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l lai_ext_ies_container; +using lai_ext_ies_container = protocol_ext_container_empty_l; // LAI ::= SEQUENCE struct lai_s { @@ -8033,9 +8033,9 @@ struct lai_s { }; // TargetRNC-ID-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o target_rnc_id_ext_ies_o; +using target_rnc_id_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l geran_cell_id_ext_ies_container; +using geran_cell_id_ext_ies_container = protocol_ext_container_empty_l; // GERAN-Cell-ID ::= SEQUENCE struct geran_cell_id_s { @@ -8053,7 +8053,7 @@ struct geran_cell_id_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l target_rnc_id_ext_ies_container; +using target_rnc_id_ext_ies_container = protocol_ext_container_empty_l; // TargetRNC-ID ::= SEQUENCE struct target_rnc_id_s { @@ -8148,9 +8148,9 @@ private: }; // RIMTransfer-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o rim_transfer_ext_ies_o; +using rim_transfer_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l rim_transfer_ext_ies_container; +using rim_transfer_ext_ies_container = protocol_ext_container_empty_l; // RIMTransfer ::= SEQUENCE struct rim_transfer_s { @@ -8453,7 +8453,7 @@ struct event_triggered_cell_load_report_resp_s { }; // ExpectedUEActivityBehaviour-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o expected_ue_activity_behaviour_ext_ies_o; +using expected_ue_activity_behaviour_ext_ies_o = s1ap_protocol_ext_empty_o; // SourceOfUEActivityBehaviourInformation ::= ENUMERATED struct source_of_ue_activity_behaviour_info_opts { @@ -8463,7 +8463,7 @@ struct source_of_ue_activity_behaviour_info_opts { }; typedef enumerated source_of_ue_activity_behaviour_info_e; -typedef protocol_ext_container_empty_l expected_ue_activity_behaviour_ext_ies_container; +using expected_ue_activity_behaviour_ext_ies_container = protocol_ext_container_empty_l; // ExpectedUEActivityBehaviour ::= SEQUENCE struct expected_ue_activity_behaviour_s { @@ -8495,9 +8495,9 @@ struct expected_ho_interv_opts { typedef enumerated expected_ho_interv_e; // ExpectedUEBehaviour-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o expected_ue_behaviour_ext_ies_o; +using expected_ue_behaviour_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l expected_ue_behaviour_ext_ies_container; +using expected_ue_behaviour_ext_ies_container = protocol_ext_container_empty_l; // ExpectedUEBehaviour ::= SEQUENCE struct expected_ue_behaviour_s { @@ -9113,9 +9113,9 @@ struct ho_prep_fail_s { }; // MBSFN-ResultToLogInfo-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o mbsfn_result_to_log_info_ext_ies_o; +using mbsfn_result_to_log_info_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l mbsfn_result_to_log_info_ext_ies_container; +using mbsfn_result_to_log_info_ext_ies_container = protocol_ext_container_empty_l; // MBSFN-ResultToLogInfo ::= SEQUENCE struct mbsfn_result_to_log_info_s { @@ -9142,7 +9142,7 @@ struct links_to_log_opts { typedef enumerated links_to_log_e; // LoggedMBSFNMDT-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o logged_mbsfnmdt_ext_ies_o; +using logged_mbsfnmdt_ext_ies_o = s1ap_protocol_ext_empty_o; // LoggingDuration ::= ENUMERATED struct logging_dur_opts { @@ -9165,7 +9165,7 @@ struct logging_interv_opts { typedef enumerated logging_interv_e; // M3Configuration-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o m3_cfg_ext_ies_o; +using m3_cfg_ext_ies_o = s1ap_protocol_ext_empty_o; // M3period ::= ENUMERATED struct m3period_opts { @@ -9190,7 +9190,7 @@ struct m3period_opts { typedef enumerated m3period_e; // M4Configuration-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o m4_cfg_ext_ies_o; +using m4_cfg_ext_ies_o = s1ap_protocol_ext_empty_o; // M4period ::= ENUMERATED struct m4period_opts { @@ -9203,7 +9203,7 @@ struct m4period_opts { typedef enumerated m4period_e; // M5Configuration-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o m5_cfg_ext_ies_o; +using m5_cfg_ext_ies_o = s1ap_protocol_ext_empty_o; // M5period ::= ENUMERATED struct m5period_opts { @@ -9216,7 +9216,7 @@ struct m5period_opts { typedef enumerated m5period_e; // M6Configuration-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o m6_cfg_ext_ies_o; +using m6_cfg_ext_ies_o = s1ap_protocol_ext_empty_o; // M6delay-threshold ::= ENUMERATED struct m6delay_thres_opts { @@ -9239,7 +9239,7 @@ struct m6report_interv_opts { typedef enumerated m6report_interv_e; // M7Configuration-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o m7_cfg_ext_ies_o; +using m7_cfg_ext_ies_o = s1ap_protocol_ext_empty_o; // MBSFN-ResultToLog ::= SEQUENCE (SIZE (1..8)) OF MBSFN-ResultToLogInfo using mbsfn_result_to_log_l = dyn_array; @@ -9256,9 +9256,9 @@ typedef enumerated wlan_meas_cfg_e; using wlan_meas_cfg_name_list_l = bounded_array, 4>; // WLANMeasurementConfiguration-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o wlan_meas_cfg_ext_ies_o; +using wlan_meas_cfg_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l logged_mbsfnmdt_ext_ies_container; +using logged_mbsfnmdt_ext_ies_container = protocol_ext_container_empty_l; // LoggedMBSFNMDT ::= SEQUENCE struct logged_mbsfnmdt_s { @@ -9278,12 +9278,12 @@ struct logged_mbsfnmdt_s { }; // M1PeriodicReporting-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o m1_periodic_report_ext_ies_o; +using m1_periodic_report_ext_ies_o = s1ap_protocol_ext_empty_o; // M1ThresholdEventA2-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o m1_thres_event_a2_ext_ies_o; +using m1_thres_event_a2_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l m3_cfg_ext_ies_container; +using m3_cfg_ext_ies_container = protocol_ext_container_empty_l; // M3Configuration ::= SEQUENCE struct m3_cfg_s { @@ -9299,7 +9299,7 @@ struct m3_cfg_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l m4_cfg_ext_ies_container; +using m4_cfg_ext_ies_container = protocol_ext_container_empty_l; // M4Configuration ::= SEQUENCE struct m4_cfg_s { @@ -9316,7 +9316,7 @@ struct m4_cfg_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l m5_cfg_ext_ies_container; +using m5_cfg_ext_ies_container = protocol_ext_container_empty_l; // M5Configuration ::= SEQUENCE struct m5_cfg_s { @@ -9333,7 +9333,7 @@ struct m5_cfg_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l m6_cfg_ext_ies_container; +using m6_cfg_ext_ies_container = protocol_ext_container_empty_l; // M6Configuration ::= SEQUENCE struct m6_cfg_s { @@ -9352,7 +9352,7 @@ struct m6_cfg_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l m7_cfg_ext_ies_container; +using m7_cfg_ext_ies_container = protocol_ext_container_empty_l; // M7Configuration ::= SEQUENCE struct m7_cfg_s { @@ -9462,7 +9462,7 @@ struct report_interv_mdt_opts { }; typedef enumerated report_interv_mdt_e; -typedef protocol_ext_container_empty_l wlan_meas_cfg_ext_ies_container; +using wlan_meas_cfg_ext_ies_container = protocol_ext_container_empty_l; // WLANMeasurementConfiguration ::= SEQUENCE struct wlan_meas_cfg_s { @@ -9614,7 +9614,7 @@ struct logged_mdt_ext_ies_o { static presence_e get_presence(const uint32_t& id); }; -typedef protocol_ext_container_empty_l m1_periodic_report_ext_ies_container; +using m1_periodic_report_ext_ies_container = protocol_ext_container_empty_l; // M1PeriodicReporting ::= SEQUENCE struct m1_periodic_report_s { @@ -9639,7 +9639,7 @@ struct m1_report_trigger_opts { }; typedef enumerated m1_report_trigger_e; -typedef protocol_ext_container_empty_l m1_thres_event_a2_ext_ies_container; +using m1_thres_event_a2_ext_ies_container = protocol_ext_container_empty_l; // M1ThresholdEventA2 ::= SEQUENCE struct m1_thres_event_a2_s { @@ -10083,7 +10083,7 @@ struct request_type_ext_ies_o { }; // SecurityContext-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o security_context_ext_ies_o; +using security_context_ext_ies_o = s1ap_protocol_ext_empty_o; // TraceActivation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION struct trace_activation_ext_ies_o { @@ -10145,13 +10145,13 @@ struct trace_depth_opts { typedef enumerated trace_depth_e; // UE-Sidelink-Aggregate-MaximumBitrates-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ue_sidelink_aggregate_maximum_bitrates_ext_ies_o; +using ue_sidelink_aggregate_maximum_bitrates_ext_ies_o = s1ap_protocol_ext_empty_o; // UESecurityCapabilities-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ue_security_cap_ext_ies_o; +using ue_security_cap_ext_ies_o = s1ap_protocol_ext_empty_o; // V2XServicesAuthorized-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o v2xservices_authorized_ext_ies_o; +using v2xservices_authorized_ext_ies_o = s1ap_protocol_ext_empty_o; // VehicleUE ::= ENUMERATED struct vehicle_ue_opts { @@ -10209,7 +10209,7 @@ struct request_type_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l security_context_ext_ies_container; +using security_context_ext_ies_container = protocol_ext_container_empty_l; // SecurityContext ::= SEQUENCE struct security_context_s { @@ -10260,7 +10260,7 @@ struct trace_activation_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l ue_security_cap_ext_ies_container; +using ue_security_cap_ext_ies_container = protocol_ext_container_empty_l; // UESecurityCapabilities ::= SEQUENCE struct ue_security_cap_s { @@ -10277,7 +10277,7 @@ struct ue_security_cap_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l ue_sidelink_aggregate_maximum_bitrates_ext_ies_container; +using ue_sidelink_aggregate_maximum_bitrates_ext_ies_container = protocol_ext_container_empty_l; // UESidelinkAggregateMaximumBitrate ::= SEQUENCE struct ue_sidelink_aggregate_maximum_bitrate_s { @@ -10301,7 +10301,7 @@ struct ueuser_plane_cio_tsupport_ind_opts { }; typedef enumerated ueuser_plane_cio_tsupport_ind_e; -typedef protocol_ext_container_empty_l v2xservices_authorized_ext_ies_container; +using v2xservices_authorized_ext_ies_container = protocol_ext_container_empty_l; // V2XServicesAuthorized ::= SEQUENCE struct v2xservices_authorized_s { @@ -10676,9 +10676,9 @@ struct ho_request_ack_s { }; // TargetNgRanNode-ID-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o target_ng_ran_node_id_ext_ies_o; +using target_ng_ran_node_id_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l target_ng_ran_node_id_ext_ies_container; +using target_ng_ran_node_id_ext_ies_container = protocol_ext_container_empty_l; // TargetNgRanNode-ID ::= SEQUENCE struct target_ng_ran_node_id_s { @@ -10995,9 +10995,9 @@ private: }; // RecommendedENBItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o recommended_enb_item_ext_ies_o; +using recommended_enb_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l recommended_enb_item_ext_ies_container; +using recommended_enb_item_ext_ies_container = protocol_ext_container_empty_l; // RecommendedENBItem ::= SEQUENCE struct recommended_enb_item_s { @@ -11049,12 +11049,12 @@ struct recommended_enb_item_ies_o { using recommended_enb_list_l = bounded_array, 16>; // RecommendedENBsForPaging-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o recommended_enbs_for_paging_ext_ies_o; +using recommended_enbs_for_paging_ext_ies_o = s1ap_protocol_ext_empty_o; // InformationOnRecommendedCellsAndENBsForPaging-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o info_on_recommended_cells_and_enbs_for_paging_ext_ies_o; +using info_on_recommended_cells_and_enbs_for_paging_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l recommended_enbs_for_paging_ext_ies_container; +using recommended_enbs_for_paging_ext_ies_container = protocol_ext_container_empty_l; // RecommendedENBsForPaging ::= SEQUENCE struct recommended_enbs_for_paging_s { @@ -11070,7 +11070,7 @@ struct recommended_enbs_for_paging_s { void to_json(json_writer& j) const; }; -typedef protocol_ext_container_empty_l info_on_recommended_cells_and_enbs_for_paging_ext_ies_container; +using info_on_recommended_cells_and_enbs_for_paging_ext_ies_container = protocol_ext_container_empty_l; // InformationOnRecommendedCellsAndENBsForPaging ::= SEQUENCE struct info_on_recommended_cells_and_enbs_for_paging_s { @@ -11738,12 +11738,12 @@ struct init_ue_msg_s { }; // UE-associatedLogicalS1-ConnectionItemExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ue_associated_lc_s1_conn_item_ext_ies_o; +using ue_associated_lc_s1_conn_item_ext_ies_o = s1ap_protocol_ext_empty_o; // TAIItemExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o tai_item_ext_ies_o; +using tai_item_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l ue_associated_lc_s1_conn_item_ext_ies_container; +using ue_associated_lc_s1_conn_item_ext_ies_container = protocol_ext_container_empty_l; // UE-associatedLogicalS1-ConnectionItem ::= SEQUENCE struct ue_associated_lc_s1_conn_item_s { @@ -11763,7 +11763,7 @@ struct ue_associated_lc_s1_conn_item_s { }; // ServedDCNsItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o served_dcns_item_ext_ies_o; +using served_dcns_item_ext_ies_o = s1ap_protocol_ext_empty_o; // ServedGUMMEIsItem-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION struct served_gummeis_item_ext_ies_o { @@ -11806,7 +11806,7 @@ using served_mmecs_l = dyn_array >; // ServedPLMNs ::= SEQUENCE (SIZE (1..32)) OF OCTET STRING (SIZE (3)) using served_plmns_l = bounded_array, 32>; -typedef protocol_ext_container_empty_l tai_item_ext_ies_container; +using tai_item_ext_ies_container = protocol_ext_container_empty_l; // TAIItem ::= SEQUENCE struct tai_item_s { @@ -11823,7 +11823,7 @@ struct tai_item_s { }; // UE-S1AP-ID-pair-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o ue_s1ap_id_pair_ext_ies_o; +using ue_s1ap_id_pair_ext_ies_o = s1ap_protocol_ext_empty_o; // UE-associatedLogicalS1-ConnectionItemRes ::= OBJECT SET OF S1AP-PROTOCOL-IES struct ue_associated_lc_s1_conn_item_res_o { @@ -11886,7 +11886,7 @@ struct nb_io_t_paging_e_drx_cycle_opts { typedef enumerated nb_io_t_paging_e_drx_cycle_e; // NB-IoT-Paging-eDRXInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o nb_io_t_paging_e_drx_info_ext_ies_o; +using nb_io_t_paging_e_drx_info_ext_ies_o = s1ap_protocol_ext_empty_o; // NB-IoT-PagingTimeWindow ::= ENUMERATED struct nb_io_t_paging_time_win_opts { @@ -11944,7 +11944,7 @@ struct paging_e_drx_cycle_opts { typedef enumerated paging_e_drx_cycle_e; // Paging-eDRXInformation-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o paging_e_drx_info_ext_ies_o; +using paging_e_drx_info_ext_ies_o = s1ap_protocol_ext_empty_o; // PagingTimeWindow ::= ENUMERATED struct paging_time_win_opts { @@ -11964,7 +11964,7 @@ struct reset_all_opts { }; typedef enumerated reset_all_e; -typedef protocol_ext_container_empty_l served_dcns_item_ext_ies_container; +using served_dcns_item_ext_ies_container = protocol_ext_container_empty_l; // ServedDCNsItem ::= SEQUENCE struct served_dcns_item_s { @@ -12032,7 +12032,7 @@ struct tai_item_ies_o { // TAIListforWarning ::= SEQUENCE (SIZE (1..65535)) OF TAI using tai_listfor_warning_l = dyn_array; -typedef protocol_ext_container_empty_l ue_s1ap_id_pair_ext_ies_container; +using ue_s1ap_id_pair_ext_ies_container = protocol_ext_container_empty_l; // UE-S1AP-ID-pair ::= SEQUENCE struct ue_s1ap_id_pair_s { @@ -12152,7 +12152,7 @@ struct mme_relay_support_ind_opts { }; typedef enumerated mme_relay_support_ind_e; -typedef protocol_ext_container_empty_l nb_io_t_paging_e_drx_info_ext_ies_container; +using nb_io_t_paging_e_drx_info_ext_ies_container = protocol_ext_container_empty_l; // NB-IoT-Paging-eDRXInformation ::= SEQUENCE struct nb_io_t_paging_e_drx_info_s { @@ -12195,7 +12195,7 @@ private: // PWSfailedECGIList ::= SEQUENCE (SIZE (1..256)) OF EUTRAN-CGI using pw_sfailed_ecgi_list_l = dyn_array; -typedef protocol_ext_container_empty_l paging_e_drx_info_ext_ies_container; +using paging_e_drx_info_ext_ies_container = protocol_ext_container_empty_l; // Paging-eDRXInformation ::= SEQUENCE struct paging_e_drx_info_s { @@ -13667,7 +13667,7 @@ struct s1ap_private_ies_empty_o { }; }; // PrivateMessageIEs ::= OBJECT SET OF S1AP-PRIVATE-IES -typedef s1ap_private_ies_empty_o private_msg_ies_o; +using private_msg_ies_o = s1ap_private_ies_empty_o; // RerouteNASRequest-IEs ::= OBJECT SET OF S1AP-PROTOCOL-IES struct reroute_nas_request_ies_o { @@ -16142,7 +16142,7 @@ struct private_ie_container_empty_l { SRSASN_CODE unpack(cbit_ref& bref); void to_json(json_writer& j) const; }; -typedef private_ie_container_empty_l private_msg_ies_container; +using private_msg_ies_container = private_ie_container_empty_l; // PrivateMessage ::= SEQUENCE struct private_msg_s { @@ -18563,9 +18563,9 @@ struct sourceenb_to_targetenb_transparent_container_s { }; // TargeteNB-ToSourceeNB-TransparentContainer-ExtIEs ::= OBJECT SET OF S1AP-PROTOCOL-EXTENSION -typedef s1ap_protocol_ext_empty_o targetenb_to_sourceenb_transparent_container_ext_ies_o; +using targetenb_to_sourceenb_transparent_container_ext_ies_o = s1ap_protocol_ext_empty_o; -typedef protocol_ext_container_empty_l targetenb_to_sourceenb_transparent_container_ext_ies_container; +using targetenb_to_sourceenb_transparent_container_ext_ies_container = protocol_ext_container_empty_l; // TargeteNB-ToSourceeNB-TransparentContainer ::= SEQUENCE struct targetenb_to_sourceenb_transparent_container_s { From 30439c12e08978b0447090339b06f224a0382c12 Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 19 Jan 2021 16:31:14 +0000 Subject: [PATCH 086/138] fix 'maybe be used uninitialized' error --- srsenb/src/stack/mac/sched_helpers.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srsenb/src/stack/mac/sched_helpers.cc b/srsenb/src/stack/mac/sched_helpers.cc index 05e7a6fe4..4a01ed836 100644 --- a/srsenb/src/stack/mac/sched_helpers.cc +++ b/srsenb/src/stack/mac/sched_helpers.cc @@ -216,7 +216,8 @@ sched_cell_params_t::dl_lb_nof_re_table get_lb_nof_re_x_prb(const sched_cell_par re_prb_vec[p] += table[p][sf_idx][s][SRSLTE_NOF_CFI - 1]; } } - srslte::bounded_vector re_prb_vec2(re_prb_vec); + srslte::bounded_vector re_prb_vec2(re_prb_vec.size()); + std::copy(re_prb_vec.begin(), re_prb_vec.end(), re_prb_vec2.begin()); ret[sf_idx][0] = *std::min_element(re_prb_vec2.begin(), re_prb_vec2.end()); for (uint32_t p = 1; p < table.size(); ++p) { std::transform(re_prb_vec2.begin(), From 3892194d98fe197810f624c08fa110e1c9f22439 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 15 Jan 2021 17:31:58 +0000 Subject: [PATCH 087/138] sched refactor, use enb_cc_idx rather than ue_cc_idx primarily to avoid uneeded conversions --- srsenb/hdr/stack/mac/sched_ue.h | 42 +++--- .../hdr/stack/mac/sched_ue_ctrl/sched_lch.h | 5 +- srsenb/src/stack/mac/sched_grid.cc | 38 +++-- srsenb/src/stack/mac/sched_ue.cc | 136 ++++++++++-------- .../src/stack/mac/sched_ue_ctrl/sched_lch.cc | 9 +- srsenb/src/stack/mac/schedulers/sched_base.cc | 20 ++- .../src/stack/mac/schedulers/sched_time_pf.cc | 14 +- .../src/stack/mac/schedulers/sched_time_rr.cc | 12 +- srsenb/test/mac/sched_grid_test.cc | 6 +- 9 files changed, 139 insertions(+), 143 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index 638e48f7c..b5d580f85 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -132,33 +132,33 @@ public: * Custom functions *******************************************************/ - const dl_harq_proc& get_dl_harq(uint32_t idx, uint32_t cc_idx) const; + const dl_harq_proc& get_dl_harq(uint32_t idx, uint32_t enb_cc_idx) const; uint16_t get_rnti() const { return rnti; } std::pair get_active_cell_index(uint32_t enb_cc_idx) const; const ue_cfg_t& get_ue_cfg() const { return cfg; } - uint32_t get_aggr_level(uint32_t ue_cc_idx, uint32_t nof_bits); + uint32_t get_aggr_level(uint32_t enb_cc_idx, uint32_t nof_bits); void ul_buffer_add(uint8_t lcid, uint32_t bytes); /******************************************************* * Functions used by scheduler metric objects *******************************************************/ - uint32_t get_required_prb_ul(uint32_t cc_idx, uint32_t req_bytes); + uint32_t get_required_prb_ul(uint32_t enb_cc_idx, uint32_t req_bytes); - rbg_interval get_required_dl_rbgs(uint32_t ue_cc_idx); - srslte::interval get_requested_dl_bytes(uint32_t ue_cc_idx); + rbg_interval get_required_dl_rbgs(uint32_t enb_cc_idx); + srslte::interval get_requested_dl_bytes(uint32_t enb_cc_idx); uint32_t get_pending_dl_rlc_data() const; - uint32_t get_expected_dl_bitrate(uint32_t ue_cc_idx, int nof_rbgs = -1) const; + uint32_t get_expected_dl_bitrate(uint32_t enb_cc_idx, int nof_rbgs = -1) const; - uint32_t get_pending_ul_data_total(tti_point tti_tx_ul, int this_ue_cc_idx); - uint32_t get_pending_ul_new_data(tti_point tti_tx_ul, int this_ue_cc_idx); + uint32_t get_pending_ul_data_total(tti_point tti_tx_ul, int this_enb_cc_idx); + uint32_t get_pending_ul_new_data(tti_point tti_tx_ul, int this_enb_cc_idx); uint32_t get_pending_ul_old_data(); - uint32_t get_pending_ul_old_data(uint32_t cc_idx); - uint32_t get_expected_ul_bitrate(uint32_t ue_cc_idx, int nof_prbs = -1) const; + uint32_t get_pending_ul_old_data(uint32_t enb_cc_idx); + uint32_t get_expected_ul_bitrate(uint32_t enb_cc_idx, int nof_prbs = -1) const; - dl_harq_proc* get_pending_dl_harq(tti_point tti_tx_dl, uint32_t cc_idx); - dl_harq_proc* get_empty_dl_harq(tti_point tti_tx_dl, uint32_t cc_idx); - ul_harq_proc* get_ul_harq(tti_point tti_tx_ul, uint32_t ue_cc_idx); + dl_harq_proc* get_pending_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_idx); + dl_harq_proc* get_empty_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_idx); + ul_harq_proc* get_ul_harq(tti_point tti_tx_ul, uint32_t enb_cc_idx); /******************************************************* * Functions used by the scheduler carrier object @@ -176,12 +176,12 @@ public: int generate_dl_dci_format(uint32_t pid, sched_interface::dl_sched_data_t* data, tti_point tti_tx_dl, - uint32_t ue_cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, const rbgmask_t& user_mask); int generate_format0(sched_interface::ul_sched_data_t* data, tti_point tti_tx_ul, - uint32_t cc_idx, + uint32_t enb_cc_idx, prb_interval alloc, bool needs_pdcch, srslte_dci_location_t cce_range, @@ -209,34 +209,34 @@ private: dl_harq_proc* h, const rbgmask_t& user_mask, tti_point tti_tx_dl, - uint32_t ue_cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, uint32_t tb); - tbs_info compute_mcs_and_tbs(uint32_t ue_cc_idx, + tbs_info compute_mcs_and_tbs(uint32_t enb_cc_idx, tti_point tti_tx_dl, uint32_t nof_alloc_prbs, uint32_t cfi, const srslte_dci_dl_t& dci); - bool needs_cqi(uint32_t tti, uint32_t cc_idx, bool will_send = false); + bool needs_cqi(uint32_t tti, uint32_t enb_cc_idx, bool will_send = false); int generate_format1(uint32_t pid, sched_interface::dl_sched_data_t* data, tti_point tti_tx_dl, - uint32_t ue_cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, const rbgmask_t& user_mask); int generate_format2a(uint32_t pid, sched_interface::dl_sched_data_t* data, tti_point tti_tx_dl, - uint32_t cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, const rbgmask_t& user_mask); int generate_format2(uint32_t pid, sched_interface::dl_sched_data_t* data, tti_point tti_tx_dl, - uint32_t cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, const rbgmask_t& user_mask); diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_lch.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_lch.h index df001e0cd..ce7356857 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_lch.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_lch.h @@ -95,10 +95,7 @@ uint32_t allocate_mac_sdus(sched_interface::dl_sched_data_t* data, * @param total_tbs available space in bytes for allocations * @return number of bytes allocated */ -uint32_t allocate_mac_ces(sched_interface::dl_sched_data_t* data, - lch_ue_manager& lch_handler, - uint32_t total_tbs, - uint32_t ue_cc_idx); +uint32_t allocate_mac_ces(sched_interface::dl_sched_data_t* data, lch_ue_manager& lch_handler, uint32_t total_tbs); } // namespace srsenb diff --git a/srsenb/src/stack/mac/sched_grid.cc b/srsenb/src/stack/mac/sched_grid.cc index 37cebc110..6e15fa052 100644 --- a/srsenb/src/stack/mac/sched_grid.cc +++ b/srsenb/src/stack/mac/sched_grid.cc @@ -780,10 +780,10 @@ alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_ma } // Check if allocation would cause segmentation - const dl_harq_proc& h = user->get_dl_harq(pid, ue_cc_idx); + const dl_harq_proc& h = user->get_dl_harq(pid, cc_cfg->enb_cc_idx); if (h.is_empty()) { // It is newTx - rbg_interval r = user->get_required_dl_rbgs(ue_cc_idx); + rbg_interval r = user->get_required_dl_rbgs(cc_cfg->enb_cc_idx); if (r.start() > user_mask.count()) { log_h->warning("The number of RBGs allocated to rnti=0x%x will force segmentation\n", user->get_rnti()); return alloc_outcome_t::NOF_RB_INVALID; @@ -799,7 +799,7 @@ alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_ma if (not has_pusch_grant) { // Try to allocate small PUSCH grant, if there are no allocated PUSCH grants for this TTI yet prb_interval alloc = {}; - uint32_t L = user->get_required_prb_ul(ue_cc_idx, srslte::ceil_div(SRSLTE_UCI_CQI_CODED_PUCCH_B + 2, 8)); + uint32_t L = user->get_required_prb_ul(cc_cfg->enb_cc_idx, srslte::ceil_div(SRSLTE_UCI_CQI_CODED_PUCCH_B + 2, 8)); tti_alloc.find_ul_alloc(L, &alloc); bool ul_alloc_success = alloc.length() > 0 and alloc_ul_user(user, alloc); if (ue_cc_idx != 0 and not ul_alloc_success) { @@ -866,7 +866,7 @@ alloc_outcome_t sf_sched::alloc_ul_user(sched_ue* user, prb_interval alloc) { // check whether adaptive/non-adaptive retx/newtx ul_alloc_t::type_t alloc_type; - ul_harq_proc* h = user->get_ul_harq(get_tti_tx_ul(), user->get_active_cell_index(cc_cfg->enb_cc_idx).second); + ul_harq_proc* h = user->get_ul_harq(get_tti_tx_ul(), cc_cfg->enb_cc_idx); bool has_retx = h->has_pending_retx(); if (has_retx) { if (h->retx_requires_pdcch(tti_point{get_tti_tx_ul()}, alloc)) { @@ -895,9 +895,8 @@ bool sf_sched::alloc_phich(sched_ue* user, sched_interface::ul_sched_res_t* ul_s // user does not support this carrier return false; } - uint32_t cell_index = p.second; - ul_harq_proc* h = user->get_ul_harq(get_tti_tx_ul(), cell_index); + ul_harq_proc* h = user->get_ul_harq(get_tti_tx_ul(), cc_cfg->enb_cc_idx); /* Indicate PHICH acknowledgment if needed */ if (h->has_pending_phich()) { @@ -1036,13 +1035,12 @@ void sf_sched::set_dl_data_sched_result(const pdcch_grid_t::alloc_result_t& dci_ continue; } sched_ue* user = &ue_it->second; - uint32_t cell_index = user->get_active_cell_index(cc_cfg->enb_cc_idx).second; - uint32_t data_before = user->get_requested_dl_bytes(cell_index).stop(); - const dl_harq_proc& dl_harq = user->get_dl_harq(data_alloc.pid, cell_index); + uint32_t data_before = user->get_requested_dl_bytes(cc_cfg->enb_cc_idx).stop(); + const dl_harq_proc& dl_harq = user->get_dl_harq(data_alloc.pid, cc_cfg->enb_cc_idx); bool is_newtx = dl_harq.is_empty(); int tbs = user->generate_dl_dci_format( - data_alloc.pid, data, get_tti_tx_dl(), cell_index, tti_alloc.get_cfi(), data_alloc.user_mask); + data_alloc.pid, data, get_tti_tx_dl(), cc_cfg->enb_cc_idx, tti_alloc.get_cfi(), data_alloc.user_mask); if (tbs <= 0) { log_h->warning("SCHED: DL %s failed rnti=0x%x, pid=%d, mask=%s, tbs=%d, buffer=%d\n", @@ -1051,7 +1049,7 @@ void sf_sched::set_dl_data_sched_result(const pdcch_grid_t::alloc_result_t& dci_ data_alloc.pid, data_alloc.user_mask.to_hex().c_str(), tbs, - user->get_requested_dl_bytes(cell_index).stop()); + user->get_requested_dl_bytes(cc_cfg->enb_cc_idx).stop()); continue; } @@ -1067,7 +1065,7 @@ void sf_sched::set_dl_data_sched_result(const pdcch_grid_t::alloc_result_t& dci_ dl_harq.nof_retx(0) + dl_harq.nof_retx(1), tbs, data_before, - user->get_requested_dl_bytes(cell_index).stop()); + user->get_requested_dl_bytes(cc_cfg->enb_cc_idx).stop()); dl_result->nof_data_elems++; } @@ -1171,8 +1169,7 @@ void sf_sched::set_ul_sched_result(const pdcch_grid_t::alloc_result_t& dci_resul if (ue_it == ue_list.end()) { continue; } - sched_ue* user = &ue_it->second; - uint32_t cell_index = user->get_active_cell_index(cc_cfg->enb_cc_idx).second; + sched_ue* user = &ue_it->second; srslte_dci_location_t cce_range = {0, 0}; if (ul_alloc.needs_pdcch()) { @@ -1183,18 +1180,18 @@ void sf_sched::set_ul_sched_result(const pdcch_grid_t::alloc_result_t& dci_resul uci_pusch_t uci_type = is_uci_included(this, *cc_results, user, cc_cfg->enb_cc_idx); /* Generate DCI Format1A */ - uint32_t total_data_before = user->get_pending_ul_data_total(get_tti_tx_ul(), cell_index); + uint32_t total_data_before = user->get_pending_ul_data_total(get_tti_tx_ul(), cc_cfg->enb_cc_idx); int tbs = user->generate_format0(pusch, get_tti_tx_ul(), - cell_index, + cc_cfg->enb_cc_idx, ul_alloc.alloc, ul_alloc.needs_pdcch(), cce_range, ul_alloc.msg3_mcs, uci_type); - ul_harq_proc* h = user->get_ul_harq(get_tti_tx_ul(), cell_index); - uint32_t new_pending_bytes = user->get_pending_ul_new_data(get_tti_tx_ul(), cell_index); + ul_harq_proc* h = user->get_ul_harq(get_tti_tx_ul(), cc_cfg->enb_cc_idx); + uint32_t new_pending_bytes = user->get_pending_ul_new_data(get_tti_tx_ul(), cc_cfg->enb_cc_idx); // Allow TBS=0 in case of UCI-only PUSCH if (tbs < 0 || (tbs == 0 && pusch->dci.tb.mcs_idx != 29)) { log_h->warning("SCHED: Error %s %s rnti=0x%x, pid=%d, dci=(%d,%d), prb=%s, bsr=%d\n", @@ -1254,9 +1251,8 @@ void sf_sched::generate_sched_results(sched_ue_list& ue_db) for (uint32_t i = 0; i < cc_result->ul_sched_result.nof_phich_elems; ++i) { auto& phich = phich_list[i]; if (phich.phich == phich_t::NACK) { - auto& ue = ue_db[phich.rnti]; - int ue_cc_idx = ue.enb_to_ue_cc_idx(cc_cfg->enb_cc_idx); - ul_harq_proc* h = (ue_cc_idx >= 0) ? ue.get_ul_harq(get_tti_tx_ul(), ue_cc_idx) : nullptr; + auto& ue = ue_db[phich.rnti]; + ul_harq_proc* h = ue.get_ul_harq(get_tti_tx_ul(), cc_cfg->enb_cc_idx); if (not is_ul_alloc(ue.get_rnti()) and h != nullptr and not h->is_empty()) { // There was a missed UL harq retx. Halt+Resume the HARQ phich.phich = phich_t::ACK; diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 9397eb665..3a8fc3683 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -425,26 +425,25 @@ void sched_ue::set_ul_snr(tti_point tti_rx, uint32_t enb_cc_idx, float snr, uint /** * Allocate MAC PDU for a UE HARQ pid - * @param data - * @param total_tbs - * @param ue_cc_idx * @return pair with allocated tbs and mcs */ tbs_info sched_ue::allocate_new_dl_mac_pdu(sched::dl_sched_data_t* data, dl_harq_proc* h, const rbgmask_t& user_mask, tti_point tti_tx_dl, - uint32_t ue_cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, uint32_t tb) { srslte_dci_dl_t* dci = &data->dci; uint32_t nof_prb = count_prb_per_tb(user_mask); - tbs_info tb_info = compute_mcs_and_tbs(ue_cc_idx, tti_tx_dl, nof_prb, cfi, *dci); + tbs_info tb_info = compute_mcs_and_tbs(enb_cc_idx, tti_tx_dl, nof_prb, cfi, *dci); // Allocate MAC PDU (subheaders, CEs, and SDUS) int rem_tbs = tb_info.tbs_bytes; - rem_tbs -= allocate_mac_ces(data, lch_handler, rem_tbs, ue_cc_idx); + if (cells[enb_cc_idx].get_ue_cc_idx() == 0) { + rem_tbs -= allocate_mac_ces(data, lch_handler, rem_tbs); + } rem_tbs -= allocate_mac_sdus(data, lch_handler, rem_tbs, tb); // Allocate DL UE Harq @@ -474,7 +473,7 @@ tbs_info sched_ue::allocate_new_dl_mac_pdu(sched::dl_sched_data_t* data, int sched_ue::generate_dl_dci_format(uint32_t pid, sched_interface::dl_sched_data_t* data, tti_point tti_tx_dl, - uint32_t ue_cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, const rbgmask_t& user_mask) { @@ -483,13 +482,13 @@ int sched_ue::generate_dl_dci_format(uint32_t pid, switch (dci_format) { case SRSLTE_DCI_FORMAT1: - tbs = generate_format1(pid, data, tti_tx_dl, ue_cc_idx, cfi, user_mask); + tbs = generate_format1(pid, data, tti_tx_dl, enb_cc_idx, cfi, user_mask); break; case SRSLTE_DCI_FORMAT2: - tbs = generate_format2(pid, data, tti_tx_dl, ue_cc_idx, cfi, user_mask); + tbs = generate_format2(pid, data, tti_tx_dl, enb_cc_idx, cfi, user_mask); break; case SRSLTE_DCI_FORMAT2A: - tbs = generate_format2a(pid, data, tti_tx_dl, ue_cc_idx, cfi, user_mask); + tbs = generate_format2a(pid, data, tti_tx_dl, enb_cc_idx, cfi, user_mask); break; default: Error("DCI format (%d) not implemented\n", dci_format); @@ -502,12 +501,13 @@ int sched_ue::generate_dl_dci_format(uint32_t pid, int sched_ue::generate_format1(uint32_t pid, sched_interface::dl_sched_data_t* data, tti_point tti_tx_dl, - uint32_t ue_cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, const rbgmask_t& user_mask) { - dl_harq_proc* h = &carriers[ue_cc_idx].harq_ent.dl_harq_procs()[pid]; - srslte_dci_dl_t* dci = &data->dci; + uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); + dl_harq_proc* h = &carriers[ue_cc_idx].harq_ent.dl_harq_procs()[pid]; + srslte_dci_dl_t* dci = &data->dci; // If the size of Format1 and Format1A is ambiguous in the common SS, use Format1A since the UE assumes // Common SS when spaces collide @@ -532,7 +532,7 @@ int sched_ue::generate_format1(uint32_t pid, tbs_info tbinfo; if (h->is_empty(0)) { - tbinfo = allocate_new_dl_mac_pdu(data, h, user_mask, tti_tx_dl, ue_cc_idx, cfi, 0); + tbinfo = allocate_new_dl_mac_pdu(data, h, user_mask, tti_tx_dl, enb_cc_idx, cfi, 0); } else { h->new_retx(user_mask, 0, tti_tx_dl, &tbinfo.mcs, &tbinfo.tbs_bytes, data->dci.location.ncce); Debug("SCHED: Alloc format1 previous mcs=%d, tbs=%d\n", tbinfo.mcs, tbinfo.tbs_bytes); @@ -555,23 +555,25 @@ int sched_ue::generate_format1(uint32_t pid, /** * Based on the amount of tx data, allocated PRBs, DCI params, etc. compute a valid MCS and resulting TBS - * @param ue_cc_idx user carrier index + * @param enb_cc_idx user carrier index * @param tti_tx_dl tti when the tx will occur * @param nof_alloc_prbs number of PRBs that were allocated * @param cfi Number of control symbols in Subframe * @param dci contains the RBG mask, and alloc type * @return pair with MCS and TBS (in bytes) */ -tbs_info sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_idx, +tbs_info sched_ue::compute_mcs_and_tbs(uint32_t enb_cc_idx, tti_point tti_tx_dl, uint32_t nof_alloc_prbs, uint32_t cfi, const srslte_dci_dl_t& dci) { - srslte::interval req_bytes = get_requested_dl_bytes(ue_cc_idx); + uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); + + srslte::interval req_bytes = get_requested_dl_bytes(enb_cc_idx); // Calculate exact number of RE for this PRB allocation - uint32_t nof_re = carriers[ue_cc_idx].get_cell_cfg()->get_dl_nof_res(tti_tx_dl, dci, cfi); + uint32_t nof_re = cells[enb_cc_idx].cell_cfg->get_dl_nof_res(tti_tx_dl, dci, cfi); // Compute MCS+TBS tbs_info tb = carriers[ue_cc_idx].alloc_tbs_dl(nof_alloc_prbs, nof_re, req_bytes.stop()); @@ -588,10 +590,11 @@ tbs_info sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_idx, int sched_ue::generate_format2a(uint32_t pid, sched_interface::dl_sched_data_t* data, tti_point tti_tx_dl, - uint32_t ue_cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, const rbgmask_t& user_mask) { + uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); dl_harq_proc* h = &carriers[ue_cc_idx].harq_ent.dl_harq_procs()[pid]; bool tb_en[SRSLTE_MAX_TB] = {false}; @@ -630,7 +633,7 @@ int sched_ue::generate_format2a(uint32_t pid, if (!h->is_empty(tb)) { h->new_retx(user_mask, tb, tti_tx_dl, &tbinfo.mcs, &tbinfo.tbs_bytes, data->dci.location.ncce); } else if (tb_en[tb] && no_retx) { - tbinfo = allocate_new_dl_mac_pdu(data, h, user_mask, tti_tx_dl, ue_cc_idx, cfi, tb); + tbinfo = allocate_new_dl_mac_pdu(data, h, user_mask, tti_tx_dl, enb_cc_idx, cfi, tb); } /* Fill DCI TB dedicated fields */ @@ -664,19 +667,20 @@ int sched_ue::generate_format2a(uint32_t pid, int sched_ue::generate_format2(uint32_t pid, sched_interface::dl_sched_data_t* data, tti_point tti_tx_dl, - uint32_t cc_idx, + uint32_t enb_cc_idx, uint32_t cfi, const rbgmask_t& user_mask) { /* Call Format 2a (common) */ - int ret = generate_format2a(pid, data, tti_tx_dl, cc_idx, cfi, user_mask); + int ret = generate_format2a(pid, data, tti_tx_dl, enb_cc_idx, cfi, user_mask); /* Compute precoding information */ - data->dci.format = SRSLTE_DCI_FORMAT2; + uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); + data->dci.format = SRSLTE_DCI_FORMAT2; if ((SRSLTE_DCI_IS_TB_EN(data->dci.tb[0]) + SRSLTE_DCI_IS_TB_EN(data->dci.tb[1])) == 1) { - data->dci.pinfo = (uint8_t)(carriers[cc_idx].dl_pmi + 1) % (uint8_t)5; + data->dci.pinfo = (uint8_t)(carriers[ue_cc_idx].dl_pmi + 1) % (uint8_t)5; } else { - data->dci.pinfo = (uint8_t)(carriers[cc_idx].dl_pmi & 1u); + data->dci.pinfo = (uint8_t)(carriers[ue_cc_idx].dl_pmi & 1u); } return ret; @@ -684,17 +688,18 @@ int sched_ue::generate_format2(uint32_t pid, int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, tti_point tti_tx_ul, - uint32_t ue_cc_idx, + uint32_t enb_cc_idx, prb_interval alloc, bool needs_pdcch, srslte_dci_location_t dci_pos, int explicit_mcs, uci_pusch_t uci_type) { - ul_harq_proc* h = get_ul_harq(tti_tx_ul, ue_cc_idx); - srslte_dci_ul_t* dci = &data->dci; + uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); + ul_harq_proc* h = get_ul_harq(tti_tx_ul, enb_cc_idx); + srslte_dci_ul_t* dci = &data->dci; - bool cqi_request = needs_cqi(tti_tx_ul.to_uint(), true); + bool cqi_request = needs_cqi(tti_tx_ul.to_uint(), enb_cc_idx, true); // Set DCI position data->needs_pdcch = needs_pdcch; @@ -715,7 +720,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, tbinfo.tbs_bytes = get_tbs_bytes(tbinfo.mcs, alloc.length(), false, true); } else { // dynamic mcs - uint32_t req_bytes = get_pending_ul_new_data(tti_tx_ul, ue_cc_idx); + uint32_t req_bytes = get_pending_ul_new_data(tti_tx_ul, enb_cc_idx); uint32_t N_srs = 0; uint32_t nof_symb = 2 * (SRSLTE_CP_NSYMB(cell.cp) - 1) - N_srs; uint32_t nof_re = nof_symb * alloc.length() * SRSLTE_NRE; @@ -807,12 +812,12 @@ uint32_t sched_ue::get_max_retx() return cfg.maxharq_tx; } -bool sched_ue::needs_cqi(uint32_t tti, uint32_t cc_idx, bool will_send) +bool sched_ue::needs_cqi(uint32_t tti, uint32_t enb_cc_idx, bool will_send) { bool ret = false; if (phy_config_dedicated_enabled && cfg.supported_cc_list[0].aperiodic_cqi_period && lch_handler.has_pending_dl_txs()) { - uint32_t interval = srslte_tti_interval(tti, carriers[cc_idx].dl_cqi_tti_rx.to_uint()); + uint32_t interval = srslte_tti_interval(tti, carriers[enb_to_ue_cc_idx(enb_cc_idx)].dl_cqi_tti_rx.to_uint()); bool needscqi = interval >= cfg.supported_cc_list[0].aperiodic_cqi_period; if (needscqi) { uint32_t interval_sent = srslte_tti_interval(tti, cqi_request_tti); @@ -830,17 +835,19 @@ bool sched_ue::needs_cqi(uint32_t tti, uint32_t cc_idx, bool will_send) /** * Compute the range of RBGs that avoids segmentation of TM and MAC subheader data. Always computed for highest CFI - * @param ue_cc_idx carrier of the UE + * @param enb_cc_idx carrier of the UE * @return range of number of RBGs that a UE can allocate in a given subframe */ -rbg_interval sched_ue::get_required_dl_rbgs(uint32_t ue_cc_idx) +rbg_interval sched_ue::get_required_dl_rbgs(uint32_t enb_cc_idx) { - srslte::interval req_bytes = get_requested_dl_bytes(ue_cc_idx); + assert(cells[enb_cc_idx].get_ue_cc_idx() >= 0); + const auto* cellparams = cells[enb_cc_idx].cell_cfg; + uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); + srslte::interval req_bytes = get_requested_dl_bytes(enb_cc_idx); if (req_bytes == srslte::interval{0, 0}) { return {0, 0}; } - const auto* cellparams = carriers[ue_cc_idx].get_cell_cfg(); - int pending_prbs = carriers[ue_cc_idx].get_required_prb_dl(to_tx_dl(current_tti), req_bytes.start()); + int pending_prbs = carriers[ue_cc_idx].get_required_prb_dl(to_tx_dl(current_tti), req_bytes.start()); if (pending_prbs < 0) { // Cannot fit allocation in given PRBs log_h->error("SCHED: DL CQI=%d does now allow fitting %d non-segmentable DL tx bytes into the cell bandwidth. " @@ -868,11 +875,14 @@ rbg_interval sched_ue::get_required_dl_rbgs(uint32_t ue_cc_idx) * - the upper boundary is set as a sum of: * - total data in all SRBs and DRBs including the MAC subheaders * - All CEs (ConRes and others) including respective MAC subheaders - * @ue_cc_idx carrier where allocation is being made + * @enb_cc_idx carrier where allocation is being made * @return */ -srslte::interval sched_ue::get_requested_dl_bytes(uint32_t ue_cc_idx) +srslte::interval sched_ue::get_requested_dl_bytes(uint32_t enb_cc_idx) { + assert(cells.at(enb_cc_idx).get_ue_cc_idx() >= 0); + uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); + /* Set Maximum boundary */ // Ensure there is space for ConRes and RRC Setup // SRB0 is a special case due to being RLC TM (no segmentation possible) @@ -927,9 +937,9 @@ uint32_t sched_ue::get_pending_dl_rlc_data() const return lch_handler.get_dl_tx_total(); } -uint32_t sched_ue::get_expected_dl_bitrate(uint32_t ue_cc_idx, int nof_rbgs) const +uint32_t sched_ue::get_expected_dl_bitrate(uint32_t enb_cc_idx, int nof_rbgs) const { - const cc_sched_ue* cc = &carriers[ue_cc_idx]; + const cc_sched_ue* cc = &carriers[cells.at(enb_cc_idx).get_ue_cc_idx()]; uint32_t nof_re = cc->get_cell_cfg()->get_dl_lb_nof_re( to_tx_dl(current_tti), count_prb_per_tb_approx(nof_rbgs, cc->get_cell_cfg()->nof_prb())); float max_coderate = srslte_cqi_to_coderate(std::min(cc->dl_cqi + 1u, 15u), cfg.use_tbs_index_alt); @@ -939,9 +949,9 @@ uint32_t sched_ue::get_expected_dl_bitrate(uint32_t ue_cc_idx, int nof_rbgs) con return tbs / tti_duration_ms; } -uint32_t sched_ue::get_expected_ul_bitrate(uint32_t ue_cc_idx, int nof_prbs) const +uint32_t sched_ue::get_expected_ul_bitrate(uint32_t enb_cc_idx, int nof_prbs) const { - const cc_sched_ue* cc = &carriers[ue_cc_idx]; + const cc_sched_ue* cc = &carriers[cells.at(enb_cc_idx).get_ue_cc_idx()]; uint32_t nof_prbs_alloc = nof_prbs < 0 ? cell.nof_prb : nof_prbs; uint32_t N_srs = 0; @@ -956,10 +966,10 @@ uint32_t sched_ue::get_expected_ul_bitrate(uint32_t ue_cc_idx, int nof_prbs) con /// Returns nof bytes allocated to active UL HARQs in the carrier cc_idx. /// NOTE: The returned value accounts for the MAC header and payload (RLC headers and actual data) -uint32_t sched_ue::get_pending_ul_old_data(uint32_t ue_cc_idx) +uint32_t sched_ue::get_pending_ul_old_data(uint32_t enb_cc_idx) { uint32_t pending_data = 0; - for (auto& h : carriers[ue_cc_idx].harq_ent.ul_harq_procs()) { + for (auto& h : carriers[enb_to_ue_cc_idx(enb_cc_idx)].harq_ent.ul_harq_procs()) { pending_data += h.get_pending_data(); } return pending_data; @@ -970,14 +980,15 @@ uint32_t sched_ue::get_pending_ul_old_data() { uint32_t pending_ul_data = 0; for (uint32_t cc_idx = 0; cc_idx < carriers.size(); ++cc_idx) { - pending_ul_data += get_pending_ul_old_data(cc_idx); + pending_ul_data += get_pending_ul_old_data(carriers[cc_idx].get_cell_cfg()->enb_cc_idx); } return pending_ul_data; } -uint32_t sched_ue::get_pending_ul_data_total(tti_point tti_tx_ul, int this_ue_cc_idx) +uint32_t sched_ue::get_pending_ul_data_total(tti_point tti_tx_ul, int this_enb_cc_idx) { static constexpr uint32_t lbsr_size = 4, sbsr_size = 2; + uint32_t this_ue_cc_idx = enb_to_ue_cc_idx(this_enb_cc_idx); // Note: If there are no active bearers, scheduling requests are also ignored. uint32_t pending_data = 0; @@ -995,7 +1006,7 @@ uint32_t sched_ue::get_pending_ul_data_total(tti_point tti_tx_ul, int this_ue_cc // may be fully occupied by a BSR, and RRC the message transmission needs to be postponed. pending_data += (pending_lcgs <= 1) ? sbsr_size : lbsr_size; } else { - if (is_sr_triggered() and this_ue_cc_idx >= 0) { + if (is_sr_triggered() and this_enb_cc_idx >= 0) { // Check if this_cc_idx is the carrier with highest CQI uint32_t max_cqi = 0, max_cc_idx = 0; for (uint32_t cc_idx = 0; cc_idx < carriers.size(); ++cc_idx) { @@ -1005,12 +1016,12 @@ uint32_t sched_ue::get_pending_ul_data_total(tti_point tti_tx_ul, int this_ue_cc max_cc_idx = cc_idx; } } - if ((int)max_cc_idx == this_ue_cc_idx) { + if (max_cc_idx == this_ue_cc_idx) { return 512; } } for (uint32_t cc_idx = 0; cc_idx < carriers.size(); ++cc_idx) { - if (needs_cqi(tti_tx_ul.to_uint(), cc_idx)) { + if (needs_cqi(tti_tx_ul.to_uint(), carriers[cc_idx].get_cell_cfg()->enb_cc_idx)) { return 128; } } @@ -1019,9 +1030,9 @@ uint32_t sched_ue::get_pending_ul_data_total(tti_point tti_tx_ul, int this_ue_cc return pending_data; } -uint32_t sched_ue::get_pending_ul_new_data(tti_point tti_tx_ul, int this_ue_cc_idx) +uint32_t sched_ue::get_pending_ul_new_data(tti_point tti_tx_ul, int this_enb_cc_idx) { - uint32_t pending_data = get_pending_ul_data_total(tti_tx_ul, this_ue_cc_idx); + uint32_t pending_data = get_pending_ul_data_total(tti_tx_ul, this_enb_cc_idx); // Subtract all the UL data already allocated in the UL harqs uint32_t pending_ul_data = get_pending_ul_old_data(); @@ -1036,9 +1047,9 @@ uint32_t sched_ue::get_pending_ul_new_data(tti_point tti_tx_ul, int this_ue_cc_i return pending_data; } -uint32_t sched_ue::get_required_prb_ul(uint32_t cc_idx, uint32_t req_bytes) +uint32_t sched_ue::get_required_prb_ul(uint32_t enb_cc_idx, uint32_t req_bytes) { - return carriers[cc_idx].get_required_prb_ul(req_bytes); + return carriers[enb_to_ue_cc_idx(enb_cc_idx)].get_required_prb_ul(req_bytes); } bool sched_ue::is_sr_triggered() @@ -1047,32 +1058,36 @@ bool sched_ue::is_sr_triggered() } /* Gets HARQ process with oldest pending retx */ -dl_harq_proc* sched_ue::get_pending_dl_harq(tti_point tti_tx_dl, uint32_t ue_cc_idx) +dl_harq_proc* sched_ue::get_pending_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_idx) { + uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); if (ue_cc_idx < carriers.size() and carriers[ue_cc_idx].cc_state() == cc_st::active) { return carriers[ue_cc_idx].harq_ent.get_pending_dl_harq(tti_tx_dl); } return nullptr; } -dl_harq_proc* sched_ue::get_empty_dl_harq(tti_point tti_tx_dl, uint32_t ue_cc_idx) +dl_harq_proc* sched_ue::get_empty_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_idx) { + uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); if (ue_cc_idx < carriers.size() and carriers[ue_cc_idx].cc_state() == cc_st::active) { return carriers[ue_cc_idx].harq_ent.get_empty_dl_harq(tti_tx_dl); } return nullptr; } -ul_harq_proc* sched_ue::get_ul_harq(tti_point tti_tx_ul, uint32_t ue_cc_idx) +ul_harq_proc* sched_ue::get_ul_harq(tti_point tti_tx_ul, uint32_t enb_cc_idx) { + uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); if (ue_cc_idx < carriers.size() and carriers[ue_cc_idx].cc_state() == cc_st::active) { return carriers[ue_cc_idx].harq_ent.get_ul_harq(tti_tx_ul); } return nullptr; } -const dl_harq_proc& sched_ue::get_dl_harq(uint32_t idx, uint32_t ue_cc_idx) const +const dl_harq_proc& sched_ue::get_dl_harq(uint32_t idx, uint32_t enb_cc_idx) const { + uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); return carriers[ue_cc_idx].harq_ent.dl_harq_procs()[idx]; } @@ -1089,8 +1104,9 @@ std::pair sched_ue::get_active_cell_index(uint32_t enb_cc_idx) c return {false, std::numeric_limits::max()}; } -uint32_t sched_ue::get_aggr_level(uint32_t ue_cc_idx, uint32_t nof_bits) +uint32_t sched_ue::get_aggr_level(uint32_t enb_cc_idx, uint32_t nof_bits) { + uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); return carriers[ue_cc_idx].get_aggr_level(nof_bits); } @@ -1162,7 +1178,7 @@ std::bitset sched_ue::scell_activation_mask() const int sched_ue::enb_to_ue_cc_idx(uint32_t enb_cc_idx) const { - return cells.at(enb_cc_idx).get_ue_cc_idx(); + return enb_cc_idx < cells.size() ? cells[enb_cc_idx].get_ue_cc_idx() : -1; } float diff_coderate_maxcoderate(int mcs, diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_lch.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_lch.cc index 6cf176596..7e2d0d555 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_lch.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_lch.cc @@ -350,15 +350,8 @@ uint32_t allocate_mac_sdus(sched_interface::dl_sched_data_t* data, return total_tbs - rem_tbs; } -uint32_t allocate_mac_ces(sched_interface::dl_sched_data_t* data, - lch_ue_manager& lch_handler, - uint32_t total_tbs, - uint32_t ue_cc_idx) +uint32_t allocate_mac_ces(sched_interface::dl_sched_data_t* data, lch_ue_manager& lch_handler, uint32_t total_tbs) { - if (ue_cc_idx != 0) { - return 0; - } - int rem_tbs = total_tbs; while (not lch_handler.pending_ces.empty() and data->nof_pdu_elems[0] < sched_interface::MAX_RLC_PDU_LIST) { int toalloc = srslte::ce_total_size(lch_handler.pending_ces.front()); diff --git a/srsenb/src/stack/mac/schedulers/sched_base.cc b/srsenb/src/stack/mac/schedulers/sched_base.cc index 51da912a4..fa336fad9 100644 --- a/srsenb/src/stack/mac/schedulers/sched_base.cc +++ b/srsenb/src/stack/mac/schedulers/sched_base.cc @@ -90,20 +90,18 @@ int get_ue_cc_idx_if_pdsch_enabled(const sched_ue& user, sf_sched* tti_sched) } const dl_harq_proc* get_dl_retx_harq(sched_ue& user, sf_sched* tti_sched) { - int ue_cc_idx = get_ue_cc_idx_if_pdsch_enabled(user, tti_sched); - if (ue_cc_idx < 0) { + if (get_ue_cc_idx_if_pdsch_enabled(user, tti_sched) < 0) { return nullptr; } - dl_harq_proc* h = user.get_pending_dl_harq(tti_sched->get_tti_tx_dl(), ue_cc_idx); + dl_harq_proc* h = user.get_pending_dl_harq(tti_sched->get_tti_tx_dl(), tti_sched->get_enb_cc_idx()); return h; } const dl_harq_proc* get_dl_newtx_harq(sched_ue& user, sf_sched* tti_sched) { - int ue_cc_idx = get_ue_cc_idx_if_pdsch_enabled(user, tti_sched); - if (ue_cc_idx < 0) { + if (get_ue_cc_idx_if_pdsch_enabled(user, tti_sched) < 0) { return nullptr; } - return user.get_empty_dl_harq(tti_sched->get_tti_tx_dl(), ue_cc_idx); + return user.get_empty_dl_harq(tti_sched->get_tti_tx_dl(), tti_sched->get_enb_cc_idx()); } int get_ue_cc_idx_if_pusch_enabled(const sched_ue& user, sf_sched* tti_sched, bool needs_pdcch) @@ -126,20 +124,18 @@ int get_ue_cc_idx_if_pusch_enabled(const sched_ue& user, sf_sched* tti_sched, bo } const ul_harq_proc* get_ul_retx_harq(sched_ue& user, sf_sched* tti_sched) { - int ue_cc_idx = get_ue_cc_idx_if_pusch_enabled(user, tti_sched, false); - if (ue_cc_idx < 0) { + if (get_ue_cc_idx_if_pusch_enabled(user, tti_sched, false) < 0) { return nullptr; } - const ul_harq_proc* h = user.get_ul_harq(tti_sched->get_tti_tx_ul(), ue_cc_idx); + const ul_harq_proc* h = user.get_ul_harq(tti_sched->get_tti_tx_ul(), tti_sched->get_enb_cc_idx()); return h->has_pending_retx() ? h : nullptr; } const ul_harq_proc* get_ul_newtx_harq(sched_ue& user, sf_sched* tti_sched) { - int ue_cc_idx = get_ue_cc_idx_if_pusch_enabled(user, tti_sched, true); - if (ue_cc_idx < 0) { + if (get_ue_cc_idx_if_pusch_enabled(user, tti_sched, true) < 0) { return nullptr; } - const ul_harq_proc* h = user.get_ul_harq(tti_sched->get_tti_tx_ul(), ue_cc_idx); + const ul_harq_proc* h = user.get_ul_harq(tti_sched->get_tti_tx_ul(), tti_sched->get_enb_cc_idx()); return h->is_empty() ? h : nullptr; } diff --git a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc index 3bd539753..a4c6798c7 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc @@ -79,7 +79,7 @@ uint32_t sched_time_pf::try_dl_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* t } } if (code != alloc_outcome_t::DCI_COLLISION and ue_ctxt.dl_newtx_h != nullptr) { - rbg_interval req_rbgs = ue.get_required_dl_rbgs(ue_ctxt.ue_cc_idx); + rbg_interval req_rbgs = ue.get_required_dl_rbgs(cc_cfg->enb_cc_idx); // Check if there is an empty harq for the newtx if (req_rbgs.stop() == 0) { return 0; @@ -90,7 +90,7 @@ uint32_t sched_time_pf::try_dl_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* t // empty RBGs were found code = tti_sched->alloc_dl_user(&ue, newtx_mask, ue_ctxt.dl_newtx_h->get_id()); if (code == alloc_outcome_t::SUCCESS) { - return ue.get_expected_dl_bitrate(ue_ctxt.ue_cc_idx, newtx_mask.count()) * tti_duration_ms / 8; + return ue.get_expected_dl_bitrate(cc_cfg->enb_cc_idx, newtx_mask.count()) * tti_duration_ms / 8; } } } @@ -136,19 +136,19 @@ uint32_t sched_time_pf::try_ul_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* t estim_tbs_bytes = code == alloc_outcome_t::SUCCESS ? ue_ctxt.ul_h->get_pending_data() : 0; } else { // Note: h->is_empty check is required, in case CA allocated a small UL grant for UCI - uint32_t pending_data = ue.get_pending_ul_new_data(tti_sched->get_tti_tx_ul(), ue_ctxt.ue_cc_idx); + uint32_t pending_data = ue.get_pending_ul_new_data(tti_sched->get_tti_tx_ul(), cc_cfg->enb_cc_idx); // Check if there is a empty harq, and data to transmit if (pending_data == 0) { return 0; } - uint32_t pending_rb = ue.get_required_prb_ul(ue_ctxt.ue_cc_idx, pending_data); + uint32_t pending_rb = ue.get_required_prb_ul(cc_cfg->enb_cc_idx, pending_data); prb_interval alloc = find_contiguous_ul_prbs(pending_rb, tti_sched->get_ul_mask()); if (alloc.empty()) { return 0; } code = tti_sched->alloc_ul_user(&ue, alloc); estim_tbs_bytes = code == alloc_outcome_t::SUCCESS - ? ue.get_expected_ul_bitrate(ue_ctxt.ue_cc_idx, alloc.length()) * tti_duration_ms / 8 + ? ue.get_expected_ul_bitrate(cc_cfg->enb_cc_idx, alloc.length()) * tti_duration_ms / 8 : 0; } if (code == alloc_outcome_t::DCI_COLLISION) { @@ -178,7 +178,7 @@ void sched_time_pf::ue_ctxt::new_tti(const sched_cell_params_t& cell, sched_ue& dl_newtx_h = get_dl_newtx_harq(ue, tti_sched); if (dl_retx_h != nullptr or dl_newtx_h != nullptr) { // calculate DL PF priority - float r = ue.get_expected_dl_bitrate(ue_cc_idx) / 8; + float r = ue.get_expected_dl_bitrate(cell.enb_cc_idx) / 8; float R = dl_avg_rate(); dl_prio = (R != 0) ? r / pow(R, fairness_coeff) : (r == 0 ? 0 : std::numeric_limits::max()); } @@ -189,7 +189,7 @@ void sched_time_pf::ue_ctxt::new_tti(const sched_cell_params_t& cell, sched_ue& ul_h = get_ul_newtx_harq(ue, tti_sched); } if (ul_h != nullptr) { - float r = ue.get_expected_ul_bitrate(ue_cc_idx) / 8; + float r = ue.get_expected_ul_bitrate(cell.enb_cc_idx) / 8; float R = ul_avg_rate(); ul_prio = (R != 0) ? r / pow(R, fairness_coeff) : (r == 0 ? 0 : std::numeric_limits::max()); } diff --git a/srsenb/src/stack/mac/schedulers/sched_time_rr.cc b/srsenb/src/stack/mac/schedulers/sched_time_rr.cc index b7b7660fc..e35c59b0e 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_rr.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_rr.cc @@ -65,13 +65,12 @@ void sched_time_rr::sched_dl_newtxs(std::map& ue_db, sf_sche if (iter == ue_db.end()) { iter = ue_db.begin(); // wrap around } - sched_ue& user = iter->second; - int ue_cc_idx = user.enb_to_ue_cc_idx(cc_cfg->enb_cc_idx); - if (ue_cc_idx < 0) { + sched_ue& user = iter->second; + if (user.enb_to_ue_cc_idx(cc_cfg->enb_cc_idx) < 0) { continue; } const dl_harq_proc* h = get_dl_newtx_harq(user, tti_sched); - rbg_interval req_rbgs = user.get_required_dl_rbgs(ue_cc_idx); + rbg_interval req_rbgs = user.get_required_dl_rbgs(cc_cfg->enb_cc_idx); // Check if there is an empty harq for the newtx if (h == nullptr or req_rbgs.stop() == 0) { continue; @@ -138,13 +137,12 @@ void sched_time_rr::sched_ul_newtxs(std::map& ue_db, sf_sche if (h == nullptr) { continue; } - uint32_t ue_cc_idx = user.enb_to_ue_cc_idx(cc_cfg->enb_cc_idx); - uint32_t pending_data = user.get_pending_ul_new_data(tti_sched->get_tti_tx_ul(), ue_cc_idx); + uint32_t pending_data = user.get_pending_ul_new_data(tti_sched->get_tti_tx_ul(), cc_cfg->enb_cc_idx); // Check if there is a empty harq, and data to transmit if (pending_data == 0) { continue; } - uint32_t pending_rb = user.get_required_prb_ul(ue_cc_idx, pending_data); + uint32_t pending_rb = user.get_required_prb_ul(cc_cfg->enb_cc_idx, pending_data); prb_interval alloc = find_contiguous_ul_prbs(pending_rb, tti_sched->get_ul_mask()); if (alloc.empty()) { continue; diff --git a/srsenb/test/mac/sched_grid_test.cc b/srsenb/test/mac/sched_grid_test.cc index b1c927589..fbea4c64b 100644 --- a/srsenb/test/mac/sched_grid_test.cc +++ b/srsenb/test/mac/sched_grid_test.cc @@ -20,11 +20,11 @@ const uint32_t seed = std::chrono::system_clock::now().time_since_epoch().count( const uint32_t PCell_IDX = 0; const std::array prb_list = {6, 15, 25, 50, 75, 100}; -uint32_t get_aggr_level(sched_ue& sched_ue, uint32_t ue_cc_idx, const std::vector& cell_params) +uint32_t get_aggr_level(sched_ue& sched_ue, uint32_t enb_cc_idx, const std::vector& cell_params) { srslte_dci_format_t dci_format = sched_ue.get_dci_format(); - uint32_t nof_dci_bits = srslte_dci_format_sizeof(&cell_params[ue_cc_idx].cfg.cell, nullptr, nullptr, dci_format); - uint32_t aggr_level = sched_ue.get_aggr_level(ue_cc_idx, nof_dci_bits); + uint32_t nof_dci_bits = srslte_dci_format_sizeof(&cell_params[enb_cc_idx].cfg.cell, nullptr, nullptr, dci_format); + uint32_t aggr_level = sched_ue.get_aggr_level(enb_cc_idx, nof_dci_bits); return aggr_level; } From dadee757a11ab11526f760f44246fe657898d5d3 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 15 Jan 2021 18:31:39 +0000 Subject: [PATCH 088/138] moved harq entity and tpc to sched_ue_cell --- srsenb/hdr/stack/mac/sched_ue.h | 10 +-- .../stack/mac/sched_ue_ctrl/sched_ue_cell.h | 13 ++- srsenb/src/stack/mac/sched_ue.cc | 79 +++++++++---------- .../stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 16 +++- srsenb/src/stack/mac/schedulers/sched_base.cc | 7 +- 5 files changed, 68 insertions(+), 57 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index b5d580f85..56c31d26b 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -18,7 +18,6 @@ #include #include -#include "sched_ue_ctrl/sched_harq.h" #include "sched_ue_ctrl/sched_lch.h" #include "sched_ue_ctrl/sched_ue_cell.h" #include "sched_ue_ctrl/tpc.h" @@ -36,10 +35,8 @@ struct tbs_info { }; struct cc_sched_ue { - const static int SCHED_MAX_HARQ_PROC = FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS; - cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, - const sched_ue_cell& cell_ue_, + sched_ue_cell& cell_ue_, uint16_t rnti_, uint32_t ue_cc_idx, srslte::tti_point current_tti); @@ -59,8 +56,6 @@ struct cc_sched_ue { int cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint32_t* mcs); cc_st cc_state() const { return cc_state_; } - harq_entity harq_ent; - uint32_t dl_ri = 0; tti_point dl_ri_tti_rx{}; uint32_t dl_pmi = 0; @@ -74,13 +69,12 @@ struct cc_sched_ue { uint32_t max_mcs_dl = 28, max_mcs_ul = 28; uint32_t max_aggr_level = 3; int fixed_mcs_ul = 0, fixed_mcs_dl = 0; - tpc tpc_fsm; private: // config srslte::log_ref log_h; const sched_interface::ue_cfg_t* cfg = nullptr; - const sched_ue_cell* cell_ue = nullptr; + sched_ue_cell* cell_ue = nullptr; uint16_t rnti; uint32_t ue_cc_idx = 0; srslte::tti_point cfg_tti; diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index e576cc856..e54198581 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -14,14 +14,19 @@ #define SRSLTE_SCHED_UE_CELL_H #include "../sched_common.h" +#include "sched_harq.h" +#include "tpc.h" namespace srsenb { struct sched_ue_cell { - using ue_cc_cfg = sched_interface::ue_cfg_t::cc_cfg_t; + using ue_cc_cfg = sched_interface::ue_cfg_t::cc_cfg_t; + const static int SCHED_MAX_HARQ_PROC = FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS; sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_); void set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_); + void reset(); + void finish_tti(tti_point tti_rx); bool configured() const { return ue_cc_idx >= 0; } int get_ue_cc_idx() const { return ue_cc_idx; } @@ -33,6 +38,12 @@ struct sched_ue_cell { /// Allowed DCI locations per per CFI and per subframe const ue_cce_locations_table dci_locations; + /// Cell HARQ Entity + harq_entity harq_ent; + + /// Cell Transmit Power Control state machine + tpc tpc_fsm; + private: const sched_interface::ue_cfg_t* ue_cfg = nullptr; int ue_cc_idx = -1; diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 3a8fc3683..9215f0a0b 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -190,13 +190,15 @@ void sched_ue::new_subframe(tti_point tti_rx, uint32_t enb_cc_idx) if (current_tti != tti_rx) { current_tti = tti_rx; lch_handler.new_tti(); - for (auto& cc : carriers) { - cc.harq_ent.new_tti(tti_rx); + for (auto& cc : cells) { + if (cc.configured()) { + cc.harq_ent.new_tti(tti_rx); + } } } - int ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); - if (ue_cc_idx >= 0) { - carriers.at(ue_cc_idx).tpc_fsm.new_tti(); + + if (cells[enb_cc_idx].configured()) { + cells[enb_cc_idx].tpc_fsm.new_tti(); } } @@ -238,7 +240,7 @@ void sched_ue::ul_buffer_add(uint8_t lcid, uint32_t bytes) void sched_ue::ul_phr(int phr) { - carriers[0].tpc_fsm.set_phr(phr); + cells[carriers[0].get_cell_cfg()->enb_cc_idx].tpc_fsm.set_phr(phr); } void sched_ue::dl_buffer_state(uint8_t lc_id, uint32_t tx_queue, uint32_t retx_queue) @@ -346,7 +348,7 @@ int sched_ue::set_ack_info(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t tb_id int tbs_acked = -1; cc_sched_ue* c = find_ue_carrier(enb_cc_idx); if (c != nullptr and c->cc_state() != cc_st::idle) { - std::pair p2 = c->harq_ent.set_ack_info(tti_rx, tb_idx, ack); + std::pair p2 = cells[enb_cc_idx].harq_ent.set_ack_info(tti_rx, tb_idx, ack); tbs_acked = p2.second; if (tbs_acked > 0) { Debug( @@ -364,7 +366,7 @@ void sched_ue::set_ul_crc(tti_point tti_rx, uint32_t enb_cc_idx, bool crc_res) { cc_sched_ue* c = find_ue_carrier(enb_cc_idx); if (c != nullptr and c->cc_state() != cc_st::idle) { - int ret = c->harq_ent.set_ul_crc(tti_rx, 0, crc_res); + int ret = cells[enb_cc_idx].harq_ent.set_ul_crc(tti_rx, 0, crc_res); if (ret < 0) { log_h->warning("Received UL CRC for invalid tti_rx=%d\n", (int)tti_rx.to_uint()); } @@ -409,7 +411,7 @@ void sched_ue::set_ul_snr(tti_point tti_rx, uint32_t enb_cc_idx, float snr, uint { cc_sched_ue* c = find_ue_carrier(enb_cc_idx); if (c != nullptr and c->cc_state() != cc_st::idle) { - c->tpc_fsm.set_snr(snr, ul_ch_code); + cells[enb_cc_idx].tpc_fsm.set_snr(snr, ul_ch_code); c->ul_cqi = srslte_cqi_from_snr(snr); c->ul_cqi_tti_rx = tti_rx; } else { @@ -506,7 +508,7 @@ int sched_ue::generate_format1(uint32_t pid, const rbgmask_t& user_mask) { uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); - dl_harq_proc* h = &carriers[ue_cc_idx].harq_ent.dl_harq_procs()[pid]; + dl_harq_proc* h = &cells[enb_cc_idx].harq_ent.dl_harq_procs()[pid]; srslte_dci_dl_t* dci = &data->dci; // If the size of Format1 and Format1A is ambiguous in the common SS, use Format1A since the UE assumes @@ -546,7 +548,7 @@ int sched_ue::generate_format1(uint32_t pid, dci->tb[0].rv = get_rvidx(h->nof_retx(0)); dci->tb[0].ndi = h->get_ndi(0); - dci->tpc_pucch = carriers[ue_cc_idx].tpc_fsm.encode_pucch_tpc(); + dci->tpc_pucch = cells[enb_cc_idx].tpc_fsm.encode_pucch_tpc(); data->tbs[0] = (uint32_t)tbinfo.tbs_bytes; data->tbs[1] = 0; } @@ -595,7 +597,7 @@ int sched_ue::generate_format2a(uint32_t pid, const rbgmask_t& user_mask) { uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); - dl_harq_proc* h = &carriers[ue_cc_idx].harq_ent.dl_harq_procs()[pid]; + dl_harq_proc* h = &cells[enb_cc_idx].harq_ent.dl_harq_procs()[pid]; bool tb_en[SRSLTE_MAX_TB] = {false}; srslte_dci_dl_t* dci = &data->dci; @@ -657,7 +659,7 @@ int sched_ue::generate_format2a(uint32_t pid, dci->rnti = rnti; dci->ue_cc_idx = ue_cc_idx; dci->pid = h->get_id(); - dci->tpc_pucch = carriers[ue_cc_idx].tpc_fsm.encode_pucch_tpc(); + dci->tpc_pucch = cells[enb_cc_idx].tpc_fsm.encode_pucch_tpc(); int ret = data->tbs[0] + data->tbs[1]; return ret; @@ -767,7 +769,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, dci->tb.ndi = h->get_ndi(0); dci->cqi_request = cqi_request; dci->freq_hop_fl = srslte_dci_ul_t::SRSLTE_RA_PUSCH_HOP_DISABLED; - dci->tpc_pusch = carriers[ue_cc_idx].tpc_fsm.encode_pusch_tpc(); + dci->tpc_pusch = cells[enb_cc_idx].tpc_fsm.encode_pusch_tpc(); dci->type2_alloc.riv = srslte_ra_type2_to_riv(alloc.length(), alloc.start(), cell.nof_prb); @@ -969,7 +971,7 @@ uint32_t sched_ue::get_expected_ul_bitrate(uint32_t enb_cc_idx, int nof_prbs) co uint32_t sched_ue::get_pending_ul_old_data(uint32_t enb_cc_idx) { uint32_t pending_data = 0; - for (auto& h : carriers[enb_to_ue_cc_idx(enb_cc_idx)].harq_ent.ul_harq_procs()) { + for (auto& h : cells[enb_cc_idx].harq_ent.ul_harq_procs()) { pending_data += h.get_pending_data(); } return pending_data; @@ -979,8 +981,10 @@ uint32_t sched_ue::get_pending_ul_old_data(uint32_t enb_cc_idx) uint32_t sched_ue::get_pending_ul_old_data() { uint32_t pending_ul_data = 0; - for (uint32_t cc_idx = 0; cc_idx < carriers.size(); ++cc_idx) { - pending_ul_data += get_pending_ul_old_data(carriers[cc_idx].get_cell_cfg()->enb_cc_idx); + for (uint32_t i = 0; i < cells.size(); ++i) { + if (cells[i].configured()) { + pending_ul_data += get_pending_ul_old_data(i); + } } return pending_ul_data; } @@ -1020,8 +1024,8 @@ uint32_t sched_ue::get_pending_ul_data_total(tti_point tti_tx_ul, int this_enb_c return 512; } } - for (uint32_t cc_idx = 0; cc_idx < carriers.size(); ++cc_idx) { - if (needs_cqi(tti_tx_ul.to_uint(), carriers[cc_idx].get_cell_cfg()->enb_cc_idx)) { + for (uint32_t i = 0; i < cells.size(); ++i) { + if (cells[i].configured() and needs_cqi(tti_tx_ul.to_uint(), i)) { return 128; } } @@ -1061,8 +1065,8 @@ bool sched_ue::is_sr_triggered() dl_harq_proc* sched_ue::get_pending_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_idx) { uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - if (ue_cc_idx < carriers.size() and carriers[ue_cc_idx].cc_state() == cc_st::active) { - return carriers[ue_cc_idx].harq_ent.get_pending_dl_harq(tti_tx_dl); + if (cells[enb_cc_idx].configured() and carriers[ue_cc_idx].cc_state() == cc_st::active) { + return cells[enb_cc_idx].harq_ent.get_pending_dl_harq(tti_tx_dl); } return nullptr; } @@ -1070,8 +1074,8 @@ dl_harq_proc* sched_ue::get_pending_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc dl_harq_proc* sched_ue::get_empty_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_idx) { uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - if (ue_cc_idx < carriers.size() and carriers[ue_cc_idx].cc_state() == cc_st::active) { - return carriers[ue_cc_idx].harq_ent.get_empty_dl_harq(tti_tx_dl); + if (cells[enb_cc_idx].configured() and carriers[ue_cc_idx].cc_state() == cc_st::active) { + return cells[enb_cc_idx].harq_ent.get_empty_dl_harq(tti_tx_dl); } return nullptr; } @@ -1079,16 +1083,15 @@ dl_harq_proc* sched_ue::get_empty_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_i ul_harq_proc* sched_ue::get_ul_harq(tti_point tti_tx_ul, uint32_t enb_cc_idx) { uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - if (ue_cc_idx < carriers.size() and carriers[ue_cc_idx].cc_state() == cc_st::active) { - return carriers[ue_cc_idx].harq_ent.get_ul_harq(tti_tx_ul); + if (cells[enb_cc_idx].configured() and carriers[ue_cc_idx].cc_state() == cc_st::active) { + return cells[enb_cc_idx].harq_ent.get_ul_harq(tti_tx_ul); } return nullptr; } const dl_harq_proc& sched_ue::get_dl_harq(uint32_t idx, uint32_t enb_cc_idx) const { - uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - return carriers[ue_cc_idx].harq_ent.dl_harq_procs()[idx]; + return cells[enb_cc_idx].harq_ent.dl_harq_procs()[idx]; } std::pair sched_ue::get_active_cell_index(uint32_t enb_cc_idx) const @@ -1247,19 +1250,11 @@ int cc_sched_ue::cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint3 ***********************************************************************************************/ cc_sched_ue::cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, - const sched_ue_cell& cell_ue_, + sched_ue_cell& cell_ue_, uint16_t rnti_, uint32_t ue_cc_idx_, tti_point current_tti) : - cell_ue(&cell_ue_), - rnti(rnti_), - log_h(srslte::logmap::get("MAC")), - ue_cc_idx(ue_cc_idx_), - last_tti(current_tti), - harq_ent(SCHED_MAX_HARQ_PROC, SCHED_MAX_HARQ_PROC), - tpc_fsm(cell_ue_.cell_cfg->nof_prb(), - cell_ue_.cell_cfg->cfg.target_ul_sinr, - cell_ue_.cell_cfg->cfg.enable_phr_handling) + cell_ue(&cell_ue_), rnti(rnti_), log_h(srslte::logmap::get("MAC")), ue_cc_idx(ue_cc_idx_), last_tti(current_tti) { dl_cqi_rx = false; dl_cqi = (ue_cc_idx == 0) ? cell_ue_.cell_cfg->cfg.initial_dl_cqi : 0; @@ -1282,7 +1277,7 @@ void cc_sched_ue::reset() dl_cqi_tti_rx = tti_point{}; ul_cqi = 1; ul_cqi_tti_rx = tti_point{}; - harq_ent.reset(); + cell_ue->reset(); } void cc_sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_) @@ -1332,9 +1327,7 @@ void cc_sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_) void cc_sched_ue::finish_tti(tti_point tti_rx) { last_tti = tti_rx; - - // reset PIDs with pending data or blocked - harq_ent.reset_pending_data(last_tti); + cell_ue->finish_tti(tti_rx); // Check if cell state needs to be updated if (ue_cc_idx > 0 and cc_state_ == cc_st::deactivating) { @@ -1457,8 +1450,8 @@ uint32_t cc_sched_ue::get_required_prb_ul(uint32_t req_bytes) }; // find nof prbs that lead to a tbs just above req_bytes - int target_tbs = req_bytes + 4; - uint32_t max_prbs = std::min(tpc_fsm.max_ul_prbs(), get_cell_cfg()->nof_prb()); + int target_tbs = req_bytes + 4; + uint32_t max_prbs = std::min(cell_ue->tpc_fsm.max_ul_prbs(), get_cell_cfg()->nof_prb()); std::tuple ret = false_position_method(1u, max_prbs, target_tbs, compute_tbs_approx, [](int y) { return y == SRSLTE_ERROR; }); uint32_t req_prbs = std::get<2>(ret); diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index 80b8b8ab0..3a6b1da7c 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -21,7 +21,10 @@ namespace srsenb { *******************************************************/ sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_) : - cell_cfg(&cell_cfg_), dci_locations(generate_cce_location_table(rnti_, cell_cfg_)) + cell_cfg(&cell_cfg_), + dci_locations(generate_cce_location_table(rnti_, cell_cfg_)), + harq_ent(SCHED_MAX_HARQ_PROC, SCHED_MAX_HARQ_PROC), + tpc_fsm(cell_cfg->nof_prb(), cell_cfg->cfg.target_ul_sinr, cell_cfg->cfg.enable_phr_handling) {} void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) @@ -34,4 +37,15 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) } } +void sched_ue_cell::reset() +{ + harq_ent.reset(); +} + +void sched_ue_cell::finish_tti(tti_point tti_rx) +{ + // reset PIDs with pending data or blocked + harq_ent.reset_pending_data(tti_rx); +} + } // namespace srsenb diff --git a/srsenb/src/stack/mac/schedulers/sched_base.cc b/srsenb/src/stack/mac/schedulers/sched_base.cc index fa336fad9..d7434e4cb 100644 --- a/srsenb/src/stack/mac/schedulers/sched_base.cc +++ b/srsenb/src/stack/mac/schedulers/sched_base.cc @@ -83,7 +83,7 @@ int get_ue_cc_idx_if_pdsch_enabled(const sched_ue& user, sf_sched* tti_sched) } uint32_t cell_idx = p.second; // Do not allow allocations when PDSCH is deactivated - if (not user.pdsch_enabled(srslte::tti_point(tti_sched->get_tti_rx()), tti_sched->get_enb_cc_idx())) { + if (not user.pdsch_enabled(tti_sched->get_tti_rx(), tti_sched->get_enb_cc_idx())) { return -1; } return cell_idx; @@ -117,7 +117,7 @@ int get_ue_cc_idx_if_pusch_enabled(const sched_ue& user, sf_sched* tti_sched, bo } uint32_t cell_idx = p.second; // Do not allow allocations when PDSCH is deactivated - if (not user.pusch_enabled(srslte::tti_point(tti_sched->get_tti_rx()), tti_sched->get_enb_cc_idx(), needs_pdcch)) { + if (not user.pusch_enabled(tti_sched->get_tti_rx(), tti_sched->get_enb_cc_idx(), needs_pdcch)) { return -1; } return cell_idx; @@ -167,8 +167,7 @@ alloc_outcome_t try_ul_retx_alloc(sf_sched& tti_sched, sched_ue& ue, const ul_ha } // Avoid measGaps accounting for PDCCH - srslte::tti_point tti_rx{tti_sched.get_tti_rx()}; - if (not ue.pusch_enabled(tti_rx, tti_sched.get_enb_cc_idx(), true)) { + if (not ue.pusch_enabled(tti_sched.get_tti_rx(), tti_sched.get_enb_cc_idx(), true)) { return alloc_outcome_t::MEASGAP_COLLISION; } uint32_t nof_prbs = alloc.length(); From c1ff03bd1a713e62a057cc70744bdfcc8f44aa69 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 18 Jan 2021 11:09:48 +0000 Subject: [PATCH 089/138] moved uci feedback and state variables from cc_sched_ue to sched_ue_cell class --- srsenb/hdr/stack/mac/sched_ue.h | 30 +-- .../stack/mac/sched_ue_ctrl/sched_ue_cell.h | 35 ++- srsenb/src/stack/mac/sched.cc | 2 +- srsenb/src/stack/mac/sched_grid.cc | 16 +- srsenb/src/stack/mac/sched_ue.cc | 234 ++++++------------ .../stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 95 ++++++- 6 files changed, 205 insertions(+), 207 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index 56c31d26b..3a53caffd 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -27,7 +27,6 @@ namespace srsenb { typedef enum { UCI_PUSCH_NONE = 0, UCI_PUSCH_CQI, UCI_PUSCH_ACK, UCI_PUSCH_ACK_CQI } uci_pusch_t; -enum class cc_st { active, idle, activating, deactivating }; struct tbs_info { int tbs_bytes = -1; @@ -35,14 +34,9 @@ struct tbs_info { }; struct cc_sched_ue { - cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, - sched_ue_cell& cell_ue_, - uint16_t rnti_, - uint32_t ue_cc_idx, - srslte::tti_point current_tti); + cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, sched_ue_cell& cell_ue_, uint16_t rnti_, uint32_t ue_cc_idx); void reset(); void set_cfg(const sched_interface::ue_cfg_t& cfg); ///< reconfigure ue carrier - void finish_tti(srslte::tti_point tti_rx); uint32_t get_aggr_level(uint32_t nof_bits); tbs_info alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul); @@ -52,23 +46,7 @@ struct cc_sched_ue { uint32_t get_required_prb_ul(uint32_t req_bytes); const sched_cell_params_t* get_cell_cfg() const { return cell_ue->cell_cfg; } uint32_t get_ue_cc_idx() const { return ue_cc_idx; } - void set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi); int cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint32_t* mcs); - cc_st cc_state() const { return cc_state_; } - - uint32_t dl_ri = 0; - tti_point dl_ri_tti_rx{}; - uint32_t dl_pmi = 0; - tti_point dl_pmi_tti_rx{}; - uint32_t dl_cqi = 1; - tti_point dl_cqi_tti_rx{0}; - uint32_t ul_cqi = 1; - tti_point ul_cqi_tti_rx{}; - bool dl_cqi_rx = false; - - uint32_t max_mcs_dl = 28, max_mcs_ul = 28; - uint32_t max_aggr_level = 3; - int fixed_mcs_ul = 0, fixed_mcs_dl = 0; private: // config @@ -78,10 +56,6 @@ private: uint16_t rnti; uint32_t ue_cc_idx = 0; srslte::tti_point cfg_tti; - - // state - srslte::tti_point last_tti; - cc_st cc_state_ = cc_st::idle; }; /** This class is designed to be thread-safe because it is called from workers through scheduler thread and from @@ -185,7 +159,7 @@ public: srslte_dci_format_t get_dci_format(); const sched_dci_cce_t* get_locations(uint32_t enb_cc_idx, uint32_t current_cfi, uint32_t sf_idx) const; - cc_sched_ue* find_ue_carrier(uint32_t enb_cc_idx); + sched_ue_cell* find_ue_carrier(uint32_t enb_cc_idx); size_t nof_carriers_configured() const { return carriers.size(); } std::bitset scell_activation_mask() const; int enb_to_ue_cc_idx(uint32_t enb_cc_idx) const; diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index e54198581..840374cb6 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -19,18 +19,26 @@ namespace srsenb { +enum class cc_st { active, idle, activating, deactivating }; + struct sched_ue_cell { using ue_cc_cfg = sched_interface::ue_cfg_t::cc_cfg_t; const static int SCHED_MAX_HARQ_PROC = FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS; - sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_); + sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_, tti_point current_tti); void set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_); + void new_tti(tti_point tti_rx); void reset(); void finish_tti(tti_point tti_rx); + void set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_); + bool configured() const { return ue_cc_idx >= 0; } int get_ue_cc_idx() const { return ue_cc_idx; } const ue_cc_cfg* get_ue_cc_cfg() const { return configured() ? &ue_cfg->supported_cc_list[ue_cc_idx] : nullptr; } + cc_st cc_state() const { return cc_state_; } + + const uint16_t rnti; /// Cell const configuration const sched_cell_params_t* cell_cfg = nullptr; @@ -44,9 +52,32 @@ struct sched_ue_cell { /// Cell Transmit Power Control state machine tpc tpc_fsm; + /// UCI Feedback + uint32_t dl_ri = 0; + tti_point dl_ri_tti_rx{}; + uint32_t dl_pmi = 0; + tti_point dl_pmi_tti_rx{}; + uint32_t dl_cqi = 1; + tti_point dl_cqi_tti_rx{0}; + uint32_t ul_cqi = 1; + tti_point ul_cqi_tti_rx{}; + bool dl_cqi_rx = false; + + uint32_t max_mcs_dl = 28, max_mcs_ul = 28; + uint32_t max_aggr_level = 3; + int fixed_mcs_ul = 0, fixed_mcs_dl = 0; + private: - const sched_interface::ue_cfg_t* ue_cfg = nullptr; + srslte::log_ref log_h{"MAC"}; + + const sched_interface::ue_cfg_t* ue_cfg = nullptr; + tti_point cfg_tti; int ue_cc_idx = -1; + + // state + tti_point current_tti; + srslte::tti_point last_tti; + cc_st cc_state_ = cc_st::idle; }; } // namespace srsenb diff --git a/srsenb/src/stack/mac/sched.cc b/srsenb/src/stack/mac/sched.cc index 464ac75e5..467fdf754 100644 --- a/srsenb/src/stack/mac/sched.cc +++ b/srsenb/src/stack/mac/sched.cc @@ -258,7 +258,7 @@ std::array sched::get_enb_ue_cc_map(uint16_t rnti) rnti, [this, &ret](sched_ue& ue) { for (size_t enb_cc_idx = 0; enb_cc_idx < carrier_schedulers.size(); ++enb_cc_idx) { - const cc_sched_ue* cc_ue = ue.find_ue_carrier(enb_cc_idx); + const sched_ue_cell* cc_ue = ue.find_ue_carrier(enb_cc_idx); if (cc_ue != nullptr) { ret[enb_cc_idx] = cc_ue->get_ue_cc_idx(); } diff --git a/srsenb/src/stack/mac/sched_grid.cc b/srsenb/src/stack/mac/sched_grid.cc index 6e15fa052..4508f8f1b 100644 --- a/srsenb/src/stack/mac/sched_grid.cc +++ b/srsenb/src/stack/mac/sched_grid.cc @@ -52,9 +52,9 @@ cc_sched_result* sf_sched_result::new_cc(uint32_t enb_cc_idx) bool sf_sched_result::is_ul_alloc(uint16_t rnti) const { - for (uint32_t i = 0; i < enb_cc_list.size(); ++i) { - for (uint32_t j = 0; j < enb_cc_list[i].ul_sched_result.nof_dci_elems; ++j) { - if (enb_cc_list[i].ul_sched_result.pusch[j].dci.rnti == rnti) { + for (const auto& cc : enb_cc_list) { + for (uint32_t j = 0; j < cc.ul_sched_result.nof_dci_elems; ++j) { + if (cc.ul_sched_result.pusch[j].dci.rnti == rnti) { return true; } } @@ -63,9 +63,9 @@ bool sf_sched_result::is_ul_alloc(uint16_t rnti) const } bool sf_sched_result::is_dl_alloc(uint16_t rnti) const { - for (uint32_t i = 0; i < enb_cc_list.size(); ++i) { - for (uint32_t j = 0; j < enb_cc_list[i].dl_sched_result.nof_data_elems; ++j) { - if (enb_cc_list[i].dl_sched_result.data[j].dci.rnti == rnti) { + for (const auto& cc : enb_cc_list) { + for (uint32_t j = 0; j < cc.dl_sched_result.nof_data_elems; ++j) { + if (cc.dl_sched_result.data[j].dci.rnti == rnti) { return true; } } @@ -456,7 +456,7 @@ alloc_outcome_t sf_grid_t::alloc_dl_data(sched_ue* user, const rbgmask_t& user_m { srslte_dci_format_t dci_format = user->get_dci_format(); uint32_t nof_bits = srslte_dci_format_sizeof(&cc_cfg->cfg.cell, nullptr, nullptr, dci_format); - uint32_t aggr_idx = user->find_ue_carrier(cc_cfg->enb_cc_idx)->get_aggr_level(nof_bits); + uint32_t aggr_idx = user->get_aggr_level(cc_cfg->enb_cc_idx, nof_bits); alloc_outcome_t ret = alloc_dl(aggr_idx, alloc_type_t::DL_DATA, user_mask, user); return ret; @@ -477,7 +477,7 @@ alloc_outcome_t sf_grid_t::alloc_ul_data(sched_ue* user, prb_interval alloc, boo // Generate PDCCH except for RAR and non-adaptive retx if (needs_pdcch) { uint32_t nof_bits = srslte_dci_format_sizeof(&cc_cfg->cfg.cell, nullptr, nullptr, SRSLTE_DCI_FORMAT0); - uint32_t aggr_idx = user->find_ue_carrier(cc_cfg->enb_cc_idx)->get_aggr_level(nof_bits); + uint32_t aggr_idx = user->get_aggr_level(cc_cfg->enb_cc_idx, nof_bits); if (not pdcch_alloc.alloc_dci(alloc_type_t::UL_DATA, aggr_idx, user)) { if (log_h->get_level() == srslte::LOG_LEVEL_DEBUG) { log_h->debug("No space in PDCCH for rnti=0x%x UL tx. Current PDCCH allocation: %s\n", diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 9215f0a0b..f962d25cc 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -104,7 +104,7 @@ void sched_ue::init(uint16_t rnti_, const std::vector& cell rnti = rnti_; cells.reserve(cell_list_params_.size()); for (auto& c : cell_list_params_) { - cells.emplace_back(rnti_, c); + cells.emplace_back(rnti_, c, current_tti); } Info("SCHED: Added user rnti=0x%x\n", rnti); } @@ -149,10 +149,10 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) if (ue_idx >= prev_supported_cc_list.size()) { // New carrier needs to be added - carriers.emplace_back(cfg, cells[cc_cfg.enb_cc_idx], rnti, ue_idx, current_tti); + carriers.emplace_back(cfg, cells[cc_cfg.enb_cc_idx], rnti, ue_idx); } else if (cc_cfg.enb_cc_idx != prev_supported_cc_list[ue_idx].enb_cc_idx) { // One carrier was added in the place of another - carriers[ue_idx] = cc_sched_ue{cfg, cells[cc_cfg.enb_cc_idx], rnti, ue_idx, current_tti}; + carriers[ue_idx] = cc_sched_ue{cfg, cells[cc_cfg.enb_cc_idx], rnti, ue_idx}; if (ue_idx == 0) { log_h->info("SCHED: rnti=0x%x PCell is now enb_cc_idx=%d.\n", rnti, cc_cfg.enb_cc_idx); } @@ -160,8 +160,8 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) // The SCell internal configuration may have changed carriers[ue_idx].set_cfg(cfg); } - scell_activation_state_changed |= ue_idx > 0 and (carriers[ue_idx].cc_state() == cc_st::activating or - carriers[ue_idx].cc_state() == cc_st::deactivating); + scell_activation_state_changed |= ue_idx > 0 and (cells[cc_cfg.enb_cc_idx].cc_state() == cc_st::activating or + cells[cc_cfg.enb_cc_idx].cc_state() == cc_st::deactivating); } if (scell_activation_state_changed) { lch_handler.pending_ces.emplace_back(srslte::dl_sch_lcid::SCELL_ACTIVATION); @@ -222,8 +222,10 @@ void sched_ue::rem_bearer(uint32_t lc_id) void sched_ue::phy_config_enabled(tti_point tti_rx, bool enabled) { - for (cc_sched_ue& c : carriers) { - c.dl_cqi_tti_rx = tti_rx; + for (sched_ue_cell& c : cells) { + if (c.configured()) { + c.dl_cqi_tti_rx = tti_rx; + } } phy_config_dedicated_enabled = enabled; } @@ -345,9 +347,8 @@ bool sched_ue::pusch_enabled(tti_point tti_rx, uint32_t enb_cc_idx, bool needs_p int sched_ue::set_ack_info(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t tb_idx, bool ack) { - int tbs_acked = -1; - cc_sched_ue* c = find_ue_carrier(enb_cc_idx); - if (c != nullptr and c->cc_state() != cc_st::idle) { + int tbs_acked = -1; + if (cells[enb_cc_idx].cc_state() != cc_st::idle) { std::pair p2 = cells[enb_cc_idx].harq_ent.set_ack_info(tti_rx, tb_idx, ack); tbs_acked = p2.second; if (tbs_acked > 0) { @@ -364,8 +365,7 @@ int sched_ue::set_ack_info(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t tb_id void sched_ue::set_ul_crc(tti_point tti_rx, uint32_t enb_cc_idx, bool crc_res) { - cc_sched_ue* c = find_ue_carrier(enb_cc_idx); - if (c != nullptr and c->cc_state() != cc_st::idle) { + if (cells[enb_cc_idx].cc_state() != cc_st::idle) { int ret = cells[enb_cc_idx].harq_ent.set_ul_crc(tti_rx, 0, crc_res); if (ret < 0) { log_h->warning("Received UL CRC for invalid tti_rx=%d\n", (int)tti_rx.to_uint()); @@ -377,10 +377,9 @@ void sched_ue::set_ul_crc(tti_point tti_rx, uint32_t enb_cc_idx, bool crc_res) void sched_ue::set_dl_ri(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t ri) { - cc_sched_ue* c = find_ue_carrier(enb_cc_idx); - if (c != nullptr and c->cc_state() != cc_st::idle) { - c->dl_ri = ri; - c->dl_ri_tti_rx = tti_rx; + if (cells[enb_cc_idx].cc_state() != cc_st::idle) { + cells[enb_cc_idx].dl_ri = ri; + cells[enb_cc_idx].dl_ri_tti_rx = tti_rx; } else { log_h->warning("Received DL RI for invalid cell index %d\n", enb_cc_idx); } @@ -388,10 +387,9 @@ void sched_ue::set_dl_ri(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t ri) void sched_ue::set_dl_pmi(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t pmi) { - cc_sched_ue* c = find_ue_carrier(enb_cc_idx); - if (c != nullptr and c->cc_state() != cc_st::idle) { - c->dl_pmi = pmi; - c->dl_pmi_tti_rx = tti_rx; + if (cells[enb_cc_idx].cc_state() != cc_st::idle) { + cells[enb_cc_idx].dl_pmi = pmi; + cells[enb_cc_idx].dl_pmi_tti_rx = tti_rx; } else { log_h->warning("Received DL PMI for invalid cell index %d\n", enb_cc_idx); } @@ -399,9 +397,8 @@ void sched_ue::set_dl_pmi(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t pmi) void sched_ue::set_dl_cqi(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t cqi) { - cc_sched_ue* c = find_ue_carrier(enb_cc_idx); - if (c != nullptr and c->cc_state() != cc_st::idle) { - c->set_dl_cqi(tti_rx, cqi); + if (cells[enb_cc_idx].cc_state() != cc_st::idle) { + cells[enb_cc_idx].set_dl_cqi(tti_rx, cqi); } else { log_h->warning("Received DL CQI for invalid enb cell index %d\n", enb_cc_idx); } @@ -409,11 +406,10 @@ void sched_ue::set_dl_cqi(tti_point tti_rx, uint32_t enb_cc_idx, uint32_t cqi) void sched_ue::set_ul_snr(tti_point tti_rx, uint32_t enb_cc_idx, float snr, uint32_t ul_ch_code) { - cc_sched_ue* c = find_ue_carrier(enb_cc_idx); - if (c != nullptr and c->cc_state() != cc_st::idle) { + if (cells[enb_cc_idx].cc_state() != cc_st::idle) { cells[enb_cc_idx].tpc_fsm.set_snr(snr, ul_ch_code); - c->ul_cqi = srslte_cqi_from_snr(snr); - c->ul_cqi_tti_rx = tti_rx; + cells[enb_cc_idx].ul_cqi = srslte_cqi_from_snr(snr); + cells[enb_cc_idx].ul_cqi_tti_rx = tti_rx; } else { log_h->warning("Received SNR info for invalid cell index %d\n", enb_cc_idx); } @@ -606,7 +602,7 @@ int sched_ue::generate_format2a(uint32_t pid, bool no_retx = true; - if (carriers[ue_cc_idx].dl_ri == 0) { + if (cells[enb_cc_idx].dl_ri == 0) { if (h->is_empty(1)) { /* One layer, tb1 buffer is empty, send tb0 only */ tb_en[0] = true; @@ -677,12 +673,11 @@ int sched_ue::generate_format2(uint32_t pid, int ret = generate_format2a(pid, data, tti_tx_dl, enb_cc_idx, cfi, user_mask); /* Compute precoding information */ - uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - data->dci.format = SRSLTE_DCI_FORMAT2; + data->dci.format = SRSLTE_DCI_FORMAT2; if ((SRSLTE_DCI_IS_TB_EN(data->dci.tb[0]) + SRSLTE_DCI_IS_TB_EN(data->dci.tb[1])) == 1) { - data->dci.pinfo = (uint8_t)(carriers[ue_cc_idx].dl_pmi + 1) % (uint8_t)5; + data->dci.pinfo = (uint8_t)(cells[enb_cc_idx].dl_pmi + 1) % (uint8_t)5; } else { - data->dci.pinfo = (uint8_t)(carriers[ue_cc_idx].dl_pmi & 1u); + data->dci.pinfo = (uint8_t)(cells[enb_cc_idx].dl_pmi & 1u); } return ret; @@ -708,7 +703,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, dci->location = dci_pos; tbs_info tbinfo; - tbinfo.mcs = (explicit_mcs >= 0) ? explicit_mcs : carriers[ue_cc_idx].fixed_mcs_ul; + tbinfo.mcs = (explicit_mcs >= 0) ? explicit_mcs : cells[enb_cc_idx].fixed_mcs_ul; tbinfo.tbs_bytes = 0; bool is_newtx = h->is_empty(0); @@ -819,7 +814,7 @@ bool sched_ue::needs_cqi(uint32_t tti, uint32_t enb_cc_idx, bool will_send) bool ret = false; if (phy_config_dedicated_enabled && cfg.supported_cc_list[0].aperiodic_cqi_period && lch_handler.has_pending_dl_txs()) { - uint32_t interval = srslte_tti_interval(tti, carriers[enb_to_ue_cc_idx(enb_cc_idx)].dl_cqi_tti_rx.to_uint()); + uint32_t interval = srslte_tti_interval(tti, cells[enb_cc_idx].dl_cqi_tti_rx.to_uint()); bool needscqi = interval >= cfg.supported_cc_list[0].aperiodic_cqi_period; if (needscqi) { uint32_t interval_sent = srslte_tti_interval(tti, cqi_request_tti); @@ -854,7 +849,7 @@ rbg_interval sched_ue::get_required_dl_rbgs(uint32_t enb_cc_idx) // Cannot fit allocation in given PRBs log_h->error("SCHED: DL CQI=%d does now allow fitting %d non-segmentable DL tx bytes into the cell bandwidth. " "Consider increasing initial CQI value.\n", - carriers[ue_cc_idx].dl_cqi, + cells[enb_cc_idx].dl_cqi, req_bytes.start()); return {cellparams->nof_prb(), cellparams->nof_prb()}; } @@ -892,7 +887,7 @@ srslte::interval sched_ue::get_requested_dl_bytes(uint32_t enb_cc_idx) log_h->error("SRB0 must always be activated for DL\n"); return {}; } - if (carriers[ue_cc_idx].cc_state() != cc_st::active) { + if (cells[enb_cc_idx].cc_state() != cc_st::active) { return {}; } @@ -941,10 +936,10 @@ uint32_t sched_ue::get_pending_dl_rlc_data() const uint32_t sched_ue::get_expected_dl_bitrate(uint32_t enb_cc_idx, int nof_rbgs) const { - const cc_sched_ue* cc = &carriers[cells.at(enb_cc_idx).get_ue_cc_idx()]; - uint32_t nof_re = cc->get_cell_cfg()->get_dl_lb_nof_re( - to_tx_dl(current_tti), count_prb_per_tb_approx(nof_rbgs, cc->get_cell_cfg()->nof_prb())); - float max_coderate = srslte_cqi_to_coderate(std::min(cc->dl_cqi + 1u, 15u), cfg.use_tbs_index_alt); + auto& cc = cells[enb_cc_idx]; + uint32_t nof_re = + cc.cell_cfg->get_dl_lb_nof_re(to_tx_dl(current_tti), count_prb_per_tb_approx(nof_rbgs, cc.cell_cfg->nof_prb())); + float max_coderate = srslte_cqi_to_coderate(std::min(cc.dl_cqi + 1u, 15u), cfg.use_tbs_index_alt); // Inverse of srslte_coderate(tbs, nof_re) uint32_t tbs = max_coderate * nof_re - 24; @@ -953,13 +948,12 @@ uint32_t sched_ue::get_expected_dl_bitrate(uint32_t enb_cc_idx, int nof_rbgs) co uint32_t sched_ue::get_expected_ul_bitrate(uint32_t enb_cc_idx, int nof_prbs) const { - const cc_sched_ue* cc = &carriers[cells.at(enb_cc_idx).get_ue_cc_idx()]; - uint32_t nof_prbs_alloc = nof_prbs < 0 ? cell.nof_prb : nof_prbs; + uint32_t nof_prbs_alloc = nof_prbs < 0 ? cell.nof_prb : nof_prbs; uint32_t N_srs = 0; uint32_t nof_symb = 2 * (SRSLTE_CP_NSYMB(cell.cp) - 1) - N_srs; uint32_t nof_re = nof_symb * nof_prbs_alloc * SRSLTE_NRE; - float max_coderate = srslte_cqi_to_coderate(std::min(cc->ul_cqi + 1u, 15u), false); + float max_coderate = srslte_cqi_to_coderate(std::min(cells[enb_cc_idx].ul_cqi + 1u, 15u), false); // Inverse of srslte_coderate(tbs, nof_re) uint32_t tbs = max_coderate * nof_re - 24; @@ -992,7 +986,6 @@ uint32_t sched_ue::get_pending_ul_old_data() uint32_t sched_ue::get_pending_ul_data_total(tti_point tti_tx_ul, int this_enb_cc_idx) { static constexpr uint32_t lbsr_size = 4, sbsr_size = 2; - uint32_t this_ue_cc_idx = enb_to_ue_cc_idx(this_enb_cc_idx); // Note: If there are no active bearers, scheduling requests are also ignored. uint32_t pending_data = 0; @@ -1013,14 +1006,16 @@ uint32_t sched_ue::get_pending_ul_data_total(tti_point tti_tx_ul, int this_enb_c if (is_sr_triggered() and this_enb_cc_idx >= 0) { // Check if this_cc_idx is the carrier with highest CQI uint32_t max_cqi = 0, max_cc_idx = 0; - for (uint32_t cc_idx = 0; cc_idx < carriers.size(); ++cc_idx) { - uint32_t sum_cqi = carriers[cc_idx].dl_cqi + carriers[cc_idx].ul_cqi; - if (carriers[cc_idx].cc_state() == cc_st::active and sum_cqi > max_cqi) { - max_cqi = sum_cqi; - max_cc_idx = cc_idx; + for (uint32_t cc = 0; cc < cells.size(); ++cc) { + if (cells[cc].configured()) { + uint32_t sum_cqi = cells[cc].dl_cqi + cells[cc].ul_cqi; + if (cells[cc].cc_state() == cc_st::active and sum_cqi > max_cqi) { + max_cqi = sum_cqi; + max_cc_idx = cc; + } } } - if (max_cc_idx == this_ue_cc_idx) { + if ((int)max_cc_idx == this_enb_cc_idx) { return 512; } } @@ -1064,8 +1059,7 @@ bool sched_ue::is_sr_triggered() /* Gets HARQ process with oldest pending retx */ dl_harq_proc* sched_ue::get_pending_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_idx) { - uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - if (cells[enb_cc_idx].configured() and carriers[ue_cc_idx].cc_state() == cc_st::active) { + if (cells[enb_cc_idx].cc_state() == cc_st::active) { return cells[enb_cc_idx].harq_ent.get_pending_dl_harq(tti_tx_dl); } return nullptr; @@ -1073,8 +1067,7 @@ dl_harq_proc* sched_ue::get_pending_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc dl_harq_proc* sched_ue::get_empty_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_idx) { - uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - if (cells[enb_cc_idx].configured() and carriers[ue_cc_idx].cc_state() == cc_st::active) { + if (cells[enb_cc_idx].cc_state() == cc_st::active) { return cells[enb_cc_idx].harq_ent.get_empty_dl_harq(tti_tx_dl); } return nullptr; @@ -1082,8 +1075,7 @@ dl_harq_proc* sched_ue::get_empty_dl_harq(tti_point tti_tx_dl, uint32_t enb_cc_i ul_harq_proc* sched_ue::get_ul_harq(tti_point tti_tx_ul, uint32_t enb_cc_idx) { - uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - if (cells[enb_cc_idx].configured() and carriers[ue_cc_idx].cc_state() == cc_st::active) { + if (cells[enb_cc_idx].cc_state() == cc_st::active) { return cells[enb_cc_idx].harq_ent.get_ul_harq(tti_tx_ul); } return nullptr; @@ -1102,7 +1094,7 @@ std::pair sched_ue::get_active_cell_index(uint32_t enb_cc_idx) c [enb_cc_idx](const sched_interface::ue_cfg_t::cc_cfg_t& u) { return u.enb_cc_idx == enb_cc_idx and u.active; }); if (it != cfg.supported_cc_list.end()) { uint32_t ue_cc_idx = std::distance(cfg.supported_cc_list.begin(), it); - return {carriers[ue_cc_idx].cc_state() == cc_st::active, ue_cc_idx}; + return {cells[enb_cc_idx].cc_state() == cc_st::active, ue_cc_idx}; } return {false, std::numeric_limits::max()}; } @@ -1115,12 +1107,8 @@ uint32_t sched_ue::get_aggr_level(uint32_t enb_cc_idx, uint32_t nof_bits) void sched_ue::finish_tti(tti_point tti_rx, uint32_t enb_cc_idx) { - cc_sched_ue* c = find_ue_carrier(enb_cc_idx); - - if (c != nullptr) { - // Check that scell state needs to change - c->finish_tti(tti_rx); - } + // Check that scell state needs to change + cells[enb_cc_idx].finish_tti(tti_rx); } srslte_dci_format_t sched_ue::get_dci_format() @@ -1162,17 +1150,16 @@ const sched_dci_cce_t* sched_ue::get_locations(uint32_t enb_cc_idx, uint32_t cfi } } -cc_sched_ue* sched_ue::find_ue_carrier(uint32_t enb_cc_idx) +sched_ue_cell* sched_ue::find_ue_carrier(uint32_t enb_cc_idx) { - int ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - return ue_cc_idx >= 0 ? &carriers[ue_cc_idx] : nullptr; + return cells[enb_cc_idx].configured() ? &cells[enb_cc_idx] : nullptr; } std::bitset sched_ue::scell_activation_mask() const { std::bitset ret{0}; for (size_t i = 1; i < carriers.size(); ++i) { - if (carriers[i].cc_state() == cc_st::active) { + if (cells[carriers[i].get_cell_cfg()->enb_cc_idx].cc_state() == cc_st::active) { ret[i] = true; } } @@ -1207,13 +1194,13 @@ int cc_sched_ue::cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint3 int max_mcs; float max_coderate; if (is_ul) { - max_mcs = max_mcs_ul; + max_mcs = cell_ue->max_mcs_ul; max_Qm = cfg->support_ul64qam == ul64qam_cap::enabled ? 6 : 4; - max_coderate = srslte_cqi_to_coderate(std::min(ul_cqi + 1u, 15u), false); + max_coderate = srslte_cqi_to_coderate(std::min(cell_ue->ul_cqi + 1u, 15u), false); } else { - max_mcs = max_mcs_dl; + max_mcs = cell_ue->max_mcs_dl; max_Qm = cfg->use_tbs_index_alt ? 8 : 6; - max_coderate = srslte_cqi_to_coderate(std::min(dl_cqi + 1u, 15u), cfg->use_tbs_index_alt); + max_coderate = srslte_cqi_to_coderate(std::min(cell_ue->dl_cqi + 1u, 15u), cfg->use_tbs_index_alt); } // function with sign-flip at solution @@ -1252,96 +1239,26 @@ int cc_sched_ue::cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint3 cc_sched_ue::cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, sched_ue_cell& cell_ue_, uint16_t rnti_, - uint32_t ue_cc_idx_, - tti_point current_tti) : - cell_ue(&cell_ue_), rnti(rnti_), log_h(srslte::logmap::get("MAC")), ue_cc_idx(ue_cc_idx_), last_tti(current_tti) + uint32_t ue_cc_idx_) : + cell_ue(&cell_ue_), rnti(rnti_), log_h(srslte::logmap::get("MAC")), ue_cc_idx(ue_cc_idx_) { - dl_cqi_rx = false; - dl_cqi = (ue_cc_idx == 0) ? cell_ue_.cell_cfg->cfg.initial_dl_cqi : 0; set_cfg(cfg_); - - max_aggr_level = cell_ue->cell_cfg->sched_cfg->max_aggr_level >= 0 ? cell_ue->cell_cfg->sched_cfg->max_aggr_level : 3; - - // set fixed mcs - fixed_mcs_dl = cell_ue->cell_cfg->sched_cfg->pdsch_mcs; - fixed_mcs_ul = cell_ue->cell_cfg->sched_cfg->pusch_mcs; } void cc_sched_ue::reset() { - dl_ri = 0; - dl_ri_tti_rx = tti_point{}; - dl_pmi = 0; - dl_pmi_tti_rx = tti_point{}; - dl_cqi = 1; - dl_cqi_tti_rx = tti_point{}; - ul_cqi = 1; - ul_cqi_tti_rx = tti_point{}; cell_ue->reset(); } void cc_sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_) { - cfg = &cfg_; - cfg_tti = last_tti; - - // set max mcs - max_mcs_ul = get_cell_cfg()->sched_cfg->pusch_max_mcs >= 0 ? get_cell_cfg()->sched_cfg->pusch_max_mcs : 28u; - if (get_cell_cfg()->cfg.enable_64qam) { - const uint32_t max_64qam_mcs[] = {20, 24, 28}; - max_mcs_ul = std::min(max_mcs_ul, max_64qam_mcs[(size_t)cfg->support_ul64qam]); - } - max_mcs_dl = - get_cell_cfg()->sched_cfg->pdsch_max_mcs >= 0 ? std::min(get_cell_cfg()->sched_cfg->pdsch_max_mcs, 28) : 28u; - if (cfg->use_tbs_index_alt) { - max_mcs_dl = std::min(max_mcs_dl, 27u); - } - - if (ue_cc_idx == 0) { - // PCell is always active - cc_state_ = cc_st::active; - } else { - switch (cc_state()) { - case cc_st::activating: - case cc_st::active: - if (not cfg->supported_cc_list[ue_cc_idx].active) { - cc_state_ = cc_st::deactivating; - log_h->info("SCHED: Deactivating rnti=0x%x, SCellIndex=%d...\n", rnti, ue_cc_idx); - } - break; - case cc_st::deactivating: - case cc_st::idle: - if (cfg->supported_cc_list[ue_cc_idx].active) { - cc_state_ = cc_st::activating; - dl_cqi_rx = false; - dl_cqi = 0; - log_h->info("SCHED: Activating rnti=0x%x, SCellIndex=%d...\n", rnti, ue_cc_idx); - } - break; - default: - break; - } - } -} - -void cc_sched_ue::finish_tti(tti_point tti_rx) -{ - last_tti = tti_rx; - cell_ue->finish_tti(tti_rx); - - // Check if cell state needs to be updated - if (ue_cc_idx > 0 and cc_state_ == cc_st::deactivating) { - // wait for all ACKs to be received before completely deactivating SCell - if (last_tti > to_tx_dl_ack(cfg_tti)) { - cc_state_ = cc_st::idle; - reset(); - } - } + cfg = &cfg_; } uint32_t cc_sched_ue::get_aggr_level(uint32_t nof_bits) { - return srsenb::get_aggr_level(nof_bits, dl_cqi, max_aggr_level, get_cell_cfg()->nof_prb(), cfg->use_tbs_index_alt); + return srsenb::get_aggr_level( + nof_bits, cell_ue->dl_cqi, cell_ue->max_aggr_level, get_cell_cfg()->nof_prb(), cfg->use_tbs_index_alt); } /* In this scheduler we tend to use all the available bandwidth and select the MCS @@ -1367,8 +1284,9 @@ tbs_info cc_sched_ue::alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_ if (req_mcs >= 0 and req_mcs < (int)sel_mcs) { uint32_t max_Qm = (is_ul) ? (cfg->support_ul64qam == sched_interface::ue_cfg_t::ul64qam_cap::enabled ? 6 : 4) : (cfg->use_tbs_index_alt ? 8 : 6); - float max_coderate = (is_ul) ? srslte_cqi_to_coderate(std::min(ul_cqi + 1u, 15u), false) - : srslte_cqi_to_coderate(std::min(dl_cqi + 1u, 15u), cfg->use_tbs_index_alt); + float max_coderate = (is_ul) + ? srslte_cqi_to_coderate(std::min(cell_ue->ul_cqi + 1u, 15u), false) + : srslte_cqi_to_coderate(std::min(cell_ue->dl_cqi + 1u, 15u), cfg->use_tbs_index_alt); if (diff_coderate_maxcoderate(req_mcs, nof_prb, nof_re, max_Qm, max_coderate, cfg->use_tbs_index_alt, is_ul) < 0) { sel_mcs = req_mcs; @@ -1395,13 +1313,13 @@ tbs_info cc_sched_ue::alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t r tbs_info ret; // Use a higher MCS for the Msg4 to fit in the 6 PRB case - if (fixed_mcs_dl < 0 or not dl_cqi_rx) { + if (cell_ue->fixed_mcs_dl < 0 or not cell_ue->dl_cqi_rx) { // Dynamic MCS ret = alloc_tbs(nof_prb, nof_re, req_bytes, false); } else { // Fixed MCS - ret.mcs = fixed_mcs_dl; - ret.tbs_bytes = get_tbs_bytes((uint32_t)fixed_mcs_dl, nof_prb, cfg->use_tbs_index_alt, false); + ret.mcs = cell_ue->fixed_mcs_dl; + ret.tbs_bytes = get_tbs_bytes((uint32_t)cell_ue->fixed_mcs_dl, nof_prb, cfg->use_tbs_index_alt, false); } return ret; } @@ -1409,7 +1327,7 @@ tbs_info cc_sched_ue::alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t r tbs_info cc_sched_ue::alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int explicit_mcs) { tbs_info ret; - int mcs = explicit_mcs >= 0 ? explicit_mcs : fixed_mcs_ul; + int mcs = explicit_mcs >= 0 ? explicit_mcs : cell_ue->fixed_mcs_ul; if (mcs < 0) { // Dynamic MCS @@ -1461,16 +1379,4 @@ uint32_t cc_sched_ue::get_required_prb_ul(uint32_t req_bytes) return req_prbs; } -void cc_sched_ue::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) -{ - dl_cqi = dl_cqi_; - dl_cqi_tti_rx = tti_rx; - dl_cqi_rx = dl_cqi_rx or dl_cqi > 0; - if (ue_cc_idx > 0 and cc_state_ == cc_st::activating and dl_cqi_rx) { - // Wait for SCell to receive a positive CQI before activating it - cc_state_ = cc_st::active; - log_h->info("SCHED: SCell index=%d is now active\n", ue_cc_idx); - } -} - } // namespace srsenb diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index 3a6b1da7c..7614db3c8 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -20,25 +20,100 @@ namespace srsenb { * sched_ue_cell *******************************************************/ -sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_) : +sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_, tti_point current_tti_) : + rnti(rnti_), cell_cfg(&cell_cfg_), dci_locations(generate_cce_location_table(rnti_, cell_cfg_)), harq_ent(SCHED_MAX_HARQ_PROC, SCHED_MAX_HARQ_PROC), - tpc_fsm(cell_cfg->nof_prb(), cell_cfg->cfg.target_ul_sinr, cell_cfg->cfg.enable_phr_handling) -{} + tpc_fsm(cell_cfg->nof_prb(), cell_cfg->cfg.target_ul_sinr, cell_cfg->cfg.enable_phr_handling), + fixed_mcs_dl(cell_cfg_.sched_cfg->pdsch_mcs), + fixed_mcs_ul(cell_cfg_.sched_cfg->pusch_mcs), + current_tti(current_tti_) +{ + max_aggr_level = cell_cfg->sched_cfg->max_aggr_level >= 0 ? cell_cfg->sched_cfg->max_aggr_level : 3; +} void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) { - ue_cfg = &ue_cfg_; + cfg_tti = current_tti; + ue_cfg = &ue_cfg_; + ue_cc_idx = -1; for (size_t i = 0; i < ue_cfg_.supported_cc_list.size(); ++i) { if (ue_cfg_.supported_cc_list[i].enb_cc_idx == cell_cfg->enb_cc_idx) { ue_cc_idx = i; } } + + // set max mcs + max_mcs_ul = cell_cfg->sched_cfg->pusch_max_mcs >= 0 ? cell_cfg->sched_cfg->pusch_max_mcs : 28u; + if (cell_cfg->cfg.enable_64qam) { + const uint32_t max_64qam_mcs[] = {20, 24, 28}; + max_mcs_ul = std::min(max_mcs_ul, max_64qam_mcs[(size_t)ue_cfg->support_ul64qam]); + } + max_mcs_dl = cell_cfg->sched_cfg->pdsch_max_mcs >= 0 ? std::min(cell_cfg->sched_cfg->pdsch_max_mcs, 28) : 28u; + if (ue_cfg->use_tbs_index_alt) { + max_mcs_dl = std::min(max_mcs_dl, 27u); + } + + // Update carrier state + if (ue_cc_idx == 0) { + if (cc_state() == cc_st::idle) { + reset(); + // PCell is always active + cc_state_ = cc_st::active; + + // set initial DL CQI + dl_cqi = cell_cfg->cfg.initial_dl_cqi; + } + } else { + // SCell case + switch (cc_state()) { + case cc_st::activating: + case cc_st::active: + if (not ue_cfg->supported_cc_list[ue_cc_idx].active) { + cc_state_ = cc_st::deactivating; + log_h->info("SCHED: Deactivating rnti=0x%x, SCellIndex=%d...\n", rnti, ue_cc_idx); + } + break; + case cc_st::deactivating: + case cc_st::idle: + if (ue_cfg->supported_cc_list[ue_cc_idx].active) { + reset(); + cc_state_ = cc_st::activating; + dl_cqi = 0; + log_h->info("SCHED: Activating rnti=0x%x, SCellIndex=%d...\n", rnti, ue_cc_idx); + } + break; + default: + break; + } + } +} + +void sched_ue_cell::new_tti(tti_point tti_rx) +{ + current_tti = tti_rx; + + // Check if cell state needs to be updated + if (ue_cc_idx > 0 and cc_state_ == cc_st::deactivating) { + // wait for all ACKs to be received before completely deactivating SCell + if (current_tti > to_tx_dl_ack(cfg_tti)) { + cc_state_ = cc_st::idle; + } + } } void sched_ue_cell::reset() { + dl_ri = 0; + dl_ri_tti_rx = tti_point{}; + dl_pmi = 0; + dl_pmi_tti_rx = tti_point{}; + dl_cqi = 1; + dl_cqi_tti_rx = tti_point{}; + dl_cqi_rx = false; + ul_cqi = 1; + ul_cqi_tti_rx = tti_point{}; harq_ent.reset(); } @@ -48,4 +123,16 @@ void sched_ue_cell::finish_tti(tti_point tti_rx) harq_ent.reset_pending_data(tti_rx); } +void sched_ue_cell::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) +{ + dl_cqi = dl_cqi_; + dl_cqi_tti_rx = tti_rx; + dl_cqi_rx = dl_cqi_rx or dl_cqi > 0; + if (ue_cc_idx > 0 and cc_state_ == cc_st::activating and dl_cqi_rx) { + // Wait for SCell to receive a positive CQI before activating it + cc_state_ = cc_st::active; + log_h->info("SCHED: SCell index=%d is now active\n", ue_cc_idx); + } +} + } // namespace srsenb From 3d7a83cb6ef69c46bcf7470818f2659ad6dfa060 Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 18 Jan 2021 12:35:59 +0000 Subject: [PATCH 090/138] delete cc_sched_ue class --- srsenb/hdr/stack/mac/sched_ue.h | 36 +- .../stack/mac/sched_ue_ctrl/sched_ue_cell.h | 27 +- srsenb/src/stack/mac/sched_ue.cc | 354 ++---------------- .../stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 234 ++++++++++++ 4 files changed, 291 insertions(+), 360 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index 3a53caffd..cbdbf13f5 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -28,36 +28,6 @@ namespace srsenb { typedef enum { UCI_PUSCH_NONE = 0, UCI_PUSCH_CQI, UCI_PUSCH_ACK, UCI_PUSCH_ACK_CQI } uci_pusch_t; -struct tbs_info { - int tbs_bytes = -1; - int mcs = 0; -}; - -struct cc_sched_ue { - cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, sched_ue_cell& cell_ue_, uint16_t rnti_, uint32_t ue_cc_idx); - void reset(); - void set_cfg(const sched_interface::ue_cfg_t& cfg); ///< reconfigure ue carrier - - uint32_t get_aggr_level(uint32_t nof_bits); - tbs_info alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul); - tbs_info alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes); - tbs_info alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int explicit_mcs = -1); - int get_required_prb_dl(tti_point tti_tx_dl, uint32_t req_bytes); - uint32_t get_required_prb_ul(uint32_t req_bytes); - const sched_cell_params_t* get_cell_cfg() const { return cell_ue->cell_cfg; } - uint32_t get_ue_cc_idx() const { return ue_cc_idx; } - int cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint32_t* mcs); - -private: - // config - srslte::log_ref log_h; - const sched_interface::ue_cfg_t* cfg = nullptr; - sched_ue_cell* cell_ue = nullptr; - uint16_t rnti; - uint32_t ue_cc_idx = 0; - srslte::tti_point cfg_tti; -}; - /** This class is designed to be thread-safe because it is called from workers through scheduler thread and from * higher layers and mac threads. */ @@ -160,7 +130,7 @@ public: const sched_dci_cce_t* get_locations(uint32_t enb_cc_idx, uint32_t current_cfi, uint32_t sf_idx) const; sched_ue_cell* find_ue_carrier(uint32_t enb_cc_idx); - size_t nof_carriers_configured() const { return carriers.size(); } + size_t nof_carriers_configured() const { return cfg.supported_cc_list.size(); } std::bitset scell_activation_mask() const; int enb_to_ue_cc_idx(uint32_t enb_cc_idx) const; @@ -224,9 +194,7 @@ private: bool phy_config_dedicated_enabled = false; - tti_point current_tti; - std::vector carriers; ///< map of UE CellIndex to carrier configuration - + tti_point current_tti; std::vector cells; ///< List of eNB cells that may be configured/activated/deactivated for the UE }; diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index 840374cb6..1db80a21b 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -21,6 +21,11 @@ namespace srsenb { enum class cc_st { active, idle, activating, deactivating }; +struct tbs_info { + int tbs_bytes = -1; + int mcs = 0; +}; + struct sched_ue_cell { using ue_cc_cfg = sched_interface::ue_cfg_t::cc_cfg_t; const static int SCHED_MAX_HARQ_PROC = FDD_HARQ_DELAY_UL_MS + FDD_HARQ_DELAY_DL_MS; @@ -36,7 +41,8 @@ struct sched_ue_cell { bool configured() const { return ue_cc_idx >= 0; } int get_ue_cc_idx() const { return ue_cc_idx; } const ue_cc_cfg* get_ue_cc_cfg() const { return configured() ? &ue_cfg->supported_cc_list[ue_cc_idx] : nullptr; } - cc_st cc_state() const { return cc_state_; } + const sched_interface::ue_cfg_t* get_ue_cfg() const { return configured() ? ue_cfg : nullptr; } + cc_st cc_state() const { return cc_state_; } const uint16_t rnti; @@ -75,11 +81,24 @@ private: int ue_cc_idx = -1; // state - tti_point current_tti; - srslte::tti_point last_tti; - cc_st cc_state_ = cc_st::idle; + tti_point current_tti; + cc_st cc_state_ = cc_st::idle; }; +/************************************************************* + * TBS/MCS derivation + ************************************************************/ + +/// Compute TBS and MCS based on cell state and grant +tbs_info cqi_to_tbs(const sched_ue_cell& cell, uint32_t nof_prb, uint32_t nof_re, bool is_ul); + +tbs_info alloc_tbs_dl(const sched_ue_cell& cell, uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes); +tbs_info +alloc_tbs_ul(const sched_ue_cell& cell, uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int explicit_mcs = -1); + +int get_required_prb_dl(const sched_ue_cell& cell, tti_point tti_tx_dl, uint32_t req_bytes); +uint32_t get_required_prb_ul(const sched_ue_cell& cell, uint32_t req_bytes); + } // namespace srsenb #endif // SRSLTE_SCHED_UE_CELL_H diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index f962d25cc..75f238596 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -29,65 +29,6 @@ namespace srsenb { #define MAC_MIN_ALLOC_SIZE 5 -template -std::tuple -false_position_method(int x1, int x2, YType y0, const Callable& f, const ErrorDetect& is_error) -{ - static_assert(std::is_same::value, - "The type of the final result and callable return do not match\n"); - YType y1 = f(x1); - if (is_error(y1) or y1 >= y0) { - return std::make_tuple(x1, y1, x1, y1); - } - YType y2 = f(x2); - if (is_error(y2) or y2 <= y0) { - return std::make_tuple(x2, y2, x2, y2); - } - YType y3; - while (x2 > x1 + 1) { - int x3 = round(x1 - ((x2 - x1) * (y1 - y0) / (float)(y2 - y1))); - if (x3 == x2) { - y3 = y2; - // check if in frontier - YType y3_1 = f(x3 - 1); - if (not is_error(y3_1) and y3_1 < y0) { - return std::make_tuple(x3 - 1, y3_1, x3, y3); - } else { - x3--; - y3 = y3_1; - } - } else if (x3 == x1) { - y3 = y1; - // check if in frontier - YType y3_1 = f(x3 + 1); - if (not is_error(y3_1) and y3_1 >= y0) { - return std::make_tuple(x3, y3, x3 + 1, y3_1); - } else { - x3++; - y3 = y3_1; - } - } else { - y3 = f(x3); - if (is_error(y3) or y3 == y0) { - return std::make_tuple(x3, y3, x3, y3); - } - } - if (y3 < y0) { - x1 = x3; - y1 = y3; - } else { - x2 = x3; - y2 = y3; - } - } - return std::make_tuple(x1, y1, x2, y2); -} -template -std::tuple false_position_method(int x1, int x2, YType y0, const Callable& f) -{ - return false_position_method(x1, x2, y0, f, [](int x) { return false; }); -} - /******************************************************* * * Initialization and configuration functions @@ -133,35 +74,14 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) lch_handler.set_cfg(cfg_); // update ue cells + bool scell_activation_state_changed = false; for (auto& c : cells) { c.set_ue_cfg(cfg); + scell_activation_state_changed |= + c.get_ue_cc_idx() > 0 and (c.cc_state() == cc_st::activating or c.cc_state() == cc_st::deactivating); } - - // in case carriers have been removed - while (carriers.size() > cfg.supported_cc_list.size()) { - // TODO: distinguish cell deactivation from reconfiguration - carriers.pop_back(); - } - // in case carriers have been added or modified - bool scell_activation_state_changed = false; - for (uint32_t ue_idx = 0; ue_idx < cfg.supported_cc_list.size(); ++ue_idx) { - auto& cc_cfg = cfg.supported_cc_list[ue_idx]; - - if (ue_idx >= prev_supported_cc_list.size()) { - // New carrier needs to be added - carriers.emplace_back(cfg, cells[cc_cfg.enb_cc_idx], rnti, ue_idx); - } else if (cc_cfg.enb_cc_idx != prev_supported_cc_list[ue_idx].enb_cc_idx) { - // One carrier was added in the place of another - carriers[ue_idx] = cc_sched_ue{cfg, cells[cc_cfg.enb_cc_idx], rnti, ue_idx}; - if (ue_idx == 0) { - log_h->info("SCHED: rnti=0x%x PCell is now enb_cc_idx=%d.\n", rnti, cc_cfg.enb_cc_idx); - } - } else { - // The SCell internal configuration may have changed - carriers[ue_idx].set_cfg(cfg); - } - scell_activation_state_changed |= ue_idx > 0 and (cells[cc_cfg.enb_cc_idx].cc_state() == cc_st::activating or - cells[cc_cfg.enb_cc_idx].cc_state() == cc_st::deactivating); + if (prev_supported_cc_list.empty() or prev_supported_cc_list[0].enb_cc_idx != cfg.supported_cc_list[0].enb_cc_idx) { + log_h->info("SCHED: rnti=0x%x PCell is now enb_cc_idx=%d.\n", rnti, cfg.supported_cc_list[0].enb_cc_idx); } if (scell_activation_state_changed) { lch_handler.pending_ces.emplace_back(srslte::dl_sch_lcid::SCELL_ACTIVATION); @@ -177,7 +97,9 @@ void sched_ue::reset() sr = false; phy_config_dedicated_enabled = false; cqi_request_tti = 0; - carriers.clear(); + for (auto& cc : cells) { + cc.reset(); + } // erase all bearers for (uint32_t i = 0; i < cfg.ue_bearers.size(); ++i) { @@ -242,7 +164,7 @@ void sched_ue::ul_buffer_add(uint8_t lcid, uint32_t bytes) void sched_ue::ul_phr(int phr) { - cells[carriers[0].get_cell_cfg()->enb_cc_idx].tpc_fsm.set_phr(phr); + cells[cfg.supported_cc_list[0].enb_cc_idx].tpc_fsm.set_phr(phr); } void sched_ue::dl_buffer_state(uint8_t lc_id, uint32_t tx_queue, uint32_t retx_queue) @@ -303,7 +225,7 @@ tti_point nearest_meas_gap(tti_point tti, uint32_t period, uint32_t offset) bool sched_ue::pdsch_enabled(srslte::tti_point tti_rx, uint32_t enb_cc_idx) const { - if (carriers[0].get_cell_cfg()->enb_cc_idx != enb_cc_idx) { + if (cfg.supported_cc_list[0].enb_cc_idx != enb_cc_idx) { return true; } @@ -323,7 +245,7 @@ bool sched_ue::pdsch_enabled(srslte::tti_point tti_rx, uint32_t enb_cc_idx) cons bool sched_ue::pusch_enabled(tti_point tti_rx, uint32_t enb_cc_idx, bool needs_pdcch) const { - if (carriers[0].get_cell_cfg()->enb_cc_idx != enb_cc_idx) { + if (cfg.supported_cc_list[0].enb_cc_idx != enb_cc_idx) { return true; } @@ -503,9 +425,8 @@ int sched_ue::generate_format1(uint32_t pid, uint32_t cfi, const rbgmask_t& user_mask) { - uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); - dl_harq_proc* h = &cells[enb_cc_idx].harq_ent.dl_harq_procs()[pid]; - srslte_dci_dl_t* dci = &data->dci; + dl_harq_proc* h = &cells[enb_cc_idx].harq_ent.dl_harq_procs()[pid]; + srslte_dci_dl_t* dci = &data->dci; // If the size of Format1 and Format1A is ambiguous in the common SS, use Format1A since the UE assumes // Common SS when spaces collide @@ -539,7 +460,7 @@ int sched_ue::generate_format1(uint32_t pid, if (tbinfo.tbs_bytes > 0) { dci->rnti = rnti; dci->pid = h->get_id(); - dci->ue_cc_idx = ue_cc_idx; + dci->ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); dci->tb[0].mcs_idx = (uint32_t)tbinfo.mcs; dci->tb[0].rv = get_rvidx(h->nof_retx(0)); dci->tb[0].ndi = h->get_ndi(0); @@ -566,15 +487,14 @@ tbs_info sched_ue::compute_mcs_and_tbs(uint32_t enb_cc_idx, uint32_t cfi, const srslte_dci_dl_t& dci) { - uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); - + assert(cells[enb_cc_idx].configured()); srslte::interval req_bytes = get_requested_dl_bytes(enb_cc_idx); // Calculate exact number of RE for this PRB allocation uint32_t nof_re = cells[enb_cc_idx].cell_cfg->get_dl_nof_res(tti_tx_dl, dci, cfi); // Compute MCS+TBS - tbs_info tb = carriers[ue_cc_idx].alloc_tbs_dl(nof_alloc_prbs, nof_re, req_bytes.stop()); + tbs_info tb = alloc_tbs_dl(cells[enb_cc_idx], nof_alloc_prbs, nof_re, req_bytes.stop()); if (tb.tbs_bytes > 0 and tb.tbs_bytes < (int)req_bytes.start()) { log_h->info("SCHED: Could not get PRB allocation that avoids MAC CE or RLC SRB0 PDU segmentation\n"); @@ -592,7 +512,6 @@ int sched_ue::generate_format2a(uint32_t pid, uint32_t cfi, const rbgmask_t& user_mask) { - uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); dl_harq_proc* h = &cells[enb_cc_idx].harq_ent.dl_harq_procs()[pid]; bool tb_en[SRSLTE_MAX_TB] = {false}; @@ -653,7 +572,7 @@ int sched_ue::generate_format2a(uint32_t pid, /* Fill common fields */ dci->format = SRSLTE_DCI_FORMAT2A; dci->rnti = rnti; - dci->ue_cc_idx = ue_cc_idx; + dci->ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); dci->pid = h->get_id(); dci->tpc_pucch = cells[enb_cc_idx].tpc_fsm.encode_pucch_tpc(); @@ -692,9 +611,8 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, int explicit_mcs, uci_pusch_t uci_type) { - uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); - ul_harq_proc* h = get_ul_harq(tti_tx_ul, enb_cc_idx); - srslte_dci_ul_t* dci = &data->dci; + ul_harq_proc* h = get_ul_harq(tti_tx_ul, enb_cc_idx); + srslte_dci_ul_t* dci = &data->dci; bool cqi_request = needs_cqi(tti_tx_ul.to_uint(), enb_cc_idx, true); @@ -721,7 +639,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, uint32_t N_srs = 0; uint32_t nof_symb = 2 * (SRSLTE_CP_NSYMB(cell.cp) - 1) - N_srs; uint32_t nof_re = nof_symb * alloc.length() * SRSLTE_NRE; - tbinfo = carriers[ue_cc_idx].alloc_tbs_ul(alloc.length(), nof_re, req_bytes); + tbinfo = alloc_tbs_ul(cells[enb_cc_idx], alloc.length(), nof_re, req_bytes); // Reduce MCS to fit UCI if transmitted in this grant if (uci_type != UCI_PUSCH_NONE) { @@ -730,7 +648,8 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, // Add the RE for ACK if (uci_type == UCI_PUSCH_ACK || uci_type == UCI_PUSCH_ACK_CQI) { float beta = srslte_sch_beta_ack(cfg.uci_offset.I_offset_ack); - nof_uci_re += srslte_qprime_ack_ext(alloc.length(), nof_symb, 8 * tbinfo.tbs_bytes, carriers.size(), beta); + nof_uci_re += + srslte_qprime_ack_ext(alloc.length(), nof_symb, 8 * tbinfo.tbs_bytes, cfg.supported_cc_list.size(), beta); } // Add the RE for CQI report (RI reports are transmitted on CQI slots. We do a conservative estimate here) if (uci_type == UCI_PUSCH_CQI || uci_type == UCI_PUSCH_ACK_CQI || cqi_request) { @@ -739,7 +658,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, } // Recompute again the MCS and TBS with the new spectral efficiency (based on the available RE for data) if (nof_re >= nof_uci_re) { - tbinfo = carriers[ue_cc_idx].alloc_tbs_ul(alloc.length(), nof_re - nof_uci_re, req_bytes); + tbinfo = alloc_tbs_ul(cells[enb_cc_idx], alloc.length(), nof_re - nof_uci_re, req_bytes); } // NOTE: if (nof_re < nof_uci_re) we should set TBS=0 } @@ -760,7 +679,7 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data, data->current_tx_nb = h->nof_retx(0); dci->rnti = rnti; dci->format = SRSLTE_DCI_FORMAT0; - dci->ue_cc_idx = ue_cc_idx; + dci->ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); dci->tb.ndi = h->get_ndi(0); dci->cqi_request = cqi_request; dci->freq_hop_fl = srslte_dci_ul_t::SRSLTE_RA_PUSCH_HOP_DISABLED; @@ -839,12 +758,11 @@ rbg_interval sched_ue::get_required_dl_rbgs(uint32_t enb_cc_idx) { assert(cells[enb_cc_idx].get_ue_cc_idx() >= 0); const auto* cellparams = cells[enb_cc_idx].cell_cfg; - uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); srslte::interval req_bytes = get_requested_dl_bytes(enb_cc_idx); if (req_bytes == srslte::interval{0, 0}) { return {0, 0}; } - int pending_prbs = carriers[ue_cc_idx].get_required_prb_dl(to_tx_dl(current_tti), req_bytes.start()); + int pending_prbs = get_required_prb_dl(cells[enb_cc_idx], to_tx_dl(current_tti), req_bytes.start()); if (pending_prbs < 0) { // Cannot fit allocation in given PRBs log_h->error("SCHED: DL CQI=%d does now allow fitting %d non-segmentable DL tx bytes into the cell bandwidth. " @@ -854,7 +772,7 @@ rbg_interval sched_ue::get_required_dl_rbgs(uint32_t enb_cc_idx) return {cellparams->nof_prb(), cellparams->nof_prb()}; } uint32_t min_pending_rbg = cellparams->nof_prbs_to_rbgs(pending_prbs); - pending_prbs = carriers[ue_cc_idx].get_required_prb_dl(to_tx_dl(current_tti), req_bytes.stop()); + pending_prbs = get_required_prb_dl(cells[enb_cc_idx], to_tx_dl(current_tti), req_bytes.stop()); pending_prbs = (pending_prbs < 0) ? cellparams->nof_prb() : pending_prbs; uint32_t max_pending_rbg = cellparams->nof_prbs_to_rbgs(pending_prbs); return {min_pending_rbg, max_pending_rbg}; @@ -1048,7 +966,7 @@ uint32_t sched_ue::get_pending_ul_new_data(tti_point tti_tx_ul, int this_enb_cc_ uint32_t sched_ue::get_required_prb_ul(uint32_t enb_cc_idx, uint32_t req_bytes) { - return carriers[enb_to_ue_cc_idx(enb_cc_idx)].get_required_prb_ul(req_bytes); + return srsenb::get_required_prb_ul(cells[enb_cc_idx], req_bytes); } bool sched_ue::is_sr_triggered() @@ -1101,8 +1019,8 @@ std::pair sched_ue::get_active_cell_index(uint32_t enb_cc_idx) c uint32_t sched_ue::get_aggr_level(uint32_t enb_cc_idx, uint32_t nof_bits) { - uint32_t ue_cc_idx = enb_to_ue_cc_idx(enb_cc_idx); - return carriers[ue_cc_idx].get_aggr_level(nof_bits); + const auto& cc = cells[enb_cc_idx]; + return srsenb::get_aggr_level(nof_bits, cc.dl_cqi, cc.max_aggr_level, cc.cell_cfg->nof_prb(), cfg.use_tbs_index_alt); } void sched_ue::finish_tti(tti_point tti_rx, uint32_t enb_cc_idx) @@ -1158,9 +1076,9 @@ sched_ue_cell* sched_ue::find_ue_carrier(uint32_t enb_cc_idx) std::bitset sched_ue::scell_activation_mask() const { std::bitset ret{0}; - for (size_t i = 1; i < carriers.size(); ++i) { - if (cells[carriers[i].get_cell_cfg()->enb_cc_idx].cc_state() == cc_st::active) { - ret[i] = true; + for (size_t i = 0; i < cells.size(); ++i) { + if (cells[i].cc_state() == cc_st::active and cells[i].get_ue_cc_idx() > 0) { + ret[cells[i].get_ue_cc_idx()] = true; } } return ret; @@ -1171,212 +1089,4 @@ int sched_ue::enb_to_ue_cc_idx(uint32_t enb_cc_idx) const return enb_cc_idx < cells.size() ? cells[enb_cc_idx].get_ue_cc_idx() : -1; } -float diff_coderate_maxcoderate(int mcs, - uint32_t nof_prb, - uint32_t nof_re, - uint32_t max_Qm, - float max_coderate, - bool use_tbs_index_alt, - bool is_ul) -{ - uint32_t tbs_idx = srslte_ra_tbs_idx_from_mcs(mcs, use_tbs_index_alt, is_ul); - int tbs = srslte_ra_tbs_from_idx(tbs_idx, nof_prb); - float coderate = srslte_coderate(tbs, nof_re); - srslte_mod_t mod = (is_ul) ? srslte_ra_ul_mod_from_mcs(mcs) : srslte_ra_dl_mod_from_mcs(mcs, use_tbs_index_alt); - uint32_t Qm = std::min(max_Qm, srslte_mod_bits_x_symbol(mod)); - return coderate - std::min(max_coderate, 0.930f * Qm); -} - -int cc_sched_ue::cqi_to_tbs(uint32_t nof_prb, uint32_t nof_re, bool is_ul, uint32_t* mcs) -{ - using ul64qam_cap = sched_interface::ue_cfg_t::ul64qam_cap; - uint32_t max_Qm; - int max_mcs; - float max_coderate; - if (is_ul) { - max_mcs = cell_ue->max_mcs_ul; - max_Qm = cfg->support_ul64qam == ul64qam_cap::enabled ? 6 : 4; - max_coderate = srslte_cqi_to_coderate(std::min(cell_ue->ul_cqi + 1u, 15u), false); - } else { - max_mcs = cell_ue->max_mcs_dl; - max_Qm = cfg->use_tbs_index_alt ? 8 : 6; - max_coderate = srslte_cqi_to_coderate(std::min(cell_ue->dl_cqi + 1u, 15u), cfg->use_tbs_index_alt); - } - - // function with sign-flip at solution - auto test_mcs = [&](int sel_mcs) -> float { - return diff_coderate_maxcoderate(sel_mcs, nof_prb, nof_re, max_Qm, max_coderate, cfg->use_tbs_index_alt, is_ul); - }; - - std::tuple ret; - if (nof_prb > 1) { - // for non-voip case - ret = false_position_method(0, max_mcs, 0.0f, test_mcs); - } else { - // avoid 6 prbs (voip case), where function is not monotonic - ret = false_position_method(7, max_mcs, 0.0f, test_mcs); - if (std::get<1>(ret) > 0) { - ret = false_position_method(0, 5, 0.0f, test_mcs); - } - } - int chosen_mcs = std::get<0>(ret); - uint32_t tbs_idx = srslte_ra_tbs_idx_from_mcs(chosen_mcs, cfg->use_tbs_index_alt, is_ul); - int chosen_tbs = srslte_ra_tbs_from_idx(tbs_idx, nof_prb); - - if (mcs != nullptr) { - *mcs = (uint32_t)chosen_mcs; - } - // If coderate > SRSLTE_MIN(max_coderate, 0.930 * Qm) we should set TBS=0. We don't because it's not correctly - // handled by the scheduler, but we might be scheduling undecodable codewords at very low SNR - - return chosen_tbs; -} - -/************************************************************************************************ - * sched_ue::sched_ue_carrier - ***********************************************************************************************/ - -cc_sched_ue::cc_sched_ue(const sched_interface::ue_cfg_t& cfg_, - sched_ue_cell& cell_ue_, - uint16_t rnti_, - uint32_t ue_cc_idx_) : - cell_ue(&cell_ue_), rnti(rnti_), log_h(srslte::logmap::get("MAC")), ue_cc_idx(ue_cc_idx_) -{ - set_cfg(cfg_); -} - -void cc_sched_ue::reset() -{ - cell_ue->reset(); -} - -void cc_sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_) -{ - cfg = &cfg_; -} - -uint32_t cc_sched_ue::get_aggr_level(uint32_t nof_bits) -{ - return srsenb::get_aggr_level( - nof_bits, cell_ue->dl_cqi, cell_ue->max_aggr_level, get_cell_cfg()->nof_prb(), cfg->use_tbs_index_alt); -} - -/* In this scheduler we tend to use all the available bandwidth and select the MCS - * that approximates the minimum between the capacity and the requested rate - */ -tbs_info cc_sched_ue::alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul) -{ - tbs_info ret; - uint32_t sel_mcs = 0; - - // TODO: Compute real spectral efficiency based on PUSCH-UCI configuration - int tbs_bytes = cqi_to_tbs(nof_prb, nof_re, is_ul, &sel_mcs) / 8; - - /* If less bytes are requested, lower the MCS */ - if (tbs_bytes > (int)req_bytes && req_bytes > 0) { - int req_tbs_idx = srslte_ra_tbs_to_table_idx(req_bytes * 8, nof_prb); - int req_mcs = srslte_ra_mcs_from_tbs_idx(req_tbs_idx, cfg->use_tbs_index_alt, is_ul); - while (cfg->use_tbs_index_alt and req_mcs < 0 and req_tbs_idx < 33) { - // some tbs_idx are invalid for 256QAM. See TS 36.213 - Table 7.1.7.1-1A - req_mcs = srslte_ra_mcs_from_tbs_idx(++req_tbs_idx, cfg->use_tbs_index_alt, is_ul); - } - - if (req_mcs >= 0 and req_mcs < (int)sel_mcs) { - uint32_t max_Qm = (is_ul) ? (cfg->support_ul64qam == sched_interface::ue_cfg_t::ul64qam_cap::enabled ? 6 : 4) - : (cfg->use_tbs_index_alt ? 8 : 6); - float max_coderate = (is_ul) - ? srslte_cqi_to_coderate(std::min(cell_ue->ul_cqi + 1u, 15u), false) - : srslte_cqi_to_coderate(std::min(cell_ue->dl_cqi + 1u, 15u), cfg->use_tbs_index_alt); - if (diff_coderate_maxcoderate(req_mcs, nof_prb, nof_re, max_Qm, max_coderate, cfg->use_tbs_index_alt, is_ul) < - 0) { - sel_mcs = req_mcs; - tbs_bytes = srslte_ra_tbs_from_idx(req_tbs_idx, nof_prb) / 8; - } - } - } - // Avoid the unusual case n_prb=1, mcs=6 tbs=328 (used in voip) - if (nof_prb == 1 && sel_mcs == 6) { - sel_mcs--; - tbs_bytes = get_tbs_bytes(sel_mcs, nof_prb, cfg->use_tbs_index_alt, is_ul); - } - - ret.tbs_bytes = tbs_bytes; - if (ret.tbs_bytes >= 0) { - ret.mcs = (int)sel_mcs; - } - - return ret; -} - -tbs_info cc_sched_ue::alloc_tbs_dl(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes) -{ - tbs_info ret; - - // Use a higher MCS for the Msg4 to fit in the 6 PRB case - if (cell_ue->fixed_mcs_dl < 0 or not cell_ue->dl_cqi_rx) { - // Dynamic MCS - ret = alloc_tbs(nof_prb, nof_re, req_bytes, false); - } else { - // Fixed MCS - ret.mcs = cell_ue->fixed_mcs_dl; - ret.tbs_bytes = get_tbs_bytes((uint32_t)cell_ue->fixed_mcs_dl, nof_prb, cfg->use_tbs_index_alt, false); - } - return ret; -} - -tbs_info cc_sched_ue::alloc_tbs_ul(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int explicit_mcs) -{ - tbs_info ret; - int mcs = explicit_mcs >= 0 ? explicit_mcs : cell_ue->fixed_mcs_ul; - - if (mcs < 0) { - // Dynamic MCS - ret = alloc_tbs(nof_prb, nof_re, req_bytes, true); - } else { - // Fixed MCS - ret.mcs = mcs; - ret.tbs_bytes = get_tbs_bytes((uint32_t)mcs, nof_prb, false, true); - } - - return ret; -} - -int cc_sched_ue::get_required_prb_dl(tti_point tti_tx_dl, uint32_t req_bytes) -{ - auto compute_tbs_approx = [tti_tx_dl, this](uint32_t nof_prb) { - uint32_t nof_re = cell_ue->cell_cfg->get_dl_lb_nof_re(tti_tx_dl, nof_prb); - tbs_info tb = alloc_tbs_dl(nof_prb, nof_re, 0); - return tb.tbs_bytes; - }; - - std::tuple ret = false_position_method( - 1u, get_cell_cfg()->nof_prb(), (int)req_bytes, compute_tbs_approx, [](int y) { return y == SRSLTE_ERROR; }); - int upper_tbs = std::get<3>(ret); - uint32_t upper_nprb = std::get<2>(ret); - return (upper_tbs < 0) ? 0 : ((upper_tbs < (int)req_bytes) ? -1 : upper_nprb); -} - -uint32_t cc_sched_ue::get_required_prb_ul(uint32_t req_bytes) -{ - if (req_bytes == 0) { - return 0; - } - auto compute_tbs_approx = [this](uint32_t nof_prb) { - const uint32_t N_srs = 0; - uint32_t nof_re = (2 * (SRSLTE_CP_NSYMB(get_cell_cfg()->cfg.cell.cp) - 1) - N_srs) * nof_prb * SRSLTE_NRE; - return alloc_tbs_ul(nof_prb, nof_re, 0).tbs_bytes; - }; - - // find nof prbs that lead to a tbs just above req_bytes - int target_tbs = req_bytes + 4; - uint32_t max_prbs = std::min(cell_ue->tpc_fsm.max_ul_prbs(), get_cell_cfg()->nof_prb()); - std::tuple ret = - false_position_method(1u, max_prbs, target_tbs, compute_tbs_approx, [](int y) { return y == SRSLTE_ERROR; }); - uint32_t req_prbs = std::get<2>(ret); - while (!srslte_dft_precoding_valid_prb(req_prbs) && req_prbs < get_cell_cfg()->nof_prb()) { - req_prbs++; - } - return req_prbs; -} - } // namespace srsenb diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index 7614db3c8..83c0d6c98 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -135,4 +135,238 @@ void sched_ue_cell::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) } } +/************************************************************* + * TBS/MCS derivation + ************************************************************/ + +template +std::tuple +false_position_method(int x1, int x2, YType y0, const Callable& f, const ErrorDetect& is_error) +{ + static_assert(std::is_same::value, + "The type of the final result and callable return do not match\n"); + YType y1 = f(x1); + if (is_error(y1) or y1 >= y0) { + return std::make_tuple(x1, y1, x1, y1); + } + YType y2 = f(x2); + if (is_error(y2) or y2 <= y0) { + return std::make_tuple(x2, y2, x2, y2); + } + YType y3; + while (x2 > x1 + 1) { + int x3 = round(x1 - ((x2 - x1) * (y1 - y0) / (float)(y2 - y1))); + if (x3 == x2) { + y3 = y2; + // check if in frontier + YType y3_1 = f(x3 - 1); + if (not is_error(y3_1) and y3_1 < y0) { + return std::make_tuple(x3 - 1, y3_1, x3, y3); + } else { + x3--; + y3 = y3_1; + } + } else if (x3 == x1) { + y3 = y1; + // check if in frontier + YType y3_1 = f(x3 + 1); + if (not is_error(y3_1) and y3_1 >= y0) { + return std::make_tuple(x3, y3, x3 + 1, y3_1); + } else { + x3++; + y3 = y3_1; + } + } else { + y3 = f(x3); + if (is_error(y3) or y3 == y0) { + return std::make_tuple(x3, y3, x3, y3); + } + } + if (y3 < y0) { + x1 = x3; + y1 = y3; + } else { + x2 = x3; + y2 = y3; + } + } + return std::make_tuple(x1, y1, x2, y2); +} +template +std::tuple false_position_method(int x1, int x2, YType y0, const Callable& f) +{ + return false_position_method(x1, x2, y0, f, [](int x) { return false; }); +} + +float diff_coderate_maxcoderate(int mcs, + uint32_t nof_prb, + uint32_t nof_re, + uint32_t max_Qm, + float max_coderate, + bool use_tbs_index_alt, + bool is_ul) +{ + uint32_t tbs_idx = srslte_ra_tbs_idx_from_mcs(mcs, use_tbs_index_alt, is_ul); + int tbs = srslte_ra_tbs_from_idx(tbs_idx, nof_prb); + float coderate = srslte_coderate(tbs, nof_re); + srslte_mod_t mod = (is_ul) ? srslte_ra_ul_mod_from_mcs(mcs) : srslte_ra_dl_mod_from_mcs(mcs, use_tbs_index_alt); + uint32_t Qm = std::min(max_Qm, srslte_mod_bits_x_symbol(mod)); + return coderate - std::min(max_coderate, 0.930f * Qm); +} + +tbs_info cqi_to_tbs(const sched_ue_cell& cell, uint32_t nof_prb, uint32_t nof_re, bool is_ul) +{ + using ul64qam_cap = sched_interface::ue_cfg_t::ul64qam_cap; + uint32_t max_Qm; + int max_mcs; + float max_coderate; + if (is_ul) { + max_mcs = cell.max_mcs_ul; + max_Qm = cell.get_ue_cfg()->support_ul64qam == ul64qam_cap::enabled ? 6 : 4; + max_coderate = srslte_cqi_to_coderate(std::min(cell.ul_cqi + 1u, 15u), false); + } else { + max_mcs = cell.max_mcs_dl; + max_Qm = cell.get_ue_cfg()->use_tbs_index_alt ? 8 : 6; + max_coderate = srslte_cqi_to_coderate(std::min(cell.dl_cqi + 1u, 15u), cell.get_ue_cfg()->use_tbs_index_alt); + } + + // function with sign-flip at solution + auto test_mcs = [&](int sel_mcs) -> float { + return diff_coderate_maxcoderate( + sel_mcs, nof_prb, nof_re, max_Qm, max_coderate, cell.get_ue_cfg()->use_tbs_index_alt, is_ul); + }; + + std::tuple ret; + if (nof_prb > 1) { + // for non-voip case + ret = false_position_method(0, max_mcs, 0.0f, test_mcs); + } else { + // avoid 6 prbs (voip case), where function is not monotonic + ret = false_position_method(7, max_mcs, 0.0f, test_mcs); + if (std::get<1>(ret) > 0) { + ret = false_position_method(0, 5, 0.0f, test_mcs); + } + } + tbs_info ret2; + ret2.mcs = std::get<0>(ret); + ret2.tbs_bytes = get_tbs_bytes(ret2.mcs, nof_prb, cell.get_ue_cfg()->use_tbs_index_alt, is_ul); + + // If coderate > SRSLTE_MIN(max_coderate, 0.930 * Qm) we should set TBS=0. We don't because it's not correctly + // handled by the scheduler, but we might be scheduling undecodable codewords at very low SNR + + return ret2; +} + +/* In this scheduler we tend to use all the available bandwidth and select the MCS + * that approximates the minimum between the capacity and the requested rate + */ +tbs_info alloc_tbs(const sched_ue_cell& cell, uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, bool is_ul) +{ + // TODO: Compute real spectral efficiency based on PUSCH-UCI configuration + tbs_info ret = cqi_to_tbs(cell, nof_prb, nof_re, is_ul); + + /* If less bytes are requested, lower the MCS */ + if (ret.tbs_bytes > (int)req_bytes && req_bytes > 0) { + int req_tbs_idx = srslte_ra_tbs_to_table_idx(req_bytes * 8, nof_prb); + int req_mcs = srslte_ra_mcs_from_tbs_idx(req_tbs_idx, cell.get_ue_cfg()->use_tbs_index_alt, is_ul); + while (cell.get_ue_cfg()->use_tbs_index_alt and req_mcs < 0 and req_tbs_idx < 33) { + // some tbs_idx are invalid for 256QAM. See TS 36.213 - Table 7.1.7.1-1A + req_mcs = srslte_ra_mcs_from_tbs_idx(++req_tbs_idx, cell.get_ue_cfg()->use_tbs_index_alt, is_ul); + } + + if (req_mcs >= 0 and req_mcs < (int)ret.mcs) { + uint32_t max_Qm = + (is_ul) ? (cell.get_ue_cfg()->support_ul64qam == sched_interface::ue_cfg_t::ul64qam_cap::enabled ? 6 : 4) + : (cell.get_ue_cfg()->use_tbs_index_alt ? 8 : 6); + float max_coderate = + (is_ul) ? srslte_cqi_to_coderate(std::min(cell.ul_cqi + 1u, 15u), false) + : srslte_cqi_to_coderate(std::min(cell.dl_cqi + 1u, 15u), cell.get_ue_cfg()->use_tbs_index_alt); + if (diff_coderate_maxcoderate( + req_mcs, nof_prb, nof_re, max_Qm, max_coderate, cell.get_ue_cfg()->use_tbs_index_alt, is_ul) < 0) { + ret.mcs = req_mcs; + ret.tbs_bytes = srslte_ra_tbs_from_idx(req_tbs_idx, nof_prb) / 8; + } + } + } + // Avoid the unusual case n_prb=1, mcs=6 tbs=328 (used in voip) + if (nof_prb == 1 && ret.mcs == 6) { + ret.mcs--; + ret.tbs_bytes = get_tbs_bytes(ret.mcs, nof_prb, cell.get_ue_cfg()->use_tbs_index_alt, is_ul); + } + + return ret; +} + +tbs_info alloc_tbs_dl(const sched_ue_cell& cell, uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes) +{ + tbs_info ret; + + // Use a higher MCS for the Msg4 to fit in the 6 PRB case + if (cell.fixed_mcs_dl < 0 or not cell.dl_cqi_rx) { + // Dynamic MCS + ret = alloc_tbs(cell, nof_prb, nof_re, req_bytes, false); + } else { + // Fixed MCS + ret.mcs = cell.fixed_mcs_dl; + ret.tbs_bytes = get_tbs_bytes((uint32_t)cell.fixed_mcs_dl, nof_prb, cell.get_ue_cfg()->use_tbs_index_alt, false); + } + return ret; +} + +tbs_info +alloc_tbs_ul(const sched_ue_cell& cell, uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes, int explicit_mcs) +{ + tbs_info ret; + int mcs = explicit_mcs >= 0 ? explicit_mcs : cell.fixed_mcs_ul; + + if (mcs < 0) { + // Dynamic MCS + ret = alloc_tbs(cell, nof_prb, nof_re, req_bytes, true); + } else { + // Fixed MCS + ret.mcs = mcs; + ret.tbs_bytes = get_tbs_bytes((uint32_t)mcs, nof_prb, false, true); + } + + return ret; +} + +int get_required_prb_dl(const sched_ue_cell& cell, tti_point tti_tx_dl, uint32_t req_bytes) +{ + auto compute_tbs_approx = [tti_tx_dl, &cell](uint32_t nof_prb) { + uint32_t nof_re = cell.cell_cfg->get_dl_lb_nof_re(tti_tx_dl, nof_prb); + tbs_info tb = alloc_tbs_dl(cell, nof_prb, nof_re, 0); + return tb.tbs_bytes; + }; + + std::tuple ret = false_position_method( + 1u, cell.cell_cfg->nof_prb(), (int)req_bytes, compute_tbs_approx, [](int y) { return y == SRSLTE_ERROR; }); + int upper_tbs = std::get<3>(ret); + uint32_t upper_nprb = std::get<2>(ret); + return (upper_tbs < 0) ? 0 : ((upper_tbs < (int)req_bytes) ? -1 : upper_nprb); +} + +uint32_t get_required_prb_ul(const sched_ue_cell& cell, uint32_t req_bytes) +{ + if (req_bytes == 0) { + return 0; + } + auto compute_tbs_approx = [&cell](uint32_t nof_prb) { + const uint32_t N_srs = 0; + uint32_t nof_re = (2 * (SRSLTE_CP_NSYMB(cell.cell_cfg->cfg.cell.cp) - 1) - N_srs) * nof_prb * SRSLTE_NRE; + return alloc_tbs_ul(cell, nof_prb, nof_re, 0).tbs_bytes; + }; + + // find nof prbs that lead to a tbs just above req_bytes + int target_tbs = req_bytes + 4; + uint32_t max_prbs = std::min(cell.tpc_fsm.max_ul_prbs(), cell.cell_cfg->nof_prb()); + std::tuple ret = + false_position_method(1u, max_prbs, target_tbs, compute_tbs_approx, [](int y) { return y == SRSLTE_ERROR; }); + uint32_t req_prbs = std::get<2>(ret); + while (!srslte_dft_precoding_valid_prb(req_prbs) && req_prbs < cell.cell_cfg->nof_prb()) { + req_prbs++; + } + return req_prbs; +} + } // namespace srsenb From 4ed87babff6e14ef8c1af19f5496737b6540515d Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 18 Jan 2021 12:49:56 +0000 Subject: [PATCH 091/138] extend sched_ue_cell interface --- .../stack/mac/sched_ue_ctrl/sched_ue_cell.h | 2 ++ srsenb/src/stack/mac/sched_grid.cc | 6 ++--- srsenb/src/stack/mac/sched_ue.cc | 22 +++++++------------ 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index 1db80a21b..abbc7ff6a 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -40,6 +40,8 @@ struct sched_ue_cell { bool configured() const { return ue_cc_idx >= 0; } int get_ue_cc_idx() const { return ue_cc_idx; } + bool is_pcell() const { return ue_cc_idx == 0; } + bool is_scell() const { return ue_cc_idx > 0; } const ue_cc_cfg* get_ue_cc_cfg() const { return configured() ? &ue_cfg->supported_cc_list[ue_cc_idx] : nullptr; } const sched_interface::ue_cfg_t* get_ue_cfg() const { return configured() ? ue_cfg : nullptr; } cc_st cc_state() const { return cc_state_; } diff --git a/srsenb/src/stack/mac/sched_grid.cc b/srsenb/src/stack/mac/sched_grid.cc index 4508f8f1b..481c4cccf 100644 --- a/srsenb/src/stack/mac/sched_grid.cc +++ b/srsenb/src/stack/mac/sched_grid.cc @@ -774,7 +774,6 @@ alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_ma if (cc == nullptr or cc->cc_state() != cc_st::active) { return alloc_outcome_t::ERROR; } - uint32_t ue_cc_idx = cc->get_ue_cc_idx(); if (not user->pdsch_enabled(srslte::tti_point{get_tti_rx()}, cc_cfg->enb_cc_idx)) { return alloc_outcome_t::MEASGAP_COLLISION; } @@ -791,8 +790,9 @@ alloc_outcome_t sf_sched::alloc_dl_user(sched_ue* user, const rbgmask_t& user_ma } // Check if there is space in the PUCCH for HARQ ACKs - const sched_interface::ue_cfg_t& ue_cfg = user->get_ue_cfg(); - std::bitset scells = user->scell_activation_mask(); + const sched_interface::ue_cfg_t& ue_cfg = user->get_ue_cfg(); + std::bitset scells = user->scell_activation_mask(); + uint32_t ue_cc_idx = cc->get_ue_cc_idx(); if (user->nof_carriers_configured() > 1 and (ue_cc_idx == 0 or scells[ue_cc_idx]) and is_periodic_cqi_expected(ue_cfg, get_tti_tx_ul())) { bool has_pusch_grant = is_ul_alloc(user->get_rnti()) or cc_results->is_ul_alloc(user->get_rnti()); diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 75f238596..1a203a3cc 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -78,7 +78,7 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) for (auto& c : cells) { c.set_ue_cfg(cfg); scell_activation_state_changed |= - c.get_ue_cc_idx() > 0 and (c.cc_state() == cc_st::activating or c.cc_state() == cc_st::deactivating); + c.is_scell() and (c.cc_state() == cc_st::activating or c.cc_state() == cc_st::deactivating); } if (prev_supported_cc_list.empty() or prev_supported_cc_list[0].enb_cc_idx != cfg.supported_cc_list[0].enb_cc_idx) { log_h->info("SCHED: rnti=0x%x PCell is now enb_cc_idx=%d.\n", rnti, cfg.supported_cc_list[0].enb_cc_idx); @@ -361,7 +361,7 @@ tbs_info sched_ue::allocate_new_dl_mac_pdu(sched::dl_sched_data_t* data, // Allocate MAC PDU (subheaders, CEs, and SDUS) int rem_tbs = tb_info.tbs_bytes; - if (cells[enb_cc_idx].get_ue_cc_idx() == 0) { + if (cells[enb_cc_idx].is_pcell()) { rem_tbs -= allocate_mac_ces(data, lch_handler, rem_tbs); } rem_tbs -= allocate_mac_sdus(data, lch_handler, rem_tbs, tb); @@ -756,7 +756,7 @@ bool sched_ue::needs_cqi(uint32_t tti, uint32_t enb_cc_idx, bool will_send) */ rbg_interval sched_ue::get_required_dl_rbgs(uint32_t enb_cc_idx) { - assert(cells[enb_cc_idx].get_ue_cc_idx() >= 0); + assert(cells[enb_cc_idx].configured()); const auto* cellparams = cells[enb_cc_idx].cell_cfg; srslte::interval req_bytes = get_requested_dl_bytes(enb_cc_idx); if (req_bytes == srslte::interval{0, 0}) { @@ -795,8 +795,7 @@ rbg_interval sched_ue::get_required_dl_rbgs(uint32_t enb_cc_idx) */ srslte::interval sched_ue::get_requested_dl_bytes(uint32_t enb_cc_idx) { - assert(cells.at(enb_cc_idx).get_ue_cc_idx() >= 0); - uint32_t ue_cc_idx = cells[enb_cc_idx].get_ue_cc_idx(); + assert(cells.at(enb_cc_idx).configured()); /* Set Maximum boundary */ // Ensure there is space for ConRes and RRC Setup @@ -814,7 +813,7 @@ srslte::interval sched_ue::get_requested_dl_bytes(uint32_t enb_cc_idx) srb0_data = lch_handler.get_dl_tx_total_with_overhead(0); // Add pending CEs - if (ue_cc_idx == 0) { + if (cells[enb_cc_idx].is_pcell()) { if (srb0_data == 0 and not lch_handler.pending_ces.empty() and lch_handler.pending_ces.front() == srslte::dl_sch_lcid::CON_RES_ID) { // Wait for SRB0 data to be available for Msg4 before scheduling the ConRes CE @@ -1006,13 +1005,8 @@ const dl_harq_proc& sched_ue::get_dl_harq(uint32_t idx, uint32_t enb_cc_idx) con std::pair sched_ue::get_active_cell_index(uint32_t enb_cc_idx) const { - auto it = std::find_if( - cfg.supported_cc_list.begin(), - cfg.supported_cc_list.end(), - [enb_cc_idx](const sched_interface::ue_cfg_t::cc_cfg_t& u) { return u.enb_cc_idx == enb_cc_idx and u.active; }); - if (it != cfg.supported_cc_list.end()) { - uint32_t ue_cc_idx = std::distance(cfg.supported_cc_list.begin(), it); - return {cells[enb_cc_idx].cc_state() == cc_st::active, ue_cc_idx}; + if (cells[enb_cc_idx].configured()) { + return {cells[enb_cc_idx].cc_state() == cc_st::active, cells[enb_cc_idx].get_ue_cc_idx()}; } return {false, std::numeric_limits::max()}; } @@ -1077,7 +1071,7 @@ std::bitset sched_ue::scell_activation_mask() const { std::bitset ret{0}; for (size_t i = 0; i < cells.size(); ++i) { - if (cells[i].cc_state() == cc_st::active and cells[i].get_ue_cc_idx() > 0) { + if (cells[i].cc_state() == cc_st::active and cells[i].is_scell()) { ret[cells[i].get_ue_cc_idx()] = true; } } From 927938c7bec7f2cde215d3bdcaa3e37d4b2b88fa Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 18 Jan 2021 15:23:41 +0000 Subject: [PATCH 092/138] fix sched_ue configuration process when a carrier is set to 'not configured' --- .../src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index 83c0d6c98..cc862e95a 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -35,14 +35,18 @@ sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) { - cfg_tti = current_tti; - ue_cfg = &ue_cfg_; - ue_cc_idx = -1; + cfg_tti = current_tti; + ue_cfg = &ue_cfg_; + int prev_ue_cc_idx = ue_cc_idx; + ue_cc_idx = -1; for (size_t i = 0; i < ue_cfg_.supported_cc_list.size(); ++i) { if (ue_cfg_.supported_cc_list[i].enb_cc_idx == cell_cfg->enb_cc_idx) { ue_cc_idx = i; } } + if (ue_cc_idx < 0 and prev_ue_cc_idx < 0) { + return; + } // set max mcs max_mcs_ul = cell_cfg->sched_cfg->pusch_max_mcs >= 0 ? cell_cfg->sched_cfg->pusch_max_mcs : 28u; @@ -70,14 +74,14 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) switch (cc_state()) { case cc_st::activating: case cc_st::active: - if (not ue_cfg->supported_cc_list[ue_cc_idx].active) { + if (ue_cc_idx < 0 or not ue_cfg->supported_cc_list[ue_cc_idx].active) { cc_state_ = cc_st::deactivating; log_h->info("SCHED: Deactivating rnti=0x%x, SCellIndex=%d...\n", rnti, ue_cc_idx); } break; case cc_st::deactivating: case cc_st::idle: - if (ue_cfg->supported_cc_list[ue_cc_idx].active) { + if (ue_cc_idx > 0 and ue_cfg->supported_cc_list[ue_cc_idx].active) { reset(); cc_state_ = cc_st::activating; dl_cqi = 0; From 9b20e35b8f1b4162691408d7c1b6e608164d82aa Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 20 Jan 2021 17:49:23 +0000 Subject: [PATCH 093/138] add comment regarding implementation of false position method in the scheduler --- .../src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index cc862e95a..c2b8fcd4f 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -143,6 +143,22 @@ void sched_ue_cell::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) * TBS/MCS derivation ************************************************************/ +/** + * Implementation of false position method to iteratively find zero of given monotonic discrete function + * @tparam YType type of y axis + * @tparam Callable callable with interface "YType function(int)" + * @tparam ErrorDetect callable with interface "bool function(YType)" + * @param x1 min x value of input interval + * @param x2 max x value of input interval + * @param y0 target y value + * @param f monotonic function "YType f(int)" that crosses zero within [x1, x2] + * @param is_error returns true if an error has been detected + * @return solution of false position. It contains the interval when "f(x)" crossed y0. In case, + * - f(x2) <= y0 -> return is tuple(x2, y2, x2, y2) + * - f(x1) >= y0 -> return is tuple(x1, x1, x1, x1) + * - x' in ]x1, x2[, such that f(x') < y0 and f(x'+1) > y0 -> return is tuple(x', f(x'), x'+1, f(x'+1)) + * - x' in ]x1, x2[, such that f(x') == y0 -> return is tuple(x', f(x'), x', f(x')) + */ template std::tuple false_position_method(int x1, int x2, YType y0, const Callable& f, const ErrorDetect& is_error) From a24091edf8c63a284f52301f5d6cfbf4da4a9243 Mon Sep 17 00:00:00 2001 From: Francisco Date: Thu, 21 Jan 2021 11:35:47 +0000 Subject: [PATCH 094/138] fix handover regression. The new pcell was not being correctly reactivated --- srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h | 2 ++ srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index abbc7ff6a..54cffffe6 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -76,6 +76,8 @@ struct sched_ue_cell { int fixed_mcs_ul = 0, fixed_mcs_dl = 0; private: + void enter_idle_st(); + srslte::log_ref log_h{"MAC"}; const sched_interface::ue_cfg_t* ue_cfg = nullptr; diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index c2b8fcd4f..1ac33a2f8 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -61,7 +61,7 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) // Update carrier state if (ue_cc_idx == 0) { - if (cc_state() == cc_st::idle) { + if (cc_state() != cc_st::active) { reset(); // PCell is always active cc_state_ = cc_st::active; @@ -102,7 +102,7 @@ void sched_ue_cell::new_tti(tti_point tti_rx) if (ue_cc_idx > 0 and cc_state_ == cc_st::deactivating) { // wait for all ACKs to be received before completely deactivating SCell if (current_tti > to_tx_dl_ack(cfg_tti)) { - cc_state_ = cc_st::idle; + enter_idle_st(); } } } @@ -118,7 +118,6 @@ void sched_ue_cell::reset() dl_cqi_rx = false; ul_cqi = 1; ul_cqi_tti_rx = tti_point{}; - harq_ent.reset(); } void sched_ue_cell::finish_tti(tti_point tti_rx) @@ -139,6 +138,12 @@ void sched_ue_cell::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) } } +void sched_ue_cell::enter_idle_st() +{ + cc_state_ = cc_st::idle; + harq_ent.reset(); +} + /************************************************************* * TBS/MCS derivation ************************************************************/ From bed979b722017d8db68ed0243761e5f6c347cca1 Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 20 Jan 2021 20:52:39 +0000 Subject: [PATCH 095/138] fix out-of-bounds memory writing in the sched_interface::ue_cfg_t ue_bearers member --- lib/include/srslte/interfaces/sched_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/include/srslte/interfaces/sched_interface.h b/lib/include/srslte/interfaces/sched_interface.h index ebef4ceca..d2fd868e1 100644 --- a/lib/include/srslte/interfaces/sched_interface.h +++ b/lib/include/srslte/interfaces/sched_interface.h @@ -31,7 +31,7 @@ public: const static int MAX_SIB_PAYLOAD_LEN = 2048; const static int MAX_SIBS = 16; - const static int MAX_LC = 6; + const static int MAX_LC = 10; const static int MAX_LC_GROUP = 4; const static int MAX_DATA_LIST = 32; const static int MAX_RAR_LIST = 8; From e0937d1dd1086a9432d7420ca49a45abdaf18414 Mon Sep 17 00:00:00 2001 From: Francisco Date: Thu, 21 Jan 2021 10:19:40 +0000 Subject: [PATCH 096/138] add lcid check and increase limit to 10 --- lib/include/srslte/interfaces/sched_interface.h | 2 +- srsenb/src/stack/rrc/rrc_bearer_cfg.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/interfaces/sched_interface.h b/lib/include/srslte/interfaces/sched_interface.h index d2fd868e1..bc0939117 100644 --- a/lib/include/srslte/interfaces/sched_interface.h +++ b/lib/include/srslte/interfaces/sched_interface.h @@ -31,7 +31,7 @@ public: const static int MAX_SIB_PAYLOAD_LEN = 2048; const static int MAX_SIBS = 16; - const static int MAX_LC = 10; + const static int MAX_LC = 11; const static int MAX_LC_GROUP = 4; const static int MAX_DATA_LIST = 32; const static int MAX_RAR_LIST = 8; diff --git a/srsenb/src/stack/rrc/rrc_bearer_cfg.cc b/srsenb/src/stack/rrc/rrc_bearer_cfg.cc index c569a25c6..ea0342d2d 100644 --- a/srsenb/src/stack/rrc/rrc_bearer_cfg.cc +++ b/srsenb/src/stack/rrc/rrc_bearer_cfg.cc @@ -223,6 +223,10 @@ int bearer_cfg_handler::add_erab(uint8_t log_h->error("QCI=%d not configured\n", qos.qci); return SRSLTE_ERROR; } + if (lcid < 3 or lcid > 10) { + log_h->error("DRB logical channel ids must be within 3 and 10\n"); + return SRSLTE_ERROR; + } erabs[erab_id].id = erab_id; erabs[erab_id].qos_params = qos; From 59114206aedd99f6962b278db948dc01d658f86d Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 20 Jan 2021 16:42:37 +0100 Subject: [PATCH 097/138] SRSUE: Unify PRACH reconfiguration conditions --- srsue/hdr/phy/prach.h | 1 - srsue/src/phy/phy.cc | 22 ++++++++-------------- srsue/src/phy/prach.cc | 14 ++++++-------- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/srsue/hdr/phy/prach.h b/srsue/hdr/phy/prach.h index 3d65dc384..ff963353a 100644 --- a/srsue/hdr/phy/prach.h +++ b/srsue/hdr/phy/prach.h @@ -30,7 +30,6 @@ public: void init(uint32_t max_prb, srslte::log* log_h); void stop(); bool set_cell(srslte_cell_t cell, srslte_prach_cfg_t prach_cfg); - void reset_cfg(); bool prepare_to_send(uint32_t preamble_idx, int allowed_subframe = -1, float target_power_dbm = -1); bool is_ready_to_send(uint32_t current_tti, uint32_t current_pci); bool is_pending() const; diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index 5a50027e2..413241dee 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -466,18 +466,15 @@ bool phy::set_config(srslte::phy_cfg_t config_, uint32_t cc_idx) Info("Setting configuration\n"); - // The PRACH shall be re-configured only if: + // The PRACH configuration shall be updated only if: // - The new configuration belongs to the primary cell // - The PRACH configuration is present - // - The PRACH configuration has changed - bool reconfigure_prach = !cc_idx && config_.prach_cfg_present && (prach_cfg != config_.prach_cfg); - - if (reconfigure_prach) { - prach_buffer.reset_cfg(); + if (!cc_idx && config_.prach_cfg_present) { + prach_cfg = config_.prach_cfg; } // Apply configuration after the worker is finished to avoid race conditions - cmd_worker.add_cmd([this, config_, cc_idx, reconfigure_prach]() { + cmd_worker.add_cmd([this, config_, cc_idx]() { log_h->info("Setting new PHY configuration cc_idx=%d...\n", cc_idx); for (uint32_t i = 0; i < args.nof_phy_threads; i++) { // set_cell is not protected so run when worker is finished @@ -488,13 +485,10 @@ bool phy::set_config(srslte::phy_cfg_t config_, uint32_t cc_idx) } } log_h->info("Finished setting new PHY configuration cc_idx=%d\n", cc_idx); - if (reconfigure_prach) { - // Reconfigure PRACH parameters only if configuration is different - prach_cfg = config_.prach_cfg; - log_h->info("Setting new PRACH configuration...\n"); - configure_prach_params(); - log_h->info("Finished setting new PRACH configuration.\n"); - } + + // It is up to the PRACH component to detect whether the cell or the configuration have changed to reconfigure + configure_prach_params(); + stack->set_config_complete(true); }); return true; diff --git a/srsue/src/phy/prach.cc b/srsue/src/phy/prach.cc index 31756fea0..0c25d62de 100644 --- a/srsue/src/phy/prach.cc +++ b/srsue/src/phy/prach.cc @@ -12,6 +12,7 @@ #include "srsue/hdr/phy/prach.h" #include "srslte/common/log.h" +#include "srslte/interfaces/phy_interface_types.h" #include "srslte/interfaces/ue_interfaces.h" #include "srslte/srslte.h" @@ -83,11 +84,6 @@ void prach::stop() mem_initiated = false; } -void prach::reset_cfg() -{ - cell_initiated = false; -} - bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg) { if (!mem_initiated) { @@ -95,8 +91,7 @@ bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg) return false; } - // TODO: Check if other PRACH parameters changed - if (cell.id == cell_.id && cell_initiated) { + if (cell.id == cell_.id && cell_initiated && prach_cfg == cfg) { return true; } @@ -110,7 +105,8 @@ bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg) return false; } - Info("PRACH: configIdx=%d, rootSequence=%d, zeroCorrelationConfig=%d, freqOffset=%d\n", + Info("PRACH: cell.id=%d, configIdx=%d, rootSequence=%d, zeroCorrelationConfig=%d, freqOffset=%d\n", + cell.id, prach_cfg.config_idx, prach_cfg.root_seq_idx, prach_cfg.zero_corr_zone, @@ -126,6 +122,8 @@ bool prach::set_cell(srslte_cell_t cell_, srslte_prach_cfg_t prach_cfg) transmitted_tti = -1; cell_initiated = true; + log_h->info("Finished setting new PRACH configuration.\n"); + return true; } From 6ca8bc12ec67eebd3074946537af1935f8c28f36 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 20 Jan 2021 11:23:03 +0000 Subject: [PATCH 098/138] Fix wrong SN in RLC status PDU when packet is dropped. --- lib/src/upper/rlc_am_lte.cc | 10 ++++----- lib/test/upper/rlc_am_test.cc | 38 +++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/upper/rlc_am_lte.cc index dcbf335bd..6c04c3fca 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/upper/rlc_am_lte.cc @@ -1670,13 +1670,13 @@ int rlc_am_lte::rlc_am_lte_rx::get_status_pdu(rlc_status_pdu_t* status, const ui // We don't use segment NACKs - just NACK the full PDU uint32_t i = vr_r; - while (RX_MOD_BASE(i) < RX_MOD_BASE(vr_ms) && status->N_nack < RLC_AM_WINDOW_SIZE) { - if (rx_window.find(i) == rx_window.end()) { + while (RX_MOD_BASE(i) <= RX_MOD_BASE(vr_ms) && status->N_nack < RLC_AM_WINDOW_SIZE) { + if (rx_window.find(i) != rx_window.end() || i == vr_ms) { + // only update ACK_SN if this SN has been received, or if we reached the maximum possible SN + status->ack_sn = i; + } else { status->nacks[status->N_nack].nack_sn = i; status->N_nack++; - } else { - // only update ACK_SN if this SN has been received - status->ack_sn = i; } // make sure we don't exceed grant size diff --git a/lib/test/upper/rlc_am_test.cc b/lib/test/upper/rlc_am_test.cc index 6ad587a9d..667df51fa 100644 --- a/lib/test/upper/rlc_am_test.cc +++ b/lib/test/upper/rlc_am_test.cc @@ -173,6 +173,11 @@ bool basic_test() assert(0 == rlc2.get_buffer_state()); + // Assert status is correct + rlc_status_pdu_t status_check = {}; + rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check); + TESTASSERT(status_check.ack_sn == 5); // 5 is the last SN that was not received. + // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); @@ -225,7 +230,21 @@ bool concat_test() // Write PDU into RLC2 rlc2.write_pdu(pdu_buf.msg, pdu_buf.N_bytes); - // No status report as we haven't crossed polling thresholds + // Check status report + TESTASSERT(2 == rlc2.get_buffer_state()); + byte_buffer_t status_buf; + len = rlc2.read_pdu(status_buf.msg, 2); + status_buf.N_bytes = len; + + TESTASSERT(0 == rlc2.get_buffer_state()); + + // Assert status is correct + rlc_status_pdu_t status_check = {}; + rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check); + TESTASSERT(status_check.ack_sn == 1); // 1 is the last SN that was not received. + + // Write status PDU to RLC1 + rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); assert(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { @@ -302,6 +321,11 @@ bool segment_test(bool in_seq_rx) len = rlc2.read_pdu(status_buf.msg, 10); // 10 bytes is enough to hold the status status_buf.N_bytes = len; + // Assert status is correct + rlc_status_pdu_t status_check = {}; + rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check); + TESTASSERT(status_check.ack_sn == n_pdus); // n_pdus (8) is the last SN that was not received. + // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); } @@ -383,6 +407,16 @@ bool retx_test() len = rlc2.read_pdu(status_buf.msg, buffer_state); // provide exactly the reported buffer state status_buf.N_bytes = len; + // Assert all bytes for status PDU were read + buffer_state = rlc2.get_buffer_state(); + TESTASSERT(0 == buffer_state); + + // Assert status is correct + rlc_status_pdu_t status_check = {}; + rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check); + TESTASSERT(status_check.N_nack == 1); // 1 packet was lost. + TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 4. + // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); @@ -433,7 +467,7 @@ bool segment_retx_test() for (uint32_t i = 0; i < nof_sdus; i++) { sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true); sdu_bufs[i]->msg[0] = i; // Write the index into the buffer - sdu_bufs[i]->N_bytes = 10; // Give each buffer a size of 1 byte + sdu_bufs[i]->N_bytes = 10; // Give each buffer a size of 10 bytes rlc1.write_sdu(std::move(sdu_bufs[i])); } From fed4e0ad820bf574356e2dd89402793505af7fc8 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 21 Jan 2021 21:33:30 +0100 Subject: [PATCH 099/138] Protect access to ul buffers (#2227) * Protect access to ul buffers * Fix interval calculation when removing old buffers --- srsenb/hdr/stack/mac/ue.h | 1 + srsenb/src/stack/mac/ue.cc | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/srsenb/hdr/stack/mac/ue.h b/srsenb/hdr/stack/mac/ue.h index 120418d75..06e985d0b 100644 --- a/srsenb/hdr/stack/mac/ue.h +++ b/srsenb/hdr/stack/mac/ue.h @@ -124,6 +124,7 @@ private: std::vector, SRSLTE_FDD_NOF_HARQ> > tx_payload_buffer; + std::mutex rx_buffers_mutex; std::vector > rx_used_buffers; srslte::block_queue pending_ta_commands; diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index 477d1543b..21280dd69 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -77,11 +77,14 @@ ue::~ue() srslte_softbuffer_tx_free(&buffer); } } - for (auto& rx_buffers_cc : rx_used_buffers) { - for (auto& q : rx_buffers_cc) { - pdus.deallocate(q.second); + { + std::unique_lock lock(rx_buffers_mutex); + for (auto& rx_buffers_cc : rx_used_buffers) { + for (auto& q : rx_buffers_cc) { + pdus.deallocate(q.second); + } + rx_buffers_cc.clear(); } - rx_buffers_cc.clear(); } } @@ -170,6 +173,7 @@ ue::get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, con uint8_t* ue::request_buffer(uint32_t tti, uint32_t ue_cc_idx, const uint32_t len) { + std::unique_lock lock(rx_buffers_mutex); uint8_t* pdu = nullptr; if (len > 0) { // Deallocate oldest buffer if we didn't deallocate it @@ -191,11 +195,17 @@ uint8_t* ue::request_buffer(uint32_t tti, uint32_t ue_cc_idx, const uint32_t len void ue::clear_old_buffers(uint32_t tti) { + std::unique_lock lock(rx_buffers_mutex); + // remove old buffers for (auto& rx_buffer_cc : rx_used_buffers) { for (auto it = rx_buffer_cc.begin(); it != rx_buffer_cc.end();) { - if (srslte_tti_interval(tti, it->first) > 20) { - Warning("UE buffers: Removing old buffer tti=%d, rnti=%d, now is %d\n", it->first, rnti, tti); + if (srslte_tti_interval(tti, it->first) > 20 && srslte_tti_interval(tti, it->first) < 500) { + Warning("UE buffers: Removing old buffer tti=%d, rnti=%d, now is %d, interval=%d\n", + it->first, + rnti, + tti, + srslte_tti_interval(tti, it->first)); pdus.deallocate(it->second); it = rx_buffer_cc.erase(it); } else { @@ -329,6 +339,8 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe void ue::deallocate_pdu(uint32_t tti, uint32_t ue_cc_idx) { + std::unique_lock lock(rx_buffers_mutex); + if (rx_used_buffers.at(ue_cc_idx).count(tti)) { pdus.deallocate(rx_used_buffers.at(ue_cc_idx).at(tti)); rx_used_buffers.at(ue_cc_idx).erase(tti); @@ -342,6 +354,7 @@ void ue::deallocate_pdu(uint32_t tti, uint32_t ue_cc_idx) void ue::push_pdu(uint32_t tti, uint32_t ue_cc_idx, uint32_t len) { + std::unique_lock lock(rx_buffers_mutex); if (rx_used_buffers.at(ue_cc_idx).count(tti)) { if (len > 0) { pdus.push(rx_used_buffers.at(ue_cc_idx).at(tti), len); From 350e90a030bdfa054c6e9ac67761cde7506f0a0c Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 21 Jan 2021 17:13:09 +0000 Subject: [PATCH 100/138] Make RLC retransmissions deterministic. It was creating unpredictablity in the RLC AM tests. See issue #2228 --- lib/include/srslte/upper/rlc_am_lte.h | 2 +- lib/src/upper/rlc_am_lte.cc | 13 ++++++------- lib/test/upper/rlc_am_test.cc | 3 +-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/include/srslte/upper/rlc_am_lte.h b/lib/include/srslte/upper/rlc_am_lte.h index f3c39e735..096ca41d4 100644 --- a/lib/include/srslte/upper/rlc_am_lte.h +++ b/lib/include/srslte/upper/rlc_am_lte.h @@ -126,7 +126,7 @@ private: bool retx_queue_has_sn(uint32_t sn); int required_buffer_size(rlc_amd_retx_t retx); - void retransmit_random_pdu(); + void retransmit_pdu(); // Helpers bool poll_required(); diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/upper/rlc_am_lte.cc index 6c04c3fca..ab50c750f 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/upper/rlc_am_lte.cc @@ -409,9 +409,9 @@ int rlc_am_lte::rlc_am_lte_tx::read_pdu(uint8_t* payload, uint32_t nof_bytes) goto unlock_and_exit; } - // Section 5.2.2.3 in TS 36.311, if tx_window is full and retx_queue empty, retransmit random PDU + // Section 5.2.2.3 in TS 36.311, if tx_window is full and retx_queue empty, retransmit PDU if (tx_window.size() >= RLC_AM_WINDOW_SIZE && retx_queue.empty()) { - retransmit_random_pdu(); + retransmit_pdu(); } // RETX if required @@ -435,11 +435,11 @@ void rlc_am_lte::rlc_am_lte_tx::timer_expired(uint32_t timeout_id) pthread_mutex_lock(&mutex); if (poll_retx_timer.is_valid() && poll_retx_timer.id() == timeout_id) { log->debug("%s Poll reTx timer expired after %dms\n", RB_NAME, poll_retx_timer.duration()); - // Section 5.2.2.3 in TS 36.311, schedule random PDU for retransmission if + // Section 5.2.2.3 in TS 36.311, schedule PDU for retransmission if // (a) both tx and retx buffer are empty, or // (b) no new data PDU can be transmitted (tx window is full) if ((retx_queue.empty() && tx_sdu_queue.size() == 0) || tx_window.size() >= RLC_AM_WINDOW_SIZE) { - retransmit_random_pdu(); + retransmit_pdu(); } } pthread_mutex_unlock(&mutex); @@ -449,12 +449,11 @@ void rlc_am_lte::rlc_am_lte_tx::timer_expired(uint32_t timeout_id) } } -void rlc_am_lte::rlc_am_lte_tx::retransmit_random_pdu() +void rlc_am_lte::rlc_am_lte_tx::retransmit_pdu() { if (not tx_window.empty()) { - // randomly select PDU in tx window for retransmission + // select PDU in tx window for retransmission std::map::iterator it = tx_window.begin(); - std::advance(it, rand() % tx_window.size()); log->info("%s Schedule SN=%d for reTx.\n", RB_NAME, it->first); rlc_amd_retx_t retx = {}; retx.is_segment = false; diff --git a/lib/test/upper/rlc_am_test.cc b/lib/test/upper/rlc_am_test.cc index 667df51fa..be2362153 100644 --- a/lib/test/upper/rlc_am_test.cc +++ b/lib/test/upper/rlc_am_test.cc @@ -394,8 +394,7 @@ bool retx_test() assert(metrics.rx_buffered_bytes == 3); // Step timers until reordering timeout expires - int cnt = 5; - while (cnt--) { + for (int cnt = 0; cnt < 5; cnt++) { timers.step_all(); } From 26086252ba38e7fa4c24b7402eb76958d8b02334 Mon Sep 17 00:00:00 2001 From: Francisco Date: Mon, 25 Jan 2021 14:05:54 +0000 Subject: [PATCH 101/138] fix resetting of harqs in the scheduler during intra-enb handover --- srsenb/hdr/stack/mac/sched_ue.h | 1 - .../stack/mac/sched_ue_ctrl/sched_ue_cell.h | 2 +- srsenb/src/stack/mac/sched_ue.cc | 21 +----------- .../stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 34 ++++++++----------- 4 files changed, 17 insertions(+), 41 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue.h b/srsenb/hdr/stack/mac/sched_ue.h index cbdbf13f5..aefeb8e46 100644 --- a/srsenb/hdr/stack/mac/sched_ue.h +++ b/srsenb/hdr/stack/mac/sched_ue.h @@ -38,7 +38,6 @@ class sched_ue public: sched_ue(); - void reset(); void init(uint16_t rnti, const std::vector& cell_list_params_); void new_subframe(tti_point tti_rx, uint32_t enb_cc_idx); diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index 54cffffe6..2d603a6e1 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -33,7 +33,7 @@ struct sched_ue_cell { sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg_, tti_point current_tti); void set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_); void new_tti(tti_point tti_rx); - void reset(); + void clear_feedback(); void finish_tti(tti_point tti_rx); void set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_); diff --git a/srsenb/src/stack/mac/sched_ue.cc b/srsenb/src/stack/mac/sched_ue.cc index 1a203a3cc..a50409a08 100644 --- a/srsenb/src/stack/mac/sched_ue.cc +++ b/srsenb/src/stack/mac/sched_ue.cc @@ -35,10 +35,7 @@ namespace srsenb { * *******************************************************/ -sched_ue::sched_ue() : log_h(srslte::logmap::get("MAC")) -{ - reset(); -} +sched_ue::sched_ue() : log_h(srslte::logmap::get("MAC")) {} void sched_ue::init(uint16_t rnti_, const std::vector& cell_list_params_) { @@ -91,22 +88,6 @@ void sched_ue::set_cfg(const ue_cfg_t& cfg_) check_ue_cfg_correctness(cfg); } -void sched_ue::reset() -{ - cfg = {}; - sr = false; - phy_config_dedicated_enabled = false; - cqi_request_tti = 0; - for (auto& cc : cells) { - cc.reset(); - } - - // erase all bearers - for (uint32_t i = 0; i < cfg.ue_bearers.size(); ++i) { - lch_handler.config_lcid(i, {}); - } -} - void sched_ue::new_subframe(tti_point tti_rx, uint32_t enb_cc_idx) { if (current_tti != tti_rx) { diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index 1ac33a2f8..57b8d62e7 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -31,6 +31,7 @@ sched_ue_cell::sched_ue_cell(uint16_t rnti_, const sched_cell_params_t& cell_cfg current_tti(current_tti_) { max_aggr_level = cell_cfg->sched_cfg->max_aggr_level >= 0 ? cell_cfg->sched_cfg->max_aggr_level : 3; + clear_feedback(); } void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) @@ -59,16 +60,16 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) max_mcs_dl = std::min(max_mcs_dl, 27u); } + // If new cell configuration, clear Cell HARQs + if (ue_cc_idx != prev_ue_cc_idx) { + clear_feedback(); + harq_ent.reset(); + } + // Update carrier state if (ue_cc_idx == 0) { - if (cc_state() != cc_st::active) { - reset(); - // PCell is always active - cc_state_ = cc_st::active; - - // set initial DL CQI - dl_cqi = cell_cfg->cfg.initial_dl_cqi; - } + // PCell is always active + cc_state_ = cc_st::active; } else { // SCell case switch (cc_state()) { @@ -82,7 +83,6 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) case cc_st::deactivating: case cc_st::idle: if (ue_cc_idx > 0 and ue_cfg->supported_cc_list[ue_cc_idx].active) { - reset(); cc_state_ = cc_st::activating; dl_cqi = 0; log_h->info("SCHED: Activating rnti=0x%x, SCellIndex=%d...\n", rnti, ue_cc_idx); @@ -102,18 +102,20 @@ void sched_ue_cell::new_tti(tti_point tti_rx) if (ue_cc_idx > 0 and cc_state_ == cc_st::deactivating) { // wait for all ACKs to be received before completely deactivating SCell if (current_tti > to_tx_dl_ack(cfg_tti)) { - enter_idle_st(); + cc_state_ = cc_st::idle; + clear_feedback(); + harq_ent.reset(); } } } -void sched_ue_cell::reset() +void sched_ue_cell::clear_feedback() { dl_ri = 0; dl_ri_tti_rx = tti_point{}; dl_pmi = 0; dl_pmi_tti_rx = tti_point{}; - dl_cqi = 1; + dl_cqi = ue_cc_idx == 0 ? cell_cfg->cfg.initial_dl_cqi : 1; dl_cqi_tti_rx = tti_point{}; dl_cqi_rx = false; ul_cqi = 1; @@ -122,7 +124,7 @@ void sched_ue_cell::reset() void sched_ue_cell::finish_tti(tti_point tti_rx) { - // reset PIDs with pending data or blocked + // clear_feedback PIDs with pending data or blocked harq_ent.reset_pending_data(tti_rx); } @@ -138,12 +140,6 @@ void sched_ue_cell::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) } } -void sched_ue_cell::enter_idle_st() -{ - cc_state_ = cc_st::idle; - harq_ent.reset(); -} - /************************************************************* * TBS/MCS derivation ************************************************************/ From f6b4f65f1293e62b505d582af489a0918c2fc68f Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 19 Jan 2021 17:51:39 +0100 Subject: [PATCH 102/138] Add NR-PDSCH-DMRS SNR estimation --- lib/src/phy/ch_estimation/dmrs_sch.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/src/phy/ch_estimation/dmrs_sch.c b/lib/src/phy/ch_estimation/dmrs_sch.c index 9914b3949..6f382d6d5 100644 --- a/lib/src/phy/ch_estimation/dmrs_sch.c +++ b/lib/src/phy/ch_estimation/dmrs_sch.c @@ -706,6 +706,26 @@ int srslte_dmrs_sch_estimate(srslte_dmrs_sch_t* q, } } + float rsrp = 0.0f; + float epre = 0.0f; + for (uint32_t i = 0; i < nof_symbols; i++) { + cf_t corr = + srslte_vec_acc_cc(&q->pilot_estimates[nof_pilots_x_symbol * i], nof_pilots_x_symbol) / nof_pilots_x_symbol; + rsrp += __real__ corr * __real__ corr + __imag__ corr * __imag__ corr; + epre += srslte_vec_avg_power_cf(&q->pilot_estimates[nof_pilots_x_symbol * i], nof_pilots_x_symbol); + } + rsrp /= nof_symbols; + epre /= nof_symbols; + rsrp = SRSLTE_MIN(rsrp, epre); + + chest_res->rsrp = rsrp; + chest_res->rsrp_dbm = srslte_convert_power_to_dB(chest_res->rsrp); + + chest_res->noise_estimate = epre - rsrp; + chest_res->noise_estimate_dbm = srslte_convert_power_to_dB(chest_res->noise_estimate); + + chest_res->snr_db = chest_res->rsrp_dbm - chest_res->noise_estimate_dbm; + // Perform measurements here // ... From 3ee667c4a5270308a13bc1a09bd0e7d713af2553 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 19 Jan 2021 17:58:02 +0100 Subject: [PATCH 103/138] SRSUE: added NR-PDSCH constellation in GUI --- srsue/hdr/phy/nr/cc_worker.h | 2 + srsue/hdr/phy/nr/sf_worker.h | 2 + srsue/src/phy/lte/sf_worker.cc | 24 ++++++--- srsue/src/phy/nr/cc_worker.cc | 7 +++ srsue/src/phy/nr/sf_worker.cc | 90 +++++++++++++++++++++++++++++++++- srsue/src/phy/phy.cc | 3 ++ 6 files changed, 120 insertions(+), 8 deletions(-) diff --git a/srsue/hdr/phy/nr/cc_worker.h b/srsue/hdr/phy/nr/cc_worker.h index 613f40107..b222c3d18 100644 --- a/srsue/hdr/phy/nr/cc_worker.h +++ b/srsue/hdr/phy/nr/cc_worker.h @@ -71,6 +71,8 @@ public: bool work_dl(); + int read_pdsch_d(cf_t* pdsch_d); + private: srslte_dl_slot_cfg_t dl_slot_cfg = {}; uint32_t cc_idx = 0; diff --git a/srsue/hdr/phy/nr/sf_worker.h b/srsue/hdr/phy/nr/sf_worker.h index 4ef4805f4..040a66560 100644 --- a/srsue/hdr/phy/nr/sf_worker.h +++ b/srsue/hdr/phy/nr/sf_worker.h @@ -49,6 +49,8 @@ public: cf_t* get_buffer(uint32_t cc_idx, uint32_t antenna_idx); uint32_t get_buffer_len(); void set_tti(uint32_t tti); + int read_pdsch_d(cf_t* pdsch_d); + void start_plot(); private: /* Inherited from thread_pool::worker. Function called every subframe to run the DL/UL processing */ diff --git a/srsue/src/phy/lte/sf_worker.cc b/srsue/src/phy/lte/sf_worker.cc index 44ba1a9d2..8b78be745 100644 --- a/srsue/src/phy/lte/sf_worker.cc +++ b/srsue/src/phy/lte/sf_worker.cc @@ -35,10 +35,10 @@ #include "srsgui/srsgui.h" #include -void init_plots(srsue::lte::sf_worker* worker); -pthread_t plot_thread; -sem_t plot_sem; -static int plot_worker_id = -1; +static void init_plots(srsue::lte::sf_worker* worker); +static pthread_t plot_thread; +static sem_t plot_sem; +static int plot_worker_id = -1; #else #pragma message "Compiling without srsGUI support" #endif @@ -332,6 +332,8 @@ float sf_worker::get_cfo() #ifdef ENABLE_GUI plot_real_t pce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS]; plot_scatter_t pconst; +plot_scatter_t pconst_nr; +bool pconst_nr_ready = false; #define SCATTER_PDSCH_BUFFER_LEN (20 * 6 * SRSLTE_SF_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)) #define SCATTER_PDSCH_PLOT_LEN 4000 float tmp_plot[SCATTER_PDSCH_BUFFER_LEN]; @@ -352,7 +354,7 @@ static uint32_t isync = 0; static float sync_buffer[SYNC_PLOT_LEN]; #endif /* SYNC_PLOT_LEN > 0 */ -void* plot_thread_run(void* arg) +static void* plot_thread_run(void* arg) { auto worker = (srsue::lte::sf_worker*)arg; uint32_t row_count = 0; @@ -373,11 +375,19 @@ void* plot_thread_run(void* arg) row_count = worker->get_rx_nof_antennas(); plot_scatter_init(&pconst); - plot_scatter_setTitle(&pconst, (char*)"PDSCH - Equalized Symbols"); + plot_scatter_setTitle(&pconst, (char*)"LTE - PDSCH - Equalized Symbols"); plot_scatter_setXAxisScale(&pconst, -4, 4); plot_scatter_setYAxisScale(&pconst, -4, 4); - plot_scatter_addToWindowGrid(&pconst, (char*)"srsue", 0, row_count); + plot_scatter_addToWindowGrid(&pconst, (char*)"srsue", 0, row_count++); + + plot_scatter_init(&pconst_nr); + plot_scatter_setTitle(&pconst_nr, (char*)"NR - PDSCH - Equalized Symbols"); + plot_scatter_setXAxisScale(&pconst_nr, -4, 4); + plot_scatter_setYAxisScale(&pconst_nr, -4, 4); + + plot_scatter_addToWindowGrid(&pconst_nr, (char*)"srsue", 0, row_count++); + pconst_nr_ready = true; #if CFO_PLOT_LEN > 0 plot_real_init(&pcfo); diff --git a/srsue/src/phy/nr/cc_worker.cc b/srsue/src/phy/nr/cc_worker.cc index 6573585b0..bc384fd19 100644 --- a/srsue/src/phy/nr/cc_worker.cc +++ b/srsue/src/phy/nr/cc_worker.cc @@ -167,5 +167,12 @@ bool cc_worker::work_dl() return true; } +int cc_worker::read_pdsch_d(cf_t* pdsch_d) +{ + uint32_t nof_re = ue_dl.carrier.nof_prb * SRSLTE_NRE * 12; + srslte_vec_cf_copy(pdsch_d, ue_dl.pdsch.d[0], nof_re); + return nof_re; +} + } // namespace nr } // namespace srsue diff --git a/srsue/src/phy/nr/sf_worker.cc b/srsue/src/phy/nr/sf_worker.cc index 9e4f51d81..efa941a83 100644 --- a/srsue/src/phy/nr/sf_worker.cc +++ b/srsue/src/phy/nr/sf_worker.cc @@ -21,6 +21,18 @@ #include "srsue/hdr/phy/nr/sf_worker.h" +#ifdef ENABLE_GUI +#include "srsgui/srsgui.h" +#include + +static void init_plots(srsue::nr::sf_worker* worker); +static pthread_t plot_thread; +static sem_t plot_sem; +static int plot_worker_id = -1; +#else +#pragma message "Compiling without srsGUI support" +#endif + namespace srsue { namespace nr { sf_worker::sf_worker(phy_nr_state* phy_state_, srslte::log* log) : phy_state(phy_state_), log_h(log) @@ -67,7 +79,83 @@ void sf_worker::work_imp() for (auto& w : cc_workers) { w->work_dl(); } + + /* Tell the plotting thread to draw the plots */ +#ifdef ENABLE_GUI + if ((int)get_id() == plot_worker_id) { + sem_post(&plot_sem); + } +#endif +} + +int sf_worker::read_pdsch_d(cf_t* pdsch_d) +{ + return cc_workers[0]->read_pdsch_d(pdsch_d); +} + +void sf_worker::start_plot() +{ +#ifdef ENABLE_GUI + if (plot_worker_id == -1) { + plot_worker_id = get_id(); + srslte::console("Starting NR plot for worker_id=%d\n", plot_worker_id); + init_plots(this); + } else { + srslte::console("Trying to start a plot but already started by worker_id=%d\n", plot_worker_id); + } +#else + srslte::console("Trying to start a plot but plots are disabled (ENABLE_GUI constant in sf_worker.cc)\n"); +#endif } } // namespace nr -} // namespace srsue \ No newline at end of file +} // namespace srsue + +#ifdef ENABLE_GUI +extern plot_scatter_t pconst_nr; +extern bool pconst_nr_ready; +#define SCATTER_PDSCH_PLOT_LEN 4000 +static cf_t tmp_pconst_nr[SRSLTE_SF_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)]; +extern bool plot_quit; + +static void* plot_thread_run(void* arg) +{ + auto worker = (srsue::nr::sf_worker*)arg; + sleep(1); + int readed_pdsch_re = 0; + while (!plot_quit) { + sem_wait(&plot_sem); + + if (readed_pdsch_re < SCATTER_PDSCH_PLOT_LEN) { + int n = worker->read_pdsch_d(&tmp_pconst_nr[readed_pdsch_re]); + readed_pdsch_re += n; + } else { + if (readed_pdsch_re > 0 and pconst_nr_ready) { + plot_scatter_setNewData(&pconst_nr, tmp_pconst_nr, readed_pdsch_re); + } + readed_pdsch_re = 0; + } + } + return nullptr; +} + +static void init_plots(srsue::nr::sf_worker* worker) +{ + if (sem_init(&plot_sem, 0, 0)) { + perror("sem_init"); + exit(-1); + } + + pthread_attr_t attr; + struct sched_param param = {}; + param.sched_priority = 0; + pthread_attr_init(&attr); + pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + pthread_attr_setschedpolicy(&attr, SCHED_OTHER); + pthread_attr_setschedparam(&attr, ¶m); + if (pthread_create(&plot_thread, &attr, plot_thread_run, worker)) { + perror("pthread_create"); + exit(-1); + } +} +#endif \ No newline at end of file diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index 413241dee..b2e2a0563 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -441,6 +441,9 @@ void phy::set_crnti(uint16_t rnti) void phy::start_plot() { lte_workers[0]->start_plot(); + if (args.nof_nr_carriers > 0) { + nr_workers[0]->start_plot(); + } } void phy::enable_pregen_signals(bool enable) From 2baccc8b13ae851038fef278fc35624cdc7ad349 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 19 Jan 2021 17:58:32 +0100 Subject: [PATCH 104/138] Set NR-PDSCH default table to 256QAM --- srsenb/hdr/phy/nr/cc_worker.h | 1 + srsue/hdr/phy/nr/cc_worker.h | 1 + 2 files changed, 2 insertions(+) diff --git a/srsenb/hdr/phy/nr/cc_worker.h b/srsenb/hdr/phy/nr/cc_worker.h index a60cbddb0..68a04117d 100644 --- a/srsenb/hdr/phy/nr/cc_worker.h +++ b/srsenb/hdr/phy/nr/cc_worker.h @@ -54,6 +54,7 @@ public: args.dl.pdsch.measure_evm = true; args.dl.pdsch.measure_time = true; args.dl.pdsch.sch.disable_simd = true; + cfg.pdsch.sch_cfg.mcs_table = srslte_mcs_table_256qam; } }; diff --git a/srsue/hdr/phy/nr/cc_worker.h b/srsue/hdr/phy/nr/cc_worker.h index b222c3d18..ff1b963d3 100644 --- a/srsue/hdr/phy/nr/cc_worker.h +++ b/srsue/hdr/phy/nr/cc_worker.h @@ -54,6 +54,7 @@ public: args.dl.pdsch.measure_evm = true; args.dl.pdsch.measure_time = true; args.dl.pdsch.sch.disable_simd = false; + cfg.pdsch.sch_cfg.mcs_table = srslte_mcs_table_256qam; } }; From 13c594651e4ebb7ea523fc13cf7f5d3c1e0eb45a Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 20 Jan 2021 10:16:10 +0100 Subject: [PATCH 105/138] Apply minor NR GUI comments --- srsue/src/phy/lte/sf_worker.cc | 8 ++++++-- srsue/src/phy/nr/sf_worker.cc | 17 ++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/srsue/src/phy/lte/sf_worker.cc b/srsue/src/phy/lte/sf_worker.cc index 8b78be745..2428fc7f0 100644 --- a/srsue/src/phy/lte/sf_worker.cc +++ b/srsue/src/phy/lte/sf_worker.cc @@ -39,6 +39,7 @@ static void init_plots(srsue::lte::sf_worker* worker); static pthread_t plot_thread; static sem_t plot_sem; static int plot_worker_id = -1; +static bool plot_nr_enable = false; #else #pragma message "Compiling without srsGUI support" #endif @@ -294,6 +295,7 @@ void sf_worker::start_plot() #ifdef ENABLE_GUI if (plot_worker_id == -1) { plot_worker_id = get_id(); + plot_nr_enable = phy->args->nof_nr_carriers > 0; srslte::console("Starting plot for worker_id=%d\n", plot_worker_id); init_plots(this); } else { @@ -386,8 +388,10 @@ static void* plot_thread_run(void* arg) plot_scatter_setXAxisScale(&pconst_nr, -4, 4); plot_scatter_setYAxisScale(&pconst_nr, -4, 4); - plot_scatter_addToWindowGrid(&pconst_nr, (char*)"srsue", 0, row_count++); - pconst_nr_ready = true; + if (plot_nr_enable) { + plot_scatter_addToWindowGrid(&pconst_nr, (char*)"srsue", 0, row_count++); + pconst_nr_ready = true; + } #if CFO_PLOT_LEN > 0 plot_real_init(&pcfo); diff --git a/srsue/src/phy/nr/sf_worker.cc b/srsue/src/phy/nr/sf_worker.cc index efa941a83..bc53df4c6 100644 --- a/srsue/src/phy/nr/sf_worker.cc +++ b/srsue/src/phy/nr/sf_worker.cc @@ -115,25 +115,24 @@ void sf_worker::start_plot() extern plot_scatter_t pconst_nr; extern bool pconst_nr_ready; #define SCATTER_PDSCH_PLOT_LEN 4000 -static cf_t tmp_pconst_nr[SRSLTE_SF_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)]; +static cf_t tmp_pconst_nr[SRSLTE_NSYMB_PER_SLOT_NR * SRSLTE_NRE * SRSLTE_MAX_PRB_NR] = {}; extern bool plot_quit; static void* plot_thread_run(void* arg) { auto worker = (srsue::nr::sf_worker*)arg; - sleep(1); - int readed_pdsch_re = 0; + int pdsch_re_count = 0; while (!plot_quit) { sem_wait(&plot_sem); - if (readed_pdsch_re < SCATTER_PDSCH_PLOT_LEN) { - int n = worker->read_pdsch_d(&tmp_pconst_nr[readed_pdsch_re]); - readed_pdsch_re += n; + if (pdsch_re_count < SCATTER_PDSCH_PLOT_LEN) { + int n = worker->read_pdsch_d(&tmp_pconst_nr[pdsch_re_count]); + pdsch_re_count += n; } else { - if (readed_pdsch_re > 0 and pconst_nr_ready) { - plot_scatter_setNewData(&pconst_nr, tmp_pconst_nr, readed_pdsch_re); + if (pdsch_re_count > 0 and pconst_nr_ready) { + plot_scatter_setNewData(&pconst_nr, tmp_pconst_nr, pdsch_re_count); } - readed_pdsch_re = 0; + pdsch_re_count = 0; } } return nullptr; From be6cb666e2f3a1f7a615b72baa8e93a63b48ce1b Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 7 Jan 2021 13:46:49 +0100 Subject: [PATCH 106/138] Initial moved block coding to FEC --- lib/include/srslte/phy/phch/uci.h | 25 --- lib/src/phy/fec/CMakeLists.txt | 1 + lib/src/phy/fec/block/CMakeLists.txt | 13 ++ lib/src/phy/fec/block/block.c | 198 ++++++++++++++++++++++ lib/src/phy/fec/block/test/CMakeLists.txt | 16 ++ lib/src/phy/fec/block/test/block_test.c | 128 ++++++++++++++ lib/src/phy/phch/pucch.c | 5 +- lib/src/phy/phch/uci.c | 117 +------------ 8 files changed, 365 insertions(+), 138 deletions(-) create mode 100644 lib/src/phy/fec/block/CMakeLists.txt create mode 100644 lib/src/phy/fec/block/block.c create mode 100644 lib/src/phy/fec/block/test/CMakeLists.txt create mode 100644 lib/src/phy/fec/block/test/block_test.c diff --git a/lib/include/srslte/phy/phch/uci.h b/lib/include/srslte/phy/phch/uci.h index dd6442a22..9d5c45758 100644 --- a/lib/include/srslte/phy/phch/uci.h +++ b/lib/include/srslte/phy/phch/uci.h @@ -32,7 +32,6 @@ #define SRSLTE_UCI_MAX_CQI_LEN_PUCCH 13 #define SRSLTE_UCI_CQI_CODED_PUCCH_B 20 #define SRSLTE_UCI_STR_MAX_CHAR 32 -#define SRSLTE_UCI_M_BASIS_SEQ_LEN 32 typedef struct SRSLTE_API { srslte_crc_t crc; @@ -65,30 +64,6 @@ SRSLTE_API int16_t srslte_uci_decode_cqi_pucch(srslte_uci_cqi_pucch_t* q, int16_t b_bits[SRSLTE_CQI_MAX_BITS], // aligned for simd uint8_t* cqi_data, uint32_t cqi_len); -/** - * Encodes Uplink Control Information using M-basis code block channel coding. - * - * @param input points to the bit to encode, one word per bit - * @param input_len number of bits to encode, the maximum number of bits is 11 - * @param output points to the encoded data, one word per bit - * @param output_len number of bits of encoded bits - */ -SRSLTE_API void -srslte_uci_encode_m_basis_bits(const uint8_t* input, uint32_t input_len, uint8_t* output, uint32_t output_len); - -/** - * Decodes Uplink Control Information using M-basis code block channel coding. - * - * @param llr points soft-bits - * @param nof_llr number of soft-bits, requires a minimum of 32 soft-bits - * @param data points to receice data, one word per bit - * @param data_len number of bits to decode, the maximum number of bits is 11 - * @return maximum correlation value - */ -SRSLTE_API int32_t srslte_uci_decode_m_basis_bits(const int16_t* llr, - uint32_t nof_llr, - uint8_t* data, - uint32_t data_len); SRSLTE_API int srslte_uci_cqi_init(srslte_uci_cqi_pusch_t* q); diff --git a/lib/src/phy/fec/CMakeLists.txt b/lib/src/phy/fec/CMakeLists.txt index e2cbae0dc..8c6ced9a9 100644 --- a/lib/src/phy/fec/CMakeLists.txt +++ b/lib/src/phy/fec/CMakeLists.txt @@ -11,6 +11,7 @@ set(FEC_SOURCES crc.c softbuffer.c) +add_subdirectory(block) add_subdirectory(convolutional) add_subdirectory(ldpc) add_subdirectory(polar) diff --git a/lib/src/phy/fec/block/CMakeLists.txt b/lib/src/phy/fec/block/CMakeLists.txt new file mode 100644 index 000000000..be0d876d9 --- /dev/null +++ b/lib/src/phy/fec/block/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright 2013-2020 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. +# + +set(FEC_SOURCES ${FEC_SOURCES} + block/block.c + PARENT_SCOPE) + +add_subdirectory(test) diff --git a/lib/src/phy/fec/block/block.c b/lib/src/phy/fec/block/block.c new file mode 100644 index 000000000..4bdebae98 --- /dev/null +++ b/lib/src/phy/fec/block/block.c @@ -0,0 +1,198 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/fec/block/block.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/vector.h" + +// Use carry-less multiplication for parity check calculation only if AVX2 is available +#ifdef LV_HAVE_AVX2 +#include +#define USE_CARRYLESS_MULT 1 +#else +#define USE_CARRYLESS_MULT 0 +#endif // LV_HAVE_AVX2 + +// The following MACRO enables/disables LUT for the decoder +#define USE_LUT 1 + +// The following type is used for selecting the algorithm precision +typedef int16_t block_llr_t; + +/// Table 5.2.2.6.4-1: Basis sequence for (32, O) code compressed in uint16_t types +static const uint64_t M_basis_seq_b[SRSLTE_FEC_BLOCK_SIZE] = { + 0b10000000011, 0b11000000111, 0b11101001001, 0b10100001101, 0b10010001111, 0b10111010011, 0b11101010101, + 0b10110011001, 0b11010011011, 0b11001011101, 0b11011100101, 0b10101100111, 0b11110101001, 0b11010101011, + 0b10010110001, 0b11011110011, 0b01001110111, 0b00100111001, 0b00011111011, 0b00001100001, 0b10001000101, + 0b11000001011, 0b10110010001, 0b11100010111, 0b01111011111, 0b10011100011, 0b01100101101, 0b01110101111, + 0b00101110101, 0b00111111101, 0b11111111111, 0b00000000001, +}; + +static inline uint8_t encode_M_basis_seq_u16(uint16_t w, uint32_t bit_idx) +{ + // Apply mask + uint64_t d = w & M_basis_seq_b[bit_idx % SRSLTE_FEC_BLOCK_SIZE]; + +#if USE_CARRYLESS_MULT + // Compute parity using carry-less multiplication + const __m128i temp = _mm_clmulepi64_si128(_mm_set_epi64x(0, d), _mm_set_epi64x(0, 0xffffUL << 17UL), 0); + d = _mm_extract_epi32(temp, 1); +#else + // Compute parity using Bit Twiddling + d ^= d >> 8UL; + d ^= d >> 4UL; + d &= 0xFUL; + d = (0x6996U >> d); +#endif + + return (uint8_t)(d & 1UL); +} + +#if USE_LUT +static block_llr_t M_basis_seq_b_lut[1U << SRSLTE_FEC_BLOCK_MAX_NOF_BITS][SRSLTE_FEC_BLOCK_SIZE]; + +// Initialization function, as the table does not change, it can be initialised as constructor +__attribute__((constructor)) static void srslte_block_init() +{ + for (uint32_t word = 0; word < (1U << SRSLTE_FEC_BLOCK_MAX_NOF_BITS); word++) { + for (uint32_t i = 0; i < SRSLTE_FEC_BLOCK_SIZE; i++) { + // Encode guess word + M_basis_seq_b_lut[word][i] = encode_M_basis_seq_u16(word, i) * 2 - 1; + } + } +} +#endif + +void srslte_block_encode(const uint8_t* input, uint32_t input_len, uint8_t* output, uint32_t output_len) +{ + // Limit number of input bits + input_len = SRSLTE_MIN(input_len, SRSLTE_FEC_BLOCK_MAX_NOF_BITS); + + // Pack input bits + uint16_t w = 0; + for (uint32_t i = 0; i < input_len; i++) { + w |= (input[i] & 1U) << i; + } + + // Encode bits + for (uint32_t i = 0; i < SRSLTE_MIN(output_len, SRSLTE_FEC_BLOCK_SIZE); i++) { + output[i] = encode_M_basis_seq_u16(w, i); + } + + // Avoid repeating operation by copying repeated sequence + for (uint32_t i = SRSLTE_FEC_BLOCK_SIZE; i < output_len; i++) { + output[i] = output[i % SRSLTE_FEC_BLOCK_SIZE]; + } +} + +static int32_t srslte_block_decode(const block_llr_t llr[SRSLTE_FEC_BLOCK_SIZE], uint8_t* data, uint32_t data_len) +{ + int32_t max_corr = 0; //< Stores maximum correlation + uint32_t max_data = 0; //< Stores the word for maximum correlation + + // Limit data to maximum + data_len = SRSLTE_MIN(data_len, SRSLTE_FEC_BLOCK_MAX_NOF_BITS); + + // Brute force all possible sequences + uint16_t max_guess = (1U << data_len); //< Maximum guess bit combination (excluded) + for (uint16_t guess = 0; guess < max_guess; guess++) { + int32_t corr = 0; +#if USE_LUT + // Load sequence from LUT + block_llr_t* sequence = M_basis_seq_b_lut[guess]; + + // Dot product + for (uint32_t i = 0; i < SRSLTE_FEC_BLOCK_SIZE; i++) { + corr += llr[i] * sequence[i]; + } +#else + for (uint32_t i = 0; i < SRSLTE_FEC_BLOCK_SIZE; i++) { + // On-the-fly sequence generation and product + corr += llr[i] * (encode_M_basis_seq_u16(guess, i) * 2 - 1); + } +#endif + + // Take decision + if (corr > max_corr) { + max_corr = corr; + max_data = guess; + } + } + + // Unpack + for (uint32_t i = 0; i < data_len; i++) { + data[i] = (uint8_t)((max_data >> i) & 1U); + } + + // Return correlation + return max_corr; +} + +int32_t srslte_block_decode_i8(const int8_t* llr, uint32_t nof_llr, uint8_t* data, uint32_t data_len) +{ + block_llr_t llr_[SRSLTE_FEC_BLOCK_SIZE]; + + // Return invalid inputs if data is not provided + if (!llr || !data) { + ERROR("Invalid inputs\n"); + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Return invalid inputs if not enough LLR are provided + if (nof_llr < SRSLTE_FEC_BLOCK_SIZE) { + ERROR("Not enough LLR bits are provided %d. Required %d;\n", nof_llr, SRSLTE_FEC_BLOCK_SIZE); + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Load the minimum of LLRs + uint32_t i = 0; + for (; i < SRSLTE_FEC_BLOCK_SIZE; i++) { + llr_[i] = (block_llr_t)llr[i]; + } + + // Combine the rest of LLRs + for (; i < nof_llr; i++) { + llr_[i % SRSLTE_FEC_BLOCK_SIZE] += (block_llr_t)llr[i]; + } + + return srslte_block_decode(llr_, data, data_len); +} + +int32_t srslte_block_decode_i16(const int16_t* llr, uint32_t nof_llr, uint8_t* data, uint32_t data_len) +{ + block_llr_t llr_[SRSLTE_FEC_BLOCK_SIZE]; + + // Return invalid inputs if data is not provided + if (!llr || !data) { + ERROR("Invalid inputs\n"); + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Return invalid inputs if not enough LLR are provided + if (nof_llr < SRSLTE_FEC_BLOCK_SIZE) { + ERROR("Not enough LLR bits are provided %d. Required %d;\n", nof_llr, SRSLTE_FEC_BLOCK_SIZE); + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Load the minimum of LLRs + uint32_t i = 0; + for (; i < SRSLTE_FEC_BLOCK_SIZE; i++) { + llr_[i] = (block_llr_t)llr[i]; + } + + // Combine the rest of LLRs + for (; i < nof_llr; i++) { + llr_[i % SRSLTE_FEC_BLOCK_SIZE] += (block_llr_t)llr[i]; + } + + return srslte_block_decode(llr_, data, data_len); +} diff --git a/lib/src/phy/fec/block/test/CMakeLists.txt b/lib/src/phy/fec/block/test/CMakeLists.txt new file mode 100644 index 000000000..cafbf16ca --- /dev/null +++ b/lib/src/phy/fec/block/test/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright 2013-2020 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. +# + +######################################################################## +# Viterbi TEST +######################################################################## + +add_executable(block_test block_test.c) +target_link_libraries(block_test srslte_phy) + +add_test(block_test block_test) diff --git a/lib/src/phy/fec/block/test/block_test.c b/lib/src/phy/fec/block/test/block_test.c new file mode 100644 index 000000000..2e38a5577 --- /dev/null +++ b/lib/src/phy/fec/block/test/block_test.c @@ -0,0 +1,128 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ +#include "srslte/common/test_common.h" +#include "srslte/phy/fec/block/block.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/random.h" +#include +#include +#include +#include +#include +#include +#include + +static uint32_t seed = 0x1234; +static uint32_t nof_repetitions = 1; +static uint32_t E = SRSLTE_FEC_BLOCK_SIZE; +static uint32_t A = 100; +static srslte_random_t random_gen = NULL; + +void usage(char* prog) +{ + printf("Usage: %s [Rv]\n", prog); + printf("\t-R Number of repetitions [Default %d]\n", nof_repetitions); + printf("\t-v increase verbose [Default %d]\n", srslte_verbose); +} + +void parse_args(int argc, char** argv) +{ + int opt; + while ((opt = getopt(argc, argv, "Rv")) != -1) { + switch (opt) { + case 'R': + nof_repetitions = (uint32_t)strtol(argv[optind], NULL, 10); + break; + case 'v': + srslte_verbose++; + break; + default: + usage(argv[0]); + exit(-1); + } + } +} + +int test(uint32_t block_size) +{ + struct timeval t[3] = {}; + uint8_t tx[SRSLTE_FEC_BLOCK_MAX_NOF_BITS] = {}; + uint8_t rx[SRSLTE_FEC_BLOCK_MAX_NOF_BITS] = {}; + uint8_t encoded[SRSLTE_FEC_BLOCK_SIZE] = {}; + int16_t llr_i16[SRSLTE_FEC_BLOCK_SIZE] = {}; + int8_t llr_i8[SRSLTE_FEC_BLOCK_SIZE] = {}; + uint64_t t_encode_us = 0; + uint64_t t_decode_i16_us = 0; + uint64_t t_decode_i8_us = 0; + + for (uint32_t r = 0; r < nof_repetitions; r++) { + // Generate random data + for (uint32_t i = 0; i < block_size; i++) { + tx[i] = (uint8_t)srslte_random_uniform_int_dist(random_gen, 0, 1); + } + + gettimeofday(&t[1], NULL); + srslte_block_encode(tx, block_size, encoded, E); + gettimeofday(&t[2], NULL); + get_time_interval(t); + t_encode_us += t[0].tv_sec * 1000000 + t[0].tv_usec; + + for (uint32_t i = 0; i < E; i++) { + int32_t llr = (encoded[i] == 0) ? -A : +A; + llr_i16[i] = (int16_t)llr; + llr_i8[i] = (int8_t)llr; + } + + gettimeofday(&t[1], NULL); + int32_t corr_i16 = srslte_block_decode_i16(llr_i16, E, rx, block_size); + gettimeofday(&t[2], NULL); + get_time_interval(t); + TESTASSERT(corr_i16 == E * A); + TESTASSERT(memcmp(tx, rx, block_size) == 0); + t_decode_i16_us += t[0].tv_sec * 1000000 + t[0].tv_usec; + + gettimeofday(&t[1], NULL); + int32_t corr_i8 = srslte_block_decode_i8(llr_i8, E, rx, block_size); + gettimeofday(&t[2], NULL); + get_time_interval(t); + TESTASSERT(corr_i8 == E * A); + TESTASSERT(memcmp(tx, rx, block_size) == 0); + t_decode_i8_us += t[0].tv_sec * 1000000 + t[0].tv_usec; + } + + double total_bits = (double)(block_size * nof_repetitions); + INFO("Block size %d PASSED! Encoder: %.1f us / %.1f Mbps; 16 bit Decoder: %.1f us / %.2f Mbps; 8 bit decoder: %.1f / " + "%.2f Mbps\n", + block_size, + t_encode_us / (double)nof_repetitions, + total_bits / (double)t_encode_us, + t_decode_i16_us / (double)nof_repetitions, + total_bits / (double)t_decode_i16_us, + t_decode_i8_us / (double)nof_repetitions, + total_bits / (double)t_decode_i8_us); + + return SRSLTE_SUCCESS; +} + +int main(int argc, char** argv) +{ + parse_args(argc, argv); + random_gen = srslte_random_init(seed); + + for (uint32_t block_size = 3; block_size <= SRSLTE_FEC_BLOCK_MAX_NOF_BITS; block_size++) { + if (test(block_size) < SRSLTE_SUCCESS) { + break; + } + } + + srslte_random_free(random_gen); +} diff --git a/lib/src/phy/phch/pucch.c b/lib/src/phy/phch/pucch.c index bd26e2b11..63ffd9d2d 100644 --- a/lib/src/phy/phch/pucch.c +++ b/lib/src/phy/phch/pucch.c @@ -10,6 +10,7 @@ * */ +#include "srslte/phy/fec/block/block.h" #include "srslte/srslte.h" #include #include @@ -639,7 +640,7 @@ static int decode_signal_format3(srslte_pucch_t* q, srslte_scrambling_s_offset(seq, q->llr, 0, SRSLTE_PUCCH3_NOF_BITS); - return (int)srslte_uci_decode_m_basis_bits(q->llr, SRSLTE_PUCCH3_NOF_BITS, bits, SRSLTE_UCI_MAX_ACK_SR_BITS); + return (int)srslte_block_decode_i16(q->llr, SRSLTE_PUCCH3_NOF_BITS, bits, SRSLTE_UCI_MAX_ACK_SR_BITS); } else { ERROR("Error modulating PUCCH3 bits: rnti not set\n"); return SRSLTE_ERROR; @@ -699,7 +700,7 @@ static int encode_bits(srslte_pucch_cfg_t* cfg, temp[k] = (uint8_t)(uci_data->scheduling_request ? 1 : 0); k++; } - srslte_uci_encode_m_basis_bits(temp, k, pucch_bits, SRSLTE_PUCCH3_NOF_BITS); + srslte_block_encode(temp, k, pucch_bits, SRSLTE_PUCCH3_NOF_BITS); } return SRSLTE_SUCCESS; } diff --git a/lib/src/phy/phch/uci.c b/lib/src/phy/phch/uci.c index 5fd7dd80a..e4883a1a5 100644 --- a/lib/src/phy/phch/uci.c +++ b/lib/src/phy/phch/uci.c @@ -20,6 +20,7 @@ #include #include "srslte/phy/common/phy_common.h" +#include "srslte/phy/fec/block/block.h" #include "srslte/phy/fec/cbsegm.h" #include "srslte/phy/fec/convolutional/convcoder.h" #include "srslte/phy/fec/convolutional/rm_conv.h" @@ -30,7 +31,7 @@ #include "srslte/phy/utils/vector.h" /* Table 5.2.2.6.4-1: Basis sequence for (32, O) code */ -static uint8_t M_basis_seq[SRSLTE_UCI_M_BASIS_SEQ_LEN][SRSLTE_UCI_MAX_ACK_SR_BITS] = { +static uint8_t M_basis_seq[SRSLTE_FEC_BLOCK_SIZE][SRSLTE_UCI_MAX_ACK_SR_BITS] = { {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1}, {1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1}, {1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1}, {1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1}, {1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1}, {1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1}, {1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1}, {1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1}, @@ -44,30 +45,6 @@ static uint8_t M_basis_seq[SRSLTE_UCI_M_BASIS_SEQ_LEN][SRSLTE_UCI_MAX_ACK_SR_BIT {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }; -static inline bool encode_M_basis_seq_u16(uint16_t w, uint32_t bit_idx) -{ - /// Table 5.2.2.6.4-1: Basis sequence for (32, O) code compressed in uint16_t types - const uint16_t M_basis_seq_b[SRSLTE_UCI_M_BASIS_SEQ_LEN] = { - 0b10000000011, 0b11000000111, 0b11101001001, 0b10100001101, 0b10010001111, 0b10111010011, 0b11101010101, - 0b10110011001, 0b11010011011, 0b11001011101, 0b11011100101, 0b10101100111, 0b11110101001, 0b11010101011, - 0b10010110001, 0b11011110011, 0b01001110111, 0b00100111001, 0b00011111011, 0b00001100001, 0b10001000101, - 0b11000001011, 0b10110010001, 0b11100010111, 0b01111011111, 0b10011100011, 0b01100101101, 0b01110101111, - 0b00101110101, 0b00111111101, 0b11111111111, 0b00000000001, - }; - - // Apply mask - uint16_t d = (uint16_t)w & M_basis_seq_b[bit_idx % SRSLTE_UCI_M_BASIS_SEQ_LEN]; - - // Compute parity - d ^= (uint16_t)(d >> 8U); - d ^= (uint16_t)(d >> 4U); - d &= 0xf; - d = (0x6996U >> d) & 1U; - - // Return false if 0, otherwise it returns true - return (d != 0); -} - static uint8_t M_basis_seq_pucch[20][13] = { {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0}, {1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0}, {1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1}, {1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1}, @@ -182,88 +159,6 @@ int16_t srslte_uci_decode_cqi_pucch(srslte_uci_cqi_pucch_t* q, } } -void srslte_uci_encode_m_basis_bits(const uint8_t* input, uint32_t input_len, uint8_t* output, uint32_t output_len) -{ - // Limit number of input bits - input_len = SRSLTE_MIN(input_len, SRSLTE_UCI_MAX_ACK_SR_BITS); - - // Pack input bits - uint16_t w = 0; - for (uint32_t i = 0; i < input_len; i++) { - w |= (input[i] & 1U) << i; - } - - // Encode bits - for (uint32_t i = 0; i < SRSLTE_MIN(output_len, SRSLTE_UCI_M_BASIS_SEQ_LEN); i++) { - output[i] = encode_M_basis_seq_u16(w, i); - } - - // Avoid repeating operation by copying repeated sequence - for (uint32_t i = SRSLTE_UCI_M_BASIS_SEQ_LEN; i < output_len; i++) { - output[i] = output[i % SRSLTE_UCI_M_BASIS_SEQ_LEN]; - } -} - -int32_t srslte_uci_decode_m_basis_bits(const int16_t* llr, uint32_t nof_llr, uint8_t* data, uint32_t data_len) -{ - int32_t max_corr = 0; ///< Stores maximum correlation - uint16_t max_data = 0; ///< Stores the word for maximum correlation - - // Return invalid inputs if data is not provided - if (!llr || !data) { - ERROR("Invalid inputs\n"); - return SRSLTE_ERROR_INVALID_INPUTS; - } - - // Return invalid inputs if not enough LLR are provided - if (nof_llr < SRSLTE_UCI_M_BASIS_SEQ_LEN) { - ERROR("Not enough LLR bits are provided %d. Required %d;\n", nof_llr, SRSLTE_UCI_M_BASIS_SEQ_LEN); - return SRSLTE_ERROR_INVALID_INPUTS; - } - - // Limit data to maximum - data_len = SRSLTE_MIN(data_len, SRSLTE_UCI_MAX_ACK_SR_BITS); - - // Brute force all possible sequences - uint16_t max_guess = (1 << data_len); ///< Maximum guess bit combination - for (uint16_t guess = 0; guess < max_guess; guess++) { - int32_t corr = 0; - - /// Compute correlation for the number of LLR - bool early_termination = false; - for (uint32_t i = 0; i < nof_llr && !early_termination; i++) { - // Encode guess word - bool d = encode_M_basis_seq_u16(guess, i); - - // Correlate - corr += (int32_t)(d ? llr[i] : -llr[i]); - - // Limit correlation to half range - corr = SRSLTE_MIN(corr, INT32_MAX / 2); - - /// Early terminates if at least SRSLTE_UCI_M_BASIS_SEQ_LEN/4 LLR processed and negative correlation - early_termination |= (i > SRSLTE_UCI_M_BASIS_SEQ_LEN / 4) && (corr < 0); - - /// Early terminates if the correlation overflows - early_termination |= (corr < -INT32_MAX / 2); - } - - // Take decision - if (corr > max_corr) { - max_corr = corr; - max_data = guess; - } - } - - // Unpack - for (uint32_t i = 0; i < data_len; i++) { - data[i] = (uint8_t)((max_data >> i) & 1U); - } - - // Return correlation - return max_corr; -} - void cqi_pusch_pregen(srslte_uci_cqi_pusch_t* q) { uint8_t word[11]; @@ -275,7 +170,7 @@ void cqi_pusch_pregen(srslte_uci_cqi_pusch_t* q) for (uint32_t w = 0; w < nwords; w++) { uint8_t* ptr = word; srslte_bit_unpack(w, &ptr, i + 1); - srslte_uci_encode_m_basis_bits(word, i + 1, &q->cqi_table[i][32 * w], SRSLTE_UCI_M_BASIS_SEQ_LEN); + srslte_block_encode(word, i + 1, &q->cqi_table[i][32 * w], SRSLTE_FEC_BLOCK_SIZE); for (int j = 0; j < 32; j++) { q->cqi_table_s[i][32 * w + j] = 2 * q->cqi_table[i][32 * w + j] - 1; } @@ -829,8 +724,8 @@ int srslte_uci_decode_ack_ri(srslte_pusch_cfg_t* cfg, int16_t llr_acc[32] = {}; ///< LLR accumulator uint32_t nof_acc = - (nof_bits == 1) ? Qm : (nof_bits == 2) ? Qm * 3 : SRSLTE_UCI_M_BASIS_SEQ_LEN; ///< Number of required LLR - uint32_t count_acc = 0; ///< LLR counter + (nof_bits == 1) ? Qm : (nof_bits == 2) ? Qm * 3 : SRSLTE_FEC_BLOCK_SIZE; ///< Number of required LLR + uint32_t count_acc = 0; ///< LLR counter for (uint32_t i = 0; i < Qprime; i++) { if (is_ri) { @@ -875,7 +770,7 @@ int srslte_uci_decode_ack_ri(srslte_pusch_cfg_t* cfg, break; default: // For more than 2 bits... - corr = srslte_uci_decode_m_basis_bits(llr_acc, SRSLTE_UCI_M_BASIS_SEQ_LEN, data, nof_bits); + corr = srslte_block_decode_i16(llr_acc, SRSLTE_FEC_BLOCK_SIZE, data, nof_bits); } if (valid) { From 95ce49acd41bd67af90b2fd2c1d2d06a92b683fe Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Fri, 8 Jan 2021 10:45:04 +0100 Subject: [PATCH 107/138] Added more vector copy functions --- lib/include/srslte/phy/utils/vector.h | 3 +++ lib/src/phy/utils/vector.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/include/srslte/phy/utils/vector.h b/lib/include/srslte/phy/utils/vector.h index c055b0d79..a89aa1049 100644 --- a/lib/include/srslte/phy/utils/vector.h +++ b/lib/include/srslte/phy/utils/vector.h @@ -107,6 +107,9 @@ SRSLTE_API void srslte_vec_u32_zero(uint32_t* ptr, uint32_t nsamples); SRSLTE_API void srslte_vec_cf_copy(cf_t* dst, const cf_t* src, uint32_t len); SRSLTE_API void srslte_vec_f_copy(float* dst, const float* src, uint32_t len); SRSLTE_API void srslte_vec_u8_copy(uint8_t* dst, const uint8_t* src, uint32_t len); +SRSLTE_API void srslte_vec_i8_copy(int8_t* dst, const int8_t* src, uint32_t len); +SRSLTE_API void srslte_vec_u16_copy(uint16_t* dst, const uint16_t* src, uint32_t len); +SRSLTE_API void srslte_vec_i16_copy(int16_t* dst, const int16_t* src, uint32_t len); /* print vectors */ SRSLTE_API void srslte_vec_fprint_c(FILE* stream, const cf_t* x, const uint32_t len); diff --git a/lib/src/phy/utils/vector.c b/lib/src/phy/utils/vector.c index ef3495701..2064ce65c 100644 --- a/lib/src/phy/utils/vector.c +++ b/lib/src/phy/utils/vector.c @@ -226,6 +226,21 @@ void srslte_vec_u8_copy(uint8_t* dst, const uint8_t* src, uint32_t len) memcpy(dst, src, sizeof(uint8_t) * len); } +void srslte_vec_i8_copy(int8_t* dst, const int8_t* src, uint32_t len) +{ + memcpy(dst, src, sizeof(int8_t) * len); +} + +void srslte_vec_i16_copy(int16_t* dst, const int16_t* src, uint32_t len) +{ + memcpy(dst, src, sizeof(int16_t) * len); +} + +void srslte_vec_u16_copy(uint16_t* dst, const uint16_t* src, uint32_t len) +{ + memcpy(dst, src, sizeof(uint16_t) * len); +} + void* srslte_vec_realloc(void* ptr, uint32_t old_size, uint32_t new_size) { #ifndef LV_HAVE_SSE From ae3c5ec7d0dd176b73e8ca103c84b7526ab8b9ba Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Fri, 8 Jan 2021 10:47:14 +0100 Subject: [PATCH 108/138] Moved all block code (32, O/K) to FEC block Fix missing header Fix missing header --- lib/include/srslte/phy/fec/block/block.h | 65 +++++++++++++ lib/include/srslte/phy/phch/uci.h | 2 - lib/src/phy/fec/block/block.c | 81 ++++++++--------- lib/src/phy/fec/block/test/CMakeLists.txt | 4 +- lib/src/phy/fec/block/test/block_test.c | 84 +++++++++-------- lib/src/phy/phch/uci.c | 106 +++------------------- 6 files changed, 168 insertions(+), 174 deletions(-) create mode 100644 lib/include/srslte/phy/fec/block/block.h diff --git a/lib/include/srslte/phy/fec/block/block.h b/lib/include/srslte/phy/fec/block/block.h new file mode 100644 index 000000000..640acc5f3 --- /dev/null +++ b/lib/include/srslte/phy/fec/block/block.h @@ -0,0 +1,65 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_BLOCK_H +#define SRSLTE_BLOCK_H + +#include "srslte/config.h" +#include +#include + +/** + * @brief Maximum number of bits that can be encoded + */ +#define SRSLTE_FEC_BLOCK_MAX_NOF_BITS 11U + +/** + * @brief Block coding output complete length + */ +#define SRSLTE_FEC_BLOCK_SIZE 32U + +/** + * @brief Encodes unpacked data using Reed–Muller code block channel coding. + * + * @remark Described by 3GPP 36.212 section 5.2.3.3 for 4G/LTE + * @remark Described by 3GPP 38.212 section 5.3.3.3 for 5G/LTE + * + * @param[in] input provides unpacked bits to encode + * @param[in] input_len number of bits to encode, the maximum number of bits is SRSLTE_FEC_BLOCK_MAX_NOF_BITS + * @param[out] output points to the unpacked encoded data + * @param[in] output_len number of bits of encoded bits + */ +SRSLTE_API void srslte_block_encode(const uint8_t* input, uint32_t input_len, uint8_t* output, uint32_t output_len); + +/** + * @brief Decodes 16-bit signed data using Reed–Muller code block channel coding. + * + * @param[in] llr Provides received LLRs + * @param[in] nof_llr number of available LLRs + * @param[out] data Data destination to store unpacked received bits + * @param[in] data_len number of bits to decode, the maximum number of bits is SRSLTE_FEC_BLOCK_MAX_NOF_BITS + * @return Decoded bits correlation if provided arguments are valid, otherwise SRSLTE_ERROR code + */ +SRSLTE_API int32_t srslte_block_decode_i16(const int16_t* llr, uint32_t nof_llr, uint8_t* data, uint32_t data_len); + +/** + * @brief Decodes 8-bit signed data using Reed–Muller code block channel coding. + * + * @param[in] llr Provides received LLRs + * @param[in] nof_llr number of available LLRs + * @param[out] data Data destination to store unpacked received bits + * @param[in] data_len number of bits to decode, the maximum number of bits is SRSLTE_FEC_BLOCK_MAX_NOF_BITS + * @return Decoded bits correlation if provided arguments are valid, otherwise SRSLTE_ERROR code + */ +SRSLTE_API int32_t srslte_block_decode_i8(const int8_t* llr, uint32_t nof_llr, uint8_t* data, uint32_t data_len); + +#endif // SRSLTE_BLOCK_H diff --git a/lib/include/srslte/phy/phch/uci.h b/lib/include/srslte/phy/phch/uci.h index 9d5c45758..2fe03d433 100644 --- a/lib/include/srslte/phy/phch/uci.h +++ b/lib/include/srslte/phy/phch/uci.h @@ -39,8 +39,6 @@ typedef struct SRSLTE_API { uint8_t tmp_cqi[SRSLTE_UCI_MAX_CQI_LEN_PUSCH]; uint8_t encoded_cqi[3 * SRSLTE_UCI_MAX_CQI_LEN_PUSCH]; int16_t encoded_cqi_s[3 * SRSLTE_UCI_MAX_CQI_LEN_PUSCH]; - uint8_t* cqi_table[11]; - int16_t* cqi_table_s[11]; } srslte_uci_cqi_pusch_t; typedef struct SRSLTE_API { diff --git a/lib/src/phy/fec/block/block.c b/lib/src/phy/fec/block/block.c index 4bdebae98..4e473fd99 100644 --- a/lib/src/phy/fec/block/block.c +++ b/lib/src/phy/fec/block/block.c @@ -58,15 +58,23 @@ static inline uint8_t encode_M_basis_seq_u16(uint16_t w, uint32_t bit_idx) } #if USE_LUT -static block_llr_t M_basis_seq_b_lut[1U << SRSLTE_FEC_BLOCK_MAX_NOF_BITS][SRSLTE_FEC_BLOCK_SIZE]; +// Encoded unpacked table +static uint8_t block_unpacked_lut[1U << SRSLTE_FEC_BLOCK_MAX_NOF_BITS][SRSLTE_FEC_BLOCK_SIZE]; -// Initialization function, as the table does not change, it can be initialised as constructor +// LLR signed table +static block_llr_t block_llr_lut[1U << SRSLTE_FEC_BLOCK_MAX_NOF_BITS][SRSLTE_FEC_BLOCK_SIZE]; + +// Initialization function, as the table is read-only after initialization, it can be initialised from constructor __attribute__((constructor)) static void srslte_block_init() { for (uint32_t word = 0; word < (1U << SRSLTE_FEC_BLOCK_MAX_NOF_BITS); word++) { for (uint32_t i = 0; i < SRSLTE_FEC_BLOCK_SIZE; i++) { - // Encode guess word - M_basis_seq_b_lut[word][i] = encode_M_basis_seq_u16(word, i) * 2 - 1; + uint8_t e = encode_M_basis_seq_u16(word, i); + // Encoded unpacked byte + block_unpacked_lut[word][i] = e; + + // Encoded LLR + block_llr_lut[word][i] = (block_llr_t)e * 2 - 1; } } } @@ -74,16 +82,28 @@ __attribute__((constructor)) static void srslte_block_init() void srslte_block_encode(const uint8_t* input, uint32_t input_len, uint8_t* output, uint32_t output_len) { + if (!input || !output) { + ERROR("Invalid inputs\n"); + return; + } + // Limit number of input bits input_len = SRSLTE_MIN(input_len, SRSLTE_FEC_BLOCK_MAX_NOF_BITS); - // Pack input bits + // Pack input bits (reversed) uint16_t w = 0; for (uint32_t i = 0; i < input_len; i++) { w |= (input[i] & 1U) << i; } // Encode bits +#if USE_LUT + uint32_t i = 0; + for (; i < output_len / SRSLTE_FEC_BLOCK_SIZE; i++) { + srslte_vec_u8_copy(&output[i * SRSLTE_FEC_BLOCK_SIZE], block_unpacked_lut[w], SRSLTE_FEC_BLOCK_SIZE); + } + srslte_vec_u8_copy(&output[i * SRSLTE_FEC_BLOCK_SIZE], block_unpacked_lut[w], output_len % SRSLTE_FEC_BLOCK_SIZE); +#else // USE_LUT for (uint32_t i = 0; i < SRSLTE_MIN(output_len, SRSLTE_FEC_BLOCK_SIZE); i++) { output[i] = encode_M_basis_seq_u16(w, i); } @@ -92,9 +112,10 @@ void srslte_block_encode(const uint8_t* input, uint32_t input_len, uint8_t* outp for (uint32_t i = SRSLTE_FEC_BLOCK_SIZE; i < output_len; i++) { output[i] = output[i % SRSLTE_FEC_BLOCK_SIZE]; } +#endif // USE_LUT } -static int32_t srslte_block_decode(const block_llr_t llr[SRSLTE_FEC_BLOCK_SIZE], uint8_t* data, uint32_t data_len) +static int32_t block_decode(const block_llr_t* llr, uint8_t* data, uint32_t data_len) { int32_t max_corr = 0; //< Stores maximum correlation uint32_t max_data = 0; //< Stores the word for maximum correlation @@ -108,11 +129,9 @@ static int32_t srslte_block_decode(const block_llr_t llr[SRSLTE_FEC_BLOCK_SIZE], int32_t corr = 0; #if USE_LUT // Load sequence from LUT - block_llr_t* sequence = M_basis_seq_b_lut[guess]; - // Dot product for (uint32_t i = 0; i < SRSLTE_FEC_BLOCK_SIZE; i++) { - corr += llr[i] * sequence[i]; + corr += llr[i] * block_llr_lut[guess][i]; } #else for (uint32_t i = 0; i < SRSLTE_FEC_BLOCK_SIZE; i++) { @@ -128,7 +147,7 @@ static int32_t srslte_block_decode(const block_llr_t llr[SRSLTE_FEC_BLOCK_SIZE], } } - // Unpack + // Bit unpack (reversed) for (uint32_t i = 0; i < data_len; i++) { data[i] = (uint8_t)((max_data >> i) & 1U); } @@ -139,7 +158,7 @@ static int32_t srslte_block_decode(const block_llr_t llr[SRSLTE_FEC_BLOCK_SIZE], int32_t srslte_block_decode_i8(const int8_t* llr, uint32_t nof_llr, uint8_t* data, uint32_t data_len) { - block_llr_t llr_[SRSLTE_FEC_BLOCK_SIZE]; + block_llr_t llr_[SRSLTE_FEC_BLOCK_SIZE] = {}; // Return invalid inputs if data is not provided if (!llr || !data) { @@ -147,29 +166,17 @@ int32_t srslte_block_decode_i8(const int8_t* llr, uint32_t nof_llr, uint8_t* dat return SRSLTE_ERROR_INVALID_INPUTS; } - // Return invalid inputs if not enough LLR are provided - if (nof_llr < SRSLTE_FEC_BLOCK_SIZE) { - ERROR("Not enough LLR bits are provided %d. Required %d;\n", nof_llr, SRSLTE_FEC_BLOCK_SIZE); - return SRSLTE_ERROR_INVALID_INPUTS; - } - - // Load the minimum of LLRs - uint32_t i = 0; - for (; i < SRSLTE_FEC_BLOCK_SIZE; i++) { - llr_[i] = (block_llr_t)llr[i]; - } - - // Combine the rest of LLRs - for (; i < nof_llr; i++) { + // Accumulate all copies of the 32-length sequence + for (uint32_t i = 0; i < nof_llr; i++) { llr_[i % SRSLTE_FEC_BLOCK_SIZE] += (block_llr_t)llr[i]; } - return srslte_block_decode(llr_, data, data_len); + return block_decode(llr_, data, data_len); } int32_t srslte_block_decode_i16(const int16_t* llr, uint32_t nof_llr, uint8_t* data, uint32_t data_len) { - block_llr_t llr_[SRSLTE_FEC_BLOCK_SIZE]; + block_llr_t llr_[SRSLTE_FEC_BLOCK_SIZE] = {}; // Return invalid inputs if data is not provided if (!llr || !data) { @@ -177,22 +184,12 @@ int32_t srslte_block_decode_i16(const int16_t* llr, uint32_t nof_llr, uint8_t* d return SRSLTE_ERROR_INVALID_INPUTS; } - // Return invalid inputs if not enough LLR are provided - if (nof_llr < SRSLTE_FEC_BLOCK_SIZE) { - ERROR("Not enough LLR bits are provided %d. Required %d;\n", nof_llr, SRSLTE_FEC_BLOCK_SIZE); - return SRSLTE_ERROR_INVALID_INPUTS; - } - - // Load the minimum of LLRs + // Accumulate all copies of the 32-length sequence uint32_t i = 0; - for (; i < SRSLTE_FEC_BLOCK_SIZE; i++) { - llr_[i] = (block_llr_t)llr[i]; - } - - // Combine the rest of LLRs - for (; i < nof_llr; i++) { - llr_[i % SRSLTE_FEC_BLOCK_SIZE] += (block_llr_t)llr[i]; + for (; i < nof_llr / SRSLTE_FEC_BLOCK_SIZE; i++) { + srslte_vec_sum_sss(&llr[i * SRSLTE_FEC_BLOCK_SIZE], llr_, llr_, SRSLTE_FEC_BLOCK_SIZE); } + srslte_vec_sum_sss(&llr[i * SRSLTE_FEC_BLOCK_SIZE], llr_, llr_, nof_llr % SRSLTE_FEC_BLOCK_SIZE); - return srslte_block_decode(llr_, data, data_len); + return block_decode(llr_, data, data_len); } diff --git a/lib/src/phy/fec/block/test/CMakeLists.txt b/lib/src/phy/fec/block/test/CMakeLists.txt index cafbf16ca..89098f865 100644 --- a/lib/src/phy/fec/block/test/CMakeLists.txt +++ b/lib/src/phy/fec/block/test/CMakeLists.txt @@ -13,4 +13,6 @@ add_executable(block_test block_test.c) target_link_libraries(block_test srslte_phy) -add_test(block_test block_test) +add_test(block_test_20 block_test -E 20) +add_test(block_test_32 block_test -E 32) +add_test(block_test_48 block_test -E 48) diff --git a/lib/src/phy/fec/block/test/block_test.c b/lib/src/phy/fec/block/test/block_test.c index 2e38a5577..fdccfedaf 100644 --- a/lib/src/phy/fec/block/test/block_test.c +++ b/lib/src/phy/fec/block/test/block_test.c @@ -31,17 +31,21 @@ void usage(char* prog) { printf("Usage: %s [Rv]\n", prog); printf("\t-R Number of repetitions [Default %d]\n", nof_repetitions); + printf("\t-E Number of encoded bits [Default %d]\n", E); printf("\t-v increase verbose [Default %d]\n", srslte_verbose); } void parse_args(int argc, char** argv) { int opt; - while ((opt = getopt(argc, argv, "Rv")) != -1) { + while ((opt = getopt(argc, argv, "REv")) != -1) { switch (opt) { case 'R': nof_repetitions = (uint32_t)strtol(argv[optind], NULL, 10); break; + case 'E': + E = (uint32_t)strtol(argv[optind], NULL, 10); + break; case 'v': srslte_verbose++; break; @@ -54,50 +58,54 @@ void parse_args(int argc, char** argv) int test(uint32_t block_size) { - struct timeval t[3] = {}; - uint8_t tx[SRSLTE_FEC_BLOCK_MAX_NOF_BITS] = {}; - uint8_t rx[SRSLTE_FEC_BLOCK_MAX_NOF_BITS] = {}; - uint8_t encoded[SRSLTE_FEC_BLOCK_SIZE] = {}; - int16_t llr_i16[SRSLTE_FEC_BLOCK_SIZE] = {}; - int8_t llr_i8[SRSLTE_FEC_BLOCK_SIZE] = {}; - uint64_t t_encode_us = 0; - uint64_t t_decode_i16_us = 0; - uint64_t t_decode_i8_us = 0; + struct timeval t[3] = {}; + uint8_t tx[SRSLTE_FEC_BLOCK_MAX_NOF_BITS] = {}; + uint8_t rx[SRSLTE_FEC_BLOCK_MAX_NOF_BITS] = {}; + uint8_t encoded[4 * SRSLTE_FEC_BLOCK_SIZE] = {}; + int16_t llr_i16[4 * SRSLTE_FEC_BLOCK_SIZE] = {}; + int8_t llr_i8[4 * SRSLTE_FEC_BLOCK_SIZE] = {}; - for (uint32_t r = 0; r < nof_repetitions; r++) { - // Generate random data - for (uint32_t i = 0; i < block_size; i++) { - tx[i] = (uint8_t)srslte_random_uniform_int_dist(random_gen, 0, 1); - } + // Generate random data + for (uint32_t i = 0; i < block_size; i++) { + tx[i] = (uint8_t)srslte_random_uniform_int_dist(random_gen, 0, 1); + } - gettimeofday(&t[1], NULL); + gettimeofday(&t[1], NULL); + for (uint32_t r = 0; r < nof_repetitions; r++) { srslte_block_encode(tx, block_size, encoded, E); - gettimeofday(&t[2], NULL); - get_time_interval(t); - t_encode_us += t[0].tv_sec * 1000000 + t[0].tv_usec; + } + gettimeofday(&t[2], NULL); + get_time_interval(t); + uint64_t t_encode_us = t[0].tv_sec * 1000000 + t[0].tv_usec; - for (uint32_t i = 0; i < E; i++) { - int32_t llr = (encoded[i] == 0) ? -A : +A; - llr_i16[i] = (int16_t)llr; - llr_i8[i] = (int8_t)llr; - } + for (uint32_t i = 0; i < E; i++) { + int32_t llr = (encoded[i] == 0) ? -A : +A; + llr_i16[i] = (int16_t)llr; + llr_i8[i] = (int8_t)llr; + } + + int32_t corr_i16 = 0; + gettimeofday(&t[1], NULL); - gettimeofday(&t[1], NULL); - int32_t corr_i16 = srslte_block_decode_i16(llr_i16, E, rx, block_size); - gettimeofday(&t[2], NULL); - get_time_interval(t); - TESTASSERT(corr_i16 == E * A); - TESTASSERT(memcmp(tx, rx, block_size) == 0); - t_decode_i16_us += t[0].tv_sec * 1000000 + t[0].tv_usec; + for (uint32_t r = 0; r < nof_repetitions; r++) { + corr_i16 = srslte_block_decode_i16(llr_i16, E, rx, block_size); + } + gettimeofday(&t[2], NULL); + get_time_interval(t); + TESTASSERT(corr_i16 == E * A); + TESTASSERT(memcmp(tx, rx, block_size) == 0); + uint64_t t_decode_i16_us = t[0].tv_sec * 1000000 + t[0].tv_usec; - gettimeofday(&t[1], NULL); - int32_t corr_i8 = srslte_block_decode_i8(llr_i8, E, rx, block_size); - gettimeofday(&t[2], NULL); - get_time_interval(t); - TESTASSERT(corr_i8 == E * A); - TESTASSERT(memcmp(tx, rx, block_size) == 0); - t_decode_i8_us += t[0].tv_sec * 1000000 + t[0].tv_usec; + gettimeofday(&t[1], NULL); + int32_t corr_i8 = 0; + for (uint32_t r = 0; r < nof_repetitions; r++) { + corr_i8 = srslte_block_decode_i8(llr_i8, E, rx, block_size); } + gettimeofday(&t[2], NULL); + get_time_interval(t); + TESTASSERT(corr_i8 == E * A); + TESTASSERT(memcmp(tx, rx, block_size) == 0); + uint64_t t_decode_i8_us = t[0].tv_sec * 1000000 + t[0].tv_usec; double total_bits = (double)(block_size * nof_repetitions); INFO("Block size %d PASSED! Encoder: %.1f us / %.1f Mbps; 16 bit Decoder: %.1f us / %.2f Mbps; 8 bit decoder: %.1f / " diff --git a/lib/src/phy/phch/uci.c b/lib/src/phy/phch/uci.c index e4883a1a5..2757ab4e7 100644 --- a/lib/src/phy/phch/uci.c +++ b/lib/src/phy/phch/uci.c @@ -21,7 +21,6 @@ #include "srslte/phy/common/phy_common.h" #include "srslte/phy/fec/block/block.h" -#include "srslte/phy/fec/cbsegm.h" #include "srslte/phy/fec/convolutional/convcoder.h" #include "srslte/phy/fec/convolutional/rm_conv.h" #include "srslte/phy/fec/crc.h" @@ -30,21 +29,7 @@ #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" -/* Table 5.2.2.6.4-1: Basis sequence for (32, O) code */ -static uint8_t M_basis_seq[SRSLTE_FEC_BLOCK_SIZE][SRSLTE_UCI_MAX_ACK_SR_BITS] = { - {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1}, {1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1}, - {1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1}, {1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1}, {1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1}, - {1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1}, {1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1}, {1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1}, - {1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1}, {1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1}, {1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1}, - {1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1}, {1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1}, {1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1}, - {1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1}, {1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0}, {1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0}, - {1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0}, {1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1}, - {1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1}, {1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1}, {1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1}, - {1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0}, {1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1}, {1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0}, - {1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0}, {1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0}, {1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, - {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -}; - +/* Table 5.2.3.3-1: Basis sequences for (20, A) code */ static uint8_t M_basis_seq_pucch[20][13] = { {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0}, {1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0}, {1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1}, {1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1}, @@ -159,37 +144,6 @@ int16_t srslte_uci_decode_cqi_pucch(srslte_uci_cqi_pucch_t* q, } } -void cqi_pusch_pregen(srslte_uci_cqi_pusch_t* q) -{ - uint8_t word[11]; - - for (int i = 0; i < 11; i++) { - uint32_t nwords = (1 << (i + 1)); - q->cqi_table[i] = srslte_vec_u8_malloc(nwords * 32); - q->cqi_table_s[i] = srslte_vec_i16_malloc(nwords * 32); - for (uint32_t w = 0; w < nwords; w++) { - uint8_t* ptr = word; - srslte_bit_unpack(w, &ptr, i + 1); - srslte_block_encode(word, i + 1, &q->cqi_table[i][32 * w], SRSLTE_FEC_BLOCK_SIZE); - for (int j = 0; j < 32; j++) { - q->cqi_table_s[i][32 * w + j] = 2 * q->cqi_table[i][32 * w + j] - 1; - } - } - } -} - -void cqi_pusch_pregen_free(srslte_uci_cqi_pusch_t* q) -{ - for (int i = 0; i < 11; i++) { - if (q->cqi_table[i]) { - free(q->cqi_table[i]); - } - if (q->cqi_table_s[i]) { - free(q->cqi_table_s[i]); - } - } -} - int srslte_uci_cqi_init(srslte_uci_cqi_pusch_t* q) { if (srslte_crc_init(&q->crc, SRSLTE_LTE_CRC8, 8)) { @@ -200,16 +154,12 @@ int srslte_uci_cqi_init(srslte_uci_cqi_pusch_t* q) return SRSLTE_ERROR; } - cqi_pusch_pregen(q); - return SRSLTE_SUCCESS; } void srslte_uci_cqi_free(srslte_uci_cqi_pusch_t* q) { srslte_viterbi_free(&q->viterbi); - - cqi_pusch_pregen_free(q); } static uint32_t Q_prime_cqi(srslte_pusch_cfg_t* cfg, uint32_t O, float beta, uint32_t Q_prime_ri) @@ -244,48 +194,19 @@ uint32_t srslte_qprime_cqi_ext(uint32_t L_prb, uint32_t nof_symbols, uint32_t tb */ int encode_cqi_short(srslte_uci_cqi_pusch_t* q, uint8_t* data, uint32_t nof_bits, uint8_t* q_bits, uint32_t Q) { - if (nof_bits <= 11 && nof_bits > 0 && q != NULL && data != NULL && q_bits != NULL) { - uint8_t* ptr = data; - uint32_t w = srslte_bit_pack(&ptr, nof_bits); - - for (int i = 0; i < Q; i++) { - q_bits[i] = q->cqi_table[nof_bits - 1][w * 32 + (i % 32)]; - } + if (nof_bits <= SRSLTE_FEC_BLOCK_MAX_NOF_BITS && nof_bits > 0 && q != NULL && data != NULL && q_bits != NULL) { + srslte_block_encode(data, nof_bits, q_bits, Q); return SRSLTE_SUCCESS; - } else { - return SRSLTE_ERROR_INVALID_INPUTS; } + return SRSLTE_ERROR_INVALID_INPUTS; } // For decoding the block-encoded CQI we use ML decoding int decode_cqi_short(srslte_uci_cqi_pusch_t* q, int16_t* q_bits, uint32_t Q, uint8_t* data, uint32_t nof_bits) { - if (nof_bits <= 11 && nof_bits > 0 && q != NULL && data != NULL && q_bits != NULL) { - // Accumulate all copies of the 32-length sequence - if (Q > 32) { - int i = 1; - for (; i < Q / 32; i++) { - srslte_vec_sum_sss(&q_bits[i * 32], q_bits, q_bits, 32); - } - srslte_vec_sum_sss(&q_bits[i * 32], q_bits, q_bits, Q % 32); - } - - uint32_t max_w = 0; - int32_t max_corr = INT32_MIN; - for (uint32_t w = 0; w < (1 << nof_bits); w++) { - - // Calculate correlation with pregenerated word and select maximum - int32_t corr = srslte_vec_dot_prod_sss(&q->cqi_table_s[nof_bits - 1][w * 32], q_bits, SRSLTE_MIN(32, Q)); - if (corr > max_corr) { - max_corr = corr; - max_w = w; - } - } - // Convert word to bits again - uint8_t* ptr = data; - srslte_bit_unpack(max_w, &ptr, nof_bits); - - INFO("Decoded CQI: w=%d, corr=%d\n", max_w, max_corr); + if (nof_bits <= SRSLTE_FEC_BLOCK_MAX_NOF_BITS && nof_bits > 0 && q != NULL && data != NULL && q_bits != NULL) { + int32_t max_corr = srslte_block_decode_i16(q_bits, Q, data, nof_bits); + INFO("Decoded CQI: corr=%d\n", max_corr); return SRSLTE_SUCCESS; } else { return SRSLTE_ERROR_INVALID_INPUTS; @@ -566,12 +487,15 @@ encode_ack_long(const uint8_t* data, uint32_t O_ack, uint8_t Q_m, uint32_t Q_pri return 0; } + // Encoded bits + uint8_t q[SRSLTE_FEC_BLOCK_SIZE] = {}; + + // Encode + srslte_block_encode(data, O_ack, q, SRSLTE_FEC_BLOCK_SIZE); + + // Convert to UCI bits for (uint32_t i = 0; i < Q_ack; i++) { - uint32_t q_i = 0; - for (uint32_t n = 0; n < O_ack; n++) { - q_i = (q_i + (data[n] * M_basis_seq[i % 32][n])) % 2; - } - q_encoded_bits[i].type = q_i ? UCI_BIT_1 : UCI_BIT_0; + q_encoded_bits[i].type = q[i % SRSLTE_FEC_BLOCK_SIZE] ? UCI_BIT_1 : UCI_BIT_0; } return Q_ack; From a7ca8ffff7d4ee8591228d80c7309eaf81a3eb36 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 11 Jan 2021 10:02:11 +0100 Subject: [PATCH 109/138] Moved prime number to different file --- .../srslte/phy/ch_estimation/ul_rs_tables.h | 107 ++++++++---------- lib/include/srslte/phy/utils/primes.h | 34 ++++++ lib/src/phy/ch_estimation/chest_sl.c | 30 +++-- lib/src/phy/ch_estimation/refsignal_ul.c | 15 +-- lib/src/phy/utils/primes.c | 55 +++++++++ 5 files changed, 152 insertions(+), 89 deletions(-) create mode 100644 lib/include/srslte/phy/utils/primes.h create mode 100644 lib/src/phy/utils/primes.c diff --git a/lib/include/srslte/phy/ch_estimation/ul_rs_tables.h b/lib/include/srslte/phy/ch_estimation/ul_rs_tables.h index ea2f91086..41c44a491 100644 --- a/lib/include/srslte/phy/ch_estimation/ul_rs_tables.h +++ b/lib/include/srslte/phy/ch_estimation/ul_rs_tables.h @@ -16,67 +16,54 @@ #include // Phi values for M_sc=12 Table 5.5.1.2-1 in 36.211 -static const int phi_M_sc_12[30][12] = {{-1, 1, 3, -3, 3, 3, 1, 1, 3, 1, -3, 3}, {1, 1, 3, 3, 3, -1, 1, -3, -3, 1, -3, 3}, - {1, 1, -3, -3, -3, -1, -3, -3, 1, -3, 1, -1}, {-1, 1, 1, 1, 1, -1, -3, -3, 1, -3, 3, -1}, - {-1, 3, 1, -1, 1, -1, -3, -1, 1, -1, 1, 3}, {1, -3, 3, -1, -1, 1, 1, -1, -1, 3, -3, 1}, - {-1, 3, -3, -3, -3, 3, 1, -1, 3, 3, -3, 1}, {-3, -1, -1, -1, 1, -3, 3, -1, 1, -3, 3, 1}, - {1, -3, 3, 1, -1, -1, -1, 1, 1, 3, -1, 1}, {1, -3, -1, 3, 3, -1, -3, 1, 1, 1, 1, 1}, - {-1, 3, -1, 1, 1, -3, -3, -1, -3, -3, 3, -1}, {3, 1, -1, -1, 3, 3, -3, 1, 3, 1, 3, 3}, - {1, -3, 1, 1, -3, 1, 1, 1, -3, -3, -3, 1}, {3, 3, -3, 3, -3, 1, 1, 3, -1, -3, 3, 3}, - {-3, 1, -1, -3, -1, 3, 1, 3, 3, 3, -1, 1}, {3, -1, 1, -3, -1, -1, 1, 1, 3, 1, -1, -3}, - {1, 3, 1, -1, 1, 3, 3, 3, -1, -1, 3, -1}, {-3, 1, 1, 3, -3, 3, -3, -3, 3, 1, 3, -1}, - {-3, 3, 1, 1, -3, 1, -3, -3, -1, -1, 1, -3}, {-1, 3, 1, 3, 1, -1, -1, 3, -3, -1, -3, -1}, - {-1, -3, 1, 1, 1, 1, 3, 1, -1, 1, -3, -1}, {-1, 3, -1, 1, -3, -3, -3, -3, -3, 1, -1, -3}, - {1, 1, -3, -3, -3, -3, -1, 3, -3, 1, -3, 3}, {1, 1, -1, -3, -1, -3, 1, -1, 1, 3, -1, 1}, - {1, 1, 3, 1, 3, 3, -1, 1, -1, -3, -3, 1}, {1, -3, 3, 3, 1, 3, 3, 1, -3, -1, -1, 3}, - {1, 3, -3, -3, 3, -3, 1, -1, -1, 3, -1, -3}, {-3, -1, -3, -1, -3, 3, 1, -1, 1, 3, -3, -3}, - {-1, 3, -3, 3, -1, 3, 3, -3, 3, 3, -1, -1}, {3, -3, -3, -1, -1, -3, -1, 3, -3, 3, 1, -1}}; +static const int phi_M_sc_12[30][12] = { + {-1, 1, 3, -3, 3, 3, 1, 1, 3, 1, -3, 3}, {1, 1, 3, 3, 3, -1, 1, -3, -3, 1, -3, 3}, + {1, 1, -3, -3, -3, -1, -3, -3, 1, -3, 1, -1}, {-1, 1, 1, 1, 1, -1, -3, -3, 1, -3, 3, -1}, + {-1, 3, 1, -1, 1, -1, -3, -1, 1, -1, 1, 3}, {1, -3, 3, -1, -1, 1, 1, -1, -1, 3, -3, 1}, + {-1, 3, -3, -3, -3, 3, 1, -1, 3, 3, -3, 1}, {-3, -1, -1, -1, 1, -3, 3, -1, 1, -3, 3, 1}, + {1, -3, 3, 1, -1, -1, -1, 1, 1, 3, -1, 1}, {1, -3, -1, 3, 3, -1, -3, 1, 1, 1, 1, 1}, + {-1, 3, -1, 1, 1, -3, -3, -1, -3, -3, 3, -1}, {3, 1, -1, -1, 3, 3, -3, 1, 3, 1, 3, 3}, + {1, -3, 1, 1, -3, 1, 1, 1, -3, -3, -3, 1}, {3, 3, -3, 3, -3, 1, 1, 3, -1, -3, 3, 3}, + {-3, 1, -1, -3, -1, 3, 1, 3, 3, 3, -1, 1}, {3, -1, 1, -3, -1, -1, 1, 1, 3, 1, -1, -3}, + {1, 3, 1, -1, 1, 3, 3, 3, -1, -1, 3, -1}, {-3, 1, 1, 3, -3, 3, -3, -3, 3, 1, 3, -1}, + {-3, 3, 1, 1, -3, 1, -3, -3, -1, -1, 1, -3}, {-1, 3, 1, 3, 1, -1, -1, 3, -3, -1, -3, -1}, + {-1, -3, 1, 1, 1, 1, 3, 1, -1, 1, -3, -1}, {-1, 3, -1, 1, -3, -3, -3, -3, -3, 1, -1, -3}, + {1, 1, -3, -3, -3, -3, -1, 3, -3, 1, -3, 3}, {1, 1, -1, -3, -1, -3, 1, -1, 1, 3, -1, 1}, + {1, 1, 3, 1, 3, 3, -1, 1, -1, -3, -3, 1}, {1, -3, 3, 3, 1, 3, 3, 1, -3, -1, -1, 3}, + {1, 3, -3, -3, 3, -3, 1, -1, -1, 3, -1, -3}, {-3, -1, -3, -1, -3, 3, 1, -1, 1, 3, -3, -3}, + {-1, 3, -3, 3, -1, 3, 3, -3, 3, 3, -1, -1}, {3, -3, -3, -1, -1, -3, -1, 3, -3, 3, 1, -1}}; // Phi values for M_sc=24 Table 5.5.1.2-2 in 36.211 -static const int phi_M_sc_24[30][24] = {{-1, 3, 1, -3, 3, -1, 1, 3, -3, 3, 1, 3, -3, 3, 1, 1, -1, 1, 3, -3, 3, -3, -1, -3}, - {-3, 3, -3, -3, -3, 1, -3, -3, 3, -1, 1, 1, 1, 3, 1, -1, 3, -3, -3, 1, 3, 1, 1, -3}, - {3, -1, 3, 3, 1, 1, -3, 3, 3, 3, 3, 1, -1, 3, -1, 1, 1, -1, -3, -1, -1, 1, 3, 3}, - {-1, -3, 1, 1, 3, -3, 1, 1, -3, -1, -1, 1, 3, 1, 3, 1, -1, 3, 1, 1, -3, -1, -3, -1}, - {-1, -1, -1, -3, -3, -1, 1, 1, 3, 3, -1, 3, -1, 1, -1, -3, 1, -1, -3, -3, 1, -3, -1, -1}, - {-3, 1, 1, 3, -1, 1, 3, 1, -3, 1, -3, 1, 1, -1, -1, 3, -1, -3, 3, -3, -3, -3, 1, 1}, - {1, 1, -1, -1, 3, -3, -3, 3, -3, 1, -1, -1, 1, -1, 1, 1, -1, -3, -1, 1, -1, 3, -1, -3}, - {-3, 3, 3, -1, -1, -3, -1, 3, 1, 3, 1, 3, 1, 1, -1, 3, 1, -1, 1, 3, -3, -1, -1, 1}, - {-3, 1, 3, -3, 1, -1, -3, 3, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, 1, -3, -3, -3, 1, -3}, - {1, 1, -3, 3, 3, -1, -3, -1, 3, -3, 3, 3, 3, -1, 1, 1, -3, 1, -1, 1, 1, -3, 1, 1}, - {-1, 1, -3, -3, 3, -1, 3, -1, -1, -3, -3, -3, -1, -3, -3, 1, -1, 1, 3, 3, -1, 1, -1, 3}, - {1, 3, 3, -3, -3, 1, 3, 1, -1, -3, -3, -3, 3, 3, -3, 3, 3, -1, -3, 3, -1, 1, -3, 1}, - {1, 3, 3, 1, 1, 1, -1, -1, 1, -3, 3, -1, 1, 1, -3, 3, 3, -1, -3, 3, -3, -1, -3, -1}, - {3, -1, -1, -1, -1, -3, -1, 3, 3, 1, -1, 1, 3, 3, 3, -1, 1, 1, -3, 1, 3, -1, -3, 3}, - {-3, -3, 3, 1, 3, 1, -3, 3, 1, 3, 1, 1, 3, 3, -1, -1, -3, 1, -3, -1, 3, 1, 1, 3}, - {-1, -1, 1, -3, 1, 3, -3, 1, -1, -3, -1, 3, 1, 3, 1, -1, -3, -3, -1, -1, -3, -3, -3, -1}, - {-1, -3, 3, -1, -1, -1, -1, 1, 1, -3, 3, 1, 3, 3, 1, -1, 1, -3, 1, -3, 1, 1, -3, -1}, - {1, 3, -1, 3, 3, -1, -3, 1, -1, -3, 3, 3, 3, -1, 1, 1, 3, -1, -3, -1, 3, -1, -1, -1}, - {1, 1, 1, 1, 1, -1, 3, -1, -3, 1, 1, 3, -3, 1, -3, -1, 1, 1, -3, -3, 3, 1, 1, -3}, - {1, 3, 3, 1, -1, -3, 3, -1, 3, 3, 3, -3, 1, -1, 1, -1, -3, -1, 1, 3, -1, 3, -3, -3}, - {-1, -3, 3, -3, -3, -3, -1, -1, -3, -1, -3, 3, 1, 3, -3, -1, 3, -1, 1, -1, 3, -3, 1, -1}, - {-3, -3, 1, 1, -1, 1, -1, 1, -1, 3, 1, -3, -1, 1, -1, 1, -1, -1, 3, 3, -3, -1, 1, -3}, - {-3, -1, -3, 3, 1, -1, -3, -1, -3, -3, 3, -3, 3, -3, -1, 1, 3, 1, -3, 1, 3, 3, -1, -3}, - {-1, -1, -1, -1, 3, 3, 3, 1, 3, 3, -3, 1, 3, -1, 3, -1, 3, 3, -3, 3, 1, -1, 3, 3}, - {1, -1, 3, 3, -1, -3, 3, -3, -1, -1, 3, -1, 3, -1, -1, 1, 1, 1, 1, -1, -1, -3, -1, 3}, - {1, -1, 1, -1, 3, -1, 3, 1, 1, -1, -1, -3, 1, 1, -3, 1, 3, -3, 1, 1, -3, -3, -1, -1}, - {-3, -1, 1, 3, 1, 1, -3, -1, -1, -3, 3, -3, 3, 1, -3, 3, -3, 1, -1, 1, -3, 1, 1, 1}, - {-1, -3, 3, 3, 1, 1, 3, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -3, -1, -3, -1, -3, -1}, - {-1, -3, -1, -1, 1, -3, -1, -1, 1, -1, -3, 1, 1, -3, 1, -3, -3, 3, 1, 1, -1, 3, -1, -1}, - {1, 1, -1, -1, -3, -1, 3, -1, 3, -1, 1, 3, 1, -1, 3, 1, 3, -3, -3, 1, -1, -1, 1, 3}}; - -// Prime numbers used for Section 5.5.1.1 of 36.211 -#define NOF_PRIME_NUMBERS 196 -static const uint32_t prime_numbers[NOF_PRIME_NUMBERS] = { - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, - 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, - 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, - 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, - 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, - 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, - 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, - 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, - 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, - 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, - 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193}; +static const int phi_M_sc_24[30][24] = { + {-1, 3, 1, -3, 3, -1, 1, 3, -3, 3, 1, 3, -3, 3, 1, 1, -1, 1, 3, -3, 3, -3, -1, -3}, + {-3, 3, -3, -3, -3, 1, -3, -3, 3, -1, 1, 1, 1, 3, 1, -1, 3, -3, -3, 1, 3, 1, 1, -3}, + {3, -1, 3, 3, 1, 1, -3, 3, 3, 3, 3, 1, -1, 3, -1, 1, 1, -1, -3, -1, -1, 1, 3, 3}, + {-1, -3, 1, 1, 3, -3, 1, 1, -3, -1, -1, 1, 3, 1, 3, 1, -1, 3, 1, 1, -3, -1, -3, -1}, + {-1, -1, -1, -3, -3, -1, 1, 1, 3, 3, -1, 3, -1, 1, -1, -3, 1, -1, -3, -3, 1, -3, -1, -1}, + {-3, 1, 1, 3, -1, 1, 3, 1, -3, 1, -3, 1, 1, -1, -1, 3, -1, -3, 3, -3, -3, -3, 1, 1}, + {1, 1, -1, -1, 3, -3, -3, 3, -3, 1, -1, -1, 1, -1, 1, 1, -1, -3, -1, 1, -1, 3, -1, -3}, + {-3, 3, 3, -1, -1, -3, -1, 3, 1, 3, 1, 3, 1, 1, -1, 3, 1, -1, 1, 3, -3, -1, -1, 1}, + {-3, 1, 3, -3, 1, -1, -3, 3, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, 1, -3, -3, -3, 1, -3}, + {1, 1, -3, 3, 3, -1, -3, -1, 3, -3, 3, 3, 3, -1, 1, 1, -3, 1, -1, 1, 1, -3, 1, 1}, + {-1, 1, -3, -3, 3, -1, 3, -1, -1, -3, -3, -3, -1, -3, -3, 1, -1, 1, 3, 3, -1, 1, -1, 3}, + {1, 3, 3, -3, -3, 1, 3, 1, -1, -3, -3, -3, 3, 3, -3, 3, 3, -1, -3, 3, -1, 1, -3, 1}, + {1, 3, 3, 1, 1, 1, -1, -1, 1, -3, 3, -1, 1, 1, -3, 3, 3, -1, -3, 3, -3, -1, -3, -1}, + {3, -1, -1, -1, -1, -3, -1, 3, 3, 1, -1, 1, 3, 3, 3, -1, 1, 1, -3, 1, 3, -1, -3, 3}, + {-3, -3, 3, 1, 3, 1, -3, 3, 1, 3, 1, 1, 3, 3, -1, -1, -3, 1, -3, -1, 3, 1, 1, 3}, + {-1, -1, 1, -3, 1, 3, -3, 1, -1, -3, -1, 3, 1, 3, 1, -1, -3, -3, -1, -1, -3, -3, -3, -1}, + {-1, -3, 3, -1, -1, -1, -1, 1, 1, -3, 3, 1, 3, 3, 1, -1, 1, -3, 1, -3, 1, 1, -3, -1}, + {1, 3, -1, 3, 3, -1, -3, 1, -1, -3, 3, 3, 3, -1, 1, 1, 3, -1, -3, -1, 3, -1, -1, -1}, + {1, 1, 1, 1, 1, -1, 3, -1, -3, 1, 1, 3, -3, 1, -3, -1, 1, 1, -3, -3, 3, 1, 1, -3}, + {1, 3, 3, 1, -1, -3, 3, -1, 3, 3, 3, -3, 1, -1, 1, -1, -3, -1, 1, 3, -1, 3, -3, -3}, + {-1, -3, 3, -3, -3, -3, -1, -1, -3, -1, -3, 3, 1, 3, -3, -1, 3, -1, 1, -1, 3, -3, 1, -1}, + {-3, -3, 1, 1, -1, 1, -1, 1, -1, 3, 1, -3, -1, 1, -1, 1, -1, -1, 3, 3, -3, -1, 1, -3}, + {-3, -1, -3, 3, 1, -1, -3, -1, -3, -3, 3, -3, 3, -3, -1, 1, 3, 1, -3, 1, 3, 3, -1, -3}, + {-1, -1, -1, -1, 3, 3, 3, 1, 3, 3, -3, 1, 3, -1, 3, -1, 3, 3, -3, 3, 1, -1, 3, 3}, + {1, -1, 3, 3, -1, -3, 3, -3, -1, -1, 3, -1, 3, -1, -1, 1, 1, 1, 1, -1, -1, -3, -1, 3}, + {1, -1, 1, -1, 3, -1, 3, 1, 1, -1, -1, -3, 1, 1, -3, 1, 3, -3, 1, 1, -3, -3, -1, -1}, + {-3, -1, 1, 3, 1, 1, -3, -1, -1, -3, 3, -3, 3, 1, -3, 3, -3, 1, -1, 1, -3, 1, 1, 1}, + {-1, -3, 3, 3, 1, 1, 3, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -3, -1, -3, -1, -3, -1}, + {-1, -3, -1, -1, 1, -3, -1, -1, 1, -1, -3, 1, 1, -3, 1, -3, -3, 3, 1, 1, -1, 3, -1, -1}, + {1, 1, -1, -1, -3, -1, 3, -1, 3, -1, 1, 3, 1, -1, 3, 1, 3, -3, -3, 1, -1, -1, 1, 3}}; #endif \ No newline at end of file diff --git a/lib/include/srslte/phy/utils/primes.h b/lib/include/srslte/phy/utils/primes.h new file mode 100644 index 000000000..96600810f --- /dev/null +++ b/lib/include/srslte/phy/utils/primes.h @@ -0,0 +1,34 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_PRIMES_H +#define SRSLTE_PRIMES_H + +#include "srslte/config.h" +#include + +/** + * @brief Finds the smallest prime number greater than n + * @param[in] n Provide the number + * @return A prime number below 1193, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_prime_greater_than(uint32_t n); + +/** + * @brief Finds the biggest prime number lesser than n + * @attention the maximum prime number it can return is 1193 + * @param[in] n Provide the number + * @return A prime number below 1193, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_prime_lower_than(uint32_t n); + +#endif // SRSLTE_PRIMES_H diff --git a/lib/src/phy/ch_estimation/chest_sl.c b/lib/src/phy/ch_estimation/chest_sl.c index 82eb15e34..20a49a7cc 100644 --- a/lib/src/phy/ch_estimation/chest_sl.c +++ b/lib/src/phy/ch_estimation/chest_sl.c @@ -20,6 +20,7 @@ #include "srslte/phy/ch_estimation/refsignal_ul.h" #include "srslte/phy/mimo/precoding.h" #include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/primes.h" #include "srslte/phy/utils/vector.h" static int chest_sl_init(srslte_chest_sl_t* q, uint32_t nof_cyclic_shift_seq) @@ -120,13 +121,12 @@ static int chest_sl_psbch_gen(srslte_chest_sl_t* q) u[ns] = (f_gh + f_ss) % SRSLTE_SL_N_RU_SEQ; } - int32_t N_zc = prime_numbers[0]; // N_zc - Zadoff Chu Sequence Length - for (uint32_t i = NOF_PRIME_NUMBERS - 1; i > 0; i--) { - if (prime_numbers[i] < q->M_sc_rs) { - N_zc = prime_numbers[i]; - break; - } + int32_t N_zc = srslte_prime_lower_than(q->M_sc_rs); // N_zc - Zadoff Chu Sequence Length + if (N_zc < SRSLTE_SUCCESS) { + ERROR("Could not find prime number\n"); + return SRSLTE_ERROR; } + for (int j = 0; j < q->nof_dmrs_symbols; ++j) { q->q[j] = srslte_refsignal_get_q(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, N_zc); float n_sz = (float)N_zc; @@ -358,11 +358,10 @@ static int chest_sl_pscch_gen(srslte_chest_sl_t* q, uint32_t cyclic_shift) } break; default: - for (uint32_t i = NOF_PRIME_NUMBERS - 1; i > 0; i--) { - if (prime_numbers[i] < q->M_sc_rs) { - N_zc = prime_numbers[i]; - break; - } + N_zc = srslte_prime_lower_than(q->M_sc_rs); // N_zc - Zadoff Chu Sequence Length + if (N_zc < SRSLTE_SUCCESS) { + ERROR("Could not find prime number\n"); + return SRSLTE_ERROR; } for (int j = 0; j < q->nof_dmrs_symbols; ++j) { q->q[j] = srslte_refsignal_get_q(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, N_zc); @@ -585,11 +584,10 @@ static int chest_sl_pssch_gen(srslte_chest_sl_t* q) } break; default: - for (uint32_t i = NOF_PRIME_NUMBERS - 1; i > 0; i--) { - if (prime_numbers[i] < q->M_sc_rs) { - N_zc = prime_numbers[i]; - break; - } + N_zc = srslte_prime_lower_than(q->M_sc_rs); // N_zc - Zadoff Chu Sequence Length + if (N_zc < SRSLTE_SUCCESS) { + ERROR("Could not find prime number\n"); + return SRSLTE_ERROR; } for (int j = 0; j < q->nof_dmrs_symbols; ++j) { q->q[j] = srslte_refsignal_get_q(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, N_zc); diff --git a/lib/src/phy/ch_estimation/refsignal_ul.c b/lib/src/phy/ch_estimation/refsignal_ul.c index eea61b3d1..e2f532ba5 100644 --- a/lib/src/phy/ch_estimation/refsignal_ul.c +++ b/lib/src/phy/ch_estimation/refsignal_ul.c @@ -22,6 +22,7 @@ #include "srslte/phy/dft/dft_precoding.h" #include "srslte/phy/phch/pucch.h" #include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/primes.h" #include "srslte/phy/utils/vector.h" // n_dmrs_2 table 5.5.2.1.1-1 from 36.211 @@ -204,17 +205,6 @@ int srslte_refsignal_ul_set_cell(srslte_refsignal_ul_t* q, srslte_cell_t cell) return ret; } -static uint32_t largest_prime_lower_than(uint32_t x) -{ - /* get largest prime n_zc 0; i--) { - if (prime_numbers[i] < x) { - return prime_numbers[i]; - } - } - return 0; -} - static void arg_r_uv_2prb(float* arg, uint32_t u) { for (int i = 0; i < 2 * SRSLTE_NRE; i++) { @@ -239,8 +229,7 @@ uint32_t srslte_refsignal_get_q(uint32_t u, uint32_t v, uint32_t N_sz) static void arg_r_uv_mprb(float* arg, uint32_t M_sc, uint32_t u, uint32_t v) { - - uint32_t N_sz = largest_prime_lower_than(M_sc); + int32_t N_sz = srslte_prime_lower_than(M_sc); // N_zc - Zadoff Chu Sequence Length if (N_sz > 0) { float q = srslte_refsignal_get_q(u, v, N_sz); float n_sz = (float)N_sz; diff --git a/lib/src/phy/utils/primes.c b/lib/src/phy/utils/primes.c new file mode 100644 index 000000000..03eb64cd6 --- /dev/null +++ b/lib/src/phy/utils/primes.c @@ -0,0 +1,55 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/utils/primes.h" + +#define NOF_PRIME_NUMBERS 196 + +static const uint32_t prime_numbers[NOF_PRIME_NUMBERS] = { + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, + 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, + 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, + 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, + 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, + 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, + 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, + 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, + 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, + 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, + 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193}; + +int srslte_prime_greater_than(uint32_t n) +{ + for (uint32_t i = 0; i < NOF_PRIME_NUMBERS; i++) { + if (prime_numbers[i] > n) { + return n; + } + } + + return SRSLTE_ERROR_OUT_OF_BOUNDS; +} + +int srslte_prime_lower_than(uint32_t n) +{ + + if (n > prime_numbers[NOF_PRIME_NUMBERS - 1]) { + return SRSLTE_ERROR_OUT_OF_BOUNDS; + } + + for (uint32_t i = NOF_PRIME_NUMBERS - 1; i > 0; i--) { + if (prime_numbers[i] < n) { + return n; + } + } + + return 2; +} From 6bb1788df1aced58e3ee54154c3536eb76b81545 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 11 Jan 2021 10:02:31 +0100 Subject: [PATCH 110/138] Added more NR CRC polynomials --- lib/include/srslte/phy/common/phy_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/include/srslte/phy/common/phy_common.h b/lib/include/srslte/phy/common/phy_common.h index 7bb1d1161..b7a8a6f3f 100644 --- a/lib/include/srslte/phy/common/phy_common.h +++ b/lib/include/srslte/phy/common/phy_common.h @@ -64,7 +64,9 @@ extern "C" { #define SRSLTE_LTE_CRC24B 0X1800063 #define SRSLTE_LTE_CRC24C 0X1B2B117 #define SRSLTE_LTE_CRC16 0x11021 +#define SRSLTE_LTE_CRC11 0x621 #define SRSLTE_LTE_CRC8 0x19B +#define SRSLTE_LTE_CRC6 0x61 #define SRSLTE_MAX_MBSFN_AREA_IDS 256 #define SRSLTE_PMCH_RV 0 From 8de73988b81e24875754904da2f819bbd815e5f8 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 11 Jan 2021 17:45:48 +0100 Subject: [PATCH 111/138] Add real vector and complex scalar product --- lib/include/srslte/phy/utils/vector.h | 1 + lib/include/srslte/phy/utils/vector_simd.h | 2 ++ lib/src/phy/utils/test/vector_test.c | 18 +++++++++++++++++ lib/src/phy/utils/vector.c | 5 +++++ lib/src/phy/utils/vector_simd.c | 23 ++++++++++++++++++++++ 5 files changed, 49 insertions(+) diff --git a/lib/include/srslte/phy/utils/vector.h b/lib/include/srslte/phy/utils/vector.h index a89aa1049..35dcb7c95 100644 --- a/lib/include/srslte/phy/utils/vector.h +++ b/lib/include/srslte/phy/utils/vector.h @@ -139,6 +139,7 @@ SRSLTE_API void srslte_vec_sub_bbb(const int8_t* x, const int8_t* y, int8_t* z, /* scalar product */ SRSLTE_API void srslte_vec_sc_prod_cfc(const cf_t* x, const float h, cf_t* z, const uint32_t len); +SRSLTE_API void srslte_vec_sc_prod_fcc(const float* x, const cf_t h, cf_t* z, const uint32_t len); SRSLTE_API void srslte_vec_sc_prod_ccc(const cf_t* x, const cf_t h, cf_t* z, const uint32_t len); SRSLTE_API void srslte_vec_sc_prod_fff(const float* x, const float h, float* z, const uint32_t len); diff --git a/lib/include/srslte/phy/utils/vector_simd.h b/lib/include/srslte/phy/utils/vector_simd.h index 3ae3eb001..0db7b9c11 100644 --- a/lib/include/srslte/phy/utils/vector_simd.h +++ b/lib/include/srslte/phy/utils/vector_simd.h @@ -42,6 +42,8 @@ SRSLTE_API void srslte_vec_sub_fff_simd(const float* x, const float* y, float* z /* SIMD Vector Scalar Product */ SRSLTE_API void srslte_vec_sc_prod_cfc_simd(const cf_t* x, const float h, cf_t* y, const int len); +SRSLTE_API void srslte_vec_sc_prod_fcc_simd(const float* x, const cf_t h, cf_t* y, const int len); + SRSLTE_API void srslte_vec_sc_prod_fff_simd(const float* x, const float h, float* z, const int len); SRSLTE_API void srslte_vec_sc_prod_ccc_simd(const cf_t* x, const cf_t h, cf_t* z, const int len); diff --git a/lib/src/phy/utils/test/vector_test.c b/lib/src/phy/utils/test/vector_test.c index 460e7a619..77b58f3d2 100644 --- a/lib/src/phy/utils/test/vector_test.c +++ b/lib/src/phy/utils/test/vector_test.c @@ -546,6 +546,20 @@ TEST(srslte_vec_sc_prod_cfc, MALLOC(cf_t, x); MALLOC(cf_t, z); cf_t gold; float free(x); free(z);) +TEST(srslte_vec_sc_prod_fcc, MALLOC(float, x); MALLOC(cf_t, z); cf_t gold; float h = RANDOM_CF(); + + for (int i = 0; i < block_size; i++) { x[i] = RANDOM_CF(); } + + TEST_CALL(srslte_vec_sc_prod_fcc(x, h, z, block_size)) + + for (int i = 0; i < block_size; i++) { + gold = x[i] * h; + mse += cabsf(gold - z[i]); + } + + free(x); + free(z);) + TEST( srslte_vec_div_ccc, MALLOC(cf_t, x); MALLOC(cf_t, y); MALLOC(cf_t, z); @@ -881,6 +895,10 @@ int main(int argc, char** argv) test_srslte_vec_sc_prod_cfc(func_names[func_count], &timmings[func_count][size_count], block_size); func_count++; + passed[func_count][size_count] = + test_srslte_vec_sc_prod_fcc(func_names[func_count], &timmings[func_count][size_count], block_size); + func_count++; + passed[func_count][size_count] = test_srslte_vec_div_ccc(func_names[func_count], &timmings[func_count][size_count], block_size); func_count++; diff --git a/lib/src/phy/utils/vector.c b/lib/src/phy/utils/vector.c index 2064ce65c..e8b8841e5 100644 --- a/lib/src/phy/utils/vector.c +++ b/lib/src/phy/utils/vector.c @@ -87,6 +87,11 @@ void srslte_vec_sc_prod_cfc(const cf_t* x, const float h, cf_t* z, const uint32_ srslte_vec_sc_prod_cfc_simd(x, h, z, len); } +void srslte_vec_sc_prod_fcc(const float* x, const cf_t h, cf_t* z, const uint32_t len) +{ + srslte_vec_sc_prod_fcc_simd(x, h, z, len); +} + // Chest UL void srslte_vec_sc_prod_ccc(const cf_t* x, const cf_t h, cf_t* z, const uint32_t len) { diff --git a/lib/src/phy/utils/vector_simd.c b/lib/src/phy/utils/vector_simd.c index 454902f5a..690e0299a 100644 --- a/lib/src/phy/utils/vector_simd.c +++ b/lib/src/phy/utils/vector_simd.c @@ -1331,6 +1331,29 @@ void srslte_vec_sc_prod_cfc_simd(const cf_t* x, const float h, cf_t* z, const in } } +void srslte_vec_sc_prod_fcc_simd(const float* x, const cf_t h, cf_t* z, const int len) +{ + int i = 0; + +#if SRSLTE_SIMD_F_SIZE + const simd_cf_t tap = srslte_simd_cf_set1(h); + + if (SRSLTE_IS_ALIGNED(x) && SRSLTE_IS_ALIGNED(z)) { + for (; i < len - SRSLTE_SIMD_F_SIZE + 1; i += SRSLTE_SIMD_F_SIZE) { + srslte_simd_cfi_store(&z[i], srslte_simd_cf_mul(tap, srslte_simd_f_load(&x[i]))); + } + } else { + for (; i < len - SRSLTE_SIMD_F_SIZE + 1; i += SRSLTE_SIMD_F_SIZE) { + srslte_simd_cfi_storeu(&z[i], srslte_simd_cf_mul(tap, srslte_simd_f_loadu(&x[i]))); + } + } +#endif + + for (; i < len; i++) { + z[i] = x[i] * h; + } +} + uint32_t srslte_vec_max_fi_simd(const float* x, const int len) { int i = 0; From aa8b69e9a76a0c93e5982c119b5fb1884e516e0e Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 11 Jan 2021 17:46:13 +0100 Subject: [PATCH 112/138] Fix prime number --- lib/src/phy/utils/primes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/utils/primes.c b/lib/src/phy/utils/primes.c index 03eb64cd6..e5d96476c 100644 --- a/lib/src/phy/utils/primes.c +++ b/lib/src/phy/utils/primes.c @@ -31,7 +31,7 @@ int srslte_prime_greater_than(uint32_t n) { for (uint32_t i = 0; i < NOF_PRIME_NUMBERS; i++) { if (prime_numbers[i] > n) { - return n; + return prime_numbers[i]; } } @@ -47,7 +47,7 @@ int srslte_prime_lower_than(uint32_t n) for (uint32_t i = NOF_PRIME_NUMBERS - 1; i > 0; i--) { if (prime_numbers[i] < n) { - return n; + return prime_numbers[i]; } } From 732a220d4270b9ea53af353bead9de40ff6e3c3f Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 11 Jan 2021 17:49:19 +0100 Subject: [PATCH 113/138] Unified low-PAPR Ruv sequence generation --- .../srslte/phy/ch_estimation/chest_sl.h | 6 - .../srslte/phy/ch_estimation/refsignal_ul.h | 12 - .../srslte/phy/ch_estimation/ul_rs_tables.h | 69 ---- lib/include/srslte/phy/common/zc_sequence.h | 50 +++ lib/include/srslte/phy/phch/pucch.h | 1 - lib/src/phy/ch_estimation/chest_sl.c | 153 ++------- lib/src/phy/ch_estimation/chest_ul.c | 7 - lib/src/phy/ch_estimation/refsignal_ul.c | 129 +------- .../phy/ch_estimation/test/chest_test_srs.c | 6 - .../ch_estimation/test/refsignal_ul_test.c | 15 +- lib/src/phy/common/CMakeLists.txt | 2 +- lib/src/phy/common/zc_sequence.c | 308 ++++++++++++++++++ lib/src/phy/phch/pucch.c | 33 +- lib/src/phy/phch/test/pucch_test.c | 5 - lib/src/phy/ue/ue_ul.c | 5 - 15 files changed, 415 insertions(+), 386 deletions(-) delete mode 100644 lib/include/srslte/phy/ch_estimation/ul_rs_tables.h create mode 100644 lib/include/srslte/phy/common/zc_sequence.h create mode 100644 lib/src/phy/common/zc_sequence.c diff --git a/lib/include/srslte/phy/ch_estimation/chest_sl.h b/lib/include/srslte/phy/ch_estimation/chest_sl.h index dcf4d37f7..6411328e1 100644 --- a/lib/include/srslte/phy/ch_estimation/chest_sl.h +++ b/lib/include/srslte/phy/ch_estimation/chest_sl.h @@ -59,12 +59,6 @@ typedef struct SRSLTE_API { // Group Hopping Flag uint32_t* f_gh_pattern; - int32_t q[SRSLTE_SL_MAX_DMRS_SYMB]; - - float* r[SRSLTE_SL_MAX_DMRS_SYMB]; - - cf_t* r_uv[SRSLTE_SL_MAX_DMRS_SYMB]; - cf_t* r_sequence[SRSLTE_SL_MAX_DMRS_SYMB][SRSLTE_SL_MAX_PSCCH_NOF_DMRS_CYCLIC_SHIFTS]; cf_t* r_sequence_rx[SRSLTE_SL_MAX_DMRS_SYMB]; diff --git a/lib/include/srslte/phy/ch_estimation/refsignal_ul.h b/lib/include/srslte/phy/ch_estimation/refsignal_ul.h index 5f0fd6907..f5d7dc4d6 100644 --- a/lib/include/srslte/phy/ch_estimation/refsignal_ul.h +++ b/lib/include/srslte/phy/ch_estimation/refsignal_ul.h @@ -26,8 +26,6 @@ #include "srslte/phy/phch/pucch_cfg.h" #include "srslte/phy/phch/pusch_cfg.h" -#include "srslte/phy/ch_estimation/ul_rs_tables.h" - #define SRSLTE_NOF_GROUPS_U 30 #define SRSLTE_NOF_SEQUENCES_U 2 #define SRSLTE_NOF_DELTA_SS 30 @@ -66,8 +64,6 @@ typedef struct SRSLTE_API { typedef struct SRSLTE_API { srslte_cell_t cell; - float* tmp_arg; - uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB]; uint32_t n_prs_pusch[SRSLTE_NOF_DELTA_SS][SRSLTE_NSLOTS_X_FRAME]; // We precompute n_prs needed for cyclic shift alpha // at srslte_refsignal_dl_init() @@ -85,14 +81,8 @@ typedef struct { cf_t* r[SRSLTE_NOF_SF_X_FRAME]; } srslte_refsignal_srs_pregen_t; -SRSLTE_API int srslte_refsignal_ul_init(srslte_refsignal_ul_t* q, uint32_t max_prb); - SRSLTE_API int srslte_refsignal_ul_set_cell(srslte_refsignal_ul_t* q, srslte_cell_t cell); -SRSLTE_API void srslte_refsignal_ul_free(srslte_refsignal_ul_t* q); - -SRSLTE_API void srslte_refsignal_r_uv_arg_1prb(float* arg, uint32_t u); - SRSLTE_API uint32_t srslte_refsignal_dmrs_N_rs(srslte_pucch_format_t format, srslte_cp_t cp); SRSLTE_API uint32_t srslte_refsignal_dmrs_pucch_symbol(uint32_t m, srslte_pucch_format_t format, srslte_cp_t cp); @@ -191,6 +181,4 @@ SRSLTE_API uint32_t srslte_refsignal_srs_rb_L_cs(uint32_t bw_cfg, uint32_t nof_p SRSLTE_API uint32_t srslte_refsignal_srs_M_sc(srslte_refsignal_ul_t* q, srslte_refsignal_srs_cfg_t* cfg); -SRSLTE_API uint32_t srslte_refsignal_get_q(uint32_t u, uint32_t v, uint32_t N_sz); - #endif // SRSLTE_REFSIGNAL_UL_H diff --git a/lib/include/srslte/phy/ch_estimation/ul_rs_tables.h b/lib/include/srslte/phy/ch_estimation/ul_rs_tables.h deleted file mode 100644 index 41c44a491..000000000 --- a/lib/include/srslte/phy/ch_estimation/ul_rs_tables.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * - * \section COPYRIGHT - * - * Copyright 2013-2020 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 SRSLTE_UL_RS_TABLES_H -#define SRSLTE_UL_RS_TABLES_H - -#include - -// Phi values for M_sc=12 Table 5.5.1.2-1 in 36.211 -static const int phi_M_sc_12[30][12] = { - {-1, 1, 3, -3, 3, 3, 1, 1, 3, 1, -3, 3}, {1, 1, 3, 3, 3, -1, 1, -3, -3, 1, -3, 3}, - {1, 1, -3, -3, -3, -1, -3, -3, 1, -3, 1, -1}, {-1, 1, 1, 1, 1, -1, -3, -3, 1, -3, 3, -1}, - {-1, 3, 1, -1, 1, -1, -3, -1, 1, -1, 1, 3}, {1, -3, 3, -1, -1, 1, 1, -1, -1, 3, -3, 1}, - {-1, 3, -3, -3, -3, 3, 1, -1, 3, 3, -3, 1}, {-3, -1, -1, -1, 1, -3, 3, -1, 1, -3, 3, 1}, - {1, -3, 3, 1, -1, -1, -1, 1, 1, 3, -1, 1}, {1, -3, -1, 3, 3, -1, -3, 1, 1, 1, 1, 1}, - {-1, 3, -1, 1, 1, -3, -3, -1, -3, -3, 3, -1}, {3, 1, -1, -1, 3, 3, -3, 1, 3, 1, 3, 3}, - {1, -3, 1, 1, -3, 1, 1, 1, -3, -3, -3, 1}, {3, 3, -3, 3, -3, 1, 1, 3, -1, -3, 3, 3}, - {-3, 1, -1, -3, -1, 3, 1, 3, 3, 3, -1, 1}, {3, -1, 1, -3, -1, -1, 1, 1, 3, 1, -1, -3}, - {1, 3, 1, -1, 1, 3, 3, 3, -1, -1, 3, -1}, {-3, 1, 1, 3, -3, 3, -3, -3, 3, 1, 3, -1}, - {-3, 3, 1, 1, -3, 1, -3, -3, -1, -1, 1, -3}, {-1, 3, 1, 3, 1, -1, -1, 3, -3, -1, -3, -1}, - {-1, -3, 1, 1, 1, 1, 3, 1, -1, 1, -3, -1}, {-1, 3, -1, 1, -3, -3, -3, -3, -3, 1, -1, -3}, - {1, 1, -3, -3, -3, -3, -1, 3, -3, 1, -3, 3}, {1, 1, -1, -3, -1, -3, 1, -1, 1, 3, -1, 1}, - {1, 1, 3, 1, 3, 3, -1, 1, -1, -3, -3, 1}, {1, -3, 3, 3, 1, 3, 3, 1, -3, -1, -1, 3}, - {1, 3, -3, -3, 3, -3, 1, -1, -1, 3, -1, -3}, {-3, -1, -3, -1, -3, 3, 1, -1, 1, 3, -3, -3}, - {-1, 3, -3, 3, -1, 3, 3, -3, 3, 3, -1, -1}, {3, -3, -3, -1, -1, -3, -1, 3, -3, 3, 1, -1}}; - -// Phi values for M_sc=24 Table 5.5.1.2-2 in 36.211 -static const int phi_M_sc_24[30][24] = { - {-1, 3, 1, -3, 3, -1, 1, 3, -3, 3, 1, 3, -3, 3, 1, 1, -1, 1, 3, -3, 3, -3, -1, -3}, - {-3, 3, -3, -3, -3, 1, -3, -3, 3, -1, 1, 1, 1, 3, 1, -1, 3, -3, -3, 1, 3, 1, 1, -3}, - {3, -1, 3, 3, 1, 1, -3, 3, 3, 3, 3, 1, -1, 3, -1, 1, 1, -1, -3, -1, -1, 1, 3, 3}, - {-1, -3, 1, 1, 3, -3, 1, 1, -3, -1, -1, 1, 3, 1, 3, 1, -1, 3, 1, 1, -3, -1, -3, -1}, - {-1, -1, -1, -3, -3, -1, 1, 1, 3, 3, -1, 3, -1, 1, -1, -3, 1, -1, -3, -3, 1, -3, -1, -1}, - {-3, 1, 1, 3, -1, 1, 3, 1, -3, 1, -3, 1, 1, -1, -1, 3, -1, -3, 3, -3, -3, -3, 1, 1}, - {1, 1, -1, -1, 3, -3, -3, 3, -3, 1, -1, -1, 1, -1, 1, 1, -1, -3, -1, 1, -1, 3, -1, -3}, - {-3, 3, 3, -1, -1, -3, -1, 3, 1, 3, 1, 3, 1, 1, -1, 3, 1, -1, 1, 3, -3, -1, -1, 1}, - {-3, 1, 3, -3, 1, -1, -3, 3, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, 1, -3, -3, -3, 1, -3}, - {1, 1, -3, 3, 3, -1, -3, -1, 3, -3, 3, 3, 3, -1, 1, 1, -3, 1, -1, 1, 1, -3, 1, 1}, - {-1, 1, -3, -3, 3, -1, 3, -1, -1, -3, -3, -3, -1, -3, -3, 1, -1, 1, 3, 3, -1, 1, -1, 3}, - {1, 3, 3, -3, -3, 1, 3, 1, -1, -3, -3, -3, 3, 3, -3, 3, 3, -1, -3, 3, -1, 1, -3, 1}, - {1, 3, 3, 1, 1, 1, -1, -1, 1, -3, 3, -1, 1, 1, -3, 3, 3, -1, -3, 3, -3, -1, -3, -1}, - {3, -1, -1, -1, -1, -3, -1, 3, 3, 1, -1, 1, 3, 3, 3, -1, 1, 1, -3, 1, 3, -1, -3, 3}, - {-3, -3, 3, 1, 3, 1, -3, 3, 1, 3, 1, 1, 3, 3, -1, -1, -3, 1, -3, -1, 3, 1, 1, 3}, - {-1, -1, 1, -3, 1, 3, -3, 1, -1, -3, -1, 3, 1, 3, 1, -1, -3, -3, -1, -1, -3, -3, -3, -1}, - {-1, -3, 3, -1, -1, -1, -1, 1, 1, -3, 3, 1, 3, 3, 1, -1, 1, -3, 1, -3, 1, 1, -3, -1}, - {1, 3, -1, 3, 3, -1, -3, 1, -1, -3, 3, 3, 3, -1, 1, 1, 3, -1, -3, -1, 3, -1, -1, -1}, - {1, 1, 1, 1, 1, -1, 3, -1, -3, 1, 1, 3, -3, 1, -3, -1, 1, 1, -3, -3, 3, 1, 1, -3}, - {1, 3, 3, 1, -1, -3, 3, -1, 3, 3, 3, -3, 1, -1, 1, -1, -3, -1, 1, 3, -1, 3, -3, -3}, - {-1, -3, 3, -3, -3, -3, -1, -1, -3, -1, -3, 3, 1, 3, -3, -1, 3, -1, 1, -1, 3, -3, 1, -1}, - {-3, -3, 1, 1, -1, 1, -1, 1, -1, 3, 1, -3, -1, 1, -1, 1, -1, -1, 3, 3, -3, -1, 1, -3}, - {-3, -1, -3, 3, 1, -1, -3, -1, -3, -3, 3, -3, 3, -3, -1, 1, 3, 1, -3, 1, 3, 3, -1, -3}, - {-1, -1, -1, -1, 3, 3, 3, 1, 3, 3, -3, 1, 3, -1, 3, -1, 3, 3, -3, 3, 1, -1, 3, 3}, - {1, -1, 3, 3, -1, -3, 3, -3, -1, -1, 3, -1, 3, -1, -1, 1, 1, 1, 1, -1, -1, -3, -1, 3}, - {1, -1, 1, -1, 3, -1, 3, 1, 1, -1, -1, -3, 1, 1, -3, 1, 3, -3, 1, 1, -3, -3, -1, -1}, - {-3, -1, 1, 3, 1, 1, -3, -1, -1, -3, 3, -3, 3, 1, -3, 3, -3, 1, -1, 1, -3, 1, 1, 1}, - {-1, -3, 3, 3, 1, 1, 3, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -3, -1, -3, -1, -3, -1}, - {-1, -3, -1, -1, 1, -3, -1, -1, 1, -1, -3, 1, 1, -3, 1, -3, -3, 3, 1, 1, -1, 3, -1, -1}, - {1, 1, -1, -1, -3, -1, 3, -1, 3, -1, 1, 3, 1, -1, 3, 1, 3, -3, -3, 1, -1, -1, 1, 3}}; - -#endif \ No newline at end of file diff --git a/lib/include/srslte/phy/common/zc_sequence.h b/lib/include/srslte/phy/common/zc_sequence.h new file mode 100644 index 000000000..ac77b9371 --- /dev/null +++ b/lib/include/srslte/phy/common/zc_sequence.h @@ -0,0 +1,50 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_ZC_SEQUENCE_H +#define SRSLTE_ZC_SEQUENCE_H + +#include "srslte/config.h" +#include +#include + +/** + * @brief Generates ZC sequences given the required parameters used in the TS 36 series (LTE) + * + * @remark Implemented as defined in TS 36.211 section 5.5.1 Generation of the reference signal sequence + * + * @param[in] u Group number {0,1,...29} + * @param[in] v Base sequence + * @param[in] alpha Phase shift + * @param[in] nof_prb Number of PRB + * @param[out] sequence Output sequence + * @return SRSLTE_SUCCESS if the generation is successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_zc_sequence_generate_lte(uint32_t u, uint32_t v, float alpha, uint32_t nof_prb, cf_t* sequence); + +/** + * @brief Generates ZC sequences given the required parameters used in the TS 38 series (NR) + * + * @remark Implemented as defined in TS 38.211 section 5.2.2 Low-PAPR sequence generation + + * @param u Group number {0,1,...29} + * @param v base sequence + * @param alpha Phase shift + * @param m Number of PRB + * @param delta Delta parameter described in specification + * @param sequence Output sequence + * @return SRSLTE_SUCCESS if the generation is successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int +srslte_zc_sequence_generate_nr(uint32_t u, uint32_t v, float alpha, uint32_t m, uint32_t delta, cf_t* sequence); + +#endif // SRSLTE_ZC_SEQUENCE_H diff --git a/lib/include/srslte/phy/phch/pucch.h b/lib/include/srslte/phy/phch/pucch.h index 558427e9b..070ddc7d7 100644 --- a/lib/include/srslte/phy/phch/pucch.h +++ b/lib/include/srslte/phy/phch/pucch.h @@ -72,7 +72,6 @@ typedef struct SRSLTE_API { cf_t d[SRSLTE_PUCCH_MAX_BITS / 2]; uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB]; uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME]; - float tmp_arg[SRSLTE_PUCCH_N_SEQ]; cf_t* z; cf_t* z_tmp; diff --git a/lib/src/phy/ch_estimation/chest_sl.c b/lib/src/phy/ch_estimation/chest_sl.c index 20a49a7cc..8e0adaa28 100644 --- a/lib/src/phy/ch_estimation/chest_sl.c +++ b/lib/src/phy/ch_estimation/chest_sl.c @@ -17,10 +17,9 @@ #include #include "srslte/phy/ch_estimation/chest_sl.h" -#include "srslte/phy/ch_estimation/refsignal_ul.h" +#include "srslte/phy/common/zc_sequence.h" #include "srslte/phy/mimo/precoding.h" #include "srslte/phy/utils/debug.h" -#include "srslte/phy/utils/primes.h" #include "srslte/phy/utils/vector.h" static int chest_sl_init(srslte_chest_sl_t* q, uint32_t nof_cyclic_shift_seq) @@ -30,18 +29,6 @@ static int chest_sl_init(srslte_chest_sl_t* q, uint32_t nof_cyclic_shift_seq) srslte_interp_linear_vector_init(&q->lin_vec_sl, SRSLTE_MAX_PRB * SRSLTE_NRE); for (int i = 0; i < SRSLTE_SL_MAX_DMRS_SYMB; i++) { - q->r[i] = srslte_vec_f_malloc(SRSLTE_MAX_PRB * SRSLTE_NRE); - if (!q->r[i]) { - ERROR("Error allocating memory"); - return SRSLTE_ERROR; - } - - q->r_uv[i] = srslte_vec_cf_malloc(SRSLTE_MAX_PRB * SRSLTE_NRE); - if (!q->r_uv[i]) { - ERROR("Error allocating memory"); - return SRSLTE_ERROR; - } - for (int j = 0; j < nof_cyclic_shift_seq; j++) { q->r_sequence[i][j] = srslte_vec_cf_malloc(SRSLTE_MAX_PRB * SRSLTE_NRE); if (!q->r_sequence[i][j]) { @@ -121,28 +108,6 @@ static int chest_sl_psbch_gen(srslte_chest_sl_t* q) u[ns] = (f_gh + f_ss) % SRSLTE_SL_N_RU_SEQ; } - int32_t N_zc = srslte_prime_lower_than(q->M_sc_rs); // N_zc - Zadoff Chu Sequence Length - if (N_zc < SRSLTE_SUCCESS) { - ERROR("Could not find prime number\n"); - return SRSLTE_ERROR; - } - - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - q->q[j] = srslte_refsignal_get_q(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, N_zc); - float n_sz = (float)N_zc; - for (uint32_t i = 0; i < q->M_sc_rs; i++) { - float m = (float)(i % N_zc); - q->r[j][i] = -M_PI * q->q[j] * m * (m + 1) / n_sz; - } - } - - // Do complex exponential and adjust amplitude, 36.211 Section 5.5.1 - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - for (int i = 0; i < q->M_sc_rs; i++) { - q->r_uv[j][i] = cexpf(I * (q->r[j][i] + q->alpha[0] * i)); - } - } - // w - Orthogonal Sequence, 36.211 Section 9.8 if (q->cell.tm <= SRSLTE_SIDELINK_TM2) { if (q->cell.N_sl_id % 2) { @@ -166,9 +131,13 @@ static int chest_sl_psbch_gen(srslte_chest_sl_t* q) } for (int j = 0; j < q->nof_dmrs_symbols; j++) { - for (int i = 0; i < q->M_sc_rs; i++) { - q->r_sequence[j][0][i] = q->w[j] * q->r_uv[j][i]; - } + cf_t* seq = q->r_sequence[j][0]; + + // Generate R_uv sequences + srslte_zc_sequence_generate_lte(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, q->alpha[0], q->M_sc_rs / SRSLTE_NRE, seq); + + // Apply w + srslte_vec_sc_prod_ccc(seq, q->w[j], seq, q->M_sc_rs); } return SRSLTE_SUCCESS; @@ -341,46 +310,6 @@ static int chest_sl_pscch_gen(srslte_chest_sl_t* q, uint32_t cyclic_shift) u[ns] = (f_gh + f_ss) % SRSLTE_SL_N_RU_SEQ; } - int32_t N_zc = 0; // N_zc - Zadoff Chu Sequence Length - switch (q->M_sc_rs / SRSLTE_NRE) { - case 1: - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - for (int i = 0; i < SRSLTE_NRE; i++) { - q->r[j][i] = phi_M_sc_12[u[j]][i] * M_PI / 4; - } - } - break; - case 2: - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - for (int i = 0; i < q->M_sc_rs; i++) { - q->r[j][i] = phi_M_sc_24[u[j]][i] * M_PI / 4; - } - } - break; - default: - N_zc = srslte_prime_lower_than(q->M_sc_rs); // N_zc - Zadoff Chu Sequence Length - if (N_zc < SRSLTE_SUCCESS) { - ERROR("Could not find prime number\n"); - return SRSLTE_ERROR; - } - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - q->q[j] = srslte_refsignal_get_q(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, N_zc); - float n_sz = (float)N_zc; - for (uint32_t i = 0; i < q->M_sc_rs; i++) { - float m = (float)(i % N_zc); - q->r[j][i] = -M_PI * q->q[j] * m * (m + 1) / n_sz; - } - } - break; - } - - // Do complex exponential and adjust amplitude, 36.211 Section 5.5.1 - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - for (int i = 0; i < q->M_sc_rs; i++) { - q->r_uv[j][i] = cexpf(I * (q->r[j][i] + q->alpha[0] * i)); - } - } - // w - Orthogonal Sequence, 36.211 Section 9.8 if (q->cell.tm <= SRSLTE_SIDELINK_TM2) { q->w[0] = 1; @@ -393,9 +322,13 @@ static int chest_sl_pscch_gen(srslte_chest_sl_t* q, uint32_t cyclic_shift) } for (int j = 0; j < q->nof_dmrs_symbols; j++) { - for (int i = 0; i < q->M_sc_rs; i++) { - q->r_sequence[j][cyclic_shift / 3][i] = q->w[j] * q->r_uv[j][i]; - } + cf_t* seq = q->r_sequence[j][cyclic_shift / 3]; + + // Generate R_uv sequences + srslte_zc_sequence_generate_lte(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, q->alpha[0], q->M_sc_rs / SRSLTE_NRE, seq); + + // Apply w + srslte_vec_sc_prod_ccc(seq, q->w[j], seq, q->M_sc_rs); } return SRSLTE_SUCCESS; @@ -567,46 +500,6 @@ static int chest_sl_pssch_gen(srslte_chest_sl_t* q) } } - int32_t N_zc = 0; // N_zc - Zadoff Chu Sequence Length - switch (q->M_sc_rs / SRSLTE_NRE) { - case 1: - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - for (int i = 0; i < SRSLTE_NRE; i++) { - q->r[j][i] = phi_M_sc_12[u[j]][i] * M_PI / 4; - } - } - break; - case 2: - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - for (int i = 0; i < q->M_sc_rs; i++) { - q->r[j][i] = phi_M_sc_24[u[j]][i] * M_PI / 4; - } - } - break; - default: - N_zc = srslte_prime_lower_than(q->M_sc_rs); // N_zc - Zadoff Chu Sequence Length - if (N_zc < SRSLTE_SUCCESS) { - ERROR("Could not find prime number\n"); - return SRSLTE_ERROR; - } - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - q->q[j] = srslte_refsignal_get_q(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, N_zc); - float n_sz = (float)N_zc; - for (uint32_t i = 0; i < q->M_sc_rs; i++) { - float m = (float)(i % N_zc); - q->r[j][i] = -M_PI * q->q[j] * m * (m + 1) / n_sz; - } - } - break; - } - - // Do complex exponential and adjust amplitude, 36.211 Section 5.5.1 - for (int j = 0; j < q->nof_dmrs_symbols; ++j) { - for (int i = 0; i < q->M_sc_rs; i++) { - q->r_uv[j][i] = cexpf(I * (q->r[j][i] + q->alpha[0] * i)); - } - } - // w - Orthogonal Sequence, 36.211 Section 9.8 if (q->cell.tm <= SRSLTE_SIDELINK_TM2) { if (q->chest_sl_cfg.N_x_id % 2 == 0) { @@ -632,9 +525,13 @@ static int chest_sl_pssch_gen(srslte_chest_sl_t* q) } for (int j = 0; j < q->nof_dmrs_symbols; j++) { - for (int i = 0; i < q->M_sc_rs; i++) { - q->r_sequence[j][0][i] = q->w[j] * q->r_uv[j][i]; - } + cf_t* seq = q->r_sequence[j][0]; + + // Generate R_uv sequences + srslte_zc_sequence_generate_lte(u[j], SRSLTE_SL_BASE_SEQUENCE_NUMBER, q->alpha[0], q->M_sc_rs / SRSLTE_NRE, seq); + + // Apply w + srslte_vec_sc_prod_ccc(seq, q->w[j], seq, q->M_sc_rs); } return SRSLTE_SUCCESS; @@ -1247,12 +1144,6 @@ void srslte_chest_sl_free(srslte_chest_sl_t* q) srslte_interp_linear_vector_free(&q->lin_vec_sl); for (int i = 0; i < SRSLTE_SL_MAX_DMRS_SYMB; i++) { - if (q->r[i]) { - free(q->r[i]); - } - if (q->r_uv[i]) { - free(q->r_uv[i]); - } for (int j = 0; j < SRSLTE_SL_MAX_PSCCH_NOF_DMRS_CYCLIC_SHIFTS; j++) { if (q->r_sequence[i][j]) { free(q->r_sequence[i][j]); diff --git a/lib/src/phy/ch_estimation/chest_ul.c b/lib/src/phy/ch_estimation/chest_ul.c index 539b6cca8..b23796140 100644 --- a/lib/src/phy/ch_estimation/chest_ul.c +++ b/lib/src/phy/ch_estimation/chest_ul.c @@ -46,12 +46,6 @@ int srslte_chest_ul_init(srslte_chest_ul_t* q, uint32_t max_prb) if (q != NULL) { bzero(q, sizeof(srslte_chest_ul_t)); - ret = srslte_refsignal_ul_init(&q->dmrs_signal, max_prb); - if (ret != SRSLTE_SUCCESS) { - ERROR("Error initializing CSR signal (%d)\n", ret); - goto clean_exit; - } - q->tmp_noise = srslte_vec_cf_malloc(MAX_REFS_SF); if (!q->tmp_noise) { perror("malloc"); @@ -110,7 +104,6 @@ void srslte_chest_ul_free(srslte_chest_ul_t* q) { srslte_refsignal_dmrs_pusch_pregen_free(&q->dmrs_signal, &q->dmrs_pregen); - srslte_refsignal_ul_free(&q->dmrs_signal); if (q->tmp_noise) { free(q->tmp_noise); } diff --git a/lib/src/phy/ch_estimation/refsignal_ul.c b/lib/src/phy/ch_estimation/refsignal_ul.c index e2f532ba5..d41e81c01 100644 --- a/lib/src/phy/ch_estimation/refsignal_ul.c +++ b/lib/src/phy/ch_estimation/refsignal_ul.c @@ -19,6 +19,7 @@ #include "srslte/phy/ch_estimation/refsignal_ul.h" #include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/sequence.h" +#include "srslte/phy/common/zc_sequence.h" #include "srslte/phy/dft/dft_precoding.h" #include "srslte/phy/phch/pucch.h" #include "srslte/phy/utils/debug.h" @@ -106,13 +107,6 @@ static int generate_n_prs(srslte_refsignal_ul_t* q) return SRSLTE_SUCCESS; } -void srslte_refsignal_r_uv_arg_1prb(float* arg, uint32_t u) -{ - for (int i = 0; i < SRSLTE_NRE; i++) { - arg[i] = phi_M_sc_12[u][i] * M_PI / 4; - } -} - static int generate_srslte_sequence_hopping_v(srslte_refsignal_ul_t* q) { srslte_sequence_t seq; @@ -130,44 +124,6 @@ static int generate_srslte_sequence_hopping_v(srslte_refsignal_ul_t* q) return SRSLTE_SUCCESS; } -/** Initializes srslte_refsignal_ul_t object according to 3GPP 36.211 5.5 - * - */ -int srslte_refsignal_ul_init(srslte_refsignal_ul_t* q, uint32_t max_prb) -{ - - int ret = SRSLTE_ERROR_INVALID_INPUTS; - - if (q != NULL) { - - ret = SRSLTE_ERROR; - - bzero(q, sizeof(srslte_refsignal_ul_t)); - - // Allocate temporal buffer for computing signal argument - q->tmp_arg = srslte_vec_f_malloc(SRSLTE_NRE * max_prb); - if (!q->tmp_arg) { - perror("malloc"); - goto free_and_exit; - } - - ret = SRSLTE_SUCCESS; - } -free_and_exit: - if (ret == SRSLTE_ERROR) { - srslte_refsignal_ul_free(q); - } - return ret; -} - -void srslte_refsignal_ul_free(srslte_refsignal_ul_t* q) -{ - if (q->tmp_arg) { - free(q->tmp_arg); - } - bzero(q, sizeof(srslte_refsignal_ul_t)); -} - /** Initializes srslte_refsignal_ul_t object according to 3GPP 36.211 5.5 * */ @@ -205,53 +161,6 @@ int srslte_refsignal_ul_set_cell(srslte_refsignal_ul_t* q, srslte_cell_t cell) return ret; } -static void arg_r_uv_2prb(float* arg, uint32_t u) -{ - for (int i = 0; i < 2 * SRSLTE_NRE; i++) { - arg[i] = phi_M_sc_24[u][i] * M_PI / 4; - } -} - -uint32_t srslte_refsignal_get_q(uint32_t u, uint32_t v, uint32_t N_sz) -{ - float q; - float q_hat; - float n_sz = (float)N_sz; - - q_hat = n_sz * (u + 1) / 31; - if ((((uint32_t)(2 * q_hat)) % 2) == 0) { - q = q_hat + 0.5 + v; - } else { - q = q_hat + 0.5 - v; - } - return (uint32_t)q; -} - -static void arg_r_uv_mprb(float* arg, uint32_t M_sc, uint32_t u, uint32_t v) -{ - int32_t N_sz = srslte_prime_lower_than(M_sc); // N_zc - Zadoff Chu Sequence Length - if (N_sz > 0) { - float q = srslte_refsignal_get_q(u, v, N_sz); - float n_sz = (float)N_sz; - for (uint32_t i = 0; i < M_sc; i++) { - float m = (float)(i % N_sz); - arg[i] = -M_PI * q * m * (m + 1) / n_sz; - } - } -} - -/* Computes argument of r_u_v signal */ -static void compute_r_uv_arg(srslte_refsignal_ul_t* q, uint32_t nof_prb, uint32_t u, uint32_t v) -{ - if (nof_prb == 1) { - srslte_refsignal_r_uv_arg_1prb(q->tmp_arg, u); - } else if (nof_prb == 2) { - arg_r_uv_2prb(q->tmp_arg, u); - } else { - arg_r_uv_mprb(q->tmp_arg, SRSLTE_NRE * nof_prb, u, v); - } -} - /* Calculates alpha according to 5.5.2.1.1 of 36.211 */ static float pusch_alpha(srslte_refsignal_ul_t* q, srslte_refsignal_dmrs_pusch_cfg_t* cfg, @@ -312,7 +221,9 @@ static void compute_r(srslte_refsignal_ul_t* q, srslte_refsignal_dmrs_pusch_cfg_t* cfg, uint32_t nof_prb, uint32_t ns, - uint32_t delta_ss) + uint32_t delta_ss, + float alpha, + cf_t* sequence) { // Get group hopping number u uint32_t f_gh = 0; @@ -328,7 +239,7 @@ static void compute_r(srslte_refsignal_ul_t* q, } // Compute signal argument - compute_r_uv_arg(q, nof_prb, u, v); + srslte_zc_sequence_generate_lte(u, v, alpha, nof_prb, sequence); } int srslte_refsignal_dmrs_pusch_pregen_init(srslte_refsignal_ul_dmrs_pregen_t* pregen, uint32_t max_prb) @@ -429,16 +340,10 @@ int srslte_refsignal_dmrs_pusch_gen(srslte_refsignal_ul_t* q, ret = SRSLTE_ERROR; for (uint32_t ns = 2 * sf_idx; ns < 2 * (sf_idx + 1); ns++) { - - compute_r(q, cfg, nof_prb, ns, cfg->delta_ss); - // Add cyclic prefix alpha float alpha = pusch_alpha(q, cfg, cyclic_shift_for_dmrs, ns); - // Do complex exponential and adjust amplitude - for (int i = 0; i < SRSLTE_NRE * nof_prb; i++) { - r_pusch[(ns % 2) * SRSLTE_NRE * nof_prb + i] = cexpf(I * (q->tmp_arg[i] + alpha * i)); - } + compute_r(q, cfg, nof_prb, ns, cfg->delta_ss, alpha, &r_pusch[(ns % 2) * SRSLTE_NRE * nof_prb]); } ret = 0; } @@ -543,8 +448,6 @@ int srslte_refsignal_dmrs_pucch_gen(srslte_refsignal_ul_t* q, } uint32_t u = (f_gh + (q->cell.id % 30)) % 30; - srslte_refsignal_r_uv_arg_1prb(q->tmp_arg, u); - for (uint32_t m = 0; m < N_rs; m++) { uint32_t n_oc = 0; @@ -585,14 +488,15 @@ int srslte_refsignal_dmrs_pucch_gen(srslte_refsignal_ul_t* q, ERROR("DMRS Generator: Unsupported format %d\n", cfg->format); return SRSLTE_ERROR; } - cf_t z_m = 1.0; + + cf_t* r_sequence = &r_pucch[(ns % 2) * SRSLTE_NRE * N_rs + m * SRSLTE_NRE]; + srslte_zc_sequence_generate_lte(u, 0, alpha, 1, r_sequence); + + cf_t z_m = cexpf(I * w[m]); if (m == 1) { - z_m = z_m_1; - } - for (uint32_t n = 0; n < SRSLTE_NRE; n++) { - r_pucch[(ns % 2) * SRSLTE_NRE * N_rs + m * SRSLTE_NRE + n] = - z_m * cexpf(I * (w[m] + q->tmp_arg[n] + alpha * n)); + z_m *= z_m_1; } + srslte_vec_sc_prod_ccc(r_sequence, z_m, r_sequence, SRSLTE_NRE); } } ret = SRSLTE_SUCCESS; @@ -972,13 +876,8 @@ int srslte_refsignal_srs_gen(srslte_refsignal_ul_t* q, uint32_t M_sc = srslte_refsignal_srs_M_sc(q, cfg); for (uint32_t ns = 2 * sf_idx; ns < 2 * (sf_idx + 1); ns++) { - compute_r(q, pusch_cfg, M_sc / SRSLTE_NRE, ns, 0); float alpha = 2 * M_PI * cfg->n_srs / 8; - - // Do complex exponential and adjust amplitude - for (int i = 0; i < M_sc; i++) { - r_srs[(ns % 2) * M_sc + i] = cexpf(I * (q->tmp_arg[i] + alpha * i)); - } + compute_r(q, pusch_cfg, M_sc / SRSLTE_NRE, ns, 0, alpha, &r_srs[(ns % 2) * M_sc]); } ret = SRSLTE_SUCCESS; } diff --git a/lib/src/phy/ch_estimation/test/chest_test_srs.c b/lib/src/phy/ch_estimation/test/chest_test_srs.c index b1cdfbbbf..4d5808016 100644 --- a/lib/src/phy/ch_estimation/test/chest_test_srs.c +++ b/lib/src/phy/ch_estimation/test/chest_test_srs.c @@ -70,11 +70,6 @@ int srs_test_context_init(srs_test_context_t* q) { q->sf_size = SRSLTE_SF_LEN_RE(SRSLTE_MAX_PRB, cell.cp); - // Initiate UL ref signals - if (srslte_refsignal_ul_init(&q->refsignal_ul, SRSLTE_MAX_PRB) != SRSLTE_SUCCESS) { - return SRSLTE_ERROR; - } - // Set cell if (srslte_refsignal_ul_set_cell(&q->refsignal_ul, cell) != SRSLTE_SUCCESS) { return SRSLTE_ERROR; @@ -111,7 +106,6 @@ int srs_test_context_init(srs_test_context_t* q) void srs_test_context_free(srs_test_context_t* q) { - srslte_refsignal_ul_free(&q->refsignal_ul); srslte_refsignal_srs_pregen_free(&q->refsignal_ul, &q->srs_pregen); srslte_chest_ul_free(&q->chest_ul); srslte_chest_ul_res_free(&q->chest_ul_res); diff --git a/lib/src/phy/ch_estimation/test/refsignal_ul_test.c b/lib/src/phy/ch_estimation/test/refsignal_ul_test.c index 0252ff050..cb1e33714 100644 --- a/lib/src/phy/ch_estimation/test/refsignal_ul_test.c +++ b/lib/src/phy/ch_estimation/test/refsignal_ul_test.c @@ -68,18 +68,13 @@ void parse_args(int argc, char** argv) int main(int argc, char** argv) { - srslte_refsignal_ul_t refs; - srslte_refsignal_dmrs_pusch_cfg_t pusch_cfg; - cf_t* signal = NULL; - int ret = -1; + srslte_refsignal_ul_t refs = {}; + srslte_refsignal_dmrs_pusch_cfg_t pusch_cfg = {}; + cf_t* signal = NULL; + int ret = -1; parse_args(argc, argv); - if (srslte_refsignal_ul_init(&refs, cell.nof_prb)) { - ERROR("Error initializing UL reference signal\n"); - goto do_exit; - } - if (srslte_refsignal_ul_set_cell(&refs, cell)) { ERROR("Error initializing UL reference signal\n"); goto do_exit; @@ -155,8 +150,6 @@ do_exit: free(signal); } - srslte_refsignal_ul_free(&refs); - if (!ret) { printf("OK\n"); } diff --git a/lib/src/phy/common/CMakeLists.txt b/lib/src/phy/common/CMakeLists.txt index 52f8ef1cb..6d69c462e 100644 --- a/lib/src/phy/common/CMakeLists.txt +++ b/lib/src/phy/common/CMakeLists.txt @@ -6,7 +6,7 @@ # the distribution. # -set(SOURCES phy_common.c phy_common_sl.c phy_common_nr.c sequence.c timestamp.c) +set(SOURCES phy_common.c phy_common_sl.c phy_common_nr.c sequence.c timestamp.c zc_sequence.c) add_library(srslte_phy_common OBJECT ${SOURCES}) add_subdirectory(test) \ No newline at end of file diff --git a/lib/src/phy/common/zc_sequence.c b/lib/src/phy/common/zc_sequence.c new file mode 100644 index 000000000..161833d90 --- /dev/null +++ b/lib/src/phy/common/zc_sequence.c @@ -0,0 +1,308 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/common/zc_sequence.h" +#include "srslte/phy/common/phy_common.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/primes.h" +#include "srslte/phy/utils/vector.h" +#include + +// Phi values for M_sc=12 Table 5.5.1.2-1 in TS 36.211 +static const float zc_sequence_lte_phi_M_sc_12[30][12] = { + {-1, 1, 3, -3, 3, 3, 1, 1, 3, 1, -3, 3}, {1, 1, 3, 3, 3, -1, 1, -3, -3, 1, -3, 3}, + {1, 1, -3, -3, -3, -1, -3, -3, 1, -3, 1, -1}, {-1, 1, 1, 1, 1, -1, -3, -3, 1, -3, 3, -1}, + {-1, 3, 1, -1, 1, -1, -3, -1, 1, -1, 1, 3}, {1, -3, 3, -1, -1, 1, 1, -1, -1, 3, -3, 1}, + {-1, 3, -3, -3, -3, 3, 1, -1, 3, 3, -3, 1}, {-3, -1, -1, -1, 1, -3, 3, -1, 1, -3, 3, 1}, + {1, -3, 3, 1, -1, -1, -1, 1, 1, 3, -1, 1}, {1, -3, -1, 3, 3, -1, -3, 1, 1, 1, 1, 1}, + {-1, 3, -1, 1, 1, -3, -3, -1, -3, -3, 3, -1}, {3, 1, -1, -1, 3, 3, -3, 1, 3, 1, 3, 3}, + {1, -3, 1, 1, -3, 1, 1, 1, -3, -3, -3, 1}, {3, 3, -3, 3, -3, 1, 1, 3, -1, -3, 3, 3}, + {-3, 1, -1, -3, -1, 3, 1, 3, 3, 3, -1, 1}, {3, -1, 1, -3, -1, -1, 1, 1, 3, 1, -1, -3}, + {1, 3, 1, -1, 1, 3, 3, 3, -1, -1, 3, -1}, {-3, 1, 1, 3, -3, 3, -3, -3, 3, 1, 3, -1}, + {-3, 3, 1, 1, -3, 1, -3, -3, -1, -1, 1, -3}, {-1, 3, 1, 3, 1, -1, -1, 3, -3, -1, -3, -1}, + {-1, -3, 1, 1, 1, 1, 3, 1, -1, 1, -3, -1}, {-1, 3, -1, 1, -3, -3, -3, -3, -3, 1, -1, -3}, + {1, 1, -3, -3, -3, -3, -1, 3, -3, 1, -3, 3}, {1, 1, -1, -3, -1, -3, 1, -1, 1, 3, -1, 1}, + {1, 1, 3, 1, 3, 3, -1, 1, -1, -3, -3, 1}, {1, -3, 3, 3, 1, 3, 3, 1, -3, -1, -1, 3}, + {1, 3, -3, -3, 3, -3, 1, -1, -1, 3, -1, -3}, {-3, -1, -3, -1, -3, 3, 1, -1, 1, 3, -3, -3}, + {-1, 3, -3, 3, -1, 3, 3, -3, 3, 3, -1, -1}, {3, -3, -3, -1, -1, -3, -1, 3, -3, 3, 1, -1}}; + +// Phi values for M_sc=24 Table 5.5.1.2-2 in TS 36.211 +static const float zc_sequence_lte_phi_M_sc_24[30][24] = { + {-1, 3, 1, -3, 3, -1, 1, 3, -3, 3, 1, 3, -3, 3, 1, 1, -1, 1, 3, -3, 3, -3, -1, -3}, + {-3, 3, -3, -3, -3, 1, -3, -3, 3, -1, 1, 1, 1, 3, 1, -1, 3, -3, -3, 1, 3, 1, 1, -3}, + {3, -1, 3, 3, 1, 1, -3, 3, 3, 3, 3, 1, -1, 3, -1, 1, 1, -1, -3, -1, -1, 1, 3, 3}, + {-1, -3, 1, 1, 3, -3, 1, 1, -3, -1, -1, 1, 3, 1, 3, 1, -1, 3, 1, 1, -3, -1, -3, -1}, + {-1, -1, -1, -3, -3, -1, 1, 1, 3, 3, -1, 3, -1, 1, -1, -3, 1, -1, -3, -3, 1, -3, -1, -1}, + {-3, 1, 1, 3, -1, 1, 3, 1, -3, 1, -3, 1, 1, -1, -1, 3, -1, -3, 3, -3, -3, -3, 1, 1}, + {1, 1, -1, -1, 3, -3, -3, 3, -3, 1, -1, -1, 1, -1, 1, 1, -1, -3, -1, 1, -1, 3, -1, -3}, + {-3, 3, 3, -1, -1, -3, -1, 3, 1, 3, 1, 3, 1, 1, -1, 3, 1, -1, 1, 3, -3, -1, -1, 1}, + {-3, 1, 3, -3, 1, -1, -3, 3, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, 1, -3, -3, -3, 1, -3}, + {1, 1, -3, 3, 3, -1, -3, -1, 3, -3, 3, 3, 3, -1, 1, 1, -3, 1, -1, 1, 1, -3, 1, 1}, + {-1, 1, -3, -3, 3, -1, 3, -1, -1, -3, -3, -3, -1, -3, -3, 1, -1, 1, 3, 3, -1, 1, -1, 3}, + {1, 3, 3, -3, -3, 1, 3, 1, -1, -3, -3, -3, 3, 3, -3, 3, 3, -1, -3, 3, -1, 1, -3, 1}, + {1, 3, 3, 1, 1, 1, -1, -1, 1, -3, 3, -1, 1, 1, -3, 3, 3, -1, -3, 3, -3, -1, -3, -1}, + {3, -1, -1, -1, -1, -3, -1, 3, 3, 1, -1, 1, 3, 3, 3, -1, 1, 1, -3, 1, 3, -1, -3, 3}, + {-3, -3, 3, 1, 3, 1, -3, 3, 1, 3, 1, 1, 3, 3, -1, -1, -3, 1, -3, -1, 3, 1, 1, 3}, + {-1, -1, 1, -3, 1, 3, -3, 1, -1, -3, -1, 3, 1, 3, 1, -1, -3, -3, -1, -1, -3, -3, -3, -1}, + {-1, -3, 3, -1, -1, -1, -1, 1, 1, -3, 3, 1, 3, 3, 1, -1, 1, -3, 1, -3, 1, 1, -3, -1}, + {1, 3, -1, 3, 3, -1, -3, 1, -1, -3, 3, 3, 3, -1, 1, 1, 3, -1, -3, -1, 3, -1, -1, -1}, + {1, 1, 1, 1, 1, -1, 3, -1, -3, 1, 1, 3, -3, 1, -3, -1, 1, 1, -3, -3, 3, 1, 1, -3}, + {1, 3, 3, 1, -1, -3, 3, -1, 3, 3, 3, -3, 1, -1, 1, -1, -3, -1, 1, 3, -1, 3, -3, -3}, + {-1, -3, 3, -3, -3, -3, -1, -1, -3, -1, -3, 3, 1, 3, -3, -1, 3, -1, 1, -1, 3, -3, 1, -1}, + {-3, -3, 1, 1, -1, 1, -1, 1, -1, 3, 1, -3, -1, 1, -1, 1, -1, -1, 3, 3, -3, -1, 1, -3}, + {-3, -1, -3, 3, 1, -1, -3, -1, -3, -3, 3, -3, 3, -3, -1, 1, 3, 1, -3, 1, 3, 3, -1, -3}, + {-1, -1, -1, -1, 3, 3, 3, 1, 3, 3, -3, 1, 3, -1, 3, -1, 3, 3, -3, 3, 1, -1, 3, 3}, + {1, -1, 3, 3, -1, -3, 3, -3, -1, -1, 3, -1, 3, -1, -1, 1, 1, 1, 1, -1, -1, -3, -1, 3}, + {1, -1, 1, -1, 3, -1, 3, 1, 1, -1, -1, -3, 1, 1, -3, 1, 3, -3, 1, 1, -3, -3, -1, -1}, + {-3, -1, 1, 3, 1, 1, -3, -1, -1, -3, 3, -3, 3, 1, -3, 3, -3, 1, -1, 1, -3, 1, 1, 1}, + {-1, -3, 3, 3, 1, 1, 3, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -3, -1, -3, -1, -3, -1}, + {-1, -3, -1, -1, 1, -3, -1, -1, 1, -1, -3, 1, 1, -3, 1, -3, -3, 3, 1, 1, -1, 3, -1, -1}, + {1, 1, -1, -1, -3, -1, 3, -1, 3, -1, 1, 3, 1, -1, 3, 1, 3, -3, -3, 1, -1, -1, 1, 3}}; + +// Phi values for M_sc=12 Table 5.2.2.2-1 in TS 38.211 +static const float zc_sequence_nr_phi_M_sc_6[30][6] = { + {-3, -1, 3, 3, -1, -3}, {-3, 3, -1, -1, 3, -3}, {-3, -3, -3, 3, 1, -3}, {1, 1, 1, 3, -1, -3}, + {1, 1, 1, -3, -1, 3}, {-3, 1, -1, -3, -3, -3}, {-3, 1, 3, -3, -3, -3}, {-3, -1, 1, -3, 1, -1}, + {-3, -1, -3, 1, -3, -3}, {-3, -3, 1, -3, 3, -3}, {-3, 1, 3, 1, -3, -3}, {-3, -1, -3, 1, 1, -3}, + {1, 1, 3, -1, -3, 3}, {1, 1, 3, 3, -1, 3}, {1, 1, 1, -3, 3, -1}, {1, 1, 1, -1, 3, -3}, + {-3, -1, -1, -1, 3, -1}, {-3, -3, -1, 1, -1, -3}, {-3, -3, -3, 1, -3, -1}, {-3, 1, 1, -3, -1, -3}, + {-3, 3, -3, 1, 1, -3}, {-3, 1, -3, -3, -3, -1}, {1, 1, -3, 3, 1, 3}, {1, 1, -3, -3, 1, -3}, + {1, 1, 3, -1, 3, 3}, {1, 1, -3, 1, 3, 3}, {1, 1, -1, -1, 3, -1}, {1, 1, -1, 3, -1, -1}, + {1, 1, -1, 3, -3, -1}, {1, 1, -3, 1, -1, -1}}; + +// Phi values for M_sc=12 Table 5.2.2.2-2 in TS 38.211 +static const float zc_sequence_nr_phi_M_sc_12[30][12] = { + {-3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3}, {-3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3}, + {-3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3}, {-3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3}, + {-3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1}, {-3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3}, + {1, -1, 3, -1, -1, -1, -3, -1, 1, 1, 1, -3}, {-1, -3, 3, -1, -3, -3, -3, -1, 1, -1, 1, -3}, + {-3, -1, 3, 1, -3, -1, -3, 3, 1, 3, 3, 1}, {-3, -1, -1, -3, -3, -1, -3, 3, 1, 3, -1, -3}, + {-3, 3, -3, 3, 3, -3, -1, -1, 3, 3, 1, -3}, {-3, -1, -3, -1, -1, -3, 3, 3, -1, -1, 1, -3}, + {-3, -1, 3, -3, -3, -1, -3, 1, -1, -3, 3, 3}, {-3, 1, -1, -1, 3, 3, -3, -1, -1, -3, -1, -3}, + {1, 3, -3, 1, 3, 3, 3, 1, -1, 1, -1, 3}, {-3, 1, 3, -1, -1, -3, -3, -1, -1, 3, 1, -3}, + {-1, -1, -1, -1, 1, -3, -1, 3, 3, -1, -3, 1}, {-1, 1, 1, -1, 1, 3, 3, -1, -1, -3, 1, -3}, + {-3, 1, 3, 3, -1, -1, -3, 3, 3, -3, 3, -3}, {-3, -3, 3, -3, -1, 3, 3, 3, -1, -3, 1, -3}, + {3, 1, 3, 1, 3, -3, -1, 1, 3, 1, -1, -3}, {-3, 3, 1, 3, -3, 1, 1, 1, 1, 3, -3, 3}, + {-3, 3, 3, 3, -1, -3, -3, -1, -3, 1, 3, -3}, {3, -1, -3, 3, -3, -1, 3, 3, 3, -3, -1, -3}, + {-3, -1, 1, -3, 1, 3, 3, 3, -1, -3, 3, 3}, {-3, 3, 1, -1, 3, 3, -3, 1, -1, 1, -1, 1}, + {-1, 1, 3, -3, 1, -1, 1, -1, -1, -3, 1, -1}, {-3, -3, 3, 3, 3, -3, -1, 1, -3, 3, 1, -3}, + {1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1}, {-3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3}}; + +// Phi values for M_sc=18 Table 5.2.2.2-3 in TS 38.211 +static const float zc_sequence_nr_phi_M_sc_18[30][18] = { + {-1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1}, + {3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3}, + {-3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1}, + {-3, -3, 3, 3, 3, 1, -3, 1, 3, 3, 1, -3, -3, 3, -1, -3, -1, 1}, + {1, 1, -1, -1, -3, -1, 1, -3, -3, -3, 1, -3, -1, -1, 1, -1, 3, 1}, + {3, -3, 1, 1, 3, -1, 1, -1, -1, -3, 1, 1, -1, 3, 3, -3, 3, -1}, + {-3, 3, -1, 1, 3, 1, -3, -1, 1, 1, -3, 1, 3, 3, -1, -3, -3, -3}, + {1, 1, -3, 3, 3, 1, 3, -3, 3, -1, 1, 1, -1, 1, -3, -3, -1, 3}, + {-3, 1, -3, -3, 1, -3, -3, 3, 1, -3, -1, -3, -3, -3, -1, 1, 1, 3}, + {3, -1, 3, 1, -3, -3, -1, 1, -3, -3, 3, 3, 3, 1, 3, -3, 3, -3}, + {-3, -3, -3, 1, -3, 3, 1, 1, 3, -3, -3, 1, 3, -1, 3, -3, -3, 3}, + {-3, -3, 3, 3, 3, -1, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -1}, + {-3, -1, -3, -3, 1, 1, -1, -3, -1, -3, -1, -1, 3, 3, -1, 3, 1, 3}, + {1, 1, -3, -3, -3, -3, 1, 3, -3, 3, 3, 1, -3, -1, 3, -1, -3, 1}, + {-3, 3, -1, -3, -1, -3, 1, 1, -3, -3, -1, -1, 3, -3, 1, 3, 1, 1}, + {3, 1, -3, 1, -3, 3, 3, -1, -3, -3, -1, -3, -3, 3, -3, -1, 1, 3}, + {-3, -1, -3, -1, -3, 1, 3, -3, -1, 3, 3, 3, 1, -1, -3, 3, -1, -3}, + {-3, -1, 3, 3, -1, 3, -1, -3, -1, 1, -1, -3, -1, -1, -1, 3, 3, 1}, + {-3, 1, -3, -1, -1, 3, 1, -3, -3, -3, -1, -3, -3, 1, 1, 1, -1, -1}, + {3, 3, 3, -3, -1, -3, -1, 3, -1, 1, -1, -3, 1, -3, -3, -1, 3, 3}, + {-3, 1, 1, -3, 1, 1, 3, -3, -1, -3, -1, 3, -3, 3, -1, -1, -1, -3}, + {1, -3, -1, -3, 3, 3, -1, -3, 1, -3, -3, -1, -3, -1, 1, 3, 3, 3}, + {-3, -3, 1, -1, -1, 1, 1, -3, -1, 3, 3, 3, 3, -1, 3, 1, 3, 1}, + {3, -1, -3, 1, -3, -3, -3, 3, 3, -1, 1, -3, -1, 3, 1, 1, 3, 3}, + {3, -1, -1, 1, -3, -1, -3, -1, -3, -3, -1, -3, 1, 1, 1, -3, -3, 3}, + {-3, -3, 1, -3, 3, 3, 3, -1, 3, 1, 1, -3, -3, -3, 3, -3, -1, -1}, + {-3, -1, -1, -3, 1, -3, 3, -1, -1, -3, 3, 3, -3, -1, 3, -1, -1, -1}, + {-3, -3, 3, 3, -3, 1, 3, -1, -3, 1, -1, -3, 3, -3, -1, -1, -1, 3}, + {-1, -3, 1, -3, -3, -3, 1, 1, 3, 3, -3, 3, 3, -3, -1, 3, -3, 1}, + {-3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1}}; + +// Phi values for M_sc=18 Table 5.2.2.2-3 in TS 38.211 +static const float zc_sequence_nr_phi_M_sc_24[30][24] = { + {-1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3}, + {-1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3}, + {-1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3}, + {1, -3, 3, -1, -3, -1, 3, 3, 1, -1, 1, 1, 3, -3, -1, -3, -3, -3, -1, 3, -3, -1, -3, -3}, + {-1, 3, -3, -3, -1, 3, -1, -1, 1, 3, 1, 3, -1, -1, -3, 1, 3, 1, -1, -3, 1, -1, -3, -3}, + {-3, -1, 1, -3, -3, 1, 1, -3, 3, -1, -1, -3, 1, 3, 1, -1, -3, -1, -3, 1, -3, -3, -3, -3}, + {-3, 3, 1, 3, -1, 1, -3, 1, -3, 1, -1, -3, -1, -3, -3, -3, -3, -1, -1, -1, 1, 1, -3, -3}, + {-3, 1, 3, -1, 1, -1, 3, -3, 3, -1, -3, -1, -3, 3, -1, -1, -1, -3, -1, -1, -3, 3, 3, -3}, + {-3, 1, -3, 3, -1, -1, -1, -3, 3, 1, -1, -3, -1, 1, 3, -1, 1, -1, 1, -3, -3, -3, -3, -3}, + {1, 1, -1, -3, -1, 1, 1, -3, 1, -1, 1, -3, 3, -3, -3, 3, -1, -3, 1, 3, -3, 1, -3, -3}, + {-3, -3, -3, -1, 3, -3, 3, 1, 3, 1, -3, -1, -1, -3, 1, 1, 3, 1, -1, -3, 3, 1, 3, -3}, + {-3, 3, -1, 3, 1, -1, -1, -1, 3, 3, 1, 1, 1, 3, 3, 1, -3, -3, -1, 1, -3, 1, 3, -3}, + {3, -3, 3, -1, -3, 1, 3, 1, -1, -1, -3, -1, 3, -3, 3, -1, -1, 3, 3, -3, -3, 3, -3, -3}, + {-3, 3, -1, 3, -1, 3, 3, 1, 1, -3, 1, 3, -3, 3, -3, -3, -1, 1, 3, -3, -1, -1, -3, -3}, + {-3, 1, -3, -1, -1, 3, 1, 3, -3, 1, -1, 3, 3, -1, -3, 3, -3, -1, -1, -3, -3, -3, 3, -3}, + {-3, -1, -1, -3, 1, -3, -3, -1, -1, 3, -1, 1, -1, 3, 1, -3, -1, 3, 1, 1, -1, -1, -3, -3}, + {-3, -3, 1, -1, 3, 3, -3, -1, 1, -1, -1, 1, 1, -1, -1, 3, -3, 1, -3, 1, -1, -1, -1, -3}, + {3, -1, 3, -1, 1, -3, 1, 1, -3, -3, 3, -3, -1, -1, -1, -1, -1, -3, -3, -1, 1, 1, -3, -3}, + {-3, 1, -3, 1, -3, -3, 1, -3, 1, -3, -3, -3, -3, -3, 1, -3, -3, 1, 1, -3, 1, 1, -3, -3}, + {-3, -3, 3, 3, 1, -1, -1, -1, 1, -3, -1, 1, -1, 3, -3, -1, -3, -1, -1, 1, -3, 3, -1, -3}, + {-3, -3, -1, -1, -1, -3, 1, -1, -3, -1, 3, -3, 1, -3, 3, -3, 3, 3, 1, -1, -1, 1, -3, -3}, + {3, -1, 1, -1, 3, -3, 1, 1, 3, -1, -3, 3, 1, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, -3}, + {-3, 1, -3, 3, -3, 1, -3, 3, 1, -1, -3, -1, -3, -3, -3, -3, 1, 3, -1, 1, 3, 3, 3, -3}, + {-3, -1, 1, -3, -1, -1, 1, 1, 1, 3, 3, -1, 1, -1, 1, -1, -1, -3, -3, -3, 3, 1, -1, -3}, + {-3, 3, -1, -3, -1, -1, -1, 3, -1, -1, 3, -3, -1, 3, -3, 3, -3, -1, 3, 1, 1, -1, -3, -3}, + {-3, 1, -1, -3, -3, -1, 1, -3, -1, -3, 1, 1, -1, 1, 1, 3, 3, 3, -1, 1, -1, 1, -1, -3}, + {-1, 3, -1, -1, 3, 3, -1, -1, -1, 3, -1, -3, 1, 3, 1, 1, -3, -3, -3, -1, -3, -1, -3, -3}, + {3, -3, -3, -1, 3, 3, -3, -1, 3, 1, 1, 1, 3, -1, 3, -3, -1, 3, -1, 3, 1, -1, -3, -3}, + {-3, 1, -3, 1, -3, 1, 1, 3, 1, -3, -3, -1, 1, 3, -1, -3, 3, 1, -1, -3, -3, -3, -3, -3}, + {3, -3, -1, 1, 3, -1, -1, -3, -1, 3, -1, -3, -1, -3, 3, -1, 3, 1, 1, -3, 3, -3, -3, -3}}; + +static void zc_sequence_lte_r_uv_arg_1prb(uint32_t u, cf_t* tmp_arg) +{ + srslte_vec_sc_prod_fcc(zc_sequence_lte_phi_M_sc_12[u], M_PI_4, tmp_arg, SRSLTE_NRE); +} + +static void zc_sequence_lte_r_uv_arg_2prb(uint32_t u, cf_t* tmp_arg) +{ + srslte_vec_sc_prod_fcc(zc_sequence_lte_phi_M_sc_24[u], M_PI_4, tmp_arg, 2 * SRSLTE_NRE); +} + +static void zc_sequence_nr_r_uv_arg_0dot5prb(uint32_t u, cf_t* tmp_arg) +{ + srslte_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_6[u], M_PI_4, tmp_arg, SRSLTE_NRE / 2); +} + +static void zc_sequence_nr_r_uv_arg_1prb(uint32_t u, cf_t* tmp_arg) +{ + srslte_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_12[u], M_PI_4, tmp_arg, SRSLTE_NRE); +} + +static void zc_sequence_nr_r_uv_arg_1dot5prb(uint32_t u, cf_t* tmp_arg) +{ + srslte_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_18[u], M_PI_4, tmp_arg, (3 * SRSLTE_NRE) / 2); +} + +static void zc_sequence_nr_r_uv_arg_2prb(uint32_t u, cf_t* tmp_arg) +{ + srslte_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_24[u], M_PI_4, tmp_arg, 2 * SRSLTE_NRE); +} + +static uint32_t zc_sequence_q(uint32_t u, uint32_t v, uint32_t N_sz) +{ + float q; + float q_hat; + float n_sz = (float)N_sz; + + q_hat = n_sz * (u + 1) / 31; + if ((((uint32_t)(2 * q_hat)) % 2) == 0) { + q = q_hat + 0.5 + v; + } else { + q = q_hat + 0.5 - v; + } + return (uint32_t)q; +} + +// Common for LTE and NR +static void zc_sequence_r_uv_arg_mprb(uint32_t M_zc, uint32_t u, uint32_t v, cf_t* tmp_arg) +{ + int32_t N_sz = srslte_prime_lower_than(M_zc); // N_zc - Zadoff Chu Sequence Length + if (N_sz > 0) { + float q = zc_sequence_q(u, v, N_sz); + float n_sz = (float)N_sz; + for (uint32_t i = 0; i < M_zc; i++) { + float m = (float)(i % N_sz); + tmp_arg[i] = -M_PI * q * m * (m + 1) / n_sz; + } + } +} + +static int zc_sequence_lte_r_uv_arg(uint32_t M_zc, uint32_t u, uint32_t v, cf_t* tmp_arg) +{ + if (M_zc == 12) { + zc_sequence_lte_r_uv_arg_1prb(u, tmp_arg); + } else if (M_zc == 24) { + zc_sequence_lte_r_uv_arg_2prb(u, tmp_arg); + } else if (M_zc >= 36) { + zc_sequence_r_uv_arg_mprb(M_zc, u, v, tmp_arg); + } else { + ERROR("Invalid M_zc (%d)\n", M_zc); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +static int zc_sequence_nr_r_uv_arg(uint32_t M_zc, uint32_t u, uint32_t v, cf_t* tmp_arg) +{ + if (M_zc == 6) { + zc_sequence_nr_r_uv_arg_0dot5prb(u, tmp_arg); + } else if (M_zc == 12) { + zc_sequence_nr_r_uv_arg_1prb(u, tmp_arg); + } else if (M_zc == 18) { + zc_sequence_nr_r_uv_arg_1dot5prb(u, tmp_arg); + } else if (M_zc == 24) { + zc_sequence_nr_r_uv_arg_2prb(u, tmp_arg); + } else if (M_zc >= 36) { + zc_sequence_r_uv_arg_mprb(M_zc, u, v, tmp_arg); + } else { + ERROR("Invalid M_zc (%d)\n", M_zc); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +static void zc_sequence_generate(uint32_t M_zc, float alpha, const cf_t* tmp_arg, cf_t* sequence) +{ + for (uint32_t i = 0; i < M_zc; i++) { + sequence[i] = cexpf(I * (tmp_arg[i] + alpha * (float)i)); + } +} + +int srslte_zc_sequence_generate_lte(uint32_t u, uint32_t v, float alpha, uint32_t nof_prb, cf_t* sequence) +{ + + if (sequence == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Calculate number of samples + uint32_t M_zc = nof_prb * SRSLTE_NRE; + + // Calculate argument + if (zc_sequence_lte_r_uv_arg(M_zc, u, v, sequence) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Do complex exponential and adjust amplitude + zc_sequence_generate(M_zc, alpha, sequence, sequence); + + return SRSLTE_SUCCESS; +} + +int srslte_zc_sequence_generate_nr(uint32_t u, uint32_t v, float alpha, uint32_t m, uint32_t delta, cf_t* sequence) +{ + // Check inputs + if (sequence == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Calculate number of samples + uint32_t M_zc = (m * SRSLTE_NRE) >> delta; + + // Calculate argument + if (zc_sequence_nr_r_uv_arg(M_zc, u, v, sequence) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Do complex exponential and adjust amplitude + zc_sequence_generate(M_zc, alpha, sequence, sequence); + + return SRSLTE_SUCCESS; +} \ No newline at end of file diff --git a/lib/src/phy/phch/pucch.c b/lib/src/phy/phch/pucch.c index 63ffd9d2d..9915cb0de 100644 --- a/lib/src/phy/phch/pucch.c +++ b/lib/src/phy/phch/pucch.c @@ -25,6 +25,7 @@ #include "srslte/phy/ch_estimation/refsignal_ul.h" #include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/sequence.h" +#include "srslte/phy/common/zc_sequence.h" #include "srslte/phy/mimo/precoding.h" #include "srslte/phy/modem/demod_soft.h" #include "srslte/phy/phch/pucch.h" @@ -289,9 +290,6 @@ uci_mod_bits(srslte_pucch_t* q, srslte_ul_sf_cfg_t* sf, srslte_pucch_cfg_t* cfg, return SRSLTE_SUCCESS; } -// Declare this here, since we can not include refsignal_ul.h -void srslte_refsignal_r_uv_arg_1prb(float* arg, uint32_t u); - /* 3GPP 36211 Table 5.5.2.2.2-1: Demodulation reference signal location for different PUCCH formats. */ static const uint32_t pucch_symbol_format1_cpnorm[4] = {0, 1, 5, 6}; static const uint32_t pucch_symbol_format1_cpext[4] = {0, 1, 4, 5}; @@ -491,21 +489,22 @@ static int encode_signal_format12(srslte_pucch_t* q, } uint32_t u = (f_gh + (q->cell.id % 30)) % 30; - srslte_refsignal_r_uv_arg_1prb(q->tmp_arg, u); uint32_t N_sf_widx = N_sf == 3 ? 1 : 0; for (uint32_t m = 0; m < N_sf; m++) { - uint32_t l = get_pucch_symbol(m, cfg->format, q->cell.cp); - float alpha = 0; + // Calculate sequence z pointer for this symbol m + cf_t* z_m = &z[(ns % 2) * N_sf_0 * SRSLTE_PUCCH_N_SEQ + m * SRSLTE_PUCCH_N_SEQ]; + + // Get symbol index + uint32_t l = get_pucch_symbol(m, cfg->format, q->cell.cp); + cf_t w_m = 1.0; if (cfg->format >= SRSLTE_PUCCH_FORMAT_2) { - alpha = srslte_pucch_alpha_format2(q->n_cs_cell, cfg, ns, l); - for (uint32_t n = 0; n < SRSLTE_PUCCH_N_SEQ; n++) { - z[(ns % 2) * N_sf * SRSLTE_PUCCH_N_SEQ + m * SRSLTE_PUCCH_N_SEQ + n] = - q->d[(ns % 2) * N_sf + m] * cexpf(I * (q->tmp_arg[n] + alpha * n)); - } + float alpha = srslte_pucch_alpha_format2(q->n_cs_cell, cfg, ns, l); + srslte_zc_sequence_generate_lte(u, 0, alpha, SRSLTE_PUCCH_N_SEQ / SRSLTE_NRE, z_m); + w_m = q->d[(ns % 2) * N_sf + m]; } else { uint32_t n_prime_ns = 0; uint32_t n_oc = 0; - alpha = srslte_pucch_alpha_format1(q->n_cs_cell, cfg, q->cell.cp, true, ns, l, &n_oc, &n_prime_ns); + float alpha = srslte_pucch_alpha_format1(q->n_cs_cell, cfg, q->cell.cp, true, ns, l, &n_oc, &n_prime_ns); float S_ns = 0; if (n_prime_ns % 2) { S_ns = M_PI / 2; @@ -517,12 +516,12 @@ static int encode_signal_format12(srslte_pucch_t* q, n_oc, n_prime_ns, cfg->n_rb_2); - - for (uint32_t n = 0; n < SRSLTE_PUCCH_N_SEQ; n++) { - z[(ns % 2) * N_sf_0 * SRSLTE_PUCCH_N_SEQ + m * SRSLTE_PUCCH_N_SEQ + n] = - q->d[0] * cexpf(I * (w_n_oc[N_sf_widx][n_oc % 3][m] + q->tmp_arg[n] + alpha * n + S_ns)); - } + srslte_zc_sequence_generate_lte(u, 0, alpha, SRSLTE_PUCCH_N_SEQ / SRSLTE_NRE, z_m); + w_m = q->d[0] * cexpf(I * (w_n_oc[N_sf_widx][n_oc % 3][m] + S_ns)); } + + // Apply w_m + srslte_vec_sc_prod_ccc(z_m, w_m, z_m, SRSLTE_PUCCH_N_SEQ); } } return SRSLTE_SUCCESS; diff --git a/lib/src/phy/phch/test/pucch_test.c b/lib/src/phy/phch/test/pucch_test.c index fc158b898..213f08ddc 100644 --- a/lib/src/phy/phch/test/pucch_test.c +++ b/lib/src/phy/phch/test/pucch_test.c @@ -172,10 +172,6 @@ int main(int argc, char** argv) ERROR("Error setting C-RNTI\n"); goto quit; } - if (srslte_refsignal_ul_init(&dmrs, cell.nof_prb)) { - ERROR("Error creating PDSCH object\n"); - exit(-1); - } if (srslte_refsignal_ul_set_cell(&dmrs, cell)) { ERROR("Error creating PDSCH object\n"); exit(-1); @@ -325,7 +321,6 @@ int main(int argc, char** argv) quit: srslte_pucch_free(&pucch_ue); srslte_pucch_free(&pucch_enb); - srslte_refsignal_ul_free(&dmrs); srslte_chest_ul_free(&chest); srslte_chest_ul_res_free(&chest_res); srslte_channel_awgn_free(&awgn); diff --git a/lib/src/phy/ue/ue_ul.c b/lib/src/phy/ue/ue_ul.c index 8049ec92c..ea8ad2394 100644 --- a/lib/src/phy/ue/ue_ul.c +++ b/lib/src/phy/ue/ue_ul.c @@ -69,10 +69,6 @@ int srslte_ue_ul_init(srslte_ue_ul_t* q, cf_t* out_buffer, uint32_t max_prb) ERROR("Error creating PUSCH object\n"); goto clean_exit; } - if (srslte_refsignal_ul_init(&q->signals, max_prb)) { - ERROR("Error initiating srslte_refsignal_ul\n"); - goto clean_exit; - } q->refsignal = srslte_vec_cf_malloc(2 * SRSLTE_NRE * max_prb); if (!q->refsignal) { perror("malloc"); @@ -106,7 +102,6 @@ void srslte_ue_ul_free(srslte_ue_ul_t* q) srslte_pucch_free(&q->pucch); srslte_cfo_free(&q->cfo); - srslte_refsignal_ul_free(&q->signals); if (q->sf_symbols) { free(q->sf_symbols); From 2f2114f37726ca158e4272b88f9946ceeddcf4f9 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 11 Jan 2021 17:56:29 +0100 Subject: [PATCH 114/138] Fix typo --- lib/include/srslte/phy/fec/block/block.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/include/srslte/phy/fec/block/block.h b/lib/include/srslte/phy/fec/block/block.h index 640acc5f3..8221f73d0 100644 --- a/lib/include/srslte/phy/fec/block/block.h +++ b/lib/include/srslte/phy/fec/block/block.h @@ -31,7 +31,7 @@ * @brief Encodes unpacked data using Reed–Muller code block channel coding. * * @remark Described by 3GPP 36.212 section 5.2.3.3 for 4G/LTE - * @remark Described by 3GPP 38.212 section 5.3.3.3 for 5G/LTE + * @remark Described by 3GPP 38.212 section 5.3.3.3 for 5G/NR * * @param[in] input provides unpacked bits to encode * @param[in] input_len number of bits to encode, the maximum number of bits is SRSLTE_FEC_BLOCK_MAX_NOF_BITS From 2f5b1ba9cbbd0c1c29c1f2576f5dcbc2b0902ed2 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 11 Jan 2021 18:16:44 +0100 Subject: [PATCH 115/138] Avoid PUSCH-DMRS initialization for 0 PRB --- lib/src/phy/ch_estimation/refsignal_ul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/phy/ch_estimation/refsignal_ul.c b/lib/src/phy/ch_estimation/refsignal_ul.c index d41e81c01..cdb1699f6 100644 --- a/lib/src/phy/ch_estimation/refsignal_ul.c +++ b/lib/src/phy/ch_estimation/refsignal_ul.c @@ -273,7 +273,7 @@ int srslte_refsignal_dmrs_pusch_pregen(srslte_refsignal_ul_t* q, for (uint32_t sf_idx = 0; sf_idx < SRSLTE_NOF_SF_X_FRAME; sf_idx++) { for (uint32_t cs = 0; cs < SRSLTE_NOF_CSHIFT; cs++) { if (pregen->r[cs][sf_idx]) { - for (uint32_t n = 0; n <= q->cell.nof_prb; n++) { + for (uint32_t n = 1; n <= q->cell.nof_prb; n++) { if (srslte_dft_precoding_valid_prb(n)) { if (pregen->r[cs][sf_idx][n]) { if (srslte_refsignal_dmrs_pusch_gen(q, cfg, n, sf_idx, cs, pregen->r[cs][sf_idx][n])) { From 058bee5fda7a2c80bfbe9603b40cc1121088b454 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 11 Jan 2021 18:37:18 +0100 Subject: [PATCH 116/138] Increased prime number range --- lib/src/phy/utils/primes.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/lib/src/phy/utils/primes.c b/lib/src/phy/utils/primes.c index e5d96476c..c5a84c223 100644 --- a/lib/src/phy/utils/primes.c +++ b/lib/src/phy/utils/primes.c @@ -12,20 +12,34 @@ #include "srslte/phy/utils/primes.h" -#define NOF_PRIME_NUMBERS 196 +#define NOF_PRIME_NUMBERS 463 static const uint32_t prime_numbers[NOF_PRIME_NUMBERS] = { - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, - 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, - 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, - 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, - 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, - 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, - 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, - 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, - 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, - 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, - 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193}; + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, + 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, + 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, + 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, + 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, + 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, + 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, + 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, + 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, + 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, + 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, + 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, + 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, + 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, + 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, + 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, + 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, + 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, + 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, + 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, + 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, + 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, + 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, + 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, + 3229, 3251, 3253, 3257, 3259, 3271, 3299}; int srslte_prime_greater_than(uint32_t n) { From 7dd99da045cfa4589240a7f45fd7b8f48cbf9c5a Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 12 Jan 2021 09:49:39 +0100 Subject: [PATCH 117/138] Disable carry-less multiplication --- lib/src/phy/fec/block/block.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/src/phy/fec/block/block.c b/lib/src/phy/fec/block/block.c index 4e473fd99..c953b578f 100644 --- a/lib/src/phy/fec/block/block.c +++ b/lib/src/phy/fec/block/block.c @@ -14,14 +14,6 @@ #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" -// Use carry-less multiplication for parity check calculation only if AVX2 is available -#ifdef LV_HAVE_AVX2 -#include -#define USE_CARRYLESS_MULT 1 -#else -#define USE_CARRYLESS_MULT 0 -#endif // LV_HAVE_AVX2 - // The following MACRO enables/disables LUT for the decoder #define USE_LUT 1 @@ -42,17 +34,11 @@ static inline uint8_t encode_M_basis_seq_u16(uint16_t w, uint32_t bit_idx) // Apply mask uint64_t d = w & M_basis_seq_b[bit_idx % SRSLTE_FEC_BLOCK_SIZE]; -#if USE_CARRYLESS_MULT - // Compute parity using carry-less multiplication - const __m128i temp = _mm_clmulepi64_si128(_mm_set_epi64x(0, d), _mm_set_epi64x(0, 0xffffUL << 17UL), 0); - d = _mm_extract_epi32(temp, 1); -#else // Compute parity using Bit Twiddling d ^= d >> 8UL; d ^= d >> 4UL; d &= 0xFUL; d = (0x6996U >> d); -#endif return (uint8_t)(d & 1UL); } From 1420c23863c5b6b48482d13ba1e2c531a7b4f0b9 Mon Sep 17 00:00:00 2001 From: yagoda Date: Mon, 25 Jan 2021 22:05:46 +0100 Subject: [PATCH 118/138] adding RAR buffers for multiple carriers, previously RARs into different carriers in the same TTI would overwrite each other --- srsenb/hdr/stack/mac/mac.h | 3 ++- srsenb/src/stack/mac/mac.cc | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/srsenb/hdr/stack/mac/mac.h b/srsenb/hdr/stack/mac/mac.h index 866c02979..c090e1fbe 100644 --- a/srsenb/hdr/stack/mac/mac.h +++ b/srsenb/hdr/stack/mac/mac.h @@ -139,6 +139,7 @@ private: void prealloc_ue(uint32_t nof_ue); uint8_t* assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, + uint32_t enb_cc_idx, uint32_t nof_grants, uint32_t rar_idx, uint32_t pdu_len, @@ -146,7 +147,7 @@ private: const static int rar_payload_len = 128; std::array rar_pdu_msg; - srslte::byte_buffer_t rar_payload[sched_interface::MAX_RAR_LIST]; + srslte::byte_buffer_t rar_payload[SRSLTE_MAX_CARRIERS][sched_interface::MAX_RAR_LIST]; const static int NOF_BCCH_DLSCH_MSG = sched_interface::MAX_SIBS; diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index a5ba36112..eafa34bf5 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -661,6 +661,7 @@ int mac::get_dl_sched(uint32_t tti_tx_dl, dl_sched_list_t& dl_sched_res_list) // Assemble PDU dl_sched_res->pdsch[n].data[0] = assemble_rar(sched_result.rar[i].msg3_grant.data(), + enb_cc_idx, sched_result.rar[i].msg3_grant.size(), i, sched_result.rar[i].tbs, @@ -830,6 +831,7 @@ int mac::get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res } uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, + uint32_t enb_cc_idx, uint32_t nof_grants, uint32_t rar_idx, uint32_t pdu_len, @@ -838,8 +840,8 @@ uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, uint8_t grant_buffer[64] = {}; if (pdu_len < rar_payload_len && rar_idx < rar_pdu_msg.size()) { srslte::rar_pdu* pdu = &rar_pdu_msg[rar_idx]; - rar_payload[rar_idx].clear(); - pdu->init_tx(&rar_payload[rar_idx], pdu_len); + rar_payload[enb_cc_idx][rar_idx].clear(); + pdu->init_tx(&rar_payload[enb_cc_idx][rar_idx], pdu_len); for (uint32_t i = 0; i < nof_grants; i++) { srslte_dci_rar_pack(&grants[i].grant, grant_buffer); if (pdu->new_subh()) { @@ -849,8 +851,8 @@ uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, pdu->get()->set_sched_grant(grant_buffer); } } - if (pdu->write_packet(rar_payload[rar_idx].msg)) { - return rar_payload[rar_idx].msg; + if (pdu->write_packet(rar_payload[enb_cc_idx][rar_idx].msg)) { + return rar_payload[enb_cc_idx][rar_idx].msg; } } From 99c3aa9ba231956c326d4c65b5cf94912b464ac3 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Tue, 26 Jan 2021 19:15:28 +0100 Subject: [PATCH 119/138] Refactor assert to TESTASSERT in unit test --- lib/test/common/CMakeLists.txt | 1 + lib/test/common/bcd_helpers_test.cc | 27 +-- lib/test/common/test_eea1.cc | 107 ++++++------ lib/test/common/test_eea2.cc | 105 ++++++------ lib/test/common/test_eea3.cc | 67 ++++---- lib/test/common/test_eia1.cc | 23 ++- lib/test/common/test_eia3.cc | 38 +++-- lib/test/common/test_f12345.cc | 43 +++-- lib/test/upper/rlc_am_data_test.cc | 117 +++++++------ lib/test/upper/rlc_am_test.cc | 216 ++++++++++++------------ lib/test/upper/rlc_stress_test.cc | 1 + lib/test/upper/rlc_um_data_test.cc | 24 +-- srsue/test/mac_test.cc | 1 - srsue/test/ttcn3/test/CMakeLists.txt | 1 + srsue/test/ttcn3/test/rapidjson_test.cc | 7 +- srsue/test/upper/nas_test.cc | 10 +- srsue/test/upper/usim_test.cc | 4 +- 17 files changed, 411 insertions(+), 381 deletions(-) diff --git a/lib/test/common/CMakeLists.txt b/lib/test/common/CMakeLists.txt index bc7c0173c..5a44305e4 100644 --- a/lib/test/common/CMakeLists.txt +++ b/lib/test/common/CMakeLists.txt @@ -46,6 +46,7 @@ add_executable(timeout_test timeout_test.cc) target_link_libraries(timeout_test srslte_phy ${CMAKE_THREAD_LIBS_INIT}) add_executable(bcd_helpers_test bcd_helpers_test.cc) +target_link_libraries(bcd_helpers_test srslte_common) add_executable(stack_procedure_test stack_procedure_test.cc) add_test(stack_procedure_test stack_procedure_test) diff --git a/lib/test/common/bcd_helpers_test.cc b/lib/test/common/bcd_helpers_test.cc index 194dcf43a..206c1b46f 100644 --- a/lib/test/common/bcd_helpers_test.cc +++ b/lib/test/common/bcd_helpers_test.cc @@ -11,7 +11,7 @@ */ #include "srslte/common/bcd_helpers.h" -#include +#include "srslte/common/test_common.h" using namespace srslte; @@ -24,15 +24,15 @@ int main(int argc, char** argv) // String to code - assert(string_to_mcc(mcc_str, &mcc)); - assert(mcc == 0xF001); + TESTASSERT(string_to_mcc(mcc_str, &mcc)); + TESTASSERT(mcc == 0xF001); - assert(string_to_mnc(mnc_str, &mnc)); - assert(mnc == 0xF001); + TESTASSERT(string_to_mnc(mnc_str, &mnc)); + TESTASSERT(mnc == 0xF001); mnc_str = "01"; - assert(string_to_mnc(mnc_str, &mnc)); - assert(mnc == 0xFF01); + TESTASSERT(string_to_mnc(mnc_str, &mnc)); + TESTASSERT(mnc == 0xFF01); // Code to string @@ -41,13 +41,14 @@ int main(int argc, char** argv) mcc = 0xF001; mnc = 0xF001; - assert(mcc_to_string(mcc, &mcc_str)); - assert(mcc_str.compare("001") == 0); + TESTASSERT(mcc_to_string(mcc, &mcc_str)); + TESTASSERT(mcc_str.compare("001") == 0); - assert(mnc_to_string(mnc, &mnc_str)); - assert(mnc_str.compare("001") == 0); + TESTASSERT(mnc_to_string(mnc, &mnc_str)); + TESTASSERT(mnc_str.compare("001") == 0); mnc = 0xFF01; - assert(mnc_to_string(mnc, &mnc_str)); - assert(mnc_str.compare("01") == 0); + TESTASSERT(mnc_to_string(mnc, &mnc_str)); + TESTASSERT(mnc_str.compare("01") == 0); + return SRSLTE_SUCCESS; } diff --git a/lib/test/common/test_eea1.cc b/lib/test/common/test_eea1.cc index 5e745542b..34a171901 100644 --- a/lib/test/common/test_eea1.cc +++ b/lib/test/common/test_eea1.cc @@ -10,12 +10,12 @@ * */ -#include #include #include #include #include "srslte/common/liblte_security.h" +#include "srslte/common/test_common.h" #include "srslte/srslte.h" /* @@ -42,7 +42,7 @@ int32 arrcmp(uint8_t const* const a, uint8_t const* const b, uint32 len) * Integrity Algorithms UEA2 & UIA2 D4 v1.0 */ -void test_set_1() +int test_set_1() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -61,24 +61,25 @@ void test_set_1() // encryption err_lte = liblte_security_encryption_eea1(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea1(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_2() +int test_set_2() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -105,24 +106,25 @@ void test_set_2() // encryption err_lte = liblte_security_encryption_eea1(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea1(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_3() +int test_set_3() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -143,24 +145,25 @@ void test_set_3() // encryption err_lte = liblte_security_encryption_eea1(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea1(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_4() +int test_set_4() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -191,24 +194,25 @@ void test_set_4() // encryption err_lte = liblte_security_encryption_eea1(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea1(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_5() +int test_set_5() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -243,24 +247,25 @@ void test_set_5() // encryption err_lte = liblte_security_encryption_eea1(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea1(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_6() +int test_set_6() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -336,11 +341,11 @@ void test_set_6() get_time_interval(t); printf( "encryption: %u bits, t=%d us, rate=%.1f Mbps/s\n", len_bits, (int)t[0].tv_usec, (float)len_bits / t[0].tv_usec); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption gettimeofday(&t[1], NULL); @@ -349,17 +354,18 @@ void test_set_6() get_time_interval(t); printf( "decryption: %u bits, t=%d us, rate=%.1f Mbps/s\n", len_bits, (int)t[0].tv_usec, (float)len_bits / t[0].tv_usec); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } // set len_bitsgth to multiple of 8 respectively 128 -void test_set_1_block_size() +int test_set_1_block_size() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -378,25 +384,26 @@ void test_set_1_block_size() // encryption err_lte = liblte_security_encryption_eea1(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea1(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } // inserted bit flip in msg[0] -void test_set_1_invalid() +int test_set_1_invalid() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -415,21 +422,22 @@ void test_set_1_invalid() // encryption err_lte = liblte_security_encryption_eea1(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp != 0); + TESTASSERT(err_cmp != 0); // decryption err_lte = liblte_security_decryption_eea1(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp != 0); + TESTASSERT(err_cmp != 0); free(out); + return SRSLTE_SUCCESS; } /* @@ -438,12 +446,13 @@ void test_set_1_invalid() int main(int argc, char* argv[]) { - test_set_1(); - test_set_2(); - test_set_3(); - test_set_4(); - test_set_5(); - test_set_6(); - test_set_1_block_size(); - test_set_1_invalid(); + TESTASSERT(test_set_1() == SRSLTE_SUCCESS); + TESTASSERT(test_set_2() == SRSLTE_SUCCESS); + TESTASSERT(test_set_3() == SRSLTE_SUCCESS); + TESTASSERT(test_set_4() == SRSLTE_SUCCESS); + TESTASSERT(test_set_5() == SRSLTE_SUCCESS); + TESTASSERT(test_set_6() == SRSLTE_SUCCESS); + TESTASSERT(test_set_1_block_size() == SRSLTE_SUCCESS); + TESTASSERT(test_set_1_invalid() == SRSLTE_SUCCESS); + return SRSLTE_SUCCESS; } diff --git a/lib/test/common/test_eea2.cc b/lib/test/common/test_eea2.cc index d367e3481..3e55c2023 100644 --- a/lib/test/common/test_eea2.cc +++ b/lib/test/common/test_eea2.cc @@ -15,6 +15,7 @@ #include #include "srslte/common/liblte_security.h" +#include "srslte/common/test_common.h" #include "srslte/srslte.h" /* @@ -39,7 +40,7 @@ int32 arrcmp(uint8_t const* const a, uint8_t const* const b, uint32 len) * Document Reference: 33.401 V13.1.0 Annex C.1 */ -void test_set_1() +int test_set_1() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -58,24 +59,25 @@ void test_set_1() // encryption err_lte = liblte_security_encryption_eea2(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea2(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_2() +int test_set_2() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -102,24 +104,25 @@ void test_set_2() // encryption err_lte = liblte_security_encryption_eea2(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea2(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_3() +int test_set_3() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -140,24 +143,25 @@ void test_set_3() // encryption err_lte = liblte_security_encryption_eea2(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea2(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_4() +int test_set_4() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -188,24 +192,25 @@ void test_set_4() // encryption err_lte = liblte_security_encryption_eea2(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea2(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_5() +int test_set_5() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -240,24 +245,25 @@ void test_set_5() // encryption err_lte = liblte_security_encryption_eea2(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea2(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } -void test_set_6() +int test_set_6() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -337,11 +343,11 @@ void test_set_6() len_bits, (int)t[0].tv_usec / 100, (float)100 * len_bits / t[0].tv_usec); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption gettimeofday(&t[1], NULL); @@ -354,17 +360,18 @@ void test_set_6() len_bits, (int)t[0].tv_usec / 100, (float)100 * len_bits / t[0].tv_usec); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } // set len_bitsgth to multiple of 8 respectively 128 -void test_set_1_block_size() +int test_set_1_block_size() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -383,25 +390,26 @@ void test_set_1_block_size() // encryption err_lte = liblte_security_encryption_eea2(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea2(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); free(out); + return SRSLTE_SUCCESS; } // inserted bit flip in msg[0] -void test_set_1_invalid() +int test_set_1_invalid() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -420,21 +428,22 @@ void test_set_1_invalid() // encryption err_lte = liblte_security_encryption_eea2(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); - assert(err_cmp != 0); + TESTASSERT(err_cmp != 0); // decryption err_lte = liblte_security_decryption_eea2(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp != 0); + TESTASSERT(err_cmp != 0); free(out); + return SRSLTE_SUCCESS; } /* @@ -443,12 +452,12 @@ void test_set_1_invalid() int main(int argc, char* argv[]) { - test_set_1(); - test_set_2(); - test_set_3(); - test_set_4(); - test_set_5(); - test_set_6(); - test_set_1_block_size(); - test_set_1_invalid(); + TESTASSERT(test_set_1() == SRSLTE_SUCCESS); + TESTASSERT(test_set_2() == SRSLTE_SUCCESS); + TESTASSERT(test_set_3() == SRSLTE_SUCCESS); + TESTASSERT(test_set_4() == SRSLTE_SUCCESS); + TESTASSERT(test_set_5() == SRSLTE_SUCCESS); + TESTASSERT(test_set_6() == SRSLTE_SUCCESS); + TESTASSERT(test_set_1_block_size() == SRSLTE_SUCCESS); + TESTASSERT(test_set_1_invalid() == SRSLTE_SUCCESS); } diff --git a/lib/test/common/test_eea3.cc b/lib/test/common/test_eea3.cc index 3f717727a..8cfb62066 100644 --- a/lib/test/common/test_eea3.cc +++ b/lib/test/common/test_eea3.cc @@ -10,11 +10,11 @@ * */ -#include #include #include #include "srslte/common/liblte_security.h" +#include "srslte/common/test_common.h" #include "srslte/srslte.h" int32 arrcmp(uint8_t const* const a, uint8_t const* const b, uint32 len) @@ -37,7 +37,7 @@ int32 arrcmp(uint8_t const* const a, uint8_t const* const b, uint32 len) * */ -void test_set_1() +int test_set_1() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -59,7 +59,7 @@ void test_set_1() // encryption err_lte = liblte_security_encryption_eea3(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); @@ -70,15 +70,15 @@ void test_set_1() printf("Test Set 1 Encryption: Failed\n"); } - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea3(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); if (err_cmp == 0) { printf("Test Set 1 Decryption: Success\n"); @@ -87,9 +87,10 @@ void test_set_1() } free(out); + return SRSLTE_SUCCESS; } -void test_set_2() +int test_set_2() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -119,7 +120,7 @@ void test_set_2() // encryption err_lte = liblte_security_encryption_eea3(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); @@ -129,15 +130,15 @@ void test_set_2() printf("Test Set 2 Encryption: Failed\n"); } - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea3(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); if (err_cmp == 0) { printf("Test Set 2 Decryption: Success\n"); @@ -146,9 +147,10 @@ void test_set_2() } free(out); + return SRSLTE_SUCCESS; } -void test_set_3() +int test_set_3() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -190,7 +192,7 @@ void test_set_3() // encryption err_lte = liblte_security_encryption_eea3(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); int i; // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); @@ -201,15 +203,15 @@ void test_set_3() printf("Test Set 3 Encryption: Failed\n"); } - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea3(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); if (err_cmp == 0) { printf("Test Set 3 Decryption: Success\n"); @@ -218,9 +220,10 @@ void test_set_3() } free(out); + return SRSLTE_SUCCESS; } -void test_set_4() +int test_set_4() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -278,7 +281,7 @@ void test_set_4() // encryption err_lte = liblte_security_encryption_eea3(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); int i; // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); @@ -289,15 +292,15 @@ void test_set_4() printf("Test Set 4 Encryption: Failed\n"); } - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea3(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); if (err_cmp == 0) { printf("Test Set 4 Decryption: Success\n"); @@ -306,9 +309,10 @@ void test_set_4() } free(out); + return SRSLTE_SUCCESS; } -void test_set_5() +int test_set_5() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -382,7 +386,7 @@ void test_set_5() // encryption err_lte = liblte_security_encryption_eea3(key, count, bearer, direction, msg, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); int i; // compare cipher text err_cmp = arrcmp(ct, out, len_bytes); @@ -393,15 +397,15 @@ void test_set_5() printf("Test Set 5 Encryption: Failed\n"); } - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // decryption err_lte = liblte_security_decryption_eea3(key, count, bearer, direction, ct, len_bits, out); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); // compare cipher text err_cmp = arrcmp(msg, out, len_bytes); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); if (err_cmp == 0) { printf("Test Set 5 Decryption: Success\n"); @@ -410,13 +414,14 @@ void test_set_5() } free(out); + return SRSLTE_SUCCESS; } int main(int argc, char* argv[]) { - test_set_1(); - test_set_2(); - test_set_3(); - test_set_4(); - test_set_5(); + TESTASSERT(test_set_1() == SRSLTE_SUCCESS); + TESTASSERT(test_set_2() == SRSLTE_SUCCESS); + TESTASSERT(test_set_3() == SRSLTE_SUCCESS); + TESTASSERT(test_set_4() == SRSLTE_SUCCESS); + TESTASSERT(test_set_5() == SRSLTE_SUCCESS); } diff --git a/lib/test/common/test_eia1.cc b/lib/test/common/test_eia1.cc index fe6f251af..85045aa59 100644 --- a/lib/test/common/test_eia1.cc +++ b/lib/test/common/test_eia1.cc @@ -16,6 +16,7 @@ #include #include "srslte/common/security.h" +#include "srslte/common/test_common.h" #include "srslte/srslte.h" /* @@ -25,7 +26,7 @@ * */ -void test_set_1() +int test_set_1() { uint8_t key[] = {0x2b, 0xd6, 0x45, 0x9f, 0x82, 0xc5, 0xb3, 0x00, 0x95, 0x2c, 0x49, 0x10, 0x48, 0x81, 0xff, 0x48}; uint32_t count = 0x38a6f056; @@ -41,11 +42,12 @@ void test_set_1() srslte::security_128_eia1(key, count, bearer, direction, msg, len_bytes, mac); for (int i = 0; i < 4; i++) { - assert(mac[i] == mt[i]); + TESTASSERT(mac[i] == mt[i]); } + return SRSLTE_SUCCESS; } -void test_set_4() +int test_set_4() { uint8_t key[] = {0x83, 0xfd, 0x23, 0xa2, 0x44, 0xa7, 0x4c, 0xf3, 0x58, 0xda, 0x30, 0x19, 0xf1, 0x72, 0x26, 0x35}; uint32_t count = 0x36af6144; @@ -66,11 +68,12 @@ void test_set_4() srslte::security_128_eia1(key, count, bearer, direction, msg, len_bytes, mac); for (int i = 0; i < 4; i++) { - assert(mac[i] == mt[i]); + TESTASSERT(mac[i] == mt[i]); } + return SRSLTE_SUCCESS; } -void test_set_7() +int test_set_7() { uint8_t key[] = {0xb3, 0x12, 0x0f, 0xfd, 0xb2, 0xcf, 0x6a, 0xf4, 0xe7, 0x3e, 0xaf, 0x2e, 0xf4, 0xeb, 0xec, 0x69}; uint32_t count = 0x296f393c; @@ -197,8 +200,9 @@ void test_set_7() srslte::security_128_eia1(key, count, bearer, direction, msg, len_bytes, mac); for (int i = 0; i < 4; i++) { - assert(mac[i] == mt[i]); + TESTASSERT(mac[i] == mt[i]); } + return SRSLTE_SUCCESS; } /* * Functions @@ -206,7 +210,8 @@ void test_set_7() int main(int argc, char* argv[]) { - test_set_1(); - test_set_4(); - test_set_7(); + TESTASSERT(test_set_1() == SRSLTE_SUCCESS); + TESTASSERT(test_set_4() == SRSLTE_SUCCESS); + TESTASSERT(test_set_7() == SRSLTE_SUCCESS); + return SRSLTE_SUCCESS; } diff --git a/lib/test/common/test_eia3.cc b/lib/test/common/test_eia3.cc index 10862ef59..0d864e9b9 100644 --- a/lib/test/common/test_eia3.cc +++ b/lib/test/common/test_eia3.cc @@ -10,13 +10,13 @@ * */ -#include #include #include #include #include "srslte/common/liblte_security.h" #include "srslte/common/security.h" +#include "srslte/common/test_common.h" #include "srslte/srslte.h" /* @@ -27,7 +27,7 @@ * */ -void test_set_1() +int test_set_1() { uint8_t key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; uint32_t count = 0x0; @@ -48,16 +48,17 @@ void test_set_1() if (mac[i] != expected_mac[i]) { failed = true; } - assert(mac[i] == expected_mac[i]); + TESTASSERT(mac[i] == expected_mac[i]); } if (failed == true) { printf("Test Set 1: Failed\n"); } else { printf("Test Set 1: Success\n"); } + return SRSLTE_SUCCESS; } -void test_set_2() +int test_set_2() { uint8_t key[] = {0x47, 0x05, 0x41, 0x25, 0x56, 0x1e, 0xb2, 0xdd, 0xa9, 0x40, 0x59, 0xda, 0x05, 0x09, 0x78, 0x50}; uint32_t count = 0x561eb2dd; @@ -78,16 +79,17 @@ void test_set_2() if (mac[i] != expected_mac[i]) { failed = true; } - assert(mac[i] == expected_mac[i]); + TESTASSERT(mac[i] == expected_mac[i]); } if (failed == true) { printf("Test Set 2: Failed\n"); } else { printf("Test Set 2: Success\n"); } + return SRSLTE_SUCCESS; } -void test_set_3() +int test_set_3() { uint8_t key[] = {0xc9, 0xe6, 0xce, 0xc4, 0x60, 0x7c, 0x72, 0xdb, 0x00, 0x0a, 0xef, 0xa8, 0x83, 0x85, 0xab, 0x0a}; uint32_t count = 0xa94059da; @@ -112,16 +114,17 @@ void test_set_3() if (mac[i] != expected_mac[i]) { failed = true; } - assert(mac[i] == expected_mac[i]); + TESTASSERT(mac[i] == expected_mac[i]); } if (failed == true) { printf("Test Set 3: Failed\n"); } else { printf("Test Set 3: Success\n"); } + return SRSLTE_SUCCESS; } -void test_set_4() +int test_set_4() { uint8_t key[] = {0xc8, 0xa4, 0x82, 0x62, 0xd0, 0xc2, 0xe2, 0xba, 0xc4, 0xb9, 0x6e, 0xf7, 0x7e, 0x80, 0xca, 0x59}; uint32_t count = 0x05097850; @@ -156,16 +159,17 @@ void test_set_4() if (mac[i] != expected_mac[i]) { failed = true; } - assert(mac[i] == expected_mac[i]); + TESTASSERT(mac[i] == expected_mac[i]); } if (failed == true) { printf("Test Set 4: Failed\n"); } else { printf("Test Set 4: Success\n"); } + return SRSLTE_SUCCESS; } -void test_set_5() +int test_set_5() { uint8_t key[] = {0x6b, 0x8b, 0x08, 0xee, 0x79, 0xe0, 0xb5, 0x98, 0x2d, 0x6d, 0x12, 0x8e, 0xa9, 0xf2, 0x20, 0xcb}; uint32_t count = 0x561eb2dd; @@ -225,20 +229,22 @@ void test_set_5() if (mac[i] != expected_mac[i]) { failed = true; } - assert(mac[i] == expected_mac[i]); + TESTASSERT(mac[i] == expected_mac[i]); } if (failed == true) { printf("Test Set 5: Failed\n"); } else { printf("Test Set 5: Success\n"); } + return SRSLTE_SUCCESS; } int main(int argc, char* argv[]) { - test_set_1(); - test_set_2(); - test_set_3(); - test_set_4(); - test_set_5(); + TESTASSERT(test_set_1() == SRSLTE_SUCCESS); + TESTASSERT(test_set_2() == SRSLTE_SUCCESS); + TESTASSERT(test_set_3() == SRSLTE_SUCCESS); + TESTASSERT(test_set_4() == SRSLTE_SUCCESS); + TESTASSERT(test_set_5() == SRSLTE_SUCCESS); + return SRSLTE_SUCCESS; } \ No newline at end of file diff --git a/lib/test/common/test_f12345.cc b/lib/test/common/test_f12345.cc index 345b010e6..54102656a 100644 --- a/lib/test/common/test_f12345.cc +++ b/lib/test/common/test_f12345.cc @@ -10,12 +10,11 @@ * */ -#include #include #include #include "srslte/common/liblte_security.h" - +#include "srslte/common/test_common.h" /* * Prototypes */ @@ -55,7 +54,7 @@ void arrprint(uint8_t const* const a, uint32 len) * Functions */ -void test_set_2() +int test_set_2() { LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; int32 err_cmp = 0; @@ -69,17 +68,17 @@ void test_set_2() uint8_t opc_o[16]; err_lte = liblte_compute_opc(k, op, opc_o); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); arrprint(opc_o, sizeof(opc_o)); uint8_t opc_a[] = {0xcd, 0x63, 0xcb, 0x71, 0x95, 0x4a, 0x9f, 0x4e, 0x48, 0xa5, 0x99, 0x4e, 0x37, 0xa0, 0x2b, 0xaf}; err_cmp = arrcmp(opc_o, opc_a, sizeof(opc_o)); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); uint8_t mac_o[8]; err_lte = liblte_security_milenage_f1(k, opc_o, rand, sqn, amf, mac_o); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); arrprint(mac_o, sizeof(mac_o)); @@ -87,21 +86,21 @@ void test_set_2() // compare mac a err_cmp = arrcmp(mac_o, mac_a, sizeof(mac_a)); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // f1 star uint8_t mac_so[8]; err_lte = liblte_security_milenage_f1_star(k, opc_o, rand, sqn, amf, mac_so); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); uint8_t mac_s[] = {0x01, 0xcf, 0xaf, 0x9e, 0xc4, 0xe8, 0x71, 0xe9}; arrprint(mac_so, sizeof(mac_so)); err_cmp = arrcmp(mac_so, mac_s, sizeof(mac_s)); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // f2345 uint8_t res_o[8]; @@ -111,7 +110,7 @@ void test_set_2() err_lte = liblte_security_milenage_f2345(k, opc_o, rand, res_o, ck_o, ik_o, ak_o); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); uint8_t res[] = {0xa5, 0x42, 0x11, 0xd5, 0xe3, 0xba, 0x50, 0xbf}; uint8_t ck[] = {0xb4, 0x0b, 0xa9, 0xa3, 0xc5, 0x8b, 0x2a, 0x05, 0xbb, 0xf0, 0xd9, 0x87, 0xb2, 0x1b, 0xf8, 0xcb}; @@ -122,35 +121,36 @@ void test_set_2() arrprint(res_o, sizeof(res_o)); err_cmp = arrcmp(res_o, res, sizeof(res)); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // CK arrprint(ck_o, sizeof(ck_o)); err_cmp = arrcmp(ck_o, ck, sizeof(ck)); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // IK arrprint(ik_o, sizeof(ik_o)); err_cmp = arrcmp(ik_o, ik, sizeof(ik)); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // AK arrprint(ak_o, sizeof(ak_o)); err_cmp = arrcmp(ak_o, ak, sizeof(ak)); - assert(err_cmp == 0); + TESTASSERT(err_cmp == 0); // f star uint8_t ak_star_o[6]; err_lte = liblte_security_milenage_f5_star(k, opc_o, rand, ak_star_o); - assert(err_lte == LIBLTE_SUCCESS); + TESTASSERT(err_lte == LIBLTE_SUCCESS); arrprint(ak_star_o, sizeof(ak_star_o)); uint8_t ak_star[] = {0x45, 0x1e, 0x8b, 0xec, 0xa4, 0x3b}; err_cmp = arrcmp(ak_star_o, ak_star, sizeof(ak_star)); - assert(err_cmp == 0); - return; + TESTASSERT(err_cmp == 0); + return SRSLTE_SUCCESS; + ; } /* @@ -160,11 +160,6 @@ void test_set_2() int main(int argc, char* argv[]) { - test_set_2(); - /* - test_set_3(); - test_set_4(); - test_set_5(); - test_set_6(); - */ + TESTASSERT(test_set_2() == SRSLTE_SUCCESS); + return SRSLTE_SUCCESS; } diff --git a/lib/test/upper/rlc_am_data_test.cc b/lib/test/upper/rlc_am_data_test.cc index 0b3e819eb..d3b1da428 100644 --- a/lib/test/upper/rlc_am_data_test.cc +++ b/lib/test/upper/rlc_am_data_test.cc @@ -10,8 +10,8 @@ * */ +#include "srslte/common/test_common.h" #include "srslte/upper/rlc_am_lte.h" -#include #include // Fixed header only @@ -42,7 +42,7 @@ uint32_t PDU4_LEN = 5; using namespace srslte; -void test1() +int test1() { srslte::rlc_amd_pdu_header_t h; srslte::byte_buffer_t b1, b2; @@ -50,21 +50,22 @@ void test1() memcpy(b1.msg, &pdu1[0], PDU1_LEN); b1.N_bytes = PDU1_LEN; rlc_am_read_data_pdu_header(&b1, &h); - assert(RLC_DC_FIELD_DATA_PDU == h.dc); - assert(0x01 == h.fi); - assert(0 == h.N_li); - assert(0 == h.lsf); - assert(0 == h.p); - assert(0 == h.rf); - assert(0 == h.so); - assert(6 == h.sn); + TESTASSERT(RLC_DC_FIELD_DATA_PDU == h.dc); + TESTASSERT(0x01 == h.fi); + TESTASSERT(0 == h.N_li); + TESTASSERT(0 == h.lsf); + TESTASSERT(0 == h.p); + TESTASSERT(0 == h.rf); + TESTASSERT(0 == h.so); + TESTASSERT(6 == h.sn); rlc_am_write_data_pdu_header(&h, &b2); - assert(b2.N_bytes == PDU1_LEN); + TESTASSERT(b2.N_bytes == PDU1_LEN); for (uint32_t i = 0; i < b2.N_bytes; i++) - assert(b2.msg[i] == b1.msg[i]); + TESTASSERT(b2.msg[i] == b1.msg[i]); + return SRSLTE_SUCCESS; } -void test2() +int test2() { srslte::rlc_amd_pdu_header_t h; srslte::byte_buffer_t b1, b2; @@ -72,23 +73,24 @@ void test2() memcpy(b1.msg, &pdu2[0], PDU2_LEN); b1.N_bytes = PDU2_LEN; rlc_am_read_data_pdu_header(&b1, &h); - assert(RLC_DC_FIELD_DATA_PDU == h.dc); - assert(0x01 == h.fi); - assert(2 == h.N_li); - assert(1500 == h.li[0]); - assert(1500 == h.li[1]); - assert(0 == h.lsf); - assert(0 == h.p); - assert(0 == h.rf); - assert(0 == h.so); - assert(0 == h.sn); + TESTASSERT(RLC_DC_FIELD_DATA_PDU == h.dc); + TESTASSERT(0x01 == h.fi); + TESTASSERT(2 == h.N_li); + TESTASSERT(1500 == h.li[0]); + TESTASSERT(1500 == h.li[1]); + TESTASSERT(0 == h.lsf); + TESTASSERT(0 == h.p); + TESTASSERT(0 == h.rf); + TESTASSERT(0 == h.so); + TESTASSERT(0 == h.sn); rlc_am_write_data_pdu_header(&h, &b2); - assert(b2.N_bytes == PDU2_LEN); + TESTASSERT(b2.N_bytes == PDU2_LEN); for (uint32_t i = 0; i < b2.N_bytes; i++) - assert(b2.msg[i] == b1.msg[i]); + TESTASSERT(b2.msg[i] == b1.msg[i]); + return SRSLTE_SUCCESS; } -void test3() +int test3() { srslte::rlc_amd_pdu_header_t h; srslte::byte_buffer_t b1, b2; @@ -96,24 +98,25 @@ void test3() memcpy(b1.msg, &pdu3[0], PDU3_LEN); b1.N_bytes = PDU3_LEN; rlc_am_read_data_pdu_header(&b1, &h); - assert(RLC_DC_FIELD_DATA_PDU == h.dc); - assert(0x01 == h.fi); - assert(3 == h.N_li); - assert(1500 == h.li[0]); - assert(1500 == h.li[1]); - assert(1500 == h.li[2]); - assert(0 == h.lsf); - assert(0 == h.p); - assert(0 == h.rf); - assert(0 == h.so); - assert(0 == h.sn); + TESTASSERT(RLC_DC_FIELD_DATA_PDU == h.dc); + TESTASSERT(0x01 == h.fi); + TESTASSERT(3 == h.N_li); + TESTASSERT(1500 == h.li[0]); + TESTASSERT(1500 == h.li[1]); + TESTASSERT(1500 == h.li[2]); + TESTASSERT(0 == h.lsf); + TESTASSERT(0 == h.p); + TESTASSERT(0 == h.rf); + TESTASSERT(0 == h.so); + TESTASSERT(0 == h.sn); rlc_am_write_data_pdu_header(&h, &b2); - assert(b2.N_bytes == PDU3_LEN); + TESTASSERT(b2.N_bytes == PDU3_LEN); for (uint32_t i = 0; i < b2.N_bytes; i++) - assert(b2.msg[i] == b1.msg[i]); + TESTASSERT(b2.msg[i] == b1.msg[i]); + return SRSLTE_SUCCESS; } -void test4() +int test4() { srslte::rlc_amd_pdu_header_t h; srslte::byte_buffer_t b1, b2; @@ -121,26 +124,28 @@ void test4() memcpy(b1.msg, &pdu4[0], PDU4_LEN); b1.N_bytes = PDU4_LEN; rlc_am_read_data_pdu_header(&b1, &h); - assert(RLC_DC_FIELD_DATA_PDU == h.dc); - assert(0x03 == h.fi); - assert(2 == h.N_li); - assert(1342 == h.li[0]); - assert(1500 == h.li[1]); - assert(0 == h.lsf); - assert(0 == h.p); - assert(0 == h.rf); - assert(0 == h.so); - assert(2 == h.sn); + TESTASSERT(RLC_DC_FIELD_DATA_PDU == h.dc); + TESTASSERT(0x03 == h.fi); + TESTASSERT(2 == h.N_li); + TESTASSERT(1342 == h.li[0]); + TESTASSERT(1500 == h.li[1]); + TESTASSERT(0 == h.lsf); + TESTASSERT(0 == h.p); + TESTASSERT(0 == h.rf); + TESTASSERT(0 == h.so); + TESTASSERT(2 == h.sn); rlc_am_write_data_pdu_header(&h, &b2); - assert(b2.N_bytes == PDU4_LEN); + TESTASSERT(b2.N_bytes == PDU4_LEN); for (uint32_t i = 0; i < b2.N_bytes; i++) - assert(b2.msg[i] == b1.msg[i]); + TESTASSERT(b2.msg[i] == b1.msg[i]); + return SRSLTE_SUCCESS; } int main(int argc, char** argv) { - test1(); - test2(); - test3(); - test4(); + TESTASSERT(test1() == SRSLTE_SUCCESS); + TESTASSERT(test2() == SRSLTE_SUCCESS); + TESTASSERT(test3() == SRSLTE_SUCCESS); + TESTASSERT(test4() == SRSLTE_SUCCESS); + return SRSLTE_SUCCESS; } diff --git a/lib/test/upper/rlc_am_test.cc b/lib/test/upper/rlc_am_test.cc index be2362153..2b7c3c560 100644 --- a/lib/test/upper/rlc_am_test.cc +++ b/lib/test/upper/rlc_am_test.cc @@ -15,7 +15,6 @@ #include "srslte/common/test_common.h" #include "srslte/common/threads.h" #include "srslte/upper/rlc_am_lte.h" -#include #include #define NBUFS 5 #define HAVE_PCAP 0 @@ -112,7 +111,7 @@ private: bool running; }; -void basic_test_tx(rlc_am_lte* rlc, byte_buffer_t pdu_bufs[NBUFS]) +int basic_test_tx(rlc_am_lte* rlc, byte_buffer_t pdu_bufs[NBUFS]) { // Push 5 SDUs into RLC1 @@ -125,19 +124,20 @@ void basic_test_tx(rlc_am_lte* rlc, byte_buffer_t pdu_bufs[NBUFS]) rlc->write_sdu(std::move(sdu_bufs[i])); } - assert(13 == rlc->get_buffer_state()); // 2 Bytes for fixed header + 6 for LIs + 5 for payload + TESTASSERT(13 == rlc->get_buffer_state()); // 2 Bytes for fixed header + 6 for LIs + 5 for payload // Read 5 PDUs from RLC1 (1 byte each) for (int i = 0; i < NBUFS; i++) { uint32_t len = rlc->read_pdu(pdu_bufs[i].msg, 3); // 2 bytes for header + 1 byte payload pdu_bufs[i].N_bytes = len; - assert(3 == len); + TESTASSERT(3 == len); } - assert(0 == rlc->get_buffer_state()); + TESTASSERT(0 == rlc->get_buffer_state()); + return SRSLTE_SUCCESS; } -bool basic_test() +int basic_test() { rlc_am_tester tester; timer_handler timers(8); @@ -147,7 +147,7 @@ bool basic_test() rlc_am_lte rlc2(rrc_log2, 1, &tester, &tester, &timers); // before configuring entity - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); if (not rlc1.configure(rlc_config_t::default_rlc_am_config())) { return -1; @@ -164,14 +164,14 @@ bool basic_test() rlc2.write_pdu(pdu_bufs[i].msg, pdu_bufs[i].N_bytes); } - assert(2 == rlc2.get_buffer_state()); + TESTASSERT(2 == rlc2.get_buffer_state()); // Read status PDU from RLC2 byte_buffer_t status_buf; int len = rlc2.read_pdu(status_buf.msg, 2); status_buf.N_bytes = len; - assert(0 == rlc2.get_buffer_state()); + TESTASSERT(0 == rlc2.get_buffer_state()); // Assert status is correct rlc_status_pdu_t status_check = {}; @@ -182,8 +182,8 @@ bool basic_test() rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); for (int i = 0; i < tester.n_sdus; i++) { - assert(tester.sdus[i]->N_bytes == 1); - assert(*(tester.sdus[i]->msg) == i); + TESTASSERT(tester.sdus[i]->N_bytes == 1); + TESTASSERT(*(tester.sdus[i]->msg) == i); } // Check statistics @@ -192,7 +192,7 @@ bool basic_test() return SRSLTE_SUCCESS; } -bool concat_test() +int concat_test() { rlc_am_tester tester; srslte::timer_handler timers(8); @@ -218,14 +218,14 @@ bool concat_test() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(13 == rlc1.get_buffer_state()); // 2 Bytes for fixed header + 6 for LIs + 5 for payload + TESTASSERT(13 == rlc1.get_buffer_state()); // 2 Bytes for fixed header + 6 for LIs + 5 for payload // Read 1 PDUs from RLC1 containing all 5 SDUs byte_buffer_t pdu_buf; int len = rlc1.read_pdu(pdu_buf.msg, 13); // 8 bytes for header + payload pdu_buf.N_bytes = len; - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDU into RLC2 rlc2.write_pdu(pdu_buf.msg, pdu_buf.N_bytes); @@ -246,10 +246,10 @@ bool concat_test() // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); - assert(tester.n_sdus == 5); + TESTASSERT(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { - assert(tester.sdus[i]->N_bytes == 1); - assert(*(tester.sdus[i]->msg) == i); + TESTASSERT(tester.sdus[i]->N_bytes == 1); + TESTASSERT(*(tester.sdus[i]->msg) == i); } // Check statistics @@ -258,7 +258,7 @@ bool concat_test() return SRSLTE_SUCCESS; } -bool segment_test(bool in_seq_rx) +int segment_test(bool in_seq_rx) { rlc_am_tester tester; srslte::timer_handler timers(8); @@ -286,7 +286,7 @@ bool segment_test(bool in_seq_rx) rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(58 == rlc1.get_buffer_state()); // 2 bytes for header + 6 bytes for LI + 50 bytes for payload + TESTASSERT(58 == rlc1.get_buffer_state()); // 2 bytes for header + 6 bytes for LI + 50 bytes for payload // Read PDUs from RLC1 (force segmentation) byte_buffer_t pdu_bufs[20]; @@ -296,7 +296,7 @@ bool segment_test(bool in_seq_rx) pdu_bufs[n_pdus++].N_bytes = len; } - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDUs into RLC2 if (in_seq_rx) { @@ -314,7 +314,7 @@ bool segment_test(bool in_seq_rx) // Receiver will only generate status PDU if they arrive in order // If SN=7 arrives first, but the Rx expects SN=0, status reporting will be delayed, see TS 36.322 v10 Section 5.2.3 if (in_seq_rx) { - assert(2 == rlc2.get_buffer_state()); + TESTASSERT(2 == rlc2.get_buffer_state()); // Read status PDU from RLC2 byte_buffer_t status_buf; @@ -330,13 +330,13 @@ bool segment_test(bool in_seq_rx) rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); } - assert(0 == rlc2.get_buffer_state()); + TESTASSERT(0 == rlc2.get_buffer_state()); - assert(tester.n_sdus == 5); + TESTASSERT(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { - assert(tester.sdus[i]->N_bytes == 10); + TESTASSERT(tester.sdus[i]->N_bytes == 10); for (int j = 0; j < 10; j++) - assert(tester.sdus[i]->msg[j] == j); + TESTASSERT(tester.sdus[i]->msg[j] == j); } // Check statistics @@ -345,7 +345,7 @@ bool segment_test(bool in_seq_rx) return SRSLTE_SUCCESS; } -bool retx_test() +int retx_test() { rlc_am_tester tester; timer_handler timers(8); @@ -372,7 +372,7 @@ bool retx_test() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(13 == rlc1.get_buffer_state()); + TESTASSERT(13 == rlc1.get_buffer_state()); // Read 5 PDUs from RLC1 (1 byte each) byte_buffer_t pdu_bufs[NBUFS]; @@ -381,7 +381,7 @@ bool retx_test() pdu_bufs[i].N_bytes = len; } - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDUs into RLC2 (skip SN 1) for (int i = 0; i < NBUFS; i++) { @@ -391,7 +391,7 @@ bool retx_test() // check buffered bytes at receiver, 3 PDUs with one 1 B each (SN=0 has been delivered already) rlc_bearer_metrics_t metrics = rlc2.get_metrics(); - assert(metrics.rx_buffered_bytes == 3); + TESTASSERT(metrics.rx_buffered_bytes == 3); // Step timers until reordering timeout expires for (int cnt = 0; cnt < 5; cnt++) { @@ -399,7 +399,7 @@ bool retx_test() } uint32_t buffer_state = rlc2.get_buffer_state(); - assert(4 == buffer_state); + TESTASSERT(4 == buffer_state); // Read status PDU from RLC2 byte_buffer_t status_buf; @@ -419,7 +419,7 @@ bool retx_test() // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); - assert(3 == rlc1.get_buffer_state()); // 2 byte header + 1 byte payload + TESTASSERT(3 == rlc1.get_buffer_state()); // 2 byte header + 1 byte payload // Read the retx PDU from RLC1 byte_buffer_t retx; @@ -429,7 +429,7 @@ bool retx_test() // Write the retx PDU to RLC2 rlc2.write_pdu(retx.msg, retx.N_bytes); - assert(tester.n_sdus == 5); + TESTASSERT(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != 1) return -1; @@ -441,7 +441,7 @@ bool retx_test() } // Purpose: test correct retx of lost segment and pollRetx timer expiration -bool segment_retx_test() +int segment_retx_test() { rlc_am_tester tester; timer_handler timers(8); @@ -544,7 +544,7 @@ bool segment_retx_test() return SRSLTE_SUCCESS; } -bool resegment_test_1() +int resegment_test_1() { // SDUs: | 10 | 10 | 10 | 10 | 10 | // PDUs: | 10 | 10 | 10 | 10 | 10 | @@ -576,7 +576,7 @@ bool resegment_test_1() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(58 == rlc1.get_buffer_state()); // 2 bytes for fixed header, 6 bytes for LIs, 50 bytes for data + TESTASSERT(58 == rlc1.get_buffer_state()); // 2 bytes for fixed header, 6 bytes for LIs, 50 bytes for data // Read 5 PDUs from RLC1 (10 bytes each) byte_buffer_t pdu_bufs[NBUFS]; @@ -585,7 +585,7 @@ bool resegment_test_1() pdu_bufs[i].N_bytes = len; } - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDUs into RLC2 (skip SN 1) for (int i = 0; i < NBUFS; i++) { @@ -599,7 +599,7 @@ bool resegment_test_1() timers.step_all(); } - assert(4 == rlc2.get_buffer_state()); + TESTASSERT(4 == rlc2.get_buffer_state()); // Read status PDU from RLC2 byte_buffer_t status_buf; @@ -609,7 +609,7 @@ bool resegment_test_1() // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); - assert(12 == rlc1.get_buffer_state()); // 2 byte header + 10 data + TESTASSERT(12 == rlc1.get_buffer_state()); // 2 byte header + 10 data // Read the retx PDU from RLC1 and force resegmentation byte_buffer_t retx1; @@ -619,7 +619,7 @@ bool resegment_test_1() // Write the retx PDU to RLC2 rlc2.write_pdu(retx1.msg, retx1.N_bytes); - assert(9 == rlc1.get_buffer_state()); + TESTASSERT(9 == rlc1.get_buffer_state()); // Read the remaining segment byte_buffer_t retx2; @@ -629,7 +629,7 @@ bool resegment_test_1() // Write the retx PDU to RLC2 rlc2.write_pdu(retx2.msg, retx2.N_bytes); - assert(tester.n_sdus == 5); + TESTASSERT(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != 10) return -1; @@ -641,7 +641,7 @@ bool resegment_test_1() return 0; } -bool resegment_test_2() +int resegment_test_2() { // SDUs: | 10 | 10 | 10 | 10 | 10 | @@ -674,7 +674,7 @@ bool resegment_test_2() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(58 == rlc1.get_buffer_state()); + TESTASSERT(58 == rlc1.get_buffer_state()); // Read 5 PDUs from RLC1 (5 bytes, 10 bytes, 20 bytes, 10 bytes, 5 bytes) byte_buffer_t pdu_bufs[NBUFS]; @@ -684,7 +684,7 @@ bool resegment_test_2() pdu_bufs[3].N_bytes = rlc1.read_pdu(pdu_bufs[3].msg, 14); // 4 byte header + 10 byte payload pdu_bufs[4].N_bytes = rlc1.read_pdu(pdu_bufs[4].msg, 7); // 2 byte header + 5 byte payload - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDUs into RLC2 (skip SN 2) for (int i = 0; i < NBUFS; i++) { @@ -698,7 +698,7 @@ bool resegment_test_2() timers.step_all(); } - assert(4 == rlc2.get_buffer_state()); + TESTASSERT(4 == rlc2.get_buffer_state()); // Read status PDU from RLC2 byte_buffer_t status_buf; @@ -707,7 +707,7 @@ bool resegment_test_2() // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); - assert(25 == rlc1.get_buffer_state()); // 4 byte header + 20 data + TESTASSERT(25 == rlc1.get_buffer_state()); // 4 byte header + 20 data // Read the retx PDU from RLC1 and force resegmentation byte_buffer_t retx1; @@ -716,7 +716,7 @@ bool resegment_test_2() // Write the retx PDU to RLC2 rlc2.write_pdu(retx1.msg, retx1.N_bytes); - assert(18 == rlc1.get_buffer_state()); + TESTASSERT(18 == rlc1.get_buffer_state()); // Read the remaining segment byte_buffer_t retx2; @@ -725,7 +725,7 @@ bool resegment_test_2() // Write the retx PDU to RLC2 rlc2.write_pdu(retx2.msg, retx2.N_bytes); - assert(tester.n_sdus == 5); + TESTASSERT(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != 10) return -1; @@ -737,7 +737,7 @@ bool resegment_test_2() return 0; } -bool resegment_test_3() +int resegment_test_3() { // SDUs: | 10 | 10 | 10 | 10 | 10 | @@ -769,7 +769,7 @@ bool resegment_test_3() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(58 == rlc1.get_buffer_state()); + TESTASSERT(58 == rlc1.get_buffer_state()); // Read 5 PDUs from RLC1 (5 bytes, 5 bytes, 20 bytes, 10 bytes, 10 bytes) byte_buffer_t pdu_bufs[NBUFS]; @@ -779,7 +779,7 @@ bool resegment_test_3() pdu_bufs[3].N_bytes = rlc1.read_pdu(pdu_bufs[3].msg, 12); // 2 byte header + 10 byte payload pdu_bufs[4].N_bytes = rlc1.read_pdu(pdu_bufs[4].msg, 12); // 2 byte header + 10 byte payload - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDUs into RLC2 (skip SN 2) for (int i = 0; i < NBUFS; i++) { @@ -793,7 +793,7 @@ bool resegment_test_3() timers.step_all(); } - assert(4 == rlc2.get_buffer_state()); + TESTASSERT(4 == rlc2.get_buffer_state()); // Read status PDU from RLC2 byte_buffer_t status_buf; @@ -816,7 +816,7 @@ bool resegment_test_3() // Write the retx PDU to RLC2 rlc2.write_pdu(retx2.msg, retx2.N_bytes); - assert(tester.n_sdus == 5); + TESTASSERT(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != 10) return -1; @@ -828,7 +828,7 @@ bool resegment_test_3() return 0; } -bool resegment_test_4() +int resegment_test_4() { // SDUs: | 10 | 10 | 10 | 10 | 10 | // PDUs: | 5 | 5| 30 | 5 | 5| @@ -859,7 +859,7 @@ bool resegment_test_4() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(58 == rlc1.get_buffer_state()); + TESTASSERT(58 == rlc1.get_buffer_state()); // Read 5 PDUs from RLC1 (5 bytes, 5 bytes, 30 bytes, 5 bytes, 5 bytes) byte_buffer_t pdu_bufs[NBUFS]; @@ -869,7 +869,7 @@ bool resegment_test_4() pdu_bufs[3].N_bytes = rlc1.read_pdu(pdu_bufs[3].msg, 7); // 2 byte header + 5 byte payload pdu_bufs[4].N_bytes = rlc1.read_pdu(pdu_bufs[4].msg, 7); // 2 byte header + 5 byte payload - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDUs into RLC2 (skip SN 2) for (int i = 0; i < NBUFS; i++) { @@ -883,7 +883,7 @@ bool resegment_test_4() timers.step_all(); } - assert(4 == rlc2.get_buffer_state()); + TESTASSERT(4 == rlc2.get_buffer_state()); // Read status PDU from RLC2 byte_buffer_t status_buf; @@ -899,7 +899,7 @@ bool resegment_test_4() // Write the retx PDU to RLC2 rlc2.write_pdu(retx1.msg, retx1.N_bytes); - assert(23 == rlc1.get_buffer_state()); + TESTASSERT(23 == rlc1.get_buffer_state()); // Read the remaining segment byte_buffer_t retx2; @@ -908,7 +908,7 @@ bool resegment_test_4() // Write the retx PDU to RLC2 rlc2.write_pdu(retx2.msg, retx2.N_bytes); - assert(tester.n_sdus == 5); + TESTASSERT(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != 10) return -1; @@ -920,7 +920,7 @@ bool resegment_test_4() return 0; } -bool resegment_test_5() +int resegment_test_5() { // SDUs: | 10 | 10 | 10 | 10 | 10 | // PDUs: |2|3| 40 |3|2| @@ -951,7 +951,7 @@ bool resegment_test_5() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(58 == rlc1.get_buffer_state()); + TESTASSERT(58 == rlc1.get_buffer_state()); // Read 5 PDUs from RLC1 (2 bytes, 3 bytes, 40 bytes, 3 bytes, 2 bytes) byte_buffer_t pdu_bufs[NBUFS]; @@ -961,7 +961,7 @@ bool resegment_test_5() pdu_bufs[3].N_bytes = rlc1.read_pdu(pdu_bufs[3].msg, 5); // 2 byte header + 3 byte payload pdu_bufs[4].N_bytes = rlc1.read_pdu(pdu_bufs[4].msg, 4); // 2 byte header + 2 byte payload - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDUs into RLC2 (skip SN 2) for (int i = 0; i < NBUFS; i++) { @@ -975,7 +975,7 @@ bool resegment_test_5() timers.step_all(); } - assert(4 == rlc2.get_buffer_state()); + TESTASSERT(4 == rlc2.get_buffer_state()); // Read status PDU from RLC2 byte_buffer_t status_buf; @@ -991,7 +991,7 @@ bool resegment_test_5() // Write the retx PDU to RLC2 rlc2.write_pdu(retx1.msg, retx1.N_bytes); - assert(31 == rlc1.get_buffer_state()); + TESTASSERT(31 == rlc1.get_buffer_state()); // Read the remaining segment byte_buffer_t retx2; @@ -1000,7 +1000,7 @@ bool resegment_test_5() // Write the retx PDU to RLC2 rlc2.write_pdu(retx2.msg, retx2.N_bytes); - assert(tester.n_sdus == 5); + TESTASSERT(tester.n_sdus == 5); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != 10) return -1; @@ -1012,7 +1012,7 @@ bool resegment_test_5() return 0; } -bool resegment_test_6() +int resegment_test_6() { // SDUs: |10|10|10| 54 | 54 | 54 | 54 | 54 | 54 | // PDUs: |10|10|10| 270 | 54 | @@ -1051,7 +1051,7 @@ bool resegment_test_6() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(368 == rlc1.get_buffer_state()); + TESTASSERT(368 == rlc1.get_buffer_state()); // Read PDUs from RLC1 (10, 10, 10, 270, 54) byte_buffer_t pdu_bufs[5]; @@ -1064,7 +1064,7 @@ bool resegment_test_6() len = rlc1.read_pdu(pdu_bufs[4].msg, 56); pdu_bufs[4].N_bytes = len; - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Write PDUs into RLC2 (skip SN 3) for (int i = 0; i < 5; i++) { @@ -1078,7 +1078,7 @@ bool resegment_test_6() timers.step_all(); } - assert(4 == rlc2.get_buffer_state()); + TESTASSERT(4 == rlc2.get_buffer_state()); // Read status PDU from RLC2 byte_buffer_t status_buf; @@ -1088,7 +1088,7 @@ bool resegment_test_6() // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); - assert(278 == rlc1.get_buffer_state()); + TESTASSERT(278 == rlc1.get_buffer_state()); // Read the retx PDU from RLC1 and force resegmentation byte_buffer_t retx1; @@ -1098,7 +1098,7 @@ bool resegment_test_6() // Write the retx PDU to RLC2 rlc2.write_pdu(retx1.msg, retx1.N_bytes); - assert(159 == rlc1.get_buffer_state()); + TESTASSERT(159 == rlc1.get_buffer_state()); // Read the remaining segment byte_buffer_t retx2; @@ -1108,11 +1108,11 @@ bool resegment_test_6() // Write the retx PDU to RLC2 rlc2.write_pdu(retx2.msg, retx2.N_bytes); - assert(tester.n_sdus == 9); + TESTASSERT(tester.n_sdus == 9); for (int i = 0; i < 3; i++) { - assert(tester.sdus[i]->N_bytes == 10); + TESTASSERT(tester.sdus[i]->N_bytes == 10); for (int j = 0; j < 10; j++) - assert(tester.sdus[i]->msg[j] == j); + TESTASSERT(tester.sdus[i]->msg[j] == j); } for (int i = 3; i < 9; i++) { if (i >= tester.n_sdus) @@ -1129,7 +1129,7 @@ bool resegment_test_6() } // Retransmission of PDU segments of the same size -bool resegment_test_7() +int resegment_test_7() { // SDUs: | 30 | 30 | // PDUs: | 13 | 13 | 11 | 13 | 10 | @@ -1172,13 +1172,13 @@ bool resegment_test_7() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(64 == rlc1.get_buffer_state()); + TESTASSERT(64 == rlc1.get_buffer_state()); // Read PDUs from RLC1 (15 bytes each) byte_buffer_t pdu_bufs[N_PDU_BUFS]; for (uint32_t i = 0; i < N_PDU_BUFS; i++) { pdu_bufs[i].N_bytes = rlc1.read_pdu(pdu_bufs[i].msg, 15); // 2 bytes for header + 12 B payload - assert(pdu_bufs[i].N_bytes); + TESTASSERT(pdu_bufs[i].N_bytes); } // Step timers until poll_retx timeout expires @@ -1188,7 +1188,7 @@ bool resegment_test_7() } // RLC should try to retx a random PDU because it needs to request a status from the receiver - assert(0 != rlc1.get_buffer_state()); + TESTASSERT(0 != rlc1.get_buffer_state()); // Skip PDU with SN 2 for (uint32_t i = 0; i < N_PDU_BUFS; i++) { @@ -1207,14 +1207,14 @@ bool resegment_test_7() } // RLC should try to retransmit a random PDU because it needs to re-request a status PDU from the receiver - assert(0 != rlc1.get_buffer_state()); + TESTASSERT(0 != rlc1.get_buffer_state()); // first round of retx, forcing resegmentation byte_buffer_t retx[4]; for (uint32_t i = 0; i < 4; i++) { - assert(0 != rlc1.get_buffer_state()); + TESTASSERT(0 != rlc1.get_buffer_state()); retx[i].N_bytes = rlc1.read_pdu(retx[i].msg, 7); - assert(retx[i].N_bytes); + TESTASSERT(retx[i].N_bytes); // Write the last two segments to RLC2 if (i > 1) { @@ -1226,7 +1226,7 @@ bool resegment_test_7() } // Read status PDU from RLC2 - assert(rlc2.get_buffer_state()); + TESTASSERT(rlc2.get_buffer_state()); byte_buffer_t status_buf; status_buf.N_bytes = rlc2.read_pdu(status_buf.msg, 10); // 10 bytes is enough to hold the status @@ -1236,14 +1236,14 @@ bool resegment_test_7() pcap.write_ul_am_ccch(status_buf.msg, status_buf.N_bytes); #endif - assert(15 == rlc1.get_buffer_state()); + TESTASSERT(15 == rlc1.get_buffer_state()); // second round of retx, forcing resegmentation byte_buffer_t retx2[4]; for (uint32_t i = 0; i < 4; i++) { - assert(rlc1.get_buffer_state() != 0); + TESTASSERT(rlc1.get_buffer_state() != 0); retx2[i].N_bytes = rlc1.read_pdu(retx2[i].msg, 9); - assert(retx2[i].N_bytes != 0); + TESTASSERT(retx2[i].N_bytes != 0); rlc2.write_pdu(retx2[i].msg, retx2[i].N_bytes); #if HAVE_PCAP @@ -1252,7 +1252,7 @@ bool resegment_test_7() } // check buffer states - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Step timers until poll_retx timeout expires cnt = 5; @@ -1261,7 +1261,7 @@ bool resegment_test_7() } // Read status PDU from RLC2 - assert(rlc2.get_buffer_state()); + TESTASSERT(rlc2.get_buffer_state()); status_buf.N_bytes = rlc2.read_pdu(status_buf.msg, 10); // 10 bytes is enough to hold the status // Write status PDU to RLC1 @@ -1271,11 +1271,11 @@ bool resegment_test_7() #endif // check status again - assert(0 == rlc1.get_buffer_state()); - assert(0 == rlc2.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc2.get_buffer_state()); // Check number of SDUs and their content - assert(tester.n_sdus == N_SDU_BUFS); + TESTASSERT(tester.n_sdus == N_SDU_BUFS); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != sdu_size) return -1; @@ -1293,7 +1293,7 @@ bool resegment_test_7() } // Retransmission of PDU segments with different size -bool resegment_test_8() +int resegment_test_8() { // SDUs: | 30 | 30 | // PDUs: | 15 | 15 | 15 | 15 | 15 | @@ -1336,16 +1336,16 @@ bool resegment_test_8() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(64 == rlc1.get_buffer_state()); + TESTASSERT(64 == rlc1.get_buffer_state()); // Read PDUs from RLC1 (15 bytes each) byte_buffer_t pdu_bufs[N_PDU_BUFS]; for (uint32_t i = 0; i < N_PDU_BUFS; i++) { pdu_bufs[i].N_bytes = rlc1.read_pdu(pdu_bufs[i].msg, 15); // 12 bytes for header + payload - assert(pdu_bufs[i].N_bytes); + TESTASSERT(pdu_bufs[i].N_bytes); } - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Skip PDU one and two for (uint32_t i = 0; i < N_PDU_BUFS; i++) { @@ -1364,14 +1364,14 @@ bool resegment_test_8() } // what PDU to retransmit is random but it must not be zero - assert(0 != rlc1.get_buffer_state()); + TESTASSERT(0 != rlc1.get_buffer_state()); // first round of retx, forcing resegmentation byte_buffer_t retx[4]; for (uint32_t i = 0; i < 3; i++) { - assert(rlc1.get_buffer_state()); + TESTASSERT(rlc1.get_buffer_state()); retx[i].N_bytes = rlc1.read_pdu(retx[i].msg, 8); - assert(retx[i].N_bytes); + TESTASSERT(retx[i].N_bytes); // Write the last two segments to RLC2 if (i > 1) { @@ -1389,7 +1389,7 @@ bool resegment_test_8() } // Read status PDU from RLC2 - assert(rlc2.get_buffer_state()); + TESTASSERT(rlc2.get_buffer_state()); byte_buffer_t status_buf; status_buf.N_bytes = rlc2.read_pdu(status_buf.msg, 10); // 10 bytes is enough to hold the status @@ -1399,14 +1399,14 @@ bool resegment_test_8() pcap.write_ul_am_ccch(status_buf.msg, status_buf.N_bytes); #endif - assert(15 == rlc1.get_buffer_state()); + TESTASSERT(15 == rlc1.get_buffer_state()); // second round of retx, reduce grant size to force different segment sizes byte_buffer_t retx2[20]; for (uint32_t i = 0; i < 7; i++) { - assert(rlc1.get_buffer_state() != 0); + TESTASSERT(rlc1.get_buffer_state() != 0); retx2[i].N_bytes = rlc1.read_pdu(retx2[i].msg, 9); - assert(retx2[i].N_bytes != 0); + TESTASSERT(retx2[i].N_bytes != 0); rlc2.write_pdu(retx2[i].msg, retx2[i].N_bytes); #if HAVE_PCAP pcap.write_dl_am_ccch(retx[i].msg, retx[i].N_bytes); @@ -1431,7 +1431,7 @@ bool resegment_test_8() }; // Check number of SDUs and their content - assert(tester.n_sdus == N_SDU_BUFS); + TESTASSERT(tester.n_sdus == N_SDU_BUFS); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != sdu_size) return -1; @@ -1585,7 +1585,7 @@ bool status_pdu_test() rlc1.write_sdu(std::move(sdu_bufs[i])); } - assert(13 == rlc1.get_buffer_state()); + TESTASSERT(13 == rlc1.get_buffer_state()); // Read 5 PDUs from RLC1 (1 byte each) byte_buffer_t pdu_bufs[NBUFS]; @@ -1594,7 +1594,7 @@ bool status_pdu_test() pdu_bufs[i].N_bytes = len; } - assert(0 == rlc1.get_buffer_state()); + TESTASSERT(0 == rlc1.get_buffer_state()); // Only pass last PDUs to RLC2 for (int i = 0; i < NBUFS; i++) { @@ -1610,14 +1610,14 @@ bool status_pdu_test() } uint32_t buffer_state = rlc2.get_buffer_state(); - assert(8 == buffer_state); + TESTASSERT(8 == buffer_state); // Read status PDU from RLC2 byte_buffer_t status_buf; len = rlc2.read_pdu(status_buf.msg, 5); // provide only small grant status_buf.N_bytes = len; - assert(status_buf.N_bytes != 0); + TESTASSERT(status_buf.N_bytes != 0); // check status PDU doesn't contain ACK_SN in NACK list rlc_status_pdu_t status_pdu = {}; @@ -1629,7 +1629,7 @@ bool status_pdu_test() // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); - assert(3 == rlc1.get_buffer_state()); // 2 byte header + 1 byte payload + TESTASSERT(3 == rlc1.get_buffer_state()); // 2 byte header + 1 byte payload // Read the retx PDU from RLC1 byte_buffer_t retx; @@ -1649,7 +1649,7 @@ bool status_pdu_test() status_buf.clear(); len = rlc2.read_pdu(status_buf.msg, 10); // big enough grant to fit full status PDU status_buf.N_bytes = len; - assert(status_buf.N_bytes != 0); + TESTASSERT(status_buf.N_bytes != 0); // Write status PDU to RLC1 rlc1.write_pdu(status_buf.msg, status_buf.N_bytes); @@ -1664,7 +1664,7 @@ bool status_pdu_test() rlc2.write_pdu(retx.msg, retx.N_bytes); } - assert(tester.n_sdus == NBUFS); + TESTASSERT(tester.n_sdus == NBUFS); for (int i = 0; i < tester.n_sdus; i++) { if (tester.sdus[i]->N_bytes != 1) return -1; diff --git a/lib/test/upper/rlc_stress_test.cc b/lib/test/upper/rlc_stress_test.cc index 93ff18bdd..324f126f8 100644 --- a/lib/test/upper/rlc_stress_test.cc +++ b/lib/test/upper/rlc_stress_test.cc @@ -13,6 +13,7 @@ #include "srslte/common/crash_handler.h" #include "srslte/common/log_filter.h" #include "srslte/common/rlc_pcap.h" +#include "srslte/common/test_common.h" #include "srslte/common/threads.h" #include "srslte/upper/rlc.h" #include diff --git a/lib/test/upper/rlc_um_data_test.cc b/lib/test/upper/rlc_um_data_test.cc index 0ab4fc965..03d9f0462 100644 --- a/lib/test/upper/rlc_um_data_test.cc +++ b/lib/test/upper/rlc_um_data_test.cc @@ -10,8 +10,8 @@ * */ +#include "srslte/common/test_common.h" #include "srslte/upper/rlc_um_lte.h" -#include #include // Fixed header only @@ -30,13 +30,13 @@ int main(int argc, char** argv) memcpy(b1.msg, &pdu1[0], PDU1_LEN); b1.N_bytes = PDU1_LEN; rlc_um_read_data_pdu_header(&b1, srslte::rlc_umd_sn_size_t::size10bits, &h); - assert(0x03 == h.fi); - assert(0 == h.N_li); - assert(226 == h.sn); + TESTASSERT(0x03 == h.fi); + TESTASSERT(0 == h.N_li); + TESTASSERT(226 == h.sn); rlc_um_write_data_pdu_header(&h, &b2); - assert(b2.N_bytes == PDU1_LEN); + TESTASSERT(b2.N_bytes == PDU1_LEN); for (uint32_t i = 0; i < b2.N_bytes; i++) - assert(b2.msg[i] == b1.msg[i]); + TESTASSERT(b2.msg[i] == b1.msg[i]); b1.clear(); b2.clear(); @@ -45,12 +45,12 @@ int main(int argc, char** argv) memcpy(b1.msg, &pdu2[0], PDU2_LEN); b1.N_bytes = PDU2_LEN; rlc_um_read_data_pdu_header(&b1, srslte::rlc_umd_sn_size_t::size10bits, &h); - assert(0x03 == h.fi); - assert(225 == h.sn); - assert(1 == h.N_li); - assert(104 == h.li[0]); + TESTASSERT(0x03 == h.fi); + TESTASSERT(225 == h.sn); + TESTASSERT(1 == h.N_li); + TESTASSERT(104 == h.li[0]); rlc_um_write_data_pdu_header(&h, &b2); - assert(b2.N_bytes == PDU2_LEN); + TESTASSERT(b2.N_bytes == PDU2_LEN); for (uint32_t i = 0; i < b2.N_bytes; i++) - assert(b2.msg[i] == b1.msg[i]); + TESTASSERT(b2.msg[i] == b1.msg[i]); } diff --git a/srsue/test/mac_test.cc b/srsue/test/mac_test.cc index 30823a5a1..9a737a941 100644 --- a/srsue/test/mac_test.cc +++ b/srsue/test/mac_test.cc @@ -19,7 +19,6 @@ #include "srslte/test/ue_test_interfaces.h" #include "srsue/hdr/stack/mac/mac.h" #include "srsue/hdr/stack/mac/mux.h" -#include #include #include diff --git a/srsue/test/ttcn3/test/CMakeLists.txt b/srsue/test/ttcn3/test/CMakeLists.txt index cc908b42d..f4dea0dc2 100644 --- a/srsue/test/ttcn3/test/CMakeLists.txt +++ b/srsue/test/ttcn3/test/CMakeLists.txt @@ -9,6 +9,7 @@ include_directories(${PROJECT_SOURCE_DIR}/srsue/test/ttcn3/hdr) add_executable(rapidjson_test rapidjson_test.cc) +target_link_libraries(rapidjson_test srslte_common) add_test(rapidjson_test rapidjson_test) add_executable(ttcn3_if_handler_test ttcn3_if_handler_test.cc) diff --git a/srsue/test/ttcn3/test/rapidjson_test.cc b/srsue/test/ttcn3/test/rapidjson_test.cc index 2a5eafb41..f3ed4bbcd 100644 --- a/srsue/test/ttcn3/test/rapidjson_test.cc +++ b/srsue/test/ttcn3/test/rapidjson_test.cc @@ -10,8 +10,8 @@ * */ +#include "srslte/common/test_common.h" #include "ttcn3_helpers.h" -#include #include #include #include @@ -64,20 +64,21 @@ int SYSTEM_CTRL_CNF_test() return 0; } -void pretty_print(std::string json) +int pretty_print(std::string json) { Document document; if (document.Parse((char*)json.c_str()).HasParseError()) { fprintf(stderr, "Error parsing incoming data. Exiting\n"); exit(-1); } - assert(document.IsObject()); + TESTASSERT(document.IsObject() == true); // Pretty-print StringBuffer buffer; PrettyWriter writer(buffer); document.Accept(writer); printf("%s\n", (char*)buffer.GetString()); + return SRSLTE_SUCCESS; } // UDP v4 test diff --git a/srsue/test/upper/nas_test.cc b/srsue/test/upper/nas_test.cc index 4ffa9b8af..9831d32cd 100644 --- a/srsue/test/upper/nas_test.cc +++ b/srsue/test/upper/nas_test.cc @@ -14,6 +14,7 @@ #include "srslte/common/log_filter.h" #include "srslte/common/logger_srslog_wrapper.h" #include "srslte/common/logmap.h" +#include "srslte/common/test_common.h" #include "srslte/interfaces/ue_interfaces.h" #include "srslte/srslog/srslog.h" #include "srslte/test/ue_test_interfaces.h" @@ -26,7 +27,6 @@ #include "srsue/hdr/stack/upper/nas.h" #include "srsue/hdr/stack/upper/usim.h" #include "srsue/hdr/stack/upper/usim_base.h" -#include #include using namespace srsue; @@ -34,14 +34,6 @@ using namespace asn1::rrc; #define LCID 1 -#define TESTASSERT(cond) \ - { \ - if (!(cond)) { \ - std::cout << "[" << __FUNCTION__ << "][Line " << __LINE__ << "]: FAIL at " << (#cond) << std::endl; \ - return -1; \ - } \ - } - uint8_t auth_request_pdu[] = {0x07, 0x52, 0x01, 0x0c, 0x63, 0xa8, 0x54, 0x13, 0xe6, 0xa4, 0xce, 0xd9, 0x86, 0xfb, 0xe5, 0xce, 0x9b, 0x62, 0x5e, 0x10, 0x67, 0x57, 0xb3, 0xc2, 0xb9, 0x70, 0x90, 0x01, 0x0c, 0x72, 0x8a, 0x67, 0x57, 0x92, 0x52, 0xb8}; diff --git a/srsue/test/upper/usim_test.cc b/srsue/test/upper/usim_test.cc index 0c8c7d912..4c0a23ebe 100644 --- a/srsue/test/upper/usim_test.cc +++ b/srsue/test/upper/usim_test.cc @@ -11,8 +11,8 @@ */ #include "srslte/common/log_filter.h" +#include "srslte/common/test_common.h" #include "srsue/hdr/stack/upper/usim.h" -#include #include using namespace srsue; @@ -69,5 +69,5 @@ int main(int argc, char** argv) srsue::usim usim(&usim_log); usim.init(&args); - assert(usim.generate_authentication_response(rand_enb, autn_enb, mcc, mnc, res, &res_len, k_asme) == AUTH_OK); + TESTASSERT(usim.generate_authentication_response(rand_enb, autn_enb, mcc, mnc, res, &res_len, k_asme) == AUTH_OK); } From 145528ad3268186fe2cbb1ca3555b1cf1c5cc851 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Tue, 12 Jan 2021 14:33:56 +0100 Subject: [PATCH 120/138] Added unpacking test for RRC reconfig --- lib/test/asn1/rrc_nr_test.cc | 76 ++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/lib/test/asn1/rrc_nr_test.cc b/lib/test/asn1/rrc_nr_test.cc index c29559905..185474f1f 100644 --- a/lib/test/asn1/rrc_nr_test.cc +++ b/lib/test/asn1/rrc_nr_test.cc @@ -142,12 +142,88 @@ int test_ue_mrdc_capabilities() return SRSLTE_SUCCESS; } +int test_ue_rrc_reconfiguration() +{ + uint8_t rrc_msg[] = "\x08\x81\x7c\x5c\x40\xb1\xc0\x7d\x48\x3a\x04\xc0\x3e\x01\x04\x54" + "\x1e\xb5\x00\x02\xe8\x53\x98\xdf\x46\x93\x4b\x80\x04\xd2\x69\x34" + "\x00\x00\x08\xc9\x8d\x6d\x8c\xa2\x01\xff\x00\x00\x00\x00\x01\x1b" + "\x82\x21\x00\x00\x04\x04\x00\xd1\x14\x0e\x70\x00\x00\x08\xc9\xc6" + "\xb6\xc6\x44\xa0\x00\x1e\xb8\x95\x63\xe0\x24\x94\x22\x0d\xb8\x44" + "\x70\x0c\x02\x10\xb0\x1d\x80\x48\xf1\x18\x06\xea\x00\x08\x0e\x01" + "\x25\xc0\xc8\x80\x37\x08\x42\x00\x00\x88\x16\x50\x02\x0c\x82\x00" + "\x00\x20\x69\x81\x01\x45\x0a\x00\x0e\x48\x18\x00\x01\x33\x55\x64" + "\x84\x1c\x00\x10\x40\xc2\x05\x0c\x1c\x9c\x40\x91\x42\xc6\x0d\x1c" + "\x3c\x8e\x00\x00\x32\x21\x40\x30\x20\x01\x91\x4a\x01\x82\x00\x0c" + "\x8c\x50\x0c\x18\x00\x64\x42\x80\xe1\x00\x03\x22\x94\x07\x0a\x00" + "\x19\x18\xa0\x38\x60\x00\xc8\x85\x02\xc3\x80\x06\x45\x28\x16\x20" + "\x64\x00\x41\x6c\x48\x04\x62\x82\x18\xa0\x08\xc5\x04\xb1\x60\x11" + "\x8a\x0a\x63\x00\x23\x14\x16\xc6\x80\x46\x28\x31\x8e\x00\x8c\x50" + "\x6b\x1e\x01\x18\xa0\xe6\x40\x00\x32\x31\x40\xb2\x23\x10\x0a\x08" + "\x40\x90\x86\x05\x10\x43\xcc\x3b\x2a\x6e\x4d\x01\xa4\x92\x1e\x2e" + "\xe0\x0c\x10\xe0\x00\x00\x01\x8f\xfd\x29\x49\x8c\x63\x72\x81\x60" + "\x00\x02\x19\x70\x00\x00\x00\x00\x00\x00\x52\xf0\x0f\xa0\x84\x8a" + "\xd5\x45\x00\x47\x00\x18\x00\x08\x20\x00\xe2\x10\x02\x40\x80\x70" + "\x10\x10\x84\x00\x0e\x21\x00\x1c\xb0\x0e\x04\x02\x20\x80\x01\xc4" + "\x20\x03\x96\x01\xc0\xc0\x42\x10\x00\x38\x84\x00\x73\x00\x38\x20" + "\x08\x82\x00\x07\x10\x80\x0e\x60\x00\x40\x00\x00\x04\x10\xc0\x40" + "\x80\xc1\x00\xe0\xd0\x00\x0e\x48\x10\x00\x00\x02\x00\x40\x00\x80" + "\x60\x00\x80\x90\x02\x20\x0a\x40\x00\x02\x38\x90\x11\x31\xc8"; + + uint32_t rrc_msg_len = sizeof(rrc_msg); + cbit_ref bref(&rrc_msg[0], sizeof(rrc_msg)); + rrc_recfg_s rrc_recfg; + + TESTASSERT(rrc_recfg.unpack(bref) == SRSASN_SUCCESS); + TESTASSERT(rrc_recfg.rrc_transaction_id == 0); + json_writer jw; + rrc_recfg.to_json(jw); + srslte::logmap::get("RRC")->info_long("RRC Reconfig: \n %s \n", jw.to_string().c_str()); + + TESTASSERT(rrc_recfg.crit_exts.type() == asn1::rrc_nr::rrc_recfg_s::crit_exts_c_::types::rrc_recfg); + TESTASSERT(rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group_present == true); + + cell_group_cfg_s cell_group_cfg; + cbit_ref bref0(rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group.data(), + rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group.size()); + TESTASSERT(cell_group_cfg.unpack(bref0) == SRSASN_SUCCESS); + json_writer jw1; + cell_group_cfg.to_json(jw1); + srslte::logmap::get("RRC")->info_long("RRC Secondary Cell Group: \n %s \n", jw1.to_string().c_str()); + TESTASSERT(cell_group_cfg.cell_group_id == 1); + TESTASSERT(cell_group_cfg.rlc_bearer_to_add_mod_list_present == true); + TESTASSERT(cell_group_cfg.rlc_bearer_to_add_mod_list.size() == 1); + TESTASSERT(cell_group_cfg.mac_cell_group_cfg_present == true); + TESTASSERT(cell_group_cfg.phys_cell_group_cfg_present == true); + TESTASSERT(cell_group_cfg.sp_cell_cfg_present == true); + return SRSLTE_SUCCESS; +} + +int test_radio_bearer_config() +{ + uint8_t rrc_msg[] = "\x14\x09\x28\x17\x87\xc0\x0c\x28"; + uint32_t rrc_msg_len = sizeof(rrc_msg); + cbit_ref bref(&rrc_msg[0], sizeof(rrc_msg)); + radio_bearer_cfg_s radio_bearer_cfg; + TESTASSERT(radio_bearer_cfg.unpack(bref) == SRSASN_SUCCESS); + json_writer jw; + radio_bearer_cfg.to_json(jw); + srslte::logmap::get("RRC")->info_long("RRC Bearer CFG Message: \n %s \n", jw.to_string().c_str()); + TESTASSERT(radio_bearer_cfg.drb_to_add_mod_list_present == true); + TESTASSERT(radio_bearer_cfg.drb_to_add_mod_list.size() == 1); + TESTASSERT(radio_bearer_cfg.security_cfg_present == true); + TESTASSERT(radio_bearer_cfg.security_cfg.security_algorithm_cfg_present == true); + TESTASSERT(radio_bearer_cfg.security_cfg.key_to_use_present == true); + return SRSLTE_SUCCESS; +} + int main() { srslte::logmap::set_default_log_level(srslte::LOG_LEVEL_DEBUG); TESTASSERT(test_eutra_nr_capabilities() == 0); TESTASSERT(test_ue_mrdc_capabilities() == 0); + TESTASSERT(test_ue_rrc_reconfiguration() == 0); + TESTASSERT(test_radio_bearer_config() == 0); printf("Success\n"); return 0; From 64299960bd15933d795105b512247b823e6179f3 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 25 Jan 2021 14:27:02 +0100 Subject: [PATCH 121/138] Added procedure for NR reconfiguration and RRC with NR complete --- lib/include/srslte/interfaces/ue_interfaces.h | 17 +- srsue/hdr/stack/rrc/rrc.h | 7 +- srsue/hdr/stack/rrc/rrc_nr.h | 43 ++++- srsue/hdr/stack/rrc/rrc_procedures.h | 1 + srsue/src/stack/rrc/rrc.cc | 84 ++++++++- srsue/src/stack/rrc/rrc_meas.cc | 3 + srsue/src/stack/rrc/rrc_nr.cc | 160 +++++++++++++++++- srsue/src/stack/rrc/rrc_procedures.cc | 33 +++- srsue/test/upper/rrc_meas_test.cc | 12 ++ 9 files changed, 346 insertions(+), 14 deletions(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index d7253d98a..64e4a7367 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -26,6 +26,7 @@ #include "pdcp_interface_types.h" #include "rlc_interface_types.h" #include "rrc_interface_types.h" +#include "srslte/asn1/asn1_utils.h" #include "srslte/asn1/liblte_mme.h" #include "srslte/common/common.h" #include "srslte/common/interfaces_common.h" @@ -155,6 +156,7 @@ class rrc_eutra_interface_rrc_nr { public: virtual void new_cell_meas_nr(const std::vector& meas) = 0; + virtual void nr_rrc_con_reconfig_complete(bool status) = 0; }; // RRC interface for PHY @@ -264,9 +266,18 @@ public: class rrc_nr_interface_rrc { public: - virtual void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps) = 0; - virtual void get_nr_capabilities(srslte::byte_buffer_t* nr_cap) = 0; - virtual void phy_set_cells_to_meas(uint32_t carrier_freq_r15) = 0; + virtual void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps) = 0; + virtual void get_nr_capabilities(srslte::byte_buffer_t* nr_cap) = 0; + virtual void phy_set_cells_to_meas(uint32_t carrier_freq_r15) = 0; + virtual void phy_meas_stop() = 0; + virtual bool rrc_reconfiguration(bool endc_release_and_add_r15, + bool nr_secondary_cell_group_cfg_r15_present, + asn1::dyn_octstring nr_secondary_cell_group_cfg_r15, + bool sk_counter_r15_present, + uint32_t sk_counter_r15, + bool nr_radio_bearer_cfg1_r15_present, + asn1::dyn_octstring nr_radio_bearer_cfg1_r15) = 0; + virtual bool is_config_pending() = 0; }; // PDCP interface for RLC diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 74d71d6d1..6ffc65ddb 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -118,6 +118,7 @@ public: // NR interface #ifdef HAVE_5GNR void new_cell_meas_nr(const std::vector& meas); + void nr_rrc_con_reconfig_complete(bool status); #endif // PHY interface @@ -358,7 +359,7 @@ private: void send_con_setup_complete(srslte::unique_byte_buffer_t nas_msg); void send_ul_info_transfer(srslte::unique_byte_buffer_t nas_msg); void send_security_mode_complete(); - void send_rrc_con_reconfig_complete(); + void send_rrc_con_reconfig_complete(bool contains_nr_complete = false); // Parsers void process_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu); @@ -416,6 +417,10 @@ private: void set_mac_default(); void set_rrc_default(); +#ifdef HAVE_5GNR + bool nr_reconfiguration_proc(const asn1::rrc::rrc_conn_recfg_r8_ies_s& rx_recfg); +#endif + // Helpers for nr communicaiton asn1::rrc::ue_cap_rat_container_s get_eutra_nr_capabilities(); asn1::rrc::ue_cap_rat_container_s get_nr_capabilities(); diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index ea7a72573..69724177c 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -74,7 +74,12 @@ public: const srslte::byte_buffer_t* pdu, const T& msg, const std::string& msg_type); - + template + void log_rrc_message(const std::string& source, + direction_t dir, + asn1::dyn_octstring oct, + const T& msg, + const std::string& msg_type); // PHY interface void in_sync() final; void out_of_sync() final; @@ -95,8 +100,16 @@ public: // RRC (LTE) interface void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps); void get_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps); + void phy_meas_stop(); void phy_set_cells_to_meas(uint32_t carrier_freq_r15); - + bool rrc_reconfiguration(bool endc_release_and_add_r15, + bool nr_secondary_cell_group_cfg_r15_present, + asn1::dyn_octstring nr_secondary_cell_group_cfg_r15, + bool sk_counter_r15_present, + uint32_t sk_counter_r15, + bool nr_radio_bearer_cfg1_r15_present, + asn1::dyn_octstring nr_radio_bearer_cfg1_r15); + bool is_config_pending(); // STACK interface void cell_search_completed(const rrc_interface_phy_lte::cell_search_ret_t& cs_ret, const phy_cell_t& found_cell); @@ -140,6 +153,32 @@ private: srslte::timer_handler* timers = nullptr; std::string get_rb_name(uint32_t lcid) final { return srslte::to_string((srslte::rb_id_nr_t)lcid); } + + class connection_reconf_no_ho_proc + { + public: + explicit connection_reconf_no_ho_proc(rrc_nr* parent_); + srslte::proc_outcome_t init(const bool endc_release_and_add_r15, + const asn1::rrc_nr::rrc_recfg_s& rrc_recfg, + const asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg, + const uint32_t sk_counter_r15, + const asn1::rrc_nr::radio_bearer_cfg_s& radio_bearer_cfg); + srslte::proc_outcome_t step() { return srslte::proc_outcome_t::yield; } + static const char* name() { return "NR Connection Reconfiguration"; } + srslte::proc_outcome_t react(const bool& config_complete); + void then(const srslte::proc_state_t& result); + + private: + // const + rrc_nr* rrc_ptr; + + asn1::rrc_nr::rrc_recfg_s rrc_recfg; + asn1::rrc_nr::cell_group_cfg_s cell_group_cfg; + }; + + srslte::proc_t conn_recfg_proc; + + srslte::proc_manager_list_t callback_list; }; } // namespace srsue diff --git a/srsue/hdr/stack/rrc/rrc_procedures.h b/srsue/hdr/stack/rrc/rrc_procedures.h index d23bd66f7..014635115 100644 --- a/srsue/hdr/stack/rrc/rrc_procedures.h +++ b/srsue/hdr/stack/rrc/rrc_procedures.h @@ -206,6 +206,7 @@ private: // const rrc* rrc_ptr; // args + bool has_5g_nr_reconfig = false; asn1::rrc::rrc_conn_recfg_r8_ies_s rx_recfg; }; diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 0e32cfb47..18391d58e 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -421,6 +421,13 @@ void rrc::process_new_cell_meas_nr(const std::vector& meas) bool neighbour_added = meas_cells_nr.process_new_cell_meas(meas_lte, filter); } + +void rrc::nr_rrc_con_reconfig_complete(bool status) +{ + if (conn_recfg_proc.is_busy()) { + conn_recfg_proc.trigger(status); + } +} #endif /* This function is called from a PHY worker thus must return very quickly. @@ -752,6 +759,62 @@ void rrc::timer_expired(uint32_t timeout_id) } } +#ifdef HAVE_5GNR +bool rrc::nr_reconfiguration_proc(const rrc_conn_recfg_r8_ies_s& rx_recfg) +{ + if (!(rx_recfg.non_crit_ext_present && rx_recfg.non_crit_ext.non_crit_ext_present && + rx_recfg.non_crit_ext.non_crit_ext.non_crit_ext_present && + rx_recfg.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present && + rx_recfg.non_crit_ext.non_crit_ext.non_crit_ext_present && + rx_recfg.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present && + rx_recfg.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present && + rx_recfg.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present && + rx_recfg.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext + .non_crit_ext_present)) { + return true; + } + + const asn1::rrc::rrc_conn_recfg_v1510_ies_s* rrc_conn_recfg_v1510_ies = + &rx_recfg.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext; + + if (!rrc_conn_recfg_v1510_ies->nr_cfg_r15_present) { + return true; + } + + bool endc_release_and_add_r15 = false; + bool nr_secondary_cell_group_cfg_r15_present = false; + asn1::dyn_octstring nr_secondary_cell_group_cfg_r15; + bool sk_counter_r15_present = false; + uint32_t sk_counter_r15 = 0; + bool nr_radio_bearer_cfg1_r15_present = false; + asn1::dyn_octstring nr_radio_bearer_cfg1_r15; + + endc_release_and_add_r15 = rrc_conn_recfg_v1510_ies->nr_cfg_r15.setup().endc_release_and_add_r15; + + if (rrc_conn_recfg_v1510_ies->nr_cfg_r15.setup().nr_secondary_cell_group_cfg_r15_present == true) { + nr_secondary_cell_group_cfg_r15_present = true; + nr_secondary_cell_group_cfg_r15 = rrc_conn_recfg_v1510_ies->nr_cfg_r15.setup().nr_secondary_cell_group_cfg_r15; + } + + if (rrc_conn_recfg_v1510_ies->sk_counter_r15_present) { + sk_counter_r15_present = true; + sk_counter_r15 = rrc_conn_recfg_v1510_ies->sk_counter_r15; + } + + if (rrc_conn_recfg_v1510_ies->nr_radio_bearer_cfg1_r15_present) { + nr_radio_bearer_cfg1_r15_present = true; + nr_radio_bearer_cfg1_r15 = rrc_conn_recfg_v1510_ies->nr_radio_bearer_cfg1_r15; + } + + return rrc_nr->rrc_reconfiguration(endc_release_and_add_r15, + nr_secondary_cell_group_cfg_r15_present, + nr_secondary_cell_group_cfg_r15, + sk_counter_r15_present, + sk_counter_r15, + nr_radio_bearer_cfg1_r15_present, + nr_radio_bearer_cfg1_r15); +} +#endif /******************************************************************************* * * @@ -934,14 +997,31 @@ void rrc::send_security_mode_complete() send_ul_dcch_msg(RB_ID_SRB1, ul_dcch_msg); } -void rrc::send_rrc_con_reconfig_complete() +void rrc::send_rrc_con_reconfig_complete(bool contains_nr_complete) { rrc_log->debug("Preparing RRC Connection Reconfig Complete\n"); ul_dcch_msg_s ul_dcch_msg; - ul_dcch_msg.msg.set_c1().set_rrc_conn_recfg_complete().crit_exts.set_rrc_conn_recfg_complete_r8(); ul_dcch_msg.msg.c1().rrc_conn_recfg_complete().rrc_transaction_id = transaction_id; + rrc_conn_recfg_complete_r8_ies_s* rrc_conn_recfg_complete_r8 = + &ul_dcch_msg.msg.set_c1().set_rrc_conn_recfg_complete().crit_exts.set_rrc_conn_recfg_complete_r8(); + + if (contains_nr_complete == true) { + rrc_log->debug("Preparing RRC Connection Reconfig Complete with NR Complete\n"); + rrc_conn_recfg_complete_r8->non_crit_ext_present = true; + rrc_conn_recfg_complete_r8->non_crit_ext.non_crit_ext_present = true; + rrc_conn_recfg_complete_r8->non_crit_ext.non_crit_ext.non_crit_ext_present = true; + rrc_conn_recfg_complete_r8->non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present = true; + rrc_conn_recfg_complete_r8->non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext_present = true; + + rrc_conn_recfg_complete_v1430_ies_s* rrc_conn_recfg_complete_v1430_ies = + &rrc_conn_recfg_complete_r8->non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext.non_crit_ext; + + rrc_conn_recfg_complete_v1430_ies->non_crit_ext_present = true; + rrc_conn_recfg_complete_v1430_ies->non_crit_ext.scg_cfg_resp_nr_r15_present = true; + rrc_conn_recfg_complete_v1430_ies->non_crit_ext.scg_cfg_resp_nr_r15.from_string("00"); + } send_ul_dcch_msg(RB_ID_SRB1, ul_dcch_msg); } diff --git a/srsue/src/stack/rrc/rrc_meas.cc b/srsue/src/stack/rrc/rrc_meas.cc index b130a0850..13ad48fe0 100644 --- a/srsue/src/stack/rrc/rrc_meas.cc +++ b/srsue/src/stack/rrc/rrc_meas.cc @@ -73,6 +73,9 @@ void rrc::rrc_meas::update_phy() { std::list objects = meas_cfg.get_active_objects(); rrc_ptr->phy->meas_stop(); +#ifdef HAVE_5GNR + rrc_ptr->rrc_nr->phy_meas_stop(); +#endif for (const auto& obj : objects) { switch (obj.meas_obj.type().value) { case meas_obj_to_add_mod_s::meas_obj_c_::types_opts::meas_obj_eutra: { diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index 852e5ee92..cf76872c8 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -12,13 +12,19 @@ #include "srsue/hdr/stack/rrc/rrc_nr.h" -using namespace asn1::rrc_nr; +#define Error(fmt, ...) rrc_ptr->log_h->error("Proc \"%s\" - " fmt, name(), ##__VA_ARGS__) +#define Warning(fmt, ...) rrc_ptr->log_h->warning("Proc \"%s\" - " fmt, name(), ##__VA_ARGS__) +#define Info(fmt, ...) rrc_ptr->log_h->info("Proc \"%s\" - " fmt, name(), ##__VA_ARGS__) +#define Debug(fmt, ...) rrc_ptr->log_h->debug("Proc \"%s\" - " fmt, name(), ##__VA_ARGS__) +using namespace asn1::rrc_nr; +using namespace asn1; +using namespace srslte; namespace srsue { const char* rrc_nr::rrc_nr_state_text[] = {"IDLE", "CONNECTED", "CONNECTED-INACTIVE"}; -rrc_nr::rrc_nr(srslte::task_sched_handle task_sched_) : log_h("RRC"), task_sched(task_sched_) {} +rrc_nr::rrc_nr(srslte::task_sched_handle task_sched_) : log_h("RRC"), task_sched(task_sched_), conn_recfg_proc(this) {} rrc_nr::~rrc_nr() = default; @@ -117,6 +123,29 @@ void rrc_nr::log_rrc_message(const std::string& source, } } +template +void rrc_nr::log_rrc_message(const std::string& source, + direction_t dir, + dyn_octstring oct, + const T& msg, + const std::string& msg_type) +{ + if (log_h->get_level() == srslte::LOG_LEVEL_INFO) { + log_h->info("%s - %s %s (%d B)\n", source.c_str(), (dir == Rx) ? "Rx" : "Tx", msg_type.c_str(), oct.size()); + } else if (log_h->get_level() >= srslte::LOG_LEVEL_DEBUG) { + asn1::json_writer json_writer; + msg.to_json(json_writer); + log_h->debug_hex(oct.data(), + oct.size(), + "%s - %s %s (%d B)\n", + source.c_str(), + (dir == Rx) ? "Rx" : "Tx", + msg_type.c_str(), + oct.size()); + log_h->debug_long("Content:\n%s\n", json_writer.to_string().c_str()); + } +} + // PHY interface void rrc_nr::in_sync() {} void rrc_nr::out_of_sync() {} @@ -250,6 +279,79 @@ void rrc_nr::get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps_pdu) return; } +bool rrc_nr::rrc_reconfiguration(bool endc_release_and_add_r15, + bool nr_secondary_cell_group_cfg_r15_present, + asn1::dyn_octstring nr_secondary_cell_group_cfg_r15, + bool sk_counter_r15_present, + uint32_t sk_counter_r15, + bool nr_radio_bearer_cfg1_r15_present, + asn1::dyn_octstring nr_radio_bearer_cfg1_r15) +{ + + // sanity check only for now + if (nr_secondary_cell_group_cfg_r15_present == false || sk_counter_r15_present == false || + nr_radio_bearer_cfg1_r15_present == false) { + log_h->error("RRC NR Reconfiguration failed sanity check failed\n"); + return false; + } + + rrc_recfg_s rrc_recfg; + cell_group_cfg_s cell_group_cfg; + radio_bearer_cfg_s radio_bearer_cfg; + asn1::SRSASN_CODE err; + + cbit_ref bref(nr_secondary_cell_group_cfg_r15.data(), nr_secondary_cell_group_cfg_r15.size()); + + err = rrc_recfg.unpack(bref); + if (err != asn1::SRSASN_SUCCESS) { + log_h->error("Could not unpack NR reconfiguration message.\n"); + return false; + } + + log_rrc_message( + "RRC NR Reconfiguration", Rx, nr_secondary_cell_group_cfg_r15, rrc_recfg, "NR Secondary Cell Group Cfg R15"); + + if (rrc_recfg.crit_exts.type() == asn1::rrc_nr::rrc_recfg_s::crit_exts_c_::types::rrc_recfg) { + if (rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group_present == true) { + cbit_ref bref0(rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group.data(), + rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group.size()); + + err = cell_group_cfg.unpack(bref0); + if (err != asn1::SRSASN_SUCCESS) { + log_h->error("Could not unpack cell group message message.\n"); + return false; + } + + log_rrc_message("RRC NR Reconfiguration", + Rx, + rrc_recfg.crit_exts.rrc_recfg().secondary_cell_group, + cell_group_cfg, + "Secondary Cell Group Config"); + } else { + log_h->error("Reconfiguration does not contain Secondary Cell Group Config\n"); + return false; + } + } + + cbit_ref bref1(nr_radio_bearer_cfg1_r15.data(), nr_radio_bearer_cfg1_r15.size()); + + err = radio_bearer_cfg.unpack(bref1); + if (err != asn1::SRSASN_SUCCESS) { + log_h->error("Could not unpack radio bearer config.\n"); + return false; + } + + log_rrc_message("RRC NR Reconfiguration", Rx, nr_radio_bearer_cfg1_r15, radio_bearer_cfg, "Radio Bearer Config R15"); + if (not conn_recfg_proc.launch( + endc_release_and_add_r15, rrc_recfg, cell_group_cfg, sk_counter_r15, radio_bearer_cfg)) { + log_h->error("Unable to launch NR RRC configuration procedure\n"); + return false; + } else { + callback_list.add_proc(conn_recfg_proc); + } + return true; +} + void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps_pdu) { @@ -291,6 +393,14 @@ void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps_pdu) return; }; +void rrc_nr::phy_meas_stop() +{ + // possbile race condition for fake_measurement timer, which might be set at the same moment as stopped => fix with + // phy integration + log_h->debug("[NR] Stopping fake measurements\n"); + fake_measurement_timer.stop(); +} + void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15) { log_h->debug("[NR] Measuring phy cell %d \n", carrier_freq_r15); @@ -300,6 +410,14 @@ void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15) fake_measurement_timer.run(); } +bool rrc_nr::is_config_pending() +{ + if (conn_recfg_proc.is_busy()) { + return true; + } + return false; +} + // RLC interface void rrc_nr::max_retx_attempted() {} @@ -307,4 +425,42 @@ void rrc_nr::max_retx_attempted() {} void rrc_nr::cell_search_completed(const rrc_interface_phy_lte::cell_search_ret_t& cs_ret, const phy_cell_t& found_cell) {} +/* Procedures */ +rrc_nr::connection_reconf_no_ho_proc::connection_reconf_no_ho_proc(rrc_nr* parent_) : rrc_ptr(parent_) {} + +proc_outcome_t rrc_nr::connection_reconf_no_ho_proc::init(const bool endc_release_and_add_r15, + const asn1::rrc_nr::rrc_recfg_s& rrc_recfg, + const asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg, + const uint32_t sk_counter_r15, + const asn1::rrc_nr::radio_bearer_cfg_s& radio_bearer_cfg) +{ + Info("Starting...\n"); + + return proc_outcome_t::success; +} + +proc_outcome_t rrc_nr::connection_reconf_no_ho_proc::react(const bool& config_complete) +{ + if (not config_complete) { + Error("Failed to config PHY\n"); + return proc_outcome_t::error; + } + + rrc_ptr->rrc_eutra->nr_rrc_con_reconfig_complete(true); + + Info("Reconfig NR return successful\n"); + return proc_outcome_t::success; +} + +void rrc_nr::connection_reconf_no_ho_proc::then(const srslte::proc_state_t& result) +{ + if (result.is_success()) { + Info("Finished %s successfully\n", name()); + return; + } + + // Section 5.3.5.5 - Reconfiguration failure + // rrc_ptr->con_reconfig_failed(); +} + } // namespace srsue \ No newline at end of file diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index 4e83716e8..f7af78c5e 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -972,9 +972,9 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::init(const asn1::rrc:: return proc_outcome_t::error; } } - - // Apply Scell RR configurations (call is non-blocking). Make a copy since can be changed inside apply_scell_config() - // Note that apply_scell_config() calls set_scell() and set_config() which run in the background. + // Apply Scell RR configurations (call is non-blocking). Make a copy since can be changed inside + // apply_scell_config() Note that apply_scell_config() calls set_scell() and set_config() which run in the + // background. rrc_ptr->apply_scell_config(&rx_recfg, true); if (!rrc_ptr->measurements->parse_meas_config( @@ -982,6 +982,16 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::init(const asn1::rrc:: return proc_outcome_t::error; } + // Apply NR config +#ifdef HAVE_5GNR + bool rtn = rrc_ptr->nr_reconfiguration_proc(rx_recfg); + if (rtn == false) { + rrc_ptr->rrc_log->error("Can not launch NR RRC Reconfiguration procedure\n"); + return proc_outcome_t::error; + } + has_5g_nr_reconfig = true; +#endif + // No phy config was scheduled, run config completion immediately if (rrc_ptr->phy_ctrl->is_config_pending()) { return react(true); @@ -1001,7 +1011,18 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::react(const bool& conf return proc_outcome_t::yield; } - rrc_ptr->send_rrc_con_reconfig_complete(); +#ifdef HAVE_5GNR + // in case there is rrc_nr to configure, wait for rrc nr configuration + if (has_5g_nr_reconfig == true && rrc_ptr->rrc_nr->is_config_pending()) { + return proc_outcome_t::yield; + } +#endif + + if (has_5g_nr_reconfig == true) { + rrc_ptr->send_rrc_con_reconfig_complete(true); + } else { + rrc_ptr->send_rrc_con_reconfig_complete(); + } srslte::unique_byte_buffer_t nas_pdu; for (auto& pdu : rx_recfg.ded_info_nas_list) { @@ -1021,12 +1042,16 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::react(const bool& conf void rrc::connection_reconf_no_ho_proc::then(const srslte::proc_state_t& result) { + // Reset 5G NR reconfig variable + has_5g_nr_reconfig = false; + if (result.is_success()) { rrc_ptr->rrc_log->info("Finished %s successfully\n", name()); return; } // Section 5.3.5.5 - Reconfiguration failure + // TODO: if RRC NR configuration this also need to be signaled via LTE rrc_ptr->con_reconfig_failed(); } diff --git a/srsue/test/upper/rrc_meas_test.cc b/srsue/test/upper/rrc_meas_test.cc index 180f1c4e3..cc2adfc64 100644 --- a/srsue/test/upper/rrc_meas_test.cc +++ b/srsue/test/upper/rrc_meas_test.cc @@ -169,6 +169,18 @@ public: void get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps) override{}; void get_nr_capabilities(srslte::byte_buffer_t* nr_cap) override{}; void phy_set_cells_to_meas(uint32_t carrier_freq_r15) override{}; + void phy_meas_stop() override{}; + bool rrc_reconfiguration(bool endc_release_and_add_r15, + bool nr_secondary_cell_group_cfg_r15_present, + asn1::dyn_octstring nr_secondary_cell_group_cfg_r15, + bool sk_counter_r15_present, + uint32_t sk_counter_r15, + bool nr_radio_bearer_cfg1_r15_present, + asn1::dyn_octstring nr_radio_bearer_cfg1_r15) override + { + return false; + }; + bool is_config_pending() override { return false; }; }; class nas_test : public srsue::nas From a6046ca875c29588548579410a573a1b769aa4a2 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 25 Jan 2021 19:54:41 +0100 Subject: [PATCH 122/138] Added funcs for asn flat config RLC and PDCP --- lib/include/srslte/asn1/rrc_nr_utils.h | 14 ++++ .../srslte/interfaces/rlc_interface_types.h | 2 +- lib/src/asn1/rrc_nr_utils.cc | 79 +++++++++++++++++++ lib/test/asn1/CMakeLists.txt | 4 + lib/test/asn1/rrc_nr_utils_test.cc | 53 +++++++++++++ 5 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 lib/test/asn1/rrc_nr_utils_test.cc diff --git a/lib/include/srslte/asn1/rrc_nr_utils.h b/lib/include/srslte/asn1/rrc_nr_utils.h index 716aefca6..8530a7435 100644 --- a/lib/include/srslte/asn1/rrc_nr_utils.h +++ b/lib/include/srslte/asn1/rrc_nr_utils.h @@ -13,6 +13,8 @@ #ifndef SRSLTE_RRC_NR_UTILS_H #define SRSLTE_RRC_NR_UTILS_H +#include "srslte/interfaces/pdcp_interface_types.h" +#include "srslte/interfaces/rlc_interface_types.h" #include "srslte/interfaces/rrc_interface_types.h" #include "srslte/interfaces/sched_interface.h" @@ -24,6 +26,8 @@ namespace rrc_nr { struct plmn_id_s; struct sib1_s; +struct rlc_cfg_c; +struct pdcp_cfg_s; } // namespace rrc_nr } // namespace asn1 @@ -36,6 +40,16 @@ namespace srslte { plmn_id_t make_plmn_id_t(const asn1::rrc_nr::plmn_id_s& asn1_type); void to_asn1(asn1::rrc_nr::plmn_id_s* asn1_type, const plmn_id_t& cfg); +/*************************** + * RLC Config + **************************/ +rlc_config_t make_rlc_config_t(const asn1::rrc_nr::rlc_cfg_c& asn1_type); + +/*************************** + * PDCP Config + **************************/ +pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue, const asn1::rrc_nr::pdcp_cfg_s& pdcp_cfg); + } // namespace srslte namespace srsenb { diff --git a/lib/include/srslte/interfaces/rlc_interface_types.h b/lib/include/srslte/interfaces/rlc_interface_types.h index cc2e0b2e7..8679f360d 100644 --- a/lib/include/srslte/interfaces/rlc_interface_types.h +++ b/lib/include/srslte/interfaces/rlc_interface_types.h @@ -216,7 +216,7 @@ public: } else if (sn_size == 12) { cnfg.um_nr.sn_field_length = rlc_um_nr_sn_size_t::size12bits; cnfg.um_nr.UM_Window_Size = 2048; - cnfg.um_nr.mod = 64; + cnfg.um_nr.mod = 4096; } else { return {}; } diff --git a/lib/src/asn1/rrc_nr_utils.cc b/lib/src/asn1/rrc_nr_utils.cc index 18b8195ae..ba44ed40e 100644 --- a/lib/src/asn1/rrc_nr_utils.cc +++ b/lib/src/asn1/rrc_nr_utils.cc @@ -13,10 +13,13 @@ #include "srslte/asn1/rrc_nr_utils.h" #include "srslte/asn1/rrc_nr.h" #include "srslte/config.h" +#include "srslte/interfaces/pdcp_interface_types.h" +#include "srslte/interfaces/rlc_interface_types.h" #include namespace srslte { +using namespace asn1::rrc_nr; /*************************** * PLMN ID **************************/ @@ -47,6 +50,82 @@ void to_asn1(asn1::rrc_nr::plmn_id_s* asn1_type, const plmn_id_t& cfg) std::copy(&cfg.mnc[0], &cfg.mnc[cfg.nof_mnc_digits], &asn1_type->mnc[0]); } +rlc_config_t make_rlc_config_t(const rlc_cfg_c& asn1_type) +{ + rlc_config_t rlc_cfg = rlc_config_t::default_rlc_um_nr_config(); + rlc_cfg.rat = srslte_rat_t::nr; + switch (asn1_type.type().value) { + case rlc_cfg_c::types_opts::am: + break; + case rlc_cfg_c::types_opts::um_bi_dir: + case rlc_cfg_c::types_opts::um_uni_dir_dl: + case rlc_cfg_c::types_opts::um_uni_dir_ul: + rlc_cfg.rlc_mode = rlc_mode_t::um; + rlc_cfg.um_nr.t_reassembly_ms = asn1_type.um_bi_dir().dl_um_rlc.t_reassembly.value; + rlc_cfg.um_nr.sn_field_length = (rlc_um_nr_sn_size_t)asn1_type.um_bi_dir().dl_um_rlc.sn_field_len.value; + rlc_cfg.um_nr.mod = (rlc_cfg.um_nr.sn_field_length == rlc_um_nr_sn_size_t::size6bits) ? 64 : 4096; + rlc_cfg.um_nr.UM_Window_Size = (rlc_cfg.um_nr.sn_field_length == rlc_um_nr_sn_size_t::size6bits) ? 32 : 2048; + break; + default: + break; + } + return rlc_cfg; +} + +srslte::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue, const pdcp_cfg_s& pdcp_cfg) +{ + // TODO: complete config processing + // TODO: check if is drb_cfg.pdcp_cfg.drb_present if not return Error + // TODO: different pdcp sn size for ul and dl + pdcp_discard_timer_t discard_timer = pdcp_discard_timer_t::infinity; + if (pdcp_cfg.drb.discard_timer_present) { + switch (pdcp_cfg.drb.discard_timer.to_number()) { + case 10: + discard_timer = pdcp_discard_timer_t::ms10; + break; + case 100: + discard_timer = pdcp_discard_timer_t::ms100; + break; + default: + discard_timer = pdcp_discard_timer_t::infinity; + break; + } + } + + pdcp_t_reordering_t t_reordering = pdcp_t_reordering_t::ms500; + if (pdcp_cfg.t_reordering_present) { + switch (pdcp_cfg.t_reordering.to_number()) { + case 0: + t_reordering = pdcp_t_reordering_t::ms0; + break; + default: + t_reordering = pdcp_t_reordering_t::ms500; + } + } + + uint8_t sn_len = srslte::PDCP_SN_LEN_12; + if (pdcp_cfg.drb.pdcp_sn_size_dl_present) { + switch (pdcp_cfg.drb.pdcp_sn_size_dl.value) { + case pdcp_cfg_s::drb_s_::pdcp_sn_size_dl_opts::options::len12bits: + sn_len = srslte::PDCP_SN_LEN_12; + break; + case pdcp_cfg_s::drb_s_::pdcp_sn_size_dl_opts::options::len18bits: + sn_len = srslte::PDCP_SN_LEN_18; + default: + break; + } + } + + pdcp_config_t cfg(bearer_id, + PDCP_RB_IS_DRB, + is_ue ? SECURITY_DIRECTION_UPLINK : SECURITY_DIRECTION_DOWNLINK, + is_ue ? SECURITY_DIRECTION_DOWNLINK : SECURITY_DIRECTION_UPLINK, + sn_len, + t_reordering, + discard_timer); + return cfg; +} + } // namespace srslte namespace srsenb { diff --git a/lib/test/asn1/CMakeLists.txt b/lib/test/asn1/CMakeLists.txt index 05c297dd4..cc3a0a54f 100644 --- a/lib/test/asn1/CMakeLists.txt +++ b/lib/test/asn1/CMakeLists.txt @@ -54,6 +54,10 @@ if (ENABLE_5GNR) add_executable(ngap_asn1_test ngap_test.cc) target_link_libraries(ngap_asn1_test ngap_nr_asn1 srslte_common) add_test(ngap_asn1_test ngap_asn1_test) + + add_executable(rrc_nr_utils_test rrc_nr_utils_test.cc) + target_link_libraries(rrc_nr_utils_test ngap_nr_asn1 srslte_common rrc_nr_asn1) + add_test(rrc_nr_utils_test rrc_nr_utils_test) endif(ENABLE_5GNR) add_executable(rrc_asn1_decoder rrc_asn1_decoder.cc) diff --git a/lib/test/asn1/rrc_nr_utils_test.cc b/lib/test/asn1/rrc_nr_utils_test.cc new file mode 100644 index 000000000..085e0bf27 --- /dev/null +++ b/lib/test/asn1/rrc_nr_utils_test.cc @@ -0,0 +1,53 @@ +/** + * + * \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. + * + */ + +#include +#include + +#include "srslte/asn1/rrc_nr.h" +#include "srslte/asn1/rrc_nr_utils.h" +#include "srslte/common/common.h" +#include "srslte/common/log.h" +#include "srslte/common/logmap.h" +#include "srslte/common/test_common.h" + +using namespace srslte; + +int test_rlc_config() +{ + asn1::rrc_nr::rlc_cfg_c rlc_cfg_asn1; + rlc_cfg_asn1.set_um_bi_dir(); + rlc_cfg_asn1.um_bi_dir().dl_um_rlc.sn_field_len_present = true; + rlc_cfg_asn1.um_bi_dir().dl_um_rlc.sn_field_len = asn1::rrc_nr::sn_field_len_um_e::size12; + rlc_cfg_asn1.um_bi_dir().dl_um_rlc.t_reassembly = asn1::rrc_nr::t_reassembly_e::ms50; + rlc_cfg_asn1.um_bi_dir().ul_um_rlc.sn_field_len_present = true; + rlc_cfg_asn1.um_bi_dir().ul_um_rlc.sn_field_len = asn1::rrc_nr::sn_field_len_um_e::size12; + asn1::json_writer jw; + rlc_cfg_asn1.to_json(jw); + logmap::get("RRC")->info_long("RLC NR Config: \n %s \n", jw.to_string().c_str()); + + rlc_config_t rlc_cfg = make_rlc_config_t(rlc_cfg_asn1); + TESTASSERT(rlc_cfg.rat == srslte_rat_t::nr); + TESTASSERT(rlc_cfg.um_nr.sn_field_length == rlc_um_nr_sn_size_t::size12bits); + TESTASSERT(rlc_cfg.um_nr.UM_Window_Size == 2048); + return SRSLTE_SUCCESS; +} + +int main() +{ + srslte::logmap::set_default_log_level(srslte::LOG_LEVEL_DEBUG); + + TESTASSERT(test_rlc_config() == 0); + + printf("Success\n"); + return 0; +} From e0420049e347099de1ff3ddd2b94ae104cdf79ef Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 25 Jan 2021 19:59:20 +0100 Subject: [PATCH 123/138] Build infrastucture for reconfig --- srsue/hdr/stack/rrc/rrc_nr.h | 24 ++++ srsue/src/stack/rrc/rrc_nr.cc | 223 ++++++++++++++++++++++++++++++++ srsue/src/stack/ue_stack_lte.cc | 2 +- 3 files changed, 248 insertions(+), 1 deletion(-) diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index 69724177c..de58bebee 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -14,6 +14,7 @@ #define SRSUE_RRC_NR_H #include "srslte/asn1/rrc_nr.h" +#include "srslte/asn1/rrc_nr_utils.h" #include "srslte/common/block_queue.h" #include "srslte/common/buffer_pool.h" #include "srslte/interfaces/nr_common_interface_types.h" @@ -154,6 +155,29 @@ private: std::string get_rb_name(uint32_t lcid) final { return srslte::to_string((srslte::rb_id_nr_t)lcid); } + typedef enum { Srb = 0, Drb } rb_type_t; + typedef struct { + uint32_t rb_id; + rb_type_t rb_type; + } rb_t; + + bool add_lcid_rb(uint32_t lcid, rb_type_t rb_type, uint32_t rbid); + uint32_t get_lcid_for_rbid(uint32_t rdid); + + std::map lcid_rb; // Map of lcid to radio bearer (type and rb id) + + std::map drb_eps_bearer_id; // Map of drb id to eps_bearer_id + + bool apply_cell_group_cfg(const asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg); + bool apply_radio_bearer_cfg(const asn1::rrc_nr::radio_bearer_cfg_s& radio_bearer_cfg); + bool apply_rlc_add_mod(const asn1::rrc_nr::rlc_bearer_cfg_s& rlc_bearer_cfg); + bool apply_mac_cell_group(const asn1::rrc_nr::mac_cell_group_cfg_s& mac_cell_group_cfg); + bool apply_sp_cell_cfg(const asn1::rrc_nr::sp_cell_cfg_s& sp_cell_cfg); + bool apply_drb_add_mod(const asn1::rrc_nr::drb_to_add_mod_s& drb_cfg); + bool apply_security_cfg(const asn1::rrc_nr::security_cfg_s& security_cfg); + + srslte::as_security_config_t sec_cfg; + class connection_reconf_no_ho_proc { public: diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index cf76872c8..977f57b33 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -11,6 +11,7 @@ */ #include "srsue/hdr/stack/rrc/rrc_nr.h" +#include "srslte/common/security.h" #define Error(fmt, ...) rrc_ptr->log_h->error("Proc \"%s\" - " fmt, name(), ##__VA_ARGS__) #define Warning(fmt, ...) rrc_ptr->log_h->warning("Proc \"%s\" - " fmt, name(), ##__VA_ARGS__) @@ -146,6 +147,30 @@ void rrc_nr::log_rrc_message(const std::string& source, } } +bool rrc_nr::add_lcid_rb(uint32_t lcid, rb_type_t rb_type, uint32_t rbid) +{ + if (lcid_rb.find(lcid) != lcid_rb.end()) { + log_h->error("Couldn't add RB to LCID. RB %d does exist.\n", rbid); + return false; + } else { + log_h->info("Adding lcid %d and radio bearer ID %d with type %s \n", lcid, rbid, (rb_type == Srb) ? "SRB" : "DRB"); + lcid_rb[lcid].rb_id = rbid; + lcid_rb[lcid].rb_type = rb_type; + } + return true; +} + +uint32_t rrc_nr::get_lcid_for_rbid(uint32_t rb_id) +{ + for (auto& rb : lcid_rb) { + if (rb.second.rb_id == rb_id) { + return rb.first; + } + } + log_h->error("Couldn't find LCID for rb LCID. RB %d does exist.\n", rb_id); + return 0; +} + // PHY interface void rrc_nr::in_sync() {} void rrc_nr::out_of_sync() {} @@ -418,6 +443,194 @@ bool rrc_nr::is_config_pending() return false; } +bool rrc_nr::apply_rlc_add_mod(const rlc_bearer_cfg_s& rlc_bearer_cfg) +{ + uint32_t lc_ch_id = 0; + uint32_t drb_id = 0; + uint32_t srb_id = 0; + rlc_config_t rlc_cfg; + + lc_ch_id = rlc_bearer_cfg.lc_ch_id; + if (rlc_bearer_cfg.served_radio_bearer_present == true) { + if (rlc_bearer_cfg.served_radio_bearer.type() == rlc_bearer_cfg_s::served_radio_bearer_c_::types::drb_id) { + drb_id = rlc_bearer_cfg.served_radio_bearer.drb_id(); + add_lcid_rb(lc_ch_id, Drb, drb_id); + } else { + srb_id = rlc_bearer_cfg.served_radio_bearer.srb_id(); + add_lcid_rb(lc_ch_id, Srb, srb_id); + } + } else { + log_h->warning("In RLC bearer cfg does not contain served radio bearer\n"); + return false; + } + + if (rlc_bearer_cfg.rlc_cfg_present == true) { + rlc_cfg = srslte::make_rlc_config_t(rlc_bearer_cfg.rlc_cfg); + if (rlc_bearer_cfg.rlc_cfg.type() == asn1::rrc_nr::rlc_cfg_c::types::um_bi_dir) { + if (rlc_bearer_cfg.rlc_cfg.um_bi_dir().dl_um_rlc.sn_field_len_present && + rlc_bearer_cfg.rlc_cfg.um_bi_dir().ul_um_rlc.sn_field_len_present && + rlc_bearer_cfg.rlc_cfg.um_bi_dir().dl_um_rlc.sn_field_len != + rlc_bearer_cfg.rlc_cfg.um_bi_dir().ul_um_rlc.sn_field_len) { + log_h->warning("NR RLC sequence number length is not the same in uplink and downlink\n"); + } + } else { + log_h->warning("NR RLC type is not unacknowledged mode bidirectional\n"); + } + } else { + log_h->warning("In RLC bearer cfg does not contain rlc cfg\n"); + return false; + } + + // Setup RLC + rlc->add_bearer(lc_ch_id, rlc_cfg); + + uint8_t log_chan_group = 0; + uint8_t priority = 1; + int prioritized_bit_rate = -1; + int bucket_size_duration = -1; + + if (rlc_bearer_cfg.mac_lc_ch_cfg_present == true && rlc_bearer_cfg.mac_lc_ch_cfg.ul_specific_params_present) { + lc_ch_cfg_s::ul_specific_params_s_ ul_specific_params = rlc_bearer_cfg.mac_lc_ch_cfg.ul_specific_params; + + if (ul_specific_params.lc_ch_group_present) { + log_chan_group = ul_specific_params.lc_ch_group; + } else { + log_h->warning("LCG not present, setting to 0\n"); + } + priority = ul_specific_params.prio; + prioritized_bit_rate = ul_specific_params.prioritised_bit_rate.to_number(); + bucket_size_duration = ul_specific_params.bucket_size_dur.to_number(); + // TODO Setup MAC @andre + // mac->setup_lcid(lc_ch_id, log_chan_group, priority, prioritized_bit_rate, bucket_size_duration); + } + return true; +} +bool rrc_nr::apply_mac_cell_group(const mac_cell_group_cfg_s& mac_cell_group_cfg) +{ + return true; +} + +bool rrc_nr::apply_cell_group_cfg(const cell_group_cfg_s& cell_group_cfg) +{ + if (cell_group_cfg.rlc_bearer_to_add_mod_list_present == true) { + for (uint32_t i = 0; i < cell_group_cfg.rlc_bearer_to_add_mod_list.size(); i++) { + apply_rlc_add_mod(cell_group_cfg.rlc_bearer_to_add_mod_list[i]); + } + } + if (cell_group_cfg.mac_cell_group_cfg_present == true) { + apply_mac_cell_group(cell_group_cfg.mac_cell_group_cfg); + } + if (cell_group_cfg.sp_cell_cfg_present) { + // apply_sp_cell_cfg(cell_group_cfg.sp_cell_cfg); + } + return true; +} + +bool rrc_nr::apply_drb_add_mod(const drb_to_add_mod_s& drb_cfg) +{ + if (!drb_cfg.pdcp_cfg_present) { + log_h->error("Cannot add DRB - incomplete configuration\n"); + return false; + } + + uint32_t lcid = get_lcid_for_rbid(drb_cfg.drb_id); + + // Setup PDCP + if (!(drb_cfg.pdcp_cfg.drb_present == true)) { + log_h->error("PDCP config does not contain DRB config\n"); + return false; + } + + if (!(drb_cfg.cn_assoc_present == true)) { + log_h->error("DRB config does not contain an associated cn\n"); + return false; + } + + if (!(drb_cfg.cn_assoc.type() == drb_to_add_mod_s::cn_assoc_c_::types_opts::eps_bearer_id)) { + log_h->error("CN associtaion type not supported %s \n", drb_cfg.cn_assoc.type().to_string().c_str()); + return false; + } + + drb_eps_bearer_id[drb_cfg.drb_id] = drb_cfg.cn_assoc.eps_bearer_id(); + + if (drb_cfg.pdcp_cfg.drb.pdcp_sn_size_dl_present && drb_cfg.pdcp_cfg.drb.pdcp_sn_size_ul_present && + (drb_cfg.pdcp_cfg.drb.pdcp_sn_size_ul.to_number() != drb_cfg.pdcp_cfg.drb.pdcp_sn_size_dl.to_number())) { + log_h->warning("PDCP SN size in UL and DL are not the same. make_drb_pdcp_config_t will use the DL SN size %d \n", + drb_cfg.pdcp_cfg.drb.pdcp_sn_size_dl.to_number()); + } + + srslte::pdcp_config_t pdcp_cfg = make_drb_pdcp_config_t(drb_cfg.drb_id, true, drb_cfg.pdcp_cfg); + pdcp->add_bearer(lcid, pdcp_cfg); + + return true; +} + +bool rrc_nr::apply_security_cfg(const security_cfg_s& security_cfg) +{ + if (security_cfg.security_algorithm_cfg_present) { + switch (security_cfg.security_algorithm_cfg.ciphering_algorithm) { + case ciphering_algorithm_e::nea0: + sec_cfg.cipher_algo = CIPHERING_ALGORITHM_ID_EEA0; + break; + case ciphering_algorithm_e::nea1: + sec_cfg.cipher_algo = CIPHERING_ALGORITHM_ID_128_EEA1; + break; + case ciphering_algorithm_e::nea2: + sec_cfg.cipher_algo = CIPHERING_ALGORITHM_ID_128_EEA2; + break; + case ciphering_algorithm_e::nea3: + sec_cfg.cipher_algo = CIPHERING_ALGORITHM_ID_128_EEA3; + break; + default: + log_h->warning("Unsupported algorithm\n"); + break; + } + + if (security_cfg.security_algorithm_cfg.integrity_prot_algorithm_present) { + switch (security_cfg.security_algorithm_cfg.integrity_prot_algorithm) { + case integrity_prot_algorithm_e::nia0: + sec_cfg.integ_algo = INTEGRITY_ALGORITHM_ID_EIA0; + break; + case integrity_prot_algorithm_e::nia1: + sec_cfg.integ_algo = INTEGRITY_ALGORITHM_ID_128_EIA1; + break; + case integrity_prot_algorithm_e::nia2: + sec_cfg.integ_algo = INTEGRITY_ALGORITHM_ID_128_EIA2; + break; + case integrity_prot_algorithm_e::nia3: + sec_cfg.integ_algo = INTEGRITY_ALGORITHM_ID_128_EIA3; + break; + default: + log_h->warning("Unsupported algorithm\n"); + break; + } + } + } + // TODO derive correct keys + if (security_cfg.key_to_use_present) { + } + // TODO derive correct keys + + // Apply security config for all known NR lcids + for (auto& lcid : lcid_rb) { + pdcp->config_security(lcid.first, sec_cfg); + pdcp->enable_encryption(lcid.first); + } + return true; +} + +bool rrc_nr::apply_radio_bearer_cfg(const radio_bearer_cfg_s& radio_bearer_cfg) +{ + if (radio_bearer_cfg.drb_to_add_mod_list_present) { + for (uint32_t i = 0; i < radio_bearer_cfg.drb_to_add_mod_list.size(); i++) { + apply_drb_add_mod(radio_bearer_cfg.drb_to_add_mod_list[i]); + } + } + if (radio_bearer_cfg.security_cfg_present) { + apply_security_cfg(radio_bearer_cfg.security_cfg); + } + return true; +} // RLC interface void rrc_nr::max_retx_attempted() {} @@ -436,6 +649,15 @@ proc_outcome_t rrc_nr::connection_reconf_no_ho_proc::init(const bool { Info("Starting...\n"); + Info("Applying Cell Group Cfg\n"); + if (!rrc_ptr->apply_cell_group_cfg(cell_group_cfg)) { + return proc_outcome_t::error; + } + + Info("Applying Radio Bearer Cfg\n"); + if (!rrc_ptr->apply_radio_bearer_cfg(radio_bearer_cfg)) { + return proc_outcome_t::error; + } return proc_outcome_t::success; } @@ -456,6 +678,7 @@ void rrc_nr::connection_reconf_no_ho_proc::then(const srslte::proc_state_t& resu { if (result.is_success()) { Info("Finished %s successfully\n", name()); + srslte::console("RRC NR reconfiguration successful.\n"); return; } diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 0df20c75e..6c2ca0888 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -122,7 +122,7 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_) pdcp.init(&rlc, &rrc, gw); nas.init(usim.get(), &rrc, gw, args.nas); #ifdef HAVE_5GNR - rrc_nr.init(nullptr, nullptr, nullptr, nullptr, gw, &rrc, task_sched.get_timer_handler(), nullptr, args.rrc_nr); + rrc_nr.init(nullptr, nullptr, &rlc, &pdcp, gw, &rrc, task_sched.get_timer_handler(), nullptr, args.rrc_nr); rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &rrc_nr, args.rrc); #else rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, args.rrc); From ceda458bb33a56d35fcaeea247d3db815fe747f3 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Thu, 21 Jan 2021 11:50:24 +0100 Subject: [PATCH 124/138] Added MAC NR to EUTRA and NR with stack interfaces including MAC config build Moved MAC logical channel config to MAC interface types --- lib/include/srslte/asn1/rrc_nr_utils.h | 6 ++ .../srslte/interfaces/mac_interface_types.h | 17 +++++ .../srslte/interfaces/ue_nr_interfaces.h | 8 ++- lib/src/asn1/rrc_nr_utils.cc | 16 +++++ srsue/hdr/stack/mac/mac_nr.h | 8 ++- srsue/hdr/stack/mac/mux.h | 21 ++---- srsue/hdr/stack/rrc/rrc_nr.h | 4 +- srsue/hdr/stack/ue_stack_lte.h | 2 + srsue/src/stack/mac/mac_nr.cc | 26 ++++---- srsue/src/stack/rrc/rrc_nr.cc | 65 ++++++++++++++----- srsue/src/stack/ue_stack_lte.cc | 5 +- srsue/test/ttcn3/src/CMakeLists.txt | 2 +- 12 files changed, 127 insertions(+), 53 deletions(-) diff --git a/lib/include/srslte/asn1/rrc_nr_utils.h b/lib/include/srslte/asn1/rrc_nr_utils.h index 8530a7435..64a08f755 100644 --- a/lib/include/srslte/asn1/rrc_nr_utils.h +++ b/lib/include/srslte/asn1/rrc_nr_utils.h @@ -13,6 +13,7 @@ #ifndef SRSLTE_RRC_NR_UTILS_H #define SRSLTE_RRC_NR_UTILS_H +#include "srslte/interfaces/mac_interface_types.h" #include "srslte/interfaces/pdcp_interface_types.h" #include "srslte/interfaces/rlc_interface_types.h" #include "srslte/interfaces/rrc_interface_types.h" @@ -28,6 +29,7 @@ struct plmn_id_s; struct sib1_s; struct rlc_cfg_c; struct pdcp_cfg_s; +struct lc_ch_cfg_s; } // namespace rrc_nr } // namespace asn1 @@ -40,6 +42,10 @@ namespace srslte { plmn_id_t make_plmn_id_t(const asn1::rrc_nr::plmn_id_s& asn1_type); void to_asn1(asn1::rrc_nr::plmn_id_s* asn1_type, const plmn_id_t& cfg); +/*************************** + * MAC Config + **************************/ +logical_channel_config_t make_mac_logical_channel_cfg_t(uint8_t lcid, const asn1::rrc_nr::lc_ch_cfg_s& asn1_type); /*************************** * RLC Config **************************/ diff --git a/lib/include/srslte/interfaces/mac_interface_types.h b/lib/include/srslte/interfaces/mac_interface_types.h index ddf8a8c78..3ed138c7d 100644 --- a/lib/include/srslte/interfaces/mac_interface_types.h +++ b/lib/include/srslte/interfaces/mac_interface_types.h @@ -20,6 +20,23 @@ namespace srslte { /*************************** * MAC Config **************************/ + +/* Logical Channel Multiplexing and Prioritization + Msg3 Buffer */ + +class logical_channel_config_t +{ +public: + uint8_t lcid; + uint8_t lcg; + int32_t Bj; + int32_t PBR; // in kByte/s, -1 sets to infinity + uint32_t bucket_size; + uint32_t BSD; + uint32_t priority; + int sched_len; // scheduled upper layer payload for this LCID + int buffer_len; // outstanding bytes for this LCID +}; + struct bsr_cfg_t { int periodic_timer; int retx_timer; diff --git a/lib/include/srslte/interfaces/ue_nr_interfaces.h b/lib/include/srslte/interfaces/ue_nr_interfaces.h index 0e0f77787..1d9009b54 100644 --- a/lib/include/srslte/interfaces/ue_nr_interfaces.h +++ b/lib/include/srslte/interfaces/ue_nr_interfaces.h @@ -14,6 +14,7 @@ #define SRSLTE_UE_NR_INTERFACES_H #include "srslte/common/interfaces_common.h" +#include "srslte/interfaces/mac_interface_types.h" #include namespace srsue { @@ -54,7 +55,12 @@ public: }; class mac_interface_rrc_nr -{}; +{ +public: + virtual void setup_lcid(const srslte::logical_channel_config_t& config) = 0; + virtual void set_config(const srslte::bsr_cfg_t& bsr_cfg) = 0; + virtual void set_config(const srslte::sr_cfg_t& sr_cfg) = 0; +}; class phy_interface_mac_nr { diff --git a/lib/src/asn1/rrc_nr_utils.cc b/lib/src/asn1/rrc_nr_utils.cc index ba44ed40e..7d68795b7 100644 --- a/lib/src/asn1/rrc_nr_utils.cc +++ b/lib/src/asn1/rrc_nr_utils.cc @@ -50,6 +50,22 @@ void to_asn1(asn1::rrc_nr::plmn_id_s* asn1_type, const plmn_id_t& cfg) std::copy(&cfg.mnc[0], &cfg.mnc[cfg.nof_mnc_digits], &asn1_type->mnc[0]); } +logical_channel_config_t make_mac_logical_channel_cfg_t(uint8_t lcid, const lc_ch_cfg_s& asn1_type) +{ + logical_channel_config_t logical_channel_config = {}; + logical_channel_config.lcid = lcid; + + if (asn1_type.ul_specific_params.lc_ch_group_present) { + logical_channel_config.lcg = asn1_type.ul_specific_params.lc_ch_group; + } + logical_channel_config.priority = asn1_type.ul_specific_params.prio; + logical_channel_config.PBR = asn1_type.ul_specific_params.prioritised_bit_rate.to_number(); + logical_channel_config.BSD = asn1_type.ul_specific_params.bucket_size_dur.to_number(); + logical_channel_config.bucket_size = logical_channel_config.PBR * logical_channel_config.BSD; + + return logical_channel_config; +} + rlc_config_t make_rlc_config_t(const rlc_cfg_c& asn1_type) { rlc_config_t rlc_cfg = rlc_config_t::default_rlc_um_nr_config(); diff --git a/srsue/hdr/stack/mac/mac_nr.h b/srsue/hdr/stack/mac/mac_nr.h index 42ffe6a34..05b84356e 100644 --- a/srsue/hdr/stack/mac/mac_nr.h +++ b/srsue/hdr/stack/mac/mac_nr.h @@ -16,6 +16,7 @@ #include "srslte/common/block_queue.h" #include "srslte/common/logmap.h" #include "srslte/common/mac_nr_pcap.h" +#include "srslte/interfaces/mac_interface_types.h" #include "srslte/interfaces/ue_nr_interfaces.h" #include "srslte/mac/mac_nr_pdu.h" #include "srsue/hdr/stack/mac/mux.h" @@ -57,12 +58,15 @@ public: void get_metrics(mac_metrics_t* metrics); + /******** Interface for RRC (RRC -> MAC) ****************/ + void setup_lcid(const srslte::logical_channel_config_t& config); + void set_config(const srslte::bsr_cfg_t& bsr_cfg); + void set_config(const srslte::sr_cfg_t& sr_cfg); + /// stack interface void process_pdus(); private: - void setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD); - void setup_lcid(const logical_channel_config_t& config); void handle_pdu(srslte::unique_byte_buffer_t pdu); void get_ul_data(const mac_nr_grant_ul_t& grant, phy_interface_stack_nr::tx_request_t* tx_request); diff --git a/srsue/hdr/stack/mac/mux.h b/srsue/hdr/stack/mac/mux.h index 992d47e2c..4ac36ed55 100644 --- a/srsue/hdr/stack/mac/mux.h +++ b/srsue/hdr/stack/mac/mux.h @@ -21,24 +21,11 @@ #include "proc_phr.h" #include "srslte/common/common.h" #include "srslte/common/log.h" +#include "srslte/interfaces/mac_interface_types.h" #include "srslte/interfaces/ue_interfaces.h" #include "srslte/mac/pdu.h" #include -/* Logical Channel Multiplexing and Prioritization + Msg3 Buffer */ - -typedef struct { - uint8_t lcid; - uint8_t lcg; - int32_t Bj; - int32_t PBR; // in kByte/s, -1 sets to infinity - uint32_t bucket_size; - uint32_t BSD; - uint32_t priority; - int sched_len; // scheduled upper layer payload for this LCID - int buffer_len; // outstanding bytes for this LCID -} logical_channel_config_t; - namespace srsue { class mux @@ -65,7 +52,7 @@ public: void append_crnti_ce_next_tx(uint16_t crnti); - void setup_lcid(const logical_channel_config_t& config); + void setup_lcid(const srslte::logical_channel_config_t& config); void print_logical_channel_state(const std::string& info); @@ -73,11 +60,11 @@ private: bool has_logical_channel(const uint32_t& lcid); bool pdu_move_to_msg3(uint32_t pdu_sz); uint32_t allocate_sdu(uint32_t lcid, srslte::sch_pdu* pdu, int max_sdu_sz); - bool sched_sdu(logical_channel_config_t* ch, int* sdu_space, int max_sdu_sz); + bool sched_sdu(srslte::logical_channel_config_t* ch, int* sdu_space, int max_sdu_sz); const static int MAX_NOF_SUBHEADERS = 20; - std::vector logical_channels; + std::vector logical_channels; // Mutex for exclusive access std::mutex mutex; diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index de58bebee..c1f75907f 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -125,8 +125,8 @@ private: bool running = false; srslte::block_queue cmd_q; - phy_interface_rrc_nr* phy = nullptr; - // mac_interface_rrc* mac = nullptr; + phy_interface_rrc_nr* phy = nullptr; + mac_interface_rrc_nr* mac = nullptr; rlc_interface_rrc* rlc = nullptr; pdcp_interface_rrc* pdcp = nullptr; gw_interface_rrc* gw = nullptr; diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index 90584f0bd..06fb77b07 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -23,6 +23,7 @@ #include #include "mac/mac.h" +#include "mac/mac_nr.h" #include "rrc/rrc.h" #include "srslte/radio/radio.h" #include "srslte/upper/pdcp.h" @@ -168,6 +169,7 @@ private: srslte::pdcp pdcp; srsue::rrc rrc; #ifdef HAVE_5GNR + srsue::mac_nr mac_nr; srsue::rrc_nr rrc_nr; #endif srsue::nas nas; diff --git a/srsue/src/stack/mac/mac_nr.cc b/srsue/src/stack/mac/mac_nr.cc index bc1e4a1f0..17e6dd453 100644 --- a/srsue/src/stack/mac/mac_nr.cc +++ b/srsue/src/stack/mac/mac_nr.cc @@ -196,19 +196,7 @@ void mac_nr::timer_expired(uint32_t timer_id) // not implemented } -void mac_nr::setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD) -{ - logical_channel_config_t config = {}; - config.lcid = lcid; - config.lcg = lcg; - config.priority = priority; - config.PBR = PBR_x_tti; - config.BSD = BSD; - config.bucket_size = config.PBR * config.BSD; - setup_lcid(config); -} - -void mac_nr::setup_lcid(const logical_channel_config_t& config) +void mac_nr::setup_lcid(const srslte::logical_channel_config_t& config) { Info("Logical Channel Setup: LCID=%d, LCG=%d, priority=%d, PBR=%d, BSD=%dms, bucket_size=%d\n", config.lcid, @@ -221,6 +209,18 @@ void mac_nr::setup_lcid(const logical_channel_config_t& config) // bsr_procedure.setup_lcid(config.lcid, config.lcg, config.priority); } +void mac_nr::set_config(const srslte::bsr_cfg_t& bsr_cfg) +{ + Info("BSR config periodic timer %d retx timer %d\n", bsr_cfg.periodic_timer, bsr_cfg.retx_timer); + Warning("Not handling BSR config yet\n"); +} + +void mac_nr::set_config(const srslte::sr_cfg_t& sr_cfg) +{ + Info("Scheduling Request Config DSR tansmax %d\n", sr_cfg.dsr_transmax); + Warning("Not Scheduling Request Config yet\n"); +} + void mac_nr::get_metrics(mac_metrics_t m[SRSLTE_MAX_CARRIERS]) {} /** diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index 977f57b33..de4315274 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -43,6 +43,7 @@ void rrc_nr::init(phy_interface_rrc_nr* phy_, rlc = rlc_; pdcp = pdcp_; gw = gw_; + mac = mac_; rrc_eutra = rrc_eutra_; timers = timers_; stack = stack_; @@ -484,29 +485,58 @@ bool rrc_nr::apply_rlc_add_mod(const rlc_bearer_cfg_s& rlc_bearer_cfg) // Setup RLC rlc->add_bearer(lc_ch_id, rlc_cfg); - uint8_t log_chan_group = 0; - uint8_t priority = 1; - int prioritized_bit_rate = -1; - int bucket_size_duration = -1; - if (rlc_bearer_cfg.mac_lc_ch_cfg_present == true && rlc_bearer_cfg.mac_lc_ch_cfg.ul_specific_params_present) { - lc_ch_cfg_s::ul_specific_params_s_ ul_specific_params = rlc_bearer_cfg.mac_lc_ch_cfg.ul_specific_params; + logical_channel_config_t logical_channel_cfg; + logical_channel_cfg = srslte::make_mac_logical_channel_cfg_t(lc_ch_id, rlc_bearer_cfg.mac_lc_ch_cfg); + mac->setup_lcid(logical_channel_cfg); + } + return true; +} +bool rrc_nr::apply_mac_cell_group(const mac_cell_group_cfg_s& mac_cell_group_cfg) +{ - if (ul_specific_params.lc_ch_group_present) { - log_chan_group = ul_specific_params.lc_ch_group; - } else { - log_h->warning("LCG not present, setting to 0\n"); + if (mac_cell_group_cfg.sched_request_cfg_present) { + sr_cfg_t sr_cfg; + if (mac_cell_group_cfg.sched_request_cfg.sched_request_to_add_mod_list_present) { + if (mac_cell_group_cfg.sched_request_cfg.sched_request_to_add_mod_list.size() > 1) { + log_h->warning("Only handling 1 scheduling request index to add\n"); + sr_cfg.dsr_transmax = mac_cell_group_cfg.sched_request_cfg.sched_request_to_add_mod_list[1].sr_trans_max; + mac->set_config(sr_cfg); + } + } + + if (mac_cell_group_cfg.sched_request_cfg.sched_request_to_release_list_present) { + log_h->warning("Not handling sched request to release list\n"); } - priority = ul_specific_params.prio; - prioritized_bit_rate = ul_specific_params.prioritised_bit_rate.to_number(); - bucket_size_duration = ul_specific_params.bucket_size_dur.to_number(); - // TODO Setup MAC @andre - // mac->setup_lcid(lc_ch_id, log_chan_group, priority, prioritized_bit_rate, bucket_size_duration); + } + if (mac_cell_group_cfg.sched_request_cfg_present) + + if (mac_cell_group_cfg.bsr_cfg_present) { + log_h->debug("Handling MAC BSR config\n"); + srslte::bsr_cfg_t bsr_cfg; + bsr_cfg.periodic_timer = mac_cell_group_cfg.bsr_cfg.periodic_bsr_timer.to_number(); + bsr_cfg.retx_timer = mac_cell_group_cfg.bsr_cfg.retx_bsr_timer.to_number(); + mac->set_config(bsr_cfg); + } + + if (mac_cell_group_cfg.tag_cfg_present) { + log_h->warning("Not handling tag cfg in MAC cell group config\n"); + } + + if (mac_cell_group_cfg.phr_cfg_present) { + log_h->warning("Not handling phr cfg in MAC cell group config\n"); + } + + if (mac_cell_group_cfg.skip_ul_tx_dynamic) { + log_h->warning("Not handling phr cfg in skip_ul_tx_dynamic cell group config\n"); } return true; } -bool rrc_nr::apply_mac_cell_group(const mac_cell_group_cfg_s& mac_cell_group_cfg) + +bool rrc_nr::apply_sp_cell_cfg(const sp_cell_cfg_s& sp_cell_cfg) { + // TODO Setup PHY @andre and @phy interface? + log_h->warning("Not handling SP Cell config\n"); return true; } @@ -520,6 +550,9 @@ bool rrc_nr::apply_cell_group_cfg(const cell_group_cfg_s& cell_group_cfg) if (cell_group_cfg.mac_cell_group_cfg_present == true) { apply_mac_cell_group(cell_group_cfg.mac_cell_group_cfg); } + if (cell_group_cfg.phys_cell_group_cfg_present == true) { + log_h->warning("Not handling physical cell group config\n"); + } if (cell_group_cfg.sp_cell_cfg_present) { // apply_sp_cell_cfg(cell_group_cfg.sp_cell_cfg); } diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 6c2ca0888..ddd8e8795 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -32,6 +32,7 @@ ue_stack_lte::ue_stack_lte() : mac("MAC", &task_sched), rrc(this, &task_sched), #ifdef HAVE_5GNR + mac_nr(&task_sched), rrc_nr(&task_sched), #endif pdcp(&task_sched, "PDCP"), @@ -122,7 +123,9 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_) pdcp.init(&rlc, &rrc, gw); nas.init(usim.get(), &rrc, gw, args.nas); #ifdef HAVE_5GNR - rrc_nr.init(nullptr, nullptr, &rlc, &pdcp, gw, &rrc, task_sched.get_timer_handler(), nullptr, args.rrc_nr); + mac_nr_args_t mac_nr_args; + mac_nr.init(mac_nr_args, nullptr, &rlc); + rrc_nr.init(nullptr, &mac_nr, &rlc, &pdcp, gw, &rrc, task_sched.get_timer_handler(), nullptr, args.rrc_nr); rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &rrc_nr, args.rrc); #else rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, args.rrc); diff --git a/srsue/test/ttcn3/src/CMakeLists.txt b/srsue/test/ttcn3/src/CMakeLists.txt index 1a4d0303c..10f32eecb 100644 --- a/srsue/test/ttcn3/src/CMakeLists.txt +++ b/srsue/test/ttcn3/src/CMakeLists.txt @@ -25,7 +25,7 @@ set(LINK_LIBRARIES srsue_stack ${Boost_LIBRARIES}) if (ENABLE_5GNR) - set(LINK_LIBRARIES ${LINK_LIBRARIES} rrc_nr_asn1) + set(LINK_LIBRARIES ${LINK_LIBRARIES} rrc_nr_asn1 srsue_mac_nr srslte_mac) endif (ENABLE_5GNR) target_link_libraries(ttcn3_dut ${LINK_LIBRARIES}) From 306bb6b38b0a5d5eaff9c4f2d5b2ccd6d043f697 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Fri, 22 Jan 2021 13:43:53 +0100 Subject: [PATCH 125/138] Added function for derive keys --- lib/include/srslte/common/liblte_security.h | 13 +++ lib/include/srslte/common/security.h | 14 +++ lib/src/common/liblte_security.cc | 109 ++++++++++++++++++++ lib/src/common/security.cc | 31 ++++++ lib/test/common/test_f12345.cc | 69 +++++++++++++ 5 files changed, 236 insertions(+) diff --git a/lib/include/srslte/common/liblte_security.h b/lib/include/srslte/common/liblte_security.h index 43d7a2553..180a66502 100644 --- a/lib/include/srslte/common/liblte_security.h +++ b/lib/include/srslte/common/liblte_security.h @@ -146,6 +146,7 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8* uint8* k_up_enc, uint8* k_up_int); +LIBLTE_ERROR_ENUM liblte_security_generate_sk_gnb(uint8_t* k_enb, uint8_t* sk_gnb, uint16_t scg_counter); /********************************************************************* Name: liblte_security_128_eia2 @@ -336,4 +337,16 @@ liblte_security_milenage_f2345(uint8* k, uint8* op, uint8* rand, uint8* res, uin // Functions LIBLTE_ERROR_ENUM liblte_security_milenage_f5_star(uint8* k, uint8* op, uint8* rand, uint8* ak); +LIBLTE_ERROR_ENUM liblte_security_generate_k_nr_rrc(uint8* k_gnb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_rrc_enc, + uint8* k_rrc_int); + +LIBLTE_ERROR_ENUM liblte_security_generate_k_nr_up(uint8* k_gnb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_up_enc, + uint8* k_up_int); + #endif // SRSLTE_LIBLTE_SECURITY_H diff --git a/lib/include/srslte/common/security.h b/lib/include/srslte/common/security.h index c6b6a9082..3595a0551 100644 --- a/lib/include/srslte/common/security.h +++ b/lib/include/srslte/common/security.h @@ -104,6 +104,20 @@ uint8_t security_generate_k_up(uint8_t* k_enb, uint8_t* k_up_enc, uint8_t* k_up_int); +uint8_t security_generate_k_nr_rrc(uint8_t* k_gnb, + CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8_t* k_rrc_enc, + uint8_t* k_rrc_int); + +uint8_t security_generate_k_nr_up(uint8_t* k_gnb, + CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8_t* k_up_enc, + uint8_t* k_up_int); + +uint8_t security_generate_sk_gnb(uint8_t* k_enb, uint8_t* sk_gnb, uint16_t scg_count); + /****************************************************************************** * Integrity Protection *****************************************************************************/ diff --git a/lib/src/common/liblte_security.cc b/lib/src/common/liblte_security.cc index aba39008f..a1ca336fc 100644 --- a/lib/src/common/liblte_security.cc +++ b/lib/src/common/liblte_security.cc @@ -276,6 +276,115 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_rrc(uint8* return (err); } +LIBLTE_ERROR_ENUM liblte_security_generate_k_nr_rrc(uint8* k_gnb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_rrc_enc, + uint8* k_rrc_int) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[7]; + + if (k_gnb != NULL && k_rrc_enc != NULL && k_rrc_int != NULL) { + // Construct S for KRRCenc + s[0] = 0x69; // FC + s[1] = 0x03; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = enc_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KRRCenc + sha256(k_gnb, 32, s, 7, k_rrc_enc, 0); + + // Construct S for KRRCint + s[0] = 0x69; // FC + s[1] = 0x04; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = int_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KRRCint + sha256(k_gnb, 32, s, 7, k_rrc_int, 0); + + err = LIBLTE_SUCCESS; + } + + return (err); +} + +LIBLTE_ERROR_ENUM liblte_security_generate_k_nr_up(uint8* k_gnb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_up_enc, + uint8* k_up_int) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[7]; + + if (k_gnb != NULL && k_up_enc != NULL && k_up_int != NULL) { + // Construct S for KUPenc + s[0] = 0x69; // FC + s[1] = 0x05; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = enc_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KUPenc + sha256(k_gnb, 32, s, 7, k_up_enc, 0); + + // Construct S for KUPint + s[0] = 0x69; // FC + s[1] = 0x06; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = int_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KUPint + sha256(k_gnb, 32, s, 7, k_up_int, 0); + + err = LIBLTE_SUCCESS; + } + + return (err); +} + +/********************************************************************* + Name: liblte_security_generate_sk_gnb + + Description: Derivation of S-KeNB or S-KgNB for dual connectivity. + + Document Reference: 33.401 v10.0.0 Annex A.15 +*********************************************************************/ + +LIBLTE_ERROR_ENUM liblte_security_generate_sk_gnb(uint8_t* k_enb, uint8_t* sk_gnb, uint16_t scg_counter) +{ + + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[5]; + + if (k_enb != NULL && sk_gnb != NULL) { + // Construct S for sk_gnb + s[0] = 0x1C; // FC + s[1] = (scg_counter >> 8) & 0xFF; // first byte of P0 + s[2] = scg_counter & 0xFF; // second byte of P0 + s[3] = 0x00; // First byte of L0 + s[4] = 0x02; // Second byte of L0 + + // Derive sk_gnb + sha256(k_enb, 32, s, 5, sk_gnb, 0); + err = LIBLTE_SUCCESS; + } + + return (err); +} /********************************************************************* Name: liblte_security_generate_k_up diff --git a/lib/src/common/security.cc b/lib/src/common/security.cc index 8be620ba2..16ce13669 100644 --- a/lib/src/common/security.cc +++ b/lib/src/common/security.cc @@ -93,6 +93,37 @@ uint8_t security_generate_k_up(uint8_t* k_enb, k_up_int); } +uint8_t security_generate_k_nr_rrc(uint8_t* k_gnb, + CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8_t* k_rrc_enc, + uint8_t* k_rrc_int) +{ + return liblte_security_generate_k_nr_rrc(k_gnb, + (LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM)enc_alg_id, + (LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM)int_alg_id, + k_rrc_enc, + k_rrc_int); +} + +uint8_t security_generate_k_nr_up(uint8_t* k_gnb, + CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8_t* k_up_enc, + uint8_t* k_up_int) +{ + return liblte_security_generate_k_nr_up(k_gnb, + (LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM)enc_alg_id, + (LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM)int_alg_id, + k_up_enc, + k_up_int); +} + +uint8_t security_generate_sk_gnb(uint8_t* k_enb, uint8_t* sk_gnb, uint16_t scg_count) +{ + return liblte_security_generate_sk_gnb(k_enb, sk_gnb, scg_count); +} + /****************************************************************************** * Integrity Protection *****************************************************************************/ diff --git a/lib/test/common/test_f12345.cc b/lib/test/common/test_f12345.cc index 54102656a..4a51211e8 100644 --- a/lib/test/common/test_f12345.cc +++ b/lib/test/common/test_f12345.cc @@ -153,6 +153,73 @@ int test_set_2() ; } +int test_set_ksg() +{ + LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; + int32 err_cmp = 0; + + uint8_t k_enb[] = {0xfe, 0x7d, 0xee, 0x80, 0x8d, 0x7f, 0x3b, 0x88, 0x2a, 0x08, 0x2c, 0xbd, 0xc8, 0x39, 0x0d, 0x12, + 0x9e, 0x5d, 0x28, 0xaf, 0x0e, 0x83, 0x22, 0xeb, 0x57, 0x3a, 0xda, 0x36, 0xf2, 0x1a, 0x5a, 0x89}; + uint8_t sk_gnb_o[32]; + uint16_t scg_counter = 0; + err_lte = liblte_security_generate_sk_gnb(k_enb, sk_gnb_o, scg_counter); + TESTASSERT(err_lte == LIBLTE_SUCCESS); + arrprint(sk_gnb_o, sizeof(sk_gnb_o)); + uint8_t sk_gnb[] = {0x45, 0xcb, 0xc3, 0xf8, 0xa8, 0x11, 0x93, 0xfd, 0x5c, 0x52, 0x29, 0x30, 0x0d, 0x59, 0xed, 0xf8, + 0x12, 0xe9, 0x98, 0xa1, 0x15, 0xec, 0x4e, 0x0c, 0xe9, 0x03, 0xba, 0x89, 0x36, 0x7e, 0x26, 0x28}; + err_cmp = arrcmp(sk_gnb_o, sk_gnb, sizeof(sk_gnb)); + TESTASSERT(err_cmp == 0); + return SRSLTE_SUCCESS; +} + +int test_set_nr_rrc_up() +{ + LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS; + int32 err_cmp = 0; + + uint8_t sk_gnb[] = {0x45, 0xcb, 0xc3, 0xf8, 0xa8, 0x11, 0x93, 0xfd, 0x5c, 0x52, 0x29, 0x30, 0x0d, 0x59, 0xed, 0xf8, + 0x12, 0xe9, 0x98, 0xa1, 0x15, 0xec, 0x4e, 0x0c, 0xe9, 0x03, 0xba, 0x89, 0x36, 0x7e, 0x26, 0x28}; + + uint8_t sk_gnb_o[32]; + uint8_t k_rrc_enc_o[32]; + uint8_t k_rrc_int_o[32]; + + err_lte = liblte_security_generate_k_nr_rrc(sk_gnb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_128_EEA2, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_EIA0, + k_rrc_enc_o, + k_rrc_int_o); + + TESTASSERT(err_lte == LIBLTE_SUCCESS); + printf("RRC ENC output:\n"); + arrprint(&k_rrc_enc_o[0], sizeof(k_rrc_enc_o)); + uint8_t k_rrc_enc[] = {0x52, 0xa9, 0x95, 0xdf, 0xf8, 0x9b, 0xc2, 0x94, 0xbd, 0x89, 0xff, + 0xb1, 0x37, 0xa2, 0x9f, 0x24, 0x66, 0xa0, 0x9e, 0x99, 0x23, 0x86, + 0xc8, 0xd1, 0xdf, 0x78, 0x92, 0x96, 0x4c, 0x6f, 0xb5, 0x22}; + + err_cmp = arrcmp(k_rrc_enc_o, k_rrc_enc, sizeof(k_rrc_enc_o)); + + TESTASSERT(err_cmp == 0); + + uint8_t k_up_enc_o[32]; + uint8_t k_up_int_o[32]; + + err_lte = liblte_security_generate_k_nr_up(sk_gnb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_128_EEA2, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_EIA0, + k_up_enc_o, + k_up_int_o); + + uint8_t k_up_enc[] = {0x7c, 0xe2, 0x06, 0x70, 0xbb, 0xbc, 0xc5, 0x90, 0x40, 0x87, 0xc0, 0xd4, 0x26, 0x53, 0xc5, 0x40, + 0x15, 0x20, 0x52, 0xd3, 0xdf, 0xbc, 0x3f, 0x05, 0x86, 0x9b, 0x7f, 0x92, 0x00, 0x95, 0xbe, 0x68}; + printf("UP ENC output:\n"); + arrprint(&k_up_enc_o[0], sizeof(k_up_enc_o)); + + err_cmp = arrcmp(k_up_enc_o, k_up_enc, sizeof(k_up_enc_o)); + TESTASSERT(err_cmp == 0); + return SRSLTE_SUCCESS; +} + /* Own test sets */ @@ -161,5 +228,7 @@ int main(int argc, char* argv[]) { TESTASSERT(test_set_2() == SRSLTE_SUCCESS); + TESTASSERT(test_set_ksg() == SRSLTE_SUCCESS); + TESTASSERT(test_set_nr_rrc_up() == SRSLTE_SUCCESS); return SRSLTE_SUCCESS; } From 1b19ee40e7d372bf788b46eba419f211e3c1402c Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Fri, 22 Jan 2021 14:28:12 +0100 Subject: [PATCH 126/138] Added usim features for key derivation --- lib/include/srslte/common/security.h | 4 ++ lib/include/srslte/interfaces/ue_interfaces.h | 7 +++ srsue/hdr/stack/rrc/rrc_nr.h | 4 ++ srsue/hdr/stack/upper/usim_base.h | 7 ++- srsue/src/stack/rrc/rrc_nr.cc | 39 ++++++++++++--- srsue/src/stack/ue_stack_lte.cc | 3 +- srsue/src/stack/ue_stack_nr.cc | 3 +- srsue/src/stack/upper/usim_base.cc | 50 +++++++++++++++++-- 8 files changed, 103 insertions(+), 14 deletions(-) diff --git a/lib/include/srslte/common/security.h b/lib/include/srslte/common/security.h index 3595a0551..a8d7257cc 100644 --- a/lib/include/srslte/common/security.h +++ b/lib/include/srslte/common/security.h @@ -60,6 +60,10 @@ struct k_enb_context_t { uint32_t ncc; }; +struct k_gnb_context_t { + as_key_t sk_gnb; +}; + struct as_security_config_t { as_key_t k_rrc_int; as_key_t k_rrc_enc; diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index 64e4a7367..2c3bcfb0e 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -280,6 +280,13 @@ public: virtual bool is_config_pending() = 0; }; +class usim_interface_rrc_nr +{ +public: + virtual void generate_nr_context(uint16_t sk_counter, srslte::as_security_config_t* sec_cfg) = 0; + virtual void update_nr_context(srslte::as_security_config_t* sec_cfg) = 0; +}; + // PDCP interface for RLC class pdcp_interface_rlc { diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index c1f75907f..b1e1ffece 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -55,6 +55,7 @@ public: pdcp_interface_rrc* pdcp_, gw_interface_rrc* gw_, rrc_eutra_interface_rrc_nr* rrc_eutra_, + usim_interface_rrc_nr* usim_, srslte::timer_handler* timers_, stack_interface_rrc* stack_, const rrc_nr_args_t& args_); @@ -110,6 +111,7 @@ public: uint32_t sk_counter_r15, bool nr_radio_bearer_cfg1_r15_present, asn1::dyn_octstring nr_radio_bearer_cfg1_r15); + void configure_sk_counter(uint16_t sk_counter); bool is_config_pending(); // STACK interface void cell_search_completed(const rrc_interface_phy_lte::cell_search_ret_t& cs_ret, const phy_cell_t& found_cell); @@ -131,6 +133,7 @@ private: pdcp_interface_rrc* pdcp = nullptr; gw_interface_rrc* gw = nullptr; rrc_eutra_interface_rrc_nr* rrc_eutra = nullptr; + usim_interface_rrc_nr* usim = nullptr; stack_interface_rrc* stack = nullptr; srslte::log_ref log_h; @@ -185,6 +188,7 @@ private: srslte::proc_outcome_t init(const bool endc_release_and_add_r15, const asn1::rrc_nr::rrc_recfg_s& rrc_recfg, const asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg, + bool sk_counter_r15_present, const uint32_t sk_counter_r15, const asn1::rrc_nr::radio_bearer_cfg_s& radio_bearer_cfg); srslte::proc_outcome_t step() { return srslte::proc_outcome_t::yield; } diff --git a/srsue/hdr/stack/upper/usim_base.h b/srsue/hdr/stack/upper/usim_base.h index 266659b05..b4e1db9ae 100644 --- a/srsue/hdr/stack/upper/usim_base.h +++ b/srsue/hdr/stack/upper/usim_base.h @@ -54,7 +54,7 @@ public: std::string reader; }; -class usim_base : public usim_interface_nas, public usim_interface_rrc +class usim_base : public usim_interface_nas, public usim_interface_rrc, public usim_interface_rrc_nr { public: usim_base(srslte::log* log_); @@ -92,6 +92,10 @@ public: void store_keys_before_ho(const srslte::as_security_config_t& as_ctx) final; void restore_keys_from_failed_ho(srslte::as_security_config_t* as_ctx) final; + // NR RRC interface + void generate_nr_context(uint16_t sk_counter, srslte::as_security_config_t* sec_cfg) final; + void update_nr_context(srslte::as_security_config_t* sec_cfg) final; + // Helpers std::string get_mcc_str(const uint8_t* imsi_vec); virtual std::string get_mnc_str(const uint8_t* imsi_vec, std::string mcc_str) = 0; @@ -120,6 +124,7 @@ protected: // Current K_eNB context (K_eNB, NH and NCC) srslte::k_enb_context_t k_enb_ctx = {}; + srslte::k_gnb_context_t k_gnb_ctx = {}; // Helpers to restore security context if HO fails srslte::k_enb_context_t old_k_enb_ctx = {}; diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index de4315274..a2d603d98 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -12,6 +12,7 @@ #include "srsue/hdr/stack/rrc/rrc_nr.h" #include "srslte/common/security.h" +#include "srsue/hdr/stack/upper/usim.h" #define Error(fmt, ...) rrc_ptr->log_h->error("Proc \"%s\" - " fmt, name(), ##__VA_ARGS__) #define Warning(fmt, ...) rrc_ptr->log_h->warning("Proc \"%s\" - " fmt, name(), ##__VA_ARGS__) @@ -35,6 +36,7 @@ void rrc_nr::init(phy_interface_rrc_nr* phy_, pdcp_interface_rrc* pdcp_, gw_interface_rrc* gw_, rrc_eutra_interface_rrc_nr* rrc_eutra_, + usim_interface_rrc_nr* usim_, srslte::timer_handler* timers_, stack_interface_rrc* stack_, const rrc_nr_args_t& args_) @@ -45,6 +47,7 @@ void rrc_nr::init(phy_interface_rrc_nr* phy_, gw = gw_; mac = mac_; rrc_eutra = rrc_eutra_; + usim = usim_; timers = timers_; stack = stack_; args = args_; @@ -368,8 +371,12 @@ bool rrc_nr::rrc_reconfiguration(bool endc_release_and_add_r15, } log_rrc_message("RRC NR Reconfiguration", Rx, nr_radio_bearer_cfg1_r15, radio_bearer_cfg, "Radio Bearer Config R15"); - if (not conn_recfg_proc.launch( - endc_release_and_add_r15, rrc_recfg, cell_group_cfg, sk_counter_r15, radio_bearer_cfg)) { + if (not conn_recfg_proc.launch(endc_release_and_add_r15, + rrc_recfg, + cell_group_cfg, + sk_counter_r15_present, + sk_counter_r15, + radio_bearer_cfg)) { log_h->error("Unable to launch NR RRC configuration procedure\n"); return false; } else { @@ -436,6 +443,11 @@ void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15) fake_measurement_timer.run(); } +void rrc_nr::configure_sk_counter(uint16_t sk_counter) +{ + log_h->info("[NR] Configure new SK counter %d. Update Key for secondary gnb\n", sk_counter); + usim->generate_nr_context(sk_counter, &sec_cfg); +} bool rrc_nr::is_config_pending() { if (conn_recfg_proc.is_busy()) { @@ -600,6 +612,14 @@ bool rrc_nr::apply_drb_add_mod(const drb_to_add_mod_s& drb_cfg) bool rrc_nr::apply_security_cfg(const security_cfg_s& security_cfg) { + + // TODO derive correct keys + if (security_cfg.key_to_use_present) { + if (security_cfg.key_to_use.value != security_cfg_s::key_to_use_opts::options::secondary) { + log_h->warning("Only secondary key supported yet\n"); + } + } + if (security_cfg.security_algorithm_cfg_present) { switch (security_cfg.security_algorithm_cfg.ciphering_algorithm) { case ciphering_algorithm_e::nea0: @@ -638,11 +658,8 @@ bool rrc_nr::apply_security_cfg(const security_cfg_s& security_cfg) break; } } + usim->update_nr_context(&sec_cfg); } - // TODO derive correct keys - if (security_cfg.key_to_use_present) { - } - // TODO derive correct keys // Apply security config for all known NR lcids for (auto& lcid : lcid_rb) { @@ -676,8 +693,9 @@ rrc_nr::connection_reconf_no_ho_proc::connection_reconf_no_ho_proc(rrc_nr* paren proc_outcome_t rrc_nr::connection_reconf_no_ho_proc::init(const bool endc_release_and_add_r15, const asn1::rrc_nr::rrc_recfg_s& rrc_recfg, - const asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg, - const uint32_t sk_counter_r15, + const asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg, + bool sk_counter_r15_present, + const uint32_t sk_counter_r15, const asn1::rrc_nr::radio_bearer_cfg_s& radio_bearer_cfg) { Info("Starting...\n"); @@ -687,6 +705,11 @@ proc_outcome_t rrc_nr::connection_reconf_no_ho_proc::init(const bool return proc_outcome_t::error; } + if (sk_counter_r15_present) { + Info("Applying Cell Group Cfg\n"); + rrc_ptr->configure_sk_counter((uint16_t)sk_counter_r15); + } + Info("Applying Radio Bearer Cfg\n"); if (!rrc_ptr->apply_radio_bearer_cfg(radio_bearer_cfg)) { return proc_outcome_t::error; diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index ddd8e8795..03b13e382 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -125,7 +125,8 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_) #ifdef HAVE_5GNR mac_nr_args_t mac_nr_args; mac_nr.init(mac_nr_args, nullptr, &rlc); - rrc_nr.init(nullptr, &mac_nr, &rlc, &pdcp, gw, &rrc, task_sched.get_timer_handler(), nullptr, args.rrc_nr); + rrc_nr.init( + nullptr, &mac_nr, &rlc, &pdcp, gw, &rrc, usim.get(), task_sched.get_timer_handler(), nullptr, args.rrc_nr); rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &rrc_nr, args.rrc); #else rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, args.rrc); diff --git a/srsue/src/stack/ue_stack_nr.cc b/srsue/src/stack/ue_stack_nr.cc index 4647779b1..f044bd085 100644 --- a/srsue/src/stack/ue_stack_nr.cc +++ b/srsue/src/stack/ue_stack_nr.cc @@ -83,7 +83,8 @@ int ue_stack_nr::init(const stack_args_t& args_) rrc_args.log_hex_limit = args.log.rrc_hex_limit; rrc_args.coreless.drb_lcid = 4; rrc_args.coreless.ip_addr = "192.168.1.3"; - rrc->init(phy, mac.get(), rlc.get(), pdcp.get(), gw, nullptr, task_sched.get_timer_handler(), this, rrc_args); + rrc->init( + phy, mac.get(), rlc.get(), pdcp.get(), gw, nullptr, nullptr, task_sched.get_timer_handler(), this, rrc_args); rrc->init_core_less(); running = true; start(STACK_MAIN_THREAD_PRIO); diff --git a/srsue/src/stack/upper/usim_base.cc b/srsue/src/stack/upper/usim_base.cc index 015c96190..49aff9340 100644 --- a/srsue/src/stack/upper/usim_base.cc +++ b/srsue/src/stack/upper/usim_base.cc @@ -175,10 +175,10 @@ void usim_base::generate_as_keys(uint8_t* k_asme_, uint32_t count_ul, srslte::as k_enb_ctx.is_first_ncc = true; log->debug_hex(k_enb_ctx.k_enb.data(), 32, "Initial K_eNB"); - log->debug_hex(sec_cfg->k_rrc_enc.data(), sec_cfg->k_rrc_enc.size(), "K_RRC_enc"); - log->debug_hex(sec_cfg->k_rrc_enc.data(), sec_cfg->k_rrc_enc.size(), "K_RRC_enc"); - log->debug_hex(sec_cfg->k_rrc_int.data(), sec_cfg->k_rrc_int.size(), "K_RRC_int"); log->debug_hex(sec_cfg->k_rrc_int.data(), sec_cfg->k_rrc_int.size(), "K_RRC_int"); + log->debug_hex(sec_cfg->k_rrc_enc.data(), sec_cfg->k_rrc_enc.size(), "K_RRC_enc"); + log->debug_hex(sec_cfg->k_up_int.data(), sec_cfg->k_up_int.size(), "K_UP_int"); + log->debug_hex(sec_cfg->k_up_enc.data(), sec_cfg->k_up_enc.size(), "K_UP_enc"); } void usim_base::generate_as_keys_ho(uint32_t pci, uint32_t earfcn, int ncc, srslte::as_security_config_t* sec_cfg) @@ -265,4 +265,48 @@ void usim_base::restore_keys_from_failed_ho(srslte::as_security_config_t* as_ctx return; } +/* + * NR RRC Interface + */ + +void usim_base::generate_nr_context(uint16_t sk_counter, srslte::as_security_config_t* sec_cfg) +{ + if (!initiated) { + log->error("USIM not initiated!\n"); + return; + } + log->info("Generating Keys. SCG Counter %d\n", sk_counter); + + srslte::security_generate_sk_gnb(k_enb_ctx.k_enb.data(), k_gnb_ctx.sk_gnb.data(), sk_counter); + log->info_hex(k_gnb_ctx.sk_gnb.data(), 32, "k_sk_gnb"); + update_nr_context(sec_cfg); +} + +void usim_base::update_nr_context(srslte::as_security_config_t* sec_cfg) +{ + if (!initiated) { + log->error("USIM not initiated!\n"); + return; + } + log->info_hex(k_gnb_ctx.sk_gnb.data(), 32, "k_sk_gnb"); + // Generate K_rrc_enc and K_rrc_int + security_generate_k_nr_rrc(k_gnb_ctx.sk_gnb.data(), + sec_cfg->cipher_algo, + sec_cfg->integ_algo, + sec_cfg->k_rrc_enc.data(), + sec_cfg->k_rrc_int.data()); + + // Generate K_up_enc and K_up_int + security_generate_k_nr_up(k_gnb_ctx.sk_gnb.data(), + sec_cfg->cipher_algo, + sec_cfg->integ_algo, + sec_cfg->k_up_enc.data(), + sec_cfg->k_up_int.data()); + + log->debug_hex(sec_cfg->k_rrc_int.data(), sec_cfg->k_rrc_int.size(), "NR K_RRC_int"); + log->debug_hex(sec_cfg->k_rrc_enc.data(), sec_cfg->k_rrc_enc.size(), "NR K_RRC_enc"); + log->debug_hex(sec_cfg->k_up_int.data(), sec_cfg->k_up_int.size(), "NR K_UP_int"); + log->debug_hex(sec_cfg->k_up_enc.data(), sec_cfg->k_up_enc.size(), "NR K_UP_enc"); +} + } // namespace srsue From 9ccc36d4fa0fa4d45a96f72d284f6a7347a39f3e Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Mon, 25 Jan 2021 13:50:44 +0100 Subject: [PATCH 127/138] Make fake measurement frequency depend on measurement config --- srsue/hdr/stack/rrc/rrc_nr.h | 1 + srsue/src/stack/rrc/rrc_nr.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/srsue/hdr/stack/rrc/rrc_nr.h b/srsue/hdr/stack/rrc/rrc_nr.h index b1e1ffece..aaef98453 100644 --- a/srsue/hdr/stack/rrc/rrc_nr.h +++ b/srsue/hdr/stack/rrc/rrc_nr.h @@ -138,6 +138,7 @@ private: srslte::log_ref log_h; + uint32_t fake_measurement_carrier_freq_r15; srslte::timer_handler::unique_timer fake_measurement_timer; /// RRC states (3GPP 38.331 v15.5.1 Sec 4.2.1) diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index a2d603d98..f5d2db15d 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -92,7 +92,7 @@ void rrc_nr::timer_expired(uint32_t timeout_id) fake_meas.rsrp = -60.0; fake_meas.rsrq = -60.0; fake_meas.cfo_hz = 1.0; - fake_meas.arfcn_nr = 632256; + fake_meas.arfcn_nr = fake_measurement_carrier_freq_r15; fake_meas.pci_nr = 500; phy_meas_nr.push_back(fake_meas); rrc_eutra->new_cell_meas_nr(phy_meas_nr); @@ -439,6 +439,7 @@ void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15) log_h->debug("[NR] Measuring phy cell %d \n", carrier_freq_r15); // Start timer for fake measurements auto timer_expire_func = [this](uint32_t tid) { timer_expired(tid); }; + fake_measurement_carrier_freq_r15 = carrier_freq_r15; fake_measurement_timer.set(10, timer_expire_func); fake_measurement_timer.run(); } From d100919561c79934ce363e024fb02ebe543b9d46 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 12 Jan 2021 10:24:52 +0100 Subject: [PATCH 128/138] Initial NR-UCI encoder --- lib/include/srslte/phy/phch/pucch_nr.h | 49 +++ lib/include/srslte/phy/phch/uci_cfg_nr.h | 40 ++ lib/include/srslte/phy/phch/uci_nr.h | 80 ++++ lib/src/phy/phch/uci_nr.c | 484 +++++++++++++++++++++++ 4 files changed, 653 insertions(+) create mode 100644 lib/include/srslte/phy/phch/pucch_nr.h create mode 100644 lib/include/srslte/phy/phch/uci_cfg_nr.h create mode 100644 lib/include/srslte/phy/phch/uci_nr.h create mode 100644 lib/src/phy/phch/uci_nr.c diff --git a/lib/include/srslte/phy/phch/pucch_nr.h b/lib/include/srslte/phy/phch/pucch_nr.h new file mode 100644 index 000000000..942ab5c67 --- /dev/null +++ b/lib/include/srslte/phy/phch/pucch_nr.h @@ -0,0 +1,49 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_PUCCH_NR_H +#define SRSLTE_PUCCH_NR_H + +#include "srslte/config.h" +#include +#include + +typedef enum SRSLTE_API { + SRSLTE_PUCCH_NR_FORMAT_0 = 0, + SRSLTE_PUCCH_NR_FORMAT_1, + SRSLTE_PUCCH_NR_FORMAT_2, + SRSLTE_PUCCH_NR_FORMAT_3, + SRSLTE_PUCCH_NR_FORMAT_4, + SRSLTE_PUCCH_NR_FORMAT_ERROR, +} srslte_pucch_nr_format_t; + +/** + * @brief Generic PUCCH Resource configuration + */ +typedef struct SRSLTE_API { + // Common + srslte_pucch_nr_format_t format; ///< PUCCH format this configuration belongs + uint32_t nof_symbols; ///< Number of symbols + uint32_t start_symbol_idx; ///< Starting symbol index + double max_code_rate; ///< Maximum code rate (0.08, 0.15, 0.25, 0.35, 0.45, 0.60, 0.80) + bool enable_pi_bpsk; ///< Enables PI-BPSK + + // Other parameters + uint32_t initial_cyclic_shift; ///< Used by formats 0, 1 + uint32_t time_domain_occ; ///< Used by format 1 + uint32_t nof_prb; ///< Used by formats 2, 3 + uint32_t occ_lenth; ///< Spreading factor, used by format 4 + uint32_t occ_index; ///< Used by format 4 + +} srslte_pucch_nr_cfg_t; + +#endif // SRSLTE_PUCCH_NR_H diff --git a/lib/include/srslte/phy/phch/uci_cfg_nr.h b/lib/include/srslte/phy/phch/uci_cfg_nr.h new file mode 100644 index 000000000..0f47924d9 --- /dev/null +++ b/lib/include/srslte/phy/phch/uci_cfg_nr.h @@ -0,0 +1,40 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_UCI_CFG_NR_H +#define SRSLTE_UCI_CFG_NR_H + +#include +#include + +#define SRSLTE_UCI_NR_MAX_ACK_BITS 10 +#define SRSLTE_UCI_NR_MAX_SR_BITS 10 +#define SRSLTE_UCI_NR_MAX_CSI1_BITS 10 +#define SRSLTE_UCI_NR_MAX_CSI2_BITS 10 + +typedef struct SRSLTE_API { + uint32_t o_ack; ///< Number of HARQ-ACK bits + uint32_t o_sr; ///< Number of SR bits + uint32_t o_csi1; ///< Number of CSI1 report number of bits + uint32_t o_csi2; ///< Number of CSI2 report number of bits + srslte_mod_t modulation; ///< Modulation +} srslte_uci_cfg_nr_t; + +typedef struct SRSLTE_API { + uint8_t ack[SRSLTE_UCI_NR_MAX_ACK_BITS]; + uint8_t sr[SRSLTE_UCI_NR_MAX_SR_BITS]; + uint8_t csi1[SRSLTE_UCI_NR_MAX_CSI1_BITS]; + uint8_t csi2[SRSLTE_UCI_NR_MAX_CSI2_BITS]; + bool valid; +} srslte_uci_value_nr_t; + +#endif // SRSLTE_UCI_CFG_NR_H diff --git a/lib/include/srslte/phy/phch/uci_nr.h b/lib/include/srslte/phy/phch/uci_nr.h new file mode 100644 index 000000000..8f9a3ac36 --- /dev/null +++ b/lib/include/srslte/phy/phch/uci_nr.h @@ -0,0 +1,80 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_UCI_NR_H +#define SRSLTE_UCI_NR_H + +#include "srslte/phy/fec/crc.h" +#include "srslte/phy/fec/polar/polar_code.h" +#include "srslte/phy/fec/polar/polar_encoder.h" +#include "srslte/phy/fec/polar/polar_rm.h" +#include "srslte/phy/phch/pucch_nr.h" +#include "uci_cfg.h" +#include "uci_cfg_nr.h" +#include +#include + +typedef struct { + bool disable_simd; +} srslte_uci_nr_args_t; + +typedef struct { + +} srslte_uci_nr_cfg_t; + +typedef struct { + srslte_polar_rm_t rm; + srslte_polar_encoder_t encoder; + srslte_crc_t crc6; + srslte_crc_t crc11; + srslte_polar_code_t code; + uint8_t* bit_sequence; ///< UCI bit sequence + uint8_t* c; ///< UCI code-block prior encoding or after decoding + uint8_t* allocated; ///< Polar code intermediate + uint8_t* d; ///< Polar code encoded intermediate +} srslte_uci_nr_t; + +/** + * @brief Initialises NR-UCI encoder/decoder object + * @param[in,out] q NR-UCI object + * @param[in] args Configuration arguments + * @return SRSLTE_SUCCESS if initialization is successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args); + +/** + * @brief Deallocates NR-UCI encoder/decoder object + * @param[in,out] q NR-UCI object + */ +SRSLTE_API void srslte_uci_nr_free(srslte_uci_nr_t* q); + +/** + * @brief Encodes UCI bits + * + * @attention Compatible only with PUCCH formats 2, 3 and 4 + * + * @remark Defined in TS 38.212 section 6.3.1.1 + * + * @param[in,out] q NR-UCI object + * @param[in] pucch_cfg Higher layers PUCCH configuration + * @param[in] uci_cfg UCI configuration + * @param[in] uci_value UCI values + * @param[out] o Output encoded bits + * @return Number of encoded bits if encoding is successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, + const srslte_pucch_nr_cfg_t* pucch_cfg, + const srslte_uci_cfg_nr_t* uci_cfg, + const srslte_uci_value_nr_t* value, + uint8_t* o); + +#endif // SRSLTE_UCI_NR_H diff --git a/lib/src/phy/phch/uci_nr.c b/lib/src/phy/phch/uci_nr.c new file mode 100644 index 000000000..8b6ed9a90 --- /dev/null +++ b/lib/src/phy/phch/uci_nr.c @@ -0,0 +1,484 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/phch/uci_nr.h" +#include "srslte/phy/fec/block/block.h" +#include "srslte/phy/fec/polar/polar_chanalloc.h" +#include "srslte/phy/phch/uci_cfg.h" +#include "srslte/phy/utils/vector.h" + +// TS 38.212 section 5.2.1 Polar coding: The value of A is no larger than 1706. +#define UCI_NR_MAX_A 1906U +#define UCI_NR_MAX_L 11U +#define UCI_NR_POLAR_MAX 2048U +#define UCI_NR_POLAR_RM_IBIL 0 + +int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args) +{ + if (q == NULL || args == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + srslte_polar_encoder_type_t polar_encoder_type = SRSLTE_POLAR_ENCODER_PIPELINED; +#ifdef LV_HAVE_AVX2 + if (!args->disable_simd) { + polar_encoder_type = SRSLTE_POLAR_ENCODER_AVX2; + } +#endif // LV_HAVE_AVX2 + + if (srslte_polar_encoder_init(&q->encoder, polar_encoder_type, NMAX_LOG) < SRSLTE_SUCCESS) { + ERROR("Initialising polar encoder\n"); + return SRSLTE_ERROR; + } + + if (srslte_polar_rm_tx_init(&q->rm) < SRSLTE_SUCCESS) { + ERROR("Initialising polar RM\n"); + return SRSLTE_ERROR; + } + + if (srslte_crc_init(&q->crc6, SRSLTE_LTE_CRC6, 6) < SRSLTE_SUCCESS) { + ERROR("Initialising CRC\n"); + return SRSLTE_ERROR; + } + + if (srslte_crc_init(&q->crc11, SRSLTE_LTE_CRC11, 11) < SRSLTE_SUCCESS) { + ERROR("Initialising CRC\n"); + return SRSLTE_ERROR; + } + + // Allocate bit sequence with space for the CRC + q->bit_sequence = srslte_vec_u8_malloc(UCI_NR_MAX_A); + if (q->bit_sequence == NULL) { + ERROR("Error malloc\n"); + return SRSLTE_ERROR; + } + + // Allocate c with space for a and the CRC + q->c = srslte_vec_u8_malloc(UCI_NR_MAX_A + UCI_NR_MAX_L); + if (q->c == NULL) { + ERROR("Error malloc\n"); + return SRSLTE_ERROR; + } + + q->allocated = srslte_vec_u8_malloc(UCI_NR_POLAR_MAX); + if (q->allocated == NULL) { + ERROR("Error malloc\n"); + return SRSLTE_ERROR; + } + + q->d = srslte_vec_u8_malloc(UCI_NR_POLAR_MAX); + if (q->d == NULL) { + ERROR("Error malloc\n"); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +void srslte_uci_nr_free(srslte_uci_nr_t* q) +{ + if (q == NULL) { + return; + } + + srslte_polar_encoder_free(&q->encoder); + + if (q->bit_sequence != NULL) { + free(q->bit_sequence); + } + if (q->c != NULL) { + free(q->c); + } + if (q->allocated != NULL) { + free(q->allocated); + } + if (q->d != NULL) { + free(q->d); + } + + SRSLTE_MEM_ZERO(q, srslte_uci_nr_t, 1); +} + +static int +uci_nr_sequence_generation_ack_sr(const srslte_uci_cfg_nr_t* cfg, const srslte_uci_value_nr_t* value, uint8_t* sequence) +{ + int A = 0; + + // Append ACK bits + srslte_vec_u8_copy(&sequence[A], value->ack, cfg->o_ack); + A += cfg->o_ack; + + // Append SR bits + srslte_vec_u8_copy(&sequence[A], value->sr, cfg->o_sr); + A += cfg->o_sr; + + return A; +} + +static int +uci_nr_sequence_generation(const srslte_uci_cfg_nr_t* cfg, const srslte_uci_value_nr_t* value, uint8_t* sequence) +{ + // 6.3.1.1.1 HARQ-ACK/SR only UCI bit sequence generation + if (cfg->o_csi1 == 0 && cfg->o_csi2 == 0) { + return uci_nr_sequence_generation_ack_sr(cfg, value, sequence); + } + + // 6.3.1.1.2 CSI only + if (cfg->o_ack == 0 && cfg->o_sr == 0) { + ERROR("CSI only are not implemented\n"); + return SRSLTE_ERROR; + } + + // 6.3.1.1.3 HARQ-ACK/SR and CSI + ERROR("HARQ-ACK/SR and CSI encoding are not implemented\n"); + return SRSLTE_ERROR; +} + +static int uci_nr_encode_1bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint8_t* o, uint32_t E) +{ + uint32_t i = 0; + srslte_uci_bit_type_t c0 = (q->bit_sequence[0] == 0) ? UCI_BIT_0 : UCI_BIT_1; + + switch (cfg->modulation) { + case SRSLTE_MOD_BPSK: + while (i < E) { + o[i++] = c0; + } + break; + case SRSLTE_MOD_QPSK: + while (i < E) { + o[i++] = c0; + o[i++] = UCI_BIT_REPETITION; + } + break; + case SRSLTE_MOD_16QAM: + while (i < E) { + o[i++] = c0; + o[i++] = UCI_BIT_REPETITION; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + } + break; + case SRSLTE_MOD_64QAM: + while (i < E) { + while (i < E) { + o[i++] = c0; + o[i++] = UCI_BIT_REPETITION; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + } + } + break; + case SRSLTE_MOD_256QAM: + while (i < E) { + o[i++] = c0; + o[i++] = UCI_BIT_REPETITION; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + } + break; + case SRSLTE_MOD_NITEMS: + default: + ERROR("Invalid modulation\n"); + return SRSLTE_ERROR; + } + + return E; +} + +static int uci_nr_encode_2bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint8_t* o, uint32_t E) +{ + uint32_t i = 0; + srslte_uci_bit_type_t c0 = (q->bit_sequence[0] == 0) ? UCI_BIT_0 : UCI_BIT_1; + srslte_uci_bit_type_t c1 = (q->bit_sequence[1] == 0) ? UCI_BIT_0 : UCI_BIT_1; + srslte_uci_bit_type_t c2 = ((q->bit_sequence[0] ^ q->bit_sequence[1]) == 0) ? UCI_BIT_0 : UCI_BIT_1; + + switch (cfg->modulation) { + + case SRSLTE_MOD_BPSK: + case SRSLTE_MOD_QPSK: + while (i < E) { + o[i++] = c0; + o[i++] = c1; + o[i++] = c2; + } + break; + case SRSLTE_MOD_16QAM: + while (i < E) { + o[i++] = c0; + o[i++] = c1; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = c2; + o[i++] = c0; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = c1; + o[i++] = c2; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + } + break; + case SRSLTE_MOD_64QAM: + while (i < E) { + o[i++] = c0; + o[i++] = c1; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = c2; + o[i++] = c0; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = c1; + o[i++] = c2; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + } + break; + case SRSLTE_MOD_256QAM: + + while (i < E) { + o[i++] = c0; + o[i++] = c1; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = c2; + o[i++] = c0; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = c1; + o[i++] = c2; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + o[i++] = UCI_BIT_PLACEHOLDER; + } + break; + case SRSLTE_MOD_NITEMS: + default: + ERROR("Invalid modulation\n"); + return SRSLTE_ERROR; + } + + return E; +} + +static int +uci_nr_encode_3_11_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint32_t A, uint8_t* o, uint32_t E) +{ + uint8_t encoded[SRSLTE_FEC_BLOCK_SIZE] = {}; + srslte_block_encode(q->bit_sequence, A, encoded, SRSLTE_FEC_BLOCK_SIZE); + + for (uint32_t i = 0; i < E; i++) { + o[i] = (encoded[i % SRSLTE_FEC_BLOCK_SIZE] == 0) ? UCI_BIT_0 : UCI_BIT_1; + } + + return E; +} + +#define CEIL(NUM, DEN) (((NUM) + ((DEN)-1)) / (DEN)) + +static int +uci_nr_encode_11_1906_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint32_t A, uint8_t* o, uint32_t E_uci) +{ + // If ( A ≥ 360 and E ≥ 1088 ) or if A ≥ 1013 , I seg = 1 ; otherwise I seg = 0 + uint32_t I_seg = 0; + if ((A >= 360 && E_uci >= 1088) || A >= 1013) { + I_seg = 1; + } + + // Select CRC + srslte_crc_t* crc = &q->crc6; + if (A >= 20) { + crc = &q->crc11; + } + + // Segmentation + uint32_t C = 1; + if (I_seg == 1) { + C = 2; + } + uint32_t A_prime = CEIL(A, C) * C; + + // Get polar code + uint32_t K_r = A_prime / C + crc->order; + uint32_t E_r = E_uci / C; + if (srslte_polar_code_get(&q->code, K_r, E_r, 9U) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Write codeword + for (uint32_t r = 0, s = 0; r < C; r++) { + uint32_t k = 0; + + // Suffix A_prime - A zeros for the first CB only + if (r == 0) { + for (uint32_t i = 0; i < (A_prime - A); i++) { + q->c[k++] = 0; + } + } + + // Load codeword bits + while (k < A_prime / C) { + q->c[k++] = q->bit_sequence[s++]; + } + + // Attach CRC + srslte_crc_attach(crc, q->c, A_prime / C); + + // Allocate channel + srslte_polar_chanalloc_tx(q->c, q->allocated, q->code.N, q->code.K, q->code.nPC, q->code.K_set, q->code.PC_set); + + // Encode bits + if (srslte_polar_encoder_encode(&q->encoder, q->allocated, q->d, q->code.n) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Rate matching + srslte_polar_rm_tx(&q->rm, q->d, &o[E_r * r], q->code.n, E_r, K_r, UCI_NR_POLAR_RM_IBIL); + } + + return E_uci; +} + +int uci_nr_encode(srslte_uci_nr_t* q, + const srslte_uci_cfg_nr_t* uci_cfg, + const srslte_uci_value_nr_t* uci_value, + uint8_t* o, + uint32_t E_uci) +{ + if (q == NULL || uci_cfg == NULL || uci_value == NULL || o == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // 6.3.1.1 UCI bit sequence generation + int A = uci_nr_sequence_generation(uci_cfg, uci_value, q->bit_sequence); + if (A < SRSLTE_SUCCESS) { + ERROR("Generating bit sequence"); + return SRSLTE_ERROR; + } + + // 5.3.3.1 Encoding of 1-bit information + if (A == 1) { + return uci_nr_encode_1bit(q, uci_cfg, o, E_uci); + } + + // 5.3.3.2 Encoding of 2-bit information + if (A == 2) { + return uci_nr_encode_2bit(q, uci_cfg, o, E_uci); + } + + // 5.3.3.3 Encoding of other small block lengths + if (A <= 11) { + return uci_nr_encode_3_11_bit(q, uci_cfg, A, o, E_uci); + } + + if (A < UCI_NR_MAX_A) { + return uci_nr_encode_11_1906_bit(q, uci_cfg, A, o, E_uci); + } + + return SRSLTE_ERROR; +} + +// Implements TS 38.212 Table 6.3.1.4-1: Total rate matching output sequence length Etot +static int uci_nr_pucch_E_tot(const srslte_pucch_nr_cfg_t* pucch_cfg, const srslte_uci_cfg_nr_t* uci_cfg) +{ + if (pucch_cfg == NULL || uci_cfg == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + switch (pucch_cfg->format) { + + case SRSLTE_PUCCH_NR_FORMAT_2: + if (uci_cfg->modulation == SRSLTE_MOD_QPSK) { + return (int)(16 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); + } + break; + case SRSLTE_PUCCH_NR_FORMAT_3: + if (uci_cfg->modulation == SRSLTE_MOD_QPSK) { + return (int)(24 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); + } + if (uci_cfg->modulation == SRSLTE_MOD_BPSK) { + return (int)(12 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); + } + break; + case SRSLTE_PUCCH_NR_FORMAT_4: + if (pucch_cfg->occ_lenth != 1 && pucch_cfg->occ_lenth != 2) { + ERROR("Invalid spreading factor (%d)\n", pucch_cfg->occ_lenth); + return SRSLTE_ERROR; + } + if (uci_cfg->modulation == SRSLTE_MOD_QPSK) { + return (int)(24 * pucch_cfg->nof_symbols / pucch_cfg->occ_lenth); + } + if (uci_cfg->modulation == SRSLTE_MOD_BPSK) { + return (int)(12 * pucch_cfg->nof_symbols / pucch_cfg->occ_lenth); + } + break; + default: + return SRSLTE_ERROR; + } + return SRSLTE_ERROR; +} + +// Implements TS 38.212 Table 6.3.1.4.1-1: Rate matching output sequence length E UCI +static int +uci_nr_pucch_E_uci(const srslte_pucch_nr_cfg_t* pucch_cfg, const srslte_uci_cfg_nr_t* uci_cfg, uint32_t E_tot) +{ + if (uci_cfg->o_csi1 != 0 && uci_cfg->o_csi2) { + ERROR("Simultaneous CSI part 1 and CSI part 2 is not implemented\n"); + return SRSLTE_ERROR; + } + + return E_tot; +} + +int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, + const srslte_pucch_nr_cfg_t* pucch_cfg, + const srslte_uci_cfg_nr_t* uci_cfg, + const srslte_uci_value_nr_t* value, + uint8_t* o) +{ + + int E_tot = uci_nr_pucch_E_tot(pucch_cfg, uci_cfg); + if (E_tot < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + int E_uci = uci_nr_pucch_E_uci(pucch_cfg, uci_cfg, E_tot); + if (E_uci < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + return uci_nr_encode(q, uci_cfg, value, o, E_uci); +} From e7562e5b3ff6e09c4edddd67266df0d5e3867792 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 18 Jan 2021 10:53:48 +0100 Subject: [PATCH 129/138] Added ZC sequence LUT object --- lib/include/srslte/phy/common/zc_sequence.h | 54 ++++++++++++- lib/src/phy/common/zc_sequence.c | 85 ++++++++++++++++++++- 2 files changed, 136 insertions(+), 3 deletions(-) diff --git a/lib/include/srslte/phy/common/zc_sequence.h b/lib/include/srslte/phy/common/zc_sequence.h index ac77b9371..66c71ef89 100644 --- a/lib/include/srslte/phy/common/zc_sequence.h +++ b/lib/include/srslte/phy/common/zc_sequence.h @@ -17,6 +17,16 @@ #include #include +/** + * @brief Defines the maximum number of ZC sequence groups (u) + */ +#define SRSLTE_ZC_SEQUENCE_NOF_GROUPS 30 + +/** + * @brief Defines the maximum number of base sequences (v) + */ +#define SRSLTE_ZC_SEQUENCE_NOF_BASE 2 + /** * @brief Generates ZC sequences given the required parameters used in the TS 36 series (LTE) * @@ -35,7 +45,7 @@ SRSLTE_API int srslte_zc_sequence_generate_lte(uint32_t u, uint32_t v, float alp * @brief Generates ZC sequences given the required parameters used in the TS 38 series (NR) * * @remark Implemented as defined in TS 38.211 section 5.2.2 Low-PAPR sequence generation - + * * @param u Group number {0,1,...29} * @param v base sequence * @param alpha Phase shift @@ -47,4 +57,46 @@ SRSLTE_API int srslte_zc_sequence_generate_lte(uint32_t u, uint32_t v, float alp SRSLTE_API int srslte_zc_sequence_generate_nr(uint32_t u, uint32_t v, float alpha, uint32_t m, uint32_t delta, cf_t* sequence); +/** + * @brief Low-PAPR ZC sequence look-up-table + */ +typedef struct SRSLTE_API { + uint32_t M_zc; + uint32_t nof_alphas; + cf_t* sequence[SRSLTE_ZC_SEQUENCE_NOF_GROUPS][SRSLTE_ZC_SEQUENCE_NOF_BASE]; +} srslte_zc_sequence_lut_t; + +/** + * @brief Initialises a Low-PAPR sequence look-up-table object using NR tables + * + * @param q Object pointer + * @param m Number of PRB + * @param delta Delta parameter described in specification + * @param alphas Vector with the alpha shift parameters + * @param nof_alphas Number alpha shifts to generate + * @return SRSLTE_SUCCESS if the initialization is successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_zc_sequence_lut_init_nr(srslte_zc_sequence_lut_t* q, + uint32_t m, + uint32_t delta, + float* alphas, + uint32_t nof_alphas); + +/** + * @brief Deallocates a Low-PAPR sequence look-up-table object + * @param q Object pointer + */ +SRSLTE_API void srslte_zc_sequence_lut_free(srslte_zc_sequence_lut_t* q); + +/** + * @brief Get a Low-PAPR sequence from the LUT + * @param q Object pointer + * @param u Group number {0,1,...29} + * @param v base sequence + * @param alpha_idx Phase shift index + * @return SRSLTE_SUCCESS if the generation is successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API const cf_t* + srslte_zc_sequence_lut_get(const srslte_zc_sequence_lut_t* q, uint32_t u, uint32_t v, uint32_t alpha_idx); + #endif // SRSLTE_ZC_SEQUENCE_H diff --git a/lib/src/phy/common/zc_sequence.c b/lib/src/phy/common/zc_sequence.c index 161833d90..18652c089 100644 --- a/lib/src/phy/common/zc_sequence.c +++ b/lib/src/phy/common/zc_sequence.c @@ -267,11 +267,17 @@ static void zc_sequence_generate(uint32_t M_zc, float alpha, const cf_t* tmp_arg int srslte_zc_sequence_generate_lte(uint32_t u, uint32_t v, float alpha, uint32_t nof_prb, cf_t* sequence) { - + // Check inputs if (sequence == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; } + // Check U and V + if (u >= SRSLTE_ZC_SEQUENCE_NOF_GROUPS || v >= SRSLTE_ZC_SEQUENCE_NOF_BASE) { + ERROR("Invalid u (%d) or v (%d)\n", u, v); + return SRSLTE_ERROR_OUT_OF_BOUNDS; + } + // Calculate number of samples uint32_t M_zc = nof_prb * SRSLTE_NRE; @@ -293,6 +299,12 @@ int srslte_zc_sequence_generate_nr(uint32_t u, uint32_t v, float alpha, uint32_t return SRSLTE_ERROR_INVALID_INPUTS; } + // Check U and V + if (u >= SRSLTE_ZC_SEQUENCE_NOF_GROUPS || v >= SRSLTE_ZC_SEQUENCE_NOF_BASE) { + ERROR("Invalid u (%d) or v (%d)\n", u, v); + return SRSLTE_ERROR_OUT_OF_BOUNDS; + } + // Calculate number of samples uint32_t M_zc = (m * SRSLTE_NRE) >> delta; @@ -305,4 +317,73 @@ int srslte_zc_sequence_generate_nr(uint32_t u, uint32_t v, float alpha, uint32_t zc_sequence_generate(M_zc, alpha, sequence, sequence); return SRSLTE_SUCCESS; -} \ No newline at end of file +} + +int srslte_zc_sequence_lut_init_nr(srslte_zc_sequence_lut_t* q, + uint32_t m, + uint32_t delta, + float* alphas, + uint32_t nof_alphas) +{ + if (q == NULL || alphas == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Set all structure to zero + SRSLTE_MEM_ZERO(q, srslte_zc_sequence_lut_t, 1); + + // Calculate number of samples + q->M_zc = (m * SRSLTE_NRE) >> delta; + q->nof_alphas = nof_alphas; + + for (uint32_t u = 0; u < SRSLTE_ZC_SEQUENCE_NOF_GROUPS; u++) { + for (uint32_t v = 0; v < SRSLTE_ZC_SEQUENCE_NOF_BASE; v++) { + // Allocate sequence + q->sequence[u][v] = srslte_vec_cf_malloc(nof_alphas * q->M_zc); + if (q->sequence[u][v] == NULL) { + ERROR("Malloc\n"); + return SRSLTE_ERROR; + } + + // Generate a sequence for each alpha + for (uint32_t alpha_idx = 0; alpha_idx < nof_alphas; alpha_idx++) { + if (srslte_zc_sequence_generate_nr(u, v, alphas[alpha_idx], m, delta, &q->sequence[u][v][alpha_idx * q->M_zc]) < + SRSLTE_SUCCESS) { + ERROR("Generating sequence\n"); + return SRSLTE_ERROR; + } + } + } + } + + return SRSLTE_SUCCESS; +} + +void srslte_zc_sequence_lut_free(srslte_zc_sequence_lut_t* q) +{ + for (uint32_t u = 0; u < SRSLTE_ZC_SEQUENCE_NOF_GROUPS; u++) { + for (uint32_t v = 0; v < SRSLTE_ZC_SEQUENCE_NOF_BASE; v++) { + if (q->sequence[u][v] != NULL) { + free(q->sequence[u][v]); + } + } + } + SRSLTE_MEM_ZERO(q, srslte_zc_sequence_lut_t, 1); +} + +const cf_t* srslte_zc_sequence_lut_get(const srslte_zc_sequence_lut_t* q, uint32_t u, uint32_t v, uint32_t alpha_idx) +{ + if (q == NULL) { + return NULL; + } + + if (u >= SRSLTE_ZC_SEQUENCE_NOF_GROUPS) { + return NULL; + } + + if (v >= SRSLTE_ZC_SEQUENCE_NOF_BASE) { + return NULL; + } + + return &q->sequence[u][v][alpha_idx * q->M_zc]; +} From 33bb387f522e5f4e422b1009196d006b79c759d8 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 18 Jan 2021 10:55:31 +0100 Subject: [PATCH 130/138] Initial NR-PUCCH formats 0 and 1 encoder --- lib/include/srslte/phy/common/phy_common_nr.h | 2 +- lib/include/srslte/phy/phch/pucch_nr.h | 133 +++++- lib/include/srslte/phy/phch/uci_nr.h | 10 +- lib/src/phy/phch/pucch_nr.c | 434 ++++++++++++++++++ lib/src/phy/phch/test/CMakeLists.txt | 4 + lib/src/phy/phch/test/pucch_nr_test.c | 149 ++++++ lib/src/phy/phch/uci_nr.c | 18 +- 7 files changed, 732 insertions(+), 18 deletions(-) create mode 100644 lib/src/phy/phch/pucch_nr.c create mode 100644 lib/src/phy/phch/test/pucch_nr_test.c diff --git a/lib/include/srslte/phy/common/phy_common_nr.h b/lib/include/srslte/phy/common/phy_common_nr.h index 47a01866f..3a133ad4e 100644 --- a/lib/include/srslte/phy/common/phy_common_nr.h +++ b/lib/include/srslte/phy/common/phy_common_nr.h @@ -37,7 +37,7 @@ extern "C" { /** * @brief Defines the maximum numerology supported. Defined by TS 38.211 v15.8.0 Table 4.3.2-1. */ -#define SRSLTE_NR_MAX_NUMEROLOGY 4 +#define SRSLTE_NR_MAX_NUMEROLOGY 4U /** * @brief Defines the symbol duration, including cyclic prefix diff --git a/lib/include/srslte/phy/phch/pucch_nr.h b/lib/include/srslte/phy/phch/pucch_nr.h index 942ab5c67..4fd52f8eb 100644 --- a/lib/include/srslte/phy/phch/pucch_nr.h +++ b/lib/include/srslte/phy/phch/pucch_nr.h @@ -14,9 +14,17 @@ #define SRSLTE_PUCCH_NR_H #include "srslte/config.h" +#include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/common/zc_sequence.h" +#include "srslte/phy/modem/modem_table.h" #include #include +/** + * @brief Maximum number of NR-PUCCH format 1 symbols (without DMRS) + */ +#define SRSLTE_PUCCH_NR_FORMAT1_N_MAX 7 + typedef enum SRSLTE_API { SRSLTE_PUCCH_NR_FORMAT_0 = 0, SRSLTE_PUCCH_NR_FORMAT_1, @@ -26,24 +34,143 @@ typedef enum SRSLTE_API { SRSLTE_PUCCH_NR_FORMAT_ERROR, } srslte_pucch_nr_format_t; +typedef enum SRSLTE_API { + SRSLTE_PUCCH_NR_GROUP_HOPPING_NEITHER = 0, + SRSLTE_PUCCH_NR_GROUP_HOPPING_ENABLE, + SRSLTE_PUCCH_NR_GROUP_HOPPING_DISABLE +} srslte_pucch_nr_group_hopping_t; + +/** + * @brief PUCCH Common configuration + * @remark Defined in TS 38.331 PUCCH-ConfigCommon + */ +typedef struct SRSLTE_API { + uint32_t resource_common; ///< Configures a set of cell-specific PUCCH resources/parameters + srslte_pucch_nr_group_hopping_t group_hopping; ///< Configuration of group and sequence hopping + uint32_t hopping_id; ///< Cell-specific scrambling ID for group hopping and sequence hopping if enabled + bool hopping_id_present; + float p0_nominal; ///< Power control parameter P0 for PUCCH transmissions. Value in dBm. (-202..24) +} srslte_pucch_nr_common_cfg_t; + /** * @brief Generic PUCCH Resource configuration + * @remark Defined in TS 38.331 PUCCH-Config */ typedef struct SRSLTE_API { - // Common + // + uint32_t starting_prb; + bool intra_slot_frequency_hopping; + uint32_t second_hop_prb; + + // Common PUCCH-Resource parameters among all formats srslte_pucch_nr_format_t format; ///< PUCCH format this configuration belongs uint32_t nof_symbols; ///< Number of symbols uint32_t start_symbol_idx; ///< Starting symbol index double max_code_rate; ///< Maximum code rate (0.08, 0.15, 0.25, 0.35, 0.45, 0.60, 0.80) bool enable_pi_bpsk; ///< Enables PI-BPSK - // Other parameters + // Specific PUCCH-Resource uint32_t initial_cyclic_shift; ///< Used by formats 0, 1 uint32_t time_domain_occ; ///< Used by format 1 uint32_t nof_prb; ///< Used by formats 2, 3 uint32_t occ_lenth; ///< Spreading factor, used by format 4 uint32_t occ_index; ///< Used by format 4 +} srslte_pucch_nr_resource_t; + +typedef struct SRSLTE_API { + float rsrp; + float rsrp_dBfs; + float epre; + float epre_dBfs; + float norm_corr; +} srslte_pucch_nr_measure_t; -} srslte_pucch_nr_cfg_t; +/** + * @brief PUCCH Resource configuration for Format 0 + * @remark Defined in TS 38.331 PUCCH-Config + */ +typedef struct SRSLTE_API { + uint32_t starting_prb; + uint32_t initial_cyclic_shift; ///< initialCyclicShift (0..11) + uint32_t start_symbol_idx; ///< startingSymbolIndex (0..13) + uint32_t nof_symbols; ///< nrofSymbols (1..2) +} srslte_pucch_nr_resource_format0_t; + +/** + * @brief PUCCH Resource configuration for Format 1 + * @remark Defined in TS 38.331 PUCCH-Config + */ +typedef struct SRSLTE_API { + uint32_t starting_prb; + uint32_t initial_cyclic_shift; ///< initialCyclicShift (0..11) + uint32_t start_symbol_idx; ///< startingSymbolIndex (0..10) + uint32_t nof_symbols; ///< nrofSymbols (4..14) + uint32_t time_domain_occ; ///< TimeDomainOCC(0..6) + bool intra_slot_hopping; +} srslte_pucch_nr_resource_format1_t; + +/** + * @brief NR-PUCCH encoder/decoder object + */ +typedef struct SRSLTE_API { + srslte_zc_sequence_lut_t r_uv_1prb; + cf_t format1_w_i_m[SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_PUCCH_NR_FORMAT1_N_MAX]; + srslte_modem_table_t bpsk; + srslte_modem_table_t qpsk; +} srslte_pucch_nr_t; + +/** + * @brief Initialises an NR-PUCCH encoder/decoder object + * @param q Object + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +int srslte_pucch_nr_init(srslte_pucch_nr_t* q); + +/** + * @brief Deallocates an NR-PUCCH encoder/decoder object + * @param q Object + */ +void srslte_pucch_nr_free(srslte_pucch_nr_t* q); + +/** + * @brief Puts NR-PUCCH format 0 in the resource grid + * @remark Described in TS 38.211 clause 6.3.2.3 PUCCH format 0 + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] carrier Carrier configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 0 resource + * @param[in] m_cs Cyclic shift according to TS 38.213 clause 5 + * @param[out] slot_symbols Resource grid of the given slot + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +int srslte_pucch_nr_format0_put(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + srslte_pucch_nr_resource_format0_t* resource, + uint32_t m_cs, + cf_t* slot_symbols); + +/** + * @brief Measures PUCCH format 0 in the resource grid + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] carrier Carrier configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 0 resource + * @param[in] m_cs Cyclic shift according to TS 38.213 clause 5 + * @param[in] slot_symbols Resource grid of the given slot + * @param[out] measure Measurement structure + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + srslte_pucch_nr_resource_format0_t* resource, + uint32_t m_cs, + const cf_t* slot_symbols, + srslte_pucch_nr_measure_t* measure); #endif // SRSLTE_PUCCH_NR_H diff --git a/lib/include/srslte/phy/phch/uci_nr.h b/lib/include/srslte/phy/phch/uci_nr.h index 8f9a3ac36..5c7600493 100644 --- a/lib/include/srslte/phy/phch/uci_nr.h +++ b/lib/include/srslte/phy/phch/uci_nr.h @@ -71,10 +71,10 @@ SRSLTE_API void srslte_uci_nr_free(srslte_uci_nr_t* q); * @param[out] o Output encoded bits * @return Number of encoded bits if encoding is successful, SRSLTE_ERROR code otherwise */ -SRSLTE_API int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, - const srslte_pucch_nr_cfg_t* pucch_cfg, - const srslte_uci_cfg_nr_t* uci_cfg, - const srslte_uci_value_nr_t* value, - uint8_t* o); +SRSLTE_API int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, + const srslte_pucch_nr_resource_t* pucch_resource, + const srslte_uci_cfg_nr_t* uci_cfg, + const srslte_uci_value_nr_t* value, + uint8_t* o); #endif // SRSLTE_UCI_NR_H diff --git a/lib/src/phy/phch/pucch_nr.c b/lib/src/phy/phch/pucch_nr.c new file mode 100644 index 000000000..6000c1e13 --- /dev/null +++ b/lib/src/phy/phch/pucch_nr.c @@ -0,0 +1,434 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/phch/pucch_nr.h" +#include "srslte/phy/common/phy_common_nr.h" +#include "srslte/phy/common/sequence.h" +#include "srslte/phy/common/zc_sequence.h" +#include "srslte/phy/modem/mod.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/vector.h" +#include + +// Implements TS 38.211 clause 6.3.2.2.1 Group and sequence hopping +static int pucch_nr_group_sequence(const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + uint32_t* u_, + uint32_t* v_) +{ + uint32_t f_gh = 0; + uint32_t f_ss = 0; + uint32_t n_id = cfg->hopping_id_present ? cfg->hopping_id : carrier->id; + + switch (cfg->group_hopping) { + + case SRSLTE_PUCCH_NR_GROUP_HOPPING_NEITHER: + f_ss = n_id % SRSLTE_ZC_SEQUENCE_NOF_GROUPS; + break; + case SRSLTE_PUCCH_NR_GROUP_HOPPING_ENABLE: + ERROR("Group hopping is not implemented\n"); + return SRSLTE_ERROR; + case SRSLTE_PUCCH_NR_GROUP_HOPPING_DISABLE: + ERROR("Hopping is not implemented\n"); + return SRSLTE_ERROR; + } + + uint32_t u = (f_gh + f_ss) % SRSLTE_ZC_SEQUENCE_NOF_GROUPS; + uint32_t v = 0; + + if (u_) { + *u_ = u; + } + + if (v_) { + *v_ = v; + } + + return SRSLTE_SUCCESS; +} + +// Implements TS 38.211 clause 6.3.2.2.2 Cyclic shift hopping +static uint32_t pucch_nr_alpha_idx(const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + uint32_t l, + uint32_t l_prime, + uint32_t m0, + uint32_t m_cs) +{ + // Compute number of slot + uint32_t n_slot = slot->idx % SRSLTE_NSLOTS_PER_FRAME_NR(carrier->numerology); + + // Generate pseudo-random sequence + uint32_t cinit = cfg->hopping_id_present ? cfg->hopping_id : carrier->id; + uint8_t cs[SRSLTE_NSYMB_PER_SLOT_NR * SRSLTE_NSLOTS_PER_FRAME_NR(SRSLTE_NR_MAX_NUMEROLOGY) * 8U] = {}; + srslte_sequence_apply_bit( + cs, cs, SRSLTE_NSYMB_PER_SLOT_NR * SRSLTE_NSLOTS_PER_FRAME_NR(carrier->numerology) * 8, cinit); + + // Create n_cs parameter + uint32_t n_cs = 0; + for (uint32_t m = 0; m < 8; m++) { + n_cs += cs[SRSLTE_NSYMB_PER_SLOT_NR * n_slot + (l + l_prime) * 8 + m] << m; + } + + return (m0 + m_cs + n_cs) % SRSLTE_NRE; +} + +static int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_format0_t* resource) +{ + if (resource == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (resource->nof_symbols != 1 && resource->nof_symbols != 2) { + ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); + return SRSLTE_ERROR; + } + + if (resource->initial_cyclic_shift > 11) { + ERROR("Invalid initial cyclic shift (%d)\n", resource->initial_cyclic_shift); + return SRSLTE_ERROR; + } + + if (resource->start_symbol_idx > 13) { + ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +static int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_format1_t* resource) +{ + if (resource == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (resource->nof_symbols < 4 || resource->nof_symbols > 14) { + ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); + return SRSLTE_ERROR; + } + + if (resource->initial_cyclic_shift > 11) { + ERROR("Invalid initial cyclic shift (%d)\n", resource->initial_cyclic_shift); + return SRSLTE_ERROR; + } + + if (resource->start_symbol_idx > 10) { + ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); + return SRSLTE_ERROR; + } + + if (resource->time_domain_occ > 6) { + ERROR("Invalid time domain occ (%d)\n", resource->time_domain_occ); + return SRSLTE_ERROR; + } + + if (resource->intra_slot_hopping) { + ERROR("Intra-slot hopping is not implemented\n"); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +// TS 38.211 Table 6.3.2.4.1-2: Orthogonal sequences for PUCCH format 1 +static uint32_t + pucch_nr_format1_rho[SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_PUCCH_NR_FORMAT1_N_MAX] = + {{{0}, {0, 0}, {0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}}, + {{}, {0, 1}, {0, 1, 2}, {0, 2, 0, 2}, {0, 1, 2, 3, 4}, {0, 1, 2, 3, 4, 5}, {0, 1, 2, 3, 4, 5, 6}}, + {{}, {}, {0, 2, 1}, {0, 0, 2, 2}, {0, 2, 4, 1, 3}, {0, 2, 4, 0, 2, 4}, {0, 2, 4, 6, 1, 3, 5}}, + {{}, {}, {}, {0, 2, 2, 0}, {0, 3, 1, 4, 2}, {0, 3, 0, 3, 0, 3}, {0, 3, 6, 2, 5, 1, 4}}, + {{}, {}, {}, {}, {0, 4, 3, 2, 1}, {0, 4, 2, 0, 4, 2}, {0, 4, 1, 5, 2, 6, 3}}, + {{}, {}, {}, {}, {}, {0, 5, 4, 3, 2, 1}, {0, 5, 3, 1, 6, 4, 2}}, + {{}, {}, {}, {}, {}, {}, {0, 6, 5, 4, 3, 2, 1}}}; + +#define SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS 2 + +int srslte_pucch_nr_init(srslte_pucch_nr_t* q) +{ + if (q == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Initialise ZC sequences for 1PRB + float alphas_1prb[SRSLTE_NRE] = {}; + for (uint32_t i = 0; i < SRSLTE_NRE; i++) { + alphas_1prb[i] = 2.0f * (float)M_PI * (float)i / (float)SRSLTE_NRE; + } + srslte_zc_sequence_lut_init_nr(&q->r_uv_1prb, 1, 0, alphas_1prb, SRSLTE_NRE); + + // Initialise BPSK modulation table + if (srslte_modem_table_lte(&q->bpsk, SRSLTE_MOD_BPSK) < SRSLTE_SUCCESS) { + ERROR("Initiating modem table\n"); + return SRSLTE_ERROR; + } + + // Initialise QPSK modulation table + if (srslte_modem_table_lte(&q->qpsk, SRSLTE_MOD_QPSK) < SRSLTE_SUCCESS) { + ERROR("Initiating modem table\n"); + return SRSLTE_ERROR; + } + + for (uint32_t n_pucch = 1; n_pucch <= SRSLTE_PUCCH_NR_FORMAT1_N_MAX; n_pucch++) { + for (uint32_t i = 0; i < SRSLTE_PUCCH_NR_FORMAT1_N_MAX; i++) { + for (uint32_t m = 0; m < SRSLTE_PUCCH_NR_FORMAT1_N_MAX; m++) { + uint32_t rho = pucch_nr_format1_rho[i][n_pucch - 1][m]; + q->format1_w_i_m[i][n_pucch - 1][m] = cexpf(I * 2.0f * (float)M_PI * (float)rho / n_pucch); + } + } + } + + return SRSLTE_SUCCESS; +} + +void srslte_pucch_nr_free(srslte_pucch_nr_t* q) +{ + if (q == NULL) { + return; + } + + srslte_zc_sequence_lut_free(&q->r_uv_1prb); + + srslte_modem_table_free(&q->bpsk); + srslte_modem_table_free(&q->qpsk); + + SRSLTE_MEM_ZERO(q, srslte_pucch_nr_t, 1); +} + +int srslte_pucch_nr_format0_put(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + srslte_pucch_nr_resource_format0_t* resource, + uint32_t m_cs, + cf_t* slot_symbols) +{ + if (carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_pucch_nr_format0_resource_valid(resource) < SRSLTE_SUCCESS) { + ERROR("Invalid PUCCH format 0 resource\n"); + return SRSLTE_SUCCESS; + } + + uint32_t u = 0; + uint32_t v = 0; + if (pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + ERROR("Error getting group sequence\n"); + return SRSLTE_ERROR; + } + + uint32_t l_prime = resource->start_symbol_idx; + for (uint32_t l = 0; l < resource->nof_symbols; l++) { + // Get Alpha index + uint32_t alpha_idx = pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs); + + // get r_uv sequence from LUT object + const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); + if (r_uv == NULL) { + ERROR("Getting r_uv sequence\n"); + return SRSLTE_ERROR; + } + + // Get start of the sequence in resource grid + cf_t* slot_symbols_ptr = &slot_symbols[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; + + // Copy sequence in grid + srslte_vec_cf_copy(slot_symbols_ptr, r_uv, SRSLTE_NRE); + } + + return SRSLTE_SUCCESS; +} + +int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + srslte_pucch_nr_resource_format0_t* resource, + uint32_t m_cs, + const cf_t* slot_symbols, + srslte_pucch_nr_measure_t* measure) +{ + if (carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL || measure == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_pucch_nr_format0_resource_valid(resource) < SRSLTE_SUCCESS) { + ERROR("Invalid PUCCH format 0 resource\n"); + return SRSLTE_SUCCESS; + } + + uint32_t u = 0; + uint32_t v = 0; + if (pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + ERROR("Error getting group sequence\n"); + return SRSLTE_ERROR; + } + + uint32_t l_prime = resource->start_symbol_idx; + float epre = 0.0f; + float rsrp = 0.0f; + for (uint32_t l = 0; l < resource->nof_symbols; l++) { + // Get Alpha index + uint32_t alpha_idx = pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs); + + // get r_uv sequence from LUT object + const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); + if (r_uv == NULL) { + ERROR("Getting r_uv sequence\n"); + return SRSLTE_ERROR; + } + + // Get start of the sequence in resource grid + const cf_t* slot_symbols_ptr = + &slot_symbols[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; + + // Measure EPRE and average + epre += srslte_vec_avg_power_cf(slot_symbols_ptr, SRSLTE_NRE) / resource->nof_symbols; + + // Do correlation + cf_t corr = srslte_vec_dot_prod_conj_ccc(r_uv, slot_symbols_ptr, SRSLTE_NRE); + corr /= SRSLTE_NRE; + + // Measure RSRP and average + rsrp += (__real__ corr * __real__ corr + __imag__ corr * __imag__ corr) / resource->nof_symbols; + } + + // Save measurement + measure->rsrp = rsrp; + measure->rsrp_dBfs = srslte_convert_power_to_dB(rsrp); + measure->epre = epre; + measure->epre_dBfs = srslte_convert_power_to_dB(epre); + if (isnormal(epre)) { + measure->norm_corr = rsrp / epre; + } else { + measure->norm_corr = 0.0f; + } + + return SRSLTE_SUCCESS; +} + +// Implements TS 38.211 table 6.3.2.4.1-1 Number of PUCCH symbols and the corresponding N_PUC... +uint32_t pucch_nr_format1_n_pucch(const srslte_pucch_nr_resource_format1_t* resource, uint32_t m_prime) +{ + if (resource->intra_slot_hopping) { + if (m_prime == 0) { + return resource->nof_symbols / 4; + } + + return resource->nof_symbols / 2 - resource->nof_symbols / 4; + } + + if (m_prime == 1) { + return 0; + } + + return resource->nof_symbols / 2; +} + +static cf_t pucch_nr_format1_w(const srslte_pucch_nr_t* q, uint32_t n_pucch, uint32_t i, uint32_t m) +{ + if (n_pucch < 1 || n_pucch > SRSLTE_PUCCH_NR_FORMAT1_N_MAX) { + ERROR("Invalid n_pucch\n"); + return NAN; + } + if (i >= SRSLTE_PUCCH_NR_FORMAT1_N_MAX) { + ERROR("Invalid i\n"); + return NAN; + } + if (m >= SRSLTE_PUCCH_NR_FORMAT1_N_MAX) { + ERROR("Invalid m\n"); + return NAN; + } + + // Get value + return q->format1_w_i_m[i][n_pucch - 1][m]; +} + +int srslte_pucch_nr_put_format1(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS], + uint32_t nof_bits, + cf_t* slot_symbols) +{ + uint32_t m_cs = 0; + + if (carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || b == NULL || slot_symbols == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { + ERROR("Invalid PUCCH format 1 resource\n"); + return SRSLTE_SUCCESS; + } + + if (nof_bits > 2) { + ERROR("Invalid number of bits (%d)\n", nof_bits); + return SRSLTE_ERROR; + } + + // Modulate d + cf_t d = 0; + if (nof_bits == 1) { + srslte_mod_modulate(&q->bpsk, b, &d, nof_bits); + } else { + srslte_mod_modulate(&q->qpsk, b, &d, nof_bits); + } + + // Get group sequence + uint32_t u = 0; + uint32_t v = 0; + if (pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + ERROR("Error getting group sequence\n"); + return SRSLTE_ERROR; + } + + // Calculate number of symbols carrying PUCCH (No DMRS) + uint32_t n_pucch = pucch_nr_format1_n_pucch(resource, 0); + + uint32_t l_prime = resource->start_symbol_idx; + for (uint32_t l = 1, m = 0; l < resource->nof_symbols; l += 2, m++) { + // Get start of the sequence in resource grid + cf_t* slot_symbols_ptr = &slot_symbols[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; + + // Get Alpha index + uint32_t alpha_idx = pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs); + + // get r_uv sequence from LUT object + const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); + if (r_uv == NULL) { + ERROR("Getting r_uv sequence\n"); + return SRSLTE_ERROR; + } + + // Compute y = d(0) * r_uv + cf_t y[SRSLTE_NRE]; + srslte_vec_sc_prod_ccc(r_uv, d, y, SRSLTE_NRE); + + // Get w_i_m + cf_t w_i_m = pucch_nr_format1_w(q, n_pucch, resource->time_domain_occ, m); + + // Compute z(n) = w(i) * y(n) + cf_t z[SRSLTE_NRE]; + srslte_vec_sc_prod_ccc(y, w_i_m, z, SRSLTE_NRE); + + // Put z in the grid + srslte_vec_cf_copy(slot_symbols_ptr, z, SRSLTE_NRE); + } + + return SRSLTE_SUCCESS; +} \ No newline at end of file diff --git a/lib/src/phy/phch/test/CMakeLists.txt b/lib/src/phy/phch/test/CMakeLists.txt index 646b637b2..49b1e355a 100644 --- a/lib/src/phy/phch/test/CMakeLists.txt +++ b/lib/src/phy/phch/test/CMakeLists.txt @@ -614,6 +614,10 @@ endif(RF_FOUND) # NR ######################################################################## +add_executable(pucch_nr_test pucch_nr_test.c) +target_link_libraries(pucch_nr_test srslte_phy) +add_test(pucch_nr_test pucch_nr_test) + add_executable(sch_nr_test sch_nr_test.c) target_link_libraries(sch_nr_test srslte_phy) add_test(sch_nr_test sch_nr_test -m 0 -p 1) diff --git a/lib/src/phy/phch/test/pucch_nr_test.c b/lib/src/phy/phch/test/pucch_nr_test.c new file mode 100644 index 000000000..44e505220 --- /dev/null +++ b/lib/src/phy/phch/test/pucch_nr_test.c @@ -0,0 +1,149 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/common/test_common.h" +#include "srslte/phy/phch/pucch_nr.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/vector.h" +#include +#include +#include +#include +#include +#include + +static srslte_carrier_nr_t carrier = { + 0, // cell_id + 0, // numerology + 6, // nof_prb + 0, // start + 1 // max_mimo_layers +}; + +static uint32_t starting_prb_stride = 4; +static uint32_t starting_symbol_stride = 4; + +static int test_pucch_format0(srslte_pucch_nr_t* pucch, const srslte_pucch_nr_common_cfg_t* cfg, cf_t* slot_symbols) +{ + srslte_dl_slot_cfg_t slot = {}; + srslte_pucch_nr_resource_format0_t resource = {}; + + for (slot.idx = 0; slot.idx < SRSLTE_NSLOTS_PER_FRAME_NR(carrier.numerology); slot.idx++) { + for (resource.starting_prb = 0; resource.starting_prb < carrier.nof_prb; + resource.starting_prb += starting_prb_stride) { + for (resource.nof_symbols = 1; resource.nof_symbols <= 2; resource.nof_symbols++) { + for (resource.start_symbol_idx = 0; + resource.start_symbol_idx <= SRSLTE_NSYMB_PER_SLOT_NR - resource.nof_symbols; + resource.start_symbol_idx += starting_symbol_stride) { + for (resource.initial_cyclic_shift = 0; resource.initial_cyclic_shift <= 11; + resource.initial_cyclic_shift++) { + for (uint32_t m_cs = 0; m_cs <= 6; m_cs += 2) { + TESTASSERT(srslte_pucch_nr_format0_put(pucch, &carrier, cfg, &slot, &resource, m_cs, slot_symbols) == + SRSLTE_SUCCESS); + + // Measure PUCCH format 0 for all possible values of m_cs + for (uint32_t m_cs_test = 0; m_cs_test <= 6; m_cs_test += 2) { + srslte_pucch_nr_measure_t measure = {}; + TESTASSERT(srslte_pucch_nr_format0_measure( + pucch, &carrier, cfg, &slot, &resource, m_cs_test, slot_symbols, &measure) == + SRSLTE_SUCCESS); + + if (m_cs == m_cs_test) { + TESTASSERT(fabsf(measure.epre - 1) < 0.001); + TESTASSERT(fabsf(measure.rsrp - 1) < 0.001); + TESTASSERT(fabsf(measure.norm_corr - 1) < 0.001); + } else { + TESTASSERT(fabsf(measure.epre - 1) < 0.001); + TESTASSERT(fabsf(measure.rsrp - 0) < 0.1); + TESTASSERT(fabsf(measure.norm_corr - 0) < 0.1); + } + } + } + } + } + } + } + } + + return SRSLTE_SUCCESS; +} + +static void usage(char* prog) +{ + printf("Usage: %s [csNnv]\n", prog); + printf("\t-c cell id [Default %d]\n", carrier.id); + printf("\t-n nof_prb [Default %d]\n", carrier.nof_prb); + printf("\t-v [set verbose to debug, default none]\n"); +} + +static void parse_args(int argc, char** argv) +{ + int opt; + while ((opt = getopt(argc, argv, "cnv")) != -1) { + switch (opt) { + case 'c': + carrier.id = (uint32_t)strtol(argv[optind], NULL, 10); + break; + case 'n': + carrier.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10); + break; + case 'v': + srslte_verbose++; + break; + default: + usage(argv[0]); + exit(-1); + } + } +} + +int main(int argc, char** argv) +{ + int ret = SRSLTE_ERROR; + parse_args(argc, argv); + + uint32_t nof_re = carrier.nof_prb * SRSLTE_NRE * SRSLTE_NSYMB_PER_SLOT_NR; + cf_t* slot_symb = srslte_vec_cf_malloc(nof_re); + srslte_pucch_nr_t pucch = {}; + + if (slot_symb == NULL) { + ERROR("Alloc\n"); + goto clean_exit; + } + + if (srslte_pucch_nr_init(&pucch) < SRSLTE_SUCCESS) { + ERROR("PUCCH init\n"); + goto clean_exit; + } + + srslte_pucch_nr_common_cfg_t common_cfg = {}; + if (test_pucch_format0(&pucch, &common_cfg, slot_symb) < SRSLTE_SUCCESS) { + ERROR("Failed PUCCH format 0\n"); + goto clean_exit; + } + + ret = SRSLTE_SUCCESS; +clean_exit: + if (slot_symb) { + free(slot_symb); + } + + srslte_pucch_nr_free(&pucch); + + if (ret == SRSLTE_SUCCESS) { + printf("Test passed!\n"); + } else { + printf("Test failed!\n"); + } + + return ret; +} \ No newline at end of file diff --git a/lib/src/phy/phch/uci_nr.c b/lib/src/phy/phch/uci_nr.c index 8b6ed9a90..093ada5f7 100644 --- a/lib/src/phy/phch/uci_nr.c +++ b/lib/src/phy/phch/uci_nr.c @@ -412,7 +412,7 @@ int uci_nr_encode(srslte_uci_nr_t* q, } // Implements TS 38.212 Table 6.3.1.4-1: Total rate matching output sequence length Etot -static int uci_nr_pucch_E_tot(const srslte_pucch_nr_cfg_t* pucch_cfg, const srslte_uci_cfg_nr_t* uci_cfg) +static int uci_nr_pucch_E_tot(const srslte_pucch_nr_resource_t* pucch_cfg, const srslte_uci_cfg_nr_t* uci_cfg) { if (pucch_cfg == NULL || uci_cfg == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; @@ -453,7 +453,7 @@ static int uci_nr_pucch_E_tot(const srslte_pucch_nr_cfg_t* pucch_cfg, const srsl // Implements TS 38.212 Table 6.3.1.4.1-1: Rate matching output sequence length E UCI static int -uci_nr_pucch_E_uci(const srslte_pucch_nr_cfg_t* pucch_cfg, const srslte_uci_cfg_nr_t* uci_cfg, uint32_t E_tot) +uci_nr_pucch_E_uci(const srslte_pucch_nr_resource_t* pucch_cfg, const srslte_uci_cfg_nr_t* uci_cfg, uint32_t E_tot) { if (uci_cfg->o_csi1 != 0 && uci_cfg->o_csi2) { ERROR("Simultaneous CSI part 1 and CSI part 2 is not implemented\n"); @@ -463,19 +463,19 @@ uci_nr_pucch_E_uci(const srslte_pucch_nr_cfg_t* pucch_cfg, const srslte_uci_cfg_ return E_tot; } -int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, - const srslte_pucch_nr_cfg_t* pucch_cfg, - const srslte_uci_cfg_nr_t* uci_cfg, - const srslte_uci_value_nr_t* value, - uint8_t* o) +int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, + const srslte_pucch_nr_resource_t* pucch_resource_cfg, + const srslte_uci_cfg_nr_t* uci_cfg, + const srslte_uci_value_nr_t* value, + uint8_t* o) { - int E_tot = uci_nr_pucch_E_tot(pucch_cfg, uci_cfg); + int E_tot = uci_nr_pucch_E_tot(pucch_resource_cfg, uci_cfg); if (E_tot < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } - int E_uci = uci_nr_pucch_E_uci(pucch_cfg, uci_cfg, E_tot); + int E_uci = uci_nr_pucch_E_uci(pucch_resource_cfg, uci_cfg, E_tot); if (E_uci < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } From 697bdb4d6d6820f334960e0e49c4afbe9d4beecc Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 18 Jan 2021 16:08:39 +0100 Subject: [PATCH 131/138] Added NR-PUCCH Format 1 encoder, decoder and DMRS --- .../srslte/phy/ch_estimation/dmrs_pucch.h | 56 ++++ lib/include/srslte/phy/phch/pucch_nr.h | 149 ++++++++-- lib/src/phy/ch_estimation/dmrs_pucch.c | 281 ++++++++++++++++++ lib/src/phy/phch/pucch_nr.c | 179 ++++++++--- lib/src/phy/phch/test/pucch_nr_test.c | 84 +++++- 5 files changed, 688 insertions(+), 61 deletions(-) create mode 100644 lib/include/srslte/phy/ch_estimation/dmrs_pucch.h create mode 100644 lib/src/phy/ch_estimation/dmrs_pucch.c diff --git a/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h b/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h new file mode 100644 index 000000000..9c0ee006b --- /dev/null +++ b/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h @@ -0,0 +1,56 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_DMRS_PUCCH_H +#define SRSLTE_DMRS_PUCCH_H + +#include "srslte/config.h" +#include "srslte/phy/ch_estimation/chest_ul.h" +#include "srslte/phy/phch/pucch_nr.h" + +/** + * @brief Puts NR-PUCCH format 1 DMRS in the provided resource grid + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] carrier Carrier configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 1 resource + * @param[out] slot_symbols Resource grid of the given slot + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + cf_t* slot_symbols); + +/** + * @brief Estimates NR-PUCCH format 1 resource elements from their DMRS in the provided resource grid + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] carrier Carrier configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 1 resource + * @param[in] slot_symbols Resource grid of the given slot + * @param[out] res UL Channel estimator result + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + const cf_t* slot_symbols, + srslte_chest_ul_res_t* res); + +#endif // SRSLTE_DMRS_PUCCH_H diff --git a/lib/include/srslte/phy/phch/pucch_nr.h b/lib/include/srslte/phy/phch/pucch_nr.h index 4fd52f8eb..15f0d418f 100644 --- a/lib/include/srslte/phy/phch/pucch_nr.h +++ b/lib/include/srslte/phy/phch/pucch_nr.h @@ -17,14 +17,20 @@ #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/common/zc_sequence.h" #include "srslte/phy/modem/modem_table.h" +#include #include #include /** - * @brief Maximum number of NR-PUCCH format 1 symbols (without DMRS) + * @brief Maximum number of symbols (without DMRS) that NR-PUCCH format 1 can transmit */ #define SRSLTE_PUCCH_NR_FORMAT1_N_MAX 7 +/** + * @brief Maximum number of bit that NR-PUCCH format 1 can carry + */ +#define SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS 2 + typedef enum SRSLTE_API { SRSLTE_PUCCH_NR_FORMAT_0 = 0, SRSLTE_PUCCH_NR_FORMAT_1, @@ -124,16 +130,58 @@ typedef struct SRSLTE_API { * @param q Object * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise */ -int srslte_pucch_nr_init(srslte_pucch_nr_t* q); +SRSLTE_API int srslte_pucch_nr_init(srslte_pucch_nr_t* q); /** * @brief Deallocates an NR-PUCCH encoder/decoder object * @param q Object */ -void srslte_pucch_nr_free(srslte_pucch_nr_t* q); +SRSLTE_API void srslte_pucch_nr_free(srslte_pucch_nr_t* q); + +/** + * @brief Computes the NR-PUCCH group sequence + * @remark Implemented according to TS 38.211 clause 6.3.2.2.1 Group and sequence hopping + * @param[in] carrier Serving cell and UL BWP configuration + * @param[in] cfg PUCCH common configuration + * @param[out] u_ Group sequence (u) + * @param[out] v_ Base sequence (v) + * @return SRSLTE_SUCCESS if provide arguments are right, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_group_sequence(const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + uint32_t* u_, + uint32_t* v_); + +/** + * @brief Computes the NR alpha index (1-NRE) + * @param[in] carrier Serving cell and UL BWP configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] l OFDM Symbol, relative to the NR-PUCCH transmission start + * @param[in] l_prime Initial OFDM symbol, relative to the transmission slot start + * @param[in] m0 Initial cyclic shift + * @param[in] m_cs Set to zero expect for format 0 + * @param[out] alpha_idx Computed alpha index + * @return SRSLTE_SUCCESS if provide arguments are right, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_alpha_idx(const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + uint32_t l, + uint32_t l_prime, + uint32_t m0, + uint32_t m_cs, + uint32_t* alpha_idx); + +/** + * @brief Validates a PUCCH format 1 resource configuration provided by upper layers + * @param resource Resource configuration to validate + * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_format0_t* resource); /** - * @brief Puts NR-PUCCH format 0 in the resource grid + * @brief Encode and writes NR-PUCCH format 0 in the resource grid * @remark Described in TS 38.211 clause 6.3.2.3 PUCCH format 0 * @param[in] q NR-PUCCH encoder/decoder object * @param[in] carrier Carrier configuration @@ -144,13 +192,13 @@ void srslte_pucch_nr_free(srslte_pucch_nr_t* q); * @param[out] slot_symbols Resource grid of the given slot * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise */ -int srslte_pucch_nr_format0_put(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - srslte_pucch_nr_resource_format0_t* resource, - uint32_t m_cs, - cf_t* slot_symbols); +SRSLTE_API int srslte_pucch_nr_format0_encode(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + srslte_pucch_nr_resource_format0_t* resource, + uint32_t m_cs, + cf_t* slot_symbols); /** * @brief Measures PUCCH format 0 in the resource grid @@ -164,13 +212,76 @@ int srslte_pucch_nr_format0_put(const srslte_pucch_nr_t* q, * @param[out] measure Measurement structure * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise */ -int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - srslte_pucch_nr_resource_format0_t* resource, - uint32_t m_cs, - const cf_t* slot_symbols, - srslte_pucch_nr_measure_t* measure); +SRSLTE_API int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + srslte_pucch_nr_resource_format0_t* resource, + uint32_t m_cs, + const cf_t* slot_symbols, + srslte_pucch_nr_measure_t* measure); + +/** + * @brief Validates a PUCCH format 1 resource configuration provided by upper layers + * @param resource Resource configuration to validate + * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_format1_t* resource); + +/** + * @brief Get NR-PUCCH orthogonal sequence w + * @remark Defined by TS 38.211 Table 6.3.2.4.1-2: Orthogonal sequences ... for PUCCH format 1 + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] n_pucch Number of PUCCH symbols + * @param[in] i sequence index + * @param m OFDM symbol index + * @return Orthogonal sequence complex number if valid, NAN otherwise + */ +SRSLTE_API cf_t srslte_pucch_nr_format1_w(const srslte_pucch_nr_t* q, uint32_t n_pucch, uint32_t i, uint32_t m); + +/** + * @brief Encodes and puts NR-PUCCH format 1 in the resource grid + * @remark Described in TS 38.211 clause 6.3.2.4 PUCCH format 1 + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] carrier Carrier configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 1 resource + * @param[in] b Bits to encode in the message + * @param[in] nof_bits Number of bits to encode in the message + * @param[out] slot_symbols Resource grid of the given slot + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + uint8_t* b, + uint32_t nof_bits, + cf_t* slot_symbols); + +/** + * @brief Decodes NR-PUCCH format 1 + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] carrier Carrier configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 1 resource + * @param[in] chest_res Channel estimator result + * @param[in] slot_symbols Resource grid of the given slot + * @param[out] b Bits to decode + * @param[in] nof_bits Number of bits to decode in the message + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols, + uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS], + uint32_t nof_bits); #endif // SRSLTE_PUCCH_NR_H diff --git a/lib/src/phy/ch_estimation/dmrs_pucch.c b/lib/src/phy/ch_estimation/dmrs_pucch.c new file mode 100644 index 000000000..daf0150e4 --- /dev/null +++ b/lib/src/phy/ch_estimation/dmrs_pucch.c @@ -0,0 +1,281 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/ch_estimation/dmrs_pucch.h" +#include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/vector.h" + +// Implements TS 38.211 table 6.4.1.3.1.1-1: Number of DM-RS symbols and the corresponding N_PUCCH... +static uint32_t dmrs_pucch_format1_n_pucch(const srslte_pucch_nr_resource_format1_t* resource, uint32_t m_prime) +{ + if (resource->intra_slot_hopping) { + if (m_prime == 0) { + switch (resource->nof_symbols) { + case 4: + case 5: + return 1; + case 6: + case 7: + case 8: + case 9: + return 2; + case 10: + case 11: + case 12: + case 13: + return 3; + case 14: + return 4; + default:; // Do nothing + } + } else { + switch (resource->nof_symbols) { + case 4: + case 6: + return 1; + case 5: + case 7: + case 8: + case 10: + return 2; + case 9: + case 11: + case 12: + case 14: + return 3; + case 13: + return 4; + default:; // Do nothing + } + } + } else if (m_prime == 0) { + switch (resource->nof_symbols) { + case 4: + return 2; + case 5: + case 6: + return 3; + case 7: + case 8: + return 4; + case 9: + case 10: + return 5; + case 11: + case 12: + return 6; + case 13: + case 14: + return 7; + default:; // Do nothing + } + } + + ERROR("Invalid case nof_symbols=%d and m_prime=%d\n", resource->nof_symbols, m_prime); + return 0; +} + +int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + cf_t* slot_symbols) +{ + + if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { + ERROR("Invalid PUCCH format 1 resource\n"); + return SRSLTE_ERROR; + } + + // Get group sequence + uint32_t u = 0; + uint32_t v = 0; + if (srslte_pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + ERROR("Error getting group sequence\n"); + return SRSLTE_ERROR; + } + + uint32_t n_pucch = dmrs_pucch_format1_n_pucch(resource, 0); + if (n_pucch == 0) { + ERROR("Error getting number of symbols\n"); + return SRSLTE_ERROR; + } + + uint32_t l_prime = resource->start_symbol_idx; + for (uint32_t m = 0; m < n_pucch; m++) { + // Clause 6.4.1.3.1.2 specifies l=0,2,4... + uint32_t l = m * 2; + + // Get start of the sequence in resource grid + cf_t* slot_symbols_ptr = &slot_symbols[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; + + // Get Alpha index + uint32_t alpha_idx = 0; + if (srslte_pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, 0, &alpha_idx) < + SRSLTE_SUCCESS) { + ERROR("Calculating alpha\n"); + } + + // get r_uv sequence from LUT object + const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); + if (r_uv == NULL) { + ERROR("Getting r_uv sequence\n"); + return SRSLTE_ERROR; + } + + // Get w_i_m + cf_t w_i_m = srslte_pucch_nr_format1_w(q, n_pucch, resource->time_domain_occ, m); + + // Compute z(n) = w(i) * r_uv(n) + cf_t z[SRSLTE_NRE]; + srslte_vec_sc_prod_ccc(r_uv, w_i_m, z, SRSLTE_NRE); + + // Put z in the grid + srslte_vec_cf_copy(slot_symbols_ptr, z, SRSLTE_NRE); + } + + return SRSLTE_SUCCESS; +} + +int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + const cf_t* slot_symbols, + srslte_chest_ul_res_t* res) +{ + + if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { + ERROR("Invalid PUCCH format 1 resource\n"); + return SRSLTE_ERROR; + } + + // Get group sequence + uint32_t u = 0; + uint32_t v = 0; + if (srslte_pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + ERROR("Error getting group sequence\n"); + return SRSLTE_ERROR; + } + + uint32_t n_pucch = dmrs_pucch_format1_n_pucch(resource, 0); + if (n_pucch == 0) { + ERROR("Error getting number of symbols\n"); + return SRSLTE_ERROR; + } + + cf_t ce[SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_NRE]; + uint32_t l_prime = resource->start_symbol_idx; + for (uint32_t m = 0; m < n_pucch; m++) { + // Clause 6.4.1.3.1.2 specifies l=0,2,4... + uint32_t l = m * 2; + + // Get start of the sequence in resource grid + const cf_t* slot_symbols_ptr = + &slot_symbols[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; + + // Get Alpha index + uint32_t alpha_idx = 0; + if (srslte_pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, 0, &alpha_idx) < + SRSLTE_SUCCESS) { + ERROR("Calculating alpha\n"); + } + + // get r_uv sequence from LUT object + const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); + if (r_uv == NULL) { + ERROR("Getting r_uv sequence\n"); + return SRSLTE_ERROR; + } + + // Get w_i_m + cf_t w_i_m = srslte_pucch_nr_format1_w(q, n_pucch, resource->time_domain_occ, m); + + // Compute z(n) = w(i) * r_uv(n) + cf_t z[SRSLTE_NRE]; + srslte_vec_sc_prod_ccc(r_uv, w_i_m, z, SRSLTE_NRE); + + // Calculate least square estimates for this symbol + srslte_vec_prod_conj_ccc(slot_symbols_ptr, z, ce[m], SRSLTE_NRE); + } + + // Perform measurements + float rsrp = 0.0f; + float epre = 0.0f; + float ta_err = 0.0f; + for (uint32_t m = 0; m < n_pucch; m++) { + cf_t corr = srslte_vec_acc_cc(ce[m], SRSLTE_NRE); + rsrp += __real__ corr * __real__ corr + __imag__ corr * __imag__ corr; + epre += srslte_vec_avg_power_cf(ce[m], SRSLTE_NRE); + ta_err += srslte_vec_estimate_frequency(ce[m], SRSLTE_NRE); + } + + // Average measurements + rsrp /= n_pucch; + epre /= n_pucch; + ta_err /= n_pucch; + + // Set power measures + rsrp = SRSLTE_MIN(rsrp, epre); + res->noise_estimate = epre - rsrp; + res->noise_estimate_dbm = srslte_convert_power_to_dB(res->noise_estimate); + res->snr = rsrp / res->noise_estimate; + res->snr_db = srslte_convert_power_to_dB(res->snr_db); + + // Compute Time Aligment error in microseconds + if (isnormal(ta_err)) { + ta_err /= 15e3f * (float)(1U << carrier->numerology); // Convert from normalized frequency to seconds + ta_err *= 1e6f; // Convert to micro-seconds + ta_err = roundf(ta_err * 10.0f) / 10.0f; // Round to one tenth of micro-second + res->ta_us = ta_err; + } else { + res->ta_us = 0.0f; + } + + // Measure CFO + res->cfo = NAN; // Not implemented + + // Do averaging here + // ... Not implemented + + // Interpolates between DMRS symbols + for (uint32_t m = 0; m < n_pucch; m++) { + uint32_t l = m * 2 + 1; + cf_t* ce_ptr = &res->ce[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; + + if (m != n_pucch - 1) { + // If it is not the last symbol with DMRS, average between + srslte_vec_sum_ccc(ce[m], ce[m + 1], ce_ptr, SRSLTE_NRE); + srslte_vec_sc_prod_cfc(ce_ptr, 0.5f, ce_ptr, SRSLTE_NRE); + } else if (m != 0) { + // Extrapolate for the last if more than 1 are provided + srslte_vec_sc_prod_cfc(ce[m], 3.0f, ce_ptr, SRSLTE_NRE); + srslte_vec_sub_ccc(ce_ptr, ce[m - 1], ce_ptr, SRSLTE_NRE); + srslte_vec_sc_prod_cfc(ce_ptr, 0.5f, ce_ptr, SRSLTE_NRE); + } else { + // Simply copy the + srslte_vec_cf_copy(ce_ptr, ce[m], SRSLTE_NRE); + } + } + + return SRSLTE_SUCCESS; +} diff --git a/lib/src/phy/phch/pucch_nr.c b/lib/src/phy/phch/pucch_nr.c index 6000c1e13..49851a1a5 100644 --- a/lib/src/phy/phch/pucch_nr.c +++ b/lib/src/phy/phch/pucch_nr.c @@ -18,9 +18,9 @@ #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" #include +#include -// Implements TS 38.211 clause 6.3.2.2.1 Group and sequence hopping -static int pucch_nr_group_sequence(const srslte_carrier_nr_t* carrier, +int srslte_pucch_nr_group_sequence(const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, uint32_t* u_, uint32_t* v_) @@ -57,14 +57,19 @@ static int pucch_nr_group_sequence(const srslte_carrier_nr_t* carrier, } // Implements TS 38.211 clause 6.3.2.2.2 Cyclic shift hopping -static uint32_t pucch_nr_alpha_idx(const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - uint32_t l, - uint32_t l_prime, - uint32_t m0, - uint32_t m_cs) +int srslte_pucch_nr_alpha_idx(const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + uint32_t l, + uint32_t l_prime, + uint32_t m0, + uint32_t m_cs, + uint32_t* alpha_idx) { + if (carrier == NULL || cfg == NULL || slot == NULL || alpha_idx == NULL) { + return SRSLTE_ERROR; + } + // Compute number of slot uint32_t n_slot = slot->idx % SRSLTE_NSLOTS_PER_FRAME_NR(carrier->numerology); @@ -80,10 +85,12 @@ static uint32_t pucch_nr_alpha_idx(const srslte_carrier_nr_t* carrier, n_cs += cs[SRSLTE_NSYMB_PER_SLOT_NR * n_slot + (l + l_prime) * 8 + m] << m; } - return (m0 + m_cs + n_cs) % SRSLTE_NRE; + *alpha_idx = (m0 + m_cs + n_cs) % SRSLTE_NRE; + + return SRSLTE_SUCCESS; } -static int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_format0_t* resource) +int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_format0_t* resource) { if (resource == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; @@ -107,7 +114,7 @@ static int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource return SRSLTE_SUCCESS; } -static int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_format1_t* resource) +int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_format1_t* resource) { if (resource == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; @@ -152,8 +159,6 @@ static uint32_t {{}, {}, {}, {}, {}, {0, 5, 4, 3, 2, 1}, {0, 5, 3, 1, 6, 4, 2}}, {{}, {}, {}, {}, {}, {}, {0, 6, 5, 4, 3, 2, 1}}}; -#define SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS 2 - int srslte_pucch_nr_init(srslte_pucch_nr_t* q) { if (q == NULL) { @@ -205,13 +210,13 @@ void srslte_pucch_nr_free(srslte_pucch_nr_t* q) SRSLTE_MEM_ZERO(q, srslte_pucch_nr_t, 1); } -int srslte_pucch_nr_format0_put(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - srslte_pucch_nr_resource_format0_t* resource, - uint32_t m_cs, - cf_t* slot_symbols) +int srslte_pucch_nr_format0_encode(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + srslte_pucch_nr_resource_format0_t* resource, + uint32_t m_cs, + cf_t* slot_symbols) { if (carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; @@ -224,7 +229,7 @@ int srslte_pucch_nr_format0_put(const srslte_pucch_nr_t* q, uint32_t u = 0; uint32_t v = 0; - if (pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { ERROR("Error getting group sequence\n"); return SRSLTE_ERROR; } @@ -232,7 +237,11 @@ int srslte_pucch_nr_format0_put(const srslte_pucch_nr_t* q, uint32_t l_prime = resource->start_symbol_idx; for (uint32_t l = 0; l < resource->nof_symbols; l++) { // Get Alpha index - uint32_t alpha_idx = pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs); + uint32_t alpha_idx = 0; + if (srslte_pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs, &alpha_idx) < + SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } // get r_uv sequence from LUT object const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); @@ -271,7 +280,7 @@ int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, uint32_t u = 0; uint32_t v = 0; - if (pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { ERROR("Error getting group sequence\n"); return SRSLTE_ERROR; } @@ -281,7 +290,11 @@ int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, float rsrp = 0.0f; for (uint32_t l = 0; l < resource->nof_symbols; l++) { // Get Alpha index - uint32_t alpha_idx = pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs); + uint32_t alpha_idx = 0; + if (srslte_pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs, &alpha_idx) < + SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } // get r_uv sequence from LUT object const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); @@ -320,7 +333,7 @@ int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, } // Implements TS 38.211 table 6.3.2.4.1-1 Number of PUCCH symbols and the corresponding N_PUC... -uint32_t pucch_nr_format1_n_pucch(const srslte_pucch_nr_resource_format1_t* resource, uint32_t m_prime) +static uint32_t pucch_nr_format1_n_pucch(const srslte_pucch_nr_resource_format1_t* resource, uint32_t m_prime) { if (resource->intra_slot_hopping) { if (m_prime == 0) { @@ -337,7 +350,7 @@ uint32_t pucch_nr_format1_n_pucch(const srslte_pucch_nr_resource_format1_t* reso return resource->nof_symbols / 2; } -static cf_t pucch_nr_format1_w(const srslte_pucch_nr_t* q, uint32_t n_pucch, uint32_t i, uint32_t m) +cf_t srslte_pucch_nr_format1_w(const srslte_pucch_nr_t* q, uint32_t n_pucch, uint32_t i, uint32_t m) { if (n_pucch < 1 || n_pucch > SRSLTE_PUCCH_NR_FORMAT1_N_MAX) { ERROR("Invalid n_pucch\n"); @@ -356,14 +369,14 @@ static cf_t pucch_nr_format1_w(const srslte_pucch_nr_t* q, uint32_t n_pucch, uin return q->format1_w_i_m[i][n_pucch - 1][m]; } -int srslte_pucch_nr_put_format1(srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS], - uint32_t nof_bits, - cf_t* slot_symbols) +int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + uint8_t* b, + uint32_t nof_bits, + cf_t* slot_symbols) { uint32_t m_cs = 0; @@ -392,7 +405,7 @@ int srslte_pucch_nr_put_format1(srslte_pucch_nr_t* q, // Get group sequence uint32_t u = 0; uint32_t v = 0; - if (pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { ERROR("Error getting group sequence\n"); return SRSLTE_ERROR; } @@ -406,7 +419,11 @@ int srslte_pucch_nr_put_format1(srslte_pucch_nr_t* q, cf_t* slot_symbols_ptr = &slot_symbols[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; // Get Alpha index - uint32_t alpha_idx = pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs); + uint32_t alpha_idx = 0; + if (srslte_pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs, &alpha_idx) < + SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } // get r_uv sequence from LUT object const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); @@ -420,7 +437,7 @@ int srslte_pucch_nr_put_format1(srslte_pucch_nr_t* q, srslte_vec_sc_prod_ccc(r_uv, d, y, SRSLTE_NRE); // Get w_i_m - cf_t w_i_m = pucch_nr_format1_w(q, n_pucch, resource->time_domain_occ, m); + cf_t w_i_m = srslte_pucch_nr_format1_w(q, n_pucch, resource->time_domain_occ, m); // Compute z(n) = w(i) * y(n) cf_t z[SRSLTE_NRE]; @@ -430,5 +447,91 @@ int srslte_pucch_nr_put_format1(srslte_pucch_nr_t* q, srslte_vec_cf_copy(slot_symbols_ptr, z, SRSLTE_NRE); } + return SRSLTE_SUCCESS; +} + +int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_format1_t* resource, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols, + uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS], + uint32_t nof_bits) +{ + uint32_t m_cs = 0; + + if (carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || b == NULL || slot_symbols == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { + ERROR("Invalid PUCCH format 1 resource\n"); + return SRSLTE_SUCCESS; + } + + if (nof_bits > 2) { + ERROR("Invalid number of bits (%d)\n", nof_bits); + return SRSLTE_ERROR; + } + + // Received symbol d + cf_t d = 0; + + // Get group sequence + uint32_t u = 0; + uint32_t v = 0; + if (srslte_pucch_nr_group_sequence(carrier, cfg, &u, &v) < SRSLTE_SUCCESS) { + ERROR("Error getting group sequence\n"); + return SRSLTE_ERROR; + } + + // Calculate number of symbols carrying PUCCH (No DMRS) + uint32_t n_pucch = pucch_nr_format1_n_pucch(resource, 0); + + uint32_t l_prime = resource->start_symbol_idx; + for (uint32_t l = 1, m = 0; l < resource->nof_symbols; l += 2, m++) { + // Get start of the sequence in resource grid + cf_t* slot_symbols_ptr = &slot_symbols[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; + cf_t* ce_ptr = &chest_res->ce[(carrier->nof_prb * (l + l_prime) + resource->starting_prb) * SRSLTE_NRE]; + + // Equalise x = w(i) * d' * r_uv(n) + cf_t x[SRSLTE_NRE]; + srslte_predecoding_single(slot_symbols_ptr, ce_ptr, x, NULL, SRSLTE_NRE, 1.0f, chest_res->noise_estimate); + + // Get Alpha index + uint32_t alpha_idx = 0; + if (srslte_pucch_nr_alpha_idx(carrier, cfg, slot, l, l_prime, resource->initial_cyclic_shift, m_cs, &alpha_idx) < + SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // get r_uv sequence from LUT object + const cf_t* r_uv = srslte_zc_sequence_lut_get(&q->r_uv_1prb, u, v, alpha_idx); + if (r_uv == NULL) { + ERROR("Getting r_uv sequence\n"); + return SRSLTE_ERROR; + } + // Get w_i_m + cf_t w_i_m = srslte_pucch_nr_format1_w(q, n_pucch, resource->time_domain_occ, m); + + // Compute z(n) = w(i) * r_uv(n) + cf_t z[SRSLTE_NRE]; + srslte_vec_sc_prod_ccc(r_uv, w_i_m, z, SRSLTE_NRE); + + // Compute d = sum(x * conj(w(i) * r_uv(n))) = sum(w(i) * d' * r_uv(n) * conj(w(i) * r_uv(n))) = d' + d += srslte_vec_dot_prod_conj_ccc(x, z, SRSLTE_NRE); + } + + // Demodulate d + float llr[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS]; + srslte_demod_soft_demodulate((nof_bits == 1) ? SRSLTE_MOD_BPSK : SRSLTE_MOD_QPSK, &d, llr, 1); + + // Hard decision + for (uint32_t i = 0; i < nof_bits; i++) { + b[i] = llr[i] > 0.0f ? 1 : 0; + } + return SRSLTE_SUCCESS; } \ No newline at end of file diff --git a/lib/src/phy/phch/test/pucch_nr_test.c b/lib/src/phy/phch/test/pucch_nr_test.c index 44e505220..2594615e2 100644 --- a/lib/src/phy/phch/test/pucch_nr_test.c +++ b/lib/src/phy/phch/test/pucch_nr_test.c @@ -11,6 +11,7 @@ */ #include "srslte/common/test_common.h" +#include "srslte/phy/ch_estimation/dmrs_pucch.h" #include "srslte/phy/phch/pucch_nr.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" @@ -47,7 +48,7 @@ static int test_pucch_format0(srslte_pucch_nr_t* pucch, const srslte_pucch_nr_co for (resource.initial_cyclic_shift = 0; resource.initial_cyclic_shift <= 11; resource.initial_cyclic_shift++) { for (uint32_t m_cs = 0; m_cs <= 6; m_cs += 2) { - TESTASSERT(srslte_pucch_nr_format0_put(pucch, &carrier, cfg, &slot, &resource, m_cs, slot_symbols) == + TESTASSERT(srslte_pucch_nr_format0_encode(pucch, &carrier, cfg, &slot, &resource, m_cs, slot_symbols) == SRSLTE_SUCCESS); // Measure PUCCH format 0 for all possible values of m_cs @@ -77,6 +78,66 @@ static int test_pucch_format0(srslte_pucch_nr_t* pucch, const srslte_pucch_nr_co return SRSLTE_SUCCESS; } +static int test_pucch_format1(srslte_pucch_nr_t* pucch, + const srslte_pucch_nr_common_cfg_t* cfg, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols) +{ + srslte_dl_slot_cfg_t slot = {}; + srslte_pucch_nr_resource_format1_t resource = {}; + + for (slot.idx = 0; slot.idx < SRSLTE_NSLOTS_PER_FRAME_NR(carrier.numerology); slot.idx++) { + for (resource.starting_prb = 0; resource.starting_prb < carrier.nof_prb; + resource.starting_prb += starting_prb_stride) { + for (resource.nof_symbols = 4; resource.nof_symbols <= 14; resource.nof_symbols++) { + for (resource.start_symbol_idx = 0; + resource.start_symbol_idx <= SRSLTE_NSYMB_PER_SLOT_NR - resource.nof_symbols; + resource.start_symbol_idx += starting_symbol_stride) { + for (resource.time_domain_occ = 0; resource.time_domain_occ <= 6; resource.time_domain_occ++) { + for (resource.initial_cyclic_shift = 0; resource.initial_cyclic_shift <= 11; + resource.initial_cyclic_shift++) { + for (uint32_t nof_bits = 1; nof_bits <= SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS; nof_bits++) { + for (uint32_t word = 0; word < (1U << nof_bits); word++) { + // Generate bits + uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS] = {}; + for (uint32_t i = 0; i < nof_bits; i++) { + b[i] = (word >> i) & 1U; + } + + // Encode PUCCH + TESTASSERT(srslte_pucch_nr_format1_encode( + pucch, &carrier, cfg, &slot, &resource, b, nof_bits, slot_symbols) == SRSLTE_SUCCESS); + + // Put DMRS + TESTASSERT(srslte_dmrs_pucch_format1_put(pucch, &carrier, cfg, &slot, &resource, slot_symbols) == + SRSLTE_SUCCESS); + + // Estimate channel + TESTASSERT(srslte_dmrs_pucch_format1_estimate( + pucch, &carrier, cfg, &slot, &resource, slot_symbols, chest_res) == SRSLTE_SUCCESS); + + // Decode PUCCH + uint8_t b_rx[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS]; + TESTASSERT(srslte_pucch_nr_format1_decode( + pucch, &carrier, cfg, &slot, &resource, chest_res, slot_symbols, b_rx, nof_bits) == + SRSLTE_SUCCESS); + + // Check received bits + for (uint32_t i = 0; i < nof_bits; i++) { + TESTASSERT(b[i] == b_rx[i]); + } + } + } + } + } + } + } + } + } + + return SRSLTE_SUCCESS; +} + static void usage(char* prog) { printf("Usage: %s [csNnv]\n", prog); @@ -111,9 +172,10 @@ int main(int argc, char** argv) int ret = SRSLTE_ERROR; parse_args(argc, argv); - uint32_t nof_re = carrier.nof_prb * SRSLTE_NRE * SRSLTE_NSYMB_PER_SLOT_NR; - cf_t* slot_symb = srslte_vec_cf_malloc(nof_re); - srslte_pucch_nr_t pucch = {}; + uint32_t nof_re = carrier.nof_prb * SRSLTE_NRE * SRSLTE_NSYMB_PER_SLOT_NR; + cf_t* slot_symb = srslte_vec_cf_malloc(nof_re); + srslte_pucch_nr_t pucch = {}; + srslte_chest_ul_res_t chest_res = {}; if (slot_symb == NULL) { ERROR("Alloc\n"); @@ -125,12 +187,25 @@ int main(int argc, char** argv) goto clean_exit; } + if (srslte_chest_ul_res_init(&chest_res, carrier.nof_prb)) { + ERROR("Chest UL\n"); + goto clean_exit; + } + srslte_pucch_nr_common_cfg_t common_cfg = {}; + + // Test Format 0 if (test_pucch_format0(&pucch, &common_cfg, slot_symb) < SRSLTE_SUCCESS) { ERROR("Failed PUCCH format 0\n"); goto clean_exit; } + // Test Format 1 + if (test_pucch_format1(&pucch, &common_cfg, &chest_res, slot_symb) < SRSLTE_SUCCESS) { + ERROR("Failed PUCCH format 1\n"); + goto clean_exit; + } + ret = SRSLTE_SUCCESS; clean_exit: if (slot_symb) { @@ -138,6 +213,7 @@ clean_exit: } srslte_pucch_nr_free(&pucch); + srslte_chest_ul_res_free(&chest_res); if (ret == SRSLTE_SUCCESS) { printf("Test passed!\n"); From 4d96cf4a418c13ba3bf104f0f5dca5ce6ae2999f Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 19 Jan 2021 15:25:18 +0100 Subject: [PATCH 132/138] More NR-PUCCH support --- .../srslte/phy/ch_estimation/dmrs_pucch.h | 26 +- lib/include/srslte/phy/phch/pucch_cfg_nr.h | 86 ++++++ lib/include/srslte/phy/phch/pucch_nr.h | 131 ++------- lib/include/srslte/phy/phch/uci_cfg_nr.h | 2 +- lib/include/srslte/phy/phch/uci_nr.h | 8 +- lib/include/srslte/phy/utils/vector.h | 1 + lib/src/phy/ch_estimation/dmrs_pucch.c | 28 +- lib/src/phy/phch/pucch_cfg_nr.c | 82 ++++++ lib/src/phy/phch/pucch_nr.c | 168 +++++------ lib/src/phy/phch/test/pucch_nr_test.c | 7 +- lib/src/phy/phch/uci_nr.c | 267 ++++++++++++++++-- lib/src/phy/utils/vector.c | 22 ++ 12 files changed, 585 insertions(+), 243 deletions(-) create mode 100644 lib/include/srslte/phy/phch/pucch_cfg_nr.h create mode 100644 lib/src/phy/phch/pucch_cfg_nr.c diff --git a/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h b/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h index 9c0ee006b..b6689069c 100644 --- a/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h +++ b/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h @@ -27,12 +27,12 @@ * @param[out] slot_symbols Resource grid of the given slot * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise */ -SRSLTE_API int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - cf_t* slot_symbols); +SRSLTE_API int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + cf_t* slot_symbols); /** * @brief Estimates NR-PUCCH format 1 resource elements from their DMRS in the provided resource grid @@ -45,12 +45,12 @@ SRSLTE_API int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* * @param[out] res UL Channel estimator result * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise */ -SRSLTE_API int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - const cf_t* slot_symbols, - srslte_chest_ul_res_t* res); +SRSLTE_API int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const cf_t* slot_symbols, + srslte_chest_ul_res_t* res); #endif // SRSLTE_DMRS_PUCCH_H diff --git a/lib/include/srslte/phy/phch/pucch_cfg_nr.h b/lib/include/srslte/phy/phch/pucch_cfg_nr.h new file mode 100644 index 000000000..6a7864973 --- /dev/null +++ b/lib/include/srslte/phy/phch/pucch_cfg_nr.h @@ -0,0 +1,86 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_PUCCH_CFG_NR_H +#define SRSLTE_PUCCH_CFG_NR_H + +#include "srslte/config.h" +#include +#include + +typedef enum SRSLTE_API { + SRSLTE_PUCCH_NR_FORMAT_0 = 0, + SRSLTE_PUCCH_NR_FORMAT_1, + SRSLTE_PUCCH_NR_FORMAT_2, + SRSLTE_PUCCH_NR_FORMAT_3, + SRSLTE_PUCCH_NR_FORMAT_4, + SRSLTE_PUCCH_NR_FORMAT_ERROR, +} srslte_pucch_nr_format_t; + +typedef enum SRSLTE_API { + SRSLTE_PUCCH_NR_GROUP_HOPPING_NEITHER = 0, + SRSLTE_PUCCH_NR_GROUP_HOPPING_ENABLE, + SRSLTE_PUCCH_NR_GROUP_HOPPING_DISABLE +} srslte_pucch_nr_group_hopping_t; + +/** + * @brief PUCCH Common configuration + * @remark Defined in TS 38.331 PUCCH-ConfigCommon + */ +typedef struct SRSLTE_API { + uint32_t resource_common; ///< Configures a set of cell-specific PUCCH resources/parameters + srslte_pucch_nr_group_hopping_t group_hopping; ///< Configuration of group and sequence hopping + uint32_t hopping_id; ///< Cell-specific scrambling ID for group hopping and sequence hopping if enabled + bool hopping_id_present; + float p0_nominal; ///< Power control parameter P0 for PUCCH transmissions. Value in dBm. (-202..24) +} srslte_pucch_nr_common_cfg_t; + +/** + * @brief Generic PUCCH Resource configuration + * @remark Defined in TS 38.331 PUCCH-Config + */ +typedef struct SRSLTE_API { + // + uint32_t starting_prb; + bool intra_slot_hopping; + uint32_t second_hop_prb; + + // Common PUCCH-Resource parameters among all formats + srslte_pucch_nr_format_t format; ///< PUCCH format this configuration belongs + uint32_t nof_symbols; ///< Number of symbols + uint32_t start_symbol_idx; ///< Starting symbol index + double max_code_rate; ///< Maximum code rate (0.08, 0.15, 0.25, 0.35, 0.45, 0.60, 0.80) + bool enable_pi_bpsk; ///< Enables PI-BPSK + + // Specific PUCCH-Resource + uint32_t initial_cyclic_shift; ///< Used by formats 0, 1 + uint32_t time_domain_occ; ///< Used by format 1 + uint32_t nof_prb; ///< Used by formats 2, 3 + uint32_t occ_lenth; ///< Spreading factor, used by format 4 + uint32_t occ_index; ///< Used by format 4 +} srslte_pucch_nr_resource_t; + +/** + * @brief Validates a PUCCH format 0 resource configuration provided by upper layers + * @param resource Resource configuration to validate + * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_t* resource); + +/** + * @brief Validates a PUCCH format 1 resource configuration provided by upper layers + * @param resource Resource configuration to validate + * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_t* resource); + +#endif // SRSLTE_PUCCH_CFG_NR_H diff --git a/lib/include/srslte/phy/phch/pucch_nr.h b/lib/include/srslte/phy/phch/pucch_nr.h index 15f0d418f..9a1a6397d 100644 --- a/lib/include/srslte/phy/phch/pucch_nr.h +++ b/lib/include/srslte/phy/phch/pucch_nr.h @@ -17,6 +17,7 @@ #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/common/zc_sequence.h" #include "srslte/phy/modem/modem_table.h" +#include "srslte/phy/phch/uci_nr.h" #include #include #include @@ -31,57 +32,10 @@ */ #define SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS 2 -typedef enum SRSLTE_API { - SRSLTE_PUCCH_NR_FORMAT_0 = 0, - SRSLTE_PUCCH_NR_FORMAT_1, - SRSLTE_PUCCH_NR_FORMAT_2, - SRSLTE_PUCCH_NR_FORMAT_3, - SRSLTE_PUCCH_NR_FORMAT_4, - SRSLTE_PUCCH_NR_FORMAT_ERROR, -} srslte_pucch_nr_format_t; - -typedef enum SRSLTE_API { - SRSLTE_PUCCH_NR_GROUP_HOPPING_NEITHER = 0, - SRSLTE_PUCCH_NR_GROUP_HOPPING_ENABLE, - SRSLTE_PUCCH_NR_GROUP_HOPPING_DISABLE -} srslte_pucch_nr_group_hopping_t; - -/** - * @brief PUCCH Common configuration - * @remark Defined in TS 38.331 PUCCH-ConfigCommon - */ -typedef struct SRSLTE_API { - uint32_t resource_common; ///< Configures a set of cell-specific PUCCH resources/parameters - srslte_pucch_nr_group_hopping_t group_hopping; ///< Configuration of group and sequence hopping - uint32_t hopping_id; ///< Cell-specific scrambling ID for group hopping and sequence hopping if enabled - bool hopping_id_present; - float p0_nominal; ///< Power control parameter P0 for PUCCH transmissions. Value in dBm. (-202..24) -} srslte_pucch_nr_common_cfg_t; - -/** - * @brief Generic PUCCH Resource configuration - * @remark Defined in TS 38.331 PUCCH-Config - */ typedef struct SRSLTE_API { - // - uint32_t starting_prb; - bool intra_slot_frequency_hopping; - uint32_t second_hop_prb; - - // Common PUCCH-Resource parameters among all formats - srslte_pucch_nr_format_t format; ///< PUCCH format this configuration belongs - uint32_t nof_symbols; ///< Number of symbols - uint32_t start_symbol_idx; ///< Starting symbol index - double max_code_rate; ///< Maximum code rate (0.08, 0.15, 0.25, 0.35, 0.45, 0.60, 0.80) - bool enable_pi_bpsk; ///< Enables PI-BPSK - - // Specific PUCCH-Resource - uint32_t initial_cyclic_shift; ///< Used by formats 0, 1 - uint32_t time_domain_occ; ///< Used by format 1 - uint32_t nof_prb; ///< Used by formats 2, 3 - uint32_t occ_lenth; ///< Spreading factor, used by format 4 - uint32_t occ_index; ///< Used by format 4 -} srslte_pucch_nr_resource_t; + srslte_uci_nr_args_t uci; + uint32_t max_nof_prb; +} srslte_pucch_nr_args_t; typedef struct SRSLTE_API { float rsrp; @@ -91,38 +45,17 @@ typedef struct SRSLTE_API { float norm_corr; } srslte_pucch_nr_measure_t; -/** - * @brief PUCCH Resource configuration for Format 0 - * @remark Defined in TS 38.331 PUCCH-Config - */ -typedef struct SRSLTE_API { - uint32_t starting_prb; - uint32_t initial_cyclic_shift; ///< initialCyclicShift (0..11) - uint32_t start_symbol_idx; ///< startingSymbolIndex (0..13) - uint32_t nof_symbols; ///< nrofSymbols (1..2) -} srslte_pucch_nr_resource_format0_t; - -/** - * @brief PUCCH Resource configuration for Format 1 - * @remark Defined in TS 38.331 PUCCH-Config - */ -typedef struct SRSLTE_API { - uint32_t starting_prb; - uint32_t initial_cyclic_shift; ///< initialCyclicShift (0..11) - uint32_t start_symbol_idx; ///< startingSymbolIndex (0..10) - uint32_t nof_symbols; ///< nrofSymbols (4..14) - uint32_t time_domain_occ; ///< TimeDomainOCC(0..6) - bool intra_slot_hopping; -} srslte_pucch_nr_resource_format1_t; - /** * @brief NR-PUCCH encoder/decoder object */ typedef struct SRSLTE_API { + uint32_t max_prb; srslte_zc_sequence_lut_t r_uv_1prb; cf_t format1_w_i_m[SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_PUCCH_NR_FORMAT1_N_MAX]; srslte_modem_table_t bpsk; srslte_modem_table_t qpsk; + srslte_uci_nr_t uci; + uint8_t* b; } srslte_pucch_nr_t; /** @@ -130,7 +63,7 @@ typedef struct SRSLTE_API { * @param q Object * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise */ -SRSLTE_API int srslte_pucch_nr_init(srslte_pucch_nr_t* q); +SRSLTE_API int srslte_pucch_nr_init(srslte_pucch_nr_t* q, const srslte_pucch_nr_args_t* args); /** * @brief Deallocates an NR-PUCCH encoder/decoder object @@ -173,13 +106,6 @@ SRSLTE_API int srslte_pucch_nr_alpha_idx(const srslte_carrier_nr_t* car uint32_t m_cs, uint32_t* alpha_idx); -/** - * @brief Validates a PUCCH format 1 resource configuration provided by upper layers - * @param resource Resource configuration to validate - * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise - */ -SRSLTE_API int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_format0_t* resource); - /** * @brief Encode and writes NR-PUCCH format 0 in the resource grid * @remark Described in TS 38.211 clause 6.3.2.3 PUCCH format 0 @@ -196,7 +122,7 @@ SRSLTE_API int srslte_pucch_nr_format0_encode(const srslte_pucch_nr_t* const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, const srslte_dl_slot_cfg_t* slot, - srslte_pucch_nr_resource_format0_t* resource, + srslte_pucch_nr_resource_t* resource, uint32_t m_cs, cf_t* slot_symbols); @@ -216,18 +142,11 @@ SRSLTE_API int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, const srslte_dl_slot_cfg_t* slot, - srslte_pucch_nr_resource_format0_t* resource, + srslte_pucch_nr_resource_t* resource, uint32_t m_cs, const cf_t* slot_symbols, srslte_pucch_nr_measure_t* measure); -/** - * @brief Validates a PUCCH format 1 resource configuration provided by upper layers - * @param resource Resource configuration to validate - * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise - */ -SRSLTE_API int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_format1_t* resource); - /** * @brief Get NR-PUCCH orthogonal sequence w * @remark Defined by TS 38.211 Table 6.3.2.4.1-2: Orthogonal sequences ... for PUCCH format 1 @@ -252,14 +171,14 @@ SRSLTE_API cf_t srslte_pucch_nr_format1_w(const srslte_pucch_nr_t* q, uint32_t n * @param[out] slot_symbols Resource grid of the given slot * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise */ -SRSLTE_API int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - uint8_t* b, - uint32_t nof_bits, - cf_t* slot_symbols); +SRSLTE_API int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + uint8_t* b, + uint32_t nof_bits, + cf_t* slot_symbols); /** * @brief Decodes NR-PUCCH format 1 @@ -274,13 +193,13 @@ SRSLTE_API int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* * @param[in] nof_bits Number of bits to decode in the message * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise */ -SRSLTE_API int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - srslte_chest_ul_res_t* chest_res, - cf_t* slot_symbols, +SRSLTE_API int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols, uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS], uint32_t nof_bits); diff --git a/lib/include/srslte/phy/phch/uci_cfg_nr.h b/lib/include/srslte/phy/phch/uci_cfg_nr.h index 0f47924d9..a357e7984 100644 --- a/lib/include/srslte/phy/phch/uci_cfg_nr.h +++ b/lib/include/srslte/phy/phch/uci_cfg_nr.h @@ -16,7 +16,7 @@ #include #include -#define SRSLTE_UCI_NR_MAX_ACK_BITS 10 +#define SRSLTE_UCI_NR_MAX_ACK_BITS 360 #define SRSLTE_UCI_NR_MAX_SR_BITS 10 #define SRSLTE_UCI_NR_MAX_CSI1_BITS 10 #define SRSLTE_UCI_NR_MAX_CSI2_BITS 10 diff --git a/lib/include/srslte/phy/phch/uci_nr.h b/lib/include/srslte/phy/phch/uci_nr.h index 5c7600493..8d31c3124 100644 --- a/lib/include/srslte/phy/phch/uci_nr.h +++ b/lib/include/srslte/phy/phch/uci_nr.h @@ -15,9 +15,10 @@ #include "srslte/phy/fec/crc.h" #include "srslte/phy/fec/polar/polar_code.h" +#include "srslte/phy/fec/polar/polar_decoder.h" #include "srslte/phy/fec/polar/polar_encoder.h" #include "srslte/phy/fec/polar/polar_rm.h" -#include "srslte/phy/phch/pucch_nr.h" +#include "srslte/phy/phch/pucch_cfg_nr.h" #include "uci_cfg.h" #include "uci_cfg_nr.h" #include @@ -27,13 +28,10 @@ typedef struct { bool disable_simd; } srslte_uci_nr_args_t; -typedef struct { - -} srslte_uci_nr_cfg_t; - typedef struct { srslte_polar_rm_t rm; srslte_polar_encoder_t encoder; + srslte_polar_decoder_t decoder; srslte_crc_t crc6; srslte_crc_t crc11; srslte_polar_code_t code; diff --git a/lib/include/srslte/phy/utils/vector.h b/lib/include/srslte/phy/utils/vector.h index 35dcb7c95..039e070f4 100644 --- a/lib/include/srslte/phy/utils/vector.h +++ b/lib/include/srslte/phy/utils/vector.h @@ -194,6 +194,7 @@ SRSLTE_API void srslte_vec_conj_cc(const cf_t* x, cf_t* y, const uint32_t len); /* average vector power */ SRSLTE_API float srslte_vec_avg_power_cf(const cf_t* x, const uint32_t len); SRSLTE_API float srslte_vec_avg_power_sf(const int16_t* x, const uint32_t len); +SRSLTE_API float srslte_vec_avg_power_bf(const int8_t* x, const uint32_t len); /* Correlation between complex vectors x and y */ SRSLTE_API float srslte_vec_corr_ccc(const cf_t* x, cf_t* y, const uint32_t len); diff --git a/lib/src/phy/ch_estimation/dmrs_pucch.c b/lib/src/phy/ch_estimation/dmrs_pucch.c index daf0150e4..d0661faa4 100644 --- a/lib/src/phy/ch_estimation/dmrs_pucch.c +++ b/lib/src/phy/ch_estimation/dmrs_pucch.c @@ -15,7 +15,7 @@ #include "srslte/phy/utils/vector.h" // Implements TS 38.211 table 6.4.1.3.1.1-1: Number of DM-RS symbols and the corresponding N_PUCCH... -static uint32_t dmrs_pucch_format1_n_pucch(const srslte_pucch_nr_resource_format1_t* resource, uint32_t m_prime) +static uint32_t dmrs_pucch_format1_n_pucch(const srslte_pucch_nr_resource_t* resource, uint32_t m_prime) { if (resource->intra_slot_hopping) { if (m_prime == 0) { @@ -84,12 +84,12 @@ static uint32_t dmrs_pucch_format1_n_pucch(const srslte_pucch_nr_resource_format return 0; } -int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - cf_t* slot_symbols) +int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + cf_t* slot_symbols) { if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL) { @@ -151,13 +151,13 @@ int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* q, return SRSLTE_SUCCESS; } -int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - const cf_t* slot_symbols, - srslte_chest_ul_res_t* res) +int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const cf_t* slot_symbols, + srslte_chest_ul_res_t* res) { if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL) { diff --git a/lib/src/phy/phch/pucch_cfg_nr.c b/lib/src/phy/phch/pucch_cfg_nr.c new file mode 100644 index 000000000..174d11e48 --- /dev/null +++ b/lib/src/phy/phch/pucch_cfg_nr.c @@ -0,0 +1,82 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/phch/pucch_cfg_nr.h" +#include "srslte/phy/utils/debug.h" + +int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_t* resource) +{ + if (resource == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (resource->format != SRSLTE_PUCCH_NR_FORMAT_0) { + ERROR("Invalid format (%d)\n", resource->format); + return SRSLTE_ERROR; + } + + if (resource->nof_symbols != 1 && resource->nof_symbols != 2) { + ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); + return SRSLTE_ERROR; + } + + if (resource->initial_cyclic_shift > 11) { + ERROR("Invalid initial cyclic shift (%d)\n", resource->initial_cyclic_shift); + return SRSLTE_ERROR; + } + + if (resource->start_symbol_idx > 13) { + ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_t* resource) +{ + if (resource == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (resource->format != SRSLTE_PUCCH_NR_FORMAT_1) { + ERROR("Invalid format (%d)\n", resource->format); + return SRSLTE_ERROR; + } + + if (resource->nof_symbols < 4 || resource->nof_symbols > 14) { + ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); + return SRSLTE_ERROR; + } + + if (resource->initial_cyclic_shift > 11) { + ERROR("Invalid initial cyclic shift (%d)\n", resource->initial_cyclic_shift); + return SRSLTE_ERROR; + } + + if (resource->start_symbol_idx > 10) { + ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); + return SRSLTE_ERROR; + } + + if (resource->time_domain_occ > 6) { + ERROR("Invalid time domain occ (%d)\n", resource->time_domain_occ); + return SRSLTE_ERROR; + } + + if (resource->intra_slot_hopping) { + ERROR("Intra-slot hopping is not implemented\n"); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} \ No newline at end of file diff --git a/lib/src/phy/phch/pucch_nr.c b/lib/src/phy/phch/pucch_nr.c index 49851a1a5..a77837d0e 100644 --- a/lib/src/phy/phch/pucch_nr.c +++ b/lib/src/phy/phch/pucch_nr.c @@ -90,64 +90,6 @@ int srslte_pucch_nr_alpha_idx(const srslte_carrier_nr_t* carrier, return SRSLTE_SUCCESS; } -int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_format0_t* resource) -{ - if (resource == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - - if (resource->nof_symbols != 1 && resource->nof_symbols != 2) { - ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); - return SRSLTE_ERROR; - } - - if (resource->initial_cyclic_shift > 11) { - ERROR("Invalid initial cyclic shift (%d)\n", resource->initial_cyclic_shift); - return SRSLTE_ERROR; - } - - if (resource->start_symbol_idx > 13) { - ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); - return SRSLTE_ERROR; - } - - return SRSLTE_SUCCESS; -} - -int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_format1_t* resource) -{ - if (resource == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - - if (resource->nof_symbols < 4 || resource->nof_symbols > 14) { - ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); - return SRSLTE_ERROR; - } - - if (resource->initial_cyclic_shift > 11) { - ERROR("Invalid initial cyclic shift (%d)\n", resource->initial_cyclic_shift); - return SRSLTE_ERROR; - } - - if (resource->start_symbol_idx > 10) { - ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); - return SRSLTE_ERROR; - } - - if (resource->time_domain_occ > 6) { - ERROR("Invalid time domain occ (%d)\n", resource->time_domain_occ); - return SRSLTE_ERROR; - } - - if (resource->intra_slot_hopping) { - ERROR("Intra-slot hopping is not implemented\n"); - return SRSLTE_ERROR; - } - - return SRSLTE_SUCCESS; -} - // TS 38.211 Table 6.3.2.4.1-2: Orthogonal sequences for PUCCH format 1 static uint32_t pucch_nr_format1_rho[SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_PUCCH_NR_FORMAT1_N_MAX][SRSLTE_PUCCH_NR_FORMAT1_N_MAX] = @@ -159,12 +101,21 @@ static uint32_t {{}, {}, {}, {}, {}, {0, 5, 4, 3, 2, 1}, {0, 5, 3, 1, 6, 4, 2}}, {{}, {}, {}, {}, {}, {}, {0, 6, 5, 4, 3, 2, 1}}}; -int srslte_pucch_nr_init(srslte_pucch_nr_t* q) +int srslte_pucch_nr_init(srslte_pucch_nr_t* q, const srslte_pucch_nr_args_t* args) { - if (q == NULL) { + if (q == NULL || args == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; } + // Make sure object is zeroed + SRSLTE_MEM_ZERO(q, srslte_pucch_nr_t, 1); + + // Save maximum number of PRB + q->max_prb = SRSLTE_MAX_PRB_NR; + if (args->max_nof_prb != 0) { + q->max_prb = args->max_nof_prb; + } + // Initialise ZC sequences for 1PRB float alphas_1prb[SRSLTE_NRE] = {}; for (uint32_t i = 0; i < SRSLTE_NRE; i++) { @@ -193,6 +144,19 @@ int srslte_pucch_nr_init(srslte_pucch_nr_t* q) } } + if (srslte_uci_nr_init(&q->uci, &args->uci) < SRSLTE_SUCCESS) { + ERROR("Initiating UCI encoder/decoder\n"); + return SRSLTE_ERROR; + } + + // Allocate encoded bits b + uint32_t max_encoded_bits = q->max_prb * SRSLTE_NRE * 2 * SRSLTE_NSYMB_PER_SLOT_NR; // Assumes QPSK (Qm = 2) + q->b = srslte_vec_u8_malloc(max_encoded_bits); + if (q->b == NULL) { + ERROR("Malloc\n"); + return SRSLTE_ERROR; + } + return SRSLTE_SUCCESS; } @@ -207,6 +171,10 @@ void srslte_pucch_nr_free(srslte_pucch_nr_t* q) srslte_modem_table_free(&q->bpsk); srslte_modem_table_free(&q->qpsk); + if (q->b != NULL) { + free(q->b); + } + SRSLTE_MEM_ZERO(q, srslte_pucch_nr_t, 1); } @@ -214,7 +182,7 @@ int srslte_pucch_nr_format0_encode(const srslte_pucch_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, const srslte_dl_slot_cfg_t* slot, - srslte_pucch_nr_resource_format0_t* resource, + srslte_pucch_nr_resource_t* resource, uint32_t m_cs, cf_t* slot_symbols) { @@ -264,7 +232,7 @@ int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, const srslte_dl_slot_cfg_t* slot, - srslte_pucch_nr_resource_format0_t* resource, + srslte_pucch_nr_resource_t* resource, uint32_t m_cs, const cf_t* slot_symbols, srslte_pucch_nr_measure_t* measure) @@ -333,7 +301,7 @@ int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, } // Implements TS 38.211 table 6.3.2.4.1-1 Number of PUCCH symbols and the corresponding N_PUC... -static uint32_t pucch_nr_format1_n_pucch(const srslte_pucch_nr_resource_format1_t* resource, uint32_t m_prime) +static uint32_t pucch_nr_format1_n_pucch(const srslte_pucch_nr_resource_t* resource, uint32_t m_prime) { if (resource->intra_slot_hopping) { if (m_prime == 0) { @@ -369,14 +337,14 @@ cf_t srslte_pucch_nr_format1_w(const srslte_pucch_nr_t* q, uint32_t n_pucch, uin return q->format1_w_i_m[i][n_pucch - 1][m]; } -int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - uint8_t* b, - uint32_t nof_bits, - cf_t* slot_symbols) +int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + uint8_t* b, + uint32_t nof_bits, + cf_t* slot_symbols) { uint32_t m_cs = 0; @@ -450,22 +418,18 @@ int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, return SRSLTE_SUCCESS; } -int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_format1_t* resource, - srslte_chest_ul_res_t* chest_res, - cf_t* slot_symbols, - uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS], - uint32_t nof_bits) +int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols, + uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS], + uint32_t nof_bits) { uint32_t m_cs = 0; - if (carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || b == NULL || slot_symbols == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { ERROR("Invalid PUCCH format 1 resource\n"); return SRSLTE_SUCCESS; @@ -533,5 +497,41 @@ int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, b[i] = llr[i] > 0.0f ? 1 : 0; } + return SRSLTE_SUCCESS; +} + +int srslte_pucch_nr_format_2_3_4_encode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const srslte_uci_cfg_nr_t* uci_cfg, + const srslte_uci_value_nr_t* uci_value, + cf_t* slot_symbols) +{ + if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || uci_cfg == NULL || + uci_value == NULL || slot_symbols == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_uci_nr_encode_pucch(&q->uci, resource, uci_cfg, uci_value, q->b) < SRSLTE_SUCCESS) { + ERROR("Error encoding UCI\n"); + return SRSLTE_ERROR; + } + + // Encode PUCCH + switch (resource->format) { + case SRSLTE_PUCCH_NR_FORMAT_2: + break; + case SRSLTE_PUCCH_NR_FORMAT_3: + case SRSLTE_PUCCH_NR_FORMAT_4: + ERROR("Not implemented\n"); + return SRSLTE_ERROR; + default: + case SRSLTE_PUCCH_NR_FORMAT_ERROR: + ERROR("Invalid format\n"); + return SRSLTE_ERROR; + } + return SRSLTE_SUCCESS; } \ No newline at end of file diff --git a/lib/src/phy/phch/test/pucch_nr_test.c b/lib/src/phy/phch/test/pucch_nr_test.c index 2594615e2..4600475e0 100644 --- a/lib/src/phy/phch/test/pucch_nr_test.c +++ b/lib/src/phy/phch/test/pucch_nr_test.c @@ -36,7 +36,7 @@ static uint32_t starting_symbol_stride = 4; static int test_pucch_format0(srslte_pucch_nr_t* pucch, const srslte_pucch_nr_common_cfg_t* cfg, cf_t* slot_symbols) { srslte_dl_slot_cfg_t slot = {}; - srslte_pucch_nr_resource_format0_t resource = {}; + srslte_pucch_nr_resource_t resource = {}; for (slot.idx = 0; slot.idx < SRSLTE_NSLOTS_PER_FRAME_NR(carrier.numerology); slot.idx++) { for (resource.starting_prb = 0; resource.starting_prb < carrier.nof_prb; @@ -84,7 +84,7 @@ static int test_pucch_format1(srslte_pucch_nr_t* pucch, cf_t* slot_symbols) { srslte_dl_slot_cfg_t slot = {}; - srslte_pucch_nr_resource_format1_t resource = {}; + srslte_pucch_nr_resource_t resource = {}; for (slot.idx = 0; slot.idx < SRSLTE_NSLOTS_PER_FRAME_NR(carrier.numerology); slot.idx++) { for (resource.starting_prb = 0; resource.starting_prb < carrier.nof_prb; @@ -182,7 +182,8 @@ int main(int argc, char** argv) goto clean_exit; } - if (srslte_pucch_nr_init(&pucch) < SRSLTE_SUCCESS) { + srslte_pucch_nr_args_t pucch_args = {}; + if (srslte_pucch_nr_init(&pucch, &pucch_args) < SRSLTE_SUCCESS) { ERROR("PUCCH init\n"); goto clean_exit; } diff --git a/lib/src/phy/phch/uci_nr.c b/lib/src/phy/phch/uci_nr.c index 093ada5f7..84b56d136 100644 --- a/lib/src/phy/phch/uci_nr.c +++ b/lib/src/phy/phch/uci_nr.c @@ -14,13 +14,15 @@ #include "srslte/phy/fec/block/block.h" #include "srslte/phy/fec/polar/polar_chanalloc.h" #include "srslte/phy/phch/uci_cfg.h" +#include "srslte/phy/utils/bit.h" #include "srslte/phy/utils/vector.h" // TS 38.212 section 5.2.1 Polar coding: The value of A is no larger than 1706. -#define UCI_NR_MAX_A 1906U +#define UCI_NR_MAX_A 1706U #define UCI_NR_MAX_L 11U #define UCI_NR_POLAR_MAX 2048U #define UCI_NR_POLAR_RM_IBIL 0 +#define UCI_NR_BLOCK_CORR_THRESHOLD 0.5f int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args) { @@ -29,9 +31,11 @@ int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args) } srslte_polar_encoder_type_t polar_encoder_type = SRSLTE_POLAR_ENCODER_PIPELINED; + srslte_polar_decoder_type_t polar_decoder_type = SRSLTE_POLAR_DECODER_SSC_C; #ifdef LV_HAVE_AVX2 if (!args->disable_simd) { polar_encoder_type = SRSLTE_POLAR_ENCODER_AVX2; + polar_decoder_type = SRSLTE_POLAR_DECODER_SSC_C_AVX2; } #endif // LV_HAVE_AVX2 @@ -40,6 +44,11 @@ int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args) return SRSLTE_ERROR; } + if (srslte_polar_decoder_init(&q->decoder, polar_decoder_type, NMAX_LOG) < SRSLTE_SUCCESS) { + ERROR("Initialising polar encoder\n"); + return SRSLTE_ERROR; + } + if (srslte_polar_rm_tx_init(&q->rm) < SRSLTE_SUCCESS) { ERROR("Initialising polar RM\n"); return SRSLTE_ERROR; @@ -91,6 +100,7 @@ void srslte_uci_nr_free(srslte_uci_nr_t* q) } srslte_polar_encoder_free(&q->encoder); + srslte_polar_decoder_free(&q->decoder); if (q->bit_sequence != NULL) { free(q->bit_sequence); @@ -108,8 +118,7 @@ void srslte_uci_nr_free(srslte_uci_nr_t* q) SRSLTE_MEM_ZERO(q, srslte_uci_nr_t, 1); } -static int -uci_nr_sequence_generation_ack_sr(const srslte_uci_cfg_nr_t* cfg, const srslte_uci_value_nr_t* value, uint8_t* sequence) +static int uci_nr_pack_ack_sr(const srslte_uci_cfg_nr_t* cfg, const srslte_uci_value_nr_t* value, uint8_t* sequence) { int A = 0; @@ -124,12 +133,62 @@ uci_nr_sequence_generation_ack_sr(const srslte_uci_cfg_nr_t* cfg, const srslte_u return A; } -static int -uci_nr_sequence_generation(const srslte_uci_cfg_nr_t* cfg, const srslte_uci_value_nr_t* value, uint8_t* sequence) +static int uci_nr_unpack_ack_sr(const srslte_uci_cfg_nr_t* cfg, const uint8_t* sequence, srslte_uci_value_nr_t* value) +{ + int A = 0; + + // Append ACK bits + srslte_vec_u8_copy(value->ack, &sequence[A], cfg->o_ack); + A += cfg->o_ack; + + // Append SR bits + srslte_vec_u8_copy(value->sr, &sequence[A], cfg->o_sr); + A += cfg->o_sr; + + return A; +} + +static int uci_nr_A(const srslte_uci_cfg_nr_t* cfg) +{ + // 6.3.1.1.1 HARQ-ACK/SR only UCI bit sequence generation + if (cfg->o_csi1 == 0 && cfg->o_csi2 == 0) { + return cfg->o_ack + cfg->o_sr; + } + + // 6.3.1.1.2 CSI only + if (cfg->o_ack == 0 && cfg->o_sr == 0) { + ERROR("CSI only are not implemented\n"); + return SRSLTE_ERROR; + } + + // 6.3.1.1.3 HARQ-ACK/SR and CSI + ERROR("HARQ-ACK/SR and CSI encoding are not implemented\n"); + return SRSLTE_ERROR; +} + +static int uci_nr_packing(const srslte_uci_cfg_nr_t* cfg, const srslte_uci_value_nr_t* value, uint8_t* sequence) +{ + // 6.3.1.1.1 HARQ-ACK/SR only UCI bit sequence generation + if (cfg->o_csi1 == 0 && cfg->o_csi2 == 0) { + return uci_nr_pack_ack_sr(cfg, value, sequence); + } + + // 6.3.1.1.2 CSI only + if (cfg->o_ack == 0 && cfg->o_sr == 0) { + ERROR("CSI only are not implemented\n"); + return SRSLTE_ERROR; + } + + // 6.3.1.1.3 HARQ-ACK/SR and CSI + ERROR("HARQ-ACK/SR and CSI encoding are not implemented\n"); + return SRSLTE_ERROR; +} + +static int uci_nr_unpacking(const srslte_uci_cfg_nr_t* cfg, const uint8_t* sequence, srslte_uci_value_nr_t* value) { // 6.3.1.1.1 HARQ-ACK/SR only UCI bit sequence generation if (cfg->o_csi1 == 0 && cfg->o_csi2 == 0) { - return uci_nr_sequence_generation_ack_sr(cfg, value, sequence); + return uci_nr_unpack_ack_sr(cfg, sequence, value); } // 6.3.1.1.2 CSI only @@ -307,10 +366,40 @@ uci_nr_encode_3_11_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint3 return E; } +static int uci_nr_decode_3_11_bit(srslte_uci_nr_t* q, + const srslte_uci_cfg_nr_t* cfg, + uint32_t A, + const int8_t* llr, + uint32_t E, + bool* decoded_ok) +{ + // Check E for avoiding zero division + if (E < 1) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Compute average LLR power + float pwr = sqrtf(srslte_vec_avg_power_bf(llr, E)); + if (!isnormal(pwr)) { + return SRSLTE_ERROR; + } + + // Decode + float corr = (float)srslte_block_decode_i8(llr, E, q->bit_sequence, A); + + // Normalise correlation + corr /= sqrtf(pwr) * E; + + // Take decoded decision with threshold + *decoded_ok = (corr > UCI_NR_BLOCK_CORR_THRESHOLD); + + return SRSLTE_SUCCESS; +} + #define CEIL(NUM, DEN) (((NUM) + ((DEN)-1)) / (DEN)) static int -uci_nr_encode_11_1906_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint32_t A, uint8_t* o, uint32_t E_uci) +uci_nr_encode_11_1706_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint32_t A, uint8_t* o, uint32_t E_uci) { // If ( A ≥ 360 and E ≥ 1088 ) or if A ≥ 1013 , I seg = 1 ; otherwise I seg = 0 uint32_t I_seg = 0; @@ -342,7 +431,7 @@ uci_nr_encode_11_1906_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, ui for (uint32_t r = 0, s = 0; r < C; r++) { uint32_t k = 0; - // Suffix A_prime - A zeros for the first CB only + // Prefix (A_prime - A) zeros for the first CB only if (r == 0) { for (uint32_t i = 0; i < (A_prime - A); i++) { q->c[k++] = 0; @@ -372,18 +461,92 @@ uci_nr_encode_11_1906_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, ui return E_uci; } -int uci_nr_encode(srslte_uci_nr_t* q, - const srslte_uci_cfg_nr_t* uci_cfg, - const srslte_uci_value_nr_t* uci_value, - uint8_t* o, - uint32_t E_uci) +static int uci_nr_decode_11_1706_bit(srslte_uci_nr_t* q, + const srslte_uci_cfg_nr_t* cfg, + uint32_t A, + const int8_t* llr, + uint32_t E_uci, + bool* decoded_ok) +{ + *decoded_ok = true; + + // If ( A ≥ 360 and E ≥ 1088 ) or if A ≥ 1013 , I seg = 1 ; otherwise I seg = 0 + uint32_t I_seg = 0; + if ((A >= 360 && E_uci >= 1088) || A >= 1013) { + I_seg = 1; + } + + // Select CRC + srslte_crc_t* crc = &q->crc6; + if (A >= 20) { + crc = &q->crc11; + } + + // Segmentation + uint32_t C = 1; + if (I_seg == 1) { + C = 2; + } + uint32_t A_prime = CEIL(A, C) * C; + + // Get polar code + uint32_t K_r = A_prime / C + crc->order; + uint32_t E_r = E_uci / C; + if (srslte_polar_code_get(&q->code, K_r, E_r, 9U) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Write codeword + for (uint32_t r = 0, s = 0; r < C; r++) { + uint32_t k = 0; + + // Undo rate matching + int8_t* d = (int8_t*)q->d; + srslte_polar_rm_rx_c(&q->rm, &llr[E_r * r], d, q->code.n, E_r, K_r, UCI_NR_POLAR_RM_IBIL); + + // Decode bits + if (srslte_polar_decoder_decode_c(&q->decoder, d, q->allocated, q->code.n, q->code.F_set, q->code.F_set_size) < + SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Undo channel allocation + srslte_polar_chanalloc_rx(q->allocated, q->c, q->code.K, q->code.nPC, q->code.K_set, q->code.PC_set); + + // + uint8_t* ptr = &q->c[q->code.K - crc->order]; + uint32_t checksum1 = srslte_crc_checksum(crc, q->c, q->code.K); + uint32_t checksum2 = srslte_bit_pack(&ptr, crc->order); + (*decoded_ok) = ((*decoded_ok) && (checksum1 == checksum2)); + + // Prefix (A_prime - A) zeros for the first CB only + if (r == 0) { + for (uint32_t i = 0; i < (A_prime - A); i++) { + k++; + } + } + + // Load codeword bits + while (k < A_prime / C) { + q->bit_sequence[s++] = q->c[k++]; + } + } + + return SRSLTE_SUCCESS; +} + +static int uci_nr_encode(srslte_uci_nr_t* q, + const srslte_uci_cfg_nr_t* uci_cfg, + const srslte_uci_value_nr_t* uci_value, + uint8_t* o, + uint32_t E_uci) { if (q == NULL || uci_cfg == NULL || uci_value == NULL || o == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; } // 6.3.1.1 UCI bit sequence generation - int A = uci_nr_sequence_generation(uci_cfg, uci_value, q->bit_sequence); + int A = uci_nr_packing(uci_cfg, uci_value, q->bit_sequence); if (A < SRSLTE_SUCCESS) { ERROR("Generating bit sequence"); return SRSLTE_ERROR; @@ -400,17 +563,60 @@ int uci_nr_encode(srslte_uci_nr_t* q, } // 5.3.3.3 Encoding of other small block lengths - if (A <= 11) { + if (A <= SRSLTE_FEC_BLOCK_MAX_NOF_BITS) { return uci_nr_encode_3_11_bit(q, uci_cfg, A, o, E_uci); } + // Encoding of other sizes up to 1906 if (A < UCI_NR_MAX_A) { - return uci_nr_encode_11_1906_bit(q, uci_cfg, A, o, E_uci); + return uci_nr_encode_11_1706_bit(q, uci_cfg, A, o, E_uci); } return SRSLTE_ERROR; } +static int uci_nr_decode(srslte_uci_nr_t* q, + const srslte_uci_cfg_nr_t* uci_cfg, + const int8_t* llr, + uint32_t E_uci, + srslte_uci_value_nr_t* uci_value) +{ + if (q == NULL || uci_cfg == NULL || uci_value == NULL || llr == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // 6.3.1.1 UCI bit sequence generation + int A = uci_nr_A(uci_cfg); + if (A < SRSLTE_SUCCESS) { + ERROR("Error getting number of bits\n"); + return SRSLTE_ERROR; + } + + // Decode LLR + if (A == 1) { + ERROR("Not implemented\n"); + } else if (A == 2) { + ERROR("Not implemented\n"); + } else if (A <= 11) { + if (uci_nr_decode_3_11_bit(q, uci_cfg, A, llr, E_uci, &uci_value->valid) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + } else if (A < UCI_NR_MAX_A) { + if (uci_nr_decode_11_1706_bit(q, uci_cfg, A, llr, E_uci, &uci_value->valid) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + } else { + ERROR("Invalid number of bits (A=%d)\n", A); + } + + // Unpack bits + if (uci_nr_unpacking(uci_cfg, q->bit_sequence, uci_value) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + // Implements TS 38.212 Table 6.3.1.4-1: Total rate matching output sequence length Etot static int uci_nr_pucch_E_tot(const srslte_pucch_nr_resource_t* pucch_cfg, const srslte_uci_cfg_nr_t* uci_cfg) { @@ -418,8 +624,15 @@ static int uci_nr_pucch_E_tot(const srslte_pucch_nr_resource_t* pucch_cfg, const return SRSLTE_ERROR_INVALID_INPUTS; } - switch (pucch_cfg->format) { + // Compute total number of bits + uint32_t nof_bits = uci_cfg->o_sr + uci_cfg->o_ack + uci_cfg->o_csi1 + uci_cfg->o_csi2; + switch (pucch_cfg->format) { + case SRSLTE_PUCCH_NR_FORMAT_1: + if (nof_bits <= 2) { + return nof_bits; + } + break; case SRSLTE_PUCCH_NR_FORMAT_2: if (uci_cfg->modulation == SRSLTE_MOD_QPSK) { return (int)(16 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); @@ -482,3 +695,23 @@ int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, return uci_nr_encode(q, uci_cfg, value, o, E_uci); } + +int srslte_uci_nr_decode_pucch(srslte_uci_nr_t* q, + const srslte_pucch_nr_resource_t* pucch_resource_cfg, + const srslte_uci_cfg_nr_t* uci_cfg, + const int8_t* llr, + srslte_uci_value_nr_t* value) +{ + + int E_tot = uci_nr_pucch_E_tot(pucch_resource_cfg, uci_cfg); + if (E_tot < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + int E_uci = uci_nr_pucch_E_uci(pucch_resource_cfg, uci_cfg, E_tot); + if (E_uci < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + return uci_nr_decode(q, uci_cfg, llr, E_uci, value); +} diff --git a/lib/src/phy/utils/vector.c b/lib/src/phy/utils/vector.c index e8b8841e5..494ca4beb 100644 --- a/lib/src/phy/utils/vector.c +++ b/lib/src/phy/utils/vector.c @@ -543,6 +543,28 @@ float srslte_vec_avg_power_sf(const int16_t* x, const uint32_t len) return acc; } +float srslte_vec_avg_power_bf(const int8_t* x, const uint32_t len) +{ + // Accumulator + float acc = 0.0f; + + for (uint32_t i = 0; i < len; i++) { + // Read value and typecast to float + float t = (float)x[i]; + + // Square value + acc += t * t; + } + + // Do average + if (len) { + acc /= len; + } + + // Return accumulated value + return acc; +} + // Correlation assumes zero-mean x and y float srslte_vec_corr_ccc(const cf_t* x, cf_t* y, const uint32_t len) { From 1ee4d84f80b45a3bc5c059e26cdb73649b200736 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 20 Jan 2021 10:04:53 +0100 Subject: [PATCH 133/138] Added NR-PUCCH encode/decode format2 skeleton --- lib/include/srslte/phy/phch/pucch_cfg_nr.h | 7 ++ lib/include/srslte/phy/phch/pucch_nr.h | 69 +++++++++++++---- lib/include/srslte/phy/phch/uci_nr.h | 18 +++++ lib/src/phy/phch/pucch_cfg_nr.c | 29 ++++++++ lib/src/phy/phch/pucch_nr.c | 86 +++++++++++++++++++++- lib/src/phy/phch/uci_nr.c | 2 - 6 files changed, 192 insertions(+), 19 deletions(-) diff --git a/lib/include/srslte/phy/phch/pucch_cfg_nr.h b/lib/include/srslte/phy/phch/pucch_cfg_nr.h index 6a7864973..71b21055b 100644 --- a/lib/include/srslte/phy/phch/pucch_cfg_nr.h +++ b/lib/include/srslte/phy/phch/pucch_cfg_nr.h @@ -83,4 +83,11 @@ SRSLTE_API int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_reso */ SRSLTE_API int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_t* resource); +/** + * @brief Validates a PUCCH format 2 resource configuration provided by upper layers + * @param resource Resource configuration to validate + * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format2_resource_valid(const srslte_pucch_nr_resource_t* resource); + #endif // SRSLTE_PUCCH_CFG_NR_H diff --git a/lib/include/srslte/phy/phch/pucch_nr.h b/lib/include/srslte/phy/phch/pucch_nr.h index 9a1a6397d..94d165488 100644 --- a/lib/include/srslte/phy/phch/pucch_nr.h +++ b/lib/include/srslte/phy/phch/pucch_nr.h @@ -13,14 +13,11 @@ #ifndef SRSLTE_PUCCH_NR_H #define SRSLTE_PUCCH_NR_H -#include "srslte/config.h" +#include "srslte/phy/ch_estimation/chest_ul.h" #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/common/zc_sequence.h" #include "srslte/phy/modem/modem_table.h" #include "srslte/phy/phch/uci_nr.h" -#include -#include -#include /** * @brief Maximum number of symbols (without DMRS) that NR-PUCCH format 1 can transmit @@ -109,8 +106,8 @@ SRSLTE_API int srslte_pucch_nr_alpha_idx(const srslte_carrier_nr_t* car /** * @brief Encode and writes NR-PUCCH format 0 in the resource grid * @remark Described in TS 38.211 clause 6.3.2.3 PUCCH format 0 - * @param[in] q NR-PUCCH encoder/decoder object - * @param[in] carrier Carrier configuration + * @param[in,out] q NR-PUCCH encoder/decoder object + * @param[in] carrier Serving cell and Uplink BWP configuration * @param[in] cfg PUCCH common configuration * @param[in] slot slot configuration * @param[in] resource PUCCH format 0 resource @@ -128,8 +125,8 @@ SRSLTE_API int srslte_pucch_nr_format0_encode(const srslte_pucch_nr_t* /** * @brief Measures PUCCH format 0 in the resource grid - * @param[in] q NR-PUCCH encoder/decoder object - * @param[in] carrier Carrier configuration + * @param[in,out] q NR-PUCCH encoder/decoder object + * @param[in] carrier Serving cell and Uplink BWP configuration * @param[in] cfg PUCCH common configuration * @param[in] slot slot configuration * @param[in] resource PUCCH format 0 resource @@ -150,7 +147,7 @@ SRSLTE_API int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* /** * @brief Get NR-PUCCH orthogonal sequence w * @remark Defined by TS 38.211 Table 6.3.2.4.1-2: Orthogonal sequences ... for PUCCH format 1 - * @param[in] q NR-PUCCH encoder/decoder object + * @param[in,out] q NR-PUCCH encoder/decoder object * @param[in] n_pucch Number of PUCCH symbols * @param[in] i sequence index * @param m OFDM symbol index @@ -161,8 +158,8 @@ SRSLTE_API cf_t srslte_pucch_nr_format1_w(const srslte_pucch_nr_t* q, uint32_t n /** * @brief Encodes and puts NR-PUCCH format 1 in the resource grid * @remark Described in TS 38.211 clause 6.3.2.4 PUCCH format 1 - * @param[in] q NR-PUCCH encoder/decoder object - * @param[in] carrier Carrier configuration + * @param[in,out] q NR-PUCCH encoder/decoder object + * @param[in] carrier Serving cell and Uplink BWP configuration * @param[in] cfg PUCCH common configuration * @param[in] slot slot configuration * @param[in] resource PUCCH format 1 resource @@ -182,11 +179,11 @@ SRSLTE_API int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* /** * @brief Decodes NR-PUCCH format 1 - * @param[in] q NR-PUCCH encoder/decoder object - * @param[in] carrier Carrier configuration + * @param[in,out] q NR-PUCCH encoder/decoder object + * @param[in] carrier Serving cell and Uplink BWP configuration * @param[in] cfg PUCCH common configuration * @param[in] slot slot configuration - * @param[in] resource PUCCH format 1 resource + * @param[in] resource PUCCH format 2-4 resource * @param[in] chest_res Channel estimator result * @param[in] slot_symbols Resource grid of the given slot * @param[out] b Bits to decode @@ -203,4 +200,48 @@ SRSLTE_API int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* uint8_t b[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS], uint32_t nof_bits); +/** + * @brief Encoder NR-PUCCH formats 2, 3 and 4. The NR-PUCCH format is selected by resource->format. + * @param[in,out] q NR-PUCCH encoder/decoder object + * @param[in] carrier Serving cell and Uplink BWP configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 1 resource + * @param[in] uci_cfg Uplink Control Information configuration + * @param[in] uci_value Uplink Control Information data + * @param[out] slot_symbols Resource grid of the given slot + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format_2_3_4_encode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const srslte_uci_cfg_nr_t* uci_cfg, + const srslte_uci_value_nr_t* uci_value, + cf_t* slot_symbols); + +/** + * @brief Decode NR-PUCCH format 2, 3, and 4. The NR-PUCCH format is selected by resource->format. + * @param q[in,out] q NR-PUCCH encoder/decoder + * @param[in] carrier Serving cell and Uplink BWP configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 2-4 resource + * @param[in] uci_cfg Uplink Control Information configuration + * @param[in] chest_res Channel estimator result + * @param[in] slot_symbols Resource grid of the given slot + * @param[out] uci_value Uplink Control Information data + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_pucch_nr_format_2_3_4_decode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const srslte_uci_cfg_nr_t* uci_cfg, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols, + srslte_uci_value_nr_t* uci_value); + #endif // SRSLTE_PUCCH_NR_H diff --git a/lib/include/srslte/phy/phch/uci_nr.h b/lib/include/srslte/phy/phch/uci_nr.h index 8d31c3124..898eb8744 100644 --- a/lib/include/srslte/phy/phch/uci_nr.h +++ b/lib/include/srslte/phy/phch/uci_nr.h @@ -75,4 +75,22 @@ SRSLTE_API int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, const srslte_uci_value_nr_t* value, uint8_t* o); +/** + * @brief Decoder UCI bits + * + * @attention Compatible only with PUCCH formats 2, 3 and 4 + * + * @param[in,out] q NR-UCI object + * @param[in] pucch_resource_cfg + * @param[in] uci_cfg + * @param[in] llr + * @param[out] value + * @return SRSLTE_SUCCESSFUL if it is successful, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_uci_nr_decode_pucch(srslte_uci_nr_t* q, + const srslte_pucch_nr_resource_t* pucch_resource_cfg, + const srslte_uci_cfg_nr_t* uci_cfg, + const int8_t* llr, + srslte_uci_value_nr_t* value); + #endif // SRSLTE_UCI_NR_H diff --git a/lib/src/phy/phch/pucch_cfg_nr.c b/lib/src/phy/phch/pucch_cfg_nr.c index 174d11e48..bb58760a9 100644 --- a/lib/src/phy/phch/pucch_cfg_nr.c +++ b/lib/src/phy/phch/pucch_cfg_nr.c @@ -78,5 +78,34 @@ int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_t* res return SRSLTE_ERROR; } + return SRSLTE_SUCCESS; +} + +int srslte_pucch_nr_format2_resource_valid(const srslte_pucch_nr_resource_t* resource) +{ + if (resource == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (resource->format != SRSLTE_PUCCH_NR_FORMAT_2) { + ERROR("Invalid format (%d)\n", resource->format); + return SRSLTE_ERROR; + } + + if (resource->nof_symbols < 1 || resource->nof_symbols > 2) { + ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); + return SRSLTE_ERROR; + } + + if (resource->nof_prb < 1 || resource->nof_prb > 16) { + ERROR("Invalid number of prb (%d)\n", resource->nof_prb); + return SRSLTE_ERROR; + } + + if (resource->start_symbol_idx > 13) { + ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); + return SRSLTE_ERROR; + } + return SRSLTE_SUCCESS; } \ No newline at end of file diff --git a/lib/src/phy/phch/pucch_nr.c b/lib/src/phy/phch/pucch_nr.c index a77837d0e..2c0b8c189 100644 --- a/lib/src/phy/phch/pucch_nr.c +++ b/lib/src/phy/phch/pucch_nr.c @@ -14,11 +14,12 @@ #include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/common/sequence.h" #include "srslte/phy/common/zc_sequence.h" +#include "srslte/phy/mimo/precoding.h" +#include "srslte/phy/modem/demod_soft.h" #include "srslte/phy/modem/mod.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" #include -#include int srslte_pucch_nr_group_sequence(const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, @@ -500,6 +501,25 @@ int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, return SRSLTE_SUCCESS; } +static int pucch_nr_format2_encode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const srslte_uci_cfg_nr_t* uci_cfg, + cf_t* slot_symbols) +{ + // Validate configuration + if (srslte_pucch_nr_format2_resource_valid(resource) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Implement encode here + // ... + + return SRSLTE_SUCCESS; +} + int srslte_pucch_nr_format_2_3_4_encode(srslte_pucch_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, @@ -509,20 +529,22 @@ int srslte_pucch_nr_format_2_3_4_encode(srslte_pucch_nr_t* q, const srslte_uci_value_nr_t* uci_value, cf_t* slot_symbols) { + // Validate input pointers if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || uci_cfg == NULL || uci_value == NULL || slot_symbols == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; } + // Encode PUCCH message if (srslte_uci_nr_encode_pucch(&q->uci, resource, uci_cfg, uci_value, q->b) < SRSLTE_SUCCESS) { ERROR("Error encoding UCI\n"); return SRSLTE_ERROR; } - // Encode PUCCH + // Modulate PUCCH switch (resource->format) { case SRSLTE_PUCCH_NR_FORMAT_2: - break; + return pucch_nr_format2_encode(q, carrier, cfg, slot, resource, uci_cfg, slot_symbols); case SRSLTE_PUCCH_NR_FORMAT_3: case SRSLTE_PUCCH_NR_FORMAT_4: ERROR("Not implemented\n"); @@ -530,7 +552,65 @@ int srslte_pucch_nr_format_2_3_4_encode(srslte_pucch_nr_t* q, default: case SRSLTE_PUCCH_NR_FORMAT_ERROR: ERROR("Invalid format\n"); + } + + return SRSLTE_ERROR; +} + +static int pucch_nr_format2_decode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols, + int8_t* llr) +{ + // Validate configuration + if (srslte_pucch_nr_format2_resource_valid(resource) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Implement decode here + // ... + + return SRSLTE_SUCCESS; +} + +int srslte_pucch_nr_format_2_3_4_decode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const srslte_uci_cfg_nr_t* uci_cfg, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols, + srslte_uci_value_nr_t* uci_value) +{ + // Validate input pointers + if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || uci_cfg == NULL || + chest_res == NULL || uci_value == NULL || slot_symbols == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Demodulate PUCCH message + int8_t* llr = (int8_t*)q->b; + switch (resource->format) { + case SRSLTE_PUCCH_NR_FORMAT_2: + return pucch_nr_format2_decode(q, carrier, cfg, slot, resource, chest_res, slot_symbols, llr); + case SRSLTE_PUCCH_NR_FORMAT_3: + case SRSLTE_PUCCH_NR_FORMAT_4: + ERROR("Not implemented\n"); return SRSLTE_ERROR; + default: + case SRSLTE_PUCCH_NR_FORMAT_ERROR: + ERROR("Invalid format\n"); + } + + // Decode PUCCH message + if (srslte_uci_nr_decode_pucch(&q->uci, resource, uci_cfg, llr, uci_value) < SRSLTE_SUCCESS) { + ERROR("Error encoding UCI\n"); + return SRSLTE_ERROR; } return SRSLTE_SUCCESS; diff --git a/lib/src/phy/phch/uci_nr.c b/lib/src/phy/phch/uci_nr.c index 84b56d136..c8838cd78 100644 --- a/lib/src/phy/phch/uci_nr.c +++ b/lib/src/phy/phch/uci_nr.c @@ -682,7 +682,6 @@ int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, const srslte_uci_value_nr_t* value, uint8_t* o) { - int E_tot = uci_nr_pucch_E_tot(pucch_resource_cfg, uci_cfg); if (E_tot < SRSLTE_SUCCESS) { return SRSLTE_ERROR; @@ -702,7 +701,6 @@ int srslte_uci_nr_decode_pucch(srslte_uci_nr_t* q, const int8_t* llr, srslte_uci_value_nr_t* value) { - int E_tot = uci_nr_pucch_E_tot(pucch_resource_cfg, uci_cfg); if (E_tot < SRSLTE_SUCCESS) { return SRSLTE_ERROR; From 573ff24a472d643789c9d3dc88608eba1e0ed8ea Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 25 Jan 2021 18:01:39 +0100 Subject: [PATCH 134/138] Fix CRC for more sizes --- lib/include/srslte/phy/fec/crc.h | 15 +++++++++--- lib/src/phy/fec/crc.c | 38 ++++++++++++----------------- lib/src/phy/fec/test/CMakeLists.txt | 2 ++ lib/src/phy/fec/test/crc_test.c | 13 +++++++++- lib/src/phy/fec/test/crc_test.h | 2 ++ 5 files changed, 43 insertions(+), 27 deletions(-) diff --git a/lib/include/srslte/phy/fec/crc.h b/lib/include/srslte/phy/fec/crc.h index b10814289..d03e1a441 100644 --- a/lib/include/srslte/phy/fec/crc.h +++ b/lib/include/srslte/phy/fec/crc.h @@ -47,11 +47,20 @@ SRSLTE_API uint32_t srslte_crc_attach_byte(srslte_crc_t* h, uint8_t* data, int l static inline void srslte_crc_checksum_put_byte(srslte_crc_t* h, uint8_t byte) { - // Polynom order 8, 16, 24 or 32 only. - int ord = h->order - 8; uint64_t crc = h->crcinit; - crc = (crc << 8) ^ h->table[((crc >> (ord)) & 0xff) ^ byte]; + uint32_t idx; + if (h->order > 8) { + // For more than 8 bits + uint32_t ord = h->order - 8U; + idx = ((crc >> (ord)) & 0xffU) ^ byte; + } else { + // For 8 bits or less + uint32_t ord = 8U - h->order; + idx = ((crc << (ord)) & 0xffU) ^ byte; + } + + crc = (crc << 8U) ^ h->table[idx]; h->crcinit = crc; } diff --git a/lib/src/phy/fec/crc.c b/lib/src/phy/fec/crc.c index 9b1c2f685..9d108b4f0 100644 --- a/lib/src/phy/fec/crc.c +++ b/lib/src/phy/fec/crc.c @@ -10,29 +10,27 @@ * */ -#include -#include -#include - #include "srslte/phy/fec/crc.h" #include "srslte/phy/utils/bit.h" #include "srslte/phy/utils/debug.h" -void gen_crc_table(srslte_crc_t* h) +static void gen_crc_table(srslte_crc_t* h) { - - int i, j, ord = (h->order - 8); - uint64_t bit, crc; - - for (i = 0; i < 256; i++) { - crc = ((uint64_t)i) << ord; - for (j = 0; j < 8; j++) { - bit = crc & h->crchighbit; - crc <<= 1; - if (bit) - crc ^= h->polynom; + uint32_t pad = (h->order < 8) ? (8 - h->order) : 0; + uint32_t ord = h->order + pad - 8; + uint32_t polynom = h->polynom << pad; + uint32_t crchighbit = h->crchighbit << pad; + + for (uint32_t i = 0; i < 256; i++) { + uint64_t crc = ((uint64_t)i) << ord; + for (uint32_t j = 0; j < 8; j++) { + bool bit = crc & crchighbit; + crc <<= 1U; + if (bit) { + crc ^= polynom; + } } - h->table[i] = crc & h->crcmask; + h->table[i] = (crc >> pad) & h->crcmask; } } @@ -73,12 +71,6 @@ int srslte_crc_init(srslte_crc_t* h, uint32_t crc_poly, int crc_order) h->crcmask = ((((uint64_t)1 << (h->order - 1)) - 1) << 1) | 1; h->crchighbit = (uint64_t)1 << (h->order - 1); - // check parameters - if (h->order % 8 != 0) { - ERROR("ERROR(invalid order=%d, it must be 8, 16, 24 or 32.\n", h->order); - return -1; - } - if (srslte_crc_set_init(h, h->crcinit)) { ERROR("Error setting CRC init word\n"); return -1; diff --git a/lib/src/phy/fec/test/CMakeLists.txt b/lib/src/phy/fec/test/CMakeLists.txt index cf7176ea2..be61c4a5d 100644 --- a/lib/src/phy/fec/test/CMakeLists.txt +++ b/lib/src/phy/fec/test/CMakeLists.txt @@ -17,5 +17,7 @@ add_test(crc_24A crc_test -n 5001 -l 24 -p 0x1864CFB -s 1) add_test(crc_24B crc_test -n 5001 -l 24 -p 0x1800063 -s 1) add_test(crc_16 crc_test -n 5001 -l 16 -p 0x11021 -s 1) add_test(crc_8 crc_test -n 5001 -l 8 -p 0x19B -s 1) +add_test(crc_11 crc_test -n 30 -l 11 -p 0xE21 -s 1) +add_test(crc_6 crc_test -n 20 -l 6 -p 0x61 -s 1) diff --git a/lib/src/phy/fec/test/crc_test.c b/lib/src/phy/fec/test/crc_test.c index 0307b1388..17ef2e51f 100644 --- a/lib/src/phy/fec/test/crc_test.c +++ b/lib/src/phy/fec/test/crc_test.c @@ -32,12 +32,13 @@ void usage(char* prog) printf("\t-l crc_length [Default %d]\n", crc_length); printf("\t-p crc_poly (Hex) [Default 0x%x]\n", crc_poly); printf("\t-s seed [Default 0=time]\n"); + printf("\t-v [set srslte_verbose to debug, default none]\n"); } void parse_args(int argc, char** argv) { int opt; - while ((opt = getopt(argc, argv, "nlps")) != -1) { + while ((opt = getopt(argc, argv, "nlpsv")) != -1) { switch (opt) { case 'n': num_bits = (int)strtol(argv[optind], NULL, 10); @@ -51,6 +52,9 @@ void parse_args(int argc, char** argv) case 's': seed = (uint32_t)strtoul(argv[optind], NULL, 0); break; + case 'v': + srslte_verbose++; + break; default: usage(argv[0]); exit(-1); @@ -83,6 +87,11 @@ int main(int argc, char** argv) data[i] = rand() % 2; } + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + INFO("data="); + srslte_vec_fprint_b(stdout, data, num_bits); + } + // Initialize CRC params and tables if (srslte_crc_init(&crc_p, crc_poly, crc_length)) { exit(-1); @@ -91,6 +100,8 @@ int main(int argc, char** argv) // generate CRC word crc_word = srslte_crc_checksum(&crc_p, data, num_bits); + INFO("checksum=%x\n", crc_word); + free(data); // check if generated word is as expected diff --git a/lib/src/phy/fec/test/crc_test.h b/lib/src/phy/fec/test/crc_test.h index 2e68cb407..a417fa748 100644 --- a/lib/src/phy/fec/test/crc_test.h +++ b/lib/src/phy/fec/test/crc_test.h @@ -29,6 +29,8 @@ static expected_word_t expected_words[] = { {5001, 24, SRSLTE_LTE_CRC24B, 1, 0x36D1F0}, // LTE CRC24B {5001, 16, SRSLTE_LTE_CRC16, 1, 0x7FF4}, // LTE CRC16: 0x7FF4 {5001, 8, SRSLTE_LTE_CRC8, 1, 0xF0}, // LTE CRC8 0xF8 + {30, 11, SRSLTE_LTE_CRC11, 1, 0x114}, // NR CRC11 0x114 + {20, 6, SRSLTE_LTE_CRC6, 1, 0x1F}, // NR CRC6 0x1F {-1, -1, 0, 0, 0}}; From 4b6849b775394a5a30595b831214e20d7ca8c178 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 25 Jan 2021 18:02:30 +0100 Subject: [PATCH 135/138] Polar: Add more information to ERROR traces --- lib/include/srslte/phy/fec/polar/polar_code.h | 2 +- lib/src/phy/fec/polar/polar_code.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/include/srslte/phy/fec/polar/polar_code.h b/lib/include/srslte/phy/fec/polar/polar_code.h index 5500eb676..fe70685c1 100644 --- a/lib/include/srslte/phy/fec/polar/polar_code.h +++ b/lib/include/srslte/phy/fec/polar/polar_code.h @@ -381,7 +381,7 @@ static inline const uint16_t* get_blk_interleaver(uint8_t n) return blk_interleaver_10; break; default: - ERROR("Wrong code_size_log\n"); + ERROR("Wrong code_size_log (%d)\n", n); return NULL; } } diff --git a/lib/src/phy/fec/polar/polar_code.c b/lib/src/phy/fec/polar/polar_code.c index 9a95d690d..b4d39fb33 100644 --- a/lib/src/phy/fec/polar/polar_code.c +++ b/lib/src/phy/fec/polar/polar_code.c @@ -104,8 +104,9 @@ int get_code_params(srslte_polar_code_t* c, const uint16_t K, const uint16_t E, case 10: // iil = false if (K < 18 || (K > 25 && K < 31) || K > 1023) { - ERROR("Codeblock length (K) not supported for uplink transmission, choose K > 17 and K < 1024, " - "excluding 31 > K > 25\n"); + ERROR("Codeblock length (K=%d) not supported for uplink transmission, choose K > 17 and K < 1024, " + "excluding 31 > K > 25\n", + K); return -1; } break; From 958afaee600331097c0671500ac148787f2e6a81 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 25 Jan 2021 18:15:28 +0100 Subject: [PATCH 136/138] Implement NR-PUCCH Format 2 encode/decode. Initial NR-PUCCH procedures. --- .../srslte/phy/ch_estimation/dmrs_pucch.h | 12 ++ lib/include/srslte/phy/common/phy_common.h | 4 +- lib/include/srslte/phy/phch/pucch_cfg_nr.h | 81 ++++++--- lib/include/srslte/phy/phch/pucch_nr.h | 1 + lib/include/srslte/phy/phch/ra_ul_nr.h | 27 +++ lib/include/srslte/phy/phch/uci_cfg_nr.h | 2 + lib/include/srslte/phy/phch/uci_nr.h | 11 +- lib/src/phy/ch_estimation/dmrs_pucch.c | 102 ++++++++++- lib/src/phy/phch/pucch_cfg_nr.c | 142 ++++++++++++---- lib/src/phy/phch/pucch_nr.c | 131 +++++++++++---- lib/src/phy/phch/ra_ul_nr.c | 158 ++++++++++++++++++ lib/src/phy/phch/test/pucch_nr_test.c | 152 +++++++++++++++-- lib/src/phy/phch/uci_nr.c | 137 ++++++++++----- 13 files changed, 820 insertions(+), 140 deletions(-) create mode 100644 lib/include/srslte/phy/phch/ra_ul_nr.h create mode 100644 lib/src/phy/phch/ra_ul_nr.c diff --git a/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h b/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h index b6689069c..7bd6c7f52 100644 --- a/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h +++ b/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h @@ -17,6 +17,18 @@ #include "srslte/phy/ch_estimation/chest_ul.h" #include "srslte/phy/phch/pucch_nr.h" +#define SRSLTE_DMRS_PUCCH_FORMAT_3_4_MAX_NSYMB 4 + +/** + * @brief Computes the symbol indexes carrying DMRS for NR-PUCCH formats 3 and 4 + * @remark Implements TS 38.211 Table 6.4.1.3.3.2-1: DM-RS positions for PUCCH format 3 and 4. + * @param[in] resource Provides the format 3 or 4 resource + * @param[out] idx Destination data for storing the symbol indexes + * @return The number of DMRS symbols if the resource is valid, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_dmrs_pucch_format_3_4_get_symbol_idx(const srslte_pucch_nr_resource_t* resource, + uint32_t idx[SRSLTE_DMRS_PUCCH_FORMAT_3_4_MAX_NSYMB]); + /** * @brief Puts NR-PUCCH format 1 DMRS in the provided resource grid * @param[in] q NR-PUCCH encoder/decoder object diff --git a/lib/include/srslte/phy/common/phy_common.h b/lib/include/srslte/phy/common/phy_common.h index b7a8a6f3f..61ee36065 100644 --- a/lib/include/srslte/phy/common/phy_common.h +++ b/lib/include/srslte/phy/common/phy_common.h @@ -64,7 +64,7 @@ extern "C" { #define SRSLTE_LTE_CRC24B 0X1800063 #define SRSLTE_LTE_CRC24C 0X1B2B117 #define SRSLTE_LTE_CRC16 0x11021 -#define SRSLTE_LTE_CRC11 0x621 +#define SRSLTE_LTE_CRC11 0xE21 #define SRSLTE_LTE_CRC8 0x19B #define SRSLTE_LTE_CRC6 0x61 @@ -274,7 +274,7 @@ typedef enum SRSLTE_API { SRSLTE_MIMO_DECODER_ZF, SRSLTE_MIMO_DECODER_MMSE } srs * \brief Types of modulations and associated modulation order. */ typedef enum SRSLTE_API { - SRSLTE_MOD_BPSK = 0, /*!< \brief pi/2-BPSK. */ + SRSLTE_MOD_BPSK = 0, /*!< \brief BPSK. */ SRSLTE_MOD_QPSK, /*!< \brief QPSK. */ SRSLTE_MOD_16QAM, /*!< \brief QAM16. */ SRSLTE_MOD_64QAM, /*!< \brief QAM64. */ diff --git a/lib/include/srslte/phy/phch/pucch_cfg_nr.h b/lib/include/srslte/phy/phch/pucch_cfg_nr.h index 71b21055b..d7ff1ff85 100644 --- a/lib/include/srslte/phy/phch/pucch_cfg_nr.h +++ b/lib/include/srslte/phy/phch/pucch_cfg_nr.h @@ -17,6 +17,54 @@ #include #include +/** + * NR-PUCCH Format 0 ranges + */ +#define SRSLTE_PUCCH_NR_FORMAT0_MAX_CS 11 +#define SRSLTE_PUCCH_NR_FORMAT0_MIN_NSYMB 1 +#define SRSLTE_PUCCH_NR_FORMAT0_MAX_NSYMB 2 +#define SRSLTE_PUCCH_NR_FORMAT0_MAX_STARTSYMB 13 + +/** + * NR-PUCCH Format 1 ranges + */ +#define SRSLTE_PUCCH_NR_FORMAT1_MAX_CS 11 +#define SRSLTE_PUCCH_NR_FORMAT1_MAX_TOCC 6 +#define SRSLTE_PUCCH_NR_FORMAT1_MIN_NSYMB 4 +#define SRSLTE_PUCCH_NR_FORMAT1_MAX_NSYMB 14 +#define SRSLTE_PUCCH_NR_FORMAT1_MAX_STARTSYMB 10 + +/** + * NR-PUCCH Format 2 ranges + */ +#define SRSLTE_PUCCH_NR_FORMAT2_MIN_NPRB 1 +#define SRSLTE_PUCCH_NR_FORMAT2_MAX_NPRB 16 +#define SRSLTE_PUCCH_NR_FORMAT2_MIN_NSYMB 1 +#define SRSLTE_PUCCH_NR_FORMAT2_MAX_NSYMB 2 +#define SRSLTE_PUCCH_NR_FORMAT2_MAX_STARTSYMB 13 + +/** + * NR-PUCCH Format 3 ranges + */ +#define SRSLTE_PUCCH_NR_FORMAT3_MIN_NPRB 1 +#define SRSLTE_PUCCH_NR_FORMAT3_MAX_NPRB 16 +#define SRSLTE_PUCCH_NR_FORMAT3_MIN_NSYMB 4 +#define SRSLTE_PUCCH_NR_FORMAT3_MAX_NSYMB 14 +#define SRSLTE_PUCCH_NR_FORMAT3_MAX_STARTSYMB 10 + +/** + * NR-PUCCH Format 4 ranges + */ +#define SRSLTE_PUCCH_NR_FORMAT4_NPRB 1 +#define SRSLTE_PUCCH_NR_FORMAT4_MIN_NSYMB 4 +#define SRSLTE_PUCCH_NR_FORMAT4_MAX_NSYMB 14 +#define SRSLTE_PUCCH_NR_FORMAT4_MAX_STARTSYMB 10 + +/** + * NR-PUCCH Formats 2, 3 and 4 code rate range + */ +#define SRSLTE_PUCCH_NR_MAX_CODE_RATE 7 + typedef enum SRSLTE_API { SRSLTE_PUCCH_NR_FORMAT_0 = 0, SRSLTE_PUCCH_NR_FORMAT_1, @@ -42,6 +90,10 @@ typedef struct SRSLTE_API { uint32_t hopping_id; ///< Cell-specific scrambling ID for group hopping and sequence hopping if enabled bool hopping_id_present; float p0_nominal; ///< Power control parameter P0 for PUCCH transmissions. Value in dBm. (-202..24) + + // From PUSCH-config + bool scrambling_id_present; + uint32_t scambling_id; // Identifier used to initialize data scrambling (dataScramblingIdentityPUSCH, 0-1023) } srslte_pucch_nr_common_cfg_t; /** @@ -49,7 +101,7 @@ typedef struct SRSLTE_API { * @remark Defined in TS 38.331 PUCCH-Config */ typedef struct SRSLTE_API { - // + // Common PUCCH-Resource parameter uint32_t starting_prb; bool intra_slot_hopping; uint32_t second_hop_prb; @@ -58,36 +110,25 @@ typedef struct SRSLTE_API { srslte_pucch_nr_format_t format; ///< PUCCH format this configuration belongs uint32_t nof_symbols; ///< Number of symbols uint32_t start_symbol_idx; ///< Starting symbol index - double max_code_rate; ///< Maximum code rate (0.08, 0.15, 0.25, 0.35, 0.45, 0.60, 0.80) - bool enable_pi_bpsk; ///< Enables PI-BPSK // Specific PUCCH-Resource uint32_t initial_cyclic_shift; ///< Used by formats 0, 1 uint32_t time_domain_occ; ///< Used by format 1 uint32_t nof_prb; ///< Used by formats 2, 3 - uint32_t occ_lenth; ///< Spreading factor, used by format 4 + uint32_t occ_lenth; ///< Spreading factor, used by format 4 (2, 4). Also called N_PUCCH4_SF uint32_t occ_index; ///< Used by format 4 -} srslte_pucch_nr_resource_t; -/** - * @brief Validates a PUCCH format 0 resource configuration provided by upper layers - * @param resource Resource configuration to validate - * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise - */ -SRSLTE_API int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_t* resource); - -/** - * @brief Validates a PUCCH format 1 resource configuration provided by upper layers - * @param resource Resource configuration to validate - * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise - */ -SRSLTE_API int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_t* resource); + // PUCCH Format common parameters + bool enable_pi_bpsk; ///< Enables PI-BPSK + uint32_t max_code_rate; ///< Maximum code rate r (0..7) + bool additional_dmrs; ///< UE enables 2 DMRS symbols per hop of a PUCCH Format 3 or 4 +} srslte_pucch_nr_resource_t; /** - * @brief Validates a PUCCH format 2 resource configuration provided by upper layers + * @brief Validates an NR-PUCCH resource configuration provided by upper layers * @param resource Resource configuration to validate * @return SRSLTE_SUCCESS if valid, SRSLTE_ERROR code otherwise */ -SRSLTE_API int srslte_pucch_nr_format2_resource_valid(const srslte_pucch_nr_resource_t* resource); +SRSLTE_API int srslte_pucch_nr_cfg_resource_valid(const srslte_pucch_nr_resource_t* resource); #endif // SRSLTE_PUCCH_CFG_NR_H diff --git a/lib/include/srslte/phy/phch/pucch_nr.h b/lib/include/srslte/phy/phch/pucch_nr.h index 94d165488..996867b70 100644 --- a/lib/include/srslte/phy/phch/pucch_nr.h +++ b/lib/include/srslte/phy/phch/pucch_nr.h @@ -53,6 +53,7 @@ typedef struct SRSLTE_API { srslte_modem_table_t qpsk; srslte_uci_nr_t uci; uint8_t* b; + cf_t* d; } srslte_pucch_nr_t; /** diff --git a/lib/include/srslte/phy/phch/ra_ul_nr.h b/lib/include/srslte/phy/phch/ra_ul_nr.h new file mode 100644 index 000000000..510480d9c --- /dev/null +++ b/lib/include/srslte/phy/phch/ra_ul_nr.h @@ -0,0 +1,27 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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 SRSLTE_RA_UL_NR_H +#define SRSLTE_RA_UL_NR_H + +#include "srslte/config.h" +#include "srslte/phy/phch/pucch_cfg_nr.h" +#include "uci_cfg_nr.h" + +/** + * @brief + * @return + */ +SRSLTE_API int srslte_ra_ul_nr_pucch_format_2_3_min_prb(const srslte_pucch_nr_resource_t* resource, + const srslte_uci_cfg_nr_t* uci_cfg); + +#endif // SRSLTE_RA_UL_NR_H diff --git a/lib/include/srslte/phy/phch/uci_cfg_nr.h b/lib/include/srslte/phy/phch/uci_cfg_nr.h index a357e7984..dc24ec7ba 100644 --- a/lib/include/srslte/phy/phch/uci_cfg_nr.h +++ b/lib/include/srslte/phy/phch/uci_cfg_nr.h @@ -13,6 +13,7 @@ #ifndef SRSLTE_UCI_CFG_NR_H #define SRSLTE_UCI_CFG_NR_H +#include "srslte/phy/common/phy_common.h" #include #include @@ -27,6 +28,7 @@ typedef struct SRSLTE_API { uint32_t o_csi1; ///< Number of CSI1 report number of bits uint32_t o_csi2; ///< Number of CSI2 report number of bits srslte_mod_t modulation; ///< Modulation + uint16_t rnti; ///< RNTI } srslte_uci_cfg_nr_t; typedef struct SRSLTE_API { diff --git a/lib/include/srslte/phy/phch/uci_nr.h b/lib/include/srslte/phy/phch/uci_nr.h index 898eb8744..fe1000646 100644 --- a/lib/include/srslte/phy/phch/uci_nr.h +++ b/lib/include/srslte/phy/phch/uci_nr.h @@ -29,7 +29,8 @@ typedef struct { } srslte_uci_nr_args_t; typedef struct { - srslte_polar_rm_t rm; + srslte_polar_rm_t rm_tx; + srslte_polar_rm_t rm_rx; srslte_polar_encoder_t encoder; srslte_polar_decoder_t decoder; srslte_crc_t crc6; @@ -41,6 +42,12 @@ typedef struct { uint8_t* d; ///< Polar code encoded intermediate } srslte_uci_nr_t; +/** + * @brief Calculates in advance how many CRC bits will be appended for a given amount of UCI bits (A) + * @param A Number of UCI bits to transmit + */ +SRSLTE_API uint32_t srslte_uci_nr_crc_len(uint32_t A); + /** * @brief Initialises NR-UCI encoder/decoder object * @param[in,out] q NR-UCI object @@ -90,7 +97,7 @@ SRSLTE_API int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, SRSLTE_API int srslte_uci_nr_decode_pucch(srslte_uci_nr_t* q, const srslte_pucch_nr_resource_t* pucch_resource_cfg, const srslte_uci_cfg_nr_t* uci_cfg, - const int8_t* llr, + int8_t* llr, srslte_uci_value_nr_t* value); #endif // SRSLTE_UCI_NR_H diff --git a/lib/src/phy/ch_estimation/dmrs_pucch.c b/lib/src/phy/ch_estimation/dmrs_pucch.c index d0661faa4..4e38701c3 100644 --- a/lib/src/phy/ch_estimation/dmrs_pucch.c +++ b/lib/src/phy/ch_estimation/dmrs_pucch.c @@ -96,7 +96,7 @@ int srslte_dmrs_pucch_format1_put(const srslte_pucch_nr_t* q, return SRSLTE_ERROR_INVALID_INPUTS; } - if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { ERROR("Invalid PUCCH format 1 resource\n"); return SRSLTE_ERROR; } @@ -164,7 +164,7 @@ int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, return SRSLTE_ERROR_INVALID_INPUTS; } - if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { ERROR("Invalid PUCCH format 1 resource\n"); return SRSLTE_ERROR; } @@ -279,3 +279,101 @@ int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, return SRSLTE_SUCCESS; } + +int srslte_dmrs_pucch_format_3_4_get_symbol_idx(const srslte_pucch_nr_resource_t* resource, + uint32_t idx[SRSLTE_DMRS_PUCCH_FORMAT_3_4_MAX_NSYMB]) +{ + if (resource == NULL || idx == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + int count = 0; + + switch (resource->nof_symbols) { + case 4: + if (resource->intra_slot_hopping) { + idx[count++] = 0; + idx[count++] = 2; + } else { + idx[count++] = 1; + } + break; + case 5: + idx[count++] = 0; + idx[count++] = 3; + break; + case 6: + case 7: + idx[count++] = 1; + idx[count++] = 4; + break; + case 8: + idx[count++] = 1; + idx[count++] = 5; + break; + case 9: + idx[count++] = 1; + idx[count++] = 6; + break; + case 10: + if (resource->additional_dmrs) { + idx[count++] = 1; + idx[count++] = 3; + idx[count++] = 6; + idx[count++] = 8; + } else { + idx[count++] = 2; + idx[count++] = 7; + } + break; + case 11: + if (resource->additional_dmrs) { + idx[count++] = 1; + idx[count++] = 3; + idx[count++] = 6; + idx[count++] = 9; + } else { + idx[count++] = 2; + idx[count++] = 7; + } + break; + case 12: + if (resource->additional_dmrs) { + idx[count++] = 1; + idx[count++] = 4; + idx[count++] = 7; + idx[count++] = 10; + } else { + idx[count++] = 2; + idx[count++] = 8; + } + break; + case 13: + if (resource->additional_dmrs) { + idx[count++] = 1; + idx[count++] = 4; + idx[count++] = 7; + idx[count++] = 11; + } else { + idx[count++] = 2; + idx[count++] = 9; + } + break; + case 14: + if (resource->additional_dmrs) { + idx[count++] = 1; + idx[count++] = 5; + idx[count++] = 8; + idx[count++] = 12; + } else { + idx[count++] = 3; + idx[count++] = 10; + } + break; + default: + ERROR("Invalid case (%d)\n", resource->nof_symbols); + return SRSLTE_ERROR; + } + + return count; +} diff --git a/lib/src/phy/phch/pucch_cfg_nr.c b/lib/src/phy/phch/pucch_cfg_nr.c index bb58760a9..c52e5d775 100644 --- a/lib/src/phy/phch/pucch_cfg_nr.c +++ b/lib/src/phy/phch/pucch_cfg_nr.c @@ -11,30 +11,28 @@ */ #include "srslte/phy/phch/pucch_cfg_nr.h" +#include "srslte/phy/common/phy_common_nr.h" #include "srslte/phy/utils/debug.h" -int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_t* resource) +static int pucch_nr_cfg_format0_resource_valid(const srslte_pucch_nr_resource_t* resource) { - if (resource == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - if (resource->format != SRSLTE_PUCCH_NR_FORMAT_0) { ERROR("Invalid format (%d)\n", resource->format); return SRSLTE_ERROR; } - if (resource->nof_symbols != 1 && resource->nof_symbols != 2) { + if (resource->nof_symbols < SRSLTE_PUCCH_NR_FORMAT0_MIN_NSYMB || + resource->nof_symbols > SRSLTE_PUCCH_NR_FORMAT0_MAX_NSYMB) { ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); return SRSLTE_ERROR; } - if (resource->initial_cyclic_shift > 11) { + if (resource->initial_cyclic_shift > SRSLTE_PUCCH_NR_FORMAT0_MAX_CS) { ERROR("Invalid initial cyclic shift (%d)\n", resource->initial_cyclic_shift); return SRSLTE_ERROR; } - if (resource->start_symbol_idx > 13) { + if (resource->start_symbol_idx > SRSLTE_PUCCH_NR_FORMAT0_MAX_STARTSYMB) { ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); return SRSLTE_ERROR; } @@ -42,70 +40,156 @@ int srslte_pucch_nr_format0_resource_valid(const srslte_pucch_nr_resource_t* res return SRSLTE_SUCCESS; } -int srslte_pucch_nr_format1_resource_valid(const srslte_pucch_nr_resource_t* resource) +static int pucch_nr_cfg_format1_resource_valid(const srslte_pucch_nr_resource_t* resource) { - if (resource == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - if (resource->format != SRSLTE_PUCCH_NR_FORMAT_1) { ERROR("Invalid format (%d)\n", resource->format); return SRSLTE_ERROR; } - if (resource->nof_symbols < 4 || resource->nof_symbols > 14) { + if (resource->nof_symbols < SRSLTE_PUCCH_NR_FORMAT1_MIN_NSYMB || + resource->nof_symbols > SRSLTE_PUCCH_NR_FORMAT1_MAX_NSYMB) { ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); return SRSLTE_ERROR; } - if (resource->initial_cyclic_shift > 11) { + if (resource->initial_cyclic_shift > SRSLTE_PUCCH_NR_FORMAT1_MAX_CS) { ERROR("Invalid initial cyclic shift (%d)\n", resource->initial_cyclic_shift); return SRSLTE_ERROR; } - if (resource->start_symbol_idx > 10) { + if (resource->start_symbol_idx > SRSLTE_PUCCH_NR_FORMAT1_MAX_STARTSYMB) { ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); return SRSLTE_ERROR; } - if (resource->time_domain_occ > 6) { + if (resource->time_domain_occ > SRSLTE_PUCCH_NR_FORMAT1_MAX_TOCC) { ERROR("Invalid time domain occ (%d)\n", resource->time_domain_occ); return SRSLTE_ERROR; } - if (resource->intra_slot_hopping) { - ERROR("Intra-slot hopping is not implemented\n"); + return SRSLTE_SUCCESS; +} + +static int pucch_nr_cfg_format2_resource_valid(const srslte_pucch_nr_resource_t* resource) +{ + if (resource->format != SRSLTE_PUCCH_NR_FORMAT_2) { + ERROR("Invalid format (%d)\n", resource->format); + return SRSLTE_ERROR; + } + + if (resource->nof_symbols < SRSLTE_PUCCH_NR_FORMAT2_MIN_NSYMB || + resource->nof_symbols > SRSLTE_PUCCH_NR_FORMAT2_MAX_NSYMB) { + ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); + return SRSLTE_ERROR; + } + + if (resource->nof_prb < SRSLTE_PUCCH_NR_FORMAT2_MIN_NPRB || resource->nof_prb > SRSLTE_PUCCH_NR_FORMAT2_MAX_NPRB) { + ERROR("Invalid number of prb (%d)\n", resource->nof_prb); + return SRSLTE_ERROR; + } + + if (resource->start_symbol_idx > SRSLTE_PUCCH_NR_FORMAT2_MAX_STARTSYMB) { + ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); return SRSLTE_ERROR; } return SRSLTE_SUCCESS; } -int srslte_pucch_nr_format2_resource_valid(const srslte_pucch_nr_resource_t* resource) +static int pucch_nr_cfg_format3_resource_valid(const srslte_pucch_nr_resource_t* resource) { - if (resource == NULL) { - return SRSLTE_ERROR_INVALID_INPUTS; - } - - if (resource->format != SRSLTE_PUCCH_NR_FORMAT_2) { + if (resource->format != SRSLTE_PUCCH_NR_FORMAT_3) { ERROR("Invalid format (%d)\n", resource->format); return SRSLTE_ERROR; } - if (resource->nof_symbols < 1 || resource->nof_symbols > 2) { + if (resource->nof_symbols < SRSLTE_PUCCH_NR_FORMAT3_MIN_NSYMB || + resource->nof_symbols > SRSLTE_PUCCH_NR_FORMAT3_MAX_NSYMB) { ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); return SRSLTE_ERROR; } - if (resource->nof_prb < 1 || resource->nof_prb > 16) { + if (resource->nof_prb < SRSLTE_PUCCH_NR_FORMAT3_MIN_NPRB || resource->nof_prb > SRSLTE_PUCCH_NR_FORMAT3_MAX_NPRB) { ERROR("Invalid number of prb (%d)\n", resource->nof_prb); return SRSLTE_ERROR; } - if (resource->start_symbol_idx > 13) { + if (resource->start_symbol_idx > SRSLTE_PUCCH_NR_FORMAT3_MAX_STARTSYMB) { + ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); + return SRSLTE_ERROR; + } + + return SRSLTE_SUCCESS; +} + +static int pucch_nr_cfg_format4_resource_valid(const srslte_pucch_nr_resource_t* resource) +{ + if (resource->format != SRSLTE_PUCCH_NR_FORMAT_4) { + ERROR("Invalid format (%d)\n", resource->format); + return SRSLTE_ERROR; + } + + if (resource->nof_symbols < SRSLTE_PUCCH_NR_FORMAT4_MIN_NSYMB || + resource->nof_symbols > SRSLTE_PUCCH_NR_FORMAT4_MAX_NSYMB) { + ERROR("Invalid number of symbols (%d)\n", resource->nof_symbols); + return SRSLTE_ERROR; + } + + if (resource->start_symbol_idx > SRSLTE_PUCCH_NR_FORMAT4_MAX_STARTSYMB) { ERROR("Invalid initial start symbol idx (%d)\n", resource->start_symbol_idx); return SRSLTE_ERROR; } + if (resource->occ_lenth != 2 && resource->occ_lenth != 4) { + ERROR("Invalid OCC length (%d)\n", resource->occ_lenth); + return SRSLTE_ERROR; + } + return SRSLTE_SUCCESS; -} \ No newline at end of file +} + +int srslte_pucch_nr_cfg_resource_valid(const srslte_pucch_nr_resource_t* resource) +{ + // Check pointer + if (resource == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (resource->starting_prb > SRSLTE_MAX_NRE_NR - 1) { + return SRSLTE_ERROR; + } + + if (resource->intra_slot_hopping) { + ERROR("Intra-slot hopping is not implemented\n"); + return SRSLTE_ERROR; + } + + if (resource->second_hop_prb > SRSLTE_MAX_NRE_NR - 1) { + return SRSLTE_ERROR; + } + + if (resource->max_code_rate > SRSLTE_PUCCH_NR_MAX_CODE_RATE) { + ERROR("Invalid maximum code rate (%d)\n", resource->max_code_rate); + return SRSLTE_ERROR; + } + + switch (resource->format) { + case SRSLTE_PUCCH_NR_FORMAT_0: + return pucch_nr_cfg_format0_resource_valid(resource); + case SRSLTE_PUCCH_NR_FORMAT_1: + return pucch_nr_cfg_format1_resource_valid(resource); + case SRSLTE_PUCCH_NR_FORMAT_2: + return pucch_nr_cfg_format2_resource_valid(resource); + case SRSLTE_PUCCH_NR_FORMAT_3: + return pucch_nr_cfg_format3_resource_valid(resource); + case SRSLTE_PUCCH_NR_FORMAT_4: + return pucch_nr_cfg_format4_resource_valid(resource); + case SRSLTE_PUCCH_NR_FORMAT_ERROR: + default: + ERROR("Invalid case\n"); + break; + } + + return SRSLTE_ERROR; +} diff --git a/lib/src/phy/phch/pucch_nr.c b/lib/src/phy/phch/pucch_nr.c index 2c0b8c189..1ea11638a 100644 --- a/lib/src/phy/phch/pucch_nr.c +++ b/lib/src/phy/phch/pucch_nr.c @@ -158,6 +158,13 @@ int srslte_pucch_nr_init(srslte_pucch_nr_t* q, const srslte_pucch_nr_args_t* arg return SRSLTE_ERROR; } + // Allocate encoded symbols d + q->d = srslte_vec_cf_malloc(max_encoded_bits / 2); + if (q->d == NULL) { + ERROR("Malloc\n"); + return SRSLTE_ERROR; + } + return SRSLTE_SUCCESS; } @@ -167,6 +174,7 @@ void srslte_pucch_nr_free(srslte_pucch_nr_t* q) return; } + srslte_uci_nr_free(&q->uci); srslte_zc_sequence_lut_free(&q->r_uv_1prb); srslte_modem_table_free(&q->bpsk); @@ -175,6 +183,9 @@ void srslte_pucch_nr_free(srslte_pucch_nr_t* q) if (q->b != NULL) { free(q->b); } + if (q->d != NULL) { + free(q->d); + } SRSLTE_MEM_ZERO(q, srslte_pucch_nr_t, 1); } @@ -191,7 +202,7 @@ int srslte_pucch_nr_format0_encode(const srslte_pucch_nr_t* q, return SRSLTE_ERROR_INVALID_INPUTS; } - if (srslte_pucch_nr_format0_resource_valid(resource) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { ERROR("Invalid PUCCH format 0 resource\n"); return SRSLTE_SUCCESS; } @@ -242,7 +253,7 @@ int srslte_pucch_nr_format0_measure(const srslte_pucch_nr_t* q, return SRSLTE_ERROR_INVALID_INPUTS; } - if (srslte_pucch_nr_format0_resource_valid(resource) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { ERROR("Invalid PUCCH format 0 resource\n"); return SRSLTE_SUCCESS; } @@ -353,7 +364,7 @@ int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, return SRSLTE_ERROR_INVALID_INPUTS; } - if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { ERROR("Invalid PUCCH format 1 resource\n"); return SRSLTE_SUCCESS; } @@ -431,7 +442,7 @@ int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, { uint32_t m_cs = 0; - if (srslte_pucch_nr_format1_resource_valid(resource) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { ERROR("Invalid PUCCH format 1 resource\n"); return SRSLTE_SUCCESS; } @@ -501,21 +512,97 @@ int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, return SRSLTE_SUCCESS; } +static uint32_t pucch_nr_format2_cinit(const srslte_pucch_nr_common_cfg_t* pucch_cfg, + const srslte_uci_cfg_nr_t* uci_cfg) +{ + uint32_t n_id = (pucch_cfg->scrambling_id_present) ? pucch_cfg->scrambling_id_present : uci_cfg->rnti; + return ((uint32_t)uci_cfg->rnti << 15U) + n_id; +} + +// Implements TS 38.211 section 6.3.2.5 PUCCH format 2 static int pucch_nr_format2_encode(srslte_pucch_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, const srslte_pucch_nr_resource_t* resource, const srslte_uci_cfg_nr_t* uci_cfg, cf_t* slot_symbols) { // Validate configuration - if (srslte_pucch_nr_format2_resource_valid(resource) < SRSLTE_SUCCESS) { + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + // Calculate number of encoded symbols + uint32_t E = 16 * resource->nof_symbols * resource->nof_prb; + + // 6.3.2.5.1 Scrambling + uint32_t cinit = pucch_nr_format2_cinit(cfg, uci_cfg); + srslte_sequence_apply_bit(q->b, q->b, E, cinit); + + // 6.3.2.5.2 Modulation + srslte_mod_modulate(&q->qpsk, q->b, q->d, E); + + // 6.3.2.5.3 Mapping to physical resources + uint32_t l_start = resource->start_symbol_idx; + uint32_t l_end = resource->start_symbol_idx + resource->nof_symbols; + uint32_t k_start = SRSLTE_MIN(carrier->nof_prb - 1, resource->starting_prb) * SRSLTE_NRE; + uint32_t k_end = SRSLTE_MIN(carrier->nof_prb, resource->starting_prb + resource->nof_prb) * SRSLTE_NRE; + for (uint32_t l = l_start, i = 0; l < l_end; l++) { + cf_t* symbol_ptr = &slot_symbols[l * carrier->nof_prb * SRSLTE_NRE]; + for (uint32_t k = k_start; k < k_end; k += 3) { + symbol_ptr[k] = q->d[i++]; + symbol_ptr[k + 2] = q->d[i++]; + } + } + + return SRSLTE_SUCCESS; +} + +static int pucch_nr_format2_decode(srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_pucch_nr_resource_t* resource, + const srslte_uci_cfg_nr_t* uci_cfg, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols, + int8_t* llr) +{ + // Validate configuration + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } - // Implement encode here - // ... + // Calculate number of encoded symbols + uint32_t E = 16 * resource->nof_symbols * resource->nof_prb; + + // Undo mapping to physical resources + uint32_t l_start = resource->start_symbol_idx; + uint32_t l_end = resource->start_symbol_idx + resource->nof_symbols; + uint32_t k_start = resource->starting_prb * SRSLTE_NRE; + uint32_t k_end = (resource->starting_prb + resource->nof_prb) * SRSLTE_NRE; + for (uint32_t l = l_start, i = 0; l < l_end; l++) { + cf_t* symbol_ptr = &slot_symbols[l * carrier->nof_prb * SRSLTE_NRE]; + for (uint32_t k = k_start; k < k_end; k += 3) { + q->d[i++] = symbol_ptr[k]; + q->d[i++] = symbol_ptr[k + 2]; + } + } + + // Equalise + if (srslte_predecoding_single(q->d, chest_res->ce, q->d, NULL, E, 1.0f, chest_res->noise_estimate) < SRSLTE_SUCCESS) { + ERROR("Error Pre-decoding\n"); + return SRSLTE_ERROR; + } + + // Soft-demodulate + if (srslte_demod_soft_demodulate_b(SRSLTE_MOD_QPSK, q->d, llr, E) < SRSLTE_SUCCESS) { + ERROR("Error soft-demodulate\n"); + return SRSLTE_ERROR; + } + + // Undo Scrambling + uint32_t cinit = pucch_nr_format2_cinit(cfg, uci_cfg); + srslte_sequence_apply_c(llr, llr, E, cinit); return SRSLTE_SUCCESS; } @@ -544,7 +631,7 @@ int srslte_pucch_nr_format_2_3_4_encode(srslte_pucch_nr_t* q, // Modulate PUCCH switch (resource->format) { case SRSLTE_PUCCH_NR_FORMAT_2: - return pucch_nr_format2_encode(q, carrier, cfg, slot, resource, uci_cfg, slot_symbols); + return pucch_nr_format2_encode(q, carrier, cfg, resource, uci_cfg, slot_symbols); case SRSLTE_PUCCH_NR_FORMAT_3: case SRSLTE_PUCCH_NR_FORMAT_4: ERROR("Not implemented\n"); @@ -557,26 +644,6 @@ int srslte_pucch_nr_format_2_3_4_encode(srslte_pucch_nr_t* q, return SRSLTE_ERROR; } -static int pucch_nr_format2_decode(srslte_pucch_nr_t* q, - const srslte_carrier_nr_t* carrier, - const srslte_pucch_nr_common_cfg_t* cfg, - const srslte_dl_slot_cfg_t* slot, - const srslte_pucch_nr_resource_t* resource, - srslte_chest_ul_res_t* chest_res, - cf_t* slot_symbols, - int8_t* llr) -{ - // Validate configuration - if (srslte_pucch_nr_format2_resource_valid(resource) < SRSLTE_SUCCESS) { - return SRSLTE_ERROR; - } - - // Implement decode here - // ... - - return SRSLTE_SUCCESS; -} - int srslte_pucch_nr_format_2_3_4_decode(srslte_pucch_nr_t* q, const srslte_carrier_nr_t* carrier, const srslte_pucch_nr_common_cfg_t* cfg, @@ -597,7 +664,11 @@ int srslte_pucch_nr_format_2_3_4_decode(srslte_pucch_nr_t* q, int8_t* llr = (int8_t*)q->b; switch (resource->format) { case SRSLTE_PUCCH_NR_FORMAT_2: - return pucch_nr_format2_decode(q, carrier, cfg, slot, resource, chest_res, slot_symbols, llr); + if (pucch_nr_format2_decode(q, carrier, cfg, resource, uci_cfg, chest_res, slot_symbols, llr) < SRSLTE_SUCCESS) { + ERROR("Demodulating PUCCH format 2\n"); + return SRSLTE_ERROR; + } + break; case SRSLTE_PUCCH_NR_FORMAT_3: case SRSLTE_PUCCH_NR_FORMAT_4: ERROR("Not implemented\n"); diff --git a/lib/src/phy/phch/ra_ul_nr.c b/lib/src/phy/phch/ra_ul_nr.c new file mode 100644 index 000000000..17dbe2fe4 --- /dev/null +++ b/lib/src/phy/phch/ra_ul_nr.c @@ -0,0 +1,158 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 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. + * + */ + +#include "srslte/phy/phch/ra_ul_nr.h" +#include "srslte/phy/ch_estimation/dmrs_pucch.h" +#include "srslte/phy/common/phy_common.h" +#include "srslte/phy/utils/debug.h" + +#define RA_UL_PUCCH_CODE_RATE_N 8 +#define RA_UL_PUCCH_CODE_RATE_RESERVED NAN + +static const double ra_ul_pucch_code_rate_table[RA_UL_PUCCH_CODE_RATE_N] = + {0.08, 0.15, 0.25, 0.35, 0.45, 0.60, 0.80, RA_UL_PUCCH_CODE_RATE_RESERVED}; + +// Implements TS 38.213 Table 9.2.5.2-1: Code rate r corresponding to value of maxCodeRate +static double ra_ul_nr_pucch_code_rate_r(const srslte_pucch_nr_resource_t* resource) +{ + if (resource->max_code_rate >= RA_UL_PUCCH_CODE_RATE_RESERVED) { + ERROR("Invalid code rate\n"); + return RA_UL_PUCCH_CODE_RATE_RESERVED; + } + + return ra_ul_pucch_code_rate_table[resource->max_code_rate]; +} + +// Calculate number of PRBs for PUCCH format 2, or PUCCH format 3, or PUCCH format 4, respectively +// static int ra_ul_nr_pucch_Mrb(const srslte_pucch_nr_resource_t* resource) +//{ +// switch (resource->format) { +// case SRSLTE_PUCCH_NR_FORMAT_2: +// case SRSLTE_PUCCH_NR_FORMAT_3: +// return resource->nof_prb; +// case SRSLTE_PUCCH_NR_FORMAT_4: +// return SRSLTE_PUCCH_NR_FORMAT4_NPRB; +// default: +// ERROR("Invalid case\n"); +// break; +// } +// return SRSLTE_ERROR; +//} + +// Calculate number of subcarriers per resource block for payload (No DMRS) +static int ra_ul_nr_pucch_nre(const srslte_pucch_nr_resource_t* resource) +{ + switch (resource->format) { + case SRSLTE_PUCCH_NR_FORMAT_2: + return SRSLTE_NRE - 4; + case SRSLTE_PUCCH_NR_FORMAT_3: + return SRSLTE_NRE; + case SRSLTE_PUCCH_NR_FORMAT_4: + return SRSLTE_NRE / resource->occ_lenth; + default: + ERROR("Invalid case\n"); + break; + } + return SRSLTE_ERROR; +} + +// Calculate number of PUCCH symbols excluding the ones used exclusively for DMRS for formats 3 and 4 +static int ra_ul_nr_pucch_nsymb(const srslte_pucch_nr_resource_t* resource) +{ + switch (resource->format) { + case SRSLTE_PUCCH_NR_FORMAT_2: + return resource->nof_symbols; + case SRSLTE_PUCCH_NR_FORMAT_3: + case SRSLTE_PUCCH_NR_FORMAT_4: { + uint32_t idx[SRSLTE_DMRS_PUCCH_FORMAT_3_4_MAX_NSYMB] = {}; + + // Get number of DMRS symbols for format 3 or 4 + int nsymb_dmrs = srslte_dmrs_pucch_format_3_4_get_symbol_idx(resource, idx); + if (nsymb_dmrs < SRSLTE_SUCCESS) { + return SRSLTE_ERROR; + } + + return (int)resource->nof_symbols - nsymb_dmrs; + } + default: + ERROR("Invalid case\n"); + break; + } + return SRSLTE_ERROR; +} + +// Calculate number of PUCCH symbols excluding the ones used exclusively for DMRS for formats 3 and 4 +static int ra_ul_nr_pucch_qm(const srslte_pucch_nr_resource_t* resource) +{ + switch (resource->format) { + case SRSLTE_PUCCH_NR_FORMAT_2: + return 2; + case SRSLTE_PUCCH_NR_FORMAT_3: + case SRSLTE_PUCCH_NR_FORMAT_4: + return resource->enable_pi_bpsk ? 1 : 2; + default: + ERROR("Invalid case\n"); + break; + } + return SRSLTE_ERROR; +} + +int srslte_ra_ul_nr_pucch_format_2_3_min_prb(const srslte_pucch_nr_resource_t* resource, + const srslte_uci_cfg_nr_t* uci_cfg) +{ + if (resource == NULL || uci_cfg == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + // Get maximum allowed code rate + double r = ra_ul_nr_pucch_code_rate_r(resource); + if (!isnormal(r)) { + ERROR("Invalid coderate %f\n", r); + return SRSLTE_ERROR; + } + + // Get number of RE/PRB + int nre = ra_ul_nr_pucch_nre(resource); + if (nre < SRSLTE_SUCCESS) { + ERROR("Getting nre\n"); + return SRSLTE_ERROR; + } + + // Get number of symbols + int nsymb = ra_ul_nr_pucch_nsymb(resource); + if (nsymb < SRSLTE_SUCCESS) { + ERROR("Getting nsymb\n"); + return SRSLTE_ERROR; + } + + // Get modulation order + int qm = ra_ul_nr_pucch_qm(resource); + if (qm < SRSLTE_SUCCESS) { + ERROR("Getting qm\n"); + return SRSLTE_ERROR; + } + + // Calculate denominator + double nof_bits_rb = r * nre * nsymb * qm; + if (!isnormal(nof_bits_rb)) { + return SRSLTE_ERROR; + } + + // Compute total number of UCI bits + uint32_t O_total = uci_cfg->o_ack + uci_cfg->o_sr + uci_cfg->o_csi1 + uci_cfg->o_csi2; + + // Add CRC bits if any + O_total += srslte_uci_nr_crc_len(O_total); + + // Return the minimum + return (int)ceil(O_total / nof_bits_rb); +} \ No newline at end of file diff --git a/lib/src/phy/phch/test/pucch_nr_test.c b/lib/src/phy/phch/test/pucch_nr_test.c index 4600475e0..5d2ce7f0b 100644 --- a/lib/src/phy/phch/test/pucch_nr_test.c +++ b/lib/src/phy/phch/test/pucch_nr_test.c @@ -13,7 +13,9 @@ #include "srslte/common/test_common.h" #include "srslte/phy/ch_estimation/dmrs_pucch.h" #include "srslte/phy/phch/pucch_nr.h" +#include "srslte/phy/phch/ra_ul_nr.h" #include "srslte/phy/utils/debug.h" +#include "srslte/phy/utils/random.h" #include "srslte/phy/utils/vector.h" #include #include @@ -30,13 +32,16 @@ static srslte_carrier_nr_t carrier = { 1 // max_mimo_layers }; -static uint32_t starting_prb_stride = 4; -static uint32_t starting_symbol_stride = 4; +static uint32_t starting_prb_stride = 4; +static uint32_t starting_symbol_stride = 4; +static srslte_random_t random_gen = NULL; +static int format = -1; static int test_pucch_format0(srslte_pucch_nr_t* pucch, const srslte_pucch_nr_common_cfg_t* cfg, cf_t* slot_symbols) { - srslte_dl_slot_cfg_t slot = {}; - srslte_pucch_nr_resource_t resource = {}; + srslte_dl_slot_cfg_t slot = {}; + srslte_pucch_nr_resource_t resource = {}; + resource.format = SRSLTE_PUCCH_NR_FORMAT_0; for (slot.idx = 0; slot.idx < SRSLTE_NSLOTS_PER_FRAME_NR(carrier.numerology); slot.idx++) { for (resource.starting_prb = 0; resource.starting_prb < carrier.nof_prb; @@ -83,18 +88,23 @@ static int test_pucch_format1(srslte_pucch_nr_t* pucch, srslte_chest_ul_res_t* chest_res, cf_t* slot_symbols) { - srslte_dl_slot_cfg_t slot = {}; - srslte_pucch_nr_resource_t resource = {}; + srslte_dl_slot_cfg_t slot = {}; + srslte_pucch_nr_resource_t resource = {}; + resource.format = SRSLTE_PUCCH_NR_FORMAT_1; for (slot.idx = 0; slot.idx < SRSLTE_NSLOTS_PER_FRAME_NR(carrier.numerology); slot.idx++) { for (resource.starting_prb = 0; resource.starting_prb < carrier.nof_prb; resource.starting_prb += starting_prb_stride) { - for (resource.nof_symbols = 4; resource.nof_symbols <= 14; resource.nof_symbols++) { + for (resource.nof_symbols = SRSLTE_PUCCH_NR_FORMAT1_MIN_NSYMB; + resource.nof_symbols <= SRSLTE_PUCCH_NR_FORMAT1_MAX_NSYMB; + resource.nof_symbols++) { for (resource.start_symbol_idx = 0; - resource.start_symbol_idx <= SRSLTE_NSYMB_PER_SLOT_NR - resource.nof_symbols; + resource.start_symbol_idx <= + SRSLTE_MIN(SRSLTE_PUCCH_NR_FORMAT1_MAX_STARTSYMB, SRSLTE_NSYMB_PER_SLOT_NR - resource.nof_symbols); resource.start_symbol_idx += starting_symbol_stride) { - for (resource.time_domain_occ = 0; resource.time_domain_occ <= 6; resource.time_domain_occ++) { - for (resource.initial_cyclic_shift = 0; resource.initial_cyclic_shift <= 11; + for (resource.time_domain_occ = 0; resource.time_domain_occ <= SRSLTE_PUCCH_NR_FORMAT1_MAX_TOCC; + resource.time_domain_occ++) { + for (resource.initial_cyclic_shift = 0; resource.initial_cyclic_shift <= SRSLTE_PUCCH_NR_FORMAT1_MAX_CS; resource.initial_cyclic_shift++) { for (uint32_t nof_bits = 1; nof_bits <= SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS; nof_bits++) { for (uint32_t word = 0; word < (1U << nof_bits); word++) { @@ -138,18 +148,103 @@ static int test_pucch_format1(srslte_pucch_nr_t* pucch, return SRSLTE_SUCCESS; } +static int test_pucch_format2(srslte_pucch_nr_t* pucch, + const srslte_pucch_nr_common_cfg_t* cfg, + srslte_chest_ul_res_t* chest_res, + cf_t* slot_symbols) +{ + srslte_dl_slot_cfg_t slot = {}; + srslte_pucch_nr_resource_t resource = {}; + resource.format = SRSLTE_PUCCH_NR_FORMAT_2; + + for (slot.idx = 0; slot.idx < SRSLTE_NSLOTS_PER_FRAME_NR(carrier.numerology); slot.idx++) { + + for (resource.nof_symbols = SRSLTE_PUCCH_NR_FORMAT2_MIN_NSYMB; + resource.nof_symbols <= SRSLTE_PUCCH_NR_FORMAT2_MAX_NSYMB; + resource.nof_symbols++) { + + for (resource.start_symbol_idx = 0; + resource.start_symbol_idx <= + SRSLTE_MIN(SRSLTE_PUCCH_NR_FORMAT2_MAX_STARTSYMB, SRSLTE_NSYMB_PER_SLOT_NR - resource.nof_symbols); + resource.start_symbol_idx += starting_symbol_stride) { + + // Maximum code rate is reserved + for (resource.max_code_rate = 0; resource.max_code_rate < SRSLTE_PUCCH_NR_MAX_CODE_RATE; + resource.max_code_rate++) { + + srslte_uci_cfg_nr_t uci_cfg = {}; + + for (uci_cfg.o_ack = 12; uci_cfg.o_ack <= SRSLTE_UCI_NR_MAX_ACK_BITS; uci_cfg.o_ack++) { + srslte_uci_value_nr_t uci_value = {}; + + // Skip case if not enough PRB are used + int min_nof_prb = srslte_ra_ul_nr_pucch_format_2_3_min_prb(&resource, &uci_cfg); + TESTASSERT(min_nof_prb > SRSLTE_SUCCESS); + + for (resource.nof_prb = min_nof_prb; + resource.nof_prb < SRSLTE_MIN(carrier.nof_prb, SRSLTE_PUCCH_NR_FORMAT2_MAX_NPRB); + resource.nof_prb++) { + + for (resource.starting_prb = 0; resource.starting_prb < (carrier.nof_prb - resource.nof_prb); + resource.starting_prb += starting_prb_stride) { + + // Generate ACKs + for (uint32_t i = 0; i < uci_cfg.o_ack; i++) { + uci_value.ack[i] = (uint8_t)srslte_random_uniform_int_dist(random_gen, 0, 1); + } + + // Encode PUCCH + TESTASSERT(srslte_pucch_nr_format_2_3_4_encode( + pucch, &carrier, cfg, &slot, &resource, &uci_cfg, &uci_value, slot_symbols) == + SRSLTE_SUCCESS); + + // Put DMRS + // TESTASSERT(srslte_dmrs_pucch_format1_put(pucch, &carrier, cfg, &slot, &resource, + // slot_symbols) == + // SRSLTE_SUCCESS); + + // Estimate channel + // TESTASSERT(srslte_dmrs_pucch_format1_estimate( + // pucch, &carrier, cfg, &slot, &resource, slot_symbols, chest_res) == + // SRSLTE_SUCCESS); + srslte_chest_ul_res_set_identity(chest_res); + + // Decode PUCCH + srslte_uci_value_nr_t uci_value_rx = {}; + TESTASSERT( + srslte_pucch_nr_format_2_3_4_decode( + pucch, &carrier, cfg, &slot, &resource, &uci_cfg, chest_res, slot_symbols, &uci_value_rx) == + SRSLTE_SUCCESS); + + TESTASSERT(uci_value_rx.valid == true); + + // Check received ACKs + for (uint32_t i = 0; i < uci_cfg.o_ack; i++) { + TESTASSERT(uci_value.ack[i] == uci_value_rx.ack[i]); + } + } + } + } + } + } + } + } + return SRSLTE_SUCCESS; +} + static void usage(char* prog) { printf("Usage: %s [csNnv]\n", prog); printf("\t-c cell id [Default %d]\n", carrier.id); printf("\t-n nof_prb [Default %d]\n", carrier.nof_prb); + printf("\t-f format [Default %d]\n", format); printf("\t-v [set verbose to debug, default none]\n"); } static void parse_args(int argc, char** argv) { int opt; - while ((opt = getopt(argc, argv, "cnv")) != -1) { + while ((opt = getopt(argc, argv, "cnfv")) != -1) { switch (opt) { case 'c': carrier.id = (uint32_t)strtol(argv[optind], NULL, 10); @@ -157,6 +252,9 @@ static void parse_args(int argc, char** argv) case 'n': carrier.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10); break; + case 'f': + format = (int)strtol(argv[optind], NULL, 10); + break; case 'v': srslte_verbose++; break; @@ -177,6 +275,12 @@ int main(int argc, char** argv) srslte_pucch_nr_t pucch = {}; srslte_chest_ul_res_t chest_res = {}; + random_gen = srslte_random_init(0x1234); + if (random_gen == NULL) { + ERROR("Random init\n"); + goto clean_exit; + } + if (slot_symb == NULL) { ERROR("Alloc\n"); goto clean_exit; @@ -196,15 +300,27 @@ int main(int argc, char** argv) srslte_pucch_nr_common_cfg_t common_cfg = {}; // Test Format 0 - if (test_pucch_format0(&pucch, &common_cfg, slot_symb) < SRSLTE_SUCCESS) { - ERROR("Failed PUCCH format 0\n"); - goto clean_exit; + if (format < 0 || format == 0) { + if (test_pucch_format0(&pucch, &common_cfg, slot_symb) < SRSLTE_SUCCESS) { + ERROR("Failed PUCCH format 0\n"); + goto clean_exit; + } } // Test Format 1 - if (test_pucch_format1(&pucch, &common_cfg, &chest_res, slot_symb) < SRSLTE_SUCCESS) { - ERROR("Failed PUCCH format 1\n"); - goto clean_exit; + if (format < 0 || format == 1) { + if (test_pucch_format1(&pucch, &common_cfg, &chest_res, slot_symb) < SRSLTE_SUCCESS) { + ERROR("Failed PUCCH format 1\n"); + goto clean_exit; + } + } + + // Test Format 2 + if (format < 0 || format == 2) { + if (test_pucch_format2(&pucch, &common_cfg, &chest_res, slot_symb) < SRSLTE_SUCCESS) { + ERROR("Failed PUCCH format 2\n"); + goto clean_exit; + } } ret = SRSLTE_SUCCESS; @@ -216,6 +332,8 @@ clean_exit: srslte_pucch_nr_free(&pucch); srslte_chest_ul_res_free(&chest_res); + srslte_random_free(random_gen); + if (ret == SRSLTE_SUCCESS) { printf("Test passed!\n"); } else { diff --git a/lib/src/phy/phch/uci_nr.c b/lib/src/phy/phch/uci_nr.c index c8838cd78..a8a433711 100644 --- a/lib/src/phy/phch/uci_nr.c +++ b/lib/src/phy/phch/uci_nr.c @@ -17,13 +17,22 @@ #include "srslte/phy/utils/bit.h" #include "srslte/phy/utils/vector.h" +#define UCI_NR_INFO_TX(...) INFO("UCI-NR Tx: " __VA_ARGS__) +#define UCI_NR_INFO_RX(...) INFO("UCI-NR Rx: " __VA_ARGS__) + // TS 38.212 section 5.2.1 Polar coding: The value of A is no larger than 1706. #define UCI_NR_MAX_A 1706U #define UCI_NR_MAX_L 11U #define UCI_NR_POLAR_MAX 2048U #define UCI_NR_POLAR_RM_IBIL 0 +#define UCI_NR_PUCCH_POLAR_N_MAX 10 #define UCI_NR_BLOCK_CORR_THRESHOLD 0.5f +uint32_t srslte_uci_nr_crc_len(uint32_t A) +{ + return (A <= 11) ? 0 : (A < 20) ? 6 : 11; +} + int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args) { if (q == NULL || args == NULL) { @@ -39,6 +48,11 @@ int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args) } #endif // LV_HAVE_AVX2 + if (srslte_polar_code_init(&q->code)) { + ERROR("Initialising polar code\n"); + return SRSLTE_ERROR; + } + if (srslte_polar_encoder_init(&q->encoder, polar_encoder_type, NMAX_LOG) < SRSLTE_SUCCESS) { ERROR("Initialising polar encoder\n"); return SRSLTE_ERROR; @@ -49,7 +63,12 @@ int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args) return SRSLTE_ERROR; } - if (srslte_polar_rm_tx_init(&q->rm) < SRSLTE_SUCCESS) { + if (srslte_polar_rm_tx_init(&q->rm_tx) < SRSLTE_SUCCESS) { + ERROR("Initialising polar RM\n"); + return SRSLTE_ERROR; + } + + if (srslte_polar_rm_rx_init_c(&q->rm_rx) < SRSLTE_SUCCESS) { ERROR("Initialising polar RM\n"); return SRSLTE_ERROR; } @@ -99,8 +118,11 @@ void srslte_uci_nr_free(srslte_uci_nr_t* q) return; } + srslte_polar_code_free(&q->code); srslte_polar_encoder_free(&q->encoder); srslte_polar_decoder_free(&q->decoder); + srslte_polar_rm_tx_free(&q->rm_tx); + srslte_polar_rm_rx_free_c(&q->rm_rx); if (q->bit_sequence != NULL) { free(q->bit_sequence); @@ -130,6 +152,11 @@ static int uci_nr_pack_ack_sr(const srslte_uci_cfg_nr_t* cfg, const srslte_uci_v srslte_vec_u8_copy(&sequence[A], value->sr, cfg->o_sr); A += cfg->o_sr; + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_TX("Packed UCI bits: "); + srslte_vec_fprint_byte(stdout, sequence, A); + } + return A; } @@ -145,6 +172,11 @@ static int uci_nr_unpack_ack_sr(const srslte_uci_cfg_nr_t* cfg, const uint8_t* s srslte_vec_u8_copy(value->sr, &sequence[A], cfg->o_sr); A += cfg->o_sr; + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_RX("Unpacked UCI bits: "); + srslte_vec_fprint_byte(stdout, sequence, A); + } + return A; } @@ -356,11 +388,11 @@ static int uci_nr_encode_2bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg static int uci_nr_encode_3_11_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint32_t A, uint8_t* o, uint32_t E) { - uint8_t encoded[SRSLTE_FEC_BLOCK_SIZE] = {}; - srslte_block_encode(q->bit_sequence, A, encoded, SRSLTE_FEC_BLOCK_SIZE); + srslte_block_encode(q->bit_sequence, A, o, E); - for (uint32_t i = 0; i < E; i++) { - o[i] = (encoded[i % SRSLTE_FEC_BLOCK_SIZE] == 0) ? UCI_BIT_0 : UCI_BIT_1; + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_TX("Block encoded UCI bits; o="); + srslte_vec_fprint_b(stdout, o, E); } return E; @@ -384,6 +416,11 @@ static int uci_nr_decode_3_11_bit(srslte_uci_nr_t* q, return SRSLTE_ERROR; } + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_RX("Block decoding NR-UCI llr="); + srslte_vec_fprint_bs(stdout, llr, E); + } + // Decode float corr = (float)srslte_block_decode_i8(llr, E, q->bit_sequence, A); @@ -408,10 +445,8 @@ uci_nr_encode_11_1706_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, ui } // Select CRC - srslte_crc_t* crc = &q->crc6; - if (A >= 20) { - crc = &q->crc11; - } + uint32_t L = srslte_uci_nr_crc_len(A); + srslte_crc_t* crc = (L == 6) ? &q->crc6 : &q->crc11; // Segmentation uint32_t C = 1; @@ -421,9 +456,9 @@ uci_nr_encode_11_1706_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, ui uint32_t A_prime = CEIL(A, C) * C; // Get polar code - uint32_t K_r = A_prime / C + crc->order; + uint32_t K_r = A_prime / C + L; uint32_t E_r = E_uci / C; - if (srslte_polar_code_get(&q->code, K_r, E_r, 9U) < SRSLTE_SUCCESS) { + if (srslte_polar_code_get(&q->code, K_r, E_r, UCI_NR_PUCCH_POLAR_N_MAX) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } @@ -445,17 +480,33 @@ uci_nr_encode_11_1706_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, ui // Attach CRC srslte_crc_attach(crc, q->c, A_prime / C); + UCI_NR_INFO_TX("Attaching %d/%d CRC%d=%02lx\n", r, C, L, srslte_crc_checksum_get(crc)); + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_TX("Polar cb %d/%d c=", r, C); + srslte_vec_fprint_byte(stdout, q->c, K_r); + } // Allocate channel srslte_polar_chanalloc_tx(q->c, q->allocated, q->code.N, q->code.K, q->code.nPC, q->code.K_set, q->code.PC_set); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_TX("Polar alloc %d/%d ", r, C); + srslte_vec_fprint_byte(stdout, q->allocated, q->code.N); + } + // Encode bits if (srslte_polar_encoder_encode(&q->encoder, q->allocated, q->d, q->code.n) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } // Rate matching - srslte_polar_rm_tx(&q->rm, q->d, &o[E_r * r], q->code.n, E_r, K_r, UCI_NR_POLAR_RM_IBIL); + srslte_polar_rm_tx(&q->rm_tx, q->d, &o[E_r * r], q->code.n, E_r, K_r, UCI_NR_POLAR_RM_IBIL); + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_TX("Polar cw %d/%d ", r, C); + srslte_vec_fprint_byte(stdout, &o[E_r * r], q->code.N); + } } return E_uci; @@ -464,7 +515,7 @@ uci_nr_encode_11_1706_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, ui static int uci_nr_decode_11_1706_bit(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* cfg, uint32_t A, - const int8_t* llr, + int8_t* llr, uint32_t E_uci, bool* decoded_ok) { @@ -477,10 +528,8 @@ static int uci_nr_decode_11_1706_bit(srslte_uci_nr_t* q, } // Select CRC - srslte_crc_t* crc = &q->crc6; - if (A >= 20) { - crc = &q->crc11; - } + uint32_t L = srslte_uci_nr_crc_len(A); + srslte_crc_t* crc = (L == 6) ? &q->crc6 : &q->crc11; // Segmentation uint32_t C = 1; @@ -490,19 +539,29 @@ static int uci_nr_decode_11_1706_bit(srslte_uci_nr_t* q, uint32_t A_prime = CEIL(A, C) * C; // Get polar code - uint32_t K_r = A_prime / C + crc->order; + uint32_t K_r = A_prime / C + L; uint32_t E_r = E_uci / C; - if (srslte_polar_code_get(&q->code, K_r, E_r, 9U) < SRSLTE_SUCCESS) { + if (srslte_polar_code_get(&q->code, K_r, E_r, UCI_NR_PUCCH_POLAR_N_MAX) < SRSLTE_SUCCESS) { return SRSLTE_ERROR; } + // Negate all LLR + for (uint32_t i = 0; i < E_r; i++) { + llr[i] *= -1; + } + // Write codeword for (uint32_t r = 0, s = 0; r < C; r++) { uint32_t k = 0; + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_RX("Polar LLR %d/%d ", r, C); + srslte_vec_fprint_bs(stdout, &llr[E_r * r], q->code.N); + } + // Undo rate matching int8_t* d = (int8_t*)q->d; - srslte_polar_rm_rx_c(&q->rm, &llr[E_r * r], d, q->code.n, E_r, K_r, UCI_NR_POLAR_RM_IBIL); + srslte_polar_rm_rx_c(&q->rm_rx, &llr[E_r * r], d, E_r, q->code.n, K_r, UCI_NR_POLAR_RM_IBIL); // Decode bits if (srslte_polar_decoder_decode_c(&q->decoder, d, q->allocated, q->code.n, q->code.F_set, q->code.F_set_size) < @@ -510,14 +569,25 @@ static int uci_nr_decode_11_1706_bit(srslte_uci_nr_t* q, return SRSLTE_ERROR; } + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_RX("Polar alloc %d/%d ", r, C); + srslte_vec_fprint_byte(stdout, q->allocated, q->code.N); + } + // Undo channel allocation srslte_polar_chanalloc_rx(q->allocated, q->c, q->code.K, q->code.nPC, q->code.K_set, q->code.PC_set); - // - uint8_t* ptr = &q->c[q->code.K - crc->order]; - uint32_t checksum1 = srslte_crc_checksum(crc, q->c, q->code.K); - uint32_t checksum2 = srslte_bit_pack(&ptr, crc->order); + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_RX("Polar cb %d/%d c=", r, C); + srslte_vec_fprint_byte(stdout, q->c, K_r); + } + + // Calculate checksum + uint8_t* ptr = &q->c[A_prime / C]; + uint32_t checksum1 = srslte_crc_checksum(crc, q->c, A_prime / C); + uint32_t checksum2 = srslte_bit_pack(&ptr, L); (*decoded_ok) = ((*decoded_ok) && (checksum1 == checksum2)); + UCI_NR_INFO_RX("Checking %d/%d CRC%d={%02x,%02x}\n", r, C, L, checksum1, checksum2); // Prefix (A_prime - A) zeros for the first CB only if (r == 0) { @@ -577,7 +647,7 @@ static int uci_nr_encode(srslte_uci_nr_t* q, static int uci_nr_decode(srslte_uci_nr_t* q, const srslte_uci_cfg_nr_t* uci_cfg, - const int8_t* llr, + int8_t* llr, uint32_t E_uci, srslte_uci_value_nr_t* uci_value) { @@ -624,20 +694,9 @@ static int uci_nr_pucch_E_tot(const srslte_pucch_nr_resource_t* pucch_cfg, const return SRSLTE_ERROR_INVALID_INPUTS; } - // Compute total number of bits - uint32_t nof_bits = uci_cfg->o_sr + uci_cfg->o_ack + uci_cfg->o_csi1 + uci_cfg->o_csi2; - switch (pucch_cfg->format) { - case SRSLTE_PUCCH_NR_FORMAT_1: - if (nof_bits <= 2) { - return nof_bits; - } - break; case SRSLTE_PUCCH_NR_FORMAT_2: - if (uci_cfg->modulation == SRSLTE_MOD_QPSK) { - return (int)(16 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); - } - break; + return (int)(16 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); case SRSLTE_PUCCH_NR_FORMAT_3: if (uci_cfg->modulation == SRSLTE_MOD_QPSK) { return (int)(24 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); @@ -684,11 +743,13 @@ int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, { int E_tot = uci_nr_pucch_E_tot(pucch_resource_cfg, uci_cfg); if (E_tot < SRSLTE_SUCCESS) { + ERROR("Error calculating number of bits\n"); return SRSLTE_ERROR; } int E_uci = uci_nr_pucch_E_uci(pucch_resource_cfg, uci_cfg, E_tot); if (E_uci < SRSLTE_SUCCESS) { + ERROR("Error calculating number of bits\n"); return SRSLTE_ERROR; } @@ -698,7 +759,7 @@ int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, int srslte_uci_nr_decode_pucch(srslte_uci_nr_t* q, const srslte_pucch_nr_resource_t* pucch_resource_cfg, const srslte_uci_cfg_nr_t* uci_cfg, - const int8_t* llr, + int8_t* llr, srslte_uci_value_nr_t* value) { int E_tot = uci_nr_pucch_E_tot(pucch_resource_cfg, uci_cfg); From 4c6944b8834dd8dad63b47c80bf083a3bb216387 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 25 Jan 2021 19:59:44 +0100 Subject: [PATCH 137/138] Implement NR-PUCCH Format 2 DMRS put/Estimate --- .../srslte/phy/ch_estimation/dmrs_pucch.h | 36 ++++ lib/include/srslte/phy/common/phy_common_nr.h | 2 +- lib/include/srslte/phy/common/sequence.h | 2 + lib/include/srslte/phy/phch/pucch_nr.h | 1 + lib/src/phy/ch_estimation/dmrs_pdcch.c | 5 +- lib/src/phy/ch_estimation/dmrs_pucch.c | 158 +++++++++++++++++- lib/src/phy/phch/pucch_nr.c | 29 +++- lib/src/phy/phch/test/pucch_nr_test.c | 58 +++++-- 8 files changed, 265 insertions(+), 26 deletions(-) diff --git a/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h b/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h index 7bd6c7f52..91cddd708 100644 --- a/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h +++ b/lib/include/srslte/phy/ch_estimation/dmrs_pucch.h @@ -65,4 +65,40 @@ SRSLTE_API int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* const cf_t* slot_symbols, srslte_chest_ul_res_t* res); +/** + * @brief Puts NR-PUCCH format 2 DMRS in the provided resource grid + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] carrier Carrier configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 2 resource + * @param[out] slot_symbols Resource grid of the given slot + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +int srslte_dmrs_pucch_format2_put(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + cf_t* slot_symbols); + +/** + * @brief Estimates NR-PUCCH format 2 resource elements from their DMRS in the provided resource grid + * @param[in] q NR-PUCCH encoder/decoder object + * @param[in] carrier Carrier configuration + * @param[in] cfg PUCCH common configuration + * @param[in] slot slot configuration + * @param[in] resource PUCCH format 2 resource + * @param[in] slot_symbols Resource grid of the given slot + * @param[out] res UL Channel estimator result + * @return SRSLTE_SUCCESS if successful, SRSLTE_ERROR code otherwise + */ +int srslte_dmrs_pucch_format2_estimate(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const cf_t* slot_symbols, + srslte_chest_ul_res_t* res); + #endif // SRSLTE_DMRS_PUCCH_H diff --git a/lib/include/srslte/phy/common/phy_common_nr.h b/lib/include/srslte/phy/common/phy_common_nr.h index 3a133ad4e..21ed49489 100644 --- a/lib/include/srslte/phy/common/phy_common_nr.h +++ b/lib/include/srslte/phy/common/phy_common_nr.h @@ -23,7 +23,7 @@ extern "C" { /** * @brief Defines the number of symbols per slot. Defined by TS 38.211 v15.8.0 Table 4.3.2-1. */ -#define SRSLTE_NSYMB_PER_SLOT_NR 14 +#define SRSLTE_NSYMB_PER_SLOT_NR 14U /** * @brief Defines the resource grid size in physical resource elements (frequency and time domain) diff --git a/lib/include/srslte/phy/common/sequence.h b/lib/include/srslte/phy/common/sequence.h index aa3ed9b71..c3857ecb9 100644 --- a/lib/include/srslte/phy/common/sequence.h +++ b/lib/include/srslte/phy/common/sequence.h @@ -25,6 +25,8 @@ #include "srslte/config.h" #include "srslte/phy/common/phy_common.h" +#define SRSLTE_SEQUENCE_MOD(X) ((X) & (uint32_t)INT32_MAX) + typedef struct SRSLTE_API { uint32_t x1; uint32_t x2; diff --git a/lib/include/srslte/phy/phch/pucch_nr.h b/lib/include/srslte/phy/phch/pucch_nr.h index 996867b70..6ddc1507d 100644 --- a/lib/include/srslte/phy/phch/pucch_nr.h +++ b/lib/include/srslte/phy/phch/pucch_nr.h @@ -54,6 +54,7 @@ typedef struct SRSLTE_API { srslte_uci_nr_t uci; uint8_t* b; cf_t* d; + cf_t* ce; } srslte_pucch_nr_t; /** diff --git a/lib/src/phy/ch_estimation/dmrs_pdcch.c b/lib/src/phy/ch_estimation/dmrs_pdcch.c index 345e8dd17..e9675cb9c 100644 --- a/lib/src/phy/ch_estimation/dmrs_pdcch.c +++ b/lib/src/phy/ch_estimation/dmrs_pdcch.c @@ -31,9 +31,8 @@ static uint32_t dmrs_pdcch_get_cinit(uint32_t slot_idx, uint32_t symbol_idx, uint32_t n_id) { - return (uint32_t)( - ((1UL << 17UL) * (SRSLTE_NSYMB_PER_SLOT_NR * slot_idx + symbol_idx + 1UL) * (2UL * n_id + 1UL) + 2UL * n_id) % - INT32_MAX); + return SRSLTE_SEQUENCE_MOD((((SRSLTE_NSYMB_PER_SLOT_NR * slot_idx + symbol_idx + 1UL) * (2UL * n_id + 1UL)) << 17U) + + 2UL * n_id); } static void dmrs_pdcch_put_symbol_noninterleaved(const srslte_carrier_nr_t* carrier, diff --git a/lib/src/phy/ch_estimation/dmrs_pucch.c b/lib/src/phy/ch_estimation/dmrs_pucch.c index 4e38701c3..9de97ef19 100644 --- a/lib/src/phy/ch_estimation/dmrs_pucch.c +++ b/lib/src/phy/ch_estimation/dmrs_pucch.c @@ -11,6 +11,7 @@ */ #include "srslte/phy/ch_estimation/dmrs_pucch.h" +#include "srslte/phy/common/sequence.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/vector.h" @@ -160,7 +161,8 @@ int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, srslte_chest_ul_res_t* res) { - if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL) { + if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL || + res == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; } @@ -223,7 +225,7 @@ int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, float epre = 0.0f; float ta_err = 0.0f; for (uint32_t m = 0; m < n_pucch; m++) { - cf_t corr = srslte_vec_acc_cc(ce[m], SRSLTE_NRE); + cf_t corr = srslte_vec_acc_cc(ce[m], SRSLTE_NRE) / SRSLTE_NRE; rsrp += __real__ corr * __real__ corr + __imag__ corr * __imag__ corr; epre += srslte_vec_avg_power_cf(ce[m], SRSLTE_NRE); ta_err += srslte_vec_estimate_frequency(ce[m], SRSLTE_NRE); @@ -236,10 +238,14 @@ int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, // Set power measures rsrp = SRSLTE_MIN(rsrp, epre); + res->rsrp = rsrp; + res->rsrp_dBfs = srslte_convert_power_to_dB(rsrp); + res->epre = epre; + res->epre_dBfs = srslte_convert_power_to_dB(epre); res->noise_estimate = epre - rsrp; res->noise_estimate_dbm = srslte_convert_power_to_dB(res->noise_estimate); res->snr = rsrp / res->noise_estimate; - res->snr_db = srslte_convert_power_to_dB(res->snr_db); + res->snr_db = srslte_convert_power_to_dB(res->snr); // Compute Time Aligment error in microseconds if (isnormal(ta_err)) { @@ -280,6 +286,152 @@ int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q, return SRSLTE_SUCCESS; } +static uint32_t dmrs_pucch_format2_cinit(const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + uint32_t l) +{ + uint32_t n = SRSLTE_SLOT_NR_MOD(slot->idx, carrier->numerology); + uint32_t n_id = (cfg->scrambling_id_present) ? cfg->scambling_id : carrier->id; + + return SRSLTE_SEQUENCE_MOD((((SRSLTE_NSYMB_PER_SLOT_NR * n + l + 1U) * (2U * n_id + 1U)) << 17U) + 2U * n_id); +} + +int srslte_dmrs_pucch_format2_put(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + cf_t* slot_symbols) +{ + if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { + ERROR("Invalid PUCCH format 1 resource\n"); + return SRSLTE_ERROR; + } + + uint32_t l_start = resource->start_symbol_idx; + uint32_t l_end = resource->start_symbol_idx + resource->nof_symbols; + uint32_t k_start = SRSLTE_MIN(carrier->nof_prb - 1, resource->starting_prb) * SRSLTE_NRE + 1; + uint32_t k_end = SRSLTE_MIN(carrier->nof_prb, resource->starting_prb + resource->nof_prb) * SRSLTE_NRE; + for (uint32_t l = l_start; l < l_end; l++) { + // Compute sequence initial state + uint32_t cinit = dmrs_pucch_format2_cinit(carrier, cfg, slot, l); + srslte_sequence_state_t sequence = {}; + srslte_sequence_state_init(&sequence, cinit); + + // Skip PRBs to start + srslte_sequence_state_advance(&sequence, 2 * 4 * resource->starting_prb); + + // Generate sequence + cf_t r_l[SRSLTE_PUCCH_NR_FORMAT2_MAX_NPRB * 4]; + srslte_sequence_state_gen_f(&sequence, M_SQRT1_2, (float*)r_l, 2 * 4 * resource->nof_prb); + + // Put sequence in k = 3 * m + 1 + for (uint32_t k = k_start, i = 0; k < k_end; k += 3, i++) { + slot_symbols[l * carrier->nof_prb * SRSLTE_NRE + k] = r_l[i]; + } + } + return SRSLTE_SUCCESS; +} + +int srslte_dmrs_pucch_format2_estimate(const srslte_pucch_nr_t* q, + const srslte_carrier_nr_t* carrier, + const srslte_pucch_nr_common_cfg_t* cfg, + const srslte_dl_slot_cfg_t* slot, + const srslte_pucch_nr_resource_t* resource, + const cf_t* slot_symbols, + srslte_chest_ul_res_t* res) +{ + if (q == NULL || carrier == NULL || cfg == NULL || slot == NULL || resource == NULL || slot_symbols == NULL || + res == NULL) { + return SRSLTE_ERROR_INVALID_INPUTS; + } + + if (srslte_pucch_nr_cfg_resource_valid(resource) < SRSLTE_SUCCESS) { + ERROR("Invalid PUCCH format 1 resource\n"); + return SRSLTE_ERROR; + } + + cf_t ce[SRSLTE_PUCCH_NR_FORMAT2_MAX_NSYMB][SRSLTE_PUCCH_NR_FORMAT2_MAX_NPRB * 4]; + + uint32_t l_start = resource->start_symbol_idx; + uint32_t l_end = resource->start_symbol_idx + resource->nof_symbols; + uint32_t k_start = SRSLTE_MIN(carrier->nof_prb - 1, resource->starting_prb) * SRSLTE_NRE + 1; + uint32_t k_end = SRSLTE_MIN(carrier->nof_prb, resource->starting_prb + resource->nof_prb) * SRSLTE_NRE; + uint32_t nof_ref = 4 * resource->nof_prb; + for (uint32_t l = l_start, j = 0; l < l_end; l++, j++) { + // Compute sequence initial state + uint32_t cinit = dmrs_pucch_format2_cinit(carrier, cfg, slot, l); + srslte_sequence_state_t sequence = {}; + srslte_sequence_state_init(&sequence, cinit); + + // Skip PRBs to start + srslte_sequence_state_advance(&sequence, 2 * 4 * resource->starting_prb); + + // Generate sequence + cf_t r_l[SRSLTE_PUCCH_NR_FORMAT2_MAX_NPRB * 4]; + srslte_sequence_state_gen_f(&sequence, M_SQRT1_2, (float*)r_l, 2 * nof_ref); + + // Put sequence in k = 3 * m + 1 + for (uint32_t k = k_start, i = 0; k < k_end; k += 3, i++) { + ce[j][i] = slot_symbols[l * carrier->nof_prb * SRSLTE_NRE + k]; + } + + srslte_vec_prod_conj_ccc(ce[j], r_l, ce[j], nof_ref); + } + + // Perform measurements + float epre = 0.0f; + float rsrp = 0.0f; + float ta_err = 0.0f; + for (uint32_t i = 0; i < resource->nof_symbols; i++) { + cf_t corr = srslte_vec_acc_cc(ce[i], nof_ref) / nof_ref; + rsrp += __real__ corr * __real__ corr + __imag__ corr * __imag__ corr; + epre += srslte_vec_avg_power_cf(ce[i], nof_ref); + ta_err += srslte_vec_estimate_frequency(ce[i], nof_ref); + } + epre /= resource->nof_symbols; + rsrp /= resource->nof_symbols; + ta_err /= resource->nof_symbols; + + // Set power measures + rsrp = SRSLTE_MIN(rsrp, epre); + res->rsrp = rsrp; + res->rsrp_dBfs = srslte_convert_power_to_dB(rsrp); + res->epre = epre; + res->epre_dBfs = srslte_convert_power_to_dB(epre); + res->noise_estimate = epre - rsrp; + res->noise_estimate_dbm = srslte_convert_power_to_dB(res->noise_estimate); + res->snr = rsrp / res->noise_estimate; + res->snr_db = srslte_convert_power_to_dB(res->snr); + + // Compute Time Aligment error in microseconds + if (isnormal(ta_err)) { + ta_err /= 15e3f * (float)(1U << carrier->numerology) * 3; // Convert from normalized frequency to seconds + ta_err *= 1e6f; // Convert to micro-seconds + ta_err = roundf(ta_err * 10.0f) / 10.0f; // Round to one tenth of micro-second + res->ta_us = ta_err; + } else { + res->ta_us = 0.0f; + } + + // Perform averaging + // ... + + // Zero order hold + for (uint32_t l = l_start, j = 0; l < l_end; l++, j++) { + for (uint32_t k = k_start - 1, i = 0; k < k_end; k++, i++) { + res->ce[l * carrier->nof_prb * SRSLTE_NRE + k] = ce[j][i / 3]; + } + } + + return SRSLTE_SUCCESS; +} + int srslte_dmrs_pucch_format_3_4_get_symbol_idx(const srslte_pucch_nr_resource_t* resource, uint32_t idx[SRSLTE_DMRS_PUCCH_FORMAT_3_4_MAX_NSYMB]) { diff --git a/lib/src/phy/phch/pucch_nr.c b/lib/src/phy/phch/pucch_nr.c index 1ea11638a..4dcbe93c7 100644 --- a/lib/src/phy/phch/pucch_nr.c +++ b/lib/src/phy/phch/pucch_nr.c @@ -165,6 +165,13 @@ int srslte_pucch_nr_init(srslte_pucch_nr_t* q, const srslte_pucch_nr_args_t* arg return SRSLTE_ERROR; } + // Allocate temporal channel estimates + q->ce = srslte_vec_cf_malloc(max_encoded_bits / 2); + if (q->ce == NULL) { + ERROR("Malloc\n"); + return SRSLTE_ERROR; + } + return SRSLTE_SUCCESS; } @@ -187,6 +194,10 @@ void srslte_pucch_nr_free(srslte_pucch_nr_t* q) free(q->d); } + if (q->ce != NULL) { + free(q->ce); + } + SRSLTE_MEM_ZERO(q, srslte_pucch_nr_t, 1); } @@ -582,14 +593,26 @@ static int pucch_nr_format2_decode(srslte_pucch_nr_t* q, uint32_t k_end = (resource->starting_prb + resource->nof_prb) * SRSLTE_NRE; for (uint32_t l = l_start, i = 0; l < l_end; l++) { cf_t* symbol_ptr = &slot_symbols[l * carrier->nof_prb * SRSLTE_NRE]; + cf_t* ce_ptr = &chest_res->ce[l * carrier->nof_prb * SRSLTE_NRE]; for (uint32_t k = k_start; k < k_end; k += 3) { - q->d[i++] = symbol_ptr[k]; - q->d[i++] = symbol_ptr[k + 2]; + q->d[i] = symbol_ptr[k]; + q->ce[i] = ce_ptr[k]; + i++; + q->d[i] = symbol_ptr[k + 2]; + q->ce[i] = ce_ptr[k + 2]; + i++; } } + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + INFO("d="); + srslte_vec_fprint_c(stdout, q->d, resource->nof_symbols * resource->nof_prb * (SRSLTE_NRE - 4)); + INFO("ce="); + srslte_vec_fprint_c(stdout, q->ce, resource->nof_symbols * resource->nof_prb * (SRSLTE_NRE - 4)); + } + // Equalise - if (srslte_predecoding_single(q->d, chest_res->ce, q->d, NULL, E, 1.0f, chest_res->noise_estimate) < SRSLTE_SUCCESS) { + if (srslte_predecoding_single(q->d, q->ce, q->d, NULL, E, 1.0f, chest_res->noise_estimate) < SRSLTE_SUCCESS) { ERROR("Error Pre-decoding\n"); return SRSLTE_ERROR; } diff --git a/lib/src/phy/phch/test/pucch_nr_test.c b/lib/src/phy/phch/test/pucch_nr_test.c index 5d2ce7f0b..9f024b008 100644 --- a/lib/src/phy/phch/test/pucch_nr_test.c +++ b/lib/src/phy/phch/test/pucch_nr_test.c @@ -12,16 +12,14 @@ #include "srslte/common/test_common.h" #include "srslte/phy/ch_estimation/dmrs_pucch.h" +#include "srslte/phy/channel/ch_awgn.h" #include "srslte/phy/phch/pucch_nr.h" #include "srslte/phy/phch/ra_ul_nr.h" #include "srslte/phy/utils/debug.h" #include "srslte/phy/utils/random.h" #include "srslte/phy/utils/vector.h" #include -#include -#include #include -#include #include static srslte_carrier_nr_t carrier = { @@ -32,10 +30,12 @@ static srslte_carrier_nr_t carrier = { 1 // max_mimo_layers }; -static uint32_t starting_prb_stride = 4; -static uint32_t starting_symbol_stride = 4; -static srslte_random_t random_gen = NULL; -static int format = -1; +static uint32_t starting_prb_stride = 4; +static uint32_t starting_symbol_stride = 4; +static srslte_random_t random_gen = NULL; +static int format = -1; +static float snr_db = 30.0f; +static srslte_channel_awgn_t awgn = {}; static int test_pucch_format0(srslte_pucch_nr_t* pucch, const srslte_pucch_nr_common_cfg_t* cfg, cf_t* slot_symbols) { @@ -122,10 +122,18 @@ static int test_pucch_format1(srslte_pucch_nr_t* pucch, TESTASSERT(srslte_dmrs_pucch_format1_put(pucch, &carrier, cfg, &slot, &resource, slot_symbols) == SRSLTE_SUCCESS); + // Apply AWGN + srslte_channel_awgn_run_c( + &awgn, slot_symbols, slot_symbols, carrier.nof_prb * SRSLTE_NRE * SRSLTE_NSYMB_PER_SLOT_NR); + // Estimate channel TESTASSERT(srslte_dmrs_pucch_format1_estimate( pucch, &carrier, cfg, &slot, &resource, slot_symbols, chest_res) == SRSLTE_SUCCESS); + TESTASSERT(fabsf(chest_res->rsrp_dBfs - 0.0f) < 3.0f); + TESTASSERT(fabsf(chest_res->epre_dBfs - 0.0f) < 3.0f); + TESTASSERT(fabsf(chest_res->snr_db - snr_db) < 10.0f); + // Decode PUCCH uint8_t b_rx[SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS]; TESTASSERT(srslte_pucch_nr_format1_decode( @@ -199,15 +207,19 @@ static int test_pucch_format2(srslte_pucch_nr_t* pucch, SRSLTE_SUCCESS); // Put DMRS - // TESTASSERT(srslte_dmrs_pucch_format1_put(pucch, &carrier, cfg, &slot, &resource, - // slot_symbols) == - // SRSLTE_SUCCESS); + TESTASSERT(srslte_dmrs_pucch_format2_put(pucch, &carrier, cfg, &slot, &resource, slot_symbols) == + SRSLTE_SUCCESS); + + // Apply AWGN + srslte_channel_awgn_run_c( + &awgn, slot_symbols, slot_symbols, carrier.nof_prb * SRSLTE_NRE * SRSLTE_NSYMB_PER_SLOT_NR); // Estimate channel - // TESTASSERT(srslte_dmrs_pucch_format1_estimate( - // pucch, &carrier, cfg, &slot, &resource, slot_symbols, chest_res) == - // SRSLTE_SUCCESS); - srslte_chest_ul_res_set_identity(chest_res); + TESTASSERT(srslte_dmrs_pucch_format2_estimate( + pucch, &carrier, cfg, &slot, &resource, slot_symbols, chest_res) == SRSLTE_SUCCESS); + TESTASSERT(fabsf(chest_res->rsrp_dBfs - 0.0f) < 3.0f); + TESTASSERT(fabsf(chest_res->epre_dBfs - 0.0f) < 3.0f); + TESTASSERT(fabsf(chest_res->snr_db - snr_db) < 10.0f); // Decode PUCCH srslte_uci_value_nr_t uci_value_rx = {}; @@ -238,13 +250,14 @@ static void usage(char* prog) printf("\t-c cell id [Default %d]\n", carrier.id); printf("\t-n nof_prb [Default %d]\n", carrier.nof_prb); printf("\t-f format [Default %d]\n", format); + printf("\t-s SNR in dB [Default %.2f]\n", snr_db); printf("\t-v [set verbose to debug, default none]\n"); } static void parse_args(int argc, char** argv) { int opt; - while ((opt = getopt(argc, argv, "cnfv")) != -1) { + while ((opt = getopt(argc, argv, "cnfsv")) != -1) { switch (opt) { case 'c': carrier.id = (uint32_t)strtol(argv[optind], NULL, 10); @@ -255,6 +268,9 @@ static void parse_args(int argc, char** argv) case 'f': format = (int)strtol(argv[optind], NULL, 10); break; + case 's': + snr_db = strtof(argv[optind], NULL); + break; case 'v': srslte_verbose++; break; @@ -297,6 +313,16 @@ int main(int argc, char** argv) goto clean_exit; } + if (srslte_channel_awgn_init(&awgn, 1234) < SRSLTE_SUCCESS) { + ERROR("AWGN init\n"); + goto clean_exit; + } + + if (srslte_channel_awgn_set_n0(&awgn, -snr_db) < SRSLTE_SUCCESS) { + ERROR("AWGN set N0\n"); + goto clean_exit; + } + srslte_pucch_nr_common_cfg_t common_cfg = {}; // Test Format 0 @@ -331,7 +357,7 @@ clean_exit: srslte_pucch_nr_free(&pucch); srslte_chest_ul_res_free(&chest_res); - + srslte_channel_awgn_free(&awgn); srslte_random_free(random_gen); if (ret == SRSLTE_SUCCESS) { From 4fe34b5e5b2463f8a5079f47fb68f32190067727 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 27 Jan 2021 11:50:12 +0100 Subject: [PATCH 138/138] Apply minor comments in NR-PUCCH --- lib/include/srslte/phy/phch/pucch_cfg_nr.h | 2 + lib/include/srslte/phy/phch/pucch_nr.h | 5 -- lib/include/srslte/phy/phch/ra_ul_nr.h | 5 +- lib/include/srslte/phy/phch/uci_cfg_nr.h | 35 ++++++++-- lib/include/srslte/phy/phch/uci_nr.h | 16 ++++- lib/src/phy/phch/pucch_nr.c | 8 +-- lib/src/phy/phch/test/pucch_nr_test.c | 25 +++++--- lib/src/phy/phch/uci_nr.c | 74 +++++++++++++--------- 8 files changed, 113 insertions(+), 57 deletions(-) diff --git a/lib/include/srslte/phy/phch/pucch_cfg_nr.h b/lib/include/srslte/phy/phch/pucch_cfg_nr.h index d7ff1ff85..577198577 100644 --- a/lib/include/srslte/phy/phch/pucch_cfg_nr.h +++ b/lib/include/srslte/phy/phch/pucch_cfg_nr.h @@ -33,6 +33,7 @@ #define SRSLTE_PUCCH_NR_FORMAT1_MIN_NSYMB 4 #define SRSLTE_PUCCH_NR_FORMAT1_MAX_NSYMB 14 #define SRSLTE_PUCCH_NR_FORMAT1_MAX_STARTSYMB 10 +#define SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS 2 /** * NR-PUCCH Format 2 ranges @@ -42,6 +43,7 @@ #define SRSLTE_PUCCH_NR_FORMAT2_MIN_NSYMB 1 #define SRSLTE_PUCCH_NR_FORMAT2_MAX_NSYMB 2 #define SRSLTE_PUCCH_NR_FORMAT2_MAX_STARTSYMB 13 +#define SRSLTE_PUCCH_NR_FORMAT2_MIN_NOF_BITS 3 /** * NR-PUCCH Format 3 ranges diff --git a/lib/include/srslte/phy/phch/pucch_nr.h b/lib/include/srslte/phy/phch/pucch_nr.h index 6ddc1507d..eeeb11418 100644 --- a/lib/include/srslte/phy/phch/pucch_nr.h +++ b/lib/include/srslte/phy/phch/pucch_nr.h @@ -24,11 +24,6 @@ */ #define SRSLTE_PUCCH_NR_FORMAT1_N_MAX 7 -/** - * @brief Maximum number of bit that NR-PUCCH format 1 can carry - */ -#define SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS 2 - typedef struct SRSLTE_API { srslte_uci_nr_args_t uci; uint32_t max_nof_prb; diff --git a/lib/include/srslte/phy/phch/ra_ul_nr.h b/lib/include/srslte/phy/phch/ra_ul_nr.h index 510480d9c..12bc5b1ff 100644 --- a/lib/include/srslte/phy/phch/ra_ul_nr.h +++ b/lib/include/srslte/phy/phch/ra_ul_nr.h @@ -18,8 +18,9 @@ #include "uci_cfg_nr.h" /** - * @brief - * @return + * @brief Calculates the minimum number of PRB required for transmitting NR-PUCCH Format 2, 3 or 4 + * @remark Based in TS 38.213 9.2.5.1 UE procedure for multiplexing HARQ-ACK or CSI and SR in a PUCCH + * @return The number of PRB if the provided configuration is valid, SRSLTE_ERROR code otherwise */ SRSLTE_API int srslte_ra_ul_nr_pucch_format_2_3_min_prb(const srslte_pucch_nr_resource_t* resource, const srslte_uci_cfg_nr_t* uci_cfg); diff --git a/lib/include/srslte/phy/phch/uci_cfg_nr.h b/lib/include/srslte/phy/phch/uci_cfg_nr.h index dc24ec7ba..b87a6c8a2 100644 --- a/lib/include/srslte/phy/phch/uci_cfg_nr.h +++ b/lib/include/srslte/phy/phch/uci_cfg_nr.h @@ -17,26 +17,49 @@ #include #include +/** + * @brief Maximum number of HARQ ACK feedback bits that can be carried in Uplink Control Information (UCI) message + */ #define SRSLTE_UCI_NR_MAX_ACK_BITS 360 + +/** + * @brief Maximum number of Scheduling Request (SR) bits that can be carried in Uplink Control Information (UCI) message + */ #define SRSLTE_UCI_NR_MAX_SR_BITS 10 + +/** + * @brief Maximum number of Channel State Information part 1 (CSI1) bits that can be carried in Uplink Control + * Information (UCI) message + */ #define SRSLTE_UCI_NR_MAX_CSI1_BITS 10 + +/** + * @brief Maximum number of Channel State Information part 2 (CSI2) bits that can be carried in Uplink Control + * Information (UCI) message + */ #define SRSLTE_UCI_NR_MAX_CSI2_BITS 10 +/** + * @brief Uplink Control Information (UCI) message configuration + */ typedef struct SRSLTE_API { uint32_t o_ack; ///< Number of HARQ-ACK bits uint32_t o_sr; ///< Number of SR bits uint32_t o_csi1; ///< Number of CSI1 report number of bits uint32_t o_csi2; ///< Number of CSI2 report number of bits - srslte_mod_t modulation; ///< Modulation + srslte_mod_t modulation; ///< Modulation (PUSCH only) uint16_t rnti; ///< RNTI } srslte_uci_cfg_nr_t; +/** + * @brief Uplink Control Information (UCI) message packed information + */ typedef struct SRSLTE_API { - uint8_t ack[SRSLTE_UCI_NR_MAX_ACK_BITS]; - uint8_t sr[SRSLTE_UCI_NR_MAX_SR_BITS]; - uint8_t csi1[SRSLTE_UCI_NR_MAX_CSI1_BITS]; - uint8_t csi2[SRSLTE_UCI_NR_MAX_CSI2_BITS]; - bool valid; + uint8_t ack[SRSLTE_UCI_NR_MAX_ACK_BITS]; ///< HARQ ACK feedback bits + uint8_t sr[SRSLTE_UCI_NR_MAX_SR_BITS]; ///< Scheduling Request bits + uint8_t csi1[SRSLTE_UCI_NR_MAX_CSI1_BITS]; ///< Channel State Information part 1 + uint8_t csi2[SRSLTE_UCI_NR_MAX_CSI2_BITS]; ///< Channel State Information part 2 + bool valid; ///< Indicates whether the message has been decoded successfully, ignored in the transmitter } srslte_uci_value_nr_t; #endif // SRSLTE_UCI_CFG_NR_H diff --git a/lib/include/srslte/phy/phch/uci_nr.h b/lib/include/srslte/phy/phch/uci_nr.h index fe1000646..df5d68e8f 100644 --- a/lib/include/srslte/phy/phch/uci_nr.h +++ b/lib/include/srslte/phy/phch/uci_nr.h @@ -24,8 +24,12 @@ #include #include +/** + * @brief NR-UCI Encoder/decoder initialization arguments + */ typedef struct { - bool disable_simd; + bool disable_simd; ///< Disable Polar code SIMD + float block_code_threshold; ///< Set normalised block code threshold (receiver only) } srslte_uci_nr_args_t; typedef struct { @@ -40,10 +44,20 @@ typedef struct { uint8_t* c; ///< UCI code-block prior encoding or after decoding uint8_t* allocated; ///< Polar code intermediate uint8_t* d; ///< Polar code encoded intermediate + float block_code_threshold; } srslte_uci_nr_t; +/** + * @brief Calculates the number of bits carried by PUCCH formats 2, 3 and 4 from the PUCCH resource + * @remark Defined in TS 38.212 Table 6.3.1.4-1: Total rate matching output sequence length Etot + * @param resource PUCCH format 2, 3 or 4 Resource provided by upper layers + * @return The number of bits if the provided resource is valid, SRSLTE_ERROR code otherwise + */ +SRSLTE_API int srslte_uci_nr_pucch_format_2_3_4_E(const srslte_pucch_nr_resource_t* resource); + /** * @brief Calculates in advance how many CRC bits will be appended for a given amount of UCI bits (A) + * @remark Defined in TS 38.212 section 6.3.1.2 Code block segmentation and CRC attachment * @param A Number of UCI bits to transmit */ SRSLTE_API uint32_t srslte_uci_nr_crc_len(uint32_t A); diff --git a/lib/src/phy/phch/pucch_nr.c b/lib/src/phy/phch/pucch_nr.c index 4dcbe93c7..cd83f7b33 100644 --- a/lib/src/phy/phch/pucch_nr.c +++ b/lib/src/phy/phch/pucch_nr.c @@ -380,7 +380,7 @@ int srslte_pucch_nr_format1_encode(const srslte_pucch_nr_t* q, return SRSLTE_SUCCESS; } - if (nof_bits > 2) { + if (nof_bits > SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS) { ERROR("Invalid number of bits (%d)\n", nof_bits); return SRSLTE_ERROR; } @@ -458,7 +458,7 @@ int srslte_pucch_nr_format1_decode(srslte_pucch_nr_t* q, return SRSLTE_SUCCESS; } - if (nof_bits > 2) { + if (nof_bits > SRSLTE_PUCCH_NR_FORMAT1_MAX_NOF_BITS) { ERROR("Invalid number of bits (%d)\n", nof_bits); return SRSLTE_ERROR; } @@ -544,7 +544,7 @@ static int pucch_nr_format2_encode(srslte_pucch_nr_t* q, } // Calculate number of encoded symbols - uint32_t E = 16 * resource->nof_symbols * resource->nof_prb; + uint32_t E = srslte_uci_nr_pucch_format_2_3_4_E(resource); // 6.3.2.5.1 Scrambling uint32_t cinit = pucch_nr_format2_cinit(cfg, uci_cfg); @@ -584,7 +584,7 @@ static int pucch_nr_format2_decode(srslte_pucch_nr_t* q, } // Calculate number of encoded symbols - uint32_t E = 16 * resource->nof_symbols * resource->nof_prb; + uint32_t E = srslte_uci_nr_pucch_format_2_3_4_E(resource); // Undo mapping to physical resources uint32_t l_start = resource->start_symbol_idx; diff --git a/lib/src/phy/phch/test/pucch_nr_test.c b/lib/src/phy/phch/test/pucch_nr_test.c index 9f024b008..ad787e2e2 100644 --- a/lib/src/phy/phch/test/pucch_nr_test.c +++ b/lib/src/phy/phch/test/pucch_nr_test.c @@ -34,7 +34,7 @@ static uint32_t starting_prb_stride = 4; static uint32_t starting_symbol_stride = 4; static srslte_random_t random_gen = NULL; static int format = -1; -static float snr_db = 30.0f; +static float snr_db = 20.0f; static srslte_channel_awgn_t awgn = {}; static int test_pucch_format0(srslte_pucch_nr_t* pucch, const srslte_pucch_nr_common_cfg_t* cfg, cf_t* slot_symbols) @@ -176,14 +176,19 @@ static int test_pucch_format2(srslte_pucch_nr_t* pucch, SRSLTE_MIN(SRSLTE_PUCCH_NR_FORMAT2_MAX_STARTSYMB, SRSLTE_NSYMB_PER_SLOT_NR - resource.nof_symbols); resource.start_symbol_idx += starting_symbol_stride) { - // Maximum code rate is reserved - for (resource.max_code_rate = 0; resource.max_code_rate < SRSLTE_PUCCH_NR_MAX_CODE_RATE; - resource.max_code_rate++) { + srslte_uci_cfg_nr_t uci_cfg = {}; - srslte_uci_cfg_nr_t uci_cfg = {}; + for (uci_cfg.o_ack = SRSLTE_PUCCH_NR_FORMAT2_MIN_NOF_BITS; uci_cfg.o_ack <= SRSLTE_UCI_NR_MAX_ACK_BITS; + uci_cfg.o_ack++) { + srslte_uci_value_nr_t uci_value = {}; - for (uci_cfg.o_ack = 12; uci_cfg.o_ack <= SRSLTE_UCI_NR_MAX_ACK_BITS; uci_cfg.o_ack++) { - srslte_uci_value_nr_t uci_value = {}; + // Maximum code rate is reserved + uint32_t max_code_rate_end = SRSLTE_PUCCH_NR_MAX_CODE_RATE; + if (uci_cfg.o_ack == 11) { + max_code_rate_end = SRSLTE_PUCCH_NR_MAX_CODE_RATE - 1; + } + + for (resource.max_code_rate = 0; resource.max_code_rate < max_code_rate_end; resource.max_code_rate++) { // Skip case if not enough PRB are used int min_nof_prb = srslte_ra_ul_nr_pucch_format_2_3_min_prb(&resource, &uci_cfg); @@ -217,9 +222,13 @@ static int test_pucch_format2(srslte_pucch_nr_t* pucch, // Estimate channel TESTASSERT(srslte_dmrs_pucch_format2_estimate( pucch, &carrier, cfg, &slot, &resource, slot_symbols, chest_res) == SRSLTE_SUCCESS); + INFO("RSRP=%+.2f; EPRE=%+.2f; SNR=%+.2f;\n", + chest_res->rsrp_dBfs, + chest_res->epre_dBfs, + chest_res->snr_db); TESTASSERT(fabsf(chest_res->rsrp_dBfs - 0.0f) < 3.0f); TESTASSERT(fabsf(chest_res->epre_dBfs - 0.0f) < 3.0f); - TESTASSERT(fabsf(chest_res->snr_db - snr_db) < 10.0f); + TESTASSERT(fabsf(chest_res->snr_db - snr_db) < 20.0f); // Decode PUCCH srslte_uci_value_nr_t uci_value_rx = {}; diff --git a/lib/src/phy/phch/uci_nr.c b/lib/src/phy/phch/uci_nr.c index a8a433711..cd72c71e1 100644 --- a/lib/src/phy/phch/uci_nr.c +++ b/lib/src/phy/phch/uci_nr.c @@ -26,7 +26,7 @@ #define UCI_NR_POLAR_MAX 2048U #define UCI_NR_POLAR_RM_IBIL 0 #define UCI_NR_PUCCH_POLAR_N_MAX 10 -#define UCI_NR_BLOCK_CORR_THRESHOLD 0.5f +#define UCI_NR_BLOCK_DEFAULT_CORR_THRESHOLD 0.5f uint32_t srslte_uci_nr_crc_len(uint32_t A) { @@ -109,6 +109,12 @@ int srslte_uci_nr_init(srslte_uci_nr_t* q, const srslte_uci_nr_args_t* args) return SRSLTE_ERROR; } + if (isnormal(args->block_code_threshold)) { + q->block_code_threshold = args->block_code_threshold; + } else { + q->block_code_threshold = UCI_NR_BLOCK_DEFAULT_CORR_THRESHOLD; + } + return SRSLTE_SUCCESS; } @@ -410,25 +416,38 @@ static int uci_nr_decode_3_11_bit(srslte_uci_nr_t* q, return SRSLTE_ERROR_INVALID_INPUTS; } - // Compute average LLR power - float pwr = sqrtf(srslte_vec_avg_power_bf(llr, E)); - if (!isnormal(pwr)) { + if (A == 11 && E <= 16) { + ERROR("NR-UCI Impossible to decode A=%d; E=%d\n", A, E); return SRSLTE_ERROR; } - if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { - UCI_NR_INFO_RX("Block decoding NR-UCI llr="); - srslte_vec_fprint_bs(stdout, llr, E); + // Compute average LLR power + float pwr = srslte_vec_avg_power_bf(llr, E); + if (!isnormal(pwr)) { + return SRSLTE_ERROR; } // Decode float corr = (float)srslte_block_decode_i8(llr, E, q->bit_sequence, A); // Normalise correlation - corr /= sqrtf(pwr) * E; + float norm_corr = corr / (sqrtf(pwr) * E); // Take decoded decision with threshold - *decoded_ok = (corr > UCI_NR_BLOCK_CORR_THRESHOLD); + *decoded_ok = (corr > q->block_code_threshold); + + if (SRSLTE_DEBUG_ENABLED && srslte_verbose >= SRSLTE_VERBOSE_INFO && !handler_registered) { + UCI_NR_INFO_RX("Block decoding NR-UCI llr="); + srslte_vec_fprint_bs(stdout, llr, E); + UCI_NR_INFO_RX("Block decoding NR-UCI A=%d; E=%d; pwr=%f; corr=%f; norm=%f; thr=%f; %s\n", + A, + E, + pwr, + corr, + norm_corr, + q->block_code_threshold, + *decoded_ok ? "OK" : "KO"); + } return SRSLTE_SUCCESS; } @@ -687,38 +706,31 @@ static int uci_nr_decode(srslte_uci_nr_t* q, return SRSLTE_SUCCESS; } -// Implements TS 38.212 Table 6.3.1.4-1: Total rate matching output sequence length Etot -static int uci_nr_pucch_E_tot(const srslte_pucch_nr_resource_t* pucch_cfg, const srslte_uci_cfg_nr_t* uci_cfg) +int srslte_uci_nr_pucch_format_2_3_4_E(const srslte_pucch_nr_resource_t* resource) { - if (pucch_cfg == NULL || uci_cfg == NULL) { + if (resource == NULL) { return SRSLTE_ERROR_INVALID_INPUTS; } - switch (pucch_cfg->format) { + switch (resource->format) { case SRSLTE_PUCCH_NR_FORMAT_2: - return (int)(16 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); + return (int)(16 * resource->nof_symbols * resource->nof_prb); case SRSLTE_PUCCH_NR_FORMAT_3: - if (uci_cfg->modulation == SRSLTE_MOD_QPSK) { - return (int)(24 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); + if (!resource->enable_pi_bpsk) { + return (int)(24 * resource->nof_symbols * resource->nof_prb); } - if (uci_cfg->modulation == SRSLTE_MOD_BPSK) { - return (int)(12 * pucch_cfg->nof_symbols * pucch_cfg->nof_prb); - } - break; + return (int)(12 * resource->nof_symbols * resource->nof_prb); case SRSLTE_PUCCH_NR_FORMAT_4: - if (pucch_cfg->occ_lenth != 1 && pucch_cfg->occ_lenth != 2) { - ERROR("Invalid spreading factor (%d)\n", pucch_cfg->occ_lenth); + if (resource->occ_lenth != 1 && resource->occ_lenth != 2) { + ERROR("Invalid spreading factor (%d)\n", resource->occ_lenth); return SRSLTE_ERROR; } - if (uci_cfg->modulation == SRSLTE_MOD_QPSK) { - return (int)(24 * pucch_cfg->nof_symbols / pucch_cfg->occ_lenth); - } - if (uci_cfg->modulation == SRSLTE_MOD_BPSK) { - return (int)(12 * pucch_cfg->nof_symbols / pucch_cfg->occ_lenth); + if (!resource->enable_pi_bpsk) { + return (int)(24 * resource->nof_symbols / resource->occ_lenth); } - break; + return (int)(12 * resource->nof_symbols / resource->occ_lenth); default: - return SRSLTE_ERROR; + ERROR("Invalid case\n"); } return SRSLTE_ERROR; } @@ -741,7 +753,7 @@ int srslte_uci_nr_encode_pucch(srslte_uci_nr_t* q, const srslte_uci_value_nr_t* value, uint8_t* o) { - int E_tot = uci_nr_pucch_E_tot(pucch_resource_cfg, uci_cfg); + int E_tot = srslte_uci_nr_pucch_format_2_3_4_E(pucch_resource_cfg); if (E_tot < SRSLTE_SUCCESS) { ERROR("Error calculating number of bits\n"); return SRSLTE_ERROR; @@ -762,7 +774,7 @@ int srslte_uci_nr_decode_pucch(srslte_uci_nr_t* q, int8_t* llr, srslte_uci_value_nr_t* value) { - int E_tot = uci_nr_pucch_E_tot(pucch_resource_cfg, uci_cfg); + int E_tot = srslte_uci_nr_pucch_format_2_3_4_E(pucch_resource_cfg); if (E_tot < SRSLTE_SUCCESS) { return SRSLTE_ERROR; }