/*
 * Copyright 2013-2020 Software Radio Systems Limited
 *
 * This file is part of srsLTE.
 *
 * srsLTE is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * srsLTE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * A copy of the GNU Affero General Public License can be found in
 * the LICENSE file in the top-level directory of this distribution
 * and at http://www.gnu.org/licenses/.
 *
 */

#include "srslte/asn1/rrc_asn1.h"
#include <sstream>

using namespace asn1;
using namespace asn1::rrc;

/*******************************************************************************
 *                              Logging Utilities
 ******************************************************************************/

void asn1::rrc::log_invalid_access_choice_id(uint32_t val, uint32_t choice_id)
{
  asn1::log_error("The access choice id is invalid (%d!=%d)\n", val, choice_id);
}

void asn1::rrc::assert_choice_type(uint32_t val, uint32_t choice_id)
{
  if (val != choice_id) {
    log_invalid_access_choice_id(val, choice_id);
  }
}

void asn1::rrc::assert_choice_type(const std::string& access_type,
                                   const std::string& current_type,
                                   const std::string& choice_type)
{
  if (access_type != current_type) {
    asn1::log_error("Invalid field access for choice type \"%s\" (\"%s\"!=\"%s\")\n",
                    choice_type.c_str(),
                    access_type.c_str(),
                    current_type.c_str());
  }
}

const char*
asn1::rrc::convert_enum_idx(const char* array[], uint32_t nof_types, uint32_t enum_val, const char* enum_type)
{
  if (enum_val >= nof_types) {
    if (enum_val == nof_types) {
      asn1::log_error("The enum of type %s was not initialized.\n", enum_type);
    } else {
      asn1::log_error("The enum value=%d of type %s is not valid.\n", enum_val, enum_type);
    }
    return "";
  }
  return array[enum_val];
}

template <class ItemType>
ItemType asn1::rrc::map_enum_number(ItemType* array, uint32_t nof_types, uint32_t enum_val, const char* enum_type)
{
  if (enum_val >= nof_types) {
    if (enum_val == nof_types) {
      asn1::log_error("The enum of type %s is not initialized.\n", enum_type);
    } else {
      asn1::log_error("The enum value=%d of type %s cannot be converted to a number.\n", enum_val, enum_type);
    }
    return 0;
  }
  return array[enum_val];
}
template const uint8_t  asn1::rrc::map_enum_number<const uint8_t>(const uint8_t* array,
                                                                 uint32_t       nof_types,
                                                                 uint32_t       enum_val,
                                                                 const char*    enum_type);
template const uint16_t asn1::rrc::map_enum_number<const uint16_t>(const uint16_t* array,
                                                                   uint32_t        nof_types,
                                                                   uint32_t        enum_val,
                                                                   const char*     enum_type);
template const uint32_t asn1::rrc::map_enum_number<const uint32_t>(const uint32_t* array,
                                                                   uint32_t        nof_types,
                                                                   uint32_t        enum_val,
                                                                   const char*     enum_type);
template const uint64_t asn1::rrc::map_enum_number<const uint64_t>(const uint64_t* array,
                                                                   uint32_t        nof_types,
                                                                   uint32_t        enum_val,
                                                                   const char*     enum_type);
template const int8_t   asn1::rrc::map_enum_number<const int8_t>(const int8_t* array,
                                                               uint32_t      nof_types,
                                                               uint32_t      enum_val,
                                                               const char*   enum_type);
template const int16_t  asn1::rrc::map_enum_number<const int16_t>(const int16_t* array,
                                                                 uint32_t       nof_types,
                                                                 uint32_t       enum_val,
                                                                 const char*    enum_type);
template const int32_t  asn1::rrc::map_enum_number<const int32_t>(const int32_t* array,
                                                                 uint32_t       nof_types,
                                                                 uint32_t       enum_val,
                                                                 const char*    enum_type);
template const int64_t  asn1::rrc::map_enum_number<const int64_t>(const int64_t* array,
                                                                 uint32_t       nof_types,
                                                                 uint32_t       enum_val,
                                                                 const char*    enum_type);
template const float    asn1::rrc::map_enum_number<const float>(const float* array,
                                                             uint32_t     nof_types,
                                                             uint32_t     enum_val,
                                                             const char*  enum_type);

void rrc_asn1_warn_assert(bool cond, const char* filename, int lineno)
{
  if (cond) {
    asn1::log_warning("Assertion in [%s][%d] failed.\n", filename, lineno);
  }
}
static void log_invalid_choice_id(uint32_t val, const char* choice_type)
{
  asn1::log_error("Invalid choice id=%d for choice type %s\n", val, choice_type);
}

/*******************************************************************************
 *                                Struct Methods
 ******************************************************************************/

// PHICH-Config ::= SEQUENCE
SRSASN_CODE phich_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(phich_dur.pack(bref));
  HANDLE_CODE(phich_res.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE phich_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(phich_dur.unpack(bref));
  HANDLE_CODE(phich_res.unpack(bref));

  return SRSASN_SUCCESS;
}
void phich_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("phich-Duration", phich_dur.to_string());
  j.write_str("phich-Resource", phich_res.to_string());
  j.end_obj();
}

// MasterInformationBlock ::= SEQUENCE
SRSASN_CODE mib_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(dl_bw.pack(bref));
  HANDLE_CODE(phich_cfg.pack(bref));
  HANDLE_CODE(sys_frame_num.pack(bref));
  HANDLE_CODE(pack_integer(bref, sched_info_sib1_br_r13, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(bref.pack(sys_info_unchanged_br_r15, 1));
  HANDLE_CODE(spare.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mib_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(dl_bw.unpack(bref));
  HANDLE_CODE(phich_cfg.unpack(bref));
  HANDLE_CODE(sys_frame_num.unpack(bref));
  HANDLE_CODE(unpack_integer(sched_info_sib1_br_r13, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(bref.unpack(sys_info_unchanged_br_r15, 1));
  HANDLE_CODE(spare.unpack(bref));

  return SRSASN_SUCCESS;
}
void mib_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("dl-Bandwidth", dl_bw.to_string());
  j.write_fieldname("phich-Config");
  phich_cfg.to_json(j);
  j.write_str("systemFrameNumber", sys_frame_num.to_string());
  j.write_int("schedulingInfoSIB1-BR-r13", sched_info_sib1_br_r13);
  j.write_bool("systemInfoUnchanged-BR-r15", sys_info_unchanged_br_r15);
  j.write_str("spare", spare.to_string());
  j.end_obj();
}

// BCCH-BCH-Message ::= SEQUENCE
SRSASN_CODE bcch_bch_msg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE bcch_bch_msg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void bcch_bch_msg_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("BCCH-BCH-Message");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// MasterInformationBlock-MBMS-r14 ::= SEQUENCE
SRSASN_CODE mib_mbms_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(dl_bw_mbms_r14.pack(bref));
  HANDLE_CODE(sys_frame_num_r14.pack(bref));
  HANDLE_CODE(pack_integer(bref, add_non_mbsfn_sfs_r14, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(spare.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mib_mbms_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(dl_bw_mbms_r14.unpack(bref));
  HANDLE_CODE(sys_frame_num_r14.unpack(bref));
  HANDLE_CODE(unpack_integer(add_non_mbsfn_sfs_r14, bref, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(spare.unpack(bref));

  return SRSASN_SUCCESS;
}
void mib_mbms_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("dl-Bandwidth-MBMS-r14", dl_bw_mbms_r14.to_string());
  j.write_str("systemFrameNumber-r14", sys_frame_num_r14.to_string());
  j.write_int("additionalNonMBSFNSubframes-r14", add_non_mbsfn_sfs_r14);
  j.write_str("spare", spare.to_string());
  j.end_obj();
}

// BCCH-BCH-Message-MBMS ::= SEQUENCE
SRSASN_CODE bcch_bch_msg_mbms_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE bcch_bch_msg_mbms_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void bcch_bch_msg_mbms_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("BCCH-BCH-Message-MBMS");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// GNSS-ID-r15 ::= SEQUENCE
SRSASN_CODE gnss_id_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(gnss_id_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE gnss_id_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(gnss_id_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void gnss_id_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("gnss-id-r15", gnss_id_r15.to_string());
  j.end_obj();
}

// SBAS-ID-r15 ::= SEQUENCE
SRSASN_CODE sbas_id_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(sbas_id_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sbas_id_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(sbas_id_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void sbas_id_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sbas-id-r15", sbas_id_r15.to_string());
  j.end_obj();
}

// PLMN-Identity ::= SEQUENCE
SRSASN_CODE plmn_id_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mcc_present, 1));

  if (mcc_present) {
    HANDLE_CODE(pack_fixed_seq_of(bref, &(mcc)[0], mcc.size(), integer_packer<uint8_t>(0, 9)));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, mnc, 2, 3, integer_packer<uint8_t>(0, 9)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_id_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mcc_present, 1));

  if (mcc_present) {
    HANDLE_CODE(unpack_fixed_seq_of(&(mcc)[0], bref, mcc.size(), integer_packer<uint8_t>(0, 9)));
  }
  HANDLE_CODE(unpack_dyn_seq_of(mnc, bref, 2, 3, integer_packer<uint8_t>(0, 9)));

  return SRSASN_SUCCESS;
}
void plmn_id_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mcc_present) {
    j.start_array("mcc");
    for (const auto& e1 : mcc) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.start_array("mnc");
  for (const auto& e1 : mnc) {
    j.write_int(e1);
  }
  j.end_array();
  j.end_obj();
}

// PosSIB-Type-r15 ::= SEQUENCE
SRSASN_CODE pos_sib_type_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(encrypted_r15_present, 1));
  HANDLE_CODE(bref.pack(gnss_id_r15_present, 1));
  HANDLE_CODE(bref.pack(sbas_id_r15_present, 1));

  if (gnss_id_r15_present) {
    HANDLE_CODE(gnss_id_r15.pack(bref));
  }
  if (sbas_id_r15_present) {
    HANDLE_CODE(sbas_id_r15.pack(bref));
  }
  HANDLE_CODE(pos_sib_type_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pos_sib_type_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(encrypted_r15_present, 1));
  HANDLE_CODE(bref.unpack(gnss_id_r15_present, 1));
  HANDLE_CODE(bref.unpack(sbas_id_r15_present, 1));

  if (gnss_id_r15_present) {
    HANDLE_CODE(gnss_id_r15.unpack(bref));
  }
  if (sbas_id_r15_present) {
    HANDLE_CODE(sbas_id_r15.unpack(bref));
  }
  HANDLE_CODE(pos_sib_type_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void pos_sib_type_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (encrypted_r15_present) {
    j.write_str("encrypted-r15", "true");
  }
  if (gnss_id_r15_present) {
    j.write_fieldname("gnss-id-r15");
    gnss_id_r15.to_json(j);
  }
  if (sbas_id_r15_present) {
    j.write_fieldname("sbas-id-r15");
    sbas_id_r15.to_json(j);
  }
  j.write_str("posSibType-r15", pos_sib_type_r15.to_string());
  j.end_obj();
}

// PLMN-IdentityInfo-r15 ::= SEQUENCE
SRSASN_CODE plmn_id_info_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(plmn_id_minus5_gc_r15.pack(bref));
  HANDLE_CODE(cell_reserved_for_oper_r15.pack(bref));
  HANDLE_CODE(cell_reserved_for_oper_crs_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_id_info_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(plmn_id_minus5_gc_r15.unpack(bref));
  HANDLE_CODE(cell_reserved_for_oper_r15.unpack(bref));
  HANDLE_CODE(cell_reserved_for_oper_crs_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void plmn_id_info_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("plmn-Identity-5GC-r15");
  plmn_id_minus5_gc_r15.to_json(j);
  j.write_str("cellReservedForOperatorUse-r15", cell_reserved_for_oper_r15.to_string());
  j.write_str("cellReservedForOperatorUse-CRS-r15", cell_reserved_for_oper_crs_r15.to_string());
  j.end_obj();
}

void plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_::destroy_()
{
  switch (type_) {
    case types::plmn_id_r15:
      c.destroy<plmn_id_s>();
      break;
    default:
      break;
  }
}
void plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::plmn_id_r15:
      c.init<plmn_id_s>();
      break;
    case types::plmn_idx_r15:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_");
  }
}
plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_::plmn_id_minus5_gc_r15_c_(
    const plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::plmn_id_r15:
      c.init(other.c.get<plmn_id_s>());
      break;
    case types::plmn_idx_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_");
  }
}
plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_& plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_::
                                              operator=(const plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::plmn_id_r15:
      c.set(other.c.get<plmn_id_s>());
      break;
    case types::plmn_idx_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_");
  }

  return *this;
}
void plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::plmn_id_r15:
      j.write_fieldname("plmn-Identity-r15");
      c.get<plmn_id_s>().to_json(j);
      break;
    case types::plmn_idx_r15:
      j.write_int("plmn-Index-r15", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::plmn_id_r15:
      HANDLE_CODE(c.get<plmn_id_s>().pack(bref));
      break;
    case types::plmn_idx_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)6u));
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::plmn_id_r15:
      HANDLE_CODE(c.get<plmn_id_s>().unpack(bref));
      break;
    case types::plmn_idx_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)6u));
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info_r15_s::plmn_id_minus5_gc_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CellIdentity-5GC-r15 ::= CHOICE
void cell_id_minus5_gc_r15_c::destroy_()
{
  switch (type_) {
    case types::cell_id_r15:
      c.destroy<fixed_bitstring<28> >();
      break;
    default:
      break;
  }
}
void cell_id_minus5_gc_r15_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cell_id_r15:
      c.init<fixed_bitstring<28> >();
      break;
    case types::cell_id_idx_r15:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cell_id_minus5_gc_r15_c");
  }
}
cell_id_minus5_gc_r15_c::cell_id_minus5_gc_r15_c(const cell_id_minus5_gc_r15_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cell_id_r15:
      c.init(other.c.get<fixed_bitstring<28> >());
      break;
    case types::cell_id_idx_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cell_id_minus5_gc_r15_c");
  }
}
cell_id_minus5_gc_r15_c& cell_id_minus5_gc_r15_c::operator=(const cell_id_minus5_gc_r15_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cell_id_r15:
      c.set(other.c.get<fixed_bitstring<28> >());
      break;
    case types::cell_id_idx_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cell_id_minus5_gc_r15_c");
  }

  return *this;
}
void cell_id_minus5_gc_r15_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cell_id_r15:
      j.write_str("cellIdentity-r15", c.get<fixed_bitstring<28> >().to_string());
      break;
    case types::cell_id_idx_r15:
      j.write_int("cellId-Index-r15", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "cell_id_minus5_gc_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE cell_id_minus5_gc_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cell_id_r15:
      HANDLE_CODE(c.get<fixed_bitstring<28> >().pack(bref));
      break;
    case types::cell_id_idx_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)6u));
      break;
    default:
      log_invalid_choice_id(type_, "cell_id_minus5_gc_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_id_minus5_gc_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cell_id_r15:
      HANDLE_CODE(c.get<fixed_bitstring<28> >().unpack(bref));
      break;
    case types::cell_id_idx_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)6u));
      break;
    default:
      log_invalid_choice_id(type_, "cell_id_minus5_gc_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PLMN-IdentityInfo-v1530 ::= SEQUENCE
SRSASN_CODE plmn_id_info_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cell_reserved_for_oper_crs_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_id_info_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(cell_reserved_for_oper_crs_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void plmn_id_info_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cellReservedForOperatorUse-CRS-r15", cell_reserved_for_oper_crs_r15.to_string());
  j.end_obj();
}

// PosSchedulingInfo-r15 ::= SEQUENCE
SRSASN_CODE pos_sched_info_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pos_si_periodicity_r15.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, pos_sib_map_info_r15, 1, 32));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pos_sched_info_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(pos_si_periodicity_r15.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(pos_sib_map_info_r15, bref, 1, 32));

  return SRSASN_SUCCESS;
}
void pos_sched_info_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("posSI-Periodicity-r15", pos_si_periodicity_r15.to_string());
  j.start_array("posSIB-MappingInfo-r15");
  for (const auto& e1 : pos_sib_map_info_r15) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// CellAccessRelatedInfo-5GC-r15 ::= SEQUENCE
SRSASN_CODE cell_access_related_info_minus5_gc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ran_area_code_r15_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r15, 1, 6));
  if (ran_area_code_r15_present) {
    HANDLE_CODE(pack_integer(bref, ran_area_code_r15, (uint16_t)0u, (uint16_t)255u));
  }
  HANDLE_CODE(tac_minus5_gc_r15.pack(bref));
  HANDLE_CODE(cell_id_minus5_gc_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_access_related_info_minus5_gc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ran_area_code_r15_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r15, bref, 1, 6));
  if (ran_area_code_r15_present) {
    HANDLE_CODE(unpack_integer(ran_area_code_r15, bref, (uint16_t)0u, (uint16_t)255u));
  }
  HANDLE_CODE(tac_minus5_gc_r15.unpack(bref));
  HANDLE_CODE(cell_id_minus5_gc_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_access_related_info_minus5_gc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("plmn-IdentityList-r15");
  for (const auto& e1 : plmn_id_list_r15) {
    e1.to_json(j);
  }
  j.end_array();
  if (ran_area_code_r15_present) {
    j.write_int("ran-AreaCode-r15", ran_area_code_r15);
  }
  j.write_str("trackingAreaCode-5GC-r15", tac_minus5_gc_r15.to_string());
  j.write_fieldname("cellIdentity-5GC-r15");
  cell_id_minus5_gc_r15.to_json(j);
  j.end_obj();
}

// CellSelectionInfoCE-v1530 ::= SEQUENCE
SRSASN_CODE cell_sel_info_ce_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pwr_class14dbm_offset_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_sel_info_ce_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(pwr_class14dbm_offset_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_sel_info_ce_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("powerClass14dBm-Offset-r15", pwr_class14dbm_offset_r15.to_string());
  j.end_obj();
}

// MCS-PSSCH-Range-r15 ::= SEQUENCE
SRSASN_CODE mcs_pssch_range_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, min_mcs_pssch_r15, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, max_mcs_pssch_r15, (uint8_t)0u, (uint8_t)31u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mcs_pssch_range_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(min_mcs_pssch_r15, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(max_mcs_pssch_r15, bref, (uint8_t)0u, (uint8_t)31u));

  return SRSASN_SUCCESS;
}
void mcs_pssch_range_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("minMCS-PSSCH-r15", min_mcs_pssch_r15);
  j.write_int("maxMCS-PSSCH-r15", max_mcs_pssch_r15);
  j.end_obj();
}

// PLMN-IdentityInfo ::= SEQUENCE
SRSASN_CODE plmn_id_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(plmn_id.pack(bref));
  HANDLE_CODE(cell_reserved_for_oper.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_id_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(plmn_id.unpack(bref));
  HANDLE_CODE(cell_reserved_for_oper.unpack(bref));

  return SRSASN_SUCCESS;
}
void plmn_id_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("plmn-Identity");
  plmn_id.to_json(j);
  j.write_str("cellReservedForOperatorUse", cell_reserved_for_oper.to_string());
  j.end_obj();
}

// SL-TxPower-r14 ::= CHOICE
void sl_tx_pwr_r14_c::set(types::options e)
{
  type_ = e;
}
void sl_tx_pwr_r14_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::minusinfinity_r14:
      break;
    case types::tx_pwr_r14:
      j.write_int("txPower-r14", c);
      break;
    default:
      log_invalid_choice_id(type_, "sl_tx_pwr_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE sl_tx_pwr_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::minusinfinity_r14:
      break;
    case types::tx_pwr_r14:
      HANDLE_CODE(pack_integer(bref, c, (int8_t)-41, (int8_t)31));
      break;
    default:
      log_invalid_choice_id(type_, "sl_tx_pwr_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_tx_pwr_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::minusinfinity_r14:
      break;
    case types::tx_pwr_r14:
      HANDLE_CODE(unpack_integer(c, bref, (int8_t)-41, (int8_t)31));
      break;
    default:
      log_invalid_choice_id(type_, "sl_tx_pwr_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-MinT2Value-r15 ::= SEQUENCE
SRSASN_CODE sl_min_t2_value_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, prio_list_r15, 1, 8, integer_packer<uint8_t>(1, 8)));
  HANDLE_CODE(pack_integer(bref, min_t2_value_r15, (uint8_t)10u, (uint8_t)20u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_min_t2_value_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(prio_list_r15, bref, 1, 8, integer_packer<uint8_t>(1, 8)));
  HANDLE_CODE(unpack_integer(min_t2_value_r15, bref, (uint8_t)10u, (uint8_t)20u));

  return SRSASN_SUCCESS;
}
void sl_min_t2_value_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("priorityList-r15");
  for (const auto& e1 : prio_list_r15) {
    j.write_int(e1);
  }
  j.end_array();
  j.write_int("minT2Value-r15", min_t2_value_r15);
  j.end_obj();
}

// SL-PPPP-TxConfigIndex-r14 ::= SEQUENCE
SRSASN_CODE sl_pppp_tx_cfg_idx_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, prio_thres_r14, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(pack_integer(bref, default_tx_cfg_idx_r14, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(pack_integer(bref, cbr_cfg_idx_r14, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(pack_dyn_seq_of(bref, tx_cfg_idx_list_r14, 1, 16, integer_packer<uint8_t>(0, 63)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pppp_tx_cfg_idx_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(prio_thres_r14, bref, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(unpack_integer(default_tx_cfg_idx_r14, bref, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(unpack_integer(cbr_cfg_idx_r14, bref, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(unpack_dyn_seq_of(tx_cfg_idx_list_r14, bref, 1, 16, integer_packer<uint8_t>(0, 63)));

  return SRSASN_SUCCESS;
}
void sl_pppp_tx_cfg_idx_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("priorityThreshold-r14", prio_thres_r14);
  j.write_int("defaultTxConfigIndex-r14", default_tx_cfg_idx_r14);
  j.write_int("cbr-ConfigIndex-r14", cbr_cfg_idx_r14);
  j.start_array("tx-ConfigIndexList-r14");
  for (const auto& e1 : tx_cfg_idx_list_r14) {
    j.write_int(e1);
  }
  j.end_array();
  j.end_obj();
}

// SL-PPPP-TxConfigIndex-v1530 ::= SEQUENCE
SRSASN_CODE sl_pppp_tx_cfg_idx_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mcs_pssch_range_list_r15_present, 1));

  if (mcs_pssch_range_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mcs_pssch_range_list_r15, 1, 16));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pppp_tx_cfg_idx_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mcs_pssch_range_list_r15_present, 1));

  if (mcs_pssch_range_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mcs_pssch_range_list_r15, bref, 1, 16));
  }

  return SRSASN_SUCCESS;
}
void sl_pppp_tx_cfg_idx_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mcs_pssch_range_list_r15_present) {
    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();
}

// SL-PSSCH-TxParameters-r14 ::= SEQUENCE
SRSASN_CODE sl_pssch_tx_params_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(max_tx_pwr_r14_present, 1));

  HANDLE_CODE(pack_integer(bref, min_mcs_pssch_r14, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, max_mcs_pssch_r14, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, min_sub_ch_num_pssch_r14, (uint8_t)1u, (uint8_t)20u));
  HANDLE_CODE(pack_integer(bref, max_subch_num_pssch_r14, (uint8_t)1u, (uint8_t)20u));
  HANDLE_CODE(allowed_retx_num_pssch_r14.pack(bref));
  if (max_tx_pwr_r14_present) {
    HANDLE_CODE(max_tx_pwr_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pssch_tx_params_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(max_tx_pwr_r14_present, 1));

  HANDLE_CODE(unpack_integer(min_mcs_pssch_r14, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(max_mcs_pssch_r14, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(min_sub_ch_num_pssch_r14, bref, (uint8_t)1u, (uint8_t)20u));
  HANDLE_CODE(unpack_integer(max_subch_num_pssch_r14, bref, (uint8_t)1u, (uint8_t)20u));
  HANDLE_CODE(allowed_retx_num_pssch_r14.unpack(bref));
  if (max_tx_pwr_r14_present) {
    HANDLE_CODE(max_tx_pwr_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_pssch_tx_params_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("minMCS-PSSCH-r14", min_mcs_pssch_r14);
  j.write_int("maxMCS-PSSCH-r14", max_mcs_pssch_r14);
  j.write_int("minSubChannel-NumberPSSCH-r14", min_sub_ch_num_pssch_r14);
  j.write_int("maxSubchannel-NumberPSSCH-r14", max_subch_num_pssch_r14);
  j.write_str("allowedRetxNumberPSSCH-r14", allowed_retx_num_pssch_r14.to_string());
  if (max_tx_pwr_r14_present) {
    j.write_fieldname("maxTxPower-r14");
    max_tx_pwr_r14.to_json(j);
  }
  j.end_obj();
}

// SL-PSSCH-TxParameters-v1530 ::= SEQUENCE
SRSASN_CODE sl_pssch_tx_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, min_mcs_pssch_r15, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, max_mcs_pssch_r15, (uint8_t)0u, (uint8_t)31u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pssch_tx_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(min_mcs_pssch_r15, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(max_mcs_pssch_r15, bref, (uint8_t)0u, (uint8_t)31u));

  return SRSASN_SUCCESS;
}
void sl_pssch_tx_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("minMCS-PSSCH-r15", min_mcs_pssch_r15);
  j.write_int("maxMCS-PSSCH-r15", max_mcs_pssch_r15);
  j.end_obj();
}

// SystemInformationBlockType1-v1530-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(hsdn_cell_r15_present, 1));
  HANDLE_CODE(bref.pack(cell_sel_info_ce_v1530_present, 1));
  HANDLE_CODE(bref.pack(crs_intf_mitig_cfg_r15_present, 1));
  HANDLE_CODE(bref.pack(plmn_id_list_v1530_present, 1));
  HANDLE_CODE(bref.pack(pos_sched_info_list_r15_present, 1));
  HANDLE_CODE(bref.pack(cell_access_related_info_minus5_gc_r15_present, 1));
  HANDLE_CODE(bref.pack(ims_emergency_support5_gc_r15_present, 1));
  HANDLE_CODE(bref.pack(ecall_over_ims_support5_gc_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (cell_sel_info_ce_v1530_present) {
    HANDLE_CODE(cell_sel_info_ce_v1530.pack(bref));
  }
  if (crs_intf_mitig_cfg_r15_present) {
    HANDLE_CODE(crs_intf_mitig_cfg_r15.pack(bref));
  }
  HANDLE_CODE(cell_barred_crs_r15.pack(bref));
  if (plmn_id_list_v1530_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_v1530, 1, 6));
  }
  if (pos_sched_info_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, pos_sched_info_list_r15, 1, 32));
  }
  if (cell_access_related_info_minus5_gc_r15_present) {
    HANDLE_CODE(cell_access_related_info_minus5_gc_r15.cell_barred_minus5_gc_r15.pack(bref));
    HANDLE_CODE(cell_access_related_info_minus5_gc_r15.cell_barred_minus5_gc_crs_r15.pack(bref));
    HANDLE_CODE(pack_dyn_seq_of(
        bref, cell_access_related_info_minus5_gc_r15.cell_access_related_info_list_minus5_gc_r15, 1, 6));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(hsdn_cell_r15_present, 1));
  HANDLE_CODE(bref.unpack(cell_sel_info_ce_v1530_present, 1));
  HANDLE_CODE(bref.unpack(crs_intf_mitig_cfg_r15_present, 1));
  HANDLE_CODE(bref.unpack(plmn_id_list_v1530_present, 1));
  HANDLE_CODE(bref.unpack(pos_sched_info_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(cell_access_related_info_minus5_gc_r15_present, 1));
  HANDLE_CODE(bref.unpack(ims_emergency_support5_gc_r15_present, 1));
  HANDLE_CODE(bref.unpack(ecall_over_ims_support5_gc_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (cell_sel_info_ce_v1530_present) {
    HANDLE_CODE(cell_sel_info_ce_v1530.unpack(bref));
  }
  if (crs_intf_mitig_cfg_r15_present) {
    HANDLE_CODE(crs_intf_mitig_cfg_r15.unpack(bref));
  }
  HANDLE_CODE(cell_barred_crs_r15.unpack(bref));
  if (plmn_id_list_v1530_present) {
    HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_v1530, bref, 1, 6));
  }
  if (pos_sched_info_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(pos_sched_info_list_r15, bref, 1, 32));
  }
  if (cell_access_related_info_minus5_gc_r15_present) {
    HANDLE_CODE(cell_access_related_info_minus5_gc_r15.cell_barred_minus5_gc_r15.unpack(bref));
    HANDLE_CODE(cell_access_related_info_minus5_gc_r15.cell_barred_minus5_gc_crs_r15.unpack(bref));
    HANDLE_CODE(unpack_dyn_seq_of(
        cell_access_related_info_minus5_gc_r15.cell_access_related_info_list_minus5_gc_r15, bref, 1, 6));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (hsdn_cell_r15_present) {
    j.write_str("hsdn-Cell-r15", "true");
  }
  if (cell_sel_info_ce_v1530_present) {
    j.write_fieldname("cellSelectionInfoCE-v1530");
    cell_sel_info_ce_v1530.to_json(j);
  }
  if (crs_intf_mitig_cfg_r15_present) {
    j.write_fieldname("crs-IntfMitigConfig-r15");
    crs_intf_mitig_cfg_r15.to_json(j);
  }
  j.write_str("cellBarred-CRS-r15", cell_barred_crs_r15.to_string());
  if (plmn_id_list_v1530_present) {
    j.start_array("plmn-IdentityList-v1530");
    for (const auto& e1 : plmn_id_list_v1530) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (pos_sched_info_list_r15_present) {
    j.start_array("posSchedulingInfoList-r15");
    for (const auto& e1 : pos_sched_info_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (cell_access_related_info_minus5_gc_r15_present) {
    j.write_fieldname("cellAccessRelatedInfo-5GC-r15");
    j.start_obj();
    j.write_str("cellBarred-5GC-r15", cell_access_related_info_minus5_gc_r15.cell_barred_minus5_gc_r15.to_string());
    j.write_str("cellBarred-5GC-CRS-r15",
                cell_access_related_info_minus5_gc_r15.cell_barred_minus5_gc_crs_r15.to_string());
    j.start_array("cellAccessRelatedInfoList-5GC-r15");
    for (const auto& e1 : cell_access_related_info_minus5_gc_r15.cell_access_related_info_list_minus5_gc_r15) {
      e1.to_json(j);
    }
    j.end_array();
    j.end_obj();
  }
  if (ims_emergency_support5_gc_r15_present) {
    j.write_str("ims-EmergencySupport5GC-r15", "true");
  }
  if (ecall_over_ims_support5_gc_r15_present) {
    j.write_str("eCallOverIMS-Support5GC-r15", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

void sib_type1_v1530_ies_s::crs_intf_mitig_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void sib_type1_v1530_ies_s::crs_intf_mitig_cfg_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::crs_intf_mitig_enabled_minus15:
      break;
    case types::crs_intf_mitig_num_prbs_r15:
      j.write_str("crs-IntfMitigNumPRBs-r15", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "sib_type1_v1530_ies_s::crs_intf_mitig_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE sib_type1_v1530_ies_s::crs_intf_mitig_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::crs_intf_mitig_enabled_minus15:
      break;
    case types::crs_intf_mitig_num_prbs_r15:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sib_type1_v1530_ies_s::crs_intf_mitig_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1530_ies_s::crs_intf_mitig_cfg_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::crs_intf_mitig_enabled_minus15:
      break;
    case types::crs_intf_mitig_num_prbs_r15:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sib_type1_v1530_ies_s::crs_intf_mitig_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// TDD-Config-v1450 ::= SEQUENCE
SRSASN_CODE tdd_cfg_v1450_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE tdd_cfg_v1450_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void tdd_cfg_v1450_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("specialSubframePatterns-v1450", "ssp10-CRS-LessDwPTS");
  j.end_obj();
}

// CellAccessRelatedInfo-r14 ::= SEQUENCE
SRSASN_CODE cell_access_related_info_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r14, 1, 6));
  HANDLE_CODE(tac_r14.pack(bref));
  HANDLE_CODE(cell_id_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_access_related_info_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r14, bref, 1, 6));
  HANDLE_CODE(tac_r14.unpack(bref));
  HANDLE_CODE(cell_id_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_access_related_info_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("plmn-IdentityList-r14");
  for (const auto& e1 : plmn_id_list_r14) {
    e1.to_json(j);
  }
  j.end_array();
  j.write_str("trackingAreaCode-r14", tac_r14.to_string());
  j.write_str("cellIdentity-r14", cell_id_r14.to_string());
  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();
}

// NS-PmaxValue-v10l0 ::= SEQUENCE
SRSASN_CODE ns_pmax_value_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 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 SRSASN_SUCCESS;
}
void ns_pmax_value_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();
}

// SL-OffsetIndicator-r12 ::= CHOICE
void sl_offset_ind_r12_c::destroy_() {}
void sl_offset_ind_r12_c::set(types::options e)
{
  destroy_();
  type_ = e;
}
sl_offset_ind_r12_c::sl_offset_ind_r12_c(const sl_offset_ind_r12_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::small_r12:
      c.init(other.c.get<uint16_t>());
      break;
    case types::large_r12:
      c.init(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_offset_ind_r12_c");
  }
}
sl_offset_ind_r12_c& sl_offset_ind_r12_c::operator=(const sl_offset_ind_r12_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::small_r12:
      c.set(other.c.get<uint16_t>());
      break;
    case types::large_r12:
      c.set(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_offset_ind_r12_c");
  }

  return *this;
}
void sl_offset_ind_r12_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::small_r12:
      j.write_int("small-r12", c.get<uint16_t>());
      break;
    case types::large_r12:
      j.write_int("large-r12", c.get<uint16_t>());
      break;
    default:
      log_invalid_choice_id(type_, "sl_offset_ind_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE sl_offset_ind_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::small_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::large_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)10239u));
      break;
    default:
      log_invalid_choice_id(type_, "sl_offset_ind_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_offset_ind_r12_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::small_r12:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::large_r12:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)10239u));
      break;
    default:
      log_invalid_choice_id(type_, "sl_offset_ind_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-P2X-ResourceSelectionConfig-r14 ::= SEQUENCE
SRSASN_CODE sl_p2_x_res_sel_cfg_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(partial_sensing_r14_present, 1));
  HANDLE_CODE(bref.pack(random_sel_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_p2_x_res_sel_cfg_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(partial_sensing_r14_present, 1));
  HANDLE_CODE(bref.unpack(random_sel_r14_present, 1));

  return SRSASN_SUCCESS;
}
void sl_p2_x_res_sel_cfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (partial_sensing_r14_present) {
    j.write_str("partialSensing-r14", "true");
  }
  if (random_sel_r14_present) {
    j.write_str("randomSelection-r14", "true");
  }
  j.end_obj();
}

// SL-PSSCH-TxConfig-r14 ::= SEQUENCE
SRSASN_CODE sl_pssch_tx_cfg_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(type_tx_sync_r14_present, 1));

  if (type_tx_sync_r14_present) {
    HANDLE_CODE(type_tx_sync_r14.pack(bref));
  }
  HANDLE_CODE(thres_ue_speed_r14.pack(bref));
  HANDLE_CODE(params_above_thres_r14.pack(bref));
  HANDLE_CODE(params_below_thres_r14.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= params_above_thres_v1530.is_present();
    group_flags[0] |= params_below_thres_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(params_above_thres_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(params_below_thres_v1530.is_present(), 1));
      if (params_above_thres_v1530.is_present()) {
        HANDLE_CODE(params_above_thres_v1530->pack(bref));
      }
      if (params_below_thres_v1530.is_present()) {
        HANDLE_CODE(params_below_thres_v1530->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pssch_tx_cfg_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(type_tx_sync_r14_present, 1));

  if (type_tx_sync_r14_present) {
    HANDLE_CODE(type_tx_sync_r14.unpack(bref));
  }
  HANDLE_CODE(thres_ue_speed_r14.unpack(bref));
  HANDLE_CODE(params_above_thres_r14.unpack(bref));
  HANDLE_CODE(params_below_thres_r14.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 params_above_thres_v1530_present;
      HANDLE_CODE(bref.unpack(params_above_thres_v1530_present, 1));
      params_above_thres_v1530.set_present(params_above_thres_v1530_present);
      bool params_below_thres_v1530_present;
      HANDLE_CODE(bref.unpack(params_below_thres_v1530_present, 1));
      params_below_thres_v1530.set_present(params_below_thres_v1530_present);
      if (params_above_thres_v1530.is_present()) {
        HANDLE_CODE(params_above_thres_v1530->unpack(bref));
      }
      if (params_below_thres_v1530.is_present()) {
        HANDLE_CODE(params_below_thres_v1530->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_pssch_tx_cfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (type_tx_sync_r14_present) {
    j.write_str("typeTxSync-r14", type_tx_sync_r14.to_string());
  }
  j.write_str("thresUE-Speed-r14", thres_ue_speed_r14.to_string());
  j.write_fieldname("parametersAboveThres-r14");
  params_above_thres_r14.to_json(j);
  j.write_fieldname("parametersBelowThres-r14");
  params_below_thres_r14.to_json(j);
  if (ext) {
    if (params_above_thres_v1530.is_present()) {
      j.write_fieldname("parametersAboveThres-v1530");
      params_above_thres_v1530->to_json(j);
    }
    if (params_below_thres_v1530.is_present()) {
      j.write_fieldname("parametersBelowThres-v1530");
      params_below_thres_v1530->to_json(j);
    }
  }
  j.end_obj();
}

// SL-SyncAllowed-r14 ::= SEQUENCE
SRSASN_CODE sl_sync_allowed_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(gnss_sync_r14_present, 1));
  HANDLE_CODE(bref.pack(enb_sync_r14_present, 1));
  HANDLE_CODE(bref.pack(ue_sync_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_sync_allowed_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(gnss_sync_r14_present, 1));
  HANDLE_CODE(bref.unpack(enb_sync_r14_present, 1));
  HANDLE_CODE(bref.unpack(ue_sync_r14_present, 1));

  return SRSASN_SUCCESS;
}
void sl_sync_allowed_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (gnss_sync_r14_present) {
    j.write_str("gnss-Sync-r14", "true");
  }
  if (enb_sync_r14_present) {
    j.write_str("enb-Sync-r14", "true");
  }
  if (ue_sync_r14_present) {
    j.write_str("ue-Sync-r14", "true");
  }
  j.end_obj();
}

// SL-TxParameters-r12 ::= SEQUENCE
SRSASN_CODE sl_tx_params_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(alpha_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, p0_r12, (int8_t)-126, (int8_t)31));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_tx_params_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(alpha_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(p0_r12, bref, (int8_t)-126, (int8_t)31));

  return SRSASN_SUCCESS;
}
void sl_tx_params_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("alpha-r12", alpha_r12.to_string());
  j.write_int("p0-r12", p0_r12);
  j.end_obj();
}

// SubframeBitmapSL-r12 ::= CHOICE
void sf_bitmap_sl_r12_c::destroy_()
{
  switch (type_) {
    case types::bs4_r12:
      c.destroy<fixed_bitstring<4> >();
      break;
    case types::bs8_r12:
      c.destroy<fixed_bitstring<8> >();
      break;
    case types::bs12_r12:
      c.destroy<fixed_bitstring<12> >();
      break;
    case types::bs16_r12:
      c.destroy<fixed_bitstring<16> >();
      break;
    case types::bs30_r12:
      c.destroy<fixed_bitstring<30> >();
      break;
    case types::bs40_r12:
      c.destroy<fixed_bitstring<40> >();
      break;
    case types::bs42_r12:
      c.destroy<fixed_bitstring<42> >();
      break;
    default:
      break;
  }
}
void sf_bitmap_sl_r12_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::bs4_r12:
      c.init<fixed_bitstring<4> >();
      break;
    case types::bs8_r12:
      c.init<fixed_bitstring<8> >();
      break;
    case types::bs12_r12:
      c.init<fixed_bitstring<12> >();
      break;
    case types::bs16_r12:
      c.init<fixed_bitstring<16> >();
      break;
    case types::bs30_r12:
      c.init<fixed_bitstring<30> >();
      break;
    case types::bs40_r12:
      c.init<fixed_bitstring<40> >();
      break;
    case types::bs42_r12:
      c.init<fixed_bitstring<42> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r12_c");
  }
}
sf_bitmap_sl_r12_c::sf_bitmap_sl_r12_c(const sf_bitmap_sl_r12_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::bs4_r12:
      c.init(other.c.get<fixed_bitstring<4> >());
      break;
    case types::bs8_r12:
      c.init(other.c.get<fixed_bitstring<8> >());
      break;
    case types::bs12_r12:
      c.init(other.c.get<fixed_bitstring<12> >());
      break;
    case types::bs16_r12:
      c.init(other.c.get<fixed_bitstring<16> >());
      break;
    case types::bs30_r12:
      c.init(other.c.get<fixed_bitstring<30> >());
      break;
    case types::bs40_r12:
      c.init(other.c.get<fixed_bitstring<40> >());
      break;
    case types::bs42_r12:
      c.init(other.c.get<fixed_bitstring<42> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r12_c");
  }
}
sf_bitmap_sl_r12_c& sf_bitmap_sl_r12_c::operator=(const sf_bitmap_sl_r12_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::bs4_r12:
      c.set(other.c.get<fixed_bitstring<4> >());
      break;
    case types::bs8_r12:
      c.set(other.c.get<fixed_bitstring<8> >());
      break;
    case types::bs12_r12:
      c.set(other.c.get<fixed_bitstring<12> >());
      break;
    case types::bs16_r12:
      c.set(other.c.get<fixed_bitstring<16> >());
      break;
    case types::bs30_r12:
      c.set(other.c.get<fixed_bitstring<30> >());
      break;
    case types::bs40_r12:
      c.set(other.c.get<fixed_bitstring<40> >());
      break;
    case types::bs42_r12:
      c.set(other.c.get<fixed_bitstring<42> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r12_c");
  }

  return *this;
}
void sf_bitmap_sl_r12_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::bs4_r12:
      j.write_str("bs4-r12", c.get<fixed_bitstring<4> >().to_string());
      break;
    case types::bs8_r12:
      j.write_str("bs8-r12", c.get<fixed_bitstring<8> >().to_string());
      break;
    case types::bs12_r12:
      j.write_str("bs12-r12", c.get<fixed_bitstring<12> >().to_string());
      break;
    case types::bs16_r12:
      j.write_str("bs16-r12", c.get<fixed_bitstring<16> >().to_string());
      break;
    case types::bs30_r12:
      j.write_str("bs30-r12", c.get<fixed_bitstring<30> >().to_string());
      break;
    case types::bs40_r12:
      j.write_str("bs40-r12", c.get<fixed_bitstring<40> >().to_string());
      break;
    case types::bs42_r12:
      j.write_str("bs42-r12", c.get<fixed_bitstring<42> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE sf_bitmap_sl_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::bs4_r12:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().pack(bref));
      break;
    case types::bs8_r12:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().pack(bref));
      break;
    case types::bs12_r12:
      HANDLE_CODE(c.get<fixed_bitstring<12> >().pack(bref));
      break;
    case types::bs16_r12:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().pack(bref));
      break;
    case types::bs30_r12:
      HANDLE_CODE(c.get<fixed_bitstring<30> >().pack(bref));
      break;
    case types::bs40_r12:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().pack(bref));
      break;
    case types::bs42_r12:
      HANDLE_CODE(c.get<fixed_bitstring<42> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sf_bitmap_sl_r12_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::bs4_r12:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().unpack(bref));
      break;
    case types::bs8_r12:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().unpack(bref));
      break;
    case types::bs12_r12:
      HANDLE_CODE(c.get<fixed_bitstring<12> >().unpack(bref));
      break;
    case types::bs16_r12:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().unpack(bref));
      break;
    case types::bs30_r12:
      HANDLE_CODE(c.get<fixed_bitstring<30> >().unpack(bref));
      break;
    case types::bs40_r12:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().unpack(bref));
      break;
    case types::bs42_r12:
      HANDLE_CODE(c.get<fixed_bitstring<42> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SubframeBitmapSL-r14 ::= CHOICE
void sf_bitmap_sl_r14_c::destroy_()
{
  switch (type_) {
    case types::bs10_r14:
      c.destroy<fixed_bitstring<10> >();
      break;
    case types::bs16_r14:
      c.destroy<fixed_bitstring<16> >();
      break;
    case types::bs20_r14:
      c.destroy<fixed_bitstring<20> >();
      break;
    case types::bs30_r14:
      c.destroy<fixed_bitstring<30> >();
      break;
    case types::bs40_r14:
      c.destroy<fixed_bitstring<40> >();
      break;
    case types::bs50_r14:
      c.destroy<fixed_bitstring<50> >();
      break;
    case types::bs60_r14:
      c.destroy<fixed_bitstring<60> >();
      break;
    case types::bs100_r14:
      c.destroy<fixed_bitstring<100> >();
      break;
    default:
      break;
  }
}
void sf_bitmap_sl_r14_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::bs10_r14:
      c.init<fixed_bitstring<10> >();
      break;
    case types::bs16_r14:
      c.init<fixed_bitstring<16> >();
      break;
    case types::bs20_r14:
      c.init<fixed_bitstring<20> >();
      break;
    case types::bs30_r14:
      c.init<fixed_bitstring<30> >();
      break;
    case types::bs40_r14:
      c.init<fixed_bitstring<40> >();
      break;
    case types::bs50_r14:
      c.init<fixed_bitstring<50> >();
      break;
    case types::bs60_r14:
      c.init<fixed_bitstring<60> >();
      break;
    case types::bs100_r14:
      c.init<fixed_bitstring<100> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r14_c");
  }
}
sf_bitmap_sl_r14_c::sf_bitmap_sl_r14_c(const sf_bitmap_sl_r14_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::bs10_r14:
      c.init(other.c.get<fixed_bitstring<10> >());
      break;
    case types::bs16_r14:
      c.init(other.c.get<fixed_bitstring<16> >());
      break;
    case types::bs20_r14:
      c.init(other.c.get<fixed_bitstring<20> >());
      break;
    case types::bs30_r14:
      c.init(other.c.get<fixed_bitstring<30> >());
      break;
    case types::bs40_r14:
      c.init(other.c.get<fixed_bitstring<40> >());
      break;
    case types::bs50_r14:
      c.init(other.c.get<fixed_bitstring<50> >());
      break;
    case types::bs60_r14:
      c.init(other.c.get<fixed_bitstring<60> >());
      break;
    case types::bs100_r14:
      c.init(other.c.get<fixed_bitstring<100> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r14_c");
  }
}
sf_bitmap_sl_r14_c& sf_bitmap_sl_r14_c::operator=(const sf_bitmap_sl_r14_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::bs10_r14:
      c.set(other.c.get<fixed_bitstring<10> >());
      break;
    case types::bs16_r14:
      c.set(other.c.get<fixed_bitstring<16> >());
      break;
    case types::bs20_r14:
      c.set(other.c.get<fixed_bitstring<20> >());
      break;
    case types::bs30_r14:
      c.set(other.c.get<fixed_bitstring<30> >());
      break;
    case types::bs40_r14:
      c.set(other.c.get<fixed_bitstring<40> >());
      break;
    case types::bs50_r14:
      c.set(other.c.get<fixed_bitstring<50> >());
      break;
    case types::bs60_r14:
      c.set(other.c.get<fixed_bitstring<60> >());
      break;
    case types::bs100_r14:
      c.set(other.c.get<fixed_bitstring<100> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r14_c");
  }

  return *this;
}
void sf_bitmap_sl_r14_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::bs10_r14:
      j.write_str("bs10-r14", c.get<fixed_bitstring<10> >().to_string());
      break;
    case types::bs16_r14:
      j.write_str("bs16-r14", c.get<fixed_bitstring<16> >().to_string());
      break;
    case types::bs20_r14:
      j.write_str("bs20-r14", c.get<fixed_bitstring<20> >().to_string());
      break;
    case types::bs30_r14:
      j.write_str("bs30-r14", c.get<fixed_bitstring<30> >().to_string());
      break;
    case types::bs40_r14:
      j.write_str("bs40-r14", c.get<fixed_bitstring<40> >().to_string());
      break;
    case types::bs50_r14:
      j.write_str("bs50-r14", c.get<fixed_bitstring<50> >().to_string());
      break;
    case types::bs60_r14:
      j.write_str("bs60-r14", c.get<fixed_bitstring<60> >().to_string());
      break;
    case types::bs100_r14:
      j.write_str("bs100-r14", c.get<fixed_bitstring<100> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE sf_bitmap_sl_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::bs10_r14:
      HANDLE_CODE(c.get<fixed_bitstring<10> >().pack(bref));
      break;
    case types::bs16_r14:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().pack(bref));
      break;
    case types::bs20_r14:
      HANDLE_CODE(c.get<fixed_bitstring<20> >().pack(bref));
      break;
    case types::bs30_r14:
      HANDLE_CODE(c.get<fixed_bitstring<30> >().pack(bref));
      break;
    case types::bs40_r14:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().pack(bref));
      break;
    case types::bs50_r14:
      HANDLE_CODE(c.get<fixed_bitstring<50> >().pack(bref));
      break;
    case types::bs60_r14:
      HANDLE_CODE(c.get<fixed_bitstring<60> >().pack(bref));
      break;
    case types::bs100_r14:
      HANDLE_CODE(c.get<fixed_bitstring<100> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sf_bitmap_sl_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::bs10_r14:
      HANDLE_CODE(c.get<fixed_bitstring<10> >().unpack(bref));
      break;
    case types::bs16_r14:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().unpack(bref));
      break;
    case types::bs20_r14:
      HANDLE_CODE(c.get<fixed_bitstring<20> >().unpack(bref));
      break;
    case types::bs30_r14:
      HANDLE_CODE(c.get<fixed_bitstring<30> >().unpack(bref));
      break;
    case types::bs40_r14:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().unpack(bref));
      break;
    case types::bs50_r14:
      HANDLE_CODE(c.get<fixed_bitstring<50> >().unpack(bref));
      break;
    case types::bs60_r14:
      HANDLE_CODE(c.get<fixed_bitstring<60> >().unpack(bref));
      break;
    case types::bs100_r14:
      HANDLE_CODE(c.get<fixed_bitstring<100> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sf_bitmap_sl_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SystemInformationBlockType1-v1450-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1450_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tdd_cfg_v1450_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (tdd_cfg_v1450_present) {
    HANDLE_CODE(tdd_cfg_v1450.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1450_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tdd_cfg_v1450_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (tdd_cfg_v1450_present) {
    HANDLE_CODE(tdd_cfg_v1450.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1450_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tdd_cfg_v1450_present) {
    j.write_fieldname("tdd-Config-v1450");
    tdd_cfg_v1450.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// TDD-Config ::= SEQUENCE
SRSASN_CODE tdd_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sf_assign.pack(bref));
  HANDLE_CODE(special_sf_patterns.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE tdd_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sf_assign.unpack(bref));
  HANDLE_CODE(special_sf_patterns.unpack(bref));

  return SRSASN_SUCCESS;
}
void tdd_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("subframeAssignment", sf_assign.to_string());
  j.write_str("specialSubframePatterns", special_sf_patterns.to_string());
  j.end_obj();
}

// TDD-Config-v1430 ::= SEQUENCE
SRSASN_CODE tdd_cfg_v1430_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE tdd_cfg_v1430_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void tdd_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("specialSubframePatterns-v1430", "ssp10");
  j.end_obj();
}

// 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));

  if (cell_sel_info_ce1_v1360_present) {
    HANDLE_CODE(cell_sel_info_ce1_v1360.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_carrier_freq_info_v1360_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));
  }

  return SRSASN_SUCCESS;
}
void inter_freq_carrier_freq_info_v1360_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.end_obj();
}

// NS-PmaxValue-r10 ::= SEQUENCE
SRSASN_CODE ns_pmax_value_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(add_pmax_r10_present, 1));

  if (add_pmax_r10_present) {
    HANDLE_CODE(pack_integer(bref, add_pmax_r10, (int8_t)-30, (int8_t)33));
  }
  HANDLE_CODE(pack_integer(bref, add_spec_emission, (uint8_t)1u, (uint8_t)32u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ns_pmax_value_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(add_pmax_r10_present, 1));

  if (add_pmax_r10_present) {
    HANDLE_CODE(unpack_integer(add_pmax_r10, bref, (int8_t)-30, (int8_t)33));
  }
  HANDLE_CODE(unpack_integer(add_spec_emission, bref, (uint8_t)1u, (uint8_t)32u));

  return SRSASN_SUCCESS;
}
void ns_pmax_value_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (add_pmax_r10_present) {
    j.write_int("additionalPmax-r10", add_pmax_r10);
  }
  j.write_int("additionalSpectrumEmission", add_spec_emission);
  j.end_obj();
}

// SL-CommResourcePoolV2X-r14 ::= SEQUENCE
SRSASN_CODE sl_comm_res_pool_v2x_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(sl_offset_ind_r14_present, 1));
  HANDLE_CODE(bref.pack(start_rb_pscch_pool_r14_present, 1));
  HANDLE_CODE(bref.pack(rx_params_ncell_r14_present, 1));
  HANDLE_CODE(bref.pack(data_tx_params_r14_present, 1));
  HANDLE_CODE(bref.pack(zone_id_r14_present, 1));
  HANDLE_CODE(bref.pack(thresh_s_rssi_cbr_r14_present, 1));
  HANDLE_CODE(bref.pack(pool_report_id_r14_present, 1));
  HANDLE_CODE(bref.pack(cbr_pssch_tx_cfg_list_r14_present, 1));
  HANDLE_CODE(bref.pack(res_sel_cfg_p2_x_r14_present, 1));
  HANDLE_CODE(bref.pack(sync_allowed_r14_present, 1));
  HANDLE_CODE(bref.pack(restrict_res_reserv_period_r14_present, 1));

  if (sl_offset_ind_r14_present) {
    HANDLE_CODE(sl_offset_ind_r14.pack(bref));
  }
  HANDLE_CODE(sl_sf_r14.pack(bref));
  HANDLE_CODE(bref.pack(adjacency_pscch_pssch_r14, 1));
  HANDLE_CODE(size_subch_r14.pack(bref));
  HANDLE_CODE(num_subch_r14.pack(bref));
  HANDLE_CODE(pack_integer(bref, start_rb_subch_r14, (uint8_t)0u, (uint8_t)99u));
  if (start_rb_pscch_pool_r14_present) {
    HANDLE_CODE(pack_integer(bref, start_rb_pscch_pool_r14, (uint8_t)0u, (uint8_t)99u));
  }
  if (rx_params_ncell_r14_present) {
    HANDLE_CODE(bref.pack(rx_params_ncell_r14.tdd_cfg_r14_present, 1));
    if (rx_params_ncell_r14.tdd_cfg_r14_present) {
      HANDLE_CODE(rx_params_ncell_r14.tdd_cfg_r14.pack(bref));
    }
    HANDLE_CODE(pack_integer(bref, rx_params_ncell_r14.sync_cfg_idx_r14, (uint8_t)0u, (uint8_t)15u));
  }
  if (data_tx_params_r14_present) {
    HANDLE_CODE(data_tx_params_r14.pack(bref));
  }
  if (zone_id_r14_present) {
    HANDLE_CODE(pack_integer(bref, zone_id_r14, (uint8_t)0u, (uint8_t)7u));
  }
  if (thresh_s_rssi_cbr_r14_present) {
    HANDLE_CODE(pack_integer(bref, thresh_s_rssi_cbr_r14, (uint8_t)0u, (uint8_t)45u));
  }
  if (pool_report_id_r14_present) {
    HANDLE_CODE(pack_integer(bref, pool_report_id_r14, (uint8_t)1u, (uint8_t)72u));
  }
  if (cbr_pssch_tx_cfg_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cbr_pssch_tx_cfg_list_r14, 1, 8));
  }
  if (res_sel_cfg_p2_x_r14_present) {
    HANDLE_CODE(res_sel_cfg_p2_x_r14.pack(bref));
  }
  if (sync_allowed_r14_present) {
    HANDLE_CODE(sync_allowed_r14.pack(bref));
  }
  if (restrict_res_reserv_period_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, restrict_res_reserv_period_r14, 1, 16));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= sl_min_t2_value_list_r15.is_present();
    group_flags[0] |= cbr_pssch_tx_cfg_list_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sl_min_t2_value_list_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(cbr_pssch_tx_cfg_list_v1530.is_present(), 1));
      if (sl_min_t2_value_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *sl_min_t2_value_list_r15, 1, 8));
      }
      if (cbr_pssch_tx_cfg_list_v1530.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *cbr_pssch_tx_cfg_list_v1530, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_res_pool_v2x_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(sl_offset_ind_r14_present, 1));
  HANDLE_CODE(bref.unpack(start_rb_pscch_pool_r14_present, 1));
  HANDLE_CODE(bref.unpack(rx_params_ncell_r14_present, 1));
  HANDLE_CODE(bref.unpack(data_tx_params_r14_present, 1));
  HANDLE_CODE(bref.unpack(zone_id_r14_present, 1));
  HANDLE_CODE(bref.unpack(thresh_s_rssi_cbr_r14_present, 1));
  HANDLE_CODE(bref.unpack(pool_report_id_r14_present, 1));
  HANDLE_CODE(bref.unpack(cbr_pssch_tx_cfg_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(res_sel_cfg_p2_x_r14_present, 1));
  HANDLE_CODE(bref.unpack(sync_allowed_r14_present, 1));
  HANDLE_CODE(bref.unpack(restrict_res_reserv_period_r14_present, 1));

  if (sl_offset_ind_r14_present) {
    HANDLE_CODE(sl_offset_ind_r14.unpack(bref));
  }
  HANDLE_CODE(sl_sf_r14.unpack(bref));
  HANDLE_CODE(bref.unpack(adjacency_pscch_pssch_r14, 1));
  HANDLE_CODE(size_subch_r14.unpack(bref));
  HANDLE_CODE(num_subch_r14.unpack(bref));
  HANDLE_CODE(unpack_integer(start_rb_subch_r14, bref, (uint8_t)0u, (uint8_t)99u));
  if (start_rb_pscch_pool_r14_present) {
    HANDLE_CODE(unpack_integer(start_rb_pscch_pool_r14, bref, (uint8_t)0u, (uint8_t)99u));
  }
  if (rx_params_ncell_r14_present) {
    HANDLE_CODE(bref.unpack(rx_params_ncell_r14.tdd_cfg_r14_present, 1));
    if (rx_params_ncell_r14.tdd_cfg_r14_present) {
      HANDLE_CODE(rx_params_ncell_r14.tdd_cfg_r14.unpack(bref));
    }
    HANDLE_CODE(unpack_integer(rx_params_ncell_r14.sync_cfg_idx_r14, bref, (uint8_t)0u, (uint8_t)15u));
  }
  if (data_tx_params_r14_present) {
    HANDLE_CODE(data_tx_params_r14.unpack(bref));
  }
  if (zone_id_r14_present) {
    HANDLE_CODE(unpack_integer(zone_id_r14, bref, (uint8_t)0u, (uint8_t)7u));
  }
  if (thresh_s_rssi_cbr_r14_present) {
    HANDLE_CODE(unpack_integer(thresh_s_rssi_cbr_r14, bref, (uint8_t)0u, (uint8_t)45u));
  }
  if (pool_report_id_r14_present) {
    HANDLE_CODE(unpack_integer(pool_report_id_r14, bref, (uint8_t)1u, (uint8_t)72u));
  }
  if (cbr_pssch_tx_cfg_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cbr_pssch_tx_cfg_list_r14, bref, 1, 8));
  }
  if (res_sel_cfg_p2_x_r14_present) {
    HANDLE_CODE(res_sel_cfg_p2_x_r14.unpack(bref));
  }
  if (sync_allowed_r14_present) {
    HANDLE_CODE(sync_allowed_r14.unpack(bref));
  }
  if (restrict_res_reserv_period_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(restrict_res_reserv_period_r14, bref, 1, 16));
  }

  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 sl_min_t2_value_list_r15_present;
      HANDLE_CODE(bref.unpack(sl_min_t2_value_list_r15_present, 1));
      sl_min_t2_value_list_r15.set_present(sl_min_t2_value_list_r15_present);
      bool cbr_pssch_tx_cfg_list_v1530_present;
      HANDLE_CODE(bref.unpack(cbr_pssch_tx_cfg_list_v1530_present, 1));
      cbr_pssch_tx_cfg_list_v1530.set_present(cbr_pssch_tx_cfg_list_v1530_present);
      if (sl_min_t2_value_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*sl_min_t2_value_list_r15, bref, 1, 8));
      }
      if (cbr_pssch_tx_cfg_list_v1530.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*cbr_pssch_tx_cfg_list_v1530, bref, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_comm_res_pool_v2x_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sl_offset_ind_r14_present) {
    j.write_fieldname("sl-OffsetIndicator-r14");
    sl_offset_ind_r14.to_json(j);
  }
  j.write_fieldname("sl-Subframe-r14");
  sl_sf_r14.to_json(j);
  j.write_bool("adjacencyPSCCH-PSSCH-r14", adjacency_pscch_pssch_r14);
  j.write_str("sizeSubchannel-r14", size_subch_r14.to_string());
  j.write_str("numSubchannel-r14", num_subch_r14.to_string());
  j.write_int("startRB-Subchannel-r14", start_rb_subch_r14);
  if (start_rb_pscch_pool_r14_present) {
    j.write_int("startRB-PSCCH-Pool-r14", start_rb_pscch_pool_r14);
  }
  if (rx_params_ncell_r14_present) {
    j.write_fieldname("rxParametersNCell-r14");
    j.start_obj();
    if (rx_params_ncell_r14.tdd_cfg_r14_present) {
      j.write_fieldname("tdd-Config-r14");
      rx_params_ncell_r14.tdd_cfg_r14.to_json(j);
    }
    j.write_int("syncConfigIndex-r14", rx_params_ncell_r14.sync_cfg_idx_r14);
    j.end_obj();
  }
  if (data_tx_params_r14_present) {
    j.write_fieldname("dataTxParameters-r14");
    data_tx_params_r14.to_json(j);
  }
  if (zone_id_r14_present) {
    j.write_int("zoneID-r14", zone_id_r14);
  }
  if (thresh_s_rssi_cbr_r14_present) {
    j.write_int("threshS-RSSI-CBR-r14", thresh_s_rssi_cbr_r14);
  }
  if (pool_report_id_r14_present) {
    j.write_int("poolReportId-r14", pool_report_id_r14);
  }
  if (cbr_pssch_tx_cfg_list_r14_present) {
    j.start_array("cbr-pssch-TxConfigList-r14");
    for (const auto& e1 : cbr_pssch_tx_cfg_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (res_sel_cfg_p2_x_r14_present) {
    j.write_fieldname("resourceSelectionConfigP2X-r14");
    res_sel_cfg_p2_x_r14.to_json(j);
  }
  if (sync_allowed_r14_present) {
    j.write_fieldname("syncAllowed-r14");
    sync_allowed_r14.to_json(j);
  }
  if (restrict_res_reserv_period_r14_present) {
    j.start_array("restrictResourceReservationPeriod-r14");
    for (const auto& e1 : restrict_res_reserv_period_r14) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (ext) {
    if (sl_min_t2_value_list_r15.is_present()) {
      j.start_array("sl-MinT2ValueList-r15");
      for (const auto& e1 : *sl_min_t2_value_list_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (cbr_pssch_tx_cfg_list_v1530.is_present()) {
      j.start_array("cbr-pssch-TxConfigList-v1530");
      for (const auto& e1 : *cbr_pssch_tx_cfg_list_v1530) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// SL-PoolSelectionConfig-r12 ::= SEQUENCE
SRSASN_CODE sl_pool_sel_cfg_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, thresh_low_r12, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(pack_integer(bref, thresh_high_r12, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pool_sel_cfg_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(thresh_low_r12, bref, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(unpack_integer(thresh_high_r12, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void sl_pool_sel_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("threshLow-r12", thresh_low_r12);
  j.write_int("threshHigh-r12", thresh_high_r12);
  j.end_obj();
}

// SL-SyncConfigNFreq-r13 ::= SEQUENCE
SRSASN_CODE sl_sync_cfg_nfreq_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(async_params_r13_present, 1));
  HANDLE_CODE(bref.pack(tx_params_r13_present, 1));
  HANDLE_CODE(bref.pack(rx_params_r13_present, 1));

  if (async_params_r13_present) {
    HANDLE_CODE(async_params_r13.sync_cp_len_r13.pack(bref));
    HANDLE_CODE(pack_integer(bref, async_params_r13.sync_offset_ind_r13, (uint8_t)0u, (uint8_t)39u));
    HANDLE_CODE(pack_integer(bref, async_params_r13.slssid_r13, (uint8_t)0u, (uint8_t)167u));
  }
  if (tx_params_r13_present) {
    HANDLE_CODE(bref.pack(tx_params_r13.sync_info_reserved_r13_present, 1));
    HANDLE_CODE(bref.pack(tx_params_r13.sync_tx_periodic_r13_present, 1));
    HANDLE_CODE(tx_params_r13.sync_tx_params_r13.pack(bref));
    HANDLE_CODE(pack_integer(bref, tx_params_r13.sync_tx_thresh_ic_r13, (uint8_t)0u, (uint8_t)13u));
    if (tx_params_r13.sync_info_reserved_r13_present) {
      HANDLE_CODE(tx_params_r13.sync_info_reserved_r13.pack(bref));
    }
  }
  if (rx_params_r13_present) {
    HANDLE_CODE(rx_params_r13.disc_sync_win_r13.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= sync_offset_ind_v1430_present;
    group_flags[0] |= gnss_sync_r14_present;
    group_flags[1] |= sync_offset_ind2_r14_present;
    group_flags[1] |= sync_offset_ind3_r14_present;
    group_flags[2] |= slss_tx_disabled_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sync_offset_ind_v1430_present, 1));
      HANDLE_CODE(bref.pack(gnss_sync_r14_present, 1));
      if (sync_offset_ind_v1430_present) {
        HANDLE_CODE(pack_integer(bref, sync_offset_ind_v1430, (uint8_t)40u, (uint8_t)159u));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sync_offset_ind2_r14_present, 1));
      HANDLE_CODE(bref.pack(sync_offset_ind3_r14_present, 1));
      if (sync_offset_ind2_r14_present) {
        HANDLE_CODE(pack_integer(bref, sync_offset_ind2_r14, (uint8_t)0u, (uint8_t)159u));
      }
      if (sync_offset_ind3_r14_present) {
        HANDLE_CODE(pack_integer(bref, sync_offset_ind3_r14, (uint8_t)0u, (uint8_t)159u));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(slss_tx_disabled_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_sync_cfg_nfreq_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(async_params_r13_present, 1));
  HANDLE_CODE(bref.unpack(tx_params_r13_present, 1));
  HANDLE_CODE(bref.unpack(rx_params_r13_present, 1));

  if (async_params_r13_present) {
    HANDLE_CODE(async_params_r13.sync_cp_len_r13.unpack(bref));
    HANDLE_CODE(unpack_integer(async_params_r13.sync_offset_ind_r13, bref, (uint8_t)0u, (uint8_t)39u));
    HANDLE_CODE(unpack_integer(async_params_r13.slssid_r13, bref, (uint8_t)0u, (uint8_t)167u));
  }
  if (tx_params_r13_present) {
    HANDLE_CODE(bref.unpack(tx_params_r13.sync_info_reserved_r13_present, 1));
    HANDLE_CODE(bref.unpack(tx_params_r13.sync_tx_periodic_r13_present, 1));
    HANDLE_CODE(tx_params_r13.sync_tx_params_r13.unpack(bref));
    HANDLE_CODE(unpack_integer(tx_params_r13.sync_tx_thresh_ic_r13, bref, (uint8_t)0u, (uint8_t)13u));
    if (tx_params_r13.sync_info_reserved_r13_present) {
      HANDLE_CODE(tx_params_r13.sync_info_reserved_r13.unpack(bref));
    }
  }
  if (rx_params_r13_present) {
    HANDLE_CODE(rx_params_r13.disc_sync_win_r13.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(sync_offset_ind_v1430_present, 1));
      HANDLE_CODE(bref.unpack(gnss_sync_r14_present, 1));
      if (sync_offset_ind_v1430_present) {
        HANDLE_CODE(unpack_integer(sync_offset_ind_v1430, bref, (uint8_t)40u, (uint8_t)159u));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(sync_offset_ind2_r14_present, 1));
      HANDLE_CODE(bref.unpack(sync_offset_ind3_r14_present, 1));
      if (sync_offset_ind2_r14_present) {
        HANDLE_CODE(unpack_integer(sync_offset_ind2_r14, bref, (uint8_t)0u, (uint8_t)159u));
      }
      if (sync_offset_ind3_r14_present) {
        HANDLE_CODE(unpack_integer(sync_offset_ind3_r14, bref, (uint8_t)0u, (uint8_t)159u));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(slss_tx_disabled_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
void sl_sync_cfg_nfreq_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (async_params_r13_present) {
    j.write_fieldname("asyncParameters-r13");
    j.start_obj();
    j.write_str("syncCP-Len-r13", async_params_r13.sync_cp_len_r13.to_string());
    j.write_int("syncOffsetIndicator-r13", async_params_r13.sync_offset_ind_r13);
    j.write_int("slssid-r13", async_params_r13.slssid_r13);
    j.end_obj();
  }
  if (tx_params_r13_present) {
    j.write_fieldname("txParameters-r13");
    j.start_obj();
    j.write_fieldname("syncTxParameters-r13");
    tx_params_r13.sync_tx_params_r13.to_json(j);
    j.write_int("syncTxThreshIC-r13", tx_params_r13.sync_tx_thresh_ic_r13);
    if (tx_params_r13.sync_info_reserved_r13_present) {
      j.write_str("syncInfoReserved-r13", tx_params_r13.sync_info_reserved_r13.to_string());
    }
    if (tx_params_r13.sync_tx_periodic_r13_present) {
      j.write_str("syncTxPeriodic-r13", "true");
    }
    j.end_obj();
  }
  if (rx_params_r13_present) {
    j.write_fieldname("rxParameters-r13");
    j.start_obj();
    j.write_str("discSyncWindow-r13", rx_params_r13.disc_sync_win_r13.to_string());
    j.end_obj();
  }
  if (ext) {
    if (sync_offset_ind_v1430_present) {
      j.write_int("syncOffsetIndicator-v1430", sync_offset_ind_v1430);
    }
    if (gnss_sync_r14_present) {
      j.write_str("gnss-Sync-r14", "true");
    }
    if (sync_offset_ind2_r14_present) {
      j.write_int("syncOffsetIndicator2-r14", sync_offset_ind2_r14);
    }
    if (sync_offset_ind3_r14_present) {
      j.write_int("syncOffsetIndicator3-r14", sync_offset_ind3_r14);
    }
    if (slss_tx_disabled_r15_present) {
      j.write_str("slss-TxDisabled-r15", "true");
    }
  }
  j.end_obj();
}

// SL-TF-ResourceConfig-r12 ::= SEQUENCE
SRSASN_CODE sl_tf_res_cfg_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, prb_num_r12, (uint8_t)1u, (uint8_t)100u));
  HANDLE_CODE(pack_integer(bref, prb_start_r12, (uint8_t)0u, (uint8_t)99u));
  HANDLE_CODE(pack_integer(bref, prb_end_r12, (uint8_t)0u, (uint8_t)99u));
  HANDLE_CODE(offset_ind_r12.pack(bref));
  HANDLE_CODE(sf_bitmap_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_tf_res_cfg_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(prb_num_r12, bref, (uint8_t)1u, (uint8_t)100u));
  HANDLE_CODE(unpack_integer(prb_start_r12, bref, (uint8_t)0u, (uint8_t)99u));
  HANDLE_CODE(unpack_integer(prb_end_r12, bref, (uint8_t)0u, (uint8_t)99u));
  HANDLE_CODE(offset_ind_r12.unpack(bref));
  HANDLE_CODE(sf_bitmap_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_tf_res_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("prb-Num-r12", prb_num_r12);
  j.write_int("prb-Start-r12", prb_start_r12);
  j.write_int("prb-End-r12", prb_end_r12);
  j.write_fieldname("offsetIndicator-r12");
  offset_ind_r12.to_json(j);
  j.write_fieldname("subframeBitmap-r12");
  sf_bitmap_r12.to_json(j);
  j.end_obj();
}

// SystemInformationBlockType1-v1430-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ecall_over_ims_support_r14_present, 1));
  HANDLE_CODE(bref.pack(tdd_cfg_v1430_present, 1));
  HANDLE_CODE(bref.pack(cell_access_related_info_list_r14_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (tdd_cfg_v1430_present) {
    HANDLE_CODE(tdd_cfg_v1430.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));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ecall_over_ims_support_r14_present, 1));
  HANDLE_CODE(bref.unpack(tdd_cfg_v1430_present, 1));
  HANDLE_CODE(bref.unpack(cell_access_related_info_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (tdd_cfg_v1430_present) {
    HANDLE_CODE(tdd_cfg_v1430.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));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ecall_over_ims_support_r14_present) {
    j.write_str("eCallOverIMS-Support-r14", "true");
  }
  if (tdd_cfg_v1430_present) {
    j.write_fieldname("tdd-Config-v1430");
    tdd_cfg_v1430.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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// TDD-Config-v1130 ::= SEQUENCE
SRSASN_CODE tdd_cfg_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(special_sf_patterns_v1130.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE tdd_cfg_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(special_sf_patterns_v1130.unpack(bref));

  return SRSASN_SUCCESS;
}
void tdd_cfg_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("specialSubframePatterns-v1130", special_sf_patterns_v1130.to_string());
  j.end_obj();
}

// BandClassInfoCDMA2000 ::= SEQUENCE
SRSASN_CODE band_class_info_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));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_class_info_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));

  return SRSASN_SUCCESS;
}
void band_class_info_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("threshX-High", thresh_x_high);
  j.write_int("threshX-Low", thresh_x_low);
  j.end_obj();
}

// CellSelectionInfoCE1-r13 ::= SEQUENCE
SRSASN_CODE cell_sel_info_ce1_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(q_qual_min_rsrq_ce1_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, q_rx_lev_min_ce1_r13, (int8_t)-70, (int8_t)-22));
  if (q_qual_min_rsrq_ce1_r13_present) {
    HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_ce1_r13, (int8_t)-34, (int8_t)-3));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_sel_info_ce1_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(q_qual_min_rsrq_ce1_r13_present, 1));

  HANDLE_CODE(unpack_integer(q_rx_lev_min_ce1_r13, bref, (int8_t)-70, (int8_t)-22));
  if (q_qual_min_rsrq_ce1_r13_present) {
    HANDLE_CODE(unpack_integer(q_qual_min_rsrq_ce1_r13, bref, (int8_t)-34, (int8_t)-3));
  }

  return SRSASN_SUCCESS;
}
void cell_sel_info_ce1_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("q-RxLevMinCE1-r13", q_rx_lev_min_ce1_r13);
  if (q_qual_min_rsrq_ce1_r13_present) {
    j.write_int("q-QualMinRSRQ-CE1-r13", q_qual_min_rsrq_ce1_r13);
  }
  j.end_obj();
}

// NeighCellsPerBandclassCDMA2000-r11 ::= SEQUENCE
SRSASN_CODE neigh_cells_per_bandclass_cdma2000_r11_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<uint16_t>(0, 511)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cells_per_bandclass_cdma2000_r11_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<uint16_t>(0, 511)));

  return SRSASN_SUCCESS;
}
void neigh_cells_per_bandclass_cdma2000_r11_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.write_int(e1);
  }
  j.end_array();
  j.end_obj();
}

// SL-CommTxPoolSensingConfig-r14 ::= SEQUENCE
SRSASN_CODE sl_comm_tx_pool_sensing_cfg_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(restrict_res_reserv_period_r14_present, 1));
  HANDLE_CODE(bref.pack(p2x_sensing_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(sl_reselect_after_r14_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, pssch_tx_cfg_list_r14, 1, 16));
  HANDLE_CODE(pack_fixed_seq_of(
      bref, &(thres_pssch_rsrp_list_r14)[0], thres_pssch_rsrp_list_r14.size(), integer_packer<uint8_t>(0, 66)));
  if (restrict_res_reserv_period_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, restrict_res_reserv_period_r14, 1, 16));
  }
  HANDLE_CODE(prob_res_keep_r14.pack(bref));
  if (p2x_sensing_cfg_r14_present) {
    HANDLE_CODE(pack_integer(bref, p2x_sensing_cfg_r14.min_num_candidate_sf_r14, (uint8_t)1u, (uint8_t)13u));
    HANDLE_CODE(p2x_sensing_cfg_r14.gap_candidate_sensing_r14.pack(bref));
  }
  if (sl_reselect_after_r14_present) {
    HANDLE_CODE(sl_reselect_after_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_tx_pool_sensing_cfg_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(restrict_res_reserv_period_r14_present, 1));
  HANDLE_CODE(bref.unpack(p2x_sensing_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(sl_reselect_after_r14_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(pssch_tx_cfg_list_r14, bref, 1, 16));
  HANDLE_CODE(unpack_fixed_seq_of(
      &(thres_pssch_rsrp_list_r14)[0], bref, thres_pssch_rsrp_list_r14.size(), integer_packer<uint8_t>(0, 66)));
  if (restrict_res_reserv_period_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(restrict_res_reserv_period_r14, bref, 1, 16));
  }
  HANDLE_CODE(prob_res_keep_r14.unpack(bref));
  if (p2x_sensing_cfg_r14_present) {
    HANDLE_CODE(unpack_integer(p2x_sensing_cfg_r14.min_num_candidate_sf_r14, bref, (uint8_t)1u, (uint8_t)13u));
    HANDLE_CODE(p2x_sensing_cfg_r14.gap_candidate_sensing_r14.unpack(bref));
  }
  if (sl_reselect_after_r14_present) {
    HANDLE_CODE(sl_reselect_after_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_comm_tx_pool_sensing_cfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("pssch-TxConfigList-r14");
  for (const auto& e1 : pssch_tx_cfg_list_r14) {
    e1.to_json(j);
  }
  j.end_array();
  j.start_array("thresPSSCH-RSRP-List-r14");
  for (const auto& e1 : thres_pssch_rsrp_list_r14) {
    j.write_int(e1);
  }
  j.end_array();
  if (restrict_res_reserv_period_r14_present) {
    j.start_array("restrictResourceReservationPeriod-r14");
    for (const auto& e1 : restrict_res_reserv_period_r14) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  j.write_str("probResourceKeep-r14", prob_res_keep_r14.to_string());
  if (p2x_sensing_cfg_r14_present) {
    j.write_fieldname("p2x-SensingConfig-r14");
    j.start_obj();
    j.write_int("minNumCandidateSF-r14", p2x_sensing_cfg_r14.min_num_candidate_sf_r14);
    j.write_str("gapCandidateSensing-r14", p2x_sensing_cfg_r14.gap_candidate_sensing_r14.to_string());
    j.end_obj();
  }
  if (sl_reselect_after_r14_present) {
    j.write_str("sl-ReselectAfter-r14", sl_reselect_after_r14.to_string());
  }
  j.end_obj();
}

// SL-DiscResourcePool-r12 ::= SEQUENCE
SRSASN_CODE sl_disc_res_pool_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(tx_params_r12_present, 1));
  HANDLE_CODE(bref.pack(rx_params_r12_present, 1));

  HANDLE_CODE(cp_len_r12.pack(bref));
  HANDLE_CODE(disc_period_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, num_retx_r12, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(pack_integer(bref, num_repeat_r12, (uint8_t)1u, (uint8_t)50u));
  HANDLE_CODE(tf_res_cfg_r12.pack(bref));
  if (tx_params_r12_present) {
    HANDLE_CODE(bref.pack(tx_params_r12.ue_sel_res_cfg_r12_present, 1));
    HANDLE_CODE(tx_params_r12.tx_params_general_r12.pack(bref));
    if (tx_params_r12.ue_sel_res_cfg_r12_present) {
      HANDLE_CODE(tx_params_r12.ue_sel_res_cfg_r12.pool_sel_r12.pack(bref));
      HANDLE_CODE(tx_params_r12.ue_sel_res_cfg_r12.tx_probability_r12.pack(bref));
    }
  }
  if (rx_params_r12_present) {
    HANDLE_CODE(bref.pack(rx_params_r12.tdd_cfg_r12_present, 1));
    if (rx_params_r12.tdd_cfg_r12_present) {
      HANDLE_CODE(rx_params_r12.tdd_cfg_r12.pack(bref));
    }
    HANDLE_CODE(pack_integer(bref, rx_params_r12.sync_cfg_idx_r12, (uint8_t)0u, (uint8_t)15u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= disc_period_v1310.is_present();
    group_flags[0] |= rx_params_add_neigh_freq_r13.is_present();
    group_flags[0] |= tx_params_add_neigh_freq_r13.is_present();
    group_flags[1] |= tx_params_add_neigh_freq_v1370.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(disc_period_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(rx_params_add_neigh_freq_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(tx_params_add_neigh_freq_r13.is_present(), 1));
      if (disc_period_v1310.is_present()) {
        HANDLE_CODE(disc_period_v1310->pack(bref));
      }
      if (rx_params_add_neigh_freq_r13.is_present()) {
        HANDLE_CODE(rx_params_add_neigh_freq_r13->pack(bref));
      }
      if (tx_params_add_neigh_freq_r13.is_present()) {
        HANDLE_CODE(tx_params_add_neigh_freq_r13->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(tx_params_add_neigh_freq_v1370.is_present(), 1));
      if (tx_params_add_neigh_freq_v1370.is_present()) {
        HANDLE_CODE(tx_params_add_neigh_freq_v1370->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_res_pool_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(tx_params_r12_present, 1));
  HANDLE_CODE(bref.unpack(rx_params_r12_present, 1));

  HANDLE_CODE(cp_len_r12.unpack(bref));
  HANDLE_CODE(disc_period_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(num_retx_r12, bref, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(unpack_integer(num_repeat_r12, bref, (uint8_t)1u, (uint8_t)50u));
  HANDLE_CODE(tf_res_cfg_r12.unpack(bref));
  if (tx_params_r12_present) {
    HANDLE_CODE(bref.unpack(tx_params_r12.ue_sel_res_cfg_r12_present, 1));
    HANDLE_CODE(tx_params_r12.tx_params_general_r12.unpack(bref));
    if (tx_params_r12.ue_sel_res_cfg_r12_present) {
      HANDLE_CODE(tx_params_r12.ue_sel_res_cfg_r12.pool_sel_r12.unpack(bref));
      HANDLE_CODE(tx_params_r12.ue_sel_res_cfg_r12.tx_probability_r12.unpack(bref));
    }
  }
  if (rx_params_r12_present) {
    HANDLE_CODE(bref.unpack(rx_params_r12.tdd_cfg_r12_present, 1));
    if (rx_params_r12.tdd_cfg_r12_present) {
      HANDLE_CODE(rx_params_r12.tdd_cfg_r12.unpack(bref));
    }
    HANDLE_CODE(unpack_integer(rx_params_r12.sync_cfg_idx_r12, bref, (uint8_t)0u, (uint8_t)15u));
  }

  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 disc_period_v1310_present;
      HANDLE_CODE(bref.unpack(disc_period_v1310_present, 1));
      disc_period_v1310.set_present(disc_period_v1310_present);
      bool rx_params_add_neigh_freq_r13_present;
      HANDLE_CODE(bref.unpack(rx_params_add_neigh_freq_r13_present, 1));
      rx_params_add_neigh_freq_r13.set_present(rx_params_add_neigh_freq_r13_present);
      bool tx_params_add_neigh_freq_r13_present;
      HANDLE_CODE(bref.unpack(tx_params_add_neigh_freq_r13_present, 1));
      tx_params_add_neigh_freq_r13.set_present(tx_params_add_neigh_freq_r13_present);
      if (disc_period_v1310.is_present()) {
        HANDLE_CODE(disc_period_v1310->unpack(bref));
      }
      if (rx_params_add_neigh_freq_r13.is_present()) {
        HANDLE_CODE(rx_params_add_neigh_freq_r13->unpack(bref));
      }
      if (tx_params_add_neigh_freq_r13.is_present()) {
        HANDLE_CODE(tx_params_add_neigh_freq_r13->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool tx_params_add_neigh_freq_v1370_present;
      HANDLE_CODE(bref.unpack(tx_params_add_neigh_freq_v1370_present, 1));
      tx_params_add_neigh_freq_v1370.set_present(tx_params_add_neigh_freq_v1370_present);
      if (tx_params_add_neigh_freq_v1370.is_present()) {
        HANDLE_CODE(tx_params_add_neigh_freq_v1370->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_disc_res_pool_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cp-Len-r12", cp_len_r12.to_string());
  j.write_str("discPeriod-r12", disc_period_r12.to_string());
  j.write_int("numRetx-r12", num_retx_r12);
  j.write_int("numRepetition-r12", num_repeat_r12);
  j.write_fieldname("tf-ResourceConfig-r12");
  tf_res_cfg_r12.to_json(j);
  if (tx_params_r12_present) {
    j.write_fieldname("txParameters-r12");
    j.start_obj();
    j.write_fieldname("txParametersGeneral-r12");
    tx_params_r12.tx_params_general_r12.to_json(j);
    if (tx_params_r12.ue_sel_res_cfg_r12_present) {
      j.write_fieldname("ue-SelectedResourceConfig-r12");
      j.start_obj();
      j.write_fieldname("poolSelection-r12");
      tx_params_r12.ue_sel_res_cfg_r12.pool_sel_r12.to_json(j);
      j.write_str("txProbability-r12", tx_params_r12.ue_sel_res_cfg_r12.tx_probability_r12.to_string());
      j.end_obj();
    }
    j.end_obj();
  }
  if (rx_params_r12_present) {
    j.write_fieldname("rxParameters-r12");
    j.start_obj();
    if (rx_params_r12.tdd_cfg_r12_present) {
      j.write_fieldname("tdd-Config-r12");
      rx_params_r12.tdd_cfg_r12.to_json(j);
    }
    j.write_int("syncConfigIndex-r12", rx_params_r12.sync_cfg_idx_r12);
    j.end_obj();
  }
  if (ext) {
    if (disc_period_v1310.is_present()) {
      j.write_fieldname("discPeriod-v1310");
      disc_period_v1310->to_json(j);
    }
    if (rx_params_add_neigh_freq_r13.is_present()) {
      j.write_fieldname("rxParamsAddNeighFreq-r13");
      rx_params_add_neigh_freq_r13->to_json(j);
    }
    if (tx_params_add_neigh_freq_r13.is_present()) {
      j.write_fieldname("txParamsAddNeighFreq-r13");
      tx_params_add_neigh_freq_r13->to_json(j);
    }
    if (tx_params_add_neigh_freq_v1370.is_present()) {
      j.write_fieldname("txParamsAddNeighFreq-v1370");
      tx_params_add_neigh_freq_v1370->to_json(j);
    }
  }
  j.end_obj();
}

void sl_disc_res_pool_r12_s::tx_params_r12_s_::ue_sel_res_cfg_r12_s_::pool_sel_r12_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_res_pool_r12_s::tx_params_r12_s_::ue_sel_res_cfg_r12_s_::pool_sel_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rsrp_based_r12:
      j.write_fieldname("rsrpBased-r12");
      c.to_json(j);
      break;
    case types::random_r12:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_r12_s_::ue_sel_res_cfg_r12_s_::pool_sel_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_res_pool_r12_s::tx_params_r12_s_::ue_sel_res_cfg_r12_s_::pool_sel_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rsrp_based_r12:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::random_r12:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_r12_s_::ue_sel_res_cfg_r12_s_::pool_sel_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_res_pool_r12_s::tx_params_r12_s_::ue_sel_res_cfg_r12_s_::pool_sel_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rsrp_based_r12:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::random_r12:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_r12_s_::ue_sel_res_cfg_r12_s_::pool_sel_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_res_pool_r12_s::disc_period_v1310_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_res_pool_r12_s::disc_period_v1310_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::disc_period_v1310_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_res_pool_r12_s::disc_period_v1310_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::disc_period_v1310_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_res_pool_r12_s::disc_period_v1310_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::disc_period_v1310_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_res_pool_r12_s::rx_params_add_neigh_freq_r13_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_res_pool_r12_s::rx_params_add_neigh_freq_r13_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("physCellId-r13");
      for (const auto& e1 : c.pci_r13) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::rx_params_add_neigh_freq_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_res_pool_r12_s::rx_params_add_neigh_freq_r13_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.pci_r13, 1, 16, integer_packer<uint16_t>(0, 503)));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::rx_params_add_neigh_freq_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_res_pool_r12_s::rx_params_add_neigh_freq_r13_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.pci_r13, bref, 1, 16, integer_packer<uint16_t>(0, 503)));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::rx_params_add_neigh_freq_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_r13_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_r13_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("physCellId-r13");
      for (const auto& e1 : c.pci_r13) {
        j.write_int(e1);
      }
      j.end_array();
      if (c.p_max_present) {
        j.write_int("p-Max", c.p_max);
      }
      if (c.tdd_cfg_r13_present) {
        j.write_fieldname("tdd-Config-r13");
        c.tdd_cfg_r13.to_json(j);
      }
      if (c.tdd_cfg_v1130_present) {
        j.write_fieldname("tdd-Config-v1130");
        c.tdd_cfg_v1130.to_json(j);
      }
      j.write_fieldname("freqInfo");
      j.start_obj();
      if (c.freq_info.ul_carrier_freq_present) {
        j.write_int("ul-CarrierFreq", c.freq_info.ul_carrier_freq);
      }
      if (c.freq_info.ul_bw_present) {
        j.write_str("ul-Bandwidth", c.freq_info.ul_bw.to_string());
      }
      j.write_int("additionalSpectrumEmission", c.freq_info.add_spec_emission);
      j.end_obj();
      j.write_int("referenceSignalPower", c.ref_sig_pwr);
      if (c.sync_cfg_idx_r13_present) {
        j.write_int("syncConfigIndex-r13", c.sync_cfg_idx_r13);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.p_max_present, 1));
      HANDLE_CODE(bref.pack(c.tdd_cfg_r13_present, 1));
      HANDLE_CODE(bref.pack(c.tdd_cfg_v1130_present, 1));
      HANDLE_CODE(bref.pack(c.sync_cfg_idx_r13_present, 1));
      HANDLE_CODE(pack_dyn_seq_of(bref, c.pci_r13, 1, 16, integer_packer<uint16_t>(0, 503)));
      if (c.p_max_present) {
        HANDLE_CODE(pack_integer(bref, c.p_max, (int8_t)-30, (int8_t)33));
      }
      if (c.tdd_cfg_r13_present) {
        HANDLE_CODE(c.tdd_cfg_r13.pack(bref));
      }
      if (c.tdd_cfg_v1130_present) {
        HANDLE_CODE(c.tdd_cfg_v1130.pack(bref));
      }
      HANDLE_CODE(bref.pack(c.freq_info.ul_carrier_freq_present, 1));
      HANDLE_CODE(bref.pack(c.freq_info.ul_bw_present, 1));
      if (c.freq_info.ul_carrier_freq_present) {
        HANDLE_CODE(pack_integer(bref, c.freq_info.ul_carrier_freq, (uint32_t)0u, (uint32_t)65535u));
      }
      if (c.freq_info.ul_bw_present) {
        HANDLE_CODE(c.freq_info.ul_bw.pack(bref));
      }
      HANDLE_CODE(pack_integer(bref, c.freq_info.add_spec_emission, (uint8_t)1u, (uint8_t)32u));
      HANDLE_CODE(pack_integer(bref, c.ref_sig_pwr, (int8_t)-60, (int8_t)50));
      if (c.sync_cfg_idx_r13_present) {
        HANDLE_CODE(pack_integer(bref, c.sync_cfg_idx_r13, (uint8_t)0u, (uint8_t)15u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_r13_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.p_max_present, 1));
      HANDLE_CODE(bref.unpack(c.tdd_cfg_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.tdd_cfg_v1130_present, 1));
      HANDLE_CODE(bref.unpack(c.sync_cfg_idx_r13_present, 1));
      HANDLE_CODE(unpack_dyn_seq_of(c.pci_r13, bref, 1, 16, integer_packer<uint16_t>(0, 503)));
      if (c.p_max_present) {
        HANDLE_CODE(unpack_integer(c.p_max, bref, (int8_t)-30, (int8_t)33));
      }
      if (c.tdd_cfg_r13_present) {
        HANDLE_CODE(c.tdd_cfg_r13.unpack(bref));
      }
      if (c.tdd_cfg_v1130_present) {
        HANDLE_CODE(c.tdd_cfg_v1130.unpack(bref));
      }
      HANDLE_CODE(bref.unpack(c.freq_info.ul_carrier_freq_present, 1));
      HANDLE_CODE(bref.unpack(c.freq_info.ul_bw_present, 1));
      if (c.freq_info.ul_carrier_freq_present) {
        HANDLE_CODE(unpack_integer(c.freq_info.ul_carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u));
      }
      if (c.freq_info.ul_bw_present) {
        HANDLE_CODE(c.freq_info.ul_bw.unpack(bref));
      }
      HANDLE_CODE(unpack_integer(c.freq_info.add_spec_emission, bref, (uint8_t)1u, (uint8_t)32u));
      HANDLE_CODE(unpack_integer(c.ref_sig_pwr, bref, (int8_t)-60, (int8_t)50));
      if (c.sync_cfg_idx_r13_present) {
        HANDLE_CODE(unpack_integer(c.sync_cfg_idx_r13, bref, (uint8_t)0u, (uint8_t)15u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_v1370_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_v1370_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("freqInfo-v1370");
      j.start_obj();
      j.write_int("additionalSpectrumEmission-v1370", c.freq_info_v1370.add_spec_emission_v1370);
      j.end_obj();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_v1370_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_v1370_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.freq_info_v1370.add_spec_emission_v1370, (uint16_t)33u, (uint16_t)288u));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_v1370_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_v1370_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.freq_info_v1370.add_spec_emission_v1370, bref, (uint16_t)33u, (uint16_t)288u));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_res_pool_r12_s::tx_params_add_neigh_freq_v1370_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-ZoneConfig-r14 ::= SEQUENCE
SRSASN_CODE sl_zone_cfg_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(zone_len_r14.pack(bref));
  HANDLE_CODE(zone_width_r14.pack(bref));
  HANDLE_CODE(pack_integer(bref, zone_id_longi_mod_r14, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(pack_integer(bref, zone_id_lati_mod_r14, (uint8_t)1u, (uint8_t)4u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_zone_cfg_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(zone_len_r14.unpack(bref));
  HANDLE_CODE(zone_width_r14.unpack(bref));
  HANDLE_CODE(unpack_integer(zone_id_longi_mod_r14, bref, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(unpack_integer(zone_id_lati_mod_r14, bref, (uint8_t)1u, (uint8_t)4u));

  return SRSASN_SUCCESS;
}
void sl_zone_cfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("zoneLength-r14", zone_len_r14.to_string());
  j.write_str("zoneWidth-r14", zone_width_r14.to_string());
  j.write_int("zoneIdLongiMod-r14", zone_id_longi_mod_r14);
  j.write_int("zoneIdLatiMod-r14", zone_id_lati_mod_r14);
  j.end_obj();
}

// SystemInformationBlockType1-v1360-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1360_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cell_sel_info_ce1_v1360_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (cell_sel_info_ce1_v1360_present) {
    HANDLE_CODE(cell_sel_info_ce1_v1360.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1360_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cell_sel_info_ce1_v1360_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (cell_sel_info_ce1_v1360_present) {
    HANDLE_CODE(cell_sel_info_ce1_v1360.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1360_ies_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);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  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<Packer>(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<Packer>(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();
}

// MultiBandInfo-v9e0 ::= SEQUENCE
SRSASN_CODE multi_band_info_v9e0_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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE multi_band_info_v9e0_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));
  }

  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();
}

// NeighCellCDMA2000-r11 ::= SEQUENCE
SRSASN_CODE neigh_cell_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));

  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cell_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));

  return SRSASN_SUCCESS;
}
void neigh_cell_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) {
    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<uint16_t>(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<uint16_t>(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.end_array();
  j.end_obj();
}

// NeighCellsPerBandclassCDMA2000-v920 ::= SEQUENCE
SRSASN_CODE neigh_cells_per_bandclass_cdma2000_v920_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, pci_list_v920, 0, 24, integer_packer<uint16_t>(0, 511)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cells_per_bandclass_cdma2000_v920_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(pci_list_v920, bref, 0, 24, integer_packer<uint16_t>(0, 511)));

  return SRSASN_SUCCESS;
}
void neigh_cells_per_bandclass_cdma2000_v920_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.end_obj();
}

// PhysCellIdRange ::= SEQUENCE
SRSASN_CODE pci_range_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(range_present, 1));

  HANDLE_CODE(pack_integer(bref, start, (uint16_t)0u, (uint16_t)503u));
  if (range_present) {
    HANDLE_CODE(range.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pci_range_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(range_present, 1));

  HANDLE_CODE(unpack_integer(start, bref, (uint16_t)0u, (uint16_t)503u));
  if (range_present) {
    HANDLE_CODE(range.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pci_range_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("start", start);
  if (range_present) {
    j.write_str("range", range.to_string());
  }
  j.end_obj();
}

// RedistributionNeighCell-r13 ::= SEQUENCE
SRSASN_CODE redist_neigh_cell_r13_s::pack(bit_ref& bref) const
{
  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 redist_neigh_cell_r13_s::unpack(cbit_ref& 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 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();
}

// SL-DiscTxPowerInfo-r12 ::= SEQUENCE
SRSASN_CODE sl_disc_tx_pwr_info_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, disc_max_tx_pwr_r12, (int8_t)-30, (int8_t)33));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_pwr_info_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(disc_max_tx_pwr_r12, bref, (int8_t)-30, (int8_t)33));

  return SRSASN_SUCCESS;
}
void sl_disc_tx_pwr_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("discMaxTxPower-r12", disc_max_tx_pwr_r12);
  j.end_obj();
}

// SL-V2X-FreqSelectionConfig-r15 ::= SEQUENCE
SRSASN_CODE sl_v2x_freq_sel_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(thresh_cbr_freq_resel_r15_present, 1));
  HANDLE_CODE(bref.pack(thresh_cbr_freq_keeping_r15_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, prio_list_r15, 1, 8, integer_packer<uint8_t>(1, 8)));
  if (thresh_cbr_freq_resel_r15_present) {
    HANDLE_CODE(pack_integer(bref, thresh_cbr_freq_resel_r15, (uint8_t)0u, (uint8_t)100u));
  }
  if (thresh_cbr_freq_keeping_r15_present) {
    HANDLE_CODE(pack_integer(bref, thresh_cbr_freq_keeping_r15, (uint8_t)0u, (uint8_t)100u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_freq_sel_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(thresh_cbr_freq_resel_r15_present, 1));
  HANDLE_CODE(bref.unpack(thresh_cbr_freq_keeping_r15_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(prio_list_r15, bref, 1, 8, integer_packer<uint8_t>(1, 8)));
  if (thresh_cbr_freq_resel_r15_present) {
    HANDLE_CODE(unpack_integer(thresh_cbr_freq_resel_r15, bref, (uint8_t)0u, (uint8_t)100u));
  }
  if (thresh_cbr_freq_keeping_r15_present) {
    HANDLE_CODE(unpack_integer(thresh_cbr_freq_keeping_r15, bref, (uint8_t)0u, (uint8_t)100u));
  }

  return SRSASN_SUCCESS;
}
void sl_v2x_freq_sel_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("priorityList-r15");
  for (const auto& e1 : prio_list_r15) {
    j.write_int(e1);
  }
  j.end_array();
  if (thresh_cbr_freq_resel_r15_present) {
    j.write_int("threshCBR-FreqReselection-r15", thresh_cbr_freq_resel_r15);
  }
  if (thresh_cbr_freq_keeping_r15_present) {
    j.write_int("threshCBR-FreqKeeping-r15", thresh_cbr_freq_keeping_r15);
  }
  j.end_obj();
}

// SL-V2X-InterFreqUE-Config-r14 ::= SEQUENCE
SRSASN_CODE sl_v2x_inter_freq_ue_cfg_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(pci_list_r14_present, 1));
  HANDLE_CODE(bref.pack(type_tx_sync_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_sync_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_comm_rx_pool_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_comm_tx_pool_normal_r14_present, 1));
  HANDLE_CODE(bref.pack(p2x_comm_tx_pool_normal_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_comm_tx_pool_exceptional_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_res_sel_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(zone_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(offset_dfn_r14_present, 1));

  if (pci_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, pci_list_r14, 1, 16, integer_packer<uint16_t>(0, 503)));
  }
  if (type_tx_sync_r14_present) {
    HANDLE_CODE(type_tx_sync_r14.pack(bref));
  }
  if (v2x_sync_cfg_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_sync_cfg_r14, 1, 16));
  }
  if (v2x_comm_rx_pool_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_rx_pool_r14, 1, 16));
  }
  if (v2x_comm_tx_pool_normal_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_tx_pool_normal_r14, 1, 8));
  }
  if (p2x_comm_tx_pool_normal_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, p2x_comm_tx_pool_normal_r14, 1, 8));
  }
  if (v2x_comm_tx_pool_exceptional_r14_present) {
    HANDLE_CODE(v2x_comm_tx_pool_exceptional_r14.pack(bref));
  }
  if (v2x_res_sel_cfg_r14_present) {
    HANDLE_CODE(v2x_res_sel_cfg_r14.pack(bref));
  }
  if (zone_cfg_r14_present) {
    HANDLE_CODE(zone_cfg_r14.pack(bref));
  }
  if (offset_dfn_r14_present) {
    HANDLE_CODE(pack_integer(bref, offset_dfn_r14, (uint16_t)0u, (uint16_t)1000u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_inter_freq_ue_cfg_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(pci_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(type_tx_sync_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_sync_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_comm_rx_pool_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_comm_tx_pool_normal_r14_present, 1));
  HANDLE_CODE(bref.unpack(p2x_comm_tx_pool_normal_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_comm_tx_pool_exceptional_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_res_sel_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(zone_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(offset_dfn_r14_present, 1));

  if (pci_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(pci_list_r14, bref, 1, 16, integer_packer<uint16_t>(0, 503)));
  }
  if (type_tx_sync_r14_present) {
    HANDLE_CODE(type_tx_sync_r14.unpack(bref));
  }
  if (v2x_sync_cfg_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_sync_cfg_r14, bref, 1, 16));
  }
  if (v2x_comm_rx_pool_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_rx_pool_r14, bref, 1, 16));
  }
  if (v2x_comm_tx_pool_normal_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_tx_pool_normal_r14, bref, 1, 8));
  }
  if (p2x_comm_tx_pool_normal_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(p2x_comm_tx_pool_normal_r14, bref, 1, 8));
  }
  if (v2x_comm_tx_pool_exceptional_r14_present) {
    HANDLE_CODE(v2x_comm_tx_pool_exceptional_r14.unpack(bref));
  }
  if (v2x_res_sel_cfg_r14_present) {
    HANDLE_CODE(v2x_res_sel_cfg_r14.unpack(bref));
  }
  if (zone_cfg_r14_present) {
    HANDLE_CODE(zone_cfg_r14.unpack(bref));
  }
  if (offset_dfn_r14_present) {
    HANDLE_CODE(unpack_integer(offset_dfn_r14, bref, (uint16_t)0u, (uint16_t)1000u));
  }

  return SRSASN_SUCCESS;
}
void sl_v2x_inter_freq_ue_cfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pci_list_r14_present) {
    j.start_array("physCellIdList-r14");
    for (const auto& e1 : pci_list_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (type_tx_sync_r14_present) {
    j.write_str("typeTxSync-r14", type_tx_sync_r14.to_string());
  }
  if (v2x_sync_cfg_r14_present) {
    j.start_array("v2x-SyncConfig-r14");
    for (const auto& e1 : v2x_sync_cfg_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_comm_rx_pool_r14_present) {
    j.start_array("v2x-CommRxPool-r14");
    for (const auto& e1 : v2x_comm_rx_pool_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_comm_tx_pool_normal_r14_present) {
    j.start_array("v2x-CommTxPoolNormal-r14");
    for (const auto& e1 : v2x_comm_tx_pool_normal_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (p2x_comm_tx_pool_normal_r14_present) {
    j.start_array("p2x-CommTxPoolNormal-r14");
    for (const auto& e1 : p2x_comm_tx_pool_normal_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_comm_tx_pool_exceptional_r14_present) {
    j.write_fieldname("v2x-CommTxPoolExceptional-r14");
    v2x_comm_tx_pool_exceptional_r14.to_json(j);
  }
  if (v2x_res_sel_cfg_r14_present) {
    j.write_fieldname("v2x-ResourceSelectionConfig-r14");
    v2x_res_sel_cfg_r14.to_json(j);
  }
  if (zone_cfg_r14_present) {
    j.write_fieldname("zoneConfig-r14");
    zone_cfg_r14.to_json(j);
  }
  if (offset_dfn_r14_present) {
    j.write_int("offsetDFN-r14", offset_dfn_r14);
  }
  j.end_obj();
}

// SchedulingInfo-BR-r13 ::= SEQUENCE
SRSASN_CODE sched_info_br_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, si_nb_r13, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(si_tbs_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sched_info_br_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(si_nb_r13, bref, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(si_tbs_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void sched_info_br_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("si-Narrowband-r13", si_nb_r13);
  j.write_str("si-TBS-r13", si_tbs_r13.to_string());
  j.end_obj();
}

// SpeedStateScaleFactors ::= SEQUENCE
SRSASN_CODE speed_state_scale_factors_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sf_medium.pack(bref));
  HANDLE_CODE(sf_high.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE speed_state_scale_factors_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sf_medium.unpack(bref));
  HANDLE_CODE(sf_high.unpack(bref));

  return SRSASN_SUCCESS;
}
void speed_state_scale_factors_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sf-Medium", sf_medium.to_string());
  j.write_str("sf-High", sf_high.to_string());
  j.end_obj();
}

// SystemInformationBlockType1-v1350-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1350_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cell_sel_info_ce1_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (cell_sel_info_ce1_r13_present) {
    HANDLE_CODE(cell_sel_info_ce1_r13.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1350_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cell_sel_info_ce1_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (cell_sel_info_ce1_r13_present) {
    HANDLE_CODE(cell_sel_info_ce1_r13.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1350_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cell_sel_info_ce1_r13_present) {
    j.write_fieldname("cellSelectionInfoCE1-r13");
    cell_sel_info_ce1_r13.to_json(j);
  }
  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
{
  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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type5_v13a0_ies_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));
  }

  return SRSASN_SUCCESS;
}
void sib_type5_v13a0_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 (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();
}

// AC-BarringConfig1XRTT-r9 ::= SEQUENCE
SRSASN_CODE ac_barr_cfg1_xrtt_r9_s::pack(bit_ref& bref) const
{
  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 ac_barr_cfg1_xrtt_r9_s::unpack(cbit_ref& bref)
{
  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();
}

// BarringPerACDC-Category-r13 ::= SEQUENCE
SRSASN_CODE barr_per_acdc_category_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(acdc_barr_cfg_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, acdc_category_r13, (uint8_t)1u, (uint8_t)16u));
  if (acdc_barr_cfg_r13_present) {
    HANDLE_CODE(acdc_barr_cfg_r13.ac_barr_factor_r13.pack(bref));
    HANDLE_CODE(acdc_barr_cfg_r13.ac_barr_time_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE barr_per_acdc_category_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(acdc_barr_cfg_r13_present, 1));

  HANDLE_CODE(unpack_integer(acdc_category_r13, bref, (uint8_t)1u, (uint8_t)16u));
  if (acdc_barr_cfg_r13_present) {
    HANDLE_CODE(acdc_barr_cfg_r13.ac_barr_factor_r13.unpack(bref));
    HANDLE_CODE(acdc_barr_cfg_r13.ac_barr_time_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void barr_per_acdc_category_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("acdc-Category-r13", acdc_category_r13);
  if (acdc_barr_cfg_r13_present) {
    j.write_fieldname("acdc-BarringConfig-r13");
    j.start_obj();
    j.write_str("ac-BarringFactor-r13", acdc_barr_cfg_r13.ac_barr_factor_r13.to_string());
    j.write_str("ac-BarringTime-r13", acdc_barr_cfg_r13.ac_barr_time_r13.to_string());
    j.end_obj();
  }
  j.end_obj();
}

// CSFB-RegistrationParam1XRTT ::= SEQUENCE
SRSASN_CODE csfb_regist_param1_xrtt_s::pack(bit_ref& bref) const
{
  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 csfb_regist_param1_xrtt_s::unpack(cbit_ref& bref)
{
  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 csfb_regist_param1_xrtt_s::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());
  j.end_obj();
}

// CSFB-RegistrationParam1XRTT-v920 ::= SEQUENCE
SRSASN_CODE csfb_regist_param1_xrtt_v920_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE csfb_regist_param1_xrtt_v920_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void csfb_regist_param1_xrtt_v920_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("powerDownReg-r9", "true");
  j.end_obj();
}

// CellReselectionParametersCDMA2000-r11 ::= SEQUENCE
SRSASN_CODE cell_resel_params_cdma2000_r11_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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_resel_params_cdma2000_r11_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));
  }

  return SRSASN_SUCCESS;
}
void cell_resel_params_cdma2000_r11_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) {
    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();
}

// CellSelectionInfoCE-r13 ::= SEQUENCE
SRSASN_CODE cell_sel_info_ce_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(q_qual_min_rsrq_ce_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, q_rx_lev_min_ce_r13, (int8_t)-70, (int8_t)-22));
  if (q_qual_min_rsrq_ce_r13_present) {
    HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_ce_r13, (int8_t)-34, (int8_t)-3));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_sel_info_ce_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(q_qual_min_rsrq_ce_r13_present, 1));

  HANDLE_CODE(unpack_integer(q_rx_lev_min_ce_r13, bref, (int8_t)-70, (int8_t)-22));
  if (q_qual_min_rsrq_ce_r13_present) {
    HANDLE_CODE(unpack_integer(q_qual_min_rsrq_ce_r13, bref, (int8_t)-34, (int8_t)-3));
  }

  return SRSASN_SUCCESS;
}
void cell_sel_info_ce_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("q-RxLevMinCE-r13", q_rx_lev_min_ce_r13);
  if (q_qual_min_rsrq_ce_r13_present) {
    j.write_int("q-QualMinRSRQ-CE-r13", q_qual_min_rsrq_ce_r13);
  }
  j.end_obj();
}

// CellSelectionInfoNFreq-r13 ::= SEQUENCE
SRSASN_CODE cell_sel_info_nfreq_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(q_rx_lev_min_offset_present, 1));

  HANDLE_CODE(pack_integer(bref, q_rx_lev_min_r13, (int8_t)-70, (int8_t)-22));
  if (q_rx_lev_min_offset_present) {
    HANDLE_CODE(pack_integer(bref, q_rx_lev_min_offset, (uint8_t)1u, (uint8_t)8u));
  }
  HANDLE_CODE(q_hyst_r13.pack(bref));
  HANDLE_CODE(pack_integer(bref, q_rx_lev_min_resel_r13, (int8_t)-70, (int8_t)-22));
  HANDLE_CODE(pack_integer(bref, t_resel_eutra_r13, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_sel_info_nfreq_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(q_rx_lev_min_offset_present, 1));

  HANDLE_CODE(unpack_integer(q_rx_lev_min_r13, bref, (int8_t)-70, (int8_t)-22));
  if (q_rx_lev_min_offset_present) {
    HANDLE_CODE(unpack_integer(q_rx_lev_min_offset, bref, (uint8_t)1u, (uint8_t)8u));
  }
  HANDLE_CODE(q_hyst_r13.unpack(bref));
  HANDLE_CODE(unpack_integer(q_rx_lev_min_resel_r13, bref, (int8_t)-70, (int8_t)-22));
  HANDLE_CODE(unpack_integer(t_resel_eutra_r13, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void cell_sel_info_nfreq_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("q-RxLevMin-r13", q_rx_lev_min_r13);
  if (q_rx_lev_min_offset_present) {
    j.write_int("q-RxLevMinOffset", q_rx_lev_min_offset);
  }
  j.write_str("q-Hyst-r13", q_hyst_r13.to_string());
  j.write_int("q-RxLevMinReselection-r13", q_rx_lev_min_resel_r13);
  j.write_int("t-ReselectionEUTRA-r13", t_resel_eutra_r13);
  j.end_obj();
}

// InterFreqCarrierFreqInfo-v10j0 ::= SEQUENCE
SRSASN_CODE inter_freq_carrier_freq_info_v10j0_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<Packer>(1, 8, Packer())));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_carrier_freq_info_v10j0_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<Packer>(1, 8, Packer())));
  }

  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();
  }
  j.end_obj();
}

// InterFreqNeighCellInfo ::= SEQUENCE
SRSASN_CODE inter_freq_neigh_cell_info_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));

  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));

  return SRSASN_SUCCESS;
}
void inter_freq_neigh_cell_info_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.end_obj();
}

// NS-PmaxValueNR-r15 ::= SEQUENCE
SRSASN_CODE ns_pmax_value_nr_r15_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)
{
  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
{
  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.end_obj();
}

// PLMN-IdentityInfo2-r12 ::= CHOICE
void plmn_id_info2_r12_c::destroy_()
{
  switch (type_) {
    case types::plmn_id_r12:
      c.destroy<plmn_id_s>();
      break;
    default:
      break;
  }
}
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<plmn_id_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info2_r12_c");
  }
}
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<uint8_t>());
      break;
    case types::plmn_id_r12:
      c.init(other.c.get<plmn_id_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info2_r12_c");
  }
}
plmn_id_info2_r12_c& plmn_id_info2_r12_c::operator=(const plmn_id_info2_r12_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::plmn_idx_r12:
      c.set(other.c.get<uint8_t>());
      break;
    case types::plmn_id_r12:
      c.set(other.c.get<plmn_id_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info2_r12_c");
  }

  return *this;
}
void plmn_id_info2_r12_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<uint8_t>());
      break;
    case types::plmn_id_r12:
      j.write_fieldname("plmnIdentity-r12");
      c.get<plmn_id_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info2_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE plmn_id_info2_r12_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>(), (uint8_t)1u, (uint8_t)6u));
      break;
    case types::plmn_id_r12:
      HANDLE_CODE(c.get<plmn_id_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info2_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_id_info2_r12_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<uint8_t>(), bref, (uint8_t)1u, (uint8_t)6u));
      break;
    case types::plmn_id_r12:
      HANDLE_CODE(c.get<plmn_id_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "plmn_id_info2_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PRACH-ParametersCE-r13 ::= SEQUENCE
SRSASN_CODE prach_params_ce_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(prach_start_sf_r13_present, 1));
  HANDLE_CODE(bref.pack(max_num_preamb_attempt_ce_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, prach_cfg_idx_r13, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(pack_integer(bref, prach_freq_offset_r13, (uint8_t)0u, (uint8_t)94u));
  if (prach_start_sf_r13_present) {
    HANDLE_CODE(prach_start_sf_r13.pack(bref));
  }
  if (max_num_preamb_attempt_ce_r13_present) {
    HANDLE_CODE(max_num_preamb_attempt_ce_r13.pack(bref));
  }
  HANDLE_CODE(num_repeat_per_preamb_attempt_r13.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, mpdcch_nbs_to_monitor_r13, 1, 2, integer_packer<uint8_t>(1, 16)));
  HANDLE_CODE(mpdcch_num_repeat_ra_r13.pack(bref));
  HANDLE_CODE(prach_hop_cfg_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_params_ce_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(prach_start_sf_r13_present, 1));
  HANDLE_CODE(bref.unpack(max_num_preamb_attempt_ce_r13_present, 1));

  HANDLE_CODE(unpack_integer(prach_cfg_idx_r13, bref, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(unpack_integer(prach_freq_offset_r13, bref, (uint8_t)0u, (uint8_t)94u));
  if (prach_start_sf_r13_present) {
    HANDLE_CODE(prach_start_sf_r13.unpack(bref));
  }
  if (max_num_preamb_attempt_ce_r13_present) {
    HANDLE_CODE(max_num_preamb_attempt_ce_r13.unpack(bref));
  }
  HANDLE_CODE(num_repeat_per_preamb_attempt_r13.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(mpdcch_nbs_to_monitor_r13, bref, 1, 2, integer_packer<uint8_t>(1, 16)));
  HANDLE_CODE(mpdcch_num_repeat_ra_r13.unpack(bref));
  HANDLE_CODE(prach_hop_cfg_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void prach_params_ce_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("prach-ConfigIndex-r13", prach_cfg_idx_r13);
  j.write_int("prach-FreqOffset-r13", prach_freq_offset_r13);
  if (prach_start_sf_r13_present) {
    j.write_str("prach-StartingSubframe-r13", prach_start_sf_r13.to_string());
  }
  if (max_num_preamb_attempt_ce_r13_present) {
    j.write_str("maxNumPreambleAttemptCE-r13", max_num_preamb_attempt_ce_r13.to_string());
  }
  j.write_str("numRepetitionPerPreambleAttempt-r13", num_repeat_per_preamb_attempt_r13.to_string());
  j.start_array("mpdcch-NarrowbandsToMonitor-r13");
  for (const auto& e1 : mpdcch_nbs_to_monitor_r13) {
    j.write_int(e1);
  }
  j.end_array();
  j.write_str("mpdcch-NumRepetition-RA-r13", mpdcch_num_repeat_ra_r13.to_string());
  j.write_str("prach-HoppingConfig-r13", prach_hop_cfg_r13.to_string());
  j.end_obj();
}

// PreRegistrationInfoHRPD ::= SEQUENCE
SRSASN_CODE pre_regist_info_hrpd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pre_regist_zone_id_present, 1));
  HANDLE_CODE(bref.pack(secondary_pre_regist_zone_id_list_present, 1));

  HANDLE_CODE(bref.pack(pre_regist_allowed, 1));
  if (pre_regist_zone_id_present) {
    HANDLE_CODE(pack_integer(bref, pre_regist_zone_id, (uint16_t)0u, (uint16_t)255u));
  }
  if (secondary_pre_regist_zone_id_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, secondary_pre_regist_zone_id_list, 1, 2, integer_packer<uint16_t>(0, 255)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pre_regist_info_hrpd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pre_regist_zone_id_present, 1));
  HANDLE_CODE(bref.unpack(secondary_pre_regist_zone_id_list_present, 1));

  HANDLE_CODE(bref.unpack(pre_regist_allowed, 1));
  if (pre_regist_zone_id_present) {
    HANDLE_CODE(unpack_integer(pre_regist_zone_id, bref, (uint16_t)0u, (uint16_t)255u));
  }
  if (secondary_pre_regist_zone_id_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(secondary_pre_regist_zone_id_list, bref, 1, 2, integer_packer<uint16_t>(0, 255)));
  }

  return SRSASN_SUCCESS;
}
void pre_regist_info_hrpd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("preRegistrationAllowed", pre_regist_allowed);
  if (pre_regist_zone_id_present) {
    j.write_int("preRegistrationZoneId", pre_regist_zone_id);
  }
  if (secondary_pre_regist_zone_id_list_present) {
    j.start_array("secondaryPreRegistrationZoneIdList");
    for (const auto& e1 : secondary_pre_regist_zone_id_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.end_obj();
}

// RACH-CE-LevelInfo-r13 ::= SEQUENCE
SRSASN_CODE rach_ce_level_info_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, preamb_map_info_r13.first_preamb_r13, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(pack_integer(bref, preamb_map_info_r13.last_preamb_r13, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(ra_resp_win_size_r13.pack(bref));
  HANDLE_CODE(mac_contention_resolution_timer_r13.pack(bref));
  HANDLE_CODE(rar_hop_cfg_r13.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= edt_params_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(edt_params_r15.is_present(), 1));
      if (edt_params_r15.is_present()) {
        HANDLE_CODE(bref.pack(edt_params_r15->mac_contention_resolution_timer_r15_present, 1));
        HANDLE_CODE(pack_integer(bref, edt_params_r15->edt_last_preamb_r15, (uint8_t)0u, (uint8_t)63u));
        HANDLE_CODE(bref.pack(edt_params_r15->edt_small_tbs_enabled_r15, 1));
        HANDLE_CODE(edt_params_r15->edt_tbs_r15.pack(bref));
        if (edt_params_r15->mac_contention_resolution_timer_r15_present) {
          HANDLE_CODE(edt_params_r15->mac_contention_resolution_timer_r15.pack(bref));
        }
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rach_ce_level_info_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(preamb_map_info_r13.first_preamb_r13, bref, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(unpack_integer(preamb_map_info_r13.last_preamb_r13, bref, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(ra_resp_win_size_r13.unpack(bref));
  HANDLE_CODE(mac_contention_resolution_timer_r13.unpack(bref));
  HANDLE_CODE(rar_hop_cfg_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 edt_params_r15_present;
      HANDLE_CODE(bref.unpack(edt_params_r15_present, 1));
      edt_params_r15.set_present(edt_params_r15_present);
      if (edt_params_r15.is_present()) {
        HANDLE_CODE(bref.unpack(edt_params_r15->mac_contention_resolution_timer_r15_present, 1));
        HANDLE_CODE(unpack_integer(edt_params_r15->edt_last_preamb_r15, bref, (uint8_t)0u, (uint8_t)63u));
        HANDLE_CODE(bref.unpack(edt_params_r15->edt_small_tbs_enabled_r15, 1));
        HANDLE_CODE(edt_params_r15->edt_tbs_r15.unpack(bref));
        if (edt_params_r15->mac_contention_resolution_timer_r15_present) {
          HANDLE_CODE(edt_params_r15->mac_contention_resolution_timer_r15.unpack(bref));
        }
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rach_ce_level_info_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("preambleMappingInfo-r13");
  j.start_obj();
  j.write_int("firstPreamble-r13", preamb_map_info_r13.first_preamb_r13);
  j.write_int("lastPreamble-r13", preamb_map_info_r13.last_preamb_r13);
  j.end_obj();
  j.write_str("ra-ResponseWindowSize-r13", ra_resp_win_size_r13.to_string());
  j.write_str("mac-ContentionResolutionTimer-r13", mac_contention_resolution_timer_r13.to_string());
  j.write_str("rar-HoppingConfig-r13", rar_hop_cfg_r13.to_string());
  if (ext) {
    if (edt_params_r15.is_present()) {
      j.write_fieldname("edt-Parameters-r15");
      j.start_obj();
      j.write_int("edt-LastPreamble-r15", edt_params_r15->edt_last_preamb_r15);
      j.write_bool("edt-SmallTBS-Enabled-r15", edt_params_r15->edt_small_tbs_enabled_r15);
      j.write_str("edt-TBS-r15", edt_params_r15->edt_tbs_r15.to_string());
      if (edt_params_r15->mac_contention_resolution_timer_r15_present) {
        j.write_str("mac-ContentionResolutionTimer-r15",
                    edt_params_r15->mac_contention_resolution_timer_r15.to_string());
      }
      j.end_obj();
    }
  }
  j.end_obj();
}

// SL-AllowedCarrierFreqList-r15 ::= SEQUENCE
SRSASN_CODE sl_allowed_carrier_freq_list_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, allowed_carrier_freq_set1, 1, 8, integer_packer<uint32_t>(0, 262143)));
  HANDLE_CODE(pack_dyn_seq_of(bref, allowed_carrier_freq_set2, 1, 8, integer_packer<uint32_t>(0, 262143)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_allowed_carrier_freq_list_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(allowed_carrier_freq_set1, bref, 1, 8, integer_packer<uint32_t>(0, 262143)));
  HANDLE_CODE(unpack_dyn_seq_of(allowed_carrier_freq_set2, bref, 1, 8, integer_packer<uint32_t>(0, 262143)));

  return SRSASN_SUCCESS;
}
void sl_allowed_carrier_freq_list_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("allowedCarrierFreqSet1");
  for (const auto& e1 : allowed_carrier_freq_set1) {
    j.write_int(e1);
  }
  j.end_array();
  j.start_array("allowedCarrierFreqSet2");
  for (const auto& e1 : allowed_carrier_freq_set2) {
    j.write_int(e1);
  }
  j.end_array();
  j.end_obj();
}

// SL-DiscTxResourcesInterFreq-r13 ::= CHOICE
void sl_disc_tx_res_inter_freq_r13_c::set(types::options e)
{
  type_ = e;
}
void sl_disc_tx_res_inter_freq_r13_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::acquire_si_from_carrier_r13:
      break;
    case types::disc_tx_pool_common_r13:
      j.start_array("discTxPoolCommon-r13");
      for (const auto& e1 : c) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::request_ded_r13:
      break;
    case types::no_tx_on_carrier_r13:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_inter_freq_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_tx_res_inter_freq_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::acquire_si_from_carrier_r13:
      break;
    case types::disc_tx_pool_common_r13:
      HANDLE_CODE(pack_dyn_seq_of(bref, c, 1, 4));
      break;
    case types::request_ded_r13:
      break;
    case types::no_tx_on_carrier_r13:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_inter_freq_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_res_inter_freq_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::acquire_si_from_carrier_r13:
      break;
    case types::disc_tx_pool_common_r13:
      HANDLE_CODE(unpack_dyn_seq_of(c, bref, 1, 4));
      break;
    case types::request_ded_r13:
      break;
    case types::no_tx_on_carrier_r13:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_inter_freq_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SystemInformationBlockType1-v1320-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1320_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(freq_hop_params_dl_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (freq_hop_params_dl_r13_present) {
    HANDLE_CODE(bref.pack(freq_hop_params_dl_r13.mpdcch_pdsch_hop_nb_r13_present, 1));
    HANDLE_CODE(bref.pack(freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_a_r13_present, 1));
    HANDLE_CODE(bref.pack(freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_b_r13_present, 1));
    HANDLE_CODE(bref.pack(freq_hop_params_dl_r13.mpdcch_pdsch_hop_offset_r13_present, 1));
    if (freq_hop_params_dl_r13.mpdcch_pdsch_hop_nb_r13_present) {
      HANDLE_CODE(freq_hop_params_dl_r13.mpdcch_pdsch_hop_nb_r13.pack(bref));
    }
    if (freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_a_r13_present) {
      HANDLE_CODE(freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_a_r13.pack(bref));
    }
    if (freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_b_r13_present) {
      HANDLE_CODE(freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_b_r13.pack(bref));
    }
    if (freq_hop_params_dl_r13.mpdcch_pdsch_hop_offset_r13_present) {
      HANDLE_CODE(pack_integer(bref, freq_hop_params_dl_r13.mpdcch_pdsch_hop_offset_r13, (uint8_t)1u, (uint8_t)16u));
    }
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1320_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(freq_hop_params_dl_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (freq_hop_params_dl_r13_present) {
    HANDLE_CODE(bref.unpack(freq_hop_params_dl_r13.mpdcch_pdsch_hop_nb_r13_present, 1));
    HANDLE_CODE(bref.unpack(freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_a_r13_present, 1));
    HANDLE_CODE(bref.unpack(freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_b_r13_present, 1));
    HANDLE_CODE(bref.unpack(freq_hop_params_dl_r13.mpdcch_pdsch_hop_offset_r13_present, 1));
    if (freq_hop_params_dl_r13.mpdcch_pdsch_hop_nb_r13_present) {
      HANDLE_CODE(freq_hop_params_dl_r13.mpdcch_pdsch_hop_nb_r13.unpack(bref));
    }
    if (freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_a_r13_present) {
      HANDLE_CODE(freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_a_r13.unpack(bref));
    }
    if (freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_b_r13_present) {
      HANDLE_CODE(freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_b_r13.unpack(bref));
    }
    if (freq_hop_params_dl_r13.mpdcch_pdsch_hop_offset_r13_present) {
      HANDLE_CODE(unpack_integer(freq_hop_params_dl_r13.mpdcch_pdsch_hop_offset_r13, bref, (uint8_t)1u, (uint8_t)16u));
    }
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1320_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (freq_hop_params_dl_r13_present) {
    j.write_fieldname("freqHoppingParametersDL-r13");
    j.start_obj();
    if (freq_hop_params_dl_r13.mpdcch_pdsch_hop_nb_r13_present) {
      j.write_str("mpdcch-pdsch-HoppingNB-r13", freq_hop_params_dl_r13.mpdcch_pdsch_hop_nb_r13.to_string());
    }
    if (freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_a_r13_present) {
      j.write_fieldname("interval-DLHoppingConfigCommonModeA-r13");
      freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_a_r13.to_json(j);
    }
    if (freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_b_r13_present) {
      j.write_fieldname("interval-DLHoppingConfigCommonModeB-r13");
      freq_hop_params_dl_r13.interv_dl_hop_cfg_common_mode_b_r13.to_json(j);
    }
    if (freq_hop_params_dl_r13.mpdcch_pdsch_hop_offset_r13_present) {
      j.write_int("mpdcch-pdsch-HoppingOffset-r13", freq_hop_params_dl_r13.mpdcch_pdsch_hop_offset_r13);
    }
    j.end_obj();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_::destroy_() {}
void sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_::
    interv_dl_hop_cfg_common_mode_a_r13_c_(
        const sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::interv_fdd_r13:
      c.init(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.init(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_");
  }
}
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_&
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_::
operator=(const sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::interv_fdd_r13:
      c.set(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.set(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_");
  }

  return *this;
}
void sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_::to_json(
    json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::interv_fdd_r13:
      j.write_str("interval-FDD-r13", c.get<interv_fdd_r13_e_>().to_string());
      break;
    case types::interv_tdd_r13:
      j.write_str("interval-TDD-r13", c.get<interv_tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().pack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().unpack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_a_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_::destroy_() {}
void sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_::
    interv_dl_hop_cfg_common_mode_b_r13_c_(
        const sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::interv_fdd_r13:
      c.init(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.init(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_");
  }
}
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_&
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_::
operator=(const sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::interv_fdd_r13:
      c.set(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.set(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_");
  }

  return *this;
}
void sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_::to_json(
    json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::interv_fdd_r13:
      j.write_str("interval-FDD-r13", c.get<interv_fdd_r13_e_>().to_string());
      break;
    case types::interv_tdd_r13:
      j.write_str("interval-TDD-r13", c.get<interv_tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().pack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE
sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().unpack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_,
                            "sib_type1_v1320_ies_s::freq_hop_params_dl_r13_s_::interv_dl_hop_cfg_common_mode_b_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SystemInformationBlockType2-v10m0-IEs ::= SEQUENCE
SRSASN_CODE sib_type2_v10m0_ies_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));

  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<uint16_t>(33, 288)));
  }

  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<uint16_t>(33, 288)));
  }

  return SRSASN_SUCCESS;
}
void sib_type2_v10m0_ies_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 (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");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// SystemInformationBlockType5-v10l0-IEs ::= SEQUENCE
SRSASN_CODE sib_type5_v10l0_ies_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));

  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;
}
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 (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();
}

// 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));

  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));

  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_()
{
  switch (type_) {
    case types::sync_sys_time:
      c.destroy<fixed_bitstring<39> >();
      break;
    case types::async_sys_time:
      c.destroy<fixed_bitstring<49> >();
      break;
    default:
      break;
  }
}
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<fixed_bitstring<39> >();
      break;
    case types::async_sys_time:
      c.init<fixed_bitstring<49> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_");
  }
}
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<fixed_bitstring<39> >());
      break;
    case types::async_sys_time:
      c.init(other.c.get<fixed_bitstring<49> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_");
  }
}
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;
  }
  set(other.type());
  switch (type_) {
    case types::sync_sys_time:
      c.set(other.c.get<fixed_bitstring<39> >());
      break;
    case types::async_sys_time:
      c.set(other.c.get<fixed_bitstring<49> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sys_time_info_cdma2000_s::cdma_sys_time_c_");
  }

  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<fixed_bitstring<39> >().to_string());
      break;
    case types::async_sys_time:
      j.write_str("asynchronousSystemTime", c.get<fixed_bitstring<49> >().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<fixed_bitstring<39> >().pack(bref));
      break;
    case types::async_sys_time:
      HANDLE_CODE(c.get<fixed_bitstring<49> >().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<fixed_bitstring<39> >().unpack(bref));
      break;
    case types::async_sys_time:
      HANDLE_CODE(c.get<fixed_bitstring<49> >().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;
}

// 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();
}

// AC-BarringConfig ::= SEQUENCE
SRSASN_CODE ac_barr_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(ac_barr_factor.pack(bref));
  HANDLE_CODE(ac_barr_time.pack(bref));
  HANDLE_CODE(ac_barr_for_special_ac.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ac_barr_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(ac_barr_factor.unpack(bref));
  HANDLE_CODE(ac_barr_time.unpack(bref));
  HANDLE_CODE(ac_barr_for_special_ac.unpack(bref));

  return SRSASN_SUCCESS;
}
void ac_barr_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("ac-BarringFactor", ac_barr_factor.to_string());
  j.write_str("ac-BarringTime", ac_barr_time.to_string());
  j.write_str("ac-BarringForSpecialAC", ac_barr_for_special_ac.to_string());
  j.end_obj();
}

// CarrierFreqsGERAN ::= SEQUENCE
SRSASN_CODE carrier_freqs_geran_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, start_arfcn, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(band_ind.pack(bref));
  HANDLE_CODE(following_arfcns.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freqs_geran_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(start_arfcn, bref, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(band_ind.unpack(bref));
  HANDLE_CODE(following_arfcns.unpack(bref));

  return SRSASN_SUCCESS;
}
void carrier_freqs_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("startingARFCN", start_arfcn);
  j.write_str("bandIndicator", band_ind.to_string());
  j.write_fieldname("followingARFCNs");
  following_arfcns.to_json(j);
  j.end_obj();
}

void carrier_freqs_geran_s::following_arfcns_c_::destroy_()
{
  switch (type_) {
    case types::explicit_list_of_arfcns:
      c.destroy<explicit_list_of_arfcns_l>();
      break;
    case types::equally_spaced_arfcns:
      c.destroy<equally_spaced_arfcns_s_>();
      break;
    case types::variable_bit_map_of_arfcns:
      c.destroy<dyn_octstring>();
      break;
    default:
      break;
  }
}
void carrier_freqs_geran_s::following_arfcns_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::explicit_list_of_arfcns:
      c.init<explicit_list_of_arfcns_l>();
      break;
    case types::equally_spaced_arfcns:
      c.init<equally_spaced_arfcns_s_>();
      break;
    case types::variable_bit_map_of_arfcns:
      c.init<dyn_octstring>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "carrier_freqs_geran_s::following_arfcns_c_");
  }
}
carrier_freqs_geran_s::following_arfcns_c_::following_arfcns_c_(const carrier_freqs_geran_s::following_arfcns_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::explicit_list_of_arfcns:
      c.init(other.c.get<explicit_list_of_arfcns_l>());
      break;
    case types::equally_spaced_arfcns:
      c.init(other.c.get<equally_spaced_arfcns_s_>());
      break;
    case types::variable_bit_map_of_arfcns:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "carrier_freqs_geran_s::following_arfcns_c_");
  }
}
carrier_freqs_geran_s::following_arfcns_c_& carrier_freqs_geran_s::following_arfcns_c_::
                                            operator=(const carrier_freqs_geran_s::following_arfcns_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::explicit_list_of_arfcns:
      c.set(other.c.get<explicit_list_of_arfcns_l>());
      break;
    case types::equally_spaced_arfcns:
      c.set(other.c.get<equally_spaced_arfcns_s_>());
      break;
    case types::variable_bit_map_of_arfcns:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "carrier_freqs_geran_s::following_arfcns_c_");
  }

  return *this;
}
void carrier_freqs_geran_s::following_arfcns_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::explicit_list_of_arfcns:
      j.start_array("explicitListOfARFCNs");
      for (const auto& e1 : c.get<explicit_list_of_arfcns_l>()) {
        j.write_int(e1);
      }
      j.end_array();
      break;
    case types::equally_spaced_arfcns:
      j.write_fieldname("equallySpacedARFCNs");
      j.start_obj();
      j.write_int("arfcn-Spacing", c.get<equally_spaced_arfcns_s_>().arfcn_spacing);
      j.write_int("numberOfFollowingARFCNs", c.get<equally_spaced_arfcns_s_>().nof_following_arfcns);
      j.end_obj();
      break;
    case types::variable_bit_map_of_arfcns:
      j.write_str("variableBitMapOfARFCNs", c.get<dyn_octstring>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "carrier_freqs_geran_s::following_arfcns_c_");
  }
  j.end_obj();
}
SRSASN_CODE carrier_freqs_geran_s::following_arfcns_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::explicit_list_of_arfcns:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<explicit_list_of_arfcns_l>(), 0, 31, integer_packer<uint16_t>(0, 1023)));
      break;
    case types::equally_spaced_arfcns:
      HANDLE_CODE(pack_integer(bref, c.get<equally_spaced_arfcns_s_>().arfcn_spacing, (uint8_t)1u, (uint8_t)8u));
      HANDLE_CODE(
          pack_integer(bref, c.get<equally_spaced_arfcns_s_>().nof_following_arfcns, (uint8_t)0u, (uint8_t)31u));
      break;
    case types::variable_bit_map_of_arfcns:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "carrier_freqs_geran_s::following_arfcns_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freqs_geran_s::following_arfcns_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::explicit_list_of_arfcns:
      HANDLE_CODE(
          unpack_dyn_seq_of(c.get<explicit_list_of_arfcns_l>(), bref, 0, 31, integer_packer<uint16_t>(0, 1023)));
      break;
    case types::equally_spaced_arfcns:
      HANDLE_CODE(unpack_integer(c.get<equally_spaced_arfcns_s_>().arfcn_spacing, bref, (uint8_t)1u, (uint8_t)8u));
      HANDLE_CODE(
          unpack_integer(c.get<equally_spaced_arfcns_s_>().nof_following_arfcns, bref, (uint8_t)0u, (uint8_t)31u));
      break;
    case types::variable_bit_map_of_arfcns:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "carrier_freqs_geran_s::following_arfcns_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CellSelectionInfo-v1250 ::= SEQUENCE
SRSASN_CODE cell_sel_info_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, q_qual_min_rsrq_on_all_symbols_r12, (int8_t)-34, (int8_t)-3));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_sel_info_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(q_qual_min_rsrq_on_all_symbols_r12, bref, (int8_t)-34, (int8_t)-3));

  return SRSASN_SUCCESS;
}
void cell_sel_info_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("q-QualMinRSRQ-OnAllSymbols-r12", q_qual_min_rsrq_on_all_symbols_r12);
  j.end_obj();
}

// DeltaFList-PUCCH ::= SEQUENCE
SRSASN_CODE delta_flist_pucch_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(delta_f_pucch_format1.pack(bref));
  HANDLE_CODE(delta_f_pucch_format1b.pack(bref));
  HANDLE_CODE(delta_f_pucch_format2.pack(bref));
  HANDLE_CODE(delta_f_pucch_format2a.pack(bref));
  HANDLE_CODE(delta_f_pucch_format2b.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE delta_flist_pucch_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(delta_f_pucch_format1.unpack(bref));
  HANDLE_CODE(delta_f_pucch_format1b.unpack(bref));
  HANDLE_CODE(delta_f_pucch_format2.unpack(bref));
  HANDLE_CODE(delta_f_pucch_format2a.unpack(bref));
  HANDLE_CODE(delta_f_pucch_format2b.unpack(bref));

  return SRSASN_SUCCESS;
}
void delta_flist_pucch_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("deltaF-PUCCH-Format1", delta_f_pucch_format1.to_string());
  j.write_str("deltaF-PUCCH-Format1b", delta_f_pucch_format1b.to_string());
  j.write_str("deltaF-PUCCH-Format2", delta_f_pucch_format2.to_string());
  j.write_str("deltaF-PUCCH-Format2a", delta_f_pucch_format2a.to_string());
  j.write_str("deltaF-PUCCH-Format2b", delta_f_pucch_format2b.to_string());
  j.end_obj();
}

// EDT-PRACH-ParametersCE-r15 ::= SEQUENCE
SRSASN_CODE edt_prach_params_ce_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(edt_prach_params_ce_r15_present, 1));

  if (edt_prach_params_ce_r15_present) {
    HANDLE_CODE(bref.pack(edt_prach_params_ce_r15.prach_start_sf_r15_present, 1));
    HANDLE_CODE(pack_integer(bref, edt_prach_params_ce_r15.prach_cfg_idx_r15, (uint8_t)0u, (uint8_t)63u));
    HANDLE_CODE(pack_integer(bref, edt_prach_params_ce_r15.prach_freq_offset_r15, (uint8_t)0u, (uint8_t)94u));
    if (edt_prach_params_ce_r15.prach_start_sf_r15_present) {
      HANDLE_CODE(edt_prach_params_ce_r15.prach_start_sf_r15.pack(bref));
    }
    HANDLE_CODE(
        pack_dyn_seq_of(bref, edt_prach_params_ce_r15.mpdcch_nbs_to_monitor_r15, 1, 2, integer_packer<uint8_t>(1, 16)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE edt_prach_params_ce_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(edt_prach_params_ce_r15_present, 1));

  if (edt_prach_params_ce_r15_present) {
    HANDLE_CODE(bref.unpack(edt_prach_params_ce_r15.prach_start_sf_r15_present, 1));
    HANDLE_CODE(unpack_integer(edt_prach_params_ce_r15.prach_cfg_idx_r15, bref, (uint8_t)0u, (uint8_t)63u));
    HANDLE_CODE(unpack_integer(edt_prach_params_ce_r15.prach_freq_offset_r15, bref, (uint8_t)0u, (uint8_t)94u));
    if (edt_prach_params_ce_r15.prach_start_sf_r15_present) {
      HANDLE_CODE(edt_prach_params_ce_r15.prach_start_sf_r15.unpack(bref));
    }
    HANDLE_CODE(unpack_dyn_seq_of(
        edt_prach_params_ce_r15.mpdcch_nbs_to_monitor_r15, bref, 1, 2, integer_packer<uint8_t>(1, 16)));
  }

  return SRSASN_SUCCESS;
}
void edt_prach_params_ce_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (edt_prach_params_ce_r15_present) {
    j.write_fieldname("edt-PRACH-ParametersCE-r15");
    j.start_obj();
    j.write_int("prach-ConfigIndex-r15", edt_prach_params_ce_r15.prach_cfg_idx_r15);
    j.write_int("prach-FreqOffset-r15", edt_prach_params_ce_r15.prach_freq_offset_r15);
    if (edt_prach_params_ce_r15.prach_start_sf_r15_present) {
      j.write_str("prach-StartingSubframe-r15", edt_prach_params_ce_r15.prach_start_sf_r15.to_string());
    }
    j.start_array("mpdcch-NarrowbandsToMonitor-r15");
    for (const auto& e1 : edt_prach_params_ce_r15.mpdcch_nbs_to_monitor_r15) {
      j.write_int(e1);
    }
    j.end_array();
    j.end_obj();
  }
  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();
}

// MTC-SSB-NR-r15 ::= SEQUENCE
SRSASN_CODE mtc_ssb_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(periodicity_and_offset_r15.pack(bref));
  HANDLE_CODE(ssb_dur_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mtc_ssb_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(periodicity_and_offset_r15.unpack(bref));
  HANDLE_CODE(ssb_dur_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void mtc_ssb_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("periodicityAndOffset-r15");
  periodicity_and_offset_r15.to_json(j);
  j.write_str("ssb-Duration-r15", ssb_dur_r15.to_string());
  j.end_obj();
}

void mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_::destroy_() {}
void mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_::periodicity_and_offset_r15_c_(
    const mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf5_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf10_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf20_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf40_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf80_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf160_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_");
  }
}
mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_& mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_::
                                                 operator=(const mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf5_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf10_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf20_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf40_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf80_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf160_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_");
  }

  return *this;
}
void mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf5_r15:
      j.write_int("sf5-r15", c.get<uint8_t>());
      break;
    case types::sf10_r15:
      j.write_int("sf10-r15", c.get<uint8_t>());
      break;
    case types::sf20_r15:
      j.write_int("sf20-r15", c.get<uint8_t>());
      break;
    case types::sf40_r15:
      j.write_int("sf40-r15", c.get<uint8_t>());
      break;
    case types::sf80_r15:
      j.write_int("sf80-r15", c.get<uint8_t>());
      break;
    case types::sf160_r15:
      j.write_int("sf160-r15", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf5_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)4u));
      break;
    case types::sf10_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf40_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf80_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf160_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    default:
      log_invalid_choice_id(type_, "mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf5_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)4u));
      break;
    case types::sf10_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf40_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf80_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf160_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    default:
      log_invalid_choice_id(type_, "mtc_ssb_nr_r15_s::periodicity_and_offset_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasIdleCarrierEUTRA-r15 ::= SEQUENCE
SRSASN_CODE meas_idle_carrier_eutra_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(validity_area_r15_present, 1));
  HANDLE_CODE(bref.pack(meas_cell_list_r15_present, 1));
  HANDLE_CODE(bref.pack(quality_thres_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(allowed_meas_bw_r15.pack(bref));
  if (validity_area_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, validity_area_r15, 1, 8));
  }
  if (meas_cell_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_cell_list_r15, 1, 8));
  }
  HANDLE_CODE(report_quantities.pack(bref));
  if (quality_thres_r15_present) {
    HANDLE_CODE(bref.pack(quality_thres_r15.idle_rsrp_thres_r15_present, 1));
    HANDLE_CODE(bref.pack(quality_thres_r15.idle_rsrq_thres_r15_present, 1));
    if (quality_thres_r15.idle_rsrp_thres_r15_present) {
      HANDLE_CODE(pack_integer(bref, quality_thres_r15.idle_rsrp_thres_r15, (uint8_t)0u, (uint8_t)97u));
    }
    if (quality_thres_r15.idle_rsrq_thres_r15_present) {
      HANDLE_CODE(pack_integer(bref, quality_thres_r15.idle_rsrq_thres_r15, (int8_t)-30, (int8_t)46));
    }
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_idle_carrier_eutra_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(validity_area_r15_present, 1));
  HANDLE_CODE(bref.unpack(meas_cell_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(quality_thres_r15_present, 1));

  HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(allowed_meas_bw_r15.unpack(bref));
  if (validity_area_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(validity_area_r15, bref, 1, 8));
  }
  if (meas_cell_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_cell_list_r15, bref, 1, 8));
  }
  HANDLE_CODE(report_quantities.unpack(bref));
  if (quality_thres_r15_present) {
    HANDLE_CODE(bref.unpack(quality_thres_r15.idle_rsrp_thres_r15_present, 1));
    HANDLE_CODE(bref.unpack(quality_thres_r15.idle_rsrq_thres_r15_present, 1));
    if (quality_thres_r15.idle_rsrp_thres_r15_present) {
      HANDLE_CODE(unpack_integer(quality_thres_r15.idle_rsrp_thres_r15, bref, (uint8_t)0u, (uint8_t)97u));
    }
    if (quality_thres_r15.idle_rsrq_thres_r15_present) {
      HANDLE_CODE(unpack_integer(quality_thres_r15.idle_rsrq_thres_r15, bref, (int8_t)-30, (int8_t)46));
    }
  }

  return SRSASN_SUCCESS;
}
void meas_idle_carrier_eutra_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r15", carrier_freq_r15);
  j.write_str("allowedMeasBandwidth-r15", allowed_meas_bw_r15.to_string());
  if (validity_area_r15_present) {
    j.start_array("validityArea-r15");
    for (const auto& e1 : validity_area_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_cell_list_r15_present) {
    j.start_array("measCellList-r15");
    for (const auto& e1 : meas_cell_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_str("reportQuantities", report_quantities.to_string());
  if (quality_thres_r15_present) {
    j.write_fieldname("qualityThreshold-r15");
    j.start_obj();
    if (quality_thres_r15.idle_rsrp_thres_r15_present) {
      j.write_int("idleRSRP-Threshold-r15", quality_thres_r15.idle_rsrp_thres_r15);
    }
    if (quality_thres_r15.idle_rsrq_thres_r15_present) {
      j.write_int("idleRSRQ-Threshold-r15", quality_thres_r15.idle_rsrq_thres_r15);
    }
    j.end_obj();
  }
  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);
  }
  j.end_array();
  j.end_obj();
}

// NeighCellCDMA2000-v920 ::= SEQUENCE
SRSASN_CODE neigh_cell_cdma2000_v920_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, neigh_cells_per_freq_list_v920, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cell_cdma2000_v920_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(neigh_cells_per_freq_list_v920, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void neigh_cell_cdma2000_v920_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.end_array();
  j.end_obj();
}

// PRACH-ConfigInfo ::= SEQUENCE
SRSASN_CODE prach_cfg_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, prach_cfg_idx, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(bref.pack(high_speed_flag, 1));
  HANDLE_CODE(pack_integer(bref, zero_correlation_zone_cfg, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(pack_integer(bref, prach_freq_offset, (uint8_t)0u, (uint8_t)94u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(prach_cfg_idx, bref, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(bref.unpack(high_speed_flag, 1));
  HANDLE_CODE(unpack_integer(zero_correlation_zone_cfg, bref, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(unpack_integer(prach_freq_offset, bref, (uint8_t)0u, (uint8_t)94u));

  return SRSASN_SUCCESS;
}
void prach_cfg_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("prach-ConfigIndex", prach_cfg_idx);
  j.write_bool("highSpeedFlag", high_speed_flag);
  j.write_int("zeroCorrelationZoneConfig", zero_correlation_zone_cfg);
  j.write_int("prach-FreqOffset", prach_freq_offset);
  j.end_obj();
}

// ParametersCDMA2000-r11 ::= SEQUENCE
SRSASN_CODE params_cdma2000_r11_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));

  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;
}
SRSASN_CODE params_cdma2000_r11_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));

  if (sys_time_info_r11_present) {
    HANDLE_CODE(sys_time_info_r11.unpack(bref));
  }
  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));
    }
  }
  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;
}
void params_cdma2000_r11_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("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();
}

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
{
  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_");
  }
  j.end_obj();
}
SRSASN_CODE params_cdma2000_r11_s::sys_time_info_r11_c_::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_, "params_cdma2000_r11_s::sys_time_info_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
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::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;
  }
  return SRSASN_SUCCESS;
}

// PowerRampingParameters ::= SEQUENCE
SRSASN_CODE pwr_ramp_params_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pwr_ramp_step.pack(bref));
  HANDLE_CODE(preamb_init_rx_target_pwr.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pwr_ramp_params_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(pwr_ramp_step.unpack(bref));
  HANDLE_CODE(preamb_init_rx_target_pwr.unpack(bref));

  return SRSASN_SUCCESS;
}
void pwr_ramp_params_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("powerRampingStep", pwr_ramp_step.to_string());
  j.write_str("preambleInitialReceivedTargetPower", preamb_init_rx_target_pwr.to_string());
  j.end_obj();
}

// RedistributionInterFreqInfo-r13 ::= SEQUENCE
SRSASN_CODE redist_inter_freq_info_r13_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));

  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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE redist_inter_freq_info_r13_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));

  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));
  }

  return SRSASN_SUCCESS;
}
void redist_inter_freq_info_r13_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);
  }
  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();
}

// SL-CBR-PSSCH-TxConfig-r14 ::= SEQUENCE
SRSASN_CODE sl_cbr_pssch_tx_cfg_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cr_limit_r14, (uint16_t)0u, (uint16_t)10000u));
  HANDLE_CODE(tx_params_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_cbr_pssch_tx_cfg_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cr_limit_r14, bref, (uint16_t)0u, (uint16_t)10000u));
  HANDLE_CODE(tx_params_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_cbr_pssch_tx_cfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cr-Limit-r14", cr_limit_r14);
  j.write_fieldname("tx-Parameters-r14");
  tx_params_r14.to_json(j);
  j.end_obj();
}

// SL-DiscConfigOtherInterFreq-r13 ::= SEQUENCE
SRSASN_CODE sl_disc_cfg_other_inter_freq_r13_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()));
  }
  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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_other_inter_freq_r13_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));
  }
  if (disc_cell_sel_info_r13_present) {
    HANDLE_CODE(disc_cell_sel_info_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_disc_cfg_other_inter_freq_r13_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();
  }
  if (disc_cell_sel_info_r13_present) {
    j.write_fieldname("discCellSelectionInfo-r13");
    disc_cell_sel_info_r13.to_json(j);
  }
  j.end_obj();
}

// SL-HoppingConfigComm-r12 ::= SEQUENCE
SRSASN_CODE sl_hop_cfg_comm_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, hop_param_r12, (uint16_t)0u, (uint16_t)504u));
  HANDLE_CODE(num_subbands_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, rb_offset_r12, (uint8_t)0u, (uint8_t)110u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_hop_cfg_comm_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(hop_param_r12, bref, (uint16_t)0u, (uint16_t)504u));
  HANDLE_CODE(num_subbands_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(rb_offset_r12, bref, (uint8_t)0u, (uint8_t)110u));

  return SRSASN_SUCCESS;
}
void sl_hop_cfg_comm_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("hoppingParameter-r12", hop_param_r12);
  j.write_str("numSubbands-r12", num_subbands_r12.to_string());
  j.write_int("rb-Offset-r12", rb_offset_r12);
  j.end_obj();
}

// SL-InterFreqInfoV2X-r14 ::= SEQUENCE
SRSASN_CODE sl_inter_freq_info_v2x_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(plmn_id_list_r14_present, 1));
  HANDLE_CODE(bref.pack(sl_max_tx_pwr_r14_present, 1));
  HANDLE_CODE(bref.pack(sl_bw_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_sched_pool_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_ue_cfg_list_r14_present, 1));

  if (plmn_id_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r14, 1, 6));
  }
  HANDLE_CODE(pack_integer(bref, v2x_comm_carrier_freq_r14, (uint32_t)0u, (uint32_t)262143u));
  if (sl_max_tx_pwr_r14_present) {
    HANDLE_CODE(pack_integer(bref, sl_max_tx_pwr_r14, (int8_t)-30, (int8_t)33));
  }
  if (sl_bw_r14_present) {
    HANDLE_CODE(sl_bw_r14.pack(bref));
  }
  if (v2x_sched_pool_r14_present) {
    HANDLE_CODE(v2x_sched_pool_r14.pack(bref));
  }
  if (v2x_ue_cfg_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_ue_cfg_list_r14, 1, 16));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= add_spec_emission_v2x_r14.is_present();
    group_flags[1] |= v2x_freq_sel_cfg_list_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(add_spec_emission_v2x_r14.is_present(), 1));
      if (add_spec_emission_v2x_r14.is_present()) {
        HANDLE_CODE(add_spec_emission_v2x_r14->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(v2x_freq_sel_cfg_list_r15.is_present(), 1));
      if (v2x_freq_sel_cfg_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *v2x_freq_sel_cfg_list_r15, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_inter_freq_info_v2x_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(plmn_id_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(sl_max_tx_pwr_r14_present, 1));
  HANDLE_CODE(bref.unpack(sl_bw_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_sched_pool_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_ue_cfg_list_r14_present, 1));

  if (plmn_id_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r14, bref, 1, 6));
  }
  HANDLE_CODE(unpack_integer(v2x_comm_carrier_freq_r14, bref, (uint32_t)0u, (uint32_t)262143u));
  if (sl_max_tx_pwr_r14_present) {
    HANDLE_CODE(unpack_integer(sl_max_tx_pwr_r14, bref, (int8_t)-30, (int8_t)33));
  }
  if (sl_bw_r14_present) {
    HANDLE_CODE(sl_bw_r14.unpack(bref));
  }
  if (v2x_sched_pool_r14_present) {
    HANDLE_CODE(v2x_sched_pool_r14.unpack(bref));
  }
  if (v2x_ue_cfg_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_ue_cfg_list_r14, bref, 1, 16));
  }

  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 add_spec_emission_v2x_r14_present;
      HANDLE_CODE(bref.unpack(add_spec_emission_v2x_r14_present, 1));
      add_spec_emission_v2x_r14.set_present(add_spec_emission_v2x_r14_present);
      if (add_spec_emission_v2x_r14.is_present()) {
        HANDLE_CODE(add_spec_emission_v2x_r14->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool v2x_freq_sel_cfg_list_r15_present;
      HANDLE_CODE(bref.unpack(v2x_freq_sel_cfg_list_r15_present, 1));
      v2x_freq_sel_cfg_list_r15.set_present(v2x_freq_sel_cfg_list_r15_present);
      if (v2x_freq_sel_cfg_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*v2x_freq_sel_cfg_list_r15, bref, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_inter_freq_info_v2x_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (plmn_id_list_r14_present) {
    j.start_array("plmn-IdentityList-r14");
    for (const auto& e1 : plmn_id_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_int("v2x-CommCarrierFreq-r14", v2x_comm_carrier_freq_r14);
  if (sl_max_tx_pwr_r14_present) {
    j.write_int("sl-MaxTxPower-r14", sl_max_tx_pwr_r14);
  }
  if (sl_bw_r14_present) {
    j.write_str("sl-Bandwidth-r14", sl_bw_r14.to_string());
  }
  if (v2x_sched_pool_r14_present) {
    j.write_fieldname("v2x-SchedulingPool-r14");
    v2x_sched_pool_r14.to_json(j);
  }
  if (v2x_ue_cfg_list_r14_present) {
    j.start_array("v2x-UE-ConfigList-r14");
    for (const auto& e1 : v2x_ue_cfg_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (ext) {
    if (add_spec_emission_v2x_r14.is_present()) {
      j.write_fieldname("additionalSpectrumEmissionV2X-r14");
      add_spec_emission_v2x_r14->to_json(j);
    }
    if (v2x_freq_sel_cfg_list_r15.is_present()) {
      j.start_array("v2x-FreqSelectionConfigList-r15");
      for (const auto& e1 : *v2x_freq_sel_cfg_list_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

void sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_::destroy_() {}
void sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_::add_spec_emission_v2x_r14_c_(
    const sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::add_spec_emission_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::add_spec_emission_v1440:
      c.init(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_");
  }
}
sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_& sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_::
                                                            operator=(const sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::add_spec_emission_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::add_spec_emission_v1440:
      c.set(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_");
  }

  return *this;
}
void sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::add_spec_emission_r14:
      j.write_int("additionalSpectrumEmission-r14", c.get<uint8_t>());
      break;
    case types::add_spec_emission_v1440:
      j.write_int("additionalSpectrumEmission-v1440", c.get<uint16_t>());
      break;
    default:
      log_invalid_choice_id(type_, "sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::add_spec_emission_r14:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)32u));
      break;
    case types::add_spec_emission_v1440:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)33u, (uint16_t)288u));
      break;
    default:
      log_invalid_choice_id(type_, "sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::add_spec_emission_r14:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)32u));
      break;
    case types::add_spec_emission_v1440:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)33u, (uint16_t)288u));
      break;
    default:
      log_invalid_choice_id(type_, "sl_inter_freq_info_v2x_r14_s::add_spec_emission_v2x_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-PPPR-Dest-CarrierFreq ::= SEQUENCE
SRSASN_CODE sl_pppr_dest_carrier_freq_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dest_info_list_r15_present, 1));
  HANDLE_CODE(bref.pack(allowed_carrier_freq_list_r15_present, 1));

  if (dest_info_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, dest_info_list_r15, 1, 16));
  }
  if (allowed_carrier_freq_list_r15_present) {
    HANDLE_CODE(allowed_carrier_freq_list_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pppr_dest_carrier_freq_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dest_info_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(allowed_carrier_freq_list_r15_present, 1));

  if (dest_info_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(dest_info_list_r15, bref, 1, 16));
  }
  if (allowed_carrier_freq_list_r15_present) {
    HANDLE_CODE(allowed_carrier_freq_list_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_pppr_dest_carrier_freq_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dest_info_list_r15_present) {
    j.start_array("destinationInfoList-r15");
    for (const auto& e1 : dest_info_list_r15) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (allowed_carrier_freq_list_r15_present) {
    j.write_fieldname("allowedCarrierFreqList-r15");
    allowed_carrier_freq_list_r15.to_json(j);
  }
  j.end_obj();
}

// SL-ResourcesInterFreq-r13 ::= SEQUENCE
SRSASN_CODE sl_res_inter_freq_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(disc_rx_res_inter_freq_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_res_inter_freq_r13_present, 1));

  if (disc_rx_res_inter_freq_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_rx_res_inter_freq_r13, 1, 16));
  }
  if (disc_tx_res_inter_freq_r13_present) {
    HANDLE_CODE(disc_tx_res_inter_freq_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_res_inter_freq_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(disc_rx_res_inter_freq_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_res_inter_freq_r13_present, 1));

  if (disc_rx_res_inter_freq_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_rx_res_inter_freq_r13, bref, 1, 16));
  }
  if (disc_tx_res_inter_freq_r13_present) {
    HANDLE_CODE(disc_tx_res_inter_freq_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_res_inter_freq_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (disc_rx_res_inter_freq_r13_present) {
    j.start_array("discRxResourcesInterFreq-r13");
    for (const auto& e1 : disc_rx_res_inter_freq_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_tx_res_inter_freq_r13_present) {
    j.write_fieldname("discTxResourcesInterFreq-r13");
    disc_tx_res_inter_freq_r13.to_json(j);
  }
  j.end_obj();
}

// SL-SyncConfig-r12 ::= SEQUENCE
SRSASN_CODE sl_sync_cfg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(tx_params_r12_present, 1));
  HANDLE_CODE(bref.pack(rx_params_ncell_r12_present, 1));

  HANDLE_CODE(sync_cp_len_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, sync_offset_ind_r12, (uint8_t)0u, (uint8_t)39u));
  HANDLE_CODE(pack_integer(bref, slssid_r12, (uint8_t)0u, (uint8_t)167u));
  if (tx_params_r12_present) {
    HANDLE_CODE(bref.pack(tx_params_r12.sync_info_reserved_r12_present, 1));
    HANDLE_CODE(tx_params_r12.sync_tx_params_r12.pack(bref));
    HANDLE_CODE(pack_integer(bref, tx_params_r12.sync_tx_thresh_ic_r12, (uint8_t)0u, (uint8_t)13u));
    if (tx_params_r12.sync_info_reserved_r12_present) {
      HANDLE_CODE(tx_params_r12.sync_info_reserved_r12.pack(bref));
    }
  }
  if (rx_params_ncell_r12_present) {
    HANDLE_CODE(pack_integer(bref, rx_params_ncell_r12.pci_r12, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(rx_params_ncell_r12.disc_sync_win_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= sync_tx_periodic_r13_present;
    group_flags[1] |= sync_offset_ind_v1430_present;
    group_flags[1] |= gnss_sync_r14_present;
    group_flags[2] |= sync_offset_ind2_r14_present;
    group_flags[2] |= sync_offset_ind3_r14_present;
    group_flags[3] |= slss_tx_disabled_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sync_tx_periodic_r13_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sync_offset_ind_v1430_present, 1));
      HANDLE_CODE(bref.pack(gnss_sync_r14_present, 1));
      if (sync_offset_ind_v1430_present) {
        HANDLE_CODE(pack_integer(bref, sync_offset_ind_v1430, (uint8_t)40u, (uint8_t)159u));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sync_offset_ind2_r14_present, 1));
      HANDLE_CODE(bref.pack(sync_offset_ind3_r14_present, 1));
      if (sync_offset_ind2_r14_present) {
        HANDLE_CODE(pack_integer(bref, sync_offset_ind2_r14, (uint8_t)0u, (uint8_t)159u));
      }
      if (sync_offset_ind3_r14_present) {
        HANDLE_CODE(pack_integer(bref, sync_offset_ind3_r14, (uint8_t)0u, (uint8_t)159u));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(slss_tx_disabled_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_sync_cfg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(tx_params_r12_present, 1));
  HANDLE_CODE(bref.unpack(rx_params_ncell_r12_present, 1));

  HANDLE_CODE(sync_cp_len_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(sync_offset_ind_r12, bref, (uint8_t)0u, (uint8_t)39u));
  HANDLE_CODE(unpack_integer(slssid_r12, bref, (uint8_t)0u, (uint8_t)167u));
  if (tx_params_r12_present) {
    HANDLE_CODE(bref.unpack(tx_params_r12.sync_info_reserved_r12_present, 1));
    HANDLE_CODE(tx_params_r12.sync_tx_params_r12.unpack(bref));
    HANDLE_CODE(unpack_integer(tx_params_r12.sync_tx_thresh_ic_r12, bref, (uint8_t)0u, (uint8_t)13u));
    if (tx_params_r12.sync_info_reserved_r12_present) {
      HANDLE_CODE(tx_params_r12.sync_info_reserved_r12.unpack(bref));
    }
  }
  if (rx_params_ncell_r12_present) {
    HANDLE_CODE(unpack_integer(rx_params_ncell_r12.pci_r12, bref, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(rx_params_ncell_r12.disc_sync_win_r12.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(sync_tx_periodic_r13_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(sync_offset_ind_v1430_present, 1));
      HANDLE_CODE(bref.unpack(gnss_sync_r14_present, 1));
      if (sync_offset_ind_v1430_present) {
        HANDLE_CODE(unpack_integer(sync_offset_ind_v1430, bref, (uint8_t)40u, (uint8_t)159u));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(sync_offset_ind2_r14_present, 1));
      HANDLE_CODE(bref.unpack(sync_offset_ind3_r14_present, 1));
      if (sync_offset_ind2_r14_present) {
        HANDLE_CODE(unpack_integer(sync_offset_ind2_r14, bref, (uint8_t)0u, (uint8_t)159u));
      }
      if (sync_offset_ind3_r14_present) {
        HANDLE_CODE(unpack_integer(sync_offset_ind3_r14, bref, (uint8_t)0u, (uint8_t)159u));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(slss_tx_disabled_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
void sl_sync_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("syncCP-Len-r12", sync_cp_len_r12.to_string());
  j.write_int("syncOffsetIndicator-r12", sync_offset_ind_r12);
  j.write_int("slssid-r12", slssid_r12);
  if (tx_params_r12_present) {
    j.write_fieldname("txParameters-r12");
    j.start_obj();
    j.write_fieldname("syncTxParameters-r12");
    tx_params_r12.sync_tx_params_r12.to_json(j);
    j.write_int("syncTxThreshIC-r12", tx_params_r12.sync_tx_thresh_ic_r12);
    if (tx_params_r12.sync_info_reserved_r12_present) {
      j.write_str("syncInfoReserved-r12", tx_params_r12.sync_info_reserved_r12.to_string());
    }
    j.end_obj();
  }
  if (rx_params_ncell_r12_present) {
    j.write_fieldname("rxParamsNCell-r12");
    j.start_obj();
    j.write_int("physCellId-r12", rx_params_ncell_r12.pci_r12);
    j.write_str("discSyncWindow-r12", rx_params_ncell_r12.disc_sync_win_r12.to_string());
    j.end_obj();
  }
  if (ext) {
    if (sync_tx_periodic_r13_present) {
      j.write_str("syncTxPeriodic-r13", "true");
    }
    if (sync_offset_ind_v1430_present) {
      j.write_int("syncOffsetIndicator-v1430", sync_offset_ind_v1430);
    }
    if (gnss_sync_r14_present) {
      j.write_str("gnss-Sync-r14", "true");
    }
    if (sync_offset_ind2_r14_present) {
      j.write_int("syncOffsetIndicator2-r14", sync_offset_ind2_r14);
    }
    if (sync_offset_ind3_r14_present) {
      j.write_int("syncOffsetIndicator3-r14", sync_offset_ind3_r14);
    }
    if (slss_tx_disabled_r15_present) {
      j.write_str("slss-TxDisabled-r15", "true");
    }
  }
  j.end_obj();
}

// SS-RSSI-Measurement-r15 ::= SEQUENCE
SRSASN_CODE ss_rssi_meas_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(meas_slots_r15.pack(bref));
  HANDLE_CODE(pack_integer(bref, end_symbol_r15, (uint8_t)0u, (uint8_t)3u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ss_rssi_meas_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(meas_slots_r15.unpack(bref));
  HANDLE_CODE(unpack_integer(end_symbol_r15, bref, (uint8_t)0u, (uint8_t)3u));

  return SRSASN_SUCCESS;
}
void ss_rssi_meas_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("measurementSlots-r15", meas_slots_r15.to_string());
  j.write_int("endSymbol-r15", end_symbol_r15);
  j.end_obj();
}

// SystemInformationBlockType1-v10l0-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_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<Packer>(1, 8, Packer())));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_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<Packer>(1, 8, Packer())));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_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.end_obj();
}

// SystemInformationBlockType1-v1310-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(hyper_sfn_r13_present, 1));
  HANDLE_CODE(bref.pack(edrx_allowed_r13_present, 1));
  HANDLE_CODE(bref.pack(cell_sel_info_ce_r13_present, 1));
  HANDLE_CODE(bref.pack(bw_reduced_access_related_info_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (hyper_sfn_r13_present) {
    HANDLE_CODE(hyper_sfn_r13.pack(bref));
  }
  if (cell_sel_info_ce_r13_present) {
    HANDLE_CODE(cell_sel_info_ce_r13.pack(bref));
  }
  if (bw_reduced_access_related_info_r13_present) {
    HANDLE_CODE(bref.pack(bw_reduced_access_related_info_r13.sched_info_list_br_r13_present, 1));
    HANDLE_CODE(bref.pack(bw_reduced_access_related_info_r13.fdd_dl_or_tdd_sf_bitmap_br_r13_present, 1));
    HANDLE_CODE(bref.pack(bw_reduced_access_related_info_r13.fdd_ul_sf_bitmap_br_r13_present, 1));
    HANDLE_CODE(bref.pack(bw_reduced_access_related_info_r13.si_validity_time_r13_present, 1));
    HANDLE_CODE(bref.pack(bw_reduced_access_related_info_r13.sys_info_value_tag_list_r13_present, 1));
    HANDLE_CODE(bw_reduced_access_related_info_r13.si_win_len_br_r13.pack(bref));
    HANDLE_CODE(bw_reduced_access_related_info_r13.si_repeat_pattern_r13.pack(bref));
    if (bw_reduced_access_related_info_r13.sched_info_list_br_r13_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, bw_reduced_access_related_info_r13.sched_info_list_br_r13, 1, 32));
    }
    if (bw_reduced_access_related_info_r13.fdd_dl_or_tdd_sf_bitmap_br_r13_present) {
      HANDLE_CODE(bw_reduced_access_related_info_r13.fdd_dl_or_tdd_sf_bitmap_br_r13.pack(bref));
    }
    if (bw_reduced_access_related_info_r13.fdd_ul_sf_bitmap_br_r13_present) {
      HANDLE_CODE(bw_reduced_access_related_info_r13.fdd_ul_sf_bitmap_br_r13.pack(bref));
    }
    HANDLE_CODE(pack_integer(bref, bw_reduced_access_related_info_r13.start_symbol_br_r13, (uint8_t)1u, (uint8_t)4u));
    HANDLE_CODE(bw_reduced_access_related_info_r13.si_hop_cfg_common_r13.pack(bref));
    if (bw_reduced_access_related_info_r13.sys_info_value_tag_list_r13_present) {
      HANDLE_CODE(pack_dyn_seq_of(
          bref, bw_reduced_access_related_info_r13.sys_info_value_tag_list_r13, 1, 32, integer_packer<uint8_t>(0, 3)));
    }
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(hyper_sfn_r13_present, 1));
  HANDLE_CODE(bref.unpack(edrx_allowed_r13_present, 1));
  HANDLE_CODE(bref.unpack(cell_sel_info_ce_r13_present, 1));
  HANDLE_CODE(bref.unpack(bw_reduced_access_related_info_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (hyper_sfn_r13_present) {
    HANDLE_CODE(hyper_sfn_r13.unpack(bref));
  }
  if (cell_sel_info_ce_r13_present) {
    HANDLE_CODE(cell_sel_info_ce_r13.unpack(bref));
  }
  if (bw_reduced_access_related_info_r13_present) {
    HANDLE_CODE(bref.unpack(bw_reduced_access_related_info_r13.sched_info_list_br_r13_present, 1));
    HANDLE_CODE(bref.unpack(bw_reduced_access_related_info_r13.fdd_dl_or_tdd_sf_bitmap_br_r13_present, 1));
    HANDLE_CODE(bref.unpack(bw_reduced_access_related_info_r13.fdd_ul_sf_bitmap_br_r13_present, 1));
    HANDLE_CODE(bref.unpack(bw_reduced_access_related_info_r13.si_validity_time_r13_present, 1));
    HANDLE_CODE(bref.unpack(bw_reduced_access_related_info_r13.sys_info_value_tag_list_r13_present, 1));
    HANDLE_CODE(bw_reduced_access_related_info_r13.si_win_len_br_r13.unpack(bref));
    HANDLE_CODE(bw_reduced_access_related_info_r13.si_repeat_pattern_r13.unpack(bref));
    if (bw_reduced_access_related_info_r13.sched_info_list_br_r13_present) {
      HANDLE_CODE(unpack_dyn_seq_of(bw_reduced_access_related_info_r13.sched_info_list_br_r13, bref, 1, 32));
    }
    if (bw_reduced_access_related_info_r13.fdd_dl_or_tdd_sf_bitmap_br_r13_present) {
      HANDLE_CODE(bw_reduced_access_related_info_r13.fdd_dl_or_tdd_sf_bitmap_br_r13.unpack(bref));
    }
    if (bw_reduced_access_related_info_r13.fdd_ul_sf_bitmap_br_r13_present) {
      HANDLE_CODE(bw_reduced_access_related_info_r13.fdd_ul_sf_bitmap_br_r13.unpack(bref));
    }
    HANDLE_CODE(unpack_integer(bw_reduced_access_related_info_r13.start_symbol_br_r13, bref, (uint8_t)1u, (uint8_t)4u));
    HANDLE_CODE(bw_reduced_access_related_info_r13.si_hop_cfg_common_r13.unpack(bref));
    if (bw_reduced_access_related_info_r13.sys_info_value_tag_list_r13_present) {
      HANDLE_CODE(unpack_dyn_seq_of(
          bw_reduced_access_related_info_r13.sys_info_value_tag_list_r13, bref, 1, 32, integer_packer<uint8_t>(0, 3)));
    }
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (hyper_sfn_r13_present) {
    j.write_str("hyperSFN-r13", hyper_sfn_r13.to_string());
  }
  if (edrx_allowed_r13_present) {
    j.write_str("eDRX-Allowed-r13", "true");
  }
  if (cell_sel_info_ce_r13_present) {
    j.write_fieldname("cellSelectionInfoCE-r13");
    cell_sel_info_ce_r13.to_json(j);
  }
  if (bw_reduced_access_related_info_r13_present) {
    j.write_fieldname("bandwidthReducedAccessRelatedInfo-r13");
    j.start_obj();
    j.write_str("si-WindowLength-BR-r13", bw_reduced_access_related_info_r13.si_win_len_br_r13.to_string());
    j.write_str("si-RepetitionPattern-r13", bw_reduced_access_related_info_r13.si_repeat_pattern_r13.to_string());
    if (bw_reduced_access_related_info_r13.sched_info_list_br_r13_present) {
      j.start_array("schedulingInfoList-BR-r13");
      for (const auto& e1 : bw_reduced_access_related_info_r13.sched_info_list_br_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (bw_reduced_access_related_info_r13.fdd_dl_or_tdd_sf_bitmap_br_r13_present) {
      j.write_fieldname("fdd-DownlinkOrTddSubframeBitmapBR-r13");
      bw_reduced_access_related_info_r13.fdd_dl_or_tdd_sf_bitmap_br_r13.to_json(j);
    }
    if (bw_reduced_access_related_info_r13.fdd_ul_sf_bitmap_br_r13_present) {
      j.write_str("fdd-UplinkSubframeBitmapBR-r13",
                  bw_reduced_access_related_info_r13.fdd_ul_sf_bitmap_br_r13.to_string());
    }
    j.write_int("startSymbolBR-r13", bw_reduced_access_related_info_r13.start_symbol_br_r13);
    j.write_str("si-HoppingConfigCommon-r13", bw_reduced_access_related_info_r13.si_hop_cfg_common_r13.to_string());
    if (bw_reduced_access_related_info_r13.si_validity_time_r13_present) {
      j.write_str("si-ValidityTime-r13", "true");
    }
    if (bw_reduced_access_related_info_r13.sys_info_value_tag_list_r13_present) {
      j.start_array("systemInfoValueTagList-r13");
      for (const auto& e1 : bw_reduced_access_related_info_r13.sys_info_value_tag_list_r13) {
        j.write_int(e1);
      }
      j.end_array();
    }
    j.end_obj();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_::destroy_()
{
  switch (type_) {
    case types::sf_pattern10_r13:
      c.destroy<fixed_bitstring<10> >();
      break;
    case types::sf_pattern40_r13:
      c.destroy<fixed_bitstring<40> >();
      break;
    default:
      break;
  }
}
void sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_::set(
    types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sf_pattern10_r13:
      c.init<fixed_bitstring<10> >();
      break;
    case types::sf_pattern40_r13:
      c.init<fixed_bitstring<40> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(
          type_, "sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_");
  }
}
sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_::
    fdd_dl_or_tdd_sf_bitmap_br_r13_c_(
        const sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf_pattern10_r13:
      c.init(other.c.get<fixed_bitstring<10> >());
      break;
    case types::sf_pattern40_r13:
      c.init(other.c.get<fixed_bitstring<40> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(
          type_, "sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_");
  }
}
sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_&
sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_::
operator=(const sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf_pattern10_r13:
      c.set(other.c.get<fixed_bitstring<10> >());
      break;
    case types::sf_pattern40_r13:
      c.set(other.c.get<fixed_bitstring<40> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(
          type_, "sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_");
  }

  return *this;
}
void sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_::to_json(
    json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf_pattern10_r13:
      j.write_str("subframePattern10-r13", c.get<fixed_bitstring<10> >().to_string());
      break;
    case types::sf_pattern40_r13:
      j.write_str("subframePattern40-r13", c.get<fixed_bitstring<40> >().to_string());
      break;
    default:
      log_invalid_choice_id(
          type_, "sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_::pack(
    bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf_pattern10_r13:
      HANDLE_CODE(c.get<fixed_bitstring<10> >().pack(bref));
      break;
    case types::sf_pattern40_r13:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(
          type_, "sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE
sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf_pattern10_r13:
      HANDLE_CODE(c.get<fixed_bitstring<10> >().unpack(bref));
      break;
    case types::sf_pattern40_r13:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(
          type_, "sib_type1_v1310_ies_s::bw_reduced_access_related_info_r13_s_::fdd_dl_or_tdd_sf_bitmap_br_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SystemInformationBlockType2-v9i0-IEs ::= SEQUENCE
SRSASN_CODE sib_type2_v9i0_ies_s::pack(bit_ref& bref) 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;
}
SRSASN_CODE sib_type2_v9i0_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(dummy_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  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());
  }
  if (dummy_present) {
    j.write_fieldname("dummy");
    j.start_obj();
    j.end_obj();
  }
  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));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type5_v10j0_ies_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));

  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 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();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// ThresholdListNR-r15 ::= SEQUENCE
SRSASN_CODE thres_list_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(nr_rsrp_r15_present, 1));
  HANDLE_CODE(bref.pack(nr_rsrq_r15_present, 1));
  HANDLE_CODE(bref.pack(nr_sinr_r15_present, 1));

  if (nr_rsrp_r15_present) {
    HANDLE_CODE(pack_integer(bref, nr_rsrp_r15, (uint8_t)0u, (uint8_t)127u));
  }
  if (nr_rsrq_r15_present) {
    HANDLE_CODE(pack_integer(bref, nr_rsrq_r15, (uint8_t)0u, (uint8_t)127u));
  }
  if (nr_sinr_r15_present) {
    HANDLE_CODE(pack_integer(bref, nr_sinr_r15, (uint8_t)0u, (uint8_t)127u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE thres_list_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(nr_rsrp_r15_present, 1));
  HANDLE_CODE(bref.unpack(nr_rsrq_r15_present, 1));
  HANDLE_CODE(bref.unpack(nr_sinr_r15_present, 1));

  if (nr_rsrp_r15_present) {
    HANDLE_CODE(unpack_integer(nr_rsrp_r15, bref, (uint8_t)0u, (uint8_t)127u));
  }
  if (nr_rsrq_r15_present) {
    HANDLE_CODE(unpack_integer(nr_rsrq_r15, bref, (uint8_t)0u, (uint8_t)127u));
  }
  if (nr_sinr_r15_present) {
    HANDLE_CODE(unpack_integer(nr_sinr_r15, bref, (uint8_t)0u, (uint8_t)127u));
  }

  return SRSASN_SUCCESS;
}
void thres_list_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (nr_rsrp_r15_present) {
    j.write_int("nr-RSRP-r15", nr_rsrp_r15);
  }
  if (nr_rsrq_r15_present) {
    j.write_int("nr-RSRQ-r15", nr_rsrq_r15);
  }
  if (nr_sinr_r15_present) {
    j.write_int("nr-SINR-r15", nr_sinr_r15);
  }
  j.end_obj();
}

// UDT-Restricting-r13 ::= SEQUENCE
SRSASN_CODE udt_restricting_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(udt_restricting_r13_present, 1));
  HANDLE_CODE(bref.pack(udt_restricting_time_r13_present, 1));

  if (udt_restricting_time_r13_present) {
    HANDLE_CODE(udt_restricting_time_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE udt_restricting_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(udt_restricting_r13_present, 1));
  HANDLE_CODE(bref.unpack(udt_restricting_time_r13_present, 1));

  if (udt_restricting_time_r13_present) {
    HANDLE_CODE(udt_restricting_time_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void udt_restricting_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (udt_restricting_r13_present) {
    j.write_str("udt-Restricting-r13", "true");
  }
  if (udt_restricting_time_r13_present) {
    j.write_str("udt-RestrictingTime-r13", udt_restricting_time_r13.to_string());
  }
  j.end_obj();
}

// UL-ReferenceSignalsPUSCH ::= SEQUENCE
SRSASN_CODE ul_ref_sigs_pusch_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(group_hop_enabled, 1));
  HANDLE_CODE(pack_integer(bref, group_assign_pusch, (uint8_t)0u, (uint8_t)29u));
  HANDLE_CODE(bref.pack(seq_hop_enabled, 1));
  HANDLE_CODE(pack_integer(bref, cyclic_shift, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ref_sigs_pusch_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(group_hop_enabled, 1));
  HANDLE_CODE(unpack_integer(group_assign_pusch, bref, (uint8_t)0u, (uint8_t)29u));
  HANDLE_CODE(bref.unpack(seq_hop_enabled, 1));
  HANDLE_CODE(unpack_integer(cyclic_shift, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void ul_ref_sigs_pusch_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("groupHoppingEnabled", group_hop_enabled);
  j.write_int("groupAssignmentPUSCH", group_assign_pusch);
  j.write_bool("sequenceHoppingEnabled", seq_hop_enabled);
  j.write_int("cyclicShift", cyclic_shift);
  j.end_obj();
}

// WLAN-Identifiers-r12 ::= SEQUENCE
SRSASN_CODE wlan_ids_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ssid_r12_present, 1));
  HANDLE_CODE(bref.pack(bssid_r12_present, 1));
  HANDLE_CODE(bref.pack(hessid_r12_present, 1));

  if (ssid_r12_present) {
    HANDLE_CODE(ssid_r12.pack(bref));
  }
  if (bssid_r12_present) {
    HANDLE_CODE(bssid_r12.pack(bref));
  }
  if (hessid_r12_present) {
    HANDLE_CODE(hessid_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_ids_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ssid_r12_present, 1));
  HANDLE_CODE(bref.unpack(bssid_r12_present, 1));
  HANDLE_CODE(bref.unpack(hessid_r12_present, 1));

  if (ssid_r12_present) {
    HANDLE_CODE(ssid_r12.unpack(bref));
  }
  if (bssid_r12_present) {
    HANDLE_CODE(bssid_r12.unpack(bref));
  }
  if (hessid_r12_present) {
    HANDLE_CODE(hessid_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void wlan_ids_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ssid_r12_present) {
    j.write_str("ssid-r12", ssid_r12.to_string());
  }
  if (bssid_r12_present) {
    j.write_str("bssid-r12", bssid_r12.to_string());
  }
  if (hessid_r12_present) {
    j.write_str("hessid-r12", hessid_r12.to_string());
  }
  j.end_obj();
}

// AC-BarringPerPLMN-r12 ::= SEQUENCE
SRSASN_CODE ac_barr_per_plmn_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ac_barr_info_r12_present, 1));
  HANDLE_CODE(bref.pack(ac_barr_skip_for_mmtel_voice_r12_present, 1));
  HANDLE_CODE(bref.pack(ac_barr_skip_for_mmtel_video_r12_present, 1));
  HANDLE_CODE(bref.pack(ac_barr_skip_for_sms_r12_present, 1));
  HANDLE_CODE(bref.pack(ac_barr_for_csfb_r12_present, 1));
  HANDLE_CODE(bref.pack(ssac_barr_for_mmtel_voice_r12_present, 1));
  HANDLE_CODE(bref.pack(ssac_barr_for_mmtel_video_r12_present, 1));

  HANDLE_CODE(pack_integer(bref, plmn_id_idx_r12, (uint8_t)1u, (uint8_t)6u));
  if (ac_barr_info_r12_present) {
    HANDLE_CODE(bref.pack(ac_barr_info_r12.ac_barr_for_mo_sig_r12_present, 1));
    HANDLE_CODE(bref.pack(ac_barr_info_r12.ac_barr_for_mo_data_r12_present, 1));
    HANDLE_CODE(bref.pack(ac_barr_info_r12.ac_barr_for_emergency_r12, 1));
    if (ac_barr_info_r12.ac_barr_for_mo_sig_r12_present) {
      HANDLE_CODE(ac_barr_info_r12.ac_barr_for_mo_sig_r12.pack(bref));
    }
    if (ac_barr_info_r12.ac_barr_for_mo_data_r12_present) {
      HANDLE_CODE(ac_barr_info_r12.ac_barr_for_mo_data_r12.pack(bref));
    }
  }
  if (ac_barr_for_csfb_r12_present) {
    HANDLE_CODE(ac_barr_for_csfb_r12.pack(bref));
  }
  if (ssac_barr_for_mmtel_voice_r12_present) {
    HANDLE_CODE(ssac_barr_for_mmtel_voice_r12.pack(bref));
  }
  if (ssac_barr_for_mmtel_video_r12_present) {
    HANDLE_CODE(ssac_barr_for_mmtel_video_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ac_barr_per_plmn_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ac_barr_info_r12_present, 1));
  HANDLE_CODE(bref.unpack(ac_barr_skip_for_mmtel_voice_r12_present, 1));
  HANDLE_CODE(bref.unpack(ac_barr_skip_for_mmtel_video_r12_present, 1));
  HANDLE_CODE(bref.unpack(ac_barr_skip_for_sms_r12_present, 1));
  HANDLE_CODE(bref.unpack(ac_barr_for_csfb_r12_present, 1));
  HANDLE_CODE(bref.unpack(ssac_barr_for_mmtel_voice_r12_present, 1));
  HANDLE_CODE(bref.unpack(ssac_barr_for_mmtel_video_r12_present, 1));

  HANDLE_CODE(unpack_integer(plmn_id_idx_r12, bref, (uint8_t)1u, (uint8_t)6u));
  if (ac_barr_info_r12_present) {
    HANDLE_CODE(bref.unpack(ac_barr_info_r12.ac_barr_for_mo_sig_r12_present, 1));
    HANDLE_CODE(bref.unpack(ac_barr_info_r12.ac_barr_for_mo_data_r12_present, 1));
    HANDLE_CODE(bref.unpack(ac_barr_info_r12.ac_barr_for_emergency_r12, 1));
    if (ac_barr_info_r12.ac_barr_for_mo_sig_r12_present) {
      HANDLE_CODE(ac_barr_info_r12.ac_barr_for_mo_sig_r12.unpack(bref));
    }
    if (ac_barr_info_r12.ac_barr_for_mo_data_r12_present) {
      HANDLE_CODE(ac_barr_info_r12.ac_barr_for_mo_data_r12.unpack(bref));
    }
  }
  if (ac_barr_for_csfb_r12_present) {
    HANDLE_CODE(ac_barr_for_csfb_r12.unpack(bref));
  }
  if (ssac_barr_for_mmtel_voice_r12_present) {
    HANDLE_CODE(ssac_barr_for_mmtel_voice_r12.unpack(bref));
  }
  if (ssac_barr_for_mmtel_video_r12_present) {
    HANDLE_CODE(ssac_barr_for_mmtel_video_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ac_barr_per_plmn_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("plmn-IdentityIndex-r12", plmn_id_idx_r12);
  if (ac_barr_info_r12_present) {
    j.write_fieldname("ac-BarringInfo-r12");
    j.start_obj();
    j.write_bool("ac-BarringForEmergency-r12", ac_barr_info_r12.ac_barr_for_emergency_r12);
    if (ac_barr_info_r12.ac_barr_for_mo_sig_r12_present) {
      j.write_fieldname("ac-BarringForMO-Signalling-r12");
      ac_barr_info_r12.ac_barr_for_mo_sig_r12.to_json(j);
    }
    if (ac_barr_info_r12.ac_barr_for_mo_data_r12_present) {
      j.write_fieldname("ac-BarringForMO-Data-r12");
      ac_barr_info_r12.ac_barr_for_mo_data_r12.to_json(j);
    }
    j.end_obj();
  }
  if (ac_barr_skip_for_mmtel_voice_r12_present) {
    j.write_str("ac-BarringSkipForMMTELVoice-r12", "true");
  }
  if (ac_barr_skip_for_mmtel_video_r12_present) {
    j.write_str("ac-BarringSkipForMMTELVideo-r12", "true");
  }
  if (ac_barr_skip_for_sms_r12_present) {
    j.write_str("ac-BarringSkipForSMS-r12", "true");
  }
  if (ac_barr_for_csfb_r12_present) {
    j.write_fieldname("ac-BarringForCSFB-r12");
    ac_barr_for_csfb_r12.to_json(j);
  }
  if (ssac_barr_for_mmtel_voice_r12_present) {
    j.write_fieldname("ssac-BarringForMMTEL-Voice-r12");
    ssac_barr_for_mmtel_voice_r12.to_json(j);
  }
  if (ssac_barr_for_mmtel_video_r12_present) {
    j.write_fieldname("ssac-BarringForMMTEL-Video-r12");
    ssac_barr_for_mmtel_video_r12.to_json(j);
  }
  j.end_obj();
}

// ACDC-BarringPerPLMN-r13 ::= SEQUENCE
SRSASN_CODE acdc_barr_per_plmn_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, plmn_id_idx_r13, (uint8_t)1u, (uint8_t)6u));
  HANDLE_CODE(bref.pack(acdc_only_for_hplmn_r13, 1));
  HANDLE_CODE(pack_dyn_seq_of(bref, barr_per_acdc_category_list_r13, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE acdc_barr_per_plmn_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(plmn_id_idx_r13, bref, (uint8_t)1u, (uint8_t)6u));
  HANDLE_CODE(bref.unpack(acdc_only_for_hplmn_r13, 1));
  HANDLE_CODE(unpack_dyn_seq_of(barr_per_acdc_category_list_r13, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void acdc_barr_per_plmn_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("plmn-IdentityIndex-r13", plmn_id_idx_r13);
  j.write_bool("acdc-OnlyForHPLMN-r13", acdc_only_for_hplmn_r13);
  j.start_array("barringPerACDC-CategoryList-r13");
  for (const auto& e1 : barr_per_acdc_category_list_r13) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// BCCH-Config ::= SEQUENCE
SRSASN_CODE bcch_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(mod_period_coeff.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE bcch_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(mod_period_coeff.unpack(bref));

  return SRSASN_SUCCESS;
}
void bcch_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("modificationPeriodCoeff", mod_period_coeff.to_string());
  j.end_obj();
}

// BCCH-Config-v1310 ::= SEQUENCE
SRSASN_CODE bcch_cfg_v1310_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE bcch_cfg_v1310_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void bcch_cfg_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("modificationPeriodCoeff-v1310", "n64");
  j.end_obj();
}

// CIOT-OptimisationPLMN-r13 ::= SEQUENCE
SRSASN_CODE ciot_optim_plmn_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(up_cio_t_eps_optim_r13_present, 1));
  HANDLE_CODE(bref.pack(cp_cio_t_eps_optim_r13_present, 1));
  HANDLE_CODE(bref.pack(attach_without_pdn_connect_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ciot_optim_plmn_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(up_cio_t_eps_optim_r13_present, 1));
  HANDLE_CODE(bref.unpack(cp_cio_t_eps_optim_r13_present, 1));
  HANDLE_CODE(bref.unpack(attach_without_pdn_connect_r13_present, 1));

  return SRSASN_SUCCESS;
}
void ciot_optim_plmn_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (up_cio_t_eps_optim_r13_present) {
    j.write_str("up-CIoT-EPS-Optimisation-r13", "true");
  }
  if (cp_cio_t_eps_optim_r13_present) {
    j.write_str("cp-CIoT-EPS-Optimisation-r13", "true");
  }
  if (attach_without_pdn_connect_r13_present) {
    j.write_str("attachWithoutPDN-Connectivity-r13", "true");
  }
  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 (multi_band_info_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer<uint8_t>(1, 86)));
  }

  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));

  if (multi_band_info_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer<uint8_t>(1, 86)));
  }

  return SRSASN_SUCCESS;
}
void carrier_freq_info_utra_fdd_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();
}

// CarrierFreqNR-r15 ::= SEQUENCE
SRSASN_CODE carrier_freq_nr_r15_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(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<uint16_t>(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<uint16_t>(1, 1024)));
  }
  if (meas_timing_cfg_r15_present) {
    HANDLE_CODE(meas_timing_cfg_r15.pack(bref));
  }
  HANDLE_CODE(subcarrier_spacing_ssb_r15.pack(bref));
  if (ss_rssi_meas_r15_present) {
    HANDLE_CODE(ss_rssi_meas_r15.pack(bref));
  }
  if (cell_resel_prio_r15_present) {
    HANDLE_CODE(pack_integer(bref, cell_resel_prio_r15, (uint8_t)0u, (uint8_t)7u));
  }
  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)-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 (thresh_rs_idx_r15_present) {
    HANDLE_CODE(thresh_rs_idx_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freq_nr_r15_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(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<uint16_t>(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<uint16_t>(1, 1024)));
  }
  if (meas_timing_cfg_r15_present) {
    HANDLE_CODE(meas_timing_cfg_r15.unpack(bref));
  }
  HANDLE_CODE(subcarrier_spacing_ssb_r15.unpack(bref));
  if (ss_rssi_meas_r15_present) {
    HANDLE_CODE(ss_rssi_meas_r15.unpack(bref));
  }
  if (cell_resel_prio_r15_present) {
    HANDLE_CODE(unpack_integer(cell_resel_prio_r15, bref, (uint8_t)0u, (uint8_t)7u));
  }
  if (cell_resel_sub_prio_r15_present) {
    HANDLE_CODE(cell_resel_sub_prio_r15.unpack(bref));
  }
  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));
  }
  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));
  }
  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 (q_qual_min_r15_present) {
    HANDLE_CODE(unpack_integer(q_qual_min_r15, 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 (thresh_rs_idx_r15_present) {
    HANDLE_CODE(thresh_rs_idx_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void carrier_freq_nr_r15_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.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);
    }
    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());
  }
  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);
  }
  j.end_obj();
}

// 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 carrier_freq_utra_fdd_s::unpack(cbit_ref& bref)
{
  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 carrier_freq_utra_fdd_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);
  }
  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_obj();
}

// 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(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(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));
  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 (multi_band_info_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list_r12, 1, 8, integer_packer<uint8_t>(1, 86)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freq_utra_fdd_ext_r12_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(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));
  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 (multi_band_info_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list_r12, bref, 1, 8, integer_packer<uint8_t>(1, 86)));
  }

  return SRSASN_SUCCESS;
}
void carrier_freq_utra_fdd_ext_r12_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);
  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 (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");
  }
  j.end_obj();
}

// CarrierFreqUTRA-TDD ::= SEQUENCE
SRSASN_CODE carrier_freq_utra_tdd_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));

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freq_utra_tdd_s::unpack(cbit_ref& bref)
{
  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;
}
void carrier_freq_utra_tdd_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);
  }
  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));

  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 carrier_freq_utra_tdd_r12_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(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 carrier_freq_utra_tdd_r12_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");
  }
  j.end_obj();
}

// CarrierFreqsInfoGERAN ::= SEQUENCE
SRSASN_CODE carrier_freqs_info_geran_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(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 carrier_freqs_info_geran_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(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 carrier_freqs_info_geran_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_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();
}

// CellSelectionInfo-v1130 ::= SEQUENCE
SRSASN_CODE cell_sel_info_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, q_qual_min_wb_r11, (int8_t)-34, (int8_t)-3));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_sel_info_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(q_qual_min_wb_r11, bref, (int8_t)-34, (int8_t)-3));

  return SRSASN_SUCCESS;
}
void cell_sel_info_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("q-QualMinWB-r11", q_qual_min_wb_r11);
  j.end_obj();
}

// EAB-Config-r11 ::= SEQUENCE
SRSASN_CODE eab_cfg_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(eab_category_r11.pack(bref));
  HANDLE_CODE(eab_barr_bitmap_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE eab_cfg_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(eab_category_r11.unpack(bref));
  HANDLE_CODE(eab_barr_bitmap_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void eab_cfg_r11_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.end_obj();
}

// FreqHoppingParameters-r13 ::= SEQUENCE
SRSASN_CODE freq_hop_params_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dummy_present, 1));
  HANDLE_CODE(bref.pack(dummy2_present, 1));
  HANDLE_CODE(bref.pack(dummy3_present, 1));
  HANDLE_CODE(bref.pack(interv_ul_hop_cfg_common_mode_a_r13_present, 1));
  HANDLE_CODE(bref.pack(interv_ul_hop_cfg_common_mode_b_r13_present, 1));
  HANDLE_CODE(bref.pack(dummy4_present, 1));

  if (dummy_present) {
    HANDLE_CODE(dummy.pack(bref));
  }
  if (dummy2_present) {
    HANDLE_CODE(dummy2.pack(bref));
  }
  if (dummy3_present) {
    HANDLE_CODE(dummy3.pack(bref));
  }
  if (interv_ul_hop_cfg_common_mode_a_r13_present) {
    HANDLE_CODE(interv_ul_hop_cfg_common_mode_a_r13.pack(bref));
  }
  if (interv_ul_hop_cfg_common_mode_b_r13_present) {
    HANDLE_CODE(interv_ul_hop_cfg_common_mode_b_r13.pack(bref));
  }
  if (dummy4_present) {
    HANDLE_CODE(pack_integer(bref, dummy4, (uint8_t)1u, (uint8_t)16u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_hop_params_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dummy_present, 1));
  HANDLE_CODE(bref.unpack(dummy2_present, 1));
  HANDLE_CODE(bref.unpack(dummy3_present, 1));
  HANDLE_CODE(bref.unpack(interv_ul_hop_cfg_common_mode_a_r13_present, 1));
  HANDLE_CODE(bref.unpack(interv_ul_hop_cfg_common_mode_b_r13_present, 1));
  HANDLE_CODE(bref.unpack(dummy4_present, 1));

  if (dummy_present) {
    HANDLE_CODE(dummy.unpack(bref));
  }
  if (dummy2_present) {
    HANDLE_CODE(dummy2.unpack(bref));
  }
  if (dummy3_present) {
    HANDLE_CODE(dummy3.unpack(bref));
  }
  if (interv_ul_hop_cfg_common_mode_a_r13_present) {
    HANDLE_CODE(interv_ul_hop_cfg_common_mode_a_r13.unpack(bref));
  }
  if (interv_ul_hop_cfg_common_mode_b_r13_present) {
    HANDLE_CODE(interv_ul_hop_cfg_common_mode_b_r13.unpack(bref));
  }
  if (dummy4_present) {
    HANDLE_CODE(unpack_integer(dummy4, bref, (uint8_t)1u, (uint8_t)16u));
  }

  return SRSASN_SUCCESS;
}
void freq_hop_params_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dummy_present) {
    j.write_str("dummy", dummy.to_string());
  }
  if (dummy2_present) {
    j.write_fieldname("dummy2");
    dummy2.to_json(j);
  }
  if (dummy3_present) {
    j.write_fieldname("dummy3");
    dummy3.to_json(j);
  }
  if (interv_ul_hop_cfg_common_mode_a_r13_present) {
    j.write_fieldname("interval-ULHoppingConfigCommonModeA-r13");
    interv_ul_hop_cfg_common_mode_a_r13.to_json(j);
  }
  if (interv_ul_hop_cfg_common_mode_b_r13_present) {
    j.write_fieldname("interval-ULHoppingConfigCommonModeB-r13");
    interv_ul_hop_cfg_common_mode_b_r13.to_json(j);
  }
  if (dummy4_present) {
    j.write_int("dummy4", dummy4);
  }
  j.end_obj();
}

void freq_hop_params_r13_s::dummy2_c_::destroy_() {}
void freq_hop_params_r13_s::dummy2_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
freq_hop_params_r13_s::dummy2_c_::dummy2_c_(const freq_hop_params_r13_s::dummy2_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::interv_fdd_r13:
      c.init(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.init(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy2_c_");
  }
}
freq_hop_params_r13_s::dummy2_c_& freq_hop_params_r13_s::dummy2_c_::
                                  operator=(const freq_hop_params_r13_s::dummy2_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::interv_fdd_r13:
      c.set(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.set(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy2_c_");
  }

  return *this;
}
void freq_hop_params_r13_s::dummy2_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::interv_fdd_r13:
      j.write_str("interval-FDD-r13", c.get<interv_fdd_r13_e_>().to_string());
      break;
    case types::interv_tdd_r13:
      j.write_str("interval-TDD-r13", c.get<interv_tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy2_c_");
  }
  j.end_obj();
}
SRSASN_CODE freq_hop_params_r13_s::dummy2_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().pack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy2_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_hop_params_r13_s::dummy2_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().unpack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy2_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void freq_hop_params_r13_s::dummy3_c_::destroy_() {}
void freq_hop_params_r13_s::dummy3_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
freq_hop_params_r13_s::dummy3_c_::dummy3_c_(const freq_hop_params_r13_s::dummy3_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::interv_fdd_r13:
      c.init(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.init(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy3_c_");
  }
}
freq_hop_params_r13_s::dummy3_c_& freq_hop_params_r13_s::dummy3_c_::
                                  operator=(const freq_hop_params_r13_s::dummy3_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::interv_fdd_r13:
      c.set(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.set(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy3_c_");
  }

  return *this;
}
void freq_hop_params_r13_s::dummy3_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::interv_fdd_r13:
      j.write_str("interval-FDD-r13", c.get<interv_fdd_r13_e_>().to_string());
      break;
    case types::interv_tdd_r13:
      j.write_str("interval-TDD-r13", c.get<interv_tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy3_c_");
  }
  j.end_obj();
}
SRSASN_CODE freq_hop_params_r13_s::dummy3_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().pack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy3_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_hop_params_r13_s::dummy3_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().unpack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::dummy3_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_::destroy_() {}
void freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_::interv_ul_hop_cfg_common_mode_a_r13_c_(
    const freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::interv_fdd_r13:
      c.init(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.init(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_");
  }
}
freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_&
freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_::
operator=(const freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::interv_fdd_r13:
      c.set(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.set(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_");
  }

  return *this;
}
void freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::interv_fdd_r13:
      j.write_str("interval-FDD-r13", c.get<interv_fdd_r13_e_>().to_string());
      break;
    case types::interv_tdd_r13:
      j.write_str("interval-TDD-r13", c.get<interv_tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().pack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().unpack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_a_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_::destroy_() {}
void freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_::interv_ul_hop_cfg_common_mode_b_r13_c_(
    const freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::interv_fdd_r13:
      c.init(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.init(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_");
  }
}
freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_&
freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_::
operator=(const freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::interv_fdd_r13:
      c.set(other.c.get<interv_fdd_r13_e_>());
      break;
    case types::interv_tdd_r13:
      c.set(other.c.get<interv_tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_");
  }

  return *this;
}
void freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::interv_fdd_r13:
      j.write_str("interval-FDD-r13", c.get<interv_fdd_r13_e_>().to_string());
      break;
    case types::interv_tdd_r13:
      j.write_str("interval-TDD-r13", c.get<interv_tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().pack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interv_fdd_r13:
      HANDLE_CODE(c.get<interv_fdd_r13_e_>().unpack(bref));
      break;
    case types::interv_tdd_r13:
      HANDLE_CODE(c.get<interv_tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "freq_hop_params_r13_s::interv_ul_hop_cfg_common_mode_b_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// HighSpeedConfig-r14 ::= SEQUENCE
SRSASN_CODE high_speed_cfg_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(high_speed_enhanced_meas_flag_r14_present, 1));
  HANDLE_CODE(bref.pack(high_speed_enhanced_demod_flag_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE high_speed_cfg_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(high_speed_enhanced_meas_flag_r14_present, 1));
  HANDLE_CODE(bref.unpack(high_speed_enhanced_demod_flag_r14_present, 1));

  return SRSASN_SUCCESS;
}
void high_speed_cfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (high_speed_enhanced_meas_flag_r14_present) {
    j.write_str("highSpeedEnhancedMeasFlag-r14", "true");
  }
  if (high_speed_enhanced_demod_flag_r14_present) {
    j.write_str("highSpeedEnhancedDemodulationFlag-r14", "true");
  }
  j.end_obj();
}

// HighSpeedConfig-v1530 ::= SEQUENCE
SRSASN_CODE high_speed_cfg_v1530_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE high_speed_cfg_v1530_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void high_speed_cfg_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("highSpeedMeasGapCE-ModeA-r15", "true");
  j.end_obj();
}

// InterFreqCarrierFreqInfo ::= SEQUENCE
SRSASN_CODE inter_freq_carrier_freq_info_s::pack(bit_ref& bref) const
{
  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(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));
  }

  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 inter_freq_carrier_freq_info_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, 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));
  }
  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));
  }

  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(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);

      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 inter_freq_carrier_freq_info_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();
  }
  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();
}

// 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(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, 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<uint16_t>(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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_carrier_freq_info_r12_s::unpack(cbit_ref& bref)
{
  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));

  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<uint16_t>(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));
  }

  return SRSASN_SUCCESS;
}
void inter_freq_carrier_freq_info_r12_s::to_json(json_writer& j) 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();
}

// InterFreqCarrierFreqInfo-v1250 ::= SEQUENCE
SRSASN_CODE inter_freq_carrier_freq_info_v1250_s::pack(bit_ref& bref) 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));

  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));
  }

  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));

  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 inter_freq_carrier_freq_info_v1250_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.end_obj();
}

// InterFreqCarrierFreqInfo-v1310 ::= SEQUENCE
SRSASN_CODE inter_freq_carrier_freq_info_v1310_s::pack(bit_ref& bref) 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));

  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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_carrier_freq_info_v1310_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));
  }

  return SRSASN_SUCCESS;
}
void inter_freq_carrier_freq_info_v1310_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.end_obj();
}

// InterFreqCarrierFreqInfo-v1350 ::= SEQUENCE
SRSASN_CODE inter_freq_carrier_freq_info_v1350_s::pack(bit_ref& bref) const
{
  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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_carrier_freq_info_v1350_s::unpack(cbit_ref& bref)
{
  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));
  }

  return SRSASN_SUCCESS;
}
void inter_freq_carrier_freq_info_v1350_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cell_sel_info_ce1_r13_present) {
    j.write_fieldname("cellSelectionInfoCE1-r13");
    cell_sel_info_ce1_r13.to_json(j);
  }
  j.end_obj();
}

// InterFreqCarrierFreqInfo-v1530 ::= SEQUENCE
SRSASN_CODE inter_freq_carrier_freq_info_v1530_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(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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_carrier_freq_info_v1530_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(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));
  }

  return SRSASN_SUCCESS;
}
void inter_freq_carrier_freq_info_v1530_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) {
      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
{
  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<uint8_t>(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<uint8_t>(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();
}

// IntraFreqNeighCellInfo ::= SEQUENCE
SRSASN_CODE intra_freq_neigh_cell_info_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));

  return SRSASN_SUCCESS;
}
SRSASN_CODE intra_freq_neigh_cell_info_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));

  return SRSASN_SUCCESS;
}
void intra_freq_neigh_cell_info_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.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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_carrier_type_r14_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));
  }

  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();
}

// 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<uint32_t>(0, 65535)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_sai_inter_freq_r11_s::unpack(cbit_ref& bref)
{
  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<uint32_t>(0, 65535)));

  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);
  }
  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<uint16_t>(1, 256)));
  }

  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<uint16_t>(1, 256)));
  }

  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_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));
      }
    }
  }
  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);

      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 mbsfn_area_info_r9_s::to_json(json_writer& j) const
{
  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());
    }
  }
  j.end_obj();
}

// MBSFN-SubframeConfig ::= SEQUENCE
SRSASN_CODE mbsfn_sf_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(radioframe_alloc_period.pack(bref));
  HANDLE_CODE(pack_integer(bref, radioframe_alloc_offset, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(sf_alloc.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbsfn_sf_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(radioframe_alloc_period.unpack(bref));
  HANDLE_CODE(unpack_integer(radioframe_alloc_offset, bref, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(sf_alloc.unpack(bref));

  return SRSASN_SUCCESS;
}
void mbsfn_sf_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("radioframeAllocationPeriod", radioframe_alloc_period.to_string());
  j.write_int("radioframeAllocationOffset", radioframe_alloc_offset);
  j.write_fieldname("subframeAllocation");
  sf_alloc.to_json(j);
  j.end_obj();
}

void mbsfn_sf_cfg_s::sf_alloc_c_::destroy_()
{
  switch (type_) {
    case types::one_frame:
      c.destroy<fixed_bitstring<6> >();
      break;
    case types::four_frames:
      c.destroy<fixed_bitstring<24> >();
      break;
    default:
      break;
  }
}
void mbsfn_sf_cfg_s::sf_alloc_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::one_frame:
      c.init<fixed_bitstring<6> >();
      break;
    case types::four_frames:
      c.init<fixed_bitstring<24> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_s::sf_alloc_c_");
  }
}
mbsfn_sf_cfg_s::sf_alloc_c_::sf_alloc_c_(const mbsfn_sf_cfg_s::sf_alloc_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::one_frame:
      c.init(other.c.get<fixed_bitstring<6> >());
      break;
    case types::four_frames:
      c.init(other.c.get<fixed_bitstring<24> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_s::sf_alloc_c_");
  }
}
mbsfn_sf_cfg_s::sf_alloc_c_& mbsfn_sf_cfg_s::sf_alloc_c_::operator=(const mbsfn_sf_cfg_s::sf_alloc_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::one_frame:
      c.set(other.c.get<fixed_bitstring<6> >());
      break;
    case types::four_frames:
      c.set(other.c.get<fixed_bitstring<24> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_s::sf_alloc_c_");
  }

  return *this;
}
void mbsfn_sf_cfg_s::sf_alloc_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::one_frame:
      j.write_str("oneFrame", c.get<fixed_bitstring<6> >().to_string());
      break;
    case types::four_frames:
      j.write_str("fourFrames", c.get<fixed_bitstring<24> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_s::sf_alloc_c_");
  }
  j.end_obj();
}
SRSASN_CODE mbsfn_sf_cfg_s::sf_alloc_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::one_frame:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().pack(bref));
      break;
    case types::four_frames:
      HANDLE_CODE(c.get<fixed_bitstring<24> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_s::sf_alloc_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mbsfn_sf_cfg_s::sf_alloc_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::one_frame:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().unpack(bref));
      break;
    case types::four_frames:
      HANDLE_CODE(c.get<fixed_bitstring<24> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_s::sf_alloc_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MBSFN-SubframeConfig-v1430 ::= SEQUENCE
SRSASN_CODE mbsfn_sf_cfg_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sf_alloc_v1430.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbsfn_sf_cfg_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sf_alloc_v1430.unpack(bref));

  return SRSASN_SUCCESS;
}
void mbsfn_sf_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("subframeAllocation-v1430");
  sf_alloc_v1430.to_json(j);
  j.end_obj();
}

void mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_::destroy_()
{
  switch (type_) {
    case types::one_frame_v1430:
      c.destroy<fixed_bitstring<2> >();
      break;
    case types::four_frames_v1430:
      c.destroy<fixed_bitstring<8> >();
      break;
    default:
      break;
  }
}
void mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::one_frame_v1430:
      c.init<fixed_bitstring<2> >();
      break;
    case types::four_frames_v1430:
      c.init<fixed_bitstring<8> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_");
  }
}
mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_::sf_alloc_v1430_c_(const mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::one_frame_v1430:
      c.init(other.c.get<fixed_bitstring<2> >());
      break;
    case types::four_frames_v1430:
      c.init(other.c.get<fixed_bitstring<8> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_");
  }
}
mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_& mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_::
                                         operator=(const mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::one_frame_v1430:
      c.set(other.c.get<fixed_bitstring<2> >());
      break;
    case types::four_frames_v1430:
      c.set(other.c.get<fixed_bitstring<8> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_");
  }

  return *this;
}
void mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::one_frame_v1430:
      j.write_str("oneFrame-v1430", c.get<fixed_bitstring<2> >().to_string());
      break;
    case types::four_frames_v1430:
      j.write_str("fourFrames-v1430", c.get<fixed_bitstring<8> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_");
  }
  j.end_obj();
}
SRSASN_CODE mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::one_frame_v1430:
      HANDLE_CODE(c.get<fixed_bitstring<2> >().pack(bref));
      break;
    case types::four_frames_v1430:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::one_frame_v1430:
      HANDLE_CODE(c.get<fixed_bitstring<2> >().unpack(bref));
      break;
    case types::four_frames_v1430:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mbsfn_sf_cfg_v1430_s::sf_alloc_v1430_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PCCH-Config ::= SEQUENCE
SRSASN_CODE pcch_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(default_paging_cycle.pack(bref));
  HANDLE_CODE(nb.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pcch_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(default_paging_cycle.unpack(bref));
  HANDLE_CODE(nb.unpack(bref));

  return SRSASN_SUCCESS;
}
void pcch_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("defaultPagingCycle", default_paging_cycle.to_string());
  j.write_str("nB", nb.to_string());
  j.end_obj();
}

// PCCH-Config-v1310 ::= SEQUENCE
SRSASN_CODE pcch_cfg_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(nb_v1310_present, 1));

  HANDLE_CODE(pack_integer(bref, paging_narrow_bands_r13, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(mpdcch_num_repeat_paging_r13.pack(bref));
  if (nb_v1310_present) {
    HANDLE_CODE(nb_v1310.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pcch_cfg_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(nb_v1310_present, 1));

  HANDLE_CODE(unpack_integer(paging_narrow_bands_r13, bref, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(mpdcch_num_repeat_paging_r13.unpack(bref));
  if (nb_v1310_present) {
    HANDLE_CODE(nb_v1310.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pcch_cfg_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("paging-narrowBands-r13", paging_narrow_bands_r13);
  j.write_str("mpdcch-NumRepetition-Paging-r13", mpdcch_num_repeat_paging_r13.to_string());
  if (nb_v1310_present) {
    j.write_str("nB-v1310", nb_v1310.to_string());
  }
  j.end_obj();
}

// PDSCH-ConfigCommon ::= SEQUENCE
SRSASN_CODE pdsch_cfg_common_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, ref_sig_pwr, (int8_t)-60, (int8_t)50));
  HANDLE_CODE(pack_integer(bref, p_b, (uint8_t)0u, (uint8_t)3u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_common_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(ref_sig_pwr, bref, (int8_t)-60, (int8_t)50));
  HANDLE_CODE(unpack_integer(p_b, bref, (uint8_t)0u, (uint8_t)3u));

  return SRSASN_SUCCESS;
}
void pdsch_cfg_common_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("referenceSignalPower", ref_sig_pwr);
  j.write_int("p-b", p_b);
  j.end_obj();
}

// PDSCH-ConfigCommon-v1310 ::= SEQUENCE
SRSASN_CODE pdsch_cfg_common_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pdsch_max_num_repeat_cemode_a_r13_present, 1));
  HANDLE_CODE(bref.pack(pdsch_max_num_repeat_cemode_b_r13_present, 1));

  if (pdsch_max_num_repeat_cemode_a_r13_present) {
    HANDLE_CODE(pdsch_max_num_repeat_cemode_a_r13.pack(bref));
  }
  if (pdsch_max_num_repeat_cemode_b_r13_present) {
    HANDLE_CODE(pdsch_max_num_repeat_cemode_b_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_common_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pdsch_max_num_repeat_cemode_a_r13_present, 1));
  HANDLE_CODE(bref.unpack(pdsch_max_num_repeat_cemode_b_r13_present, 1));

  if (pdsch_max_num_repeat_cemode_a_r13_present) {
    HANDLE_CODE(pdsch_max_num_repeat_cemode_a_r13.unpack(bref));
  }
  if (pdsch_max_num_repeat_cemode_b_r13_present) {
    HANDLE_CODE(pdsch_max_num_repeat_cemode_b_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdsch_cfg_common_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pdsch_max_num_repeat_cemode_a_r13_present) {
    j.write_str("pdsch-maxNumRepetitionCEmodeA-r13", pdsch_max_num_repeat_cemode_a_r13.to_string());
  }
  if (pdsch_max_num_repeat_cemode_b_r13_present) {
    j.write_str("pdsch-maxNumRepetitionCEmodeB-r13", pdsch_max_num_repeat_cemode_b_r13.to_string());
  }
  j.end_obj();
}

// PLMN-Info-r15 ::= SEQUENCE
SRSASN_CODE plmn_info_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(upper_layer_ind_r15_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_info_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(upper_layer_ind_r15_present, 1));

  return SRSASN_SUCCESS;
}
void plmn_info_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (upper_layer_ind_r15_present) {
    j.write_str("upperLayerIndication-r15", "true");
  }
  j.end_obj();
}

// PRACH-Config-v1430 ::= SEQUENCE
SRSASN_CODE prach_cfg_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, root_seq_idx_high_speed_r14, (uint16_t)0u, (uint16_t)837u));
  HANDLE_CODE(pack_integer(bref, zero_correlation_zone_cfg_high_speed_r14, (uint8_t)0u, (uint8_t)12u));
  HANDLE_CODE(pack_integer(bref, prach_cfg_idx_high_speed_r14, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(pack_integer(bref, prach_freq_offset_high_speed_r14, (uint8_t)0u, (uint8_t)94u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(root_seq_idx_high_speed_r14, bref, (uint16_t)0u, (uint16_t)837u));
  HANDLE_CODE(unpack_integer(zero_correlation_zone_cfg_high_speed_r14, bref, (uint8_t)0u, (uint8_t)12u));
  HANDLE_CODE(unpack_integer(prach_cfg_idx_high_speed_r14, bref, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(unpack_integer(prach_freq_offset_high_speed_r14, bref, (uint8_t)0u, (uint8_t)94u));

  return SRSASN_SUCCESS;
}
void prach_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("rootSequenceIndexHighSpeed-r14", root_seq_idx_high_speed_r14);
  j.write_int("zeroCorrelationZoneConfigHighSpeed-r14", zero_correlation_zone_cfg_high_speed_r14);
  j.write_int("prach-ConfigIndexHighSpeed-r14", prach_cfg_idx_high_speed_r14);
  j.write_int("prach-FreqOffsetHighSpeed-r14", prach_freq_offset_high_speed_r14);
  j.end_obj();
}

// PRACH-ConfigSIB ::= SEQUENCE
SRSASN_CODE prach_cfg_sib_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, root_seq_idx, (uint16_t)0u, (uint16_t)837u));
  HANDLE_CODE(prach_cfg_info.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_sib_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(root_seq_idx, bref, (uint16_t)0u, (uint16_t)837u));
  HANDLE_CODE(prach_cfg_info.unpack(bref));

  return SRSASN_SUCCESS;
}
void prach_cfg_sib_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("rootSequenceIndex", root_seq_idx);
  j.write_fieldname("prach-ConfigInfo");
  prach_cfg_info.to_json(j);
  j.end_obj();
}

// PRACH-ConfigSIB-v1310 ::= SEQUENCE
SRSASN_CODE prach_cfg_sib_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mpdcch_start_sf_css_ra_r13_present, 1));
  HANDLE_CODE(bref.pack(prach_hop_offset_r13_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, rsrp_thress_prach_info_list_r13, 1, 3, integer_packer<uint8_t>(0, 97)));
  if (mpdcch_start_sf_css_ra_r13_present) {
    HANDLE_CODE(mpdcch_start_sf_css_ra_r13.pack(bref));
  }
  if (prach_hop_offset_r13_present) {
    HANDLE_CODE(pack_integer(bref, prach_hop_offset_r13, (uint8_t)0u, (uint8_t)94u));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, prach_params_list_ce_r13, 1, 4));

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_sib_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mpdcch_start_sf_css_ra_r13_present, 1));
  HANDLE_CODE(bref.unpack(prach_hop_offset_r13_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(rsrp_thress_prach_info_list_r13, bref, 1, 3, integer_packer<uint8_t>(0, 97)));
  if (mpdcch_start_sf_css_ra_r13_present) {
    HANDLE_CODE(mpdcch_start_sf_css_ra_r13.unpack(bref));
  }
  if (prach_hop_offset_r13_present) {
    HANDLE_CODE(unpack_integer(prach_hop_offset_r13, bref, (uint8_t)0u, (uint8_t)94u));
  }
  HANDLE_CODE(unpack_dyn_seq_of(prach_params_list_ce_r13, bref, 1, 4));

  return SRSASN_SUCCESS;
}
void prach_cfg_sib_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("rsrp-ThresholdsPrachInfoList-r13");
  for (const auto& e1 : rsrp_thress_prach_info_list_r13) {
    j.write_int(e1);
  }
  j.end_array();
  if (mpdcch_start_sf_css_ra_r13_present) {
    j.write_fieldname("mpdcch-startSF-CSS-RA-r13");
    mpdcch_start_sf_css_ra_r13.to_json(j);
  }
  if (prach_hop_offset_r13_present) {
    j.write_int("prach-HoppingOffset-r13", prach_hop_offset_r13);
  }
  j.start_array("prach-ParametersListCE-r13");
  for (const auto& e1 : prach_params_list_ce_r13) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

void prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_::destroy_() {}
void prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_::mpdcch_start_sf_css_ra_r13_c_(
    const prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::fdd_r13:
      c.init(other.c.get<fdd_r13_e_>());
      break;
    case types::tdd_r13:
      c.init(other.c.get<tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
  }
}
prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_& prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_::
                                                      operator=(const prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::fdd_r13:
      c.set(other.c.get<fdd_r13_e_>());
      break;
    case types::tdd_r13:
      c.set(other.c.get<tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
  }

  return *this;
}
void prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::fdd_r13:
      j.write_str("fdd-r13", c.get<fdd_r13_e_>().to_string());
      break;
    case types::tdd_r13:
      j.write_str("tdd-r13", c.get<tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::fdd_r13:
      HANDLE_CODE(c.get<fdd_r13_e_>().pack(bref));
      break;
    case types::tdd_r13:
      HANDLE_CODE(c.get<tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::fdd_r13:
      HANDLE_CODE(c.get<fdd_r13_e_>().unpack(bref));
      break;
    case types::tdd_r13:
      HANDLE_CODE(c.get<tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_sib_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PRACH-ConfigSIB-v1530 ::= SEQUENCE
SRSASN_CODE prach_cfg_sib_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, edt_prach_params_list_ce_r15, 1, 4));

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_sib_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(edt_prach_params_list_ce_r15, bref, 1, 4));

  return SRSASN_SUCCESS;
}
void prach_cfg_sib_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("edt-PRACH-ParametersListCE-r15");
  for (const auto& e1 : edt_prach_params_list_ce_r15) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// PUCCH-ConfigCommon ::= SEQUENCE
SRSASN_CODE pucch_cfg_common_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(delta_pucch_shift.pack(bref));
  HANDLE_CODE(pack_integer(bref, nrb_cqi, (uint8_t)0u, (uint8_t)98u));
  HANDLE_CODE(pack_integer(bref, ncs_an, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(pack_integer(bref, n1_pucch_an, (uint16_t)0u, (uint16_t)2047u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_common_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(delta_pucch_shift.unpack(bref));
  HANDLE_CODE(unpack_integer(nrb_cqi, bref, (uint8_t)0u, (uint8_t)98u));
  HANDLE_CODE(unpack_integer(ncs_an, bref, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(unpack_integer(n1_pucch_an, bref, (uint16_t)0u, (uint16_t)2047u));

  return SRSASN_SUCCESS;
}
void pucch_cfg_common_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("deltaPUCCH-Shift", delta_pucch_shift.to_string());
  j.write_int("nRB-CQI", nrb_cqi);
  j.write_int("nCS-AN", ncs_an);
  j.write_int("n1PUCCH-AN", n1_pucch_an);
  j.end_obj();
}

// PUCCH-ConfigCommon-v1310 ::= SEQUENCE
SRSASN_CODE pucch_cfg_common_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(n1_pucch_an_info_list_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_num_repeat_ce_msg4_level0_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_num_repeat_ce_msg4_level1_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_num_repeat_ce_msg4_level2_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_num_repeat_ce_msg4_level3_r13_present, 1));

  if (n1_pucch_an_info_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, n1_pucch_an_info_list_r13, 1, 4, integer_packer<uint16_t>(0, 2047)));
  }
  if (pucch_num_repeat_ce_msg4_level0_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level0_r13.pack(bref));
  }
  if (pucch_num_repeat_ce_msg4_level1_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level1_r13.pack(bref));
  }
  if (pucch_num_repeat_ce_msg4_level2_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level2_r13.pack(bref));
  }
  if (pucch_num_repeat_ce_msg4_level3_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level3_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_common_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(n1_pucch_an_info_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_num_repeat_ce_msg4_level0_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_num_repeat_ce_msg4_level1_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_num_repeat_ce_msg4_level2_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_num_repeat_ce_msg4_level3_r13_present, 1));

  if (n1_pucch_an_info_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(n1_pucch_an_info_list_r13, bref, 1, 4, integer_packer<uint16_t>(0, 2047)));
  }
  if (pucch_num_repeat_ce_msg4_level0_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level0_r13.unpack(bref));
  }
  if (pucch_num_repeat_ce_msg4_level1_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level1_r13.unpack(bref));
  }
  if (pucch_num_repeat_ce_msg4_level2_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level2_r13.unpack(bref));
  }
  if (pucch_num_repeat_ce_msg4_level3_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level3_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pucch_cfg_common_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (n1_pucch_an_info_list_r13_present) {
    j.start_array("n1PUCCH-AN-InfoList-r13");
    for (const auto& e1 : n1_pucch_an_info_list_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (pucch_num_repeat_ce_msg4_level0_r13_present) {
    j.write_str("pucch-NumRepetitionCE-Msg4-Level0-r13", pucch_num_repeat_ce_msg4_level0_r13.to_string());
  }
  if (pucch_num_repeat_ce_msg4_level1_r13_present) {
    j.write_str("pucch-NumRepetitionCE-Msg4-Level1-r13", pucch_num_repeat_ce_msg4_level1_r13.to_string());
  }
  if (pucch_num_repeat_ce_msg4_level2_r13_present) {
    j.write_str("pucch-NumRepetitionCE-Msg4-Level2-r13", pucch_num_repeat_ce_msg4_level2_r13.to_string());
  }
  if (pucch_num_repeat_ce_msg4_level3_r13_present) {
    j.write_str("pucch-NumRepetitionCE-Msg4-Level3-r13", pucch_num_repeat_ce_msg4_level3_r13.to_string());
  }
  j.end_obj();
}

// PUCCH-ConfigCommon-v1430 ::= SEQUENCE
SRSASN_CODE pucch_cfg_common_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pucch_num_repeat_ce_msg4_level3_r14_present, 1));

  if (pucch_num_repeat_ce_msg4_level3_r14_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level3_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_common_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pucch_num_repeat_ce_msg4_level3_r14_present, 1));

  if (pucch_num_repeat_ce_msg4_level3_r14_present) {
    HANDLE_CODE(pucch_num_repeat_ce_msg4_level3_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pucch_cfg_common_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pucch_num_repeat_ce_msg4_level3_r14_present) {
    j.write_str("pucch-NumRepetitionCE-Msg4-Level3-r14", pucch_num_repeat_ce_msg4_level3_r14.to_string());
  }
  j.end_obj();
}

// PUSCH-ConfigCommon ::= SEQUENCE
SRSASN_CODE pusch_cfg_common_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, pusch_cfg_basic.n_sb, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(pusch_cfg_basic.hop_mode.pack(bref));
  HANDLE_CODE(pack_integer(bref, pusch_cfg_basic.pusch_hop_offset, (uint8_t)0u, (uint8_t)98u));
  HANDLE_CODE(bref.pack(pusch_cfg_basic.enable64_qam, 1));
  HANDLE_CODE(ul_ref_sigs_pusch.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_common_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(pusch_cfg_basic.n_sb, bref, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(pusch_cfg_basic.hop_mode.unpack(bref));
  HANDLE_CODE(unpack_integer(pusch_cfg_basic.pusch_hop_offset, bref, (uint8_t)0u, (uint8_t)98u));
  HANDLE_CODE(bref.unpack(pusch_cfg_basic.enable64_qam, 1));
  HANDLE_CODE(ul_ref_sigs_pusch.unpack(bref));

  return SRSASN_SUCCESS;
}
void pusch_cfg_common_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("pusch-ConfigBasic");
  j.start_obj();
  j.write_int("n-SB", pusch_cfg_basic.n_sb);
  j.write_str("hoppingMode", pusch_cfg_basic.hop_mode.to_string());
  j.write_int("pusch-HoppingOffset", pusch_cfg_basic.pusch_hop_offset);
  j.write_bool("enable64QAM", pusch_cfg_basic.enable64_qam);
  j.end_obj();
  j.write_fieldname("ul-ReferenceSignalsPUSCH");
  ul_ref_sigs_pusch.to_json(j);
  j.end_obj();
}

// PUSCH-ConfigCommon-v1270 ::= SEQUENCE
SRSASN_CODE pusch_cfg_common_v1270_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_common_v1270_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void pusch_cfg_common_v1270_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("enable64QAM-v1270", "true");
  j.end_obj();
}

// PUSCH-ConfigCommon-v1310 ::= SEQUENCE
SRSASN_CODE pusch_cfg_common_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pusch_max_num_repeat_cemode_a_r13_present, 1));
  HANDLE_CODE(bref.pack(pusch_max_num_repeat_cemode_b_r13_present, 1));
  HANDLE_CODE(bref.pack(pusch_hop_offset_v1310_present, 1));

  if (pusch_max_num_repeat_cemode_a_r13_present) {
    HANDLE_CODE(pusch_max_num_repeat_cemode_a_r13.pack(bref));
  }
  if (pusch_max_num_repeat_cemode_b_r13_present) {
    HANDLE_CODE(pusch_max_num_repeat_cemode_b_r13.pack(bref));
  }
  if (pusch_hop_offset_v1310_present) {
    HANDLE_CODE(pack_integer(bref, pusch_hop_offset_v1310, (uint8_t)1u, (uint8_t)16u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_common_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pusch_max_num_repeat_cemode_a_r13_present, 1));
  HANDLE_CODE(bref.unpack(pusch_max_num_repeat_cemode_b_r13_present, 1));
  HANDLE_CODE(bref.unpack(pusch_hop_offset_v1310_present, 1));

  if (pusch_max_num_repeat_cemode_a_r13_present) {
    HANDLE_CODE(pusch_max_num_repeat_cemode_a_r13.unpack(bref));
  }
  if (pusch_max_num_repeat_cemode_b_r13_present) {
    HANDLE_CODE(pusch_max_num_repeat_cemode_b_r13.unpack(bref));
  }
  if (pusch_hop_offset_v1310_present) {
    HANDLE_CODE(unpack_integer(pusch_hop_offset_v1310, bref, (uint8_t)1u, (uint8_t)16u));
  }

  return SRSASN_SUCCESS;
}
void pusch_cfg_common_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pusch_max_num_repeat_cemode_a_r13_present) {
    j.write_str("pusch-maxNumRepetitionCEmodeA-r13", pusch_max_num_repeat_cemode_a_r13.to_string());
  }
  if (pusch_max_num_repeat_cemode_b_r13_present) {
    j.write_str("pusch-maxNumRepetitionCEmodeB-r13", pusch_max_num_repeat_cemode_b_r13.to_string());
  }
  if (pusch_hop_offset_v1310_present) {
    j.write_int("pusch-HoppingOffset-v1310", pusch_hop_offset_v1310);
  }
  j.end_obj();
}

// RACH-ConfigCommon ::= SEQUENCE
SRSASN_CODE rach_cfg_common_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(preamb_info.preambs_group_a_cfg_present, 1));
  HANDLE_CODE(preamb_info.nof_ra_preambs.pack(bref));
  if (preamb_info.preambs_group_a_cfg_present) {
    bref.pack(preamb_info.preambs_group_a_cfg.ext, 1);
    HANDLE_CODE(preamb_info.preambs_group_a_cfg.size_of_ra_preambs_group_a.pack(bref));
    HANDLE_CODE(preamb_info.preambs_group_a_cfg.msg_size_group_a.pack(bref));
    HANDLE_CODE(preamb_info.preambs_group_a_cfg.msg_pwr_offset_group_b.pack(bref));
  }
  HANDLE_CODE(pwr_ramp_params.pack(bref));
  HANDLE_CODE(ra_supervision_info.preamb_trans_max.pack(bref));
  HANDLE_CODE(ra_supervision_info.ra_resp_win_size.pack(bref));
  HANDLE_CODE(ra_supervision_info.mac_contention_resolution_timer.pack(bref));
  HANDLE_CODE(pack_integer(bref, max_harq_msg3_tx, (uint8_t)1u, (uint8_t)8u));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= preamb_trans_max_ce_r13_present;
    group_flags[0] |= rach_ce_level_info_list_r13.is_present();
    group_flags[1] |= edt_small_tbs_subset_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(preamb_trans_max_ce_r13_present, 1));
      HANDLE_CODE(bref.pack(rach_ce_level_info_list_r13.is_present(), 1));
      if (preamb_trans_max_ce_r13_present) {
        HANDLE_CODE(preamb_trans_max_ce_r13.pack(bref));
      }
      if (rach_ce_level_info_list_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *rach_ce_level_info_list_r13, 1, 4));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(edt_small_tbs_subset_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rach_cfg_common_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(preamb_info.preambs_group_a_cfg_present, 1));
  HANDLE_CODE(preamb_info.nof_ra_preambs.unpack(bref));
  if (preamb_info.preambs_group_a_cfg_present) {
    bref.unpack(preamb_info.preambs_group_a_cfg.ext, 1);
    HANDLE_CODE(preamb_info.preambs_group_a_cfg.size_of_ra_preambs_group_a.unpack(bref));
    HANDLE_CODE(preamb_info.preambs_group_a_cfg.msg_size_group_a.unpack(bref));
    HANDLE_CODE(preamb_info.preambs_group_a_cfg.msg_pwr_offset_group_b.unpack(bref));
  }
  HANDLE_CODE(pwr_ramp_params.unpack(bref));
  HANDLE_CODE(ra_supervision_info.preamb_trans_max.unpack(bref));
  HANDLE_CODE(ra_supervision_info.ra_resp_win_size.unpack(bref));
  HANDLE_CODE(ra_supervision_info.mac_contention_resolution_timer.unpack(bref));
  HANDLE_CODE(unpack_integer(max_harq_msg3_tx, bref, (uint8_t)1u, (uint8_t)8u));

  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(preamb_trans_max_ce_r13_present, 1));
      bool rach_ce_level_info_list_r13_present;
      HANDLE_CODE(bref.unpack(rach_ce_level_info_list_r13_present, 1));
      rach_ce_level_info_list_r13.set_present(rach_ce_level_info_list_r13_present);
      if (preamb_trans_max_ce_r13_present) {
        HANDLE_CODE(preamb_trans_max_ce_r13.unpack(bref));
      }
      if (rach_ce_level_info_list_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*rach_ce_level_info_list_r13, bref, 1, 4));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(edt_small_tbs_subset_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
void rach_cfg_common_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("preambleInfo");
  j.start_obj();
  j.write_str("numberOfRA-Preambles", preamb_info.nof_ra_preambs.to_string());
  if (preamb_info.preambs_group_a_cfg_present) {
    j.write_fieldname("preamblesGroupAConfig");
    j.start_obj();
    j.write_str("sizeOfRA-PreamblesGroupA", preamb_info.preambs_group_a_cfg.size_of_ra_preambs_group_a.to_string());
    j.write_str("messageSizeGroupA", preamb_info.preambs_group_a_cfg.msg_size_group_a.to_string());
    j.write_str("messagePowerOffsetGroupB", preamb_info.preambs_group_a_cfg.msg_pwr_offset_group_b.to_string());
    j.end_obj();
  }
  j.end_obj();
  j.write_fieldname("powerRampingParameters");
  pwr_ramp_params.to_json(j);
  j.write_fieldname("ra-SupervisionInfo");
  j.start_obj();
  j.write_str("preambleTransMax", ra_supervision_info.preamb_trans_max.to_string());
  j.write_str("ra-ResponseWindowSize", ra_supervision_info.ra_resp_win_size.to_string());
  j.write_str("mac-ContentionResolutionTimer", ra_supervision_info.mac_contention_resolution_timer.to_string());
  j.end_obj();
  j.write_int("maxHARQ-Msg3Tx", max_harq_msg3_tx);
  if (ext) {
    if (preamb_trans_max_ce_r13_present) {
      j.write_str("preambleTransMax-CE-r13", preamb_trans_max_ce_r13.to_string());
    }
    if (rach_ce_level_info_list_r13.is_present()) {
      j.start_array("rach-CE-LevelInfoList-r13");
      for (const auto& e1 : *rach_ce_level_info_list_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (edt_small_tbs_subset_r15_present) {
      j.write_str("edt-SmallTBS-Subset-r15", "true");
    }
  }
  j.end_obj();
}

// RACH-ConfigCommon-v1250 ::= SEQUENCE
SRSASN_CODE rach_cfg_common_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tx_fail_params_r12.conn_est_fail_offset_r12_present, 1));
  HANDLE_CODE(tx_fail_params_r12.conn_est_fail_count_r12.pack(bref));
  HANDLE_CODE(tx_fail_params_r12.conn_est_fail_offset_validity_r12.pack(bref));
  if (tx_fail_params_r12.conn_est_fail_offset_r12_present) {
    HANDLE_CODE(pack_integer(bref, tx_fail_params_r12.conn_est_fail_offset_r12, (uint8_t)0u, (uint8_t)15u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rach_cfg_common_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tx_fail_params_r12.conn_est_fail_offset_r12_present, 1));
  HANDLE_CODE(tx_fail_params_r12.conn_est_fail_count_r12.unpack(bref));
  HANDLE_CODE(tx_fail_params_r12.conn_est_fail_offset_validity_r12.unpack(bref));
  if (tx_fail_params_r12.conn_est_fail_offset_r12_present) {
    HANDLE_CODE(unpack_integer(tx_fail_params_r12.conn_est_fail_offset_r12, bref, (uint8_t)0u, (uint8_t)15u));
  }

  return SRSASN_SUCCESS;
}
void rach_cfg_common_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("txFailParams-r12");
  j.start_obj();
  j.write_str("connEstFailCount-r12", tx_fail_params_r12.conn_est_fail_count_r12.to_string());
  j.write_str("connEstFailOffsetValidity-r12", tx_fail_params_r12.conn_est_fail_offset_validity_r12.to_string());
  if (tx_fail_params_r12.conn_est_fail_offset_r12_present) {
    j.write_int("connEstFailOffset-r12", tx_fail_params_r12.conn_est_fail_offset_r12);
  }
  j.end_obj();
  j.end_obj();
}

// RSS-Config-r15 ::= SEQUENCE
SRSASN_CODE rss_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(dur_r15.pack(bref));
  HANDLE_CODE(pack_integer(bref, freq_location_r15, (uint8_t)0u, (uint8_t)98u));
  HANDLE_CODE(periodicity_r15.pack(bref));
  HANDLE_CODE(pwr_boost_r15.pack(bref));
  HANDLE_CODE(pack_integer(bref, time_offset_r15, (uint8_t)0u, (uint8_t)31u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rss_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(dur_r15.unpack(bref));
  HANDLE_CODE(unpack_integer(freq_location_r15, bref, (uint8_t)0u, (uint8_t)98u));
  HANDLE_CODE(periodicity_r15.unpack(bref));
  HANDLE_CODE(pwr_boost_r15.unpack(bref));
  HANDLE_CODE(unpack_integer(time_offset_r15, bref, (uint8_t)0u, (uint8_t)31u));

  return SRSASN_SUCCESS;
}
void rss_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("duration-r15", dur_r15.to_string());
  j.write_int("freqLocation-r15", freq_location_r15);
  j.write_str("periodicity-r15", periodicity_r15.to_string());
  j.write_str("powerBoost-r15", pwr_boost_r15.to_string());
  j.write_int("timeOffset-r15", time_offset_r15);
  j.end_obj();
}

// ReferenceTime-r15 ::= SEQUENCE
SRSASN_CODE ref_time_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, ref_days_r15, (uint32_t)0u, (uint32_t)72999u));
  HANDLE_CODE(pack_integer(bref, ref_seconds_r15, (uint32_t)0u, (uint32_t)86399u));
  HANDLE_CODE(pack_integer(bref, ref_milli_seconds_r15, (uint16_t)0u, (uint16_t)999u));
  HANDLE_CODE(pack_integer(bref, ref_quarter_micro_seconds_r15, (uint16_t)0u, (uint16_t)3999u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ref_time_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(ref_days_r15, bref, (uint32_t)0u, (uint32_t)72999u));
  HANDLE_CODE(unpack_integer(ref_seconds_r15, bref, (uint32_t)0u, (uint32_t)86399u));
  HANDLE_CODE(unpack_integer(ref_milli_seconds_r15, bref, (uint16_t)0u, (uint16_t)999u));
  HANDLE_CODE(unpack_integer(ref_quarter_micro_seconds_r15, bref, (uint16_t)0u, (uint16_t)3999u));

  return SRSASN_SUCCESS;
}
void ref_time_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("refDays-r15", ref_days_r15);
  j.write_int("refSeconds-r15", ref_seconds_r15);
  j.write_int("refMilliSeconds-r15", ref_milli_seconds_r15);
  j.write_int("refQuarterMicroSeconds-r15", ref_quarter_micro_seconds_r15);
  j.end_obj();
}

// 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 resel_info_relay_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(min_hyst_r13_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));
  }

  return SRSASN_SUCCESS;
}
void resel_info_relay_r13_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.end_obj();
}

// 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 sib8_per_plmn_r11_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));

  return SRSASN_SUCCESS;
}
void sib8_per_plmn_r11_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.end_obj();
}

void sib8_per_plmn_r11_s::params_cdma2000_r11_c_::set(types::options e)
{
  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_");
  }
  j.end_obj();
}
SRSASN_CODE sib8_per_plmn_r11_s::params_cdma2000_r11_c_::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;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sib8_per_plmn_r11_s::params_cdma2000_r11_c_::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;
  }
  return SRSASN_SUCCESS;
}

// SL-CBR-CommonTxConfigList-r14 ::= SEQUENCE
SRSASN_CODE sl_cbr_common_tx_cfg_list_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref,
                              cbr_range_common_cfg_list_r14,
                              1,
                              4,
                              SeqOfPacker<integer_packer<uint8_t> >(1, 16, integer_packer<uint8_t>(0, 100))));
  HANDLE_CODE(pack_dyn_seq_of(bref, sl_cbr_pssch_tx_cfg_list_r14, 1, 64));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_cbr_common_tx_cfg_list_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(cbr_range_common_cfg_list_r14,
                                bref,
                                1,
                                4,
                                SeqOfPacker<integer_packer<uint8_t> >(1, 16, integer_packer<uint8_t>(0, 100))));
  HANDLE_CODE(unpack_dyn_seq_of(sl_cbr_pssch_tx_cfg_list_r14, bref, 1, 64));

  return SRSASN_SUCCESS;
}
void sl_cbr_common_tx_cfg_list_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("cbr-RangeCommonConfigList-r14");
  for (const auto& e1 : cbr_range_common_cfg_list_r14) {
    j.start_array();
    for (const auto& e2 : e1) {
      j.write_int(e2);
    }
    j.end_array();
  }
  j.end_array();
  j.start_array("sl-CBR-PSSCH-TxConfigList-r14");
  for (const auto& e1 : sl_cbr_pssch_tx_cfg_list_r14) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// SL-CarrierFreqInfo-r12 ::= SEQUENCE
SRSASN_CODE sl_carrier_freq_info_r12_s::pack(bit_ref& bref) 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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_carrier_freq_info_r12_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));
  }

  return SRSASN_SUCCESS;
}
void sl_carrier_freq_info_r12_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.end_obj();
}

// SL-CarrierFreqInfo-v1310 ::= SEQUENCE
SRSASN_CODE sl_carrier_freq_info_v1310_s::pack(bit_ref& bref) 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));

  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 sl_carrier_freq_info_v1310_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));
  }

  return SRSASN_SUCCESS;
}
void sl_carrier_freq_info_v1310_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.end_obj();
}

// SL-CommResourcePool-r12 ::= SEQUENCE
SRSASN_CODE sl_comm_res_pool_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ue_sel_res_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(rx_params_ncell_r12_present, 1));
  HANDLE_CODE(bref.pack(tx_params_r12_present, 1));

  HANDLE_CODE(sc_cp_len_r12.pack(bref));
  HANDLE_CODE(sc_period_r12.pack(bref));
  HANDLE_CODE(sc_tf_res_cfg_r12.pack(bref));
  HANDLE_CODE(data_cp_len_r12.pack(bref));
  HANDLE_CODE(data_hop_cfg_r12.pack(bref));
  if (ue_sel_res_cfg_r12_present) {
    HANDLE_CODE(bref.pack(ue_sel_res_cfg_r12.trpt_subset_r12_present, 1));
    HANDLE_CODE(ue_sel_res_cfg_r12.data_tf_res_cfg_r12.pack(bref));
    if (ue_sel_res_cfg_r12.trpt_subset_r12_present) {
      HANDLE_CODE(ue_sel_res_cfg_r12.trpt_subset_r12.pack(bref));
    }
  }
  if (rx_params_ncell_r12_present) {
    HANDLE_CODE(bref.pack(rx_params_ncell_r12.tdd_cfg_r12_present, 1));
    if (rx_params_ncell_r12.tdd_cfg_r12_present) {
      HANDLE_CODE(rx_params_ncell_r12.tdd_cfg_r12.pack(bref));
    }
    HANDLE_CODE(pack_integer(bref, rx_params_ncell_r12.sync_cfg_idx_r12, (uint8_t)0u, (uint8_t)15u));
  }
  if (tx_params_r12_present) {
    HANDLE_CODE(tx_params_r12.sc_tx_params_r12.pack(bref));
    HANDLE_CODE(tx_params_r12.data_tx_params_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= prio_list_r13.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(prio_list_r13.is_present(), 1));
      if (prio_list_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *prio_list_r13, 1, 8, integer_packer<uint8_t>(1, 8)));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_res_pool_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ue_sel_res_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(rx_params_ncell_r12_present, 1));
  HANDLE_CODE(bref.unpack(tx_params_r12_present, 1));

  HANDLE_CODE(sc_cp_len_r12.unpack(bref));
  HANDLE_CODE(sc_period_r12.unpack(bref));
  HANDLE_CODE(sc_tf_res_cfg_r12.unpack(bref));
  HANDLE_CODE(data_cp_len_r12.unpack(bref));
  HANDLE_CODE(data_hop_cfg_r12.unpack(bref));
  if (ue_sel_res_cfg_r12_present) {
    HANDLE_CODE(bref.unpack(ue_sel_res_cfg_r12.trpt_subset_r12_present, 1));
    HANDLE_CODE(ue_sel_res_cfg_r12.data_tf_res_cfg_r12.unpack(bref));
    if (ue_sel_res_cfg_r12.trpt_subset_r12_present) {
      HANDLE_CODE(ue_sel_res_cfg_r12.trpt_subset_r12.unpack(bref));
    }
  }
  if (rx_params_ncell_r12_present) {
    HANDLE_CODE(bref.unpack(rx_params_ncell_r12.tdd_cfg_r12_present, 1));
    if (rx_params_ncell_r12.tdd_cfg_r12_present) {
      HANDLE_CODE(rx_params_ncell_r12.tdd_cfg_r12.unpack(bref));
    }
    HANDLE_CODE(unpack_integer(rx_params_ncell_r12.sync_cfg_idx_r12, bref, (uint8_t)0u, (uint8_t)15u));
  }
  if (tx_params_r12_present) {
    HANDLE_CODE(tx_params_r12.sc_tx_params_r12.unpack(bref));
    HANDLE_CODE(tx_params_r12.data_tx_params_r12.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 prio_list_r13_present;
      HANDLE_CODE(bref.unpack(prio_list_r13_present, 1));
      prio_list_r13.set_present(prio_list_r13_present);
      if (prio_list_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*prio_list_r13, bref, 1, 8, integer_packer<uint8_t>(1, 8)));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_comm_res_pool_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sc-CP-Len-r12", sc_cp_len_r12.to_string());
  j.write_str("sc-Period-r12", sc_period_r12.to_string());
  j.write_fieldname("sc-TF-ResourceConfig-r12");
  sc_tf_res_cfg_r12.to_json(j);
  j.write_str("data-CP-Len-r12", data_cp_len_r12.to_string());
  j.write_fieldname("dataHoppingConfig-r12");
  data_hop_cfg_r12.to_json(j);
  if (ue_sel_res_cfg_r12_present) {
    j.write_fieldname("ue-SelectedResourceConfig-r12");
    j.start_obj();
    j.write_fieldname("data-TF-ResourceConfig-r12");
    ue_sel_res_cfg_r12.data_tf_res_cfg_r12.to_json(j);
    if (ue_sel_res_cfg_r12.trpt_subset_r12_present) {
      j.write_str("trpt-Subset-r12", ue_sel_res_cfg_r12.trpt_subset_r12.to_string());
    }
    j.end_obj();
  }
  if (rx_params_ncell_r12_present) {
    j.write_fieldname("rxParametersNCell-r12");
    j.start_obj();
    if (rx_params_ncell_r12.tdd_cfg_r12_present) {
      j.write_fieldname("tdd-Config-r12");
      rx_params_ncell_r12.tdd_cfg_r12.to_json(j);
    }
    j.write_int("syncConfigIndex-r12", rx_params_ncell_r12.sync_cfg_idx_r12);
    j.end_obj();
  }
  if (tx_params_r12_present) {
    j.write_fieldname("txParameters-r12");
    j.start_obj();
    j.write_fieldname("sc-TxParameters-r12");
    tx_params_r12.sc_tx_params_r12.to_json(j);
    j.write_fieldname("dataTxParameters-r12");
    tx_params_r12.data_tx_params_r12.to_json(j);
    j.end_obj();
  }
  if (ext) {
    if (prio_list_r13.is_present()) {
      j.start_array("priorityList-r13");
      for (const auto& e1 : *prio_list_r13) {
        j.write_int(e1);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// SL-PPPP-TxConfigIndex-r15 ::= SEQUENCE
SRSASN_CODE sl_pppp_tx_cfg_idx_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<uint8_t>(0, 63)));
  HANDLE_CODE(pack_dyn_seq_of(bref, mcs_pssch_range_list_r15, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pppp_tx_cfg_idx_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<uint8_t>(0, 63)));
  HANDLE_CODE(unpack_dyn_seq_of(mcs_pssch_range_list_r15, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void sl_pppp_tx_cfg_idx_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) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// SoundingRS-UL-ConfigCommon ::= CHOICE
void srs_ul_cfg_common_c::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_common_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("srs-BandwidthConfig", c.srs_bw_cfg.to_string());
      j.write_str("srs-SubframeConfig", c.srs_sf_cfg.to_string());
      j.write_bool("ackNackSRS-SimultaneousTransmission", c.ack_nack_srs_simul_tx);
      if (c.srs_max_up_pts_present) {
        j.write_str("srs-MaxUpPts", "true");
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_common_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_common_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.srs_max_up_pts_present, 1));
      HANDLE_CODE(c.srs_bw_cfg.pack(bref));
      HANDLE_CODE(c.srs_sf_cfg.pack(bref));
      HANDLE_CODE(bref.pack(c.ack_nack_srs_simul_tx, 1));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_common_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_common_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.srs_max_up_pts_present, 1));
      HANDLE_CODE(c.srs_bw_cfg.unpack(bref));
      HANDLE_CODE(c.srs_sf_cfg.unpack(bref));
      HANDLE_CODE(bref.unpack(c.ack_nack_srs_simul_tx, 1));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_common_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SystemInformationBlockType1-v10j0-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v10j0_ies_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));

  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<Packer>(1, 8, Packer())));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v10j0_ies_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));

  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<Packer>(1, 8, Packer())));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_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();
}

// SystemInformationBlockType1-v1250-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cell_sel_info_v1250_present, 1));
  HANDLE_CODE(bref.pack(freq_band_ind_prio_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.pack(cell_access_related_info_v1250.category0_allowed_r12_present, 1));
  if (cell_sel_info_v1250_present) {
    HANDLE_CODE(cell_sel_info_v1250.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cell_sel_info_v1250_present, 1));
  HANDLE_CODE(bref.unpack(freq_band_ind_prio_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.unpack(cell_access_related_info_v1250.category0_allowed_r12_present, 1));
  if (cell_sel_info_v1250_present) {
    HANDLE_CODE(cell_sel_info_v1250.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("cellAccessRelatedInfo-v1250");
  j.start_obj();
  if (cell_access_related_info_v1250.category0_allowed_r12_present) {
    j.write_str("category0Allowed-r12", "true");
  }
  j.end_obj();
  if (cell_sel_info_v1250_present) {
    j.write_fieldname("cellSelectionInfo-v1250");
    cell_sel_info_v1250.to_json(j);
  }
  if (freq_band_ind_prio_r12_present) {
    j.write_str("freqBandIndicatorPriority-r12", "true");
  }
  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<Packer>(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<Packer>(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.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)
{
  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 sib_type5_v9e0_ies_s::to_json(json_writer& j) 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();
}

// 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 uac_barr_info_set_r15_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));

  return SRSASN_SUCCESS;
}
void uac_barr_info_set_r15_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.end_obj();
}

// UAC-BarringPerPLMN-r15 ::= SEQUENCE
SRSASN_CODE uac_barr_per_plmn_r15_s::pack(bit_ref& bref) const
{
  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;
}
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_()
{
  switch (type_) {
    case types::uac_implicit_ac_barr_list_r15:
      c.destroy<uac_implicit_ac_barr_list_r15_l_>();
      break;
    case types::uac_explicit_ac_barr_list_r15:
      c.destroy<uac_barr_per_cat_list_r15_l>();
      break;
    default:
      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<uac_implicit_ac_barr_list_r15_l_>();
      break;
    case types::uac_explicit_ac_barr_list_r15:
      c.init<uac_barr_per_cat_list_r15_l>();
      break;
    case types::nulltype:
      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<uac_implicit_ac_barr_list_r15_l_>());
      break;
    case types::uac_explicit_ac_barr_list_r15:
      c.init(other.c.get<uac_barr_per_cat_list_r15_l>());
      break;
    case types::nulltype:
      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_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)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::uac_implicit_ac_barr_list_r15:
      c.set(other.c.get<uac_implicit_ac_barr_list_r15_l_>());
      break;
    case types::uac_explicit_ac_barr_list_r15:
      c.set(other.c.get<uac_barr_per_cat_list_r15_l>());
      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
{
  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<uac_implicit_ac_barr_list_r15_l_>()) {
        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<uac_barr_per_cat_list_r15_l>()) {
        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();
}
SRSASN_CODE uac_barr_per_plmn_r15_s::uac_ac_barr_list_type_r15_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<uac_implicit_ac_barr_list_r15_l_>())[0],
                                    c.get<uac_implicit_ac_barr_list_r15_l_>().size(),
                                    integer_packer<uint8_t>(1, 8)));
      break;
    case types::uac_explicit_ac_barr_list_r15:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<uac_barr_per_cat_list_r15_l>(), 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;
}
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<uac_implicit_ac_barr_list_r15_l_>())[0],
                                      bref,
                                      c.get<uac_implicit_ac_barr_list_r15_l_>().size(),
                                      integer_packer<uint8_t>(1, 8)));
      break;
    case types::uac_explicit_ac_barr_list_r15:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<uac_barr_per_cat_list_r15_l>(), 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;
}

// UDT-RestrictingPerPLMN-r13 ::= SEQUENCE
SRSASN_CODE udt_restricting_per_plmn_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(udt_restricting_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, plmn_id_idx_r13, (uint8_t)1u, (uint8_t)6u));
  if (udt_restricting_r13_present) {
    HANDLE_CODE(udt_restricting_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE udt_restricting_per_plmn_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(udt_restricting_r13_present, 1));

  HANDLE_CODE(unpack_integer(plmn_id_idx_r13, bref, (uint8_t)1u, (uint8_t)6u));
  if (udt_restricting_r13_present) {
    HANDLE_CODE(udt_restricting_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void udt_restricting_per_plmn_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("plmn-IdentityIndex-r13", plmn_id_idx_r13);
  if (udt_restricting_r13_present) {
    j.write_fieldname("udt-Restricting-r13");
    udt_restricting_r13.to_json(j);
  }
  j.end_obj();
}

// UplinkPowerControlCommon ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_common_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, p0_nominal_pusch, (int8_t)-126, (int8_t)24));
  HANDLE_CODE(alpha.pack(bref));
  HANDLE_CODE(pack_integer(bref, p0_nominal_pucch, (int8_t)-127, (int8_t)-96));
  HANDLE_CODE(delta_flist_pucch.pack(bref));
  HANDLE_CODE(pack_integer(bref, delta_preamb_msg3, (int8_t)-1, (int8_t)6));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_common_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(p0_nominal_pusch, bref, (int8_t)-126, (int8_t)24));
  HANDLE_CODE(alpha.unpack(bref));
  HANDLE_CODE(unpack_integer(p0_nominal_pucch, bref, (int8_t)-127, (int8_t)-96));
  HANDLE_CODE(delta_flist_pucch.unpack(bref));
  HANDLE_CODE(unpack_integer(delta_preamb_msg3, bref, (int8_t)-1, (int8_t)6));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_common_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p0-NominalPUSCH", p0_nominal_pusch);
  j.write_str("alpha", alpha.to_string());
  j.write_int("p0-NominalPUCCH", p0_nominal_pucch);
  j.write_fieldname("deltaFList-PUCCH");
  delta_flist_pucch.to_json(j);
  j.write_int("deltaPreambleMsg3", delta_preamb_msg3);
  j.end_obj();
}

// UplinkPowerControlCommon-v1020 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_common_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(delta_f_pucch_format3_r10.pack(bref));
  HANDLE_CODE(delta_f_pucch_format1b_cs_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_common_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(delta_f_pucch_format3_r10.unpack(bref));
  HANDLE_CODE(delta_f_pucch_format1b_cs_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_common_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("deltaF-PUCCH-Format3-r10", delta_f_pucch_format3_r10.to_string());
  j.write_str("deltaF-PUCCH-Format1bCS-r10", delta_f_pucch_format1b_cs_r10.to_string());
  j.end_obj();
}

// WLAN-OffloadConfig-r12 ::= SEQUENCE
SRSASN_CODE wlan_offload_cfg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(thres_rsrp_r12_present, 1));
  HANDLE_CODE(bref.pack(thres_rsrq_r12_present, 1));
  HANDLE_CODE(bref.pack(thres_rsrq_on_all_symbols_with_wb_r12_present, 1));
  HANDLE_CODE(bref.pack(thres_rsrq_on_all_symbols_r12_present, 1));
  HANDLE_CODE(bref.pack(thres_rsrq_wb_r12_present, 1));
  HANDLE_CODE(bref.pack(thres_ch_utilization_r12_present, 1));
  HANDLE_CODE(bref.pack(thres_backhaul_bw_r12_present, 1));
  HANDLE_CODE(bref.pack(thres_wlan_rssi_r12_present, 1));
  HANDLE_CODE(bref.pack(offload_pref_ind_r12_present, 1));
  HANDLE_CODE(bref.pack(t_steering_wlan_r12_present, 1));

  if (thres_rsrp_r12_present) {
    HANDLE_CODE(pack_integer(bref, thres_rsrp_r12.thres_rsrp_low_r12, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(pack_integer(bref, thres_rsrp_r12.thres_rsrp_high_r12, (uint8_t)0u, (uint8_t)97u));
  }
  if (thres_rsrq_r12_present) {
    HANDLE_CODE(pack_integer(bref, thres_rsrq_r12.thres_rsrq_low_r12, (uint8_t)0u, (uint8_t)34u));
    HANDLE_CODE(pack_integer(bref, thres_rsrq_r12.thres_rsrq_high_r12, (uint8_t)0u, (uint8_t)34u));
  }
  if (thres_rsrq_on_all_symbols_with_wb_r12_present) {
    HANDLE_CODE(pack_integer(bref,
                             thres_rsrq_on_all_symbols_with_wb_r12.thres_rsrq_on_all_symbols_with_wb_low_r12,
                             (uint8_t)0u,
                             (uint8_t)34u));
    HANDLE_CODE(pack_integer(bref,
                             thres_rsrq_on_all_symbols_with_wb_r12.thres_rsrq_on_all_symbols_with_wb_high_r12,
                             (uint8_t)0u,
                             (uint8_t)34u));
  }
  if (thres_rsrq_on_all_symbols_r12_present) {
    HANDLE_CODE(
        pack_integer(bref, thres_rsrq_on_all_symbols_r12.thres_rsrq_on_all_symbols_low_r12, (uint8_t)0u, (uint8_t)34u));
    HANDLE_CODE(pack_integer(
        bref, thres_rsrq_on_all_symbols_r12.thres_rsrq_on_all_symbols_high_r12, (uint8_t)0u, (uint8_t)34u));
  }
  if (thres_rsrq_wb_r12_present) {
    HANDLE_CODE(pack_integer(bref, thres_rsrq_wb_r12.thres_rsrq_wb_low_r12, (uint8_t)0u, (uint8_t)34u));
    HANDLE_CODE(pack_integer(bref, thres_rsrq_wb_r12.thres_rsrq_wb_high_r12, (uint8_t)0u, (uint8_t)34u));
  }
  if (thres_ch_utilization_r12_present) {
    HANDLE_CODE(
        pack_integer(bref, thres_ch_utilization_r12.thres_ch_utilization_low_r12, (uint16_t)0u, (uint16_t)255u));
    HANDLE_CODE(
        pack_integer(bref, thres_ch_utilization_r12.thres_ch_utilization_high_r12, (uint16_t)0u, (uint16_t)255u));
  }
  if (thres_backhaul_bw_r12_present) {
    HANDLE_CODE(thres_backhaul_bw_r12.thres_backhaul_dl_bw_low_r12.pack(bref));
    HANDLE_CODE(thres_backhaul_bw_r12.thres_backhaul_dl_bw_high_r12.pack(bref));
    HANDLE_CODE(thres_backhaul_bw_r12.thres_backhaul_ul_bw_low_r12.pack(bref));
    HANDLE_CODE(thres_backhaul_bw_r12.thres_backhaul_ul_bw_high_r12.pack(bref));
  }
  if (thres_wlan_rssi_r12_present) {
    HANDLE_CODE(pack_integer(bref, thres_wlan_rssi_r12.thres_wlan_rssi_low_r12, (uint16_t)0u, (uint16_t)255u));
    HANDLE_CODE(pack_integer(bref, thres_wlan_rssi_r12.thres_wlan_rssi_high_r12, (uint16_t)0u, (uint16_t)255u));
  }
  if (offload_pref_ind_r12_present) {
    HANDLE_CODE(offload_pref_ind_r12.pack(bref));
  }
  if (t_steering_wlan_r12_present) {
    HANDLE_CODE(pack_integer(bref, t_steering_wlan_r12, (uint8_t)0u, (uint8_t)7u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_offload_cfg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(thres_rsrp_r12_present, 1));
  HANDLE_CODE(bref.unpack(thres_rsrq_r12_present, 1));
  HANDLE_CODE(bref.unpack(thres_rsrq_on_all_symbols_with_wb_r12_present, 1));
  HANDLE_CODE(bref.unpack(thres_rsrq_on_all_symbols_r12_present, 1));
  HANDLE_CODE(bref.unpack(thres_rsrq_wb_r12_present, 1));
  HANDLE_CODE(bref.unpack(thres_ch_utilization_r12_present, 1));
  HANDLE_CODE(bref.unpack(thres_backhaul_bw_r12_present, 1));
  HANDLE_CODE(bref.unpack(thres_wlan_rssi_r12_present, 1));
  HANDLE_CODE(bref.unpack(offload_pref_ind_r12_present, 1));
  HANDLE_CODE(bref.unpack(t_steering_wlan_r12_present, 1));

  if (thres_rsrp_r12_present) {
    HANDLE_CODE(unpack_integer(thres_rsrp_r12.thres_rsrp_low_r12, bref, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(unpack_integer(thres_rsrp_r12.thres_rsrp_high_r12, bref, (uint8_t)0u, (uint8_t)97u));
  }
  if (thres_rsrq_r12_present) {
    HANDLE_CODE(unpack_integer(thres_rsrq_r12.thres_rsrq_low_r12, bref, (uint8_t)0u, (uint8_t)34u));
    HANDLE_CODE(unpack_integer(thres_rsrq_r12.thres_rsrq_high_r12, bref, (uint8_t)0u, (uint8_t)34u));
  }
  if (thres_rsrq_on_all_symbols_with_wb_r12_present) {
    HANDLE_CODE(unpack_integer(thres_rsrq_on_all_symbols_with_wb_r12.thres_rsrq_on_all_symbols_with_wb_low_r12,
                               bref,
                               (uint8_t)0u,
                               (uint8_t)34u));
    HANDLE_CODE(unpack_integer(thres_rsrq_on_all_symbols_with_wb_r12.thres_rsrq_on_all_symbols_with_wb_high_r12,
                               bref,
                               (uint8_t)0u,
                               (uint8_t)34u));
  }
  if (thres_rsrq_on_all_symbols_r12_present) {
    HANDLE_CODE(unpack_integer(
        thres_rsrq_on_all_symbols_r12.thres_rsrq_on_all_symbols_low_r12, bref, (uint8_t)0u, (uint8_t)34u));
    HANDLE_CODE(unpack_integer(
        thres_rsrq_on_all_symbols_r12.thres_rsrq_on_all_symbols_high_r12, bref, (uint8_t)0u, (uint8_t)34u));
  }
  if (thres_rsrq_wb_r12_present) {
    HANDLE_CODE(unpack_integer(thres_rsrq_wb_r12.thres_rsrq_wb_low_r12, bref, (uint8_t)0u, (uint8_t)34u));
    HANDLE_CODE(unpack_integer(thres_rsrq_wb_r12.thres_rsrq_wb_high_r12, bref, (uint8_t)0u, (uint8_t)34u));
  }
  if (thres_ch_utilization_r12_present) {
    HANDLE_CODE(
        unpack_integer(thres_ch_utilization_r12.thres_ch_utilization_low_r12, bref, (uint16_t)0u, (uint16_t)255u));
    HANDLE_CODE(
        unpack_integer(thres_ch_utilization_r12.thres_ch_utilization_high_r12, bref, (uint16_t)0u, (uint16_t)255u));
  }
  if (thres_backhaul_bw_r12_present) {
    HANDLE_CODE(thres_backhaul_bw_r12.thres_backhaul_dl_bw_low_r12.unpack(bref));
    HANDLE_CODE(thres_backhaul_bw_r12.thres_backhaul_dl_bw_high_r12.unpack(bref));
    HANDLE_CODE(thres_backhaul_bw_r12.thres_backhaul_ul_bw_low_r12.unpack(bref));
    HANDLE_CODE(thres_backhaul_bw_r12.thres_backhaul_ul_bw_high_r12.unpack(bref));
  }
  if (thres_wlan_rssi_r12_present) {
    HANDLE_CODE(unpack_integer(thres_wlan_rssi_r12.thres_wlan_rssi_low_r12, bref, (uint16_t)0u, (uint16_t)255u));
    HANDLE_CODE(unpack_integer(thres_wlan_rssi_r12.thres_wlan_rssi_high_r12, bref, (uint16_t)0u, (uint16_t)255u));
  }
  if (offload_pref_ind_r12_present) {
    HANDLE_CODE(offload_pref_ind_r12.unpack(bref));
  }
  if (t_steering_wlan_r12_present) {
    HANDLE_CODE(unpack_integer(t_steering_wlan_r12, bref, (uint8_t)0u, (uint8_t)7u));
  }

  return SRSASN_SUCCESS;
}
void wlan_offload_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (thres_rsrp_r12_present) {
    j.write_fieldname("thresholdRSRP-r12");
    j.start_obj();
    j.write_int("thresholdRSRP-Low-r12", thres_rsrp_r12.thres_rsrp_low_r12);
    j.write_int("thresholdRSRP-High-r12", thres_rsrp_r12.thres_rsrp_high_r12);
    j.end_obj();
  }
  if (thres_rsrq_r12_present) {
    j.write_fieldname("thresholdRSRQ-r12");
    j.start_obj();
    j.write_int("thresholdRSRQ-Low-r12", thres_rsrq_r12.thres_rsrq_low_r12);
    j.write_int("thresholdRSRQ-High-r12", thres_rsrq_r12.thres_rsrq_high_r12);
    j.end_obj();
  }
  if (thres_rsrq_on_all_symbols_with_wb_r12_present) {
    j.write_fieldname("thresholdRSRQ-OnAllSymbolsWithWB-r12");
    j.start_obj();
    j.write_int("thresholdRSRQ-OnAllSymbolsWithWB-Low-r12",
                thres_rsrq_on_all_symbols_with_wb_r12.thres_rsrq_on_all_symbols_with_wb_low_r12);
    j.write_int("thresholdRSRQ-OnAllSymbolsWithWB-High-r12",
                thres_rsrq_on_all_symbols_with_wb_r12.thres_rsrq_on_all_symbols_with_wb_high_r12);
    j.end_obj();
  }
  if (thres_rsrq_on_all_symbols_r12_present) {
    j.write_fieldname("thresholdRSRQ-OnAllSymbols-r12");
    j.start_obj();
    j.write_int("thresholdRSRQ-OnAllSymbolsLow-r12", thres_rsrq_on_all_symbols_r12.thres_rsrq_on_all_symbols_low_r12);
    j.write_int("thresholdRSRQ-OnAllSymbolsHigh-r12", thres_rsrq_on_all_symbols_r12.thres_rsrq_on_all_symbols_high_r12);
    j.end_obj();
  }
  if (thres_rsrq_wb_r12_present) {
    j.write_fieldname("thresholdRSRQ-WB-r12");
    j.start_obj();
    j.write_int("thresholdRSRQ-WB-Low-r12", thres_rsrq_wb_r12.thres_rsrq_wb_low_r12);
    j.write_int("thresholdRSRQ-WB-High-r12", thres_rsrq_wb_r12.thres_rsrq_wb_high_r12);
    j.end_obj();
  }
  if (thres_ch_utilization_r12_present) {
    j.write_fieldname("thresholdChannelUtilization-r12");
    j.start_obj();
    j.write_int("thresholdChannelUtilizationLow-r12", thres_ch_utilization_r12.thres_ch_utilization_low_r12);
    j.write_int("thresholdChannelUtilizationHigh-r12", thres_ch_utilization_r12.thres_ch_utilization_high_r12);
    j.end_obj();
  }
  if (thres_backhaul_bw_r12_present) {
    j.write_fieldname("thresholdBackhaul-Bandwidth-r12");
    j.start_obj();
    j.write_str("thresholdBackhaulDL-BandwidthLow-r12", thres_backhaul_bw_r12.thres_backhaul_dl_bw_low_r12.to_string());
    j.write_str("thresholdBackhaulDL-BandwidthHigh-r12",
                thres_backhaul_bw_r12.thres_backhaul_dl_bw_high_r12.to_string());
    j.write_str("thresholdBackhaulUL-BandwidthLow-r12", thres_backhaul_bw_r12.thres_backhaul_ul_bw_low_r12.to_string());
    j.write_str("thresholdBackhaulUL-BandwidthHigh-r12",
                thres_backhaul_bw_r12.thres_backhaul_ul_bw_high_r12.to_string());
    j.end_obj();
  }
  if (thres_wlan_rssi_r12_present) {
    j.write_fieldname("thresholdWLAN-RSSI-r12");
    j.start_obj();
    j.write_int("thresholdWLAN-RSSI-Low-r12", thres_wlan_rssi_r12.thres_wlan_rssi_low_r12);
    j.write_int("thresholdWLAN-RSSI-High-r12", thres_wlan_rssi_r12.thres_wlan_rssi_high_r12);
    j.end_obj();
  }
  if (offload_pref_ind_r12_present) {
    j.write_str("offloadPreferenceIndicator-r12", offload_pref_ind_r12.to_string());
  }
  if (t_steering_wlan_r12_present) {
    j.write_int("t-SteeringWLAN-r12", t_steering_wlan_r12);
  }
  j.end_obj();
}

// WUS-Config-r15 ::= SEQUENCE
SRSASN_CODE wus_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(num_pos_r15_present, 1));
  HANDLE_CODE(bref.pack(time_offset_e_drx_long_r15_present, 1));

  HANDLE_CODE(max_dur_factor_r15.pack(bref));
  if (num_pos_r15_present) {
    HANDLE_CODE(num_pos_r15.pack(bref));
  }
  HANDLE_CODE(freq_location_r15.pack(bref));
  HANDLE_CODE(time_offset_drx_r15.pack(bref));
  HANDLE_CODE(time_offset_e_drx_short_r15.pack(bref));
  if (time_offset_e_drx_long_r15_present) {
    HANDLE_CODE(time_offset_e_drx_long_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE wus_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(num_pos_r15_present, 1));
  HANDLE_CODE(bref.unpack(time_offset_e_drx_long_r15_present, 1));

  HANDLE_CODE(max_dur_factor_r15.unpack(bref));
  if (num_pos_r15_present) {
    HANDLE_CODE(num_pos_r15.unpack(bref));
  }
  HANDLE_CODE(freq_location_r15.unpack(bref));
  HANDLE_CODE(time_offset_drx_r15.unpack(bref));
  HANDLE_CODE(time_offset_e_drx_short_r15.unpack(bref));
  if (time_offset_e_drx_long_r15_present) {
    HANDLE_CODE(time_offset_e_drx_long_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void wus_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("maxDurationFactor-r15", max_dur_factor_r15.to_string());
  if (num_pos_r15_present) {
    j.write_str("numPOs-r15", num_pos_r15.to_string());
  }
  j.write_str("freqLocation-r15", freq_location_r15.to_string());
  j.write_str("timeOffsetDRX-r15", time_offset_drx_r15.to_string());
  j.write_str("timeOffset-eDRX-Short-r15", time_offset_e_drx_short_r15.to_string());
  if (time_offset_e_drx_long_r15_present) {
    j.write_str("timeOffset-eDRX-Long-r15", time_offset_e_drx_long_r15.to_string());
  }
  j.end_obj();
}

// ACDC-BarringForCommon-r13 ::= SEQUENCE
SRSASN_CODE acdc_barr_for_common_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(acdc_hplm_nonly_r13, 1));
  HANDLE_CODE(pack_dyn_seq_of(bref, barr_per_acdc_category_list_r13, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE acdc_barr_for_common_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(acdc_hplm_nonly_r13, 1));
  HANDLE_CODE(unpack_dyn_seq_of(barr_per_acdc_category_list_r13, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void acdc_barr_for_common_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("acdc-HPLMNonly-r13", acdc_hplm_nonly_r13);
  j.start_array("barringPerACDC-CategoryList-r13");
  for (const auto& e1 : barr_per_acdc_category_list_r13) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// 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));

  return SRSASN_SUCCESS;
}
void carrier_freq_info_utra_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (reduced_meas_performance_r12_present) {
    j.write_str("reducedMeasPerformance-r12", "true");
  }
  j.end_obj();
}

// CellReselectionInfoCommon-v1460 ::= SEQUENCE
SRSASN_CODE cell_resel_info_common_v1460_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(s_search_delta_p_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_resel_info_common_v1460_s::unpack(cbit_ref& bref)
{
  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();
}

// 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)
{
  HANDLE_CODE(unpack_integer(cell_equivalent_size_r15, bref, (uint8_t)2u, (uint8_t)16u));

  return SRSASN_SUCCESS;
}
void cell_resel_info_hsdn_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellEquivalentSize-r15", cell_equivalent_size_r15);
  j.end_obj();
}

// CellReselectionParametersCDMA2000 ::= SEQUENCE
SRSASN_CODE cell_resel_params_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, 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 cell_resel_params_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, 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 cell_resel_params_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");
  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();
}

// CellReselectionParametersCDMA2000-v920 ::= SEQUENCE
SRSASN_CODE cell_resel_params_cdma2000_v920_s::pack(bit_ref& bref) 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();
}

// CellReselectionServingFreqInfo-v1310 ::= SEQUENCE
SRSASN_CODE cell_resel_serving_freq_info_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cell_resel_sub_prio_r13.pack(bref));

  return SRSASN_SUCCESS;
}
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();
  j.write_str("cellReselectionSubPriority-r13", cell_resel_sub_prio_r13.to_string());
  j.end_obj();
}

// CellSelectionInfo-v920 ::= SEQUENCE
SRSASN_CODE cell_sel_info_v920_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(q_qual_min_offset_r9_present, 1));

  HANDLE_CODE(pack_integer(bref, q_qual_min_r9, (int8_t)-34, (int8_t)-3));
  if (q_qual_min_offset_r9_present) {
    HANDLE_CODE(pack_integer(bref, q_qual_min_offset_r9, (uint8_t)1u, (uint8_t)8u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_sel_info_v920_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(q_qual_min_offset_r9_present, 1));

  HANDLE_CODE(unpack_integer(q_qual_min_r9, bref, (int8_t)-34, (int8_t)-3));
  if (q_qual_min_offset_r9_present) {
    HANDLE_CODE(unpack_integer(q_qual_min_offset_r9, bref, (uint8_t)1u, (uint8_t)8u));
  }

  return SRSASN_SUCCESS;
}
void cell_sel_info_v920_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("q-QualMin-r9", q_qual_min_r9);
  if (q_qual_min_offset_r9_present) {
    j.write_int("q-QualMinOffset-r9", q_qual_min_offset_r9);
  }
  j.end_obj();
}

// EAB-ConfigPLMN-r11 ::= SEQUENCE
SRSASN_CODE eab_cfg_plmn_r11_s::pack(bit_ref& bref) const
{
  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 eab_cfg_plmn_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(eab_cfg_r11_present, 1));

  if (eab_cfg_r11_present) {
    HANDLE_CODE(eab_cfg_r11.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void eab_cfg_plmn_r11_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);
  }
  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 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));

  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();
}

// 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 mbms_notif_cfg_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(notif_sf_idx_v1430, bref, (uint8_t)7u, (uint8_t)10u));

  return SRSASN_SUCCESS;
}
void mbms_notif_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("notificationSF-Index-v1430", notif_sf_idx_v1430);
  j.end_obj();
}

// MeasIdleConfigSIB-r15 ::= SEQUENCE
SRSASN_CODE meas_idle_cfg_sib_r15_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));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_idle_cfg_sib_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_dyn_seq_of(meas_idle_carrier_list_eutra_r15, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void meas_idle_cfg_sib_r15_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.end_array();
  j.end_obj();
}

// MobilityStateParameters ::= SEQUENCE
SRSASN_CODE mob_state_params_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(t_eval.pack(bref));
  HANDLE_CODE(t_hyst_normal.pack(bref));
  HANDLE_CODE(pack_integer(bref, n_cell_change_medium, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(pack_integer(bref, n_cell_change_high, (uint8_t)1u, (uint8_t)16u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_state_params_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(t_eval.unpack(bref));
  HANDLE_CODE(t_hyst_normal.unpack(bref));
  HANDLE_CODE(unpack_integer(n_cell_change_medium, bref, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(unpack_integer(n_cell_change_high, bref, (uint8_t)1u, (uint8_t)16u));

  return SRSASN_SUCCESS;
}
void mob_state_params_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t-Evaluation", t_eval.to_string());
  j.write_str("t-HystNormal", t_hyst_normal.to_string());
  j.write_int("n-CellChangeMedium", n_cell_change_medium);
  j.write_int("n-CellChangeHigh", n_cell_change_high);
  j.end_obj();
}

// RadioResourceConfigCommonSIB ::= SEQUENCE
SRSASN_CODE rr_cfg_common_sib_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(rach_cfg_common.pack(bref));
  HANDLE_CODE(bcch_cfg.pack(bref));
  HANDLE_CODE(pcch_cfg.pack(bref));
  HANDLE_CODE(prach_cfg.pack(bref));
  HANDLE_CODE(pdsch_cfg_common.pack(bref));
  HANDLE_CODE(pusch_cfg_common.pack(bref));
  HANDLE_CODE(pucch_cfg_common.pack(bref));
  HANDLE_CODE(srs_ul_cfg_common.pack(bref));
  HANDLE_CODE(ul_pwr_ctrl_common.pack(bref));
  HANDLE_CODE(ul_cp_len.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= ul_pwr_ctrl_common_v1020.is_present();
    group_flags[1] |= rach_cfg_common_v1250.is_present();
    group_flags[2] |= pusch_cfg_common_v1270.is_present();
    group_flags[3] |= bcch_cfg_v1310.is_present();
    group_flags[3] |= pcch_cfg_v1310.is_present();
    group_flags[3] |= freq_hop_params_r13.is_present();
    group_flags[3] |= pdsch_cfg_common_v1310.is_present();
    group_flags[3] |= pusch_cfg_common_v1310.is_present();
    group_flags[3] |= prach_cfg_common_v1310.is_present();
    group_flags[3] |= pucch_cfg_common_v1310.is_present();
    group_flags[4] |= high_speed_cfg_r14.is_present();
    group_flags[4] |= prach_cfg_v1430.is_present();
    group_flags[4] |= pucch_cfg_common_v1430.is_present();
    group_flags[5] |= prach_cfg_v1530.is_present();
    group_flags[5] |= ce_rss_cfg_r15.is_present();
    group_flags[5] |= wus_cfg_r15.is_present();
    group_flags[5] |= high_speed_cfg_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_v1020.is_present(), 1));
      if (ul_pwr_ctrl_common_v1020.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_v1020->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rach_cfg_common_v1250.is_present(), 1));
      if (rach_cfg_common_v1250.is_present()) {
        HANDLE_CODE(rach_cfg_common_v1250->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pusch_cfg_common_v1270.is_present(), 1));
      if (pusch_cfg_common_v1270.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1270->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(bcch_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(pcch_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(freq_hop_params_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_common_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_common_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(prach_cfg_common_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_common_v1310.is_present(), 1));
      if (bcch_cfg_v1310.is_present()) {
        HANDLE_CODE(bcch_cfg_v1310->pack(bref));
      }
      if (pcch_cfg_v1310.is_present()) {
        HANDLE_CODE(pcch_cfg_v1310->pack(bref));
      }
      if (freq_hop_params_r13.is_present()) {
        HANDLE_CODE(freq_hop_params_r13->pack(bref));
      }
      if (pdsch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pdsch_cfg_common_v1310->pack(bref));
      }
      if (pusch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1310->pack(bref));
      }
      if (prach_cfg_common_v1310.is_present()) {
        HANDLE_CODE(prach_cfg_common_v1310->pack(bref));
      }
      if (pucch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pucch_cfg_common_v1310->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(high_speed_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(prach_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_common_v1430.is_present(), 1));
      if (high_speed_cfg_r14.is_present()) {
        HANDLE_CODE(high_speed_cfg_r14->pack(bref));
      }
      if (prach_cfg_v1430.is_present()) {
        HANDLE_CODE(prach_cfg_v1430->pack(bref));
      }
      if (pucch_cfg_common_v1430.is_present()) {
        HANDLE_CODE(pucch_cfg_common_v1430->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(prach_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(ce_rss_cfg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(wus_cfg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(high_speed_cfg_v1530.is_present(), 1));
      if (prach_cfg_v1530.is_present()) {
        HANDLE_CODE(prach_cfg_v1530->pack(bref));
      }
      if (ce_rss_cfg_r15.is_present()) {
        HANDLE_CODE(ce_rss_cfg_r15->pack(bref));
      }
      if (wus_cfg_r15.is_present()) {
        HANDLE_CODE(wus_cfg_r15->pack(bref));
      }
      if (high_speed_cfg_v1530.is_present()) {
        HANDLE_CODE(high_speed_cfg_v1530->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_common_sib_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(rach_cfg_common.unpack(bref));
  HANDLE_CODE(bcch_cfg.unpack(bref));
  HANDLE_CODE(pcch_cfg.unpack(bref));
  HANDLE_CODE(prach_cfg.unpack(bref));
  HANDLE_CODE(pdsch_cfg_common.unpack(bref));
  HANDLE_CODE(pusch_cfg_common.unpack(bref));
  HANDLE_CODE(pucch_cfg_common.unpack(bref));
  HANDLE_CODE(srs_ul_cfg_common.unpack(bref));
  HANDLE_CODE(ul_pwr_ctrl_common.unpack(bref));
  HANDLE_CODE(ul_cp_len.unpack(bref));

  if (ext) {
    ext_groups_unpacker_guard group_flags(6);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ul_pwr_ctrl_common_v1020_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_v1020_present, 1));
      ul_pwr_ctrl_common_v1020.set_present(ul_pwr_ctrl_common_v1020_present);
      if (ul_pwr_ctrl_common_v1020.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_v1020->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool rach_cfg_common_v1250_present;
      HANDLE_CODE(bref.unpack(rach_cfg_common_v1250_present, 1));
      rach_cfg_common_v1250.set_present(rach_cfg_common_v1250_present);
      if (rach_cfg_common_v1250.is_present()) {
        HANDLE_CODE(rach_cfg_common_v1250->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool pusch_cfg_common_v1270_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_common_v1270_present, 1));
      pusch_cfg_common_v1270.set_present(pusch_cfg_common_v1270_present);
      if (pusch_cfg_common_v1270.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1270->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool bcch_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(bcch_cfg_v1310_present, 1));
      bcch_cfg_v1310.set_present(bcch_cfg_v1310_present);
      bool pcch_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(pcch_cfg_v1310_present, 1));
      pcch_cfg_v1310.set_present(pcch_cfg_v1310_present);
      bool freq_hop_params_r13_present;
      HANDLE_CODE(bref.unpack(freq_hop_params_r13_present, 1));
      freq_hop_params_r13.set_present(freq_hop_params_r13_present);
      bool pdsch_cfg_common_v1310_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_common_v1310_present, 1));
      pdsch_cfg_common_v1310.set_present(pdsch_cfg_common_v1310_present);
      bool pusch_cfg_common_v1310_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_common_v1310_present, 1));
      pusch_cfg_common_v1310.set_present(pusch_cfg_common_v1310_present);
      bool prach_cfg_common_v1310_present;
      HANDLE_CODE(bref.unpack(prach_cfg_common_v1310_present, 1));
      prach_cfg_common_v1310.set_present(prach_cfg_common_v1310_present);
      bool pucch_cfg_common_v1310_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_common_v1310_present, 1));
      pucch_cfg_common_v1310.set_present(pucch_cfg_common_v1310_present);
      if (bcch_cfg_v1310.is_present()) {
        HANDLE_CODE(bcch_cfg_v1310->unpack(bref));
      }
      if (pcch_cfg_v1310.is_present()) {
        HANDLE_CODE(pcch_cfg_v1310->unpack(bref));
      }
      if (freq_hop_params_r13.is_present()) {
        HANDLE_CODE(freq_hop_params_r13->unpack(bref));
      }
      if (pdsch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pdsch_cfg_common_v1310->unpack(bref));
      }
      if (pusch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1310->unpack(bref));
      }
      if (prach_cfg_common_v1310.is_present()) {
        HANDLE_CODE(prach_cfg_common_v1310->unpack(bref));
      }
      if (pucch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pucch_cfg_common_v1310->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool high_speed_cfg_r14_present;
      HANDLE_CODE(bref.unpack(high_speed_cfg_r14_present, 1));
      high_speed_cfg_r14.set_present(high_speed_cfg_r14_present);
      bool prach_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(prach_cfg_v1430_present, 1));
      prach_cfg_v1430.set_present(prach_cfg_v1430_present);
      bool pucch_cfg_common_v1430_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_common_v1430_present, 1));
      pucch_cfg_common_v1430.set_present(pucch_cfg_common_v1430_present);
      if (high_speed_cfg_r14.is_present()) {
        HANDLE_CODE(high_speed_cfg_r14->unpack(bref));
      }
      if (prach_cfg_v1430.is_present()) {
        HANDLE_CODE(prach_cfg_v1430->unpack(bref));
      }
      if (pucch_cfg_common_v1430.is_present()) {
        HANDLE_CODE(pucch_cfg_common_v1430->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool prach_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(prach_cfg_v1530_present, 1));
      prach_cfg_v1530.set_present(prach_cfg_v1530_present);
      bool ce_rss_cfg_r15_present;
      HANDLE_CODE(bref.unpack(ce_rss_cfg_r15_present, 1));
      ce_rss_cfg_r15.set_present(ce_rss_cfg_r15_present);
      bool wus_cfg_r15_present;
      HANDLE_CODE(bref.unpack(wus_cfg_r15_present, 1));
      wus_cfg_r15.set_present(wus_cfg_r15_present);
      bool high_speed_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(high_speed_cfg_v1530_present, 1));
      high_speed_cfg_v1530.set_present(high_speed_cfg_v1530_present);
      if (prach_cfg_v1530.is_present()) {
        HANDLE_CODE(prach_cfg_v1530->unpack(bref));
      }
      if (ce_rss_cfg_r15.is_present()) {
        HANDLE_CODE(ce_rss_cfg_r15->unpack(bref));
      }
      if (wus_cfg_r15.is_present()) {
        HANDLE_CODE(wus_cfg_r15->unpack(bref));
      }
      if (high_speed_cfg_v1530.is_present()) {
        HANDLE_CODE(high_speed_cfg_v1530->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rr_cfg_common_sib_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("rach-ConfigCommon");
  rach_cfg_common.to_json(j);
  j.write_fieldname("bcch-Config");
  bcch_cfg.to_json(j);
  j.write_fieldname("pcch-Config");
  pcch_cfg.to_json(j);
  j.write_fieldname("prach-Config");
  prach_cfg.to_json(j);
  j.write_fieldname("pdsch-ConfigCommon");
  pdsch_cfg_common.to_json(j);
  j.write_fieldname("pusch-ConfigCommon");
  pusch_cfg_common.to_json(j);
  j.write_fieldname("pucch-ConfigCommon");
  pucch_cfg_common.to_json(j);
  j.write_fieldname("soundingRS-UL-ConfigCommon");
  srs_ul_cfg_common.to_json(j);
  j.write_fieldname("uplinkPowerControlCommon");
  ul_pwr_ctrl_common.to_json(j);
  j.write_str("ul-CyclicPrefixLength", ul_cp_len.to_string());
  if (ext) {
    if (ul_pwr_ctrl_common_v1020.is_present()) {
      j.write_fieldname("uplinkPowerControlCommon-v1020");
      ul_pwr_ctrl_common_v1020->to_json(j);
    }
    if (rach_cfg_common_v1250.is_present()) {
      j.write_fieldname("rach-ConfigCommon-v1250");
      rach_cfg_common_v1250->to_json(j);
    }
    if (pusch_cfg_common_v1270.is_present()) {
      j.write_fieldname("pusch-ConfigCommon-v1270");
      pusch_cfg_common_v1270->to_json(j);
    }
    if (bcch_cfg_v1310.is_present()) {
      j.write_fieldname("bcch-Config-v1310");
      bcch_cfg_v1310->to_json(j);
    }
    if (pcch_cfg_v1310.is_present()) {
      j.write_fieldname("pcch-Config-v1310");
      pcch_cfg_v1310->to_json(j);
    }
    if (freq_hop_params_r13.is_present()) {
      j.write_fieldname("freqHoppingParameters-r13");
      freq_hop_params_r13->to_json(j);
    }
    if (pdsch_cfg_common_v1310.is_present()) {
      j.write_fieldname("pdsch-ConfigCommon-v1310");
      pdsch_cfg_common_v1310->to_json(j);
    }
    if (pusch_cfg_common_v1310.is_present()) {
      j.write_fieldname("pusch-ConfigCommon-v1310");
      pusch_cfg_common_v1310->to_json(j);
    }
    if (prach_cfg_common_v1310.is_present()) {
      j.write_fieldname("prach-ConfigCommon-v1310");
      prach_cfg_common_v1310->to_json(j);
    }
    if (pucch_cfg_common_v1310.is_present()) {
      j.write_fieldname("pucch-ConfigCommon-v1310");
      pucch_cfg_common_v1310->to_json(j);
    }
    if (high_speed_cfg_r14.is_present()) {
      j.write_fieldname("highSpeedConfig-r14");
      high_speed_cfg_r14->to_json(j);
    }
    if (prach_cfg_v1430.is_present()) {
      j.write_fieldname("prach-Config-v1430");
      prach_cfg_v1430->to_json(j);
    }
    if (pucch_cfg_common_v1430.is_present()) {
      j.write_fieldname("pucch-ConfigCommon-v1430");
      pucch_cfg_common_v1430->to_json(j);
    }
    if (prach_cfg_v1530.is_present()) {
      j.write_fieldname("prach-Config-v1530");
      prach_cfg_v1530->to_json(j);
    }
    if (ce_rss_cfg_r15.is_present()) {
      j.write_fieldname("ce-RSS-Config-r15");
      ce_rss_cfg_r15->to_json(j);
    }
    if (wus_cfg_r15.is_present()) {
      j.write_fieldname("wus-Config-r15");
      wus_cfg_r15->to_json(j);
    }
    if (high_speed_cfg_v1530.is_present()) {
      j.write_fieldname("highSpeedConfig-v1530");
      high_speed_cfg_v1530->to_json(j);
    }
  }
  j.end_obj();
}

// RedistributionServingInfo-r13 ::= SEQUENCE
SRSASN_CODE redist_serving_info_r13_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));

  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 redist_serving_info_r13_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));

  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 redist_serving_info_r13_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("t360-r13", t360_r13.to_string());
  if (redistr_on_paging_only_r13_present) {
    j.write_str("redistrOnPagingOnly-r13", "true");
  }
  j.end_obj();
}

// SC-MCCH-SchedulingInfo-r14 ::= SEQUENCE
SRSASN_CODE sc_mcch_sched_info_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_mcch_sched_info_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_mcch_sched_info_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();
}

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)
{
  destroy_();
  type_ = e;
}
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::sf10:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf20:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf32:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf40:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf64:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf80:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf128:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf160:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf256:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf320:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf512:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf640:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf1024:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf2048:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf4096:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf8192:
      c.init(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "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_&
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::sf10:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf20:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf32:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf40:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf64:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf80:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf128:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf160:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf256:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf320:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf512:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf640:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf1024:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf2048:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf4096:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf8192:
      c.set(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_");
  }

  return *this;
}
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::sf10:
      j.write_int("sf10", c.get<uint8_t>());
      break;
    case types::sf20:
      j.write_int("sf20", c.get<uint8_t>());
      break;
    case types::sf32:
      j.write_int("sf32", c.get<uint8_t>());
      break;
    case types::sf40:
      j.write_int("sf40", c.get<uint8_t>());
      break;
    case types::sf64:
      j.write_int("sf64", c.get<uint8_t>());
      break;
    case types::sf80:
      j.write_int("sf80", c.get<uint8_t>());
      break;
    case types::sf128:
      j.write_int("sf128", c.get<uint8_t>());
      break;
    case types::sf160:
      j.write_int("sf160", c.get<uint8_t>());
      break;
    case types::sf256:
      j.write_int("sf256", c.get<uint16_t>());
      break;
    case types::sf320:
      j.write_int("sf320", c.get<uint16_t>());
      break;
    case types::sf512:
      j.write_int("sf512", c.get<uint16_t>());
      break;
    case types::sf640:
      j.write_int("sf640", c.get<uint16_t>());
      break;
    case types::sf1024:
      j.write_int("sf1024", c.get<uint16_t>());
      break;
    case types::sf2048:
      j.write_int("sf2048", c.get<uint16_t>());
      break;
    case types::sf4096:
      j.write_int("sf4096", c.get<uint16_t>());
      break;
    case types::sf8192:
      j.write_int("sf8192", c.get<uint16_t>());
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_");
  }
  j.end_obj();
}
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::sf10:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf32:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)31u));
      break;
    case types::sf40:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf64:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)63u));
      break;
    case types::sf80:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf128:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    case types::sf160:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    case types::sf256:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)255u));
      break;
    case types::sf320:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::sf512:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::sf640:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::sf1024:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1023u));
      break;
    case types::sf2048:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)2047u));
      break;
    case types::sf4096:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)4095u));
      break;
    case types::sf8192:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (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;
}
SRSASN_CODE sc_mcch_sched_info_r14_s::sched_period_start_offset_scptm_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf10:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf32:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)31u));
      break;
    case types::sf40:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf64:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)63u));
      break;
    case types::sf80:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf128:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    case types::sf160:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    case types::sf256:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)255u));
      break;
    case types::sf320:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::sf512:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::sf640:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::sf1024:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1023u));
      break;
    case types::sf2048:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    case types::sf4096:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)4095u));
      break;
    case types::sf8192:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), 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;
}

// SL-DiscConfigRelayUE-r13 ::= SEQUENCE
SRSASN_CODE sl_disc_cfg_relay_ue_r13_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));

  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 sl_disc_cfg_relay_ue_r13_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));

  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 sl_disc_cfg_relay_ue_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  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();
}

// 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));

  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 sl_disc_cfg_remote_ue_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(thresh_high_r13_present, 1));
  HANDLE_CODE(bref.unpack(hyst_max_r13_present, 1));

  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 sl_disc_cfg_remote_ue_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (thresh_high_r13_present) {
    j.write_int("threshHigh-r13", thresh_high_r13);
  }
  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();
}

// SL-V2X-ConfigCommon-r14 ::= SEQUENCE
SRSASN_CODE sl_v2x_cfg_common_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(v2x_comm_rx_pool_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_comm_tx_pool_normal_common_r14_present, 1));
  HANDLE_CODE(bref.pack(p2x_comm_tx_pool_normal_common_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_comm_tx_pool_exceptional_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_sync_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_inter_freq_info_list_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_res_sel_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(zone_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(type_tx_sync_r14_present, 1));
  HANDLE_CODE(bref.pack(thres_sl_tx_prioritization_r14_present, 1));
  HANDLE_CODE(bref.pack(anchor_carrier_freq_list_r14_present, 1));
  HANDLE_CODE(bref.pack(offset_dfn_r14_present, 1));
  HANDLE_CODE(bref.pack(cbr_common_tx_cfg_list_r14_present, 1));

  if (v2x_comm_rx_pool_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_rx_pool_r14, 1, 16));
  }
  if (v2x_comm_tx_pool_normal_common_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_tx_pool_normal_common_r14, 1, 8));
  }
  if (p2x_comm_tx_pool_normal_common_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, p2x_comm_tx_pool_normal_common_r14, 1, 8));
  }
  if (v2x_comm_tx_pool_exceptional_r14_present) {
    HANDLE_CODE(v2x_comm_tx_pool_exceptional_r14.pack(bref));
  }
  if (v2x_sync_cfg_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_sync_cfg_r14, 1, 16));
  }
  if (v2x_inter_freq_info_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_inter_freq_info_list_r14, 0, 7));
  }
  if (v2x_res_sel_cfg_r14_present) {
    HANDLE_CODE(v2x_res_sel_cfg_r14.pack(bref));
  }
  if (zone_cfg_r14_present) {
    HANDLE_CODE(zone_cfg_r14.pack(bref));
  }
  if (type_tx_sync_r14_present) {
    HANDLE_CODE(type_tx_sync_r14.pack(bref));
  }
  if (thres_sl_tx_prioritization_r14_present) {
    HANDLE_CODE(pack_integer(bref, thres_sl_tx_prioritization_r14, (uint8_t)1u, (uint8_t)8u));
  }
  if (anchor_carrier_freq_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, anchor_carrier_freq_list_r14, 1, 8, integer_packer<uint32_t>(0, 262143)));
  }
  if (offset_dfn_r14_present) {
    HANDLE_CODE(pack_integer(bref, offset_dfn_r14, (uint16_t)0u, (uint16_t)1000u));
  }
  if (cbr_common_tx_cfg_list_r14_present) {
    HANDLE_CODE(cbr_common_tx_cfg_list_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_cfg_common_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(v2x_comm_rx_pool_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_comm_tx_pool_normal_common_r14_present, 1));
  HANDLE_CODE(bref.unpack(p2x_comm_tx_pool_normal_common_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_comm_tx_pool_exceptional_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_sync_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_inter_freq_info_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_res_sel_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(zone_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(type_tx_sync_r14_present, 1));
  HANDLE_CODE(bref.unpack(thres_sl_tx_prioritization_r14_present, 1));
  HANDLE_CODE(bref.unpack(anchor_carrier_freq_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(offset_dfn_r14_present, 1));
  HANDLE_CODE(bref.unpack(cbr_common_tx_cfg_list_r14_present, 1));

  if (v2x_comm_rx_pool_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_rx_pool_r14, bref, 1, 16));
  }
  if (v2x_comm_tx_pool_normal_common_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_tx_pool_normal_common_r14, bref, 1, 8));
  }
  if (p2x_comm_tx_pool_normal_common_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(p2x_comm_tx_pool_normal_common_r14, bref, 1, 8));
  }
  if (v2x_comm_tx_pool_exceptional_r14_present) {
    HANDLE_CODE(v2x_comm_tx_pool_exceptional_r14.unpack(bref));
  }
  if (v2x_sync_cfg_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_sync_cfg_r14, bref, 1, 16));
  }
  if (v2x_inter_freq_info_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_inter_freq_info_list_r14, bref, 0, 7));
  }
  if (v2x_res_sel_cfg_r14_present) {
    HANDLE_CODE(v2x_res_sel_cfg_r14.unpack(bref));
  }
  if (zone_cfg_r14_present) {
    HANDLE_CODE(zone_cfg_r14.unpack(bref));
  }
  if (type_tx_sync_r14_present) {
    HANDLE_CODE(type_tx_sync_r14.unpack(bref));
  }
  if (thres_sl_tx_prioritization_r14_present) {
    HANDLE_CODE(unpack_integer(thres_sl_tx_prioritization_r14, bref, (uint8_t)1u, (uint8_t)8u));
  }
  if (anchor_carrier_freq_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(anchor_carrier_freq_list_r14, bref, 1, 8, integer_packer<uint32_t>(0, 262143)));
  }
  if (offset_dfn_r14_present) {
    HANDLE_CODE(unpack_integer(offset_dfn_r14, bref, (uint16_t)0u, (uint16_t)1000u));
  }
  if (cbr_common_tx_cfg_list_r14_present) {
    HANDLE_CODE(cbr_common_tx_cfg_list_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_v2x_cfg_common_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (v2x_comm_rx_pool_r14_present) {
    j.start_array("v2x-CommRxPool-r14");
    for (const auto& e1 : v2x_comm_rx_pool_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_comm_tx_pool_normal_common_r14_present) {
    j.start_array("v2x-CommTxPoolNormalCommon-r14");
    for (const auto& e1 : v2x_comm_tx_pool_normal_common_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (p2x_comm_tx_pool_normal_common_r14_present) {
    j.start_array("p2x-CommTxPoolNormalCommon-r14");
    for (const auto& e1 : p2x_comm_tx_pool_normal_common_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_comm_tx_pool_exceptional_r14_present) {
    j.write_fieldname("v2x-CommTxPoolExceptional-r14");
    v2x_comm_tx_pool_exceptional_r14.to_json(j);
  }
  if (v2x_sync_cfg_r14_present) {
    j.start_array("v2x-SyncConfig-r14");
    for (const auto& e1 : v2x_sync_cfg_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_inter_freq_info_list_r14_present) {
    j.start_array("v2x-InterFreqInfoList-r14");
    for (const auto& e1 : v2x_inter_freq_info_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_res_sel_cfg_r14_present) {
    j.write_fieldname("v2x-ResourceSelectionConfig-r14");
    v2x_res_sel_cfg_r14.to_json(j);
  }
  if (zone_cfg_r14_present) {
    j.write_fieldname("zoneConfig-r14");
    zone_cfg_r14.to_json(j);
  }
  if (type_tx_sync_r14_present) {
    j.write_str("typeTxSync-r14", type_tx_sync_r14.to_string());
  }
  if (thres_sl_tx_prioritization_r14_present) {
    j.write_int("thresSL-TxPrioritization-r14", thres_sl_tx_prioritization_r14);
  }
  if (anchor_carrier_freq_list_r14_present) {
    j.start_array("anchorCarrierFreqList-r14");
    for (const auto& e1 : anchor_carrier_freq_list_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (offset_dfn_r14_present) {
    j.write_int("offsetDFN-r14", offset_dfn_r14);
  }
  if (cbr_common_tx_cfg_list_r14_present) {
    j.write_fieldname("cbr-CommonTxConfigList-r14");
    cbr_common_tx_cfg_list_r14.to_json(j);
  }
  j.end_obj();
}

// SL-V2X-PacketDuplicationConfig-r15 ::= SEQUENCE
SRSASN_CODE sl_v2x_packet_dupl_cfg_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(allowed_carrier_freq_cfg_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, thresh_sl_reliability_r15, (uint8_t)1u, (uint8_t)8u));
  if (allowed_carrier_freq_cfg_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, allowed_carrier_freq_cfg_r15, 1, 16));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_packet_dupl_cfg_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(allowed_carrier_freq_cfg_r15_present, 1));

  HANDLE_CODE(unpack_integer(thresh_sl_reliability_r15, bref, (uint8_t)1u, (uint8_t)8u));
  if (allowed_carrier_freq_cfg_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(allowed_carrier_freq_cfg_r15, bref, 1, 16));
  }

  return SRSASN_SUCCESS;
}
void sl_v2x_packet_dupl_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("threshSL-Reliability-r15", thresh_sl_reliability_r15);
  if (allowed_carrier_freq_cfg_r15_present) {
    j.start_array("allowedCarrierFreqConfig-r15");
    for (const auto& e1 : allowed_carrier_freq_cfg_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SystemInformationBlockType1-v1130-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tdd_cfg_v1130_present, 1));
  HANDLE_CODE(bref.pack(cell_sel_info_v1130_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (tdd_cfg_v1130_present) {
    HANDLE_CODE(tdd_cfg_v1130.pack(bref));
  }
  if (cell_sel_info_v1130_present) {
    HANDLE_CODE(cell_sel_info_v1130.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tdd_cfg_v1130_present, 1));
  HANDLE_CODE(bref.unpack(cell_sel_info_v1130_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (tdd_cfg_v1130_present) {
    HANDLE_CODE(tdd_cfg_v1130.unpack(bref));
  }
  if (cell_sel_info_v1130_present) {
    HANDLE_CODE(cell_sel_info_v1130.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tdd_cfg_v1130_present) {
    j.write_fieldname("tdd-Config-v1130");
    tdd_cfg_v1130.to_json(j);
  }
  if (cell_sel_info_v1130_present) {
    j.write_fieldname("cellSelectionInfo-v1130");
    cell_sel_info_v1130.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SystemInformationBlockType1-v9e0-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v9e0_ies_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));

  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 sib_type1_v9e0_ies_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));

  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;
}
void sib_type1_v9e0_ies_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) {
      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();
}

// SystemInformationBlockType2-v8h0-IEs ::= SEQUENCE
SRSASN_CODE sib_type2_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 (multi_band_info_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer<uint8_t>(1, 32)));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type2_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));

  if (multi_band_info_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer<uint8_t>(1, 32)));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type2_v8h0_ies_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 (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SystemInformationBlockType3-v10j0-IEs ::= SEQUENCE
SRSASN_CODE sib_type3_v10j0_ies_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));

  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<Packer>(1, 8, Packer())));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type3_v10j0_ies_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));

  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<Packer>(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();
}

// 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));
  }

  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) {
      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));
  }

  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();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// TimeReferenceInfo-r15 ::= SEQUENCE
SRSASN_CODE time_ref_info_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(uncertainty_r15_present, 1));
  HANDLE_CODE(bref.pack(time_info_type_r15_present, 1));
  HANDLE_CODE(bref.pack(ref_sfn_r15_present, 1));

  HANDLE_CODE(time_r15.pack(bref));
  if (uncertainty_r15_present) {
    HANDLE_CODE(pack_integer(bref, uncertainty_r15, (uint8_t)0u, (uint8_t)12u));
  }
  if (ref_sfn_r15_present) {
    HANDLE_CODE(pack_integer(bref, ref_sfn_r15, (uint16_t)0u, (uint16_t)1023u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE time_ref_info_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(uncertainty_r15_present, 1));
  HANDLE_CODE(bref.unpack(time_info_type_r15_present, 1));
  HANDLE_CODE(bref.unpack(ref_sfn_r15_present, 1));

  HANDLE_CODE(time_r15.unpack(bref));
  if (uncertainty_r15_present) {
    HANDLE_CODE(unpack_integer(uncertainty_r15, bref, (uint8_t)0u, (uint8_t)12u));
  }
  if (ref_sfn_r15_present) {
    HANDLE_CODE(unpack_integer(ref_sfn_r15, bref, (uint16_t)0u, (uint16_t)1023u));
  }

  return SRSASN_SUCCESS;
}
void time_ref_info_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("time-r15");
  time_r15.to_json(j);
  if (uncertainty_r15_present) {
    j.write_int("uncertainty-r15", uncertainty_r15);
  }
  if (time_info_type_r15_present) {
    j.write_str("timeInfoType-r15", "localClock");
  }
  if (ref_sfn_r15_present) {
    j.write_int("referenceSFN-r15", ref_sfn_r15);
  }
  j.end_obj();
}

// UE-TimersAndConstants ::= SEQUENCE
SRSASN_CODE ue_timers_and_consts_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(t300.pack(bref));
  HANDLE_CODE(t301.pack(bref));
  HANDLE_CODE(t310.pack(bref));
  HANDLE_CODE(n310.pack(bref));
  HANDLE_CODE(t311.pack(bref));
  HANDLE_CODE(n311.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= t300_v1310_present;
    group_flags[0] |= t301_v1310_present;
    group_flags[1] |= t310_v1330_present;
    group_flags[2] |= t300_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(t300_v1310_present, 1));
      HANDLE_CODE(bref.pack(t301_v1310_present, 1));
      if (t300_v1310_present) {
        HANDLE_CODE(t300_v1310.pack(bref));
      }
      if (t301_v1310_present) {
        HANDLE_CODE(t301_v1310.pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(t310_v1330_present, 1));
      if (t310_v1330_present) {
        HANDLE_CODE(t310_v1330.pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(t300_r15_present, 1));
      if (t300_r15_present) {
        HANDLE_CODE(t300_r15.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_timers_and_consts_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(t300.unpack(bref));
  HANDLE_CODE(t301.unpack(bref));
  HANDLE_CODE(t310.unpack(bref));
  HANDLE_CODE(n310.unpack(bref));
  HANDLE_CODE(t311.unpack(bref));
  HANDLE_CODE(n311.unpack(bref));

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(t300_v1310_present, 1));
      HANDLE_CODE(bref.unpack(t301_v1310_present, 1));
      if (t300_v1310_present) {
        HANDLE_CODE(t300_v1310.unpack(bref));
      }
      if (t301_v1310_present) {
        HANDLE_CODE(t301_v1310.unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(t310_v1330_present, 1));
      if (t310_v1330_present) {
        HANDLE_CODE(t310_v1330.unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(t300_r15_present, 1));
      if (t300_r15_present) {
        HANDLE_CODE(t300_r15.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void ue_timers_and_consts_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t300", t300.to_string());
  j.write_str("t301", t301.to_string());
  j.write_str("t310", t310.to_string());
  j.write_str("n310", n310.to_string());
  j.write_str("t311", t311.to_string());
  j.write_str("n311", n311.to_string());
  if (ext) {
    if (t300_v1310_present) {
      j.write_str("t300-v1310", t300_v1310.to_string());
    }
    if (t301_v1310_present) {
      j.write_str("t301-v1310", t301_v1310.to_string());
    }
    if (t310_v1330_present) {
      j.write_str("t310-v1330", t310_v1330.to_string());
    }
    if (t300_r15_present) {
      j.write_str("t300-r15", t300_r15.to_string());
    }
  }
  j.end_obj();
}

// WLAN-OffloadInfoPerPLMN-r12 ::= SEQUENCE
SRSASN_CODE wlan_offload_info_per_plmn_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(wlan_offload_cfg_common_r12_present, 1));
  HANDLE_CODE(bref.pack(wlan_id_list_r12_present, 1));

  if (wlan_offload_cfg_common_r12_present) {
    HANDLE_CODE(wlan_offload_cfg_common_r12.pack(bref));
  }
  if (wlan_id_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, wlan_id_list_r12, 1, 16));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_offload_info_per_plmn_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(wlan_offload_cfg_common_r12_present, 1));
  HANDLE_CODE(bref.unpack(wlan_id_list_r12_present, 1));

  if (wlan_offload_cfg_common_r12_present) {
    HANDLE_CODE(wlan_offload_cfg_common_r12.unpack(bref));
  }
  if (wlan_id_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(wlan_id_list_r12, bref, 1, 16));
  }

  return SRSASN_SUCCESS;
}
void wlan_offload_info_per_plmn_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (wlan_offload_cfg_common_r12_present) {
    j.write_fieldname("wlan-OffloadConfigCommon-r12");
    wlan_offload_cfg_common_r12.to_json(j);
  }
  if (wlan_id_list_r12_present) {
    j.start_array("wlan-Id-List-r12");
    for (const auto& e1 : wlan_id_list_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SchedulingInfo ::= SEQUENCE
SRSASN_CODE sched_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(si_periodicity.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, sib_map_info, 0, 31));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sched_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(si_periodicity.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(sib_map_info, bref, 0, 31));

  return SRSASN_SUCCESS;
}
void sched_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("si-Periodicity", si_periodicity.to_string());
  j.start_array("sib-MappingInfo");
  for (const auto& e1 : sib_map_info) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.end_obj();
}

// SystemInformation-v8a0-IEs ::= SEQUENCE
SRSASN_CODE sys_info_v8a0_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 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));
  }

  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();
}

// 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(assist_data_sib_elem_r15.pack(bref));
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_pos_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));

  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 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 (multi_band_info_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, multi_band_info_list, 1, 8, integer_packer<uint8_t>(1, 64)));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  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));

  if (multi_band_info_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(multi_band_info_list, bref, 1, 8, integer_packer<uint8_t>(1, 64)));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v8h0_ies_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 (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SystemInformationBlockType1-v920-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v920_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ims_emergency_support_r9_present, 1));
  HANDLE_CODE(bref.pack(cell_sel_info_v920_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (cell_sel_info_v920_present) {
    HANDLE_CODE(cell_sel_info_v920.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_v920_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ims_emergency_support_r9_present, 1));
  HANDLE_CODE(bref.unpack(cell_sel_info_v920_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (cell_sel_info_v920_present) {
    HANDLE_CODE(cell_sel_info_v920.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_v920_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ims_emergency_support_r9_present) {
    j.write_str("ims-EmergencySupport-r9", "true");
  }
  if (cell_sel_info_v920_present) {
    j.write_fieldname("cellSelectionInfo-v920");
    cell_sel_info_v920.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SystemInformationBlockType10 ::= SEQUENCE
SRSASN_CODE sib_type10_s::pack(bit_ref& bref) 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;
}
SRSASN_CODE sib_type10_s::unpack(cbit_ref& bref)
{
  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));

    if (late_non_crit_ext_present) {
      HANDLE_CODE(late_non_crit_ext.unpack(bref));
    }
  }
  return SRSASN_SUCCESS;
}
void sib_type10_s::to_json(json_writer& j) 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();
}

// SystemInformationBlockType11 ::= SEQUENCE
SRSASN_CODE sib_type11_s::pack(bit_ref& bref) 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;
}
SRSASN_CODE sib_type11_s::unpack(cbit_ref& bref)
{
  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;
}
void sib_type11_s::to_json(json_writer& j) const
{
  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());
  }
  if (ext) {
    if (late_non_crit_ext_present) {
      j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string());
    }
  }
  j.end_obj();
}

// SystemInformationBlockType12-r9 ::= SEQUENCE
SRSASN_CODE sib_type12_r9_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  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 sib_type12_r9_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  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 sib_type12_r9_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 (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();
}

// SystemInformationBlockType13-r9 ::= SEQUENCE
SRSASN_CODE sib_type13_r9_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 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 (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)
{
  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;
}
void sib_type13_r9_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);
  }
  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
{
  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;
}
SRSASN_CODE sib_type14_r11_s::unpack(cbit_ref& bref)
{
  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<eab_cfg_r11_s>();
      break;
    case types::eab_per_plmn_list_r11:
      c.destroy<eab_per_plmn_list_r11_l_>();
      break;
    default:
      break;
  }
}
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<eab_cfg_r11_s>();
      break;
    case types::eab_per_plmn_list_r11:
      c.init<eab_per_plmn_list_r11_l_>();
      break;
    case types::nulltype:
      break;
    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<eab_cfg_r11_s>());
      break;
    case types::eab_per_plmn_list_r11:
      c.init(other.c.get<eab_per_plmn_list_r11_l_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_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)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::eab_common_r11:
      c.set(other.c.get<eab_cfg_r11_s>());
      break;
    case types::eab_per_plmn_list_r11:
      c.set(other.c.get<eab_per_plmn_list_r11_l_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_");
  }

  return *this;
}
void sib_type14_r11_s::eab_param_r11_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<eab_cfg_r11_s>().to_json(j);
      break;
    case types::eab_per_plmn_list_r11:
      j.start_array("eab-PerPLMN-List-r11");
      for (const auto& e1 : c.get<eab_per_plmn_list_r11_l_>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE sib_type14_r11_s::eab_param_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::eab_common_r11:
      HANDLE_CODE(c.get<eab_cfg_r11_s>().pack(bref));
      break;
    case types::eab_per_plmn_list_r11:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<eab_per_plmn_list_r11_l_>(), 1, 6));
      break;
    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<eab_cfg_r11_s>().unpack(bref));
      break;
    case types::eab_per_plmn_list_r11:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<eab_per_plmn_list_r11_l_>(), bref, 1, 6));
      break;
    default:
      log_invalid_choice_id(type_, "sib_type14_r11_s::eab_param_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SystemInformationBlockType15-r11 ::= SEQUENCE
SRSASN_CODE sib_type15_r11_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));

  if (mbms_sai_intra_freq_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mbms_sai_intra_freq_r11, 1, 64, integer_packer<uint32_t>(0, 65535)));
  }
  if (mbms_sai_inter_freq_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mbms_sai_inter_freq_list_r11, 1, 8));
  }
  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 sib_type15_r11_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));

  if (mbms_sai_intra_freq_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mbms_sai_intra_freq_r11, bref, 1, 64, integer_packer<uint32_t>(0, 65535)));
  }
  if (mbms_sai_inter_freq_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mbms_sai_inter_freq_list_r11, bref, 1, 8));
  }
  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 sib_type15_r11_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);
    }
    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) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (late_non_crit_ext_present) {
    j.write_str("lateNonCriticalExtension", late_non_crit_ext.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();
}

// SystemInformationBlockType16-r11 ::= SEQUENCE
SRSASN_CODE sib_type16_r11_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));
  }

  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 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 (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 (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 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 sib_type16_r11_s::to_json(json_writer& j) const
{
  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();
  }
  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.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 (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(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 (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));
  }

  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);
    }
    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 (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 (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_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 (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 (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_type18_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  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 (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();
}

// 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));
    }
    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 (disc_inter_freq_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_inter_freq_list_r12, 1, 8));
  }
  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_type19_r12_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));

  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 (disc_inter_freq_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_inter_freq_list_r12, bref, 1, 8));
  }
  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_type19_r12_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) {
      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) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (late_non_crit_ext_present) {
    j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string());
  }
  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_obj();
}

// SystemInformationBlockType2 ::= SEQUENCE
SRSASN_CODE sib_type2_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ac_barr_info_present, 1));
  HANDLE_CODE(bref.pack(mbsfn_sf_cfg_list_present, 1));

  if (ac_barr_info_present) {
    HANDLE_CODE(bref.pack(ac_barr_info.ac_barr_for_mo_sig_present, 1));
    HANDLE_CODE(bref.pack(ac_barr_info.ac_barr_for_mo_data_present, 1));
    HANDLE_CODE(bref.pack(ac_barr_info.ac_barr_for_emergency, 1));
    if (ac_barr_info.ac_barr_for_mo_sig_present) {
      HANDLE_CODE(ac_barr_info.ac_barr_for_mo_sig.pack(bref));
    }
    if (ac_barr_info.ac_barr_for_mo_data_present) {
      HANDLE_CODE(ac_barr_info.ac_barr_for_mo_data.pack(bref));
    }
  }
  HANDLE_CODE(rr_cfg_common.pack(bref));
  HANDLE_CODE(ue_timers_and_consts.pack(bref));
  HANDLE_CODE(bref.pack(freq_info.ul_carrier_freq_present, 1));
  HANDLE_CODE(bref.pack(freq_info.ul_bw_present, 1));
  if (freq_info.ul_carrier_freq_present) {
    HANDLE_CODE(pack_integer(bref, freq_info.ul_carrier_freq, (uint32_t)0u, (uint32_t)65535u));
  }
  if (freq_info.ul_bw_present) {
    HANDLE_CODE(freq_info.ul_bw.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, freq_info.add_spec_emission, (uint8_t)1u, (uint8_t)32u));
  if (mbsfn_sf_cfg_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mbsfn_sf_cfg_list, 1, 8));
  }
  HANDLE_CODE(time_align_timer_common.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= late_non_crit_ext_present;
    group_flags[1] |= ssac_barr_for_mmtel_voice_r9.is_present();
    group_flags[1] |= ssac_barr_for_mmtel_video_r9.is_present();
    group_flags[2] |= ac_barr_for_csfb_r10.is_present();
    group_flags[3] |= ac_barr_skip_for_mmtel_voice_r12_present;
    group_flags[3] |= ac_barr_skip_for_mmtel_video_r12_present;
    group_flags[3] |= ac_barr_skip_for_sms_r12_present;
    group_flags[3] |= ac_barr_per_plmn_list_r12.is_present();
    group_flags[4] |= voice_service_cause_ind_r12_present;
    group_flags[5] |= acdc_barr_for_common_r13.is_present();
    group_flags[5] |= acdc_barr_per_plmn_list_r13.is_present();
    group_flags[6] |= udt_restricting_for_common_r13.is_present();
    group_flags[6] |= udt_restricting_per_plmn_list_r13.is_present();
    group_flags[6] |= cio_t_eps_optim_info_r13.is_present();
    group_flags[6] |= use_full_resume_id_r13_present;
    group_flags[7] |= unicast_freq_hop_ind_r13_present;
    group_flags[8] |= mbsfn_sf_cfg_list_v1430.is_present();
    group_flags[8] |= video_service_cause_ind_r14_present;
    group_flags[9] |= plmn_info_list_r15.is_present();
    group_flags[10] |= cp_edt_r15_present;
    group_flags[10] |= up_edt_r15_present;
    group_flags[10] |= idle_mode_meass_r15_present;
    group_flags[10] |= reduced_cp_latency_enabled_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(ssac_barr_for_mmtel_voice_r9.is_present(), 1));
      HANDLE_CODE(bref.pack(ssac_barr_for_mmtel_video_r9.is_present(), 1));
      if (ssac_barr_for_mmtel_voice_r9.is_present()) {
        HANDLE_CODE(ssac_barr_for_mmtel_voice_r9->pack(bref));
      }
      if (ssac_barr_for_mmtel_video_r9.is_present()) {
        HANDLE_CODE(ssac_barr_for_mmtel_video_r9->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ac_barr_for_csfb_r10.is_present(), 1));
      if (ac_barr_for_csfb_r10.is_present()) {
        HANDLE_CODE(ac_barr_for_csfb_r10->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ac_barr_skip_for_mmtel_voice_r12_present, 1));
      HANDLE_CODE(bref.pack(ac_barr_skip_for_mmtel_video_r12_present, 1));
      HANDLE_CODE(bref.pack(ac_barr_skip_for_sms_r12_present, 1));
      HANDLE_CODE(bref.pack(ac_barr_per_plmn_list_r12.is_present(), 1));
      if (ac_barr_per_plmn_list_r12.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *ac_barr_per_plmn_list_r12, 1, 6));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(voice_service_cause_ind_r12_present, 1));
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(acdc_barr_for_common_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(acdc_barr_per_plmn_list_r13.is_present(), 1));
      if (acdc_barr_for_common_r13.is_present()) {
        HANDLE_CODE(acdc_barr_for_common_r13->pack(bref));
      }
      if (acdc_barr_per_plmn_list_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *acdc_barr_per_plmn_list_r13, 1, 6));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(udt_restricting_for_common_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(udt_restricting_per_plmn_list_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(cio_t_eps_optim_info_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(use_full_resume_id_r13_present, 1));
      if (udt_restricting_for_common_r13.is_present()) {
        HANDLE_CODE(udt_restricting_for_common_r13->pack(bref));
      }
      if (udt_restricting_per_plmn_list_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *udt_restricting_per_plmn_list_r13, 1, 6));
      }
      if (cio_t_eps_optim_info_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *cio_t_eps_optim_info_r13, 1, 6));
      }
    }
    if (group_flags[7]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(unicast_freq_hop_ind_r13_present, 1));
    }
    if (group_flags[8]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mbsfn_sf_cfg_list_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(video_service_cause_ind_r14_present, 1));
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *mbsfn_sf_cfg_list_v1430, 1, 8));
      }
    }
    if (group_flags[9]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(plmn_info_list_r15.is_present(), 1));
      if (plmn_info_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *plmn_info_list_r15, 1, 6));
      }
    }
    if (group_flags[10]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cp_edt_r15_present, 1));
      HANDLE_CODE(bref.pack(up_edt_r15_present, 1));
      HANDLE_CODE(bref.pack(idle_mode_meass_r15_present, 1));
      HANDLE_CODE(bref.pack(reduced_cp_latency_enabled_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type2_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ac_barr_info_present, 1));
  HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_list_present, 1));

  if (ac_barr_info_present) {
    HANDLE_CODE(bref.unpack(ac_barr_info.ac_barr_for_mo_sig_present, 1));
    HANDLE_CODE(bref.unpack(ac_barr_info.ac_barr_for_mo_data_present, 1));
    HANDLE_CODE(bref.unpack(ac_barr_info.ac_barr_for_emergency, 1));
    if (ac_barr_info.ac_barr_for_mo_sig_present) {
      HANDLE_CODE(ac_barr_info.ac_barr_for_mo_sig.unpack(bref));
    }
    if (ac_barr_info.ac_barr_for_mo_data_present) {
      HANDLE_CODE(ac_barr_info.ac_barr_for_mo_data.unpack(bref));
    }
  }
  HANDLE_CODE(rr_cfg_common.unpack(bref));
  HANDLE_CODE(ue_timers_and_consts.unpack(bref));
  HANDLE_CODE(bref.unpack(freq_info.ul_carrier_freq_present, 1));
  HANDLE_CODE(bref.unpack(freq_info.ul_bw_present, 1));
  if (freq_info.ul_carrier_freq_present) {
    HANDLE_CODE(unpack_integer(freq_info.ul_carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u));
  }
  if (freq_info.ul_bw_present) {
    HANDLE_CODE(freq_info.ul_bw.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(freq_info.add_spec_emission, bref, (uint8_t)1u, (uint8_t)32u));
  if (mbsfn_sf_cfg_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mbsfn_sf_cfg_list, bref, 1, 8));
  }
  HANDLE_CODE(time_align_timer_common.unpack(bref));

  if (ext) {
    ext_groups_unpacker_guard group_flags(11);
    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 ssac_barr_for_mmtel_voice_r9_present;
      HANDLE_CODE(bref.unpack(ssac_barr_for_mmtel_voice_r9_present, 1));
      ssac_barr_for_mmtel_voice_r9.set_present(ssac_barr_for_mmtel_voice_r9_present);
      bool ssac_barr_for_mmtel_video_r9_present;
      HANDLE_CODE(bref.unpack(ssac_barr_for_mmtel_video_r9_present, 1));
      ssac_barr_for_mmtel_video_r9.set_present(ssac_barr_for_mmtel_video_r9_present);
      if (ssac_barr_for_mmtel_voice_r9.is_present()) {
        HANDLE_CODE(ssac_barr_for_mmtel_voice_r9->unpack(bref));
      }
      if (ssac_barr_for_mmtel_video_r9.is_present()) {
        HANDLE_CODE(ssac_barr_for_mmtel_video_r9->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ac_barr_for_csfb_r10_present;
      HANDLE_CODE(bref.unpack(ac_barr_for_csfb_r10_present, 1));
      ac_barr_for_csfb_r10.set_present(ac_barr_for_csfb_r10_present);
      if (ac_barr_for_csfb_r10.is_present()) {
        HANDLE_CODE(ac_barr_for_csfb_r10->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(ac_barr_skip_for_mmtel_voice_r12_present, 1));
      HANDLE_CODE(bref.unpack(ac_barr_skip_for_mmtel_video_r12_present, 1));
      HANDLE_CODE(bref.unpack(ac_barr_skip_for_sms_r12_present, 1));
      bool ac_barr_per_plmn_list_r12_present;
      HANDLE_CODE(bref.unpack(ac_barr_per_plmn_list_r12_present, 1));
      ac_barr_per_plmn_list_r12.set_present(ac_barr_per_plmn_list_r12_present);
      if (ac_barr_per_plmn_list_r12.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*ac_barr_per_plmn_list_r12, bref, 1, 6));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(voice_service_cause_ind_r12_present, 1));
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool acdc_barr_for_common_r13_present;
      HANDLE_CODE(bref.unpack(acdc_barr_for_common_r13_present, 1));
      acdc_barr_for_common_r13.set_present(acdc_barr_for_common_r13_present);
      bool acdc_barr_per_plmn_list_r13_present;
      HANDLE_CODE(bref.unpack(acdc_barr_per_plmn_list_r13_present, 1));
      acdc_barr_per_plmn_list_r13.set_present(acdc_barr_per_plmn_list_r13_present);
      if (acdc_barr_for_common_r13.is_present()) {
        HANDLE_CODE(acdc_barr_for_common_r13->unpack(bref));
      }
      if (acdc_barr_per_plmn_list_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*acdc_barr_per_plmn_list_r13, bref, 1, 6));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool udt_restricting_for_common_r13_present;
      HANDLE_CODE(bref.unpack(udt_restricting_for_common_r13_present, 1));
      udt_restricting_for_common_r13.set_present(udt_restricting_for_common_r13_present);
      bool udt_restricting_per_plmn_list_r13_present;
      HANDLE_CODE(bref.unpack(udt_restricting_per_plmn_list_r13_present, 1));
      udt_restricting_per_plmn_list_r13.set_present(udt_restricting_per_plmn_list_r13_present);
      bool cio_t_eps_optim_info_r13_present;
      HANDLE_CODE(bref.unpack(cio_t_eps_optim_info_r13_present, 1));
      cio_t_eps_optim_info_r13.set_present(cio_t_eps_optim_info_r13_present);
      HANDLE_CODE(bref.unpack(use_full_resume_id_r13_present, 1));
      if (udt_restricting_for_common_r13.is_present()) {
        HANDLE_CODE(udt_restricting_for_common_r13->unpack(bref));
      }
      if (udt_restricting_per_plmn_list_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*udt_restricting_per_plmn_list_r13, bref, 1, 6));
      }
      if (cio_t_eps_optim_info_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*cio_t_eps_optim_info_r13, bref, 1, 6));
      }
    }
    if (group_flags[7]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(unicast_freq_hop_ind_r13_present, 1));
    }
    if (group_flags[8]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool mbsfn_sf_cfg_list_v1430_present;
      HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_list_v1430_present, 1));
      mbsfn_sf_cfg_list_v1430.set_present(mbsfn_sf_cfg_list_v1430_present);
      HANDLE_CODE(bref.unpack(video_service_cause_ind_r14_present, 1));
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*mbsfn_sf_cfg_list_v1430, bref, 1, 8));
      }
    }
    if (group_flags[9]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool plmn_info_list_r15_present;
      HANDLE_CODE(bref.unpack(plmn_info_list_r15_present, 1));
      plmn_info_list_r15.set_present(plmn_info_list_r15_present);
      if (plmn_info_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*plmn_info_list_r15, bref, 1, 6));
      }
    }
    if (group_flags[10]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(cp_edt_r15_present, 1));
      HANDLE_CODE(bref.unpack(up_edt_r15_present, 1));
      HANDLE_CODE(bref.unpack(idle_mode_meass_r15_present, 1));
      HANDLE_CODE(bref.unpack(reduced_cp_latency_enabled_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
void sib_type2_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ac_barr_info_present) {
    j.write_fieldname("ac-BarringInfo");
    j.start_obj();
    j.write_bool("ac-BarringForEmergency", ac_barr_info.ac_barr_for_emergency);
    if (ac_barr_info.ac_barr_for_mo_sig_present) {
      j.write_fieldname("ac-BarringForMO-Signalling");
      ac_barr_info.ac_barr_for_mo_sig.to_json(j);
    }
    if (ac_barr_info.ac_barr_for_mo_data_present) {
      j.write_fieldname("ac-BarringForMO-Data");
      ac_barr_info.ac_barr_for_mo_data.to_json(j);
    }
    j.end_obj();
  }
  j.write_fieldname("radioResourceConfigCommon");
  rr_cfg_common.to_json(j);
  j.write_fieldname("ue-TimersAndConstants");
  ue_timers_and_consts.to_json(j);
  j.write_fieldname("freqInfo");
  j.start_obj();
  if (freq_info.ul_carrier_freq_present) {
    j.write_int("ul-CarrierFreq", freq_info.ul_carrier_freq);
  }
  if (freq_info.ul_bw_present) {
    j.write_str("ul-Bandwidth", freq_info.ul_bw.to_string());
  }
  j.write_int("additionalSpectrumEmission", freq_info.add_spec_emission);
  j.end_obj();
  if (mbsfn_sf_cfg_list_present) {
    j.start_array("mbsfn-SubframeConfigList");
    for (const auto& e1 : mbsfn_sf_cfg_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_str("timeAlignmentTimerCommon", time_align_timer_common.to_string());
  if (ext) {
    if (late_non_crit_ext_present) {
      j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string());
    }
    if (ssac_barr_for_mmtel_voice_r9.is_present()) {
      j.write_fieldname("ssac-BarringForMMTEL-Voice-r9");
      ssac_barr_for_mmtel_voice_r9->to_json(j);
    }
    if (ssac_barr_for_mmtel_video_r9.is_present()) {
      j.write_fieldname("ssac-BarringForMMTEL-Video-r9");
      ssac_barr_for_mmtel_video_r9->to_json(j);
    }
    if (ac_barr_for_csfb_r10.is_present()) {
      j.write_fieldname("ac-BarringForCSFB-r10");
      ac_barr_for_csfb_r10->to_json(j);
    }
    if (ac_barr_skip_for_mmtel_voice_r12_present) {
      j.write_str("ac-BarringSkipForMMTELVoice-r12", "true");
    }
    if (ac_barr_skip_for_mmtel_video_r12_present) {
      j.write_str("ac-BarringSkipForMMTELVideo-r12", "true");
    }
    if (ac_barr_skip_for_sms_r12_present) {
      j.write_str("ac-BarringSkipForSMS-r12", "true");
    }
    if (ac_barr_per_plmn_list_r12.is_present()) {
      j.start_array("ac-BarringPerPLMN-List-r12");
      for (const auto& e1 : *ac_barr_per_plmn_list_r12) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (voice_service_cause_ind_r12_present) {
      j.write_str("voiceServiceCauseIndication-r12", "true");
    }
    if (acdc_barr_for_common_r13.is_present()) {
      j.write_fieldname("acdc-BarringForCommon-r13");
      acdc_barr_for_common_r13->to_json(j);
    }
    if (acdc_barr_per_plmn_list_r13.is_present()) {
      j.start_array("acdc-BarringPerPLMN-List-r13");
      for (const auto& e1 : *acdc_barr_per_plmn_list_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (udt_restricting_for_common_r13.is_present()) {
      j.write_fieldname("udt-RestrictingForCommon-r13");
      udt_restricting_for_common_r13->to_json(j);
    }
    if (udt_restricting_per_plmn_list_r13.is_present()) {
      j.start_array("udt-RestrictingPerPLMN-List-r13");
      for (const auto& e1 : *udt_restricting_per_plmn_list_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (cio_t_eps_optim_info_r13.is_present()) {
      j.start_array("cIoT-EPS-OptimisationInfo-r13");
      for (const auto& e1 : *cio_t_eps_optim_info_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (use_full_resume_id_r13_present) {
      j.write_str("useFullResumeID-r13", "true");
    }
    if (unicast_freq_hop_ind_r13_present) {
      j.write_str("unicastFreqHoppingInd-r13", "true");
    }
    if (mbsfn_sf_cfg_list_v1430.is_present()) {
      j.start_array("mbsfn-SubframeConfigList-v1430");
      for (const auto& e1 : *mbsfn_sf_cfg_list_v1430) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (video_service_cause_ind_r14_present) {
      j.write_str("videoServiceCauseIndication-r14", "true");
    }
    if (plmn_info_list_r15.is_present()) {
      j.start_array("plmn-InfoList-r15");
      for (const auto& e1 : *plmn_info_list_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (cp_edt_r15_present) {
      j.write_str("cp-EDT-r15", "true");
    }
    if (up_edt_r15_present) {
      j.write_str("up-EDT-r15", "true");
    }
    if (idle_mode_meass_r15_present) {
      j.write_str("idleModeMeasurements-r15", "true");
    }
    if (reduced_cp_latency_enabled_r15_present) {
      j.write_str("reducedCP-LatencyEnabled-r15", "true");
    }
  }
  j.end_obj();
}

// 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(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));
  }

  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);

    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));
      }
      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(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_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(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));
  }

  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 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);

      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_type20_r13_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());
  }
  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();
}

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<fdd_r14_e_>());
      break;
    case types::tdd_r14:
      c.init(other.c.get<tdd_r14_e_>());
      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_");
  }
}
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<fdd_r14_e_>());
      break;
    case types::tdd_r14:
      c.set(other.c.get<tdd_r14_e_>());
      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<fdd_r14_e_>().to_string());
      break;
    case types::tdd_r14:
      j.write_str("tdd-r14", c.get<tdd_r14_e_>().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<fdd_r14_e_>().pack(bref));
      break;
    case types::tdd_r14:
      HANDLE_CODE(c.get<tdd_r14_e_>().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<fdd_r14_e_>().unpack(bref));
      break;
    case types::tdd_r14:
      HANDLE_CODE(c.get<tdd_r14_e_>().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;
}

// 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)
{
  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));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.unpack(bref));
  }

  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);
  }
  if (late_non_crit_ext_present) {
    j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string());
  }
  j.end_obj();
}

// 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));

  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));
  }

  return SRSASN_SUCCESS;
}
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));

  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));
  }

  return SRSASN_SUCCESS;
}
void sib_type24_r15_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) {
      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());
  }
  j.end_obj();
}

// SystemInformationBlockType25-r15 ::= SEQUENCE
SRSASN_CODE sib_type25_r15_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));

  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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type25_r15_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));

  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));
  }

  return SRSASN_SUCCESS;
}
void sib_type25_r15_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 (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());
  }
  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<individual_plmn_list_r15_l_>();
      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<individual_plmn_list_r15_l_>();
      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<uac_ac1_select_assist_info_r15_e>());
      break;
    case types::individual_plmn_list_r15:
      c.init(other.c.get<individual_plmn_list_r15_l_>());
      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<uac_ac1_select_assist_info_r15_e>());
      break;
    case types::individual_plmn_list_r15:
      c.set(other.c.get<individual_plmn_list_r15_l_>());
      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<uac_ac1_select_assist_info_r15_e>().to_string());
      break;
    case types::individual_plmn_list_r15:
      j.start_array("individualPLMNList-r15");
      for (const auto& e1 : c.get<individual_plmn_list_r15_l_>()) {
        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<uac_ac1_select_assist_info_r15_e>().pack(bref));
      break;
    case types::individual_plmn_list_r15:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<individual_plmn_list_r15_l_>(), 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<uac_ac1_select_assist_info_r15_e>().unpack(bref));
      break;
    case types::individual_plmn_list_r15:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<individual_plmn_list_r15_l_>(), 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
{
  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_r14_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<uint32_t>(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_r14_present) {
    HANDLE_CODE(pack_integer(bref, thresh_s_rssi_cbr_r14, (uint8_t)0u, (uint8_t)45u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type26_r15_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_r14_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<uint32_t>(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_r14_present) {
    HANDLE_CODE(unpack_integer(thresh_s_rssi_cbr_r14, bref, (uint8_t)0u, (uint8_t)45u));
  }

  return SRSASN_SUCCESS;
}
void sib_type26_r15_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_r14_present) {
    j.write_int("threshS-RSSI-CBR-r14", thresh_s_rssi_cbr_r14);
  }
  j.end_obj();
}

// SystemInformationBlockType3 ::= SEQUENCE
SRSASN_CODE sib_type3_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(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] |= 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)
{
  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));
  }
  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));
  }

  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));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sib_type3_s::to_json(json_writer& j) const
{
  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);
  }
  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();
}

// 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)
{
  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));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sib_type8_s::to_json(json_writer& j) const
{
  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 (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 (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();
}

// 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)
{
  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));
    }
  }
  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
{
  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));
  }

  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));
  }

  return SRSASN_SUCCESS;
}
void pos_sys_info_r15_ies_s::to_json(json_writer& j) const
{
  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());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

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<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus2_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus3_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus4_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus5_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus6_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus7_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus1_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus2_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus3_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus4_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus5_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus6_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus7_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus8_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus9_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus10_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus11_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus12_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus13_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus14_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus15_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus16_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus17_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus18_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus19_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    case types::pos_sib3_minus1_r15:
      c.destroy<sib_pos_r15_s>();
      break;
    default:
      break;
  }
}
void pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::pos_sib1_minus1_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus2_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus3_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus4_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus5_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus6_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib1_minus7_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus1_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus2_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus3_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus4_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus5_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus6_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus7_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus8_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus9_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus10_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus11_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus12_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus13_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus14_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus15_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus16_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus17_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus18_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib2_minus19_r15:
      c.init<sib_pos_r15_s>();
      break;
    case types::pos_sib3_minus1_r15:
      c.init<sib_pos_r15_s>();
      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_");
  }
}
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)
{
  type_ = other.type();
  switch (type_) {
    case types::pos_sib1_minus1_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus2_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus3_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus4_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus5_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus6_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus7_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus1_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus2_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus3_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus4_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus5_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus6_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus7_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus8_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus9_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus10_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus11_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus12_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus13_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus14_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus15_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus16_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus17_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus18_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus19_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib3_minus1_r15:
      c.init(other.c.get<sib_pos_r15_s>());
      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_");
  }
}
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)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::pos_sib1_minus1_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus2_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus3_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus4_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus5_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus6_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib1_minus7_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus1_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus2_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus3_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus4_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus5_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus6_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus7_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus8_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus9_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus10_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus11_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus12_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus13_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus14_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus15_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus16_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus17_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus18_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib2_minus19_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      break;
    case types::pos_sib3_minus1_r15:
      c.set(other.c.get<sib_pos_r15_s>());
      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 *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<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib1_minus2_r15:
      j.write_fieldname("posSib1-2-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib1_minus3_r15:
      j.write_fieldname("posSib1-3-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib1_minus4_r15:
      j.write_fieldname("posSib1-4-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib1_minus5_r15:
      j.write_fieldname("posSib1-5-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib1_minus6_r15:
      j.write_fieldname("posSib1-6-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib1_minus7_r15:
      j.write_fieldname("posSib1-7-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus1_r15:
      j.write_fieldname("posSib2-1-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus2_r15:
      j.write_fieldname("posSib2-2-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus3_r15:
      j.write_fieldname("posSib2-3-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus4_r15:
      j.write_fieldname("posSib2-4-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus5_r15:
      j.write_fieldname("posSib2-5-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus6_r15:
      j.write_fieldname("posSib2-6-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus7_r15:
      j.write_fieldname("posSib2-7-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus8_r15:
      j.write_fieldname("posSib2-8-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus9_r15:
      j.write_fieldname("posSib2-9-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus10_r15:
      j.write_fieldname("posSib2-10-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus11_r15:
      j.write_fieldname("posSib2-11-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus12_r15:
      j.write_fieldname("posSib2-12-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus13_r15:
      j.write_fieldname("posSib2-13-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus14_r15:
      j.write_fieldname("posSib2-14-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus15_r15:
      j.write_fieldname("posSib2-15-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus16_r15:
      j.write_fieldname("posSib2-16-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus17_r15:
      j.write_fieldname("posSib2-17-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus18_r15:
      j.write_fieldname("posSib2-18-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib2_minus19_r15:
      j.write_fieldname("posSib2-19-r15");
      c.get<sib_pos_r15_s>().to_json(j);
      break;
    case types::pos_sib3_minus1_r15:
      j.write_fieldname("posSib3-1-r15");
      c.get<sib_pos_r15_s>().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();
}
SRSASN_CODE pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::pos_sib1_minus1_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib1_minus2_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib1_minus3_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib1_minus4_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib1_minus5_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib1_minus6_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib1_minus7_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus1_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus2_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus3_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus4_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus5_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus6_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus7_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus8_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus9_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus10_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus11_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus12_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus13_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus14_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus15_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus16_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus17_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus18_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib2_minus19_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().pack(bref));
      break;
    case types::pos_sib3_minus1_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().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;
}
SRSASN_CODE pos_sys_info_r15_ies_s::pos_sib_type_and_info_r15_item_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::pos_sib1_minus1_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib1_minus2_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib1_minus3_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib1_minus4_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib1_minus5_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib1_minus6_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib1_minus7_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus1_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus2_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus3_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus4_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus5_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus6_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus7_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus8_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus9_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus10_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus11_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus12_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus13_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus14_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus15_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus16_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus17_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus18_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib2_minus19_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().unpack(bref));
      break;
    case types::pos_sib3_minus1_r15:
      HANDLE_CODE(c.get<sib_pos_r15_s>().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;
}

void sib_info_item_c::destroy_()
{
  switch (type_) {
    case types::sib2:
      c.destroy<sib_type2_s>();
      break;
    case types::sib3:
      c.destroy<sib_type3_s>();
      break;
    case types::sib4:
      c.destroy<sib_type4_s>();
      break;
    case types::sib5:
      c.destroy<sib_type5_s>();
      break;
    case types::sib6:
      c.destroy<sib_type6_s>();
      break;
    case types::sib7:
      c.destroy<sib_type7_s>();
      break;
    case types::sib8:
      c.destroy<sib_type8_s>();
      break;
    case types::sib9:
      c.destroy<sib_type9_s>();
      break;
    case types::sib10:
      c.destroy<sib_type10_s>();
      break;
    case types::sib11:
      c.destroy<sib_type11_s>();
      break;
    case types::sib12_v920:
      c.destroy<sib_type12_r9_s>();
      break;
    case types::sib13_v920:
      c.destroy<sib_type13_r9_s>();
      break;
    case types::sib14_v1130:
      c.destroy<sib_type14_r11_s>();
      break;
    case types::sib15_v1130:
      c.destroy<sib_type15_r11_s>();
      break;
    case types::sib16_v1130:
      c.destroy<sib_type16_r11_s>();
      break;
    case types::sib17_v1250:
      c.destroy<sib_type17_r12_s>();
      break;
    case types::sib18_v1250:
      c.destroy<sib_type18_r12_s>();
      break;
    case types::sib19_v1250:
      c.destroy<sib_type19_r12_s>();
      break;
    case types::sib20_v1310:
      c.destroy<sib_type20_r13_s>();
      break;
    case types::sib21_v1430:
      c.destroy<sib_type21_r14_s>();
      break;
    case types::sib24_v1530:
      c.destroy<sib_type24_r15_s>();
      break;
    case types::sib25_v1530:
      c.destroy<sib_type25_r15_s>();
      break;
    case types::sib26_v1530:
      c.destroy<sib_type26_r15_s>();
      break;
    default:
      break;
  }
}
void sib_info_item_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sib2:
      c.init<sib_type2_s>();
      break;
    case types::sib3:
      c.init<sib_type3_s>();
      break;
    case types::sib4:
      c.init<sib_type4_s>();
      break;
    case types::sib5:
      c.init<sib_type5_s>();
      break;
    case types::sib6:
      c.init<sib_type6_s>();
      break;
    case types::sib7:
      c.init<sib_type7_s>();
      break;
    case types::sib8:
      c.init<sib_type8_s>();
      break;
    case types::sib9:
      c.init<sib_type9_s>();
      break;
    case types::sib10:
      c.init<sib_type10_s>();
      break;
    case types::sib11:
      c.init<sib_type11_s>();
      break;
    case types::sib12_v920:
      c.init<sib_type12_r9_s>();
      break;
    case types::sib13_v920:
      c.init<sib_type13_r9_s>();
      break;
    case types::sib14_v1130:
      c.init<sib_type14_r11_s>();
      break;
    case types::sib15_v1130:
      c.init<sib_type15_r11_s>();
      break;
    case types::sib16_v1130:
      c.init<sib_type16_r11_s>();
      break;
    case types::sib17_v1250:
      c.init<sib_type17_r12_s>();
      break;
    case types::sib18_v1250:
      c.init<sib_type18_r12_s>();
      break;
    case types::sib19_v1250:
      c.init<sib_type19_r12_s>();
      break;
    case types::sib20_v1310:
      c.init<sib_type20_r13_s>();
      break;
    case types::sib21_v1430:
      c.init<sib_type21_r14_s>();
      break;
    case types::sib24_v1530:
      c.init<sib_type24_r15_s>();
      break;
    case types::sib25_v1530:
      c.init<sib_type25_r15_s>();
      break;
    case types::sib26_v1530:
      c.init<sib_type26_r15_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sib_info_item_c");
  }
}
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<sib_type2_s>());
      break;
    case types::sib3:
      c.init(other.c.get<sib_type3_s>());
      break;
    case types::sib4:
      c.init(other.c.get<sib_type4_s>());
      break;
    case types::sib5:
      c.init(other.c.get<sib_type5_s>());
      break;
    case types::sib6:
      c.init(other.c.get<sib_type6_s>());
      break;
    case types::sib7:
      c.init(other.c.get<sib_type7_s>());
      break;
    case types::sib8:
      c.init(other.c.get<sib_type8_s>());
      break;
    case types::sib9:
      c.init(other.c.get<sib_type9_s>());
      break;
    case types::sib10:
      c.init(other.c.get<sib_type10_s>());
      break;
    case types::sib11:
      c.init(other.c.get<sib_type11_s>());
      break;
    case types::sib12_v920:
      c.init(other.c.get<sib_type12_r9_s>());
      break;
    case types::sib13_v920:
      c.init(other.c.get<sib_type13_r9_s>());
      break;
    case types::sib14_v1130:
      c.init(other.c.get<sib_type14_r11_s>());
      break;
    case types::sib15_v1130:
      c.init(other.c.get<sib_type15_r11_s>());
      break;
    case types::sib16_v1130:
      c.init(other.c.get<sib_type16_r11_s>());
      break;
    case types::sib17_v1250:
      c.init(other.c.get<sib_type17_r12_s>());
      break;
    case types::sib18_v1250:
      c.init(other.c.get<sib_type18_r12_s>());
      break;
    case types::sib19_v1250:
      c.init(other.c.get<sib_type19_r12_s>());
      break;
    case types::sib20_v1310:
      c.init(other.c.get<sib_type20_r13_s>());
      break;
    case types::sib21_v1430:
      c.init(other.c.get<sib_type21_r14_s>());
      break;
    case types::sib24_v1530:
      c.init(other.c.get<sib_type24_r15_s>());
      break;
    case types::sib25_v1530:
      c.init(other.c.get<sib_type25_r15_s>());
      break;
    case types::sib26_v1530:
      c.init(other.c.get<sib_type26_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sib_info_item_c");
  }
}
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::sib2:
      c.set(other.c.get<sib_type2_s>());
      break;
    case types::sib3:
      c.set(other.c.get<sib_type3_s>());
      break;
    case types::sib4:
      c.set(other.c.get<sib_type4_s>());
      break;
    case types::sib5:
      c.set(other.c.get<sib_type5_s>());
      break;
    case types::sib6:
      c.set(other.c.get<sib_type6_s>());
      break;
    case types::sib7:
      c.set(other.c.get<sib_type7_s>());
      break;
    case types::sib8:
      c.set(other.c.get<sib_type8_s>());
      break;
    case types::sib9:
      c.set(other.c.get<sib_type9_s>());
      break;
    case types::sib10:
      c.set(other.c.get<sib_type10_s>());
      break;
    case types::sib11:
      c.set(other.c.get<sib_type11_s>());
      break;
    case types::sib12_v920:
      c.set(other.c.get<sib_type12_r9_s>());
      break;
    case types::sib13_v920:
      c.set(other.c.get<sib_type13_r9_s>());
      break;
    case types::sib14_v1130:
      c.set(other.c.get<sib_type14_r11_s>());
      break;
    case types::sib15_v1130:
      c.set(other.c.get<sib_type15_r11_s>());
      break;
    case types::sib16_v1130:
      c.set(other.c.get<sib_type16_r11_s>());
      break;
    case types::sib17_v1250:
      c.set(other.c.get<sib_type17_r12_s>());
      break;
    case types::sib18_v1250:
      c.set(other.c.get<sib_type18_r12_s>());
      break;
    case types::sib19_v1250:
      c.set(other.c.get<sib_type19_r12_s>());
      break;
    case types::sib20_v1310:
      c.set(other.c.get<sib_type20_r13_s>());
      break;
    case types::sib21_v1430:
      c.set(other.c.get<sib_type21_r14_s>());
      break;
    case types::sib24_v1530:
      c.set(other.c.get<sib_type24_r15_s>());
      break;
    case types::sib25_v1530:
      c.set(other.c.get<sib_type25_r15_s>());
      break;
    case types::sib26_v1530:
      c.set(other.c.get<sib_type26_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sib_info_item_c");
  }

  return *this;
}
void sib_info_item_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sib2:
      j.write_fieldname("sib2");
      c.get<sib_type2_s>().to_json(j);
      break;
    case types::sib3:
      j.write_fieldname("sib3");
      c.get<sib_type3_s>().to_json(j);
      break;
    case types::sib4:
      j.write_fieldname("sib4");
      c.get<sib_type4_s>().to_json(j);
      break;
    case types::sib5:
      j.write_fieldname("sib5");
      c.get<sib_type5_s>().to_json(j);
      break;
    case types::sib6:
      j.write_fieldname("sib6");
      c.get<sib_type6_s>().to_json(j);
      break;
    case types::sib7:
      j.write_fieldname("sib7");
      c.get<sib_type7_s>().to_json(j);
      break;
    case types::sib8:
      j.write_fieldname("sib8");
      c.get<sib_type8_s>().to_json(j);
      break;
    case types::sib9:
      j.write_fieldname("sib9");
      c.get<sib_type9_s>().to_json(j);
      break;
    case types::sib10:
      j.write_fieldname("sib10");
      c.get<sib_type10_s>().to_json(j);
      break;
    case types::sib11:
      j.write_fieldname("sib11");
      c.get<sib_type11_s>().to_json(j);
      break;
    case types::sib12_v920:
      j.write_fieldname("sib12-v920");
      c.get<sib_type12_r9_s>().to_json(j);
      break;
    case types::sib13_v920:
      j.write_fieldname("sib13-v920");
      c.get<sib_type13_r9_s>().to_json(j);
      break;
    case types::sib14_v1130:
      j.write_fieldname("sib14-v1130");
      c.get<sib_type14_r11_s>().to_json(j);
      break;
    case types::sib15_v1130:
      j.write_fieldname("sib15-v1130");
      c.get<sib_type15_r11_s>().to_json(j);
      break;
    case types::sib16_v1130:
      j.write_fieldname("sib16-v1130");
      c.get<sib_type16_r11_s>().to_json(j);
      break;
    case types::sib17_v1250:
      j.write_fieldname("sib17-v1250");
      c.get<sib_type17_r12_s>().to_json(j);
      break;
    case types::sib18_v1250:
      j.write_fieldname("sib18-v1250");
      c.get<sib_type18_r12_s>().to_json(j);
      break;
    case types::sib19_v1250:
      j.write_fieldname("sib19-v1250");
      c.get<sib_type19_r12_s>().to_json(j);
      break;
    case types::sib20_v1310:
      j.write_fieldname("sib20-v1310");
      c.get<sib_type20_r13_s>().to_json(j);
      break;
    case types::sib21_v1430:
      j.write_fieldname("sib21-v1430");
      c.get<sib_type21_r14_s>().to_json(j);
      break;
    case types::sib24_v1530:
      j.write_fieldname("sib24-v1530");
      c.get<sib_type24_r15_s>().to_json(j);
      break;
    case types::sib25_v1530:
      j.write_fieldname("sib25-v1530");
      c.get<sib_type25_r15_s>().to_json(j);
      break;
    case types::sib26_v1530:
      j.write_fieldname("sib26-v1530");
      c.get<sib_type26_r15_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sib_info_item_c");
  }
  j.end_obj();
}
SRSASN_CODE sib_info_item_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sib2:
      HANDLE_CODE(c.get<sib_type2_s>().pack(bref));
      break;
    case types::sib3:
      HANDLE_CODE(c.get<sib_type3_s>().pack(bref));
      break;
    case types::sib4:
      HANDLE_CODE(c.get<sib_type4_s>().pack(bref));
      break;
    case types::sib5:
      HANDLE_CODE(c.get<sib_type5_s>().pack(bref));
      break;
    case types::sib6:
      HANDLE_CODE(c.get<sib_type6_s>().pack(bref));
      break;
    case types::sib7:
      HANDLE_CODE(c.get<sib_type7_s>().pack(bref));
      break;
    case types::sib8:
      HANDLE_CODE(c.get<sib_type8_s>().pack(bref));
      break;
    case types::sib9:
      HANDLE_CODE(c.get<sib_type9_s>().pack(bref));
      break;
    case types::sib10:
      HANDLE_CODE(c.get<sib_type10_s>().pack(bref));
      break;
    case types::sib11:
      HANDLE_CODE(c.get<sib_type11_s>().pack(bref));
      break;
    case types::sib12_v920: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type12_r9_s>().pack(bref));
    } break;
    case types::sib13_v920: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type13_r9_s>().pack(bref));
    } break;
    case types::sib14_v1130: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type14_r11_s>().pack(bref));
    } break;
    case types::sib15_v1130: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type15_r11_s>().pack(bref));
    } break;
    case types::sib16_v1130: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type16_r11_s>().pack(bref));
    } break;
    case types::sib17_v1250: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type17_r12_s>().pack(bref));
    } break;
    case types::sib18_v1250: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type18_r12_s>().pack(bref));
    } break;
    case types::sib19_v1250: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type19_r12_s>().pack(bref));
    } break;
    case types::sib20_v1310: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type20_r13_s>().pack(bref));
    } break;
    case types::sib21_v1430: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type21_r14_s>().pack(bref));
    } break;
    case types::sib24_v1530: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type24_r15_s>().pack(bref));
    } break;
    case types::sib25_v1530: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type25_r15_s>().pack(bref));
    } break;
    case types::sib26_v1530: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type26_r15_s>().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<sib_type2_s>().unpack(bref));
      break;
    case types::sib3:
      HANDLE_CODE(c.get<sib_type3_s>().unpack(bref));
      break;
    case types::sib4:
      HANDLE_CODE(c.get<sib_type4_s>().unpack(bref));
      break;
    case types::sib5:
      HANDLE_CODE(c.get<sib_type5_s>().unpack(bref));
      break;
    case types::sib6:
      HANDLE_CODE(c.get<sib_type6_s>().unpack(bref));
      break;
    case types::sib7:
      HANDLE_CODE(c.get<sib_type7_s>().unpack(bref));
      break;
    case types::sib8:
      HANDLE_CODE(c.get<sib_type8_s>().unpack(bref));
      break;
    case types::sib9:
      HANDLE_CODE(c.get<sib_type9_s>().unpack(bref));
      break;
    case types::sib10:
      HANDLE_CODE(c.get<sib_type10_s>().unpack(bref));
      break;
    case types::sib11:
      HANDLE_CODE(c.get<sib_type11_s>().unpack(bref));
      break;
    case types::sib12_v920: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type12_r9_s>().unpack(bref));
    } break;
    case types::sib13_v920: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type13_r9_s>().unpack(bref));
    } break;
    case types::sib14_v1130: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type14_r11_s>().unpack(bref));
    } break;
    case types::sib15_v1130: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type15_r11_s>().unpack(bref));
    } break;
    case types::sib16_v1130: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type16_r11_s>().unpack(bref));
    } break;
    case types::sib17_v1250: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type17_r12_s>().unpack(bref));
    } break;
    case types::sib18_v1250: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type18_r12_s>().unpack(bref));
    } break;
    case types::sib19_v1250: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type19_r12_s>().unpack(bref));
    } break;
    case types::sib20_v1310: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type20_r13_s>().unpack(bref));
    } break;
    case types::sib21_v1430: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type21_r14_s>().unpack(bref));
    } break;
    case types::sib24_v1530: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type24_r15_s>().unpack(bref));
    } break;
    case types::sib25_v1530: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type25_r15_s>().unpack(bref));
    } break;
    case types::sib26_v1530: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<sib_type26_r15_s>().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();
}

// SystemInformationBlockType1-v890-IEs ::= SEQUENCE
SRSASN_CODE sib_type1_v890_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 sib_type1_v890_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 sib_type1_v890_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();
}

// 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<sys_info_r8_ies_s>();
      break;
    case types::crit_exts_future_r15:
      c.destroy<crit_exts_future_r15_c_>();
      break;
    default:
      break;
  }
}
void sys_info_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sys_info_r8:
      c.init<sys_info_r8_ies_s>();
      break;
    case types::crit_exts_future_r15:
      c.init<crit_exts_future_r15_c_>();
      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_r8:
      c.init(other.c.get<sys_info_r8_ies_s>());
      break;
    case types::crit_exts_future_r15:
      c.init(other.c.get<crit_exts_future_r15_c_>());
      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_r8:
      c.set(other.c.get<sys_info_r8_ies_s>());
      break;
    case types::crit_exts_future_r15:
      c.set(other.c.get<crit_exts_future_r15_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::sys_info_r8:
      j.write_fieldname("systemInformation-r8");
      c.get<sys_info_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future_r15:
      j.write_fieldname("criticalExtensionsFuture-r15");
      c.get<crit_exts_future_r15_c_>().to_json(j);
      break;
    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<sys_info_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future_r15:
      HANDLE_CODE(c.get<crit_exts_future_r15_c_>().pack(bref));
      break;
    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<sys_info_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future_r15:
      HANDLE_CODE(c.get<crit_exts_future_r15_c_>().unpack(bref));
      break;
    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_::destroy_()
{
  switch (type_) {
    case types::pos_sys_info_r15:
      c.destroy<pos_sys_info_r15_ies_s>();
      break;
    default:
      break;
  }
}
void sys_info_s::crit_exts_c_::crit_exts_future_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::pos_sys_info_r15:
      c.init<pos_sys_info_r15_ies_s>();
      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_");
  }
}
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)
{
  type_ = other.type();
  switch (type_) {
    case types::pos_sys_info_r15:
      c.init(other.c.get<pos_sys_info_r15_ies_s>());
      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_");
  }
}
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)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::pos_sys_info_r15:
      c.set(other.c.get<pos_sys_info_r15_ies_s>());
      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_");
  }

  return *this;
}
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.get<pos_sys_info_r15_ies_s>().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_");
  }
  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.get<pos_sys_info_r15_ies_s>().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;
  }
  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.get<pos_sys_info_r15_ies_s>().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;
  }
  return SRSASN_SUCCESS;
}

// SystemInformationBlockType1 ::= SEQUENCE
SRSASN_CODE sib_type1_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(p_max_present, 1));
  HANDLE_CODE(bref.pack(tdd_cfg_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.pack(cell_access_related_info.csg_id_present, 1));
  HANDLE_CODE(pack_dyn_seq_of(bref, cell_access_related_info.plmn_id_list, 1, 6));
  HANDLE_CODE(cell_access_related_info.tac.pack(bref));
  HANDLE_CODE(cell_access_related_info.cell_id.pack(bref));
  HANDLE_CODE(cell_access_related_info.cell_barred.pack(bref));
  HANDLE_CODE(cell_access_related_info.intra_freq_resel.pack(bref));
  HANDLE_CODE(bref.pack(cell_access_related_info.csg_ind, 1));
  if (cell_access_related_info.csg_id_present) {
    HANDLE_CODE(cell_access_related_info.csg_id.pack(bref));
  }
  HANDLE_CODE(bref.pack(cell_sel_info.q_rx_lev_min_offset_present, 1));
  HANDLE_CODE(pack_integer(bref, cell_sel_info.q_rx_lev_min, (int8_t)-70, (int8_t)-22));
  if (cell_sel_info.q_rx_lev_min_offset_present) {
    HANDLE_CODE(pack_integer(bref, cell_sel_info.q_rx_lev_min_offset, (uint8_t)1u, (uint8_t)8u));
  }
  if (p_max_present) {
    HANDLE_CODE(pack_integer(bref, p_max, (int8_t)-30, (int8_t)33));
  }
  HANDLE_CODE(pack_integer(bref, freq_band_ind, (uint8_t)1u, (uint8_t)64u));
  HANDLE_CODE(pack_dyn_seq_of(bref, sched_info_list, 1, 32));
  if (tdd_cfg_present) {
    HANDLE_CODE(tdd_cfg.pack(bref));
  }
  HANDLE_CODE(si_win_len.pack(bref));
  HANDLE_CODE(pack_integer(bref, sys_info_value_tag, (uint8_t)0u, (uint8_t)31u));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sib_type1_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(p_max_present, 1));
  HANDLE_CODE(bref.unpack(tdd_cfg_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.unpack(cell_access_related_info.csg_id_present, 1));
  HANDLE_CODE(unpack_dyn_seq_of(cell_access_related_info.plmn_id_list, bref, 1, 6));
  HANDLE_CODE(cell_access_related_info.tac.unpack(bref));
  HANDLE_CODE(cell_access_related_info.cell_id.unpack(bref));
  HANDLE_CODE(cell_access_related_info.cell_barred.unpack(bref));
  HANDLE_CODE(cell_access_related_info.intra_freq_resel.unpack(bref));
  HANDLE_CODE(bref.unpack(cell_access_related_info.csg_ind, 1));
  if (cell_access_related_info.csg_id_present) {
    HANDLE_CODE(cell_access_related_info.csg_id.unpack(bref));
  }
  HANDLE_CODE(bref.unpack(cell_sel_info.q_rx_lev_min_offset_present, 1));
  HANDLE_CODE(unpack_integer(cell_sel_info.q_rx_lev_min, bref, (int8_t)-70, (int8_t)-22));
  if (cell_sel_info.q_rx_lev_min_offset_present) {
    HANDLE_CODE(unpack_integer(cell_sel_info.q_rx_lev_min_offset, bref, (uint8_t)1u, (uint8_t)8u));
  }
  if (p_max_present) {
    HANDLE_CODE(unpack_integer(p_max, bref, (int8_t)-30, (int8_t)33));
  }
  HANDLE_CODE(unpack_integer(freq_band_ind, bref, (uint8_t)1u, (uint8_t)64u));
  HANDLE_CODE(unpack_dyn_seq_of(sched_info_list, bref, 1, 32));
  if (tdd_cfg_present) {
    HANDLE_CODE(tdd_cfg.unpack(bref));
  }
  HANDLE_CODE(si_win_len.unpack(bref));
  HANDLE_CODE(unpack_integer(sys_info_value_tag, bref, (uint8_t)0u, (uint8_t)31u));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sib_type1_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("cellAccessRelatedInfo");
  j.start_obj();
  j.start_array("plmn-IdentityList");
  for (const auto& e1 : cell_access_related_info.plmn_id_list) {
    e1.to_json(j);
  }
  j.end_array();
  j.write_str("trackingAreaCode", cell_access_related_info.tac.to_string());
  j.write_str("cellIdentity", cell_access_related_info.cell_id.to_string());
  j.write_str("cellBarred", cell_access_related_info.cell_barred.to_string());
  j.write_str("intraFreqReselection", cell_access_related_info.intra_freq_resel.to_string());
  j.write_bool("csg-Indication", cell_access_related_info.csg_ind);
  if (cell_access_related_info.csg_id_present) {
    j.write_str("csg-Identity", cell_access_related_info.csg_id.to_string());
  }
  j.end_obj();
  j.write_fieldname("cellSelectionInfo");
  j.start_obj();
  j.write_int("q-RxLevMin", cell_sel_info.q_rx_lev_min);
  if (cell_sel_info.q_rx_lev_min_offset_present) {
    j.write_int("q-RxLevMinOffset", cell_sel_info.q_rx_lev_min_offset);
  }
  j.end_obj();
  if (p_max_present) {
    j.write_int("p-Max", p_max);
  }
  j.write_int("freqBandIndicator", freq_band_ind);
  j.start_array("schedulingInfoList");
  for (const auto& e1 : sched_info_list) {
    e1.to_json(j);
  }
  j.end_array();
  if (tdd_cfg_present) {
    j.write_fieldname("tdd-Config");
    tdd_cfg.to_json(j);
  }
  j.write_str("si-WindowLength", si_win_len.to_string());
  j.write_int("systemInfoValueTag", sys_info_value_tag);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// BCCH-DL-SCH-MessageType ::= CHOICE
void bcch_dl_sch_msg_type_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void bcch_dl_sch_msg_type_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      break;
    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.get<c1_c_>().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;
  }
  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.get<c1_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<sys_info_s>();
      break;
    case types::sib_type1:
      c.destroy<sib_type1_s>();
      break;
    default:
      break;
  }
}
void bcch_dl_sch_msg_type_c::c1_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sys_info:
      c.init<sys_info_s>();
      break;
    case types::sib_type1:
      c.init<sib_type1_s>();
      break;
    case types::nulltype:
      break;
    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<sys_info_s>());
      break;
    case types::sib_type1:
      c.init(other.c.get<sib_type1_s>());
      break;
    case types::nulltype:
      break;
    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<sys_info_s>());
      break;
    case types::sib_type1:
      c.set(other.c.get<sib_type1_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_c::c1_c_");
  }

  return *this;
}
void bcch_dl_sch_msg_type_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sys_info:
      j.write_fieldname("systemInformation");
      c.get<sys_info_s>().to_json(j);
      break;
    case types::sib_type1:
      j.write_fieldname("systemInformationBlockType1");
      c.get<sib_type1_s>().to_json(j);
      break;
    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<sys_info_s>().pack(bref));
      break;
    case types::sib_type1:
      HANDLE_CODE(c.get<sib_type1_s>().pack(bref));
      break;
    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<sys_info_s>().unpack(bref));
      break;
    case types::sib_type1:
      HANDLE_CODE(c.get<sib_type1_s>().unpack(bref));
      break;
    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::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void bcch_dl_sch_msg_type_br_r13_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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");
  }
}
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<c1_c_>());
      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");
  }
}
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)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::c1:
      c.set(other.c.get<c1_c_>());
      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");
  }

  return *this;
}
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.get<c1_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      break;
    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.get<c1_c_>().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;
  }
  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.get<c1_c_>().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;
  }
  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<sys_info_br_r13_s>();
      break;
    case types::sib_type1_br_r13:
      c.destroy<sib_type1_br_r13_s>();
      break;
    default:
      break;
  }
}
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<sys_info_br_r13_s>();
      break;
    case types::sib_type1_br_r13:
      c.init<sib_type1_br_r13_s>();
      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<sys_info_br_r13_s>());
      break;
    case types::sib_type1_br_r13:
      c.init(other.c.get<sib_type1_br_r13_s>());
      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_& 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<sys_info_br_r13_s>());
      break;
    case types::sib_type1_br_r13:
      c.set(other.c.get<sib_type1_br_r13_s>());
      break;
    case types::nulltype:
      break;
    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<sys_info_br_r13_s>().to_json(j);
      break;
    case types::sib_type1_br_r13:
      j.write_fieldname("systemInformationBlockType1-BR-r13");
      c.get<sib_type1_br_r13_s>().to_json(j);
      break;
    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<sys_info_br_r13_s>().pack(bref));
      break;
    case types::sib_type1_br_r13:
      HANDLE_CODE(c.get<sib_type1_br_r13_s>().pack(bref));
      break;
    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<sys_info_br_r13_s>().unpack(bref));
      break;
    case types::sib_type1_br_r13:
      HANDLE_CODE(c.get<sib_type1_br_r13_s>().unpack(bref));
      break;
    default:
      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();
}

// 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();
}

// 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();
}

// 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<uint16_t>(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)
{
  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<uint16_t>(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;
}
void sib_type1_mbms_r14_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);
    }
    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();
}

// BCCH-DL-SCH-MessageType-MBMS-r14 ::= CHOICE
void bcch_dl_sch_msg_type_mbms_r14_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE bcch_dl_sch_msg_type_mbms_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void bcch_dl_sch_msg_type_mbms_r14_c::c1_c_::destroy_()
{
  switch (type_) {
    case types::sys_info_mbms_r14:
      c.destroy<sys_info_mbms_r14_s>();
      break;
    case types::sib_type1_mbms_r14:
      c.destroy<sib_type1_mbms_r14_s>();
      break;
    default:
      break;
  }
}
void bcch_dl_sch_msg_type_mbms_r14_c::c1_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sys_info_mbms_r14:
      c.init<sys_info_mbms_r14_s>();
      break;
    case types::sib_type1_mbms_r14:
      c.init<sib_type1_mbms_r14_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c::c1_c_");
  }
}
bcch_dl_sch_msg_type_mbms_r14_c::c1_c_::c1_c_(const bcch_dl_sch_msg_type_mbms_r14_c::c1_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sys_info_mbms_r14:
      c.init(other.c.get<sys_info_mbms_r14_s>());
      break;
    case types::sib_type1_mbms_r14:
      c.init(other.c.get<sib_type1_mbms_r14_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c::c1_c_");
  }
}
bcch_dl_sch_msg_type_mbms_r14_c::c1_c_& bcch_dl_sch_msg_type_mbms_r14_c::c1_c_::
                                        operator=(const bcch_dl_sch_msg_type_mbms_r14_c::c1_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sys_info_mbms_r14:
      c.set(other.c.get<sys_info_mbms_r14_s>());
      break;
    case types::sib_type1_mbms_r14:
      c.set(other.c.get<sib_type1_mbms_r14_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c::c1_c_");
  }

  return *this;
}
void bcch_dl_sch_msg_type_mbms_r14_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sys_info_mbms_r14:
      j.write_fieldname("systemInformation-MBMS-r14");
      c.get<sys_info_mbms_r14_s>().to_json(j);
      break;
    case types::sib_type1_mbms_r14:
      j.write_fieldname("systemInformationBlockType1-MBMS-r14");
      c.get<sib_type1_mbms_r14_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE bcch_dl_sch_msg_type_mbms_r14_c::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sys_info_mbms_r14:
      HANDLE_CODE(c.get<sys_info_mbms_r14_s>().pack(bref));
      break;
    case types::sib_type1_mbms_r14:
      HANDLE_CODE(c.get<sib_type1_mbms_r14_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE bcch_dl_sch_msg_type_mbms_r14_c::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sys_info_mbms_r14:
      HANDLE_CODE(c.get<sys_info_mbms_r14_s>().unpack(bref));
      break;
    case types::sib_type1_mbms_r14:
      HANDLE_CODE(c.get<sib_type1_mbms_r14_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "bcch_dl_sch_msg_type_mbms_r14_c::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// BCCH-DL-SCH-Message-MBMS ::= SEQUENCE
SRSASN_CODE bcch_dl_sch_msg_mbms_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE bcch_dl_sch_msg_mbms_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void bcch_dl_sch_msg_mbms_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("BCCH-DL-SCH-Message-MBMS");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// P-C-AndCBSR-r13 ::= SEQUENCE
SRSASN_CODE p_c_and_cbsr_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, p_c_r13, (int8_t)-8, (int8_t)15));
  HANDLE_CODE(cbsr_sel_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE p_c_and_cbsr_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(p_c_r13, bref, (int8_t)-8, (int8_t)15));
  HANDLE_CODE(cbsr_sel_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void p_c_and_cbsr_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p-C-r13", p_c_r13);
  j.write_fieldname("cbsr-Selection-r13");
  cbsr_sel_r13.to_json(j);
  j.end_obj();
}

void p_c_and_cbsr_r13_s::cbsr_sel_r13_c_::destroy_()
{
  switch (type_) {
    case types::non_precoded_r13:
      c.destroy<non_precoded_r13_s_>();
      break;
    case types::bf_k1a_r13:
      c.destroy<bf_k1a_r13_s_>();
      break;
    case types::bf_kn_r13:
      c.destroy<bf_kn_r13_s_>();
      break;
    default:
      break;
  }
}
void p_c_and_cbsr_r13_s::cbsr_sel_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::non_precoded_r13:
      c.init<non_precoded_r13_s_>();
      break;
    case types::bf_k1a_r13:
      c.init<bf_k1a_r13_s_>();
      break;
    case types::bf_kn_r13:
      c.init<bf_kn_r13_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "p_c_and_cbsr_r13_s::cbsr_sel_r13_c_");
  }
}
p_c_and_cbsr_r13_s::cbsr_sel_r13_c_::cbsr_sel_r13_c_(const p_c_and_cbsr_r13_s::cbsr_sel_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::non_precoded_r13:
      c.init(other.c.get<non_precoded_r13_s_>());
      break;
    case types::bf_k1a_r13:
      c.init(other.c.get<bf_k1a_r13_s_>());
      break;
    case types::bf_kn_r13:
      c.init(other.c.get<bf_kn_r13_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "p_c_and_cbsr_r13_s::cbsr_sel_r13_c_");
  }
}
p_c_and_cbsr_r13_s::cbsr_sel_r13_c_& p_c_and_cbsr_r13_s::cbsr_sel_r13_c_::
                                     operator=(const p_c_and_cbsr_r13_s::cbsr_sel_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::non_precoded_r13:
      c.set(other.c.get<non_precoded_r13_s_>());
      break;
    case types::bf_k1a_r13:
      c.set(other.c.get<bf_k1a_r13_s_>());
      break;
    case types::bf_kn_r13:
      c.set(other.c.get<bf_kn_r13_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "p_c_and_cbsr_r13_s::cbsr_sel_r13_c_");
  }

  return *this;
}
void p_c_and_cbsr_r13_s::cbsr_sel_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::non_precoded_r13:
      j.write_fieldname("nonPrecoded-r13");
      j.start_obj();
      j.write_str("codebookSubsetRestriction1-r13",
                  c.get<non_precoded_r13_s_>().codebook_subset_restrict1_r13.to_string());
      j.write_str("codebookSubsetRestriction2-r13",
                  c.get<non_precoded_r13_s_>().codebook_subset_restrict2_r13.to_string());
      j.end_obj();
      break;
    case types::bf_k1a_r13:
      j.write_fieldname("beamformedK1a-r13");
      j.start_obj();
      j.write_str("codebookSubsetRestriction3-r13", c.get<bf_k1a_r13_s_>().codebook_subset_restrict3_r13.to_string());
      j.end_obj();
      break;
    case types::bf_kn_r13:
      j.write_fieldname("beamformedKN-r13");
      j.start_obj();
      j.write_str("codebookSubsetRestriction-r13", c.get<bf_kn_r13_s_>().codebook_subset_restrict_r13.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "p_c_and_cbsr_r13_s::cbsr_sel_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE p_c_and_cbsr_r13_s::cbsr_sel_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::non_precoded_r13:
      HANDLE_CODE(c.get<non_precoded_r13_s_>().codebook_subset_restrict1_r13.pack(bref));
      HANDLE_CODE(c.get<non_precoded_r13_s_>().codebook_subset_restrict2_r13.pack(bref));
      break;
    case types::bf_k1a_r13:
      HANDLE_CODE(c.get<bf_k1a_r13_s_>().codebook_subset_restrict3_r13.pack(bref));
      break;
    case types::bf_kn_r13:
      HANDLE_CODE(c.get<bf_kn_r13_s_>().codebook_subset_restrict_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "p_c_and_cbsr_r13_s::cbsr_sel_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE p_c_and_cbsr_r13_s::cbsr_sel_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::non_precoded_r13:
      HANDLE_CODE(c.get<non_precoded_r13_s_>().codebook_subset_restrict1_r13.unpack(bref));
      HANDLE_CODE(c.get<non_precoded_r13_s_>().codebook_subset_restrict2_r13.unpack(bref));
      break;
    case types::bf_k1a_r13:
      HANDLE_CODE(c.get<bf_k1a_r13_s_>().codebook_subset_restrict3_r13.unpack(bref));
      break;
    case types::bf_kn_r13:
      HANDLE_CODE(c.get<bf_kn_r13_s_>().codebook_subset_restrict_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "p_c_and_cbsr_r13_s::cbsr_sel_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-Config-NZP-v1430 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_nzp_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tx_comb_r14_present, 1));
  HANDLE_CODE(bref.pack(freq_density_r14_present, 1));

  if (tx_comb_r14_present) {
    HANDLE_CODE(pack_integer(bref, tx_comb_r14, (uint8_t)0u, (uint8_t)2u));
  }
  if (freq_density_r14_present) {
    HANDLE_CODE(freq_density_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_nzp_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tx_comb_r14_present, 1));
  HANDLE_CODE(bref.unpack(freq_density_r14_present, 1));

  if (tx_comb_r14_present) {
    HANDLE_CODE(unpack_integer(tx_comb_r14, bref, (uint8_t)0u, (uint8_t)2u));
  }
  if (freq_density_r14_present) {
    HANDLE_CODE(freq_density_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_nzp_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tx_comb_r14_present) {
    j.write_int("transmissionComb-r14", tx_comb_r14);
  }
  if (freq_density_r14_present) {
    j.write_str("frequencyDensity-r14", freq_density_r14.to_string());
  }
  j.end_obj();
}

// CSI-RS-ConfigNZP-Activation-r14 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_nzp_activation_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(csi_rs_nzp_mode_r14.pack(bref));
  HANDLE_CODE(pack_integer(bref, activ_res_r14, (uint8_t)0u, (uint8_t)4u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_nzp_activation_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(csi_rs_nzp_mode_r14.unpack(bref));
  HANDLE_CODE(unpack_integer(activ_res_r14, bref, (uint8_t)0u, (uint8_t)4u));

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_nzp_activation_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("csi-RS-NZP-mode-r14", csi_rs_nzp_mode_r14.to_string());
  j.write_int("activatedResources-r14", activ_res_r14);
  j.end_obj();
}

// CSI-RS-ConfigNZP-r11 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_nzp_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(qcl_crs_info_r11_present, 1));

  HANDLE_CODE(pack_integer(bref, csi_rs_cfg_nzp_id_r11, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(ant_ports_count_r11.pack(bref));
  HANDLE_CODE(pack_integer(bref, res_cfg_r11, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, sf_cfg_r11, (uint8_t)0u, (uint8_t)154u));
  HANDLE_CODE(pack_integer(bref, scrambling_id_r11, (uint16_t)0u, (uint16_t)503u));
  if (qcl_crs_info_r11_present) {
    HANDLE_CODE(bref.pack(qcl_crs_info_r11.mbsfn_sf_cfg_list_r11_present, 1));
    HANDLE_CODE(pack_integer(bref, qcl_crs_info_r11.qcl_scrambling_id_r11, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(qcl_crs_info_r11.crs_ports_count_r11.pack(bref));
    if (qcl_crs_info_r11.mbsfn_sf_cfg_list_r11_present) {
      HANDLE_CODE(qcl_crs_info_r11.mbsfn_sf_cfg_list_r11.pack(bref));
    }
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= csi_rs_cfg_nzp_id_v1310_present;
    group_flags[1] |= tx_comb_r14_present;
    group_flags[1] |= freq_density_r14_present;
    group_flags[2] |= mbsfn_sf_cfg_list_v1430.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_id_v1310_present, 1));
      if (csi_rs_cfg_nzp_id_v1310_present) {
        HANDLE_CODE(pack_integer(bref, csi_rs_cfg_nzp_id_v1310, (uint8_t)4u, (uint8_t)24u));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(tx_comb_r14_present, 1));
      HANDLE_CODE(bref.pack(freq_density_r14_present, 1));
      if (tx_comb_r14_present) {
        HANDLE_CODE(pack_integer(bref, tx_comb_r14, (uint8_t)0u, (uint8_t)2u));
      }
      if (freq_density_r14_present) {
        HANDLE_CODE(freq_density_r14.pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mbsfn_sf_cfg_list_v1430.is_present(), 1));
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(mbsfn_sf_cfg_list_v1430->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_nzp_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(qcl_crs_info_r11_present, 1));

  HANDLE_CODE(unpack_integer(csi_rs_cfg_nzp_id_r11, bref, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(ant_ports_count_r11.unpack(bref));
  HANDLE_CODE(unpack_integer(res_cfg_r11, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(sf_cfg_r11, bref, (uint8_t)0u, (uint8_t)154u));
  HANDLE_CODE(unpack_integer(scrambling_id_r11, bref, (uint16_t)0u, (uint16_t)503u));
  if (qcl_crs_info_r11_present) {
    HANDLE_CODE(bref.unpack(qcl_crs_info_r11.mbsfn_sf_cfg_list_r11_present, 1));
    HANDLE_CODE(unpack_integer(qcl_crs_info_r11.qcl_scrambling_id_r11, bref, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(qcl_crs_info_r11.crs_ports_count_r11.unpack(bref));
    if (qcl_crs_info_r11.mbsfn_sf_cfg_list_r11_present) {
      HANDLE_CODE(qcl_crs_info_r11.mbsfn_sf_cfg_list_r11.unpack(bref));
    }
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_id_v1310_present, 1));
      if (csi_rs_cfg_nzp_id_v1310_present) {
        HANDLE_CODE(unpack_integer(csi_rs_cfg_nzp_id_v1310, bref, (uint8_t)4u, (uint8_t)24u));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(tx_comb_r14_present, 1));
      HANDLE_CODE(bref.unpack(freq_density_r14_present, 1));
      if (tx_comb_r14_present) {
        HANDLE_CODE(unpack_integer(tx_comb_r14, bref, (uint8_t)0u, (uint8_t)2u));
      }
      if (freq_density_r14_present) {
        HANDLE_CODE(freq_density_r14.unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool mbsfn_sf_cfg_list_v1430_present;
      HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_list_v1430_present, 1));
      mbsfn_sf_cfg_list_v1430.set_present(mbsfn_sf_cfg_list_v1430_present);
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(mbsfn_sf_cfg_list_v1430->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void csi_rs_cfg_nzp_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("csi-RS-ConfigNZPId-r11", csi_rs_cfg_nzp_id_r11);
  j.write_str("antennaPortsCount-r11", ant_ports_count_r11.to_string());
  j.write_int("resourceConfig-r11", res_cfg_r11);
  j.write_int("subframeConfig-r11", sf_cfg_r11);
  j.write_int("scramblingIdentity-r11", scrambling_id_r11);
  if (qcl_crs_info_r11_present) {
    j.write_fieldname("qcl-CRS-Info-r11");
    j.start_obj();
    j.write_int("qcl-ScramblingIdentity-r11", qcl_crs_info_r11.qcl_scrambling_id_r11);
    j.write_str("crs-PortsCount-r11", qcl_crs_info_r11.crs_ports_count_r11.to_string());
    if (qcl_crs_info_r11.mbsfn_sf_cfg_list_r11_present) {
      j.write_fieldname("mbsfn-SubframeConfigList-r11");
      qcl_crs_info_r11.mbsfn_sf_cfg_list_r11.to_json(j);
    }
    j.end_obj();
  }
  if (ext) {
    if (csi_rs_cfg_nzp_id_v1310_present) {
      j.write_int("csi-RS-ConfigNZPId-v1310", csi_rs_cfg_nzp_id_v1310);
    }
    if (tx_comb_r14_present) {
      j.write_int("transmissionComb-r14", tx_comb_r14);
    }
    if (freq_density_r14_present) {
      j.write_str("frequencyDensity-r14", freq_density_r14.to_string());
    }
    if (mbsfn_sf_cfg_list_v1430.is_present()) {
      j.write_fieldname("mbsfn-SubframeConfigList-v1430");
      mbsfn_sf_cfg_list_v1430->to_json(j);
    }
  }
  j.end_obj();
}

void csi_rs_cfg_nzp_r11_s::qcl_crs_info_r11_s_::mbsfn_sf_cfg_list_r11_c_::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_nzp_r11_s::qcl_crs_info_r11_s_::mbsfn_sf_cfg_list_r11_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("subframeConfigList");
      for (const auto& e1 : c.sf_cfg_list) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_r11_s::qcl_crs_info_r11_s_::mbsfn_sf_cfg_list_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_nzp_r11_s::qcl_crs_info_r11_s_::mbsfn_sf_cfg_list_r11_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.sf_cfg_list, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_r11_s::qcl_crs_info_r11_s_::mbsfn_sf_cfg_list_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_nzp_r11_s::qcl_crs_info_r11_s_::mbsfn_sf_cfg_list_r11_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.sf_cfg_list, bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_r11_s::qcl_crs_info_r11_s_::mbsfn_sf_cfg_list_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void csi_rs_cfg_nzp_r11_s::mbsfn_sf_cfg_list_v1430_c_::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_nzp_r11_s::mbsfn_sf_cfg_list_v1430_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("subframeConfigList-v1430");
      for (const auto& e1 : c.sf_cfg_list_v1430) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_r11_s::mbsfn_sf_cfg_list_v1430_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_nzp_r11_s::mbsfn_sf_cfg_list_v1430_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.sf_cfg_list_v1430, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_r11_s::mbsfn_sf_cfg_list_v1430_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_nzp_r11_s::mbsfn_sf_cfg_list_v1430_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.sf_cfg_list_v1430, bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_r11_s::mbsfn_sf_cfg_list_v1430_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// NZP-ResourceConfig-r13 ::= SEQUENCE
SRSASN_CODE nzp_res_cfg_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, res_cfg_r13, (uint8_t)0u, (uint8_t)31u));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= tx_comb_r14_present;
    group_flags[0] |= freq_density_r14_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(tx_comb_r14_present, 1));
      HANDLE_CODE(bref.pack(freq_density_r14_present, 1));
      if (tx_comb_r14_present) {
        HANDLE_CODE(pack_integer(bref, tx_comb_r14, (uint8_t)0u, (uint8_t)2u));
      }
      if (freq_density_r14_present) {
        HANDLE_CODE(freq_density_r14.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE nzp_res_cfg_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(res_cfg_r13, bref, (uint8_t)0u, (uint8_t)31u));

  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(tx_comb_r14_present, 1));
      HANDLE_CODE(bref.unpack(freq_density_r14_present, 1));
      if (tx_comb_r14_present) {
        HANDLE_CODE(unpack_integer(tx_comb_r14, bref, (uint8_t)0u, (uint8_t)2u));
      }
      if (freq_density_r14_present) {
        HANDLE_CODE(freq_density_r14.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void nzp_res_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("resourceConfig-r13", res_cfg_r13);
  if (ext) {
    if (tx_comb_r14_present) {
      j.write_int("transmissionComb-r14", tx_comb_r14);
    }
    if (freq_density_r14_present) {
      j.write_str("frequencyDensity-r14", freq_density_r14.to_string());
    }
  }
  j.end_obj();
}

// P-C-AndCBSR-r15 ::= SEQUENCE
SRSASN_CODE p_c_and_cbsr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, p_c_r15, (int8_t)-8, (int8_t)15));
  HANDLE_CODE(codebook_subset_restrict4_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE p_c_and_cbsr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(p_c_r15, bref, (int8_t)-8, (int8_t)15));
  HANDLE_CODE(codebook_subset_restrict4_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void p_c_and_cbsr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p-C-r15", p_c_r15);
  j.write_str("codebookSubsetRestriction4-r15", codebook_subset_restrict4_r15.to_string());
  j.end_obj();
}

// CSI-RS-ConfigBeamformed-r14 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_bf_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_id_list_ext_r14_present, 1));
  HANDLE_CODE(bref.pack(csi_im_cfg_id_list_r14_present, 1));
  HANDLE_CODE(bref.pack(p_c_and_cbsr_per_res_cfg_list_r14_present, 1));
  HANDLE_CODE(bref.pack(ace_for4_tx_per_res_cfg_list_r14_present, 1));
  HANDLE_CODE(bref.pack(alt_codebook_enabled_bf_r14_present, 1));
  HANDLE_CODE(bref.pack(ch_meas_restrict_r14_present, 1));
  HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_ap_list_r14_present, 1));
  HANDLE_CODE(bref.pack(nzp_res_cfg_original_v1430_present, 1));
  HANDLE_CODE(bref.pack(csi_rs_nzp_activation_r14_present, 1));

  if (csi_rs_cfg_nzp_id_list_ext_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_rs_cfg_nzp_id_list_ext_r14, 1, 7, integer_packer<uint8_t>(1, 24)));
  }
  if (csi_im_cfg_id_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_im_cfg_id_list_r14, 1, 8, integer_packer<uint8_t>(1, 24)));
  }
  if (p_c_and_cbsr_per_res_cfg_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, p_c_and_cbsr_per_res_cfg_list_r14, 1, 8, SeqOfPacker<Packer>(1, 2, Packer())));
  }
  if (ace_for4_tx_per_res_cfg_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, ace_for4_tx_per_res_cfg_list_r14, 1, 7, BitPacker(1)));
  }
  if (csi_rs_cfg_nzp_ap_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_rs_cfg_nzp_ap_list_r14, 1, 8));
  }
  if (nzp_res_cfg_original_v1430_present) {
    HANDLE_CODE(nzp_res_cfg_original_v1430.pack(bref));
  }
  if (csi_rs_nzp_activation_r14_present) {
    HANDLE_CODE(csi_rs_nzp_activation_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_bf_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_id_list_ext_r14_present, 1));
  HANDLE_CODE(bref.unpack(csi_im_cfg_id_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(p_c_and_cbsr_per_res_cfg_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(ace_for4_tx_per_res_cfg_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(alt_codebook_enabled_bf_r14_present, 1));
  HANDLE_CODE(bref.unpack(ch_meas_restrict_r14_present, 1));
  HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_ap_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(nzp_res_cfg_original_v1430_present, 1));
  HANDLE_CODE(bref.unpack(csi_rs_nzp_activation_r14_present, 1));

  if (csi_rs_cfg_nzp_id_list_ext_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_rs_cfg_nzp_id_list_ext_r14, bref, 1, 7, integer_packer<uint8_t>(1, 24)));
  }
  if (csi_im_cfg_id_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_im_cfg_id_list_r14, bref, 1, 8, integer_packer<uint8_t>(1, 24)));
  }
  if (p_c_and_cbsr_per_res_cfg_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(p_c_and_cbsr_per_res_cfg_list_r14, bref, 1, 8, SeqOfPacker<Packer>(1, 2, Packer())));
  }
  if (ace_for4_tx_per_res_cfg_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(ace_for4_tx_per_res_cfg_list_r14, bref, 1, 7, BitPacker(1)));
  }
  if (csi_rs_cfg_nzp_ap_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_rs_cfg_nzp_ap_list_r14, bref, 1, 8));
  }
  if (nzp_res_cfg_original_v1430_present) {
    HANDLE_CODE(nzp_res_cfg_original_v1430.unpack(bref));
  }
  if (csi_rs_nzp_activation_r14_present) {
    HANDLE_CODE(csi_rs_nzp_activation_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_bf_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_rs_cfg_nzp_id_list_ext_r14_present) {
    j.start_array("csi-RS-ConfigNZPIdListExt-r14");
    for (const auto& e1 : csi_rs_cfg_nzp_id_list_ext_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (csi_im_cfg_id_list_r14_present) {
    j.start_array("csi-IM-ConfigIdList-r14");
    for (const auto& e1 : csi_im_cfg_id_list_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (p_c_and_cbsr_per_res_cfg_list_r14_present) {
    j.start_array("p-C-AndCBSR-PerResourceConfigList-r14");
    for (const auto& e1 : p_c_and_cbsr_per_res_cfg_list_r14) {
      j.start_array();
      for (const auto& e2 : e1) {
        e2.to_json(j);
      }
      j.end_array();
    }
    j.end_array();
  }
  if (ace_for4_tx_per_res_cfg_list_r14_present) {
    j.start_array("ace-For4Tx-PerResourceConfigList-r14");
    for (const auto& e1 : ace_for4_tx_per_res_cfg_list_r14) {
      j.write_bool(e1);
    }
    j.end_array();
  }
  if (alt_codebook_enabled_bf_r14_present) {
    j.write_str("alternativeCodebookEnabledBeamformed-r14", "true");
  }
  if (ch_meas_restrict_r14_present) {
    j.write_str("channelMeasRestriction-r14", "on");
  }
  if (csi_rs_cfg_nzp_ap_list_r14_present) {
    j.start_array("csi-RS-ConfigNZP-ApList-r14");
    for (const auto& e1 : csi_rs_cfg_nzp_ap_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (nzp_res_cfg_original_v1430_present) {
    j.write_fieldname("nzp-ResourceConfigOriginal-v1430");
    nzp_res_cfg_original_v1430.to_json(j);
  }
  if (csi_rs_nzp_activation_r14_present) {
    j.write_fieldname("csi-RS-NZP-Activation-r14");
    csi_rs_nzp_activation_r14.to_json(j);
  }
  j.end_obj();
}

// CSI-RS-ConfigNZP-EMIMO-r13 ::= CHOICE
void csi_rs_cfg_nzp_emimo_r13_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_nzp_emimo_r13_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("nzp-resourceConfigList-r13");
      for (const auto& e1 : c.nzp_res_cfg_list_r13) {
        e1.to_json(j);
      }
      j.end_array();
      if (c.cdm_type_r13_present) {
        j.write_str("cdmType-r13", c.cdm_type_r13.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_emimo_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_nzp_emimo_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.cdm_type_r13_present, 1));
      HANDLE_CODE(pack_dyn_seq_of(bref, c.nzp_res_cfg_list_r13, 1, 2));
      if (c.cdm_type_r13_present) {
        HANDLE_CODE(c.cdm_type_r13.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_emimo_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_nzp_emimo_r13_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.cdm_type_r13_present, 1));
      HANDLE_CODE(unpack_dyn_seq_of(c.nzp_res_cfg_list_r13, bref, 1, 2));
      if (c.cdm_type_r13_present) {
        HANDLE_CODE(c.cdm_type_r13.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_nzp_emimo_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-ConfigNZP-EMIMO-v1430 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_nzp_emimo_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cdm_type_v1430_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, nzp_res_cfg_list_ext_r14, 0, 4));

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_nzp_emimo_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cdm_type_v1430_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(nzp_res_cfg_list_ext_r14, bref, 0, 4));

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_nzp_emimo_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("nzp-resourceConfigListExt-r14");
  for (const auto& e1 : nzp_res_cfg_list_ext_r14) {
    e1.to_json(j);
  }
  j.end_array();
  if (cdm_type_v1430_present) {
    j.write_str("cdmType-v1430", "cdm8");
  }
  j.end_obj();
}

// CSI-RS-ConfigBeamformed-r13 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_bf_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_id_list_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(csi_im_cfg_id_list_r13_present, 1));
  HANDLE_CODE(bref.pack(p_c_and_cbsr_per_res_cfg_list_r13_present, 1));
  HANDLE_CODE(bref.pack(ace_for4_tx_per_res_cfg_list_r13_present, 1));
  HANDLE_CODE(bref.pack(alt_codebook_enabled_bf_r13_present, 1));
  HANDLE_CODE(bref.pack(ch_meas_restrict_r13_present, 1));

  if (csi_rs_cfg_nzp_id_list_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_rs_cfg_nzp_id_list_ext_r13, 1, 7, integer_packer<uint8_t>(1, 24)));
  }
  if (csi_im_cfg_id_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_im_cfg_id_list_r13, 1, 8, integer_packer<uint8_t>(1, 24)));
  }
  if (p_c_and_cbsr_per_res_cfg_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, p_c_and_cbsr_per_res_cfg_list_r13, 1, 8, SeqOfPacker<Packer>(1, 2, Packer())));
  }
  if (ace_for4_tx_per_res_cfg_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, ace_for4_tx_per_res_cfg_list_r13, 1, 7, BitPacker(1)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_bf_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_id_list_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(csi_im_cfg_id_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(p_c_and_cbsr_per_res_cfg_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(ace_for4_tx_per_res_cfg_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(alt_codebook_enabled_bf_r13_present, 1));
  HANDLE_CODE(bref.unpack(ch_meas_restrict_r13_present, 1));

  if (csi_rs_cfg_nzp_id_list_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_rs_cfg_nzp_id_list_ext_r13, bref, 1, 7, integer_packer<uint8_t>(1, 24)));
  }
  if (csi_im_cfg_id_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_im_cfg_id_list_r13, bref, 1, 8, integer_packer<uint8_t>(1, 24)));
  }
  if (p_c_and_cbsr_per_res_cfg_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(p_c_and_cbsr_per_res_cfg_list_r13, bref, 1, 8, SeqOfPacker<Packer>(1, 2, Packer())));
  }
  if (ace_for4_tx_per_res_cfg_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(ace_for4_tx_per_res_cfg_list_r13, bref, 1, 7, BitPacker(1)));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_bf_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_rs_cfg_nzp_id_list_ext_r13_present) {
    j.start_array("csi-RS-ConfigNZPIdListExt-r13");
    for (const auto& e1 : csi_rs_cfg_nzp_id_list_ext_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (csi_im_cfg_id_list_r13_present) {
    j.start_array("csi-IM-ConfigIdList-r13");
    for (const auto& e1 : csi_im_cfg_id_list_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (p_c_and_cbsr_per_res_cfg_list_r13_present) {
    j.start_array("p-C-AndCBSR-PerResourceConfigList-r13");
    for (const auto& e1 : p_c_and_cbsr_per_res_cfg_list_r13) {
      j.start_array();
      for (const auto& e2 : e1) {
        e2.to_json(j);
      }
      j.end_array();
    }
    j.end_array();
  }
  if (ace_for4_tx_per_res_cfg_list_r13_present) {
    j.start_array("ace-For4Tx-PerResourceConfigList-r13");
    for (const auto& e1 : ace_for4_tx_per_res_cfg_list_r13) {
      j.write_bool(e1);
    }
    j.end_array();
  }
  if (alt_codebook_enabled_bf_r13_present) {
    j.write_str("alternativeCodebookEnabledBeamformed-r13", "true");
  }
  if (ch_meas_restrict_r13_present) {
    j.write_str("channelMeasRestriction-r13", "on");
  }
  j.end_obj();
}

// CSI-RS-ConfigBeamformed-v1430 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_bf_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_ap_list_r14_present, 1));
  HANDLE_CODE(bref.pack(nzp_res_cfg_original_v1430_present, 1));
  HANDLE_CODE(bref.pack(csi_rs_nzp_activation_r14_present, 1));

  if (csi_rs_cfg_nzp_ap_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_rs_cfg_nzp_ap_list_r14, 1, 8));
  }
  if (nzp_res_cfg_original_v1430_present) {
    HANDLE_CODE(nzp_res_cfg_original_v1430.pack(bref));
  }
  if (csi_rs_nzp_activation_r14_present) {
    HANDLE_CODE(csi_rs_nzp_activation_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_bf_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_ap_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(nzp_res_cfg_original_v1430_present, 1));
  HANDLE_CODE(bref.unpack(csi_rs_nzp_activation_r14_present, 1));

  if (csi_rs_cfg_nzp_ap_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_rs_cfg_nzp_ap_list_r14, bref, 1, 8));
  }
  if (nzp_res_cfg_original_v1430_present) {
    HANDLE_CODE(nzp_res_cfg_original_v1430.unpack(bref));
  }
  if (csi_rs_nzp_activation_r14_present) {
    HANDLE_CODE(csi_rs_nzp_activation_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_bf_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_rs_cfg_nzp_ap_list_r14_present) {
    j.start_array("csi-RS-ConfigNZP-ApList-r14");
    for (const auto& e1 : csi_rs_cfg_nzp_ap_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (nzp_res_cfg_original_v1430_present) {
    j.write_fieldname("nzp-ResourceConfigOriginal-v1430");
    nzp_res_cfg_original_v1430.to_json(j);
  }
  if (csi_rs_nzp_activation_r14_present) {
    j.write_fieldname("csi-RS-NZP-Activation-r14");
    csi_rs_nzp_activation_r14.to_json(j);
  }
  j.end_obj();
}

// CSI-RS-ConfigEMIMO2-r14 ::= CHOICE
void csi_rs_cfg_emimo2_r14_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_emimo2_r14_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo2_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo2_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo2_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo2_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo2_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-ConfigNonPrecoded-r13 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_non_precoded_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(p_c_and_cbsr_list_r13_present, 1));
  HANDLE_CODE(bref.pack(codebook_over_sampling_rate_cfg_o1_r13_present, 1));
  HANDLE_CODE(bref.pack(codebook_over_sampling_rate_cfg_o2_r13_present, 1));
  HANDLE_CODE(bref.pack(csi_im_cfg_id_list_r13_present, 1));
  HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_emimo_r13_present, 1));

  if (p_c_and_cbsr_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, p_c_and_cbsr_list_r13, 1, 2));
  }
  HANDLE_CODE(codebook_cfg_n1_r13.pack(bref));
  HANDLE_CODE(codebook_cfg_n2_r13.pack(bref));
  if (codebook_over_sampling_rate_cfg_o1_r13_present) {
    HANDLE_CODE(codebook_over_sampling_rate_cfg_o1_r13.pack(bref));
  }
  if (codebook_over_sampling_rate_cfg_o2_r13_present) {
    HANDLE_CODE(codebook_over_sampling_rate_cfg_o2_r13.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, codebook_cfg_r13, (uint8_t)1u, (uint8_t)4u));
  if (csi_im_cfg_id_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_im_cfg_id_list_r13, 1, 2, integer_packer<uint8_t>(1, 24)));
  }
  if (csi_rs_cfg_nzp_emimo_r13_present) {
    HANDLE_CODE(csi_rs_cfg_nzp_emimo_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_non_precoded_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(p_c_and_cbsr_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(codebook_over_sampling_rate_cfg_o1_r13_present, 1));
  HANDLE_CODE(bref.unpack(codebook_over_sampling_rate_cfg_o2_r13_present, 1));
  HANDLE_CODE(bref.unpack(csi_im_cfg_id_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_emimo_r13_present, 1));

  if (p_c_and_cbsr_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(p_c_and_cbsr_list_r13, bref, 1, 2));
  }
  HANDLE_CODE(codebook_cfg_n1_r13.unpack(bref));
  HANDLE_CODE(codebook_cfg_n2_r13.unpack(bref));
  if (codebook_over_sampling_rate_cfg_o1_r13_present) {
    HANDLE_CODE(codebook_over_sampling_rate_cfg_o1_r13.unpack(bref));
  }
  if (codebook_over_sampling_rate_cfg_o2_r13_present) {
    HANDLE_CODE(codebook_over_sampling_rate_cfg_o2_r13.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(codebook_cfg_r13, bref, (uint8_t)1u, (uint8_t)4u));
  if (csi_im_cfg_id_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_im_cfg_id_list_r13, bref, 1, 2, integer_packer<uint8_t>(1, 24)));
  }
  if (csi_rs_cfg_nzp_emimo_r13_present) {
    HANDLE_CODE(csi_rs_cfg_nzp_emimo_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_non_precoded_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (p_c_and_cbsr_list_r13_present) {
    j.start_array("p-C-AndCBSRList-r13");
    for (const auto& e1 : p_c_and_cbsr_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_str("codebookConfigN1-r13", codebook_cfg_n1_r13.to_string());
  j.write_str("codebookConfigN2-r13", codebook_cfg_n2_r13.to_string());
  if (codebook_over_sampling_rate_cfg_o1_r13_present) {
    j.write_str("codebookOverSamplingRateConfig-O1-r13", codebook_over_sampling_rate_cfg_o1_r13.to_string());
  }
  if (codebook_over_sampling_rate_cfg_o2_r13_present) {
    j.write_str("codebookOverSamplingRateConfig-O2-r13", codebook_over_sampling_rate_cfg_o2_r13.to_string());
  }
  j.write_int("codebookConfig-r13", codebook_cfg_r13);
  if (csi_im_cfg_id_list_r13_present) {
    j.start_array("csi-IM-ConfigIdList-r13");
    for (const auto& e1 : csi_im_cfg_id_list_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (csi_rs_cfg_nzp_emimo_r13_present) {
    j.write_fieldname("csi-RS-ConfigNZP-EMIMO-r13");
    csi_rs_cfg_nzp_emimo_r13.to_json(j);
  }
  j.end_obj();
}

// CSI-RS-ConfigNonPrecoded-v1430 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_non_precoded_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_emimo_v1430_present, 1));

  if (csi_rs_cfg_nzp_emimo_v1430_present) {
    HANDLE_CODE(csi_rs_cfg_nzp_emimo_v1430.pack(bref));
  }
  HANDLE_CODE(codebook_cfg_n1_v1430.pack(bref));
  HANDLE_CODE(codebook_cfg_n2_v1430.pack(bref));
  HANDLE_CODE(nzp_res_cfg_tm9_original_v1430.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_non_precoded_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_emimo_v1430_present, 1));

  if (csi_rs_cfg_nzp_emimo_v1430_present) {
    HANDLE_CODE(csi_rs_cfg_nzp_emimo_v1430.unpack(bref));
  }
  HANDLE_CODE(codebook_cfg_n1_v1430.unpack(bref));
  HANDLE_CODE(codebook_cfg_n2_v1430.unpack(bref));
  HANDLE_CODE(nzp_res_cfg_tm9_original_v1430.unpack(bref));

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_non_precoded_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_rs_cfg_nzp_emimo_v1430_present) {
    j.write_fieldname("csi-RS-ConfigNZP-EMIMO-v1430");
    csi_rs_cfg_nzp_emimo_v1430.to_json(j);
  }
  j.write_str("codebookConfigN1-v1430", codebook_cfg_n1_v1430.to_string());
  j.write_str("codebookConfigN2-v1430", codebook_cfg_n2_v1430.to_string());
  j.write_fieldname("nzp-ResourceConfigTM9-Original-v1430");
  nzp_res_cfg_tm9_original_v1430.to_json(j);
  j.end_obj();
}

// CSI-RS-ConfigNonPrecoded-v1480 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_non_precoded_v1480_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_emimo_v1480_present, 1));
  HANDLE_CODE(bref.pack(codebook_cfg_n1_v1480_present, 1));
  HANDLE_CODE(bref.pack(codebook_cfg_n2_r1480_present, 1));

  if (csi_rs_cfg_nzp_emimo_v1480_present) {
    HANDLE_CODE(csi_rs_cfg_nzp_emimo_v1480.pack(bref));
  }
  if (codebook_cfg_n1_v1480_present) {
    HANDLE_CODE(codebook_cfg_n1_v1480.pack(bref));
  }
  if (codebook_cfg_n2_r1480_present) {
    HANDLE_CODE(codebook_cfg_n2_r1480.pack(bref));
  }
  HANDLE_CODE(nzp_res_cfg_tm9_original_v1480.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_non_precoded_v1480_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_emimo_v1480_present, 1));
  HANDLE_CODE(bref.unpack(codebook_cfg_n1_v1480_present, 1));
  HANDLE_CODE(bref.unpack(codebook_cfg_n2_r1480_present, 1));

  if (csi_rs_cfg_nzp_emimo_v1480_present) {
    HANDLE_CODE(csi_rs_cfg_nzp_emimo_v1480.unpack(bref));
  }
  if (codebook_cfg_n1_v1480_present) {
    HANDLE_CODE(codebook_cfg_n1_v1480.unpack(bref));
  }
  if (codebook_cfg_n2_r1480_present) {
    HANDLE_CODE(codebook_cfg_n2_r1480.unpack(bref));
  }
  HANDLE_CODE(nzp_res_cfg_tm9_original_v1480.unpack(bref));

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_non_precoded_v1480_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_rs_cfg_nzp_emimo_v1480_present) {
    j.write_fieldname("csi-RS-ConfigNZP-EMIMO-v1480");
    csi_rs_cfg_nzp_emimo_v1480.to_json(j);
  }
  if (codebook_cfg_n1_v1480_present) {
    j.write_str("codebookConfigN1-v1480", codebook_cfg_n1_v1480.to_string());
  }
  if (codebook_cfg_n2_r1480_present) {
    j.write_str("codebookConfigN2-r1480", codebook_cfg_n2_r1480.to_string());
  }
  j.write_fieldname("nzp-ResourceConfigTM9-Original-v1480");
  nzp_res_cfg_tm9_original_v1480.to_json(j);
  j.end_obj();
}

// CSI-RS-ConfigNonPrecoded-v1530 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_non_precoded_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(p_c_and_cbsr_list_r15_present, 1));

  if (p_c_and_cbsr_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, p_c_and_cbsr_list_r15, 1, 2));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_non_precoded_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(p_c_and_cbsr_list_r15_present, 1));

  if (p_c_and_cbsr_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(p_c_and_cbsr_list_r15, bref, 1, 2));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_non_precoded_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (p_c_and_cbsr_list_r15_present) {
    j.start_array("p-C-AndCBSRList-r15");
    for (const auto& e1 : p_c_and_cbsr_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// P-C-AndCBSR-r11 ::= SEQUENCE
SRSASN_CODE p_c_and_cbsr_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, p_c_r11, (int8_t)-8, (int8_t)15));
  HANDLE_CODE(codebook_subset_restrict_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE p_c_and_cbsr_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(p_c_r11, bref, (int8_t)-8, (int8_t)15));
  HANDLE_CODE(codebook_subset_restrict_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void p_c_and_cbsr_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p-C-r11", p_c_r11);
  j.write_str("codebookSubsetRestriction-r11", codebook_subset_restrict_r11.to_string());
  j.end_obj();
}

// CQI-ReportAperiodicProc-r11 ::= SEQUENCE
SRSASN_CODE cqi_report_aperiodic_proc_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cqi_report_mode_aperiodic_r11.pack(bref));
  HANDLE_CODE(bref.pack(trigger01_r11, 1));
  HANDLE_CODE(bref.pack(trigger10_r11, 1));
  HANDLE_CODE(bref.pack(trigger11_r11, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_aperiodic_proc_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(cqi_report_mode_aperiodic_r11.unpack(bref));
  HANDLE_CODE(bref.unpack(trigger01_r11, 1));
  HANDLE_CODE(bref.unpack(trigger10_r11, 1));
  HANDLE_CODE(bref.unpack(trigger11_r11, 1));

  return SRSASN_SUCCESS;
}
void cqi_report_aperiodic_proc_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cqi-ReportModeAperiodic-r11", cqi_report_mode_aperiodic_r11.to_string());
  j.write_bool("trigger01-r11", trigger01_r11);
  j.write_bool("trigger10-r11", trigger10_r11);
  j.write_bool("trigger11-r11", trigger11_r11);
  j.end_obj();
}

// CQI-ReportAperiodicProc-v1310 ::= SEQUENCE
SRSASN_CODE cqi_report_aperiodic_proc_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(trigger001_r13, 1));
  HANDLE_CODE(bref.pack(trigger010_r13, 1));
  HANDLE_CODE(bref.pack(trigger011_r13, 1));
  HANDLE_CODE(bref.pack(trigger100_r13, 1));
  HANDLE_CODE(bref.pack(trigger101_r13, 1));
  HANDLE_CODE(bref.pack(trigger110_r13, 1));
  HANDLE_CODE(bref.pack(trigger111_r13, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_aperiodic_proc_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(trigger001_r13, 1));
  HANDLE_CODE(bref.unpack(trigger010_r13, 1));
  HANDLE_CODE(bref.unpack(trigger011_r13, 1));
  HANDLE_CODE(bref.unpack(trigger100_r13, 1));
  HANDLE_CODE(bref.unpack(trigger101_r13, 1));
  HANDLE_CODE(bref.unpack(trigger110_r13, 1));
  HANDLE_CODE(bref.unpack(trigger111_r13, 1));

  return SRSASN_SUCCESS;
}
void cqi_report_aperiodic_proc_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("trigger001-r13", trigger001_r13);
  j.write_bool("trigger010-r13", trigger010_r13);
  j.write_bool("trigger011-r13", trigger011_r13);
  j.write_bool("trigger100-r13", trigger100_r13);
  j.write_bool("trigger101-r13", trigger101_r13);
  j.write_bool("trigger110-r13", trigger110_r13);
  j.write_bool("trigger111-r13", trigger111_r13);
  j.end_obj();
}

// CQI-ReportBothProc-r11 ::= SEQUENCE
SRSASN_CODE cqi_report_both_proc_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ri_ref_csi_process_id_r11_present, 1));
  HANDLE_CODE(bref.pack(pmi_ri_report_r11_present, 1));

  if (ri_ref_csi_process_id_r11_present) {
    HANDLE_CODE(pack_integer(bref, ri_ref_csi_process_id_r11, (uint8_t)1u, (uint8_t)4u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_both_proc_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ri_ref_csi_process_id_r11_present, 1));
  HANDLE_CODE(bref.unpack(pmi_ri_report_r11_present, 1));

  if (ri_ref_csi_process_id_r11_present) {
    HANDLE_CODE(unpack_integer(ri_ref_csi_process_id_r11, bref, (uint8_t)1u, (uint8_t)4u));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_both_proc_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ri_ref_csi_process_id_r11_present) {
    j.write_int("ri-Ref-CSI-ProcessId-r11", ri_ref_csi_process_id_r11);
  }
  if (pmi_ri_report_r11_present) {
    j.write_str("pmi-RI-Report-r11", "setup");
  }
  j.end_obj();
}

// CRI-ReportConfig-r13 ::= CHOICE
void cri_report_cfg_r13_c::set(types::options e)
{
  type_ = e;
}
void cri_report_cfg_r13_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_int("cri-ConfigIndex-r13", c.cri_cfg_idx_r13);
      if (c.cri_cfg_idx2_r13_present) {
        j.write_int("cri-ConfigIndex2-r13", c.cri_cfg_idx2_r13);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cri_report_cfg_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE cri_report_cfg_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.cri_cfg_idx2_r13_present, 1));
      HANDLE_CODE(pack_integer(bref, c.cri_cfg_idx_r13, (uint16_t)0u, (uint16_t)1023u));
      if (c.cri_cfg_idx2_r13_present) {
        HANDLE_CODE(pack_integer(bref, c.cri_cfg_idx2_r13, (uint16_t)0u, (uint16_t)1023u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cri_report_cfg_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cri_report_cfg_r13_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.cri_cfg_idx2_r13_present, 1));
      HANDLE_CODE(unpack_integer(c.cri_cfg_idx_r13, bref, (uint16_t)0u, (uint16_t)1023u));
      if (c.cri_cfg_idx2_r13_present) {
        HANDLE_CODE(unpack_integer(c.cri_cfg_idx2_r13, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cri_report_cfg_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-ConfigEMIMO-Hybrid-r14 ::= CHOICE
void csi_rs_cfg_emimo_hybrid_r14_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_emimo_hybrid_r14_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.periodicity_offset_idx_r14_present) {
        j.write_int("periodicityOffsetIndex-r14", c.periodicity_offset_idx_r14);
      }
      if (c.emimo_type2_r14_present) {
        j.write_fieldname("eMIMO-Type2-r14");
        c.emimo_type2_r14.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_hybrid_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_hybrid_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.periodicity_offset_idx_r14_present, 1));
      HANDLE_CODE(bref.pack(c.emimo_type2_r14_present, 1));
      if (c.periodicity_offset_idx_r14_present) {
        HANDLE_CODE(pack_integer(bref, c.periodicity_offset_idx_r14, (uint16_t)0u, (uint16_t)1023u));
      }
      if (c.emimo_type2_r14_present) {
        HANDLE_CODE(c.emimo_type2_r14.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_hybrid_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_hybrid_r14_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.periodicity_offset_idx_r14_present, 1));
      HANDLE_CODE(bref.unpack(c.emimo_type2_r14_present, 1));
      if (c.periodicity_offset_idx_r14_present) {
        HANDLE_CODE(unpack_integer(c.periodicity_offset_idx_r14, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      if (c.emimo_type2_r14_present) {
        HANDLE_CODE(c.emimo_type2_r14.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_hybrid_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-ConfigEMIMO-r13 ::= CHOICE
void csi_rs_cfg_emimo_r13_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_emimo_r13_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void csi_rs_cfg_emimo_r13_c::setup_c_::destroy_()
{
  switch (type_) {
    case types::non_precoded_r13:
      c.destroy<csi_rs_cfg_non_precoded_r13_s>();
      break;
    case types::bf_r13:
      c.destroy<csi_rs_cfg_bf_r13_s>();
      break;
    default:
      break;
  }
}
void csi_rs_cfg_emimo_r13_c::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::non_precoded_r13:
      c.init<csi_rs_cfg_non_precoded_r13_s>();
      break;
    case types::bf_r13:
      c.init<csi_rs_cfg_bf_r13_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c::setup_c_");
  }
}
csi_rs_cfg_emimo_r13_c::setup_c_::setup_c_(const csi_rs_cfg_emimo_r13_c::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::non_precoded_r13:
      c.init(other.c.get<csi_rs_cfg_non_precoded_r13_s>());
      break;
    case types::bf_r13:
      c.init(other.c.get<csi_rs_cfg_bf_r13_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c::setup_c_");
  }
}
csi_rs_cfg_emimo_r13_c::setup_c_& csi_rs_cfg_emimo_r13_c::setup_c_::
                                  operator=(const csi_rs_cfg_emimo_r13_c::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::non_precoded_r13:
      c.set(other.c.get<csi_rs_cfg_non_precoded_r13_s>());
      break;
    case types::bf_r13:
      c.set(other.c.get<csi_rs_cfg_bf_r13_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c::setup_c_");
  }

  return *this;
}
void csi_rs_cfg_emimo_r13_c::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::non_precoded_r13:
      j.write_fieldname("nonPrecoded-r13");
      c.get<csi_rs_cfg_non_precoded_r13_s>().to_json(j);
      break;
    case types::bf_r13:
      j.write_fieldname("beamformed-r13");
      c.get<csi_rs_cfg_bf_r13_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_r13_c::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::non_precoded_r13:
      HANDLE_CODE(c.get<csi_rs_cfg_non_precoded_r13_s>().pack(bref));
      break;
    case types::bf_r13:
      HANDLE_CODE(c.get<csi_rs_cfg_bf_r13_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_r13_c::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::non_precoded_r13:
      HANDLE_CODE(c.get<csi_rs_cfg_non_precoded_r13_s>().unpack(bref));
      break;
    case types::bf_r13:
      HANDLE_CODE(c.get<csi_rs_cfg_bf_r13_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_r13_c::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-ConfigEMIMO-v1430 ::= CHOICE
void csi_rs_cfg_emimo_v1430_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_emimo_v1430_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_v1430_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_v1430_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void csi_rs_cfg_emimo_v1430_c::setup_c_::destroy_()
{
  switch (type_) {
    case types::non_precoded_v1430:
      c.destroy<csi_rs_cfg_non_precoded_v1430_s>();
      break;
    case types::bf_v1430:
      c.destroy<csi_rs_cfg_bf_v1430_s>();
      break;
    default:
      break;
  }
}
void csi_rs_cfg_emimo_v1430_c::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::non_precoded_v1430:
      c.init<csi_rs_cfg_non_precoded_v1430_s>();
      break;
    case types::bf_v1430:
      c.init<csi_rs_cfg_bf_v1430_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c::setup_c_");
  }
}
csi_rs_cfg_emimo_v1430_c::setup_c_::setup_c_(const csi_rs_cfg_emimo_v1430_c::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::non_precoded_v1430:
      c.init(other.c.get<csi_rs_cfg_non_precoded_v1430_s>());
      break;
    case types::bf_v1430:
      c.init(other.c.get<csi_rs_cfg_bf_v1430_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c::setup_c_");
  }
}
csi_rs_cfg_emimo_v1430_c::setup_c_& csi_rs_cfg_emimo_v1430_c::setup_c_::
                                    operator=(const csi_rs_cfg_emimo_v1430_c::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::non_precoded_v1430:
      c.set(other.c.get<csi_rs_cfg_non_precoded_v1430_s>());
      break;
    case types::bf_v1430:
      c.set(other.c.get<csi_rs_cfg_bf_v1430_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c::setup_c_");
  }

  return *this;
}
void csi_rs_cfg_emimo_v1430_c::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::non_precoded_v1430:
      j.write_fieldname("nonPrecoded-v1430");
      c.get<csi_rs_cfg_non_precoded_v1430_s>().to_json(j);
      break;
    case types::bf_v1430:
      j.write_fieldname("beamformed-v1430");
      c.get<csi_rs_cfg_bf_v1430_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_v1430_c::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::non_precoded_v1430:
      HANDLE_CODE(c.get<csi_rs_cfg_non_precoded_v1430_s>().pack(bref));
      break;
    case types::bf_v1430:
      HANDLE_CODE(c.get<csi_rs_cfg_bf_v1430_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_v1430_c::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::non_precoded_v1430:
      HANDLE_CODE(c.get<csi_rs_cfg_non_precoded_v1430_s>().unpack(bref));
      break;
    case types::bf_v1430:
      HANDLE_CODE(c.get<csi_rs_cfg_bf_v1430_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1430_c::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-ConfigEMIMO-v1480 ::= CHOICE
void csi_rs_cfg_emimo_v1480_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_emimo_v1480_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_v1480_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_v1480_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void csi_rs_cfg_emimo_v1480_c::setup_c_::destroy_()
{
  switch (type_) {
    case types::non_precoded_v1480:
      c.destroy<csi_rs_cfg_non_precoded_v1480_s>();
      break;
    case types::bf_v1480:
      c.destroy<csi_rs_cfg_bf_v1430_s>();
      break;
    default:
      break;
  }
}
void csi_rs_cfg_emimo_v1480_c::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::non_precoded_v1480:
      c.init<csi_rs_cfg_non_precoded_v1480_s>();
      break;
    case types::bf_v1480:
      c.init<csi_rs_cfg_bf_v1430_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c::setup_c_");
  }
}
csi_rs_cfg_emimo_v1480_c::setup_c_::setup_c_(const csi_rs_cfg_emimo_v1480_c::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::non_precoded_v1480:
      c.init(other.c.get<csi_rs_cfg_non_precoded_v1480_s>());
      break;
    case types::bf_v1480:
      c.init(other.c.get<csi_rs_cfg_bf_v1430_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c::setup_c_");
  }
}
csi_rs_cfg_emimo_v1480_c::setup_c_& csi_rs_cfg_emimo_v1480_c::setup_c_::
                                    operator=(const csi_rs_cfg_emimo_v1480_c::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::non_precoded_v1480:
      c.set(other.c.get<csi_rs_cfg_non_precoded_v1480_s>());
      break;
    case types::bf_v1480:
      c.set(other.c.get<csi_rs_cfg_bf_v1430_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c::setup_c_");
  }

  return *this;
}
void csi_rs_cfg_emimo_v1480_c::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::non_precoded_v1480:
      j.write_fieldname("nonPrecoded-v1480");
      c.get<csi_rs_cfg_non_precoded_v1480_s>().to_json(j);
      break;
    case types::bf_v1480:
      j.write_fieldname("beamformed-v1480");
      c.get<csi_rs_cfg_bf_v1430_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_v1480_c::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::non_precoded_v1480:
      HANDLE_CODE(c.get<csi_rs_cfg_non_precoded_v1480_s>().pack(bref));
      break;
    case types::bf_v1480:
      HANDLE_CODE(c.get<csi_rs_cfg_bf_v1430_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_v1480_c::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::non_precoded_v1480:
      HANDLE_CODE(c.get<csi_rs_cfg_non_precoded_v1480_s>().unpack(bref));
      break;
    case types::bf_v1480:
      HANDLE_CODE(c.get<csi_rs_cfg_bf_v1430_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1480_c::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-ConfigEMIMO-v1530 ::= CHOICE
void csi_rs_cfg_emimo_v1530_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_emimo_v1530_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1530_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_v1530_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1530_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_v1530_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1530_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void csi_rs_cfg_emimo_v1530_c::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("nonPrecoded-v1530");
  c.to_json(j);
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_emimo_v1530_c::setup_c_::pack(bit_ref& bref) const
{
  HANDLE_CODE(c.pack(bref));
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_emimo_v1530_c::setup_c_::unpack(cbit_ref& bref)
{
  HANDLE_CODE(c.unpack(bref));
  return SRSASN_SUCCESS;
}

// CQI-ReportPeriodicProcExt-r11 ::= SEQUENCE
SRSASN_CODE cqi_report_periodic_proc_ext_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ri_cfg_idx_r11_present, 1));
  HANDLE_CODE(bref.pack(csi_cfg_idx_r11_present, 1));

  HANDLE_CODE(pack_integer(bref, cqi_report_periodic_proc_ext_id_r11, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(pack_integer(bref, cqi_pmi_cfg_idx_r11, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(cqi_format_ind_periodic_r11.pack(bref));
  if (ri_cfg_idx_r11_present) {
    HANDLE_CODE(pack_integer(bref, ri_cfg_idx_r11, (uint16_t)0u, (uint16_t)1023u));
  }
  if (csi_cfg_idx_r11_present) {
    HANDLE_CODE(csi_cfg_idx_r11.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= cri_report_cfg_r13.is_present();
    group_flags[1] |= periodicity_factor_wb_r13_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cri_report_cfg_r13.is_present(), 1));
      if (cri_report_cfg_r13.is_present()) {
        HANDLE_CODE(cri_report_cfg_r13->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(periodicity_factor_wb_r13_present, 1));
      if (periodicity_factor_wb_r13_present) {
        HANDLE_CODE(periodicity_factor_wb_r13.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_proc_ext_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ri_cfg_idx_r11_present, 1));
  HANDLE_CODE(bref.unpack(csi_cfg_idx_r11_present, 1));

  HANDLE_CODE(unpack_integer(cqi_report_periodic_proc_ext_id_r11, bref, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(unpack_integer(cqi_pmi_cfg_idx_r11, bref, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(cqi_format_ind_periodic_r11.unpack(bref));
  if (ri_cfg_idx_r11_present) {
    HANDLE_CODE(unpack_integer(ri_cfg_idx_r11, bref, (uint16_t)0u, (uint16_t)1023u));
  }
  if (csi_cfg_idx_r11_present) {
    HANDLE_CODE(csi_cfg_idx_r11.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 cri_report_cfg_r13_present;
      HANDLE_CODE(bref.unpack(cri_report_cfg_r13_present, 1));
      cri_report_cfg_r13.set_present(cri_report_cfg_r13_present);
      if (cri_report_cfg_r13.is_present()) {
        HANDLE_CODE(cri_report_cfg_r13->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(periodicity_factor_wb_r13_present, 1));
      if (periodicity_factor_wb_r13_present) {
        HANDLE_CODE(periodicity_factor_wb_r13.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void cqi_report_periodic_proc_ext_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cqi-ReportPeriodicProcExtId-r11", cqi_report_periodic_proc_ext_id_r11);
  j.write_int("cqi-pmi-ConfigIndex-r11", cqi_pmi_cfg_idx_r11);
  j.write_fieldname("cqi-FormatIndicatorPeriodic-r11");
  cqi_format_ind_periodic_r11.to_json(j);
  if (ri_cfg_idx_r11_present) {
    j.write_int("ri-ConfigIndex-r11", ri_cfg_idx_r11);
  }
  if (csi_cfg_idx_r11_present) {
    j.write_fieldname("csi-ConfigIndex-r11");
    csi_cfg_idx_r11.to_json(j);
  }
  if (ext) {
    if (cri_report_cfg_r13.is_present()) {
      j.write_fieldname("cri-ReportConfig-r13");
      cri_report_cfg_r13->to_json(j);
    }
    if (periodicity_factor_wb_r13_present) {
      j.write_str("periodicityFactorWB-r13", periodicity_factor_wb_r13.to_string());
    }
  }
  j.end_obj();
}

void cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_::destroy_()
{
  switch (type_) {
    case types::wideband_cqi_r11:
      c.destroy<wideband_cqi_r11_s_>();
      break;
    case types::subband_cqi_r11:
      c.destroy<subband_cqi_r11_s_>();
      break;
    default:
      break;
  }
}
void cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::wideband_cqi_r11:
      c.init<wideband_cqi_r11_s_>();
      break;
    case types::subband_cqi_r11:
      c.init<subband_cqi_r11_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_");
  }
}
cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_::cqi_format_ind_periodic_r11_c_(
    const cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::wideband_cqi_r11:
      c.init(other.c.get<wideband_cqi_r11_s_>());
      break;
    case types::subband_cqi_r11:
      c.init(other.c.get<subband_cqi_r11_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_");
  }
}
cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_&
cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_::
operator=(const cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::wideband_cqi_r11:
      c.set(other.c.get<wideband_cqi_r11_s_>());
      break;
    case types::subband_cqi_r11:
      c.set(other.c.get<subband_cqi_r11_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_");
  }

  return *this;
}
void cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::wideband_cqi_r11:
      j.write_fieldname("widebandCQI-r11");
      j.start_obj();
      if (c.get<wideband_cqi_r11_s_>().csi_report_mode_r11_present) {
        j.write_str("csi-ReportMode-r11", c.get<wideband_cqi_r11_s_>().csi_report_mode_r11.to_string());
      }
      j.end_obj();
      break;
    case types::subband_cqi_r11:
      j.write_fieldname("subbandCQI-r11");
      j.start_obj();
      j.write_int("k", c.get<subband_cqi_r11_s_>().k);
      j.write_str("periodicityFactor-r11", c.get<subband_cqi_r11_s_>().periodicity_factor_r11.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::wideband_cqi_r11:
      HANDLE_CODE(bref.pack(c.get<wideband_cqi_r11_s_>().csi_report_mode_r11_present, 1));
      if (c.get<wideband_cqi_r11_s_>().csi_report_mode_r11_present) {
        HANDLE_CODE(c.get<wideband_cqi_r11_s_>().csi_report_mode_r11.pack(bref));
      }
      break;
    case types::subband_cqi_r11:
      HANDLE_CODE(pack_integer(bref, c.get<subband_cqi_r11_s_>().k, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(c.get<subband_cqi_r11_s_>().periodicity_factor_r11.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::wideband_cqi_r11:
      HANDLE_CODE(bref.unpack(c.get<wideband_cqi_r11_s_>().csi_report_mode_r11_present, 1));
      if (c.get<wideband_cqi_r11_s_>().csi_report_mode_r11_present) {
        HANDLE_CODE(c.get<wideband_cqi_r11_s_>().csi_report_mode_r11.unpack(bref));
      }
      break;
    case types::subband_cqi_r11:
      HANDLE_CODE(unpack_integer(c.get<subband_cqi_r11_s_>().k, bref, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(c.get<subband_cqi_r11_s_>().periodicity_factor_r11.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::cqi_format_ind_periodic_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cqi_report_periodic_proc_ext_r11_s::csi_cfg_idx_r11_c_::set(types::options e)
{
  type_ = e;
}
void cqi_report_periodic_proc_ext_r11_s::csi_cfg_idx_r11_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_int("cqi-pmi-ConfigIndex2-r11", c.cqi_pmi_cfg_idx2_r11);
      if (c.ri_cfg_idx2_r11_present) {
        j.write_int("ri-ConfigIndex2-r11", c.ri_cfg_idx2_r11);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::csi_cfg_idx_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_proc_ext_r11_s::csi_cfg_idx_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.ri_cfg_idx2_r11_present, 1));
      HANDLE_CODE(pack_integer(bref, c.cqi_pmi_cfg_idx2_r11, (uint16_t)0u, (uint16_t)1023u));
      if (c.ri_cfg_idx2_r11_present) {
        HANDLE_CODE(pack_integer(bref, c.ri_cfg_idx2_r11, (uint16_t)0u, (uint16_t)1023u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::csi_cfg_idx_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_proc_ext_r11_s::csi_cfg_idx_r11_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.ri_cfg_idx2_r11_present, 1));
      HANDLE_CODE(unpack_integer(c.cqi_pmi_cfg_idx2_r11, bref, (uint16_t)0u, (uint16_t)1023u));
      if (c.ri_cfg_idx2_r11_present) {
        HANDLE_CODE(unpack_integer(c.ri_cfg_idx2_r11, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_proc_ext_r11_s::csi_cfg_idx_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-IM-Config-r11 ::= SEQUENCE
SRSASN_CODE csi_im_cfg_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, csi_im_cfg_id_r11, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(pack_integer(bref, res_cfg_r11, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, sf_cfg_r11, (uint8_t)0u, (uint8_t)154u));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= interference_meas_restrict_r13_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(interference_meas_restrict_r13_present, 1));
      if (interference_meas_restrict_r13_present) {
        HANDLE_CODE(bref.pack(interference_meas_restrict_r13, 1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_im_cfg_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(csi_im_cfg_id_r11, bref, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(unpack_integer(res_cfg_r11, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(sf_cfg_r11, bref, (uint8_t)0u, (uint8_t)154u));

  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(interference_meas_restrict_r13_present, 1));
      if (interference_meas_restrict_r13_present) {
        HANDLE_CODE(bref.unpack(interference_meas_restrict_r13, 1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void csi_im_cfg_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("csi-IM-ConfigId-r11", csi_im_cfg_id_r11);
  j.write_int("resourceConfig-r11", res_cfg_r11);
  j.write_int("subframeConfig-r11", sf_cfg_r11);
  if (ext) {
    if (interference_meas_restrict_r13_present) {
      j.write_bool("interferenceMeasRestriction-r13", interference_meas_restrict_r13);
    }
  }
  j.end_obj();
}

// CSI-IM-ConfigExt-r12 ::= SEQUENCE
SRSASN_CODE csi_im_cfg_ext_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, csi_im_cfg_id_v1250, (uint8_t)4u, (uint8_t)4u));
  HANDLE_CODE(pack_integer(bref, res_cfg_r12, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, sf_cfg_r12, (uint8_t)0u, (uint8_t)154u));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= interference_meas_restrict_r13_present;
    group_flags[0] |= csi_im_cfg_id_v1310_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(interference_meas_restrict_r13_present, 1));
      HANDLE_CODE(bref.pack(csi_im_cfg_id_v1310_present, 1));
      if (interference_meas_restrict_r13_present) {
        HANDLE_CODE(bref.pack(interference_meas_restrict_r13, 1));
      }
      if (csi_im_cfg_id_v1310_present) {
        HANDLE_CODE(pack_integer(bref, csi_im_cfg_id_v1310, (uint8_t)5u, (uint8_t)24u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_im_cfg_ext_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(csi_im_cfg_id_v1250, bref, (uint8_t)4u, (uint8_t)4u));
  HANDLE_CODE(unpack_integer(res_cfg_r12, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(sf_cfg_r12, bref, (uint8_t)0u, (uint8_t)154u));

  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(interference_meas_restrict_r13_present, 1));
      HANDLE_CODE(bref.unpack(csi_im_cfg_id_v1310_present, 1));
      if (interference_meas_restrict_r13_present) {
        HANDLE_CODE(bref.unpack(interference_meas_restrict_r13, 1));
      }
      if (csi_im_cfg_id_v1310_present) {
        HANDLE_CODE(unpack_integer(csi_im_cfg_id_v1310, bref, (uint8_t)5u, (uint8_t)24u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void csi_im_cfg_ext_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("csi-IM-ConfigId-v1250", csi_im_cfg_id_v1250);
  j.write_int("resourceConfig-r12", res_cfg_r12);
  j.write_int("subframeConfig-r12", sf_cfg_r12);
  if (ext) {
    if (interference_meas_restrict_r13_present) {
      j.write_bool("interferenceMeasRestriction-r13", interference_meas_restrict_r13);
    }
    if (csi_im_cfg_id_v1310_present) {
      j.write_int("csi-IM-ConfigId-v1310", csi_im_cfg_id_v1310);
    }
  }
  j.end_obj();
}

// CSI-Process-r11 ::= SEQUENCE
SRSASN_CODE csi_process_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(cqi_report_both_proc_r11_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_periodic_proc_id_r11_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_aperiodic_proc_r11_present, 1));

  HANDLE_CODE(pack_integer(bref, csi_process_id_r11, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(pack_integer(bref, csi_rs_cfg_nzp_id_r11, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(pack_integer(bref, csi_im_cfg_id_r11, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(pack_dyn_seq_of(bref, p_c_and_cbsr_list_r11, 1, 2));
  if (cqi_report_both_proc_r11_present) {
    HANDLE_CODE(cqi_report_both_proc_r11.pack(bref));
  }
  if (cqi_report_periodic_proc_id_r11_present) {
    HANDLE_CODE(pack_integer(bref, cqi_report_periodic_proc_id_r11, (uint8_t)0u, (uint8_t)3u));
  }
  if (cqi_report_aperiodic_proc_r11_present) {
    HANDLE_CODE(cqi_report_aperiodic_proc_r11.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= alt_codebook_enabled_for4_tx_proc_r12_present;
    group_flags[0] |= csi_im_cfg_id_list_r12.is_present();
    group_flags[0] |= cqi_report_aperiodic_proc2_r12.is_present();
    group_flags[1] |= cqi_report_aperiodic_proc_v1310.is_present();
    group_flags[1] |= cqi_report_aperiodic_proc2_v1310.is_present();
    group_flags[1] |= emimo_type_r13.is_present();
    group_flags[2] |= dummy.is_present();
    group_flags[2] |= emimo_hybrid_r14.is_present();
    group_flags[2] |= advanced_codebook_enabled_r14_present;
    group_flags[3] |= emimo_type_v1480.is_present();
    group_flags[4] |= fe_comp_csi_enabled_v1530_present;
    group_flags[4] |= emimo_type_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(alt_codebook_enabled_for4_tx_proc_r12_present, 1));
      HANDLE_CODE(bref.pack(csi_im_cfg_id_list_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_aperiodic_proc2_r12.is_present(), 1));
      if (csi_im_cfg_id_list_r12.is_present()) {
        HANDLE_CODE(csi_im_cfg_id_list_r12->pack(bref));
      }
      if (cqi_report_aperiodic_proc2_r12.is_present()) {
        HANDLE_CODE(cqi_report_aperiodic_proc2_r12->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cqi_report_aperiodic_proc_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_aperiodic_proc2_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(emimo_type_r13.is_present(), 1));
      if (cqi_report_aperiodic_proc_v1310.is_present()) {
        HANDLE_CODE(cqi_report_aperiodic_proc_v1310->pack(bref));
      }
      if (cqi_report_aperiodic_proc2_v1310.is_present()) {
        HANDLE_CODE(cqi_report_aperiodic_proc2_v1310->pack(bref));
      }
      if (emimo_type_r13.is_present()) {
        HANDLE_CODE(emimo_type_r13->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(dummy.is_present(), 1));
      HANDLE_CODE(bref.pack(emimo_hybrid_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(advanced_codebook_enabled_r14_present, 1));
      if (dummy.is_present()) {
        HANDLE_CODE(dummy->pack(bref));
      }
      if (emimo_hybrid_r14.is_present()) {
        HANDLE_CODE(emimo_hybrid_r14->pack(bref));
      }
      if (advanced_codebook_enabled_r14_present) {
        HANDLE_CODE(bref.pack(advanced_codebook_enabled_r14, 1));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(emimo_type_v1480.is_present(), 1));
      if (emimo_type_v1480.is_present()) {
        HANDLE_CODE(emimo_type_v1480->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(fe_comp_csi_enabled_v1530_present, 1));
      HANDLE_CODE(bref.pack(emimo_type_v1530.is_present(), 1));
      if (fe_comp_csi_enabled_v1530_present) {
        HANDLE_CODE(bref.pack(fe_comp_csi_enabled_v1530, 1));
      }
      if (emimo_type_v1530.is_present()) {
        HANDLE_CODE(emimo_type_v1530->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_process_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(cqi_report_both_proc_r11_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_periodic_proc_id_r11_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_aperiodic_proc_r11_present, 1));

  HANDLE_CODE(unpack_integer(csi_process_id_r11, bref, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(unpack_integer(csi_rs_cfg_nzp_id_r11, bref, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(unpack_integer(csi_im_cfg_id_r11, bref, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(unpack_dyn_seq_of(p_c_and_cbsr_list_r11, bref, 1, 2));
  if (cqi_report_both_proc_r11_present) {
    HANDLE_CODE(cqi_report_both_proc_r11.unpack(bref));
  }
  if (cqi_report_periodic_proc_id_r11_present) {
    HANDLE_CODE(unpack_integer(cqi_report_periodic_proc_id_r11, bref, (uint8_t)0u, (uint8_t)3u));
  }
  if (cqi_report_aperiodic_proc_r11_present) {
    HANDLE_CODE(cqi_report_aperiodic_proc_r11.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(5);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(alt_codebook_enabled_for4_tx_proc_r12_present, 1));
      bool csi_im_cfg_id_list_r12_present;
      HANDLE_CODE(bref.unpack(csi_im_cfg_id_list_r12_present, 1));
      csi_im_cfg_id_list_r12.set_present(csi_im_cfg_id_list_r12_present);
      bool cqi_report_aperiodic_proc2_r12_present;
      HANDLE_CODE(bref.unpack(cqi_report_aperiodic_proc2_r12_present, 1));
      cqi_report_aperiodic_proc2_r12.set_present(cqi_report_aperiodic_proc2_r12_present);
      if (csi_im_cfg_id_list_r12.is_present()) {
        HANDLE_CODE(csi_im_cfg_id_list_r12->unpack(bref));
      }
      if (cqi_report_aperiodic_proc2_r12.is_present()) {
        HANDLE_CODE(cqi_report_aperiodic_proc2_r12->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool cqi_report_aperiodic_proc_v1310_present;
      HANDLE_CODE(bref.unpack(cqi_report_aperiodic_proc_v1310_present, 1));
      cqi_report_aperiodic_proc_v1310.set_present(cqi_report_aperiodic_proc_v1310_present);
      bool cqi_report_aperiodic_proc2_v1310_present;
      HANDLE_CODE(bref.unpack(cqi_report_aperiodic_proc2_v1310_present, 1));
      cqi_report_aperiodic_proc2_v1310.set_present(cqi_report_aperiodic_proc2_v1310_present);
      bool emimo_type_r13_present;
      HANDLE_CODE(bref.unpack(emimo_type_r13_present, 1));
      emimo_type_r13.set_present(emimo_type_r13_present);
      if (cqi_report_aperiodic_proc_v1310.is_present()) {
        HANDLE_CODE(cqi_report_aperiodic_proc_v1310->unpack(bref));
      }
      if (cqi_report_aperiodic_proc2_v1310.is_present()) {
        HANDLE_CODE(cqi_report_aperiodic_proc2_v1310->unpack(bref));
      }
      if (emimo_type_r13.is_present()) {
        HANDLE_CODE(emimo_type_r13->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool dummy_present;
      HANDLE_CODE(bref.unpack(dummy_present, 1));
      dummy.set_present(dummy_present);
      bool emimo_hybrid_r14_present;
      HANDLE_CODE(bref.unpack(emimo_hybrid_r14_present, 1));
      emimo_hybrid_r14.set_present(emimo_hybrid_r14_present);
      HANDLE_CODE(bref.unpack(advanced_codebook_enabled_r14_present, 1));
      if (dummy.is_present()) {
        HANDLE_CODE(dummy->unpack(bref));
      }
      if (emimo_hybrid_r14.is_present()) {
        HANDLE_CODE(emimo_hybrid_r14->unpack(bref));
      }
      if (advanced_codebook_enabled_r14_present) {
        HANDLE_CODE(bref.unpack(advanced_codebook_enabled_r14, 1));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool emimo_type_v1480_present;
      HANDLE_CODE(bref.unpack(emimo_type_v1480_present, 1));
      emimo_type_v1480.set_present(emimo_type_v1480_present);
      if (emimo_type_v1480.is_present()) {
        HANDLE_CODE(emimo_type_v1480->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(fe_comp_csi_enabled_v1530_present, 1));
      bool emimo_type_v1530_present;
      HANDLE_CODE(bref.unpack(emimo_type_v1530_present, 1));
      emimo_type_v1530.set_present(emimo_type_v1530_present);
      if (fe_comp_csi_enabled_v1530_present) {
        HANDLE_CODE(bref.unpack(fe_comp_csi_enabled_v1530, 1));
      }
      if (emimo_type_v1530.is_present()) {
        HANDLE_CODE(emimo_type_v1530->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void csi_process_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("csi-ProcessId-r11", csi_process_id_r11);
  j.write_int("csi-RS-ConfigNZPId-r11", csi_rs_cfg_nzp_id_r11);
  j.write_int("csi-IM-ConfigId-r11", csi_im_cfg_id_r11);
  j.start_array("p-C-AndCBSRList-r11");
  for (const auto& e1 : p_c_and_cbsr_list_r11) {
    e1.to_json(j);
  }
  j.end_array();
  if (cqi_report_both_proc_r11_present) {
    j.write_fieldname("cqi-ReportBothProc-r11");
    cqi_report_both_proc_r11.to_json(j);
  }
  if (cqi_report_periodic_proc_id_r11_present) {
    j.write_int("cqi-ReportPeriodicProcId-r11", cqi_report_periodic_proc_id_r11);
  }
  if (cqi_report_aperiodic_proc_r11_present) {
    j.write_fieldname("cqi-ReportAperiodicProc-r11");
    cqi_report_aperiodic_proc_r11.to_json(j);
  }
  if (ext) {
    if (alt_codebook_enabled_for4_tx_proc_r12_present) {
      j.write_str("alternativeCodebookEnabledFor4TXProc-r12", "true");
    }
    if (csi_im_cfg_id_list_r12.is_present()) {
      j.write_fieldname("csi-IM-ConfigIdList-r12");
      csi_im_cfg_id_list_r12->to_json(j);
    }
    if (cqi_report_aperiodic_proc2_r12.is_present()) {
      j.write_fieldname("cqi-ReportAperiodicProc2-r12");
      cqi_report_aperiodic_proc2_r12->to_json(j);
    }
    if (cqi_report_aperiodic_proc_v1310.is_present()) {
      j.write_fieldname("cqi-ReportAperiodicProc-v1310");
      cqi_report_aperiodic_proc_v1310->to_json(j);
    }
    if (cqi_report_aperiodic_proc2_v1310.is_present()) {
      j.write_fieldname("cqi-ReportAperiodicProc2-v1310");
      cqi_report_aperiodic_proc2_v1310->to_json(j);
    }
    if (emimo_type_r13.is_present()) {
      j.write_fieldname("eMIMO-Type-r13");
      emimo_type_r13->to_json(j);
    }
    if (dummy.is_present()) {
      j.write_fieldname("dummy");
      dummy->to_json(j);
    }
    if (emimo_hybrid_r14.is_present()) {
      j.write_fieldname("eMIMO-Hybrid-r14");
      emimo_hybrid_r14->to_json(j);
    }
    if (advanced_codebook_enabled_r14_present) {
      j.write_bool("advancedCodebookEnabled-r14", advanced_codebook_enabled_r14);
    }
    if (emimo_type_v1480.is_present()) {
      j.write_fieldname("eMIMO-Type-v1480");
      emimo_type_v1480->to_json(j);
    }
    if (fe_comp_csi_enabled_v1530_present) {
      j.write_bool("feCOMP-CSI-Enabled-v1530", fe_comp_csi_enabled_v1530);
    }
    if (emimo_type_v1530.is_present()) {
      j.write_fieldname("eMIMO-Type-v1530");
      emimo_type_v1530->to_json(j);
    }
  }
  j.end_obj();
}

void csi_process_r11_s::csi_im_cfg_id_list_r12_c_::set(types::options e)
{
  type_ = e;
}
void csi_process_r11_s::csi_im_cfg_id_list_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        j.write_int(e1);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::csi_im_cfg_id_list_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_process_r11_s::csi_im_cfg_id_list_r12_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, 1, 2, integer_packer<uint8_t>(1, 4)));
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::csi_im_cfg_id_list_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_process_r11_s::csi_im_cfg_id_list_r12_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, bref, 1, 2, integer_packer<uint8_t>(1, 4)));
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::csi_im_cfg_id_list_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void csi_process_r11_s::cqi_report_aperiodic_proc2_r12_c_::set(types::options e)
{
  type_ = e;
}
void csi_process_r11_s::cqi_report_aperiodic_proc2_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc2_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_process_r11_s::cqi_report_aperiodic_proc2_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc2_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_process_r11_s::cqi_report_aperiodic_proc2_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc2_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void csi_process_r11_s::cqi_report_aperiodic_proc_v1310_c_::set(types::options e)
{
  type_ = e;
}
void csi_process_r11_s::cqi_report_aperiodic_proc_v1310_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc_v1310_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_process_r11_s::cqi_report_aperiodic_proc_v1310_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc_v1310_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_process_r11_s::cqi_report_aperiodic_proc_v1310_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc_v1310_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void csi_process_r11_s::cqi_report_aperiodic_proc2_v1310_c_::set(types::options e)
{
  type_ = e;
}
void csi_process_r11_s::cqi_report_aperiodic_proc2_v1310_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc2_v1310_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_process_r11_s::cqi_report_aperiodic_proc2_v1310_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc2_v1310_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_process_r11_s::cqi_report_aperiodic_proc2_v1310_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "csi_process_r11_s::cqi_report_aperiodic_proc2_v1310_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// N4SPUCCH-Resource-r15 ::= SEQUENCE
SRSASN_CODE n4_spucch_res_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, n4start_prb_r15, (uint8_t)0u, (uint8_t)109u));
  HANDLE_CODE(pack_integer(bref, n4nof_prb_r15, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE n4_spucch_res_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(n4start_prb_r15, bref, (uint8_t)0u, (uint8_t)109u));
  HANDLE_CODE(unpack_integer(n4nof_prb_r15, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void n4_spucch_res_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("n4startingPRB-r15", n4start_prb_r15);
  j.write_int("n4numberOfPRB-r15", n4nof_prb_r15);
  j.end_obj();
}

// ZeroTxPowerCSI-RS-r12 ::= SEQUENCE
SRSASN_CODE zero_tx_pwr_csi_rs_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(zero_tx_pwr_res_cfg_list_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, zero_tx_pwr_sf_cfg_r12, (uint8_t)0u, (uint8_t)154u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE zero_tx_pwr_csi_rs_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(zero_tx_pwr_res_cfg_list_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(zero_tx_pwr_sf_cfg_r12, bref, (uint8_t)0u, (uint8_t)154u));

  return SRSASN_SUCCESS;
}
void zero_tx_pwr_csi_rs_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("zeroTxPowerResourceConfigList-r12", zero_tx_pwr_res_cfg_list_r12.to_string());
  j.write_int("zeroTxPowerSubframeConfig-r12", zero_tx_pwr_sf_cfg_r12);
  j.end_obj();
}

// CQI-ReportAperiodic-r10 ::= CHOICE
void cqi_report_aperiodic_r10_c::set(types::options e)
{
  type_ = e;
}
void cqi_report_aperiodic_r10_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("cqi-ReportModeAperiodic-r10", c.cqi_report_mode_aperiodic_r10.to_string());
      if (c.aperiodic_csi_trigger_r10_present) {
        j.write_fieldname("aperiodicCSI-Trigger-r10");
        j.start_obj();
        j.write_str("trigger1-r10", c.aperiodic_csi_trigger_r10.trigger1_r10.to_string());
        j.write_str("trigger2-r10", c.aperiodic_csi_trigger_r10.trigger2_r10.to_string());
        j.end_obj();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_r10_c");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_aperiodic_r10_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.aperiodic_csi_trigger_r10_present, 1));
      HANDLE_CODE(c.cqi_report_mode_aperiodic_r10.pack(bref));
      if (c.aperiodic_csi_trigger_r10_present) {
        HANDLE_CODE(c.aperiodic_csi_trigger_r10.trigger1_r10.pack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_r10.trigger2_r10.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_r10_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_aperiodic_r10_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.aperiodic_csi_trigger_r10_present, 1));
      HANDLE_CODE(c.cqi_report_mode_aperiodic_r10.unpack(bref));
      if (c.aperiodic_csi_trigger_r10_present) {
        HANDLE_CODE(c.aperiodic_csi_trigger_r10.trigger1_r10.unpack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_r10.trigger2_r10.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_r10_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportAperiodic-v1250 ::= CHOICE
void cqi_report_aperiodic_v1250_c::set(types::options e)
{
  type_ = e;
}
void cqi_report_aperiodic_v1250_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("aperiodicCSI-Trigger-v1250");
      j.start_obj();
      j.write_str("trigger-SubframeSetIndicator-r12", c.aperiodic_csi_trigger_v1250.trigger_sf_set_ind_r12.to_string());
      j.write_str("trigger1-SubframeSetIndicator-r12",
                  c.aperiodic_csi_trigger_v1250.trigger1_sf_set_ind_r12.to_string());
      j.write_str("trigger2-SubframeSetIndicator-r12",
                  c.aperiodic_csi_trigger_v1250.trigger2_sf_set_ind_r12.to_string());
      j.end_obj();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1250_c");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_aperiodic_v1250_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.aperiodic_csi_trigger_v1250.trigger_sf_set_ind_r12.pack(bref));
      HANDLE_CODE(c.aperiodic_csi_trigger_v1250.trigger1_sf_set_ind_r12.pack(bref));
      HANDLE_CODE(c.aperiodic_csi_trigger_v1250.trigger2_sf_set_ind_r12.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1250_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_aperiodic_v1250_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.aperiodic_csi_trigger_v1250.trigger_sf_set_ind_r12.unpack(bref));
      HANDLE_CODE(c.aperiodic_csi_trigger_v1250.trigger1_sf_set_ind_r12.unpack(bref));
      HANDLE_CODE(c.aperiodic_csi_trigger_v1250.trigger2_sf_set_ind_r12.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1250_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportAperiodic-v1310 ::= CHOICE
void cqi_report_aperiodic_v1310_c::set(types::options e)
{
  type_ = e;
}
void cqi_report_aperiodic_v1310_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.aperiodic_csi_trigger_v1310_present) {
        j.write_fieldname("aperiodicCSI-Trigger-v1310");
        j.start_obj();
        j.write_str("trigger1-r13", c.aperiodic_csi_trigger_v1310.trigger1_r13.to_string());
        j.write_str("trigger2-r13", c.aperiodic_csi_trigger_v1310.trigger2_r13.to_string());
        j.write_str("trigger3-r13", c.aperiodic_csi_trigger_v1310.trigger3_r13.to_string());
        j.write_str("trigger4-r13", c.aperiodic_csi_trigger_v1310.trigger4_r13.to_string());
        j.write_str("trigger5-r13", c.aperiodic_csi_trigger_v1310.trigger5_r13.to_string());
        j.write_str("trigger6-r13", c.aperiodic_csi_trigger_v1310.trigger6_r13.to_string());
        j.end_obj();
      }
      if (c.aperiodic_csi_trigger2_r13_present) {
        j.write_fieldname("aperiodicCSI-Trigger2-r13");
        c.aperiodic_csi_trigger2_r13.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1310_c");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_aperiodic_v1310_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.aperiodic_csi_trigger_v1310_present, 1));
      HANDLE_CODE(bref.pack(c.aperiodic_csi_trigger2_r13_present, 1));
      if (c.aperiodic_csi_trigger_v1310_present) {
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger1_r13.pack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger2_r13.pack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger3_r13.pack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger4_r13.pack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger5_r13.pack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger6_r13.pack(bref));
      }
      if (c.aperiodic_csi_trigger2_r13_present) {
        HANDLE_CODE(c.aperiodic_csi_trigger2_r13.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1310_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_aperiodic_v1310_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.aperiodic_csi_trigger_v1310_present, 1));
      HANDLE_CODE(bref.unpack(c.aperiodic_csi_trigger2_r13_present, 1));
      if (c.aperiodic_csi_trigger_v1310_present) {
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger1_r13.unpack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger2_r13.unpack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger3_r13.unpack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger4_r13.unpack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger5_r13.unpack(bref));
        HANDLE_CODE(c.aperiodic_csi_trigger_v1310.trigger6_r13.unpack(bref));
      }
      if (c.aperiodic_csi_trigger2_r13_present) {
        HANDLE_CODE(c.aperiodic_csi_trigger2_r13.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1310_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cqi_report_aperiodic_v1310_c::setup_s_::aperiodic_csi_trigger2_r13_c_::set(types::options e)
{
  type_ = e;
}
void cqi_report_aperiodic_v1310_c::setup_s_::aperiodic_csi_trigger2_r13_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("trigger1-SubframeSetIndicator-r13", c.trigger1_sf_set_ind_r13.to_string());
      j.write_str("trigger2-SubframeSetIndicator-r13", c.trigger2_sf_set_ind_r13.to_string());
      j.write_str("trigger3-SubframeSetIndicator-r13", c.trigger3_sf_set_ind_r13.to_string());
      j.write_str("trigger4-SubframeSetIndicator-r13", c.trigger4_sf_set_ind_r13.to_string());
      j.write_str("trigger5-SubframeSetIndicator-r13", c.trigger5_sf_set_ind_r13.to_string());
      j.write_str("trigger6-SubframeSetIndicator-r13", c.trigger6_sf_set_ind_r13.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1310_c::setup_s_::aperiodic_csi_trigger2_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_aperiodic_v1310_c::setup_s_::aperiodic_csi_trigger2_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.trigger1_sf_set_ind_r13.pack(bref));
      HANDLE_CODE(c.trigger2_sf_set_ind_r13.pack(bref));
      HANDLE_CODE(c.trigger3_sf_set_ind_r13.pack(bref));
      HANDLE_CODE(c.trigger4_sf_set_ind_r13.pack(bref));
      HANDLE_CODE(c.trigger5_sf_set_ind_r13.pack(bref));
      HANDLE_CODE(c.trigger6_sf_set_ind_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1310_c::setup_s_::aperiodic_csi_trigger2_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_aperiodic_v1310_c::setup_s_::aperiodic_csi_trigger2_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.trigger1_sf_set_ind_r13.unpack(bref));
      HANDLE_CODE(c.trigger2_sf_set_ind_r13.unpack(bref));
      HANDLE_CODE(c.trigger3_sf_set_ind_r13.unpack(bref));
      HANDLE_CODE(c.trigger4_sf_set_ind_r13.unpack(bref));
      HANDLE_CODE(c.trigger5_sf_set_ind_r13.unpack(bref));
      HANDLE_CODE(c.trigger6_sf_set_ind_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_v1310_c::setup_s_::aperiodic_csi_trigger2_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportAperiodicHybrid-r14 ::= SEQUENCE
SRSASN_CODE cqi_report_aperiodic_hybrid_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(triggers_r14_present, 1));

  if (triggers_r14_present) {
    HANDLE_CODE(triggers_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_aperiodic_hybrid_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(triggers_r14_present, 1));

  if (triggers_r14_present) {
    HANDLE_CODE(triggers_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_aperiodic_hybrid_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (triggers_r14_present) {
    j.write_fieldname("triggers-r14");
    triggers_r14.to_json(j);
  }
  j.end_obj();
}

void cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_::destroy_()
{
  switch (type_) {
    case types::one_bit_r14:
      c.destroy<one_bit_r14_s_>();
      break;
    case types::two_bit_r14:
      c.destroy<two_bit_r14_s_>();
      break;
    case types::three_bit_r14:
      c.destroy<three_bit_r14_s_>();
      break;
    default:
      break;
  }
}
void cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::one_bit_r14:
      c.init<one_bit_r14_s_>();
      break;
    case types::two_bit_r14:
      c.init<two_bit_r14_s_>();
      break;
    case types::three_bit_r14:
      c.init<three_bit_r14_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_");
  }
}
cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_::triggers_r14_c_(
    const cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::one_bit_r14:
      c.init(other.c.get<one_bit_r14_s_>());
      break;
    case types::two_bit_r14:
      c.init(other.c.get<two_bit_r14_s_>());
      break;
    case types::three_bit_r14:
      c.init(other.c.get<three_bit_r14_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_");
  }
}
cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_& cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_::
                                                    operator=(const cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::one_bit_r14:
      c.set(other.c.get<one_bit_r14_s_>());
      break;
    case types::two_bit_r14:
      c.set(other.c.get<two_bit_r14_s_>());
      break;
    case types::three_bit_r14:
      c.set(other.c.get<three_bit_r14_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_");
  }

  return *this;
}
void cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::one_bit_r14:
      j.write_fieldname("oneBit-r14");
      j.start_obj();
      j.write_str("trigger1-Indicator-r14", c.get<one_bit_r14_s_>().trigger1_ind_r14.to_string());
      j.end_obj();
      break;
    case types::two_bit_r14:
      j.write_fieldname("twoBit-r14");
      j.start_obj();
      j.write_str("trigger01-Indicator-r14", c.get<two_bit_r14_s_>().trigger01_ind_r14.to_string());
      j.write_str("trigger10-Indicator-r14", c.get<two_bit_r14_s_>().trigger10_ind_r14.to_string());
      j.write_str("trigger11-Indicator-r14", c.get<two_bit_r14_s_>().trigger11_ind_r14.to_string());
      j.end_obj();
      break;
    case types::three_bit_r14:
      j.write_fieldname("threeBit-r14");
      j.start_obj();
      j.write_str("trigger001-Indicator-r14", c.get<three_bit_r14_s_>().trigger001_ind_r14.to_string());
      j.write_str("trigger010-Indicator-r14", c.get<three_bit_r14_s_>().trigger010_ind_r14.to_string());
      j.write_str("trigger011-Indicator-r14", c.get<three_bit_r14_s_>().trigger011_ind_r14.to_string());
      j.write_str("trigger100-Indicator-r14", c.get<three_bit_r14_s_>().trigger100_ind_r14.to_string());
      j.write_str("trigger101-Indicator-r14", c.get<three_bit_r14_s_>().trigger101_ind_r14.to_string());
      j.write_str("trigger110-Indicator-r14", c.get<three_bit_r14_s_>().trigger110_ind_r14.to_string());
      j.write_str("trigger111-Indicator-r14", c.get<three_bit_r14_s_>().trigger111_ind_r14.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::one_bit_r14:
      HANDLE_CODE(c.get<one_bit_r14_s_>().trigger1_ind_r14.pack(bref));
      break;
    case types::two_bit_r14:
      HANDLE_CODE(c.get<two_bit_r14_s_>().trigger01_ind_r14.pack(bref));
      HANDLE_CODE(c.get<two_bit_r14_s_>().trigger10_ind_r14.pack(bref));
      HANDLE_CODE(c.get<two_bit_r14_s_>().trigger11_ind_r14.pack(bref));
      break;
    case types::three_bit_r14:
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger001_ind_r14.pack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger010_ind_r14.pack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger011_ind_r14.pack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger100_ind_r14.pack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger101_ind_r14.pack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger110_ind_r14.pack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger111_ind_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::one_bit_r14:
      HANDLE_CODE(c.get<one_bit_r14_s_>().trigger1_ind_r14.unpack(bref));
      break;
    case types::two_bit_r14:
      HANDLE_CODE(c.get<two_bit_r14_s_>().trigger01_ind_r14.unpack(bref));
      HANDLE_CODE(c.get<two_bit_r14_s_>().trigger10_ind_r14.unpack(bref));
      HANDLE_CODE(c.get<two_bit_r14_s_>().trigger11_ind_r14.unpack(bref));
      break;
    case types::three_bit_r14:
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger001_ind_r14.unpack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger010_ind_r14.unpack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger011_ind_r14.unpack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger100_ind_r14.unpack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger101_ind_r14.unpack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger110_ind_r14.unpack(bref));
      HANDLE_CODE(c.get<three_bit_r14_s_>().trigger111_ind_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_aperiodic_hybrid_r14_s::triggers_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportBoth-r11 ::= SEQUENCE
SRSASN_CODE cqi_report_both_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_im_cfg_to_release_list_r11_present, 1));
  HANDLE_CODE(bref.pack(csi_im_cfg_to_add_mod_list_r11_present, 1));
  HANDLE_CODE(bref.pack(csi_process_to_release_list_r11_present, 1));
  HANDLE_CODE(bref.pack(csi_process_to_add_mod_list_r11_present, 1));

  if (csi_im_cfg_to_release_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_im_cfg_to_release_list_r11, 1, 3, integer_packer<uint8_t>(1, 3)));
  }
  if (csi_im_cfg_to_add_mod_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_im_cfg_to_add_mod_list_r11, 1, 3));
  }
  if (csi_process_to_release_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_process_to_release_list_r11, 1, 4, integer_packer<uint8_t>(1, 4)));
  }
  if (csi_process_to_add_mod_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_process_to_add_mod_list_r11, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_both_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_im_cfg_to_release_list_r11_present, 1));
  HANDLE_CODE(bref.unpack(csi_im_cfg_to_add_mod_list_r11_present, 1));
  HANDLE_CODE(bref.unpack(csi_process_to_release_list_r11_present, 1));
  HANDLE_CODE(bref.unpack(csi_process_to_add_mod_list_r11_present, 1));

  if (csi_im_cfg_to_release_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_im_cfg_to_release_list_r11, bref, 1, 3, integer_packer<uint8_t>(1, 3)));
  }
  if (csi_im_cfg_to_add_mod_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_im_cfg_to_add_mod_list_r11, bref, 1, 3));
  }
  if (csi_process_to_release_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_process_to_release_list_r11, bref, 1, 4, integer_packer<uint8_t>(1, 4)));
  }
  if (csi_process_to_add_mod_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_process_to_add_mod_list_r11, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_both_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_im_cfg_to_release_list_r11_present) {
    j.start_array("csi-IM-ConfigToReleaseList-r11");
    for (const auto& e1 : csi_im_cfg_to_release_list_r11) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (csi_im_cfg_to_add_mod_list_r11_present) {
    j.start_array("csi-IM-ConfigToAddModList-r11");
    for (const auto& e1 : csi_im_cfg_to_add_mod_list_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (csi_process_to_release_list_r11_present) {
    j.start_array("csi-ProcessToReleaseList-r11");
    for (const auto& e1 : csi_process_to_release_list_r11) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (csi_process_to_add_mod_list_r11_present) {
    j.start_array("csi-ProcessToAddModList-r11");
    for (const auto& e1 : csi_process_to_add_mod_list_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// CQI-ReportBoth-v1250 ::= SEQUENCE
SRSASN_CODE cqi_report_both_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_im_cfg_to_release_list_ext_r12_present, 1));
  HANDLE_CODE(bref.pack(csi_im_cfg_to_add_mod_list_ext_r12_present, 1));

  if (csi_im_cfg_to_release_list_ext_r12_present) {
    HANDLE_CODE(pack_integer(bref, csi_im_cfg_to_release_list_ext_r12, (uint8_t)4u, (uint8_t)4u));
  }
  if (csi_im_cfg_to_add_mod_list_ext_r12_present) {
    HANDLE_CODE(csi_im_cfg_to_add_mod_list_ext_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_both_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_im_cfg_to_release_list_ext_r12_present, 1));
  HANDLE_CODE(bref.unpack(csi_im_cfg_to_add_mod_list_ext_r12_present, 1));

  if (csi_im_cfg_to_release_list_ext_r12_present) {
    HANDLE_CODE(unpack_integer(csi_im_cfg_to_release_list_ext_r12, bref, (uint8_t)4u, (uint8_t)4u));
  }
  if (csi_im_cfg_to_add_mod_list_ext_r12_present) {
    HANDLE_CODE(csi_im_cfg_to_add_mod_list_ext_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_both_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_im_cfg_to_release_list_ext_r12_present) {
    j.write_int("csi-IM-ConfigToReleaseListExt-r12", csi_im_cfg_to_release_list_ext_r12);
  }
  if (csi_im_cfg_to_add_mod_list_ext_r12_present) {
    j.write_fieldname("csi-IM-ConfigToAddModListExt-r12");
    csi_im_cfg_to_add_mod_list_ext_r12.to_json(j);
  }
  j.end_obj();
}

// CQI-ReportBoth-v1310 ::= SEQUENCE
SRSASN_CODE cqi_report_both_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_im_cfg_to_release_list_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(csi_im_cfg_to_add_mod_list_ext_r13_present, 1));

  if (csi_im_cfg_to_release_list_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_im_cfg_to_release_list_ext_r13, 1, 20, integer_packer<uint8_t>(5, 24)));
  }
  if (csi_im_cfg_to_add_mod_list_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_im_cfg_to_add_mod_list_ext_r13, 1, 20));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_both_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_im_cfg_to_release_list_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(csi_im_cfg_to_add_mod_list_ext_r13_present, 1));

  if (csi_im_cfg_to_release_list_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_im_cfg_to_release_list_ext_r13, bref, 1, 20, integer_packer<uint8_t>(5, 24)));
  }
  if (csi_im_cfg_to_add_mod_list_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_im_cfg_to_add_mod_list_ext_r13, bref, 1, 20));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_both_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_im_cfg_to_release_list_ext_r13_present) {
    j.start_array("csi-IM-ConfigToReleaseListExt-r13");
    for (const auto& e1 : csi_im_cfg_to_release_list_ext_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (csi_im_cfg_to_add_mod_list_ext_r13_present) {
    j.start_array("csi-IM-ConfigToAddModListExt-r13");
    for (const auto& e1 : csi_im_cfg_to_add_mod_list_ext_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// CQI-ReportPeriodic-r10 ::= CHOICE
void cqi_report_periodic_r10_c::set(types::options e)
{
  type_ = e;
}
void cqi_report_periodic_r10_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_int("cqi-PUCCH-ResourceIndex-r10", c.cqi_pucch_res_idx_r10);
      if (c.cqi_pucch_res_idx_p1_r10_present) {
        j.write_int("cqi-PUCCH-ResourceIndexP1-r10", c.cqi_pucch_res_idx_p1_r10);
      }
      j.write_int("cqi-pmi-ConfigIndex", c.cqi_pmi_cfg_idx);
      j.write_fieldname("cqi-FormatIndicatorPeriodic-r10");
      c.cqi_format_ind_periodic_r10.to_json(j);
      if (c.ri_cfg_idx_present) {
        j.write_int("ri-ConfigIndex", c.ri_cfg_idx);
      }
      j.write_bool("simultaneousAckNackAndCQI", c.simul_ack_nack_and_cqi);
      if (c.cqi_mask_r9_present) {
        j.write_str("cqi-Mask-r9", "setup");
      }
      if (c.csi_cfg_idx_r10_present) {
        j.write_fieldname("csi-ConfigIndex-r10");
        c.csi_cfg_idx_r10.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_r10_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.cqi_pucch_res_idx_p1_r10_present, 1));
      HANDLE_CODE(bref.pack(c.ri_cfg_idx_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_mask_r9_present, 1));
      HANDLE_CODE(bref.pack(c.csi_cfg_idx_r10_present, 1));
      HANDLE_CODE(pack_integer(bref, c.cqi_pucch_res_idx_r10, (uint16_t)0u, (uint16_t)1184u));
      if (c.cqi_pucch_res_idx_p1_r10_present) {
        HANDLE_CODE(pack_integer(bref, c.cqi_pucch_res_idx_p1_r10, (uint16_t)0u, (uint16_t)1184u));
      }
      HANDLE_CODE(pack_integer(bref, c.cqi_pmi_cfg_idx, (uint16_t)0u, (uint16_t)1023u));
      HANDLE_CODE(c.cqi_format_ind_periodic_r10.pack(bref));
      if (c.ri_cfg_idx_present) {
        HANDLE_CODE(pack_integer(bref, c.ri_cfg_idx, (uint16_t)0u, (uint16_t)1023u));
      }
      HANDLE_CODE(bref.pack(c.simul_ack_nack_and_cqi, 1));
      if (c.csi_cfg_idx_r10_present) {
        HANDLE_CODE(c.csi_cfg_idx_r10.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_r10_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.cqi_pucch_res_idx_p1_r10_present, 1));
      HANDLE_CODE(bref.unpack(c.ri_cfg_idx_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_mask_r9_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_cfg_idx_r10_present, 1));
      HANDLE_CODE(unpack_integer(c.cqi_pucch_res_idx_r10, bref, (uint16_t)0u, (uint16_t)1184u));
      if (c.cqi_pucch_res_idx_p1_r10_present) {
        HANDLE_CODE(unpack_integer(c.cqi_pucch_res_idx_p1_r10, bref, (uint16_t)0u, (uint16_t)1184u));
      }
      HANDLE_CODE(unpack_integer(c.cqi_pmi_cfg_idx, bref, (uint16_t)0u, (uint16_t)1023u));
      HANDLE_CODE(c.cqi_format_ind_periodic_r10.unpack(bref));
      if (c.ri_cfg_idx_present) {
        HANDLE_CODE(unpack_integer(c.ri_cfg_idx, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      HANDLE_CODE(bref.unpack(c.simul_ack_nack_and_cqi, 1));
      if (c.csi_cfg_idx_r10_present) {
        HANDLE_CODE(c.csi_cfg_idx_r10.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_::destroy_()
{
  switch (type_) {
    case types::wideband_cqi_r10:
      c.destroy<wideband_cqi_r10_s_>();
      break;
    case types::subband_cqi_r10:
      c.destroy<subband_cqi_r10_s_>();
      break;
    default:
      break;
  }
}
void cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::wideband_cqi_r10:
      c.init<wideband_cqi_r10_s_>();
      break;
    case types::subband_cqi_r10:
      c.init<subband_cqi_r10_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_");
  }
}
cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_::cqi_format_ind_periodic_r10_c_(
    const cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::wideband_cqi_r10:
      c.init(other.c.get<wideband_cqi_r10_s_>());
      break;
    case types::subband_cqi_r10:
      c.init(other.c.get<subband_cqi_r10_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_");
  }
}
cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_&
cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_::
operator=(const cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::wideband_cqi_r10:
      c.set(other.c.get<wideband_cqi_r10_s_>());
      break;
    case types::subband_cqi_r10:
      c.set(other.c.get<subband_cqi_r10_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_");
  }

  return *this;
}
void cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::wideband_cqi_r10:
      j.write_fieldname("widebandCQI-r10");
      j.start_obj();
      if (c.get<wideband_cqi_r10_s_>().csi_report_mode_r10_present) {
        j.write_str("csi-ReportMode-r10", c.get<wideband_cqi_r10_s_>().csi_report_mode_r10.to_string());
      }
      j.end_obj();
      break;
    case types::subband_cqi_r10:
      j.write_fieldname("subbandCQI-r10");
      j.start_obj();
      j.write_int("k", c.get<subband_cqi_r10_s_>().k);
      j.write_str("periodicityFactor-r10", c.get<subband_cqi_r10_s_>().periodicity_factor_r10.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::wideband_cqi_r10:
      HANDLE_CODE(bref.pack(c.get<wideband_cqi_r10_s_>().csi_report_mode_r10_present, 1));
      if (c.get<wideband_cqi_r10_s_>().csi_report_mode_r10_present) {
        HANDLE_CODE(c.get<wideband_cqi_r10_s_>().csi_report_mode_r10.pack(bref));
      }
      break;
    case types::subband_cqi_r10:
      HANDLE_CODE(pack_integer(bref, c.get<subband_cqi_r10_s_>().k, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(c.get<subband_cqi_r10_s_>().periodicity_factor_r10.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::wideband_cqi_r10:
      HANDLE_CODE(bref.unpack(c.get<wideband_cqi_r10_s_>().csi_report_mode_r10_present, 1));
      if (c.get<wideband_cqi_r10_s_>().csi_report_mode_r10_present) {
        HANDLE_CODE(c.get<wideband_cqi_r10_s_>().csi_report_mode_r10.unpack(bref));
      }
      break;
    case types::subband_cqi_r10:
      HANDLE_CODE(unpack_integer(c.get<subband_cqi_r10_s_>().k, bref, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(c.get<subband_cqi_r10_s_>().periodicity_factor_r10.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::cqi_format_ind_periodic_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cqi_report_periodic_r10_c::setup_s_::csi_cfg_idx_r10_c_::set(types::options e)
{
  type_ = e;
}
void cqi_report_periodic_r10_c::setup_s_::csi_cfg_idx_r10_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_int("cqi-pmi-ConfigIndex2-r10", c.cqi_pmi_cfg_idx2_r10);
      if (c.ri_cfg_idx2_r10_present) {
        j.write_int("ri-ConfigIndex2-r10", c.ri_cfg_idx2_r10);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::csi_cfg_idx_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_r10_c::setup_s_::csi_cfg_idx_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.ri_cfg_idx2_r10_present, 1));
      HANDLE_CODE(pack_integer(bref, c.cqi_pmi_cfg_idx2_r10, (uint16_t)0u, (uint16_t)1023u));
      if (c.ri_cfg_idx2_r10_present) {
        HANDLE_CODE(pack_integer(bref, c.ri_cfg_idx2_r10, (uint16_t)0u, (uint16_t)1023u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::csi_cfg_idx_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_r10_c::setup_s_::csi_cfg_idx_r10_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.ri_cfg_idx2_r10_present, 1));
      HANDLE_CODE(unpack_integer(c.cqi_pmi_cfg_idx2_r10, bref, (uint16_t)0u, (uint16_t)1023u));
      if (c.ri_cfg_idx2_r10_present) {
        HANDLE_CODE(unpack_integer(c.ri_cfg_idx2_r10, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_r10_c::setup_s_::csi_cfg_idx_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportPeriodic-v1130 ::= SEQUENCE
SRSASN_CODE cqi_report_periodic_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(simul_ack_nack_and_cqi_format3_r11_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_periodic_proc_ext_to_release_list_r11_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_periodic_proc_ext_to_add_mod_list_r11_present, 1));

  if (cqi_report_periodic_proc_ext_to_release_list_r11_present) {
    HANDLE_CODE(
        pack_dyn_seq_of(bref, cqi_report_periodic_proc_ext_to_release_list_r11, 1, 3, integer_packer<uint8_t>(1, 3)));
  }
  if (cqi_report_periodic_proc_ext_to_add_mod_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cqi_report_periodic_proc_ext_to_add_mod_list_r11, 1, 3));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(simul_ack_nack_and_cqi_format3_r11_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_periodic_proc_ext_to_release_list_r11_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_periodic_proc_ext_to_add_mod_list_r11_present, 1));

  if (cqi_report_periodic_proc_ext_to_release_list_r11_present) {
    HANDLE_CODE(
        unpack_dyn_seq_of(cqi_report_periodic_proc_ext_to_release_list_r11, bref, 1, 3, integer_packer<uint8_t>(1, 3)));
  }
  if (cqi_report_periodic_proc_ext_to_add_mod_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cqi_report_periodic_proc_ext_to_add_mod_list_r11, bref, 1, 3));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_periodic_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (simul_ack_nack_and_cqi_format3_r11_present) {
    j.write_str("simultaneousAckNackAndCQI-Format3-r11", "setup");
  }
  if (cqi_report_periodic_proc_ext_to_release_list_r11_present) {
    j.start_array("cqi-ReportPeriodicProcExtToReleaseList-r11");
    for (const auto& e1 : cqi_report_periodic_proc_ext_to_release_list_r11) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (cqi_report_periodic_proc_ext_to_add_mod_list_r11_present) {
    j.start_array("cqi-ReportPeriodicProcExtToAddModList-r11");
    for (const auto& e1 : cqi_report_periodic_proc_ext_to_add_mod_list_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// CQI-ReportPeriodic-v1310 ::= SEQUENCE
SRSASN_CODE cqi_report_periodic_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cri_report_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(simul_ack_nack_and_cqi_format4_format5_r13_present, 1));

  if (cri_report_cfg_r13_present) {
    HANDLE_CODE(cri_report_cfg_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cri_report_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(simul_ack_nack_and_cqi_format4_format5_r13_present, 1));

  if (cri_report_cfg_r13_present) {
    HANDLE_CODE(cri_report_cfg_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_periodic_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cri_report_cfg_r13_present) {
    j.write_fieldname("cri-ReportConfig-r13");
    cri_report_cfg_r13.to_json(j);
  }
  if (simul_ack_nack_and_cqi_format4_format5_r13_present) {
    j.write_str("simultaneousAckNackAndCQI-Format4-Format5-r13", "setup");
  }
  j.end_obj();
}

// CQI-ReportPeriodic-v1320 ::= SEQUENCE
SRSASN_CODE cqi_report_periodic_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(periodicity_factor_wb_r13_present, 1));

  if (periodicity_factor_wb_r13_present) {
    HANDLE_CODE(periodicity_factor_wb_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(periodicity_factor_wb_r13_present, 1));

  if (periodicity_factor_wb_r13_present) {
    HANDLE_CODE(periodicity_factor_wb_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_periodic_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (periodicity_factor_wb_r13_present) {
    j.write_str("periodicityFactorWB-r13", periodicity_factor_wb_r13.to_string());
  }
  j.end_obj();
}

// DL-AM-RLC-r15 ::= SEQUENCE
SRSASN_CODE dl_am_rlc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(t_reordering_r15.pack(bref));
  HANDLE_CODE(t_status_prohibit_r15.pack(bref));
  HANDLE_CODE(bref.pack(extended_rlc_li_field_r15, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_am_rlc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(t_reordering_r15.unpack(bref));
  HANDLE_CODE(t_status_prohibit_r15.unpack(bref));
  HANDLE_CODE(bref.unpack(extended_rlc_li_field_r15, 1));

  return SRSASN_SUCCESS;
}
void dl_am_rlc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t-Reordering-r15", t_reordering_r15.to_string());
  j.write_str("t-StatusProhibit-r15", t_status_prohibit_r15.to_string());
  j.write_bool("extended-RLC-LI-Field-r15", extended_rlc_li_field_r15);
  j.end_obj();
}

// DL-UM-RLC-r15 ::= SEQUENCE
SRSASN_CODE dl_um_rlc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sn_field_len_r15.pack(bref));
  HANDLE_CODE(t_reordering_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_um_rlc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sn_field_len_r15.unpack(bref));
  HANDLE_CODE(t_reordering_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void dl_um_rlc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sn-FieldLength-r15", sn_field_len_r15.to_string());
  j.write_str("t-Reordering-r15", t_reordering_r15.to_string());
  j.end_obj();
}

// MeasSubframePattern-r10 ::= CHOICE
void meas_sf_pattern_r10_c::destroy_()
{
  switch (type_) {
    case types::sf_pattern_fdd_r10:
      c.destroy<fixed_bitstring<40> >();
      break;
    case types::sf_pattern_tdd_r10:
      c.destroy<sf_pattern_tdd_r10_c_>();
      break;
    default:
      break;
  }
}
void meas_sf_pattern_r10_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sf_pattern_fdd_r10:
      c.init<fixed_bitstring<40> >();
      break;
    case types::sf_pattern_tdd_r10:
      c.init<sf_pattern_tdd_r10_c_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c");
  }
}
meas_sf_pattern_r10_c::meas_sf_pattern_r10_c(const meas_sf_pattern_r10_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf_pattern_fdd_r10:
      c.init(other.c.get<fixed_bitstring<40> >());
      break;
    case types::sf_pattern_tdd_r10:
      c.init(other.c.get<sf_pattern_tdd_r10_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c");
  }
}
meas_sf_pattern_r10_c& meas_sf_pattern_r10_c::operator=(const meas_sf_pattern_r10_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf_pattern_fdd_r10:
      c.set(other.c.get<fixed_bitstring<40> >());
      break;
    case types::sf_pattern_tdd_r10:
      c.set(other.c.get<sf_pattern_tdd_r10_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c");
  }

  return *this;
}
void meas_sf_pattern_r10_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf_pattern_fdd_r10:
      j.write_str("subframePatternFDD-r10", c.get<fixed_bitstring<40> >().to_string());
      break;
    case types::sf_pattern_tdd_r10:
      j.write_fieldname("subframePatternTDD-r10");
      c.get<sf_pattern_tdd_r10_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c");
  }
  j.end_obj();
}
SRSASN_CODE meas_sf_pattern_r10_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf_pattern_fdd_r10:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().pack(bref));
      break;
    case types::sf_pattern_tdd_r10:
      HANDLE_CODE(c.get<sf_pattern_tdd_r10_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_sf_pattern_r10_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf_pattern_fdd_r10:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().unpack(bref));
      break;
    case types::sf_pattern_tdd_r10:
      HANDLE_CODE(c.get<sf_pattern_tdd_r10_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_::destroy_()
{
  switch (type_) {
    case types::sf_cfg1_minus5_r10:
      c.destroy<fixed_bitstring<20> >();
      break;
    case types::sf_cfg0_r10:
      c.destroy<fixed_bitstring<70> >();
      break;
    case types::sf_cfg6_r10:
      c.destroy<fixed_bitstring<60> >();
      break;
    default:
      break;
  }
}
void meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sf_cfg1_minus5_r10:
      c.init<fixed_bitstring<20> >();
      break;
    case types::sf_cfg0_r10:
      c.init<fixed_bitstring<70> >();
      break;
    case types::sf_cfg6_r10:
      c.init<fixed_bitstring<60> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_");
  }
}
meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_::sf_pattern_tdd_r10_c_(
    const meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf_cfg1_minus5_r10:
      c.init(other.c.get<fixed_bitstring<20> >());
      break;
    case types::sf_cfg0_r10:
      c.init(other.c.get<fixed_bitstring<70> >());
      break;
    case types::sf_cfg6_r10:
      c.init(other.c.get<fixed_bitstring<60> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_");
  }
}
meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_& meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_::
                                              operator=(const meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf_cfg1_minus5_r10:
      c.set(other.c.get<fixed_bitstring<20> >());
      break;
    case types::sf_cfg0_r10:
      c.set(other.c.get<fixed_bitstring<70> >());
      break;
    case types::sf_cfg6_r10:
      c.set(other.c.get<fixed_bitstring<60> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_");
  }

  return *this;
}
void meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf_cfg1_minus5_r10:
      j.write_str("subframeConfig1-5-r10", c.get<fixed_bitstring<20> >().to_string());
      break;
    case types::sf_cfg0_r10:
      j.write_str("subframeConfig0-r10", c.get<fixed_bitstring<70> >().to_string());
      break;
    case types::sf_cfg6_r10:
      j.write_str("subframeConfig6-r10", c.get<fixed_bitstring<60> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf_cfg1_minus5_r10:
      HANDLE_CODE(c.get<fixed_bitstring<20> >().pack(bref));
      break;
    case types::sf_cfg0_r10:
      HANDLE_CODE(c.get<fixed_bitstring<70> >().pack(bref));
      break;
    case types::sf_cfg6_r10:
      HANDLE_CODE(c.get<fixed_bitstring<60> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf_cfg1_minus5_r10:
      HANDLE_CODE(c.get<fixed_bitstring<20> >().unpack(bref));
      break;
    case types::sf_cfg0_r10:
      HANDLE_CODE(c.get<fixed_bitstring<70> >().unpack(bref));
      break;
    case types::sf_cfg6_r10:
      HANDLE_CODE(c.get<fixed_bitstring<60> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_r10_c::sf_pattern_tdd_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SPDCCH-Elements-r15 ::= CHOICE
void spdcch_elems_r15_c::set(types::options e)
{
  type_ = e;
}
void spdcch_elems_r15_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.spdcch_set_cfg_id_r15_present) {
        j.write_int("spdcch-SetConfigId-r15", c.spdcch_set_cfg_id_r15);
      }
      if (c.spdcch_set_ref_sig_r15_present) {
        j.write_str("spdcch-SetReferenceSig-r15", c.spdcch_set_ref_sig_r15.to_string());
      }
      if (c.tx_type_r15_present) {
        j.write_str("transmissionType-r15", c.tx_type_r15.to_string());
      }
      if (c.spdcch_no_of_symbols_r15_present) {
        j.write_int("spdcch-NoOfSymbols-r15", c.spdcch_no_of_symbols_r15);
      }
      if (c.dmrs_scrambling_seq_int_r15_present) {
        j.write_int("dmrs-ScramblingSequenceInt-r15", c.dmrs_scrambling_seq_int_r15);
      }
      if (c.dci7_candidates_per_al_pdcch_r15_present) {
        j.start_array("dci7-CandidatesPerAL-PDCCH-r15");
        for (const auto& e1 : c.dci7_candidates_per_al_pdcch_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.dci7_candidate_sets_per_al_spdcch_r15_present) {
        j.start_array("dci7-CandidateSetsPerAL-SPDCCH-r15");
        for (const auto& e1 : c.dci7_candidate_sets_per_al_spdcch_r15) {
          j.start_array();
          for (const auto& e2 : e1) {
            j.write_int(e2);
          }
          j.end_array();
        }
        j.end_array();
      }
      if (c.res_block_assign_r15_present) {
        j.write_fieldname("resourceBlockAssignment-r15");
        j.start_obj();
        j.write_int("numberRB-InFreq-domain-r15", c.res_block_assign_r15.num_rb_in_freq_domain_r15);
        j.write_str("resourceBlockAssignment-r15", c.res_block_assign_r15.res_block_assign_r15.to_string());
        j.end_obj();
      }
      if (c.subslot_applicability_r15_present) {
        j.write_str("subslotApplicability-r15", c.subslot_applicability_r15.to_string());
      }
      if (c.al_start_point_spdcch_r15_present) {
        j.start_array("al-StartingPointSPDCCH-r15");
        for (const auto& e1 : c.al_start_point_spdcch_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.sf_type_r15_present) {
        j.write_str("subframeType-r15", c.sf_type_r15.to_string());
      }
      if (c.rate_matching_mode_r15_present) {
        j.write_str("rateMatchingMode-r15", c.rate_matching_mode_r15.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "spdcch_elems_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE spdcch_elems_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.spdcch_set_cfg_id_r15_present, 1));
      HANDLE_CODE(bref.pack(c.spdcch_set_ref_sig_r15_present, 1));
      HANDLE_CODE(bref.pack(c.tx_type_r15_present, 1));
      HANDLE_CODE(bref.pack(c.spdcch_no_of_symbols_r15_present, 1));
      HANDLE_CODE(bref.pack(c.dmrs_scrambling_seq_int_r15_present, 1));
      HANDLE_CODE(bref.pack(c.dci7_candidates_per_al_pdcch_r15_present, 1));
      HANDLE_CODE(bref.pack(c.dci7_candidate_sets_per_al_spdcch_r15_present, 1));
      HANDLE_CODE(bref.pack(c.res_block_assign_r15_present, 1));
      HANDLE_CODE(bref.pack(c.subslot_applicability_r15_present, 1));
      HANDLE_CODE(bref.pack(c.al_start_point_spdcch_r15_present, 1));
      HANDLE_CODE(bref.pack(c.sf_type_r15_present, 1));
      HANDLE_CODE(bref.pack(c.rate_matching_mode_r15_present, 1));
      if (c.spdcch_set_cfg_id_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.spdcch_set_cfg_id_r15, (uint8_t)0u, (uint8_t)3u));
      }
      if (c.spdcch_set_ref_sig_r15_present) {
        HANDLE_CODE(c.spdcch_set_ref_sig_r15.pack(bref));
      }
      if (c.tx_type_r15_present) {
        HANDLE_CODE(c.tx_type_r15.pack(bref));
      }
      if (c.spdcch_no_of_symbols_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.spdcch_no_of_symbols_r15, (uint8_t)1u, (uint8_t)2u));
      }
      if (c.dmrs_scrambling_seq_int_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.dmrs_scrambling_seq_int_r15, (uint16_t)0u, (uint16_t)503u));
      }
      if (c.dci7_candidates_per_al_pdcch_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.dci7_candidates_per_al_pdcch_r15, 1, 4, integer_packer<uint8_t>(0, 6)));
      }
      if (c.dci7_candidate_sets_per_al_spdcch_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref,
                                    c.dci7_candidate_sets_per_al_spdcch_r15,
                                    1,
                                    2,
                                    SeqOfPacker<integer_packer<uint8_t> >(1, 4, integer_packer<uint8_t>(0, 6))));
      }
      if (c.res_block_assign_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.res_block_assign_r15.num_rb_in_freq_domain_r15, (uint8_t)2u, (uint8_t)100u));
        HANDLE_CODE(c.res_block_assign_r15.res_block_assign_r15.pack(bref));
      }
      if (c.subslot_applicability_r15_present) {
        HANDLE_CODE(c.subslot_applicability_r15.pack(bref));
      }
      if (c.al_start_point_spdcch_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.al_start_point_spdcch_r15, 1, 4, integer_packer<uint8_t>(0, 49)));
      }
      if (c.sf_type_r15_present) {
        HANDLE_CODE(c.sf_type_r15.pack(bref));
      }
      if (c.rate_matching_mode_r15_present) {
        HANDLE_CODE(c.rate_matching_mode_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "spdcch_elems_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE spdcch_elems_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.spdcch_set_cfg_id_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.spdcch_set_ref_sig_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.tx_type_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.spdcch_no_of_symbols_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.dmrs_scrambling_seq_int_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.dci7_candidates_per_al_pdcch_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.dci7_candidate_sets_per_al_spdcch_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.res_block_assign_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.subslot_applicability_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.al_start_point_spdcch_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.sf_type_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.rate_matching_mode_r15_present, 1));
      if (c.spdcch_set_cfg_id_r15_present) {
        HANDLE_CODE(unpack_integer(c.spdcch_set_cfg_id_r15, bref, (uint8_t)0u, (uint8_t)3u));
      }
      if (c.spdcch_set_ref_sig_r15_present) {
        HANDLE_CODE(c.spdcch_set_ref_sig_r15.unpack(bref));
      }
      if (c.tx_type_r15_present) {
        HANDLE_CODE(c.tx_type_r15.unpack(bref));
      }
      if (c.spdcch_no_of_symbols_r15_present) {
        HANDLE_CODE(unpack_integer(c.spdcch_no_of_symbols_r15, bref, (uint8_t)1u, (uint8_t)2u));
      }
      if (c.dmrs_scrambling_seq_int_r15_present) {
        HANDLE_CODE(unpack_integer(c.dmrs_scrambling_seq_int_r15, bref, (uint16_t)0u, (uint16_t)503u));
      }
      if (c.dci7_candidates_per_al_pdcch_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.dci7_candidates_per_al_pdcch_r15, bref, 1, 4, integer_packer<uint8_t>(0, 6)));
      }
      if (c.dci7_candidate_sets_per_al_spdcch_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.dci7_candidate_sets_per_al_spdcch_r15,
                                      bref,
                                      1,
                                      2,
                                      SeqOfPacker<integer_packer<uint8_t> >(1, 4, integer_packer<uint8_t>(0, 6))));
      }
      if (c.res_block_assign_r15_present) {
        HANDLE_CODE(unpack_integer(c.res_block_assign_r15.num_rb_in_freq_domain_r15, bref, (uint8_t)2u, (uint8_t)100u));
        HANDLE_CODE(c.res_block_assign_r15.res_block_assign_r15.unpack(bref));
      }
      if (c.subslot_applicability_r15_present) {
        HANDLE_CODE(c.subslot_applicability_r15.unpack(bref));
      }
      if (c.al_start_point_spdcch_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.al_start_point_spdcch_r15, bref, 1, 4, integer_packer<uint8_t>(0, 49)));
      }
      if (c.sf_type_r15_present) {
        HANDLE_CODE(c.sf_type_r15.unpack(bref));
      }
      if (c.rate_matching_mode_r15_present) {
        HANDLE_CODE(c.rate_matching_mode_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "spdcch_elems_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SPUCCH-Elements-r15 ::= CHOICE
void spucch_elems_r15_c::set(types::options e)
{
  type_ = e;
}
void spucch_elems_r15_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.n1_subslot_spucch_an_list_r15_present) {
        j.start_array("n1SubslotSPUCCH-AN-List-r15");
        for (const auto& e1 : c.n1_subslot_spucch_an_list_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.n1_slot_spucch_fh_an_list_r15_present) {
        j.write_int("n1SlotSPUCCH-FH-AN-List-r15", c.n1_slot_spucch_fh_an_list_r15);
      }
      if (c.n1_slot_spucch_no_fh_an_list_r15_present) {
        j.write_int("n1SlotSPUCCH-NoFH-AN-List-r15", c.n1_slot_spucch_no_fh_an_list_r15);
      }
      if (c.n3_spucch_an_list_r15_present) {
        j.write_int("n3SPUCCH-AN-List-r15", c.n3_spucch_an_list_r15);
      }
      if (c.n4_spucch_slot_res_r15_present) {
        j.start_array("n4SPUCCHSlot-Resource-r15");
        for (const auto& e1 : c.n4_spucch_slot_res_r15) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.n4_spucch_subslot_res_r15_present) {
        j.start_array("n4SPUCCHSubslot-Resource-r15");
        for (const auto& e1 : c.n4_spucch_subslot_res_r15) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.n4max_coderate_slot_pucch_r15_present) {
        j.write_int("n4maxCoderateSlotPUCCH-r15", c.n4max_coderate_slot_pucch_r15);
      }
      if (c.n4max_coderate_subslot_pucch_r15_present) {
        j.write_int("n4maxCoderateSubslotPUCCH-r15", c.n4max_coderate_subslot_pucch_r15);
      }
      if (c.n4max_coderate_multi_res_slot_pucch_r15_present) {
        j.write_int("n4maxCoderateMultiResourceSlotPUCCH-r15", c.n4max_coderate_multi_res_slot_pucch_r15);
      }
      if (c.n4max_coderate_multi_res_subslot_pucch_r15_present) {
        j.write_int("n4maxCoderateMultiResourceSubslotPUCCH-r15", c.n4max_coderate_multi_res_subslot_pucch_r15);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "spucch_elems_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE spucch_elems_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.n1_subslot_spucch_an_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n1_slot_spucch_fh_an_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n1_slot_spucch_no_fh_an_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n3_spucch_an_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n4_spucch_slot_res_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n4_spucch_subslot_res_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n4max_coderate_slot_pucch_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n4max_coderate_subslot_pucch_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n4max_coderate_multi_res_slot_pucch_r15_present, 1));
      HANDLE_CODE(bref.pack(c.n4max_coderate_multi_res_subslot_pucch_r15_present, 1));
      if (c.n1_subslot_spucch_an_list_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.n1_subslot_spucch_an_list_r15, 1, 4, integer_packer<uint16_t>(0, 1319)));
      }
      if (c.n1_slot_spucch_fh_an_list_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.n1_slot_spucch_fh_an_list_r15, (uint16_t)0u, (uint16_t)1319u));
      }
      if (c.n1_slot_spucch_no_fh_an_list_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.n1_slot_spucch_no_fh_an_list_r15, (uint16_t)0u, (uint16_t)3959u));
      }
      if (c.n3_spucch_an_list_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.n3_spucch_an_list_r15, (uint16_t)0u, (uint16_t)549u));
      }
      if (c.n4_spucch_slot_res_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.n4_spucch_slot_res_r15, 1, 2));
      }
      if (c.n4_spucch_subslot_res_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.n4_spucch_subslot_res_r15, 1, 2));
      }
      if (c.n4max_coderate_slot_pucch_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.n4max_coderate_slot_pucch_r15, (uint8_t)0u, (uint8_t)7u));
      }
      if (c.n4max_coderate_subslot_pucch_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.n4max_coderate_subslot_pucch_r15, (uint8_t)0u, (uint8_t)7u));
      }
      if (c.n4max_coderate_multi_res_slot_pucch_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.n4max_coderate_multi_res_slot_pucch_r15, (uint8_t)0u, (uint8_t)7u));
      }
      if (c.n4max_coderate_multi_res_subslot_pucch_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.n4max_coderate_multi_res_subslot_pucch_r15, (uint8_t)0u, (uint8_t)7u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "spucch_elems_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE spucch_elems_r15_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.n1_subslot_spucch_an_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n1_slot_spucch_fh_an_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n1_slot_spucch_no_fh_an_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n3_spucch_an_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n4_spucch_slot_res_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n4_spucch_subslot_res_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n4max_coderate_slot_pucch_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n4max_coderate_subslot_pucch_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n4max_coderate_multi_res_slot_pucch_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.n4max_coderate_multi_res_subslot_pucch_r15_present, 1));
      if (c.n1_subslot_spucch_an_list_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.n1_subslot_spucch_an_list_r15, bref, 1, 4, integer_packer<uint16_t>(0, 1319)));
      }
      if (c.n1_slot_spucch_fh_an_list_r15_present) {
        HANDLE_CODE(unpack_integer(c.n1_slot_spucch_fh_an_list_r15, bref, (uint16_t)0u, (uint16_t)1319u));
      }
      if (c.n1_slot_spucch_no_fh_an_list_r15_present) {
        HANDLE_CODE(unpack_integer(c.n1_slot_spucch_no_fh_an_list_r15, bref, (uint16_t)0u, (uint16_t)3959u));
      }
      if (c.n3_spucch_an_list_r15_present) {
        HANDLE_CODE(unpack_integer(c.n3_spucch_an_list_r15, bref, (uint16_t)0u, (uint16_t)549u));
      }
      if (c.n4_spucch_slot_res_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.n4_spucch_slot_res_r15, bref, 1, 2));
      }
      if (c.n4_spucch_subslot_res_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.n4_spucch_subslot_res_r15, bref, 1, 2));
      }
      if (c.n4max_coderate_slot_pucch_r15_present) {
        HANDLE_CODE(unpack_integer(c.n4max_coderate_slot_pucch_r15, bref, (uint8_t)0u, (uint8_t)7u));
      }
      if (c.n4max_coderate_subslot_pucch_r15_present) {
        HANDLE_CODE(unpack_integer(c.n4max_coderate_subslot_pucch_r15, bref, (uint8_t)0u, (uint8_t)7u));
      }
      if (c.n4max_coderate_multi_res_slot_pucch_r15_present) {
        HANDLE_CODE(unpack_integer(c.n4max_coderate_multi_res_slot_pucch_r15, bref, (uint8_t)0u, (uint8_t)7u));
      }
      if (c.n4max_coderate_multi_res_subslot_pucch_r15_present) {
        HANDLE_CODE(unpack_integer(c.n4max_coderate_multi_res_subslot_pucch_r15, bref, (uint8_t)0u, (uint8_t)7u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "spucch_elems_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// TPC-Index ::= CHOICE
void tpc_idx_c::destroy_() {}
void tpc_idx_c::set(types::options e)
{
  destroy_();
  type_ = e;
}
tpc_idx_c::tpc_idx_c(const tpc_idx_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::idx_of_format3:
      c.init(other.c.get<uint8_t>());
      break;
    case types::idx_of_format3_a:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "tpc_idx_c");
  }
}
tpc_idx_c& tpc_idx_c::operator=(const tpc_idx_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::idx_of_format3:
      c.set(other.c.get<uint8_t>());
      break;
    case types::idx_of_format3_a:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "tpc_idx_c");
  }

  return *this;
}
void tpc_idx_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::idx_of_format3:
      j.write_int("indexOfFormat3", c.get<uint8_t>());
      break;
    case types::idx_of_format3_a:
      j.write_int("indexOfFormat3A", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "tpc_idx_c");
  }
  j.end_obj();
}
SRSASN_CODE tpc_idx_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::idx_of_format3:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)15u));
      break;
    case types::idx_of_format3_a:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)31u));
      break;
    default:
      log_invalid_choice_id(type_, "tpc_idx_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE tpc_idx_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::idx_of_format3:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)15u));
      break;
    case types::idx_of_format3_a:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)31u));
      break;
    default:
      log_invalid_choice_id(type_, "tpc_idx_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UL-AM-RLC-r15 ::= SEQUENCE
SRSASN_CODE ul_am_rlc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(t_poll_retx_r15.pack(bref));
  HANDLE_CODE(poll_pdu_r15.pack(bref));
  HANDLE_CODE(poll_byte_r15.pack(bref));
  HANDLE_CODE(max_retx_thres_r15.pack(bref));
  HANDLE_CODE(bref.pack(extended_rlc_li_field_r15, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_am_rlc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(t_poll_retx_r15.unpack(bref));
  HANDLE_CODE(poll_pdu_r15.unpack(bref));
  HANDLE_CODE(poll_byte_r15.unpack(bref));
  HANDLE_CODE(max_retx_thres_r15.unpack(bref));
  HANDLE_CODE(bref.unpack(extended_rlc_li_field_r15, 1));

  return SRSASN_SUCCESS;
}
void ul_am_rlc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t-PollRetransmit-r15", t_poll_retx_r15.to_string());
  j.write_str("pollPDU-r15", poll_pdu_r15.to_string());
  j.write_str("pollByte-r15", poll_byte_r15.to_string());
  j.write_str("maxRetxThreshold-r15", max_retx_thres_r15.to_string());
  j.write_bool("extended-RLC-LI-Field-r15", extended_rlc_li_field_r15);
  j.end_obj();
}

// UL-UM-RLC ::= SEQUENCE
SRSASN_CODE ul_um_rlc_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sn_field_len.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_um_rlc_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sn_field_len.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_um_rlc_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sn-FieldLength", sn_field_len.to_string());
  j.end_obj();
}

// ZeroTxPowerCSI-RS-Conf-r12 ::= CHOICE
void zero_tx_pwr_csi_rs_conf_r12_c::set(types::options e)
{
  type_ = e;
}
void zero_tx_pwr_csi_rs_conf_r12_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "zero_tx_pwr_csi_rs_conf_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE zero_tx_pwr_csi_rs_conf_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "zero_tx_pwr_csi_rs_conf_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE zero_tx_pwr_csi_rs_conf_r12_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "zero_tx_pwr_csi_rs_conf_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportConfig-r10 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cqi_report_aperiodic_r10_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_periodic_r10_present, 1));
  HANDLE_CODE(bref.pack(pmi_ri_report_r9_present, 1));
  HANDLE_CODE(bref.pack(csi_sf_pattern_cfg_r10_present, 1));

  if (cqi_report_aperiodic_r10_present) {
    HANDLE_CODE(cqi_report_aperiodic_r10.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, nom_pdsch_rs_epre_offset, (int8_t)-1, (int8_t)6));
  if (cqi_report_periodic_r10_present) {
    HANDLE_CODE(cqi_report_periodic_r10.pack(bref));
  }
  if (csi_sf_pattern_cfg_r10_present) {
    HANDLE_CODE(csi_sf_pattern_cfg_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cqi_report_aperiodic_r10_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_periodic_r10_present, 1));
  HANDLE_CODE(bref.unpack(pmi_ri_report_r9_present, 1));
  HANDLE_CODE(bref.unpack(csi_sf_pattern_cfg_r10_present, 1));

  if (cqi_report_aperiodic_r10_present) {
    HANDLE_CODE(cqi_report_aperiodic_r10.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(nom_pdsch_rs_epre_offset, bref, (int8_t)-1, (int8_t)6));
  if (cqi_report_periodic_r10_present) {
    HANDLE_CODE(cqi_report_periodic_r10.unpack(bref));
  }
  if (csi_sf_pattern_cfg_r10_present) {
    HANDLE_CODE(csi_sf_pattern_cfg_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cqi_report_aperiodic_r10_present) {
    j.write_fieldname("cqi-ReportAperiodic-r10");
    cqi_report_aperiodic_r10.to_json(j);
  }
  j.write_int("nomPDSCH-RS-EPRE-Offset", nom_pdsch_rs_epre_offset);
  if (cqi_report_periodic_r10_present) {
    j.write_fieldname("cqi-ReportPeriodic-r10");
    cqi_report_periodic_r10.to_json(j);
  }
  if (pmi_ri_report_r9_present) {
    j.write_str("pmi-RI-Report-r9", "setup");
  }
  if (csi_sf_pattern_cfg_r10_present) {
    j.write_fieldname("csi-SubframePatternConfig-r10");
    csi_sf_pattern_cfg_r10.to_json(j);
  }
  j.end_obj();
}

void cqi_report_cfg_r10_s::csi_sf_pattern_cfg_r10_c_::set(types::options e)
{
  type_ = e;
}
void cqi_report_cfg_r10_s::csi_sf_pattern_cfg_r10_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("csi-MeasSubframeSet1-r10");
      c.csi_meas_sf_set1_r10.to_json(j);
      j.write_fieldname("csi-MeasSubframeSet2-r10");
      c.csi_meas_sf_set2_r10.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_r10_s::csi_sf_pattern_cfg_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_cfg_r10_s::csi_sf_pattern_cfg_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.csi_meas_sf_set1_r10.pack(bref));
      HANDLE_CODE(c.csi_meas_sf_set2_r10.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_r10_s::csi_sf_pattern_cfg_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_r10_s::csi_sf_pattern_cfg_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.csi_meas_sf_set1_r10.unpack(bref));
      HANDLE_CODE(c.csi_meas_sf_set2_r10.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_r10_s::csi_sf_pattern_cfg_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportConfig-v1130 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cqi_report_periodic_v1130.pack(bref));
  HANDLE_CODE(cqi_report_both_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(cqi_report_periodic_v1130.unpack(bref));
  HANDLE_CODE(cqi_report_both_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("cqi-ReportPeriodic-v1130");
  cqi_report_periodic_v1130.to_json(j);
  j.write_fieldname("cqi-ReportBoth-r11");
  cqi_report_both_r11.to_json(j);
  j.end_obj();
}

// CQI-ReportConfig-v1250 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_sf_pattern_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_both_v1250_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_aperiodic_v1250_present, 1));
  HANDLE_CODE(bref.pack(alt_cqi_table_r12_present, 1));

  if (csi_sf_pattern_cfg_r12_present) {
    HANDLE_CODE(csi_sf_pattern_cfg_r12.pack(bref));
  }
  if (cqi_report_both_v1250_present) {
    HANDLE_CODE(cqi_report_both_v1250.pack(bref));
  }
  if (cqi_report_aperiodic_v1250_present) {
    HANDLE_CODE(cqi_report_aperiodic_v1250.pack(bref));
  }
  if (alt_cqi_table_r12_present) {
    HANDLE_CODE(alt_cqi_table_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_sf_pattern_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_both_v1250_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_aperiodic_v1250_present, 1));
  HANDLE_CODE(bref.unpack(alt_cqi_table_r12_present, 1));

  if (csi_sf_pattern_cfg_r12_present) {
    HANDLE_CODE(csi_sf_pattern_cfg_r12.unpack(bref));
  }
  if (cqi_report_both_v1250_present) {
    HANDLE_CODE(cqi_report_both_v1250.unpack(bref));
  }
  if (cqi_report_aperiodic_v1250_present) {
    HANDLE_CODE(cqi_report_aperiodic_v1250.unpack(bref));
  }
  if (alt_cqi_table_r12_present) {
    HANDLE_CODE(alt_cqi_table_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_sf_pattern_cfg_r12_present) {
    j.write_fieldname("csi-SubframePatternConfig-r12");
    csi_sf_pattern_cfg_r12.to_json(j);
  }
  if (cqi_report_both_v1250_present) {
    j.write_fieldname("cqi-ReportBoth-v1250");
    cqi_report_both_v1250.to_json(j);
  }
  if (cqi_report_aperiodic_v1250_present) {
    j.write_fieldname("cqi-ReportAperiodic-v1250");
    cqi_report_aperiodic_v1250.to_json(j);
  }
  if (alt_cqi_table_r12_present) {
    j.write_str("altCQI-Table-r12", alt_cqi_table_r12.to_string());
  }
  j.end_obj();
}

void cqi_report_cfg_v1250_s::csi_sf_pattern_cfg_r12_c_::set(types::options e)
{
  type_ = e;
}
void cqi_report_cfg_v1250_s::csi_sf_pattern_cfg_r12_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("csi-MeasSubframeSets-r12", c.csi_meas_sf_sets_r12.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_v1250_s::csi_sf_pattern_cfg_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_cfg_v1250_s::csi_sf_pattern_cfg_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.csi_meas_sf_sets_r12.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_v1250_s::csi_sf_pattern_cfg_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_v1250_s::csi_sf_pattern_cfg_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.csi_meas_sf_sets_r12.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_v1250_s::csi_sf_pattern_cfg_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportConfig-v1310 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cqi_report_both_v1310_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_aperiodic_v1310_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_periodic_v1310_present, 1));

  if (cqi_report_both_v1310_present) {
    HANDLE_CODE(cqi_report_both_v1310.pack(bref));
  }
  if (cqi_report_aperiodic_v1310_present) {
    HANDLE_CODE(cqi_report_aperiodic_v1310.pack(bref));
  }
  if (cqi_report_periodic_v1310_present) {
    HANDLE_CODE(cqi_report_periodic_v1310.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cqi_report_both_v1310_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_aperiodic_v1310_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_periodic_v1310_present, 1));

  if (cqi_report_both_v1310_present) {
    HANDLE_CODE(cqi_report_both_v1310.unpack(bref));
  }
  if (cqi_report_aperiodic_v1310_present) {
    HANDLE_CODE(cqi_report_aperiodic_v1310.unpack(bref));
  }
  if (cqi_report_periodic_v1310_present) {
    HANDLE_CODE(cqi_report_periodic_v1310.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cqi_report_both_v1310_present) {
    j.write_fieldname("cqi-ReportBoth-v1310");
    cqi_report_both_v1310.to_json(j);
  }
  if (cqi_report_aperiodic_v1310_present) {
    j.write_fieldname("cqi-ReportAperiodic-v1310");
    cqi_report_aperiodic_v1310.to_json(j);
  }
  if (cqi_report_periodic_v1310_present) {
    j.write_fieldname("cqi-ReportPeriodic-v1310");
    cqi_report_periodic_v1310.to_json(j);
  }
  j.end_obj();
}

// CQI-ReportConfig-v1320 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cqi_report_periodic_v1320_present, 1));

  if (cqi_report_periodic_v1320_present) {
    HANDLE_CODE(cqi_report_periodic_v1320.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cqi_report_periodic_v1320_present, 1));

  if (cqi_report_periodic_v1320_present) {
    HANDLE_CODE(cqi_report_periodic_v1320.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cqi_report_periodic_v1320_present) {
    j.write_fieldname("cqi-ReportPeriodic-v1320");
    cqi_report_periodic_v1320.to_json(j);
  }
  j.end_obj();
}

// CQI-ReportConfig-v1430 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cqi_report_aperiodic_hybrid_r14_present, 1));

  if (cqi_report_aperiodic_hybrid_r14_present) {
    HANDLE_CODE(cqi_report_aperiodic_hybrid_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cqi_report_aperiodic_hybrid_r14_present, 1));

  if (cqi_report_aperiodic_hybrid_r14_present) {
    HANDLE_CODE(cqi_report_aperiodic_hybrid_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cqi_report_aperiodic_hybrid_r14_present) {
    j.write_fieldname("cqi-ReportAperiodicHybrid-r14");
    cqi_report_aperiodic_hybrid_r14.to_json(j);
  }
  j.end_obj();
}

// CSI-RS-Config-r10 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_rs_r10_present, 1));
  HANDLE_CODE(bref.pack(zero_tx_pwr_csi_rs_r10_present, 1));

  if (csi_rs_r10_present) {
    HANDLE_CODE(csi_rs_r10.pack(bref));
  }
  if (zero_tx_pwr_csi_rs_r10_present) {
    HANDLE_CODE(zero_tx_pwr_csi_rs_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_rs_r10_present, 1));
  HANDLE_CODE(bref.unpack(zero_tx_pwr_csi_rs_r10_present, 1));

  if (csi_rs_r10_present) {
    HANDLE_CODE(csi_rs_r10.unpack(bref));
  }
  if (zero_tx_pwr_csi_rs_r10_present) {
    HANDLE_CODE(zero_tx_pwr_csi_rs_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_rs_r10_present) {
    j.write_fieldname("csi-RS-r10");
    csi_rs_r10.to_json(j);
  }
  if (zero_tx_pwr_csi_rs_r10_present) {
    j.write_fieldname("zeroTxPowerCSI-RS-r10");
    zero_tx_pwr_csi_rs_r10.to_json(j);
  }
  j.end_obj();
}

void csi_rs_cfg_r10_s::csi_rs_r10_c_::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_r10_s::csi_rs_r10_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("antennaPortsCount-r10", c.ant_ports_count_r10.to_string());
      j.write_int("resourceConfig-r10", c.res_cfg_r10);
      j.write_int("subframeConfig-r10", c.sf_cfg_r10);
      j.write_int("p-C-r10", c.p_c_r10);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_r10_s::csi_rs_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_r10_s::csi_rs_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.ant_ports_count_r10.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.res_cfg_r10, (uint8_t)0u, (uint8_t)31u));
      HANDLE_CODE(pack_integer(bref, c.sf_cfg_r10, (uint8_t)0u, (uint8_t)154u));
      HANDLE_CODE(pack_integer(bref, c.p_c_r10, (int8_t)-8, (int8_t)15));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_r10_s::csi_rs_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_r10_s::csi_rs_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.ant_ports_count_r10.unpack(bref));
      HANDLE_CODE(unpack_integer(c.res_cfg_r10, bref, (uint8_t)0u, (uint8_t)31u));
      HANDLE_CODE(unpack_integer(c.sf_cfg_r10, bref, (uint8_t)0u, (uint8_t)154u));
      HANDLE_CODE(unpack_integer(c.p_c_r10, bref, (int8_t)-8, (int8_t)15));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_r10_s::csi_rs_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-Config-v1250 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(zero_tx_pwr_csi_rs2_r12_present, 1));
  HANDLE_CODE(bref.pack(ds_zero_tx_pwr_csi_rs_r12_present, 1));

  if (zero_tx_pwr_csi_rs2_r12_present) {
    HANDLE_CODE(zero_tx_pwr_csi_rs2_r12.pack(bref));
  }
  if (ds_zero_tx_pwr_csi_rs_r12_present) {
    HANDLE_CODE(ds_zero_tx_pwr_csi_rs_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(zero_tx_pwr_csi_rs2_r12_present, 1));
  HANDLE_CODE(bref.unpack(ds_zero_tx_pwr_csi_rs_r12_present, 1));

  if (zero_tx_pwr_csi_rs2_r12_present) {
    HANDLE_CODE(zero_tx_pwr_csi_rs2_r12.unpack(bref));
  }
  if (ds_zero_tx_pwr_csi_rs_r12_present) {
    HANDLE_CODE(ds_zero_tx_pwr_csi_rs_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (zero_tx_pwr_csi_rs2_r12_present) {
    j.write_fieldname("zeroTxPowerCSI-RS2-r12");
    zero_tx_pwr_csi_rs2_r12.to_json(j);
  }
  if (ds_zero_tx_pwr_csi_rs_r12_present) {
    j.write_fieldname("ds-ZeroTxPowerCSI-RS-r12");
    ds_zero_tx_pwr_csi_rs_r12.to_json(j);
  }
  j.end_obj();
}

void csi_rs_cfg_v1250_s::ds_zero_tx_pwr_csi_rs_r12_c_::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_v1250_s::ds_zero_tx_pwr_csi_rs_r12_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("zeroTxPowerCSI-RS-List-r12");
      for (const auto& e1 : c.zero_tx_pwr_csi_rs_list_r12) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_v1250_s::ds_zero_tx_pwr_csi_rs_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_v1250_s::ds_zero_tx_pwr_csi_rs_r12_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.zero_tx_pwr_csi_rs_list_r12, 1, 5));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_v1250_s::ds_zero_tx_pwr_csi_rs_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_v1250_s::ds_zero_tx_pwr_csi_rs_r12_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.zero_tx_pwr_csi_rs_list_r12, bref, 1, 5));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_v1250_s::ds_zero_tx_pwr_csi_rs_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-Config-v1310 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(emimo_type_r13_present, 1));

  if (emimo_type_r13_present) {
    HANDLE_CODE(emimo_type_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(emimo_type_r13_present, 1));

  if (emimo_type_r13_present) {
    HANDLE_CODE(emimo_type_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (emimo_type_r13_present) {
    j.write_fieldname("eMIMO-Type-r13");
    emimo_type_r13.to_json(j);
  }
  j.end_obj();
}

// CSI-RS-Config-v1430 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dummy_present, 1));
  HANDLE_CODE(bref.pack(emimo_hybrid_r14_present, 1));
  HANDLE_CODE(bref.pack(advanced_codebook_enabled_r14_present, 1));

  if (dummy_present) {
    HANDLE_CODE(dummy.pack(bref));
  }
  if (emimo_hybrid_r14_present) {
    HANDLE_CODE(emimo_hybrid_r14.pack(bref));
  }
  if (advanced_codebook_enabled_r14_present) {
    HANDLE_CODE(bref.pack(advanced_codebook_enabled_r14, 1));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dummy_present, 1));
  HANDLE_CODE(bref.unpack(emimo_hybrid_r14_present, 1));
  HANDLE_CODE(bref.unpack(advanced_codebook_enabled_r14_present, 1));

  if (dummy_present) {
    HANDLE_CODE(dummy.unpack(bref));
  }
  if (emimo_hybrid_r14_present) {
    HANDLE_CODE(emimo_hybrid_r14.unpack(bref));
  }
  if (advanced_codebook_enabled_r14_present) {
    HANDLE_CODE(bref.unpack(advanced_codebook_enabled_r14, 1));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dummy_present) {
    j.write_fieldname("dummy");
    dummy.to_json(j);
  }
  if (emimo_hybrid_r14_present) {
    j.write_fieldname("eMIMO-Hybrid-r14");
    emimo_hybrid_r14.to_json(j);
  }
  if (advanced_codebook_enabled_r14_present) {
    j.write_bool("advancedCodebookEnabled-r14", advanced_codebook_enabled_r14);
  }
  j.end_obj();
}

// CSI-RS-ConfigZP-r11 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_zp_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, csi_rs_cfg_zp_id_r11, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(res_cfg_list_r11.pack(bref));
  HANDLE_CODE(pack_integer(bref, sf_cfg_r11, (uint8_t)0u, (uint8_t)154u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_zp_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(csi_rs_cfg_zp_id_r11, bref, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(res_cfg_list_r11.unpack(bref));
  HANDLE_CODE(unpack_integer(sf_cfg_r11, bref, (uint8_t)0u, (uint8_t)154u));

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_zp_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("csi-RS-ConfigZPId-r11", csi_rs_cfg_zp_id_r11);
  j.write_str("resourceConfigList-r11", res_cfg_list_r11.to_string());
  j.write_int("subframeConfig-r11", sf_cfg_r11);
  j.end_obj();
}

// DL-AM-RLC ::= SEQUENCE
SRSASN_CODE dl_am_rlc_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(t_reordering.pack(bref));
  HANDLE_CODE(t_status_prohibit.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_am_rlc_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(t_reordering.unpack(bref));
  HANDLE_CODE(t_status_prohibit.unpack(bref));

  return SRSASN_SUCCESS;
}
void dl_am_rlc_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t-Reordering", t_reordering.to_string());
  j.write_str("t-StatusProhibit", t_status_prohibit.to_string());
  j.end_obj();
}

// DL-UM-RLC ::= SEQUENCE
SRSASN_CODE dl_um_rlc_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sn_field_len.pack(bref));
  HANDLE_CODE(t_reordering.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_um_rlc_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sn_field_len.unpack(bref));
  HANDLE_CODE(t_reordering.unpack(bref));

  return SRSASN_SUCCESS;
}
void dl_um_rlc_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sn-FieldLength", sn_field_len.to_string());
  j.write_str("t-Reordering", t_reordering.to_string());
  j.end_obj();
}

// DeltaTxD-OffsetListSPUCCH-r15 ::= SEQUENCE
SRSASN_CODE delta_tx_d_offset_list_spucch_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(delta_tx_d_offset_spucch_format1_r15.pack(bref));
  HANDLE_CODE(delta_tx_d_offset_spucch_format1a_r15.pack(bref));
  HANDLE_CODE(delta_tx_d_offset_spucch_format1b_r15.pack(bref));
  HANDLE_CODE(delta_tx_d_offset_spucch_format3_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE delta_tx_d_offset_list_spucch_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(delta_tx_d_offset_spucch_format1_r15.unpack(bref));
  HANDLE_CODE(delta_tx_d_offset_spucch_format1a_r15.unpack(bref));
  HANDLE_CODE(delta_tx_d_offset_spucch_format1b_r15.unpack(bref));
  HANDLE_CODE(delta_tx_d_offset_spucch_format3_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void delta_tx_d_offset_list_spucch_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("deltaTxD-OffsetSPUCCH-Format1-r15", delta_tx_d_offset_spucch_format1_r15.to_string());
  j.write_str("deltaTxD-OffsetSPUCCH-Format1a-r15", delta_tx_d_offset_spucch_format1a_r15.to_string());
  j.write_str("deltaTxD-OffsetSPUCCH-Format1b-r15", delta_tx_d_offset_spucch_format1b_r15.to_string());
  j.write_str("deltaTxD-OffsetSPUCCH-Format3-r15", delta_tx_d_offset_spucch_format3_r15.to_string());
  j.end_obj();
}

// EPDCCH-SetConfig-r11 ::= SEQUENCE
SRSASN_CODE epdcch_set_cfg_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(re_map_qcl_cfg_id_r11_present, 1));

  HANDLE_CODE(pack_integer(bref, set_cfg_id_r11, (uint8_t)0u, (uint8_t)1u));
  HANDLE_CODE(tx_type_r11.pack(bref));
  HANDLE_CODE(res_block_assign_r11.num_prb_pairs_r11.pack(bref));
  HANDLE_CODE(res_block_assign_r11.res_block_assign_r11.pack(bref));
  HANDLE_CODE(pack_integer(bref, dmrs_scrambling_seq_int_r11, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(pack_integer(bref, pucch_res_start_offset_r11, (uint16_t)0u, (uint16_t)2047u));
  if (re_map_qcl_cfg_id_r11_present) {
    HANDLE_CODE(pack_integer(bref, re_map_qcl_cfg_id_r11, (uint8_t)1u, (uint8_t)4u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= csi_rs_cfg_zp_id2_r12.is_present();
    group_flags[1] |= num_prb_pairs_v1310.is_present();
    group_flags[1] |= mpdcch_cfg_r13.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(csi_rs_cfg_zp_id2_r12.is_present(), 1));
      if (csi_rs_cfg_zp_id2_r12.is_present()) {
        HANDLE_CODE(csi_rs_cfg_zp_id2_r12->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(num_prb_pairs_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(mpdcch_cfg_r13.is_present(), 1));
      if (num_prb_pairs_v1310.is_present()) {
        HANDLE_CODE(num_prb_pairs_v1310->pack(bref));
      }
      if (mpdcch_cfg_r13.is_present()) {
        HANDLE_CODE(mpdcch_cfg_r13->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE epdcch_set_cfg_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(re_map_qcl_cfg_id_r11_present, 1));

  HANDLE_CODE(unpack_integer(set_cfg_id_r11, bref, (uint8_t)0u, (uint8_t)1u));
  HANDLE_CODE(tx_type_r11.unpack(bref));
  HANDLE_CODE(res_block_assign_r11.num_prb_pairs_r11.unpack(bref));
  HANDLE_CODE(res_block_assign_r11.res_block_assign_r11.unpack(bref));
  HANDLE_CODE(unpack_integer(dmrs_scrambling_seq_int_r11, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(unpack_integer(pucch_res_start_offset_r11, bref, (uint16_t)0u, (uint16_t)2047u));
  if (re_map_qcl_cfg_id_r11_present) {
    HANDLE_CODE(unpack_integer(re_map_qcl_cfg_id_r11, bref, (uint8_t)1u, (uint8_t)4u));
  }

  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 csi_rs_cfg_zp_id2_r12_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_zp_id2_r12_present, 1));
      csi_rs_cfg_zp_id2_r12.set_present(csi_rs_cfg_zp_id2_r12_present);
      if (csi_rs_cfg_zp_id2_r12.is_present()) {
        HANDLE_CODE(csi_rs_cfg_zp_id2_r12->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool num_prb_pairs_v1310_present;
      HANDLE_CODE(bref.unpack(num_prb_pairs_v1310_present, 1));
      num_prb_pairs_v1310.set_present(num_prb_pairs_v1310_present);
      bool mpdcch_cfg_r13_present;
      HANDLE_CODE(bref.unpack(mpdcch_cfg_r13_present, 1));
      mpdcch_cfg_r13.set_present(mpdcch_cfg_r13_present);
      if (num_prb_pairs_v1310.is_present()) {
        HANDLE_CODE(num_prb_pairs_v1310->unpack(bref));
      }
      if (mpdcch_cfg_r13.is_present()) {
        HANDLE_CODE(mpdcch_cfg_r13->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void epdcch_set_cfg_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("setConfigId-r11", set_cfg_id_r11);
  j.write_str("transmissionType-r11", tx_type_r11.to_string());
  j.write_fieldname("resourceBlockAssignment-r11");
  j.start_obj();
  j.write_str("numberPRB-Pairs-r11", res_block_assign_r11.num_prb_pairs_r11.to_string());
  j.write_str("resourceBlockAssignment-r11", res_block_assign_r11.res_block_assign_r11.to_string());
  j.end_obj();
  j.write_int("dmrs-ScramblingSequenceInt-r11", dmrs_scrambling_seq_int_r11);
  j.write_int("pucch-ResourceStartOffset-r11", pucch_res_start_offset_r11);
  if (re_map_qcl_cfg_id_r11_present) {
    j.write_int("re-MappingQCL-ConfigId-r11", re_map_qcl_cfg_id_r11);
  }
  if (ext) {
    if (csi_rs_cfg_zp_id2_r12.is_present()) {
      j.write_fieldname("csi-RS-ConfigZPId2-r12");
      csi_rs_cfg_zp_id2_r12->to_json(j);
    }
    if (num_prb_pairs_v1310.is_present()) {
      j.write_fieldname("numberPRB-Pairs-v1310");
      num_prb_pairs_v1310->to_json(j);
    }
    if (mpdcch_cfg_r13.is_present()) {
      j.write_fieldname("mpdcch-config-r13");
      mpdcch_cfg_r13->to_json(j);
    }
  }
  j.end_obj();
}

void epdcch_set_cfg_r11_s::csi_rs_cfg_zp_id2_r12_c_::set(types::options e)
{
  type_ = e;
}
void epdcch_set_cfg_r11_s::csi_rs_cfg_zp_id2_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_int("setup", c);
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::csi_rs_cfg_zp_id2_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE epdcch_set_cfg_r11_s::csi_rs_cfg_zp_id2_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c, (uint8_t)1u, (uint8_t)4u));
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::csi_rs_cfg_zp_id2_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE epdcch_set_cfg_r11_s::csi_rs_cfg_zp_id2_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c, bref, (uint8_t)1u, (uint8_t)4u));
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::csi_rs_cfg_zp_id2_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void epdcch_set_cfg_r11_s::num_prb_pairs_v1310_c_::set(types::options e)
{
  type_ = e;
}
void epdcch_set_cfg_r11_s::num_prb_pairs_v1310_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.end_obj();
}
SRSASN_CODE epdcch_set_cfg_r11_s::num_prb_pairs_v1310_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  return SRSASN_SUCCESS;
}
SRSASN_CODE epdcch_set_cfg_r11_s::num_prb_pairs_v1310_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  return SRSASN_SUCCESS;
}

void epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::set(types::options e)
{
  type_ = e;
}
void epdcch_set_cfg_r11_s::mpdcch_cfg_r13_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("csi-NumRepetitionCE-r13", c.csi_num_repeat_ce_r13.to_string());
      j.write_str("mpdcch-pdsch-HoppingConfig-r13", c.mpdcch_pdsch_hop_cfg_r13.to_string());
      j.write_fieldname("mpdcch-StartSF-UESS-r13");
      c.mpdcch_start_sf_uess_r13.to_json(j);
      j.write_str("mpdcch-NumRepetition-r13", c.mpdcch_num_repeat_r13.to_string());
      j.write_int("mpdcch-Narrowband-r13", c.mpdcch_nb_r13);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.csi_num_repeat_ce_r13.pack(bref));
      HANDLE_CODE(c.mpdcch_pdsch_hop_cfg_r13.pack(bref));
      HANDLE_CODE(c.mpdcch_start_sf_uess_r13.pack(bref));
      HANDLE_CODE(c.mpdcch_num_repeat_r13.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.mpdcch_nb_r13, (uint8_t)1u, (uint8_t)16u));
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.csi_num_repeat_ce_r13.unpack(bref));
      HANDLE_CODE(c.mpdcch_pdsch_hop_cfg_r13.unpack(bref));
      HANDLE_CODE(c.mpdcch_start_sf_uess_r13.unpack(bref));
      HANDLE_CODE(c.mpdcch_num_repeat_r13.unpack(bref));
      HANDLE_CODE(unpack_integer(c.mpdcch_nb_r13, bref, (uint8_t)1u, (uint8_t)16u));
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_::destroy_() {}
void epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_::mpdcch_start_sf_uess_r13_c_(
    const epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::fdd_r13:
      c.init(other.c.get<fdd_r13_e_>());
      break;
    case types::tdd_r13:
      c.init(other.c.get<tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_");
  }
}
epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_&
epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_::
operator=(const epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::fdd_r13:
      c.set(other.c.get<fdd_r13_e_>());
      break;
    case types::tdd_r13:
      c.set(other.c.get<tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_");
  }

  return *this;
}
void epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::fdd_r13:
      j.write_str("fdd-r13", c.get<fdd_r13_e_>().to_string());
      break;
    case types::tdd_r13:
      j.write_str("tdd-r13", c.get<tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::fdd_r13:
      HANDLE_CODE(c.get<fdd_r13_e_>().pack(bref));
      break;
    case types::tdd_r13:
      HANDLE_CODE(c.get<tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::fdd_r13:
      HANDLE_CODE(c.get<fdd_r13_e_>().unpack(bref));
      break;
    case types::tdd_r13:
      HANDLE_CODE(c.get<tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_set_cfg_r11_s::mpdcch_cfg_r13_c_::setup_s_::mpdcch_start_sf_uess_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// Enable256QAM-r14 ::= CHOICE
void enable256_qam_r14_c::set(types::options e)
{
  type_ = e;
}
void enable256_qam_r14_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE enable256_qam_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE enable256_qam_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void enable256_qam_r14_c::setup_c_::destroy_()
{
  switch (type_) {
    case types::tpc_sf_set_cfgured_r14:
      c.destroy<tpc_sf_set_cfgured_r14_s_>();
      break;
    case types::tpc_sf_set_not_cfgured_r14:
      c.destroy<tpc_sf_set_not_cfgured_r14_s_>();
      break;
    default:
      break;
  }
}
void enable256_qam_r14_c::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::tpc_sf_set_cfgured_r14:
      c.init<tpc_sf_set_cfgured_r14_s_>();
      break;
    case types::tpc_sf_set_not_cfgured_r14:
      c.init<tpc_sf_set_not_cfgured_r14_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c::setup_c_");
  }
}
enable256_qam_r14_c::setup_c_::setup_c_(const enable256_qam_r14_c::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::tpc_sf_set_cfgured_r14:
      c.init(other.c.get<tpc_sf_set_cfgured_r14_s_>());
      break;
    case types::tpc_sf_set_not_cfgured_r14:
      c.init(other.c.get<tpc_sf_set_not_cfgured_r14_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c::setup_c_");
  }
}
enable256_qam_r14_c::setup_c_& enable256_qam_r14_c::setup_c_::operator=(const enable256_qam_r14_c::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::tpc_sf_set_cfgured_r14:
      c.set(other.c.get<tpc_sf_set_cfgured_r14_s_>());
      break;
    case types::tpc_sf_set_not_cfgured_r14:
      c.set(other.c.get<tpc_sf_set_not_cfgured_r14_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c::setup_c_");
  }

  return *this;
}
void enable256_qam_r14_c::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::tpc_sf_set_cfgured_r14:
      j.write_fieldname("tpc-SubframeSet-Configured-r14");
      j.start_obj();
      j.write_bool("subframeSet1-DCI-Format0-r14", c.get<tpc_sf_set_cfgured_r14_s_>().sf_set1_dci_format0_r14);
      j.write_bool("subframeSet1-DCI-Format4-r14", c.get<tpc_sf_set_cfgured_r14_s_>().sf_set1_dci_format4_r14);
      j.write_bool("subframeSet2-DCI-Format0-r14", c.get<tpc_sf_set_cfgured_r14_s_>().sf_set2_dci_format0_r14);
      j.write_bool("subframeSet2-DCI-Format4-r14", c.get<tpc_sf_set_cfgured_r14_s_>().sf_set2_dci_format4_r14);
      j.end_obj();
      break;
    case types::tpc_sf_set_not_cfgured_r14:
      j.write_fieldname("tpc-SubframeSet-NotConfigured-r14");
      j.start_obj();
      j.write_bool("dci-Format0-r14", c.get<tpc_sf_set_not_cfgured_r14_s_>().dci_format0_r14);
      j.write_bool("dci-Format4-r14", c.get<tpc_sf_set_not_cfgured_r14_s_>().dci_format4_r14);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE enable256_qam_r14_c::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::tpc_sf_set_cfgured_r14:
      HANDLE_CODE(bref.pack(c.get<tpc_sf_set_cfgured_r14_s_>().sf_set1_dci_format0_r14, 1));
      HANDLE_CODE(bref.pack(c.get<tpc_sf_set_cfgured_r14_s_>().sf_set1_dci_format4_r14, 1));
      HANDLE_CODE(bref.pack(c.get<tpc_sf_set_cfgured_r14_s_>().sf_set2_dci_format0_r14, 1));
      HANDLE_CODE(bref.pack(c.get<tpc_sf_set_cfgured_r14_s_>().sf_set2_dci_format4_r14, 1));
      break;
    case types::tpc_sf_set_not_cfgured_r14:
      HANDLE_CODE(bref.pack(c.get<tpc_sf_set_not_cfgured_r14_s_>().dci_format0_r14, 1));
      HANDLE_CODE(bref.pack(c.get<tpc_sf_set_not_cfgured_r14_s_>().dci_format4_r14, 1));
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE enable256_qam_r14_c::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::tpc_sf_set_cfgured_r14:
      HANDLE_CODE(bref.unpack(c.get<tpc_sf_set_cfgured_r14_s_>().sf_set1_dci_format0_r14, 1));
      HANDLE_CODE(bref.unpack(c.get<tpc_sf_set_cfgured_r14_s_>().sf_set1_dci_format4_r14, 1));
      HANDLE_CODE(bref.unpack(c.get<tpc_sf_set_cfgured_r14_s_>().sf_set2_dci_format0_r14, 1));
      HANDLE_CODE(bref.unpack(c.get<tpc_sf_set_cfgured_r14_s_>().sf_set2_dci_format4_r14, 1));
      break;
    case types::tpc_sf_set_not_cfgured_r14:
      HANDLE_CODE(bref.unpack(c.get<tpc_sf_set_not_cfgured_r14_s_>().dci_format0_r14, 1));
      HANDLE_CODE(bref.unpack(c.get<tpc_sf_set_not_cfgured_r14_s_>().dci_format4_r14, 1));
      break;
    default:
      log_invalid_choice_id(type_, "enable256_qam_r14_c::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// LogicalChannelConfig ::= SEQUENCE
SRSASN_CODE lc_ch_cfg_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ul_specific_params_present, 1));

  if (ul_specific_params_present) {
    HANDLE_CODE(bref.pack(ul_specific_params.lc_ch_group_present, 1));
    HANDLE_CODE(pack_integer(bref, ul_specific_params.prio, (uint8_t)1u, (uint8_t)16u));
    HANDLE_CODE(ul_specific_params.prioritised_bit_rate.pack(bref));
    HANDLE_CODE(ul_specific_params.bucket_size_dur.pack(bref));
    if (ul_specific_params.lc_ch_group_present) {
      HANDLE_CODE(pack_integer(bref, ul_specific_params.lc_ch_group, (uint8_t)0u, (uint8_t)3u));
    }
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= lc_ch_sr_mask_r9_present;
    group_flags[1] |= lc_ch_sr_prohibit_r12_present;
    group_flags[2] |= laa_ul_allowed_r14_present;
    group_flags[2] |= bit_rate_query_prohibit_timer_r14_present;
    group_flags[3] |= allowed_tti_lens_r15.is_present();
    group_flags[3] |= lc_ch_sr_restrict_r15.is_present();
    group_flags[3] |= chl_access_prio_r15.is_present();
    group_flags[3] |= lch_cell_restrict_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(lc_ch_sr_mask_r9_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(lc_ch_sr_prohibit_r12_present, 1));
      if (lc_ch_sr_prohibit_r12_present) {
        HANDLE_CODE(bref.pack(lc_ch_sr_prohibit_r12, 1));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(laa_ul_allowed_r14_present, 1));
      HANDLE_CODE(bref.pack(bit_rate_query_prohibit_timer_r14_present, 1));
      if (laa_ul_allowed_r14_present) {
        HANDLE_CODE(bref.pack(laa_ul_allowed_r14, 1));
      }
      if (bit_rate_query_prohibit_timer_r14_present) {
        HANDLE_CODE(bit_rate_query_prohibit_timer_r14.pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(allowed_tti_lens_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(lc_ch_sr_restrict_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(chl_access_prio_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(lch_cell_restrict_r15_present, 1));
      if (allowed_tti_lens_r15.is_present()) {
        HANDLE_CODE(allowed_tti_lens_r15->pack(bref));
      }
      if (lc_ch_sr_restrict_r15.is_present()) {
        HANDLE_CODE(lc_ch_sr_restrict_r15->pack(bref));
      }
      if (chl_access_prio_r15.is_present()) {
        HANDLE_CODE(chl_access_prio_r15->pack(bref));
      }
      if (lch_cell_restrict_r15_present) {
        HANDLE_CODE(lch_cell_restrict_r15.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE lc_ch_cfg_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ul_specific_params_present, 1));

  if (ul_specific_params_present) {
    HANDLE_CODE(bref.unpack(ul_specific_params.lc_ch_group_present, 1));
    HANDLE_CODE(unpack_integer(ul_specific_params.prio, bref, (uint8_t)1u, (uint8_t)16u));
    HANDLE_CODE(ul_specific_params.prioritised_bit_rate.unpack(bref));
    HANDLE_CODE(ul_specific_params.bucket_size_dur.unpack(bref));
    if (ul_specific_params.lc_ch_group_present) {
      HANDLE_CODE(unpack_integer(ul_specific_params.lc_ch_group, bref, (uint8_t)0u, (uint8_t)3u));
    }
  }

  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(lc_ch_sr_mask_r9_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(lc_ch_sr_prohibit_r12_present, 1));
      if (lc_ch_sr_prohibit_r12_present) {
        HANDLE_CODE(bref.unpack(lc_ch_sr_prohibit_r12, 1));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(laa_ul_allowed_r14_present, 1));
      HANDLE_CODE(bref.unpack(bit_rate_query_prohibit_timer_r14_present, 1));
      if (laa_ul_allowed_r14_present) {
        HANDLE_CODE(bref.unpack(laa_ul_allowed_r14, 1));
      }
      if (bit_rate_query_prohibit_timer_r14_present) {
        HANDLE_CODE(bit_rate_query_prohibit_timer_r14.unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool allowed_tti_lens_r15_present;
      HANDLE_CODE(bref.unpack(allowed_tti_lens_r15_present, 1));
      allowed_tti_lens_r15.set_present(allowed_tti_lens_r15_present);
      bool lc_ch_sr_restrict_r15_present;
      HANDLE_CODE(bref.unpack(lc_ch_sr_restrict_r15_present, 1));
      lc_ch_sr_restrict_r15.set_present(lc_ch_sr_restrict_r15_present);
      bool chl_access_prio_r15_present;
      HANDLE_CODE(bref.unpack(chl_access_prio_r15_present, 1));
      chl_access_prio_r15.set_present(chl_access_prio_r15_present);
      HANDLE_CODE(bref.unpack(lch_cell_restrict_r15_present, 1));
      if (allowed_tti_lens_r15.is_present()) {
        HANDLE_CODE(allowed_tti_lens_r15->unpack(bref));
      }
      if (lc_ch_sr_restrict_r15.is_present()) {
        HANDLE_CODE(lc_ch_sr_restrict_r15->unpack(bref));
      }
      if (chl_access_prio_r15.is_present()) {
        HANDLE_CODE(chl_access_prio_r15->unpack(bref));
      }
      if (lch_cell_restrict_r15_present) {
        HANDLE_CODE(lch_cell_restrict_r15.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void lc_ch_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ul_specific_params_present) {
    j.write_fieldname("ul-SpecificParameters");
    j.start_obj();
    j.write_int("priority", ul_specific_params.prio);
    j.write_str("prioritisedBitRate", ul_specific_params.prioritised_bit_rate.to_string());
    j.write_str("bucketSizeDuration", ul_specific_params.bucket_size_dur.to_string());
    if (ul_specific_params.lc_ch_group_present) {
      j.write_int("logicalChannelGroup", ul_specific_params.lc_ch_group);
    }
    j.end_obj();
  }
  if (ext) {
    if (lc_ch_sr_mask_r9_present) {
      j.write_str("logicalChannelSR-Mask-r9", "setup");
    }
    if (lc_ch_sr_prohibit_r12_present) {
      j.write_bool("logicalChannelSR-Prohibit-r12", lc_ch_sr_prohibit_r12);
    }
    if (laa_ul_allowed_r14_present) {
      j.write_bool("laa-UL-Allowed-r14", laa_ul_allowed_r14);
    }
    if (bit_rate_query_prohibit_timer_r14_present) {
      j.write_str("bitRateQueryProhibitTimer-r14", bit_rate_query_prohibit_timer_r14.to_string());
    }
    if (allowed_tti_lens_r15.is_present()) {
      j.write_fieldname("allowedTTI-Lengths-r15");
      allowed_tti_lens_r15->to_json(j);
    }
    if (lc_ch_sr_restrict_r15.is_present()) {
      j.write_fieldname("logicalChannelSR-Restriction-r15");
      lc_ch_sr_restrict_r15->to_json(j);
    }
    if (chl_access_prio_r15.is_present()) {
      j.write_fieldname("channellAccessPriority-r15");
      chl_access_prio_r15->to_json(j);
    }
    if (lch_cell_restrict_r15_present) {
      j.write_str("lch-CellRestriction-r15", lch_cell_restrict_r15.to_string());
    }
  }
  j.end_obj();
}

void lc_ch_cfg_s::allowed_tti_lens_r15_c_::set(types::options e)
{
  type_ = e;
}
void lc_ch_cfg_s::allowed_tti_lens_r15_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_bool("shortTTI-r15", c.short_tti_r15);
      j.write_bool("subframeTTI-r15", c.sf_tti_r15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::allowed_tti_lens_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE lc_ch_cfg_s::allowed_tti_lens_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.short_tti_r15, 1));
      HANDLE_CODE(bref.pack(c.sf_tti_r15, 1));
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::allowed_tti_lens_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE lc_ch_cfg_s::allowed_tti_lens_r15_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.short_tti_r15, 1));
      HANDLE_CODE(bref.unpack(c.sf_tti_r15, 1));
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::allowed_tti_lens_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void lc_ch_cfg_s::lc_ch_sr_restrict_r15_c_::set(types::options e)
{
  type_ = e;
}
void lc_ch_cfg_s::lc_ch_sr_restrict_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::lc_ch_sr_restrict_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE lc_ch_cfg_s::lc_ch_sr_restrict_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::lc_ch_sr_restrict_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE lc_ch_cfg_s::lc_ch_sr_restrict_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::lc_ch_sr_restrict_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void lc_ch_cfg_s::chl_access_prio_r15_c_::set(types::options e)
{
  type_ = e;
}
void lc_ch_cfg_s::chl_access_prio_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_int("setup", c);
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::chl_access_prio_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE lc_ch_cfg_s::chl_access_prio_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c, (uint8_t)1u, (uint8_t)4u));
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::chl_access_prio_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE lc_ch_cfg_s::chl_access_prio_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c, bref, (uint8_t)1u, (uint8_t)4u));
      break;
    default:
      log_invalid_choice_id(type_, "lc_ch_cfg_s::chl_access_prio_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PDSCH-RE-MappingQCL-Config-r11 ::= SEQUENCE
SRSASN_CODE pdsch_re_map_qcl_cfg_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(optional_set_of_fields_r11_present, 1));
  HANDLE_CODE(bref.pack(qcl_csi_rs_cfg_nzp_id_r11_present, 1));

  HANDLE_CODE(pack_integer(bref, pdsch_re_map_qcl_cfg_id_r11, (uint8_t)1u, (uint8_t)4u));
  if (optional_set_of_fields_r11_present) {
    HANDLE_CODE(bref.pack(optional_set_of_fields_r11.mbsfn_sf_cfg_list_r11_present, 1));
    HANDLE_CODE(optional_set_of_fields_r11.crs_ports_count_r11.pack(bref));
    HANDLE_CODE(pack_integer(bref, optional_set_of_fields_r11.crs_freq_shift_r11, (uint8_t)0u, (uint8_t)5u));
    if (optional_set_of_fields_r11.mbsfn_sf_cfg_list_r11_present) {
      HANDLE_CODE(optional_set_of_fields_r11.mbsfn_sf_cfg_list_r11.pack(bref));
    }
    HANDLE_CODE(optional_set_of_fields_r11.pdsch_start_r11.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, csi_rs_cfg_zp_id_r11, (uint8_t)1u, (uint8_t)4u));
  if (qcl_csi_rs_cfg_nzp_id_r11_present) {
    HANDLE_CODE(pack_integer(bref, qcl_csi_rs_cfg_nzp_id_r11, (uint8_t)1u, (uint8_t)3u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= mbsfn_sf_cfg_list_v1430.is_present();
    group_flags[1] |= codeword_one_cfg_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mbsfn_sf_cfg_list_v1430.is_present(), 1));
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(mbsfn_sf_cfg_list_v1430->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(codeword_one_cfg_v1530.is_present(), 1));
      if (codeword_one_cfg_v1530.is_present()) {
        HANDLE_CODE(codeword_one_cfg_v1530->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_re_map_qcl_cfg_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(optional_set_of_fields_r11_present, 1));
  HANDLE_CODE(bref.unpack(qcl_csi_rs_cfg_nzp_id_r11_present, 1));

  HANDLE_CODE(unpack_integer(pdsch_re_map_qcl_cfg_id_r11, bref, (uint8_t)1u, (uint8_t)4u));
  if (optional_set_of_fields_r11_present) {
    HANDLE_CODE(bref.unpack(optional_set_of_fields_r11.mbsfn_sf_cfg_list_r11_present, 1));
    HANDLE_CODE(optional_set_of_fields_r11.crs_ports_count_r11.unpack(bref));
    HANDLE_CODE(unpack_integer(optional_set_of_fields_r11.crs_freq_shift_r11, bref, (uint8_t)0u, (uint8_t)5u));
    if (optional_set_of_fields_r11.mbsfn_sf_cfg_list_r11_present) {
      HANDLE_CODE(optional_set_of_fields_r11.mbsfn_sf_cfg_list_r11.unpack(bref));
    }
    HANDLE_CODE(optional_set_of_fields_r11.pdsch_start_r11.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(csi_rs_cfg_zp_id_r11, bref, (uint8_t)1u, (uint8_t)4u));
  if (qcl_csi_rs_cfg_nzp_id_r11_present) {
    HANDLE_CODE(unpack_integer(qcl_csi_rs_cfg_nzp_id_r11, bref, (uint8_t)1u, (uint8_t)3u));
  }

  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 mbsfn_sf_cfg_list_v1430_present;
      HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_list_v1430_present, 1));
      mbsfn_sf_cfg_list_v1430.set_present(mbsfn_sf_cfg_list_v1430_present);
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(mbsfn_sf_cfg_list_v1430->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool codeword_one_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(codeword_one_cfg_v1530_present, 1));
      codeword_one_cfg_v1530.set_present(codeword_one_cfg_v1530_present);
      if (codeword_one_cfg_v1530.is_present()) {
        HANDLE_CODE(codeword_one_cfg_v1530->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void pdsch_re_map_qcl_cfg_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("pdsch-RE-MappingQCL-ConfigId-r11", pdsch_re_map_qcl_cfg_id_r11);
  if (optional_set_of_fields_r11_present) {
    j.write_fieldname("optionalSetOfFields-r11");
    j.start_obj();
    j.write_str("crs-PortsCount-r11", optional_set_of_fields_r11.crs_ports_count_r11.to_string());
    j.write_int("crs-FreqShift-r11", optional_set_of_fields_r11.crs_freq_shift_r11);
    if (optional_set_of_fields_r11.mbsfn_sf_cfg_list_r11_present) {
      j.write_fieldname("mbsfn-SubframeConfigList-r11");
      optional_set_of_fields_r11.mbsfn_sf_cfg_list_r11.to_json(j);
    }
    j.write_str("pdsch-Start-r11", optional_set_of_fields_r11.pdsch_start_r11.to_string());
    j.end_obj();
  }
  j.write_int("csi-RS-ConfigZPId-r11", csi_rs_cfg_zp_id_r11);
  if (qcl_csi_rs_cfg_nzp_id_r11_present) {
    j.write_int("qcl-CSI-RS-ConfigNZPId-r11", qcl_csi_rs_cfg_nzp_id_r11);
  }
  if (ext) {
    if (mbsfn_sf_cfg_list_v1430.is_present()) {
      j.write_fieldname("mbsfn-SubframeConfigList-v1430");
      mbsfn_sf_cfg_list_v1430->to_json(j);
    }
    if (codeword_one_cfg_v1530.is_present()) {
      j.write_fieldname("codewordOneConfig-v1530");
      codeword_one_cfg_v1530->to_json(j);
    }
  }
  j.end_obj();
}

void pdsch_re_map_qcl_cfg_r11_s::optional_set_of_fields_r11_s_::mbsfn_sf_cfg_list_r11_c_::set(types::options e)
{
  type_ = e;
}
void pdsch_re_map_qcl_cfg_r11_s::optional_set_of_fields_r11_s_::mbsfn_sf_cfg_list_r11_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("subframeConfigList");
      for (const auto& e1 : c.sf_cfg_list) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_,
                            "pdsch_re_map_qcl_cfg_r11_s::optional_set_of_fields_r11_s_::mbsfn_sf_cfg_list_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE
pdsch_re_map_qcl_cfg_r11_s::optional_set_of_fields_r11_s_::mbsfn_sf_cfg_list_r11_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.sf_cfg_list, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_,
                            "pdsch_re_map_qcl_cfg_r11_s::optional_set_of_fields_r11_s_::mbsfn_sf_cfg_list_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_re_map_qcl_cfg_r11_s::optional_set_of_fields_r11_s_::mbsfn_sf_cfg_list_r11_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.sf_cfg_list, bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_,
                            "pdsch_re_map_qcl_cfg_r11_s::optional_set_of_fields_r11_s_::mbsfn_sf_cfg_list_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pdsch_re_map_qcl_cfg_r11_s::mbsfn_sf_cfg_list_v1430_c_::set(types::options e)
{
  type_ = e;
}
void pdsch_re_map_qcl_cfg_r11_s::mbsfn_sf_cfg_list_v1430_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("subframeConfigList-v1430");
      for (const auto& e1 : c.sf_cfg_list_v1430) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdsch_re_map_qcl_cfg_r11_s::mbsfn_sf_cfg_list_v1430_c_");
  }
  j.end_obj();
}
SRSASN_CODE pdsch_re_map_qcl_cfg_r11_s::mbsfn_sf_cfg_list_v1430_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.sf_cfg_list_v1430, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "pdsch_re_map_qcl_cfg_r11_s::mbsfn_sf_cfg_list_v1430_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_re_map_qcl_cfg_r11_s::mbsfn_sf_cfg_list_v1430_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.sf_cfg_list_v1430, bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "pdsch_re_map_qcl_cfg_r11_s::mbsfn_sf_cfg_list_v1430_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pdsch_re_map_qcl_cfg_r11_s::codeword_one_cfg_v1530_c_::set(types::options e)
{
  type_ = e;
}
void pdsch_re_map_qcl_cfg_r11_s::codeword_one_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("crs-PortsCount-v1530", c.crs_ports_count_v1530.to_string());
      j.write_int("crs-FreqShift-v1530", c.crs_freq_shift_v1530);
      if (c.mbsfn_sf_cfg_list_v1530_present) {
        j.start_array("mbsfn-SubframeConfigList-v1530");
        for (const auto& e1 : c.mbsfn_sf_cfg_list_v1530) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.mbsfn_sf_cfg_list_ext_v1530_present) {
        j.start_array("mbsfn-SubframeConfigListExt-v1530");
        for (const auto& e1 : c.mbsfn_sf_cfg_list_ext_v1530) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.write_str("pdsch-Start-v1530", c.pdsch_start_v1530.to_string());
      j.write_int("csi-RS-ConfigZPId-v1530", c.csi_rs_cfg_zp_id_v1530);
      if (c.qcl_csi_rs_cfg_nzp_id_v1530_present) {
        j.write_int("qcl-CSI-RS-ConfigNZPId-v1530", c.qcl_csi_rs_cfg_nzp_id_v1530);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdsch_re_map_qcl_cfg_r11_s::codeword_one_cfg_v1530_c_");
  }
  j.end_obj();
}
SRSASN_CODE pdsch_re_map_qcl_cfg_r11_s::codeword_one_cfg_v1530_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.mbsfn_sf_cfg_list_v1530_present, 1));
      HANDLE_CODE(bref.pack(c.mbsfn_sf_cfg_list_ext_v1530_present, 1));
      HANDLE_CODE(bref.pack(c.qcl_csi_rs_cfg_nzp_id_v1530_present, 1));
      HANDLE_CODE(c.crs_ports_count_v1530.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.crs_freq_shift_v1530, (uint8_t)0u, (uint8_t)5u));
      if (c.mbsfn_sf_cfg_list_v1530_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.mbsfn_sf_cfg_list_v1530, 1, 8));
      }
      if (c.mbsfn_sf_cfg_list_ext_v1530_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.mbsfn_sf_cfg_list_ext_v1530, 1, 8));
      }
      HANDLE_CODE(c.pdsch_start_v1530.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.csi_rs_cfg_zp_id_v1530, (uint8_t)1u, (uint8_t)4u));
      if (c.qcl_csi_rs_cfg_nzp_id_v1530_present) {
        HANDLE_CODE(pack_integer(bref, c.qcl_csi_rs_cfg_nzp_id_v1530, (uint8_t)1u, (uint8_t)3u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pdsch_re_map_qcl_cfg_r11_s::codeword_one_cfg_v1530_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_re_map_qcl_cfg_r11_s::codeword_one_cfg_v1530_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.mbsfn_sf_cfg_list_v1530_present, 1));
      HANDLE_CODE(bref.unpack(c.mbsfn_sf_cfg_list_ext_v1530_present, 1));
      HANDLE_CODE(bref.unpack(c.qcl_csi_rs_cfg_nzp_id_v1530_present, 1));
      HANDLE_CODE(c.crs_ports_count_v1530.unpack(bref));
      HANDLE_CODE(unpack_integer(c.crs_freq_shift_v1530, bref, (uint8_t)0u, (uint8_t)5u));
      if (c.mbsfn_sf_cfg_list_v1530_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.mbsfn_sf_cfg_list_v1530, bref, 1, 8));
      }
      if (c.mbsfn_sf_cfg_list_ext_v1530_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.mbsfn_sf_cfg_list_ext_v1530, bref, 1, 8));
      }
      HANDLE_CODE(c.pdsch_start_v1530.unpack(bref));
      HANDLE_CODE(unpack_integer(c.csi_rs_cfg_zp_id_v1530, bref, (uint8_t)1u, (uint8_t)4u));
      if (c.qcl_csi_rs_cfg_nzp_id_v1530_present) {
        HANDLE_CODE(unpack_integer(c.qcl_csi_rs_cfg_nzp_id_v1530, bref, (uint8_t)1u, (uint8_t)3u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pdsch_re_map_qcl_cfg_r11_s::codeword_one_cfg_v1530_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RLC-Config-r15 ::= SEQUENCE
SRSASN_CODE rlc_cfg_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(reestablish_rlc_r15_present, 1));
  HANDLE_CODE(bref.pack(rlc_out_of_order_delivery_r15_present, 1));

  HANDLE_CODE(mode_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_cfg_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(reestablish_rlc_r15_present, 1));
  HANDLE_CODE(bref.unpack(rlc_out_of_order_delivery_r15_present, 1));

  HANDLE_CODE(mode_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void rlc_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("mode-r15");
  mode_r15.to_json(j);
  if (reestablish_rlc_r15_present) {
    j.write_str("reestablishRLC-r15", "true");
  }
  if (rlc_out_of_order_delivery_r15_present) {
    j.write_str("rlc-OutOfOrderDelivery-r15", "true");
  }
  j.end_obj();
}

void rlc_cfg_r15_s::mode_r15_c_::destroy_()
{
  switch (type_) {
    case types::am_r15:
      c.destroy<am_r15_s_>();
      break;
    case types::um_bi_dir_r15:
      c.destroy<um_bi_dir_r15_s_>();
      break;
    case types::um_uni_dir_ul_r15:
      c.destroy<um_uni_dir_ul_r15_s_>();
      break;
    case types::um_uni_dir_dl_r15:
      c.destroy<um_uni_dir_dl_r15_s_>();
      break;
    default:
      break;
  }
}
void rlc_cfg_r15_s::mode_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::am_r15:
      c.init<am_r15_s_>();
      break;
    case types::um_bi_dir_r15:
      c.init<um_bi_dir_r15_s_>();
      break;
    case types::um_uni_dir_ul_r15:
      c.init<um_uni_dir_ul_r15_s_>();
      break;
    case types::um_uni_dir_dl_r15:
      c.init<um_uni_dir_dl_r15_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_r15_s::mode_r15_c_");
  }
}
rlc_cfg_r15_s::mode_r15_c_::mode_r15_c_(const rlc_cfg_r15_s::mode_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::am_r15:
      c.init(other.c.get<am_r15_s_>());
      break;
    case types::um_bi_dir_r15:
      c.init(other.c.get<um_bi_dir_r15_s_>());
      break;
    case types::um_uni_dir_ul_r15:
      c.init(other.c.get<um_uni_dir_ul_r15_s_>());
      break;
    case types::um_uni_dir_dl_r15:
      c.init(other.c.get<um_uni_dir_dl_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_r15_s::mode_r15_c_");
  }
}
rlc_cfg_r15_s::mode_r15_c_& rlc_cfg_r15_s::mode_r15_c_::operator=(const rlc_cfg_r15_s::mode_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::am_r15:
      c.set(other.c.get<am_r15_s_>());
      break;
    case types::um_bi_dir_r15:
      c.set(other.c.get<um_bi_dir_r15_s_>());
      break;
    case types::um_uni_dir_ul_r15:
      c.set(other.c.get<um_uni_dir_ul_r15_s_>());
      break;
    case types::um_uni_dir_dl_r15:
      c.set(other.c.get<um_uni_dir_dl_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_r15_s::mode_r15_c_");
  }

  return *this;
}
void rlc_cfg_r15_s::mode_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::am_r15:
      j.write_fieldname("am-r15");
      j.start_obj();
      j.write_fieldname("ul-AM-RLC-r15");
      c.get<am_r15_s_>().ul_am_rlc_r15.to_json(j);
      j.write_fieldname("dl-AM-RLC-r15");
      c.get<am_r15_s_>().dl_am_rlc_r15.to_json(j);
      j.end_obj();
      break;
    case types::um_bi_dir_r15:
      j.write_fieldname("um-Bi-Directional-r15");
      j.start_obj();
      j.write_fieldname("ul-UM-RLC-r15");
      c.get<um_bi_dir_r15_s_>().ul_um_rlc_r15.to_json(j);
      j.write_fieldname("dl-UM-RLC-r15");
      c.get<um_bi_dir_r15_s_>().dl_um_rlc_r15.to_json(j);
      j.end_obj();
      break;
    case types::um_uni_dir_ul_r15:
      j.write_fieldname("um-Uni-Directional-UL-r15");
      j.start_obj();
      j.write_fieldname("ul-UM-RLC-r15");
      c.get<um_uni_dir_ul_r15_s_>().ul_um_rlc_r15.to_json(j);
      j.end_obj();
      break;
    case types::um_uni_dir_dl_r15:
      j.write_fieldname("um-Uni-Directional-DL-r15");
      j.start_obj();
      j.write_fieldname("dl-UM-RLC-r15");
      c.get<um_uni_dir_dl_r15_s_>().dl_um_rlc_r15.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_r15_s::mode_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE rlc_cfg_r15_s::mode_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::am_r15:
      HANDLE_CODE(c.get<am_r15_s_>().ul_am_rlc_r15.pack(bref));
      HANDLE_CODE(c.get<am_r15_s_>().dl_am_rlc_r15.pack(bref));
      break;
    case types::um_bi_dir_r15:
      HANDLE_CODE(c.get<um_bi_dir_r15_s_>().ul_um_rlc_r15.pack(bref));
      HANDLE_CODE(c.get<um_bi_dir_r15_s_>().dl_um_rlc_r15.pack(bref));
      break;
    case types::um_uni_dir_ul_r15:
      HANDLE_CODE(c.get<um_uni_dir_ul_r15_s_>().ul_um_rlc_r15.pack(bref));
      break;
    case types::um_uni_dir_dl_r15:
      HANDLE_CODE(c.get<um_uni_dir_dl_r15_s_>().dl_um_rlc_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_r15_s::mode_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_cfg_r15_s::mode_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::am_r15:
      HANDLE_CODE(c.get<am_r15_s_>().ul_am_rlc_r15.unpack(bref));
      HANDLE_CODE(c.get<am_r15_s_>().dl_am_rlc_r15.unpack(bref));
      break;
    case types::um_bi_dir_r15:
      HANDLE_CODE(c.get<um_bi_dir_r15_s_>().ul_um_rlc_r15.unpack(bref));
      HANDLE_CODE(c.get<um_bi_dir_r15_s_>().dl_um_rlc_r15.unpack(bref));
      break;
    case types::um_uni_dir_ul_r15:
      HANDLE_CODE(c.get<um_uni_dir_ul_r15_s_>().ul_um_rlc_r15.unpack(bref));
      break;
    case types::um_uni_dir_dl_r15:
      HANDLE_CODE(c.get<um_uni_dir_dl_r15_s_>().dl_um_rlc_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_r15_s::mode_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// TPC-PDCCH-Config ::= CHOICE
void tpc_pdcch_cfg_c::set(types::options e)
{
  type_ = e;
}
void tpc_pdcch_cfg_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("tpc-RNTI", c.tpc_rnti.to_string());
      j.write_fieldname("tpc-Index");
      c.tpc_idx.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "tpc_pdcch_cfg_c");
  }
  j.end_obj();
}
SRSASN_CODE tpc_pdcch_cfg_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.tpc_rnti.pack(bref));
      HANDLE_CODE(c.tpc_idx.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "tpc_pdcch_cfg_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE tpc_pdcch_cfg_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.tpc_rnti.unpack(bref));
      HANDLE_CODE(c.tpc_idx.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "tpc_pdcch_cfg_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UL-AM-RLC ::= SEQUENCE
SRSASN_CODE ul_am_rlc_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(t_poll_retx.pack(bref));
  HANDLE_CODE(poll_pdu.pack(bref));
  HANDLE_CODE(poll_byte.pack(bref));
  HANDLE_CODE(max_retx_thres.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_am_rlc_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(t_poll_retx.unpack(bref));
  HANDLE_CODE(poll_pdu.unpack(bref));
  HANDLE_CODE(poll_byte.unpack(bref));
  HANDLE_CODE(max_retx_thres.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_am_rlc_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t-PollRetransmit", t_poll_retx.to_string());
  j.write_str("pollPDU", poll_pdu.to_string());
  j.write_str("pollByte", poll_byte.to_string());
  j.write_str("maxRetxThreshold", max_retx_thres.to_string());
  j.end_obj();
}

// AntennaInfoDedicatedSTTI-r15 ::= CHOICE
void ant_info_ded_stti_r15_c::set(types::options e)
{
  type_ = e;
}
void ant_info_ded_stti_r15_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.tx_mode_dl_mbsfn_r15_present) {
        j.write_str("transmissionModeDL-MBSFN-r15", c.tx_mode_dl_mbsfn_r15.to_string());
      }
      if (c.tx_mode_dl_non_mbsfn_r15_present) {
        j.write_str("transmissionModeDL-nonMBSFN-r15", c.tx_mode_dl_non_mbsfn_r15.to_string());
      }
      if (c.codebook_subset_restrict_present) {
        j.write_fieldname("codebookSubsetRestriction");
        c.codebook_subset_restrict.to_json(j);
      }
      if (c.max_layers_mimo_stti_r15_present) {
        j.write_str("maxLayersMIMO-STTI-r15", c.max_layers_mimo_stti_r15.to_string());
      }
      j.write_bool("slotSubslotPDSCH-TxDiv-2Layer-r15", c.slot_subslot_pdsch_tx_div_minus2_layer_r15);
      j.write_bool("slotSubslotPDSCH-TxDiv-4Layer-r15", c.slot_subslot_pdsch_tx_div_minus4_layer_r15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE ant_info_ded_stti_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.tx_mode_dl_mbsfn_r15_present, 1));
      HANDLE_CODE(bref.pack(c.tx_mode_dl_non_mbsfn_r15_present, 1));
      HANDLE_CODE(bref.pack(c.codebook_subset_restrict_present, 1));
      HANDLE_CODE(bref.pack(c.max_layers_mimo_stti_r15_present, 1));
      if (c.tx_mode_dl_mbsfn_r15_present) {
        HANDLE_CODE(c.tx_mode_dl_mbsfn_r15.pack(bref));
      }
      if (c.tx_mode_dl_non_mbsfn_r15_present) {
        HANDLE_CODE(c.tx_mode_dl_non_mbsfn_r15.pack(bref));
      }
      if (c.codebook_subset_restrict_present) {
        HANDLE_CODE(c.codebook_subset_restrict.pack(bref));
      }
      if (c.max_layers_mimo_stti_r15_present) {
        HANDLE_CODE(c.max_layers_mimo_stti_r15.pack(bref));
      }
      HANDLE_CODE(bref.pack(c.slot_subslot_pdsch_tx_div_minus2_layer_r15, 1));
      HANDLE_CODE(bref.pack(c.slot_subslot_pdsch_tx_div_minus4_layer_r15, 1));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_stti_r15_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.tx_mode_dl_mbsfn_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.tx_mode_dl_non_mbsfn_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.codebook_subset_restrict_present, 1));
      HANDLE_CODE(bref.unpack(c.max_layers_mimo_stti_r15_present, 1));
      if (c.tx_mode_dl_mbsfn_r15_present) {
        HANDLE_CODE(c.tx_mode_dl_mbsfn_r15.unpack(bref));
      }
      if (c.tx_mode_dl_non_mbsfn_r15_present) {
        HANDLE_CODE(c.tx_mode_dl_non_mbsfn_r15.unpack(bref));
      }
      if (c.codebook_subset_restrict_present) {
        HANDLE_CODE(c.codebook_subset_restrict.unpack(bref));
      }
      if (c.max_layers_mimo_stti_r15_present) {
        HANDLE_CODE(c.max_layers_mimo_stti_r15.unpack(bref));
      }
      HANDLE_CODE(bref.unpack(c.slot_subslot_pdsch_tx_div_minus2_layer_r15, 1));
      HANDLE_CODE(bref.unpack(c.slot_subslot_pdsch_tx_div_minus4_layer_r15, 1));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_::destroy_()
{
  switch (type_) {
    case types::n2_tx_ant_tm3_r15:
      c.destroy<fixed_bitstring<2> >();
      break;
    case types::n4_tx_ant_tm3_r15:
      c.destroy<fixed_bitstring<4> >();
      break;
    case types::n2_tx_ant_tm4_r15:
      c.destroy<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm4_r15:
      c.destroy<fixed_bitstring<64> >();
      break;
    case types::n2_tx_ant_tm5_r15:
      c.destroy<fixed_bitstring<4> >();
      break;
    case types::n4_tx_ant_tm5_r15:
      c.destroy<fixed_bitstring<16> >();
      break;
    case types::n2_tx_ant_tm6_r15:
      c.destroy<fixed_bitstring<4> >();
      break;
    case types::n4_tx_ant_tm6_r15:
      c.destroy<fixed_bitstring<16> >();
      break;
    case types::n2_tx_ant_tm8_r15:
      c.destroy<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm8_r15:
      c.destroy<fixed_bitstring<64> >();
      break;
    case types::n2_tx_ant_tm9and10_r15:
      c.destroy<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm9and10_r15:
      c.destroy<fixed_bitstring<96> >();
      break;
    case types::n8_tx_ant_tm9and10_r15:
      c.destroy<fixed_bitstring<109> >();
      break;
    default:
      break;
  }
}
void ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::n2_tx_ant_tm3_r15:
      c.init<fixed_bitstring<2> >();
      break;
    case types::n4_tx_ant_tm3_r15:
      c.init<fixed_bitstring<4> >();
      break;
    case types::n2_tx_ant_tm4_r15:
      c.init<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm4_r15:
      c.init<fixed_bitstring<64> >();
      break;
    case types::n2_tx_ant_tm5_r15:
      c.init<fixed_bitstring<4> >();
      break;
    case types::n4_tx_ant_tm5_r15:
      c.init<fixed_bitstring<16> >();
      break;
    case types::n2_tx_ant_tm6_r15:
      c.init<fixed_bitstring<4> >();
      break;
    case types::n4_tx_ant_tm6_r15:
      c.init<fixed_bitstring<16> >();
      break;
    case types::n2_tx_ant_tm8_r15:
      c.init<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm8_r15:
      c.init<fixed_bitstring<64> >();
      break;
    case types::n2_tx_ant_tm9and10_r15:
      c.init<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm9and10_r15:
      c.init<fixed_bitstring<96> >();
      break;
    case types::n8_tx_ant_tm9and10_r15:
      c.init<fixed_bitstring<109> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_");
  }
}
ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_::codebook_subset_restrict_c_(
    const ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::n2_tx_ant_tm3_r15:
      c.init(other.c.get<fixed_bitstring<2> >());
      break;
    case types::n4_tx_ant_tm3_r15:
      c.init(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n2_tx_ant_tm4_r15:
      c.init(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm4_r15:
      c.init(other.c.get<fixed_bitstring<64> >());
      break;
    case types::n2_tx_ant_tm5_r15:
      c.init(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n4_tx_ant_tm5_r15:
      c.init(other.c.get<fixed_bitstring<16> >());
      break;
    case types::n2_tx_ant_tm6_r15:
      c.init(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n4_tx_ant_tm6_r15:
      c.init(other.c.get<fixed_bitstring<16> >());
      break;
    case types::n2_tx_ant_tm8_r15:
      c.init(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm8_r15:
      c.init(other.c.get<fixed_bitstring<64> >());
      break;
    case types::n2_tx_ant_tm9and10_r15:
      c.init(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm9and10_r15:
      c.init(other.c.get<fixed_bitstring<96> >());
      break;
    case types::n8_tx_ant_tm9and10_r15:
      c.init(other.c.get<fixed_bitstring<109> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_");
  }
}
ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_&
ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_::
operator=(const ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::n2_tx_ant_tm3_r15:
      c.set(other.c.get<fixed_bitstring<2> >());
      break;
    case types::n4_tx_ant_tm3_r15:
      c.set(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n2_tx_ant_tm4_r15:
      c.set(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm4_r15:
      c.set(other.c.get<fixed_bitstring<64> >());
      break;
    case types::n2_tx_ant_tm5_r15:
      c.set(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n4_tx_ant_tm5_r15:
      c.set(other.c.get<fixed_bitstring<16> >());
      break;
    case types::n2_tx_ant_tm6_r15:
      c.set(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n4_tx_ant_tm6_r15:
      c.set(other.c.get<fixed_bitstring<16> >());
      break;
    case types::n2_tx_ant_tm8_r15:
      c.set(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm8_r15:
      c.set(other.c.get<fixed_bitstring<64> >());
      break;
    case types::n2_tx_ant_tm9and10_r15:
      c.set(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm9and10_r15:
      c.set(other.c.get<fixed_bitstring<96> >());
      break;
    case types::n8_tx_ant_tm9and10_r15:
      c.set(other.c.get<fixed_bitstring<109> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_");
  }

  return *this;
}
void ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::n2_tx_ant_tm3_r15:
      j.write_str("n2TxAntenna-tm3-r15", c.get<fixed_bitstring<2> >().to_string());
      break;
    case types::n4_tx_ant_tm3_r15:
      j.write_str("n4TxAntenna-tm3-r15", c.get<fixed_bitstring<4> >().to_string());
      break;
    case types::n2_tx_ant_tm4_r15:
      j.write_str("n2TxAntenna-tm4-r15", c.get<fixed_bitstring<6> >().to_string());
      break;
    case types::n4_tx_ant_tm4_r15:
      j.write_str("n4TxAntenna-tm4-r15", c.get<fixed_bitstring<64> >().to_string());
      break;
    case types::n2_tx_ant_tm5_r15:
      j.write_str("n2TxAntenna-tm5-r15", c.get<fixed_bitstring<4> >().to_string());
      break;
    case types::n4_tx_ant_tm5_r15:
      j.write_str("n4TxAntenna-tm5-r15", c.get<fixed_bitstring<16> >().to_string());
      break;
    case types::n2_tx_ant_tm6_r15:
      j.write_str("n2TxAntenna-tm6-r15", c.get<fixed_bitstring<4> >().to_string());
      break;
    case types::n4_tx_ant_tm6_r15:
      j.write_str("n4TxAntenna-tm6-r15", c.get<fixed_bitstring<16> >().to_string());
      break;
    case types::n2_tx_ant_tm8_r15:
      j.write_str("n2TxAntenna-tm8-r15", c.get<fixed_bitstring<6> >().to_string());
      break;
    case types::n4_tx_ant_tm8_r15:
      j.write_str("n4TxAntenna-tm8-r15", c.get<fixed_bitstring<64> >().to_string());
      break;
    case types::n2_tx_ant_tm9and10_r15:
      j.write_str("n2TxAntenna-tm9and10-r15", c.get<fixed_bitstring<6> >().to_string());
      break;
    case types::n4_tx_ant_tm9and10_r15:
      j.write_str("n4TxAntenna-tm9and10-r15", c.get<fixed_bitstring<96> >().to_string());
      break;
    case types::n8_tx_ant_tm9and10_r15:
      j.write_str("n8TxAntenna-tm9and10-r15", c.get<fixed_bitstring<109> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_");
  }
  j.end_obj();
}
SRSASN_CODE ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::n2_tx_ant_tm3_r15:
      HANDLE_CODE(c.get<fixed_bitstring<2> >().pack(bref));
      break;
    case types::n4_tx_ant_tm3_r15:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().pack(bref));
      break;
    case types::n2_tx_ant_tm4_r15:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().pack(bref));
      break;
    case types::n4_tx_ant_tm4_r15:
      HANDLE_CODE(c.get<fixed_bitstring<64> >().pack(bref));
      break;
    case types::n2_tx_ant_tm5_r15:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().pack(bref));
      break;
    case types::n4_tx_ant_tm5_r15:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().pack(bref));
      break;
    case types::n2_tx_ant_tm6_r15:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().pack(bref));
      break;
    case types::n4_tx_ant_tm6_r15:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().pack(bref));
      break;
    case types::n2_tx_ant_tm8_r15:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().pack(bref));
      break;
    case types::n4_tx_ant_tm8_r15:
      HANDLE_CODE(c.get<fixed_bitstring<64> >().pack(bref));
      break;
    case types::n2_tx_ant_tm9and10_r15:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().pack(bref));
      break;
    case types::n4_tx_ant_tm9and10_r15:
      HANDLE_CODE(c.get<fixed_bitstring<96> >().pack(bref));
      break;
    case types::n8_tx_ant_tm9and10_r15:
      HANDLE_CODE(c.get<fixed_bitstring<109> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::n2_tx_ant_tm3_r15:
      HANDLE_CODE(c.get<fixed_bitstring<2> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm3_r15:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().unpack(bref));
      break;
    case types::n2_tx_ant_tm4_r15:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm4_r15:
      HANDLE_CODE(c.get<fixed_bitstring<64> >().unpack(bref));
      break;
    case types::n2_tx_ant_tm5_r15:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm5_r15:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().unpack(bref));
      break;
    case types::n2_tx_ant_tm6_r15:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm6_r15:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().unpack(bref));
      break;
    case types::n2_tx_ant_tm8_r15:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm8_r15:
      HANDLE_CODE(c.get<fixed_bitstring<64> >().unpack(bref));
      break;
    case types::n2_tx_ant_tm9and10_r15:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm9and10_r15:
      HANDLE_CODE(c.get<fixed_bitstring<96> >().unpack(bref));
      break;
    case types::n8_tx_ant_tm9and10_r15:
      HANDLE_CODE(c.get<fixed_bitstring<109> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_stti_r15_c::setup_s_::codebook_subset_restrict_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// AntennaInfoUL-STTI-r15 ::= SEQUENCE
SRSASN_CODE ant_info_ul_stti_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tx_mode_ul_stti_r15_present, 1));

  if (tx_mode_ul_stti_r15_present) {
    HANDLE_CODE(tx_mode_ul_stti_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ul_stti_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tx_mode_ul_stti_r15_present, 1));

  if (tx_mode_ul_stti_r15_present) {
    HANDLE_CODE(tx_mode_ul_stti_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ant_info_ul_stti_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tx_mode_ul_stti_r15_present) {
    j.write_str("transmissionModeUL-STTI-r15", tx_mode_ul_stti_r15.to_string());
  }
  j.end_obj();
}

// CQI-ReportConfig-r15 ::= CHOICE
void cqi_report_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void cqi_report_cfg_r15_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.cqi_report_cfg_r10_present) {
        j.write_fieldname("cqi-ReportConfig-r10");
        c.cqi_report_cfg_r10.to_json(j);
      }
      if (c.cqi_report_cfg_v1130_present) {
        j.write_fieldname("cqi-ReportConfig-v1130");
        c.cqi_report_cfg_v1130.to_json(j);
      }
      if (c.cqi_report_cfg_pcell_v1250_present) {
        j.write_fieldname("cqi-ReportConfigPCell-v1250");
        c.cqi_report_cfg_pcell_v1250.to_json(j);
      }
      if (c.cqi_report_cfg_v1310_present) {
        j.write_fieldname("cqi-ReportConfig-v1310");
        c.cqi_report_cfg_v1310.to_json(j);
      }
      if (c.cqi_report_cfg_v1320_present) {
        j.write_fieldname("cqi-ReportConfig-v1320");
        c.cqi_report_cfg_v1320.to_json(j);
      }
      if (c.cqi_report_cfg_v1430_present) {
        j.write_fieldname("cqi-ReportConfig-v1430");
        c.cqi_report_cfg_v1430.to_json(j);
      }
      if (c.alt_cqi_table_minus1024_qam_r15_present) {
        j.write_str("altCQI-Table-1024QAM-r15", c.alt_cqi_table_minus1024_qam_r15.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_cfg_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.cqi_report_cfg_r10_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_report_cfg_v1130_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_report_cfg_pcell_v1250_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_report_cfg_v1310_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_report_cfg_v1320_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_report_cfg_v1430_present, 1));
      HANDLE_CODE(bref.pack(c.alt_cqi_table_minus1024_qam_r15_present, 1));
      if (c.cqi_report_cfg_r10_present) {
        HANDLE_CODE(c.cqi_report_cfg_r10.pack(bref));
      }
      if (c.cqi_report_cfg_v1130_present) {
        HANDLE_CODE(c.cqi_report_cfg_v1130.pack(bref));
      }
      if (c.cqi_report_cfg_pcell_v1250_present) {
        HANDLE_CODE(c.cqi_report_cfg_pcell_v1250.pack(bref));
      }
      if (c.cqi_report_cfg_v1310_present) {
        HANDLE_CODE(c.cqi_report_cfg_v1310.pack(bref));
      }
      if (c.cqi_report_cfg_v1320_present) {
        HANDLE_CODE(c.cqi_report_cfg_v1320.pack(bref));
      }
      if (c.cqi_report_cfg_v1430_present) {
        HANDLE_CODE(c.cqi_report_cfg_v1430.pack(bref));
      }
      if (c.alt_cqi_table_minus1024_qam_r15_present) {
        HANDLE_CODE(c.alt_cqi_table_minus1024_qam_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_r15_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.cqi_report_cfg_r10_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_report_cfg_v1130_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_report_cfg_pcell_v1250_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_report_cfg_v1310_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_report_cfg_v1320_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_report_cfg_v1430_present, 1));
      HANDLE_CODE(bref.unpack(c.alt_cqi_table_minus1024_qam_r15_present, 1));
      if (c.cqi_report_cfg_r10_present) {
        HANDLE_CODE(c.cqi_report_cfg_r10.unpack(bref));
      }
      if (c.cqi_report_cfg_v1130_present) {
        HANDLE_CODE(c.cqi_report_cfg_v1130.unpack(bref));
      }
      if (c.cqi_report_cfg_pcell_v1250_present) {
        HANDLE_CODE(c.cqi_report_cfg_pcell_v1250.unpack(bref));
      }
      if (c.cqi_report_cfg_v1310_present) {
        HANDLE_CODE(c.cqi_report_cfg_v1310.unpack(bref));
      }
      if (c.cqi_report_cfg_v1320_present) {
        HANDLE_CODE(c.cqi_report_cfg_v1320.unpack(bref));
      }
      if (c.cqi_report_cfg_v1430_present) {
        HANDLE_CODE(c.cqi_report_cfg_v1430.unpack(bref));
      }
      if (c.alt_cqi_table_minus1024_qam_r15_present) {
        HANDLE_CODE(c.alt_cqi_table_minus1024_qam_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportPeriodic ::= CHOICE
void cqi_report_periodic_c::set(types::options e)
{
  type_ = e;
}
void cqi_report_periodic_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_int("cqi-PUCCH-ResourceIndex", c.cqi_pucch_res_idx);
      j.write_int("cqi-pmi-ConfigIndex", c.cqi_pmi_cfg_idx);
      j.write_fieldname("cqi-FormatIndicatorPeriodic");
      c.cqi_format_ind_periodic.to_json(j);
      if (c.ri_cfg_idx_present) {
        j.write_int("ri-ConfigIndex", c.ri_cfg_idx);
      }
      j.write_bool("simultaneousAckNackAndCQI", c.simul_ack_nack_and_cqi);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_c");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.ri_cfg_idx_present, 1));
      HANDLE_CODE(pack_integer(bref, c.cqi_pucch_res_idx, (uint16_t)0u, (uint16_t)1185u));
      HANDLE_CODE(pack_integer(bref, c.cqi_pmi_cfg_idx, (uint16_t)0u, (uint16_t)1023u));
      HANDLE_CODE(c.cqi_format_ind_periodic.pack(bref));
      if (c.ri_cfg_idx_present) {
        HANDLE_CODE(pack_integer(bref, c.ri_cfg_idx, (uint16_t)0u, (uint16_t)1023u));
      }
      HANDLE_CODE(bref.pack(c.simul_ack_nack_and_cqi, 1));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_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.ri_cfg_idx_present, 1));
      HANDLE_CODE(unpack_integer(c.cqi_pucch_res_idx, bref, (uint16_t)0u, (uint16_t)1185u));
      HANDLE_CODE(unpack_integer(c.cqi_pmi_cfg_idx, bref, (uint16_t)0u, (uint16_t)1023u));
      HANDLE_CODE(c.cqi_format_ind_periodic.unpack(bref));
      if (c.ri_cfg_idx_present) {
        HANDLE_CODE(unpack_integer(c.ri_cfg_idx, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      HANDLE_CODE(bref.unpack(c.simul_ack_nack_and_cqi, 1));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_::set(types::options e)
{
  type_ = e;
}
void cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::wideband_cqi:
      break;
    case types::subband_cqi:
      j.write_fieldname("subbandCQI");
      j.start_obj();
      j.write_int("k", c.k);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::wideband_cqi:
      break;
    case types::subband_cqi:
      HANDLE_CODE(pack_integer(bref, c.k, (uint8_t)1u, (uint8_t)4u));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::wideband_cqi:
      break;
    case types::subband_cqi:
      HANDLE_CODE(unpack_integer(c.k, bref, (uint8_t)1u, (uint8_t)4u));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CRS-AssistanceInfo-r11 ::= SEQUENCE
SRSASN_CODE crs_assist_info_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, pci_r11, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(ant_ports_count_r11.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, mbsfn_sf_cfg_list_r11, 1, 8));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= mbsfn_sf_cfg_list_v1430.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mbsfn_sf_cfg_list_v1430.is_present(), 1));
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *mbsfn_sf_cfg_list_v1430, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE crs_assist_info_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(pci_r11, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(ant_ports_count_r11.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(mbsfn_sf_cfg_list_r11, bref, 1, 8));

  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 mbsfn_sf_cfg_list_v1430_present;
      HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_list_v1430_present, 1));
      mbsfn_sf_cfg_list_v1430.set_present(mbsfn_sf_cfg_list_v1430_present);
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*mbsfn_sf_cfg_list_v1430, bref, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void crs_assist_info_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r11", pci_r11);
  j.write_str("antennaPortsCount-r11", ant_ports_count_r11.to_string());
  j.start_array("mbsfn-SubframeConfigList-r11");
  for (const auto& e1 : mbsfn_sf_cfg_list_r11) {
    e1.to_json(j);
  }
  j.end_array();
  if (ext) {
    if (mbsfn_sf_cfg_list_v1430.is_present()) {
      j.start_array("mbsfn-SubframeConfigList-v1430");
      for (const auto& e1 : *mbsfn_sf_cfg_list_v1430) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// CRS-AssistanceInfo-r13 ::= SEQUENCE
SRSASN_CODE crs_assist_info_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(mbsfn_sf_cfg_list_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, pci_r13, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(ant_ports_count_r13.pack(bref));
  if (mbsfn_sf_cfg_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mbsfn_sf_cfg_list_r13, 1, 8));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= mbsfn_sf_cfg_list_v1430.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mbsfn_sf_cfg_list_v1430.is_present(), 1));
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *mbsfn_sf_cfg_list_v1430, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE crs_assist_info_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_list_r13_present, 1));

  HANDLE_CODE(unpack_integer(pci_r13, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(ant_ports_count_r13.unpack(bref));
  if (mbsfn_sf_cfg_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mbsfn_sf_cfg_list_r13, bref, 1, 8));
  }

  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 mbsfn_sf_cfg_list_v1430_present;
      HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_list_v1430_present, 1));
      mbsfn_sf_cfg_list_v1430.set_present(mbsfn_sf_cfg_list_v1430_present);
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*mbsfn_sf_cfg_list_v1430, bref, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void crs_assist_info_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r13", pci_r13);
  j.write_str("antennaPortsCount-r13", ant_ports_count_r13.to_string());
  if (mbsfn_sf_cfg_list_r13_present) {
    j.start_array("mbsfn-SubframeConfigList-r13");
    for (const auto& e1 : mbsfn_sf_cfg_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (ext) {
    if (mbsfn_sf_cfg_list_v1430.is_present()) {
      j.start_array("mbsfn-SubframeConfigList-v1430");
      for (const auto& e1 : *mbsfn_sf_cfg_list_v1430) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// CRS-AssistanceInfo-r15 ::= SEQUENCE
SRSASN_CODE crs_assist_info_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(crs_intf_mitig_enabled_minus15_present, 1));

  HANDLE_CODE(pack_integer(bref, pci_r15, (uint16_t)0u, (uint16_t)503u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE crs_assist_info_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(crs_intf_mitig_enabled_minus15_present, 1));

  HANDLE_CODE(unpack_integer(pci_r15, bref, (uint16_t)0u, (uint16_t)503u));

  return SRSASN_SUCCESS;
}
void crs_assist_info_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r15", pci_r15);
  if (crs_intf_mitig_enabled_minus15_present) {
    j.write_str("crs-IntfMitigEnabled-15", "enabled");
  }
  j.end_obj();
}

// CSI-RS-Config-r15 ::= CHOICE
void csi_rs_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_r15_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.csi_rs_cfg_r10_present) {
        j.write_fieldname("csi-RS-Config-r10");
        c.csi_rs_cfg_r10.to_json(j);
      }
      if (c.csi_rs_cfg_v1250_present) {
        j.write_fieldname("csi-RS-Config-v1250");
        c.csi_rs_cfg_v1250.to_json(j);
      }
      if (c.csi_rs_cfg_v1310_present) {
        j.write_fieldname("csi-RS-Config-v1310");
        c.csi_rs_cfg_v1310.to_json(j);
      }
      if (c.csi_rs_cfg_v1430_present) {
        j.write_fieldname("csi-RS-Config-v1430");
        c.csi_rs_cfg_v1430.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_r10_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_v1250_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_v1310_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_v1430_present, 1));
      if (c.csi_rs_cfg_r10_present) {
        HANDLE_CODE(c.csi_rs_cfg_r10.pack(bref));
      }
      if (c.csi_rs_cfg_v1250_present) {
        HANDLE_CODE(c.csi_rs_cfg_v1250.pack(bref));
      }
      if (c.csi_rs_cfg_v1310_present) {
        HANDLE_CODE(c.csi_rs_cfg_v1310.pack(bref));
      }
      if (c.csi_rs_cfg_v1430_present) {
        HANDLE_CODE(c.csi_rs_cfg_v1430.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_r15_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.csi_rs_cfg_r10_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_v1250_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_v1310_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_v1430_present, 1));
      if (c.csi_rs_cfg_r10_present) {
        HANDLE_CODE(c.csi_rs_cfg_r10.unpack(bref));
      }
      if (c.csi_rs_cfg_v1250_present) {
        HANDLE_CODE(c.csi_rs_cfg_v1250.unpack(bref));
      }
      if (c.csi_rs_cfg_v1310_present) {
        HANDLE_CODE(c.csi_rs_cfg_v1310.unpack(bref));
      }
      if (c.csi_rs_cfg_v1430_present) {
        HANDLE_CODE(c.csi_rs_cfg_v1430.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSI-RS-ConfigZP-ApList-r14 ::= CHOICE
void csi_rs_cfg_zp_ap_list_r14_c::set(types::options e)
{
  type_ = e;
}
void csi_rs_cfg_zp_ap_list_r14_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_zp_ap_list_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE csi_rs_cfg_zp_ap_list_r14_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, 1, 4));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_zp_ap_list_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_zp_ap_list_r14_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, bref, 1, 4));
      break;
    default:
      log_invalid_choice_id(type_, "csi_rs_cfg_zp_ap_list_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DMRS-Config-r11 ::= CHOICE
void dmrs_cfg_r11_c::set(types::options e)
{
  type_ = e;
}
void dmrs_cfg_r11_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_int("scramblingIdentity-r11", c.scrambling_id_r11);
      j.write_int("scramblingIdentity2-r11", c.scrambling_id2_r11);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "dmrs_cfg_r11_c");
  }
  j.end_obj();
}
SRSASN_CODE dmrs_cfg_r11_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.scrambling_id_r11, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(pack_integer(bref, c.scrambling_id2_r11, (uint16_t)0u, (uint16_t)503u));
      break;
    default:
      log_invalid_choice_id(type_, "dmrs_cfg_r11_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dmrs_cfg_r11_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.scrambling_id_r11, bref, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(unpack_integer(c.scrambling_id2_r11, bref, (uint16_t)0u, (uint16_t)503u));
      break;
    default:
      log_invalid_choice_id(type_, "dmrs_cfg_r11_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DMRS-Config-v1310 ::= SEQUENCE
SRSASN_CODE dmrs_cfg_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dmrs_table_alt_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE dmrs_cfg_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dmrs_table_alt_r13_present, 1));

  return SRSASN_SUCCESS;
}
void dmrs_cfg_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dmrs_table_alt_r13_present) {
    j.write_str("dmrs-tableAlt-r13", "true");
  }
  j.end_obj();
}

// DeltaTxD-OffsetListPUCCH-r10 ::= SEQUENCE
SRSASN_CODE delta_tx_d_offset_list_pucch_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(delta_tx_d_offset_pucch_format1_r10.pack(bref));
  HANDLE_CODE(delta_tx_d_offset_pucch_format1a1b_r10.pack(bref));
  HANDLE_CODE(delta_tx_d_offset_pucch_format22a2b_r10.pack(bref));
  HANDLE_CODE(delta_tx_d_offset_pucch_format3_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE delta_tx_d_offset_list_pucch_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(delta_tx_d_offset_pucch_format1_r10.unpack(bref));
  HANDLE_CODE(delta_tx_d_offset_pucch_format1a1b_r10.unpack(bref));
  HANDLE_CODE(delta_tx_d_offset_pucch_format22a2b_r10.unpack(bref));
  HANDLE_CODE(delta_tx_d_offset_pucch_format3_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void delta_tx_d_offset_list_pucch_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("deltaTxD-OffsetPUCCH-Format1-r10", delta_tx_d_offset_pucch_format1_r10.to_string());
  j.write_str("deltaTxD-OffsetPUCCH-Format1a1b-r10", delta_tx_d_offset_pucch_format1a1b_r10.to_string());
  j.write_str("deltaTxD-OffsetPUCCH-Format22a2b-r10", delta_tx_d_offset_pucch_format22a2b_r10.to_string());
  j.write_str("deltaTxD-OffsetPUCCH-Format3-r10", delta_tx_d_offset_pucch_format3_r10.to_string());
  j.end_obj();
}

// DeltaTxD-OffsetListPUCCH-v1130 ::= SEQUENCE
SRSASN_CODE delta_tx_d_offset_list_pucch_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(delta_tx_d_offset_pucch_format1b_cs_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE delta_tx_d_offset_list_pucch_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(delta_tx_d_offset_pucch_format1b_cs_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void delta_tx_d_offset_list_pucch_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("deltaTxD-OffsetPUCCH-Format1bCS-r11", delta_tx_d_offset_pucch_format1b_cs_r11.to_string());
  j.end_obj();
}

// EIMTA-MainConfig-r12 ::= CHOICE
void eimta_main_cfg_r12_c::set(types::options e)
{
  type_ = e;
}
void eimta_main_cfg_r12_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("eimta-RNTI-r12", c.eimta_rnti_r12.to_string());
      j.write_str("eimta-CommandPeriodicity-r12", c.eimta_cmd_periodicity_r12.to_string());
      j.write_str("eimta-CommandSubframeSet-r12", c.eimta_cmd_sf_set_r12.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE eimta_main_cfg_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.eimta_rnti_r12.pack(bref));
      HANDLE_CODE(c.eimta_cmd_periodicity_r12.pack(bref));
      HANDLE_CODE(c.eimta_cmd_sf_set_r12.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE eimta_main_cfg_r12_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.eimta_rnti_r12.unpack(bref));
      HANDLE_CODE(c.eimta_cmd_periodicity_r12.unpack(bref));
      HANDLE_CODE(c.eimta_cmd_sf_set_r12.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// EIMTA-MainConfigServCell-r12 ::= CHOICE
void eimta_main_cfg_serv_cell_r12_c::set(types::options e)
{
  type_ = e;
}
void eimta_main_cfg_serv_cell_r12_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_int("eimta-UL-DL-ConfigIndex-r12", c.eimta_ul_dl_cfg_idx_r12);
      j.write_str("eimta-HARQ-ReferenceConfig-r12", c.eimta_harq_ref_cfg_r12.to_string());
      j.write_fieldname("mbsfn-SubframeConfigList-v1250");
      c.mbsfn_sf_cfg_list_v1250.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_serv_cell_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE eimta_main_cfg_serv_cell_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.eimta_ul_dl_cfg_idx_r12, (uint8_t)1u, (uint8_t)5u));
      HANDLE_CODE(c.eimta_harq_ref_cfg_r12.pack(bref));
      HANDLE_CODE(c.mbsfn_sf_cfg_list_v1250.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_serv_cell_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE eimta_main_cfg_serv_cell_r12_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.eimta_ul_dl_cfg_idx_r12, bref, (uint8_t)1u, (uint8_t)5u));
      HANDLE_CODE(c.eimta_harq_ref_cfg_r12.unpack(bref));
      HANDLE_CODE(c.mbsfn_sf_cfg_list_v1250.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_serv_cell_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void eimta_main_cfg_serv_cell_r12_c::setup_s_::mbsfn_sf_cfg_list_v1250_c_::set(types::options e)
{
  type_ = e;
}
void eimta_main_cfg_serv_cell_r12_c::setup_s_::mbsfn_sf_cfg_list_v1250_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("subframeConfigList-r12");
      for (const auto& e1 : c.sf_cfg_list_r12) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_serv_cell_r12_c::setup_s_::mbsfn_sf_cfg_list_v1250_c_");
  }
  j.end_obj();
}
SRSASN_CODE eimta_main_cfg_serv_cell_r12_c::setup_s_::mbsfn_sf_cfg_list_v1250_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.sf_cfg_list_r12, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_serv_cell_r12_c::setup_s_::mbsfn_sf_cfg_list_v1250_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE eimta_main_cfg_serv_cell_r12_c::setup_s_::mbsfn_sf_cfg_list_v1250_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.sf_cfg_list_r12, bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "eimta_main_cfg_serv_cell_r12_c::setup_s_::mbsfn_sf_cfg_list_v1250_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// Format4-resource-r13 ::= SEQUENCE
SRSASN_CODE format4_res_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, start_prb_format4_r13, (uint8_t)0u, (uint8_t)109u));
  HANDLE_CODE(pack_integer(bref, nof_prb_format4_r13, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE format4_res_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(start_prb_format4_r13, bref, (uint8_t)0u, (uint8_t)109u));
  HANDLE_CODE(unpack_integer(nof_prb_format4_r13, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void format4_res_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("startingPRB-format4-r13", start_prb_format4_r13);
  j.write_int("numberOfPRB-format4-r13", nof_prb_format4_r13);
  j.end_obj();
}

// Format5-resource-r13 ::= SEQUENCE
SRSASN_CODE format5_res_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, start_prb_format5_r13, (uint8_t)0u, (uint8_t)109u));
  HANDLE_CODE(pack_integer(bref, cdm_idx_format5_r13, (uint8_t)0u, (uint8_t)1u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE format5_res_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(start_prb_format5_r13, bref, (uint8_t)0u, (uint8_t)109u));
  HANDLE_CODE(unpack_integer(cdm_idx_format5_r13, bref, (uint8_t)0u, (uint8_t)1u));

  return SRSASN_SUCCESS;
}
void format5_res_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("startingPRB-format5-r13", start_prb_format5_r13);
  j.write_int("cdm-index-format5-r13", cdm_idx_format5_r13);
  j.end_obj();
}

// NeighCellsInfo-r12 ::= SEQUENCE
SRSASN_CODE neigh_cells_info_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(mbsfn_sf_cfg_r12_present, 1));

  HANDLE_CODE(pack_integer(bref, pci_r12, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(pack_integer(bref, p_b_r12, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(crs_ports_count_r12.pack(bref));
  if (mbsfn_sf_cfg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mbsfn_sf_cfg_r12, 1, 8));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, p_a_list_r12, 1, 3));
  HANDLE_CODE(tx_mode_list_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, res_alloc_granularity_r12, (uint8_t)1u, (uint8_t)4u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cells_info_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_r12_present, 1));

  HANDLE_CODE(unpack_integer(pci_r12, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(unpack_integer(p_b_r12, bref, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(crs_ports_count_r12.unpack(bref));
  if (mbsfn_sf_cfg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mbsfn_sf_cfg_r12, bref, 1, 8));
  }
  HANDLE_CODE(unpack_dyn_seq_of(p_a_list_r12, bref, 1, 3));
  HANDLE_CODE(tx_mode_list_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(res_alloc_granularity_r12, bref, (uint8_t)1u, (uint8_t)4u));

  return SRSASN_SUCCESS;
}
void neigh_cells_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r12", pci_r12);
  j.write_int("p-b-r12", p_b_r12);
  j.write_str("crs-PortsCount-r12", crs_ports_count_r12.to_string());
  if (mbsfn_sf_cfg_r12_present) {
    j.start_array("mbsfn-SubframeConfig-r12");
    for (const auto& e1 : mbsfn_sf_cfg_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.start_array("p-aList-r12");
  for (const auto& e1 : p_a_list_r12) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.write_str("transmissionModeList-r12", tx_mode_list_r12.to_string());
  j.write_int("resAllocGranularity-r12", res_alloc_granularity_r12);
  j.end_obj();
}

// PDCP-Config ::= SEQUENCE
SRSASN_CODE pdcp_cfg_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(discard_timer_present, 1));
  HANDLE_CODE(bref.pack(rlc_am_present, 1));
  HANDLE_CODE(bref.pack(rlc_um_present, 1));

  if (discard_timer_present) {
    HANDLE_CODE(discard_timer.pack(bref));
  }
  if (rlc_am_present) {
    HANDLE_CODE(bref.pack(rlc_am.status_report_required, 1));
  }
  if (rlc_um_present) {
    HANDLE_CODE(rlc_um.pdcp_sn_size.pack(bref));
  }
  HANDLE_CODE(hdr_compress.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= rn_integrity_protection_r10_present;
    group_flags[1] |= pdcp_sn_size_v1130_present;
    group_flags[2] |= ul_data_split_drb_via_scg_r12_present;
    group_flags[2] |= t_reordering_r12_present;
    group_flags[3] |= ul_data_split_thres_r13.is_present();
    group_flags[3] |= pdcp_sn_size_v1310_present;
    group_flags[3] |= status_feedback_r13.is_present();
    group_flags[4] |= ul_lwa_cfg_r14.is_present();
    group_flags[4] |= ul_only_hdr_compress_r14.is_present();
    group_flags[5] |= ul_data_compress_r15.is_present();
    group_flags[5] |= pdcp_dupl_cfg_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rn_integrity_protection_r10_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pdcp_sn_size_v1130_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_data_split_drb_via_scg_r12_present, 1));
      HANDLE_CODE(bref.pack(t_reordering_r12_present, 1));
      if (ul_data_split_drb_via_scg_r12_present) {
        HANDLE_CODE(bref.pack(ul_data_split_drb_via_scg_r12, 1));
      }
      if (t_reordering_r12_present) {
        HANDLE_CODE(t_reordering_r12.pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_data_split_thres_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(pdcp_sn_size_v1310_present, 1));
      HANDLE_CODE(bref.pack(status_feedback_r13.is_present(), 1));
      if (ul_data_split_thres_r13.is_present()) {
        HANDLE_CODE(ul_data_split_thres_r13->pack(bref));
      }
      if (status_feedback_r13.is_present()) {
        HANDLE_CODE(status_feedback_r13->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_lwa_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_only_hdr_compress_r14.is_present(), 1));
      if (ul_lwa_cfg_r14.is_present()) {
        HANDLE_CODE(ul_lwa_cfg_r14->pack(bref));
      }
      if (ul_only_hdr_compress_r14.is_present()) {
        HANDLE_CODE(ul_only_hdr_compress_r14->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_data_compress_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(pdcp_dupl_cfg_r15.is_present(), 1));
      if (ul_data_compress_r15.is_present()) {
        bref.pack(ul_data_compress_r15->ext, 1);
        HANDLE_CODE(bref.pack(ul_data_compress_r15->dictionary_r15_present, 1));
        HANDLE_CODE(ul_data_compress_r15->buffer_size_r15.pack(bref));
        if (ul_data_compress_r15->dictionary_r15_present) {
          HANDLE_CODE(ul_data_compress_r15->dictionary_r15.pack(bref));
        }
      }
      if (pdcp_dupl_cfg_r15.is_present()) {
        HANDLE_CODE(pdcp_dupl_cfg_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_cfg_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(discard_timer_present, 1));
  HANDLE_CODE(bref.unpack(rlc_am_present, 1));
  HANDLE_CODE(bref.unpack(rlc_um_present, 1));

  if (discard_timer_present) {
    HANDLE_CODE(discard_timer.unpack(bref));
  }
  if (rlc_am_present) {
    HANDLE_CODE(bref.unpack(rlc_am.status_report_required, 1));
  }
  if (rlc_um_present) {
    HANDLE_CODE(rlc_um.pdcp_sn_size.unpack(bref));
  }
  HANDLE_CODE(hdr_compress.unpack(bref));

  if (ext) {
    ext_groups_unpacker_guard group_flags(6);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(rn_integrity_protection_r10_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(pdcp_sn_size_v1130_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(ul_data_split_drb_via_scg_r12_present, 1));
      HANDLE_CODE(bref.unpack(t_reordering_r12_present, 1));
      if (ul_data_split_drb_via_scg_r12_present) {
        HANDLE_CODE(bref.unpack(ul_data_split_drb_via_scg_r12, 1));
      }
      if (t_reordering_r12_present) {
        HANDLE_CODE(t_reordering_r12.unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ul_data_split_thres_r13_present;
      HANDLE_CODE(bref.unpack(ul_data_split_thres_r13_present, 1));
      ul_data_split_thres_r13.set_present(ul_data_split_thres_r13_present);
      HANDLE_CODE(bref.unpack(pdcp_sn_size_v1310_present, 1));
      bool status_feedback_r13_present;
      HANDLE_CODE(bref.unpack(status_feedback_r13_present, 1));
      status_feedback_r13.set_present(status_feedback_r13_present);
      if (ul_data_split_thres_r13.is_present()) {
        HANDLE_CODE(ul_data_split_thres_r13->unpack(bref));
      }
      if (status_feedback_r13.is_present()) {
        HANDLE_CODE(status_feedback_r13->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ul_lwa_cfg_r14_present;
      HANDLE_CODE(bref.unpack(ul_lwa_cfg_r14_present, 1));
      ul_lwa_cfg_r14.set_present(ul_lwa_cfg_r14_present);
      bool ul_only_hdr_compress_r14_present;
      HANDLE_CODE(bref.unpack(ul_only_hdr_compress_r14_present, 1));
      ul_only_hdr_compress_r14.set_present(ul_only_hdr_compress_r14_present);
      if (ul_lwa_cfg_r14.is_present()) {
        HANDLE_CODE(ul_lwa_cfg_r14->unpack(bref));
      }
      if (ul_only_hdr_compress_r14.is_present()) {
        HANDLE_CODE(ul_only_hdr_compress_r14->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ul_data_compress_r15_present;
      HANDLE_CODE(bref.unpack(ul_data_compress_r15_present, 1));
      ul_data_compress_r15.set_present(ul_data_compress_r15_present);
      bool pdcp_dupl_cfg_r15_present;
      HANDLE_CODE(bref.unpack(pdcp_dupl_cfg_r15_present, 1));
      pdcp_dupl_cfg_r15.set_present(pdcp_dupl_cfg_r15_present);
      if (ul_data_compress_r15.is_present()) {
        bref.unpack(ul_data_compress_r15->ext, 1);
        HANDLE_CODE(bref.unpack(ul_data_compress_r15->dictionary_r15_present, 1));
        HANDLE_CODE(ul_data_compress_r15->buffer_size_r15.unpack(bref));
        if (ul_data_compress_r15->dictionary_r15_present) {
          HANDLE_CODE(ul_data_compress_r15->dictionary_r15.unpack(bref));
        }
      }
      if (pdcp_dupl_cfg_r15.is_present()) {
        HANDLE_CODE(pdcp_dupl_cfg_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void pdcp_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (discard_timer_present) {
    j.write_str("discardTimer", discard_timer.to_string());
  }
  if (rlc_am_present) {
    j.write_fieldname("rlc-AM");
    j.start_obj();
    j.write_bool("statusReportRequired", rlc_am.status_report_required);
    j.end_obj();
  }
  if (rlc_um_present) {
    j.write_fieldname("rlc-UM");
    j.start_obj();
    j.write_str("pdcp-SN-Size", rlc_um.pdcp_sn_size.to_string());
    j.end_obj();
  }
  j.write_fieldname("headerCompression");
  hdr_compress.to_json(j);
  if (ext) {
    if (rn_integrity_protection_r10_present) {
      j.write_str("rn-IntegrityProtection-r10", "enabled");
    }
    if (pdcp_sn_size_v1130_present) {
      j.write_str("pdcp-SN-Size-v1130", "len15bits");
    }
    if (ul_data_split_drb_via_scg_r12_present) {
      j.write_bool("ul-DataSplitDRB-ViaSCG-r12", ul_data_split_drb_via_scg_r12);
    }
    if (t_reordering_r12_present) {
      j.write_str("t-Reordering-r12", t_reordering_r12.to_string());
    }
    if (ul_data_split_thres_r13.is_present()) {
      j.write_fieldname("ul-DataSplitThreshold-r13");
      ul_data_split_thres_r13->to_json(j);
    }
    if (pdcp_sn_size_v1310_present) {
      j.write_str("pdcp-SN-Size-v1310", "len18bits");
    }
    if (status_feedback_r13.is_present()) {
      j.write_fieldname("statusFeedback-r13");
      status_feedback_r13->to_json(j);
    }
    if (ul_lwa_cfg_r14.is_present()) {
      j.write_fieldname("ul-LWA-Config-r14");
      ul_lwa_cfg_r14->to_json(j);
    }
    if (ul_only_hdr_compress_r14.is_present()) {
      j.write_fieldname("uplinkOnlyHeaderCompression-r14");
      ul_only_hdr_compress_r14->to_json(j);
    }
    if (ul_data_compress_r15.is_present()) {
      j.write_fieldname("uplinkDataCompression-r15");
      j.start_obj();
      j.write_str("bufferSize-r15", ul_data_compress_r15->buffer_size_r15.to_string());
      if (ul_data_compress_r15->dictionary_r15_present) {
        j.write_str("dictionary-r15", ul_data_compress_r15->dictionary_r15.to_string());
      }
      j.end_obj();
    }
    if (pdcp_dupl_cfg_r15.is_present()) {
      j.write_fieldname("pdcp-DuplicationConfig-r15");
      pdcp_dupl_cfg_r15->to_json(j);
    }
  }
  j.end_obj();
}

void pdcp_cfg_s::hdr_compress_c_::set(types::options e)
{
  type_ = e;
}
void pdcp_cfg_s::hdr_compress_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::not_used:
      break;
    case types::rohc:
      j.write_fieldname("rohc");
      j.start_obj();
      if (c.max_cid_present) {
        j.write_int("maxCID", c.max_cid);
      }
      j.write_fieldname("profiles");
      j.start_obj();
      j.write_bool("profile0x0001", c.profiles.profile0x0001);
      j.write_bool("profile0x0002", c.profiles.profile0x0002);
      j.write_bool("profile0x0003", c.profiles.profile0x0003);
      j.write_bool("profile0x0004", c.profiles.profile0x0004);
      j.write_bool("profile0x0006", c.profiles.profile0x0006);
      j.write_bool("profile0x0101", c.profiles.profile0x0101);
      j.write_bool("profile0x0102", c.profiles.profile0x0102);
      j.write_bool("profile0x0103", c.profiles.profile0x0103);
      j.write_bool("profile0x0104", c.profiles.profile0x0104);
      j.end_obj();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::hdr_compress_c_");
  }
  j.end_obj();
}
SRSASN_CODE pdcp_cfg_s::hdr_compress_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::not_used:
      break;
    case types::rohc:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.max_cid_present, 1));
      if (c.max_cid_present) {
        HANDLE_CODE(pack_integer(bref, c.max_cid, (uint16_t)1u, (uint16_t)16383u));
      }
      HANDLE_CODE(bref.pack(c.profiles.profile0x0001, 1));
      HANDLE_CODE(bref.pack(c.profiles.profile0x0002, 1));
      HANDLE_CODE(bref.pack(c.profiles.profile0x0003, 1));
      HANDLE_CODE(bref.pack(c.profiles.profile0x0004, 1));
      HANDLE_CODE(bref.pack(c.profiles.profile0x0006, 1));
      HANDLE_CODE(bref.pack(c.profiles.profile0x0101, 1));
      HANDLE_CODE(bref.pack(c.profiles.profile0x0102, 1));
      HANDLE_CODE(bref.pack(c.profiles.profile0x0103, 1));
      HANDLE_CODE(bref.pack(c.profiles.profile0x0104, 1));
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::hdr_compress_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_cfg_s::hdr_compress_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::not_used:
      break;
    case types::rohc:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.max_cid_present, 1));
      if (c.max_cid_present) {
        HANDLE_CODE(unpack_integer(c.max_cid, bref, (uint16_t)1u, (uint16_t)16383u));
      }
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0001, 1));
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0002, 1));
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0003, 1));
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0004, 1));
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0006, 1));
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0101, 1));
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0102, 1));
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0103, 1));
      HANDLE_CODE(bref.unpack(c.profiles.profile0x0104, 1));
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::hdr_compress_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pdcp_cfg_s::ul_data_split_thres_r13_c_::set(types::options e)
{
  type_ = e;
}
void pdcp_cfg_s::ul_data_split_thres_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_data_split_thres_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pdcp_cfg_s::ul_data_split_thres_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_data_split_thres_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_cfg_s::ul_data_split_thres_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_data_split_thres_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pdcp_cfg_s::status_feedback_r13_c_::set(types::options e)
{
  type_ = e;
}
void pdcp_cfg_s::status_feedback_r13_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.status_pdu_type_for_polling_r13_present) {
        j.write_str("statusPDU-TypeForPolling-r13", c.status_pdu_type_for_polling_r13.to_string());
      }
      if (c.status_pdu_periodicity_type1_r13_present) {
        j.write_str("statusPDU-Periodicity-Type1-r13", c.status_pdu_periodicity_type1_r13.to_string());
      }
      if (c.status_pdu_periodicity_type2_r13_present) {
        j.write_str("statusPDU-Periodicity-Type2-r13", c.status_pdu_periodicity_type2_r13.to_string());
      }
      if (c.status_pdu_periodicity_offset_r13_present) {
        j.write_str("statusPDU-Periodicity-Offset-r13", c.status_pdu_periodicity_offset_r13.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::status_feedback_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pdcp_cfg_s::status_feedback_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.status_pdu_type_for_polling_r13_present, 1));
      HANDLE_CODE(bref.pack(c.status_pdu_periodicity_type1_r13_present, 1));
      HANDLE_CODE(bref.pack(c.status_pdu_periodicity_type2_r13_present, 1));
      HANDLE_CODE(bref.pack(c.status_pdu_periodicity_offset_r13_present, 1));
      if (c.status_pdu_type_for_polling_r13_present) {
        HANDLE_CODE(c.status_pdu_type_for_polling_r13.pack(bref));
      }
      if (c.status_pdu_periodicity_type1_r13_present) {
        HANDLE_CODE(c.status_pdu_periodicity_type1_r13.pack(bref));
      }
      if (c.status_pdu_periodicity_type2_r13_present) {
        HANDLE_CODE(c.status_pdu_periodicity_type2_r13.pack(bref));
      }
      if (c.status_pdu_periodicity_offset_r13_present) {
        HANDLE_CODE(c.status_pdu_periodicity_offset_r13.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::status_feedback_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_cfg_s::status_feedback_r13_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.status_pdu_type_for_polling_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.status_pdu_periodicity_type1_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.status_pdu_periodicity_type2_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.status_pdu_periodicity_offset_r13_present, 1));
      if (c.status_pdu_type_for_polling_r13_present) {
        HANDLE_CODE(c.status_pdu_type_for_polling_r13.unpack(bref));
      }
      if (c.status_pdu_periodicity_type1_r13_present) {
        HANDLE_CODE(c.status_pdu_periodicity_type1_r13.unpack(bref));
      }
      if (c.status_pdu_periodicity_type2_r13_present) {
        HANDLE_CODE(c.status_pdu_periodicity_type2_r13.unpack(bref));
      }
      if (c.status_pdu_periodicity_offset_r13_present) {
        HANDLE_CODE(c.status_pdu_periodicity_offset_r13.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::status_feedback_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pdcp_cfg_s::ul_lwa_cfg_r14_c_::set(types::options e)
{
  type_ = e;
}
void pdcp_cfg_s::ul_lwa_cfg_r14_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_bool("ul-LWA-DRB-ViaWLAN-r14", c.ul_lwa_drb_via_wlan_r14);
      if (c.ul_lwa_data_split_thres_r14_present) {
        j.write_str("ul-LWA-DataSplitThreshold-r14", c.ul_lwa_data_split_thres_r14.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_lwa_cfg_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE pdcp_cfg_s::ul_lwa_cfg_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.ul_lwa_data_split_thres_r14_present, 1));
      HANDLE_CODE(bref.pack(c.ul_lwa_drb_via_wlan_r14, 1));
      if (c.ul_lwa_data_split_thres_r14_present) {
        HANDLE_CODE(c.ul_lwa_data_split_thres_r14.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_lwa_cfg_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_cfg_s::ul_lwa_cfg_r14_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.ul_lwa_data_split_thres_r14_present, 1));
      HANDLE_CODE(bref.unpack(c.ul_lwa_drb_via_wlan_r14, 1));
      if (c.ul_lwa_data_split_thres_r14_present) {
        HANDLE_CODE(c.ul_lwa_data_split_thres_r14.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_lwa_cfg_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pdcp_cfg_s::ul_only_hdr_compress_r14_c_::set(types::options e)
{
  type_ = e;
}
void pdcp_cfg_s::ul_only_hdr_compress_r14_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::not_used_r14:
      break;
    case types::rohc_r14:
      j.write_fieldname("rohc-r14");
      j.start_obj();
      if (c.max_cid_r14_present) {
        j.write_int("maxCID-r14", c.max_cid_r14);
      }
      j.write_fieldname("profiles-r14");
      j.start_obj();
      j.write_bool("profile0x0006-r14", c.profiles_r14.profile0x0006_r14);
      j.end_obj();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_only_hdr_compress_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE pdcp_cfg_s::ul_only_hdr_compress_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::not_used_r14:
      break;
    case types::rohc_r14:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.max_cid_r14_present, 1));
      if (c.max_cid_r14_present) {
        HANDLE_CODE(pack_integer(bref, c.max_cid_r14, (uint16_t)1u, (uint16_t)16383u));
      }
      HANDLE_CODE(bref.pack(c.profiles_r14.profile0x0006_r14, 1));
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_only_hdr_compress_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_cfg_s::ul_only_hdr_compress_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::not_used_r14:
      break;
    case types::rohc_r14:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.max_cid_r14_present, 1));
      if (c.max_cid_r14_present) {
        HANDLE_CODE(unpack_integer(c.max_cid_r14, bref, (uint16_t)1u, (uint16_t)16383u));
      }
      HANDLE_CODE(bref.unpack(c.profiles_r14.profile0x0006_r14, 1));
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::ul_only_hdr_compress_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pdcp_cfg_s::pdcp_dupl_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void pdcp_cfg_s::pdcp_dupl_cfg_r15_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("pdcp-Duplication-r15", c.pdcp_dupl_r15.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::pdcp_dupl_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE pdcp_cfg_s::pdcp_dupl_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pdcp_dupl_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::pdcp_dupl_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_cfg_s::pdcp_dupl_cfg_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pdcp_dupl_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pdcp_cfg_s::pdcp_dupl_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUCCH-ConfigDedicated-v1530 ::= SEQUENCE
SRSASN_CODE pucch_cfg_ded_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(n1_pucch_an_spt_r15_present, 1));
  HANDLE_CODE(bref.pack(codebooksize_determination_stti_r15_present, 1));

  if (n1_pucch_an_spt_r15_present) {
    HANDLE_CODE(pack_integer(bref, n1_pucch_an_spt_r15, (uint16_t)0u, (uint16_t)2047u));
  }
  if (codebooksize_determination_stti_r15_present) {
    HANDLE_CODE(codebooksize_determination_stti_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(n1_pucch_an_spt_r15_present, 1));
  HANDLE_CODE(bref.unpack(codebooksize_determination_stti_r15_present, 1));

  if (n1_pucch_an_spt_r15_present) {
    HANDLE_CODE(unpack_integer(n1_pucch_an_spt_r15, bref, (uint16_t)0u, (uint16_t)2047u));
  }
  if (codebooksize_determination_stti_r15_present) {
    HANDLE_CODE(codebooksize_determination_stti_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pucch_cfg_ded_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (n1_pucch_an_spt_r15_present) {
    j.write_int("n1PUCCH-AN-SPT-r15", n1_pucch_an_spt_r15);
  }
  if (codebooksize_determination_stti_r15_present) {
    j.write_str("codebooksizeDeterminationSTTI-r15", codebooksize_determination_stti_r15.to_string());
  }
  j.end_obj();
}

// PUCCH-Format3-Conf-r13 ::= SEQUENCE
SRSASN_CODE pucch_format3_conf_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(n3_pucch_an_list_r13_present, 1));
  HANDLE_CODE(bref.pack(two_ant_port_activ_pucch_format3_r13_present, 1));

  if (n3_pucch_an_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, n3_pucch_an_list_r13, 1, 4, integer_packer<uint16_t>(0, 549)));
  }
  if (two_ant_port_activ_pucch_format3_r13_present) {
    HANDLE_CODE(two_ant_port_activ_pucch_format3_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_format3_conf_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(n3_pucch_an_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(two_ant_port_activ_pucch_format3_r13_present, 1));

  if (n3_pucch_an_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(n3_pucch_an_list_r13, bref, 1, 4, integer_packer<uint16_t>(0, 549)));
  }
  if (two_ant_port_activ_pucch_format3_r13_present) {
    HANDLE_CODE(two_ant_port_activ_pucch_format3_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pucch_format3_conf_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (n3_pucch_an_list_r13_present) {
    j.start_array("n3PUCCH-AN-List-r13");
    for (const auto& e1 : n3_pucch_an_list_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (two_ant_port_activ_pucch_format3_r13_present) {
    j.write_fieldname("twoAntennaPortActivatedPUCCH-Format3-r13");
    two_ant_port_activ_pucch_format3_r13.to_json(j);
  }
  j.end_obj();
}

void pucch_format3_conf_r13_s::two_ant_port_activ_pucch_format3_r13_c_::set(types::options e)
{
  type_ = e;
}
void pucch_format3_conf_r13_s::two_ant_port_activ_pucch_format3_r13_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("n3PUCCH-AN-ListP1-r13");
      for (const auto& e1 : c.n3_pucch_an_list_p1_r13) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_format3_conf_r13_s::two_ant_port_activ_pucch_format3_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_format3_conf_r13_s::two_ant_port_activ_pucch_format3_r13_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.n3_pucch_an_list_p1_r13, 1, 4, integer_packer<uint16_t>(0, 549)));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_format3_conf_r13_s::two_ant_port_activ_pucch_format3_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_format3_conf_r13_s::two_ant_port_activ_pucch_format3_r13_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.n3_pucch_an_list_p1_r13, bref, 1, 4, integer_packer<uint16_t>(0, 549)));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_format3_conf_r13_s::two_ant_port_activ_pucch_format3_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RLC-BearerConfig-r15 ::= CHOICE
void rlc_bearer_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void rlc_bearer_cfg_r15_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.rlc_cfg_r15_present) {
        j.write_fieldname("rlc-Config-r15");
        c.rlc_cfg_r15.to_json(j);
      }
      j.write_fieldname("logicalChannelIdentityConfig-r15");
      c.lc_ch_id_cfg_r15.to_json(j);
      if (c.lc_ch_cfg_r15_present) {
        j.write_fieldname("logicalChannelConfig-r15");
        c.lc_ch_cfg_r15.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rlc_bearer_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE rlc_bearer_cfg_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.rlc_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.lc_ch_cfg_r15_present, 1));
      if (c.rlc_cfg_r15_present) {
        HANDLE_CODE(c.rlc_cfg_r15.pack(bref));
      }
      HANDLE_CODE(c.lc_ch_id_cfg_r15.pack(bref));
      if (c.lc_ch_cfg_r15_present) {
        HANDLE_CODE(c.lc_ch_cfg_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rlc_bearer_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_bearer_cfg_r15_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.rlc_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.lc_ch_cfg_r15_present, 1));
      if (c.rlc_cfg_r15_present) {
        HANDLE_CODE(c.rlc_cfg_r15.unpack(bref));
      }
      HANDLE_CODE(c.lc_ch_id_cfg_r15.unpack(bref));
      if (c.lc_ch_cfg_r15_present) {
        HANDLE_CODE(c.lc_ch_cfg_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rlc_bearer_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_::destroy_() {}
void rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_::lc_ch_id_cfg_r15_c_(
    const rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::lc_ch_id_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::lc_ch_id_ext_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_");
  }
}
rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_& rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_::
                                                     operator=(const rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::lc_ch_id_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::lc_ch_id_ext_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_");
  }

  return *this;
}
void rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::lc_ch_id_r15:
      j.write_int("logicalChannelIdentity-r15", c.get<uint8_t>());
      break;
    case types::lc_ch_id_ext_r15:
      j.write_int("logicalChannelIdentityExt-r15", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::lc_ch_id_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)10u));
      break;
    case types::lc_ch_id_ext_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)32u, (uint8_t)38u));
      break;
    default:
      log_invalid_choice_id(type_, "rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::lc_ch_id_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)10u));
      break;
    case types::lc_ch_id_ext_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)32u, (uint8_t)38u));
      break;
    default:
      log_invalid_choice_id(type_, "rlc_bearer_cfg_r15_c::setup_s_::lc_ch_id_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RLC-Config ::= CHOICE
void rlc_cfg_c::destroy_()
{
  switch (type_) {
    case types::am:
      c.destroy<am_s_>();
      break;
    case types::um_bi_dir:
      c.destroy<um_bi_dir_s_>();
      break;
    case types::um_uni_dir_ul:
      c.destroy<um_uni_dir_ul_s_>();
      break;
    case types::um_uni_dir_dl:
      c.destroy<um_uni_dir_dl_s_>();
      break;
    default:
      break;
  }
}
void rlc_cfg_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::am:
      c.init<am_s_>();
      break;
    case types::um_bi_dir:
      c.init<um_bi_dir_s_>();
      break;
    case types::um_uni_dir_ul:
      c.init<um_uni_dir_ul_s_>();
      break;
    case types::um_uni_dir_dl:
      c.init<um_uni_dir_dl_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_c");
  }
}
rlc_cfg_c::rlc_cfg_c(const rlc_cfg_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::am:
      c.init(other.c.get<am_s_>());
      break;
    case types::um_bi_dir:
      c.init(other.c.get<um_bi_dir_s_>());
      break;
    case types::um_uni_dir_ul:
      c.init(other.c.get<um_uni_dir_ul_s_>());
      break;
    case types::um_uni_dir_dl:
      c.init(other.c.get<um_uni_dir_dl_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_c");
  }
}
rlc_cfg_c& rlc_cfg_c::operator=(const rlc_cfg_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::am:
      c.set(other.c.get<am_s_>());
      break;
    case types::um_bi_dir:
      c.set(other.c.get<um_bi_dir_s_>());
      break;
    case types::um_uni_dir_ul:
      c.set(other.c.get<um_uni_dir_ul_s_>());
      break;
    case types::um_uni_dir_dl:
      c.set(other.c.get<um_uni_dir_dl_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_c");
  }

  return *this;
}
void rlc_cfg_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::am:
      j.write_fieldname("am");
      j.start_obj();
      j.write_fieldname("ul-AM-RLC");
      c.get<am_s_>().ul_am_rlc.to_json(j);
      j.write_fieldname("dl-AM-RLC");
      c.get<am_s_>().dl_am_rlc.to_json(j);
      j.end_obj();
      break;
    case types::um_bi_dir:
      j.write_fieldname("um-Bi-Directional");
      j.start_obj();
      j.write_fieldname("ul-UM-RLC");
      c.get<um_bi_dir_s_>().ul_um_rlc.to_json(j);
      j.write_fieldname("dl-UM-RLC");
      c.get<um_bi_dir_s_>().dl_um_rlc.to_json(j);
      j.end_obj();
      break;
    case types::um_uni_dir_ul:
      j.write_fieldname("um-Uni-Directional-UL");
      j.start_obj();
      j.write_fieldname("ul-UM-RLC");
      c.get<um_uni_dir_ul_s_>().ul_um_rlc.to_json(j);
      j.end_obj();
      break;
    case types::um_uni_dir_dl:
      j.write_fieldname("um-Uni-Directional-DL");
      j.start_obj();
      j.write_fieldname("dl-UM-RLC");
      c.get<um_uni_dir_dl_s_>().dl_um_rlc.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_c");
  }
  j.end_obj();
}
SRSASN_CODE rlc_cfg_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::am:
      HANDLE_CODE(c.get<am_s_>().ul_am_rlc.pack(bref));
      HANDLE_CODE(c.get<am_s_>().dl_am_rlc.pack(bref));
      break;
    case types::um_bi_dir:
      HANDLE_CODE(c.get<um_bi_dir_s_>().ul_um_rlc.pack(bref));
      HANDLE_CODE(c.get<um_bi_dir_s_>().dl_um_rlc.pack(bref));
      break;
    case types::um_uni_dir_ul:
      HANDLE_CODE(c.get<um_uni_dir_ul_s_>().ul_um_rlc.pack(bref));
      break;
    case types::um_uni_dir_dl:
      HANDLE_CODE(c.get<um_uni_dir_dl_s_>().dl_um_rlc.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_cfg_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::am:
      HANDLE_CODE(c.get<am_s_>().ul_am_rlc.unpack(bref));
      HANDLE_CODE(c.get<am_s_>().dl_am_rlc.unpack(bref));
      break;
    case types::um_bi_dir:
      HANDLE_CODE(c.get<um_bi_dir_s_>().ul_um_rlc.unpack(bref));
      HANDLE_CODE(c.get<um_bi_dir_s_>().dl_um_rlc.unpack(bref));
      break;
    case types::um_uni_dir_ul:
      HANDLE_CODE(c.get<um_uni_dir_ul_s_>().ul_um_rlc.unpack(bref));
      break;
    case types::um_uni_dir_dl:
      HANDLE_CODE(c.get<um_uni_dir_dl_s_>().dl_um_rlc.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RLC-Config-v1250 ::= SEQUENCE
SRSASN_CODE rlc_cfg_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_extended_rlc_li_field_r12, 1));
  HANDLE_CODE(bref.pack(dl_extended_rlc_li_field_r12, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_cfg_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_extended_rlc_li_field_r12, 1));
  HANDLE_CODE(bref.unpack(dl_extended_rlc_li_field_r12, 1));

  return SRSASN_SUCCESS;
}
void rlc_cfg_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("ul-extended-RLC-LI-Field-r12", ul_extended_rlc_li_field_r12);
  j.write_bool("dl-extended-RLC-LI-Field-r12", dl_extended_rlc_li_field_r12);
  j.end_obj();
}

// RLC-Config-v1310 ::= SEQUENCE
SRSASN_CODE rlc_cfg_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(poll_pdu_v1310_present, 1));

  HANDLE_CODE(bref.pack(ul_extended_rlc_am_sn_r13, 1));
  HANDLE_CODE(bref.pack(dl_extended_rlc_am_sn_r13, 1));
  if (poll_pdu_v1310_present) {
    HANDLE_CODE(poll_pdu_v1310.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_cfg_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(poll_pdu_v1310_present, 1));

  HANDLE_CODE(bref.unpack(ul_extended_rlc_am_sn_r13, 1));
  HANDLE_CODE(bref.unpack(dl_extended_rlc_am_sn_r13, 1));
  if (poll_pdu_v1310_present) {
    HANDLE_CODE(poll_pdu_v1310.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rlc_cfg_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("ul-extended-RLC-AM-SN-r13", ul_extended_rlc_am_sn_r13);
  j.write_bool("dl-extended-RLC-AM-SN-r13", dl_extended_rlc_am_sn_r13);
  if (poll_pdu_v1310_present) {
    j.write_str("pollPDU-v1310", poll_pdu_v1310.to_string());
  }
  j.end_obj();
}

// RLC-Config-v1430 ::= CHOICE
void rlc_cfg_v1430_c::set(types::options e)
{
  type_ = e;
}
void rlc_cfg_v1430_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("pollByte-r14", c.poll_byte_r14.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_v1430_c");
  }
  j.end_obj();
}
SRSASN_CODE rlc_cfg_v1430_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.poll_byte_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_v1430_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_cfg_v1430_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.poll_byte_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlc_cfg_v1430_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RLC-Config-v1510 ::= SEQUENCE
SRSASN_CODE rlc_cfg_v1510_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_cfg_v1510_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void rlc_cfg_v1510_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("reestablishRLC-r15", "true");
  j.end_obj();
}

// RLC-Config-v1530 ::= CHOICE
void rlc_cfg_v1530_c::set(types::options e)
{
  type_ = 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)
{
  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;
}

// RRCConnectionReject-v1320-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reject_v1320_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rrc_suspend_ind_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reject_v1320_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rrc_suspend_ind_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
void rrc_conn_reject_v1320_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rrc_suspend_ind_r13_present) {
    j.write_str("rrc-SuspendIndication-r13", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// SPDCCH-Config-r15 ::= CHOICE
void spdcch_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void spdcch_cfg_r15_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.spdcch_l1_reuse_ind_r15_present) {
        j.write_str("spdcch-L1-ReuseIndication-r15", c.spdcch_l1_reuse_ind_r15.to_string());
      }
      if (c.spdcch_set_cfg_r15_present) {
        j.start_array("spdcch-SetConfig-r15");
        for (const auto& e1 : c.spdcch_set_cfg_r15) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "spdcch_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE spdcch_cfg_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.spdcch_l1_reuse_ind_r15_present, 1));
      HANDLE_CODE(bref.pack(c.spdcch_set_cfg_r15_present, 1));
      if (c.spdcch_l1_reuse_ind_r15_present) {
        HANDLE_CODE(c.spdcch_l1_reuse_ind_r15.pack(bref));
      }
      if (c.spdcch_set_cfg_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.spdcch_set_cfg_r15, 1, 4));
      }
      break;
    default:
      log_invalid_choice_id(type_, "spdcch_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE spdcch_cfg_r15_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.spdcch_l1_reuse_ind_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.spdcch_set_cfg_r15_present, 1));
      if (c.spdcch_l1_reuse_ind_r15_present) {
        HANDLE_CODE(c.spdcch_l1_reuse_ind_r15.unpack(bref));
      }
      if (c.spdcch_set_cfg_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.spdcch_set_cfg_r15, bref, 1, 4));
      }
      break;
    default:
      log_invalid_choice_id(type_, "spdcch_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SPS-ConfigSL-r14 ::= SEQUENCE
SRSASN_CODE sps_cfg_sl_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, sps_cfg_idx_r14, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(semi_persist_sched_interv_sl_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_sl_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(sps_cfg_idx_r14, bref, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(semi_persist_sched_interv_sl_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void sps_cfg_sl_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sps-ConfigIndex-r14", sps_cfg_idx_r14);
  j.write_str("semiPersistSchedIntervalSL-r14", semi_persist_sched_interv_sl_r14.to_string());
  j.end_obj();
}

// SPS-ConfigUL ::= CHOICE
void sps_cfg_ul_c::set(types::options e)
{
  type_ = e;
}
void sps_cfg_ul_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_c");
  }
  j.end_obj();
}
SRSASN_CODE sps_cfg_ul_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_ul_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

SRSASN_CODE sps_cfg_ul_c::setup_s_::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(p0_persistent_present, 1));
  HANDLE_CODE(bref.pack(two_intervs_cfg_present, 1));

  HANDLE_CODE(semi_persist_sched_interv_ul.pack(bref));
  HANDLE_CODE(implicit_release_after.pack(bref));
  if (p0_persistent_present) {
    HANDLE_CODE(pack_integer(bref, p0_persistent.p0_nominal_pusch_persistent, (int8_t)-126, (int8_t)24));
    HANDLE_CODE(pack_integer(bref, p0_persistent.p0_ue_pusch_persistent, (int8_t)-8, (int8_t)7));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= p0_persistent_sf_set2_r12.is_present();
    group_flags[1] |= nof_conf_ul_sps_processes_r13_present;
    group_flags[2] |= fixed_rv_non_adaptive_r14_present;
    group_flags[2] |= sps_cfg_idx_r14_present;
    group_flags[2] |= semi_persist_sched_interv_ul_v1430_present;
    group_flags[3] |= cyclic_shift_sps_r15_present;
    group_flags[3] |= harq_proc_id_offset_r15_present;
    group_flags[3] |= rv_sps_ul_repeats_r15_present;
    group_flags[3] |= tpc_pdcch_cfg_pusch_sps_r15.is_present();
    group_flags[3] |= total_num_pusch_sps_ul_repeats_r15_present;
    group_flags[3] |= sps_cfg_idx_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(p0_persistent_sf_set2_r12.is_present(), 1));
      if (p0_persistent_sf_set2_r12.is_present()) {
        HANDLE_CODE(p0_persistent_sf_set2_r12->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(nof_conf_ul_sps_processes_r13_present, 1));
      if (nof_conf_ul_sps_processes_r13_present) {
        HANDLE_CODE(pack_integer(bref, nof_conf_ul_sps_processes_r13, (uint8_t)1u, (uint8_t)8u));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(fixed_rv_non_adaptive_r14_present, 1));
      HANDLE_CODE(bref.pack(sps_cfg_idx_r14_present, 1));
      HANDLE_CODE(bref.pack(semi_persist_sched_interv_ul_v1430_present, 1));
      if (sps_cfg_idx_r14_present) {
        HANDLE_CODE(pack_integer(bref, sps_cfg_idx_r14, (uint8_t)1u, (uint8_t)8u));
      }
      if (semi_persist_sched_interv_ul_v1430_present) {
        HANDLE_CODE(semi_persist_sched_interv_ul_v1430.pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cyclic_shift_sps_r15_present, 1));
      HANDLE_CODE(bref.pack(harq_proc_id_offset_r15_present, 1));
      HANDLE_CODE(bref.pack(rv_sps_ul_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(tpc_pdcch_cfg_pusch_sps_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(total_num_pusch_sps_ul_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(sps_cfg_idx_r15_present, 1));
      if (cyclic_shift_sps_r15_present) {
        HANDLE_CODE(cyclic_shift_sps_r15.pack(bref));
      }
      if (harq_proc_id_offset_r15_present) {
        HANDLE_CODE(pack_integer(bref, harq_proc_id_offset_r15, (uint8_t)0u, (uint8_t)7u));
      }
      if (rv_sps_ul_repeats_r15_present) {
        HANDLE_CODE(rv_sps_ul_repeats_r15.pack(bref));
      }
      if (tpc_pdcch_cfg_pusch_sps_r15.is_present()) {
        HANDLE_CODE(tpc_pdcch_cfg_pusch_sps_r15->pack(bref));
      }
      if (total_num_pusch_sps_ul_repeats_r15_present) {
        HANDLE_CODE(total_num_pusch_sps_ul_repeats_r15.pack(bref));
      }
      if (sps_cfg_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, sps_cfg_idx_r15, (uint8_t)1u, (uint8_t)6u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_ul_c::setup_s_::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(p0_persistent_present, 1));
  HANDLE_CODE(bref.unpack(two_intervs_cfg_present, 1));

  HANDLE_CODE(semi_persist_sched_interv_ul.unpack(bref));
  HANDLE_CODE(implicit_release_after.unpack(bref));
  if (p0_persistent_present) {
    HANDLE_CODE(unpack_integer(p0_persistent.p0_nominal_pusch_persistent, bref, (int8_t)-126, (int8_t)24));
    HANDLE_CODE(unpack_integer(p0_persistent.p0_ue_pusch_persistent, bref, (int8_t)-8, (int8_t)7));
  }

  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);

      bool p0_persistent_sf_set2_r12_present;
      HANDLE_CODE(bref.unpack(p0_persistent_sf_set2_r12_present, 1));
      p0_persistent_sf_set2_r12.set_present(p0_persistent_sf_set2_r12_present);
      if (p0_persistent_sf_set2_r12.is_present()) {
        HANDLE_CODE(p0_persistent_sf_set2_r12->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(nof_conf_ul_sps_processes_r13_present, 1));
      if (nof_conf_ul_sps_processes_r13_present) {
        HANDLE_CODE(unpack_integer(nof_conf_ul_sps_processes_r13, bref, (uint8_t)1u, (uint8_t)8u));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(fixed_rv_non_adaptive_r14_present, 1));
      HANDLE_CODE(bref.unpack(sps_cfg_idx_r14_present, 1));
      HANDLE_CODE(bref.unpack(semi_persist_sched_interv_ul_v1430_present, 1));
      if (sps_cfg_idx_r14_present) {
        HANDLE_CODE(unpack_integer(sps_cfg_idx_r14, bref, (uint8_t)1u, (uint8_t)8u));
      }
      if (semi_persist_sched_interv_ul_v1430_present) {
        HANDLE_CODE(semi_persist_sched_interv_ul_v1430.unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(cyclic_shift_sps_r15_present, 1));
      HANDLE_CODE(bref.unpack(harq_proc_id_offset_r15_present, 1));
      HANDLE_CODE(bref.unpack(rv_sps_ul_repeats_r15_present, 1));
      bool tpc_pdcch_cfg_pusch_sps_r15_present;
      HANDLE_CODE(bref.unpack(tpc_pdcch_cfg_pusch_sps_r15_present, 1));
      tpc_pdcch_cfg_pusch_sps_r15.set_present(tpc_pdcch_cfg_pusch_sps_r15_present);
      HANDLE_CODE(bref.unpack(total_num_pusch_sps_ul_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(sps_cfg_idx_r15_present, 1));
      if (cyclic_shift_sps_r15_present) {
        HANDLE_CODE(cyclic_shift_sps_r15.unpack(bref));
      }
      if (harq_proc_id_offset_r15_present) {
        HANDLE_CODE(unpack_integer(harq_proc_id_offset_r15, bref, (uint8_t)0u, (uint8_t)7u));
      }
      if (rv_sps_ul_repeats_r15_present) {
        HANDLE_CODE(rv_sps_ul_repeats_r15.unpack(bref));
      }
      if (tpc_pdcch_cfg_pusch_sps_r15.is_present()) {
        HANDLE_CODE(tpc_pdcch_cfg_pusch_sps_r15->unpack(bref));
      }
      if (total_num_pusch_sps_ul_repeats_r15_present) {
        HANDLE_CODE(total_num_pusch_sps_ul_repeats_r15.unpack(bref));
      }
      if (sps_cfg_idx_r15_present) {
        HANDLE_CODE(unpack_integer(sps_cfg_idx_r15, bref, (uint8_t)1u, (uint8_t)6u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sps_cfg_ul_c::setup_s_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("semiPersistSchedIntervalUL", semi_persist_sched_interv_ul.to_string());
  j.write_str("implicitReleaseAfter", implicit_release_after.to_string());
  if (p0_persistent_present) {
    j.write_fieldname("p0-Persistent");
    j.start_obj();
    j.write_int("p0-NominalPUSCH-Persistent", p0_persistent.p0_nominal_pusch_persistent);
    j.write_int("p0-UE-PUSCH-Persistent", p0_persistent.p0_ue_pusch_persistent);
    j.end_obj();
  }
  if (two_intervs_cfg_present) {
    j.write_str("twoIntervalsConfig", "true");
  }
  if (ext) {
    if (p0_persistent_sf_set2_r12.is_present()) {
      j.write_fieldname("p0-PersistentSubframeSet2-r12");
      p0_persistent_sf_set2_r12->to_json(j);
    }
    if (nof_conf_ul_sps_processes_r13_present) {
      j.write_int("numberOfConfUlSPS-Processes-r13", nof_conf_ul_sps_processes_r13);
    }
    if (fixed_rv_non_adaptive_r14_present) {
      j.write_str("fixedRV-NonAdaptive-r14", "true");
    }
    if (sps_cfg_idx_r14_present) {
      j.write_int("sps-ConfigIndex-r14", sps_cfg_idx_r14);
    }
    if (semi_persist_sched_interv_ul_v1430_present) {
      j.write_str("semiPersistSchedIntervalUL-v1430", semi_persist_sched_interv_ul_v1430.to_string());
    }
    if (cyclic_shift_sps_r15_present) {
      j.write_str("cyclicShiftSPS-r15", cyclic_shift_sps_r15.to_string());
    }
    if (harq_proc_id_offset_r15_present) {
      j.write_int("harq-ProcID-Offset-r15", harq_proc_id_offset_r15);
    }
    if (rv_sps_ul_repeats_r15_present) {
      j.write_str("rv-SPS-UL-Repetitions-r15", rv_sps_ul_repeats_r15.to_string());
    }
    if (tpc_pdcch_cfg_pusch_sps_r15.is_present()) {
      j.write_fieldname("tpc-PDCCH-ConfigPUSCH-SPS-r15");
      tpc_pdcch_cfg_pusch_sps_r15->to_json(j);
    }
    if (total_num_pusch_sps_ul_repeats_r15_present) {
      j.write_str("totalNumberPUSCH-SPS-UL-Repetitions-r15", total_num_pusch_sps_ul_repeats_r15.to_string());
    }
    if (sps_cfg_idx_r15_present) {
      j.write_int("sps-ConfigIndex-r15", sps_cfg_idx_r15);
    }
  }
  j.end_obj();
}

void sps_cfg_ul_c::setup_s_::p0_persistent_sf_set2_r12_c_::set(types::options e)
{
  type_ = e;
}
void sps_cfg_ul_c::setup_s_::p0_persistent_sf_set2_r12_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_int("p0-NominalPUSCH-PersistentSubframeSet2-r12", c.p0_nominal_pusch_persistent_sf_set2_r12);
      j.write_int("p0-UE-PUSCH-PersistentSubframeSet2-r12", c.p0_ue_pusch_persistent_sf_set2_r12);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_c::setup_s_::p0_persistent_sf_set2_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE sps_cfg_ul_c::setup_s_::p0_persistent_sf_set2_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.p0_nominal_pusch_persistent_sf_set2_r12, (int8_t)-126, (int8_t)24));
      HANDLE_CODE(pack_integer(bref, c.p0_ue_pusch_persistent_sf_set2_r12, (int8_t)-8, (int8_t)7));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_c::setup_s_::p0_persistent_sf_set2_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_ul_c::setup_s_::p0_persistent_sf_set2_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.p0_nominal_pusch_persistent_sf_set2_r12, bref, (int8_t)-126, (int8_t)24));
      HANDLE_CODE(unpack_integer(c.p0_ue_pusch_persistent_sf_set2_r12, bref, (int8_t)-8, (int8_t)7));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_c::setup_s_::p0_persistent_sf_set2_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SPS-ConfigUL-STTI-r15 ::= CHOICE
void sps_cfg_ul_stti_r15_c::set(types::options e)
{
  type_ = e;
}
void sps_cfg_ul_stti_r15_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("semiPersistSchedIntervalUL-STTI-r15", c.semi_persist_sched_interv_ul_stti_r15.to_string());
      j.write_str("implicitReleaseAfter", c.implicit_release_after.to_string());
      if (c.p0_persistent_r15_present) {
        j.write_fieldname("p0-Persistent-r15");
        j.start_obj();
        j.write_int("p0-NominalSPUSCH-Persistent-r15", c.p0_persistent_r15.p0_nominal_spusch_persistent_r15);
        j.write_int("p0-UE-SPUSCH-Persistent-r15", c.p0_persistent_r15.p0_ue_spusch_persistent_r15);
        j.end_obj();
      }
      if (c.two_intervs_cfg_r15_present) {
        j.write_str("twoIntervalsConfig-r15", "true");
      }
      if (c.p0_persistent_sf_set2_r15_present) {
        j.write_fieldname("p0-PersistentSubframeSet2-r15");
        c.p0_persistent_sf_set2_r15.to_json(j);
      }
      if (c.nof_conf_ul_sps_processes_stti_r15_present) {
        j.write_int("numberOfConfUL-SPS-Processes-STTI-r15", c.nof_conf_ul_sps_processes_stti_r15);
      }
      j.write_int("sTTI-StartTimeUL-r15", c.stti_start_time_ul_r15);
      if (c.tpc_pdcch_cfg_pusch_sps_r15_present) {
        j.write_fieldname("tpc-PDCCH-ConfigPUSCH-SPS-r15");
        c.tpc_pdcch_cfg_pusch_sps_r15.to_json(j);
      }
      if (c.cyclic_shift_sps_s_tti_r15_present) {
        j.write_str("cyclicShiftSPS-sTTI-r15", c.cyclic_shift_sps_s_tti_r15.to_string());
      }
      if (c.ifdma_cfg_sps_r15_present) {
        j.write_bool("ifdma-Config-SPS-r15", c.ifdma_cfg_sps_r15);
      }
      if (c.harq_proc_id_offset_r15_present) {
        j.write_int("harq-ProcID-offset-r15", c.harq_proc_id_offset_r15);
      }
      if (c.rv_sps_stti_ul_repeats_r15_present) {
        j.write_str("rv-SPS-STTI-UL-Repetitions-r15", c.rv_sps_stti_ul_repeats_r15.to_string());
      }
      if (c.sps_cfg_idx_r15_present) {
        j.write_int("sps-ConfigIndex-r15", c.sps_cfg_idx_r15);
      }
      if (c.tbs_scaling_factor_subslot_sps_ul_repeats_r15_present) {
        j.write_str("tbs-scalingFactorSubslotSPS-UL-Repetitions-r15",
                    c.tbs_scaling_factor_subslot_sps_ul_repeats_r15.to_string());
      }
      if (c.total_num_pusch_sps_stti_ul_repeats_r15_present) {
        j.write_str("totalNumberPUSCH-SPS-STTI-UL-Repetitions-r15",
                    c.total_num_pusch_sps_stti_ul_repeats_r15.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_stti_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE sps_cfg_ul_stti_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.p0_persistent_r15_present, 1));
      HANDLE_CODE(bref.pack(c.two_intervs_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.p0_persistent_sf_set2_r15_present, 1));
      HANDLE_CODE(bref.pack(c.nof_conf_ul_sps_processes_stti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.tpc_pdcch_cfg_pusch_sps_r15_present, 1));
      HANDLE_CODE(bref.pack(c.cyclic_shift_sps_s_tti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.ifdma_cfg_sps_r15_present, 1));
      HANDLE_CODE(bref.pack(c.harq_proc_id_offset_r15_present, 1));
      HANDLE_CODE(bref.pack(c.rv_sps_stti_ul_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.sps_cfg_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.tbs_scaling_factor_subslot_sps_ul_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.total_num_pusch_sps_stti_ul_repeats_r15_present, 1));
      HANDLE_CODE(c.semi_persist_sched_interv_ul_stti_r15.pack(bref));
      HANDLE_CODE(c.implicit_release_after.pack(bref));
      if (c.p0_persistent_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.p0_persistent_r15.p0_nominal_spusch_persistent_r15, (int8_t)-126, (int8_t)24));
        HANDLE_CODE(pack_integer(bref, c.p0_persistent_r15.p0_ue_spusch_persistent_r15, (int8_t)-8, (int8_t)7));
      }
      if (c.p0_persistent_sf_set2_r15_present) {
        HANDLE_CODE(c.p0_persistent_sf_set2_r15.pack(bref));
      }
      if (c.nof_conf_ul_sps_processes_stti_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.nof_conf_ul_sps_processes_stti_r15, (uint8_t)1u, (uint8_t)12u));
      }
      HANDLE_CODE(pack_integer(bref, c.stti_start_time_ul_r15, (uint8_t)0u, (uint8_t)5u));
      if (c.tpc_pdcch_cfg_pusch_sps_r15_present) {
        HANDLE_CODE(c.tpc_pdcch_cfg_pusch_sps_r15.pack(bref));
      }
      if (c.cyclic_shift_sps_s_tti_r15_present) {
        HANDLE_CODE(c.cyclic_shift_sps_s_tti_r15.pack(bref));
      }
      if (c.ifdma_cfg_sps_r15_present) {
        HANDLE_CODE(bref.pack(c.ifdma_cfg_sps_r15, 1));
      }
      if (c.harq_proc_id_offset_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.harq_proc_id_offset_r15, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.rv_sps_stti_ul_repeats_r15_present) {
        HANDLE_CODE(c.rv_sps_stti_ul_repeats_r15.pack(bref));
      }
      if (c.sps_cfg_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.sps_cfg_idx_r15, (uint8_t)1u, (uint8_t)6u));
      }
      if (c.tbs_scaling_factor_subslot_sps_ul_repeats_r15_present) {
        HANDLE_CODE(c.tbs_scaling_factor_subslot_sps_ul_repeats_r15.pack(bref));
      }
      if (c.total_num_pusch_sps_stti_ul_repeats_r15_present) {
        HANDLE_CODE(c.total_num_pusch_sps_stti_ul_repeats_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_stti_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_ul_stti_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.p0_persistent_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.two_intervs_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.p0_persistent_sf_set2_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.nof_conf_ul_sps_processes_stti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.tpc_pdcch_cfg_pusch_sps_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.cyclic_shift_sps_s_tti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.ifdma_cfg_sps_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.harq_proc_id_offset_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.rv_sps_stti_ul_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.sps_cfg_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.tbs_scaling_factor_subslot_sps_ul_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.total_num_pusch_sps_stti_ul_repeats_r15_present, 1));
      HANDLE_CODE(c.semi_persist_sched_interv_ul_stti_r15.unpack(bref));
      HANDLE_CODE(c.implicit_release_after.unpack(bref));
      if (c.p0_persistent_r15_present) {
        HANDLE_CODE(
            unpack_integer(c.p0_persistent_r15.p0_nominal_spusch_persistent_r15, bref, (int8_t)-126, (int8_t)24));
        HANDLE_CODE(unpack_integer(c.p0_persistent_r15.p0_ue_spusch_persistent_r15, bref, (int8_t)-8, (int8_t)7));
      }
      if (c.p0_persistent_sf_set2_r15_present) {
        HANDLE_CODE(c.p0_persistent_sf_set2_r15.unpack(bref));
      }
      if (c.nof_conf_ul_sps_processes_stti_r15_present) {
        HANDLE_CODE(unpack_integer(c.nof_conf_ul_sps_processes_stti_r15, bref, (uint8_t)1u, (uint8_t)12u));
      }
      HANDLE_CODE(unpack_integer(c.stti_start_time_ul_r15, bref, (uint8_t)0u, (uint8_t)5u));
      if (c.tpc_pdcch_cfg_pusch_sps_r15_present) {
        HANDLE_CODE(c.tpc_pdcch_cfg_pusch_sps_r15.unpack(bref));
      }
      if (c.cyclic_shift_sps_s_tti_r15_present) {
        HANDLE_CODE(c.cyclic_shift_sps_s_tti_r15.unpack(bref));
      }
      if (c.ifdma_cfg_sps_r15_present) {
        HANDLE_CODE(bref.unpack(c.ifdma_cfg_sps_r15, 1));
      }
      if (c.harq_proc_id_offset_r15_present) {
        HANDLE_CODE(unpack_integer(c.harq_proc_id_offset_r15, bref, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.rv_sps_stti_ul_repeats_r15_present) {
        HANDLE_CODE(c.rv_sps_stti_ul_repeats_r15.unpack(bref));
      }
      if (c.sps_cfg_idx_r15_present) {
        HANDLE_CODE(unpack_integer(c.sps_cfg_idx_r15, bref, (uint8_t)1u, (uint8_t)6u));
      }
      if (c.tbs_scaling_factor_subslot_sps_ul_repeats_r15_present) {
        HANDLE_CODE(c.tbs_scaling_factor_subslot_sps_ul_repeats_r15.unpack(bref));
      }
      if (c.total_num_pusch_sps_stti_ul_repeats_r15_present) {
        HANDLE_CODE(c.total_num_pusch_sps_stti_ul_repeats_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_stti_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sps_cfg_ul_stti_r15_c::setup_s_::p0_persistent_sf_set2_r15_c_::set(types::options e)
{
  type_ = e;
}
void sps_cfg_ul_stti_r15_c::setup_s_::p0_persistent_sf_set2_r15_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_int("p0-NominalSPUSCH-PersistentSubframeSet2-r15", c.p0_nominal_spusch_persistent_sf_set2_r15);
      j.write_int("p0-UE-SPUSCH-PersistentSubframeSet2-r15", c.p0_ue_spusch_persistent_sf_set2_r15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_stti_r15_c::setup_s_::p0_persistent_sf_set2_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE sps_cfg_ul_stti_r15_c::setup_s_::p0_persistent_sf_set2_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.p0_nominal_spusch_persistent_sf_set2_r15, (int8_t)-126, (int8_t)24));
      HANDLE_CODE(pack_integer(bref, c.p0_ue_spusch_persistent_sf_set2_r15, (int8_t)-8, (int8_t)7));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_stti_r15_c::setup_s_::p0_persistent_sf_set2_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_ul_stti_r15_c::setup_s_::p0_persistent_sf_set2_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.p0_nominal_spusch_persistent_sf_set2_r15, bref, (int8_t)-126, (int8_t)24));
      HANDLE_CODE(unpack_integer(c.p0_ue_spusch_persistent_sf_set2_r15, bref, (int8_t)-8, (int8_t)7));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_ul_stti_r15_c::setup_s_::p0_persistent_sf_set2_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SPUCCH-Config-r15 ::= CHOICE
void spucch_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void spucch_cfg_r15_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.spucch_set_r15_present) {
        j.start_array("spucch-Set-r15");
        for (const auto& e1 : c.spucch_set_r15) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.two_ant_port_activ_spucch_format1a1b_r15_present) {
        j.write_str("twoAntennaPortActivatedSPUCCH-Format1a1b-r15", "true");
      }
      j.write_fieldname("twoAntennaPortActivatedSPUCCH-Format3-r15");
      j.start_obj();
      j.start_array("n3SPUCCH-AN-List-r15");
      for (const auto& e1 : c.two_ant_port_activ_spucch_format3_r15.n3_spucch_an_list_r15) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "spucch_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE spucch_cfg_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.spucch_set_r15_present, 1));
      HANDLE_CODE(bref.pack(c.two_ant_port_activ_spucch_format1a1b_r15_present, 1));
      if (c.spucch_set_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.spucch_set_r15, 1, 4));
      }
      HANDLE_CODE(pack_dyn_seq_of(
          bref, c.two_ant_port_activ_spucch_format3_r15.n3_spucch_an_list_r15, 1, 4, integer_packer<uint16_t>(0, 549)));
      break;
    default:
      log_invalid_choice_id(type_, "spucch_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE spucch_cfg_r15_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.spucch_set_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.two_ant_port_activ_spucch_format1a1b_r15_present, 1));
      if (c.spucch_set_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.spucch_set_r15, bref, 1, 4));
      }
      HANDLE_CODE(unpack_dyn_seq_of(
          c.two_ant_port_activ_spucch_format3_r15.n3_spucch_an_list_r15, bref, 1, 4, integer_packer<uint16_t>(0, 549)));
      break;
    default:
      log_invalid_choice_id(type_, "spucch_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SRS-CC-SetIndex-r14 ::= SEQUENCE
SRSASN_CODE srs_cc_set_idx_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cc_set_idx_r14, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(pack_integer(bref, cc_idx_in_one_cc_set_r14, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_cc_set_idx_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cc_set_idx_r14, bref, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(unpack_integer(cc_idx_in_one_cc_set_r14, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void srs_cc_set_idx_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cc-SetIndex-r14", cc_set_idx_r14);
  j.write_int("cc-IndexInOneCC-Set-r14", cc_idx_in_one_cc_set_r14);
  j.end_obj();
}

// SRS-ConfigAp-r10 ::= SEQUENCE
SRSASN_CODE srs_cfg_ap_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(srs_ant_port_ap_r10.pack(bref));
  HANDLE_CODE(srs_bw_ap_r10.pack(bref));
  HANDLE_CODE(pack_integer(bref, freq_domain_position_ap_r10, (uint8_t)0u, (uint8_t)23u));
  HANDLE_CODE(pack_integer(bref, tx_comb_ap_r10, (uint8_t)0u, (uint8_t)1u));
  HANDLE_CODE(cyclic_shift_ap_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_cfg_ap_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(srs_ant_port_ap_r10.unpack(bref));
  HANDLE_CODE(srs_bw_ap_r10.unpack(bref));
  HANDLE_CODE(unpack_integer(freq_domain_position_ap_r10, bref, (uint8_t)0u, (uint8_t)23u));
  HANDLE_CODE(unpack_integer(tx_comb_ap_r10, bref, (uint8_t)0u, (uint8_t)1u));
  HANDLE_CODE(cyclic_shift_ap_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void srs_cfg_ap_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("srs-AntennaPortAp-r10", srs_ant_port_ap_r10.to_string());
  j.write_str("srs-BandwidthAp-r10", srs_bw_ap_r10.to_string());
  j.write_int("freqDomainPositionAp-r10", freq_domain_position_ap_r10);
  j.write_int("transmissionCombAp-r10", tx_comb_ap_r10);
  j.write_str("cyclicShiftAp-r10", cyclic_shift_ap_r10.to_string());
  j.end_obj();
}

// SRS-ConfigAp-r13 ::= SEQUENCE
SRSASN_CODE srs_cfg_ap_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(srs_ant_port_ap_r13.pack(bref));
  HANDLE_CODE(srs_bw_ap_r13.pack(bref));
  HANDLE_CODE(pack_integer(bref, freq_domain_position_ap_r13, (uint8_t)0u, (uint8_t)23u));
  HANDLE_CODE(pack_integer(bref, tx_comb_ap_r13, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(cyclic_shift_ap_r13.pack(bref));
  HANDLE_CODE(tx_comb_num_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_cfg_ap_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(srs_ant_port_ap_r13.unpack(bref));
  HANDLE_CODE(srs_bw_ap_r13.unpack(bref));
  HANDLE_CODE(unpack_integer(freq_domain_position_ap_r13, bref, (uint8_t)0u, (uint8_t)23u));
  HANDLE_CODE(unpack_integer(tx_comb_ap_r13, bref, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(cyclic_shift_ap_r13.unpack(bref));
  HANDLE_CODE(tx_comb_num_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void srs_cfg_ap_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("srs-AntennaPortAp-r13", srs_ant_port_ap_r13.to_string());
  j.write_str("srs-BandwidthAp-r13", srs_bw_ap_r13.to_string());
  j.write_int("freqDomainPositionAp-r13", freq_domain_position_ap_r13);
  j.write_int("transmissionCombAp-r13", tx_comb_ap_r13);
  j.write_str("cyclicShiftAp-r13", cyclic_shift_ap_r13.to_string());
  j.write_str("transmissionCombNum-r13", tx_comb_num_r13.to_string());
  j.end_obj();
}

// SRS-ConfigAp-v1310 ::= SEQUENCE
SRSASN_CODE srs_cfg_ap_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tx_comb_ap_v1310_present, 1));
  HANDLE_CODE(bref.pack(cyclic_shift_ap_v1310_present, 1));
  HANDLE_CODE(bref.pack(tx_comb_num_r13_present, 1));

  if (tx_comb_ap_v1310_present) {
    HANDLE_CODE(pack_integer(bref, tx_comb_ap_v1310, (uint8_t)2u, (uint8_t)3u));
  }
  if (cyclic_shift_ap_v1310_present) {
    HANDLE_CODE(cyclic_shift_ap_v1310.pack(bref));
  }
  if (tx_comb_num_r13_present) {
    HANDLE_CODE(tx_comb_num_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_cfg_ap_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tx_comb_ap_v1310_present, 1));
  HANDLE_CODE(bref.unpack(cyclic_shift_ap_v1310_present, 1));
  HANDLE_CODE(bref.unpack(tx_comb_num_r13_present, 1));

  if (tx_comb_ap_v1310_present) {
    HANDLE_CODE(unpack_integer(tx_comb_ap_v1310, bref, (uint8_t)2u, (uint8_t)3u));
  }
  if (cyclic_shift_ap_v1310_present) {
    HANDLE_CODE(cyclic_shift_ap_v1310.unpack(bref));
  }
  if (tx_comb_num_r13_present) {
    HANDLE_CODE(tx_comb_num_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void srs_cfg_ap_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tx_comb_ap_v1310_present) {
    j.write_int("transmissionCombAp-v1310", tx_comb_ap_v1310);
  }
  if (cyclic_shift_ap_v1310_present) {
    j.write_str("cyclicShiftAp-v1310", cyclic_shift_ap_v1310.to_string());
  }
  if (tx_comb_num_r13_present) {
    j.write_str("transmissionCombNum-r13", tx_comb_num_r13.to_string());
  }
  j.end_obj();
}

// STAG-ToAddMod-r11 ::= SEQUENCE
SRSASN_CODE stag_to_add_mod_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, stag_id_r11, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(time_align_timer_stag_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE stag_to_add_mod_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(stag_id_r11, bref, (uint8_t)1u, (uint8_t)3u));
  HANDLE_CODE(time_align_timer_stag_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void stag_to_add_mod_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("stag-Id-r11", stag_id_r11);
  j.write_str("timeAlignmentTimerSTAG-r11", time_align_timer_stag_r11.to_string());
  j.end_obj();
}

// SchedulingRequestConfig-v1530 ::= CHOICE
void sched_request_cfg_v1530_c::set(types::options e)
{
  type_ = e;
}
void sched_request_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();
      if (c.sr_slot_spucch_idx_fh_r15_present) {
        j.write_int("sr-SlotSPUCCH-IndexFH-r15", c.sr_slot_spucch_idx_fh_r15);
      }
      if (c.sr_slot_spucch_idx_no_fh_r15_present) {
        j.write_int("sr-SlotSPUCCH-IndexNoFH-r15", c.sr_slot_spucch_idx_no_fh_r15);
      }
      if (c.sr_subslot_spucch_res_list_r15_present) {
        j.start_array("sr-SubslotSPUCCH-ResourceList-r15");
        for (const auto& e1 : c.sr_subslot_spucch_res_list_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.sr_cfg_idx_slot_r15_present) {
        j.write_int("sr-ConfigIndexSlot-r15", c.sr_cfg_idx_slot_r15);
      }
      if (c.sr_cfg_idx_subslot_r15_present) {
        j.write_int("sr-ConfigIndexSubslot-r15", c.sr_cfg_idx_subslot_r15);
      }
      j.write_str("dssr-TransMax-r15", c.dssr_trans_max_r15.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_v1530_c");
  }
  j.end_obj();
}
SRSASN_CODE sched_request_cfg_v1530_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.sr_slot_spucch_idx_fh_r15_present, 1));
      HANDLE_CODE(bref.pack(c.sr_slot_spucch_idx_no_fh_r15_present, 1));
      HANDLE_CODE(bref.pack(c.sr_subslot_spucch_res_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.sr_cfg_idx_slot_r15_present, 1));
      HANDLE_CODE(bref.pack(c.sr_cfg_idx_subslot_r15_present, 1));
      if (c.sr_slot_spucch_idx_fh_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.sr_slot_spucch_idx_fh_r15, (uint16_t)0u, (uint16_t)1319u));
      }
      if (c.sr_slot_spucch_idx_no_fh_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.sr_slot_spucch_idx_no_fh_r15, (uint16_t)0u, (uint16_t)3959u));
      }
      if (c.sr_subslot_spucch_res_list_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.sr_subslot_spucch_res_list_r15, 1, 4, integer_packer<uint16_t>(0, 1319)));
      }
      if (c.sr_cfg_idx_slot_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.sr_cfg_idx_slot_r15, (uint8_t)0u, (uint8_t)36u));
      }
      if (c.sr_cfg_idx_subslot_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.sr_cfg_idx_subslot_r15, (uint8_t)0u, (uint8_t)122u));
      }
      HANDLE_CODE(c.dssr_trans_max_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_v1530_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sched_request_cfg_v1530_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.sr_slot_spucch_idx_fh_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.sr_slot_spucch_idx_no_fh_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.sr_subslot_spucch_res_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.sr_cfg_idx_slot_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.sr_cfg_idx_subslot_r15_present, 1));
      if (c.sr_slot_spucch_idx_fh_r15_present) {
        HANDLE_CODE(unpack_integer(c.sr_slot_spucch_idx_fh_r15, bref, (uint16_t)0u, (uint16_t)1319u));
      }
      if (c.sr_slot_spucch_idx_no_fh_r15_present) {
        HANDLE_CODE(unpack_integer(c.sr_slot_spucch_idx_no_fh_r15, bref, (uint16_t)0u, (uint16_t)3959u));
      }
      if (c.sr_subslot_spucch_res_list_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.sr_subslot_spucch_res_list_r15, bref, 1, 4, integer_packer<uint16_t>(0, 1319)));
      }
      if (c.sr_cfg_idx_slot_r15_present) {
        HANDLE_CODE(unpack_integer(c.sr_cfg_idx_slot_r15, bref, (uint8_t)0u, (uint8_t)36u));
      }
      if (c.sr_cfg_idx_subslot_r15_present) {
        HANDLE_CODE(unpack_integer(c.sr_cfg_idx_subslot_r15, bref, (uint8_t)0u, (uint8_t)122u));
      }
      HANDLE_CODE(c.dssr_trans_max_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_v1530_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ShortTTI-r15 ::= SEQUENCE
SRSASN_CODE short_tti_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dl_stti_len_r15_present, 1));
  HANDLE_CODE(bref.pack(ul_stti_len_r15_present, 1));

  if (dl_stti_len_r15_present) {
    HANDLE_CODE(dl_stti_len_r15.pack(bref));
  }
  if (ul_stti_len_r15_present) {
    HANDLE_CODE(ul_stti_len_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE short_tti_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dl_stti_len_r15_present, 1));
  HANDLE_CODE(bref.unpack(ul_stti_len_r15_present, 1));

  if (dl_stti_len_r15_present) {
    HANDLE_CODE(dl_stti_len_r15.unpack(bref));
  }
  if (ul_stti_len_r15_present) {
    HANDLE_CODE(ul_stti_len_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void short_tti_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dl_stti_len_r15_present) {
    j.write_str("dl-STTI-Length-r15", dl_stti_len_r15.to_string());
  }
  if (ul_stti_len_r15_present) {
    j.write_str("ul-STTI-Length-r15", ul_stti_len_r15.to_string());
  }
  j.end_obj();
}

// SlotOrSubslotPDSCH-Config-r15 ::= CHOICE
void slot_or_subslot_pdsch_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void slot_or_subslot_pdsch_cfg_r15_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.alt_cqi_table_stti_r15_present) {
        j.write_str("altCQI-TableSTTI-r15", c.alt_cqi_table_stti_r15.to_string());
      }
      if (c.alt_cqi_table1024_qam_stti_r15_present) {
        j.write_str("altCQI-Table1024QAM-STTI-r15", c.alt_cqi_table1024_qam_stti_r15.to_string());
      }
      if (c.res_alloc_r15_present) {
        j.write_str("resourceAllocation-r15", c.res_alloc_r15.to_string());
      }
      if (c.tbs_idx_alt_stti_r15_present) {
        j.write_str("tbsIndexAlt-STTI-r15", "a33");
      }
      if (c.tbs_idx_alt2_stti_r15_present) {
        j.write_str("tbsIndexAlt2-STTI-r15", "b33");
      }
      if (c.tbs_idx_alt3_stti_r15_present) {
        j.write_str("tbsIndexAlt3-STTI-r15", "a37");
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "slot_or_subslot_pdsch_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE slot_or_subslot_pdsch_cfg_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.alt_cqi_table_stti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.alt_cqi_table1024_qam_stti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.res_alloc_r15_present, 1));
      HANDLE_CODE(bref.pack(c.tbs_idx_alt_stti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.tbs_idx_alt2_stti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.tbs_idx_alt3_stti_r15_present, 1));
      if (c.alt_cqi_table_stti_r15_present) {
        HANDLE_CODE(c.alt_cqi_table_stti_r15.pack(bref));
      }
      if (c.alt_cqi_table1024_qam_stti_r15_present) {
        HANDLE_CODE(c.alt_cqi_table1024_qam_stti_r15.pack(bref));
      }
      if (c.res_alloc_r15_present) {
        HANDLE_CODE(c.res_alloc_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "slot_or_subslot_pdsch_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE slot_or_subslot_pdsch_cfg_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.alt_cqi_table_stti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.alt_cqi_table1024_qam_stti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.res_alloc_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.tbs_idx_alt_stti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.tbs_idx_alt2_stti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.tbs_idx_alt3_stti_r15_present, 1));
      if (c.alt_cqi_table_stti_r15_present) {
        HANDLE_CODE(c.alt_cqi_table_stti_r15.unpack(bref));
      }
      if (c.alt_cqi_table1024_qam_stti_r15_present) {
        HANDLE_CODE(c.alt_cqi_table1024_qam_stti_r15.unpack(bref));
      }
      if (c.res_alloc_r15_present) {
        HANDLE_CODE(c.res_alloc_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "slot_or_subslot_pdsch_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SlotOrSubslotPUSCH-Config-r15 ::= CHOICE
void slot_or_subslot_pusch_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void slot_or_subslot_pusch_cfg_r15_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.beta_offset_slot_ack_idx_r15_present) {
        j.write_int("betaOffsetSlot-ACK-Index-r15", c.beta_offset_slot_ack_idx_r15);
      }
      if (c.beta_offset2_slot_ack_idx_r15_present) {
        j.write_int("betaOffset2Slot-ACK-Index-r15", c.beta_offset2_slot_ack_idx_r15);
      }
      if (c.beta_offset_subslot_ack_idx_r15_present) {
        j.start_array("betaOffsetSubslot-ACK-Index-r15");
        for (const auto& e1 : c.beta_offset_subslot_ack_idx_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.beta_offset2_subslot_ack_idx_r15_present) {
        j.start_array("betaOffset2Subslot-ACK-Index-r15");
        for (const auto& e1 : c.beta_offset2_subslot_ack_idx_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.beta_offset_slot_ri_idx_r15_present) {
        j.write_int("betaOffsetSlot-RI-Index-r15", c.beta_offset_slot_ri_idx_r15);
      }
      if (c.beta_offset_subslot_ri_idx_r15_present) {
        j.start_array("betaOffsetSubslot-RI-Index-r15");
        for (const auto& e1 : c.beta_offset_subslot_ri_idx_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.beta_offset_slot_cqi_idx_r15_present) {
        j.write_int("betaOffsetSlot-CQI-Index-r15", c.beta_offset_slot_cqi_idx_r15);
      }
      if (c.beta_offset_subslot_cqi_idx_r15_present) {
        j.write_int("betaOffsetSubslot-CQI-Index-r15", c.beta_offset_subslot_cqi_idx_r15);
      }
      if (c.enable256_qam_slot_or_subslot_r15_present) {
        j.write_fieldname("enable256QAM-SlotOrSubslot-r15");
        c.enable256_qam_slot_or_subslot_r15.to_json(j);
      }
      if (c.res_alloc_offset_r15_present) {
        j.write_int("resourceAllocationOffset-r15", c.res_alloc_offset_r15);
      }
      j.write_bool("ul-DMRS-IFDMA-SlotOrSubslot-r15", c.ul_dmrs_ifdma_slot_or_subslot_r15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "slot_or_subslot_pusch_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE slot_or_subslot_pusch_cfg_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.beta_offset_slot_ack_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.beta_offset2_slot_ack_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.beta_offset_subslot_ack_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.beta_offset2_subslot_ack_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.beta_offset_slot_ri_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.beta_offset_subslot_ri_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.beta_offset_slot_cqi_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.beta_offset_subslot_cqi_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(c.enable256_qam_slot_or_subslot_r15_present, 1));
      HANDLE_CODE(bref.pack(c.res_alloc_offset_r15_present, 1));
      if (c.beta_offset_slot_ack_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.beta_offset_slot_ack_idx_r15, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.beta_offset2_slot_ack_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.beta_offset2_slot_ack_idx_r15, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.beta_offset_subslot_ack_idx_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.beta_offset_subslot_ack_idx_r15, 1, 2, integer_packer<uint8_t>(0, 15)));
      }
      if (c.beta_offset2_subslot_ack_idx_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.beta_offset2_subslot_ack_idx_r15, 1, 2, integer_packer<uint8_t>(0, 15)));
      }
      if (c.beta_offset_slot_ri_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.beta_offset_slot_ri_idx_r15, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.beta_offset_subslot_ri_idx_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.beta_offset_subslot_ri_idx_r15, 1, 2, integer_packer<uint8_t>(0, 15)));
      }
      if (c.beta_offset_slot_cqi_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.beta_offset_slot_cqi_idx_r15, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.beta_offset_subslot_cqi_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.beta_offset_subslot_cqi_idx_r15, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.enable256_qam_slot_or_subslot_r15_present) {
        HANDLE_CODE(c.enable256_qam_slot_or_subslot_r15.pack(bref));
      }
      if (c.res_alloc_offset_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.res_alloc_offset_r15, (uint8_t)1u, (uint8_t)2u));
      }
      HANDLE_CODE(bref.pack(c.ul_dmrs_ifdma_slot_or_subslot_r15, 1));
      break;
    default:
      log_invalid_choice_id(type_, "slot_or_subslot_pusch_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE slot_or_subslot_pusch_cfg_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.beta_offset_slot_ack_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.beta_offset2_slot_ack_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.beta_offset_subslot_ack_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.beta_offset2_subslot_ack_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.beta_offset_slot_ri_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.beta_offset_subslot_ri_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.beta_offset_slot_cqi_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.beta_offset_subslot_cqi_idx_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.enable256_qam_slot_or_subslot_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.res_alloc_offset_r15_present, 1));
      if (c.beta_offset_slot_ack_idx_r15_present) {
        HANDLE_CODE(unpack_integer(c.beta_offset_slot_ack_idx_r15, bref, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.beta_offset2_slot_ack_idx_r15_present) {
        HANDLE_CODE(unpack_integer(c.beta_offset2_slot_ack_idx_r15, bref, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.beta_offset_subslot_ack_idx_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.beta_offset_subslot_ack_idx_r15, bref, 1, 2, integer_packer<uint8_t>(0, 15)));
      }
      if (c.beta_offset2_subslot_ack_idx_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.beta_offset2_subslot_ack_idx_r15, bref, 1, 2, integer_packer<uint8_t>(0, 15)));
      }
      if (c.beta_offset_slot_ri_idx_r15_present) {
        HANDLE_CODE(unpack_integer(c.beta_offset_slot_ri_idx_r15, bref, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.beta_offset_subslot_ri_idx_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.beta_offset_subslot_ri_idx_r15, bref, 1, 2, integer_packer<uint8_t>(0, 15)));
      }
      if (c.beta_offset_slot_cqi_idx_r15_present) {
        HANDLE_CODE(unpack_integer(c.beta_offset_slot_cqi_idx_r15, bref, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.beta_offset_subslot_cqi_idx_r15_present) {
        HANDLE_CODE(unpack_integer(c.beta_offset_subslot_cqi_idx_r15, bref, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.enable256_qam_slot_or_subslot_r15_present) {
        HANDLE_CODE(c.enable256_qam_slot_or_subslot_r15.unpack(bref));
      }
      if (c.res_alloc_offset_r15_present) {
        HANDLE_CODE(unpack_integer(c.res_alloc_offset_r15, bref, (uint8_t)1u, (uint8_t)2u));
      }
      HANDLE_CODE(bref.unpack(c.ul_dmrs_ifdma_slot_or_subslot_r15, 1));
      break;
    default:
      log_invalid_choice_id(type_, "slot_or_subslot_pusch_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// TDD-PUSCH-UpPTS-r14 ::= CHOICE
void tdd_pusch_up_pts_r14_c::set(types::options e)
{
  type_ = e;
}
void tdd_pusch_up_pts_r14_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.sym_pusch_up_pts_r14_present) {
        j.write_str("symPUSCH-UpPTS-r14", c.sym_pusch_up_pts_r14.to_string());
      }
      if (c.dmrs_less_up_pts_cfg_r14_present) {
        j.write_str("dmrs-LessUpPTS-Config-r14", "true");
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "tdd_pusch_up_pts_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE tdd_pusch_up_pts_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.sym_pusch_up_pts_r14_present, 1));
      HANDLE_CODE(bref.pack(c.dmrs_less_up_pts_cfg_r14_present, 1));
      if (c.sym_pusch_up_pts_r14_present) {
        HANDLE_CODE(c.sym_pusch_up_pts_r14.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "tdd_pusch_up_pts_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE tdd_pusch_up_pts_r14_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.sym_pusch_up_pts_r14_present, 1));
      HANDLE_CODE(bref.unpack(c.dmrs_less_up_pts_cfg_r14_present, 1));
      if (c.sym_pusch_up_pts_r14_present) {
        HANDLE_CODE(c.sym_pusch_up_pts_r14.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "tdd_pusch_up_pts_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UplinkPowerControlDedicatedSTTI-r15 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_ded_stti_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(delta_tx_d_offset_list_spucch_r15_present, 1));

  HANDLE_CODE(bref.pack(accumulation_enabled_stti_r15, 1));
  if (delta_tx_d_offset_list_spucch_r15_present) {
    HANDLE_CODE(delta_tx_d_offset_list_spucch_r15.pack(bref));
  }
  HANDLE_CODE(bref.pack(ul_pwr_csi_payload, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_stti_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(delta_tx_d_offset_list_spucch_r15_present, 1));

  HANDLE_CODE(bref.unpack(accumulation_enabled_stti_r15, 1));
  if (delta_tx_d_offset_list_spucch_r15_present) {
    HANDLE_CODE(delta_tx_d_offset_list_spucch_r15.unpack(bref));
  }
  HANDLE_CODE(bref.unpack(ul_pwr_csi_payload, 1));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_ded_stti_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("accumulationEnabledSTTI-r15", accumulation_enabled_stti_r15);
  if (delta_tx_d_offset_list_spucch_r15_present) {
    j.write_fieldname("deltaTxD-OffsetListSPUCCH-r15");
    delta_tx_d_offset_list_spucch_r15.to_json(j);
  }
  j.write_bool("uplinkPower-CSIPayload", ul_pwr_csi_payload);
  j.end_obj();
}

// AntennaInfoDedicated ::= SEQUENCE
SRSASN_CODE ant_info_ded_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(codebook_subset_restrict_present, 1));

  HANDLE_CODE(tx_mode.pack(bref));
  if (codebook_subset_restrict_present) {
    HANDLE_CODE(codebook_subset_restrict.pack(bref));
  }
  HANDLE_CODE(ue_tx_ant_sel.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(codebook_subset_restrict_present, 1));

  HANDLE_CODE(tx_mode.unpack(bref));
  if (codebook_subset_restrict_present) {
    HANDLE_CODE(codebook_subset_restrict.unpack(bref));
  }
  HANDLE_CODE(ue_tx_ant_sel.unpack(bref));

  return SRSASN_SUCCESS;
}
void ant_info_ded_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("transmissionMode", tx_mode.to_string());
  if (codebook_subset_restrict_present) {
    j.write_fieldname("codebookSubsetRestriction");
    codebook_subset_restrict.to_json(j);
  }
  j.write_fieldname("ue-TransmitAntennaSelection");
  ue_tx_ant_sel.to_json(j);
  j.end_obj();
}

void ant_info_ded_s::codebook_subset_restrict_c_::destroy_()
{
  switch (type_) {
    case types::n2_tx_ant_tm3:
      c.destroy<fixed_bitstring<2> >();
      break;
    case types::n4_tx_ant_tm3:
      c.destroy<fixed_bitstring<4> >();
      break;
    case types::n2_tx_ant_tm4:
      c.destroy<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm4:
      c.destroy<fixed_bitstring<64> >();
      break;
    case types::n2_tx_ant_tm5:
      c.destroy<fixed_bitstring<4> >();
      break;
    case types::n4_tx_ant_tm5:
      c.destroy<fixed_bitstring<16> >();
      break;
    case types::n2_tx_ant_tm6:
      c.destroy<fixed_bitstring<4> >();
      break;
    case types::n4_tx_ant_tm6:
      c.destroy<fixed_bitstring<16> >();
      break;
    default:
      break;
  }
}
void ant_info_ded_s::codebook_subset_restrict_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::n2_tx_ant_tm3:
      c.init<fixed_bitstring<2> >();
      break;
    case types::n4_tx_ant_tm3:
      c.init<fixed_bitstring<4> >();
      break;
    case types::n2_tx_ant_tm4:
      c.init<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm4:
      c.init<fixed_bitstring<64> >();
      break;
    case types::n2_tx_ant_tm5:
      c.init<fixed_bitstring<4> >();
      break;
    case types::n4_tx_ant_tm5:
      c.init<fixed_bitstring<16> >();
      break;
    case types::n2_tx_ant_tm6:
      c.init<fixed_bitstring<4> >();
      break;
    case types::n4_tx_ant_tm6:
      c.init<fixed_bitstring<16> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::codebook_subset_restrict_c_");
  }
}
ant_info_ded_s::codebook_subset_restrict_c_::codebook_subset_restrict_c_(
    const ant_info_ded_s::codebook_subset_restrict_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::n2_tx_ant_tm3:
      c.init(other.c.get<fixed_bitstring<2> >());
      break;
    case types::n4_tx_ant_tm3:
      c.init(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n2_tx_ant_tm4:
      c.init(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm4:
      c.init(other.c.get<fixed_bitstring<64> >());
      break;
    case types::n2_tx_ant_tm5:
      c.init(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n4_tx_ant_tm5:
      c.init(other.c.get<fixed_bitstring<16> >());
      break;
    case types::n2_tx_ant_tm6:
      c.init(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n4_tx_ant_tm6:
      c.init(other.c.get<fixed_bitstring<16> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::codebook_subset_restrict_c_");
  }
}
ant_info_ded_s::codebook_subset_restrict_c_& ant_info_ded_s::codebook_subset_restrict_c_::
                                             operator=(const ant_info_ded_s::codebook_subset_restrict_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::n2_tx_ant_tm3:
      c.set(other.c.get<fixed_bitstring<2> >());
      break;
    case types::n4_tx_ant_tm3:
      c.set(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n2_tx_ant_tm4:
      c.set(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm4:
      c.set(other.c.get<fixed_bitstring<64> >());
      break;
    case types::n2_tx_ant_tm5:
      c.set(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n4_tx_ant_tm5:
      c.set(other.c.get<fixed_bitstring<16> >());
      break;
    case types::n2_tx_ant_tm6:
      c.set(other.c.get<fixed_bitstring<4> >());
      break;
    case types::n4_tx_ant_tm6:
      c.set(other.c.get<fixed_bitstring<16> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::codebook_subset_restrict_c_");
  }

  return *this;
}
void ant_info_ded_s::codebook_subset_restrict_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::n2_tx_ant_tm3:
      j.write_str("n2TxAntenna-tm3", c.get<fixed_bitstring<2> >().to_string());
      break;
    case types::n4_tx_ant_tm3:
      j.write_str("n4TxAntenna-tm3", c.get<fixed_bitstring<4> >().to_string());
      break;
    case types::n2_tx_ant_tm4:
      j.write_str("n2TxAntenna-tm4", c.get<fixed_bitstring<6> >().to_string());
      break;
    case types::n4_tx_ant_tm4:
      j.write_str("n4TxAntenna-tm4", c.get<fixed_bitstring<64> >().to_string());
      break;
    case types::n2_tx_ant_tm5:
      j.write_str("n2TxAntenna-tm5", c.get<fixed_bitstring<4> >().to_string());
      break;
    case types::n4_tx_ant_tm5:
      j.write_str("n4TxAntenna-tm5", c.get<fixed_bitstring<16> >().to_string());
      break;
    case types::n2_tx_ant_tm6:
      j.write_str("n2TxAntenna-tm6", c.get<fixed_bitstring<4> >().to_string());
      break;
    case types::n4_tx_ant_tm6:
      j.write_str("n4TxAntenna-tm6", c.get<fixed_bitstring<16> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::codebook_subset_restrict_c_");
  }
  j.end_obj();
}
SRSASN_CODE ant_info_ded_s::codebook_subset_restrict_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::n2_tx_ant_tm3:
      HANDLE_CODE(c.get<fixed_bitstring<2> >().pack(bref));
      break;
    case types::n4_tx_ant_tm3:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().pack(bref));
      break;
    case types::n2_tx_ant_tm4:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().pack(bref));
      break;
    case types::n4_tx_ant_tm4:
      HANDLE_CODE(c.get<fixed_bitstring<64> >().pack(bref));
      break;
    case types::n2_tx_ant_tm5:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().pack(bref));
      break;
    case types::n4_tx_ant_tm5:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().pack(bref));
      break;
    case types::n2_tx_ant_tm6:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().pack(bref));
      break;
    case types::n4_tx_ant_tm6:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::codebook_subset_restrict_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_s::codebook_subset_restrict_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::n2_tx_ant_tm3:
      HANDLE_CODE(c.get<fixed_bitstring<2> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm3:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().unpack(bref));
      break;
    case types::n2_tx_ant_tm4:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm4:
      HANDLE_CODE(c.get<fixed_bitstring<64> >().unpack(bref));
      break;
    case types::n2_tx_ant_tm5:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm5:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().unpack(bref));
      break;
    case types::n2_tx_ant_tm6:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm6:
      HANDLE_CODE(c.get<fixed_bitstring<16> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::codebook_subset_restrict_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ant_info_ded_s::ue_tx_ant_sel_c_::set(types::options e)
{
  type_ = e;
}
void ant_info_ded_s::ue_tx_ant_sel_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::ue_tx_ant_sel_c_");
  }
  j.end_obj();
}
SRSASN_CODE ant_info_ded_s::ue_tx_ant_sel_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::ue_tx_ant_sel_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_s::ue_tx_ant_sel_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_s::ue_tx_ant_sel_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// AntennaInfoDedicated-r10 ::= SEQUENCE
SRSASN_CODE ant_info_ded_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(codebook_subset_restrict_r10_present, 1));

  HANDLE_CODE(tx_mode_r10.pack(bref));
  if (codebook_subset_restrict_r10_present) {
    HANDLE_CODE(codebook_subset_restrict_r10.pack(bref));
  }
  HANDLE_CODE(ue_tx_ant_sel.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(codebook_subset_restrict_r10_present, 1));

  HANDLE_CODE(tx_mode_r10.unpack(bref));
  if (codebook_subset_restrict_r10_present) {
    HANDLE_CODE(codebook_subset_restrict_r10.unpack(bref));
  }
  HANDLE_CODE(ue_tx_ant_sel.unpack(bref));

  return SRSASN_SUCCESS;
}
void ant_info_ded_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("transmissionMode-r10", tx_mode_r10.to_string());
  if (codebook_subset_restrict_r10_present) {
    j.write_str("codebookSubsetRestriction-r10", codebook_subset_restrict_r10.to_string());
  }
  j.write_fieldname("ue-TransmitAntennaSelection");
  ue_tx_ant_sel.to_json(j);
  j.end_obj();
}

void ant_info_ded_r10_s::ue_tx_ant_sel_c_::set(types::options e)
{
  type_ = e;
}
void ant_info_ded_r10_s::ue_tx_ant_sel_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_r10_s::ue_tx_ant_sel_c_");
  }
  j.end_obj();
}
SRSASN_CODE ant_info_ded_r10_s::ue_tx_ant_sel_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_r10_s::ue_tx_ant_sel_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_r10_s::ue_tx_ant_sel_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_r10_s::ue_tx_ant_sel_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// AntennaInfoDedicated-v1250 ::= SEQUENCE
SRSASN_CODE ant_info_ded_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(alt_codebook_enabled_for4_tx_r12, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(alt_codebook_enabled_for4_tx_r12, 1));

  return SRSASN_SUCCESS;
}
void ant_info_ded_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("alternativeCodebookEnabledFor4TX-r12", alt_codebook_enabled_for4_tx_r12);
  j.end_obj();
}

// AntennaInfoDedicated-v1430 ::= SEQUENCE
SRSASN_CODE ant_info_ded_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_ue_tx_ant_sel_cfg_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_ue_tx_ant_sel_cfg_r14_present, 1));

  return SRSASN_SUCCESS;
}
void ant_info_ded_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_ue_tx_ant_sel_cfg_r14_present) {
    j.write_str("ce-UE-TxAntennaSelection-config-r14", "on");
  }
  j.end_obj();
}

// AntennaInfoDedicated-v1530 ::= CHOICE
void ant_info_ded_v1530_c::set(types::options e)
{
  type_ = e;
}
void ant_info_ded_v1530_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v1530_c");
  }
  j.end_obj();
}
SRSASN_CODE ant_info_ded_v1530_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v1530_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_v1530_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v1530_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ant_info_ded_v1530_c::setup_c_::set(types::options e)
{
  type_ = e;
}
void ant_info_ded_v1530_c::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_tx_ant_sel_srs_minus1_t4_r_cfg_r15:
      break;
    case types::ue_tx_ant_sel_srs_minus2_t4_r_nr_of_pairs_r15:
      j.write_str("ue-TxAntennaSelection-SRS-2T4R-NrOfPairs-r15", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v1530_c::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE ant_info_ded_v1530_c::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_tx_ant_sel_srs_minus1_t4_r_cfg_r15:
      break;
    case types::ue_tx_ant_sel_srs_minus2_t4_r_nr_of_pairs_r15:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v1530_c::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_v1530_c::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_tx_ant_sel_srs_minus1_t4_r_cfg_r15:
      break;
    case types::ue_tx_ant_sel_srs_minus2_t4_r_nr_of_pairs_r15:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v1530_c::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// AntennaInfoDedicated-v920 ::= SEQUENCE
SRSASN_CODE ant_info_ded_v920_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(codebook_subset_restrict_v920_present, 1));

  if (codebook_subset_restrict_v920_present) {
    HANDLE_CODE(codebook_subset_restrict_v920.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_v920_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(codebook_subset_restrict_v920_present, 1));

  if (codebook_subset_restrict_v920_present) {
    HANDLE_CODE(codebook_subset_restrict_v920.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ant_info_ded_v920_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (codebook_subset_restrict_v920_present) {
    j.write_fieldname("codebookSubsetRestriction-v920");
    codebook_subset_restrict_v920.to_json(j);
  }
  j.end_obj();
}

void ant_info_ded_v920_s::codebook_subset_restrict_v920_c_::destroy_()
{
  switch (type_) {
    case types::n2_tx_ant_tm8_r9:
      c.destroy<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm8_r9:
      c.destroy<fixed_bitstring<32> >();
      break;
    default:
      break;
  }
}
void ant_info_ded_v920_s::codebook_subset_restrict_v920_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::n2_tx_ant_tm8_r9:
      c.init<fixed_bitstring<6> >();
      break;
    case types::n4_tx_ant_tm8_r9:
      c.init<fixed_bitstring<32> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v920_s::codebook_subset_restrict_v920_c_");
  }
}
ant_info_ded_v920_s::codebook_subset_restrict_v920_c_::codebook_subset_restrict_v920_c_(
    const ant_info_ded_v920_s::codebook_subset_restrict_v920_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::n2_tx_ant_tm8_r9:
      c.init(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm8_r9:
      c.init(other.c.get<fixed_bitstring<32> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v920_s::codebook_subset_restrict_v920_c_");
  }
}
ant_info_ded_v920_s::codebook_subset_restrict_v920_c_& ant_info_ded_v920_s::codebook_subset_restrict_v920_c_::
                                                       operator=(const ant_info_ded_v920_s::codebook_subset_restrict_v920_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::n2_tx_ant_tm8_r9:
      c.set(other.c.get<fixed_bitstring<6> >());
      break;
    case types::n4_tx_ant_tm8_r9:
      c.set(other.c.get<fixed_bitstring<32> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v920_s::codebook_subset_restrict_v920_c_");
  }

  return *this;
}
void ant_info_ded_v920_s::codebook_subset_restrict_v920_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::n2_tx_ant_tm8_r9:
      j.write_str("n2TxAntenna-tm8-r9", c.get<fixed_bitstring<6> >().to_string());
      break;
    case types::n4_tx_ant_tm8_r9:
      j.write_str("n4TxAntenna-tm8-r9", c.get<fixed_bitstring<32> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v920_s::codebook_subset_restrict_v920_c_");
  }
  j.end_obj();
}
SRSASN_CODE ant_info_ded_v920_s::codebook_subset_restrict_v920_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::n2_tx_ant_tm8_r9:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().pack(bref));
      break;
    case types::n4_tx_ant_tm8_r9:
      HANDLE_CODE(c.get<fixed_bitstring<32> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v920_s::codebook_subset_restrict_v920_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_v920_s::codebook_subset_restrict_v920_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::n2_tx_ant_tm8_r9:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().unpack(bref));
      break;
    case types::n4_tx_ant_tm8_r9:
      HANDLE_CODE(c.get<fixed_bitstring<32> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ant_info_ded_v920_s::codebook_subset_restrict_v920_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// AntennaInfoUL-r10 ::= SEQUENCE
SRSASN_CODE ant_info_ul_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tx_mode_ul_r10_present, 1));
  HANDLE_CODE(bref.pack(four_ant_port_activ_r10_present, 1));

  if (tx_mode_ul_r10_present) {
    HANDLE_CODE(tx_mode_ul_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ul_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tx_mode_ul_r10_present, 1));
  HANDLE_CODE(bref.unpack(four_ant_port_activ_r10_present, 1));

  if (tx_mode_ul_r10_present) {
    HANDLE_CODE(tx_mode_ul_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ant_info_ul_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tx_mode_ul_r10_present) {
    j.write_str("transmissionModeUL-r10", tx_mode_ul_r10.to_string());
  }
  if (four_ant_port_activ_r10_present) {
    j.write_str("fourAntennaPortActivated-r10", "setup");
  }
  j.end_obj();
}

// BandClassPriority1XRTT ::= SEQUENCE
SRSASN_CODE band_class_prio1_xrtt_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(band_class.pack(bref));
  HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_class_prio1_xrtt_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(band_class.unpack(bref));
  HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void band_class_prio1_xrtt_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("bandClass", band_class.to_string());
  j.write_int("cellReselectionPriority", cell_resel_prio);
  j.end_obj();
}

// BandClassPriorityHRPD ::= SEQUENCE
SRSASN_CODE band_class_prio_hrpd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(band_class.pack(bref));
  HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_class_prio_hrpd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(band_class.unpack(bref));
  HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void band_class_prio_hrpd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("bandClass", band_class.to_string());
  j.write_int("cellReselectionPriority", cell_resel_prio);
  j.end_obj();
}

// CFI-Config-r15 ::= SEQUENCE
SRSASN_CODE cfi_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cfi_sf_non_mbsfn_r15_present, 1));
  HANDLE_CODE(bref.pack(cfi_slot_subslot_non_mbsfn_r15_present, 1));
  HANDLE_CODE(bref.pack(cfi_sf_mbsfn_r15_present, 1));
  HANDLE_CODE(bref.pack(cfi_slot_subslot_mbsfn_r15_present, 1));

  if (cfi_sf_non_mbsfn_r15_present) {
    HANDLE_CODE(pack_integer(bref, cfi_sf_non_mbsfn_r15, (uint8_t)1u, (uint8_t)4u));
  }
  if (cfi_slot_subslot_non_mbsfn_r15_present) {
    HANDLE_CODE(pack_integer(bref, cfi_slot_subslot_non_mbsfn_r15, (uint8_t)1u, (uint8_t)3u));
  }
  if (cfi_sf_mbsfn_r15_present) {
    HANDLE_CODE(pack_integer(bref, cfi_sf_mbsfn_r15, (uint8_t)1u, (uint8_t)2u));
  }
  if (cfi_slot_subslot_mbsfn_r15_present) {
    HANDLE_CODE(pack_integer(bref, cfi_slot_subslot_mbsfn_r15, (uint8_t)1u, (uint8_t)2u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cfi_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cfi_sf_non_mbsfn_r15_present, 1));
  HANDLE_CODE(bref.unpack(cfi_slot_subslot_non_mbsfn_r15_present, 1));
  HANDLE_CODE(bref.unpack(cfi_sf_mbsfn_r15_present, 1));
  HANDLE_CODE(bref.unpack(cfi_slot_subslot_mbsfn_r15_present, 1));

  if (cfi_sf_non_mbsfn_r15_present) {
    HANDLE_CODE(unpack_integer(cfi_sf_non_mbsfn_r15, bref, (uint8_t)1u, (uint8_t)4u));
  }
  if (cfi_slot_subslot_non_mbsfn_r15_present) {
    HANDLE_CODE(unpack_integer(cfi_slot_subslot_non_mbsfn_r15, bref, (uint8_t)1u, (uint8_t)3u));
  }
  if (cfi_sf_mbsfn_r15_present) {
    HANDLE_CODE(unpack_integer(cfi_sf_mbsfn_r15, bref, (uint8_t)1u, (uint8_t)2u));
  }
  if (cfi_slot_subslot_mbsfn_r15_present) {
    HANDLE_CODE(unpack_integer(cfi_slot_subslot_mbsfn_r15, bref, (uint8_t)1u, (uint8_t)2u));
  }

  return SRSASN_SUCCESS;
}
void cfi_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cfi_sf_non_mbsfn_r15_present) {
    j.write_int("cfi-SubframeNonMBSFN-r15", cfi_sf_non_mbsfn_r15);
  }
  if (cfi_slot_subslot_non_mbsfn_r15_present) {
    j.write_int("cfi-SlotSubslotNonMBSFN-r15", cfi_slot_subslot_non_mbsfn_r15);
  }
  if (cfi_sf_mbsfn_r15_present) {
    j.write_int("cfi-SubframeMBSFN-r15", cfi_sf_mbsfn_r15);
  }
  if (cfi_slot_subslot_mbsfn_r15_present) {
    j.write_int("cfi-SlotSubslotMBSFN-r15", cfi_slot_subslot_mbsfn_r15);
  }
  j.end_obj();
}

// CFI-PatternConfig-r15 ::= SEQUENCE
SRSASN_CODE cfi_pattern_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cfi_pattern_sf_r15_present, 1));
  HANDLE_CODE(bref.pack(cfi_pattern_slot_subslot_r15_present, 1));

  if (cfi_pattern_sf_r15_present) {
    HANDLE_CODE(
        pack_fixed_seq_of(bref, &(cfi_pattern_sf_r15)[0], cfi_pattern_sf_r15.size(), integer_packer<uint8_t>(1, 4)));
  }
  if (cfi_pattern_slot_subslot_r15_present) {
    HANDLE_CODE(pack_fixed_seq_of(
        bref, &(cfi_pattern_slot_subslot_r15)[0], cfi_pattern_slot_subslot_r15.size(), integer_packer<uint8_t>(1, 3)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cfi_pattern_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cfi_pattern_sf_r15_present, 1));
  HANDLE_CODE(bref.unpack(cfi_pattern_slot_subslot_r15_present, 1));

  if (cfi_pattern_sf_r15_present) {
    HANDLE_CODE(
        unpack_fixed_seq_of(&(cfi_pattern_sf_r15)[0], bref, cfi_pattern_sf_r15.size(), integer_packer<uint8_t>(1, 4)));
  }
  if (cfi_pattern_slot_subslot_r15_present) {
    HANDLE_CODE(unpack_fixed_seq_of(
        &(cfi_pattern_slot_subslot_r15)[0], bref, cfi_pattern_slot_subslot_r15.size(), integer_packer<uint8_t>(1, 3)));
  }

  return SRSASN_SUCCESS;
}
void cfi_pattern_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cfi_pattern_sf_r15_present) {
    j.start_array("cfi-PatternSubframe-r15");
    for (const auto& e1 : cfi_pattern_sf_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (cfi_pattern_slot_subslot_r15_present) {
    j.start_array("cfi-PatternSlotSubslot-r15");
    for (const auto& e1 : cfi_pattern_slot_subslot_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.end_obj();
}

// CQI-ReportConfig ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cqi_report_mode_aperiodic_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_periodic_present, 1));

  if (cqi_report_mode_aperiodic_present) {
    HANDLE_CODE(cqi_report_mode_aperiodic.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, nom_pdsch_rs_epre_offset, (int8_t)-1, (int8_t)6));
  if (cqi_report_periodic_present) {
    HANDLE_CODE(cqi_report_periodic.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cqi_report_mode_aperiodic_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_periodic_present, 1));

  if (cqi_report_mode_aperiodic_present) {
    HANDLE_CODE(cqi_report_mode_aperiodic.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(nom_pdsch_rs_epre_offset, bref, (int8_t)-1, (int8_t)6));
  if (cqi_report_periodic_present) {
    HANDLE_CODE(cqi_report_periodic.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cqi_report_mode_aperiodic_present) {
    j.write_str("cqi-ReportModeAperiodic", cqi_report_mode_aperiodic.to_string());
  }
  j.write_int("nomPDSCH-RS-EPRE-Offset", nom_pdsch_rs_epre_offset);
  if (cqi_report_periodic_present) {
    j.write_fieldname("cqi-ReportPeriodic");
    cqi_report_periodic.to_json(j);
  }
  j.end_obj();
}

// CQI-ReportConfig-v1530 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(alt_cqi_table_minus1024_qam_r15_present, 1));

  if (alt_cqi_table_minus1024_qam_r15_present) {
    HANDLE_CODE(alt_cqi_table_minus1024_qam_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(alt_cqi_table_minus1024_qam_r15_present, 1));

  if (alt_cqi_table_minus1024_qam_r15_present) {
    HANDLE_CODE(alt_cqi_table_minus1024_qam_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (alt_cqi_table_minus1024_qam_r15_present) {
    j.write_str("altCQI-Table-1024QAM-r15", alt_cqi_table_minus1024_qam_r15.to_string());
  }
  j.end_obj();
}

// CQI-ReportConfig-v920 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_v920_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cqi_mask_r9_present, 1));
  HANDLE_CODE(bref.pack(pmi_ri_report_r9_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_v920_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cqi_mask_r9_present, 1));
  HANDLE_CODE(bref.unpack(pmi_ri_report_r9_present, 1));

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_v920_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cqi_mask_r9_present) {
    j.write_str("cqi-Mask-r9", "setup");
  }
  if (pmi_ri_report_r9_present) {
    j.write_str("pmi-RI-Report-r9", "setup");
  }
  j.end_obj();
}

// CSI-RS-Config-v1480 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_v1480_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(emimo_type_v1480_present, 1));

  if (emimo_type_v1480_present) {
    HANDLE_CODE(emimo_type_v1480.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_v1480_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(emimo_type_v1480_present, 1));

  if (emimo_type_v1480_present) {
    HANDLE_CODE(emimo_type_v1480.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_v1480_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (emimo_type_v1480_present) {
    j.write_fieldname("eMIMO-Type-v1480");
    emimo_type_v1480.to_json(j);
  }
  j.end_obj();
}

// CSI-RS-Config-v1530 ::= SEQUENCE
SRSASN_CODE csi_rs_cfg_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(emimo_type_v1530_present, 1));

  if (emimo_type_v1530_present) {
    HANDLE_CODE(emimo_type_v1530.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csi_rs_cfg_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(emimo_type_v1530_present, 1));

  if (emimo_type_v1530_present) {
    HANDLE_CODE(emimo_type_v1530.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csi_rs_cfg_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (emimo_type_v1530_present) {
    j.write_fieldname("eMIMO-Type-v1530");
    emimo_type_v1530.to_json(j);
  }
  j.end_obj();
}

// DRB-ToAddMod ::= SEQUENCE
SRSASN_CODE drb_to_add_mod_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(eps_bearer_id_present, 1));
  HANDLE_CODE(bref.pack(pdcp_cfg_present, 1));
  HANDLE_CODE(bref.pack(rlc_cfg_present, 1));
  HANDLE_CODE(bref.pack(lc_ch_id_present, 1));
  HANDLE_CODE(bref.pack(lc_ch_cfg_present, 1));

  if (eps_bearer_id_present) {
    HANDLE_CODE(pack_integer(bref, eps_bearer_id, (uint8_t)0u, (uint8_t)15u));
  }
  HANDLE_CODE(pack_integer(bref, drb_id, (uint8_t)1u, (uint8_t)32u));
  if (pdcp_cfg_present) {
    HANDLE_CODE(pdcp_cfg.pack(bref));
  }
  if (rlc_cfg_present) {
    HANDLE_CODE(rlc_cfg.pack(bref));
  }
  if (lc_ch_id_present) {
    HANDLE_CODE(pack_integer(bref, lc_ch_id, (uint8_t)3u, (uint8_t)10u));
  }
  if (lc_ch_cfg_present) {
    HANDLE_CODE(lc_ch_cfg.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= drb_type_change_r12_present;
    group_flags[0] |= rlc_cfg_v1250.is_present();
    group_flags[1] |= rlc_cfg_v1310.is_present();
    group_flags[1] |= drb_type_lwa_r13_present;
    group_flags[1] |= drb_type_lwip_r13_present;
    group_flags[2] |= rlc_cfg_v1430.is_present();
    group_flags[2] |= lwip_ul_aggregation_r14_present;
    group_flags[2] |= lwip_dl_aggregation_r14_present;
    group_flags[2] |= lwa_wlan_ac_r14_present;
    group_flags[3] |= rlc_cfg_v1510.is_present();
    group_flags[4] |= rlc_cfg_v1530.is_present();
    group_flags[4] |= rlc_bearer_cfg_dupl_r15.is_present();
    group_flags[4] |= lc_ch_id_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(drb_type_change_r12_present, 1));
      HANDLE_CODE(bref.pack(rlc_cfg_v1250.is_present(), 1));
      if (rlc_cfg_v1250.is_present()) {
        HANDLE_CODE(rlc_cfg_v1250->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rlc_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(drb_type_lwa_r13_present, 1));
      HANDLE_CODE(bref.pack(drb_type_lwip_r13_present, 1));
      if (rlc_cfg_v1310.is_present()) {
        HANDLE_CODE(rlc_cfg_v1310->pack(bref));
      }
      if (drb_type_lwa_r13_present) {
        HANDLE_CODE(bref.pack(drb_type_lwa_r13, 1));
      }
      if (drb_type_lwip_r13_present) {
        HANDLE_CODE(drb_type_lwip_r13.pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rlc_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(lwip_ul_aggregation_r14_present, 1));
      HANDLE_CODE(bref.pack(lwip_dl_aggregation_r14_present, 1));
      HANDLE_CODE(bref.pack(lwa_wlan_ac_r14_present, 1));
      if (rlc_cfg_v1430.is_present()) {
        HANDLE_CODE(rlc_cfg_v1430->pack(bref));
      }
      if (lwip_ul_aggregation_r14_present) {
        HANDLE_CODE(bref.pack(lwip_ul_aggregation_r14, 1));
      }
      if (lwip_dl_aggregation_r14_present) {
        HANDLE_CODE(bref.pack(lwip_dl_aggregation_r14, 1));
      }
      if (lwa_wlan_ac_r14_present) {
        HANDLE_CODE(lwa_wlan_ac_r14.pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rlc_cfg_v1510.is_present(), 1));
      if (rlc_cfg_v1510.is_present()) {
        HANDLE_CODE(rlc_cfg_v1510->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rlc_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(rlc_bearer_cfg_dupl_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(lc_ch_id_r15_present, 1));
      if (rlc_cfg_v1530.is_present()) {
        HANDLE_CODE(rlc_cfg_v1530->pack(bref));
      }
      if (rlc_bearer_cfg_dupl_r15.is_present()) {
        HANDLE_CODE(rlc_bearer_cfg_dupl_r15->pack(bref));
      }
      if (lc_ch_id_r15_present) {
        HANDLE_CODE(pack_integer(bref, lc_ch_id_r15, (uint8_t)32u, (uint8_t)38u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE drb_to_add_mod_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(eps_bearer_id_present, 1));
  HANDLE_CODE(bref.unpack(pdcp_cfg_present, 1));
  HANDLE_CODE(bref.unpack(rlc_cfg_present, 1));
  HANDLE_CODE(bref.unpack(lc_ch_id_present, 1));
  HANDLE_CODE(bref.unpack(lc_ch_cfg_present, 1));

  if (eps_bearer_id_present) {
    HANDLE_CODE(unpack_integer(eps_bearer_id, bref, (uint8_t)0u, (uint8_t)15u));
  }
  HANDLE_CODE(unpack_integer(drb_id, bref, (uint8_t)1u, (uint8_t)32u));
  if (pdcp_cfg_present) {
    HANDLE_CODE(pdcp_cfg.unpack(bref));
  }
  if (rlc_cfg_present) {
    HANDLE_CODE(rlc_cfg.unpack(bref));
  }
  if (lc_ch_id_present) {
    HANDLE_CODE(unpack_integer(lc_ch_id, bref, (uint8_t)3u, (uint8_t)10u));
  }
  if (lc_ch_cfg_present) {
    HANDLE_CODE(lc_ch_cfg.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(5);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(drb_type_change_r12_present, 1));
      bool rlc_cfg_v1250_present;
      HANDLE_CODE(bref.unpack(rlc_cfg_v1250_present, 1));
      rlc_cfg_v1250.set_present(rlc_cfg_v1250_present);
      if (rlc_cfg_v1250.is_present()) {
        HANDLE_CODE(rlc_cfg_v1250->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool rlc_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(rlc_cfg_v1310_present, 1));
      rlc_cfg_v1310.set_present(rlc_cfg_v1310_present);
      HANDLE_CODE(bref.unpack(drb_type_lwa_r13_present, 1));
      HANDLE_CODE(bref.unpack(drb_type_lwip_r13_present, 1));
      if (rlc_cfg_v1310.is_present()) {
        HANDLE_CODE(rlc_cfg_v1310->unpack(bref));
      }
      if (drb_type_lwa_r13_present) {
        HANDLE_CODE(bref.unpack(drb_type_lwa_r13, 1));
      }
      if (drb_type_lwip_r13_present) {
        HANDLE_CODE(drb_type_lwip_r13.unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool rlc_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(rlc_cfg_v1430_present, 1));
      rlc_cfg_v1430.set_present(rlc_cfg_v1430_present);
      HANDLE_CODE(bref.unpack(lwip_ul_aggregation_r14_present, 1));
      HANDLE_CODE(bref.unpack(lwip_dl_aggregation_r14_present, 1));
      HANDLE_CODE(bref.unpack(lwa_wlan_ac_r14_present, 1));
      if (rlc_cfg_v1430.is_present()) {
        HANDLE_CODE(rlc_cfg_v1430->unpack(bref));
      }
      if (lwip_ul_aggregation_r14_present) {
        HANDLE_CODE(bref.unpack(lwip_ul_aggregation_r14, 1));
      }
      if (lwip_dl_aggregation_r14_present) {
        HANDLE_CODE(bref.unpack(lwip_dl_aggregation_r14, 1));
      }
      if (lwa_wlan_ac_r14_present) {
        HANDLE_CODE(lwa_wlan_ac_r14.unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool rlc_cfg_v1510_present;
      HANDLE_CODE(bref.unpack(rlc_cfg_v1510_present, 1));
      rlc_cfg_v1510.set_present(rlc_cfg_v1510_present);
      if (rlc_cfg_v1510.is_present()) {
        HANDLE_CODE(rlc_cfg_v1510->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool rlc_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(rlc_cfg_v1530_present, 1));
      rlc_cfg_v1530.set_present(rlc_cfg_v1530_present);
      bool rlc_bearer_cfg_dupl_r15_present;
      HANDLE_CODE(bref.unpack(rlc_bearer_cfg_dupl_r15_present, 1));
      rlc_bearer_cfg_dupl_r15.set_present(rlc_bearer_cfg_dupl_r15_present);
      HANDLE_CODE(bref.unpack(lc_ch_id_r15_present, 1));
      if (rlc_cfg_v1530.is_present()) {
        HANDLE_CODE(rlc_cfg_v1530->unpack(bref));
      }
      if (rlc_bearer_cfg_dupl_r15.is_present()) {
        HANDLE_CODE(rlc_bearer_cfg_dupl_r15->unpack(bref));
      }
      if (lc_ch_id_r15_present) {
        HANDLE_CODE(unpack_integer(lc_ch_id_r15, bref, (uint8_t)32u, (uint8_t)38u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void drb_to_add_mod_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (eps_bearer_id_present) {
    j.write_int("eps-BearerIdentity", eps_bearer_id);
  }
  j.write_int("drb-Identity", drb_id);
  if (pdcp_cfg_present) {
    j.write_fieldname("pdcp-Config");
    pdcp_cfg.to_json(j);
  }
  if (rlc_cfg_present) {
    j.write_fieldname("rlc-Config");
    rlc_cfg.to_json(j);
  }
  if (lc_ch_id_present) {
    j.write_int("logicalChannelIdentity", lc_ch_id);
  }
  if (lc_ch_cfg_present) {
    j.write_fieldname("logicalChannelConfig");
    lc_ch_cfg.to_json(j);
  }
  if (ext) {
    if (drb_type_change_r12_present) {
      j.write_str("drb-TypeChange-r12", "toMCG");
    }
    if (rlc_cfg_v1250.is_present()) {
      j.write_fieldname("rlc-Config-v1250");
      rlc_cfg_v1250->to_json(j);
    }
    if (rlc_cfg_v1310.is_present()) {
      j.write_fieldname("rlc-Config-v1310");
      rlc_cfg_v1310->to_json(j);
    }
    if (drb_type_lwa_r13_present) {
      j.write_bool("drb-TypeLWA-r13", drb_type_lwa_r13);
    }
    if (drb_type_lwip_r13_present) {
      j.write_str("drb-TypeLWIP-r13", drb_type_lwip_r13.to_string());
    }
    if (rlc_cfg_v1430.is_present()) {
      j.write_fieldname("rlc-Config-v1430");
      rlc_cfg_v1430->to_json(j);
    }
    if (lwip_ul_aggregation_r14_present) {
      j.write_bool("lwip-UL-Aggregation-r14", lwip_ul_aggregation_r14);
    }
    if (lwip_dl_aggregation_r14_present) {
      j.write_bool("lwip-DL-Aggregation-r14", lwip_dl_aggregation_r14);
    }
    if (lwa_wlan_ac_r14_present) {
      j.write_str("lwa-WLAN-AC-r14", lwa_wlan_ac_r14.to_string());
    }
    if (rlc_cfg_v1510.is_present()) {
      j.write_fieldname("rlc-Config-v1510");
      rlc_cfg_v1510->to_json(j);
    }
    if (rlc_cfg_v1530.is_present()) {
      j.write_fieldname("rlc-Config-v1530");
      rlc_cfg_v1530->to_json(j);
    }
    if (rlc_bearer_cfg_dupl_r15.is_present()) {
      j.write_fieldname("rlc-BearerConfigDupl-r15");
      rlc_bearer_cfg_dupl_r15->to_json(j);
    }
    if (lc_ch_id_r15_present) {
      j.write_int("logicalChannelIdentity-r15", lc_ch_id_r15);
    }
  }
  j.end_obj();
}

// DRX-Config ::= CHOICE
void drx_cfg_c::set(types::options e)
{
  type_ = e;
}
void drx_cfg_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("onDurationTimer", c.on_dur_timer.to_string());
      j.write_str("drx-InactivityTimer", c.drx_inactivity_timer.to_string());
      j.write_str("drx-RetransmissionTimer", c.drx_retx_timer.to_string());
      j.write_fieldname("longDRX-CycleStartOffset");
      c.long_drx_cycle_start_offset.to_json(j);
      if (c.short_drx_present) {
        j.write_fieldname("shortDRX");
        j.start_obj();
        j.write_str("shortDRX-Cycle", c.short_drx.short_drx_cycle.to_string());
        j.write_int("drxShortCycleTimer", c.short_drx.drx_short_cycle_timer);
        j.end_obj();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_c");
  }
  j.end_obj();
}
SRSASN_CODE drx_cfg_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.short_drx_present, 1));
      HANDLE_CODE(c.on_dur_timer.pack(bref));
      HANDLE_CODE(c.drx_inactivity_timer.pack(bref));
      HANDLE_CODE(c.drx_retx_timer.pack(bref));
      HANDLE_CODE(c.long_drx_cycle_start_offset.pack(bref));
      if (c.short_drx_present) {
        HANDLE_CODE(c.short_drx.short_drx_cycle.pack(bref));
        HANDLE_CODE(pack_integer(bref, c.short_drx.drx_short_cycle_timer, (uint8_t)1u, (uint8_t)16u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE drx_cfg_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.short_drx_present, 1));
      HANDLE_CODE(c.on_dur_timer.unpack(bref));
      HANDLE_CODE(c.drx_inactivity_timer.unpack(bref));
      HANDLE_CODE(c.drx_retx_timer.unpack(bref));
      HANDLE_CODE(c.long_drx_cycle_start_offset.unpack(bref));
      if (c.short_drx_present) {
        HANDLE_CODE(c.short_drx.short_drx_cycle.unpack(bref));
        HANDLE_CODE(unpack_integer(c.short_drx.drx_short_cycle_timer, bref, (uint8_t)1u, (uint8_t)16u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_::destroy_() {}
void drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_::long_drx_cycle_start_offset_c_(
    const drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf10:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf20:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf32:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf40:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf64:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf80:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf128:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf160:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf256:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf320:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf512:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf640:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf1024:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf1280:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf2048:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf2560:
      c.init(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_");
  }
}
drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_& drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_::
                                                     operator=(const drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf10:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf20:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf32:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf40:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf64:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf80:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf128:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf160:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf256:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf320:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf512:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf640:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf1024:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf1280:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf2048:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf2560:
      c.set(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_");
  }

  return *this;
}
void drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf10:
      j.write_int("sf10", c.get<uint8_t>());
      break;
    case types::sf20:
      j.write_int("sf20", c.get<uint8_t>());
      break;
    case types::sf32:
      j.write_int("sf32", c.get<uint8_t>());
      break;
    case types::sf40:
      j.write_int("sf40", c.get<uint8_t>());
      break;
    case types::sf64:
      j.write_int("sf64", c.get<uint8_t>());
      break;
    case types::sf80:
      j.write_int("sf80", c.get<uint8_t>());
      break;
    case types::sf128:
      j.write_int("sf128", c.get<uint8_t>());
      break;
    case types::sf160:
      j.write_int("sf160", c.get<uint8_t>());
      break;
    case types::sf256:
      j.write_int("sf256", c.get<uint16_t>());
      break;
    case types::sf320:
      j.write_int("sf320", c.get<uint16_t>());
      break;
    case types::sf512:
      j.write_int("sf512", c.get<uint16_t>());
      break;
    case types::sf640:
      j.write_int("sf640", c.get<uint16_t>());
      break;
    case types::sf1024:
      j.write_int("sf1024", c.get<uint16_t>());
      break;
    case types::sf1280:
      j.write_int("sf1280", c.get<uint16_t>());
      break;
    case types::sf2048:
      j.write_int("sf2048", c.get<uint16_t>());
      break;
    case types::sf2560:
      j.write_int("sf2560", c.get<uint16_t>());
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_");
  }
  j.end_obj();
}
SRSASN_CODE drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf10:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf32:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)31u));
      break;
    case types::sf40:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf64:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)63u));
      break;
    case types::sf80:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf128:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    case types::sf160:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    case types::sf256:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)255u));
      break;
    case types::sf320:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::sf512:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::sf640:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::sf1024:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1023u));
      break;
    case types::sf1280:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::sf2048:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)2047u));
      break;
    case types::sf2560:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)2559u));
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf10:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf32:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)31u));
      break;
    case types::sf40:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf64:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)63u));
      break;
    case types::sf80:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf128:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    case types::sf160:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    case types::sf256:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)255u));
      break;
    case types::sf320:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::sf512:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::sf640:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::sf1024:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1023u));
      break;
    case types::sf1280:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::sf2048:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    case types::sf2560:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)2559u));
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_c::setup_s_::long_drx_cycle_start_offset_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DRX-Config-r13 ::= SEQUENCE
SRSASN_CODE drx_cfg_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(on_dur_timer_v1310_present, 1));
  HANDLE_CODE(bref.pack(drx_retx_timer_v1310_present, 1));
  HANDLE_CODE(bref.pack(drx_ul_retx_timer_r13_present, 1));

  if (on_dur_timer_v1310_present) {
    HANDLE_CODE(on_dur_timer_v1310.pack(bref));
  }
  if (drx_retx_timer_v1310_present) {
    HANDLE_CODE(drx_retx_timer_v1310.pack(bref));
  }
  if (drx_ul_retx_timer_r13_present) {
    HANDLE_CODE(drx_ul_retx_timer_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE drx_cfg_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(on_dur_timer_v1310_present, 1));
  HANDLE_CODE(bref.unpack(drx_retx_timer_v1310_present, 1));
  HANDLE_CODE(bref.unpack(drx_ul_retx_timer_r13_present, 1));

  if (on_dur_timer_v1310_present) {
    HANDLE_CODE(on_dur_timer_v1310.unpack(bref));
  }
  if (drx_retx_timer_v1310_present) {
    HANDLE_CODE(drx_retx_timer_v1310.unpack(bref));
  }
  if (drx_ul_retx_timer_r13_present) {
    HANDLE_CODE(drx_ul_retx_timer_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void drx_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (on_dur_timer_v1310_present) {
    j.write_str("onDurationTimer-v1310", on_dur_timer_v1310.to_string());
  }
  if (drx_retx_timer_v1310_present) {
    j.write_str("drx-RetransmissionTimer-v1310", drx_retx_timer_v1310.to_string());
  }
  if (drx_ul_retx_timer_r13_present) {
    j.write_str("drx-ULRetransmissionTimer-r13", drx_ul_retx_timer_r13.to_string());
  }
  j.end_obj();
}

// DRX-Config-r15 ::= SEQUENCE
SRSASN_CODE drx_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(drx_retx_timer_short_tti_r15_present, 1));
  HANDLE_CODE(bref.pack(drx_ul_retx_timer_short_tti_r15_present, 1));

  if (drx_retx_timer_short_tti_r15_present) {
    HANDLE_CODE(drx_retx_timer_short_tti_r15.pack(bref));
  }
  if (drx_ul_retx_timer_short_tti_r15_present) {
    HANDLE_CODE(drx_ul_retx_timer_short_tti_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE drx_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(drx_retx_timer_short_tti_r15_present, 1));
  HANDLE_CODE(bref.unpack(drx_ul_retx_timer_short_tti_r15_present, 1));

  if (drx_retx_timer_short_tti_r15_present) {
    HANDLE_CODE(drx_retx_timer_short_tti_r15.unpack(bref));
  }
  if (drx_ul_retx_timer_short_tti_r15_present) {
    HANDLE_CODE(drx_ul_retx_timer_short_tti_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void drx_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (drx_retx_timer_short_tti_r15_present) {
    j.write_str("drx-RetransmissionTimerShortTTI-r15", drx_retx_timer_short_tti_r15.to_string());
  }
  if (drx_ul_retx_timer_short_tti_r15_present) {
    j.write_str("drx-UL-RetransmissionTimerShortTTI-r15", drx_ul_retx_timer_short_tti_r15.to_string());
  }
  j.end_obj();
}

// DRX-Config-v1130 ::= SEQUENCE
SRSASN_CODE drx_cfg_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(drx_retx_timer_v1130_present, 1));
  HANDLE_CODE(bref.pack(long_drx_cycle_start_offset_v1130_present, 1));
  HANDLE_CODE(bref.pack(short_drx_cycle_v1130_present, 1));

  if (long_drx_cycle_start_offset_v1130_present) {
    HANDLE_CODE(long_drx_cycle_start_offset_v1130.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE drx_cfg_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(drx_retx_timer_v1130_present, 1));
  HANDLE_CODE(bref.unpack(long_drx_cycle_start_offset_v1130_present, 1));
  HANDLE_CODE(bref.unpack(short_drx_cycle_v1130_present, 1));

  if (long_drx_cycle_start_offset_v1130_present) {
    HANDLE_CODE(long_drx_cycle_start_offset_v1130.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void drx_cfg_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (drx_retx_timer_v1130_present) {
    j.write_str("drx-RetransmissionTimer-v1130", "psf0-v1130");
  }
  if (long_drx_cycle_start_offset_v1130_present) {
    j.write_fieldname("longDRX-CycleStartOffset-v1130");
    long_drx_cycle_start_offset_v1130.to_json(j);
  }
  if (short_drx_cycle_v1130_present) {
    j.write_str("shortDRX-Cycle-v1130", "sf4-v1130");
  }
  j.end_obj();
}

void drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_::destroy_() {}
void drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_::long_drx_cycle_start_offset_v1130_c_(
    const drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf60_v1130:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf70_v1130:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_");
  }
}
drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_& drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_::
                                                       operator=(const drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf60_v1130:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf70_v1130:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_");
  }

  return *this;
}
void drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf60_v1130:
      j.write_int("sf60-v1130", c.get<uint8_t>());
      break;
    case types::sf70_v1130:
      j.write_int("sf70-v1130", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_");
  }
  j.end_obj();
}
SRSASN_CODE drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf60_v1130:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)59u));
      break;
    case types::sf70_v1130:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)69u));
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf60_v1130:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)59u));
      break;
    case types::sf70_v1130:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)69u));
      break;
    default:
      log_invalid_choice_id(type_, "drx_cfg_v1130_s::long_drx_cycle_start_offset_v1130_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DRX-Config-v1310 ::= SEQUENCE
SRSASN_CODE drx_cfg_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(long_drx_cycle_start_offset_v1310_present, 1));

  if (long_drx_cycle_start_offset_v1310_present) {
    HANDLE_CODE(pack_integer(bref, long_drx_cycle_start_offset_v1310.sf60_v1310, (uint8_t)0u, (uint8_t)59u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE drx_cfg_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(long_drx_cycle_start_offset_v1310_present, 1));

  if (long_drx_cycle_start_offset_v1310_present) {
    HANDLE_CODE(unpack_integer(long_drx_cycle_start_offset_v1310.sf60_v1310, bref, (uint8_t)0u, (uint8_t)59u));
  }

  return SRSASN_SUCCESS;
}
void drx_cfg_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (long_drx_cycle_start_offset_v1310_present) {
    j.write_fieldname("longDRX-CycleStartOffset-v1310");
    j.start_obj();
    j.write_int("sf60-v1310", long_drx_cycle_start_offset_v1310.sf60_v1310);
    j.end_obj();
  }
  j.end_obj();
}

// EPDCCH-Config-r11 ::= SEQUENCE
SRSASN_CODE epdcch_cfg_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cfg_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE epdcch_cfg_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(cfg_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void epdcch_cfg_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("config-r11");
  cfg_r11.to_json(j);
  j.end_obj();
}

void epdcch_cfg_r11_s::cfg_r11_c_::set(types::options e)
{
  type_ = e;
}
void epdcch_cfg_r11_s::cfg_r11_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.sf_pattern_cfg_r11_present) {
        j.write_fieldname("subframePatternConfig-r11");
        c.sf_pattern_cfg_r11.to_json(j);
      }
      if (c.start_symbol_r11_present) {
        j.write_int("startSymbol-r11", c.start_symbol_r11);
      }
      if (c.set_cfg_to_release_list_r11_present) {
        j.start_array("setConfigToReleaseList-r11");
        for (const auto& e1 : c.set_cfg_to_release_list_r11) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.set_cfg_to_add_mod_list_r11_present) {
        j.start_array("setConfigToAddModList-r11");
        for (const auto& e1 : c.set_cfg_to_add_mod_list_r11) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_cfg_r11_s::cfg_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE epdcch_cfg_r11_s::cfg_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.sf_pattern_cfg_r11_present, 1));
      HANDLE_CODE(bref.pack(c.start_symbol_r11_present, 1));
      HANDLE_CODE(bref.pack(c.set_cfg_to_release_list_r11_present, 1));
      HANDLE_CODE(bref.pack(c.set_cfg_to_add_mod_list_r11_present, 1));
      if (c.sf_pattern_cfg_r11_present) {
        HANDLE_CODE(c.sf_pattern_cfg_r11.pack(bref));
      }
      if (c.start_symbol_r11_present) {
        HANDLE_CODE(pack_integer(bref, c.start_symbol_r11, (uint8_t)1u, (uint8_t)4u));
      }
      if (c.set_cfg_to_release_list_r11_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.set_cfg_to_release_list_r11, 1, 2, integer_packer<uint8_t>(0, 1)));
      }
      if (c.set_cfg_to_add_mod_list_r11_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.set_cfg_to_add_mod_list_r11, 1, 2));
      }
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_cfg_r11_s::cfg_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE epdcch_cfg_r11_s::cfg_r11_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.sf_pattern_cfg_r11_present, 1));
      HANDLE_CODE(bref.unpack(c.start_symbol_r11_present, 1));
      HANDLE_CODE(bref.unpack(c.set_cfg_to_release_list_r11_present, 1));
      HANDLE_CODE(bref.unpack(c.set_cfg_to_add_mod_list_r11_present, 1));
      if (c.sf_pattern_cfg_r11_present) {
        HANDLE_CODE(c.sf_pattern_cfg_r11.unpack(bref));
      }
      if (c.start_symbol_r11_present) {
        HANDLE_CODE(unpack_integer(c.start_symbol_r11, bref, (uint8_t)1u, (uint8_t)4u));
      }
      if (c.set_cfg_to_release_list_r11_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.set_cfg_to_release_list_r11, bref, 1, 2, integer_packer<uint8_t>(0, 1)));
      }
      if (c.set_cfg_to_add_mod_list_r11_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.set_cfg_to_add_mod_list_r11, bref, 1, 2));
      }
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_cfg_r11_s::cfg_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void epdcch_cfg_r11_s::cfg_r11_c_::setup_s_::sf_pattern_cfg_r11_c_::set(types::options e)
{
  type_ = e;
}
void epdcch_cfg_r11_s::cfg_r11_c_::setup_s_::sf_pattern_cfg_r11_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("subframePattern-r11");
      c.sf_pattern_r11.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_cfg_r11_s::cfg_r11_c_::setup_s_::sf_pattern_cfg_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE epdcch_cfg_r11_s::cfg_r11_c_::setup_s_::sf_pattern_cfg_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.sf_pattern_r11.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_cfg_r11_s::cfg_r11_c_::setup_s_::sf_pattern_cfg_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE epdcch_cfg_r11_s::cfg_r11_c_::setup_s_::sf_pattern_cfg_r11_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.sf_pattern_r11.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "epdcch_cfg_r11_s::cfg_r11_c_::setup_s_::sf_pattern_cfg_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// FreqPriorityEUTRA ::= SEQUENCE
SRSASN_CODE freq_prio_eutra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, carrier_freq, (uint32_t)0u, (uint32_t)65535u));
  HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_prio_eutra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u));
  HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void freq_prio_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq", carrier_freq);
  j.write_int("cellReselectionPriority", cell_resel_prio);
  j.end_obj();
}

// FreqPriorityEUTRA-r12 ::= SEQUENCE
SRSASN_CODE freq_prio_eutra_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(pack_integer(bref, cell_resel_prio_r12, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_prio_eutra_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(unpack_integer(cell_resel_prio_r12, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void freq_prio_eutra_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r12", carrier_freq_r12);
  j.write_int("cellReselectionPriority-r12", cell_resel_prio_r12);
  j.end_obj();
}

// FreqPriorityEUTRA-v1310 ::= SEQUENCE
SRSASN_CODE freq_prio_eutra_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cell_resel_sub_prio_r13_present, 1));

  if (cell_resel_sub_prio_r13_present) {
    HANDLE_CODE(cell_resel_sub_prio_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_prio_eutra_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cell_resel_sub_prio_r13_present, 1));

  if (cell_resel_sub_prio_r13_present) {
    HANDLE_CODE(cell_resel_sub_prio_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void freq_prio_eutra_v1310_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());
  }
  j.end_obj();
}

// FreqPriorityNR-r15 ::= SEQUENCE
SRSASN_CODE freq_prio_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cell_resel_sub_prio_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)3279165u));
  HANDLE_CODE(pack_integer(bref, cell_resel_prio_r15, (uint8_t)0u, (uint8_t)7u));
  if (cell_resel_sub_prio_r15_present) {
    HANDLE_CODE(cell_resel_sub_prio_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_prio_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cell_resel_sub_prio_r15_present, 1));

  HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)3279165u));
  HANDLE_CODE(unpack_integer(cell_resel_prio_r15, bref, (uint8_t)0u, (uint8_t)7u));
  if (cell_resel_sub_prio_r15_present) {
    HANDLE_CODE(cell_resel_sub_prio_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void freq_prio_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r15", carrier_freq_r15);
  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.end_obj();
}

// FreqPriorityUTRA-FDD ::= SEQUENCE
SRSASN_CODE freq_prio_utra_fdd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, carrier_freq, (uint16_t)0u, (uint16_t)16383u));
  HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_prio_utra_fdd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint16_t)0u, (uint16_t)16383u));
  HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void freq_prio_utra_fdd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq", carrier_freq);
  j.write_int("cellReselectionPriority", cell_resel_prio);
  j.end_obj();
}

// FreqPriorityUTRA-TDD ::= SEQUENCE
SRSASN_CODE freq_prio_utra_tdd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, carrier_freq, (uint16_t)0u, (uint16_t)16383u));
  HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_prio_utra_tdd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint16_t)0u, (uint16_t)16383u));
  HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void freq_prio_utra_tdd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq", carrier_freq);
  j.write_int("cellReselectionPriority", cell_resel_prio);
  j.end_obj();
}

// FreqsPriorityGERAN ::= SEQUENCE
SRSASN_CODE freqs_prio_geran_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(carrier_freqs.pack(bref));
  HANDLE_CODE(pack_integer(bref, cell_resel_prio, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE freqs_prio_geran_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(carrier_freqs.unpack(bref));
  HANDLE_CODE(unpack_integer(cell_resel_prio, bref, (uint8_t)0u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void freqs_prio_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("carrierFreqs");
  carrier_freqs.to_json(j);
  j.write_int("cellReselectionPriority", cell_resel_prio);
  j.end_obj();
}

// PDCCH-CandidateReductions-r13 ::= CHOICE
void pdcch_candidate_reductions_r13_c::set(types::options e)
{
  type_ = e;
}
void pdcch_candidate_reductions_r13_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("pdcch-candidateReductionAL1-r13", c.pdcch_candidate_reduction_al1_r13.to_string());
      j.write_str("pdcch-candidateReductionAL2-r13", c.pdcch_candidate_reduction_al2_r13.to_string());
      j.write_str("pdcch-candidateReductionAL3-r13", c.pdcch_candidate_reduction_al3_r13.to_string());
      j.write_str("pdcch-candidateReductionAL4-r13", c.pdcch_candidate_reduction_al4_r13.to_string());
      j.write_str("pdcch-candidateReductionAL5-r13", c.pdcch_candidate_reduction_al5_r13.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdcch_candidate_reductions_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE pdcch_candidate_reductions_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pdcch_candidate_reduction_al1_r13.pack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al2_r13.pack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al3_r13.pack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al4_r13.pack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al5_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pdcch_candidate_reductions_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcch_candidate_reductions_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pdcch_candidate_reduction_al1_r13.unpack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al2_r13.unpack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al3_r13.unpack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al4_r13.unpack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al5_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pdcch_candidate_reductions_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PDSCH-ConfigDedicated ::= SEQUENCE
SRSASN_CODE pdsch_cfg_ded_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(p_a.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_ded_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(p_a.unpack(bref));

  return SRSASN_SUCCESS;
}
void pdsch_cfg_ded_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("p-a", p_a.to_string());
  j.end_obj();
}

// PDSCH-ConfigDedicated-v1130 ::= SEQUENCE
SRSASN_CODE pdsch_cfg_ded_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dmrs_cfg_pdsch_r11_present, 1));
  HANDLE_CODE(bref.pack(qcl_operation_present, 1));
  HANDLE_CODE(bref.pack(re_map_qcl_cfg_to_release_list_r11_present, 1));
  HANDLE_CODE(bref.pack(re_map_qcl_cfg_to_add_mod_list_r11_present, 1));

  if (dmrs_cfg_pdsch_r11_present) {
    HANDLE_CODE(dmrs_cfg_pdsch_r11.pack(bref));
  }
  if (qcl_operation_present) {
    HANDLE_CODE(qcl_operation.pack(bref));
  }
  if (re_map_qcl_cfg_to_release_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, re_map_qcl_cfg_to_release_list_r11, 1, 4, integer_packer<uint8_t>(1, 4)));
  }
  if (re_map_qcl_cfg_to_add_mod_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, re_map_qcl_cfg_to_add_mod_list_r11, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_ded_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dmrs_cfg_pdsch_r11_present, 1));
  HANDLE_CODE(bref.unpack(qcl_operation_present, 1));
  HANDLE_CODE(bref.unpack(re_map_qcl_cfg_to_release_list_r11_present, 1));
  HANDLE_CODE(bref.unpack(re_map_qcl_cfg_to_add_mod_list_r11_present, 1));

  if (dmrs_cfg_pdsch_r11_present) {
    HANDLE_CODE(dmrs_cfg_pdsch_r11.unpack(bref));
  }
  if (qcl_operation_present) {
    HANDLE_CODE(qcl_operation.unpack(bref));
  }
  if (re_map_qcl_cfg_to_release_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(re_map_qcl_cfg_to_release_list_r11, bref, 1, 4, integer_packer<uint8_t>(1, 4)));
  }
  if (re_map_qcl_cfg_to_add_mod_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(re_map_qcl_cfg_to_add_mod_list_r11, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void pdsch_cfg_ded_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dmrs_cfg_pdsch_r11_present) {
    j.write_fieldname("dmrs-ConfigPDSCH-r11");
    dmrs_cfg_pdsch_r11.to_json(j);
  }
  if (qcl_operation_present) {
    j.write_str("qcl-Operation", qcl_operation.to_string());
  }
  if (re_map_qcl_cfg_to_release_list_r11_present) {
    j.start_array("re-MappingQCLConfigToReleaseList-r11");
    for (const auto& e1 : re_map_qcl_cfg_to_release_list_r11) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (re_map_qcl_cfg_to_add_mod_list_r11_present) {
    j.start_array("re-MappingQCLConfigToAddModList-r11");
    for (const auto& e1 : re_map_qcl_cfg_to_add_mod_list_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// PDSCH-ConfigDedicated-v1280 ::= SEQUENCE
SRSASN_CODE pdsch_cfg_ded_v1280_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tbs_idx_alt_r12_present, 1));

  if (tbs_idx_alt_r12_present) {
    HANDLE_CODE(tbs_idx_alt_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_ded_v1280_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tbs_idx_alt_r12_present, 1));

  if (tbs_idx_alt_r12_present) {
    HANDLE_CODE(tbs_idx_alt_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdsch_cfg_ded_v1280_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tbs_idx_alt_r12_present) {
    j.write_str("tbsIndexAlt-r12", tbs_idx_alt_r12.to_string());
  }
  j.end_obj();
}

// PDSCH-ConfigDedicated-v1310 ::= SEQUENCE
SRSASN_CODE pdsch_cfg_ded_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dmrs_cfg_pdsch_v1310_present, 1));

  if (dmrs_cfg_pdsch_v1310_present) {
    HANDLE_CODE(dmrs_cfg_pdsch_v1310.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_ded_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dmrs_cfg_pdsch_v1310_present, 1));

  if (dmrs_cfg_pdsch_v1310_present) {
    HANDLE_CODE(dmrs_cfg_pdsch_v1310.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdsch_cfg_ded_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dmrs_cfg_pdsch_v1310_present) {
    j.write_fieldname("dmrs-ConfigPDSCH-v1310");
    dmrs_cfg_pdsch_v1310.to_json(j);
  }
  j.end_obj();
}

// PDSCH-ConfigDedicated-v1430 ::= SEQUENCE
SRSASN_CODE pdsch_cfg_ded_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_pdsch_max_bw_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_pdsch_ten_processes_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_harq_ack_bundling_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_sched_enhancement_r14_present, 1));
  HANDLE_CODE(bref.pack(tbs_idx_alt2_r14_present, 1));

  if (ce_pdsch_max_bw_r14_present) {
    HANDLE_CODE(ce_pdsch_max_bw_r14.pack(bref));
  }
  if (ce_sched_enhancement_r14_present) {
    HANDLE_CODE(ce_sched_enhancement_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_ded_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_pdsch_max_bw_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_pdsch_ten_processes_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_harq_ack_bundling_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_sched_enhancement_r14_present, 1));
  HANDLE_CODE(bref.unpack(tbs_idx_alt2_r14_present, 1));

  if (ce_pdsch_max_bw_r14_present) {
    HANDLE_CODE(ce_pdsch_max_bw_r14.unpack(bref));
  }
  if (ce_sched_enhancement_r14_present) {
    HANDLE_CODE(ce_sched_enhancement_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdsch_cfg_ded_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_pdsch_max_bw_r14_present) {
    j.write_str("ce-PDSCH-MaxBandwidth-r14", ce_pdsch_max_bw_r14.to_string());
  }
  if (ce_pdsch_ten_processes_r14_present) {
    j.write_str("ce-PDSCH-TenProcesses-r14", "on");
  }
  if (ce_harq_ack_bundling_r14_present) {
    j.write_str("ce-HARQ-AckBundling-r14", "on");
  }
  if (ce_sched_enhancement_r14_present) {
    j.write_str("ce-SchedulingEnhancement-r14", ce_sched_enhancement_r14.to_string());
  }
  if (tbs_idx_alt2_r14_present) {
    j.write_str("tbsIndexAlt2-r14", "b33");
  }
  j.end_obj();
}

// PDSCH-ConfigDedicated-v1530 ::= SEQUENCE
SRSASN_CODE pdsch_cfg_ded_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(qcl_operation_v1530_present, 1));
  HANDLE_CODE(bref.pack(tbs_idx_alt3_r15_present, 1));
  HANDLE_CODE(bref.pack(ce_cqi_alt_table_cfg_r15_present, 1));
  HANDLE_CODE(bref.pack(ce_pdsch_minus64_qam_cfg_r15_present, 1));
  HANDLE_CODE(bref.pack(ce_pdsch_flex_start_prb_alloc_cfg_r15_present, 1));
  HANDLE_CODE(bref.pack(alt_mcs_table_scaling_cfg_r15_present, 1));

  if (alt_mcs_table_scaling_cfg_r15_present) {
    HANDLE_CODE(alt_mcs_table_scaling_cfg_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_ded_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(qcl_operation_v1530_present, 1));
  HANDLE_CODE(bref.unpack(tbs_idx_alt3_r15_present, 1));
  HANDLE_CODE(bref.unpack(ce_cqi_alt_table_cfg_r15_present, 1));
  HANDLE_CODE(bref.unpack(ce_pdsch_minus64_qam_cfg_r15_present, 1));
  HANDLE_CODE(bref.unpack(ce_pdsch_flex_start_prb_alloc_cfg_r15_present, 1));
  HANDLE_CODE(bref.unpack(alt_mcs_table_scaling_cfg_r15_present, 1));

  if (alt_mcs_table_scaling_cfg_r15_present) {
    HANDLE_CODE(alt_mcs_table_scaling_cfg_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdsch_cfg_ded_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (qcl_operation_v1530_present) {
    j.write_str("qcl-Operation-v1530", "typeC");
  }
  if (tbs_idx_alt3_r15_present) {
    j.write_str("tbs-IndexAlt3-r15", "a37");
  }
  if (ce_cqi_alt_table_cfg_r15_present) {
    j.write_str("ce-CQI-AlternativeTableConfig-r15", "on");
  }
  if (ce_pdsch_minus64_qam_cfg_r15_present) {
    j.write_str("ce-PDSCH-64QAM-Config-r15", "on");
  }
  if (ce_pdsch_flex_start_prb_alloc_cfg_r15_present) {
    j.write_str("ce-PDSCH-FlexibleStartPRB-AllocConfig-r15", "on");
  }
  if (alt_mcs_table_scaling_cfg_r15_present) {
    j.write_str("altMCS-TableScalingConfig-r15", alt_mcs_table_scaling_cfg_r15.to_string());
  }
  j.end_obj();
}

// PUCCH-ConfigDedicated ::= SEQUENCE
SRSASN_CODE pucch_cfg_ded_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tdd_ack_nack_feedback_mode_present, 1));

  HANDLE_CODE(ack_nack_repeat.pack(bref));
  if (tdd_ack_nack_feedback_mode_present) {
    HANDLE_CODE(tdd_ack_nack_feedback_mode.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tdd_ack_nack_feedback_mode_present, 1));

  HANDLE_CODE(ack_nack_repeat.unpack(bref));
  if (tdd_ack_nack_feedback_mode_present) {
    HANDLE_CODE(tdd_ack_nack_feedback_mode.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pucch_cfg_ded_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ackNackRepetition");
  ack_nack_repeat.to_json(j);
  if (tdd_ack_nack_feedback_mode_present) {
    j.write_str("tdd-AckNackFeedbackMode", tdd_ack_nack_feedback_mode.to_string());
  }
  j.end_obj();
}

void pucch_cfg_ded_s::ack_nack_repeat_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_s::ack_nack_repeat_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("repetitionFactor", c.repeat_factor.to_string());
      j.write_int("n1PUCCH-AN-Rep", c.n1_pucch_an_rep);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_s::ack_nack_repeat_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_s::ack_nack_repeat_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.repeat_factor.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.n1_pucch_an_rep, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_s::ack_nack_repeat_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_s::ack_nack_repeat_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.repeat_factor.unpack(bref));
      HANDLE_CODE(unpack_integer(c.n1_pucch_an_rep, bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_s::ack_nack_repeat_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUCCH-ConfigDedicated-r13 ::= SEQUENCE
SRSASN_CODE pucch_cfg_ded_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tdd_ack_nack_feedback_mode_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_format_r13_present, 1));
  HANDLE_CODE(bref.pack(two_ant_port_activ_pucch_format1a1b_r13_present, 1));
  HANDLE_CODE(bref.pack(simul_pucch_pusch_r13_present, 1));
  HANDLE_CODE(bref.pack(n1_pucch_an_rep_p1_r13_present, 1));
  HANDLE_CODE(bref.pack(npucch_param_r13_present, 1));
  HANDLE_CODE(bref.pack(nka_pucch_param_r13_present, 1));
  HANDLE_CODE(bref.pack(codebooksize_determination_r13_present, 1));
  HANDLE_CODE(bref.pack(maximum_payload_coderate_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_num_repeat_ce_r13_present, 1));

  HANDLE_CODE(ack_nack_repeat_r13.pack(bref));
  if (tdd_ack_nack_feedback_mode_r13_present) {
    HANDLE_CODE(tdd_ack_nack_feedback_mode_r13.pack(bref));
  }
  if (pucch_format_r13_present) {
    HANDLE_CODE(pucch_format_r13.pack(bref));
  }
  if (n1_pucch_an_rep_p1_r13_present) {
    HANDLE_CODE(pack_integer(bref, n1_pucch_an_rep_p1_r13, (uint16_t)0u, (uint16_t)2047u));
  }
  if (npucch_param_r13_present) {
    HANDLE_CODE(npucch_param_r13.pack(bref));
  }
  if (nka_pucch_param_r13_present) {
    HANDLE_CODE(nka_pucch_param_r13.pack(bref));
  }
  HANDLE_CODE(bref.pack(spatial_bundling_pucch_r13, 1));
  HANDLE_CODE(bref.pack(spatial_bundling_pusch_r13, 1));
  HANDLE_CODE(bref.pack(harq_timing_tdd_r13, 1));
  if (codebooksize_determination_r13_present) {
    HANDLE_CODE(codebooksize_determination_r13.pack(bref));
  }
  if (maximum_payload_coderate_r13_present) {
    HANDLE_CODE(pack_integer(bref, maximum_payload_coderate_r13, (uint8_t)0u, (uint8_t)7u));
  }
  if (pucch_num_repeat_ce_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tdd_ack_nack_feedback_mode_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_format_r13_present, 1));
  HANDLE_CODE(bref.unpack(two_ant_port_activ_pucch_format1a1b_r13_present, 1));
  HANDLE_CODE(bref.unpack(simul_pucch_pusch_r13_present, 1));
  HANDLE_CODE(bref.unpack(n1_pucch_an_rep_p1_r13_present, 1));
  HANDLE_CODE(bref.unpack(npucch_param_r13_present, 1));
  HANDLE_CODE(bref.unpack(nka_pucch_param_r13_present, 1));
  HANDLE_CODE(bref.unpack(codebooksize_determination_r13_present, 1));
  HANDLE_CODE(bref.unpack(maximum_payload_coderate_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_num_repeat_ce_r13_present, 1));

  HANDLE_CODE(ack_nack_repeat_r13.unpack(bref));
  if (tdd_ack_nack_feedback_mode_r13_present) {
    HANDLE_CODE(tdd_ack_nack_feedback_mode_r13.unpack(bref));
  }
  if (pucch_format_r13_present) {
    HANDLE_CODE(pucch_format_r13.unpack(bref));
  }
  if (n1_pucch_an_rep_p1_r13_present) {
    HANDLE_CODE(unpack_integer(n1_pucch_an_rep_p1_r13, bref, (uint16_t)0u, (uint16_t)2047u));
  }
  if (npucch_param_r13_present) {
    HANDLE_CODE(npucch_param_r13.unpack(bref));
  }
  if (nka_pucch_param_r13_present) {
    HANDLE_CODE(nka_pucch_param_r13.unpack(bref));
  }
  HANDLE_CODE(bref.unpack(spatial_bundling_pucch_r13, 1));
  HANDLE_CODE(bref.unpack(spatial_bundling_pusch_r13, 1));
  HANDLE_CODE(bref.unpack(harq_timing_tdd_r13, 1));
  if (codebooksize_determination_r13_present) {
    HANDLE_CODE(codebooksize_determination_r13.unpack(bref));
  }
  if (maximum_payload_coderate_r13_present) {
    HANDLE_CODE(unpack_integer(maximum_payload_coderate_r13, bref, (uint8_t)0u, (uint8_t)7u));
  }
  if (pucch_num_repeat_ce_r13_present) {
    HANDLE_CODE(pucch_num_repeat_ce_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pucch_cfg_ded_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ackNackRepetition-r13");
  ack_nack_repeat_r13.to_json(j);
  if (tdd_ack_nack_feedback_mode_r13_present) {
    j.write_str("tdd-AckNackFeedbackMode-r13", tdd_ack_nack_feedback_mode_r13.to_string());
  }
  if (pucch_format_r13_present) {
    j.write_fieldname("pucch-Format-r13");
    pucch_format_r13.to_json(j);
  }
  if (two_ant_port_activ_pucch_format1a1b_r13_present) {
    j.write_str("twoAntennaPortActivatedPUCCH-Format1a1b-r13", "true");
  }
  if (simul_pucch_pusch_r13_present) {
    j.write_str("simultaneousPUCCH-PUSCH-r13", "true");
  }
  if (n1_pucch_an_rep_p1_r13_present) {
    j.write_int("n1PUCCH-AN-RepP1-r13", n1_pucch_an_rep_p1_r13);
  }
  if (npucch_param_r13_present) {
    j.write_fieldname("nPUCCH-Param-r13");
    npucch_param_r13.to_json(j);
  }
  if (nka_pucch_param_r13_present) {
    j.write_fieldname("nkaPUCCH-Param-r13");
    nka_pucch_param_r13.to_json(j);
  }
  j.write_bool("spatialBundlingPUCCH-r13", spatial_bundling_pucch_r13);
  j.write_bool("spatialBundlingPUSCH-r13", spatial_bundling_pusch_r13);
  j.write_bool("harq-TimingTDD-r13", harq_timing_tdd_r13);
  if (codebooksize_determination_r13_present) {
    j.write_str("codebooksizeDetermination-r13", codebooksize_determination_r13.to_string());
  }
  if (maximum_payload_coderate_r13_present) {
    j.write_int("maximumPayloadCoderate-r13", maximum_payload_coderate_r13);
  }
  if (pucch_num_repeat_ce_r13_present) {
    j.write_fieldname("pucch-NumRepetitionCE-r13");
    pucch_num_repeat_ce_r13.to_json(j);
  }
  j.end_obj();
}

void pucch_cfg_ded_r13_s::ack_nack_repeat_r13_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_r13_s::ack_nack_repeat_r13_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("repetitionFactor-r13", c.repeat_factor_r13.to_string());
      j.write_int("n1PUCCH-AN-Rep-r13", c.n1_pucch_an_rep_r13);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::ack_nack_repeat_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_r13_s::ack_nack_repeat_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.repeat_factor_r13.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.n1_pucch_an_rep_r13, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::ack_nack_repeat_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::ack_nack_repeat_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.repeat_factor_r13.unpack(bref));
      HANDLE_CODE(unpack_integer(c.n1_pucch_an_rep_r13, bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::ack_nack_repeat_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_r13_s::pucch_format_r13_c_::destroy_()
{
  switch (type_) {
    case types::format3_r13:
      c.destroy<format3_r13_s_>();
      break;
    case types::ch_sel_r13:
      c.destroy<ch_sel_r13_s_>();
      break;
    case types::format4_r13:
      c.destroy<format4_r13_s_>();
      break;
    case types::format5_r13:
      c.destroy<format5_r13_s_>();
      break;
    default:
      break;
  }
}
void pucch_cfg_ded_r13_s::pucch_format_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::format3_r13:
      c.init<format3_r13_s_>();
      break;
    case types::ch_sel_r13:
      c.init<ch_sel_r13_s_>();
      break;
    case types::format4_r13:
      c.init<format4_r13_s_>();
      break;
    case types::format5_r13:
      c.init<format5_r13_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_");
  }
}
pucch_cfg_ded_r13_s::pucch_format_r13_c_::pucch_format_r13_c_(const pucch_cfg_ded_r13_s::pucch_format_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::format3_r13:
      c.init(other.c.get<format3_r13_s_>());
      break;
    case types::ch_sel_r13:
      c.init(other.c.get<ch_sel_r13_s_>());
      break;
    case types::format4_r13:
      c.init(other.c.get<format4_r13_s_>());
      break;
    case types::format5_r13:
      c.init(other.c.get<format5_r13_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_");
  }
}
pucch_cfg_ded_r13_s::pucch_format_r13_c_& pucch_cfg_ded_r13_s::pucch_format_r13_c_::
                                          operator=(const pucch_cfg_ded_r13_s::pucch_format_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::format3_r13:
      c.set(other.c.get<format3_r13_s_>());
      break;
    case types::ch_sel_r13:
      c.set(other.c.get<ch_sel_r13_s_>());
      break;
    case types::format4_r13:
      c.set(other.c.get<format4_r13_s_>());
      break;
    case types::format5_r13:
      c.set(other.c.get<format5_r13_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_");
  }

  return *this;
}
void pucch_cfg_ded_r13_s::pucch_format_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::format3_r13:
      j.write_fieldname("format3-r13");
      j.start_obj();
      if (c.get<format3_r13_s_>().n3_pucch_an_list_r13_present) {
        j.start_array("n3PUCCH-AN-List-r13");
        for (const auto& e1 : c.get<format3_r13_s_>().n3_pucch_an_list_r13) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.get<format3_r13_s_>().two_ant_port_activ_pucch_format3_r13_present) {
        j.write_fieldname("twoAntennaPortActivatedPUCCH-Format3-r13");
        c.get<format3_r13_s_>().two_ant_port_activ_pucch_format3_r13.to_json(j);
      }
      j.end_obj();
      break;
    case types::ch_sel_r13:
      j.write_fieldname("channelSelection-r13");
      j.start_obj();
      if (c.get<ch_sel_r13_s_>().n1_pucch_an_cs_r13_present) {
        j.write_fieldname("n1PUCCH-AN-CS-r13");
        c.get<ch_sel_r13_s_>().n1_pucch_an_cs_r13.to_json(j);
      }
      j.end_obj();
      break;
    case types::format4_r13:
      j.write_fieldname("format4-r13");
      j.start_obj();
      j.start_array("format4-resourceConfiguration-r13");
      for (const auto& e1 : c.get<format4_r13_s_>().format4_res_cfg_r13) {
        e1.to_json(j);
      }
      j.end_array();
      if (c.get<format4_r13_s_>().format4_multi_csi_res_cfg_r13_present) {
        j.start_array("format4-MultiCSI-resourceConfiguration-r13");
        for (const auto& e1 : c.get<format4_r13_s_>().format4_multi_csi_res_cfg_r13) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    case types::format5_r13:
      j.write_fieldname("format5-r13");
      j.start_obj();
      j.start_array("format5-resourceConfiguration-r13");
      for (const auto& e1 : c.get<format5_r13_s_>().format5_res_cfg_r13) {
        e1.to_json(j);
      }
      j.end_array();
      if (c.get<format5_r13_s_>().format5_multi_csi_res_cfg_r13_present) {
        j.write_fieldname("format5-MultiCSI-resourceConfiguration-r13");
        c.get<format5_r13_s_>().format5_multi_csi_res_cfg_r13.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_format_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::format3_r13:
      HANDLE_CODE(bref.pack(c.get<format3_r13_s_>().n3_pucch_an_list_r13_present, 1));
      HANDLE_CODE(bref.pack(c.get<format3_r13_s_>().two_ant_port_activ_pucch_format3_r13_present, 1));
      if (c.get<format3_r13_s_>().n3_pucch_an_list_r13_present) {
        HANDLE_CODE(pack_dyn_seq_of(
            bref, c.get<format3_r13_s_>().n3_pucch_an_list_r13, 1, 4, integer_packer<uint16_t>(0, 549)));
      }
      if (c.get<format3_r13_s_>().two_ant_port_activ_pucch_format3_r13_present) {
        HANDLE_CODE(c.get<format3_r13_s_>().two_ant_port_activ_pucch_format3_r13.pack(bref));
      }
      break;
    case types::ch_sel_r13:
      HANDLE_CODE(bref.pack(c.get<ch_sel_r13_s_>().n1_pucch_an_cs_r13_present, 1));
      if (c.get<ch_sel_r13_s_>().n1_pucch_an_cs_r13_present) {
        HANDLE_CODE(c.get<ch_sel_r13_s_>().n1_pucch_an_cs_r13.pack(bref));
      }
      break;
    case types::format4_r13:
      HANDLE_CODE(bref.pack(c.get<format4_r13_s_>().format4_multi_csi_res_cfg_r13_present, 1));
      HANDLE_CODE(pack_fixed_seq_of(
          bref, &(c.get<format4_r13_s_>().format4_res_cfg_r13)[0], c.get<format4_r13_s_>().format4_res_cfg_r13.size()));
      if (c.get<format4_r13_s_>().format4_multi_csi_res_cfg_r13_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.get<format4_r13_s_>().format4_multi_csi_res_cfg_r13, 1, 2));
      }
      break;
    case types::format5_r13:
      HANDLE_CODE(bref.pack(c.get<format5_r13_s_>().format5_multi_csi_res_cfg_r13_present, 1));
      HANDLE_CODE(pack_fixed_seq_of(
          bref, &(c.get<format5_r13_s_>().format5_res_cfg_r13)[0], c.get<format5_r13_s_>().format5_res_cfg_r13.size()));
      if (c.get<format5_r13_s_>().format5_multi_csi_res_cfg_r13_present) {
        HANDLE_CODE(c.get<format5_r13_s_>().format5_multi_csi_res_cfg_r13.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_format_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::format3_r13:
      HANDLE_CODE(bref.unpack(c.get<format3_r13_s_>().n3_pucch_an_list_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.get<format3_r13_s_>().two_ant_port_activ_pucch_format3_r13_present, 1));
      if (c.get<format3_r13_s_>().n3_pucch_an_list_r13_present) {
        HANDLE_CODE(unpack_dyn_seq_of(
            c.get<format3_r13_s_>().n3_pucch_an_list_r13, bref, 1, 4, integer_packer<uint16_t>(0, 549)));
      }
      if (c.get<format3_r13_s_>().two_ant_port_activ_pucch_format3_r13_present) {
        HANDLE_CODE(c.get<format3_r13_s_>().two_ant_port_activ_pucch_format3_r13.unpack(bref));
      }
      break;
    case types::ch_sel_r13:
      HANDLE_CODE(bref.unpack(c.get<ch_sel_r13_s_>().n1_pucch_an_cs_r13_present, 1));
      if (c.get<ch_sel_r13_s_>().n1_pucch_an_cs_r13_present) {
        HANDLE_CODE(c.get<ch_sel_r13_s_>().n1_pucch_an_cs_r13.unpack(bref));
      }
      break;
    case types::format4_r13:
      HANDLE_CODE(bref.unpack(c.get<format4_r13_s_>().format4_multi_csi_res_cfg_r13_present, 1));
      HANDLE_CODE(unpack_fixed_seq_of(
          &(c.get<format4_r13_s_>().format4_res_cfg_r13)[0], bref, c.get<format4_r13_s_>().format4_res_cfg_r13.size()));
      if (c.get<format4_r13_s_>().format4_multi_csi_res_cfg_r13_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.get<format4_r13_s_>().format4_multi_csi_res_cfg_r13, bref, 1, 2));
      }
      break;
    case types::format5_r13:
      HANDLE_CODE(bref.unpack(c.get<format5_r13_s_>().format5_multi_csi_res_cfg_r13_present, 1));
      HANDLE_CODE(unpack_fixed_seq_of(
          &(c.get<format5_r13_s_>().format5_res_cfg_r13)[0], bref, c.get<format5_r13_s_>().format5_res_cfg_r13.size()));
      if (c.get<format5_r13_s_>().format5_multi_csi_res_cfg_r13_present) {
        HANDLE_CODE(c.get<format5_r13_s_>().format5_multi_csi_res_cfg_r13.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_r13_s::pucch_format_r13_c_::format3_r13_s_::two_ant_port_activ_pucch_format3_r13_c_::set(
    types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_r13_s::pucch_format_r13_c_::format3_r13_s_::two_ant_port_activ_pucch_format3_r13_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("n3PUCCH-AN-ListP1-r13");
      for (const auto& e1 : c.n3_pucch_an_list_p1_r13) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(
          type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_::format3_r13_s_::two_ant_port_activ_pucch_format3_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_format_r13_c_::format3_r13_s_::two_ant_port_activ_pucch_format3_r13_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.n3_pucch_an_list_p1_r13, 1, 4, integer_packer<uint16_t>(0, 549)));
      break;
    default:
      log_invalid_choice_id(
          type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_::format3_r13_s_::two_ant_port_activ_pucch_format3_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_format_r13_c_::format3_r13_s_::two_ant_port_activ_pucch_format3_r13_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.n3_pucch_an_list_p1_r13, bref, 1, 4, integer_packer<uint16_t>(0, 549)));
      break;
    default:
      log_invalid_choice_id(
          type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_::format3_r13_s_::two_ant_port_activ_pucch_format3_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_r13_s::pucch_format_r13_c_::ch_sel_r13_s_::n1_pucch_an_cs_r13_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_r13_s::pucch_format_r13_c_::ch_sel_r13_s_::n1_pucch_an_cs_r13_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-List-r13");
      for (const auto& e1 : c.n1_pucch_an_cs_list_r13) {
        j.start_array();
        for (const auto& e2 : e1) {
          j.write_int(e2);
        }
        j.end_array();
      }
      j.end_array();
      j.start_array("n1PUCCH-AN-CS-ListP1-r13");
      for (const auto& e1 : c.n1_pucch_an_cs_list_p1_r13) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_::ch_sel_r13_s_::n1_pucch_an_cs_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_format_r13_c_::ch_sel_r13_s_::n1_pucch_an_cs_r13_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_r13,
                                  1,
                                  2,
                                  SeqOfPacker<integer_packer<uint16_t> >(1, 4, integer_packer<uint16_t>(0, 2047))));
      HANDLE_CODE(pack_dyn_seq_of(bref, c.n1_pucch_an_cs_list_p1_r13, 2, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_::ch_sel_r13_s_::n1_pucch_an_cs_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_format_r13_c_::ch_sel_r13_s_::n1_pucch_an_cs_r13_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_r13,
                                    bref,
                                    1,
                                    2,
                                    SeqOfPacker<integer_packer<uint16_t> >(1, 4, integer_packer<uint16_t>(0, 2047))));
      HANDLE_CODE(unpack_dyn_seq_of(c.n1_pucch_an_cs_list_p1_r13, bref, 2, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_format_r13_c_::ch_sel_r13_s_::n1_pucch_an_cs_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_r13_s::npucch_param_r13_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_r13_s::npucch_param_r13_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_int("nPUCCH-Identity-r13", c.npucch_id_r13);
      j.write_int("n1PUCCH-AN-r13", c.n1_pucch_an_r13);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::npucch_param_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_r13_s::npucch_param_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.npucch_id_r13, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(pack_integer(bref, c.n1_pucch_an_r13, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::npucch_param_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::npucch_param_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.npucch_id_r13, bref, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(unpack_integer(c.n1_pucch_an_r13, bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::npucch_param_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_r13_s::nka_pucch_param_r13_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_r13_s::nka_pucch_param_r13_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_int("nkaPUCCH-AN-r13", c.nka_pucch_an_r13);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::nka_pucch_param_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_r13_s::nka_pucch_param_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.nka_pucch_an_r13, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::nka_pucch_param_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::nka_pucch_param_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.nka_pucch_an_r13, bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::nka_pucch_param_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::mode_a:
      c.destroy<mode_a_s_>();
      break;
    case types::mode_b:
      c.destroy<mode_b_s_>();
      break;
    default:
      break;
  }
}
void pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::mode_a:
      c.init<mode_a_s_>();
      break;
    case types::mode_b:
      c.init<mode_b_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_");
  }
}
pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_::setup_c_(
    const pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::mode_a:
      c.init(other.c.get<mode_a_s_>());
      break;
    case types::mode_b:
      c.init(other.c.get<mode_b_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_");
  }
}
pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_& pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_::
                                                           operator=(const pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::mode_a:
      c.set(other.c.get<mode_a_s_>());
      break;
    case types::mode_b:
      c.set(other.c.get<mode_b_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_");
  }

  return *this;
}
void pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::mode_a:
      j.write_fieldname("modeA");
      j.start_obj();
      j.write_str("pucch-NumRepetitionCE-format1-r13", c.get<mode_a_s_>().pucch_num_repeat_ce_format1_r13.to_string());
      j.write_str("pucch-NumRepetitionCE-format2-r13", c.get<mode_a_s_>().pucch_num_repeat_ce_format2_r13.to_string());
      j.end_obj();
      break;
    case types::mode_b:
      j.write_fieldname("modeB");
      j.start_obj();
      j.write_str("pucch-NumRepetitionCE-format1-r13", c.get<mode_b_s_>().pucch_num_repeat_ce_format1_r13.to_string());
      j.write_str("pucch-NumRepetitionCE-format2-r13", c.get<mode_b_s_>().pucch_num_repeat_ce_format2_r13.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::mode_a:
      HANDLE_CODE(c.get<mode_a_s_>().pucch_num_repeat_ce_format1_r13.pack(bref));
      HANDLE_CODE(c.get<mode_a_s_>().pucch_num_repeat_ce_format2_r13.pack(bref));
      break;
    case types::mode_b:
      HANDLE_CODE(c.get<mode_b_s_>().pucch_num_repeat_ce_format1_r13.pack(bref));
      HANDLE_CODE(c.get<mode_b_s_>().pucch_num_repeat_ce_format2_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::mode_a:
      HANDLE_CODE(c.get<mode_a_s_>().pucch_num_repeat_ce_format1_r13.unpack(bref));
      HANDLE_CODE(c.get<mode_a_s_>().pucch_num_repeat_ce_format2_r13.unpack(bref));
      break;
    case types::mode_b:
      HANDLE_CODE(c.get<mode_b_s_>().pucch_num_repeat_ce_format1_r13.unpack(bref));
      HANDLE_CODE(c.get<mode_b_s_>().pucch_num_repeat_ce_format2_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_r13_s::pucch_num_repeat_ce_r13_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUCCH-ConfigDedicated-v1020 ::= SEQUENCE
SRSASN_CODE pucch_cfg_ded_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pucch_format_r10_present, 1));
  HANDLE_CODE(bref.pack(two_ant_port_activ_pucch_format1a1b_r10_present, 1));
  HANDLE_CODE(bref.pack(simul_pucch_pusch_r10_present, 1));
  HANDLE_CODE(bref.pack(n1_pucch_an_rep_p1_r10_present, 1));

  if (pucch_format_r10_present) {
    HANDLE_CODE(pucch_format_r10.pack(bref));
  }
  if (n1_pucch_an_rep_p1_r10_present) {
    HANDLE_CODE(pack_integer(bref, n1_pucch_an_rep_p1_r10, (uint16_t)0u, (uint16_t)2047u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pucch_format_r10_present, 1));
  HANDLE_CODE(bref.unpack(two_ant_port_activ_pucch_format1a1b_r10_present, 1));
  HANDLE_CODE(bref.unpack(simul_pucch_pusch_r10_present, 1));
  HANDLE_CODE(bref.unpack(n1_pucch_an_rep_p1_r10_present, 1));

  if (pucch_format_r10_present) {
    HANDLE_CODE(pucch_format_r10.unpack(bref));
  }
  if (n1_pucch_an_rep_p1_r10_present) {
    HANDLE_CODE(unpack_integer(n1_pucch_an_rep_p1_r10, bref, (uint16_t)0u, (uint16_t)2047u));
  }

  return SRSASN_SUCCESS;
}
void pucch_cfg_ded_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pucch_format_r10_present) {
    j.write_fieldname("pucch-Format-r10");
    pucch_format_r10.to_json(j);
  }
  if (two_ant_port_activ_pucch_format1a1b_r10_present) {
    j.write_str("twoAntennaPortActivatedPUCCH-Format1a1b-r10", "true");
  }
  if (simul_pucch_pusch_r10_present) {
    j.write_str("simultaneousPUCCH-PUSCH-r10", "true");
  }
  if (n1_pucch_an_rep_p1_r10_present) {
    j.write_int("n1PUCCH-AN-RepP1-r10", n1_pucch_an_rep_p1_r10);
  }
  j.end_obj();
}

void pucch_cfg_ded_v1020_s::pucch_format_r10_c_::destroy_()
{
  switch (type_) {
    case types::format3_r10:
      c.destroy<pucch_format3_conf_r13_s>();
      break;
    case types::ch_sel_r10:
      c.destroy<ch_sel_r10_s_>();
      break;
    default:
      break;
  }
}
void pucch_cfg_ded_v1020_s::pucch_format_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::format3_r10:
      c.init<pucch_format3_conf_r13_s>();
      break;
    case types::ch_sel_r10:
      c.init<ch_sel_r10_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_");
  }
}
pucch_cfg_ded_v1020_s::pucch_format_r10_c_::pucch_format_r10_c_(const pucch_cfg_ded_v1020_s::pucch_format_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::format3_r10:
      c.init(other.c.get<pucch_format3_conf_r13_s>());
      break;
    case types::ch_sel_r10:
      c.init(other.c.get<ch_sel_r10_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_");
  }
}
pucch_cfg_ded_v1020_s::pucch_format_r10_c_& pucch_cfg_ded_v1020_s::pucch_format_r10_c_::
                                            operator=(const pucch_cfg_ded_v1020_s::pucch_format_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::format3_r10:
      c.set(other.c.get<pucch_format3_conf_r13_s>());
      break;
    case types::ch_sel_r10:
      c.set(other.c.get<ch_sel_r10_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_");
  }

  return *this;
}
void pucch_cfg_ded_v1020_s::pucch_format_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::format3_r10:
      j.write_fieldname("format3-r10");
      c.get<pucch_format3_conf_r13_s>().to_json(j);
      break;
    case types::ch_sel_r10:
      j.write_fieldname("channelSelection-r10");
      j.start_obj();
      if (c.get<ch_sel_r10_s_>().n1_pucch_an_cs_r10_present) {
        j.write_fieldname("n1PUCCH-AN-CS-r10");
        c.get<ch_sel_r10_s_>().n1_pucch_an_cs_r10.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_v1020_s::pucch_format_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::format3_r10:
      HANDLE_CODE(c.get<pucch_format3_conf_r13_s>().pack(bref));
      break;
    case types::ch_sel_r10:
      HANDLE_CODE(bref.pack(c.get<ch_sel_r10_s_>().n1_pucch_an_cs_r10_present, 1));
      if (c.get<ch_sel_r10_s_>().n1_pucch_an_cs_r10_present) {
        HANDLE_CODE(c.get<ch_sel_r10_s_>().n1_pucch_an_cs_r10.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1020_s::pucch_format_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::format3_r10:
      HANDLE_CODE(c.get<pucch_format3_conf_r13_s>().unpack(bref));
      break;
    case types::ch_sel_r10:
      HANDLE_CODE(bref.unpack(c.get<ch_sel_r10_s_>().n1_pucch_an_cs_r10_present, 1));
      if (c.get<ch_sel_r10_s_>().n1_pucch_an_cs_r10_present) {
        HANDLE_CODE(c.get<ch_sel_r10_s_>().n1_pucch_an_cs_r10.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_v1020_s::pucch_format_r10_c_::ch_sel_r10_s_::n1_pucch_an_cs_r10_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_v1020_s::pucch_format_r10_c_::ch_sel_r10_s_::n1_pucch_an_cs_r10_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-List-r10");
      for (const auto& e1 : c.n1_pucch_an_cs_list_r10) {
        j.start_array();
        for (const auto& e2 : e1) {
          j.write_int(e2);
        }
        j.end_array();
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_::ch_sel_r10_s_::n1_pucch_an_cs_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_v1020_s::pucch_format_r10_c_::ch_sel_r10_s_::n1_pucch_an_cs_r10_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_r10,
                                  1,
                                  2,
                                  SeqOfPacker<integer_packer<uint16_t> >(1, 4, integer_packer<uint16_t>(0, 2047))));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_::ch_sel_r10_s_::n1_pucch_an_cs_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1020_s::pucch_format_r10_c_::ch_sel_r10_s_::n1_pucch_an_cs_r10_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_r10,
                                    bref,
                                    1,
                                    2,
                                    SeqOfPacker<integer_packer<uint16_t> >(1, 4, integer_packer<uint16_t>(0, 2047))));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1020_s::pucch_format_r10_c_::ch_sel_r10_s_::n1_pucch_an_cs_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUCCH-ConfigDedicated-v1130 ::= SEQUENCE
SRSASN_CODE pucch_cfg_ded_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(n1_pucch_an_cs_v1130_present, 1));
  HANDLE_CODE(bref.pack(npucch_param_r11_present, 1));

  if (n1_pucch_an_cs_v1130_present) {
    HANDLE_CODE(n1_pucch_an_cs_v1130.pack(bref));
  }
  if (npucch_param_r11_present) {
    HANDLE_CODE(npucch_param_r11.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(n1_pucch_an_cs_v1130_present, 1));
  HANDLE_CODE(bref.unpack(npucch_param_r11_present, 1));

  if (n1_pucch_an_cs_v1130_present) {
    HANDLE_CODE(n1_pucch_an_cs_v1130.unpack(bref));
  }
  if (npucch_param_r11_present) {
    HANDLE_CODE(npucch_param_r11.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pucch_cfg_ded_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (n1_pucch_an_cs_v1130_present) {
    j.write_fieldname("n1PUCCH-AN-CS-v1130");
    n1_pucch_an_cs_v1130.to_json(j);
  }
  if (npucch_param_r11_present) {
    j.write_fieldname("nPUCCH-Param-r11");
    npucch_param_r11.to_json(j);
  }
  j.end_obj();
}

void pucch_cfg_ded_v1130_s::n1_pucch_an_cs_v1130_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_v1130_s::n1_pucch_an_cs_v1130_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-r11");
      for (const auto& e1 : c.n1_pucch_an_cs_list_p1_r11) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1130_s::n1_pucch_an_cs_v1130_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_v1130_s::n1_pucch_an_cs_v1130_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_r11, 2, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1130_s::n1_pucch_an_cs_v1130_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1130_s::n1_pucch_an_cs_v1130_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_r11, bref, 2, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1130_s::n1_pucch_an_cs_v1130_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pucch_cfg_ded_v1130_s::npucch_param_r11_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_v1130_s::npucch_param_r11_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_int("nPUCCH-Identity-r11", c.npucch_id_r11);
      j.write_int("n1PUCCH-AN-r11", c.n1_pucch_an_r11);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1130_s::npucch_param_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_v1130_s::npucch_param_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.npucch_id_r11, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(pack_integer(bref, c.n1_pucch_an_r11, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1130_s::npucch_param_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1130_s::npucch_param_r11_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.npucch_id_r11, bref, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(unpack_integer(c.n1_pucch_an_r11, bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1130_s::npucch_param_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUCCH-ConfigDedicated-v1250 ::= SEQUENCE
SRSASN_CODE pucch_cfg_ded_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(nka_pucch_param_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(nka_pucch_param_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void pucch_cfg_ded_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("nkaPUCCH-Param-r12");
  nka_pucch_param_r12.to_json(j);
  j.end_obj();
}

void pucch_cfg_ded_v1250_s::nka_pucch_param_r12_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_v1250_s::nka_pucch_param_r12_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_int("nkaPUCCH-AN-r12", c.nka_pucch_an_r12);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1250_s::nka_pucch_param_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_v1250_s::nka_pucch_param_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.nka_pucch_an_r12, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1250_s::nka_pucch_param_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1250_s::nka_pucch_param_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.nka_pucch_an_r12, bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1250_s::nka_pucch_param_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUCCH-ConfigDedicated-v1430 ::= SEQUENCE
SRSASN_CODE pucch_cfg_ded_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pucch_num_repeat_ce_format1_r14_present, 1));

  if (pucch_num_repeat_ce_format1_r14_present) {
    HANDLE_CODE(pucch_num_repeat_ce_format1_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pucch_num_repeat_ce_format1_r14_present, 1));

  if (pucch_num_repeat_ce_format1_r14_present) {
    HANDLE_CODE(pucch_num_repeat_ce_format1_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pucch_cfg_ded_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pucch_num_repeat_ce_format1_r14_present) {
    j.write_str("pucch-NumRepetitionCE-format1-r14", pucch_num_repeat_ce_format1_r14.to_string());
  }
  j.end_obj();
}

// PUSCH-ConfigDedicated ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, beta_offset_ack_idx, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(pack_integer(bref, beta_offset_ri_idx, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(pack_integer(bref, beta_offset_cqi_idx, (uint8_t)0u, (uint8_t)15u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(beta_offset_ack_idx, bref, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(unpack_integer(beta_offset_ri_idx, bref, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(unpack_integer(beta_offset_cqi_idx, bref, (uint8_t)0u, (uint8_t)15u));

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("betaOffset-ACK-Index", beta_offset_ack_idx);
  j.write_int("betaOffset-RI-Index", beta_offset_ri_idx);
  j.write_int("betaOffset-CQI-Index", beta_offset_cqi_idx);
  j.end_obj();
}

// PUSCH-ConfigDedicated-r13 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(beta_offset2_ack_idx_r13_present, 1));
  HANDLE_CODE(bref.pack(beta_offset_mc_r13_present, 1));
  HANDLE_CODE(bref.pack(group_hop_disabled_r13_present, 1));
  HANDLE_CODE(bref.pack(dmrs_with_occ_activ_r13_present, 1));
  HANDLE_CODE(bref.pack(pusch_dmrs_r11_present, 1));
  HANDLE_CODE(bref.pack(uci_on_pusch_present, 1));
  HANDLE_CODE(bref.pack(pusch_hop_cfg_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, beta_offset_ack_idx_r13, (uint8_t)0u, (uint8_t)15u));
  if (beta_offset2_ack_idx_r13_present) {
    HANDLE_CODE(pack_integer(bref, beta_offset2_ack_idx_r13, (uint8_t)0u, (uint8_t)15u));
  }
  HANDLE_CODE(pack_integer(bref, beta_offset_ri_idx_r13, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(pack_integer(bref, beta_offset_cqi_idx_r13, (uint8_t)0u, (uint8_t)15u));
  if (beta_offset_mc_r13_present) {
    HANDLE_CODE(bref.pack(beta_offset_mc_r13.beta_offset2_ack_idx_mc_r13_present, 1));
    HANDLE_CODE(pack_integer(bref, beta_offset_mc_r13.beta_offset_ack_idx_mc_r13, (uint8_t)0u, (uint8_t)15u));
    if (beta_offset_mc_r13.beta_offset2_ack_idx_mc_r13_present) {
      HANDLE_CODE(pack_integer(bref, beta_offset_mc_r13.beta_offset2_ack_idx_mc_r13, (uint8_t)0u, (uint8_t)15u));
    }
    HANDLE_CODE(pack_integer(bref, beta_offset_mc_r13.beta_offset_ri_idx_mc_r13, (uint8_t)0u, (uint8_t)15u));
    HANDLE_CODE(pack_integer(bref, beta_offset_mc_r13.beta_offset_cqi_idx_mc_r13, (uint8_t)0u, (uint8_t)15u));
  }
  if (pusch_dmrs_r11_present) {
    HANDLE_CODE(pusch_dmrs_r11.pack(bref));
  }
  if (uci_on_pusch_present) {
    HANDLE_CODE(uci_on_pusch.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(beta_offset2_ack_idx_r13_present, 1));
  HANDLE_CODE(bref.unpack(beta_offset_mc_r13_present, 1));
  HANDLE_CODE(bref.unpack(group_hop_disabled_r13_present, 1));
  HANDLE_CODE(bref.unpack(dmrs_with_occ_activ_r13_present, 1));
  HANDLE_CODE(bref.unpack(pusch_dmrs_r11_present, 1));
  HANDLE_CODE(bref.unpack(uci_on_pusch_present, 1));
  HANDLE_CODE(bref.unpack(pusch_hop_cfg_r13_present, 1));

  HANDLE_CODE(unpack_integer(beta_offset_ack_idx_r13, bref, (uint8_t)0u, (uint8_t)15u));
  if (beta_offset2_ack_idx_r13_present) {
    HANDLE_CODE(unpack_integer(beta_offset2_ack_idx_r13, bref, (uint8_t)0u, (uint8_t)15u));
  }
  HANDLE_CODE(unpack_integer(beta_offset_ri_idx_r13, bref, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(unpack_integer(beta_offset_cqi_idx_r13, bref, (uint8_t)0u, (uint8_t)15u));
  if (beta_offset_mc_r13_present) {
    HANDLE_CODE(bref.unpack(beta_offset_mc_r13.beta_offset2_ack_idx_mc_r13_present, 1));
    HANDLE_CODE(unpack_integer(beta_offset_mc_r13.beta_offset_ack_idx_mc_r13, bref, (uint8_t)0u, (uint8_t)15u));
    if (beta_offset_mc_r13.beta_offset2_ack_idx_mc_r13_present) {
      HANDLE_CODE(unpack_integer(beta_offset_mc_r13.beta_offset2_ack_idx_mc_r13, bref, (uint8_t)0u, (uint8_t)15u));
    }
    HANDLE_CODE(unpack_integer(beta_offset_mc_r13.beta_offset_ri_idx_mc_r13, bref, (uint8_t)0u, (uint8_t)15u));
    HANDLE_CODE(unpack_integer(beta_offset_mc_r13.beta_offset_cqi_idx_mc_r13, bref, (uint8_t)0u, (uint8_t)15u));
  }
  if (pusch_dmrs_r11_present) {
    HANDLE_CODE(pusch_dmrs_r11.unpack(bref));
  }
  if (uci_on_pusch_present) {
    HANDLE_CODE(uci_on_pusch.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("betaOffset-ACK-Index-r13", beta_offset_ack_idx_r13);
  if (beta_offset2_ack_idx_r13_present) {
    j.write_int("betaOffset2-ACK-Index-r13", beta_offset2_ack_idx_r13);
  }
  j.write_int("betaOffset-RI-Index-r13", beta_offset_ri_idx_r13);
  j.write_int("betaOffset-CQI-Index-r13", beta_offset_cqi_idx_r13);
  if (beta_offset_mc_r13_present) {
    j.write_fieldname("betaOffsetMC-r13");
    j.start_obj();
    j.write_int("betaOffset-ACK-Index-MC-r13", beta_offset_mc_r13.beta_offset_ack_idx_mc_r13);
    if (beta_offset_mc_r13.beta_offset2_ack_idx_mc_r13_present) {
      j.write_int("betaOffset2-ACK-Index-MC-r13", beta_offset_mc_r13.beta_offset2_ack_idx_mc_r13);
    }
    j.write_int("betaOffset-RI-Index-MC-r13", beta_offset_mc_r13.beta_offset_ri_idx_mc_r13);
    j.write_int("betaOffset-CQI-Index-MC-r13", beta_offset_mc_r13.beta_offset_cqi_idx_mc_r13);
    j.end_obj();
  }
  if (group_hop_disabled_r13_present) {
    j.write_str("groupHoppingDisabled-r13", "true");
  }
  if (dmrs_with_occ_activ_r13_present) {
    j.write_str("dmrs-WithOCC-Activated-r13", "true");
  }
  if (pusch_dmrs_r11_present) {
    j.write_fieldname("pusch-DMRS-r11");
    pusch_dmrs_r11.to_json(j);
  }
  if (uci_on_pusch_present) {
    j.write_fieldname("uciOnPUSCH");
    uci_on_pusch.to_json(j);
  }
  if (pusch_hop_cfg_r13_present) {
    j.write_str("pusch-HoppingConfig-r13", "on");
  }
  j.end_obj();
}

void pusch_cfg_ded_r13_s::pusch_dmrs_r11_c_::set(types::options e)
{
  type_ = e;
}
void pusch_cfg_ded_r13_s::pusch_dmrs_r11_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_int("nPUSCH-Identity-r13", c.npusch_id_r13);
      j.write_int("nDMRS-CSH-Identity-r13", c.ndmrs_csh_id_r13);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_r13_s::pusch_dmrs_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE pusch_cfg_ded_r13_s::pusch_dmrs_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.npusch_id_r13, (uint16_t)0u, (uint16_t)509u));
      HANDLE_CODE(pack_integer(bref, c.ndmrs_csh_id_r13, (uint16_t)0u, (uint16_t)509u));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_r13_s::pusch_dmrs_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_r13_s::pusch_dmrs_r11_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.npusch_id_r13, bref, (uint16_t)0u, (uint16_t)509u));
      HANDLE_CODE(unpack_integer(c.ndmrs_csh_id_r13, bref, (uint16_t)0u, (uint16_t)509u));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_r13_s::pusch_dmrs_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pusch_cfg_ded_r13_s::uci_on_pusch_c_::set(types::options e)
{
  type_ = e;
}
void pusch_cfg_ded_r13_s::uci_on_pusch_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_int("betaOffset-ACK-Index-SubframeSet2-r13", c.beta_offset_ack_idx_sf_set2_r13);
      if (c.beta_offset2_ack_idx_sf_set2_r13_present) {
        j.write_int("betaOffset2-ACK-Index-SubframeSet2-r13", c.beta_offset2_ack_idx_sf_set2_r13);
      }
      j.write_int("betaOffset-RI-Index-SubframeSet2-r13", c.beta_offset_ri_idx_sf_set2_r13);
      j.write_int("betaOffset-CQI-Index-SubframeSet2-r13", c.beta_offset_cqi_idx_sf_set2_r13);
      if (c.beta_offset_mc_r12_present) {
        j.write_fieldname("betaOffsetMC-r12");
        j.start_obj();
        j.write_int("betaOffset-ACK-Index-MC-SubframeSet2-r13",
                    c.beta_offset_mc_r12.beta_offset_ack_idx_mc_sf_set2_r13);
        if (c.beta_offset_mc_r12.beta_offset2_ack_idx_mc_sf_set2_r13_present) {
          j.write_int("betaOffset2-ACK-Index-MC-SubframeSet2-r13",
                      c.beta_offset_mc_r12.beta_offset2_ack_idx_mc_sf_set2_r13);
        }
        j.write_int("betaOffset-RI-Index-MC-SubframeSet2-r13", c.beta_offset_mc_r12.beta_offset_ri_idx_mc_sf_set2_r13);
        j.write_int("betaOffset-CQI-Index-MC-SubframeSet2-r13",
                    c.beta_offset_mc_r12.beta_offset_cqi_idx_mc_sf_set2_r13);
        j.end_obj();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_r13_s::uci_on_pusch_c_");
  }
  j.end_obj();
}
SRSASN_CODE pusch_cfg_ded_r13_s::uci_on_pusch_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.beta_offset2_ack_idx_sf_set2_r13_present, 1));
      HANDLE_CODE(bref.pack(c.beta_offset_mc_r12_present, 1));
      HANDLE_CODE(pack_integer(bref, c.beta_offset_ack_idx_sf_set2_r13, (uint8_t)0u, (uint8_t)15u));
      if (c.beta_offset2_ack_idx_sf_set2_r13_present) {
        HANDLE_CODE(pack_integer(bref, c.beta_offset2_ack_idx_sf_set2_r13, (uint8_t)0u, (uint8_t)15u));
      }
      HANDLE_CODE(pack_integer(bref, c.beta_offset_ri_idx_sf_set2_r13, (uint8_t)0u, (uint8_t)15u));
      HANDLE_CODE(pack_integer(bref, c.beta_offset_cqi_idx_sf_set2_r13, (uint8_t)0u, (uint8_t)15u));
      if (c.beta_offset_mc_r12_present) {
        HANDLE_CODE(bref.pack(c.beta_offset_mc_r12.beta_offset2_ack_idx_mc_sf_set2_r13_present, 1));
        HANDLE_CODE(
            pack_integer(bref, c.beta_offset_mc_r12.beta_offset_ack_idx_mc_sf_set2_r13, (uint8_t)0u, (uint8_t)15u));
        if (c.beta_offset_mc_r12.beta_offset2_ack_idx_mc_sf_set2_r13_present) {
          HANDLE_CODE(
              pack_integer(bref, c.beta_offset_mc_r12.beta_offset2_ack_idx_mc_sf_set2_r13, (uint8_t)0u, (uint8_t)15u));
        }
        HANDLE_CODE(
            pack_integer(bref, c.beta_offset_mc_r12.beta_offset_ri_idx_mc_sf_set2_r13, (uint8_t)0u, (uint8_t)15u));
        HANDLE_CODE(
            pack_integer(bref, c.beta_offset_mc_r12.beta_offset_cqi_idx_mc_sf_set2_r13, (uint8_t)0u, (uint8_t)15u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_r13_s::uci_on_pusch_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_r13_s::uci_on_pusch_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.beta_offset2_ack_idx_sf_set2_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.beta_offset_mc_r12_present, 1));
      HANDLE_CODE(unpack_integer(c.beta_offset_ack_idx_sf_set2_r13, bref, (uint8_t)0u, (uint8_t)15u));
      if (c.beta_offset2_ack_idx_sf_set2_r13_present) {
        HANDLE_CODE(unpack_integer(c.beta_offset2_ack_idx_sf_set2_r13, bref, (uint8_t)0u, (uint8_t)15u));
      }
      HANDLE_CODE(unpack_integer(c.beta_offset_ri_idx_sf_set2_r13, bref, (uint8_t)0u, (uint8_t)15u));
      HANDLE_CODE(unpack_integer(c.beta_offset_cqi_idx_sf_set2_r13, bref, (uint8_t)0u, (uint8_t)15u));
      if (c.beta_offset_mc_r12_present) {
        HANDLE_CODE(bref.unpack(c.beta_offset_mc_r12.beta_offset2_ack_idx_mc_sf_set2_r13_present, 1));
        HANDLE_CODE(
            unpack_integer(c.beta_offset_mc_r12.beta_offset_ack_idx_mc_sf_set2_r13, bref, (uint8_t)0u, (uint8_t)15u));
        if (c.beta_offset_mc_r12.beta_offset2_ack_idx_mc_sf_set2_r13_present) {
          HANDLE_CODE(unpack_integer(
              c.beta_offset_mc_r12.beta_offset2_ack_idx_mc_sf_set2_r13, bref, (uint8_t)0u, (uint8_t)15u));
        }
        HANDLE_CODE(
            unpack_integer(c.beta_offset_mc_r12.beta_offset_ri_idx_mc_sf_set2_r13, bref, (uint8_t)0u, (uint8_t)15u));
        HANDLE_CODE(
            unpack_integer(c.beta_offset_mc_r12.beta_offset_cqi_idx_mc_sf_set2_r13, bref, (uint8_t)0u, (uint8_t)15u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_r13_s::uci_on_pusch_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUSCH-ConfigDedicated-v1020 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(beta_offset_mc_r10_present, 1));
  HANDLE_CODE(bref.pack(group_hop_disabled_r10_present, 1));
  HANDLE_CODE(bref.pack(dmrs_with_occ_activ_r10_present, 1));

  if (beta_offset_mc_r10_present) {
    HANDLE_CODE(pack_integer(bref, beta_offset_mc_r10.beta_offset_ack_idx_mc_r10, (uint8_t)0u, (uint8_t)15u));
    HANDLE_CODE(pack_integer(bref, beta_offset_mc_r10.beta_offset_ri_idx_mc_r10, (uint8_t)0u, (uint8_t)15u));
    HANDLE_CODE(pack_integer(bref, beta_offset_mc_r10.beta_offset_cqi_idx_mc_r10, (uint8_t)0u, (uint8_t)15u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(beta_offset_mc_r10_present, 1));
  HANDLE_CODE(bref.unpack(group_hop_disabled_r10_present, 1));
  HANDLE_CODE(bref.unpack(dmrs_with_occ_activ_r10_present, 1));

  if (beta_offset_mc_r10_present) {
    HANDLE_CODE(unpack_integer(beta_offset_mc_r10.beta_offset_ack_idx_mc_r10, bref, (uint8_t)0u, (uint8_t)15u));
    HANDLE_CODE(unpack_integer(beta_offset_mc_r10.beta_offset_ri_idx_mc_r10, bref, (uint8_t)0u, (uint8_t)15u));
    HANDLE_CODE(unpack_integer(beta_offset_mc_r10.beta_offset_cqi_idx_mc_r10, bref, (uint8_t)0u, (uint8_t)15u));
  }

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (beta_offset_mc_r10_present) {
    j.write_fieldname("betaOffsetMC-r10");
    j.start_obj();
    j.write_int("betaOffset-ACK-Index-MC-r10", beta_offset_mc_r10.beta_offset_ack_idx_mc_r10);
    j.write_int("betaOffset-RI-Index-MC-r10", beta_offset_mc_r10.beta_offset_ri_idx_mc_r10);
    j.write_int("betaOffset-CQI-Index-MC-r10", beta_offset_mc_r10.beta_offset_cqi_idx_mc_r10);
    j.end_obj();
  }
  if (group_hop_disabled_r10_present) {
    j.write_str("groupHoppingDisabled-r10", "true");
  }
  if (dmrs_with_occ_activ_r10_present) {
    j.write_str("dmrs-WithOCC-Activated-r10", "true");
  }
  j.end_obj();
}

// PUSCH-ConfigDedicated-v1130 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pusch_dmrs_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(pusch_dmrs_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("pusch-DMRS-r11");
  pusch_dmrs_r11.to_json(j);
  j.end_obj();
}

void pusch_cfg_ded_v1130_s::pusch_dmrs_r11_c_::set(types::options e)
{
  type_ = e;
}
void pusch_cfg_ded_v1130_s::pusch_dmrs_r11_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_int("nPUSCH-Identity-r11", c.npusch_id_r11);
      j.write_int("nDMRS-CSH-Identity-r11", c.ndmrs_csh_id_r11);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1130_s::pusch_dmrs_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE pusch_cfg_ded_v1130_s::pusch_dmrs_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.npusch_id_r11, (uint16_t)0u, (uint16_t)509u));
      HANDLE_CODE(pack_integer(bref, c.ndmrs_csh_id_r11, (uint16_t)0u, (uint16_t)509u));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1130_s::pusch_dmrs_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1130_s::pusch_dmrs_r11_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.npusch_id_r11, bref, (uint16_t)0u, (uint16_t)509u));
      HANDLE_CODE(unpack_integer(c.ndmrs_csh_id_r11, bref, (uint16_t)0u, (uint16_t)509u));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1130_s::pusch_dmrs_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUSCH-ConfigDedicated-v1250 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(uci_on_pusch.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(uci_on_pusch.unpack(bref));

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("uciOnPUSCH");
  uci_on_pusch.to_json(j);
  j.end_obj();
}

void pusch_cfg_ded_v1250_s::uci_on_pusch_c_::set(types::options e)
{
  type_ = e;
}
void pusch_cfg_ded_v1250_s::uci_on_pusch_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_int("betaOffset-ACK-Index-SubframeSet2-r12", c.beta_offset_ack_idx_sf_set2_r12);
      j.write_int("betaOffset-RI-Index-SubframeSet2-r12", c.beta_offset_ri_idx_sf_set2_r12);
      j.write_int("betaOffset-CQI-Index-SubframeSet2-r12", c.beta_offset_cqi_idx_sf_set2_r12);
      if (c.beta_offset_mc_r12_present) {
        j.write_fieldname("betaOffsetMC-r12");
        j.start_obj();
        j.write_int("betaOffset-ACK-Index-MC-SubframeSet2-r12",
                    c.beta_offset_mc_r12.beta_offset_ack_idx_mc_sf_set2_r12);
        j.write_int("betaOffset-RI-Index-MC-SubframeSet2-r12", c.beta_offset_mc_r12.beta_offset_ri_idx_mc_sf_set2_r12);
        j.write_int("betaOffset-CQI-Index-MC-SubframeSet2-r12",
                    c.beta_offset_mc_r12.beta_offset_cqi_idx_mc_sf_set2_r12);
        j.end_obj();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1250_s::uci_on_pusch_c_");
  }
  j.end_obj();
}
SRSASN_CODE pusch_cfg_ded_v1250_s::uci_on_pusch_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.beta_offset_mc_r12_present, 1));
      HANDLE_CODE(pack_integer(bref, c.beta_offset_ack_idx_sf_set2_r12, (uint8_t)0u, (uint8_t)15u));
      HANDLE_CODE(pack_integer(bref, c.beta_offset_ri_idx_sf_set2_r12, (uint8_t)0u, (uint8_t)15u));
      HANDLE_CODE(pack_integer(bref, c.beta_offset_cqi_idx_sf_set2_r12, (uint8_t)0u, (uint8_t)15u));
      if (c.beta_offset_mc_r12_present) {
        HANDLE_CODE(
            pack_integer(bref, c.beta_offset_mc_r12.beta_offset_ack_idx_mc_sf_set2_r12, (uint8_t)0u, (uint8_t)15u));
        HANDLE_CODE(
            pack_integer(bref, c.beta_offset_mc_r12.beta_offset_ri_idx_mc_sf_set2_r12, (uint8_t)0u, (uint8_t)15u));
        HANDLE_CODE(
            pack_integer(bref, c.beta_offset_mc_r12.beta_offset_cqi_idx_mc_sf_set2_r12, (uint8_t)0u, (uint8_t)15u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1250_s::uci_on_pusch_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1250_s::uci_on_pusch_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.beta_offset_mc_r12_present, 1));
      HANDLE_CODE(unpack_integer(c.beta_offset_ack_idx_sf_set2_r12, bref, (uint8_t)0u, (uint8_t)15u));
      HANDLE_CODE(unpack_integer(c.beta_offset_ri_idx_sf_set2_r12, bref, (uint8_t)0u, (uint8_t)15u));
      HANDLE_CODE(unpack_integer(c.beta_offset_cqi_idx_sf_set2_r12, bref, (uint8_t)0u, (uint8_t)15u));
      if (c.beta_offset_mc_r12_present) {
        HANDLE_CODE(
            unpack_integer(c.beta_offset_mc_r12.beta_offset_ack_idx_mc_sf_set2_r12, bref, (uint8_t)0u, (uint8_t)15u));
        HANDLE_CODE(
            unpack_integer(c.beta_offset_mc_r12.beta_offset_ri_idx_mc_sf_set2_r12, bref, (uint8_t)0u, (uint8_t)15u));
        HANDLE_CODE(
            unpack_integer(c.beta_offset_mc_r12.beta_offset_cqi_idx_mc_sf_set2_r12, bref, (uint8_t)0u, (uint8_t)15u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1250_s::uci_on_pusch_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUSCH-ConfigDedicated-v1430 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_pusch_nb_max_tbs_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_pusch_max_bw_r14_present, 1));
  HANDLE_CODE(bref.pack(tdd_pusch_up_pts_r14_present, 1));
  HANDLE_CODE(bref.pack(enable256_qam_r14_present, 1));

  if (tdd_pusch_up_pts_r14_present) {
    HANDLE_CODE(tdd_pusch_up_pts_r14.pack(bref));
  }
  HANDLE_CODE(bref.pack(ul_dmrs_ifdma_r14, 1));
  if (enable256_qam_r14_present) {
    HANDLE_CODE(enable256_qam_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_pusch_nb_max_tbs_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_pusch_max_bw_r14_present, 1));
  HANDLE_CODE(bref.unpack(tdd_pusch_up_pts_r14_present, 1));
  HANDLE_CODE(bref.unpack(enable256_qam_r14_present, 1));

  if (tdd_pusch_up_pts_r14_present) {
    HANDLE_CODE(tdd_pusch_up_pts_r14.unpack(bref));
  }
  HANDLE_CODE(bref.unpack(ul_dmrs_ifdma_r14, 1));
  if (enable256_qam_r14_present) {
    HANDLE_CODE(enable256_qam_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_pusch_nb_max_tbs_r14_present) {
    j.write_str("ce-PUSCH-NB-MaxTBS-r14", "on");
  }
  if (ce_pusch_max_bw_r14_present) {
    j.write_str("ce-PUSCH-MaxBandwidth-r14", "bw5");
  }
  if (tdd_pusch_up_pts_r14_present) {
    j.write_fieldname("tdd-PUSCH-UpPTS-r14");
    tdd_pusch_up_pts_r14.to_json(j);
  }
  j.write_bool("ul-DMRS-IFDMA-r14", ul_dmrs_ifdma_r14);
  if (enable256_qam_r14_present) {
    j.write_fieldname("enable256QAM-r14");
    enable256_qam_r14.to_json(j);
  }
  j.end_obj();
}

// PUSCH-ConfigDedicated-v1530 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_pusch_sub_prb_cfg_r15_present, 1));

  HANDLE_CODE(ce_pusch_flex_start_prb_alloc_cfg_r15.pack(bref));
  if (ce_pusch_sub_prb_cfg_r15_present) {
    HANDLE_CODE(ce_pusch_sub_prb_cfg_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_pusch_sub_prb_cfg_r15_present, 1));

  HANDLE_CODE(ce_pusch_flex_start_prb_alloc_cfg_r15.unpack(bref));
  if (ce_pusch_sub_prb_cfg_r15_present) {
    HANDLE_CODE(ce_pusch_sub_prb_cfg_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ce-PUSCH-FlexibleStartPRB-AllocConfig-r15");
  ce_pusch_flex_start_prb_alloc_cfg_r15.to_json(j);
  if (ce_pusch_sub_prb_cfg_r15_present) {
    j.write_fieldname("ce-PUSCH-SubPRB-Config-r15");
    ce_pusch_sub_prb_cfg_r15.to_json(j);
  }
  j.end_obj();
}

void pusch_cfg_ded_v1530_s::ce_pusch_flex_start_prb_alloc_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void pusch_cfg_ded_v1530_s::ce_pusch_flex_start_prb_alloc_cfg_r15_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.offset_ce_mode_b_r15_present) {
        j.write_int("offsetCE-ModeB-r15", c.offset_ce_mode_b_r15);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1530_s::ce_pusch_flex_start_prb_alloc_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE pusch_cfg_ded_v1530_s::ce_pusch_flex_start_prb_alloc_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.offset_ce_mode_b_r15_present, 1));
      if (c.offset_ce_mode_b_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.offset_ce_mode_b_r15, (int8_t)-1, (int8_t)3));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1530_s::ce_pusch_flex_start_prb_alloc_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1530_s::ce_pusch_flex_start_prb_alloc_cfg_r15_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.offset_ce_mode_b_r15_present, 1));
      if (c.offset_ce_mode_b_r15_present) {
        HANDLE_CODE(unpack_integer(c.offset_ce_mode_b_r15, bref, (int8_t)-1, (int8_t)3));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1530_s::ce_pusch_flex_start_prb_alloc_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pusch_cfg_ded_v1530_s::ce_pusch_sub_prb_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void pusch_cfg_ded_v1530_s::ce_pusch_sub_prb_cfg_r15_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.location_ce_mode_b_r15_present) {
        j.write_int("locationCE-ModeB-r15", c.location_ce_mode_b_r15);
      }
      j.write_int("sixToneCyclicShift-r15", c.six_tone_cyclic_shift_r15);
      j.write_int("threeToneCyclicShift-r15", c.three_tone_cyclic_shift_r15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1530_s::ce_pusch_sub_prb_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE pusch_cfg_ded_v1530_s::ce_pusch_sub_prb_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.location_ce_mode_b_r15_present, 1));
      if (c.location_ce_mode_b_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.location_ce_mode_b_r15, (uint8_t)0u, (uint8_t)5u));
      }
      HANDLE_CODE(pack_integer(bref, c.six_tone_cyclic_shift_r15, (uint8_t)0u, (uint8_t)3u));
      HANDLE_CODE(pack_integer(bref, c.three_tone_cyclic_shift_r15, (uint8_t)0u, (uint8_t)2u));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1530_s::ce_pusch_sub_prb_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_v1530_s::ce_pusch_sub_prb_cfg_r15_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.location_ce_mode_b_r15_present, 1));
      if (c.location_ce_mode_b_r15_present) {
        HANDLE_CODE(unpack_integer(c.location_ce_mode_b_r15, bref, (uint8_t)0u, (uint8_t)5u));
      }
      HANDLE_CODE(unpack_integer(c.six_tone_cyclic_shift_r15, bref, (uint8_t)0u, (uint8_t)3u));
      HANDLE_CODE(unpack_integer(c.three_tone_cyclic_shift_r15, bref, (uint8_t)0u, (uint8_t)2u));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_v1530_s::ce_pusch_sub_prb_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUSCH-EnhancementsConfig-r14 ::= CHOICE
void pusch_enhance_cfg_r14_c::set(types::options e)
{
  type_ = e;
}
void pusch_enhance_cfg_r14_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.pusch_hop_offset_pusch_enh_r14_present) {
        j.write_int("pusch-HoppingOffsetPUSCH-Enh-r14", c.pusch_hop_offset_pusch_enh_r14);
      }
      if (c.interv_ul_hop_pusch_enh_r14_present) {
        j.write_fieldname("interval-ULHoppingPUSCH-Enh-r14");
        c.interv_ul_hop_pusch_enh_r14.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pusch_enhance_cfg_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE pusch_enhance_cfg_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.pusch_hop_offset_pusch_enh_r14_present, 1));
      HANDLE_CODE(bref.pack(c.interv_ul_hop_pusch_enh_r14_present, 1));
      if (c.pusch_hop_offset_pusch_enh_r14_present) {
        HANDLE_CODE(pack_integer(bref, c.pusch_hop_offset_pusch_enh_r14, (uint8_t)1u, (uint8_t)100u));
      }
      if (c.interv_ul_hop_pusch_enh_r14_present) {
        HANDLE_CODE(c.interv_ul_hop_pusch_enh_r14.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pusch_enhance_cfg_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_enhance_cfg_r14_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.pusch_hop_offset_pusch_enh_r14_present, 1));
      HANDLE_CODE(bref.unpack(c.interv_ul_hop_pusch_enh_r14_present, 1));
      if (c.pusch_hop_offset_pusch_enh_r14_present) {
        HANDLE_CODE(unpack_integer(c.pusch_hop_offset_pusch_enh_r14, bref, (uint8_t)1u, (uint8_t)100u));
      }
      if (c.interv_ul_hop_pusch_enh_r14_present) {
        HANDLE_CODE(c.interv_ul_hop_pusch_enh_r14.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "pusch_enhance_cfg_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_::destroy_() {}
void pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_::interv_ul_hop_pusch_enh_r14_c_(
    const pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::interv_fdd_pusch_enh_r14:
      c.init(other.c.get<interv_fdd_pusch_enh_r14_e_>());
      break;
    case types::interv_tdd_pusch_enh_r14:
      c.init(other.c.get<interv_tdd_pusch_enh_r14_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_");
  }
}
pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_&
pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_::
operator=(const pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::interv_fdd_pusch_enh_r14:
      c.set(other.c.get<interv_fdd_pusch_enh_r14_e_>());
      break;
    case types::interv_tdd_pusch_enh_r14:
      c.set(other.c.get<interv_tdd_pusch_enh_r14_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_");
  }

  return *this;
}
void pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::interv_fdd_pusch_enh_r14:
      j.write_str("interval-FDD-PUSCH-Enh-r14", c.get<interv_fdd_pusch_enh_r14_e_>().to_string());
      break;
    case types::interv_tdd_pusch_enh_r14:
      j.write_str("interval-TDD-PUSCH-Enh-r14", c.get<interv_tdd_pusch_enh_r14_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interv_fdd_pusch_enh_r14:
      HANDLE_CODE(c.get<interv_fdd_pusch_enh_r14_e_>().pack(bref));
      break;
    case types::interv_tdd_pusch_enh_r14:
      HANDLE_CODE(c.get<interv_tdd_pusch_enh_r14_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interv_fdd_pusch_enh_r14:
      HANDLE_CODE(c.get<interv_fdd_pusch_enh_r14_e_>().unpack(bref));
      break;
    case types::interv_tdd_pusch_enh_r14:
      HANDLE_CODE(c.get<interv_tdd_pusch_enh_r14_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_enhance_cfg_r14_c::setup_s_::interv_ul_hop_pusch_enh_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PhysicalConfigDedicatedSTTI-r15 ::= CHOICE
void phys_cfg_ded_stti_r15_c::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_stti_r15_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.ant_info_ded_stti_r15_present) {
        j.write_fieldname("antennaInfoDedicatedSTTI-r15");
        c.ant_info_ded_stti_r15.to_json(j);
      }
      if (c.ant_info_ul_stti_r15_present) {
        j.write_fieldname("antennaInfoUL-STTI-r15");
        c.ant_info_ul_stti_r15.to_json(j);
      }
      if (c.pucch_cfg_ded_v1530_present) {
        j.write_fieldname("pucch-ConfigDedicated-v1530");
        c.pucch_cfg_ded_v1530.to_json(j);
      }
      if (c.sched_request_cfg_v1530_present) {
        j.write_fieldname("schedulingRequestConfig-v1530");
        c.sched_request_cfg_v1530.to_json(j);
      }
      if (c.ul_pwr_ctrl_ded_stti_r15_present) {
        j.write_fieldname("uplinkPowerControlDedicatedSTTI-r15");
        c.ul_pwr_ctrl_ded_stti_r15.to_json(j);
      }
      if (c.cqi_report_cfg_r15_present) {
        j.write_fieldname("cqi-ReportConfig-r15");
        c.cqi_report_cfg_r15.to_json(j);
      }
      if (c.csi_rs_cfg_r15_present) {
        j.write_fieldname("csi-RS-Config-r15");
        c.csi_rs_cfg_r15.to_json(j);
      }
      if (c.csi_rs_cfg_nzp_to_release_list_r15_present) {
        j.start_array("csi-RS-ConfigNZPToReleaseList-r15");
        for (const auto& e1 : c.csi_rs_cfg_nzp_to_release_list_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.csi_rs_cfg_nzp_to_add_mod_list_r15_present) {
        j.start_array("csi-RS-ConfigNZPToAddModList-r15");
        for (const auto& e1 : c.csi_rs_cfg_nzp_to_add_mod_list_r15) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.csi_rs_cfg_zp_to_release_list_r15_present) {
        j.start_array("csi-RS-ConfigZPToReleaseList-r15");
        for (const auto& e1 : c.csi_rs_cfg_zp_to_release_list_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.csi_rs_cfg_zp_to_add_mod_list_r11_present) {
        j.start_array("csi-RS-ConfigZPToAddModList-r11");
        for (const auto& e1 : c.csi_rs_cfg_zp_to_add_mod_list_r11) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.csi_rs_cfg_zp_ap_list_r15_present) {
        j.write_fieldname("csi-RS-ConfigZP-ApList-r15");
        c.csi_rs_cfg_zp_ap_list_r15.to_json(j);
      }
      if (c.eimta_main_cfg_r12_present) {
        j.write_fieldname("eimta-MainConfig-r12");
        c.eimta_main_cfg_r12.to_json(j);
      }
      if (c.eimta_main_cfg_serv_cell_r15_present) {
        j.write_fieldname("eimta-MainConfigServCell-r15");
        c.eimta_main_cfg_serv_cell_r15.to_json(j);
      }
      j.write_bool("semiOpenLoopSTTI-r15", c.semi_open_loop_stti_r15);
      if (c.slot_or_subslot_pdsch_cfg_r15_present) {
        j.write_fieldname("slotOrSubslotPDSCH-Config-r15");
        c.slot_or_subslot_pdsch_cfg_r15.to_json(j);
      }
      if (c.slot_or_subslot_pusch_cfg_r15_present) {
        j.write_fieldname("slotOrSubslotPUSCH-Config-r15");
        c.slot_or_subslot_pusch_cfg_r15.to_json(j);
      }
      if (c.spdcch_cfg_r15_present) {
        j.write_fieldname("spdcch-Config-r15");
        c.spdcch_cfg_r15.to_json(j);
      }
      if (c.spucch_cfg_r15_present) {
        j.write_fieldname("spucch-Config-r15");
        c.spucch_cfg_r15.to_json(j);
      }
      j.write_bool("srs-DCI7-TriggeringConfig-r15", c.srs_dci7_trigger_cfg_r15);
      j.write_bool("shortProcessingTime-r15", c.short_processing_time_r15);
      if (c.short_tti_r15_present) {
        j.write_fieldname("shortTTI-r15");
        c.short_tti_r15.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_stti_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_stti_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.ant_info_ded_stti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.ant_info_ul_stti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.pucch_cfg_ded_v1530_present, 1));
      HANDLE_CODE(bref.pack(c.sched_request_cfg_v1530_present, 1));
      HANDLE_CODE(bref.pack(c.ul_pwr_ctrl_ded_stti_r15_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_report_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_nzp_to_release_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_nzp_to_add_mod_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_zp_to_release_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_zp_to_add_mod_list_r11_present, 1));
      HANDLE_CODE(bref.pack(c.csi_rs_cfg_zp_ap_list_r15_present, 1));
      HANDLE_CODE(bref.pack(c.eimta_main_cfg_r12_present, 1));
      HANDLE_CODE(bref.pack(c.eimta_main_cfg_serv_cell_r15_present, 1));
      HANDLE_CODE(bref.pack(c.slot_or_subslot_pdsch_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.slot_or_subslot_pusch_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.spdcch_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.spucch_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.short_tti_r15_present, 1));
      if (c.ant_info_ded_stti_r15_present) {
        HANDLE_CODE(c.ant_info_ded_stti_r15.pack(bref));
      }
      if (c.ant_info_ul_stti_r15_present) {
        HANDLE_CODE(c.ant_info_ul_stti_r15.pack(bref));
      }
      if (c.pucch_cfg_ded_v1530_present) {
        HANDLE_CODE(c.pucch_cfg_ded_v1530.pack(bref));
      }
      if (c.sched_request_cfg_v1530_present) {
        HANDLE_CODE(c.sched_request_cfg_v1530.pack(bref));
      }
      if (c.ul_pwr_ctrl_ded_stti_r15_present) {
        HANDLE_CODE(c.ul_pwr_ctrl_ded_stti_r15.pack(bref));
      }
      if (c.cqi_report_cfg_r15_present) {
        HANDLE_CODE(c.cqi_report_cfg_r15.pack(bref));
      }
      if (c.csi_rs_cfg_r15_present) {
        HANDLE_CODE(c.csi_rs_cfg_r15.pack(bref));
      }
      if (c.csi_rs_cfg_nzp_to_release_list_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.csi_rs_cfg_nzp_to_release_list_r15, 1, 24, integer_packer<uint8_t>(1, 24)));
      }
      if (c.csi_rs_cfg_nzp_to_add_mod_list_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.csi_rs_cfg_nzp_to_add_mod_list_r15, 1, 24));
      }
      if (c.csi_rs_cfg_zp_to_release_list_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.csi_rs_cfg_zp_to_release_list_r15, 1, 4, integer_packer<uint8_t>(1, 4)));
      }
      if (c.csi_rs_cfg_zp_to_add_mod_list_r11_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.csi_rs_cfg_zp_to_add_mod_list_r11, 1, 4));
      }
      if (c.csi_rs_cfg_zp_ap_list_r15_present) {
        HANDLE_CODE(c.csi_rs_cfg_zp_ap_list_r15.pack(bref));
      }
      if (c.eimta_main_cfg_r12_present) {
        HANDLE_CODE(c.eimta_main_cfg_r12.pack(bref));
      }
      if (c.eimta_main_cfg_serv_cell_r15_present) {
        HANDLE_CODE(c.eimta_main_cfg_serv_cell_r15.pack(bref));
      }
      HANDLE_CODE(bref.pack(c.semi_open_loop_stti_r15, 1));
      if (c.slot_or_subslot_pdsch_cfg_r15_present) {
        HANDLE_CODE(c.slot_or_subslot_pdsch_cfg_r15.pack(bref));
      }
      if (c.slot_or_subslot_pusch_cfg_r15_present) {
        HANDLE_CODE(c.slot_or_subslot_pusch_cfg_r15.pack(bref));
      }
      if (c.spdcch_cfg_r15_present) {
        HANDLE_CODE(c.spdcch_cfg_r15.pack(bref));
      }
      if (c.spucch_cfg_r15_present) {
        HANDLE_CODE(c.spucch_cfg_r15.pack(bref));
      }
      HANDLE_CODE(bref.pack(c.srs_dci7_trigger_cfg_r15, 1));
      HANDLE_CODE(bref.pack(c.short_processing_time_r15, 1));
      if (c.short_tti_r15_present) {
        HANDLE_CODE(c.short_tti_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_stti_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_stti_r15_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.ant_info_ded_stti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.ant_info_ul_stti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.pucch_cfg_ded_v1530_present, 1));
      HANDLE_CODE(bref.unpack(c.sched_request_cfg_v1530_present, 1));
      HANDLE_CODE(bref.unpack(c.ul_pwr_ctrl_ded_stti_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_report_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_nzp_to_release_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_nzp_to_add_mod_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_zp_to_release_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_zp_to_add_mod_list_r11_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_rs_cfg_zp_ap_list_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.eimta_main_cfg_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.eimta_main_cfg_serv_cell_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.slot_or_subslot_pdsch_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.slot_or_subslot_pusch_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.spdcch_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.spucch_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.short_tti_r15_present, 1));
      if (c.ant_info_ded_stti_r15_present) {
        HANDLE_CODE(c.ant_info_ded_stti_r15.unpack(bref));
      }
      if (c.ant_info_ul_stti_r15_present) {
        HANDLE_CODE(c.ant_info_ul_stti_r15.unpack(bref));
      }
      if (c.pucch_cfg_ded_v1530_present) {
        HANDLE_CODE(c.pucch_cfg_ded_v1530.unpack(bref));
      }
      if (c.sched_request_cfg_v1530_present) {
        HANDLE_CODE(c.sched_request_cfg_v1530.unpack(bref));
      }
      if (c.ul_pwr_ctrl_ded_stti_r15_present) {
        HANDLE_CODE(c.ul_pwr_ctrl_ded_stti_r15.unpack(bref));
      }
      if (c.cqi_report_cfg_r15_present) {
        HANDLE_CODE(c.cqi_report_cfg_r15.unpack(bref));
      }
      if (c.csi_rs_cfg_r15_present) {
        HANDLE_CODE(c.csi_rs_cfg_r15.unpack(bref));
      }
      if (c.csi_rs_cfg_nzp_to_release_list_r15_present) {
        HANDLE_CODE(
            unpack_dyn_seq_of(c.csi_rs_cfg_nzp_to_release_list_r15, bref, 1, 24, integer_packer<uint8_t>(1, 24)));
      }
      if (c.csi_rs_cfg_nzp_to_add_mod_list_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.csi_rs_cfg_nzp_to_add_mod_list_r15, bref, 1, 24));
      }
      if (c.csi_rs_cfg_zp_to_release_list_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.csi_rs_cfg_zp_to_release_list_r15, bref, 1, 4, integer_packer<uint8_t>(1, 4)));
      }
      if (c.csi_rs_cfg_zp_to_add_mod_list_r11_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.csi_rs_cfg_zp_to_add_mod_list_r11, bref, 1, 4));
      }
      if (c.csi_rs_cfg_zp_ap_list_r15_present) {
        HANDLE_CODE(c.csi_rs_cfg_zp_ap_list_r15.unpack(bref));
      }
      if (c.eimta_main_cfg_r12_present) {
        HANDLE_CODE(c.eimta_main_cfg_r12.unpack(bref));
      }
      if (c.eimta_main_cfg_serv_cell_r15_present) {
        HANDLE_CODE(c.eimta_main_cfg_serv_cell_r15.unpack(bref));
      }
      HANDLE_CODE(bref.unpack(c.semi_open_loop_stti_r15, 1));
      if (c.slot_or_subslot_pdsch_cfg_r15_present) {
        HANDLE_CODE(c.slot_or_subslot_pdsch_cfg_r15.unpack(bref));
      }
      if (c.slot_or_subslot_pusch_cfg_r15_present) {
        HANDLE_CODE(c.slot_or_subslot_pusch_cfg_r15.unpack(bref));
      }
      if (c.spdcch_cfg_r15_present) {
        HANDLE_CODE(c.spdcch_cfg_r15.unpack(bref));
      }
      if (c.spucch_cfg_r15_present) {
        HANDLE_CODE(c.spucch_cfg_r15.unpack(bref));
      }
      HANDLE_CODE(bref.unpack(c.srs_dci7_trigger_cfg_r15, 1));
      HANDLE_CODE(bref.unpack(c.short_processing_time_r15, 1));
      if (c.short_tti_r15_present) {
        HANDLE_CODE(c.short_tti_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_stti_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReject-v1130-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reject_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(depriorit_req_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (depriorit_req_r11_present) {
    HANDLE_CODE(depriorit_req_r11.depriorit_type_r11.pack(bref));
    HANDLE_CODE(depriorit_req_r11.depriorit_timer_r11.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reject_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(depriorit_req_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (depriorit_req_r11_present) {
    HANDLE_CODE(depriorit_req_r11.depriorit_type_r11.unpack(bref));
    HANDLE_CODE(depriorit_req_r11.depriorit_timer_r11.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reject_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (depriorit_req_r11_present) {
    j.write_fieldname("deprioritisationReq-r11");
    j.start_obj();
    j.write_str("deprioritisationType-r11", depriorit_req_r11.depriorit_type_r11.to_string());
    j.write_str("deprioritisationTimer-r11", depriorit_req_r11.depriorit_timer_r11.to_string());
    j.end_obj();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SPS-ConfigDL ::= CHOICE
void sps_cfg_dl_c::set(types::options e)
{
  type_ = e;
}
void sps_cfg_dl_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_c");
  }
  j.end_obj();
}
SRSASN_CODE sps_cfg_dl_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_dl_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

SRSASN_CODE sps_cfg_dl_c::setup_s_::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(semi_persist_sched_interv_dl.pack(bref));
  HANDLE_CODE(pack_integer(bref, nof_conf_sps_processes, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(pack_dyn_seq_of(bref, n1_pucch_an_persistent_list, 1, 4, integer_packer<uint16_t>(0, 2047)));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= two_ant_port_activ_r10.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(two_ant_port_activ_r10.is_present(), 1));
      if (two_ant_port_activ_r10.is_present()) {
        HANDLE_CODE(two_ant_port_activ_r10->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_dl_c::setup_s_::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(semi_persist_sched_interv_dl.unpack(bref));
  HANDLE_CODE(unpack_integer(nof_conf_sps_processes, bref, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(unpack_dyn_seq_of(n1_pucch_an_persistent_list, bref, 1, 4, integer_packer<uint16_t>(0, 2047)));

  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 two_ant_port_activ_r10_present;
      HANDLE_CODE(bref.unpack(two_ant_port_activ_r10_present, 1));
      two_ant_port_activ_r10.set_present(two_ant_port_activ_r10_present);
      if (two_ant_port_activ_r10.is_present()) {
        HANDLE_CODE(two_ant_port_activ_r10->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sps_cfg_dl_c::setup_s_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("semiPersistSchedIntervalDL", semi_persist_sched_interv_dl.to_string());
  j.write_int("numberOfConfSPS-Processes", nof_conf_sps_processes);
  j.start_array("n1PUCCH-AN-PersistentList");
  for (const auto& e1 : n1_pucch_an_persistent_list) {
    j.write_int(e1);
  }
  j.end_array();
  if (ext) {
    if (two_ant_port_activ_r10.is_present()) {
      j.write_fieldname("twoAntennaPortActivated-r10");
      two_ant_port_activ_r10->to_json(j);
    }
  }
  j.end_obj();
}

void sps_cfg_dl_c::setup_s_::two_ant_port_activ_r10_c_::set(types::options e)
{
  type_ = e;
}
void sps_cfg_dl_c::setup_s_::two_ant_port_activ_r10_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-PersistentListP1-r10");
      for (const auto& e1 : c.n1_pucch_an_persistent_list_p1_r10) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_c::setup_s_::two_ant_port_activ_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE sps_cfg_dl_c::setup_s_::two_ant_port_activ_r10_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_persistent_list_p1_r10, 1, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_c::setup_s_::two_ant_port_activ_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_dl_c::setup_s_::two_ant_port_activ_r10_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_persistent_list_p1_r10, bref, 1, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_c::setup_s_::two_ant_port_activ_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SRB-ToAddMod ::= SEQUENCE
SRSASN_CODE srb_to_add_mod_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rlc_cfg_present, 1));
  HANDLE_CODE(bref.pack(lc_ch_cfg_present, 1));

  HANDLE_CODE(pack_integer(bref, srb_id, (uint8_t)1u, (uint8_t)2u));
  if (rlc_cfg_present) {
    HANDLE_CODE(rlc_cfg.pack(bref));
  }
  if (lc_ch_cfg_present) {
    HANDLE_CODE(lc_ch_cfg.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= pdcp_ver_change_r15_present;
    group_flags[0] |= rlc_cfg_v1530.is_present();
    group_flags[0] |= rlc_bearer_cfg_dupl_r15.is_present();
    group_flags[0] |= srb_id_v1530_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pdcp_ver_change_r15_present, 1));
      HANDLE_CODE(bref.pack(rlc_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(rlc_bearer_cfg_dupl_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(srb_id_v1530_present, 1));
      if (rlc_cfg_v1530.is_present()) {
        HANDLE_CODE(rlc_cfg_v1530->pack(bref));
      }
      if (rlc_bearer_cfg_dupl_r15.is_present()) {
        HANDLE_CODE(rlc_bearer_cfg_dupl_r15->pack(bref));
      }
      if (srb_id_v1530_present) {
        HANDLE_CODE(pack_integer(bref, srb_id_v1530, (uint8_t)4u, (uint8_t)4u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srb_to_add_mod_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rlc_cfg_present, 1));
  HANDLE_CODE(bref.unpack(lc_ch_cfg_present, 1));

  HANDLE_CODE(unpack_integer(srb_id, bref, (uint8_t)1u, (uint8_t)2u));
  if (rlc_cfg_present) {
    HANDLE_CODE(rlc_cfg.unpack(bref));
  }
  if (lc_ch_cfg_present) {
    HANDLE_CODE(lc_ch_cfg.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(pdcp_ver_change_r15_present, 1));
      bool rlc_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(rlc_cfg_v1530_present, 1));
      rlc_cfg_v1530.set_present(rlc_cfg_v1530_present);
      bool rlc_bearer_cfg_dupl_r15_present;
      HANDLE_CODE(bref.unpack(rlc_bearer_cfg_dupl_r15_present, 1));
      rlc_bearer_cfg_dupl_r15.set_present(rlc_bearer_cfg_dupl_r15_present);
      HANDLE_CODE(bref.unpack(srb_id_v1530_present, 1));
      if (rlc_cfg_v1530.is_present()) {
        HANDLE_CODE(rlc_cfg_v1530->unpack(bref));
      }
      if (rlc_bearer_cfg_dupl_r15.is_present()) {
        HANDLE_CODE(rlc_bearer_cfg_dupl_r15->unpack(bref));
      }
      if (srb_id_v1530_present) {
        HANDLE_CODE(unpack_integer(srb_id_v1530, bref, (uint8_t)4u, (uint8_t)4u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void srb_to_add_mod_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("srb-Identity", srb_id);
  if (rlc_cfg_present) {
    j.write_fieldname("rlc-Config");
    rlc_cfg.to_json(j);
  }
  if (lc_ch_cfg_present) {
    j.write_fieldname("logicalChannelConfig");
    lc_ch_cfg.to_json(j);
  }
  if (ext) {
    if (pdcp_ver_change_r15_present) {
      j.write_str("pdcp-verChange-r15", "true");
    }
    if (rlc_cfg_v1530.is_present()) {
      j.write_fieldname("rlc-Config-v1530");
      rlc_cfg_v1530->to_json(j);
    }
    if (rlc_bearer_cfg_dupl_r15.is_present()) {
      j.write_fieldname("rlc-BearerConfigDupl-r15");
      rlc_bearer_cfg_dupl_r15->to_json(j);
    }
    if (srb_id_v1530_present) {
      j.write_int("srb-Identity-v1530", srb_id_v1530);
    }
  }
  j.end_obj();
}

void srb_to_add_mod_s::rlc_cfg_c_::set(types::options e)
{
  type_ = e;
}
void srb_to_add_mod_s::rlc_cfg_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_, "srb_to_add_mod_s::rlc_cfg_c_");
  }
  j.end_obj();
}
SRSASN_CODE srb_to_add_mod_s::rlc_cfg_c_::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_, "srb_to_add_mod_s::rlc_cfg_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srb_to_add_mod_s::rlc_cfg_c_::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_, "srb_to_add_mod_s::rlc_cfg_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void srb_to_add_mod_s::lc_ch_cfg_c_::set(types::options e)
{
  type_ = e;
}
void srb_to_add_mod_s::lc_ch_cfg_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_, "srb_to_add_mod_s::lc_ch_cfg_c_");
  }
  j.end_obj();
}
SRSASN_CODE srb_to_add_mod_s::lc_ch_cfg_c_::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_, "srb_to_add_mod_s::lc_ch_cfg_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srb_to_add_mod_s::lc_ch_cfg_c_::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_, "srb_to_add_mod_s::lc_ch_cfg_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SRS-TPC-PDCCH-Config-r14 ::= CHOICE
void srs_tpc_pdcch_cfg_r14_c::set(types::options e)
{
  type_ = e;
}
void srs_tpc_pdcch_cfg_r14_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("srs-TPC-RNTI-r14", c.srs_tpc_rnti_r14.to_string());
      j.write_int("startingBitOfFormat3B-r14", c.start_bit_of_format3_b_r14);
      j.write_int("fieldTypeFormat3B-r14", c.field_type_format3_b_r14);
      if (c.srs_cc_set_idxlist_r14_present) {
        j.start_array("srs-CC-SetIndexlist-r14");
        for (const auto& e1 : c.srs_cc_set_idxlist_r14) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_tpc_pdcch_cfg_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_tpc_pdcch_cfg_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.srs_cc_set_idxlist_r14_present, 1));
      HANDLE_CODE(c.srs_tpc_rnti_r14.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.start_bit_of_format3_b_r14, (uint8_t)0u, (uint8_t)31u));
      HANDLE_CODE(pack_integer(bref, c.field_type_format3_b_r14, (uint8_t)1u, (uint8_t)4u));
      if (c.srs_cc_set_idxlist_r14_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.srs_cc_set_idxlist_r14, 1, 4));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_tpc_pdcch_cfg_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_tpc_pdcch_cfg_r14_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.srs_cc_set_idxlist_r14_present, 1));
      HANDLE_CODE(c.srs_tpc_rnti_r14.unpack(bref));
      HANDLE_CODE(unpack_integer(c.start_bit_of_format3_b_r14, bref, (uint8_t)0u, (uint8_t)31u));
      HANDLE_CODE(unpack_integer(c.field_type_format3_b_r14, bref, (uint8_t)1u, (uint8_t)4u));
      if (c.srs_cc_set_idxlist_r14_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.srs_cc_set_idxlist_r14, bref, 1, 4));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_tpc_pdcch_cfg_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SchedulingRequestConfig ::= CHOICE
void sched_request_cfg_c::set(types::options e)
{
  type_ = e;
}
void sched_request_cfg_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_int("sr-PUCCH-ResourceIndex", c.sr_pucch_res_idx);
      j.write_int("sr-ConfigIndex", c.sr_cfg_idx);
      j.write_str("dsr-TransMax", c.dsr_trans_max.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_c");
  }
  j.end_obj();
}
SRSASN_CODE sched_request_cfg_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.sr_pucch_res_idx, (uint16_t)0u, (uint16_t)2047u));
      HANDLE_CODE(pack_integer(bref, c.sr_cfg_idx, (uint8_t)0u, (uint8_t)157u));
      HANDLE_CODE(c.dsr_trans_max.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sched_request_cfg_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.sr_pucch_res_idx, bref, (uint16_t)0u, (uint16_t)2047u));
      HANDLE_CODE(unpack_integer(c.sr_cfg_idx, bref, (uint8_t)0u, (uint8_t)157u));
      HANDLE_CODE(c.dsr_trans_max.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SchedulingRequestConfig-v1020 ::= SEQUENCE
SRSASN_CODE sched_request_cfg_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(sr_pucch_res_idx_p1_r10_present, 1));

  if (sr_pucch_res_idx_p1_r10_present) {
    HANDLE_CODE(pack_integer(bref, sr_pucch_res_idx_p1_r10, (uint16_t)0u, (uint16_t)2047u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sched_request_cfg_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(sr_pucch_res_idx_p1_r10_present, 1));

  if (sr_pucch_res_idx_p1_r10_present) {
    HANDLE_CODE(unpack_integer(sr_pucch_res_idx_p1_r10, bref, (uint16_t)0u, (uint16_t)2047u));
  }

  return SRSASN_SUCCESS;
}
void sched_request_cfg_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sr_pucch_res_idx_p1_r10_present) {
    j.write_int("sr-PUCCH-ResourceIndexP1-r10", sr_pucch_res_idx_p1_r10);
  }
  j.end_obj();
}

// SoundingRS-UL-ConfigDedicated ::= CHOICE
void srs_ul_cfg_ded_c::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_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("srs-Bandwidth", c.srs_bw.to_string());
      j.write_str("srs-HoppingBandwidth", c.srs_hop_bw.to_string());
      j.write_int("freqDomainPosition", c.freq_domain_position);
      j.write_bool("duration", c.dur);
      j.write_int("srs-ConfigIndex", c.srs_cfg_idx);
      j.write_int("transmissionComb", c.tx_comb);
      j.write_str("cyclicShift", c.cyclic_shift.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.srs_bw.pack(bref));
      HANDLE_CODE(c.srs_hop_bw.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.freq_domain_position, (uint8_t)0u, (uint8_t)23u));
      HANDLE_CODE(bref.pack(c.dur, 1));
      HANDLE_CODE(pack_integer(bref, c.srs_cfg_idx, (uint16_t)0u, (uint16_t)1023u));
      HANDLE_CODE(pack_integer(bref, c.tx_comb, (uint8_t)0u, (uint8_t)1u));
      HANDLE_CODE(c.cyclic_shift.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.srs_bw.unpack(bref));
      HANDLE_CODE(c.srs_hop_bw.unpack(bref));
      HANDLE_CODE(unpack_integer(c.freq_domain_position, bref, (uint8_t)0u, (uint8_t)23u));
      HANDLE_CODE(bref.unpack(c.dur, 1));
      HANDLE_CODE(unpack_integer(c.srs_cfg_idx, bref, (uint16_t)0u, (uint16_t)1023u));
      HANDLE_CODE(unpack_integer(c.tx_comb, bref, (uint8_t)0u, (uint8_t)1u));
      HANDLE_CODE(c.cyclic_shift.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SoundingRS-UL-ConfigDedicated-v1020 ::= SEQUENCE
SRSASN_CODE srs_ul_cfg_ded_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(srs_ant_port_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(srs_ant_port_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void srs_ul_cfg_ded_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("srs-AntennaPort-r10", srs_ant_port_r10.to_string());
  j.end_obj();
}

// SoundingRS-UL-ConfigDedicated-v1310 ::= CHOICE
void srs_ul_cfg_ded_v1310_c::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_v1310_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.tx_comb_v1310_present) {
        j.write_int("transmissionComb-v1310", c.tx_comb_v1310);
      }
      if (c.cyclic_shift_v1310_present) {
        j.write_str("cyclicShift-v1310", c.cyclic_shift_v1310.to_string());
      }
      if (c.tx_comb_num_r13_present) {
        j.write_str("transmissionCombNum-r13", c.tx_comb_num_r13.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_v1310_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_v1310_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.tx_comb_v1310_present, 1));
      HANDLE_CODE(bref.pack(c.cyclic_shift_v1310_present, 1));
      HANDLE_CODE(bref.pack(c.tx_comb_num_r13_present, 1));
      if (c.tx_comb_v1310_present) {
        HANDLE_CODE(pack_integer(bref, c.tx_comb_v1310, (uint8_t)2u, (uint8_t)3u));
      }
      if (c.cyclic_shift_v1310_present) {
        HANDLE_CODE(c.cyclic_shift_v1310.pack(bref));
      }
      if (c.tx_comb_num_r13_present) {
        HANDLE_CODE(c.tx_comb_num_r13.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_v1310_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_v1310_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.tx_comb_v1310_present, 1));
      HANDLE_CODE(bref.unpack(c.cyclic_shift_v1310_present, 1));
      HANDLE_CODE(bref.unpack(c.tx_comb_num_r13_present, 1));
      if (c.tx_comb_v1310_present) {
        HANDLE_CODE(unpack_integer(c.tx_comb_v1310, bref, (uint8_t)2u, (uint8_t)3u));
      }
      if (c.cyclic_shift_v1310_present) {
        HANDLE_CODE(c.cyclic_shift_v1310.unpack(bref));
      }
      if (c.tx_comb_num_r13_present) {
        HANDLE_CODE(c.tx_comb_num_r13.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_v1310_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SoundingRS-UL-ConfigDedicatedAperiodic-r10 ::= CHOICE
void srs_ul_cfg_ded_aperiodic_r10_c::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_aperiodic_r10_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_int("srs-ConfigIndexAp-r10", c.srs_cfg_idx_ap_r10);
      if (c.srs_cfg_ap_dci_format4_r10_present) {
        j.start_array("srs-ConfigApDCI-Format4-r10");
        for (const auto& e1 : c.srs_cfg_ap_dci_format4_r10) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.srs_activ_ap_r10_present) {
        j.write_fieldname("srs-ActivateAp-r10");
        c.srs_activ_ap_r10.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_r10_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_r10_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.srs_cfg_ap_dci_format4_r10_present, 1));
      HANDLE_CODE(bref.pack(c.srs_activ_ap_r10_present, 1));
      HANDLE_CODE(pack_integer(bref, c.srs_cfg_idx_ap_r10, (uint8_t)0u, (uint8_t)31u));
      if (c.srs_cfg_ap_dci_format4_r10_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.srs_cfg_ap_dci_format4_r10, 1, 3));
      }
      if (c.srs_activ_ap_r10_present) {
        HANDLE_CODE(c.srs_activ_ap_r10.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_r10_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_r10_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.srs_cfg_ap_dci_format4_r10_present, 1));
      HANDLE_CODE(bref.unpack(c.srs_activ_ap_r10_present, 1));
      HANDLE_CODE(unpack_integer(c.srs_cfg_idx_ap_r10, bref, (uint8_t)0u, (uint8_t)31u));
      if (c.srs_cfg_ap_dci_format4_r10_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.srs_cfg_ap_dci_format4_r10, bref, 1, 3));
      }
      if (c.srs_activ_ap_r10_present) {
        HANDLE_CODE(c.srs_activ_ap_r10.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_r10_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void srs_ul_cfg_ded_aperiodic_r10_c::setup_s_::srs_activ_ap_r10_c_::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_aperiodic_r10_c::setup_s_::srs_activ_ap_r10_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("srs-ConfigApDCI-Format0-r10");
      c.srs_cfg_ap_dci_format0_r10.to_json(j);
      j.write_fieldname("srs-ConfigApDCI-Format1a2b2c-r10");
      c.srs_cfg_ap_dci_format1a2b2c_r10.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_r10_c::setup_s_::srs_activ_ap_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_r10_c::setup_s_::srs_activ_ap_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(c.srs_cfg_ap_dci_format0_r10.pack(bref));
      HANDLE_CODE(c.srs_cfg_ap_dci_format1a2b2c_r10.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_r10_c::setup_s_::srs_activ_ap_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_r10_c::setup_s_::srs_activ_ap_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(c.srs_cfg_ap_dci_format0_r10.unpack(bref));
      HANDLE_CODE(c.srs_cfg_ap_dci_format1a2b2c_r10.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_r10_c::setup_s_::srs_activ_ap_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SoundingRS-UL-ConfigDedicatedAperiodic-v1310 ::= CHOICE
void srs_ul_cfg_ded_aperiodic_v1310_c::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_aperiodic_v1310_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.srs_cfg_ap_dci_format4_v1310_present) {
        j.start_array("srs-ConfigApDCI-Format4-v1310");
        for (const auto& e1 : c.srs_cfg_ap_dci_format4_v1310) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.srs_activ_ap_v1310_present) {
        j.write_fieldname("srs-ActivateAp-v1310");
        c.srs_activ_ap_v1310.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1310_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_v1310_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.srs_cfg_ap_dci_format4_v1310_present, 1));
      HANDLE_CODE(bref.pack(c.srs_activ_ap_v1310_present, 1));
      if (c.srs_cfg_ap_dci_format4_v1310_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.srs_cfg_ap_dci_format4_v1310, 1, 3));
      }
      if (c.srs_activ_ap_v1310_present) {
        HANDLE_CODE(c.srs_activ_ap_v1310.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1310_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_v1310_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.srs_cfg_ap_dci_format4_v1310_present, 1));
      HANDLE_CODE(bref.unpack(c.srs_activ_ap_v1310_present, 1));
      if (c.srs_cfg_ap_dci_format4_v1310_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.srs_cfg_ap_dci_format4_v1310, bref, 1, 3));
      }
      if (c.srs_activ_ap_v1310_present) {
        HANDLE_CODE(c.srs_activ_ap_v1310.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1310_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void srs_ul_cfg_ded_aperiodic_v1310_c::setup_s_::srs_activ_ap_v1310_c_::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_aperiodic_v1310_c::setup_s_::srs_activ_ap_v1310_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.srs_cfg_ap_dci_format0_v1310_present) {
        j.write_fieldname("srs-ConfigApDCI-Format0-v1310");
        c.srs_cfg_ap_dci_format0_v1310.to_json(j);
      }
      if (c.srs_cfg_ap_dci_format1a2b2c_v1310_present) {
        j.write_fieldname("srs-ConfigApDCI-Format1a2b2c-v1310");
        c.srs_cfg_ap_dci_format1a2b2c_v1310.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1310_c::setup_s_::srs_activ_ap_v1310_c_");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_v1310_c::setup_s_::srs_activ_ap_v1310_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.srs_cfg_ap_dci_format0_v1310_present, 1));
      HANDLE_CODE(bref.pack(c.srs_cfg_ap_dci_format1a2b2c_v1310_present, 1));
      if (c.srs_cfg_ap_dci_format0_v1310_present) {
        HANDLE_CODE(c.srs_cfg_ap_dci_format0_v1310.pack(bref));
      }
      if (c.srs_cfg_ap_dci_format1a2b2c_v1310_present) {
        HANDLE_CODE(c.srs_cfg_ap_dci_format1a2b2c_v1310.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1310_c::setup_s_::srs_activ_ap_v1310_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_v1310_c::setup_s_::srs_activ_ap_v1310_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.srs_cfg_ap_dci_format0_v1310_present, 1));
      HANDLE_CODE(bref.unpack(c.srs_cfg_ap_dci_format1a2b2c_v1310_present, 1));
      if (c.srs_cfg_ap_dci_format0_v1310_present) {
        HANDLE_CODE(c.srs_cfg_ap_dci_format0_v1310.unpack(bref));
      }
      if (c.srs_cfg_ap_dci_format1a2b2c_v1310_present) {
        HANDLE_CODE(c.srs_cfg_ap_dci_format1a2b2c_v1310.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1310_c::setup_s_::srs_activ_ap_v1310_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SoundingRS-UL-ConfigDedicatedAperiodicUpPTsExt-r13 ::= CHOICE
void srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_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("srs-UpPtsAdd-r13", c.srs_up_pts_add_r13.to_string());
      j.write_int("srs-ConfigIndexAp-r13", c.srs_cfg_idx_ap_r13);
      if (c.srs_cfg_ap_dci_format4_r13_present) {
        j.start_array("srs-ConfigApDCI-Format4-r13");
        for (const auto& e1 : c.srs_cfg_ap_dci_format4_r13) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.srs_activ_ap_r13_present) {
        j.write_fieldname("srs-ActivateAp-r13");
        c.srs_activ_ap_r13.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.srs_cfg_ap_dci_format4_r13_present, 1));
      HANDLE_CODE(bref.pack(c.srs_activ_ap_r13_present, 1));
      HANDLE_CODE(c.srs_up_pts_add_r13.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.srs_cfg_idx_ap_r13, (uint8_t)0u, (uint8_t)31u));
      if (c.srs_cfg_ap_dci_format4_r13_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.srs_cfg_ap_dci_format4_r13, 1, 3));
      }
      if (c.srs_activ_ap_r13_present) {
        HANDLE_CODE(c.srs_activ_ap_r13.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_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.srs_cfg_ap_dci_format4_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.srs_activ_ap_r13_present, 1));
      HANDLE_CODE(c.srs_up_pts_add_r13.unpack(bref));
      HANDLE_CODE(unpack_integer(c.srs_cfg_idx_ap_r13, bref, (uint8_t)0u, (uint8_t)31u));
      if (c.srs_cfg_ap_dci_format4_r13_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.srs_cfg_ap_dci_format4_r13, bref, 1, 3));
      }
      if (c.srs_activ_ap_r13_present) {
        HANDLE_CODE(c.srs_activ_ap_r13.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::setup_s_::srs_activ_ap_r13_c_::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::setup_s_::srs_activ_ap_r13_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("srs-ConfigApDCI-Format0-r13");
      c.srs_cfg_ap_dci_format0_r13.to_json(j);
      j.write_fieldname("srs-ConfigApDCI-Format1a2b2c-r13");
      c.srs_cfg_ap_dci_format1a2b2c_r13.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::setup_s_::srs_activ_ap_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::setup_s_::srs_activ_ap_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.srs_cfg_ap_dci_format0_r13.pack(bref));
      HANDLE_CODE(c.srs_cfg_ap_dci_format1a2b2c_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::setup_s_::srs_activ_ap_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::setup_s_::srs_activ_ap_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.srs_cfg_ap_dci_format0_r13.unpack(bref));
      HANDLE_CODE(c.srs_cfg_ap_dci_format1a2b2c_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_c::setup_s_::srs_activ_ap_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SoundingRS-UL-ConfigDedicatedUpPTsExt-r13 ::= CHOICE
void srs_ul_cfg_ded_up_pts_ext_r13_c::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_up_pts_ext_r13_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("srs-UpPtsAdd-r13", c.srs_up_pts_add_r13.to_string());
      j.write_str("srs-Bandwidth-r13", c.srs_bw_r13.to_string());
      j.write_str("srs-HoppingBandwidth-r13", c.srs_hop_bw_r13.to_string());
      j.write_int("freqDomainPosition-r13", c.freq_domain_position_r13);
      j.write_bool("duration-r13", c.dur_r13);
      j.write_int("srs-ConfigIndex-r13", c.srs_cfg_idx_r13);
      j.write_int("transmissionComb-r13", c.tx_comb_r13);
      j.write_str("cyclicShift-r13", c.cyclic_shift_r13.to_string());
      j.write_str("srs-AntennaPort-r13", c.srs_ant_port_r13.to_string());
      j.write_str("transmissionCombNum-r13", c.tx_comb_num_r13.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_up_pts_ext_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_up_pts_ext_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.srs_up_pts_add_r13.pack(bref));
      HANDLE_CODE(c.srs_bw_r13.pack(bref));
      HANDLE_CODE(c.srs_hop_bw_r13.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.freq_domain_position_r13, (uint8_t)0u, (uint8_t)23u));
      HANDLE_CODE(bref.pack(c.dur_r13, 1));
      HANDLE_CODE(pack_integer(bref, c.srs_cfg_idx_r13, (uint16_t)0u, (uint16_t)1023u));
      HANDLE_CODE(pack_integer(bref, c.tx_comb_r13, (uint8_t)0u, (uint8_t)3u));
      HANDLE_CODE(c.cyclic_shift_r13.pack(bref));
      HANDLE_CODE(c.srs_ant_port_r13.pack(bref));
      HANDLE_CODE(c.tx_comb_num_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_up_pts_ext_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_up_pts_ext_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.srs_up_pts_add_r13.unpack(bref));
      HANDLE_CODE(c.srs_bw_r13.unpack(bref));
      HANDLE_CODE(c.srs_hop_bw_r13.unpack(bref));
      HANDLE_CODE(unpack_integer(c.freq_domain_position_r13, bref, (uint8_t)0u, (uint8_t)23u));
      HANDLE_CODE(bref.unpack(c.dur_r13, 1));
      HANDLE_CODE(unpack_integer(c.srs_cfg_idx_r13, bref, (uint16_t)0u, (uint16_t)1023u));
      HANDLE_CODE(unpack_integer(c.tx_comb_r13, bref, (uint8_t)0u, (uint8_t)3u));
      HANDLE_CODE(c.cyclic_shift_r13.unpack(bref));
      HANDLE_CODE(c.srs_ant_port_r13.unpack(bref));
      HANDLE_CODE(c.tx_comb_num_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_up_pts_ext_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UplinkPowerControlDedicated ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_ded_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coef_present, 1));

  HANDLE_CODE(pack_integer(bref, p0_ue_pusch, (int8_t)-8, (int8_t)7));
  HANDLE_CODE(delta_mcs_enabled.pack(bref));
  HANDLE_CODE(bref.pack(accumulation_enabled, 1));
  HANDLE_CODE(pack_integer(bref, p0_ue_pucch, (int8_t)-8, (int8_t)7));
  HANDLE_CODE(pack_integer(bref, psrs_offset, (uint8_t)0u, (uint8_t)15u));
  if (filt_coef_present) {
    HANDLE_CODE(filt_coef.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coef_present, 1));

  HANDLE_CODE(unpack_integer(p0_ue_pusch, bref, (int8_t)-8, (int8_t)7));
  HANDLE_CODE(delta_mcs_enabled.unpack(bref));
  HANDLE_CODE(bref.unpack(accumulation_enabled, 1));
  HANDLE_CODE(unpack_integer(p0_ue_pucch, bref, (int8_t)-8, (int8_t)7));
  HANDLE_CODE(unpack_integer(psrs_offset, bref, (uint8_t)0u, (uint8_t)15u));
  if (filt_coef_present) {
    HANDLE_CODE(filt_coef.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_ded_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p0-UE-PUSCH", p0_ue_pusch);
  j.write_str("deltaMCS-Enabled", delta_mcs_enabled.to_string());
  j.write_bool("accumulationEnabled", accumulation_enabled);
  j.write_int("p0-UE-PUCCH", p0_ue_pucch);
  j.write_int("pSRS-Offset", psrs_offset);
  if (filt_coef_present) {
    j.write_str("filterCoefficient", filt_coef.to_string());
  }
  j.end_obj();
}

// UplinkPowerControlDedicated-v1020 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_ded_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(delta_tx_d_offset_list_pucch_r10_present, 1));
  HANDLE_CODE(bref.pack(psrs_offset_ap_r10_present, 1));

  if (delta_tx_d_offset_list_pucch_r10_present) {
    HANDLE_CODE(delta_tx_d_offset_list_pucch_r10.pack(bref));
  }
  if (psrs_offset_ap_r10_present) {
    HANDLE_CODE(pack_integer(bref, psrs_offset_ap_r10, (uint8_t)0u, (uint8_t)15u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(delta_tx_d_offset_list_pucch_r10_present, 1));
  HANDLE_CODE(bref.unpack(psrs_offset_ap_r10_present, 1));

  if (delta_tx_d_offset_list_pucch_r10_present) {
    HANDLE_CODE(delta_tx_d_offset_list_pucch_r10.unpack(bref));
  }
  if (psrs_offset_ap_r10_present) {
    HANDLE_CODE(unpack_integer(psrs_offset_ap_r10, bref, (uint8_t)0u, (uint8_t)15u));
  }

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_ded_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (delta_tx_d_offset_list_pucch_r10_present) {
    j.write_fieldname("deltaTxD-OffsetListPUCCH-r10");
    delta_tx_d_offset_list_pucch_r10.to_json(j);
  }
  if (psrs_offset_ap_r10_present) {
    j.write_int("pSRS-OffsetAp-r10", psrs_offset_ap_r10);
  }
  j.end_obj();
}

// UplinkPowerControlDedicated-v1130 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_ded_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(psrs_offset_v1130_present, 1));
  HANDLE_CODE(bref.pack(psrs_offset_ap_v1130_present, 1));
  HANDLE_CODE(bref.pack(delta_tx_d_offset_list_pucch_v1130_present, 1));

  if (psrs_offset_v1130_present) {
    HANDLE_CODE(pack_integer(bref, psrs_offset_v1130, (uint8_t)16u, (uint8_t)31u));
  }
  if (psrs_offset_ap_v1130_present) {
    HANDLE_CODE(pack_integer(bref, psrs_offset_ap_v1130, (uint8_t)16u, (uint8_t)31u));
  }
  if (delta_tx_d_offset_list_pucch_v1130_present) {
    HANDLE_CODE(delta_tx_d_offset_list_pucch_v1130.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(psrs_offset_v1130_present, 1));
  HANDLE_CODE(bref.unpack(psrs_offset_ap_v1130_present, 1));
  HANDLE_CODE(bref.unpack(delta_tx_d_offset_list_pucch_v1130_present, 1));

  if (psrs_offset_v1130_present) {
    HANDLE_CODE(unpack_integer(psrs_offset_v1130, bref, (uint8_t)16u, (uint8_t)31u));
  }
  if (psrs_offset_ap_v1130_present) {
    HANDLE_CODE(unpack_integer(psrs_offset_ap_v1130, bref, (uint8_t)16u, (uint8_t)31u));
  }
  if (delta_tx_d_offset_list_pucch_v1130_present) {
    HANDLE_CODE(delta_tx_d_offset_list_pucch_v1130.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_ded_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (psrs_offset_v1130_present) {
    j.write_int("pSRS-Offset-v1130", psrs_offset_v1130);
  }
  if (psrs_offset_ap_v1130_present) {
    j.write_int("pSRS-OffsetAp-v1130", psrs_offset_ap_v1130);
  }
  if (delta_tx_d_offset_list_pucch_v1130_present) {
    j.write_fieldname("deltaTxD-OffsetListPUCCH-v1130");
    delta_tx_d_offset_list_pucch_v1130.to_json(j);
  }
  j.end_obj();
}

// UplinkPowerControlDedicated-v1250 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_ded_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(set2_pwr_ctrl_param.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(set2_pwr_ctrl_param.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_ded_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("set2PowerControlParameter");
  set2_pwr_ctrl_param.to_json(j);
  j.end_obj();
}

void ul_pwr_ctrl_ded_v1250_s::set2_pwr_ctrl_param_c_::set(types::options e)
{
  type_ = e;
}
void ul_pwr_ctrl_ded_v1250_s::set2_pwr_ctrl_param_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("tpc-SubframeSet-r12", c.tpc_sf_set_r12.to_string());
      j.write_int("p0-NominalPUSCH-SubframeSet2-r12", c.p0_nominal_pusch_sf_set2_r12);
      j.write_str("alpha-SubframeSet2-r12", c.alpha_sf_set2_r12.to_string());
      j.write_int("p0-UE-PUSCH-SubframeSet2-r12", c.p0_ue_pusch_sf_set2_r12);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "ul_pwr_ctrl_ded_v1250_s::set2_pwr_ctrl_param_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_pwr_ctrl_ded_v1250_s::set2_pwr_ctrl_param_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.tpc_sf_set_r12.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.p0_nominal_pusch_sf_set2_r12, (int8_t)-126, (int8_t)24));
      HANDLE_CODE(c.alpha_sf_set2_r12.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.p0_ue_pusch_sf_set2_r12, (int8_t)-8, (int8_t)7));
      break;
    default:
      log_invalid_choice_id(type_, "ul_pwr_ctrl_ded_v1250_s::set2_pwr_ctrl_param_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_v1250_s::set2_pwr_ctrl_param_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.tpc_sf_set_r12.unpack(bref));
      HANDLE_CODE(unpack_integer(c.p0_nominal_pusch_sf_set2_r12, bref, (int8_t)-126, (int8_t)24));
      HANDLE_CODE(c.alpha_sf_set2_r12.unpack(bref));
      HANDLE_CODE(unpack_integer(c.p0_ue_pusch_sf_set2_r12, bref, (int8_t)-8, (int8_t)7));
      break;
    default:
      log_invalid_choice_id(type_, "ul_pwr_ctrl_ded_v1250_s::set2_pwr_ctrl_param_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UplinkPowerControlDedicated-v1530 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_ded_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(alpha_ue_r15_present, 1));
  HANDLE_CODE(bref.pack(p0_ue_pusch_r15_present, 1));

  if (alpha_ue_r15_present) {
    HANDLE_CODE(alpha_ue_r15.pack(bref));
  }
  if (p0_ue_pusch_r15_present) {
    HANDLE_CODE(pack_integer(bref, p0_ue_pusch_r15, (int8_t)-16, (int8_t)15));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(alpha_ue_r15_present, 1));
  HANDLE_CODE(bref.unpack(p0_ue_pusch_r15_present, 1));

  if (alpha_ue_r15_present) {
    HANDLE_CODE(alpha_ue_r15.unpack(bref));
  }
  if (p0_ue_pusch_r15_present) {
    HANDLE_CODE(unpack_integer(p0_ue_pusch_r15, bref, (int8_t)-16, (int8_t)15));
  }

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_ded_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (alpha_ue_r15_present) {
    j.write_str("alpha-UE-r15", alpha_ue_r15.to_string());
  }
  if (p0_ue_pusch_r15_present) {
    j.write_int("p0-UE-PUSCH-r15", p0_ue_pusch_r15);
  }
  j.end_obj();
}

// CarrierFreqCDMA2000 ::= SEQUENCE
SRSASN_CODE carrier_freq_cdma2000_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(band_class.pack(bref));
  HANDLE_CODE(pack_integer(bref, arfcn, (uint16_t)0u, (uint16_t)2047u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freq_cdma2000_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(band_class.unpack(bref));
  HANDLE_CODE(unpack_integer(arfcn, bref, (uint16_t)0u, (uint16_t)2047u));

  return SRSASN_SUCCESS;
}
void carrier_freq_cdma2000_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("bandClass", band_class.to_string());
  j.write_int("arfcn", arfcn);
  j.end_obj();
}

// FreqPriorityEUTRA-v9e0 ::= SEQUENCE
SRSASN_CODE freq_prio_eutra_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(carrier_freq_v9e0_present, 1));

  if (carrier_freq_v9e0_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_v9e0, (uint32_t)65536u, (uint32_t)262143u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE freq_prio_eutra_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(carrier_freq_v9e0_present, 1));

  if (carrier_freq_v9e0_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u));
  }

  return SRSASN_SUCCESS;
}
void freq_prio_eutra_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (carrier_freq_v9e0_present) {
    j.write_int("carrierFreq-v9e0", carrier_freq_v9e0);
  }
  j.end_obj();
}

// MAC-MainConfig ::= SEQUENCE
SRSASN_CODE mac_main_cfg_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ul_sch_cfg_present, 1));
  HANDLE_CODE(bref.pack(drx_cfg_present, 1));
  HANDLE_CODE(bref.pack(phr_cfg_present, 1));

  if (ul_sch_cfg_present) {
    HANDLE_CODE(bref.pack(ul_sch_cfg.max_harq_tx_present, 1));
    HANDLE_CODE(bref.pack(ul_sch_cfg.periodic_bsr_timer_present, 1));
    if (ul_sch_cfg.max_harq_tx_present) {
      HANDLE_CODE(ul_sch_cfg.max_harq_tx.pack(bref));
    }
    if (ul_sch_cfg.periodic_bsr_timer_present) {
      HANDLE_CODE(ul_sch_cfg.periodic_bsr_timer.pack(bref));
    }
    HANDLE_CODE(ul_sch_cfg.retx_bsr_timer.pack(bref));
    HANDLE_CODE(bref.pack(ul_sch_cfg.tti_bundling, 1));
  }
  if (drx_cfg_present) {
    HANDLE_CODE(drx_cfg.pack(bref));
  }
  HANDLE_CODE(time_align_timer_ded.pack(bref));
  if (phr_cfg_present) {
    HANDLE_CODE(phr_cfg.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= sr_prohibit_timer_r9_present;
    group_flags[1] |= mac_main_cfg_v1020.is_present();
    group_flags[2] |= stag_to_release_list_r11.is_present();
    group_flags[2] |= stag_to_add_mod_list_r11.is_present();
    group_flags[2] |= drx_cfg_v1130.is_present();
    group_flags[3] |= e_harq_pattern_r12_present;
    group_flags[3] |= dual_connect_phr.is_present();
    group_flags[3] |= lc_ch_sr_cfg_r12.is_present();
    group_flags[4] |= drx_cfg_v1310.is_present();
    group_flags[4] |= extended_phr2_r13_present;
    group_flags[4] |= edrx_cfg_cycle_start_offset_r13.is_present();
    group_flags[5] |= drx_cfg_r13.is_present();
    group_flags[6] |= skip_ul_tx_r14.is_present();
    group_flags[6] |= data_inactivity_timer_cfg_r14.is_present();
    group_flags[7] |= rai_activation_r14_present;
    group_flags[8] |= short_tti_and_spt_r15.is_present();
    group_flags[8] |= mpdcch_ul_harq_ack_feedback_cfg_r15_present;
    group_flags[8] |= dormant_state_timers_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sr_prohibit_timer_r9_present, 1));
      if (sr_prohibit_timer_r9_present) {
        HANDLE_CODE(pack_integer(bref, sr_prohibit_timer_r9, (uint8_t)0u, (uint8_t)7u));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mac_main_cfg_v1020.is_present(), 1));
      if (mac_main_cfg_v1020.is_present()) {
        HANDLE_CODE(bref.pack(mac_main_cfg_v1020->scell_deactivation_timer_r10_present, 1));
        HANDLE_CODE(bref.pack(mac_main_cfg_v1020->extended_bsr_sizes_r10_present, 1));
        HANDLE_CODE(bref.pack(mac_main_cfg_v1020->extended_phr_r10_present, 1));
        if (mac_main_cfg_v1020->scell_deactivation_timer_r10_present) {
          HANDLE_CODE(mac_main_cfg_v1020->scell_deactivation_timer_r10.pack(bref));
        }
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(stag_to_release_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(stag_to_add_mod_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(drx_cfg_v1130.is_present(), 1));
      if (stag_to_release_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *stag_to_release_list_r11, 1, 3, integer_packer<uint8_t>(1, 3)));
      }
      if (stag_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *stag_to_add_mod_list_r11, 1, 3));
      }
      if (drx_cfg_v1130.is_present()) {
        HANDLE_CODE(drx_cfg_v1130->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(e_harq_pattern_r12_present, 1));
      HANDLE_CODE(bref.pack(dual_connect_phr.is_present(), 1));
      HANDLE_CODE(bref.pack(lc_ch_sr_cfg_r12.is_present(), 1));
      if (e_harq_pattern_r12_present) {
        HANDLE_CODE(bref.pack(e_harq_pattern_r12, 1));
      }
      if (dual_connect_phr.is_present()) {
        HANDLE_CODE(dual_connect_phr->pack(bref));
      }
      if (lc_ch_sr_cfg_r12.is_present()) {
        HANDLE_CODE(lc_ch_sr_cfg_r12->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(drx_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(extended_phr2_r13_present, 1));
      HANDLE_CODE(bref.pack(edrx_cfg_cycle_start_offset_r13.is_present(), 1));
      if (drx_cfg_v1310.is_present()) {
        HANDLE_CODE(drx_cfg_v1310->pack(bref));
      }
      if (extended_phr2_r13_present) {
        HANDLE_CODE(bref.pack(extended_phr2_r13, 1));
      }
      if (edrx_cfg_cycle_start_offset_r13.is_present()) {
        HANDLE_CODE(edrx_cfg_cycle_start_offset_r13->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(drx_cfg_r13.is_present(), 1));
      if (drx_cfg_r13.is_present()) {
        HANDLE_CODE(drx_cfg_r13->pack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(skip_ul_tx_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(data_inactivity_timer_cfg_r14.is_present(), 1));
      if (skip_ul_tx_r14.is_present()) {
        HANDLE_CODE(skip_ul_tx_r14->pack(bref));
      }
      if (data_inactivity_timer_cfg_r14.is_present()) {
        HANDLE_CODE(data_inactivity_timer_cfg_r14->pack(bref));
      }
    }
    if (group_flags[7]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rai_activation_r14_present, 1));
    }
    if (group_flags[8]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(short_tti_and_spt_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(mpdcch_ul_harq_ack_feedback_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(dormant_state_timers_r15.is_present(), 1));
      if (short_tti_and_spt_r15.is_present()) {
        HANDLE_CODE(short_tti_and_spt_r15->pack(bref));
      }
      if (mpdcch_ul_harq_ack_feedback_cfg_r15_present) {
        HANDLE_CODE(bref.pack(mpdcch_ul_harq_ack_feedback_cfg_r15, 1));
      }
      if (dormant_state_timers_r15.is_present()) {
        HANDLE_CODE(dormant_state_timers_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ul_sch_cfg_present, 1));
  HANDLE_CODE(bref.unpack(drx_cfg_present, 1));
  HANDLE_CODE(bref.unpack(phr_cfg_present, 1));

  if (ul_sch_cfg_present) {
    HANDLE_CODE(bref.unpack(ul_sch_cfg.max_harq_tx_present, 1));
    HANDLE_CODE(bref.unpack(ul_sch_cfg.periodic_bsr_timer_present, 1));
    if (ul_sch_cfg.max_harq_tx_present) {
      HANDLE_CODE(ul_sch_cfg.max_harq_tx.unpack(bref));
    }
    if (ul_sch_cfg.periodic_bsr_timer_present) {
      HANDLE_CODE(ul_sch_cfg.periodic_bsr_timer.unpack(bref));
    }
    HANDLE_CODE(ul_sch_cfg.retx_bsr_timer.unpack(bref));
    HANDLE_CODE(bref.unpack(ul_sch_cfg.tti_bundling, 1));
  }
  if (drx_cfg_present) {
    HANDLE_CODE(drx_cfg.unpack(bref));
  }
  HANDLE_CODE(time_align_timer_ded.unpack(bref));
  if (phr_cfg_present) {
    HANDLE_CODE(phr_cfg.unpack(bref));
  }

  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(sr_prohibit_timer_r9_present, 1));
      if (sr_prohibit_timer_r9_present) {
        HANDLE_CODE(unpack_integer(sr_prohibit_timer_r9, bref, (uint8_t)0u, (uint8_t)7u));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool mac_main_cfg_v1020_present;
      HANDLE_CODE(bref.unpack(mac_main_cfg_v1020_present, 1));
      mac_main_cfg_v1020.set_present(mac_main_cfg_v1020_present);
      if (mac_main_cfg_v1020.is_present()) {
        HANDLE_CODE(bref.unpack(mac_main_cfg_v1020->scell_deactivation_timer_r10_present, 1));
        HANDLE_CODE(bref.unpack(mac_main_cfg_v1020->extended_bsr_sizes_r10_present, 1));
        HANDLE_CODE(bref.unpack(mac_main_cfg_v1020->extended_phr_r10_present, 1));
        if (mac_main_cfg_v1020->scell_deactivation_timer_r10_present) {
          HANDLE_CODE(mac_main_cfg_v1020->scell_deactivation_timer_r10.unpack(bref));
        }
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool stag_to_release_list_r11_present;
      HANDLE_CODE(bref.unpack(stag_to_release_list_r11_present, 1));
      stag_to_release_list_r11.set_present(stag_to_release_list_r11_present);
      bool stag_to_add_mod_list_r11_present;
      HANDLE_CODE(bref.unpack(stag_to_add_mod_list_r11_present, 1));
      stag_to_add_mod_list_r11.set_present(stag_to_add_mod_list_r11_present);
      bool drx_cfg_v1130_present;
      HANDLE_CODE(bref.unpack(drx_cfg_v1130_present, 1));
      drx_cfg_v1130.set_present(drx_cfg_v1130_present);
      if (stag_to_release_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*stag_to_release_list_r11, bref, 1, 3, integer_packer<uint8_t>(1, 3)));
      }
      if (stag_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*stag_to_add_mod_list_r11, bref, 1, 3));
      }
      if (drx_cfg_v1130.is_present()) {
        HANDLE_CODE(drx_cfg_v1130->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(e_harq_pattern_r12_present, 1));
      bool dual_connect_phr_present;
      HANDLE_CODE(bref.unpack(dual_connect_phr_present, 1));
      dual_connect_phr.set_present(dual_connect_phr_present);
      bool lc_ch_sr_cfg_r12_present;
      HANDLE_CODE(bref.unpack(lc_ch_sr_cfg_r12_present, 1));
      lc_ch_sr_cfg_r12.set_present(lc_ch_sr_cfg_r12_present);
      if (e_harq_pattern_r12_present) {
        HANDLE_CODE(bref.unpack(e_harq_pattern_r12, 1));
      }
      if (dual_connect_phr.is_present()) {
        HANDLE_CODE(dual_connect_phr->unpack(bref));
      }
      if (lc_ch_sr_cfg_r12.is_present()) {
        HANDLE_CODE(lc_ch_sr_cfg_r12->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool drx_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(drx_cfg_v1310_present, 1));
      drx_cfg_v1310.set_present(drx_cfg_v1310_present);
      HANDLE_CODE(bref.unpack(extended_phr2_r13_present, 1));
      bool edrx_cfg_cycle_start_offset_r13_present;
      HANDLE_CODE(bref.unpack(edrx_cfg_cycle_start_offset_r13_present, 1));
      edrx_cfg_cycle_start_offset_r13.set_present(edrx_cfg_cycle_start_offset_r13_present);
      if (drx_cfg_v1310.is_present()) {
        HANDLE_CODE(drx_cfg_v1310->unpack(bref));
      }
      if (extended_phr2_r13_present) {
        HANDLE_CODE(bref.unpack(extended_phr2_r13, 1));
      }
      if (edrx_cfg_cycle_start_offset_r13.is_present()) {
        HANDLE_CODE(edrx_cfg_cycle_start_offset_r13->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool drx_cfg_r13_present;
      HANDLE_CODE(bref.unpack(drx_cfg_r13_present, 1));
      drx_cfg_r13.set_present(drx_cfg_r13_present);
      if (drx_cfg_r13.is_present()) {
        HANDLE_CODE(drx_cfg_r13->unpack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool skip_ul_tx_r14_present;
      HANDLE_CODE(bref.unpack(skip_ul_tx_r14_present, 1));
      skip_ul_tx_r14.set_present(skip_ul_tx_r14_present);
      bool data_inactivity_timer_cfg_r14_present;
      HANDLE_CODE(bref.unpack(data_inactivity_timer_cfg_r14_present, 1));
      data_inactivity_timer_cfg_r14.set_present(data_inactivity_timer_cfg_r14_present);
      if (skip_ul_tx_r14.is_present()) {
        HANDLE_CODE(skip_ul_tx_r14->unpack(bref));
      }
      if (data_inactivity_timer_cfg_r14.is_present()) {
        HANDLE_CODE(data_inactivity_timer_cfg_r14->unpack(bref));
      }
    }
    if (group_flags[7]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(rai_activation_r14_present, 1));
    }
    if (group_flags[8]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool short_tti_and_spt_r15_present;
      HANDLE_CODE(bref.unpack(short_tti_and_spt_r15_present, 1));
      short_tti_and_spt_r15.set_present(short_tti_and_spt_r15_present);
      HANDLE_CODE(bref.unpack(mpdcch_ul_harq_ack_feedback_cfg_r15_present, 1));
      bool dormant_state_timers_r15_present;
      HANDLE_CODE(bref.unpack(dormant_state_timers_r15_present, 1));
      dormant_state_timers_r15.set_present(dormant_state_timers_r15_present);
      if (short_tti_and_spt_r15.is_present()) {
        HANDLE_CODE(short_tti_and_spt_r15->unpack(bref));
      }
      if (mpdcch_ul_harq_ack_feedback_cfg_r15_present) {
        HANDLE_CODE(bref.unpack(mpdcch_ul_harq_ack_feedback_cfg_r15, 1));
      }
      if (dormant_state_timers_r15.is_present()) {
        HANDLE_CODE(dormant_state_timers_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void mac_main_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ul_sch_cfg_present) {
    j.write_fieldname("ul-SCH-Config");
    j.start_obj();
    if (ul_sch_cfg.max_harq_tx_present) {
      j.write_str("maxHARQ-Tx", ul_sch_cfg.max_harq_tx.to_string());
    }
    if (ul_sch_cfg.periodic_bsr_timer_present) {
      j.write_str("periodicBSR-Timer", ul_sch_cfg.periodic_bsr_timer.to_string());
    }
    j.write_str("retxBSR-Timer", ul_sch_cfg.retx_bsr_timer.to_string());
    j.write_bool("ttiBundling", ul_sch_cfg.tti_bundling);
    j.end_obj();
  }
  if (drx_cfg_present) {
    j.write_fieldname("drx-Config");
    drx_cfg.to_json(j);
  }
  j.write_str("timeAlignmentTimerDedicated", time_align_timer_ded.to_string());
  if (phr_cfg_present) {
    j.write_fieldname("phr-Config");
    phr_cfg.to_json(j);
  }
  if (ext) {
    if (sr_prohibit_timer_r9_present) {
      j.write_int("sr-ProhibitTimer-r9", sr_prohibit_timer_r9);
    }
    if (mac_main_cfg_v1020.is_present()) {
      j.write_fieldname("mac-MainConfig-v1020");
      j.start_obj();
      if (mac_main_cfg_v1020->scell_deactivation_timer_r10_present) {
        j.write_str("sCellDeactivationTimer-r10", mac_main_cfg_v1020->scell_deactivation_timer_r10.to_string());
      }
      if (mac_main_cfg_v1020->extended_bsr_sizes_r10_present) {
        j.write_str("extendedBSR-Sizes-r10", "setup");
      }
      if (mac_main_cfg_v1020->extended_phr_r10_present) {
        j.write_str("extendedPHR-r10", "setup");
      }
      j.end_obj();
    }
    if (stag_to_release_list_r11.is_present()) {
      j.start_array("stag-ToReleaseList-r11");
      for (const auto& e1 : *stag_to_release_list_r11) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (stag_to_add_mod_list_r11.is_present()) {
      j.start_array("stag-ToAddModList-r11");
      for (const auto& e1 : *stag_to_add_mod_list_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (drx_cfg_v1130.is_present()) {
      j.write_fieldname("drx-Config-v1130");
      drx_cfg_v1130->to_json(j);
    }
    if (e_harq_pattern_r12_present) {
      j.write_bool("e-HARQ-Pattern-r12", e_harq_pattern_r12);
    }
    if (dual_connect_phr.is_present()) {
      j.write_fieldname("dualConnectivityPHR");
      dual_connect_phr->to_json(j);
    }
    if (lc_ch_sr_cfg_r12.is_present()) {
      j.write_fieldname("logicalChannelSR-Config-r12");
      lc_ch_sr_cfg_r12->to_json(j);
    }
    if (drx_cfg_v1310.is_present()) {
      j.write_fieldname("drx-Config-v1310");
      drx_cfg_v1310->to_json(j);
    }
    if (extended_phr2_r13_present) {
      j.write_bool("extendedPHR2-r13", extended_phr2_r13);
    }
    if (edrx_cfg_cycle_start_offset_r13.is_present()) {
      j.write_fieldname("eDRX-Config-CycleStartOffset-r13");
      edrx_cfg_cycle_start_offset_r13->to_json(j);
    }
    if (drx_cfg_r13.is_present()) {
      j.write_fieldname("drx-Config-r13");
      drx_cfg_r13->to_json(j);
    }
    if (skip_ul_tx_r14.is_present()) {
      j.write_fieldname("skipUplinkTx-r14");
      skip_ul_tx_r14->to_json(j);
    }
    if (data_inactivity_timer_cfg_r14.is_present()) {
      j.write_fieldname("dataInactivityTimerConfig-r14");
      data_inactivity_timer_cfg_r14->to_json(j);
    }
    if (rai_activation_r14_present) {
      j.write_str("rai-Activation-r14", "true");
    }
    if (short_tti_and_spt_r15.is_present()) {
      j.write_fieldname("shortTTI-AndSPT-r15");
      short_tti_and_spt_r15->to_json(j);
    }
    if (mpdcch_ul_harq_ack_feedback_cfg_r15_present) {
      j.write_bool("mpdcch-UL-HARQ-ACK-FeedbackConfig-r15", mpdcch_ul_harq_ack_feedback_cfg_r15);
    }
    if (dormant_state_timers_r15.is_present()) {
      j.write_fieldname("dormantStateTimers-r15");
      dormant_state_timers_r15->to_json(j);
    }
  }
  j.end_obj();
}

void mac_main_cfg_s::phr_cfg_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::phr_cfg_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("periodicPHR-Timer", c.periodic_phr_timer.to_string());
      j.write_str("prohibitPHR-Timer", c.prohibit_phr_timer.to_string());
      j.write_str("dl-PathlossChange", c.dl_pathloss_change.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::phr_cfg_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::phr_cfg_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.periodic_phr_timer.pack(bref));
      HANDLE_CODE(c.prohibit_phr_timer.pack(bref));
      HANDLE_CODE(c.dl_pathloss_change.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::phr_cfg_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::phr_cfg_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.periodic_phr_timer.unpack(bref));
      HANDLE_CODE(c.prohibit_phr_timer.unpack(bref));
      HANDLE_CODE(c.dl_pathloss_change.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::phr_cfg_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::dual_connect_phr_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::dual_connect_phr_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("phr-ModeOtherCG-r12", c.phr_mode_other_cg_r12.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::dual_connect_phr_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::dual_connect_phr_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.phr_mode_other_cg_r12.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::dual_connect_phr_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::dual_connect_phr_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.phr_mode_other_cg_r12.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::dual_connect_phr_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::lc_ch_sr_cfg_r12_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::lc_ch_sr_cfg_r12_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("logicalChannelSR-ProhibitTimer-r12", c.lc_ch_sr_prohibit_timer_r12.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::lc_ch_sr_cfg_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::lc_ch_sr_cfg_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.lc_ch_sr_prohibit_timer_r12.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::lc_ch_sr_cfg_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::lc_ch_sr_cfg_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.lc_ch_sr_prohibit_timer_r12.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::lc_ch_sr_cfg_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_::destroy_() {}
void mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_::setup_c_(
    const mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf5120:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf10240:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_");
  }
}
mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_&
mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_::
operator=(const mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf5120:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf10240:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_");
  }

  return *this;
}
void mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf5120:
      j.write_int("sf5120", c.get<uint8_t>());
      break;
    case types::sf10240:
      j.write_int("sf10240", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf5120:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)1u));
      break;
    case types::sf10240:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)3u));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf5120:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)1u));
      break;
    case types::sf10240:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)3u));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::edrx_cfg_cycle_start_offset_r13_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::drx_cfg_r13_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::drx_cfg_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::drx_cfg_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::drx_cfg_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::drx_cfg_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::drx_cfg_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::drx_cfg_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::skip_ul_tx_r14_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::skip_ul_tx_r14_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.skip_ul_tx_sps_r14_present) {
        j.write_str("skipUplinkTxSPS-r14", "true");
      }
      if (c.skip_ul_tx_dynamic_r14_present) {
        j.write_str("skipUplinkTxDynamic-r14", "true");
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::skip_ul_tx_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::skip_ul_tx_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.skip_ul_tx_sps_r14_present, 1));
      HANDLE_CODE(bref.pack(c.skip_ul_tx_dynamic_r14_present, 1));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::skip_ul_tx_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::skip_ul_tx_r14_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.skip_ul_tx_sps_r14_present, 1));
      HANDLE_CODE(bref.unpack(c.skip_ul_tx_dynamic_r14_present, 1));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::skip_ul_tx_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::data_inactivity_timer_cfg_r14_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::data_inactivity_timer_cfg_r14_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("dataInactivityTimer-r14", c.data_inactivity_timer_r14.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::data_inactivity_timer_cfg_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::data_inactivity_timer_cfg_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.data_inactivity_timer_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::data_inactivity_timer_cfg_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::data_inactivity_timer_cfg_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.data_inactivity_timer_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::data_inactivity_timer_cfg_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::short_tti_and_spt_r15_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::short_tti_and_spt_r15_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.drx_cfg_r15_present) {
        j.write_fieldname("drx-Config-r15");
        c.drx_cfg_r15.to_json(j);
      }
      if (c.periodic_bsr_timer_r15_present) {
        j.write_str("periodicBSR-Timer-r15", c.periodic_bsr_timer_r15.to_string());
      }
      if (c.proc_timeline_r15_present) {
        j.write_str("proc-Timeline-r15", c.proc_timeline_r15.to_string());
      }
      if (c.ssr_prohibit_timer_r15_present) {
        j.write_int("ssr-ProhibitTimer-r15", c.ssr_prohibit_timer_r15);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::short_tti_and_spt_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::short_tti_and_spt_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.drx_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.periodic_bsr_timer_r15_present, 1));
      HANDLE_CODE(bref.pack(c.proc_timeline_r15_present, 1));
      HANDLE_CODE(bref.pack(c.ssr_prohibit_timer_r15_present, 1));
      if (c.drx_cfg_r15_present) {
        HANDLE_CODE(c.drx_cfg_r15.pack(bref));
      }
      if (c.periodic_bsr_timer_r15_present) {
        HANDLE_CODE(c.periodic_bsr_timer_r15.pack(bref));
      }
      if (c.proc_timeline_r15_present) {
        HANDLE_CODE(c.proc_timeline_r15.pack(bref));
      }
      if (c.ssr_prohibit_timer_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.ssr_prohibit_timer_r15, (uint8_t)0u, (uint8_t)7u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::short_tti_and_spt_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::short_tti_and_spt_r15_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.drx_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.periodic_bsr_timer_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.proc_timeline_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.ssr_prohibit_timer_r15_present, 1));
      if (c.drx_cfg_r15_present) {
        HANDLE_CODE(c.drx_cfg_r15.unpack(bref));
      }
      if (c.periodic_bsr_timer_r15_present) {
        HANDLE_CODE(c.periodic_bsr_timer_r15.unpack(bref));
      }
      if (c.proc_timeline_r15_present) {
        HANDLE_CODE(c.proc_timeline_r15.unpack(bref));
      }
      if (c.ssr_prohibit_timer_r15_present) {
        HANDLE_CODE(unpack_integer(c.ssr_prohibit_timer_r15, bref, (uint8_t)0u, (uint8_t)7u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::short_tti_and_spt_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mac_main_cfg_s::dormant_state_timers_r15_c_::set(types::options e)
{
  type_ = e;
}
void mac_main_cfg_s::dormant_state_timers_r15_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.scell_hibernation_timer_r15_present) {
        j.write_str("sCellHibernationTimer-r15", c.scell_hibernation_timer_r15.to_string());
      }
      if (c.dormant_scell_deactivation_timer_r15_present) {
        j.write_str("dormantSCellDeactivationTimer-r15", c.dormant_scell_deactivation_timer_r15.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::dormant_state_timers_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE mac_main_cfg_s::dormant_state_timers_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.scell_hibernation_timer_r15_present, 1));
      HANDLE_CODE(bref.pack(c.dormant_scell_deactivation_timer_r15_present, 1));
      if (c.scell_hibernation_timer_r15_present) {
        HANDLE_CODE(c.scell_hibernation_timer_r15.pack(bref));
      }
      if (c.dormant_scell_deactivation_timer_r15_present) {
        HANDLE_CODE(c.dormant_scell_deactivation_timer_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::dormant_state_timers_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_s::dormant_state_timers_r15_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.scell_hibernation_timer_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.dormant_scell_deactivation_timer_r15_present, 1));
      if (c.scell_hibernation_timer_r15_present) {
        HANDLE_CODE(c.scell_hibernation_timer_r15.unpack(bref));
      }
      if (c.dormant_scell_deactivation_timer_r15_present) {
        HANDLE_CODE(c.dormant_scell_deactivation_timer_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "mac_main_cfg_s::dormant_state_timers_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasSubframePatternPCell-r10 ::= CHOICE
void meas_sf_pattern_pcell_r10_c::set(types::options e)
{
  type_ = e;
}
void meas_sf_pattern_pcell_r10_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_pcell_r10_c");
  }
  j.end_obj();
}
SRSASN_CODE meas_sf_pattern_pcell_r10_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_pcell_r10_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_sf_pattern_pcell_r10_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_pcell_r10_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// NAICS-AssistanceInfo-r12 ::= CHOICE
void naics_assist_info_r12_c::set(types::options e)
{
  type_ = e;
}
void naics_assist_info_r12_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.neigh_cells_to_release_list_r12_present) {
        j.start_array("neighCellsToReleaseList-r12");
        for (const auto& e1 : c.neigh_cells_to_release_list_r12) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.neigh_cells_to_add_mod_list_r12_present) {
        j.start_array("neighCellsToAddModList-r12");
        for (const auto& e1 : c.neigh_cells_to_add_mod_list_r12) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.serv_cellp_a_r12_present) {
        j.write_str("servCellp-a-r12", c.serv_cellp_a_r12.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "naics_assist_info_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE naics_assist_info_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.neigh_cells_to_release_list_r12_present, 1));
      HANDLE_CODE(bref.pack(c.neigh_cells_to_add_mod_list_r12_present, 1));
      HANDLE_CODE(bref.pack(c.serv_cellp_a_r12_present, 1));
      if (c.neigh_cells_to_release_list_r12_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.neigh_cells_to_release_list_r12, 1, 8, integer_packer<uint16_t>(0, 503)));
      }
      if (c.neigh_cells_to_add_mod_list_r12_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.neigh_cells_to_add_mod_list_r12, 1, 8));
      }
      if (c.serv_cellp_a_r12_present) {
        HANDLE_CODE(c.serv_cellp_a_r12.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "naics_assist_info_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE naics_assist_info_r12_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.neigh_cells_to_release_list_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.neigh_cells_to_add_mod_list_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.serv_cellp_a_r12_present, 1));
      if (c.neigh_cells_to_release_list_r12_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.neigh_cells_to_release_list_r12, bref, 1, 8, integer_packer<uint16_t>(0, 503)));
      }
      if (c.neigh_cells_to_add_mod_list_r12_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.neigh_cells_to_add_mod_list_r12, bref, 1, 8));
      }
      if (c.serv_cellp_a_r12_present) {
        HANDLE_CODE(c.serv_cellp_a_r12.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "naics_assist_info_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// NeighCellsCRS-Info-r11 ::= CHOICE
void neigh_cells_crs_info_r11_c::set(types::options e)
{
  type_ = e;
}
void neigh_cells_crs_info_r11_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r11_c");
  }
  j.end_obj();
}
SRSASN_CODE neigh_cells_crs_info_r11_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, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r11_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cells_crs_info_r11_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, bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r11_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// NeighCellsCRS-Info-r13 ::= CHOICE
void neigh_cells_crs_info_r13_c::set(types::options e)
{
  type_ = e;
}
void neigh_cells_crs_info_r13_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE neigh_cells_crs_info_r13_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, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cells_crs_info_r13_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, bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// NeighCellsCRS-Info-r15 ::= CHOICE
void neigh_cells_crs_info_r15_c::set(types::options e)
{
  type_ = e;
}
void neigh_cells_crs_info_r15_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE neigh_cells_crs_info_r15_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, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cells_crs_info_r15_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, bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "neigh_cells_crs_info_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PhysicalConfigDedicated ::= SEQUENCE
SRSASN_CODE phys_cfg_ded_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(pdsch_cfg_ded_present, 1));
  HANDLE_CODE(bref.pack(pucch_cfg_ded_present, 1));
  HANDLE_CODE(bref.pack(pusch_cfg_ded_present, 1));
  HANDLE_CODE(bref.pack(ul_pwr_ctrl_ded_present, 1));
  HANDLE_CODE(bref.pack(tpc_pdcch_cfg_pucch_present, 1));
  HANDLE_CODE(bref.pack(tpc_pdcch_cfg_pusch_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_cfg_present, 1));
  HANDLE_CODE(bref.pack(srs_ul_cfg_ded_present, 1));
  HANDLE_CODE(bref.pack(ant_info_present, 1));
  HANDLE_CODE(bref.pack(sched_request_cfg_present, 1));

  if (pdsch_cfg_ded_present) {
    HANDLE_CODE(pdsch_cfg_ded.pack(bref));
  }
  if (pucch_cfg_ded_present) {
    HANDLE_CODE(pucch_cfg_ded.pack(bref));
  }
  if (pusch_cfg_ded_present) {
    HANDLE_CODE(pusch_cfg_ded.pack(bref));
  }
  if (ul_pwr_ctrl_ded_present) {
    HANDLE_CODE(ul_pwr_ctrl_ded.pack(bref));
  }
  if (tpc_pdcch_cfg_pucch_present) {
    HANDLE_CODE(tpc_pdcch_cfg_pucch.pack(bref));
  }
  if (tpc_pdcch_cfg_pusch_present) {
    HANDLE_CODE(tpc_pdcch_cfg_pusch.pack(bref));
  }
  if (cqi_report_cfg_present) {
    HANDLE_CODE(cqi_report_cfg.pack(bref));
  }
  if (srs_ul_cfg_ded_present) {
    HANDLE_CODE(srs_ul_cfg_ded.pack(bref));
  }
  if (ant_info_present) {
    HANDLE_CODE(ant_info.pack(bref));
  }
  if (sched_request_cfg_present) {
    HANDLE_CODE(sched_request_cfg.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= cqi_report_cfg_v920.is_present();
    group_flags[0] |= ant_info_v920.is_present();
    group_flags[1] |= ant_info_r10.is_present();
    group_flags[1] |= ant_info_ul_r10.is_present();
    group_flags[1] |= cif_presence_r10_present;
    group_flags[1] |= cqi_report_cfg_r10.is_present();
    group_flags[1] |= csi_rs_cfg_r10.is_present();
    group_flags[1] |= pucch_cfg_ded_v1020.is_present();
    group_flags[1] |= pusch_cfg_ded_v1020.is_present();
    group_flags[1] |= sched_request_cfg_v1020.is_present();
    group_flags[1] |= srs_ul_cfg_ded_v1020.is_present();
    group_flags[1] |= srs_ul_cfg_ded_aperiodic_r10.is_present();
    group_flags[1] |= ul_pwr_ctrl_ded_v1020.is_present();
    group_flags[2] |= add_spec_emission_ca_r10.is_present();
    group_flags[3] |= csi_rs_cfg_nzp_to_release_list_r11.is_present();
    group_flags[3] |= csi_rs_cfg_nzp_to_add_mod_list_r11.is_present();
    group_flags[3] |= csi_rs_cfg_zp_to_release_list_r11.is_present();
    group_flags[3] |= csi_rs_cfg_zp_to_add_mod_list_r11.is_present();
    group_flags[3] |= epdcch_cfg_r11.is_present();
    group_flags[3] |= pdsch_cfg_ded_v1130.is_present();
    group_flags[3] |= cqi_report_cfg_v1130.is_present();
    group_flags[3] |= pucch_cfg_ded_v1130.is_present();
    group_flags[3] |= pusch_cfg_ded_v1130.is_present();
    group_flags[3] |= ul_pwr_ctrl_ded_v1130.is_present();
    group_flags[4] |= ant_info_v1250.is_present();
    group_flags[4] |= eimta_main_cfg_r12.is_present();
    group_flags[4] |= eimta_main_cfg_pcell_r12.is_present();
    group_flags[4] |= pucch_cfg_ded_v1250.is_present();
    group_flags[4] |= cqi_report_cfg_pcell_v1250.is_present();
    group_flags[4] |= ul_pwr_ctrl_ded_v1250.is_present();
    group_flags[4] |= pusch_cfg_ded_v1250.is_present();
    group_flags[4] |= csi_rs_cfg_v1250.is_present();
    group_flags[5] |= pdsch_cfg_ded_v1280.is_present();
    group_flags[6] |= pdsch_cfg_ded_v1310.is_present();
    group_flags[6] |= pucch_cfg_ded_r13.is_present();
    group_flags[6] |= pusch_cfg_ded_r13.is_present();
    group_flags[6] |= pdcch_candidate_reductions_r13.is_present();
    group_flags[6] |= cqi_report_cfg_v1310.is_present();
    group_flags[6] |= srs_ul_cfg_ded_v1310.is_present();
    group_flags[6] |= srs_ul_cfg_ded_up_pts_ext_r13.is_present();
    group_flags[6] |= srs_ul_cfg_ded_aperiodic_v1310.is_present();
    group_flags[6] |= srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present();
    group_flags[6] |= csi_rs_cfg_v1310.is_present();
    group_flags[6] |= ce_mode_r13.is_present();
    group_flags[6] |= csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present();
    group_flags[6] |= csi_rs_cfg_nzp_to_release_list_ext_r13.is_present();
    group_flags[7] |= cqi_report_cfg_v1320.is_present();
    group_flags[8] |= type_a_srs_tpc_pdcch_group_r14.is_present();
    group_flags[8] |= must_cfg_r14.is_present();
    group_flags[8] |= pusch_enhance_cfg_r14.is_present();
    group_flags[8] |= ce_pdsch_pusch_enhancement_cfg_r14_present;
    group_flags[8] |= ant_info_v1430.is_present();
    group_flags[8] |= pucch_cfg_ded_v1430.is_present();
    group_flags[8] |= pdsch_cfg_ded_v1430.is_present();
    group_flags[8] |= pusch_cfg_ded_v1430.is_present();
    group_flags[8] |= srs_ul_periodic_cfg_ded_list_r14.is_present();
    group_flags[8] |= srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present();
    group_flags[8] |= srs_ul_aperiodic_cfg_ded_list_r14.is_present();
    group_flags[8] |= srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present();
    group_flags[8] |= csi_rs_cfg_v1430.is_present();
    group_flags[8] |= csi_rs_cfg_zp_ap_list_r14.is_present();
    group_flags[8] |= cqi_report_cfg_v1430.is_present();
    group_flags[8] |= semi_open_loop_r14_present;
    group_flags[9] |= csi_rs_cfg_v1480.is_present();
    group_flags[10] |= phys_cfg_ded_stti_r15.is_present();
    group_flags[10] |= pdsch_cfg_ded_v1530.is_present();
    group_flags[10] |= pusch_cfg_ded_v1530.is_present();
    group_flags[10] |= cqi_report_cfg_v1530.is_present();
    group_flags[10] |= ant_info_v1530.is_present();
    group_flags[10] |= csi_rs_cfg_v1530.is_present();
    group_flags[10] |= ul_pwr_ctrl_ded_v1530.is_present();
    group_flags[10] |= semi_static_cfi_cfg_r15.is_present();
    group_flags[10] |= blind_pdsch_repeat_cfg_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cqi_report_cfg_v920.is_present(), 1));
      HANDLE_CODE(bref.pack(ant_info_v920.is_present(), 1));
      if (cqi_report_cfg_v920.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v920->pack(bref));
      }
      if (ant_info_v920.is_present()) {
        HANDLE_CODE(ant_info_v920->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ant_info_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(ant_info_ul_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(cif_presence_r10_present, 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_ded_v1020.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1020.is_present(), 1));
      HANDLE_CODE(bref.pack(sched_request_cfg_v1020.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_v1020.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_aperiodic_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_ded_v1020.is_present(), 1));
      if (ant_info_r10.is_present()) {
        HANDLE_CODE(ant_info_r10->pack(bref));
      }
      if (ant_info_ul_r10.is_present()) {
        HANDLE_CODE(ant_info_ul_r10->pack(bref));
      }
      if (cif_presence_r10_present) {
        HANDLE_CODE(bref.pack(cif_presence_r10, 1));
      }
      if (cqi_report_cfg_r10.is_present()) {
        HANDLE_CODE(cqi_report_cfg_r10->pack(bref));
      }
      if (csi_rs_cfg_r10.is_present()) {
        HANDLE_CODE(csi_rs_cfg_r10->pack(bref));
      }
      if (pucch_cfg_ded_v1020.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_v1020->pack(bref));
      }
      if (pusch_cfg_ded_v1020.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1020->pack(bref));
      }
      if (sched_request_cfg_v1020.is_present()) {
        HANDLE_CODE(sched_request_cfg_v1020->pack(bref));
      }
      if (srs_ul_cfg_ded_v1020.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_v1020->pack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_r10.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_r10->pack(bref));
      }
      if (ul_pwr_ctrl_ded_v1020.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1020->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(add_spec_emission_ca_r10.is_present(), 1));
      if (add_spec_emission_ca_r10.is_present()) {
        HANDLE_CODE(add_spec_emission_ca_r10->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_to_release_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_to_add_mod_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_zp_to_release_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_zp_to_add_mod_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(epdcch_cfg_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1130.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_v1130.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_ded_v1130.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1130.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_ded_v1130.is_present(), 1));
      if (csi_rs_cfg_nzp_to_release_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_nzp_to_release_list_r11, 1, 3, integer_packer<uint8_t>(1, 3)));
      }
      if (csi_rs_cfg_nzp_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_nzp_to_add_mod_list_r11, 1, 3));
      }
      if (csi_rs_cfg_zp_to_release_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_zp_to_release_list_r11, 1, 4, integer_packer<uint8_t>(1, 4)));
      }
      if (csi_rs_cfg_zp_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_zp_to_add_mod_list_r11, 1, 4));
      }
      if (epdcch_cfg_r11.is_present()) {
        HANDLE_CODE(epdcch_cfg_r11->pack(bref));
      }
      if (pdsch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1130->pack(bref));
      }
      if (cqi_report_cfg_v1130.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1130->pack(bref));
      }
      if (pucch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_v1130->pack(bref));
      }
      if (pusch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1130->pack(bref));
      }
      if (ul_pwr_ctrl_ded_v1130.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1130->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ant_info_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(eimta_main_cfg_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(eimta_main_cfg_pcell_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_ded_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_pcell_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_ded_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_v1250.is_present(), 1));
      if (ant_info_v1250.is_present()) {
        HANDLE_CODE(ant_info_v1250->pack(bref));
      }
      if (eimta_main_cfg_r12.is_present()) {
        HANDLE_CODE(eimta_main_cfg_r12->pack(bref));
      }
      if (eimta_main_cfg_pcell_r12.is_present()) {
        HANDLE_CODE(eimta_main_cfg_pcell_r12->pack(bref));
      }
      if (pucch_cfg_ded_v1250.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_v1250->pack(bref));
      }
      if (cqi_report_cfg_pcell_v1250.is_present()) {
        HANDLE_CODE(cqi_report_cfg_pcell_v1250->pack(bref));
      }
      if (ul_pwr_ctrl_ded_v1250.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1250->pack(bref));
      }
      if (pusch_cfg_ded_v1250.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1250->pack(bref));
      }
      if (csi_rs_cfg_v1250.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1250->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1280.is_present(), 1));
      if (pdsch_cfg_ded_v1280.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1280->pack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_ded_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(pdcch_candidate_reductions_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_up_pts_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_aperiodic_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(ce_mode_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_to_release_list_ext_r13.is_present(), 1));
      if (pdsch_cfg_ded_v1310.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1310->pack(bref));
      }
      if (pucch_cfg_ded_r13.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_r13->pack(bref));
      }
      if (pusch_cfg_ded_r13.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_r13->pack(bref));
      }
      if (pdcch_candidate_reductions_r13.is_present()) {
        HANDLE_CODE(pdcch_candidate_reductions_r13->pack(bref));
      }
      if (cqi_report_cfg_v1310.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1310->pack(bref));
      }
      if (srs_ul_cfg_ded_v1310.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_v1310->pack(bref));
      }
      if (srs_ul_cfg_ded_up_pts_ext_r13.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_up_pts_ext_r13->pack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_v1310.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_v1310->pack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13->pack(bref));
      }
      if (csi_rs_cfg_v1310.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1310->pack(bref));
      }
      if (ce_mode_r13.is_present()) {
        HANDLE_CODE(ce_mode_r13->pack(bref));
      }
      if (csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_nzp_to_add_mod_list_ext_r13, 1, 21));
      }
      if (csi_rs_cfg_nzp_to_release_list_ext_r13.is_present()) {
        HANDLE_CODE(
            pack_dyn_seq_of(bref, *csi_rs_cfg_nzp_to_release_list_ext_r13, 1, 21, integer_packer<uint8_t>(4, 24)));
      }
    }
    if (group_flags[7]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cqi_report_cfg_v1320.is_present(), 1));
      if (cqi_report_cfg_v1320.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1320->pack(bref));
      }
    }
    if (group_flags[8]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(type_a_srs_tpc_pdcch_group_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(must_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_enhance_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(ce_pdsch_pusch_enhancement_cfg_r14_present, 1));
      HANDLE_CODE(bref.pack(ant_info_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_ded_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_periodic_cfg_ded_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_aperiodic_cfg_ded_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_zp_ap_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(semi_open_loop_r14_present, 1));
      if (type_a_srs_tpc_pdcch_group_r14.is_present()) {
        HANDLE_CODE(type_a_srs_tpc_pdcch_group_r14->pack(bref));
      }
      if (must_cfg_r14.is_present()) {
        HANDLE_CODE(must_cfg_r14->pack(bref));
      }
      if (pusch_enhance_cfg_r14.is_present()) {
        HANDLE_CODE(pusch_enhance_cfg_r14->pack(bref));
      }
      if (ant_info_v1430.is_present()) {
        HANDLE_CODE(ant_info_v1430->pack(bref));
      }
      if (pucch_cfg_ded_v1430.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_v1430->pack(bref));
      }
      if (pdsch_cfg_ded_v1430.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1430->pack(bref));
      }
      if (pusch_cfg_ded_v1430.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1430->pack(bref));
      }
      if (srs_ul_periodic_cfg_ded_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srs_ul_periodic_cfg_ded_list_r14, 1, 2));
      }
      if (srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srs_ul_periodic_cfg_ded_up_pts_ext_list_r14, 1, 4));
      }
      if (srs_ul_aperiodic_cfg_ded_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srs_ul_aperiodic_cfg_ded_list_r14, 1, 2));
      }
      if (srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srs_ul_cfg_ded_ap_up_pts_ext_list_r14, 1, 4));
      }
      if (csi_rs_cfg_v1430.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1430->pack(bref));
      }
      if (csi_rs_cfg_zp_ap_list_r14.is_present()) {
        HANDLE_CODE(csi_rs_cfg_zp_ap_list_r14->pack(bref));
      }
      if (cqi_report_cfg_v1430.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1430->pack(bref));
      }
      if (semi_open_loop_r14_present) {
        HANDLE_CODE(bref.pack(semi_open_loop_r14, 1));
      }
    }
    if (group_flags[9]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(csi_rs_cfg_v1480.is_present(), 1));
      if (csi_rs_cfg_v1480.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1480->pack(bref));
      }
    }
    if (group_flags[10]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(phys_cfg_ded_stti_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(ant_info_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_ded_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(semi_static_cfi_cfg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(blind_pdsch_repeat_cfg_r15.is_present(), 1));
      if (phys_cfg_ded_stti_r15.is_present()) {
        HANDLE_CODE(phys_cfg_ded_stti_r15->pack(bref));
      }
      if (pdsch_cfg_ded_v1530.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1530->pack(bref));
      }
      if (pusch_cfg_ded_v1530.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1530->pack(bref));
      }
      if (cqi_report_cfg_v1530.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1530->pack(bref));
      }
      if (ant_info_v1530.is_present()) {
        HANDLE_CODE(ant_info_v1530->pack(bref));
      }
      if (csi_rs_cfg_v1530.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1530->pack(bref));
      }
      if (ul_pwr_ctrl_ded_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1530->pack(bref));
      }
      if (semi_static_cfi_cfg_r15.is_present()) {
        HANDLE_CODE(semi_static_cfi_cfg_r15->pack(bref));
      }
      if (blind_pdsch_repeat_cfg_r15.is_present()) {
        HANDLE_CODE(blind_pdsch_repeat_cfg_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(pdsch_cfg_ded_present, 1));
  HANDLE_CODE(bref.unpack(pucch_cfg_ded_present, 1));
  HANDLE_CODE(bref.unpack(pusch_cfg_ded_present, 1));
  HANDLE_CODE(bref.unpack(ul_pwr_ctrl_ded_present, 1));
  HANDLE_CODE(bref.unpack(tpc_pdcch_cfg_pucch_present, 1));
  HANDLE_CODE(bref.unpack(tpc_pdcch_cfg_pusch_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_cfg_present, 1));
  HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_present, 1));
  HANDLE_CODE(bref.unpack(ant_info_present, 1));
  HANDLE_CODE(bref.unpack(sched_request_cfg_present, 1));

  if (pdsch_cfg_ded_present) {
    HANDLE_CODE(pdsch_cfg_ded.unpack(bref));
  }
  if (pucch_cfg_ded_present) {
    HANDLE_CODE(pucch_cfg_ded.unpack(bref));
  }
  if (pusch_cfg_ded_present) {
    HANDLE_CODE(pusch_cfg_ded.unpack(bref));
  }
  if (ul_pwr_ctrl_ded_present) {
    HANDLE_CODE(ul_pwr_ctrl_ded.unpack(bref));
  }
  if (tpc_pdcch_cfg_pucch_present) {
    HANDLE_CODE(tpc_pdcch_cfg_pucch.unpack(bref));
  }
  if (tpc_pdcch_cfg_pusch_present) {
    HANDLE_CODE(tpc_pdcch_cfg_pusch.unpack(bref));
  }
  if (cqi_report_cfg_present) {
    HANDLE_CODE(cqi_report_cfg.unpack(bref));
  }
  if (srs_ul_cfg_ded_present) {
    HANDLE_CODE(srs_ul_cfg_ded.unpack(bref));
  }
  if (ant_info_present) {
    HANDLE_CODE(ant_info.unpack(bref));
  }
  if (sched_request_cfg_present) {
    HANDLE_CODE(sched_request_cfg.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(11);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool cqi_report_cfg_v920_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v920_present, 1));
      cqi_report_cfg_v920.set_present(cqi_report_cfg_v920_present);
      bool ant_info_v920_present;
      HANDLE_CODE(bref.unpack(ant_info_v920_present, 1));
      ant_info_v920.set_present(ant_info_v920_present);
      if (cqi_report_cfg_v920.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v920->unpack(bref));
      }
      if (ant_info_v920.is_present()) {
        HANDLE_CODE(ant_info_v920->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ant_info_r10_present;
      HANDLE_CODE(bref.unpack(ant_info_r10_present, 1));
      ant_info_r10.set_present(ant_info_r10_present);
      bool ant_info_ul_r10_present;
      HANDLE_CODE(bref.unpack(ant_info_ul_r10_present, 1));
      ant_info_ul_r10.set_present(ant_info_ul_r10_present);
      HANDLE_CODE(bref.unpack(cif_presence_r10_present, 1));
      bool cqi_report_cfg_r10_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_r10_present, 1));
      cqi_report_cfg_r10.set_present(cqi_report_cfg_r10_present);
      bool csi_rs_cfg_r10_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_r10_present, 1));
      csi_rs_cfg_r10.set_present(csi_rs_cfg_r10_present);
      bool pucch_cfg_ded_v1020_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_ded_v1020_present, 1));
      pucch_cfg_ded_v1020.set_present(pucch_cfg_ded_v1020_present);
      bool pusch_cfg_ded_v1020_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_v1020_present, 1));
      pusch_cfg_ded_v1020.set_present(pusch_cfg_ded_v1020_present);
      bool sched_request_cfg_v1020_present;
      HANDLE_CODE(bref.unpack(sched_request_cfg_v1020_present, 1));
      sched_request_cfg_v1020.set_present(sched_request_cfg_v1020_present);
      bool srs_ul_cfg_ded_v1020_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_v1020_present, 1));
      srs_ul_cfg_ded_v1020.set_present(srs_ul_cfg_ded_v1020_present);
      bool srs_ul_cfg_ded_aperiodic_r10_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_aperiodic_r10_present, 1));
      srs_ul_cfg_ded_aperiodic_r10.set_present(srs_ul_cfg_ded_aperiodic_r10_present);
      bool ul_pwr_ctrl_ded_v1020_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_ded_v1020_present, 1));
      ul_pwr_ctrl_ded_v1020.set_present(ul_pwr_ctrl_ded_v1020_present);
      if (ant_info_r10.is_present()) {
        HANDLE_CODE(ant_info_r10->unpack(bref));
      }
      if (ant_info_ul_r10.is_present()) {
        HANDLE_CODE(ant_info_ul_r10->unpack(bref));
      }
      if (cif_presence_r10_present) {
        HANDLE_CODE(bref.unpack(cif_presence_r10, 1));
      }
      if (cqi_report_cfg_r10.is_present()) {
        HANDLE_CODE(cqi_report_cfg_r10->unpack(bref));
      }
      if (csi_rs_cfg_r10.is_present()) {
        HANDLE_CODE(csi_rs_cfg_r10->unpack(bref));
      }
      if (pucch_cfg_ded_v1020.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_v1020->unpack(bref));
      }
      if (pusch_cfg_ded_v1020.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1020->unpack(bref));
      }
      if (sched_request_cfg_v1020.is_present()) {
        HANDLE_CODE(sched_request_cfg_v1020->unpack(bref));
      }
      if (srs_ul_cfg_ded_v1020.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_v1020->unpack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_r10.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_r10->unpack(bref));
      }
      if (ul_pwr_ctrl_ded_v1020.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1020->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool add_spec_emission_ca_r10_present;
      HANDLE_CODE(bref.unpack(add_spec_emission_ca_r10_present, 1));
      add_spec_emission_ca_r10.set_present(add_spec_emission_ca_r10_present);
      if (add_spec_emission_ca_r10.is_present()) {
        HANDLE_CODE(add_spec_emission_ca_r10->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool csi_rs_cfg_nzp_to_release_list_r11_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_to_release_list_r11_present, 1));
      csi_rs_cfg_nzp_to_release_list_r11.set_present(csi_rs_cfg_nzp_to_release_list_r11_present);
      bool csi_rs_cfg_nzp_to_add_mod_list_r11_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_to_add_mod_list_r11_present, 1));
      csi_rs_cfg_nzp_to_add_mod_list_r11.set_present(csi_rs_cfg_nzp_to_add_mod_list_r11_present);
      bool csi_rs_cfg_zp_to_release_list_r11_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_zp_to_release_list_r11_present, 1));
      csi_rs_cfg_zp_to_release_list_r11.set_present(csi_rs_cfg_zp_to_release_list_r11_present);
      bool csi_rs_cfg_zp_to_add_mod_list_r11_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_zp_to_add_mod_list_r11_present, 1));
      csi_rs_cfg_zp_to_add_mod_list_r11.set_present(csi_rs_cfg_zp_to_add_mod_list_r11_present);
      bool epdcch_cfg_r11_present;
      HANDLE_CODE(bref.unpack(epdcch_cfg_r11_present, 1));
      epdcch_cfg_r11.set_present(epdcch_cfg_r11_present);
      bool pdsch_cfg_ded_v1130_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1130_present, 1));
      pdsch_cfg_ded_v1130.set_present(pdsch_cfg_ded_v1130_present);
      bool cqi_report_cfg_v1130_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1130_present, 1));
      cqi_report_cfg_v1130.set_present(cqi_report_cfg_v1130_present);
      bool pucch_cfg_ded_v1130_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_ded_v1130_present, 1));
      pucch_cfg_ded_v1130.set_present(pucch_cfg_ded_v1130_present);
      bool pusch_cfg_ded_v1130_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_v1130_present, 1));
      pusch_cfg_ded_v1130.set_present(pusch_cfg_ded_v1130_present);
      bool ul_pwr_ctrl_ded_v1130_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_ded_v1130_present, 1));
      ul_pwr_ctrl_ded_v1130.set_present(ul_pwr_ctrl_ded_v1130_present);
      if (csi_rs_cfg_nzp_to_release_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_nzp_to_release_list_r11, bref, 1, 3, integer_packer<uint8_t>(1, 3)));
      }
      if (csi_rs_cfg_nzp_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_nzp_to_add_mod_list_r11, bref, 1, 3));
      }
      if (csi_rs_cfg_zp_to_release_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_zp_to_release_list_r11, bref, 1, 4, integer_packer<uint8_t>(1, 4)));
      }
      if (csi_rs_cfg_zp_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_zp_to_add_mod_list_r11, bref, 1, 4));
      }
      if (epdcch_cfg_r11.is_present()) {
        HANDLE_CODE(epdcch_cfg_r11->unpack(bref));
      }
      if (pdsch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1130->unpack(bref));
      }
      if (cqi_report_cfg_v1130.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1130->unpack(bref));
      }
      if (pucch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_v1130->unpack(bref));
      }
      if (pusch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1130->unpack(bref));
      }
      if (ul_pwr_ctrl_ded_v1130.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1130->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ant_info_v1250_present;
      HANDLE_CODE(bref.unpack(ant_info_v1250_present, 1));
      ant_info_v1250.set_present(ant_info_v1250_present);
      bool eimta_main_cfg_r12_present;
      HANDLE_CODE(bref.unpack(eimta_main_cfg_r12_present, 1));
      eimta_main_cfg_r12.set_present(eimta_main_cfg_r12_present);
      bool eimta_main_cfg_pcell_r12_present;
      HANDLE_CODE(bref.unpack(eimta_main_cfg_pcell_r12_present, 1));
      eimta_main_cfg_pcell_r12.set_present(eimta_main_cfg_pcell_r12_present);
      bool pucch_cfg_ded_v1250_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_ded_v1250_present, 1));
      pucch_cfg_ded_v1250.set_present(pucch_cfg_ded_v1250_present);
      bool cqi_report_cfg_pcell_v1250_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_pcell_v1250_present, 1));
      cqi_report_cfg_pcell_v1250.set_present(cqi_report_cfg_pcell_v1250_present);
      bool ul_pwr_ctrl_ded_v1250_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_ded_v1250_present, 1));
      ul_pwr_ctrl_ded_v1250.set_present(ul_pwr_ctrl_ded_v1250_present);
      bool pusch_cfg_ded_v1250_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_v1250_present, 1));
      pusch_cfg_ded_v1250.set_present(pusch_cfg_ded_v1250_present);
      bool csi_rs_cfg_v1250_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1250_present, 1));
      csi_rs_cfg_v1250.set_present(csi_rs_cfg_v1250_present);
      if (ant_info_v1250.is_present()) {
        HANDLE_CODE(ant_info_v1250->unpack(bref));
      }
      if (eimta_main_cfg_r12.is_present()) {
        HANDLE_CODE(eimta_main_cfg_r12->unpack(bref));
      }
      if (eimta_main_cfg_pcell_r12.is_present()) {
        HANDLE_CODE(eimta_main_cfg_pcell_r12->unpack(bref));
      }
      if (pucch_cfg_ded_v1250.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_v1250->unpack(bref));
      }
      if (cqi_report_cfg_pcell_v1250.is_present()) {
        HANDLE_CODE(cqi_report_cfg_pcell_v1250->unpack(bref));
      }
      if (ul_pwr_ctrl_ded_v1250.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1250->unpack(bref));
      }
      if (pusch_cfg_ded_v1250.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1250->unpack(bref));
      }
      if (csi_rs_cfg_v1250.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1250->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool pdsch_cfg_ded_v1280_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1280_present, 1));
      pdsch_cfg_ded_v1280.set_present(pdsch_cfg_ded_v1280_present);
      if (pdsch_cfg_ded_v1280.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1280->unpack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool pdsch_cfg_ded_v1310_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1310_present, 1));
      pdsch_cfg_ded_v1310.set_present(pdsch_cfg_ded_v1310_present);
      bool pucch_cfg_ded_r13_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_ded_r13_present, 1));
      pucch_cfg_ded_r13.set_present(pucch_cfg_ded_r13_present);
      bool pusch_cfg_ded_r13_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_r13_present, 1));
      pusch_cfg_ded_r13.set_present(pusch_cfg_ded_r13_present);
      bool pdcch_candidate_reductions_r13_present;
      HANDLE_CODE(bref.unpack(pdcch_candidate_reductions_r13_present, 1));
      pdcch_candidate_reductions_r13.set_present(pdcch_candidate_reductions_r13_present);
      bool cqi_report_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1310_present, 1));
      cqi_report_cfg_v1310.set_present(cqi_report_cfg_v1310_present);
      bool srs_ul_cfg_ded_v1310_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_v1310_present, 1));
      srs_ul_cfg_ded_v1310.set_present(srs_ul_cfg_ded_v1310_present);
      bool srs_ul_cfg_ded_up_pts_ext_r13_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_up_pts_ext_r13_present, 1));
      srs_ul_cfg_ded_up_pts_ext_r13.set_present(srs_ul_cfg_ded_up_pts_ext_r13_present);
      bool srs_ul_cfg_ded_aperiodic_v1310_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_aperiodic_v1310_present, 1));
      srs_ul_cfg_ded_aperiodic_v1310.set_present(srs_ul_cfg_ded_aperiodic_v1310_present);
      bool srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_present, 1));
      srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.set_present(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_present);
      bool csi_rs_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1310_present, 1));
      csi_rs_cfg_v1310.set_present(csi_rs_cfg_v1310_present);
      bool ce_mode_r13_present;
      HANDLE_CODE(bref.unpack(ce_mode_r13_present, 1));
      ce_mode_r13.set_present(ce_mode_r13_present);
      bool csi_rs_cfg_nzp_to_add_mod_list_ext_r13_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_to_add_mod_list_ext_r13_present, 1));
      csi_rs_cfg_nzp_to_add_mod_list_ext_r13.set_present(csi_rs_cfg_nzp_to_add_mod_list_ext_r13_present);
      bool csi_rs_cfg_nzp_to_release_list_ext_r13_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_to_release_list_ext_r13_present, 1));
      csi_rs_cfg_nzp_to_release_list_ext_r13.set_present(csi_rs_cfg_nzp_to_release_list_ext_r13_present);
      if (pdsch_cfg_ded_v1310.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1310->unpack(bref));
      }
      if (pucch_cfg_ded_r13.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_r13->unpack(bref));
      }
      if (pusch_cfg_ded_r13.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_r13->unpack(bref));
      }
      if (pdcch_candidate_reductions_r13.is_present()) {
        HANDLE_CODE(pdcch_candidate_reductions_r13->unpack(bref));
      }
      if (cqi_report_cfg_v1310.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1310->unpack(bref));
      }
      if (srs_ul_cfg_ded_v1310.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_v1310->unpack(bref));
      }
      if (srs_ul_cfg_ded_up_pts_ext_r13.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_up_pts_ext_r13->unpack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_v1310.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_v1310->unpack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13->unpack(bref));
      }
      if (csi_rs_cfg_v1310.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1310->unpack(bref));
      }
      if (ce_mode_r13.is_present()) {
        HANDLE_CODE(ce_mode_r13->unpack(bref));
      }
      if (csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_nzp_to_add_mod_list_ext_r13, bref, 1, 21));
      }
      if (csi_rs_cfg_nzp_to_release_list_ext_r13.is_present()) {
        HANDLE_CODE(
            unpack_dyn_seq_of(*csi_rs_cfg_nzp_to_release_list_ext_r13, bref, 1, 21, integer_packer<uint8_t>(4, 24)));
      }
    }
    if (group_flags[7]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool cqi_report_cfg_v1320_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1320_present, 1));
      cqi_report_cfg_v1320.set_present(cqi_report_cfg_v1320_present);
      if (cqi_report_cfg_v1320.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1320->unpack(bref));
      }
    }
    if (group_flags[8]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool type_a_srs_tpc_pdcch_group_r14_present;
      HANDLE_CODE(bref.unpack(type_a_srs_tpc_pdcch_group_r14_present, 1));
      type_a_srs_tpc_pdcch_group_r14.set_present(type_a_srs_tpc_pdcch_group_r14_present);
      bool must_cfg_r14_present;
      HANDLE_CODE(bref.unpack(must_cfg_r14_present, 1));
      must_cfg_r14.set_present(must_cfg_r14_present);
      bool pusch_enhance_cfg_r14_present;
      HANDLE_CODE(bref.unpack(pusch_enhance_cfg_r14_present, 1));
      pusch_enhance_cfg_r14.set_present(pusch_enhance_cfg_r14_present);
      HANDLE_CODE(bref.unpack(ce_pdsch_pusch_enhancement_cfg_r14_present, 1));
      bool ant_info_v1430_present;
      HANDLE_CODE(bref.unpack(ant_info_v1430_present, 1));
      ant_info_v1430.set_present(ant_info_v1430_present);
      bool pucch_cfg_ded_v1430_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_ded_v1430_present, 1));
      pucch_cfg_ded_v1430.set_present(pucch_cfg_ded_v1430_present);
      bool pdsch_cfg_ded_v1430_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1430_present, 1));
      pdsch_cfg_ded_v1430.set_present(pdsch_cfg_ded_v1430_present);
      bool pusch_cfg_ded_v1430_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_v1430_present, 1));
      pusch_cfg_ded_v1430.set_present(pusch_cfg_ded_v1430_present);
      bool srs_ul_periodic_cfg_ded_list_r14_present;
      HANDLE_CODE(bref.unpack(srs_ul_periodic_cfg_ded_list_r14_present, 1));
      srs_ul_periodic_cfg_ded_list_r14.set_present(srs_ul_periodic_cfg_ded_list_r14_present);
      bool srs_ul_periodic_cfg_ded_up_pts_ext_list_r14_present;
      HANDLE_CODE(bref.unpack(srs_ul_periodic_cfg_ded_up_pts_ext_list_r14_present, 1));
      srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.set_present(srs_ul_periodic_cfg_ded_up_pts_ext_list_r14_present);
      bool srs_ul_aperiodic_cfg_ded_list_r14_present;
      HANDLE_CODE(bref.unpack(srs_ul_aperiodic_cfg_ded_list_r14_present, 1));
      srs_ul_aperiodic_cfg_ded_list_r14.set_present(srs_ul_aperiodic_cfg_ded_list_r14_present);
      bool srs_ul_cfg_ded_ap_up_pts_ext_list_r14_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_ap_up_pts_ext_list_r14_present, 1));
      srs_ul_cfg_ded_ap_up_pts_ext_list_r14.set_present(srs_ul_cfg_ded_ap_up_pts_ext_list_r14_present);
      bool csi_rs_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1430_present, 1));
      csi_rs_cfg_v1430.set_present(csi_rs_cfg_v1430_present);
      bool csi_rs_cfg_zp_ap_list_r14_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_zp_ap_list_r14_present, 1));
      csi_rs_cfg_zp_ap_list_r14.set_present(csi_rs_cfg_zp_ap_list_r14_present);
      bool cqi_report_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1430_present, 1));
      cqi_report_cfg_v1430.set_present(cqi_report_cfg_v1430_present);
      HANDLE_CODE(bref.unpack(semi_open_loop_r14_present, 1));
      if (type_a_srs_tpc_pdcch_group_r14.is_present()) {
        HANDLE_CODE(type_a_srs_tpc_pdcch_group_r14->unpack(bref));
      }
      if (must_cfg_r14.is_present()) {
        HANDLE_CODE(must_cfg_r14->unpack(bref));
      }
      if (pusch_enhance_cfg_r14.is_present()) {
        HANDLE_CODE(pusch_enhance_cfg_r14->unpack(bref));
      }
      if (ant_info_v1430.is_present()) {
        HANDLE_CODE(ant_info_v1430->unpack(bref));
      }
      if (pucch_cfg_ded_v1430.is_present()) {
        HANDLE_CODE(pucch_cfg_ded_v1430->unpack(bref));
      }
      if (pdsch_cfg_ded_v1430.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1430->unpack(bref));
      }
      if (pusch_cfg_ded_v1430.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1430->unpack(bref));
      }
      if (srs_ul_periodic_cfg_ded_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srs_ul_periodic_cfg_ded_list_r14, bref, 1, 2));
      }
      if (srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srs_ul_periodic_cfg_ded_up_pts_ext_list_r14, bref, 1, 4));
      }
      if (srs_ul_aperiodic_cfg_ded_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srs_ul_aperiodic_cfg_ded_list_r14, bref, 1, 2));
      }
      if (srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srs_ul_cfg_ded_ap_up_pts_ext_list_r14, bref, 1, 4));
      }
      if (csi_rs_cfg_v1430.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1430->unpack(bref));
      }
      if (csi_rs_cfg_zp_ap_list_r14.is_present()) {
        HANDLE_CODE(csi_rs_cfg_zp_ap_list_r14->unpack(bref));
      }
      if (cqi_report_cfg_v1430.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1430->unpack(bref));
      }
      if (semi_open_loop_r14_present) {
        HANDLE_CODE(bref.unpack(semi_open_loop_r14, 1));
      }
    }
    if (group_flags[9]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool csi_rs_cfg_v1480_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1480_present, 1));
      csi_rs_cfg_v1480.set_present(csi_rs_cfg_v1480_present);
      if (csi_rs_cfg_v1480.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1480->unpack(bref));
      }
    }
    if (group_flags[10]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool phys_cfg_ded_stti_r15_present;
      HANDLE_CODE(bref.unpack(phys_cfg_ded_stti_r15_present, 1));
      phys_cfg_ded_stti_r15.set_present(phys_cfg_ded_stti_r15_present);
      bool pdsch_cfg_ded_v1530_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1530_present, 1));
      pdsch_cfg_ded_v1530.set_present(pdsch_cfg_ded_v1530_present);
      bool pusch_cfg_ded_v1530_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_v1530_present, 1));
      pusch_cfg_ded_v1530.set_present(pusch_cfg_ded_v1530_present);
      bool cqi_report_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1530_present, 1));
      cqi_report_cfg_v1530.set_present(cqi_report_cfg_v1530_present);
      bool ant_info_v1530_present;
      HANDLE_CODE(bref.unpack(ant_info_v1530_present, 1));
      ant_info_v1530.set_present(ant_info_v1530_present);
      bool csi_rs_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1530_present, 1));
      csi_rs_cfg_v1530.set_present(csi_rs_cfg_v1530_present);
      bool ul_pwr_ctrl_ded_v1530_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_ded_v1530_present, 1));
      ul_pwr_ctrl_ded_v1530.set_present(ul_pwr_ctrl_ded_v1530_present);
      bool semi_static_cfi_cfg_r15_present;
      HANDLE_CODE(bref.unpack(semi_static_cfi_cfg_r15_present, 1));
      semi_static_cfi_cfg_r15.set_present(semi_static_cfi_cfg_r15_present);
      bool blind_pdsch_repeat_cfg_r15_present;
      HANDLE_CODE(bref.unpack(blind_pdsch_repeat_cfg_r15_present, 1));
      blind_pdsch_repeat_cfg_r15.set_present(blind_pdsch_repeat_cfg_r15_present);
      if (phys_cfg_ded_stti_r15.is_present()) {
        HANDLE_CODE(phys_cfg_ded_stti_r15->unpack(bref));
      }
      if (pdsch_cfg_ded_v1530.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1530->unpack(bref));
      }
      if (pusch_cfg_ded_v1530.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1530->unpack(bref));
      }
      if (cqi_report_cfg_v1530.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1530->unpack(bref));
      }
      if (ant_info_v1530.is_present()) {
        HANDLE_CODE(ant_info_v1530->unpack(bref));
      }
      if (csi_rs_cfg_v1530.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1530->unpack(bref));
      }
      if (ul_pwr_ctrl_ded_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_v1530->unpack(bref));
      }
      if (semi_static_cfi_cfg_r15.is_present()) {
        HANDLE_CODE(semi_static_cfi_cfg_r15->unpack(bref));
      }
      if (blind_pdsch_repeat_cfg_r15.is_present()) {
        HANDLE_CODE(blind_pdsch_repeat_cfg_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void phys_cfg_ded_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pdsch_cfg_ded_present) {
    j.write_fieldname("pdsch-ConfigDedicated");
    pdsch_cfg_ded.to_json(j);
  }
  if (pucch_cfg_ded_present) {
    j.write_fieldname("pucch-ConfigDedicated");
    pucch_cfg_ded.to_json(j);
  }
  if (pusch_cfg_ded_present) {
    j.write_fieldname("pusch-ConfigDedicated");
    pusch_cfg_ded.to_json(j);
  }
  if (ul_pwr_ctrl_ded_present) {
    j.write_fieldname("uplinkPowerControlDedicated");
    ul_pwr_ctrl_ded.to_json(j);
  }
  if (tpc_pdcch_cfg_pucch_present) {
    j.write_fieldname("tpc-PDCCH-ConfigPUCCH");
    tpc_pdcch_cfg_pucch.to_json(j);
  }
  if (tpc_pdcch_cfg_pusch_present) {
    j.write_fieldname("tpc-PDCCH-ConfigPUSCH");
    tpc_pdcch_cfg_pusch.to_json(j);
  }
  if (cqi_report_cfg_present) {
    j.write_fieldname("cqi-ReportConfig");
    cqi_report_cfg.to_json(j);
  }
  if (srs_ul_cfg_ded_present) {
    j.write_fieldname("soundingRS-UL-ConfigDedicated");
    srs_ul_cfg_ded.to_json(j);
  }
  if (ant_info_present) {
    j.write_fieldname("antennaInfo");
    ant_info.to_json(j);
  }
  if (sched_request_cfg_present) {
    j.write_fieldname("schedulingRequestConfig");
    sched_request_cfg.to_json(j);
  }
  if (ext) {
    if (cqi_report_cfg_v920.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v920");
      cqi_report_cfg_v920->to_json(j);
    }
    if (ant_info_v920.is_present()) {
      j.write_fieldname("antennaInfo-v920");
      ant_info_v920->to_json(j);
    }
    if (ant_info_r10.is_present()) {
      j.write_fieldname("antennaInfo-r10");
      ant_info_r10->to_json(j);
    }
    if (ant_info_ul_r10.is_present()) {
      j.write_fieldname("antennaInfoUL-r10");
      ant_info_ul_r10->to_json(j);
    }
    if (cif_presence_r10_present) {
      j.write_bool("cif-Presence-r10", cif_presence_r10);
    }
    if (cqi_report_cfg_r10.is_present()) {
      j.write_fieldname("cqi-ReportConfig-r10");
      cqi_report_cfg_r10->to_json(j);
    }
    if (csi_rs_cfg_r10.is_present()) {
      j.write_fieldname("csi-RS-Config-r10");
      csi_rs_cfg_r10->to_json(j);
    }
    if (pucch_cfg_ded_v1020.is_present()) {
      j.write_fieldname("pucch-ConfigDedicated-v1020");
      pucch_cfg_ded_v1020->to_json(j);
    }
    if (pusch_cfg_ded_v1020.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-v1020");
      pusch_cfg_ded_v1020->to_json(j);
    }
    if (sched_request_cfg_v1020.is_present()) {
      j.write_fieldname("schedulingRequestConfig-v1020");
      sched_request_cfg_v1020->to_json(j);
    }
    if (srs_ul_cfg_ded_v1020.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicated-v1020");
      srs_ul_cfg_ded_v1020->to_json(j);
    }
    if (srs_ul_cfg_ded_aperiodic_r10.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodic-r10");
      srs_ul_cfg_ded_aperiodic_r10->to_json(j);
    }
    if (ul_pwr_ctrl_ded_v1020.is_present()) {
      j.write_fieldname("uplinkPowerControlDedicated-v1020");
      ul_pwr_ctrl_ded_v1020->to_json(j);
    }
    if (add_spec_emission_ca_r10.is_present()) {
      j.write_fieldname("additionalSpectrumEmissionCA-r10");
      add_spec_emission_ca_r10->to_json(j);
    }
    if (csi_rs_cfg_nzp_to_release_list_r11.is_present()) {
      j.start_array("csi-RS-ConfigNZPToReleaseList-r11");
      for (const auto& e1 : *csi_rs_cfg_nzp_to_release_list_r11) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (csi_rs_cfg_nzp_to_add_mod_list_r11.is_present()) {
      j.start_array("csi-RS-ConfigNZPToAddModList-r11");
      for (const auto& e1 : *csi_rs_cfg_nzp_to_add_mod_list_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (csi_rs_cfg_zp_to_release_list_r11.is_present()) {
      j.start_array("csi-RS-ConfigZPToReleaseList-r11");
      for (const auto& e1 : *csi_rs_cfg_zp_to_release_list_r11) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (csi_rs_cfg_zp_to_add_mod_list_r11.is_present()) {
      j.start_array("csi-RS-ConfigZPToAddModList-r11");
      for (const auto& e1 : *csi_rs_cfg_zp_to_add_mod_list_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (epdcch_cfg_r11.is_present()) {
      j.write_fieldname("epdcch-Config-r11");
      epdcch_cfg_r11->to_json(j);
    }
    if (pdsch_cfg_ded_v1130.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1130");
      pdsch_cfg_ded_v1130->to_json(j);
    }
    if (cqi_report_cfg_v1130.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1130");
      cqi_report_cfg_v1130->to_json(j);
    }
    if (pucch_cfg_ded_v1130.is_present()) {
      j.write_fieldname("pucch-ConfigDedicated-v1130");
      pucch_cfg_ded_v1130->to_json(j);
    }
    if (pusch_cfg_ded_v1130.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-v1130");
      pusch_cfg_ded_v1130->to_json(j);
    }
    if (ul_pwr_ctrl_ded_v1130.is_present()) {
      j.write_fieldname("uplinkPowerControlDedicated-v1130");
      ul_pwr_ctrl_ded_v1130->to_json(j);
    }
    if (ant_info_v1250.is_present()) {
      j.write_fieldname("antennaInfo-v1250");
      ant_info_v1250->to_json(j);
    }
    if (eimta_main_cfg_r12.is_present()) {
      j.write_fieldname("eimta-MainConfig-r12");
      eimta_main_cfg_r12->to_json(j);
    }
    if (eimta_main_cfg_pcell_r12.is_present()) {
      j.write_fieldname("eimta-MainConfigPCell-r12");
      eimta_main_cfg_pcell_r12->to_json(j);
    }
    if (pucch_cfg_ded_v1250.is_present()) {
      j.write_fieldname("pucch-ConfigDedicated-v1250");
      pucch_cfg_ded_v1250->to_json(j);
    }
    if (cqi_report_cfg_pcell_v1250.is_present()) {
      j.write_fieldname("cqi-ReportConfigPCell-v1250");
      cqi_report_cfg_pcell_v1250->to_json(j);
    }
    if (ul_pwr_ctrl_ded_v1250.is_present()) {
      j.write_fieldname("uplinkPowerControlDedicated-v1250");
      ul_pwr_ctrl_ded_v1250->to_json(j);
    }
    if (pusch_cfg_ded_v1250.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-v1250");
      pusch_cfg_ded_v1250->to_json(j);
    }
    if (csi_rs_cfg_v1250.is_present()) {
      j.write_fieldname("csi-RS-Config-v1250");
      csi_rs_cfg_v1250->to_json(j);
    }
    if (pdsch_cfg_ded_v1280.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1280");
      pdsch_cfg_ded_v1280->to_json(j);
    }
    if (pdsch_cfg_ded_v1310.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1310");
      pdsch_cfg_ded_v1310->to_json(j);
    }
    if (pucch_cfg_ded_r13.is_present()) {
      j.write_fieldname("pucch-ConfigDedicated-r13");
      pucch_cfg_ded_r13->to_json(j);
    }
    if (pusch_cfg_ded_r13.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-r13");
      pusch_cfg_ded_r13->to_json(j);
    }
    if (pdcch_candidate_reductions_r13.is_present()) {
      j.write_fieldname("pdcch-CandidateReductions-r13");
      pdcch_candidate_reductions_r13->to_json(j);
    }
    if (cqi_report_cfg_v1310.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1310");
      cqi_report_cfg_v1310->to_json(j);
    }
    if (srs_ul_cfg_ded_v1310.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicated-v1310");
      srs_ul_cfg_ded_v1310->to_json(j);
    }
    if (srs_ul_cfg_ded_up_pts_ext_r13.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicatedUpPTsExt-r13");
      srs_ul_cfg_ded_up_pts_ext_r13->to_json(j);
    }
    if (srs_ul_cfg_ded_aperiodic_v1310.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodic-v1310");
      srs_ul_cfg_ded_aperiodic_v1310->to_json(j);
    }
    if (srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodicUpPTsExt-r13");
      srs_ul_cfg_ded_aperiodic_up_pts_ext_r13->to_json(j);
    }
    if (csi_rs_cfg_v1310.is_present()) {
      j.write_fieldname("csi-RS-Config-v1310");
      csi_rs_cfg_v1310->to_json(j);
    }
    if (ce_mode_r13.is_present()) {
      j.write_fieldname("ce-Mode-r13");
      ce_mode_r13->to_json(j);
    }
    if (csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present()) {
      j.start_array("csi-RS-ConfigNZPToAddModListExt-r13");
      for (const auto& e1 : *csi_rs_cfg_nzp_to_add_mod_list_ext_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (csi_rs_cfg_nzp_to_release_list_ext_r13.is_present()) {
      j.start_array("csi-RS-ConfigNZPToReleaseListExt-r13");
      for (const auto& e1 : *csi_rs_cfg_nzp_to_release_list_ext_r13) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (cqi_report_cfg_v1320.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1320");
      cqi_report_cfg_v1320->to_json(j);
    }
    if (type_a_srs_tpc_pdcch_group_r14.is_present()) {
      j.write_fieldname("typeA-SRS-TPC-PDCCH-Group-r14");
      type_a_srs_tpc_pdcch_group_r14->to_json(j);
    }
    if (must_cfg_r14.is_present()) {
      j.write_fieldname("must-Config-r14");
      must_cfg_r14->to_json(j);
    }
    if (pusch_enhance_cfg_r14.is_present()) {
      j.write_fieldname("pusch-EnhancementsConfig-r14");
      pusch_enhance_cfg_r14->to_json(j);
    }
    if (ce_pdsch_pusch_enhancement_cfg_r14_present) {
      j.write_str("ce-pdsch-pusch-EnhancementConfig-r14", "on");
    }
    if (ant_info_v1430.is_present()) {
      j.write_fieldname("antennaInfo-v1430");
      ant_info_v1430->to_json(j);
    }
    if (pucch_cfg_ded_v1430.is_present()) {
      j.write_fieldname("pucch-ConfigDedicated-v1430");
      pucch_cfg_ded_v1430->to_json(j);
    }
    if (pdsch_cfg_ded_v1430.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1430");
      pdsch_cfg_ded_v1430->to_json(j);
    }
    if (pusch_cfg_ded_v1430.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-v1430");
      pusch_cfg_ded_v1430->to_json(j);
    }
    if (srs_ul_periodic_cfg_ded_list_r14.is_present()) {
      j.start_array("soundingRS-UL-PeriodicConfigDedicatedList-r14");
      for (const auto& e1 : *srs_ul_periodic_cfg_ded_list_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present()) {
      j.start_array("soundingRS-UL-PeriodicConfigDedicatedUpPTsExtList-r14");
      for (const auto& e1 : *srs_ul_periodic_cfg_ded_up_pts_ext_list_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (srs_ul_aperiodic_cfg_ded_list_r14.is_present()) {
      j.start_array("soundingRS-UL-AperiodicConfigDedicatedList-r14");
      for (const auto& e1 : *srs_ul_aperiodic_cfg_ded_list_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present()) {
      j.start_array("soundingRS-UL-ConfigDedicatedApUpPTsExtList-r14");
      for (const auto& e1 : *srs_ul_cfg_ded_ap_up_pts_ext_list_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (csi_rs_cfg_v1430.is_present()) {
      j.write_fieldname("csi-RS-Config-v1430");
      csi_rs_cfg_v1430->to_json(j);
    }
    if (csi_rs_cfg_zp_ap_list_r14.is_present()) {
      j.write_fieldname("csi-RS-ConfigZP-ApList-r14");
      csi_rs_cfg_zp_ap_list_r14->to_json(j);
    }
    if (cqi_report_cfg_v1430.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1430");
      cqi_report_cfg_v1430->to_json(j);
    }
    if (semi_open_loop_r14_present) {
      j.write_bool("semiOpenLoop-r14", semi_open_loop_r14);
    }
    if (csi_rs_cfg_v1480.is_present()) {
      j.write_fieldname("csi-RS-Config-v1480");
      csi_rs_cfg_v1480->to_json(j);
    }
    if (phys_cfg_ded_stti_r15.is_present()) {
      j.write_fieldname("physicalConfigDedicatedSTTI-r15");
      phys_cfg_ded_stti_r15->to_json(j);
    }
    if (pdsch_cfg_ded_v1530.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1530");
      pdsch_cfg_ded_v1530->to_json(j);
    }
    if (pusch_cfg_ded_v1530.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-v1530");
      pusch_cfg_ded_v1530->to_json(j);
    }
    if (cqi_report_cfg_v1530.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1530");
      cqi_report_cfg_v1530->to_json(j);
    }
    if (ant_info_v1530.is_present()) {
      j.write_fieldname("antennaInfo-v1530");
      ant_info_v1530->to_json(j);
    }
    if (csi_rs_cfg_v1530.is_present()) {
      j.write_fieldname("csi-RS-Config-v1530");
      csi_rs_cfg_v1530->to_json(j);
    }
    if (ul_pwr_ctrl_ded_v1530.is_present()) {
      j.write_fieldname("uplinkPowerControlDedicated-v1530");
      ul_pwr_ctrl_ded_v1530->to_json(j);
    }
    if (semi_static_cfi_cfg_r15.is_present()) {
      j.write_fieldname("semiStaticCFI-Config-r15");
      semi_static_cfi_cfg_r15->to_json(j);
    }
    if (blind_pdsch_repeat_cfg_r15.is_present()) {
      j.write_fieldname("blindPDSCH-Repetition-Config-r15");
      blind_pdsch_repeat_cfg_r15->to_json(j);
    }
  }
  j.end_obj();
}

void phys_cfg_ded_s::ant_info_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_s::ant_info_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_, "phys_cfg_ded_s::ant_info_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::ant_info_c_::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_, "phys_cfg_ded_s::ant_info_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::ant_info_c_::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_, "phys_cfg_ded_s::ant_info_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_s::ant_info_r10_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_s::ant_info_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::explicit_value_r10:
      j.write_fieldname("explicitValue-r10");
      c.to_json(j);
      break;
    case types::default_value:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::ant_info_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::ant_info_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::explicit_value_r10:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::default_value:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::ant_info_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::ant_info_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::explicit_value_r10:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::default_value:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::ant_info_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_s::add_spec_emission_ca_r10_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_s::add_spec_emission_ca_r10_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_int("additionalSpectrumEmissionPCell-r10", c.add_spec_emission_pcell_r10);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::add_spec_emission_ca_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::add_spec_emission_ca_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.add_spec_emission_pcell_r10, (uint8_t)1u, (uint8_t)32u));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::add_spec_emission_ca_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::add_spec_emission_ca_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.add_spec_emission_pcell_r10, bref, (uint8_t)1u, (uint8_t)32u));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::add_spec_emission_ca_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_s::ce_mode_r13_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_s::ce_mode_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::ce_mode_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::ce_mode_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::ce_mode_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::ce_mode_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::ce_mode_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_s::type_a_srs_tpc_pdcch_group_r14_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_s::type_a_srs_tpc_pdcch_group_r14_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::type_a_srs_tpc_pdcch_group_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::type_a_srs_tpc_pdcch_group_r14_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, 1, 32));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::type_a_srs_tpc_pdcch_group_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::type_a_srs_tpc_pdcch_group_r14_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, bref, 1, 32));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::type_a_srs_tpc_pdcch_group_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_s::must_cfg_r14_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_s::must_cfg_r14_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("k-max-r14", c.k_max_r14.to_string());
      if (c.p_a_must_r14_present) {
        j.write_str("p-a-must-r14", c.p_a_must_r14.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::must_cfg_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::must_cfg_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.p_a_must_r14_present, 1));
      HANDLE_CODE(c.k_max_r14.pack(bref));
      if (c.p_a_must_r14_present) {
        HANDLE_CODE(c.p_a_must_r14.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::must_cfg_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::must_cfg_r14_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.p_a_must_r14_present, 1));
      HANDLE_CODE(c.k_max_r14.unpack(bref));
      if (c.p_a_must_r14_present) {
        HANDLE_CODE(c.p_a_must_r14.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::must_cfg_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::cfi_cfg_r15:
      c.destroy<cfi_cfg_r15_s>();
      break;
    case types::cfi_pattern_cfg_r15:
      c.destroy<cfi_pattern_cfg_r15_s>();
      break;
    default:
      break;
  }
}
void phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cfi_cfg_r15:
      c.init<cfi_cfg_r15_s>();
      break;
    case types::cfi_pattern_cfg_r15:
      c.init<cfi_pattern_cfg_r15_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_");
  }
}
phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_::setup_c_(
    const phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cfi_cfg_r15:
      c.init(other.c.get<cfi_cfg_r15_s>());
      break;
    case types::cfi_pattern_cfg_r15:
      c.init(other.c.get<cfi_pattern_cfg_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_");
  }
}
phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_& phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_::
                                                      operator=(const phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cfi_cfg_r15:
      c.set(other.c.get<cfi_cfg_r15_s>());
      break;
    case types::cfi_pattern_cfg_r15:
      c.set(other.c.get<cfi_pattern_cfg_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_");
  }

  return *this;
}
void phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cfi_cfg_r15:
      j.write_fieldname("cfi-Config-r15");
      c.get<cfi_cfg_r15_s>().to_json(j);
      break;
    case types::cfi_pattern_cfg_r15:
      j.write_fieldname("cfi-PatternConfig-r15");
      c.get<cfi_pattern_cfg_r15_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cfi_cfg_r15:
      HANDLE_CODE(c.get<cfi_cfg_r15_s>().pack(bref));
      break;
    case types::cfi_pattern_cfg_r15:
      HANDLE_CODE(c.get<cfi_pattern_cfg_r15_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cfi_cfg_r15:
      HANDLE_CODE(c.get<cfi_cfg_r15_s>().unpack(bref));
      break;
    case types::cfi_pattern_cfg_r15:
      HANDLE_CODE(c.get<cfi_pattern_cfg_r15_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::semi_static_cfi_cfg_r15_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_s::blind_pdsch_repeat_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_s::blind_pdsch_repeat_cfg_r15_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_bool("blindSubframePDSCH-Repetitions-r15", c.blind_sf_pdsch_repeats_r15);
      j.write_bool("blindSlotSubslotPDSCH-Repetitions-r15", c.blind_slot_subslot_pdsch_repeats_r15);
      if (c.max_num_sf_pdsch_repeats_r15_present) {
        j.write_str("maxNumber-SubframePDSCH-Repetitions-r15", c.max_num_sf_pdsch_repeats_r15.to_string());
      }
      if (c.max_num_slot_subslot_pdsch_repeats_r15_present) {
        j.write_str("maxNumber-SlotSubslotPDSCH-Repetitions-r15", c.max_num_slot_subslot_pdsch_repeats_r15.to_string());
      }
      if (c.rv_sf_pdsch_repeats_r15_present) {
        j.write_str("rv-SubframePDSCH-Repetitions-r15", c.rv_sf_pdsch_repeats_r15.to_string());
      }
      if (c.rv_slotsublot_pdsch_repeats_r15_present) {
        j.write_str("rv-SlotsublotPDSCH-Repetitions-r15", c.rv_slotsublot_pdsch_repeats_r15.to_string());
      }
      if (c.nof_processes_sf_pdsch_repeats_r15_present) {
        j.write_int("numberOfProcesses-SubframePDSCH-Repetitions-r15", c.nof_processes_sf_pdsch_repeats_r15);
      }
      if (c.nof_processes_slot_subslot_pdsch_repeats_r15_present) {
        j.write_int("numberOfProcesses-SlotSubslotPDSCH-Repetitions-r15",
                    c.nof_processes_slot_subslot_pdsch_repeats_r15);
      }
      if (c.mcs_restrict_sf_pdsch_repeats_r15_present) {
        j.write_str("mcs-restrictionSubframePDSCH-Repetitions-r15", c.mcs_restrict_sf_pdsch_repeats_r15.to_string());
      }
      if (c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present) {
        j.write_str("mcs-restrictionSlotSubslotPDSCH-Repetitions-r15",
                    c.mcs_restrict_slot_subslot_pdsch_repeats_r15.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::blind_pdsch_repeat_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_s::blind_pdsch_repeat_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.max_num_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.max_num_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.rv_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.rv_slotsublot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.nof_processes_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.nof_processes_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.mcs_restrict_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.blind_sf_pdsch_repeats_r15, 1));
      HANDLE_CODE(bref.pack(c.blind_slot_subslot_pdsch_repeats_r15, 1));
      if (c.max_num_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.max_num_sf_pdsch_repeats_r15.pack(bref));
      }
      if (c.max_num_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.max_num_slot_subslot_pdsch_repeats_r15.pack(bref));
      }
      if (c.rv_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.rv_sf_pdsch_repeats_r15.pack(bref));
      }
      if (c.rv_slotsublot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.rv_slotsublot_pdsch_repeats_r15.pack(bref));
      }
      if (c.nof_processes_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.nof_processes_sf_pdsch_repeats_r15, (uint8_t)1u, (uint8_t)16u));
      }
      if (c.nof_processes_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.nof_processes_slot_subslot_pdsch_repeats_r15, (uint8_t)1u, (uint8_t)16u));
      }
      if (c.mcs_restrict_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.mcs_restrict_sf_pdsch_repeats_r15.pack(bref));
      }
      if (c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.mcs_restrict_slot_subslot_pdsch_repeats_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::blind_pdsch_repeat_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_s::blind_pdsch_repeat_cfg_r15_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.max_num_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.max_num_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.rv_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.rv_slotsublot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.nof_processes_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.nof_processes_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.mcs_restrict_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.blind_sf_pdsch_repeats_r15, 1));
      HANDLE_CODE(bref.unpack(c.blind_slot_subslot_pdsch_repeats_r15, 1));
      if (c.max_num_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.max_num_sf_pdsch_repeats_r15.unpack(bref));
      }
      if (c.max_num_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.max_num_slot_subslot_pdsch_repeats_r15.unpack(bref));
      }
      if (c.rv_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.rv_sf_pdsch_repeats_r15.unpack(bref));
      }
      if (c.rv_slotsublot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.rv_slotsublot_pdsch_repeats_r15.unpack(bref));
      }
      if (c.nof_processes_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(unpack_integer(c.nof_processes_sf_pdsch_repeats_r15, bref, (uint8_t)1u, (uint8_t)16u));
      }
      if (c.nof_processes_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(unpack_integer(c.nof_processes_slot_subslot_pdsch_repeats_r15, bref, (uint8_t)1u, (uint8_t)16u));
      }
      if (c.mcs_restrict_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.mcs_restrict_sf_pdsch_repeats_r15.unpack(bref));
      }
      if (c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.mcs_restrict_slot_subslot_pdsch_repeats_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_s::blind_pdsch_repeat_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RLF-TimersAndConstants-r13 ::= CHOICE
void rlf_timers_and_consts_r13_c::set(types::options e)
{
  type_ = e;
}
void rlf_timers_and_consts_r13_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE rlf_timers_and_consts_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlf_timers_and_consts_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

SRSASN_CODE rlf_timers_and_consts_r13_c::setup_s_::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(t301_v1310.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= t310_v1330_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(t310_v1330_present, 1));
      if (t310_v1330_present) {
        HANDLE_CODE(t310_v1330.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlf_timers_and_consts_r13_c::setup_s_::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(t301_v1310.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(t310_v1330_present, 1));
      if (t310_v1330_present) {
        HANDLE_CODE(t310_v1330.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rlf_timers_and_consts_r13_c::setup_s_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t301-v1310", t301_v1310.to_string());
  if (ext) {
    if (t310_v1330_present) {
      j.write_str("t310-v1330", t310_v1330.to_string());
    }
  }
  j.end_obj();
}

// RLF-TimersAndConstants-r9 ::= CHOICE
void rlf_timers_and_consts_r9_c::set(types::options e)
{
  type_ = e;
}
void rlf_timers_and_consts_r9_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("t301-r9", c.t301_r9.to_string());
      j.write_str("t310-r9", c.t310_r9.to_string());
      j.write_str("n310-r9", c.n310_r9.to_string());
      j.write_str("t311-r9", c.t311_r9.to_string());
      j.write_str("n311-r9", c.n311_r9.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_r9_c");
  }
  j.end_obj();
}
SRSASN_CODE rlf_timers_and_consts_r9_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(c.t301_r9.pack(bref));
      HANDLE_CODE(c.t310_r9.pack(bref));
      HANDLE_CODE(c.n310_r9.pack(bref));
      HANDLE_CODE(c.t311_r9.pack(bref));
      HANDLE_CODE(c.n311_r9.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_r9_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlf_timers_and_consts_r9_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(c.t301_r9.unpack(bref));
      HANDLE_CODE(c.t310_r9.unpack(bref));
      HANDLE_CODE(c.n310_r9.unpack(bref));
      HANDLE_CODE(c.t311_r9.unpack(bref));
      HANDLE_CODE(c.n311_r9.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_r9_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReject-v1020-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reject_v1020_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(extended_wait_time_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (extended_wait_time_r10_present) {
    HANDLE_CODE(pack_integer(bref, extended_wait_time_r10, (uint16_t)1u, (uint16_t)1800u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reject_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(extended_wait_time_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (extended_wait_time_r10_present) {
    HANDLE_CODE(unpack_integer(extended_wait_time_r10, bref, (uint16_t)1u, (uint16_t)1800u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reject_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (extended_wait_time_r10_present) {
    j.write_int("extendedWaitTime-r10", extended_wait_time_r10);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SPS-Config ::= SEQUENCE
SRSASN_CODE sps_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(semi_persist_sched_c_rnti_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_dl_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_ul_present, 1));

  if (semi_persist_sched_c_rnti_present) {
    HANDLE_CODE(semi_persist_sched_c_rnti.pack(bref));
  }
  if (sps_cfg_dl_present) {
    HANDLE_CODE(sps_cfg_dl.pack(bref));
  }
  if (sps_cfg_ul_present) {
    HANDLE_CODE(sps_cfg_ul.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(semi_persist_sched_c_rnti_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_dl_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_ul_present, 1));

  if (semi_persist_sched_c_rnti_present) {
    HANDLE_CODE(semi_persist_sched_c_rnti.unpack(bref));
  }
  if (sps_cfg_dl_present) {
    HANDLE_CODE(sps_cfg_dl.unpack(bref));
  }
  if (sps_cfg_ul_present) {
    HANDLE_CODE(sps_cfg_ul.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sps_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (semi_persist_sched_c_rnti_present) {
    j.write_str("semiPersistSchedC-RNTI", semi_persist_sched_c_rnti.to_string());
  }
  if (sps_cfg_dl_present) {
    j.write_fieldname("sps-ConfigDL");
    sps_cfg_dl.to_json(j);
  }
  if (sps_cfg_ul_present) {
    j.write_fieldname("sps-ConfigUL");
    sps_cfg_ul.to_json(j);
  }
  j.end_obj();
}

// SPS-Config-v1430 ::= SEQUENCE
SRSASN_CODE sps_cfg_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_sps_v_rnti_r14_present, 1));
  HANDLE_CODE(bref.pack(sl_sps_v_rnti_r14_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_ul_to_add_mod_list_r14_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_ul_to_release_list_r14_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_sl_to_add_mod_list_r14_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_sl_to_release_list_r14_present, 1));

  if (ul_sps_v_rnti_r14_present) {
    HANDLE_CODE(ul_sps_v_rnti_r14.pack(bref));
  }
  if (sl_sps_v_rnti_r14_present) {
    HANDLE_CODE(sl_sps_v_rnti_r14.pack(bref));
  }
  if (sps_cfg_ul_to_add_mod_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_cfg_ul_to_add_mod_list_r14, 1, 8));
  }
  if (sps_cfg_ul_to_release_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_cfg_ul_to_release_list_r14, 1, 8, integer_packer<uint8_t>(1, 8)));
  }
  if (sps_cfg_sl_to_add_mod_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_cfg_sl_to_add_mod_list_r14, 1, 8));
  }
  if (sps_cfg_sl_to_release_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_cfg_sl_to_release_list_r14, 1, 8, integer_packer<uint8_t>(1, 8)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_sps_v_rnti_r14_present, 1));
  HANDLE_CODE(bref.unpack(sl_sps_v_rnti_r14_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_ul_to_add_mod_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_ul_to_release_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_sl_to_add_mod_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_sl_to_release_list_r14_present, 1));

  if (ul_sps_v_rnti_r14_present) {
    HANDLE_CODE(ul_sps_v_rnti_r14.unpack(bref));
  }
  if (sl_sps_v_rnti_r14_present) {
    HANDLE_CODE(sl_sps_v_rnti_r14.unpack(bref));
  }
  if (sps_cfg_ul_to_add_mod_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_cfg_ul_to_add_mod_list_r14, bref, 1, 8));
  }
  if (sps_cfg_ul_to_release_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_cfg_ul_to_release_list_r14, bref, 1, 8, integer_packer<uint8_t>(1, 8)));
  }
  if (sps_cfg_sl_to_add_mod_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_cfg_sl_to_add_mod_list_r14, bref, 1, 8));
  }
  if (sps_cfg_sl_to_release_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_cfg_sl_to_release_list_r14, bref, 1, 8, integer_packer<uint8_t>(1, 8)));
  }

  return SRSASN_SUCCESS;
}
void sps_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ul_sps_v_rnti_r14_present) {
    j.write_str("ul-SPS-V-RNTI-r14", ul_sps_v_rnti_r14.to_string());
  }
  if (sl_sps_v_rnti_r14_present) {
    j.write_str("sl-SPS-V-RNTI-r14", sl_sps_v_rnti_r14.to_string());
  }
  if (sps_cfg_ul_to_add_mod_list_r14_present) {
    j.start_array("sps-ConfigUL-ToAddModList-r14");
    for (const auto& e1 : sps_cfg_ul_to_add_mod_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (sps_cfg_ul_to_release_list_r14_present) {
    j.start_array("sps-ConfigUL-ToReleaseList-r14");
    for (const auto& e1 : sps_cfg_ul_to_release_list_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (sps_cfg_sl_to_add_mod_list_r14_present) {
    j.start_array("sps-ConfigSL-ToAddModList-r14");
    for (const auto& e1 : sps_cfg_sl_to_add_mod_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (sps_cfg_sl_to_release_list_r14_present) {
    j.start_array("sps-ConfigSL-ToReleaseList-r14");
    for (const auto& e1 : sps_cfg_sl_to_release_list_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.end_obj();
}

// SPS-Config-v1530 ::= SEQUENCE
SRSASN_CODE sps_cfg_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(semi_persist_sched_c_rnti_r15_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_dl_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_ul_stti_to_add_mod_list_r15_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_ul_stti_to_release_list_r15_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_ul_to_add_mod_list_r15_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_ul_to_release_list_r15_present, 1));

  if (semi_persist_sched_c_rnti_r15_present) {
    HANDLE_CODE(semi_persist_sched_c_rnti_r15.pack(bref));
  }
  if (sps_cfg_dl_present) {
    HANDLE_CODE(sps_cfg_dl.pack(bref));
  }
  if (sps_cfg_ul_stti_to_add_mod_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_cfg_ul_stti_to_add_mod_list_r15, 1, 6));
  }
  if (sps_cfg_ul_stti_to_release_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_cfg_ul_stti_to_release_list_r15, 1, 6, integer_packer<uint8_t>(1, 6)));
  }
  if (sps_cfg_ul_to_add_mod_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_cfg_ul_to_add_mod_list_r15, 1, 6));
  }
  if (sps_cfg_ul_to_release_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_cfg_ul_to_release_list_r15, 1, 6, integer_packer<uint8_t>(1, 6)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(semi_persist_sched_c_rnti_r15_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_dl_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_ul_stti_to_add_mod_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_ul_stti_to_release_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_ul_to_add_mod_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_ul_to_release_list_r15_present, 1));

  if (semi_persist_sched_c_rnti_r15_present) {
    HANDLE_CODE(semi_persist_sched_c_rnti_r15.unpack(bref));
  }
  if (sps_cfg_dl_present) {
    HANDLE_CODE(sps_cfg_dl.unpack(bref));
  }
  if (sps_cfg_ul_stti_to_add_mod_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_cfg_ul_stti_to_add_mod_list_r15, bref, 1, 6));
  }
  if (sps_cfg_ul_stti_to_release_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_cfg_ul_stti_to_release_list_r15, bref, 1, 6, integer_packer<uint8_t>(1, 6)));
  }
  if (sps_cfg_ul_to_add_mod_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_cfg_ul_to_add_mod_list_r15, bref, 1, 6));
  }
  if (sps_cfg_ul_to_release_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_cfg_ul_to_release_list_r15, bref, 1, 6, integer_packer<uint8_t>(1, 6)));
  }

  return SRSASN_SUCCESS;
}
void sps_cfg_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (semi_persist_sched_c_rnti_r15_present) {
    j.write_str("semiPersistSchedC-RNTI-r15", semi_persist_sched_c_rnti_r15.to_string());
  }
  if (sps_cfg_dl_present) {
    j.write_fieldname("sps-ConfigDL");
    sps_cfg_dl.to_json(j);
  }
  if (sps_cfg_ul_stti_to_add_mod_list_r15_present) {
    j.start_array("sps-ConfigUL-STTI-ToAddModList-r15");
    for (const auto& e1 : sps_cfg_ul_stti_to_add_mod_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (sps_cfg_ul_stti_to_release_list_r15_present) {
    j.start_array("sps-ConfigUL-STTI-ToReleaseList-r15");
    for (const auto& e1 : sps_cfg_ul_stti_to_release_list_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (sps_cfg_ul_to_add_mod_list_r15_present) {
    j.start_array("sps-ConfigUL-ToAddModList-r15");
    for (const auto& e1 : sps_cfg_ul_to_add_mod_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (sps_cfg_ul_to_release_list_r15_present) {
    j.start_array("sps-ConfigUL-ToReleaseList-r15");
    for (const auto& e1 : sps_cfg_ul_to_release_list_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.end_obj();
}

// IdleModeMobilityControlInfo ::= SEQUENCE
SRSASN_CODE idle_mode_mob_ctrl_info_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(freq_prio_list_eutra_present, 1));
  HANDLE_CODE(bref.pack(freq_prio_list_geran_present, 1));
  HANDLE_CODE(bref.pack(freq_prio_list_utra_fdd_present, 1));
  HANDLE_CODE(bref.pack(freq_prio_list_utra_tdd_present, 1));
  HANDLE_CODE(bref.pack(band_class_prio_list_hrpd_present, 1));
  HANDLE_CODE(bref.pack(band_class_prio_list1_xrtt_present, 1));
  HANDLE_CODE(bref.pack(t320_present, 1));

  if (freq_prio_list_eutra_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, freq_prio_list_eutra, 1, 8));
  }
  if (freq_prio_list_geran_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, freq_prio_list_geran, 1, 16));
  }
  if (freq_prio_list_utra_fdd_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, freq_prio_list_utra_fdd, 1, 16));
  }
  if (freq_prio_list_utra_tdd_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, freq_prio_list_utra_tdd, 1, 16));
  }
  if (band_class_prio_list_hrpd_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_class_prio_list_hrpd, 1, 32));
  }
  if (band_class_prio_list1_xrtt_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_class_prio_list1_xrtt, 1, 32));
  }
  if (t320_present) {
    HANDLE_CODE(t320.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= freq_prio_list_ext_eutra_r12.is_present();
    group_flags[1] |= freq_prio_list_eutra_v1310.is_present();
    group_flags[1] |= freq_prio_list_ext_eutra_v1310.is_present();
    group_flags[2] |= freq_prio_list_nr_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(freq_prio_list_ext_eutra_r12.is_present(), 1));
      if (freq_prio_list_ext_eutra_r12.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *freq_prio_list_ext_eutra_r12, 1, 8));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(freq_prio_list_eutra_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(freq_prio_list_ext_eutra_v1310.is_present(), 1));
      if (freq_prio_list_eutra_v1310.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *freq_prio_list_eutra_v1310, 1, 8));
      }
      if (freq_prio_list_ext_eutra_v1310.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *freq_prio_list_ext_eutra_v1310, 1, 8));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(freq_prio_list_nr_r15.is_present(), 1));
      if (freq_prio_list_nr_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *freq_prio_list_nr_r15, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE idle_mode_mob_ctrl_info_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(freq_prio_list_eutra_present, 1));
  HANDLE_CODE(bref.unpack(freq_prio_list_geran_present, 1));
  HANDLE_CODE(bref.unpack(freq_prio_list_utra_fdd_present, 1));
  HANDLE_CODE(bref.unpack(freq_prio_list_utra_tdd_present, 1));
  HANDLE_CODE(bref.unpack(band_class_prio_list_hrpd_present, 1));
  HANDLE_CODE(bref.unpack(band_class_prio_list1_xrtt_present, 1));
  HANDLE_CODE(bref.unpack(t320_present, 1));

  if (freq_prio_list_eutra_present) {
    HANDLE_CODE(unpack_dyn_seq_of(freq_prio_list_eutra, bref, 1, 8));
  }
  if (freq_prio_list_geran_present) {
    HANDLE_CODE(unpack_dyn_seq_of(freq_prio_list_geran, bref, 1, 16));
  }
  if (freq_prio_list_utra_fdd_present) {
    HANDLE_CODE(unpack_dyn_seq_of(freq_prio_list_utra_fdd, bref, 1, 16));
  }
  if (freq_prio_list_utra_tdd_present) {
    HANDLE_CODE(unpack_dyn_seq_of(freq_prio_list_utra_tdd, bref, 1, 16));
  }
  if (band_class_prio_list_hrpd_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_class_prio_list_hrpd, bref, 1, 32));
  }
  if (band_class_prio_list1_xrtt_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_class_prio_list1_xrtt, bref, 1, 32));
  }
  if (t320_present) {
    HANDLE_CODE(t320.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool freq_prio_list_ext_eutra_r12_present;
      HANDLE_CODE(bref.unpack(freq_prio_list_ext_eutra_r12_present, 1));
      freq_prio_list_ext_eutra_r12.set_present(freq_prio_list_ext_eutra_r12_present);
      if (freq_prio_list_ext_eutra_r12.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*freq_prio_list_ext_eutra_r12, bref, 1, 8));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool freq_prio_list_eutra_v1310_present;
      HANDLE_CODE(bref.unpack(freq_prio_list_eutra_v1310_present, 1));
      freq_prio_list_eutra_v1310.set_present(freq_prio_list_eutra_v1310_present);
      bool freq_prio_list_ext_eutra_v1310_present;
      HANDLE_CODE(bref.unpack(freq_prio_list_ext_eutra_v1310_present, 1));
      freq_prio_list_ext_eutra_v1310.set_present(freq_prio_list_ext_eutra_v1310_present);
      if (freq_prio_list_eutra_v1310.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*freq_prio_list_eutra_v1310, bref, 1, 8));
      }
      if (freq_prio_list_ext_eutra_v1310.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*freq_prio_list_ext_eutra_v1310, bref, 1, 8));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool freq_prio_list_nr_r15_present;
      HANDLE_CODE(bref.unpack(freq_prio_list_nr_r15_present, 1));
      freq_prio_list_nr_r15.set_present(freq_prio_list_nr_r15_present);
      if (freq_prio_list_nr_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*freq_prio_list_nr_r15, bref, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void idle_mode_mob_ctrl_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (freq_prio_list_eutra_present) {
    j.start_array("freqPriorityListEUTRA");
    for (const auto& e1 : freq_prio_list_eutra) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (freq_prio_list_geran_present) {
    j.start_array("freqPriorityListGERAN");
    for (const auto& e1 : freq_prio_list_geran) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (freq_prio_list_utra_fdd_present) {
    j.start_array("freqPriorityListUTRA-FDD");
    for (const auto& e1 : freq_prio_list_utra_fdd) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (freq_prio_list_utra_tdd_present) {
    j.start_array("freqPriorityListUTRA-TDD");
    for (const auto& e1 : freq_prio_list_utra_tdd) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (band_class_prio_list_hrpd_present) {
    j.start_array("bandClassPriorityListHRPD");
    for (const auto& e1 : band_class_prio_list_hrpd) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (band_class_prio_list1_xrtt_present) {
    j.start_array("bandClassPriorityList1XRTT");
    for (const auto& e1 : band_class_prio_list1_xrtt) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (t320_present) {
    j.write_str("t320", t320.to_string());
  }
  if (ext) {
    if (freq_prio_list_ext_eutra_r12.is_present()) {
      j.start_array("freqPriorityListExtEUTRA-r12");
      for (const auto& e1 : *freq_prio_list_ext_eutra_r12) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (freq_prio_list_eutra_v1310.is_present()) {
      j.start_array("freqPriorityListEUTRA-v1310");
      for (const auto& e1 : *freq_prio_list_eutra_v1310) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (freq_prio_list_ext_eutra_v1310.is_present()) {
      j.start_array("freqPriorityListExtEUTRA-v1310");
      for (const auto& e1 : *freq_prio_list_ext_eutra_v1310) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (freq_prio_list_nr_r15.is_present()) {
      j.start_array("freqPriorityListNR-r15");
      for (const auto& e1 : *freq_prio_list_nr_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// IdleModeMobilityControlInfo-v9e0 ::= SEQUENCE
SRSASN_CODE idle_mode_mob_ctrl_info_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, freq_prio_list_eutra_v9e0, 1, 8));

  return SRSASN_SUCCESS;
}
SRSASN_CODE idle_mode_mob_ctrl_info_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(freq_prio_list_eutra_v9e0, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void idle_mode_mob_ctrl_info_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("freqPriorityListEUTRA-v9e0");
  for (const auto& e1 : freq_prio_list_eutra_v9e0) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// RRCConnectionReestablishment-v8a0-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_v8a0_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_conn_reest_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));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_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();
}

// RRCConnectionReestablishmentReject-v8a0-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_reject_v8a0_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_conn_reest_reject_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));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_reject_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();
}

// RRCConnectionReject-v8a0-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reject_v8a0_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_reject_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reject_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionSetup-v8a0-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_v8a0_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_conn_setup_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));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_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();
}

// RadioResourceConfigDedicated ::= SEQUENCE
SRSASN_CODE rr_cfg_ded_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(srb_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(drb_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(drb_to_release_list_present, 1));
  HANDLE_CODE(bref.pack(mac_main_cfg_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_present, 1));
  HANDLE_CODE(bref.pack(phys_cfg_ded_present, 1));

  if (srb_to_add_mod_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, srb_to_add_mod_list, 1, 2));
  }
  if (drb_to_add_mod_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_to_add_mod_list, 1, 11));
  }
  if (drb_to_release_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_to_release_list, 1, 11, integer_packer<uint8_t>(1, 32)));
  }
  if (mac_main_cfg_present) {
    HANDLE_CODE(mac_main_cfg.pack(bref));
  }
  if (sps_cfg_present) {
    HANDLE_CODE(sps_cfg.pack(bref));
  }
  if (phys_cfg_ded_present) {
    HANDLE_CODE(phys_cfg_ded.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= rlf_timers_and_consts_r9.is_present();
    group_flags[1] |= meas_sf_pattern_pcell_r10.is_present();
    group_flags[2] |= neigh_cells_crs_info_r11.is_present();
    group_flags[3] |= naics_info_r12.is_present();
    group_flags[4] |= neigh_cells_crs_info_r13.is_present();
    group_flags[4] |= rlf_timers_and_consts_r13.is_present();
    group_flags[5] |= sps_cfg_v1430.is_present();
    group_flags[6] |= srb_to_add_mod_ext_list_r15.is_present();
    group_flags[6] |= srb_to_release_ext_list_r15_present;
    group_flags[6] |= sps_cfg_v1530.is_present();
    group_flags[6] |= crs_intf_mitig_cfg_r15.is_present();
    group_flags[6] |= neigh_cells_crs_info_r15.is_present();
    group_flags[6] |= drb_to_add_mod_list_r15.is_present();
    group_flags[6] |= drb_to_release_list_r15.is_present();
    group_flags[6] |= srb_to_release_list_dupl_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rlf_timers_and_consts_r9.is_present(), 1));
      if (rlf_timers_and_consts_r9.is_present()) {
        HANDLE_CODE(rlf_timers_and_consts_r9->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_sf_pattern_pcell_r10.is_present(), 1));
      if (meas_sf_pattern_pcell_r10.is_present()) {
        HANDLE_CODE(meas_sf_pattern_pcell_r10->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(neigh_cells_crs_info_r11.is_present(), 1));
      if (neigh_cells_crs_info_r11.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r11->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(naics_info_r12.is_present(), 1));
      if (naics_info_r12.is_present()) {
        HANDLE_CODE(naics_info_r12->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(neigh_cells_crs_info_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(rlf_timers_and_consts_r13.is_present(), 1));
      if (neigh_cells_crs_info_r13.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r13->pack(bref));
      }
      if (rlf_timers_and_consts_r13.is_present()) {
        HANDLE_CODE(rlf_timers_and_consts_r13->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sps_cfg_v1430.is_present(), 1));
      if (sps_cfg_v1430.is_present()) {
        HANDLE_CODE(sps_cfg_v1430->pack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(srb_to_add_mod_ext_list_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(srb_to_release_ext_list_r15_present, 1));
      HANDLE_CODE(bref.pack(sps_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(crs_intf_mitig_cfg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(neigh_cells_crs_info_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(drb_to_add_mod_list_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(drb_to_release_list_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(srb_to_release_list_dupl_r15.is_present(), 1));
      if (srb_to_add_mod_ext_list_r15.is_present()) {
        HANDLE_CODE(pack_fixed_seq_of(bref, &(*srb_to_add_mod_ext_list_r15)[0], srb_to_add_mod_ext_list_r15->size()));
      }
      if (srb_to_release_ext_list_r15_present) {
        HANDLE_CODE(pack_integer(bref, srb_to_release_ext_list_r15, (uint8_t)4u, (uint8_t)4u));
      }
      if (sps_cfg_v1530.is_present()) {
        HANDLE_CODE(sps_cfg_v1530->pack(bref));
      }
      if (crs_intf_mitig_cfg_r15.is_present()) {
        HANDLE_CODE(crs_intf_mitig_cfg_r15->pack(bref));
      }
      if (neigh_cells_crs_info_r15.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r15->pack(bref));
      }
      if (drb_to_add_mod_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *drb_to_add_mod_list_r15, 1, 15));
      }
      if (drb_to_release_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *drb_to_release_list_r15, 1, 15, integer_packer<uint8_t>(1, 32)));
      }
      if (srb_to_release_list_dupl_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srb_to_release_list_dupl_r15, 1, 2, integer_packer<uint8_t>(1, 2)));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_ded_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(srb_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(drb_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(drb_to_release_list_present, 1));
  HANDLE_CODE(bref.unpack(mac_main_cfg_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_present, 1));
  HANDLE_CODE(bref.unpack(phys_cfg_ded_present, 1));

  if (srb_to_add_mod_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(srb_to_add_mod_list, bref, 1, 2));
  }
  if (drb_to_add_mod_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_to_add_mod_list, bref, 1, 11));
  }
  if (drb_to_release_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_to_release_list, bref, 1, 11, integer_packer<uint8_t>(1, 32)));
  }
  if (mac_main_cfg_present) {
    HANDLE_CODE(mac_main_cfg.unpack(bref));
  }
  if (sps_cfg_present) {
    HANDLE_CODE(sps_cfg.unpack(bref));
  }
  if (phys_cfg_ded_present) {
    HANDLE_CODE(phys_cfg_ded.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(7);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool rlf_timers_and_consts_r9_present;
      HANDLE_CODE(bref.unpack(rlf_timers_and_consts_r9_present, 1));
      rlf_timers_and_consts_r9.set_present(rlf_timers_and_consts_r9_present);
      if (rlf_timers_and_consts_r9.is_present()) {
        HANDLE_CODE(rlf_timers_and_consts_r9->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_sf_pattern_pcell_r10_present;
      HANDLE_CODE(bref.unpack(meas_sf_pattern_pcell_r10_present, 1));
      meas_sf_pattern_pcell_r10.set_present(meas_sf_pattern_pcell_r10_present);
      if (meas_sf_pattern_pcell_r10.is_present()) {
        HANDLE_CODE(meas_sf_pattern_pcell_r10->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool neigh_cells_crs_info_r11_present;
      HANDLE_CODE(bref.unpack(neigh_cells_crs_info_r11_present, 1));
      neigh_cells_crs_info_r11.set_present(neigh_cells_crs_info_r11_present);
      if (neigh_cells_crs_info_r11.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r11->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool naics_info_r12_present;
      HANDLE_CODE(bref.unpack(naics_info_r12_present, 1));
      naics_info_r12.set_present(naics_info_r12_present);
      if (naics_info_r12.is_present()) {
        HANDLE_CODE(naics_info_r12->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool neigh_cells_crs_info_r13_present;
      HANDLE_CODE(bref.unpack(neigh_cells_crs_info_r13_present, 1));
      neigh_cells_crs_info_r13.set_present(neigh_cells_crs_info_r13_present);
      bool rlf_timers_and_consts_r13_present;
      HANDLE_CODE(bref.unpack(rlf_timers_and_consts_r13_present, 1));
      rlf_timers_and_consts_r13.set_present(rlf_timers_and_consts_r13_present);
      if (neigh_cells_crs_info_r13.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r13->unpack(bref));
      }
      if (rlf_timers_and_consts_r13.is_present()) {
        HANDLE_CODE(rlf_timers_and_consts_r13->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool sps_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(sps_cfg_v1430_present, 1));
      sps_cfg_v1430.set_present(sps_cfg_v1430_present);
      if (sps_cfg_v1430.is_present()) {
        HANDLE_CODE(sps_cfg_v1430->unpack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool srb_to_add_mod_ext_list_r15_present;
      HANDLE_CODE(bref.unpack(srb_to_add_mod_ext_list_r15_present, 1));
      srb_to_add_mod_ext_list_r15.set_present(srb_to_add_mod_ext_list_r15_present);
      HANDLE_CODE(bref.unpack(srb_to_release_ext_list_r15_present, 1));
      bool sps_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(sps_cfg_v1530_present, 1));
      sps_cfg_v1530.set_present(sps_cfg_v1530_present);
      bool crs_intf_mitig_cfg_r15_present;
      HANDLE_CODE(bref.unpack(crs_intf_mitig_cfg_r15_present, 1));
      crs_intf_mitig_cfg_r15.set_present(crs_intf_mitig_cfg_r15_present);
      bool neigh_cells_crs_info_r15_present;
      HANDLE_CODE(bref.unpack(neigh_cells_crs_info_r15_present, 1));
      neigh_cells_crs_info_r15.set_present(neigh_cells_crs_info_r15_present);
      bool drb_to_add_mod_list_r15_present;
      HANDLE_CODE(bref.unpack(drb_to_add_mod_list_r15_present, 1));
      drb_to_add_mod_list_r15.set_present(drb_to_add_mod_list_r15_present);
      bool drb_to_release_list_r15_present;
      HANDLE_CODE(bref.unpack(drb_to_release_list_r15_present, 1));
      drb_to_release_list_r15.set_present(drb_to_release_list_r15_present);
      bool srb_to_release_list_dupl_r15_present;
      HANDLE_CODE(bref.unpack(srb_to_release_list_dupl_r15_present, 1));
      srb_to_release_list_dupl_r15.set_present(srb_to_release_list_dupl_r15_present);
      if (srb_to_add_mod_ext_list_r15.is_present()) {
        HANDLE_CODE(unpack_fixed_seq_of(&(*srb_to_add_mod_ext_list_r15)[0], bref, srb_to_add_mod_ext_list_r15->size()));
      }
      if (srb_to_release_ext_list_r15_present) {
        HANDLE_CODE(unpack_integer(srb_to_release_ext_list_r15, bref, (uint8_t)4u, (uint8_t)4u));
      }
      if (sps_cfg_v1530.is_present()) {
        HANDLE_CODE(sps_cfg_v1530->unpack(bref));
      }
      if (crs_intf_mitig_cfg_r15.is_present()) {
        HANDLE_CODE(crs_intf_mitig_cfg_r15->unpack(bref));
      }
      if (neigh_cells_crs_info_r15.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r15->unpack(bref));
      }
      if (drb_to_add_mod_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*drb_to_add_mod_list_r15, bref, 1, 15));
      }
      if (drb_to_release_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*drb_to_release_list_r15, bref, 1, 15, integer_packer<uint8_t>(1, 32)));
      }
      if (srb_to_release_list_dupl_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srb_to_release_list_dupl_r15, bref, 1, 2, integer_packer<uint8_t>(1, 2)));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rr_cfg_ded_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (srb_to_add_mod_list_present) {
    j.start_array("srb-ToAddModList");
    for (const auto& e1 : srb_to_add_mod_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (drb_to_add_mod_list_present) {
    j.start_array("drb-ToAddModList");
    for (const auto& e1 : drb_to_add_mod_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (drb_to_release_list_present) {
    j.start_array("drb-ToReleaseList");
    for (const auto& e1 : drb_to_release_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (mac_main_cfg_present) {
    j.write_fieldname("mac-MainConfig");
    mac_main_cfg.to_json(j);
  }
  if (sps_cfg_present) {
    j.write_fieldname("sps-Config");
    sps_cfg.to_json(j);
  }
  if (phys_cfg_ded_present) {
    j.write_fieldname("physicalConfigDedicated");
    phys_cfg_ded.to_json(j);
  }
  if (ext) {
    if (rlf_timers_and_consts_r9.is_present()) {
      j.write_fieldname("rlf-TimersAndConstants-r9");
      rlf_timers_and_consts_r9->to_json(j);
    }
    if (meas_sf_pattern_pcell_r10.is_present()) {
      j.write_fieldname("measSubframePatternPCell-r10");
      meas_sf_pattern_pcell_r10->to_json(j);
    }
    if (neigh_cells_crs_info_r11.is_present()) {
      j.write_fieldname("neighCellsCRS-Info-r11");
      neigh_cells_crs_info_r11->to_json(j);
    }
    if (naics_info_r12.is_present()) {
      j.write_fieldname("naics-Info-r12");
      naics_info_r12->to_json(j);
    }
    if (neigh_cells_crs_info_r13.is_present()) {
      j.write_fieldname("neighCellsCRS-Info-r13");
      neigh_cells_crs_info_r13->to_json(j);
    }
    if (rlf_timers_and_consts_r13.is_present()) {
      j.write_fieldname("rlf-TimersAndConstants-r13");
      rlf_timers_and_consts_r13->to_json(j);
    }
    if (sps_cfg_v1430.is_present()) {
      j.write_fieldname("sps-Config-v1430");
      sps_cfg_v1430->to_json(j);
    }
    if (srb_to_add_mod_ext_list_r15.is_present()) {
      j.start_array("srb-ToAddModExtList-r15");
      for (const auto& e1 : *srb_to_add_mod_ext_list_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (srb_to_release_ext_list_r15_present) {
      j.write_int("srb-ToReleaseExtList-r15", srb_to_release_ext_list_r15);
    }
    if (sps_cfg_v1530.is_present()) {
      j.write_fieldname("sps-Config-v1530");
      sps_cfg_v1530->to_json(j);
    }
    if (crs_intf_mitig_cfg_r15.is_present()) {
      j.write_fieldname("crs-IntfMitigConfig-r15");
      crs_intf_mitig_cfg_r15->to_json(j);
    }
    if (neigh_cells_crs_info_r15.is_present()) {
      j.write_fieldname("neighCellsCRS-Info-r15");
      neigh_cells_crs_info_r15->to_json(j);
    }
    if (drb_to_add_mod_list_r15.is_present()) {
      j.start_array("drb-ToAddModList-r15");
      for (const auto& e1 : *drb_to_add_mod_list_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (drb_to_release_list_r15.is_present()) {
      j.start_array("drb-ToReleaseList-r15");
      for (const auto& e1 : *drb_to_release_list_r15) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (srb_to_release_list_dupl_r15.is_present()) {
      j.start_array("srb-ToReleaseListDupl-r15");
      for (const auto& e1 : *srb_to_release_list_dupl_r15) {
        j.write_int(e1);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

void rr_cfg_ded_s::mac_main_cfg_c_::set(types::options e)
{
  type_ = e;
}
void rr_cfg_ded_s::mac_main_cfg_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_, "rr_cfg_ded_s::mac_main_cfg_c_");
  }
  j.end_obj();
}
SRSASN_CODE rr_cfg_ded_s::mac_main_cfg_c_::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_, "rr_cfg_ded_s::mac_main_cfg_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_ded_s::mac_main_cfg_c_::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_, "rr_cfg_ded_s::mac_main_cfg_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::setup_c_::set(types::options e)
{
  type_ = e;
}
void rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::crs_intf_mitig_enabled_minus15:
      break;
    case types::crs_intf_mitig_num_prbs_r15:
      j.write_str("crs-IntfMitigNumPRBs-r15", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::crs_intf_mitig_enabled_minus15:
      break;
    case types::crs_intf_mitig_num_prbs_r15:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::crs_intf_mitig_enabled_minus15:
      break;
    case types::crs_intf_mitig_num_prbs_r15:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rr_cfg_ded_s::crs_intf_mitig_cfg_r15_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RedirectedCarrierInfo-r15-IEs ::= CHOICE
void redirected_carrier_info_r15_ies_c::destroy_()
{
  switch (type_) {
    case types::geran_r15:
      c.destroy<carrier_freqs_geran_s>();
      break;
    case types::cdma2000_hrpd_r15:
      c.destroy<carrier_freq_cdma2000_s>();
      break;
    case types::cdma2000_minus1x_rtt_r15:
      c.destroy<carrier_freq_cdma2000_s>();
      break;
    case types::utra_tdd_r15:
      c.destroy<carrier_freq_list_utra_tdd_r10_l>();
      break;
    default:
      break;
  }
}
void redirected_carrier_info_r15_ies_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::eutra_r15:
      break;
    case types::geran_r15:
      c.init<carrier_freqs_geran_s>();
      break;
    case types::utra_fdd_r15:
      break;
    case types::cdma2000_hrpd_r15:
      c.init<carrier_freq_cdma2000_s>();
      break;
    case types::cdma2000_minus1x_rtt_r15:
      c.init<carrier_freq_cdma2000_s>();
      break;
    case types::utra_tdd_r15:
      c.init<carrier_freq_list_utra_tdd_r10_l>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_r15_ies_c");
  }
}
redirected_carrier_info_r15_ies_c::redirected_carrier_info_r15_ies_c(const redirected_carrier_info_r15_ies_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::eutra_r15:
      c.init(other.c.get<uint32_t>());
      break;
    case types::geran_r15:
      c.init(other.c.get<carrier_freqs_geran_s>());
      break;
    case types::utra_fdd_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::cdma2000_hrpd_r15:
      c.init(other.c.get<carrier_freq_cdma2000_s>());
      break;
    case types::cdma2000_minus1x_rtt_r15:
      c.init(other.c.get<carrier_freq_cdma2000_s>());
      break;
    case types::utra_tdd_r15:
      c.init(other.c.get<carrier_freq_list_utra_tdd_r10_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_r15_ies_c");
  }
}
redirected_carrier_info_r15_ies_c& redirected_carrier_info_r15_ies_c::
                                   operator=(const redirected_carrier_info_r15_ies_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::eutra_r15:
      c.set(other.c.get<uint32_t>());
      break;
    case types::geran_r15:
      c.set(other.c.get<carrier_freqs_geran_s>());
      break;
    case types::utra_fdd_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::cdma2000_hrpd_r15:
      c.set(other.c.get<carrier_freq_cdma2000_s>());
      break;
    case types::cdma2000_minus1x_rtt_r15:
      c.set(other.c.get<carrier_freq_cdma2000_s>());
      break;
    case types::utra_tdd_r15:
      c.set(other.c.get<carrier_freq_list_utra_tdd_r10_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_r15_ies_c");
  }

  return *this;
}
void redirected_carrier_info_r15_ies_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::eutra_r15:
      j.write_int("eutra-r15", c.get<uint32_t>());
      break;
    case types::geran_r15:
      j.write_fieldname("geran-r15");
      c.get<carrier_freqs_geran_s>().to_json(j);
      break;
    case types::utra_fdd_r15:
      j.write_int("utra-FDD-r15", c.get<uint16_t>());
      break;
    case types::cdma2000_hrpd_r15:
      j.write_fieldname("cdma2000-HRPD-r15");
      c.get<carrier_freq_cdma2000_s>().to_json(j);
      break;
    case types::cdma2000_minus1x_rtt_r15:
      j.write_fieldname("cdma2000-1xRTT-r15");
      c.get<carrier_freq_cdma2000_s>().to_json(j);
      break;
    case types::utra_tdd_r15:
      j.start_array("utra-TDD-r15");
      for (const auto& e1 : c.get<carrier_freq_list_utra_tdd_r10_l>()) {
        j.write_int(e1);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_r15_ies_c");
  }
  j.end_obj();
}
SRSASN_CODE redirected_carrier_info_r15_ies_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::eutra_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint32_t>(), (uint32_t)0u, (uint32_t)262143u));
      break;
    case types::geran_r15:
      HANDLE_CODE(c.get<carrier_freqs_geran_s>().pack(bref));
      break;
    case types::utra_fdd_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)16383u));
      break;
    case types::cdma2000_hrpd_r15:
      HANDLE_CODE(c.get<carrier_freq_cdma2000_s>().pack(bref));
      break;
    case types::cdma2000_minus1x_rtt_r15:
      HANDLE_CODE(c.get<carrier_freq_cdma2000_s>().pack(bref));
      break;
    case types::utra_tdd_r15:
      HANDLE_CODE(
          pack_dyn_seq_of(bref, c.get<carrier_freq_list_utra_tdd_r10_l>(), 1, 6, integer_packer<uint16_t>(0, 16383)));
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_r15_ies_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE redirected_carrier_info_r15_ies_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::eutra_r15:
      HANDLE_CODE(unpack_integer(c.get<uint32_t>(), bref, (uint32_t)0u, (uint32_t)262143u));
      break;
    case types::geran_r15:
      HANDLE_CODE(c.get<carrier_freqs_geran_s>().unpack(bref));
      break;
    case types::utra_fdd_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)16383u));
      break;
    case types::cdma2000_hrpd_r15:
      HANDLE_CODE(c.get<carrier_freq_cdma2000_s>().unpack(bref));
      break;
    case types::cdma2000_minus1x_rtt_r15:
      HANDLE_CODE(c.get<carrier_freq_cdma2000_s>().unpack(bref));
      break;
    case types::utra_tdd_r15:
      HANDLE_CODE(
          unpack_dyn_seq_of(c.get<carrier_freq_list_utra_tdd_r10_l>(), bref, 1, 6, integer_packer<uint16_t>(0, 16383)));
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_r15_ies_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReestablishment-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(rr_cfg_ded.pack(bref));
  HANDLE_CODE(pack_integer(bref, next_hop_chaining_count, (uint8_t)0u, (uint8_t)7u));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(rr_cfg_ded.unpack(bref));
  HANDLE_CODE(unpack_integer(next_hop_chaining_count, bref, (uint8_t)0u, (uint8_t)7u));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("radioResourceConfigDedicated");
  rr_cfg_ded.to_json(j);
  j.write_int("nextHopChainingCount", next_hop_chaining_count);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReestablishmentReject-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_reject_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_reject_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_reject_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReject-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reject_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pack_integer(bref, wait_time, (uint8_t)1u, (uint8_t)16u));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reject_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_integer(wait_time, bref, (uint8_t)1u, (uint8_t)16u));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reject_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("waitTime", wait_time);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionSetup-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(rr_cfg_ded.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(rr_cfg_ded.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("radioResourceConfigDedicated");
  rr_cfg_ded.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCEarlyDataComplete-r15-IEs ::= SEQUENCE
SRSASN_CODE rrc_early_data_complete_r15_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ded_info_nas_r15_present, 1));
  HANDLE_CODE(bref.pack(extended_wait_time_r15_present, 1));
  HANDLE_CODE(bref.pack(idle_mode_mob_ctrl_info_r15_present, 1));
  HANDLE_CODE(bref.pack(idle_mode_mob_ctrl_info_ext_r15_present, 1));
  HANDLE_CODE(bref.pack(redirected_carrier_info_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ded_info_nas_r15_present) {
    HANDLE_CODE(ded_info_nas_r15.pack(bref));
  }
  if (extended_wait_time_r15_present) {
    HANDLE_CODE(pack_integer(bref, extended_wait_time_r15, (uint16_t)1u, (uint16_t)1800u));
  }
  if (idle_mode_mob_ctrl_info_r15_present) {
    HANDLE_CODE(idle_mode_mob_ctrl_info_r15.pack(bref));
  }
  if (idle_mode_mob_ctrl_info_ext_r15_present) {
    HANDLE_CODE(idle_mode_mob_ctrl_info_ext_r15.pack(bref));
  }
  if (redirected_carrier_info_r15_present) {
    HANDLE_CODE(redirected_carrier_info_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_early_data_complete_r15_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ded_info_nas_r15_present, 1));
  HANDLE_CODE(bref.unpack(extended_wait_time_r15_present, 1));
  HANDLE_CODE(bref.unpack(idle_mode_mob_ctrl_info_r15_present, 1));
  HANDLE_CODE(bref.unpack(idle_mode_mob_ctrl_info_ext_r15_present, 1));
  HANDLE_CODE(bref.unpack(redirected_carrier_info_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ded_info_nas_r15_present) {
    HANDLE_CODE(ded_info_nas_r15.unpack(bref));
  }
  if (extended_wait_time_r15_present) {
    HANDLE_CODE(unpack_integer(extended_wait_time_r15, bref, (uint16_t)1u, (uint16_t)1800u));
  }
  if (idle_mode_mob_ctrl_info_r15_present) {
    HANDLE_CODE(idle_mode_mob_ctrl_info_r15.unpack(bref));
  }
  if (idle_mode_mob_ctrl_info_ext_r15_present) {
    HANDLE_CODE(idle_mode_mob_ctrl_info_ext_r15.unpack(bref));
  }
  if (redirected_carrier_info_r15_present) {
    HANDLE_CODE(redirected_carrier_info_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_early_data_complete_r15_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ded_info_nas_r15_present) {
    j.write_str("dedicatedInfoNAS-r15", ded_info_nas_r15.to_string());
  }
  if (extended_wait_time_r15_present) {
    j.write_int("extendedWaitTime-r15", extended_wait_time_r15);
  }
  if (idle_mode_mob_ctrl_info_r15_present) {
    j.write_fieldname("idleModeMobilityControlInfo-r15");
    idle_mode_mob_ctrl_info_r15.to_json(j);
  }
  if (idle_mode_mob_ctrl_info_ext_r15_present) {
    j.write_fieldname("idleModeMobilityControlInfoExt-r15");
    idle_mode_mob_ctrl_info_ext_r15.to_json(j);
  }
  if (redirected_carrier_info_r15_present) {
    j.write_fieldname("redirectedCarrierInfo-r15");
    redirected_carrier_info_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RRCConnectionReestablishment ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_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_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_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_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rrc_conn_reest_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_reest_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_reest_r8:
      j.write_fieldname("rrcConnectionReestablishment-r8");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_reest_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_reest_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_reest_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReestablishmentReject ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_reject_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_reject_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_reject_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_reest_reject_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::rrc_conn_reest_reject_r8:
      c.destroy<rrc_conn_reest_reject_r8_ies_s>();
      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<rrc_conn_reest_reject_r8_ies_s>();
      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<rrc_conn_reest_reject_r8_ies_s>());
      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<rrc_conn_reest_reject_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_reest_reject_r8:
      j.write_fieldname("rrcConnectionReestablishmentReject-r8");
      c.get<rrc_conn_reest_reject_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_reject_s::crit_exts_c_");
  }
  j.end_obj();
}
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<rrc_conn_reest_reject_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_reject_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_reject_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_reest_reject_r8:
      HANDLE_CODE(c.get<rrc_conn_reest_reject_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_reject_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReject ::= SEQUENCE
SRSASN_CODE rrc_conn_reject_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reject_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_reject_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_reject_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reject_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rrc_conn_reject_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_reject_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_reject_r8:
      j.write_fieldname("rrcConnectionReject-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_reject_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_reject_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reject_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_reject_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reject_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionSetup ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_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_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_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_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rrc_conn_setup_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_setup_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_setup_r8:
      j.write_fieldname("rrcConnectionSetup-r8");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_setup_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_setup_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_setup_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCEarlyDataComplete-r15 ::= SEQUENCE
SRSASN_CODE rrc_early_data_complete_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_early_data_complete_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_early_data_complete_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_complete_r15_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::rrc_early_data_complete_r15:
      c.destroy<rrc_early_data_complete_r15_ies_s>();
      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<rrc_early_data_complete_r15_ies_s>();
      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<rrc_early_data_complete_r15_ies_s>());
      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<rrc_early_data_complete_r15_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::rrc_early_data_complete_r15:
      j.write_fieldname("rrcEarlyDataComplete-r15");
      c.get<rrc_early_data_complete_r15_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_early_data_complete_r15_s::crit_exts_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_early_data_complete_r15_s::crit_exts_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_early_data_complete_r15:
      HANDLE_CODE(c.get<rrc_early_data_complete_r15_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_early_data_complete_r15_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_early_data_complete_r15_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_early_data_complete_r15:
      HANDLE_CODE(c.get<rrc_early_data_complete_r15_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_early_data_complete_r15_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DL-CCCH-MessageType ::= CHOICE
void dl_ccch_msg_type_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    case types::msg_class_ext:
      c.destroy<msg_class_ext_c_>();
      break;
    default:
      break;
  }
}
void dl_ccch_msg_type_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      break;
    case types::msg_class_ext:
      c.init<msg_class_ext_c_>();
      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<c1_c_>());
      break;
    case types::msg_class_ext:
      c.init(other.c.get<msg_class_ext_c_>());
      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<c1_c_>());
      break;
    case types::msg_class_ext:
      c.set(other.c.get<msg_class_ext_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      j.write_fieldname("messageClassExtension");
      c.get<msg_class_ext_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c");
  }
  j.end_obj();
}
SRSASN_CODE dl_ccch_msg_type_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().pack(bref));
      break;
    case types::msg_class_ext:
      HANDLE_CODE(c.get<msg_class_ext_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_ccch_msg_type_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::msg_class_ext:
      HANDLE_CODE(c.get<msg_class_ext_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void dl_ccch_msg_type_c::c1_c_::destroy_()
{
  switch (type_) {
    case types::rrc_conn_reest:
      c.destroy<rrc_conn_reest_s>();
      break;
    case types::rrc_conn_reest_reject:
      c.destroy<rrc_conn_reest_reject_s>();
      break;
    case types::rrc_conn_reject:
      c.destroy<rrc_conn_reject_s>();
      break;
    case types::rrc_conn_setup:
      c.destroy<rrc_conn_setup_s>();
      break;
    default:
      break;
  }
}
void dl_ccch_msg_type_c::c1_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::rrc_conn_reest:
      c.init<rrc_conn_reest_s>();
      break;
    case types::rrc_conn_reest_reject:
      c.init<rrc_conn_reest_reject_s>();
      break;
    case types::rrc_conn_reject:
      c.init<rrc_conn_reject_s>();
      break;
    case types::rrc_conn_setup:
      c.init<rrc_conn_setup_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::c1_c_");
  }
}
dl_ccch_msg_type_c::c1_c_::c1_c_(const dl_ccch_msg_type_c::c1_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::rrc_conn_reest:
      c.init(other.c.get<rrc_conn_reest_s>());
      break;
    case types::rrc_conn_reest_reject:
      c.init(other.c.get<rrc_conn_reest_reject_s>());
      break;
    case types::rrc_conn_reject:
      c.init(other.c.get<rrc_conn_reject_s>());
      break;
    case types::rrc_conn_setup:
      c.init(other.c.get<rrc_conn_setup_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::c1_c_");
  }
}
dl_ccch_msg_type_c::c1_c_& dl_ccch_msg_type_c::c1_c_::operator=(const dl_ccch_msg_type_c::c1_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::rrc_conn_reest:
      c.set(other.c.get<rrc_conn_reest_s>());
      break;
    case types::rrc_conn_reest_reject:
      c.set(other.c.get<rrc_conn_reest_reject_s>());
      break;
    case types::rrc_conn_reject:
      c.set(other.c.get<rrc_conn_reject_s>());
      break;
    case types::rrc_conn_setup:
      c.set(other.c.get<rrc_conn_setup_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::c1_c_");
  }

  return *this;
}
void dl_ccch_msg_type_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_reest:
      j.write_fieldname("rrcConnectionReestablishment");
      c.get<rrc_conn_reest_s>().to_json(j);
      break;
    case types::rrc_conn_reest_reject:
      j.write_fieldname("rrcConnectionReestablishmentReject");
      c.get<rrc_conn_reest_reject_s>().to_json(j);
      break;
    case types::rrc_conn_reject:
      j.write_fieldname("rrcConnectionReject");
      c.get<rrc_conn_reject_s>().to_json(j);
      break;
    case types::rrc_conn_setup:
      j.write_fieldname("rrcConnectionSetup");
      c.get<rrc_conn_setup_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE dl_ccch_msg_type_c::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_reest:
      HANDLE_CODE(c.get<rrc_conn_reest_s>().pack(bref));
      break;
    case types::rrc_conn_reest_reject:
      HANDLE_CODE(c.get<rrc_conn_reest_reject_s>().pack(bref));
      break;
    case types::rrc_conn_reject:
      HANDLE_CODE(c.get<rrc_conn_reject_s>().pack(bref));
      break;
    case types::rrc_conn_setup:
      HANDLE_CODE(c.get<rrc_conn_setup_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_ccch_msg_type_c::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_reest:
      HANDLE_CODE(c.get<rrc_conn_reest_s>().unpack(bref));
      break;
    case types::rrc_conn_reest_reject:
      HANDLE_CODE(c.get<rrc_conn_reest_reject_s>().unpack(bref));
      break;
    case types::rrc_conn_reject:
      HANDLE_CODE(c.get<rrc_conn_reject_s>().unpack(bref));
      break;
    case types::rrc_conn_setup:
      HANDLE_CODE(c.get<rrc_conn_setup_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void dl_ccch_msg_type_c::msg_class_ext_c_::destroy_()
{
  switch (type_) {
    case types::c2:
      c.destroy<c2_c_>();
      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<c2_c_>();
      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<c2_c_>());
      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<c2_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c2:
      j.write_fieldname("c2");
      c.get<c2_c_>().to_json(j);
      break;
    case types::msg_class_ext_future_r15:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_");
  }
  j.end_obj();
}
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<c2_c_>().pack(bref));
      break;
    case types::msg_class_ext_future_r15:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_ccch_msg_type_c::msg_class_ext_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c2:
      HANDLE_CODE(c.get<c2_c_>().unpack(bref));
      break;
    case types::msg_class_ext_future_r15:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void dl_ccch_msg_type_c::msg_class_ext_c_::c2_c_::set(types::options e)
{
  type_ = e;
}
void dl_ccch_msg_type_c::msg_class_ext_c_::c2_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_early_data_complete_r15:
      j.write_fieldname("rrcEarlyDataComplete-r15");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_::c2_c_");
  }
  j.end_obj();
}
SRSASN_CODE dl_ccch_msg_type_c::msg_class_ext_c_::c2_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_early_data_complete_r15:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_::c2_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_ccch_msg_type_c::msg_class_ext_c_::c2_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_early_data_complete_r15:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_ccch_msg_type_c::msg_class_ext_c_::c2_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DL-CCCH-Message ::= SEQUENCE
SRSASN_CODE dl_ccch_msg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_ccch_msg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void dl_ccch_msg_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("DL-CCCH-Message");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// PDCCH-CandidateReductionsLAA-UL-r14 ::= CHOICE
void pdcch_candidate_reductions_laa_ul_r14_c::set(types::options e)
{
  type_ = e;
}
void pdcch_candidate_reductions_laa_ul_r14_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("pdcch-candidateReductionAL1-r14", c.pdcch_candidate_reduction_al1_r14.to_string());
      j.write_str("pdcch-candidateReductionAL2-r14", c.pdcch_candidate_reduction_al2_r14.to_string());
      j.write_str("pdcch-candidateReductionAL3-r14", c.pdcch_candidate_reduction_al3_r14.to_string());
      j.write_str("pdcch-candidateReductionAL4-r14", c.pdcch_candidate_reduction_al4_r14.to_string());
      j.write_str("pdcch-candidateReductionAL5-r14", c.pdcch_candidate_reduction_al5_r14.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pdcch_candidate_reductions_laa_ul_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE pdcch_candidate_reductions_laa_ul_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pdcch_candidate_reduction_al1_r14.pack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al2_r14.pack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al3_r14.pack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al4_r14.pack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al5_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pdcch_candidate_reductions_laa_ul_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcch_candidate_reductions_laa_ul_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pdcch_candidate_reduction_al1_r14.unpack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al2_r14.unpack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al3_r14.unpack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al4_r14.unpack(bref));
      HANDLE_CODE(c.pdcch_candidate_reduction_al5_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pdcch_candidate_reductions_laa_ul_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// AUL-Config-r15 ::= CHOICE
void aul_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void aul_cfg_r15_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("aul-CRNTI-r15", c.aul_crnti_r15.to_string());
      j.write_str("aul-Subframes-r15", c.aul_sfs_r15.to_string());
      j.write_int("aul-HARQ-Processes-r15", c.aul_harq_processes_r15);
      j.write_str("transmissionModeUL-AUL-r15", c.tx_mode_ul_aul_r15.to_string());
      j.write_str("aul-StartingFullBW-InsideMCOT-r15", c.aul_start_full_bw_inside_mcot_r15.to_string());
      j.write_str("aul-StartingFullBW-OutsideMCOT-r15", c.aul_start_full_bw_outside_mcot_r15.to_string());
      j.write_str("aul-StartingPartialBW-InsideMCOT-r15", c.aul_start_partial_bw_inside_mcot_r15.to_string());
      j.write_str("aul-StartingPartialBW-OutsideMCOT-r15", c.aul_start_partial_bw_outside_mcot_r15.to_string());
      j.write_str("aul-RetransmissionTimer-r15", c.aul_retx_timer_r15.to_string());
      j.write_int("endingSymbolAUL-r15", c.ending_symbol_aul_r15);
      j.write_int("subframeOffsetCOT-Sharing-r15", c.sf_offset_cot_sharing_r15);
      j.write_str("contentionWindowSizeTimer-r15", c.contention_win_size_timer_r15.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "aul_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE aul_cfg_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.aul_crnti_r15.pack(bref));
      HANDLE_CODE(c.aul_sfs_r15.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.aul_harq_processes_r15, (uint8_t)1u, (uint8_t)16u));
      HANDLE_CODE(c.tx_mode_ul_aul_r15.pack(bref));
      HANDLE_CODE(c.aul_start_full_bw_inside_mcot_r15.pack(bref));
      HANDLE_CODE(c.aul_start_full_bw_outside_mcot_r15.pack(bref));
      HANDLE_CODE(c.aul_start_partial_bw_inside_mcot_r15.pack(bref));
      HANDLE_CODE(c.aul_start_partial_bw_outside_mcot_r15.pack(bref));
      HANDLE_CODE(c.aul_retx_timer_r15.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.ending_symbol_aul_r15, (uint8_t)12u, (uint8_t)13u));
      HANDLE_CODE(pack_integer(bref, c.sf_offset_cot_sharing_r15, (uint8_t)2u, (uint8_t)4u));
      HANDLE_CODE(c.contention_win_size_timer_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "aul_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE aul_cfg_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.aul_crnti_r15.unpack(bref));
      HANDLE_CODE(c.aul_sfs_r15.unpack(bref));
      HANDLE_CODE(unpack_integer(c.aul_harq_processes_r15, bref, (uint8_t)1u, (uint8_t)16u));
      HANDLE_CODE(c.tx_mode_ul_aul_r15.unpack(bref));
      HANDLE_CODE(c.aul_start_full_bw_inside_mcot_r15.unpack(bref));
      HANDLE_CODE(c.aul_start_full_bw_outside_mcot_r15.unpack(bref));
      HANDLE_CODE(c.aul_start_partial_bw_inside_mcot_r15.unpack(bref));
      HANDLE_CODE(c.aul_start_partial_bw_outside_mcot_r15.unpack(bref));
      HANDLE_CODE(c.aul_retx_timer_r15.unpack(bref));
      HANDLE_CODE(unpack_integer(c.ending_symbol_aul_r15, bref, (uint8_t)12u, (uint8_t)13u));
      HANDLE_CODE(unpack_integer(c.sf_offset_cot_sharing_r15, bref, (uint8_t)2u, (uint8_t)4u));
      HANDLE_CODE(c.contention_win_size_timer_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "aul_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportPeriodicSCell-r15 ::= CHOICE
void cqi_report_periodic_scell_r15_c::set(types::options e)
{
  type_ = e;
}
void cqi_report_periodic_scell_r15_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_int("cqi-pmi-ConfigIndexDormant-r15", c.cqi_pmi_cfg_idx_dormant_r15);
      if (c.ri_cfg_idx_dormant_r15_present) {
        j.write_int("ri-ConfigIndexDormant-r15", c.ri_cfg_idx_dormant_r15);
      }
      if (c.csi_sf_pattern_dormant_r15_present) {
        j.write_fieldname("csi-SubframePatternDormant-r15");
        c.csi_sf_pattern_dormant_r15.to_json(j);
      }
      if (c.cqi_format_ind_dormant_r15_present) {
        j.write_fieldname("cqi-FormatIndicatorDormant-r15");
        c.cqi_format_ind_dormant_r15.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_scell_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.ri_cfg_idx_dormant_r15_present, 1));
      HANDLE_CODE(bref.pack(c.csi_sf_pattern_dormant_r15_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_format_ind_dormant_r15_present, 1));
      HANDLE_CODE(pack_integer(bref, c.cqi_pmi_cfg_idx_dormant_r15, (uint16_t)0u, (uint16_t)1023u));
      if (c.ri_cfg_idx_dormant_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.ri_cfg_idx_dormant_r15, (uint16_t)0u, (uint16_t)1023u));
      }
      if (c.csi_sf_pattern_dormant_r15_present) {
        HANDLE_CODE(c.csi_sf_pattern_dormant_r15.pack(bref));
      }
      if (c.cqi_format_ind_dormant_r15_present) {
        HANDLE_CODE(c.cqi_format_ind_dormant_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_scell_r15_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.ri_cfg_idx_dormant_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.csi_sf_pattern_dormant_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_format_ind_dormant_r15_present, 1));
      HANDLE_CODE(unpack_integer(c.cqi_pmi_cfg_idx_dormant_r15, bref, (uint16_t)0u, (uint16_t)1023u));
      if (c.ri_cfg_idx_dormant_r15_present) {
        HANDLE_CODE(unpack_integer(c.ri_cfg_idx_dormant_r15, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      if (c.csi_sf_pattern_dormant_r15_present) {
        HANDLE_CODE(c.csi_sf_pattern_dormant_r15.unpack(bref));
      }
      if (c.cqi_format_ind_dormant_r15_present) {
        HANDLE_CODE(c.cqi_format_ind_dormant_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cqi_report_periodic_scell_r15_c::setup_s_::csi_sf_pattern_dormant_r15_c_::set(types::options e)
{
  type_ = e;
}
void cqi_report_periodic_scell_r15_c::setup_s_::csi_sf_pattern_dormant_r15_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("csi-MeasSubframeSet1-r15");
      c.csi_meas_sf_set1_r15.to_json(j);
      j.write_fieldname("csi-MeasSubframeSet2-r15");
      c.csi_meas_sf_set2_r15.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::csi_sf_pattern_dormant_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_scell_r15_c::setup_s_::csi_sf_pattern_dormant_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.csi_meas_sf_set1_r15.pack(bref));
      HANDLE_CODE(c.csi_meas_sf_set2_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::csi_sf_pattern_dormant_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_scell_r15_c::setup_s_::csi_sf_pattern_dormant_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.csi_meas_sf_set1_r15.unpack(bref));
      HANDLE_CODE(c.csi_meas_sf_set2_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::csi_sf_pattern_dormant_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_::destroy_()
{
  switch (type_) {
    case types::wideband_cqi_r15:
      c.destroy<wideband_cqi_r15_s_>();
      break;
    case types::subband_cqi_r15:
      c.destroy<subband_cqi_r15_s_>();
      break;
    default:
      break;
  }
}
void cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::wideband_cqi_r15:
      c.init<wideband_cqi_r15_s_>();
      break;
    case types::subband_cqi_r15:
      c.init<subband_cqi_r15_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_");
  }
}
cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_::cqi_format_ind_dormant_r15_c_(
    const cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::wideband_cqi_r15:
      c.init(other.c.get<wideband_cqi_r15_s_>());
      break;
    case types::subband_cqi_r15:
      c.init(other.c.get<subband_cqi_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_");
  }
}
cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_&
cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_::
operator=(const cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::wideband_cqi_r15:
      c.set(other.c.get<wideband_cqi_r15_s_>());
      break;
    case types::subband_cqi_r15:
      c.set(other.c.get<subband_cqi_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_");
  }

  return *this;
}
void cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::wideband_cqi_r15:
      j.write_fieldname("widebandCQI-r15");
      j.start_obj();
      if (c.get<wideband_cqi_r15_s_>().csi_report_mode_r15_present) {
        j.write_str("csi-ReportMode-r15", c.get<wideband_cqi_r15_s_>().csi_report_mode_r15.to_string());
      }
      j.end_obj();
      break;
    case types::subband_cqi_r15:
      j.write_fieldname("subbandCQI-r15");
      j.start_obj();
      j.write_int("k-r15", c.get<subband_cqi_r15_s_>().k_r15);
      j.write_str("periodicityFactor-r15", c.get<subband_cqi_r15_s_>().periodicity_factor_r15.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::wideband_cqi_r15:
      HANDLE_CODE(bref.pack(c.get<wideband_cqi_r15_s_>().csi_report_mode_r15_present, 1));
      if (c.get<wideband_cqi_r15_s_>().csi_report_mode_r15_present) {
        HANDLE_CODE(c.get<wideband_cqi_r15_s_>().csi_report_mode_r15.pack(bref));
      }
      break;
    case types::subband_cqi_r15:
      HANDLE_CODE(pack_integer(bref, c.get<subband_cqi_r15_s_>().k_r15, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(c.get<subband_cqi_r15_s_>().periodicity_factor_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::wideband_cqi_r15:
      HANDLE_CODE(bref.unpack(c.get<wideband_cqi_r15_s_>().csi_report_mode_r15_present, 1));
      if (c.get<wideband_cqi_r15_s_>().csi_report_mode_r15_present) {
        HANDLE_CODE(c.get<wideband_cqi_r15_s_>().csi_report_mode_r15.unpack(bref));
      }
      break;
    case types::subband_cqi_r15:
      HANDLE_CODE(unpack_integer(c.get<subband_cqi_r15_s_>().k_r15, bref, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(c.get<subband_cqi_r15_s_>().periodicity_factor_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_report_periodic_scell_r15_c::setup_s_::cqi_format_ind_dormant_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CrossCarrierSchedulingConfigLAA-UL-r14 ::= SEQUENCE
SRSASN_CODE cross_carrier_sched_cfg_laa_ul_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, sched_cell_id_r14, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, cif_in_sched_cell_r14, (uint8_t)1u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cross_carrier_sched_cfg_laa_ul_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(sched_cell_id_r14, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(cif_in_sched_cell_r14, bref, (uint8_t)1u, (uint8_t)7u));

  return SRSASN_SUCCESS;
}
void cross_carrier_sched_cfg_laa_ul_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("schedulingCellId-r14", sched_cell_id_r14);
  j.write_int("cif-InSchedulingCell-r14", cif_in_sched_cell_r14);
  j.end_obj();
}

// LBT-Config-r14 ::= CHOICE
void lbt_cfg_r14_c::destroy_() {}
void lbt_cfg_r14_c::set(types::options e)
{
  destroy_();
  type_ = e;
}
lbt_cfg_r14_c::lbt_cfg_r14_c(const lbt_cfg_r14_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::max_energy_detection_thres_r14:
      c.init(other.c.get<int8_t>());
      break;
    case types::energy_detection_thres_offset_r14:
      c.init(other.c.get<int8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "lbt_cfg_r14_c");
  }
}
lbt_cfg_r14_c& lbt_cfg_r14_c::operator=(const lbt_cfg_r14_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::max_energy_detection_thres_r14:
      c.set(other.c.get<int8_t>());
      break;
    case types::energy_detection_thres_offset_r14:
      c.set(other.c.get<int8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "lbt_cfg_r14_c");
  }

  return *this;
}
void lbt_cfg_r14_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::max_energy_detection_thres_r14:
      j.write_int("maxEnergyDetectionThreshold-r14", c.get<int8_t>());
      break;
    case types::energy_detection_thres_offset_r14:
      j.write_int("energyDetectionThresholdOffset-r14", c.get<int8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "lbt_cfg_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE lbt_cfg_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::max_energy_detection_thres_r14:
      HANDLE_CODE(pack_integer(bref, c.get<int8_t>(), (int8_t)-85, (int8_t)-52));
      break;
    case types::energy_detection_thres_offset_r14:
      HANDLE_CODE(pack_integer(bref, c.get<int8_t>(), (int8_t)-13, (int8_t)20));
      break;
    default:
      log_invalid_choice_id(type_, "lbt_cfg_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE lbt_cfg_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::max_energy_detection_thres_r14:
      HANDLE_CODE(unpack_integer(c.get<int8_t>(), bref, (int8_t)-85, (int8_t)-52));
      break;
    case types::energy_detection_thres_offset_r14:
      HANDLE_CODE(unpack_integer(c.get<int8_t>(), bref, (int8_t)-13, (int8_t)20));
      break;
    default:
      log_invalid_choice_id(type_, "lbt_cfg_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PDCCH-ConfigLAA-r14 ::= SEQUENCE
SRSASN_CODE pdcch_cfg_laa_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(max_nof_sched_sfs_format0_b_r14_present, 1));
  HANDLE_CODE(bref.pack(max_nof_sched_sfs_format4_b_r14_present, 1));
  HANDLE_CODE(bref.pack(skip_monitoring_dci_format0_a_r14_present, 1));
  HANDLE_CODE(bref.pack(skip_monitoring_dci_format4_a_r14_present, 1));
  HANDLE_CODE(bref.pack(pdcch_candidate_reductions_format0_a_r14_present, 1));
  HANDLE_CODE(bref.pack(pdcch_candidate_reductions_format4_a_r14_present, 1));
  HANDLE_CODE(bref.pack(pdcch_candidate_reductions_format0_b_r14_present, 1));
  HANDLE_CODE(bref.pack(pdcch_candidate_reductions_format4_b_r14_present, 1));

  if (max_nof_sched_sfs_format0_b_r14_present) {
    HANDLE_CODE(max_nof_sched_sfs_format0_b_r14.pack(bref));
  }
  if (max_nof_sched_sfs_format4_b_r14_present) {
    HANDLE_CODE(max_nof_sched_sfs_format4_b_r14.pack(bref));
  }
  if (pdcch_candidate_reductions_format0_a_r14_present) {
    HANDLE_CODE(pdcch_candidate_reductions_format0_a_r14.pack(bref));
  }
  if (pdcch_candidate_reductions_format4_a_r14_present) {
    HANDLE_CODE(pdcch_candidate_reductions_format4_a_r14.pack(bref));
  }
  if (pdcch_candidate_reductions_format0_b_r14_present) {
    HANDLE_CODE(pdcch_candidate_reductions_format0_b_r14.pack(bref));
  }
  if (pdcch_candidate_reductions_format4_b_r14_present) {
    HANDLE_CODE(pdcch_candidate_reductions_format4_b_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcch_cfg_laa_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(max_nof_sched_sfs_format0_b_r14_present, 1));
  HANDLE_CODE(bref.unpack(max_nof_sched_sfs_format4_b_r14_present, 1));
  HANDLE_CODE(bref.unpack(skip_monitoring_dci_format0_a_r14_present, 1));
  HANDLE_CODE(bref.unpack(skip_monitoring_dci_format4_a_r14_present, 1));
  HANDLE_CODE(bref.unpack(pdcch_candidate_reductions_format0_a_r14_present, 1));
  HANDLE_CODE(bref.unpack(pdcch_candidate_reductions_format4_a_r14_present, 1));
  HANDLE_CODE(bref.unpack(pdcch_candidate_reductions_format0_b_r14_present, 1));
  HANDLE_CODE(bref.unpack(pdcch_candidate_reductions_format4_b_r14_present, 1));

  if (max_nof_sched_sfs_format0_b_r14_present) {
    HANDLE_CODE(max_nof_sched_sfs_format0_b_r14.unpack(bref));
  }
  if (max_nof_sched_sfs_format4_b_r14_present) {
    HANDLE_CODE(max_nof_sched_sfs_format4_b_r14.unpack(bref));
  }
  if (pdcch_candidate_reductions_format0_a_r14_present) {
    HANDLE_CODE(pdcch_candidate_reductions_format0_a_r14.unpack(bref));
  }
  if (pdcch_candidate_reductions_format4_a_r14_present) {
    HANDLE_CODE(pdcch_candidate_reductions_format4_a_r14.unpack(bref));
  }
  if (pdcch_candidate_reductions_format0_b_r14_present) {
    HANDLE_CODE(pdcch_candidate_reductions_format0_b_r14.unpack(bref));
  }
  if (pdcch_candidate_reductions_format4_b_r14_present) {
    HANDLE_CODE(pdcch_candidate_reductions_format4_b_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdcch_cfg_laa_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (max_nof_sched_sfs_format0_b_r14_present) {
    j.write_str("maxNumberOfSchedSubframes-Format0B-r14", max_nof_sched_sfs_format0_b_r14.to_string());
  }
  if (max_nof_sched_sfs_format4_b_r14_present) {
    j.write_str("maxNumberOfSchedSubframes-Format4B-r14", max_nof_sched_sfs_format4_b_r14.to_string());
  }
  if (skip_monitoring_dci_format0_a_r14_present) {
    j.write_str("skipMonitoringDCI-Format0A-r14", "true");
  }
  if (skip_monitoring_dci_format4_a_r14_present) {
    j.write_str("skipMonitoringDCI-Format4A-r14", "true");
  }
  if (pdcch_candidate_reductions_format0_a_r14_present) {
    j.write_fieldname("pdcch-CandidateReductions-Format0A-r14");
    pdcch_candidate_reductions_format0_a_r14.to_json(j);
  }
  if (pdcch_candidate_reductions_format4_a_r14_present) {
    j.write_fieldname("pdcch-CandidateReductions-Format4A-r14");
    pdcch_candidate_reductions_format4_a_r14.to_json(j);
  }
  if (pdcch_candidate_reductions_format0_b_r14_present) {
    j.write_fieldname("pdcch-CandidateReductions-Format0B-r14");
    pdcch_candidate_reductions_format0_b_r14.to_json(j);
  }
  if (pdcch_candidate_reductions_format4_b_r14_present) {
    j.write_fieldname("pdcch-CandidateReductions-Format4B-r14");
    pdcch_candidate_reductions_format4_b_r14.to_json(j);
  }
  j.end_obj();
}

// PUSCH-ModeConfigLAA-r15 ::= SEQUENCE
SRSASN_CODE pusch_mode_cfg_laa_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(laa_pusch_mode1, 1));
  HANDLE_CODE(bref.pack(laa_pusch_mode2, 1));
  HANDLE_CODE(bref.pack(laa_pusch_mode3, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_mode_cfg_laa_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(laa_pusch_mode1, 1));
  HANDLE_CODE(bref.unpack(laa_pusch_mode2, 1));
  HANDLE_CODE(bref.unpack(laa_pusch_mode3, 1));

  return SRSASN_SUCCESS;
}
void pusch_mode_cfg_laa_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("laa-PUSCH-Mode1", laa_pusch_mode1);
  j.write_bool("laa-PUSCH-Mode2", laa_pusch_mode2);
  j.write_bool("laa-PUSCH-Mode3", laa_pusch_mode3);
  j.end_obj();
}

// SoundingRS-UL-ConfigDedicatedAperiodic-v1430 ::= CHOICE
void srs_ul_cfg_ded_aperiodic_v1430_c::set(types::options e)
{
  type_ = e;
}
void srs_ul_cfg_ded_aperiodic_v1430_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.srs_sf_ind_r14_present) {
        j.write_int("srs-SubframeIndication-r14", c.srs_sf_ind_r14);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1430_c");
  }
  j.end_obj();
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_v1430_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.srs_sf_ind_r14_present, 1));
      if (c.srs_sf_ind_r14_present) {
        HANDLE_CODE(pack_integer(bref, c.srs_sf_ind_r14, (uint8_t)1u, (uint8_t)4u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1430_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_ul_cfg_ded_aperiodic_v1430_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.srs_sf_ind_r14_present, 1));
      if (c.srs_sf_ind_r14_present) {
        HANDLE_CODE(unpack_integer(c.srs_sf_ind_r14, bref, (uint8_t)1u, (uint8_t)4u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "srs_ul_cfg_ded_aperiodic_v1430_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CQI-ReportConfigSCell-r10 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_scell_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cqi_report_mode_aperiodic_r10_present, 1));
  HANDLE_CODE(bref.pack(cqi_report_periodic_scell_r10_present, 1));
  HANDLE_CODE(bref.pack(pmi_ri_report_r10_present, 1));

  if (cqi_report_mode_aperiodic_r10_present) {
    HANDLE_CODE(cqi_report_mode_aperiodic_r10.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, nom_pdsch_rs_epre_offset_r10, (int8_t)-1, (int8_t)6));
  if (cqi_report_periodic_scell_r10_present) {
    HANDLE_CODE(cqi_report_periodic_scell_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_scell_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cqi_report_mode_aperiodic_r10_present, 1));
  HANDLE_CODE(bref.unpack(cqi_report_periodic_scell_r10_present, 1));
  HANDLE_CODE(bref.unpack(pmi_ri_report_r10_present, 1));

  if (cqi_report_mode_aperiodic_r10_present) {
    HANDLE_CODE(cqi_report_mode_aperiodic_r10.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(nom_pdsch_rs_epre_offset_r10, bref, (int8_t)-1, (int8_t)6));
  if (cqi_report_periodic_scell_r10_present) {
    HANDLE_CODE(cqi_report_periodic_scell_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_scell_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cqi_report_mode_aperiodic_r10_present) {
    j.write_str("cqi-ReportModeAperiodic-r10", cqi_report_mode_aperiodic_r10.to_string());
  }
  j.write_int("nomPDSCH-RS-EPRE-Offset-r10", nom_pdsch_rs_epre_offset_r10);
  if (cqi_report_periodic_scell_r10_present) {
    j.write_fieldname("cqi-ReportPeriodicSCell-r10");
    cqi_report_periodic_scell_r10.to_json(j);
  }
  if (pmi_ri_report_r10_present) {
    j.write_str("pmi-RI-Report-r10", "setup");
  }
  j.end_obj();
}

// CQI-ReportConfigSCell-r15 ::= SEQUENCE
SRSASN_CODE cqi_report_cfg_scell_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cqi_report_periodic_scell_r15_present, 1));
  HANDLE_CODE(bref.pack(alt_cqi_table_minus1024_qam_r15_present, 1));

  if (cqi_report_periodic_scell_r15_present) {
    HANDLE_CODE(cqi_report_periodic_scell_r15.pack(bref));
  }
  if (alt_cqi_table_minus1024_qam_r15_present) {
    HANDLE_CODE(alt_cqi_table_minus1024_qam_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_report_cfg_scell_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cqi_report_periodic_scell_r15_present, 1));
  HANDLE_CODE(bref.unpack(alt_cqi_table_minus1024_qam_r15_present, 1));

  if (cqi_report_periodic_scell_r15_present) {
    HANDLE_CODE(cqi_report_periodic_scell_r15.unpack(bref));
  }
  if (alt_cqi_table_minus1024_qam_r15_present) {
    HANDLE_CODE(alt_cqi_table_minus1024_qam_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void cqi_report_cfg_scell_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cqi_report_periodic_scell_r15_present) {
    j.write_fieldname("cqi-ReportPeriodicSCell-r15");
    cqi_report_periodic_scell_r15.to_json(j);
  }
  if (alt_cqi_table_minus1024_qam_r15_present) {
    j.write_str("altCQI-Table-1024QAM-r15", alt_cqi_table_minus1024_qam_r15.to_string());
  }
  j.end_obj();
}

// CQI-ShortConfigSCell-r15 ::= CHOICE
void cqi_short_cfg_scell_r15_c::set(types::options e)
{
  type_ = e;
}
void cqi_short_cfg_scell_r15_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_int("cqi-pmi-ConfigIndexShort-r15", c.cqi_pmi_cfg_idx_short_r15);
      if (c.ri_cfg_idx_short_r15_present) {
        j.write_int("ri-ConfigIndexShort-r15", c.ri_cfg_idx_short_r15);
      }
      if (c.cqi_format_ind_short_r15_present) {
        j.write_fieldname("cqi-FormatIndicatorShort-r15");
        c.cqi_format_ind_short_r15.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE cqi_short_cfg_scell_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.ri_cfg_idx_short_r15_present, 1));
      HANDLE_CODE(bref.pack(c.cqi_format_ind_short_r15_present, 1));
      HANDLE_CODE(pack_integer(bref, c.cqi_pmi_cfg_idx_short_r15, (uint16_t)0u, (uint16_t)1023u));
      if (c.ri_cfg_idx_short_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.ri_cfg_idx_short_r15, (uint16_t)0u, (uint16_t)1023u));
      }
      if (c.cqi_format_ind_short_r15_present) {
        HANDLE_CODE(c.cqi_format_ind_short_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_short_cfg_scell_r15_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.ri_cfg_idx_short_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.cqi_format_ind_short_r15_present, 1));
      HANDLE_CODE(unpack_integer(c.cqi_pmi_cfg_idx_short_r15, bref, (uint16_t)0u, (uint16_t)1023u));
      if (c.ri_cfg_idx_short_r15_present) {
        HANDLE_CODE(unpack_integer(c.ri_cfg_idx_short_r15, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      if (c.cqi_format_ind_short_r15_present) {
        HANDLE_CODE(c.cqi_format_ind_short_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_::destroy_()
{
  switch (type_) {
    case types::wideband_cqi_short_r15:
      c.destroy<wideband_cqi_short_r15_s_>();
      break;
    case types::subband_cqi_short_r15:
      c.destroy<subband_cqi_short_r15_s_>();
      break;
    default:
      break;
  }
}
void cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::wideband_cqi_short_r15:
      c.init<wideband_cqi_short_r15_s_>();
      break;
    case types::subband_cqi_short_r15:
      c.init<subband_cqi_short_r15_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_");
  }
}
cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_::cqi_format_ind_short_r15_c_(
    const cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::wideband_cqi_short_r15:
      c.init(other.c.get<wideband_cqi_short_r15_s_>());
      break;
    case types::subband_cqi_short_r15:
      c.init(other.c.get<subband_cqi_short_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_");
  }
}
cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_&
cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_::
operator=(const cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::wideband_cqi_short_r15:
      c.set(other.c.get<wideband_cqi_short_r15_s_>());
      break;
    case types::subband_cqi_short_r15:
      c.set(other.c.get<subband_cqi_short_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_");
  }

  return *this;
}
void cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::wideband_cqi_short_r15:
      j.write_fieldname("widebandCQI-Short-r15");
      j.start_obj();
      if (c.get<wideband_cqi_short_r15_s_>().csi_report_mode_short_r15_present) {
        j.write_str("csi-ReportModeShort-r15",
                    c.get<wideband_cqi_short_r15_s_>().csi_report_mode_short_r15.to_string());
      }
      j.end_obj();
      break;
    case types::subband_cqi_short_r15:
      j.write_fieldname("subbandCQI-Short-r15");
      j.start_obj();
      j.write_int("k-r15", c.get<subband_cqi_short_r15_s_>().k_r15);
      j.write_str("periodicityFactor-r15", c.get<subband_cqi_short_r15_s_>().periodicity_factor_r15.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::wideband_cqi_short_r15:
      HANDLE_CODE(bref.pack(c.get<wideband_cqi_short_r15_s_>().csi_report_mode_short_r15_present, 1));
      if (c.get<wideband_cqi_short_r15_s_>().csi_report_mode_short_r15_present) {
        HANDLE_CODE(c.get<wideband_cqi_short_r15_s_>().csi_report_mode_short_r15.pack(bref));
      }
      break;
    case types::subband_cqi_short_r15:
      HANDLE_CODE(pack_integer(bref, c.get<subband_cqi_short_r15_s_>().k_r15, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(c.get<subband_cqi_short_r15_s_>().periodicity_factor_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::wideband_cqi_short_r15:
      HANDLE_CODE(bref.unpack(c.get<wideband_cqi_short_r15_s_>().csi_report_mode_short_r15_present, 1));
      if (c.get<wideband_cqi_short_r15_s_>().csi_report_mode_short_r15_present) {
        HANDLE_CODE(c.get<wideband_cqi_short_r15_s_>().csi_report_mode_short_r15.unpack(bref));
      }
      break;
    case types::subband_cqi_short_r15:
      HANDLE_CODE(unpack_integer(c.get<subband_cqi_short_r15_s_>().k_r15, bref, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(c.get<subband_cqi_short_r15_s_>().periodicity_factor_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cqi_short_cfg_scell_r15_c::setup_s_::cqi_format_ind_short_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CrossCarrierSchedulingConfig-r10 ::= SEQUENCE
SRSASN_CODE cross_carrier_sched_cfg_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sched_cell_info_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cross_carrier_sched_cfg_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sched_cell_info_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void cross_carrier_sched_cfg_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("schedulingCellInfo-r10");
  sched_cell_info_r10.to_json(j);
  j.end_obj();
}

void cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_::destroy_()
{
  switch (type_) {
    case types::own_r10:
      c.destroy<own_r10_s_>();
      break;
    case types::other_r10:
      c.destroy<other_r10_s_>();
      break;
    default:
      break;
  }
}
void cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::own_r10:
      c.init<own_r10_s_>();
      break;
    case types::other_r10:
      c.init<other_r10_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_");
  }
}
cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_::sched_cell_info_r10_c_(
    const cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::own_r10:
      c.init(other.c.get<own_r10_s_>());
      break;
    case types::other_r10:
      c.init(other.c.get<other_r10_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_");
  }
}
cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_& cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_::
                                                       operator=(const cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::own_r10:
      c.set(other.c.get<own_r10_s_>());
      break;
    case types::other_r10:
      c.set(other.c.get<other_r10_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_");
  }

  return *this;
}
void cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::own_r10:
      j.write_fieldname("own-r10");
      j.start_obj();
      j.write_bool("cif-Presence-r10", c.get<own_r10_s_>().cif_presence_r10);
      j.end_obj();
      break;
    case types::other_r10:
      j.write_fieldname("other-r10");
      j.start_obj();
      j.write_int("schedulingCellId-r10", c.get<other_r10_s_>().sched_cell_id_r10);
      j.write_int("pdsch-Start-r10", c.get<other_r10_s_>().pdsch_start_r10);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::own_r10:
      HANDLE_CODE(bref.pack(c.get<own_r10_s_>().cif_presence_r10, 1));
      break;
    case types::other_r10:
      HANDLE_CODE(pack_integer(bref, c.get<other_r10_s_>().sched_cell_id_r10, (uint8_t)0u, (uint8_t)7u));
      HANDLE_CODE(pack_integer(bref, c.get<other_r10_s_>().pdsch_start_r10, (uint8_t)1u, (uint8_t)4u));
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::own_r10:
      HANDLE_CODE(bref.unpack(c.get<own_r10_s_>().cif_presence_r10, 1));
      break;
    case types::other_r10:
      HANDLE_CODE(unpack_integer(c.get<other_r10_s_>().sched_cell_id_r10, bref, (uint8_t)0u, (uint8_t)7u));
      HANDLE_CODE(unpack_integer(c.get<other_r10_s_>().pdsch_start_r10, bref, (uint8_t)1u, (uint8_t)4u));
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r10_s::sched_cell_info_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CrossCarrierSchedulingConfig-r13 ::= SEQUENCE
SRSASN_CODE cross_carrier_sched_cfg_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sched_cell_info_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cross_carrier_sched_cfg_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sched_cell_info_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void cross_carrier_sched_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("schedulingCellInfo-r13");
  sched_cell_info_r13.to_json(j);
  j.end_obj();
}

void cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_::destroy_()
{
  switch (type_) {
    case types::own_r13:
      c.destroy<own_r13_s_>();
      break;
    case types::other_r13:
      c.destroy<other_r13_s_>();
      break;
    default:
      break;
  }
}
void cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::own_r13:
      c.init<own_r13_s_>();
      break;
    case types::other_r13:
      c.init<other_r13_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_");
  }
}
cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_::sched_cell_info_r13_c_(
    const cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::own_r13:
      c.init(other.c.get<own_r13_s_>());
      break;
    case types::other_r13:
      c.init(other.c.get<other_r13_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_");
  }
}
cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_& cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_::
                                                       operator=(const cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::own_r13:
      c.set(other.c.get<own_r13_s_>());
      break;
    case types::other_r13:
      c.set(other.c.get<other_r13_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_");
  }

  return *this;
}
void cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::own_r13:
      j.write_fieldname("own-r13");
      j.start_obj();
      j.write_bool("cif-Presence-r13", c.get<own_r13_s_>().cif_presence_r13);
      j.end_obj();
      break;
    case types::other_r13:
      j.write_fieldname("other-r13");
      j.start_obj();
      j.write_int("schedulingCellId-r13", c.get<other_r13_s_>().sched_cell_id_r13);
      j.write_int("pdsch-Start-r13", c.get<other_r13_s_>().pdsch_start_r13);
      j.write_int("cif-InSchedulingCell-r13", c.get<other_r13_s_>().cif_in_sched_cell_r13);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::own_r13:
      HANDLE_CODE(bref.pack(c.get<own_r13_s_>().cif_presence_r13, 1));
      break;
    case types::other_r13:
      HANDLE_CODE(pack_integer(bref, c.get<other_r13_s_>().sched_cell_id_r13, (uint8_t)0u, (uint8_t)31u));
      HANDLE_CODE(pack_integer(bref, c.get<other_r13_s_>().pdsch_start_r13, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(pack_integer(bref, c.get<other_r13_s_>().cif_in_sched_cell_r13, (uint8_t)1u, (uint8_t)7u));
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::own_r13:
      HANDLE_CODE(bref.unpack(c.get<own_r13_s_>().cif_presence_r13, 1));
      break;
    case types::other_r13:
      HANDLE_CODE(unpack_integer(c.get<other_r13_s_>().sched_cell_id_r13, bref, (uint8_t)0u, (uint8_t)31u));
      HANDLE_CODE(unpack_integer(c.get<other_r13_s_>().pdsch_start_r13, bref, (uint8_t)1u, (uint8_t)4u));
      HANDLE_CODE(unpack_integer(c.get<other_r13_s_>().cif_in_sched_cell_r13, bref, (uint8_t)1u, (uint8_t)7u));
      break;
    default:
      log_invalid_choice_id(type_, "cross_carrier_sched_cfg_r13_s::sched_cell_info_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DeltaFList-SPUCCH-r15 ::= CHOICE
void delta_flist_spucch_r15_c::set(types::options e)
{
  type_ = e;
}
void delta_flist_spucch_r15_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.delta_f_slot_spucch_format1_r15_present) {
        j.write_str("deltaF-slotSPUCCH-Format1-r15", c.delta_f_slot_spucch_format1_r15.to_string());
      }
      if (c.delta_f_slot_spucch_format1a_r15_present) {
        j.write_str("deltaF-slotSPUCCH-Format1a-r15", c.delta_f_slot_spucch_format1a_r15.to_string());
      }
      if (c.delta_f_slot_spucch_format1b_r15_present) {
        j.write_str("deltaF-slotSPUCCH-Format1b-r15", c.delta_f_slot_spucch_format1b_r15.to_string());
      }
      if (c.delta_f_slot_spucch_format3_r15_present) {
        j.write_str("deltaF-slotSPUCCH-Format3-r15", c.delta_f_slot_spucch_format3_r15.to_string());
      }
      if (c.delta_f_slot_spucch_rm_format4_r15_present) {
        j.write_str("deltaF-slotSPUCCH-RM-Format4-r15", c.delta_f_slot_spucch_rm_format4_r15.to_string());
      }
      if (c.delta_f_slot_spucch_tbcc_format4_r15_present) {
        j.write_str("deltaF-slotSPUCCH-TBCC-Format4-r15", c.delta_f_slot_spucch_tbcc_format4_r15.to_string());
      }
      if (c.delta_f_subslot_spucch_format1and1a_r15_present) {
        j.write_str("deltaF-subslotSPUCCH-Format1and1a-r15", c.delta_f_subslot_spucch_format1and1a_r15.to_string());
      }
      if (c.delta_f_subslot_spucch_format1b_r15_present) {
        j.write_str("deltaF-subslotSPUCCH-Format1b-r15", c.delta_f_subslot_spucch_format1b_r15.to_string());
      }
      if (c.delta_f_subslot_spucch_rm_format4_r15_present) {
        j.write_str("deltaF-subslotSPUCCH-RM-Format4-r15", c.delta_f_subslot_spucch_rm_format4_r15.to_string());
      }
      if (c.delta_f_subslot_spucch_tbcc_format4_r15_present) {
        j.write_str("deltaF-subslotSPUCCH-TBCC-Format4-r15", c.delta_f_subslot_spucch_tbcc_format4_r15.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "delta_flist_spucch_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE delta_flist_spucch_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.delta_f_slot_spucch_format1_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_slot_spucch_format1a_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_slot_spucch_format1b_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_slot_spucch_format3_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_slot_spucch_rm_format4_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_slot_spucch_tbcc_format4_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_subslot_spucch_format1and1a_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_subslot_spucch_format1b_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_subslot_spucch_rm_format4_r15_present, 1));
      HANDLE_CODE(bref.pack(c.delta_f_subslot_spucch_tbcc_format4_r15_present, 1));
      if (c.delta_f_slot_spucch_format1_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_format1_r15.pack(bref));
      }
      if (c.delta_f_slot_spucch_format1a_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_format1a_r15.pack(bref));
      }
      if (c.delta_f_slot_spucch_format1b_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_format1b_r15.pack(bref));
      }
      if (c.delta_f_slot_spucch_format3_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_format3_r15.pack(bref));
      }
      if (c.delta_f_slot_spucch_rm_format4_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_rm_format4_r15.pack(bref));
      }
      if (c.delta_f_slot_spucch_tbcc_format4_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_tbcc_format4_r15.pack(bref));
      }
      if (c.delta_f_subslot_spucch_format1and1a_r15_present) {
        HANDLE_CODE(c.delta_f_subslot_spucch_format1and1a_r15.pack(bref));
      }
      if (c.delta_f_subslot_spucch_format1b_r15_present) {
        HANDLE_CODE(c.delta_f_subslot_spucch_format1b_r15.pack(bref));
      }
      if (c.delta_f_subslot_spucch_rm_format4_r15_present) {
        HANDLE_CODE(c.delta_f_subslot_spucch_rm_format4_r15.pack(bref));
      }
      if (c.delta_f_subslot_spucch_tbcc_format4_r15_present) {
        HANDLE_CODE(c.delta_f_subslot_spucch_tbcc_format4_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "delta_flist_spucch_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE delta_flist_spucch_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.delta_f_slot_spucch_format1_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_slot_spucch_format1a_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_slot_spucch_format1b_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_slot_spucch_format3_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_slot_spucch_rm_format4_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_slot_spucch_tbcc_format4_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_subslot_spucch_format1and1a_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_subslot_spucch_format1b_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_subslot_spucch_rm_format4_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.delta_f_subslot_spucch_tbcc_format4_r15_present, 1));
      if (c.delta_f_slot_spucch_format1_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_format1_r15.unpack(bref));
      }
      if (c.delta_f_slot_spucch_format1a_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_format1a_r15.unpack(bref));
      }
      if (c.delta_f_slot_spucch_format1b_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_format1b_r15.unpack(bref));
      }
      if (c.delta_f_slot_spucch_format3_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_format3_r15.unpack(bref));
      }
      if (c.delta_f_slot_spucch_rm_format4_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_rm_format4_r15.unpack(bref));
      }
      if (c.delta_f_slot_spucch_tbcc_format4_r15_present) {
        HANDLE_CODE(c.delta_f_slot_spucch_tbcc_format4_r15.unpack(bref));
      }
      if (c.delta_f_subslot_spucch_format1and1a_r15_present) {
        HANDLE_CODE(c.delta_f_subslot_spucch_format1and1a_r15.unpack(bref));
      }
      if (c.delta_f_subslot_spucch_format1b_r15_present) {
        HANDLE_CODE(c.delta_f_subslot_spucch_format1b_r15.unpack(bref));
      }
      if (c.delta_f_subslot_spucch_rm_format4_r15_present) {
        HANDLE_CODE(c.delta_f_subslot_spucch_rm_format4_r15.unpack(bref));
      }
      if (c.delta_f_subslot_spucch_tbcc_format4_r15_present) {
        HANDLE_CODE(c.delta_f_subslot_spucch_tbcc_format4_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "delta_flist_spucch_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// LAA-SCellConfiguration-r13 ::= SEQUENCE
SRSASN_CODE laa_scell_cfg_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sf_start_position_r13.pack(bref));
  HANDLE_CODE(laa_scell_sf_cfg_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE laa_scell_cfg_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sf_start_position_r13.unpack(bref));
  HANDLE_CODE(laa_scell_sf_cfg_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void laa_scell_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("subframeStartPosition-r13", sf_start_position_r13.to_string());
  j.write_str("laa-SCellSubframeConfig-r13", laa_scell_sf_cfg_r13.to_string());
  j.end_obj();
}

// LAA-SCellConfiguration-v1430 ::= SEQUENCE
SRSASN_CODE laa_scell_cfg_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cross_carrier_sched_cfg_ul_r14_present, 1));
  HANDLE_CODE(bref.pack(lbt_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(pdcch_cfg_laa_r14_present, 1));
  HANDLE_CODE(bref.pack(absence_of_any_other_technology_r14_present, 1));
  HANDLE_CODE(bref.pack(srs_ul_cfg_ded_aperiodic_v1430_present, 1));

  if (cross_carrier_sched_cfg_ul_r14_present) {
    HANDLE_CODE(cross_carrier_sched_cfg_ul_r14.pack(bref));
  }
  if (lbt_cfg_r14_present) {
    HANDLE_CODE(lbt_cfg_r14.pack(bref));
  }
  if (pdcch_cfg_laa_r14_present) {
    HANDLE_CODE(pdcch_cfg_laa_r14.pack(bref));
  }
  if (srs_ul_cfg_ded_aperiodic_v1430_present) {
    HANDLE_CODE(srs_ul_cfg_ded_aperiodic_v1430.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE laa_scell_cfg_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cross_carrier_sched_cfg_ul_r14_present, 1));
  HANDLE_CODE(bref.unpack(lbt_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(pdcch_cfg_laa_r14_present, 1));
  HANDLE_CODE(bref.unpack(absence_of_any_other_technology_r14_present, 1));
  HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_aperiodic_v1430_present, 1));

  if (cross_carrier_sched_cfg_ul_r14_present) {
    HANDLE_CODE(cross_carrier_sched_cfg_ul_r14.unpack(bref));
  }
  if (lbt_cfg_r14_present) {
    HANDLE_CODE(lbt_cfg_r14.unpack(bref));
  }
  if (pdcch_cfg_laa_r14_present) {
    HANDLE_CODE(pdcch_cfg_laa_r14.unpack(bref));
  }
  if (srs_ul_cfg_ded_aperiodic_v1430_present) {
    HANDLE_CODE(srs_ul_cfg_ded_aperiodic_v1430.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void laa_scell_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cross_carrier_sched_cfg_ul_r14_present) {
    j.write_fieldname("crossCarrierSchedulingConfig-UL-r14");
    cross_carrier_sched_cfg_ul_r14.to_json(j);
  }
  if (lbt_cfg_r14_present) {
    j.write_fieldname("lbt-Config-r14");
    lbt_cfg_r14.to_json(j);
  }
  if (pdcch_cfg_laa_r14_present) {
    j.write_fieldname("pdcch-ConfigLAA-r14");
    pdcch_cfg_laa_r14.to_json(j);
  }
  if (absence_of_any_other_technology_r14_present) {
    j.write_str("absenceOfAnyOtherTechnology-r14", "true");
  }
  if (srs_ul_cfg_ded_aperiodic_v1430_present) {
    j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodic-v1430");
    srs_ul_cfg_ded_aperiodic_v1430.to_json(j);
  }
  j.end_obj();
}

void laa_scell_cfg_v1430_s::cross_carrier_sched_cfg_ul_r14_c_::set(types::options e)
{
  type_ = e;
}
void laa_scell_cfg_v1430_s::cross_carrier_sched_cfg_ul_r14_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("crossCarrierSchedulingConfigLAA-UL-r14");
      c.cross_carrier_sched_cfg_laa_ul_r14.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "laa_scell_cfg_v1430_s::cross_carrier_sched_cfg_ul_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE laa_scell_cfg_v1430_s::cross_carrier_sched_cfg_ul_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.cross_carrier_sched_cfg_laa_ul_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "laa_scell_cfg_v1430_s::cross_carrier_sched_cfg_ul_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE laa_scell_cfg_v1430_s::cross_carrier_sched_cfg_ul_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.cross_carrier_sched_cfg_laa_ul_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "laa_scell_cfg_v1430_s::cross_carrier_sched_cfg_ul_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// LAA-SCellConfiguration-v1530 ::= SEQUENCE
SRSASN_CODE laa_scell_cfg_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(aul_cfg_r15_present, 1));
  HANDLE_CODE(bref.pack(pusch_mode_cfg_laa_r15_present, 1));

  if (aul_cfg_r15_present) {
    HANDLE_CODE(aul_cfg_r15.pack(bref));
  }
  if (pusch_mode_cfg_laa_r15_present) {
    HANDLE_CODE(pusch_mode_cfg_laa_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE laa_scell_cfg_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(aul_cfg_r15_present, 1));
  HANDLE_CODE(bref.unpack(pusch_mode_cfg_laa_r15_present, 1));

  if (aul_cfg_r15_present) {
    HANDLE_CODE(aul_cfg_r15.unpack(bref));
  }
  if (pusch_mode_cfg_laa_r15_present) {
    HANDLE_CODE(pusch_mode_cfg_laa_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void laa_scell_cfg_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (aul_cfg_r15_present) {
    j.write_fieldname("aul-Config-r15");
    aul_cfg_r15.to_json(j);
  }
  if (pusch_mode_cfg_laa_r15_present) {
    j.write_fieldname("pusch-ModeConfigLAA-r15");
    pusch_mode_cfg_laa_r15.to_json(j);
  }
  j.end_obj();
}

// PDCCH-ConfigSCell-r13 ::= SEQUENCE
SRSASN_CODE pdcch_cfg_scell_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(skip_monitoring_dci_format0_minus1_a_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcch_cfg_scell_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(skip_monitoring_dci_format0_minus1_a_r13_present, 1));

  return SRSASN_SUCCESS;
}
void pdcch_cfg_scell_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (skip_monitoring_dci_format0_minus1_a_r13_present) {
    j.write_str("skipMonitoringDCI-format0-1A-r13", "true");
  }
  j.end_obj();
}

// PDSCH-ConfigDedicatedSCell-v1430 ::= SEQUENCE
SRSASN_CODE pdsch_cfg_ded_scell_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tbs_idx_alt2_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdsch_cfg_ded_scell_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tbs_idx_alt2_r14_present, 1));

  return SRSASN_SUCCESS;
}
void pdsch_cfg_ded_scell_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tbs_idx_alt2_r14_present) {
    j.write_str("tbsIndexAlt2-r14", "b33");
  }
  j.end_obj();
}

// PUCCH-ConfigDedicated-v1370 ::= SEQUENCE
SRSASN_CODE pucch_cfg_ded_v1370_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pucch_format_v1370.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1370_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(pucch_format_v1370.unpack(bref));

  return SRSASN_SUCCESS;
}
void pucch_cfg_ded_v1370_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("pucch-Format-v1370");
  pucch_format_v1370.to_json(j);
  j.end_obj();
}

void pucch_cfg_ded_v1370_s::pucch_format_v1370_c_::set(types::options e)
{
  type_ = e;
}
void pucch_cfg_ded_v1370_s::pucch_format_v1370_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1370_s::pucch_format_v1370_c_");
  }
  j.end_obj();
}
SRSASN_CODE pucch_cfg_ded_v1370_s::pucch_format_v1370_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1370_s::pucch_format_v1370_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pucch_cfg_ded_v1370_s::pucch_format_v1370_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pucch_cfg_ded_v1370_s::pucch_format_v1370_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PUSCH-ConfigDedicatedSCell-r10 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_scell_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(group_hop_disabled_r10_present, 1));
  HANDLE_CODE(bref.pack(dmrs_with_occ_activ_r10_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_scell_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(group_hop_disabled_r10_present, 1));
  HANDLE_CODE(bref.unpack(dmrs_with_occ_activ_r10_present, 1));

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_scell_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (group_hop_disabled_r10_present) {
    j.write_str("groupHoppingDisabled-r10", "true");
  }
  if (dmrs_with_occ_activ_r10_present) {
    j.write_str("dmrs-WithOCC-Activated-r10", "true");
  }
  j.end_obj();
}

// PUSCH-ConfigDedicatedSCell-v1430 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_scell_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(enable256_qam_r14_present, 1));

  if (enable256_qam_r14_present) {
    HANDLE_CODE(enable256_qam_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_scell_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(enable256_qam_r14_present, 1));

  if (enable256_qam_r14_present) {
    HANDLE_CODE(enable256_qam_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_scell_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (enable256_qam_r14_present) {
    j.write_fieldname("enable256QAM-r14");
    enable256_qam_r14.to_json(j);
  }
  j.end_obj();
}

// PUSCH-ConfigDedicatedScell-v1530 ::= SEQUENCE
SRSASN_CODE pusch_cfg_ded_scell_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(uci_on_pusch_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_scell_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(uci_on_pusch_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void pusch_cfg_ded_scell_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("uci-OnPUSCH-r15");
  uci_on_pusch_r15.to_json(j);
  j.end_obj();
}

void pusch_cfg_ded_scell_v1530_s::uci_on_pusch_r15_c_::set(types::options e)
{
  type_ = e;
}
void pusch_cfg_ded_scell_v1530_s::uci_on_pusch_r15_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_int("betaOffsetAUL-r15", c.beta_offset_aul_r15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_scell_v1530_s::uci_on_pusch_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE pusch_cfg_ded_scell_v1530_s::uci_on_pusch_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c.beta_offset_aul_r15, (uint8_t)0u, (uint8_t)15u));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_scell_v1530_s::uci_on_pusch_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pusch_cfg_ded_scell_v1530_s::uci_on_pusch_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c.beta_offset_aul_r15, bref, (uint8_t)0u, (uint8_t)15u));
      break;
    default:
      log_invalid_choice_id(type_, "pusch_cfg_ded_scell_v1530_s::uci_on_pusch_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SchedulingRequestConfigSCell-r13 ::= CHOICE
void sched_request_cfg_scell_r13_c::set(types::options e)
{
  type_ = e;
}
void sched_request_cfg_scell_r13_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_int("sr-PUCCH-ResourceIndex-r13", c.sr_pucch_res_idx_r13);
      if (c.sr_pucch_res_idx_p1_r13_present) {
        j.write_int("sr-PUCCH-ResourceIndexP1-r13", c.sr_pucch_res_idx_p1_r13);
      }
      j.write_int("sr-ConfigIndex-r13", c.sr_cfg_idx_r13);
      j.write_str("dsr-TransMax-r13", c.dsr_trans_max_r13.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_scell_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE sched_request_cfg_scell_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.sr_pucch_res_idx_p1_r13_present, 1));
      HANDLE_CODE(pack_integer(bref, c.sr_pucch_res_idx_r13, (uint16_t)0u, (uint16_t)2047u));
      if (c.sr_pucch_res_idx_p1_r13_present) {
        HANDLE_CODE(pack_integer(bref, c.sr_pucch_res_idx_p1_r13, (uint16_t)0u, (uint16_t)2047u));
      }
      HANDLE_CODE(pack_integer(bref, c.sr_cfg_idx_r13, (uint8_t)0u, (uint8_t)157u));
      HANDLE_CODE(c.dsr_trans_max_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_scell_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sched_request_cfg_scell_r13_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.sr_pucch_res_idx_p1_r13_present, 1));
      HANDLE_CODE(unpack_integer(c.sr_pucch_res_idx_r13, bref, (uint16_t)0u, (uint16_t)2047u));
      if (c.sr_pucch_res_idx_p1_r13_present) {
        HANDLE_CODE(unpack_integer(c.sr_pucch_res_idx_p1_r13, bref, (uint16_t)0u, (uint16_t)2047u));
      }
      HANDLE_CODE(unpack_integer(c.sr_cfg_idx_r13, bref, (uint8_t)0u, (uint8_t)157u));
      HANDLE_CODE(c.dsr_trans_max_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sched_request_cfg_scell_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SoundingRS-AperiodicSet-r14 ::= SEQUENCE
SRSASN_CODE srs_aperiodic_set_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(srs_cc_set_idx_list_r14_present, 1));

  if (srs_cc_set_idx_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, srs_cc_set_idx_list_r14, 1, 4));
  }
  HANDLE_CODE(srs_ul_cfg_ded_aperiodic_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_aperiodic_set_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(srs_cc_set_idx_list_r14_present, 1));

  if (srs_cc_set_idx_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(srs_cc_set_idx_list_r14, bref, 1, 4));
  }
  HANDLE_CODE(srs_ul_cfg_ded_aperiodic_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void srs_aperiodic_set_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (srs_cc_set_idx_list_r14_present) {
    j.start_array("srs-CC-SetIndexList-r14");
    for (const auto& e1 : srs_cc_set_idx_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodic-r14");
  srs_ul_cfg_ded_aperiodic_r14.to_json(j);
  j.end_obj();
}

// SoundingRS-AperiodicSetUpPTsExt-r14 ::= SEQUENCE
SRSASN_CODE srs_aperiodic_set_up_pts_ext_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(srs_cc_set_idx_list_r14_present, 1));

  if (srs_cc_set_idx_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, srs_cc_set_idx_list_r14, 1, 4));
  }
  HANDLE_CODE(srs_ul_cfg_ded_aperiodic_up_pts_ext_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE srs_aperiodic_set_up_pts_ext_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(srs_cc_set_idx_list_r14_present, 1));

  if (srs_cc_set_idx_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(srs_cc_set_idx_list_r14, bref, 1, 4));
  }
  HANDLE_CODE(srs_ul_cfg_ded_aperiodic_up_pts_ext_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void srs_aperiodic_set_up_pts_ext_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (srs_cc_set_idx_list_r14_present) {
    j.start_array("srs-CC-SetIndexList-r14");
    for (const auto& e1 : srs_cc_set_idx_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodicUpPTsExt-r14");
  srs_ul_cfg_ded_aperiodic_up_pts_ext_r14.to_json(j);
  j.end_obj();
}

// TPC-PDCCH-ConfigSCell-r13 ::= CHOICE
void tpc_pdcch_cfg_scell_r13_c::set(types::options e)
{
  type_ = e;
}
void tpc_pdcch_cfg_scell_r13_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("tpc-Index-PUCCH-SCell-r13");
      c.tpc_idx_pucch_scell_r13.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "tpc_pdcch_cfg_scell_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE tpc_pdcch_cfg_scell_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.tpc_idx_pucch_scell_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "tpc_pdcch_cfg_scell_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE tpc_pdcch_cfg_scell_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.tpc_idx_pucch_scell_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "tpc_pdcch_cfg_scell_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UplinkPUSCH-LessPowerControlDedicated-v1430 ::= SEQUENCE
SRSASN_CODE ul_pusch_less_pwr_ctrl_ded_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(p0_ue_periodic_srs_r14_present, 1));
  HANDLE_CODE(bref.pack(p0_ue_aperiodic_srs_r14_present, 1));

  if (p0_ue_periodic_srs_r14_present) {
    HANDLE_CODE(pack_integer(bref, p0_ue_periodic_srs_r14, (int8_t)-8, (int8_t)7));
  }
  if (p0_ue_aperiodic_srs_r14_present) {
    HANDLE_CODE(pack_integer(bref, p0_ue_aperiodic_srs_r14, (int8_t)-8, (int8_t)7));
  }
  HANDLE_CODE(bref.pack(accumulation_enabled_r14, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pusch_less_pwr_ctrl_ded_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(p0_ue_periodic_srs_r14_present, 1));
  HANDLE_CODE(bref.unpack(p0_ue_aperiodic_srs_r14_present, 1));

  if (p0_ue_periodic_srs_r14_present) {
    HANDLE_CODE(unpack_integer(p0_ue_periodic_srs_r14, bref, (int8_t)-8, (int8_t)7));
  }
  if (p0_ue_aperiodic_srs_r14_present) {
    HANDLE_CODE(unpack_integer(p0_ue_aperiodic_srs_r14, bref, (int8_t)-8, (int8_t)7));
  }
  HANDLE_CODE(bref.unpack(accumulation_enabled_r14, 1));

  return SRSASN_SUCCESS;
}
void ul_pusch_less_pwr_ctrl_ded_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (p0_ue_periodic_srs_r14_present) {
    j.write_int("p0-UE-PeriodicSRS-r14", p0_ue_periodic_srs_r14);
  }
  if (p0_ue_aperiodic_srs_r14_present) {
    j.write_int("p0-UE-AperiodicSRS-r14", p0_ue_aperiodic_srs_r14);
  }
  j.write_bool("accumulationEnabled-r14", accumulation_enabled_r14);
  j.end_obj();
}

// UplinkPowerControlDedicatedSCell-r10 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_ded_scell_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(psrs_offset_ap_r10_present, 1));
  HANDLE_CODE(bref.pack(filt_coef_r10_present, 1));

  HANDLE_CODE(pack_integer(bref, p0_ue_pusch_r10, (int8_t)-8, (int8_t)7));
  HANDLE_CODE(delta_mcs_enabled_r10.pack(bref));
  HANDLE_CODE(bref.pack(accumulation_enabled_r10, 1));
  HANDLE_CODE(pack_integer(bref, psrs_offset_r10, (uint8_t)0u, (uint8_t)15u));
  if (psrs_offset_ap_r10_present) {
    HANDLE_CODE(pack_integer(bref, psrs_offset_ap_r10, (uint8_t)0u, (uint8_t)15u));
  }
  if (filt_coef_r10_present) {
    HANDLE_CODE(filt_coef_r10.pack(bref));
  }
  HANDLE_CODE(pathloss_ref_linking_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_scell_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(psrs_offset_ap_r10_present, 1));
  HANDLE_CODE(bref.unpack(filt_coef_r10_present, 1));

  HANDLE_CODE(unpack_integer(p0_ue_pusch_r10, bref, (int8_t)-8, (int8_t)7));
  HANDLE_CODE(delta_mcs_enabled_r10.unpack(bref));
  HANDLE_CODE(bref.unpack(accumulation_enabled_r10, 1));
  HANDLE_CODE(unpack_integer(psrs_offset_r10, bref, (uint8_t)0u, (uint8_t)15u));
  if (psrs_offset_ap_r10_present) {
    HANDLE_CODE(unpack_integer(psrs_offset_ap_r10, bref, (uint8_t)0u, (uint8_t)15u));
  }
  if (filt_coef_r10_present) {
    HANDLE_CODE(filt_coef_r10.unpack(bref));
  }
  HANDLE_CODE(pathloss_ref_linking_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_ded_scell_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p0-UE-PUSCH-r10", p0_ue_pusch_r10);
  j.write_str("deltaMCS-Enabled-r10", delta_mcs_enabled_r10.to_string());
  j.write_bool("accumulationEnabled-r10", accumulation_enabled_r10);
  j.write_int("pSRS-Offset-r10", psrs_offset_r10);
  if (psrs_offset_ap_r10_present) {
    j.write_int("pSRS-OffsetAp-r10", psrs_offset_ap_r10);
  }
  if (filt_coef_r10_present) {
    j.write_str("filterCoefficient-r10", filt_coef_r10.to_string());
  }
  j.write_str("pathlossReferenceLinking-r10", pathloss_ref_linking_r10.to_string());
  j.end_obj();
}

// UplinkPowerControlDedicatedSCell-v1310 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_ded_scell_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(delta_tx_d_offset_list_pucch_r10_present, 1));

  HANDLE_CODE(pack_integer(bref, p0_ue_pucch, (int8_t)-8, (int8_t)7));
  if (delta_tx_d_offset_list_pucch_r10_present) {
    HANDLE_CODE(delta_tx_d_offset_list_pucch_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_ded_scell_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(delta_tx_d_offset_list_pucch_r10_present, 1));

  HANDLE_CODE(unpack_integer(p0_ue_pucch, bref, (int8_t)-8, (int8_t)7));
  if (delta_tx_d_offset_list_pucch_r10_present) {
    HANDLE_CODE(delta_tx_d_offset_list_pucch_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_ded_scell_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p0-UE-PUCCH", p0_ue_pucch);
  if (delta_tx_d_offset_list_pucch_r10_present) {
    j.write_fieldname("deltaTxD-OffsetListPUCCH-r10");
    delta_tx_d_offset_list_pucch_r10.to_json(j);
  }
  j.end_obj();
}

// AntennaInfoCommon ::= SEQUENCE
SRSASN_CODE ant_info_common_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(ant_ports_count.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_common_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(ant_ports_count.unpack(bref));

  return SRSASN_SUCCESS;
}
void ant_info_common_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("antennaPortsCount", ant_ports_count.to_string());
  j.end_obj();
}

// HighSpeedConfigSCell-r14 ::= SEQUENCE
SRSASN_CODE high_speed_cfg_scell_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(high_speed_enhanced_demod_flag_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE high_speed_cfg_scell_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(high_speed_enhanced_demod_flag_r14_present, 1));

  return SRSASN_SUCCESS;
}
void high_speed_cfg_scell_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (high_speed_enhanced_demod_flag_r14_present) {
    j.write_str("highSpeedEnhancedDemodulationFlag-r14", "true");
  }
  j.end_obj();
}

// MAC-MainConfigSCell-r11 ::= SEQUENCE
SRSASN_CODE mac_main_cfg_scell_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(stag_id_r11_present, 1));

  if (stag_id_r11_present) {
    HANDLE_CODE(pack_integer(bref, stag_id_r11, (uint8_t)1u, (uint8_t)3u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_scell_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(stag_id_r11_present, 1));

  if (stag_id_r11_present) {
    HANDLE_CODE(unpack_integer(stag_id_r11, bref, (uint8_t)1u, (uint8_t)3u));
  }

  return SRSASN_SUCCESS;
}
void mac_main_cfg_scell_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (stag_id_r11_present) {
    j.write_int("stag-Id-r11", stag_id_r11);
  }
  j.end_obj();
}

// PRACH-Config ::= SEQUENCE
SRSASN_CODE prach_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(prach_cfg_info_present, 1));

  HANDLE_CODE(pack_integer(bref, root_seq_idx, (uint16_t)0u, (uint16_t)837u));
  if (prach_cfg_info_present) {
    HANDLE_CODE(prach_cfg_info.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(prach_cfg_info_present, 1));

  HANDLE_CODE(unpack_integer(root_seq_idx, bref, (uint16_t)0u, (uint16_t)837u));
  if (prach_cfg_info_present) {
    HANDLE_CODE(prach_cfg_info.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void prach_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("rootSequenceIndex", root_seq_idx);
  if (prach_cfg_info_present) {
    j.write_fieldname("prach-ConfigInfo");
    prach_cfg_info.to_json(j);
  }
  j.end_obj();
}

// PRACH-ConfigSCell-r10 ::= SEQUENCE
SRSASN_CODE prach_cfg_scell_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, prach_cfg_idx_r10, (uint8_t)0u, (uint8_t)63u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_scell_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(prach_cfg_idx_r10, bref, (uint8_t)0u, (uint8_t)63u));

  return SRSASN_SUCCESS;
}
void prach_cfg_scell_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("prach-ConfigIndex-r10", prach_cfg_idx_r10);
  j.end_obj();
}

// PhysicalConfigDedicatedSCell-r10 ::= SEQUENCE
SRSASN_CODE phys_cfg_ded_scell_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(non_ul_cfg_r10_present, 1));
  HANDLE_CODE(bref.pack(ul_cfg_r10_present, 1));

  if (non_ul_cfg_r10_present) {
    HANDLE_CODE(bref.pack(non_ul_cfg_r10.ant_info_r10_present, 1));
    HANDLE_CODE(bref.pack(non_ul_cfg_r10.cross_carrier_sched_cfg_r10_present, 1));
    HANDLE_CODE(bref.pack(non_ul_cfg_r10.csi_rs_cfg_r10_present, 1));
    HANDLE_CODE(bref.pack(non_ul_cfg_r10.pdsch_cfg_ded_r10_present, 1));
    if (non_ul_cfg_r10.ant_info_r10_present) {
      HANDLE_CODE(non_ul_cfg_r10.ant_info_r10.pack(bref));
    }
    if (non_ul_cfg_r10.cross_carrier_sched_cfg_r10_present) {
      HANDLE_CODE(non_ul_cfg_r10.cross_carrier_sched_cfg_r10.pack(bref));
    }
    if (non_ul_cfg_r10.csi_rs_cfg_r10_present) {
      HANDLE_CODE(non_ul_cfg_r10.csi_rs_cfg_r10.pack(bref));
    }
    if (non_ul_cfg_r10.pdsch_cfg_ded_r10_present) {
      HANDLE_CODE(non_ul_cfg_r10.pdsch_cfg_ded_r10.pack(bref));
    }
  }
  if (ul_cfg_r10_present) {
    HANDLE_CODE(bref.pack(ul_cfg_r10.ant_info_ul_r10_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.pusch_cfg_ded_scell_r10_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.ul_pwr_ctrl_ded_scell_r10_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.cqi_report_cfg_scell_r10_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.srs_ul_cfg_ded_r10_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.srs_ul_cfg_ded_v1020_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.srs_ul_cfg_ded_aperiodic_r10_present, 1));
    if (ul_cfg_r10.ant_info_ul_r10_present) {
      HANDLE_CODE(ul_cfg_r10.ant_info_ul_r10.pack(bref));
    }
    if (ul_cfg_r10.pusch_cfg_ded_scell_r10_present) {
      HANDLE_CODE(ul_cfg_r10.pusch_cfg_ded_scell_r10.pack(bref));
    }
    if (ul_cfg_r10.ul_pwr_ctrl_ded_scell_r10_present) {
      HANDLE_CODE(ul_cfg_r10.ul_pwr_ctrl_ded_scell_r10.pack(bref));
    }
    if (ul_cfg_r10.cqi_report_cfg_scell_r10_present) {
      HANDLE_CODE(ul_cfg_r10.cqi_report_cfg_scell_r10.pack(bref));
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_r10_present) {
      HANDLE_CODE(ul_cfg_r10.srs_ul_cfg_ded_r10.pack(bref));
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_v1020_present) {
      HANDLE_CODE(ul_cfg_r10.srs_ul_cfg_ded_v1020.pack(bref));
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_aperiodic_r10_present) {
      HANDLE_CODE(ul_cfg_r10.srs_ul_cfg_ded_aperiodic_r10.pack(bref));
    }
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= csi_rs_cfg_nzp_to_release_list_r11.is_present();
    group_flags[0] |= csi_rs_cfg_nzp_to_add_mod_list_r11.is_present();
    group_flags[0] |= csi_rs_cfg_zp_to_release_list_r11.is_present();
    group_flags[0] |= csi_rs_cfg_zp_to_add_mod_list_r11.is_present();
    group_flags[0] |= epdcch_cfg_r11.is_present();
    group_flags[0] |= pdsch_cfg_ded_v1130.is_present();
    group_flags[0] |= cqi_report_cfg_v1130.is_present();
    group_flags[0] |= pusch_cfg_ded_v1130.is_present();
    group_flags[0] |= ul_pwr_ctrl_ded_scell_v1130.is_present();
    group_flags[1] |= ant_info_v1250.is_present();
    group_flags[1] |= eimta_main_cfg_scell_r12.is_present();
    group_flags[1] |= cqi_report_cfg_scell_v1250.is_present();
    group_flags[1] |= ul_pwr_ctrl_ded_scell_v1250.is_present();
    group_flags[1] |= csi_rs_cfg_v1250.is_present();
    group_flags[2] |= pdsch_cfg_ded_v1280.is_present();
    group_flags[3] |= pucch_cell_r13_present;
    group_flags[3] |= pucch_scell.is_present();
    group_flags[3] |= cross_carrier_sched_cfg_r13.is_present();
    group_flags[3] |= pdcch_cfg_scell_r13.is_present();
    group_flags[3] |= cqi_report_cfg_v1310.is_present();
    group_flags[3] |= pdsch_cfg_ded_v1310.is_present();
    group_flags[3] |= srs_ul_cfg_ded_v1310.is_present();
    group_flags[3] |= srs_ul_cfg_ded_up_pts_ext_r13.is_present();
    group_flags[3] |= srs_ul_cfg_ded_aperiodic_v1310.is_present();
    group_flags[3] |= srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present();
    group_flags[3] |= csi_rs_cfg_v1310.is_present();
    group_flags[3] |= laa_scell_cfg_r13.is_present();
    group_flags[3] |= csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present();
    group_flags[3] |= csi_rs_cfg_nzp_to_release_list_ext_r13.is_present();
    group_flags[4] |= cqi_report_cfg_v1320.is_present();
    group_flags[5] |= laa_scell_cfg_v1430.is_present();
    group_flags[5] |= type_b_srs_tpc_pdcch_cfg_r14.is_present();
    group_flags[5] |= ul_pusch_less_pwr_ctrl_ded_v1430.is_present();
    group_flags[5] |= srs_ul_periodic_cfg_ded_list_r14.is_present();
    group_flags[5] |= srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present();
    group_flags[5] |= srs_ul_aperiodic_cfg_ded_list_r14.is_present();
    group_flags[5] |= srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present();
    group_flags[5] |= must_cfg_r14.is_present();
    group_flags[5] |= pusch_cfg_ded_v1430.is_present();
    group_flags[5] |= csi_rs_cfg_v1430.is_present();
    group_flags[5] |= csi_rs_cfg_zp_ap_list_r14.is_present();
    group_flags[5] |= cqi_report_cfg_v1430.is_present();
    group_flags[5] |= semi_open_loop_r14_present;
    group_flags[5] |= pdsch_cfg_ded_scell_v1430.is_present();
    group_flags[6] |= csi_rs_cfg_v1480.is_present();
    group_flags[7] |= phys_cfg_ded_stti_r15.is_present();
    group_flags[7] |= pdsch_cfg_ded_v1530.is_present();
    group_flags[7] |= cqi_report_cfg_v1530.is_present();
    group_flags[7] |= cqi_report_cfg_scell_r15.is_present();
    group_flags[7] |= cqi_short_cfg_scell_r15.is_present();
    group_flags[7] |= csi_rs_cfg_v1530.is_present();
    group_flags[7] |= ul_pwr_ctrl_ded_scell_v1530.is_present();
    group_flags[7] |= laa_scell_cfg_v1530.is_present();
    group_flags[7] |= pusch_cfg_ded_v1530.is_present();
    group_flags[7] |= semi_static_cfi_cfg_r15.is_present();
    group_flags[7] |= blind_pdsch_repeat_cfg_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_to_release_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_to_add_mod_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_zp_to_release_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_zp_to_add_mod_list_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(epdcch_cfg_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1130.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_v1130.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1130.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_ded_scell_v1130.is_present(), 1));
      if (csi_rs_cfg_nzp_to_release_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_nzp_to_release_list_r11, 1, 3, integer_packer<uint8_t>(1, 3)));
      }
      if (csi_rs_cfg_nzp_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_nzp_to_add_mod_list_r11, 1, 3));
      }
      if (csi_rs_cfg_zp_to_release_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_zp_to_release_list_r11, 1, 4, integer_packer<uint8_t>(1, 4)));
      }
      if (csi_rs_cfg_zp_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_zp_to_add_mod_list_r11, 1, 4));
      }
      if (epdcch_cfg_r11.is_present()) {
        HANDLE_CODE(epdcch_cfg_r11->pack(bref));
      }
      if (pdsch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1130->pack(bref));
      }
      if (cqi_report_cfg_v1130.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1130->pack(bref));
      }
      if (pusch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1130->pack(bref));
      }
      if (ul_pwr_ctrl_ded_scell_v1130.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_scell_v1130->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ant_info_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(eimta_main_cfg_scell_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_scell_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_ded_scell_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_v1250.is_present(), 1));
      if (ant_info_v1250.is_present()) {
        HANDLE_CODE(ant_info_v1250->pack(bref));
      }
      if (eimta_main_cfg_scell_r12.is_present()) {
        HANDLE_CODE(eimta_main_cfg_scell_r12->pack(bref));
      }
      if (cqi_report_cfg_scell_v1250.is_present()) {
        HANDLE_CODE(cqi_report_cfg_scell_v1250->pack(bref));
      }
      if (ul_pwr_ctrl_ded_scell_v1250.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_scell_v1250->pack(bref));
      }
      if (csi_rs_cfg_v1250.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1250->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1280.is_present(), 1));
      if (pdsch_cfg_ded_v1280.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1280->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pucch_cell_r13_present, 1));
      HANDLE_CODE(bref.pack(pucch_scell.is_present(), 1));
      HANDLE_CODE(bref.pack(cross_carrier_sched_cfg_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(pdcch_cfg_scell_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_up_pts_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_aperiodic_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(laa_scell_cfg_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_nzp_to_release_list_ext_r13.is_present(), 1));
      if (pucch_scell.is_present()) {
        HANDLE_CODE(pucch_scell->pack(bref));
      }
      if (cross_carrier_sched_cfg_r13.is_present()) {
        HANDLE_CODE(cross_carrier_sched_cfg_r13->pack(bref));
      }
      if (pdcch_cfg_scell_r13.is_present()) {
        HANDLE_CODE(pdcch_cfg_scell_r13->pack(bref));
      }
      if (cqi_report_cfg_v1310.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1310->pack(bref));
      }
      if (pdsch_cfg_ded_v1310.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1310->pack(bref));
      }
      if (srs_ul_cfg_ded_v1310.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_v1310->pack(bref));
      }
      if (srs_ul_cfg_ded_up_pts_ext_r13.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_up_pts_ext_r13->pack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_v1310.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_v1310->pack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13->pack(bref));
      }
      if (csi_rs_cfg_v1310.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1310->pack(bref));
      }
      if (laa_scell_cfg_r13.is_present()) {
        HANDLE_CODE(laa_scell_cfg_r13->pack(bref));
      }
      if (csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *csi_rs_cfg_nzp_to_add_mod_list_ext_r13, 1, 21));
      }
      if (csi_rs_cfg_nzp_to_release_list_ext_r13.is_present()) {
        HANDLE_CODE(
            pack_dyn_seq_of(bref, *csi_rs_cfg_nzp_to_release_list_ext_r13, 1, 21, integer_packer<uint8_t>(4, 24)));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cqi_report_cfg_v1320.is_present(), 1));
      if (cqi_report_cfg_v1320.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1320->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(laa_scell_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(type_b_srs_tpc_pdcch_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pusch_less_pwr_ctrl_ded_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_periodic_cfg_ded_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_aperiodic_cfg_ded_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(must_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_zp_ap_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(semi_open_loop_r14_present, 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_ded_scell_v1430.is_present(), 1));
      if (laa_scell_cfg_v1430.is_present()) {
        HANDLE_CODE(laa_scell_cfg_v1430->pack(bref));
      }
      if (type_b_srs_tpc_pdcch_cfg_r14.is_present()) {
        HANDLE_CODE(type_b_srs_tpc_pdcch_cfg_r14->pack(bref));
      }
      if (ul_pusch_less_pwr_ctrl_ded_v1430.is_present()) {
        HANDLE_CODE(ul_pusch_less_pwr_ctrl_ded_v1430->pack(bref));
      }
      if (srs_ul_periodic_cfg_ded_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srs_ul_periodic_cfg_ded_list_r14, 1, 2));
      }
      if (srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srs_ul_periodic_cfg_ded_up_pts_ext_list_r14, 1, 4));
      }
      if (srs_ul_aperiodic_cfg_ded_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srs_ul_aperiodic_cfg_ded_list_r14, 1, 2));
      }
      if (srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *srs_ul_cfg_ded_ap_up_pts_ext_list_r14, 1, 4));
      }
      if (must_cfg_r14.is_present()) {
        HANDLE_CODE(must_cfg_r14->pack(bref));
      }
      if (pusch_cfg_ded_v1430.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1430->pack(bref));
      }
      if (csi_rs_cfg_v1430.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1430->pack(bref));
      }
      if (csi_rs_cfg_zp_ap_list_r14.is_present()) {
        HANDLE_CODE(csi_rs_cfg_zp_ap_list_r14->pack(bref));
      }
      if (cqi_report_cfg_v1430.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1430->pack(bref));
      }
      if (semi_open_loop_r14_present) {
        HANDLE_CODE(bref.pack(semi_open_loop_r14, 1));
      }
      if (pdsch_cfg_ded_scell_v1430.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_scell_v1430->pack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(csi_rs_cfg_v1480.is_present(), 1));
      if (csi_rs_cfg_v1480.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1480->pack(bref));
      }
    }
    if (group_flags[7]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(phys_cfg_ded_stti_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_ded_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_report_cfg_scell_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(cqi_short_cfg_scell_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(csi_rs_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_ded_scell_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(laa_scell_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_ded_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(semi_static_cfi_cfg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(blind_pdsch_repeat_cfg_r15.is_present(), 1));
      if (phys_cfg_ded_stti_r15.is_present()) {
        HANDLE_CODE(phys_cfg_ded_stti_r15->pack(bref));
      }
      if (pdsch_cfg_ded_v1530.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1530->pack(bref));
      }
      if (cqi_report_cfg_v1530.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1530->pack(bref));
      }
      if (cqi_report_cfg_scell_r15.is_present()) {
        HANDLE_CODE(cqi_report_cfg_scell_r15->pack(bref));
      }
      if (cqi_short_cfg_scell_r15.is_present()) {
        HANDLE_CODE(cqi_short_cfg_scell_r15->pack(bref));
      }
      if (csi_rs_cfg_v1530.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1530->pack(bref));
      }
      if (ul_pwr_ctrl_ded_scell_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_scell_v1530->pack(bref));
      }
      if (laa_scell_cfg_v1530.is_present()) {
        HANDLE_CODE(laa_scell_cfg_v1530->pack(bref));
      }
      if (pusch_cfg_ded_v1530.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1530->pack(bref));
      }
      if (semi_static_cfi_cfg_r15.is_present()) {
        HANDLE_CODE(semi_static_cfi_cfg_r15->pack(bref));
      }
      if (blind_pdsch_repeat_cfg_r15.is_present()) {
        HANDLE_CODE(blind_pdsch_repeat_cfg_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(non_ul_cfg_r10_present, 1));
  HANDLE_CODE(bref.unpack(ul_cfg_r10_present, 1));

  if (non_ul_cfg_r10_present) {
    HANDLE_CODE(bref.unpack(non_ul_cfg_r10.ant_info_r10_present, 1));
    HANDLE_CODE(bref.unpack(non_ul_cfg_r10.cross_carrier_sched_cfg_r10_present, 1));
    HANDLE_CODE(bref.unpack(non_ul_cfg_r10.csi_rs_cfg_r10_present, 1));
    HANDLE_CODE(bref.unpack(non_ul_cfg_r10.pdsch_cfg_ded_r10_present, 1));
    if (non_ul_cfg_r10.ant_info_r10_present) {
      HANDLE_CODE(non_ul_cfg_r10.ant_info_r10.unpack(bref));
    }
    if (non_ul_cfg_r10.cross_carrier_sched_cfg_r10_present) {
      HANDLE_CODE(non_ul_cfg_r10.cross_carrier_sched_cfg_r10.unpack(bref));
    }
    if (non_ul_cfg_r10.csi_rs_cfg_r10_present) {
      HANDLE_CODE(non_ul_cfg_r10.csi_rs_cfg_r10.unpack(bref));
    }
    if (non_ul_cfg_r10.pdsch_cfg_ded_r10_present) {
      HANDLE_CODE(non_ul_cfg_r10.pdsch_cfg_ded_r10.unpack(bref));
    }
  }
  if (ul_cfg_r10_present) {
    HANDLE_CODE(bref.unpack(ul_cfg_r10.ant_info_ul_r10_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.pusch_cfg_ded_scell_r10_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.ul_pwr_ctrl_ded_scell_r10_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.cqi_report_cfg_scell_r10_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.srs_ul_cfg_ded_r10_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.srs_ul_cfg_ded_v1020_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.srs_ul_cfg_ded_aperiodic_r10_present, 1));
    if (ul_cfg_r10.ant_info_ul_r10_present) {
      HANDLE_CODE(ul_cfg_r10.ant_info_ul_r10.unpack(bref));
    }
    if (ul_cfg_r10.pusch_cfg_ded_scell_r10_present) {
      HANDLE_CODE(ul_cfg_r10.pusch_cfg_ded_scell_r10.unpack(bref));
    }
    if (ul_cfg_r10.ul_pwr_ctrl_ded_scell_r10_present) {
      HANDLE_CODE(ul_cfg_r10.ul_pwr_ctrl_ded_scell_r10.unpack(bref));
    }
    if (ul_cfg_r10.cqi_report_cfg_scell_r10_present) {
      HANDLE_CODE(ul_cfg_r10.cqi_report_cfg_scell_r10.unpack(bref));
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_r10_present) {
      HANDLE_CODE(ul_cfg_r10.srs_ul_cfg_ded_r10.unpack(bref));
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_v1020_present) {
      HANDLE_CODE(ul_cfg_r10.srs_ul_cfg_ded_v1020.unpack(bref));
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_aperiodic_r10_present) {
      HANDLE_CODE(ul_cfg_r10.srs_ul_cfg_ded_aperiodic_r10.unpack(bref));
    }
  }

  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);

      bool csi_rs_cfg_nzp_to_release_list_r11_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_to_release_list_r11_present, 1));
      csi_rs_cfg_nzp_to_release_list_r11.set_present(csi_rs_cfg_nzp_to_release_list_r11_present);
      bool csi_rs_cfg_nzp_to_add_mod_list_r11_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_to_add_mod_list_r11_present, 1));
      csi_rs_cfg_nzp_to_add_mod_list_r11.set_present(csi_rs_cfg_nzp_to_add_mod_list_r11_present);
      bool csi_rs_cfg_zp_to_release_list_r11_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_zp_to_release_list_r11_present, 1));
      csi_rs_cfg_zp_to_release_list_r11.set_present(csi_rs_cfg_zp_to_release_list_r11_present);
      bool csi_rs_cfg_zp_to_add_mod_list_r11_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_zp_to_add_mod_list_r11_present, 1));
      csi_rs_cfg_zp_to_add_mod_list_r11.set_present(csi_rs_cfg_zp_to_add_mod_list_r11_present);
      bool epdcch_cfg_r11_present;
      HANDLE_CODE(bref.unpack(epdcch_cfg_r11_present, 1));
      epdcch_cfg_r11.set_present(epdcch_cfg_r11_present);
      bool pdsch_cfg_ded_v1130_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1130_present, 1));
      pdsch_cfg_ded_v1130.set_present(pdsch_cfg_ded_v1130_present);
      bool cqi_report_cfg_v1130_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1130_present, 1));
      cqi_report_cfg_v1130.set_present(cqi_report_cfg_v1130_present);
      bool pusch_cfg_ded_v1130_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_v1130_present, 1));
      pusch_cfg_ded_v1130.set_present(pusch_cfg_ded_v1130_present);
      bool ul_pwr_ctrl_ded_scell_v1130_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_ded_scell_v1130_present, 1));
      ul_pwr_ctrl_ded_scell_v1130.set_present(ul_pwr_ctrl_ded_scell_v1130_present);
      if (csi_rs_cfg_nzp_to_release_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_nzp_to_release_list_r11, bref, 1, 3, integer_packer<uint8_t>(1, 3)));
      }
      if (csi_rs_cfg_nzp_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_nzp_to_add_mod_list_r11, bref, 1, 3));
      }
      if (csi_rs_cfg_zp_to_release_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_zp_to_release_list_r11, bref, 1, 4, integer_packer<uint8_t>(1, 4)));
      }
      if (csi_rs_cfg_zp_to_add_mod_list_r11.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_zp_to_add_mod_list_r11, bref, 1, 4));
      }
      if (epdcch_cfg_r11.is_present()) {
        HANDLE_CODE(epdcch_cfg_r11->unpack(bref));
      }
      if (pdsch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1130->unpack(bref));
      }
      if (cqi_report_cfg_v1130.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1130->unpack(bref));
      }
      if (pusch_cfg_ded_v1130.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1130->unpack(bref));
      }
      if (ul_pwr_ctrl_ded_scell_v1130.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_scell_v1130->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ant_info_v1250_present;
      HANDLE_CODE(bref.unpack(ant_info_v1250_present, 1));
      ant_info_v1250.set_present(ant_info_v1250_present);
      bool eimta_main_cfg_scell_r12_present;
      HANDLE_CODE(bref.unpack(eimta_main_cfg_scell_r12_present, 1));
      eimta_main_cfg_scell_r12.set_present(eimta_main_cfg_scell_r12_present);
      bool cqi_report_cfg_scell_v1250_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_scell_v1250_present, 1));
      cqi_report_cfg_scell_v1250.set_present(cqi_report_cfg_scell_v1250_present);
      bool ul_pwr_ctrl_ded_scell_v1250_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_ded_scell_v1250_present, 1));
      ul_pwr_ctrl_ded_scell_v1250.set_present(ul_pwr_ctrl_ded_scell_v1250_present);
      bool csi_rs_cfg_v1250_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1250_present, 1));
      csi_rs_cfg_v1250.set_present(csi_rs_cfg_v1250_present);
      if (ant_info_v1250.is_present()) {
        HANDLE_CODE(ant_info_v1250->unpack(bref));
      }
      if (eimta_main_cfg_scell_r12.is_present()) {
        HANDLE_CODE(eimta_main_cfg_scell_r12->unpack(bref));
      }
      if (cqi_report_cfg_scell_v1250.is_present()) {
        HANDLE_CODE(cqi_report_cfg_scell_v1250->unpack(bref));
      }
      if (ul_pwr_ctrl_ded_scell_v1250.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_scell_v1250->unpack(bref));
      }
      if (csi_rs_cfg_v1250.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1250->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool pdsch_cfg_ded_v1280_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1280_present, 1));
      pdsch_cfg_ded_v1280.set_present(pdsch_cfg_ded_v1280_present);
      if (pdsch_cfg_ded_v1280.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1280->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(pucch_cell_r13_present, 1));
      bool pucch_scell_present;
      HANDLE_CODE(bref.unpack(pucch_scell_present, 1));
      pucch_scell.set_present(pucch_scell_present);
      bool cross_carrier_sched_cfg_r13_present;
      HANDLE_CODE(bref.unpack(cross_carrier_sched_cfg_r13_present, 1));
      cross_carrier_sched_cfg_r13.set_present(cross_carrier_sched_cfg_r13_present);
      bool pdcch_cfg_scell_r13_present;
      HANDLE_CODE(bref.unpack(pdcch_cfg_scell_r13_present, 1));
      pdcch_cfg_scell_r13.set_present(pdcch_cfg_scell_r13_present);
      bool cqi_report_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1310_present, 1));
      cqi_report_cfg_v1310.set_present(cqi_report_cfg_v1310_present);
      bool pdsch_cfg_ded_v1310_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1310_present, 1));
      pdsch_cfg_ded_v1310.set_present(pdsch_cfg_ded_v1310_present);
      bool srs_ul_cfg_ded_v1310_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_v1310_present, 1));
      srs_ul_cfg_ded_v1310.set_present(srs_ul_cfg_ded_v1310_present);
      bool srs_ul_cfg_ded_up_pts_ext_r13_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_up_pts_ext_r13_present, 1));
      srs_ul_cfg_ded_up_pts_ext_r13.set_present(srs_ul_cfg_ded_up_pts_ext_r13_present);
      bool srs_ul_cfg_ded_aperiodic_v1310_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_aperiodic_v1310_present, 1));
      srs_ul_cfg_ded_aperiodic_v1310.set_present(srs_ul_cfg_ded_aperiodic_v1310_present);
      bool srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_present, 1));
      srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.set_present(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13_present);
      bool csi_rs_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1310_present, 1));
      csi_rs_cfg_v1310.set_present(csi_rs_cfg_v1310_present);
      bool laa_scell_cfg_r13_present;
      HANDLE_CODE(bref.unpack(laa_scell_cfg_r13_present, 1));
      laa_scell_cfg_r13.set_present(laa_scell_cfg_r13_present);
      bool csi_rs_cfg_nzp_to_add_mod_list_ext_r13_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_to_add_mod_list_ext_r13_present, 1));
      csi_rs_cfg_nzp_to_add_mod_list_ext_r13.set_present(csi_rs_cfg_nzp_to_add_mod_list_ext_r13_present);
      bool csi_rs_cfg_nzp_to_release_list_ext_r13_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_nzp_to_release_list_ext_r13_present, 1));
      csi_rs_cfg_nzp_to_release_list_ext_r13.set_present(csi_rs_cfg_nzp_to_release_list_ext_r13_present);
      if (pucch_scell.is_present()) {
        HANDLE_CODE(pucch_scell->unpack(bref));
      }
      if (cross_carrier_sched_cfg_r13.is_present()) {
        HANDLE_CODE(cross_carrier_sched_cfg_r13->unpack(bref));
      }
      if (pdcch_cfg_scell_r13.is_present()) {
        HANDLE_CODE(pdcch_cfg_scell_r13->unpack(bref));
      }
      if (cqi_report_cfg_v1310.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1310->unpack(bref));
      }
      if (pdsch_cfg_ded_v1310.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1310->unpack(bref));
      }
      if (srs_ul_cfg_ded_v1310.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_v1310->unpack(bref));
      }
      if (srs_ul_cfg_ded_up_pts_ext_r13.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_up_pts_ext_r13->unpack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_v1310.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_v1310->unpack(bref));
      }
      if (srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present()) {
        HANDLE_CODE(srs_ul_cfg_ded_aperiodic_up_pts_ext_r13->unpack(bref));
      }
      if (csi_rs_cfg_v1310.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1310->unpack(bref));
      }
      if (laa_scell_cfg_r13.is_present()) {
        HANDLE_CODE(laa_scell_cfg_r13->unpack(bref));
      }
      if (csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*csi_rs_cfg_nzp_to_add_mod_list_ext_r13, bref, 1, 21));
      }
      if (csi_rs_cfg_nzp_to_release_list_ext_r13.is_present()) {
        HANDLE_CODE(
            unpack_dyn_seq_of(*csi_rs_cfg_nzp_to_release_list_ext_r13, bref, 1, 21, integer_packer<uint8_t>(4, 24)));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool cqi_report_cfg_v1320_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1320_present, 1));
      cqi_report_cfg_v1320.set_present(cqi_report_cfg_v1320_present);
      if (cqi_report_cfg_v1320.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1320->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool laa_scell_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(laa_scell_cfg_v1430_present, 1));
      laa_scell_cfg_v1430.set_present(laa_scell_cfg_v1430_present);
      bool type_b_srs_tpc_pdcch_cfg_r14_present;
      HANDLE_CODE(bref.unpack(type_b_srs_tpc_pdcch_cfg_r14_present, 1));
      type_b_srs_tpc_pdcch_cfg_r14.set_present(type_b_srs_tpc_pdcch_cfg_r14_present);
      bool ul_pusch_less_pwr_ctrl_ded_v1430_present;
      HANDLE_CODE(bref.unpack(ul_pusch_less_pwr_ctrl_ded_v1430_present, 1));
      ul_pusch_less_pwr_ctrl_ded_v1430.set_present(ul_pusch_less_pwr_ctrl_ded_v1430_present);
      bool srs_ul_periodic_cfg_ded_list_r14_present;
      HANDLE_CODE(bref.unpack(srs_ul_periodic_cfg_ded_list_r14_present, 1));
      srs_ul_periodic_cfg_ded_list_r14.set_present(srs_ul_periodic_cfg_ded_list_r14_present);
      bool srs_ul_periodic_cfg_ded_up_pts_ext_list_r14_present;
      HANDLE_CODE(bref.unpack(srs_ul_periodic_cfg_ded_up_pts_ext_list_r14_present, 1));
      srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.set_present(srs_ul_periodic_cfg_ded_up_pts_ext_list_r14_present);
      bool srs_ul_aperiodic_cfg_ded_list_r14_present;
      HANDLE_CODE(bref.unpack(srs_ul_aperiodic_cfg_ded_list_r14_present, 1));
      srs_ul_aperiodic_cfg_ded_list_r14.set_present(srs_ul_aperiodic_cfg_ded_list_r14_present);
      bool srs_ul_cfg_ded_ap_up_pts_ext_list_r14_present;
      HANDLE_CODE(bref.unpack(srs_ul_cfg_ded_ap_up_pts_ext_list_r14_present, 1));
      srs_ul_cfg_ded_ap_up_pts_ext_list_r14.set_present(srs_ul_cfg_ded_ap_up_pts_ext_list_r14_present);
      bool must_cfg_r14_present;
      HANDLE_CODE(bref.unpack(must_cfg_r14_present, 1));
      must_cfg_r14.set_present(must_cfg_r14_present);
      bool pusch_cfg_ded_v1430_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_v1430_present, 1));
      pusch_cfg_ded_v1430.set_present(pusch_cfg_ded_v1430_present);
      bool csi_rs_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1430_present, 1));
      csi_rs_cfg_v1430.set_present(csi_rs_cfg_v1430_present);
      bool csi_rs_cfg_zp_ap_list_r14_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_zp_ap_list_r14_present, 1));
      csi_rs_cfg_zp_ap_list_r14.set_present(csi_rs_cfg_zp_ap_list_r14_present);
      bool cqi_report_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1430_present, 1));
      cqi_report_cfg_v1430.set_present(cqi_report_cfg_v1430_present);
      HANDLE_CODE(bref.unpack(semi_open_loop_r14_present, 1));
      bool pdsch_cfg_ded_scell_v1430_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_scell_v1430_present, 1));
      pdsch_cfg_ded_scell_v1430.set_present(pdsch_cfg_ded_scell_v1430_present);
      if (laa_scell_cfg_v1430.is_present()) {
        HANDLE_CODE(laa_scell_cfg_v1430->unpack(bref));
      }
      if (type_b_srs_tpc_pdcch_cfg_r14.is_present()) {
        HANDLE_CODE(type_b_srs_tpc_pdcch_cfg_r14->unpack(bref));
      }
      if (ul_pusch_less_pwr_ctrl_ded_v1430.is_present()) {
        HANDLE_CODE(ul_pusch_less_pwr_ctrl_ded_v1430->unpack(bref));
      }
      if (srs_ul_periodic_cfg_ded_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srs_ul_periodic_cfg_ded_list_r14, bref, 1, 2));
      }
      if (srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srs_ul_periodic_cfg_ded_up_pts_ext_list_r14, bref, 1, 4));
      }
      if (srs_ul_aperiodic_cfg_ded_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srs_ul_aperiodic_cfg_ded_list_r14, bref, 1, 2));
      }
      if (srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*srs_ul_cfg_ded_ap_up_pts_ext_list_r14, bref, 1, 4));
      }
      if (must_cfg_r14.is_present()) {
        HANDLE_CODE(must_cfg_r14->unpack(bref));
      }
      if (pusch_cfg_ded_v1430.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1430->unpack(bref));
      }
      if (csi_rs_cfg_v1430.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1430->unpack(bref));
      }
      if (csi_rs_cfg_zp_ap_list_r14.is_present()) {
        HANDLE_CODE(csi_rs_cfg_zp_ap_list_r14->unpack(bref));
      }
      if (cqi_report_cfg_v1430.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1430->unpack(bref));
      }
      if (semi_open_loop_r14_present) {
        HANDLE_CODE(bref.unpack(semi_open_loop_r14, 1));
      }
      if (pdsch_cfg_ded_scell_v1430.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_scell_v1430->unpack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool csi_rs_cfg_v1480_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1480_present, 1));
      csi_rs_cfg_v1480.set_present(csi_rs_cfg_v1480_present);
      if (csi_rs_cfg_v1480.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1480->unpack(bref));
      }
    }
    if (group_flags[7]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool phys_cfg_ded_stti_r15_present;
      HANDLE_CODE(bref.unpack(phys_cfg_ded_stti_r15_present, 1));
      phys_cfg_ded_stti_r15.set_present(phys_cfg_ded_stti_r15_present);
      bool pdsch_cfg_ded_v1530_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_ded_v1530_present, 1));
      pdsch_cfg_ded_v1530.set_present(pdsch_cfg_ded_v1530_present);
      bool cqi_report_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_v1530_present, 1));
      cqi_report_cfg_v1530.set_present(cqi_report_cfg_v1530_present);
      bool cqi_report_cfg_scell_r15_present;
      HANDLE_CODE(bref.unpack(cqi_report_cfg_scell_r15_present, 1));
      cqi_report_cfg_scell_r15.set_present(cqi_report_cfg_scell_r15_present);
      bool cqi_short_cfg_scell_r15_present;
      HANDLE_CODE(bref.unpack(cqi_short_cfg_scell_r15_present, 1));
      cqi_short_cfg_scell_r15.set_present(cqi_short_cfg_scell_r15_present);
      bool csi_rs_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(csi_rs_cfg_v1530_present, 1));
      csi_rs_cfg_v1530.set_present(csi_rs_cfg_v1530_present);
      bool ul_pwr_ctrl_ded_scell_v1530_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_ded_scell_v1530_present, 1));
      ul_pwr_ctrl_ded_scell_v1530.set_present(ul_pwr_ctrl_ded_scell_v1530_present);
      bool laa_scell_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(laa_scell_cfg_v1530_present, 1));
      laa_scell_cfg_v1530.set_present(laa_scell_cfg_v1530_present);
      bool pusch_cfg_ded_v1530_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_ded_v1530_present, 1));
      pusch_cfg_ded_v1530.set_present(pusch_cfg_ded_v1530_present);
      bool semi_static_cfi_cfg_r15_present;
      HANDLE_CODE(bref.unpack(semi_static_cfi_cfg_r15_present, 1));
      semi_static_cfi_cfg_r15.set_present(semi_static_cfi_cfg_r15_present);
      bool blind_pdsch_repeat_cfg_r15_present;
      HANDLE_CODE(bref.unpack(blind_pdsch_repeat_cfg_r15_present, 1));
      blind_pdsch_repeat_cfg_r15.set_present(blind_pdsch_repeat_cfg_r15_present);
      if (phys_cfg_ded_stti_r15.is_present()) {
        HANDLE_CODE(phys_cfg_ded_stti_r15->unpack(bref));
      }
      if (pdsch_cfg_ded_v1530.is_present()) {
        HANDLE_CODE(pdsch_cfg_ded_v1530->unpack(bref));
      }
      if (cqi_report_cfg_v1530.is_present()) {
        HANDLE_CODE(cqi_report_cfg_v1530->unpack(bref));
      }
      if (cqi_report_cfg_scell_r15.is_present()) {
        HANDLE_CODE(cqi_report_cfg_scell_r15->unpack(bref));
      }
      if (cqi_short_cfg_scell_r15.is_present()) {
        HANDLE_CODE(cqi_short_cfg_scell_r15->unpack(bref));
      }
      if (csi_rs_cfg_v1530.is_present()) {
        HANDLE_CODE(csi_rs_cfg_v1530->unpack(bref));
      }
      if (ul_pwr_ctrl_ded_scell_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_ded_scell_v1530->unpack(bref));
      }
      if (laa_scell_cfg_v1530.is_present()) {
        HANDLE_CODE(laa_scell_cfg_v1530->unpack(bref));
      }
      if (pusch_cfg_ded_v1530.is_present()) {
        HANDLE_CODE(pusch_cfg_ded_v1530->unpack(bref));
      }
      if (semi_static_cfi_cfg_r15.is_present()) {
        HANDLE_CODE(semi_static_cfi_cfg_r15->unpack(bref));
      }
      if (blind_pdsch_repeat_cfg_r15.is_present()) {
        HANDLE_CODE(blind_pdsch_repeat_cfg_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void phys_cfg_ded_scell_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_ul_cfg_r10_present) {
    j.write_fieldname("nonUL-Configuration-r10");
    j.start_obj();
    if (non_ul_cfg_r10.ant_info_r10_present) {
      j.write_fieldname("antennaInfo-r10");
      non_ul_cfg_r10.ant_info_r10.to_json(j);
    }
    if (non_ul_cfg_r10.cross_carrier_sched_cfg_r10_present) {
      j.write_fieldname("crossCarrierSchedulingConfig-r10");
      non_ul_cfg_r10.cross_carrier_sched_cfg_r10.to_json(j);
    }
    if (non_ul_cfg_r10.csi_rs_cfg_r10_present) {
      j.write_fieldname("csi-RS-Config-r10");
      non_ul_cfg_r10.csi_rs_cfg_r10.to_json(j);
    }
    if (non_ul_cfg_r10.pdsch_cfg_ded_r10_present) {
      j.write_fieldname("pdsch-ConfigDedicated-r10");
      non_ul_cfg_r10.pdsch_cfg_ded_r10.to_json(j);
    }
    j.end_obj();
  }
  if (ul_cfg_r10_present) {
    j.write_fieldname("ul-Configuration-r10");
    j.start_obj();
    if (ul_cfg_r10.ant_info_ul_r10_present) {
      j.write_fieldname("antennaInfoUL-r10");
      ul_cfg_r10.ant_info_ul_r10.to_json(j);
    }
    if (ul_cfg_r10.pusch_cfg_ded_scell_r10_present) {
      j.write_fieldname("pusch-ConfigDedicatedSCell-r10");
      ul_cfg_r10.pusch_cfg_ded_scell_r10.to_json(j);
    }
    if (ul_cfg_r10.ul_pwr_ctrl_ded_scell_r10_present) {
      j.write_fieldname("uplinkPowerControlDedicatedSCell-r10");
      ul_cfg_r10.ul_pwr_ctrl_ded_scell_r10.to_json(j);
    }
    if (ul_cfg_r10.cqi_report_cfg_scell_r10_present) {
      j.write_fieldname("cqi-ReportConfigSCell-r10");
      ul_cfg_r10.cqi_report_cfg_scell_r10.to_json(j);
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_r10_present) {
      j.write_fieldname("soundingRS-UL-ConfigDedicated-r10");
      ul_cfg_r10.srs_ul_cfg_ded_r10.to_json(j);
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_v1020_present) {
      j.write_fieldname("soundingRS-UL-ConfigDedicated-v1020");
      ul_cfg_r10.srs_ul_cfg_ded_v1020.to_json(j);
    }
    if (ul_cfg_r10.srs_ul_cfg_ded_aperiodic_r10_present) {
      j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodic-r10");
      ul_cfg_r10.srs_ul_cfg_ded_aperiodic_r10.to_json(j);
    }
    j.end_obj();
  }
  if (ext) {
    if (csi_rs_cfg_nzp_to_release_list_r11.is_present()) {
      j.start_array("csi-RS-ConfigNZPToReleaseList-r11");
      for (const auto& e1 : *csi_rs_cfg_nzp_to_release_list_r11) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (csi_rs_cfg_nzp_to_add_mod_list_r11.is_present()) {
      j.start_array("csi-RS-ConfigNZPToAddModList-r11");
      for (const auto& e1 : *csi_rs_cfg_nzp_to_add_mod_list_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (csi_rs_cfg_zp_to_release_list_r11.is_present()) {
      j.start_array("csi-RS-ConfigZPToReleaseList-r11");
      for (const auto& e1 : *csi_rs_cfg_zp_to_release_list_r11) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (csi_rs_cfg_zp_to_add_mod_list_r11.is_present()) {
      j.start_array("csi-RS-ConfigZPToAddModList-r11");
      for (const auto& e1 : *csi_rs_cfg_zp_to_add_mod_list_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (epdcch_cfg_r11.is_present()) {
      j.write_fieldname("epdcch-Config-r11");
      epdcch_cfg_r11->to_json(j);
    }
    if (pdsch_cfg_ded_v1130.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1130");
      pdsch_cfg_ded_v1130->to_json(j);
    }
    if (cqi_report_cfg_v1130.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1130");
      cqi_report_cfg_v1130->to_json(j);
    }
    if (pusch_cfg_ded_v1130.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-v1130");
      pusch_cfg_ded_v1130->to_json(j);
    }
    if (ul_pwr_ctrl_ded_scell_v1130.is_present()) {
      j.write_fieldname("uplinkPowerControlDedicatedSCell-v1130");
      ul_pwr_ctrl_ded_scell_v1130->to_json(j);
    }
    if (ant_info_v1250.is_present()) {
      j.write_fieldname("antennaInfo-v1250");
      ant_info_v1250->to_json(j);
    }
    if (eimta_main_cfg_scell_r12.is_present()) {
      j.write_fieldname("eimta-MainConfigSCell-r12");
      eimta_main_cfg_scell_r12->to_json(j);
    }
    if (cqi_report_cfg_scell_v1250.is_present()) {
      j.write_fieldname("cqi-ReportConfigSCell-v1250");
      cqi_report_cfg_scell_v1250->to_json(j);
    }
    if (ul_pwr_ctrl_ded_scell_v1250.is_present()) {
      j.write_fieldname("uplinkPowerControlDedicatedSCell-v1250");
      ul_pwr_ctrl_ded_scell_v1250->to_json(j);
    }
    if (csi_rs_cfg_v1250.is_present()) {
      j.write_fieldname("csi-RS-Config-v1250");
      csi_rs_cfg_v1250->to_json(j);
    }
    if (pdsch_cfg_ded_v1280.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1280");
      pdsch_cfg_ded_v1280->to_json(j);
    }
    if (pucch_cell_r13_present) {
      j.write_str("pucch-Cell-r13", "true");
    }
    if (pucch_scell.is_present()) {
      j.write_fieldname("pucch-SCell");
      pucch_scell->to_json(j);
    }
    if (cross_carrier_sched_cfg_r13.is_present()) {
      j.write_fieldname("crossCarrierSchedulingConfig-r13");
      cross_carrier_sched_cfg_r13->to_json(j);
    }
    if (pdcch_cfg_scell_r13.is_present()) {
      j.write_fieldname("pdcch-ConfigSCell-r13");
      pdcch_cfg_scell_r13->to_json(j);
    }
    if (cqi_report_cfg_v1310.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1310");
      cqi_report_cfg_v1310->to_json(j);
    }
    if (pdsch_cfg_ded_v1310.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1310");
      pdsch_cfg_ded_v1310->to_json(j);
    }
    if (srs_ul_cfg_ded_v1310.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicated-v1310");
      srs_ul_cfg_ded_v1310->to_json(j);
    }
    if (srs_ul_cfg_ded_up_pts_ext_r13.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicatedUpPTsExt-r13");
      srs_ul_cfg_ded_up_pts_ext_r13->to_json(j);
    }
    if (srs_ul_cfg_ded_aperiodic_v1310.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodic-v1310");
      srs_ul_cfg_ded_aperiodic_v1310->to_json(j);
    }
    if (srs_ul_cfg_ded_aperiodic_up_pts_ext_r13.is_present()) {
      j.write_fieldname("soundingRS-UL-ConfigDedicatedAperiodicUpPTsExt-r13");
      srs_ul_cfg_ded_aperiodic_up_pts_ext_r13->to_json(j);
    }
    if (csi_rs_cfg_v1310.is_present()) {
      j.write_fieldname("csi-RS-Config-v1310");
      csi_rs_cfg_v1310->to_json(j);
    }
    if (laa_scell_cfg_r13.is_present()) {
      j.write_fieldname("laa-SCellConfiguration-r13");
      laa_scell_cfg_r13->to_json(j);
    }
    if (csi_rs_cfg_nzp_to_add_mod_list_ext_r13.is_present()) {
      j.start_array("csi-RS-ConfigNZPToAddModListExt-r13");
      for (const auto& e1 : *csi_rs_cfg_nzp_to_add_mod_list_ext_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (csi_rs_cfg_nzp_to_release_list_ext_r13.is_present()) {
      j.start_array("csi-RS-ConfigNZPToReleaseListExt-r13");
      for (const auto& e1 : *csi_rs_cfg_nzp_to_release_list_ext_r13) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (cqi_report_cfg_v1320.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1320");
      cqi_report_cfg_v1320->to_json(j);
    }
    if (laa_scell_cfg_v1430.is_present()) {
      j.write_fieldname("laa-SCellConfiguration-v1430");
      laa_scell_cfg_v1430->to_json(j);
    }
    if (type_b_srs_tpc_pdcch_cfg_r14.is_present()) {
      j.write_fieldname("typeB-SRS-TPC-PDCCH-Config-r14");
      type_b_srs_tpc_pdcch_cfg_r14->to_json(j);
    }
    if (ul_pusch_less_pwr_ctrl_ded_v1430.is_present()) {
      j.write_fieldname("uplinkPUSCH-LessPowerControlDedicated-v1430");
      ul_pusch_less_pwr_ctrl_ded_v1430->to_json(j);
    }
    if (srs_ul_periodic_cfg_ded_list_r14.is_present()) {
      j.start_array("soundingRS-UL-PeriodicConfigDedicatedList-r14");
      for (const auto& e1 : *srs_ul_periodic_cfg_ded_list_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (srs_ul_periodic_cfg_ded_up_pts_ext_list_r14.is_present()) {
      j.start_array("soundingRS-UL-PeriodicConfigDedicatedUpPTsExtList-r14");
      for (const auto& e1 : *srs_ul_periodic_cfg_ded_up_pts_ext_list_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (srs_ul_aperiodic_cfg_ded_list_r14.is_present()) {
      j.start_array("soundingRS-UL-AperiodicConfigDedicatedList-r14");
      for (const auto& e1 : *srs_ul_aperiodic_cfg_ded_list_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (srs_ul_cfg_ded_ap_up_pts_ext_list_r14.is_present()) {
      j.start_array("soundingRS-UL-ConfigDedicatedApUpPTsExtList-r14");
      for (const auto& e1 : *srs_ul_cfg_ded_ap_up_pts_ext_list_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (must_cfg_r14.is_present()) {
      j.write_fieldname("must-Config-r14");
      must_cfg_r14->to_json(j);
    }
    if (pusch_cfg_ded_v1430.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-v1430");
      pusch_cfg_ded_v1430->to_json(j);
    }
    if (csi_rs_cfg_v1430.is_present()) {
      j.write_fieldname("csi-RS-Config-v1430");
      csi_rs_cfg_v1430->to_json(j);
    }
    if (csi_rs_cfg_zp_ap_list_r14.is_present()) {
      j.write_fieldname("csi-RS-ConfigZP-ApList-r14");
      csi_rs_cfg_zp_ap_list_r14->to_json(j);
    }
    if (cqi_report_cfg_v1430.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1430");
      cqi_report_cfg_v1430->to_json(j);
    }
    if (semi_open_loop_r14_present) {
      j.write_bool("semiOpenLoop-r14", semi_open_loop_r14);
    }
    if (pdsch_cfg_ded_scell_v1430.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicatedSCell-v1430");
      pdsch_cfg_ded_scell_v1430->to_json(j);
    }
    if (csi_rs_cfg_v1480.is_present()) {
      j.write_fieldname("csi-RS-Config-v1480");
      csi_rs_cfg_v1480->to_json(j);
    }
    if (phys_cfg_ded_stti_r15.is_present()) {
      j.write_fieldname("physicalConfigDedicatedSTTI-r15");
      phys_cfg_ded_stti_r15->to_json(j);
    }
    if (pdsch_cfg_ded_v1530.is_present()) {
      j.write_fieldname("pdsch-ConfigDedicated-v1530");
      pdsch_cfg_ded_v1530->to_json(j);
    }
    if (cqi_report_cfg_v1530.is_present()) {
      j.write_fieldname("cqi-ReportConfig-v1530");
      cqi_report_cfg_v1530->to_json(j);
    }
    if (cqi_report_cfg_scell_r15.is_present()) {
      j.write_fieldname("cqi-ReportConfigSCell-r15");
      cqi_report_cfg_scell_r15->to_json(j);
    }
    if (cqi_short_cfg_scell_r15.is_present()) {
      j.write_fieldname("cqi-ShortConfigSCell-r15");
      cqi_short_cfg_scell_r15->to_json(j);
    }
    if (csi_rs_cfg_v1530.is_present()) {
      j.write_fieldname("csi-RS-Config-v1530");
      csi_rs_cfg_v1530->to_json(j);
    }
    if (ul_pwr_ctrl_ded_scell_v1530.is_present()) {
      j.write_fieldname("uplinkPowerControlDedicatedSCell-v1530");
      ul_pwr_ctrl_ded_scell_v1530->to_json(j);
    }
    if (laa_scell_cfg_v1530.is_present()) {
      j.write_fieldname("laa-SCellConfiguration-v1530");
      laa_scell_cfg_v1530->to_json(j);
    }
    if (pusch_cfg_ded_v1530.is_present()) {
      j.write_fieldname("pusch-ConfigDedicated-v1530");
      pusch_cfg_ded_v1530->to_json(j);
    }
    if (semi_static_cfi_cfg_r15.is_present()) {
      j.write_fieldname("semiStaticCFI-Config-r15");
      semi_static_cfi_cfg_r15->to_json(j);
    }
    if (blind_pdsch_repeat_cfg_r15.is_present()) {
      j.write_fieldname("blindPDSCH-Repetition-Config-r15");
      blind_pdsch_repeat_cfg_r15->to_json(j);
    }
  }
  j.end_obj();
}

void phys_cfg_ded_scell_r10_s::pucch_scell_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_scell_r10_s::pucch_scell_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.pucch_cfg_ded_r13_present) {
        j.write_fieldname("pucch-ConfigDedicated-r13");
        c.pucch_cfg_ded_r13.to_json(j);
      }
      if (c.sched_request_cfg_r13_present) {
        j.write_fieldname("schedulingRequestConfig-r13");
        c.sched_request_cfg_r13.to_json(j);
      }
      if (c.tpc_pdcch_cfg_pucch_scell_r13_present) {
        j.write_fieldname("tpc-PDCCH-ConfigPUCCH-SCell-r13");
        c.tpc_pdcch_cfg_pucch_scell_r13.to_json(j);
      }
      if (c.pusch_cfg_ded_r13_present) {
        j.write_fieldname("pusch-ConfigDedicated-r13");
        c.pusch_cfg_ded_r13.to_json(j);
      }
      if (c.ul_pwr_ctrl_ded_r13_present) {
        j.write_fieldname("uplinkPowerControlDedicated-r13");
        c.ul_pwr_ctrl_ded_r13.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::pucch_scell_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::pucch_scell_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.pucch_cfg_ded_r13_present, 1));
      HANDLE_CODE(bref.pack(c.sched_request_cfg_r13_present, 1));
      HANDLE_CODE(bref.pack(c.tpc_pdcch_cfg_pucch_scell_r13_present, 1));
      HANDLE_CODE(bref.pack(c.pusch_cfg_ded_r13_present, 1));
      HANDLE_CODE(bref.pack(c.ul_pwr_ctrl_ded_r13_present, 1));
      if (c.pucch_cfg_ded_r13_present) {
        HANDLE_CODE(c.pucch_cfg_ded_r13.pack(bref));
      }
      if (c.sched_request_cfg_r13_present) {
        HANDLE_CODE(c.sched_request_cfg_r13.pack(bref));
      }
      if (c.tpc_pdcch_cfg_pucch_scell_r13_present) {
        HANDLE_CODE(c.tpc_pdcch_cfg_pucch_scell_r13.pack(bref));
      }
      if (c.pusch_cfg_ded_r13_present) {
        HANDLE_CODE(c.pusch_cfg_ded_r13.pack(bref));
      }
      if (c.ul_pwr_ctrl_ded_r13_present) {
        HANDLE_CODE(c.ul_pwr_ctrl_ded_r13.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::pucch_scell_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::pucch_scell_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.pucch_cfg_ded_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.sched_request_cfg_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.tpc_pdcch_cfg_pucch_scell_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.pusch_cfg_ded_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.ul_pwr_ctrl_ded_r13_present, 1));
      if (c.pucch_cfg_ded_r13_present) {
        HANDLE_CODE(c.pucch_cfg_ded_r13.unpack(bref));
      }
      if (c.sched_request_cfg_r13_present) {
        HANDLE_CODE(c.sched_request_cfg_r13.unpack(bref));
      }
      if (c.tpc_pdcch_cfg_pucch_scell_r13_present) {
        HANDLE_CODE(c.tpc_pdcch_cfg_pucch_scell_r13.unpack(bref));
      }
      if (c.pusch_cfg_ded_r13_present) {
        HANDLE_CODE(c.pusch_cfg_ded_r13.unpack(bref));
      }
      if (c.ul_pwr_ctrl_ded_r13_present) {
        HANDLE_CODE(c.ul_pwr_ctrl_ded_r13.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::pucch_scell_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_scell_r10_s::must_cfg_r14_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_scell_r10_s::must_cfg_r14_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("k-max-r14", c.k_max_r14.to_string());
      if (c.p_a_must_r14_present) {
        j.write_str("p-a-must-r14", c.p_a_must_r14.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::must_cfg_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::must_cfg_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.p_a_must_r14_present, 1));
      HANDLE_CODE(c.k_max_r14.pack(bref));
      if (c.p_a_must_r14_present) {
        HANDLE_CODE(c.p_a_must_r14.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::must_cfg_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::must_cfg_r14_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.p_a_must_r14_present, 1));
      HANDLE_CODE(c.k_max_r14.unpack(bref));
      if (c.p_a_must_r14_present) {
        HANDLE_CODE(c.p_a_must_r14.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::must_cfg_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::cfi_cfg_r15:
      c.destroy<cfi_cfg_r15_s>();
      break;
    case types::cfi_pattern_cfg_r15:
      c.destroy<cfi_pattern_cfg_r15_s>();
      break;
    default:
      break;
  }
}
void phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cfi_cfg_r15:
      c.init<cfi_cfg_r15_s>();
      break;
    case types::cfi_pattern_cfg_r15:
      c.init<cfi_pattern_cfg_r15_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_");
  }
}
phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_::setup_c_(
    const phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cfi_cfg_r15:
      c.init(other.c.get<cfi_cfg_r15_s>());
      break;
    case types::cfi_pattern_cfg_r15:
      c.init(other.c.get<cfi_pattern_cfg_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_");
  }
}
phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_&
phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_::
operator=(const phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cfi_cfg_r15:
      c.set(other.c.get<cfi_cfg_r15_s>());
      break;
    case types::cfi_pattern_cfg_r15:
      c.set(other.c.get<cfi_pattern_cfg_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_");
  }

  return *this;
}
void phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cfi_cfg_r15:
      j.write_fieldname("cfi-Config-r15");
      c.get<cfi_cfg_r15_s>().to_json(j);
      break;
    case types::cfi_pattern_cfg_r15:
      j.write_fieldname("cfi-PatternConfig-r15");
      c.get<cfi_pattern_cfg_r15_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cfi_cfg_r15:
      HANDLE_CODE(c.get<cfi_cfg_r15_s>().pack(bref));
      break;
    case types::cfi_pattern_cfg_r15:
      HANDLE_CODE(c.get<cfi_pattern_cfg_r15_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cfi_cfg_r15:
      HANDLE_CODE(c.get<cfi_cfg_r15_s>().unpack(bref));
      break;
    case types::cfi_pattern_cfg_r15:
      HANDLE_CODE(c.get<cfi_pattern_cfg_r15_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::semi_static_cfi_cfg_r15_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void phys_cfg_ded_scell_r10_s::blind_pdsch_repeat_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_scell_r10_s::blind_pdsch_repeat_cfg_r15_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_bool("blindSubframePDSCH-Repetitions-r15", c.blind_sf_pdsch_repeats_r15);
      j.write_bool("blindSlotSubslotPDSCH-Repetitions-r15", c.blind_slot_subslot_pdsch_repeats_r15);
      if (c.max_num_sf_pdsch_repeats_r15_present) {
        j.write_str("maxNumber-SubframePDSCH-Repetitions-r15", c.max_num_sf_pdsch_repeats_r15.to_string());
      }
      if (c.max_num_slot_subslot_pdsch_repeats_r15_present) {
        j.write_str("maxNumber-SlotSubslotPDSCH-Repetitions-r15", c.max_num_slot_subslot_pdsch_repeats_r15.to_string());
      }
      if (c.rv_sf_pdsch_repeats_r15_present) {
        j.write_str("rv-SubframePDSCH-Repetitions-r15", c.rv_sf_pdsch_repeats_r15.to_string());
      }
      if (c.rv_slotsublot_pdsch_repeats_r15_present) {
        j.write_str("rv-SlotsublotPDSCH-Repetitions-r15", c.rv_slotsublot_pdsch_repeats_r15.to_string());
      }
      if (c.nof_processes_sf_pdsch_repeats_r15_present) {
        j.write_int("numberOfProcesses-SubframePDSCH-Repetitions-r15", c.nof_processes_sf_pdsch_repeats_r15);
      }
      if (c.nof_processes_slot_subslot_pdsch_repeats_r15_present) {
        j.write_int("numberOfProcesses-SlotSubslotPDSCH-Repetitions-r15",
                    c.nof_processes_slot_subslot_pdsch_repeats_r15);
      }
      if (c.mcs_restrict_sf_pdsch_repeats_r15_present) {
        j.write_str("mcs-restrictionSubframePDSCH-Repetitions-r15", c.mcs_restrict_sf_pdsch_repeats_r15.to_string());
      }
      if (c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present) {
        j.write_str("mcs-restrictionSlotSubslotPDSCH-Repetitions-r15",
                    c.mcs_restrict_slot_subslot_pdsch_repeats_r15.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::blind_pdsch_repeat_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::blind_pdsch_repeat_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.max_num_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.max_num_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.rv_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.rv_slotsublot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.nof_processes_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.nof_processes_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.mcs_restrict_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.pack(c.blind_sf_pdsch_repeats_r15, 1));
      HANDLE_CODE(bref.pack(c.blind_slot_subslot_pdsch_repeats_r15, 1));
      if (c.max_num_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.max_num_sf_pdsch_repeats_r15.pack(bref));
      }
      if (c.max_num_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.max_num_slot_subslot_pdsch_repeats_r15.pack(bref));
      }
      if (c.rv_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.rv_sf_pdsch_repeats_r15.pack(bref));
      }
      if (c.rv_slotsublot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.rv_slotsublot_pdsch_repeats_r15.pack(bref));
      }
      if (c.nof_processes_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.nof_processes_sf_pdsch_repeats_r15, (uint8_t)1u, (uint8_t)16u));
      }
      if (c.nof_processes_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.nof_processes_slot_subslot_pdsch_repeats_r15, (uint8_t)1u, (uint8_t)16u));
      }
      if (c.mcs_restrict_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.mcs_restrict_sf_pdsch_repeats_r15.pack(bref));
      }
      if (c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.mcs_restrict_slot_subslot_pdsch_repeats_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::blind_pdsch_repeat_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_scell_r10_s::blind_pdsch_repeat_cfg_r15_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.max_num_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.max_num_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.rv_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.rv_slotsublot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.nof_processes_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.nof_processes_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.mcs_restrict_sf_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.blind_sf_pdsch_repeats_r15, 1));
      HANDLE_CODE(bref.unpack(c.blind_slot_subslot_pdsch_repeats_r15, 1));
      if (c.max_num_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.max_num_sf_pdsch_repeats_r15.unpack(bref));
      }
      if (c.max_num_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.max_num_slot_subslot_pdsch_repeats_r15.unpack(bref));
      }
      if (c.rv_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.rv_sf_pdsch_repeats_r15.unpack(bref));
      }
      if (c.rv_slotsublot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.rv_slotsublot_pdsch_repeats_r15.unpack(bref));
      }
      if (c.nof_processes_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(unpack_integer(c.nof_processes_sf_pdsch_repeats_r15, bref, (uint8_t)1u, (uint8_t)16u));
      }
      if (c.nof_processes_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(unpack_integer(c.nof_processes_slot_subslot_pdsch_repeats_r15, bref, (uint8_t)1u, (uint8_t)16u));
      }
      if (c.mcs_restrict_sf_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.mcs_restrict_sf_pdsch_repeats_r15.unpack(bref));
      }
      if (c.mcs_restrict_slot_subslot_pdsch_repeats_r15_present) {
        HANDLE_CODE(c.mcs_restrict_slot_subslot_pdsch_repeats_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_r10_s::blind_pdsch_repeat_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PhysicalConfigDedicatedSCell-v1370 ::= SEQUENCE
SRSASN_CODE phys_cfg_ded_scell_v1370_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pucch_scell_v1370.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_scell_v1370_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(pucch_scell_v1370.unpack(bref));

  return SRSASN_SUCCESS;
}
void phys_cfg_ded_scell_v1370_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("pucch-SCell-v1370");
  pucch_scell_v1370.to_json(j);
  j.end_obj();
}

void phys_cfg_ded_scell_v1370_s::pucch_scell_v1370_c_::set(types::options e)
{
  type_ = e;
}
void phys_cfg_ded_scell_v1370_s::pucch_scell_v1370_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.pucch_cfg_ded_v1370_present) {
        j.write_fieldname("pucch-ConfigDedicated-v1370");
        c.pucch_cfg_ded_v1370.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_v1370_s::pucch_scell_v1370_c_");
  }
  j.end_obj();
}
SRSASN_CODE phys_cfg_ded_scell_v1370_s::pucch_scell_v1370_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.pucch_cfg_ded_v1370_present, 1));
      if (c.pucch_cfg_ded_v1370_present) {
        HANDLE_CODE(c.pucch_cfg_ded_v1370.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_v1370_s::pucch_scell_v1370_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_scell_v1370_s::pucch_scell_v1370_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.pucch_cfg_ded_v1370_present, 1));
      if (c.pucch_cfg_ded_v1370_present) {
        HANDLE_CODE(c.pucch_cfg_ded_v1370.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "phys_cfg_ded_scell_v1370_s::pucch_scell_v1370_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RACH-ConfigCommonSCell-r11 ::= SEQUENCE
SRSASN_CODE rach_cfg_common_scell_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pwr_ramp_params_r11.pack(bref));
  HANDLE_CODE(ra_supervision_info_r11.preamb_trans_max_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rach_cfg_common_scell_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(pwr_ramp_params_r11.unpack(bref));
  HANDLE_CODE(ra_supervision_info_r11.preamb_trans_max_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void rach_cfg_common_scell_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("powerRampingParameters-r11");
  pwr_ramp_params_r11.to_json(j);
  j.write_fieldname("ra-SupervisionInfo-r11");
  j.start_obj();
  j.write_str("preambleTransMax-r11", ra_supervision_info_r11.preamb_trans_max_r11.to_string());
  j.end_obj();
  j.end_obj();
}

// UplinkPowerControlCommon-v1530 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_common_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(delta_flist_spucch_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_common_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(delta_flist_spucch_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_common_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("deltaFList-SPUCCH-r15");
  delta_flist_spucch_r15.to_json(j);
  j.end_obj();
}

// UplinkPowerControlCommonPUSCH-LessCell-v1430 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_common_pusch_less_cell_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(p0_nominal_periodic_srs_r14_present, 1));
  HANDLE_CODE(bref.pack(p0_nominal_aperiodic_srs_r14_present, 1));
  HANDLE_CODE(bref.pack(alpha_srs_r14_present, 1));

  if (p0_nominal_periodic_srs_r14_present) {
    HANDLE_CODE(pack_integer(bref, p0_nominal_periodic_srs_r14, (int8_t)-126, (int8_t)24));
  }
  if (p0_nominal_aperiodic_srs_r14_present) {
    HANDLE_CODE(pack_integer(bref, p0_nominal_aperiodic_srs_r14, (int8_t)-126, (int8_t)24));
  }
  if (alpha_srs_r14_present) {
    HANDLE_CODE(alpha_srs_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_common_pusch_less_cell_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(p0_nominal_periodic_srs_r14_present, 1));
  HANDLE_CODE(bref.unpack(p0_nominal_aperiodic_srs_r14_present, 1));
  HANDLE_CODE(bref.unpack(alpha_srs_r14_present, 1));

  if (p0_nominal_periodic_srs_r14_present) {
    HANDLE_CODE(unpack_integer(p0_nominal_periodic_srs_r14, bref, (int8_t)-126, (int8_t)24));
  }
  if (p0_nominal_aperiodic_srs_r14_present) {
    HANDLE_CODE(unpack_integer(p0_nominal_aperiodic_srs_r14, bref, (int8_t)-126, (int8_t)24));
  }
  if (alpha_srs_r14_present) {
    HANDLE_CODE(alpha_srs_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_common_pusch_less_cell_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (p0_nominal_periodic_srs_r14_present) {
    j.write_int("p0-Nominal-PeriodicSRS-r14", p0_nominal_periodic_srs_r14);
  }
  if (p0_nominal_aperiodic_srs_r14_present) {
    j.write_int("p0-Nominal-AperiodicSRS-r14", p0_nominal_aperiodic_srs_r14);
  }
  if (alpha_srs_r14_present) {
    j.write_str("alpha-SRS-r14", alpha_srs_r14.to_string());
  }
  j.end_obj();
}

// UplinkPowerControlCommonSCell-r10 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_common_scell_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, p0_nominal_pusch_r10, (int8_t)-126, (int8_t)24));
  HANDLE_CODE(alpha_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_common_scell_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(p0_nominal_pusch_r10, bref, (int8_t)-126, (int8_t)24));
  HANDLE_CODE(alpha_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_common_scell_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p0-NominalPUSCH-r10", p0_nominal_pusch_r10);
  j.write_str("alpha-r10", alpha_r10.to_string());
  j.end_obj();
}

// UplinkPowerControlCommonSCell-v1130 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_common_scell_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, delta_preamb_msg3_r11, (int8_t)-1, (int8_t)6));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_common_scell_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(delta_preamb_msg3_r11, bref, (int8_t)-1, (int8_t)6));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_common_scell_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("deltaPreambleMsg3-r11", delta_preamb_msg3_r11);
  j.end_obj();
}

// UplinkPowerControlCommonSCell-v1310 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_common_scell_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(delta_f_pucch_format3_r12_present, 1));
  HANDLE_CODE(bref.pack(delta_f_pucch_format1b_cs_r12_present, 1));
  HANDLE_CODE(bref.pack(delta_f_pucch_format4_r13_present, 1));
  HANDLE_CODE(bref.pack(delta_f_pucch_format5_minus13_present, 1));

  HANDLE_CODE(pack_integer(bref, p0_nominal_pucch, (int8_t)-127, (int8_t)-96));
  HANDLE_CODE(delta_flist_pucch.pack(bref));
  if (delta_f_pucch_format3_r12_present) {
    HANDLE_CODE(delta_f_pucch_format3_r12.pack(bref));
  }
  if (delta_f_pucch_format1b_cs_r12_present) {
    HANDLE_CODE(delta_f_pucch_format1b_cs_r12.pack(bref));
  }
  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_scell_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(delta_f_pucch_format3_r12_present, 1));
  HANDLE_CODE(bref.unpack(delta_f_pucch_format1b_cs_r12_present, 1));
  HANDLE_CODE(bref.unpack(delta_f_pucch_format4_r13_present, 1));
  HANDLE_CODE(bref.unpack(delta_f_pucch_format5_minus13_present, 1));

  HANDLE_CODE(unpack_integer(p0_nominal_pucch, bref, (int8_t)-127, (int8_t)-96));
  HANDLE_CODE(delta_flist_pucch.unpack(bref));
  if (delta_f_pucch_format3_r12_present) {
    HANDLE_CODE(delta_f_pucch_format3_r12.unpack(bref));
  }
  if (delta_f_pucch_format1b_cs_r12_present) {
    HANDLE_CODE(delta_f_pucch_format1b_cs_r12.unpack(bref));
  }
  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_scell_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p0-NominalPUCCH", p0_nominal_pucch);
  j.write_fieldname("deltaFList-PUCCH");
  delta_flist_pucch.to_json(j);
  if (delta_f_pucch_format3_r12_present) {
    j.write_str("deltaF-PUCCH-Format3-r12", delta_f_pucch_format3_r12.to_string());
  }
  if (delta_f_pucch_format1b_cs_r12_present) {
    j.write_str("deltaF-PUCCH-Format1bCS-r12", delta_f_pucch_format1b_cs_r12.to_string());
  }
  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();
}

// AntennaInfoDedicated-v10i0 ::= SEQUENCE
SRSASN_CODE ant_info_ded_v10i0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(max_layers_mimo_r10_present, 1));

  if (max_layers_mimo_r10_present) {
    HANDLE_CODE(max_layers_mimo_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ant_info_ded_v10i0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(max_layers_mimo_r10_present, 1));

  if (max_layers_mimo_r10_present) {
    HANDLE_CODE(max_layers_mimo_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ant_info_ded_v10i0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (max_layers_mimo_r10_present) {
    j.write_str("maxLayersMIMO-r10", max_layers_mimo_r10.to_string());
  }
  j.end_obj();
}

// RadioResourceConfigCommonSCell-r10 ::= SEQUENCE
SRSASN_CODE rr_cfg_common_scell_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ul_cfg_r10_present, 1));

  HANDLE_CODE(bref.pack(non_ul_cfg_r10.mbsfn_sf_cfg_list_r10_present, 1));
  HANDLE_CODE(bref.pack(non_ul_cfg_r10.tdd_cfg_r10_present, 1));
  HANDLE_CODE(non_ul_cfg_r10.dl_bw_r10.pack(bref));
  HANDLE_CODE(non_ul_cfg_r10.ant_info_common_r10.pack(bref));
  if (non_ul_cfg_r10.mbsfn_sf_cfg_list_r10_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, non_ul_cfg_r10.mbsfn_sf_cfg_list_r10, 1, 8));
  }
  HANDLE_CODE(non_ul_cfg_r10.phich_cfg_r10.pack(bref));
  HANDLE_CODE(non_ul_cfg_r10.pdsch_cfg_common_r10.pack(bref));
  if (non_ul_cfg_r10.tdd_cfg_r10_present) {
    HANDLE_CODE(non_ul_cfg_r10.tdd_cfg_r10.pack(bref));
  }
  if (ul_cfg_r10_present) {
    HANDLE_CODE(bref.pack(ul_cfg_r10.p_max_r10_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.prach_cfg_scell_r10_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10_present, 1));
    HANDLE_CODE(bref.pack(ul_cfg_r10.ul_freq_info_r10.ul_bw_r10_present, 1));
    if (ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10_present) {
      HANDLE_CODE(pack_integer(bref, ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10, (uint32_t)0u, (uint32_t)65535u));
    }
    if (ul_cfg_r10.ul_freq_info_r10.ul_bw_r10_present) {
      HANDLE_CODE(ul_cfg_r10.ul_freq_info_r10.ul_bw_r10.pack(bref));
    }
    HANDLE_CODE(pack_integer(bref, ul_cfg_r10.ul_freq_info_r10.add_spec_emission_scell_r10, (uint8_t)1u, (uint8_t)32u));
    if (ul_cfg_r10.p_max_r10_present) {
      HANDLE_CODE(pack_integer(bref, ul_cfg_r10.p_max_r10, (int8_t)-30, (int8_t)33));
    }
    HANDLE_CODE(ul_cfg_r10.ul_pwr_ctrl_common_scell_r10.pack(bref));
    HANDLE_CODE(ul_cfg_r10.srs_ul_cfg_common_r10.pack(bref));
    HANDLE_CODE(ul_cfg_r10.ul_cp_len_r10.pack(bref));
    if (ul_cfg_r10.prach_cfg_scell_r10_present) {
      HANDLE_CODE(ul_cfg_r10.prach_cfg_scell_r10.pack(bref));
    }
    HANDLE_CODE(ul_cfg_r10.pusch_cfg_common_r10.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= ul_carrier_freq_v1090_present;
    group_flags[1] |= rach_cfg_common_scell_r11.is_present();
    group_flags[1] |= prach_cfg_scell_r11.is_present();
    group_flags[1] |= tdd_cfg_v1130.is_present();
    group_flags[1] |= ul_pwr_ctrl_common_scell_v1130.is_present();
    group_flags[2] |= pusch_cfg_common_v1270.is_present();
    group_flags[3] |= pucch_cfg_common_r13.is_present();
    group_flags[3] |= ul_pwr_ctrl_common_scell_v1310.is_present();
    group_flags[4] |= high_speed_cfg_scell_r14.is_present();
    group_flags[4] |= prach_cfg_v1430.is_present();
    group_flags[4] |= ul_cfg_r14.is_present();
    group_flags[4] |= harq_ref_cfg_r14_present;
    group_flags[4] |= srs_flex_timing_r14_present;
    group_flags[5] |= mbsfn_sf_cfg_list_v1430.is_present();
    group_flags[6] |= ul_pwr_ctrl_common_scell_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_carrier_freq_v1090_present, 1));
      if (ul_carrier_freq_v1090_present) {
        HANDLE_CODE(pack_integer(bref, ul_carrier_freq_v1090, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rach_cfg_common_scell_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(prach_cfg_scell_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(tdd_cfg_v1130.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_scell_v1130.is_present(), 1));
      if (rach_cfg_common_scell_r11.is_present()) {
        HANDLE_CODE(rach_cfg_common_scell_r11->pack(bref));
      }
      if (prach_cfg_scell_r11.is_present()) {
        HANDLE_CODE(prach_cfg_scell_r11->pack(bref));
      }
      if (tdd_cfg_v1130.is_present()) {
        HANDLE_CODE(tdd_cfg_v1130->pack(bref));
      }
      if (ul_pwr_ctrl_common_scell_v1130.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_scell_v1130->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pusch_cfg_common_v1270.is_present(), 1));
      if (pusch_cfg_common_v1270.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1270->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pucch_cfg_common_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_scell_v1310.is_present(), 1));
      if (pucch_cfg_common_r13.is_present()) {
        HANDLE_CODE(pucch_cfg_common_r13->pack(bref));
      }
      if (ul_pwr_ctrl_common_scell_v1310.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_scell_v1310->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(high_speed_cfg_scell_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(prach_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(harq_ref_cfg_r14_present, 1));
      HANDLE_CODE(bref.pack(srs_flex_timing_r14_present, 1));
      if (high_speed_cfg_scell_r14.is_present()) {
        HANDLE_CODE(high_speed_cfg_scell_r14->pack(bref));
      }
      if (prach_cfg_v1430.is_present()) {
        HANDLE_CODE(prach_cfg_v1430->pack(bref));
      }
      if (ul_cfg_r14.is_present()) {
        HANDLE_CODE(bref.pack(ul_cfg_r14->p_max_r14_present, 1));
        HANDLE_CODE(bref.pack(ul_cfg_r14->prach_cfg_scell_r14_present, 1));
        HANDLE_CODE(bref.pack(ul_cfg_r14->ul_pwr_ctrl_common_pusch_less_cell_v1430_present, 1));
        HANDLE_CODE(bref.pack(ul_cfg_r14->ul_freq_info_r14.ul_carrier_freq_r14_present, 1));
        HANDLE_CODE(bref.pack(ul_cfg_r14->ul_freq_info_r14.ul_bw_r14_present, 1));
        if (ul_cfg_r14->ul_freq_info_r14.ul_carrier_freq_r14_present) {
          HANDLE_CODE(
              pack_integer(bref, ul_cfg_r14->ul_freq_info_r14.ul_carrier_freq_r14, (uint32_t)0u, (uint32_t)262143u));
        }
        if (ul_cfg_r14->ul_freq_info_r14.ul_bw_r14_present) {
          HANDLE_CODE(ul_cfg_r14->ul_freq_info_r14.ul_bw_r14.pack(bref));
        }
        HANDLE_CODE(
            pack_integer(bref, ul_cfg_r14->ul_freq_info_r14.add_spec_emission_scell_r14, (uint8_t)1u, (uint8_t)32u));
        if (ul_cfg_r14->p_max_r14_present) {
          HANDLE_CODE(pack_integer(bref, ul_cfg_r14->p_max_r14, (int8_t)-30, (int8_t)33));
        }
        HANDLE_CODE(ul_cfg_r14->srs_ul_cfg_common_r14.pack(bref));
        HANDLE_CODE(ul_cfg_r14->ul_cp_len_r14.pack(bref));
        if (ul_cfg_r14->prach_cfg_scell_r14_present) {
          HANDLE_CODE(ul_cfg_r14->prach_cfg_scell_r14.pack(bref));
        }
        if (ul_cfg_r14->ul_pwr_ctrl_common_pusch_less_cell_v1430_present) {
          HANDLE_CODE(ul_cfg_r14->ul_pwr_ctrl_common_pusch_less_cell_v1430.pack(bref));
        }
      }
      if (harq_ref_cfg_r14_present) {
        HANDLE_CODE(harq_ref_cfg_r14.pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mbsfn_sf_cfg_list_v1430.is_present(), 1));
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *mbsfn_sf_cfg_list_v1430, 1, 8));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_scell_v1530.is_present(), 1));
      if (ul_pwr_ctrl_common_scell_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_scell_v1530->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_common_scell_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ul_cfg_r10_present, 1));

  HANDLE_CODE(bref.unpack(non_ul_cfg_r10.mbsfn_sf_cfg_list_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_ul_cfg_r10.tdd_cfg_r10_present, 1));
  HANDLE_CODE(non_ul_cfg_r10.dl_bw_r10.unpack(bref));
  HANDLE_CODE(non_ul_cfg_r10.ant_info_common_r10.unpack(bref));
  if (non_ul_cfg_r10.mbsfn_sf_cfg_list_r10_present) {
    HANDLE_CODE(unpack_dyn_seq_of(non_ul_cfg_r10.mbsfn_sf_cfg_list_r10, bref, 1, 8));
  }
  HANDLE_CODE(non_ul_cfg_r10.phich_cfg_r10.unpack(bref));
  HANDLE_CODE(non_ul_cfg_r10.pdsch_cfg_common_r10.unpack(bref));
  if (non_ul_cfg_r10.tdd_cfg_r10_present) {
    HANDLE_CODE(non_ul_cfg_r10.tdd_cfg_r10.unpack(bref));
  }
  if (ul_cfg_r10_present) {
    HANDLE_CODE(bref.unpack(ul_cfg_r10.p_max_r10_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.prach_cfg_scell_r10_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10_present, 1));
    HANDLE_CODE(bref.unpack(ul_cfg_r10.ul_freq_info_r10.ul_bw_r10_present, 1));
    if (ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10_present) {
      HANDLE_CODE(
          unpack_integer(ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10, bref, (uint32_t)0u, (uint32_t)65535u));
    }
    if (ul_cfg_r10.ul_freq_info_r10.ul_bw_r10_present) {
      HANDLE_CODE(ul_cfg_r10.ul_freq_info_r10.ul_bw_r10.unpack(bref));
    }
    HANDLE_CODE(
        unpack_integer(ul_cfg_r10.ul_freq_info_r10.add_spec_emission_scell_r10, bref, (uint8_t)1u, (uint8_t)32u));
    if (ul_cfg_r10.p_max_r10_present) {
      HANDLE_CODE(unpack_integer(ul_cfg_r10.p_max_r10, bref, (int8_t)-30, (int8_t)33));
    }
    HANDLE_CODE(ul_cfg_r10.ul_pwr_ctrl_common_scell_r10.unpack(bref));
    HANDLE_CODE(ul_cfg_r10.srs_ul_cfg_common_r10.unpack(bref));
    HANDLE_CODE(ul_cfg_r10.ul_cp_len_r10.unpack(bref));
    if (ul_cfg_r10.prach_cfg_scell_r10_present) {
      HANDLE_CODE(ul_cfg_r10.prach_cfg_scell_r10.unpack(bref));
    }
    HANDLE_CODE(ul_cfg_r10.pusch_cfg_common_r10.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(7);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(ul_carrier_freq_v1090_present, 1));
      if (ul_carrier_freq_v1090_present) {
        HANDLE_CODE(unpack_integer(ul_carrier_freq_v1090, bref, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool rach_cfg_common_scell_r11_present;
      HANDLE_CODE(bref.unpack(rach_cfg_common_scell_r11_present, 1));
      rach_cfg_common_scell_r11.set_present(rach_cfg_common_scell_r11_present);
      bool prach_cfg_scell_r11_present;
      HANDLE_CODE(bref.unpack(prach_cfg_scell_r11_present, 1));
      prach_cfg_scell_r11.set_present(prach_cfg_scell_r11_present);
      bool tdd_cfg_v1130_present;
      HANDLE_CODE(bref.unpack(tdd_cfg_v1130_present, 1));
      tdd_cfg_v1130.set_present(tdd_cfg_v1130_present);
      bool ul_pwr_ctrl_common_scell_v1130_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_scell_v1130_present, 1));
      ul_pwr_ctrl_common_scell_v1130.set_present(ul_pwr_ctrl_common_scell_v1130_present);
      if (rach_cfg_common_scell_r11.is_present()) {
        HANDLE_CODE(rach_cfg_common_scell_r11->unpack(bref));
      }
      if (prach_cfg_scell_r11.is_present()) {
        HANDLE_CODE(prach_cfg_scell_r11->unpack(bref));
      }
      if (tdd_cfg_v1130.is_present()) {
        HANDLE_CODE(tdd_cfg_v1130->unpack(bref));
      }
      if (ul_pwr_ctrl_common_scell_v1130.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_scell_v1130->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool pusch_cfg_common_v1270_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_common_v1270_present, 1));
      pusch_cfg_common_v1270.set_present(pusch_cfg_common_v1270_present);
      if (pusch_cfg_common_v1270.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1270->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool pucch_cfg_common_r13_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_common_r13_present, 1));
      pucch_cfg_common_r13.set_present(pucch_cfg_common_r13_present);
      bool ul_pwr_ctrl_common_scell_v1310_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_scell_v1310_present, 1));
      ul_pwr_ctrl_common_scell_v1310.set_present(ul_pwr_ctrl_common_scell_v1310_present);
      if (pucch_cfg_common_r13.is_present()) {
        HANDLE_CODE(pucch_cfg_common_r13->unpack(bref));
      }
      if (ul_pwr_ctrl_common_scell_v1310.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_scell_v1310->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool high_speed_cfg_scell_r14_present;
      HANDLE_CODE(bref.unpack(high_speed_cfg_scell_r14_present, 1));
      high_speed_cfg_scell_r14.set_present(high_speed_cfg_scell_r14_present);
      bool prach_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(prach_cfg_v1430_present, 1));
      prach_cfg_v1430.set_present(prach_cfg_v1430_present);
      bool ul_cfg_r14_present;
      HANDLE_CODE(bref.unpack(ul_cfg_r14_present, 1));
      ul_cfg_r14.set_present(ul_cfg_r14_present);
      HANDLE_CODE(bref.unpack(harq_ref_cfg_r14_present, 1));
      HANDLE_CODE(bref.unpack(srs_flex_timing_r14_present, 1));
      if (high_speed_cfg_scell_r14.is_present()) {
        HANDLE_CODE(high_speed_cfg_scell_r14->unpack(bref));
      }
      if (prach_cfg_v1430.is_present()) {
        HANDLE_CODE(prach_cfg_v1430->unpack(bref));
      }
      if (ul_cfg_r14.is_present()) {
        HANDLE_CODE(bref.unpack(ul_cfg_r14->p_max_r14_present, 1));
        HANDLE_CODE(bref.unpack(ul_cfg_r14->prach_cfg_scell_r14_present, 1));
        HANDLE_CODE(bref.unpack(ul_cfg_r14->ul_pwr_ctrl_common_pusch_less_cell_v1430_present, 1));
        HANDLE_CODE(bref.unpack(ul_cfg_r14->ul_freq_info_r14.ul_carrier_freq_r14_present, 1));
        HANDLE_CODE(bref.unpack(ul_cfg_r14->ul_freq_info_r14.ul_bw_r14_present, 1));
        if (ul_cfg_r14->ul_freq_info_r14.ul_carrier_freq_r14_present) {
          HANDLE_CODE(
              unpack_integer(ul_cfg_r14->ul_freq_info_r14.ul_carrier_freq_r14, bref, (uint32_t)0u, (uint32_t)262143u));
        }
        if (ul_cfg_r14->ul_freq_info_r14.ul_bw_r14_present) {
          HANDLE_CODE(ul_cfg_r14->ul_freq_info_r14.ul_bw_r14.unpack(bref));
        }
        HANDLE_CODE(
            unpack_integer(ul_cfg_r14->ul_freq_info_r14.add_spec_emission_scell_r14, bref, (uint8_t)1u, (uint8_t)32u));
        if (ul_cfg_r14->p_max_r14_present) {
          HANDLE_CODE(unpack_integer(ul_cfg_r14->p_max_r14, bref, (int8_t)-30, (int8_t)33));
        }
        HANDLE_CODE(ul_cfg_r14->srs_ul_cfg_common_r14.unpack(bref));
        HANDLE_CODE(ul_cfg_r14->ul_cp_len_r14.unpack(bref));
        if (ul_cfg_r14->prach_cfg_scell_r14_present) {
          HANDLE_CODE(ul_cfg_r14->prach_cfg_scell_r14.unpack(bref));
        }
        if (ul_cfg_r14->ul_pwr_ctrl_common_pusch_less_cell_v1430_present) {
          HANDLE_CODE(ul_cfg_r14->ul_pwr_ctrl_common_pusch_less_cell_v1430.unpack(bref));
        }
      }
      if (harq_ref_cfg_r14_present) {
        HANDLE_CODE(harq_ref_cfg_r14.unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool mbsfn_sf_cfg_list_v1430_present;
      HANDLE_CODE(bref.unpack(mbsfn_sf_cfg_list_v1430_present, 1));
      mbsfn_sf_cfg_list_v1430.set_present(mbsfn_sf_cfg_list_v1430_present);
      if (mbsfn_sf_cfg_list_v1430.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*mbsfn_sf_cfg_list_v1430, bref, 1, 8));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ul_pwr_ctrl_common_scell_v1530_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_scell_v1530_present, 1));
      ul_pwr_ctrl_common_scell_v1530.set_present(ul_pwr_ctrl_common_scell_v1530_present);
      if (ul_pwr_ctrl_common_scell_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_scell_v1530->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rr_cfg_common_scell_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("nonUL-Configuration-r10");
  j.start_obj();
  j.write_str("dl-Bandwidth-r10", non_ul_cfg_r10.dl_bw_r10.to_string());
  j.write_fieldname("antennaInfoCommon-r10");
  non_ul_cfg_r10.ant_info_common_r10.to_json(j);
  if (non_ul_cfg_r10.mbsfn_sf_cfg_list_r10_present) {
    j.start_array("mbsfn-SubframeConfigList-r10");
    for (const auto& e1 : non_ul_cfg_r10.mbsfn_sf_cfg_list_r10) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_fieldname("phich-Config-r10");
  non_ul_cfg_r10.phich_cfg_r10.to_json(j);
  j.write_fieldname("pdsch-ConfigCommon-r10");
  non_ul_cfg_r10.pdsch_cfg_common_r10.to_json(j);
  if (non_ul_cfg_r10.tdd_cfg_r10_present) {
    j.write_fieldname("tdd-Config-r10");
    non_ul_cfg_r10.tdd_cfg_r10.to_json(j);
  }
  j.end_obj();
  if (ul_cfg_r10_present) {
    j.write_fieldname("ul-Configuration-r10");
    j.start_obj();
    j.write_fieldname("ul-FreqInfo-r10");
    j.start_obj();
    if (ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10_present) {
      j.write_int("ul-CarrierFreq-r10", ul_cfg_r10.ul_freq_info_r10.ul_carrier_freq_r10);
    }
    if (ul_cfg_r10.ul_freq_info_r10.ul_bw_r10_present) {
      j.write_str("ul-Bandwidth-r10", ul_cfg_r10.ul_freq_info_r10.ul_bw_r10.to_string());
    }
    j.write_int("additionalSpectrumEmissionSCell-r10", ul_cfg_r10.ul_freq_info_r10.add_spec_emission_scell_r10);
    j.end_obj();
    if (ul_cfg_r10.p_max_r10_present) {
      j.write_int("p-Max-r10", ul_cfg_r10.p_max_r10);
    }
    j.write_fieldname("uplinkPowerControlCommonSCell-r10");
    ul_cfg_r10.ul_pwr_ctrl_common_scell_r10.to_json(j);
    j.write_fieldname("soundingRS-UL-ConfigCommon-r10");
    ul_cfg_r10.srs_ul_cfg_common_r10.to_json(j);
    j.write_str("ul-CyclicPrefixLength-r10", ul_cfg_r10.ul_cp_len_r10.to_string());
    if (ul_cfg_r10.prach_cfg_scell_r10_present) {
      j.write_fieldname("prach-ConfigSCell-r10");
      ul_cfg_r10.prach_cfg_scell_r10.to_json(j);
    }
    j.write_fieldname("pusch-ConfigCommon-r10");
    ul_cfg_r10.pusch_cfg_common_r10.to_json(j);
    j.end_obj();
  }
  if (ext) {
    if (ul_carrier_freq_v1090_present) {
      j.write_int("ul-CarrierFreq-v1090", ul_carrier_freq_v1090);
    }
    if (rach_cfg_common_scell_r11.is_present()) {
      j.write_fieldname("rach-ConfigCommonSCell-r11");
      rach_cfg_common_scell_r11->to_json(j);
    }
    if (prach_cfg_scell_r11.is_present()) {
      j.write_fieldname("prach-ConfigSCell-r11");
      prach_cfg_scell_r11->to_json(j);
    }
    if (tdd_cfg_v1130.is_present()) {
      j.write_fieldname("tdd-Config-v1130");
      tdd_cfg_v1130->to_json(j);
    }
    if (ul_pwr_ctrl_common_scell_v1130.is_present()) {
      j.write_fieldname("uplinkPowerControlCommonSCell-v1130");
      ul_pwr_ctrl_common_scell_v1130->to_json(j);
    }
    if (pusch_cfg_common_v1270.is_present()) {
      j.write_fieldname("pusch-ConfigCommon-v1270");
      pusch_cfg_common_v1270->to_json(j);
    }
    if (pucch_cfg_common_r13.is_present()) {
      j.write_fieldname("pucch-ConfigCommon-r13");
      pucch_cfg_common_r13->to_json(j);
    }
    if (ul_pwr_ctrl_common_scell_v1310.is_present()) {
      j.write_fieldname("uplinkPowerControlCommonSCell-v1310");
      ul_pwr_ctrl_common_scell_v1310->to_json(j);
    }
    if (high_speed_cfg_scell_r14.is_present()) {
      j.write_fieldname("highSpeedConfigSCell-r14");
      high_speed_cfg_scell_r14->to_json(j);
    }
    if (prach_cfg_v1430.is_present()) {
      j.write_fieldname("prach-Config-v1430");
      prach_cfg_v1430->to_json(j);
    }
    if (ul_cfg_r14.is_present()) {
      j.write_fieldname("ul-Configuration-r14");
      j.start_obj();
      j.write_fieldname("ul-FreqInfo-r14");
      j.start_obj();
      if (ul_cfg_r14->ul_freq_info_r14.ul_carrier_freq_r14_present) {
        j.write_int("ul-CarrierFreq-r14", ul_cfg_r14->ul_freq_info_r14.ul_carrier_freq_r14);
      }
      if (ul_cfg_r14->ul_freq_info_r14.ul_bw_r14_present) {
        j.write_str("ul-Bandwidth-r14", ul_cfg_r14->ul_freq_info_r14.ul_bw_r14.to_string());
      }
      j.write_int("additionalSpectrumEmissionSCell-r14", ul_cfg_r14->ul_freq_info_r14.add_spec_emission_scell_r14);
      j.end_obj();
      if (ul_cfg_r14->p_max_r14_present) {
        j.write_int("p-Max-r14", ul_cfg_r14->p_max_r14);
      }
      j.write_fieldname("soundingRS-UL-ConfigCommon-r14");
      ul_cfg_r14->srs_ul_cfg_common_r14.to_json(j);
      j.write_str("ul-CyclicPrefixLength-r14", ul_cfg_r14->ul_cp_len_r14.to_string());
      if (ul_cfg_r14->prach_cfg_scell_r14_present) {
        j.write_fieldname("prach-ConfigSCell-r14");
        ul_cfg_r14->prach_cfg_scell_r14.to_json(j);
      }
      if (ul_cfg_r14->ul_pwr_ctrl_common_pusch_less_cell_v1430_present) {
        j.write_fieldname("uplinkPowerControlCommonPUSCH-LessCell-v1430");
        ul_cfg_r14->ul_pwr_ctrl_common_pusch_less_cell_v1430.to_json(j);
      }
      j.end_obj();
    }
    if (harq_ref_cfg_r14_present) {
      j.write_str("harq-ReferenceConfig-r14", harq_ref_cfg_r14.to_string());
    }
    if (srs_flex_timing_r14_present) {
      j.write_str("soundingRS-FlexibleTiming-r14", "true");
    }
    if (mbsfn_sf_cfg_list_v1430.is_present()) {
      j.start_array("mbsfn-SubframeConfigList-v1430");
      for (const auto& e1 : *mbsfn_sf_cfg_list_v1430) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (ul_pwr_ctrl_common_scell_v1530.is_present()) {
      j.write_fieldname("uplinkPowerControlCommonSCell-v1530");
      ul_pwr_ctrl_common_scell_v1530->to_json(j);
    }
  }
  j.end_obj();
}

// RadioResourceConfigDedicatedSCell-r10 ::= SEQUENCE
SRSASN_CODE rr_cfg_ded_scell_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(phys_cfg_ded_scell_r10_present, 1));

  if (phys_cfg_ded_scell_r10_present) {
    HANDLE_CODE(phys_cfg_ded_scell_r10.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= mac_main_cfg_scell_r11.is_present();
    group_flags[1] |= naics_info_r12.is_present();
    group_flags[2] |= neigh_cells_crs_info_scell_r13.is_present();
    group_flags[3] |= phys_cfg_ded_scell_v1370.is_present();
    group_flags[4] |= crs_intf_mitig_enabled_r15_present;
    group_flags[4] |= neigh_cells_crs_info_r15.is_present();
    group_flags[4] |= sps_cfg_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mac_main_cfg_scell_r11.is_present(), 1));
      if (mac_main_cfg_scell_r11.is_present()) {
        HANDLE_CODE(mac_main_cfg_scell_r11->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(naics_info_r12.is_present(), 1));
      if (naics_info_r12.is_present()) {
        HANDLE_CODE(naics_info_r12->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(neigh_cells_crs_info_scell_r13.is_present(), 1));
      if (neigh_cells_crs_info_scell_r13.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_scell_r13->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(phys_cfg_ded_scell_v1370.is_present(), 1));
      if (phys_cfg_ded_scell_v1370.is_present()) {
        HANDLE_CODE(phys_cfg_ded_scell_v1370->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(crs_intf_mitig_enabled_r15_present, 1));
      HANDLE_CODE(bref.pack(neigh_cells_crs_info_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(sps_cfg_v1530.is_present(), 1));
      if (crs_intf_mitig_enabled_r15_present) {
        HANDLE_CODE(bref.pack(crs_intf_mitig_enabled_r15, 1));
      }
      if (neigh_cells_crs_info_r15.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r15->pack(bref));
      }
      if (sps_cfg_v1530.is_present()) {
        HANDLE_CODE(sps_cfg_v1530->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_ded_scell_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(phys_cfg_ded_scell_r10_present, 1));

  if (phys_cfg_ded_scell_r10_present) {
    HANDLE_CODE(phys_cfg_ded_scell_r10.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(5);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool mac_main_cfg_scell_r11_present;
      HANDLE_CODE(bref.unpack(mac_main_cfg_scell_r11_present, 1));
      mac_main_cfg_scell_r11.set_present(mac_main_cfg_scell_r11_present);
      if (mac_main_cfg_scell_r11.is_present()) {
        HANDLE_CODE(mac_main_cfg_scell_r11->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool naics_info_r12_present;
      HANDLE_CODE(bref.unpack(naics_info_r12_present, 1));
      naics_info_r12.set_present(naics_info_r12_present);
      if (naics_info_r12.is_present()) {
        HANDLE_CODE(naics_info_r12->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool neigh_cells_crs_info_scell_r13_present;
      HANDLE_CODE(bref.unpack(neigh_cells_crs_info_scell_r13_present, 1));
      neigh_cells_crs_info_scell_r13.set_present(neigh_cells_crs_info_scell_r13_present);
      if (neigh_cells_crs_info_scell_r13.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_scell_r13->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool phys_cfg_ded_scell_v1370_present;
      HANDLE_CODE(bref.unpack(phys_cfg_ded_scell_v1370_present, 1));
      phys_cfg_ded_scell_v1370.set_present(phys_cfg_ded_scell_v1370_present);
      if (phys_cfg_ded_scell_v1370.is_present()) {
        HANDLE_CODE(phys_cfg_ded_scell_v1370->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(crs_intf_mitig_enabled_r15_present, 1));
      bool neigh_cells_crs_info_r15_present;
      HANDLE_CODE(bref.unpack(neigh_cells_crs_info_r15_present, 1));
      neigh_cells_crs_info_r15.set_present(neigh_cells_crs_info_r15_present);
      bool sps_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(sps_cfg_v1530_present, 1));
      sps_cfg_v1530.set_present(sps_cfg_v1530_present);
      if (crs_intf_mitig_enabled_r15_present) {
        HANDLE_CODE(bref.unpack(crs_intf_mitig_enabled_r15, 1));
      }
      if (neigh_cells_crs_info_r15.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r15->unpack(bref));
      }
      if (sps_cfg_v1530.is_present()) {
        HANDLE_CODE(sps_cfg_v1530->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rr_cfg_ded_scell_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phys_cfg_ded_scell_r10_present) {
    j.write_fieldname("physicalConfigDedicatedSCell-r10");
    phys_cfg_ded_scell_r10.to_json(j);
  }
  if (ext) {
    if (mac_main_cfg_scell_r11.is_present()) {
      j.write_fieldname("mac-MainConfigSCell-r11");
      mac_main_cfg_scell_r11->to_json(j);
    }
    if (naics_info_r12.is_present()) {
      j.write_fieldname("naics-Info-r12");
      naics_info_r12->to_json(j);
    }
    if (neigh_cells_crs_info_scell_r13.is_present()) {
      j.write_fieldname("neighCellsCRS-InfoSCell-r13");
      neigh_cells_crs_info_scell_r13->to_json(j);
    }
    if (phys_cfg_ded_scell_v1370.is_present()) {
      j.write_fieldname("physicalConfigDedicatedSCell-v1370");
      phys_cfg_ded_scell_v1370->to_json(j);
    }
    if (crs_intf_mitig_enabled_r15_present) {
      j.write_bool("crs-IntfMitigEnabled-r15", crs_intf_mitig_enabled_r15);
    }
    if (neigh_cells_crs_info_r15.is_present()) {
      j.write_fieldname("neighCellsCRS-Info-r15");
      neigh_cells_crs_info_r15->to_json(j);
    }
    if (sps_cfg_v1530.is_present()) {
      j.write_fieldname("sps-Config-v1530");
      sps_cfg_v1530->to_json(j);
    }
  }
  j.end_obj();
}

// SCellToAddModExt-r13 ::= SEQUENCE
SRSASN_CODE scell_to_add_mod_ext_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cell_identif_r13_present, 1));
  HANDLE_CODE(bref.pack(rr_cfg_common_scell_r13_present, 1));
  HANDLE_CODE(bref.pack(rr_cfg_ded_scell_r13_present, 1));
  HANDLE_CODE(bref.pack(ant_info_ded_scell_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, scell_idx_r13, (uint8_t)1u, (uint8_t)31u));
  if (cell_identif_r13_present) {
    HANDLE_CODE(pack_integer(bref, cell_identif_r13.pci_r13, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(pack_integer(bref, cell_identif_r13.dl_carrier_freq_r13, (uint32_t)0u, (uint32_t)262143u));
  }
  if (rr_cfg_common_scell_r13_present) {
    HANDLE_CODE(rr_cfg_common_scell_r13.pack(bref));
  }
  if (rr_cfg_ded_scell_r13_present) {
    HANDLE_CODE(rr_cfg_ded_scell_r13.pack(bref));
  }
  if (ant_info_ded_scell_r13_present) {
    HANDLE_CODE(ant_info_ded_scell_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scell_to_add_mod_ext_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cell_identif_r13_present, 1));
  HANDLE_CODE(bref.unpack(rr_cfg_common_scell_r13_present, 1));
  HANDLE_CODE(bref.unpack(rr_cfg_ded_scell_r13_present, 1));
  HANDLE_CODE(bref.unpack(ant_info_ded_scell_r13_present, 1));

  HANDLE_CODE(unpack_integer(scell_idx_r13, bref, (uint8_t)1u, (uint8_t)31u));
  if (cell_identif_r13_present) {
    HANDLE_CODE(unpack_integer(cell_identif_r13.pci_r13, bref, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(unpack_integer(cell_identif_r13.dl_carrier_freq_r13, bref, (uint32_t)0u, (uint32_t)262143u));
  }
  if (rr_cfg_common_scell_r13_present) {
    HANDLE_CODE(rr_cfg_common_scell_r13.unpack(bref));
  }
  if (rr_cfg_ded_scell_r13_present) {
    HANDLE_CODE(rr_cfg_ded_scell_r13.unpack(bref));
  }
  if (ant_info_ded_scell_r13_present) {
    HANDLE_CODE(ant_info_ded_scell_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scell_to_add_mod_ext_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sCellIndex-r13", scell_idx_r13);
  if (cell_identif_r13_present) {
    j.write_fieldname("cellIdentification-r13");
    j.start_obj();
    j.write_int("physCellId-r13", cell_identif_r13.pci_r13);
    j.write_int("dl-CarrierFreq-r13", cell_identif_r13.dl_carrier_freq_r13);
    j.end_obj();
  }
  if (rr_cfg_common_scell_r13_present) {
    j.write_fieldname("radioResourceConfigCommonSCell-r13");
    rr_cfg_common_scell_r13.to_json(j);
  }
  if (rr_cfg_ded_scell_r13_present) {
    j.write_fieldname("radioResourceConfigDedicatedSCell-r13");
    rr_cfg_ded_scell_r13.to_json(j);
  }
  if (ant_info_ded_scell_r13_present) {
    j.write_fieldname("antennaInfoDedicatedSCell-r13");
    ant_info_ded_scell_r13.to_json(j);
  }
  j.end_obj();
}

// SCellConfigCommon-r15 ::= SEQUENCE
SRSASN_CODE scell_cfg_common_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rr_cfg_common_scell_r15_present, 1));
  HANDLE_CODE(bref.pack(rr_cfg_ded_scell_r15_present, 1));
  HANDLE_CODE(bref.pack(ant_info_ded_scell_r15_present, 1));

  if (rr_cfg_common_scell_r15_present) {
    HANDLE_CODE(rr_cfg_common_scell_r15.pack(bref));
  }
  if (rr_cfg_ded_scell_r15_present) {
    HANDLE_CODE(rr_cfg_ded_scell_r15.pack(bref));
  }
  if (ant_info_ded_scell_r15_present) {
    HANDLE_CODE(ant_info_ded_scell_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scell_cfg_common_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rr_cfg_common_scell_r15_present, 1));
  HANDLE_CODE(bref.unpack(rr_cfg_ded_scell_r15_present, 1));
  HANDLE_CODE(bref.unpack(ant_info_ded_scell_r15_present, 1));

  if (rr_cfg_common_scell_r15_present) {
    HANDLE_CODE(rr_cfg_common_scell_r15.unpack(bref));
  }
  if (rr_cfg_ded_scell_r15_present) {
    HANDLE_CODE(rr_cfg_ded_scell_r15.unpack(bref));
  }
  if (ant_info_ded_scell_r15_present) {
    HANDLE_CODE(ant_info_ded_scell_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scell_cfg_common_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rr_cfg_common_scell_r15_present) {
    j.write_fieldname("radioResourceConfigCommonSCell-r15");
    rr_cfg_common_scell_r15.to_json(j);
  }
  if (rr_cfg_ded_scell_r15_present) {
    j.write_fieldname("radioResourceConfigDedicatedSCell-r15");
    rr_cfg_ded_scell_r15.to_json(j);
  }
  if (ant_info_ded_scell_r15_present) {
    j.write_fieldname("antennaInfoDedicatedSCell-r15");
    ant_info_ded_scell_r15.to_json(j);
  }
  j.end_obj();
}

// SL-DiscTxPoolToAddMod-r12 ::= SEQUENCE
SRSASN_CODE sl_disc_tx_pool_to_add_mod_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, pool_id_r12, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(pool_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_pool_to_add_mod_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(pool_id_r12, bref, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(pool_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_disc_tx_pool_to_add_mod_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("poolIdentity-r12", pool_id_r12);
  j.write_fieldname("pool-r12");
  pool_r12.to_json(j);
  j.end_obj();
}

// SL-TF-IndexPair-r12b ::= SEQUENCE
SRSASN_CODE sl_tf_idx_pair_r12b_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(disc_sf_idx_r12b_present, 1));
  HANDLE_CODE(bref.pack(disc_prb_idx_r12b_present, 1));

  if (disc_sf_idx_r12b_present) {
    HANDLE_CODE(pack_integer(bref, disc_sf_idx_r12b, (uint8_t)0u, (uint8_t)209u));
  }
  if (disc_prb_idx_r12b_present) {
    HANDLE_CODE(pack_integer(bref, disc_prb_idx_r12b, (uint8_t)0u, (uint8_t)49u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_tf_idx_pair_r12b_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(disc_sf_idx_r12b_present, 1));
  HANDLE_CODE(bref.unpack(disc_prb_idx_r12b_present, 1));

  if (disc_sf_idx_r12b_present) {
    HANDLE_CODE(unpack_integer(disc_sf_idx_r12b, bref, (uint8_t)0u, (uint8_t)209u));
  }
  if (disc_prb_idx_r12b_present) {
    HANDLE_CODE(unpack_integer(disc_prb_idx_r12b, bref, (uint8_t)0u, (uint8_t)49u));
  }

  return SRSASN_SUCCESS;
}
void sl_tf_idx_pair_r12b_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (disc_sf_idx_r12b_present) {
    j.write_int("discSF-Index-r12b", disc_sf_idx_r12b);
  }
  if (disc_prb_idx_r12b_present) {
    j.write_int("discPRB-Index-r12b", disc_prb_idx_r12b);
  }
  j.end_obj();
}

// SCellGroupToAddMod-r15 ::= SEQUENCE
SRSASN_CODE scell_group_to_add_mod_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(scell_cfg_common_r15_present, 1));
  HANDLE_CODE(bref.pack(scell_to_release_list_r15_present, 1));
  HANDLE_CODE(bref.pack(scell_to_add_mod_list_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, scell_group_idx_r15, (uint8_t)1u, (uint8_t)4u));
  if (scell_cfg_common_r15_present) {
    HANDLE_CODE(scell_cfg_common_r15.pack(bref));
  }
  if (scell_to_release_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_release_list_r15, 1, 31, integer_packer<uint8_t>(1, 31)));
  }
  if (scell_to_add_mod_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_r15, 1, 31));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scell_group_to_add_mod_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(scell_cfg_common_r15_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_release_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_r15_present, 1));

  HANDLE_CODE(unpack_integer(scell_group_idx_r15, bref, (uint8_t)1u, (uint8_t)4u));
  if (scell_cfg_common_r15_present) {
    HANDLE_CODE(scell_cfg_common_r15.unpack(bref));
  }
  if (scell_to_release_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_release_list_r15, bref, 1, 31, integer_packer<uint8_t>(1, 31)));
  }
  if (scell_to_add_mod_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_r15, bref, 1, 31));
  }

  return SRSASN_SUCCESS;
}
void scell_group_to_add_mod_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sCellGroupIndex-r15", scell_group_idx_r15);
  if (scell_cfg_common_r15_present) {
    j.write_fieldname("sCellConfigCommon-r15");
    scell_cfg_common_r15.to_json(j);
  }
  if (scell_to_release_list_r15_present) {
    j.start_array("sCellToReleaseList-r15");
    for (const auto& e1 : scell_to_release_list_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (scell_to_add_mod_list_r15_present) {
    j.start_array("sCellToAddModList-r15");
    for (const auto& e1 : scell_to_add_mod_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SL-HoppingConfigDisc-r12 ::= SEQUENCE
SRSASN_CODE sl_hop_cfg_disc_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, a_r12, (uint8_t)1u, (uint8_t)200u));
  HANDLE_CODE(pack_integer(bref, b_r12, (uint8_t)1u, (uint8_t)10u));
  HANDLE_CODE(c_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_hop_cfg_disc_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(a_r12, bref, (uint8_t)1u, (uint8_t)200u));
  HANDLE_CODE(unpack_integer(b_r12, bref, (uint8_t)1u, (uint8_t)10u));
  HANDLE_CODE(c_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_hop_cfg_disc_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("a-r12", a_r12);
  j.write_int("b-r12", b_r12);
  j.write_str("c-r12", c_r12.to_string());
  j.end_obj();
}

// SecurityAlgorithmConfig ::= SEQUENCE
SRSASN_CODE security_algorithm_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(ciphering_algorithm.pack(bref));
  HANDLE_CODE(integrity_prot_algorithm.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE security_algorithm_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(ciphering_algorithm.unpack(bref));
  HANDLE_CODE(integrity_prot_algorithm.unpack(bref));

  return SRSASN_SUCCESS;
}
void security_algorithm_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cipheringAlgorithm", ciphering_algorithm.to_string());
  j.write_str("integrityProtAlgorithm", integrity_prot_algorithm.to_string());
  j.end_obj();
}

// DRB-ToAddModSCG-r12 ::= SEQUENCE
SRSASN_CODE drb_to_add_mod_scg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(drb_type_r12_present, 1));
  HANDLE_CODE(bref.pack(rlc_cfg_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(rlc_cfg_v1250_present, 1));
  HANDLE_CODE(bref.pack(lc_ch_id_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(lc_ch_cfg_scg_r12_present, 1));

  HANDLE_CODE(pack_integer(bref, drb_id_r12, (uint8_t)1u, (uint8_t)32u));
  if (drb_type_r12_present) {
    HANDLE_CODE(drb_type_r12.pack(bref));
  }
  if (rlc_cfg_scg_r12_present) {
    HANDLE_CODE(rlc_cfg_scg_r12.pack(bref));
  }
  if (rlc_cfg_v1250_present) {
    HANDLE_CODE(rlc_cfg_v1250.pack(bref));
  }
  if (lc_ch_id_scg_r12_present) {
    HANDLE_CODE(pack_integer(bref, lc_ch_id_scg_r12, (uint8_t)3u, (uint8_t)10u));
  }
  if (lc_ch_cfg_scg_r12_present) {
    HANDLE_CODE(lc_ch_cfg_scg_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= rlc_cfg_v1430.is_present();
    group_flags[1] |= lc_ch_id_scg_r15_present;
    group_flags[1] |= rlc_cfg_v1530.is_present();
    group_flags[1] |= rlc_bearer_cfg_dupl_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rlc_cfg_v1430.is_present(), 1));
      if (rlc_cfg_v1430.is_present()) {
        HANDLE_CODE(rlc_cfg_v1430->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(lc_ch_id_scg_r15_present, 1));
      HANDLE_CODE(bref.pack(rlc_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(rlc_bearer_cfg_dupl_r15.is_present(), 1));
      if (lc_ch_id_scg_r15_present) {
        HANDLE_CODE(pack_integer(bref, lc_ch_id_scg_r15, (uint8_t)32u, (uint8_t)38u));
      }
      if (rlc_cfg_v1530.is_present()) {
        HANDLE_CODE(rlc_cfg_v1530->pack(bref));
      }
      if (rlc_bearer_cfg_dupl_r15.is_present()) {
        HANDLE_CODE(rlc_bearer_cfg_dupl_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE drb_to_add_mod_scg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(drb_type_r12_present, 1));
  HANDLE_CODE(bref.unpack(rlc_cfg_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(rlc_cfg_v1250_present, 1));
  HANDLE_CODE(bref.unpack(lc_ch_id_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(lc_ch_cfg_scg_r12_present, 1));

  HANDLE_CODE(unpack_integer(drb_id_r12, bref, (uint8_t)1u, (uint8_t)32u));
  if (drb_type_r12_present) {
    HANDLE_CODE(drb_type_r12.unpack(bref));
  }
  if (rlc_cfg_scg_r12_present) {
    HANDLE_CODE(rlc_cfg_scg_r12.unpack(bref));
  }
  if (rlc_cfg_v1250_present) {
    HANDLE_CODE(rlc_cfg_v1250.unpack(bref));
  }
  if (lc_ch_id_scg_r12_present) {
    HANDLE_CODE(unpack_integer(lc_ch_id_scg_r12, bref, (uint8_t)3u, (uint8_t)10u));
  }
  if (lc_ch_cfg_scg_r12_present) {
    HANDLE_CODE(lc_ch_cfg_scg_r12.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 rlc_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(rlc_cfg_v1430_present, 1));
      rlc_cfg_v1430.set_present(rlc_cfg_v1430_present);
      if (rlc_cfg_v1430.is_present()) {
        HANDLE_CODE(rlc_cfg_v1430->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(lc_ch_id_scg_r15_present, 1));
      bool rlc_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(rlc_cfg_v1530_present, 1));
      rlc_cfg_v1530.set_present(rlc_cfg_v1530_present);
      bool rlc_bearer_cfg_dupl_r15_present;
      HANDLE_CODE(bref.unpack(rlc_bearer_cfg_dupl_r15_present, 1));
      rlc_bearer_cfg_dupl_r15.set_present(rlc_bearer_cfg_dupl_r15_present);
      if (lc_ch_id_scg_r15_present) {
        HANDLE_CODE(unpack_integer(lc_ch_id_scg_r15, bref, (uint8_t)32u, (uint8_t)38u));
      }
      if (rlc_cfg_v1530.is_present()) {
        HANDLE_CODE(rlc_cfg_v1530->unpack(bref));
      }
      if (rlc_bearer_cfg_dupl_r15.is_present()) {
        HANDLE_CODE(rlc_bearer_cfg_dupl_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void drb_to_add_mod_scg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("drb-Identity-r12", drb_id_r12);
  if (drb_type_r12_present) {
    j.write_fieldname("drb-Type-r12");
    drb_type_r12.to_json(j);
  }
  if (rlc_cfg_scg_r12_present) {
    j.write_fieldname("rlc-ConfigSCG-r12");
    rlc_cfg_scg_r12.to_json(j);
  }
  if (rlc_cfg_v1250_present) {
    j.write_fieldname("rlc-Config-v1250");
    rlc_cfg_v1250.to_json(j);
  }
  if (lc_ch_id_scg_r12_present) {
    j.write_int("logicalChannelIdentitySCG-r12", lc_ch_id_scg_r12);
  }
  if (lc_ch_cfg_scg_r12_present) {
    j.write_fieldname("logicalChannelConfigSCG-r12");
    lc_ch_cfg_scg_r12.to_json(j);
  }
  if (ext) {
    if (rlc_cfg_v1430.is_present()) {
      j.write_fieldname("rlc-Config-v1430");
      rlc_cfg_v1430->to_json(j);
    }
    if (lc_ch_id_scg_r15_present) {
      j.write_int("logicalChannelIdentitySCG-r15", lc_ch_id_scg_r15);
    }
    if (rlc_cfg_v1530.is_present()) {
      j.write_fieldname("rlc-Config-v1530");
      rlc_cfg_v1530->to_json(j);
    }
    if (rlc_bearer_cfg_dupl_r15.is_present()) {
      j.write_fieldname("rlc-BearerConfigDupl-r15");
      rlc_bearer_cfg_dupl_r15->to_json(j);
    }
  }
  j.end_obj();
}

void drb_to_add_mod_scg_r12_s::drb_type_r12_c_::set(types::options e)
{
  type_ = e;
}
void drb_to_add_mod_scg_r12_s::drb_type_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::split_r12:
      break;
    case types::scg_r12:
      j.write_fieldname("scg-r12");
      j.start_obj();
      if (c.eps_bearer_id_r12_present) {
        j.write_int("eps-BearerIdentity-r12", c.eps_bearer_id_r12);
      }
      if (c.pdcp_cfg_r12_present) {
        j.write_fieldname("pdcp-Config-r12");
        c.pdcp_cfg_r12.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "drb_to_add_mod_scg_r12_s::drb_type_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE drb_to_add_mod_scg_r12_s::drb_type_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::split_r12:
      break;
    case types::scg_r12:
      HANDLE_CODE(bref.pack(c.eps_bearer_id_r12_present, 1));
      HANDLE_CODE(bref.pack(c.pdcp_cfg_r12_present, 1));
      if (c.eps_bearer_id_r12_present) {
        HANDLE_CODE(pack_integer(bref, c.eps_bearer_id_r12, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.pdcp_cfg_r12_present) {
        HANDLE_CODE(c.pdcp_cfg_r12.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "drb_to_add_mod_scg_r12_s::drb_type_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE drb_to_add_mod_scg_r12_s::drb_type_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::split_r12:
      break;
    case types::scg_r12:
      HANDLE_CODE(bref.unpack(c.eps_bearer_id_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.pdcp_cfg_r12_present, 1));
      if (c.eps_bearer_id_r12_present) {
        HANDLE_CODE(unpack_integer(c.eps_bearer_id_r12, bref, (uint8_t)0u, (uint8_t)15u));
      }
      if (c.pdcp_cfg_r12_present) {
        HANDLE_CODE(c.pdcp_cfg_r12.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "drb_to_add_mod_scg_r12_s::drb_type_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// IKE-Identity-r13 ::= SEQUENCE
SRSASN_CODE ike_id_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(id_i_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ike_id_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(id_i_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void ike_id_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("idI-r13", id_i_r13.to_string());
  j.end_obj();
}

// IP-Address-r13 ::= CHOICE
void ip_address_r13_c::destroy_()
{
  switch (type_) {
    case types::ipv4_r13:
      c.destroy<fixed_bitstring<32> >();
      break;
    case types::ipv6_r13:
      c.destroy<fixed_bitstring<128> >();
      break;
    default:
      break;
  }
}
void ip_address_r13_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ipv4_r13:
      c.init<fixed_bitstring<32> >();
      break;
    case types::ipv6_r13:
      c.init<fixed_bitstring<128> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ip_address_r13_c");
  }
}
ip_address_r13_c::ip_address_r13_c(const ip_address_r13_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ipv4_r13:
      c.init(other.c.get<fixed_bitstring<32> >());
      break;
    case types::ipv6_r13:
      c.init(other.c.get<fixed_bitstring<128> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ip_address_r13_c");
  }
}
ip_address_r13_c& ip_address_r13_c::operator=(const ip_address_r13_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ipv4_r13:
      c.set(other.c.get<fixed_bitstring<32> >());
      break;
    case types::ipv6_r13:
      c.set(other.c.get<fixed_bitstring<128> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ip_address_r13_c");
  }

  return *this;
}
void ip_address_r13_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ipv4_r13:
      j.write_str("ipv4-r13", c.get<fixed_bitstring<32> >().to_string());
      break;
    case types::ipv6_r13:
      j.write_str("ipv6-r13", c.get<fixed_bitstring<128> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "ip_address_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE ip_address_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ipv4_r13:
      HANDLE_CODE(c.get<fixed_bitstring<32> >().pack(bref));
      break;
    case types::ipv6_r13:
      HANDLE_CODE(c.get<fixed_bitstring<128> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ip_address_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ip_address_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ipv4_r13:
      HANDLE_CODE(c.get<fixed_bitstring<32> >().unpack(bref));
      break;
    case types::ipv6_r13:
      HANDLE_CODE(c.get<fixed_bitstring<128> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ip_address_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PhysicalConfigDedicated-v1370 ::= SEQUENCE
SRSASN_CODE phys_cfg_ded_v1370_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pucch_cfg_ded_v1370_present, 1));

  if (pucch_cfg_ded_v1370_present) {
    HANDLE_CODE(pucch_cfg_ded_v1370.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phys_cfg_ded_v1370_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pucch_cfg_ded_v1370_present, 1));

  if (pucch_cfg_ded_v1370_present) {
    HANDLE_CODE(pucch_cfg_ded_v1370.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void phys_cfg_ded_v1370_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pucch_cfg_ded_v1370_present) {
    j.write_fieldname("pucch-ConfigDedicated-v1370");
    pucch_cfg_ded_v1370.to_json(j);
  }
  j.end_obj();
}

// RAN-AreaConfig-r15 ::= SEQUENCE
SRSASN_CODE ran_area_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ran_area_code_list_r15_present, 1));

  HANDLE_CODE(tac_minus5_gc_r15.pack(bref));
  if (ran_area_code_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, ran_area_code_list_r15, 1, 32, integer_packer<uint16_t>(0, 255)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ran_area_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ran_area_code_list_r15_present, 1));

  HANDLE_CODE(tac_minus5_gc_r15.unpack(bref));
  if (ran_area_code_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(ran_area_code_list_r15, bref, 1, 32, integer_packer<uint16_t>(0, 255)));
  }

  return SRSASN_SUCCESS;
}
void ran_area_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("trackingAreaCode-5GC-r15", tac_minus5_gc_r15.to_string());
  if (ran_area_code_list_r15_present) {
    j.start_array("ran-AreaCodeList-r15");
    for (const auto& e1 : ran_area_code_list_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.end_obj();
}

// RadioResourceConfigCommonSCell-v10l0 ::= SEQUENCE
SRSASN_CODE rr_cfg_common_scell_v10l0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, ul_cfg_v10l0.add_spec_emission_scell_v10l0, (uint16_t)33u, (uint16_t)288u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_common_scell_v10l0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(ul_cfg_v10l0.add_spec_emission_scell_v10l0, bref, (uint16_t)33u, (uint16_t)288u));

  return SRSASN_SUCCESS;
}
void rr_cfg_common_scell_v10l0_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ul-Configuration-v10l0");
  j.start_obj();
  j.write_int("additionalSpectrumEmissionSCell-v10l0", ul_cfg_v10l0.add_spec_emission_scell_v10l0);
  j.end_obj();
  j.end_obj();
}

// RadioResourceConfigCommonSCell-v1440 ::= SEQUENCE
SRSASN_CODE rr_cfg_common_scell_v1440_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(
      pack_integer(bref, ul_cfg_v1440.ul_freq_info_v1440.add_spec_emission_scell_v1440, (uint16_t)33u, (uint16_t)288u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_common_scell_v1440_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(
      ul_cfg_v1440.ul_freq_info_v1440.add_spec_emission_scell_v1440, bref, (uint16_t)33u, (uint16_t)288u));

  return SRSASN_SUCCESS;
}
void rr_cfg_common_scell_v1440_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ul-Configuration-v1440");
  j.start_obj();
  j.write_fieldname("ul-FreqInfo-v1440");
  j.start_obj();
  j.write_int("additionalSpectrumEmissionSCell-v1440", ul_cfg_v1440.ul_freq_info_v1440.add_spec_emission_scell_v1440);
  j.end_obj();
  j.end_obj();
  j.end_obj();
}

// SL-DiscTxConfigScheduled-r13 ::= SEQUENCE
SRSASN_CODE sl_disc_tx_cfg_sched_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(disc_tx_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tf_idx_list_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_hop_cfg_r13_present, 1));

  if (disc_tx_cfg_r13_present) {
    HANDLE_CODE(disc_tx_cfg_r13.pack(bref));
  }
  if (disc_tf_idx_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_tf_idx_list_r13, 1, 64));
  }
  if (disc_hop_cfg_r13_present) {
    HANDLE_CODE(disc_hop_cfg_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_cfg_sched_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(disc_tx_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tf_idx_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_hop_cfg_r13_present, 1));

  if (disc_tx_cfg_r13_present) {
    HANDLE_CODE(disc_tx_cfg_r13.unpack(bref));
  }
  if (disc_tf_idx_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_tf_idx_list_r13, bref, 1, 64));
  }
  if (disc_hop_cfg_r13_present) {
    HANDLE_CODE(disc_hop_cfg_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_disc_tx_cfg_sched_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (disc_tx_cfg_r13_present) {
    j.write_fieldname("discTxConfig-r13");
    disc_tx_cfg_r13.to_json(j);
  }
  if (disc_tf_idx_list_r13_present) {
    j.start_array("discTF-IndexList-r13");
    for (const auto& e1 : disc_tf_idx_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_hop_cfg_r13_present) {
    j.write_fieldname("discHoppingConfig-r13");
    disc_hop_cfg_r13.to_json(j);
  }
  j.end_obj();
}

// SL-DiscTxPoolDedicated-r13 ::= SEQUENCE
SRSASN_CODE sl_disc_tx_pool_ded_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pool_to_release_list_r13_present, 1));
  HANDLE_CODE(bref.pack(pool_to_add_mod_list_r13_present, 1));

  if (pool_to_release_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, pool_to_release_list_r13, 1, 4, integer_packer<uint8_t>(1, 4)));
  }
  if (pool_to_add_mod_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, pool_to_add_mod_list_r13, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_pool_ded_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pool_to_release_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(pool_to_add_mod_list_r13_present, 1));

  if (pool_to_release_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(pool_to_release_list_r13, bref, 1, 4, integer_packer<uint8_t>(1, 4)));
  }
  if (pool_to_add_mod_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(pool_to_add_mod_list_r13, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void sl_disc_tx_pool_ded_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pool_to_release_list_r13_present) {
    j.start_array("poolToReleaseList-r13");
    for (const auto& e1 : pool_to_release_list_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (pool_to_add_mod_list_r13_present) {
    j.start_array("poolToAddModList-r13");
    for (const auto& e1 : pool_to_add_mod_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SL-TxPoolToAddMod-r14 ::= SEQUENCE
SRSASN_CODE sl_tx_pool_to_add_mod_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, pool_id_r14, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(pool_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_tx_pool_to_add_mod_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(pool_id_r14, bref, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(pool_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_tx_pool_to_add_mod_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("poolIdentity-r14", pool_id_r14);
  j.write_fieldname("pool-r14");
  pool_r14.to_json(j);
  j.end_obj();
}

// SecurityConfigHO-v1530 ::= SEQUENCE
SRSASN_CODE security_cfg_ho_v1530_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(handov_type_v1530.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE security_cfg_ho_v1530_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(handov_type_v1530.unpack(bref));

  return SRSASN_SUCCESS;
}
void security_cfg_ho_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("handoverType-v1530");
  handov_type_v1530.to_json(j);
  j.end_obj();
}

void security_cfg_ho_v1530_s::handov_type_v1530_c_::destroy_()
{
  switch (type_) {
    case types::intra5_gc_r15:
      c.destroy<intra5_gc_r15_s_>();
      break;
    case types::ngc_to_epc_r15:
      c.destroy<ngc_to_epc_r15_s_>();
      break;
    case types::epc_to_ngc_r15:
      c.destroy<epc_to_ngc_r15_s_>();
      break;
    default:
      break;
  }
}
void security_cfg_ho_v1530_s::handov_type_v1530_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::intra5_gc_r15:
      c.init<intra5_gc_r15_s_>();
      break;
    case types::ngc_to_epc_r15:
      c.init<ngc_to_epc_r15_s_>();
      break;
    case types::epc_to_ngc_r15:
      c.init<epc_to_ngc_r15_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_v1530_s::handov_type_v1530_c_");
  }
}
security_cfg_ho_v1530_s::handov_type_v1530_c_::handov_type_v1530_c_(
    const security_cfg_ho_v1530_s::handov_type_v1530_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::intra5_gc_r15:
      c.init(other.c.get<intra5_gc_r15_s_>());
      break;
    case types::ngc_to_epc_r15:
      c.init(other.c.get<ngc_to_epc_r15_s_>());
      break;
    case types::epc_to_ngc_r15:
      c.init(other.c.get<epc_to_ngc_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_v1530_s::handov_type_v1530_c_");
  }
}
security_cfg_ho_v1530_s::handov_type_v1530_c_& security_cfg_ho_v1530_s::handov_type_v1530_c_::
                                               operator=(const security_cfg_ho_v1530_s::handov_type_v1530_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::intra5_gc_r15:
      c.set(other.c.get<intra5_gc_r15_s_>());
      break;
    case types::ngc_to_epc_r15:
      c.set(other.c.get<ngc_to_epc_r15_s_>());
      break;
    case types::epc_to_ngc_r15:
      c.set(other.c.get<epc_to_ngc_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_v1530_s::handov_type_v1530_c_");
  }

  return *this;
}
void security_cfg_ho_v1530_s::handov_type_v1530_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::intra5_gc_r15:
      j.write_fieldname("intra5GC-r15");
      j.start_obj();
      if (c.get<intra5_gc_r15_s_>().security_algorithm_cfg_r15_present) {
        j.write_fieldname("securityAlgorithmConfig-r15");
        c.get<intra5_gc_r15_s_>().security_algorithm_cfg_r15.to_json(j);
      }
      j.write_bool("keyChangeIndicator-r15", c.get<intra5_gc_r15_s_>().key_change_ind_r15);
      j.write_int("nextHopChainingCount-r15", c.get<intra5_gc_r15_s_>().next_hop_chaining_count_r15);
      if (c.get<intra5_gc_r15_s_>().nas_container_r15_present) {
        j.write_str("nas-Container-r15", c.get<intra5_gc_r15_s_>().nas_container_r15.to_string());
      }
      j.end_obj();
      break;
    case types::ngc_to_epc_r15:
      j.write_fieldname("ngc-ToEPC-r15");
      j.start_obj();
      j.write_fieldname("securityAlgorithmConfig-r15");
      c.get<ngc_to_epc_r15_s_>().security_algorithm_cfg_r15.to_json(j);
      j.write_int("nextHopChainingCount-r15", c.get<ngc_to_epc_r15_s_>().next_hop_chaining_count_r15);
      j.end_obj();
      break;
    case types::epc_to_ngc_r15:
      j.write_fieldname("epc-ToNGC-r15");
      j.start_obj();
      j.write_fieldname("securityAlgorithmConfig-r15");
      c.get<epc_to_ngc_r15_s_>().security_algorithm_cfg_r15.to_json(j);
      j.write_str("nas-Container-r15", c.get<epc_to_ngc_r15_s_>().nas_container_r15.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_v1530_s::handov_type_v1530_c_");
  }
  j.end_obj();
}
SRSASN_CODE security_cfg_ho_v1530_s::handov_type_v1530_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::intra5_gc_r15:
      HANDLE_CODE(bref.pack(c.get<intra5_gc_r15_s_>().security_algorithm_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.get<intra5_gc_r15_s_>().nas_container_r15_present, 1));
      if (c.get<intra5_gc_r15_s_>().security_algorithm_cfg_r15_present) {
        HANDLE_CODE(c.get<intra5_gc_r15_s_>().security_algorithm_cfg_r15.pack(bref));
      }
      HANDLE_CODE(bref.pack(c.get<intra5_gc_r15_s_>().key_change_ind_r15, 1));
      HANDLE_CODE(pack_integer(bref, c.get<intra5_gc_r15_s_>().next_hop_chaining_count_r15, (uint8_t)0u, (uint8_t)7u));
      if (c.get<intra5_gc_r15_s_>().nas_container_r15_present) {
        HANDLE_CODE(c.get<intra5_gc_r15_s_>().nas_container_r15.pack(bref));
      }
      break;
    case types::ngc_to_epc_r15:
      HANDLE_CODE(c.get<ngc_to_epc_r15_s_>().security_algorithm_cfg_r15.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.get<ngc_to_epc_r15_s_>().next_hop_chaining_count_r15, (uint8_t)0u, (uint8_t)7u));
      break;
    case types::epc_to_ngc_r15:
      HANDLE_CODE(c.get<epc_to_ngc_r15_s_>().security_algorithm_cfg_r15.pack(bref));
      HANDLE_CODE(c.get<epc_to_ngc_r15_s_>().nas_container_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_v1530_s::handov_type_v1530_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE security_cfg_ho_v1530_s::handov_type_v1530_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::intra5_gc_r15:
      HANDLE_CODE(bref.unpack(c.get<intra5_gc_r15_s_>().security_algorithm_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.get<intra5_gc_r15_s_>().nas_container_r15_present, 1));
      if (c.get<intra5_gc_r15_s_>().security_algorithm_cfg_r15_present) {
        HANDLE_CODE(c.get<intra5_gc_r15_s_>().security_algorithm_cfg_r15.unpack(bref));
      }
      HANDLE_CODE(bref.unpack(c.get<intra5_gc_r15_s_>().key_change_ind_r15, 1));
      HANDLE_CODE(
          unpack_integer(c.get<intra5_gc_r15_s_>().next_hop_chaining_count_r15, bref, (uint8_t)0u, (uint8_t)7u));
      if (c.get<intra5_gc_r15_s_>().nas_container_r15_present) {
        HANDLE_CODE(c.get<intra5_gc_r15_s_>().nas_container_r15.unpack(bref));
      }
      break;
    case types::ngc_to_epc_r15:
      HANDLE_CODE(c.get<ngc_to_epc_r15_s_>().security_algorithm_cfg_r15.unpack(bref));
      HANDLE_CODE(
          unpack_integer(c.get<ngc_to_epc_r15_s_>().next_hop_chaining_count_r15, bref, (uint8_t)0u, (uint8_t)7u));
      break;
    case types::epc_to_ngc_r15:
      HANDLE_CODE(c.get<epc_to_ngc_r15_s_>().security_algorithm_cfg_r15.unpack(bref));
      HANDLE_CODE(c.get<epc_to_ngc_r15_s_>().nas_container_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_v1530_s::handov_type_v1530_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// 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();
}

// UplinkPowerControlCommonPSCell-r12 ::= SEQUENCE
SRSASN_CODE ul_pwr_ctrl_common_ps_cell_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(delta_f_pucch_format3_r12.pack(bref));
  HANDLE_CODE(delta_f_pucch_format1b_cs_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, p0_nominal_pucch_r12, (int8_t)-127, (int8_t)-96));
  HANDLE_CODE(delta_flist_pucch_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pwr_ctrl_common_ps_cell_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(delta_f_pucch_format3_r12.unpack(bref));
  HANDLE_CODE(delta_f_pucch_format1b_cs_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(p0_nominal_pucch_r12, bref, (int8_t)-127, (int8_t)-96));
  HANDLE_CODE(delta_flist_pucch_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_pwr_ctrl_common_ps_cell_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("deltaF-PUCCH-Format3-r12", delta_f_pucch_format3_r12.to_string());
  j.write_str("deltaF-PUCCH-Format1bCS-r12", delta_f_pucch_format1b_cs_r12.to_string());
  j.write_int("p0-NominalPUCCH-r12", p0_nominal_pucch_r12);
  j.write_fieldname("deltaFList-PUCCH-r12");
  delta_flist_pucch_r12.to_json(j);
  j.end_obj();
}

// WLAN-SuspendConfig-r14 ::= SEQUENCE
SRSASN_CODE wlan_suspend_cfg_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(wlan_suspend_resume_allowed_r14_present, 1));
  HANDLE_CODE(bref.pack(wlan_suspend_triggers_status_report_r14_present, 1));

  if (wlan_suspend_resume_allowed_r14_present) {
    HANDLE_CODE(bref.pack(wlan_suspend_resume_allowed_r14, 1));
  }
  if (wlan_suspend_triggers_status_report_r14_present) {
    HANDLE_CODE(bref.pack(wlan_suspend_triggers_status_report_r14, 1));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_suspend_cfg_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(wlan_suspend_resume_allowed_r14_present, 1));
  HANDLE_CODE(bref.unpack(wlan_suspend_triggers_status_report_r14_present, 1));

  if (wlan_suspend_resume_allowed_r14_present) {
    HANDLE_CODE(bref.unpack(wlan_suspend_resume_allowed_r14, 1));
  }
  if (wlan_suspend_triggers_status_report_r14_present) {
    HANDLE_CODE(bref.unpack(wlan_suspend_triggers_status_report_r14, 1));
  }

  return SRSASN_SUCCESS;
}
void wlan_suspend_cfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (wlan_suspend_resume_allowed_r14_present) {
    j.write_bool("wlan-SuspendResumeAllowed-r14", wlan_suspend_resume_allowed_r14);
  }
  if (wlan_suspend_triggers_status_report_r14_present) {
    j.write_bool("wlan-SuspendTriggersStatusReport-r14", wlan_suspend_triggers_status_report_r14);
  }
  j.end_obj();
}

// MAC-MainConfigSL-r12 ::= SEQUENCE
SRSASN_CODE mac_main_cfg_sl_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(periodic_bsr_timer_sl_present, 1));

  if (periodic_bsr_timer_sl_present) {
    HANDLE_CODE(periodic_bsr_timer_sl.pack(bref));
  }
  HANDLE_CODE(retx_bsr_timer_sl.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_main_cfg_sl_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(periodic_bsr_timer_sl_present, 1));

  if (periodic_bsr_timer_sl_present) {
    HANDLE_CODE(periodic_bsr_timer_sl.unpack(bref));
  }
  HANDLE_CODE(retx_bsr_timer_sl.unpack(bref));

  return SRSASN_SUCCESS;
}
void mac_main_cfg_sl_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (periodic_bsr_timer_sl_present) {
    j.write_str("periodic-BSR-TimerSL", periodic_bsr_timer_sl.to_string());
  }
  j.write_str("retx-BSR-TimerSL", retx_bsr_timer_sl.to_string());
  j.end_obj();
}

// PLMN-RAN-AreaCell-r15 ::= SEQUENCE
SRSASN_CODE plmn_ran_area_cell_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(plmn_id_r15_present, 1));

  if (plmn_id_r15_present) {
    HANDLE_CODE(plmn_id_r15.pack(bref));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, ran_area_cells_r15, 1, 32));

  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_ran_area_cell_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(plmn_id_r15_present, 1));

  if (plmn_id_r15_present) {
    HANDLE_CODE(plmn_id_r15.unpack(bref));
  }
  HANDLE_CODE(unpack_dyn_seq_of(ran_area_cells_r15, bref, 1, 32));

  return SRSASN_SUCCESS;
}
void plmn_ran_area_cell_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (plmn_id_r15_present) {
    j.write_fieldname("plmn-Identity-r15");
    plmn_id_r15.to_json(j);
  }
  j.start_array("ran-AreaCells-r15");
  for (const auto& e1 : ran_area_cells_r15) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.end_obj();
}

// PLMN-RAN-AreaConfig-r15 ::= SEQUENCE
SRSASN_CODE plmn_ran_area_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(plmn_id_r15_present, 1));

  if (plmn_id_r15_present) {
    HANDLE_CODE(plmn_id_r15.pack(bref));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, ran_area_r15, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_ran_area_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(plmn_id_r15_present, 1));

  if (plmn_id_r15_present) {
    HANDLE_CODE(plmn_id_r15.unpack(bref));
  }
  HANDLE_CODE(unpack_dyn_seq_of(ran_area_r15, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void plmn_ran_area_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (plmn_id_r15_present) {
    j.write_fieldname("plmn-Identity-r15");
    plmn_id_r15.to_json(j);
  }
  j.start_array("ran-Area-r15");
  for (const auto& e1 : ran_area_r15) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// RACH-ConfigDedicated ::= SEQUENCE
SRSASN_CODE rach_cfg_ded_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, ra_preamb_idx, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(pack_integer(bref, ra_prach_mask_idx, (uint8_t)0u, (uint8_t)15u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rach_cfg_ded_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(ra_preamb_idx, bref, (uint8_t)0u, (uint8_t)63u));
  HANDLE_CODE(unpack_integer(ra_prach_mask_idx, bref, (uint8_t)0u, (uint8_t)15u));

  return SRSASN_SUCCESS;
}
void rach_cfg_ded_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("ra-PreambleIndex", ra_preamb_idx);
  j.write_int("ra-PRACH-MaskIndex", ra_prach_mask_idx);
  j.end_obj();
}

// RACH-Skip-r14 ::= SEQUENCE
SRSASN_CODE rach_skip_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_cfg_info_r14_present, 1));

  HANDLE_CODE(target_ta_r14.pack(bref));
  if (ul_cfg_info_r14_present) {
    HANDLE_CODE(pack_integer(bref, ul_cfg_info_r14.nof_conf_ul_processes_r14, (uint8_t)1u, (uint8_t)8u));
    HANDLE_CODE(ul_cfg_info_r14.ul_sched_interv_r14.pack(bref));
    HANDLE_CODE(pack_integer(bref, ul_cfg_info_r14.ul_start_sf_r14, (uint8_t)0u, (uint8_t)9u));
    HANDLE_CODE(ul_cfg_info_r14.ul_grant_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rach_skip_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_cfg_info_r14_present, 1));

  HANDLE_CODE(target_ta_r14.unpack(bref));
  if (ul_cfg_info_r14_present) {
    HANDLE_CODE(unpack_integer(ul_cfg_info_r14.nof_conf_ul_processes_r14, bref, (uint8_t)1u, (uint8_t)8u));
    HANDLE_CODE(ul_cfg_info_r14.ul_sched_interv_r14.unpack(bref));
    HANDLE_CODE(unpack_integer(ul_cfg_info_r14.ul_start_sf_r14, bref, (uint8_t)0u, (uint8_t)9u));
    HANDLE_CODE(ul_cfg_info_r14.ul_grant_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rach_skip_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("targetTA-r14");
  target_ta_r14.to_json(j);
  if (ul_cfg_info_r14_present) {
    j.write_fieldname("ul-ConfigInfo-r14");
    j.start_obj();
    j.write_int("numberOfConfUL-Processes-r14", ul_cfg_info_r14.nof_conf_ul_processes_r14);
    j.write_str("ul-SchedInterval-r14", ul_cfg_info_r14.ul_sched_interv_r14.to_string());
    j.write_int("ul-StartSubframe-r14", ul_cfg_info_r14.ul_start_sf_r14);
    j.write_str("ul-Grant-r14", ul_cfg_info_r14.ul_grant_r14.to_string());
    j.end_obj();
  }
  j.end_obj();
}

void rach_skip_r14_s::target_ta_r14_c_::destroy_() {}
void rach_skip_r14_s::target_ta_r14_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
rach_skip_r14_s::target_ta_r14_c_::target_ta_r14_c_(const rach_skip_r14_s::target_ta_r14_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ta0_r14:
      break;
    case types::mcg_ptag_r14:
      break;
    case types::scg_ptag_r14:
      break;
    case types::mcg_stag_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::scg_stag_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rach_skip_r14_s::target_ta_r14_c_");
  }
}
rach_skip_r14_s::target_ta_r14_c_& rach_skip_r14_s::target_ta_r14_c_::
                                   operator=(const rach_skip_r14_s::target_ta_r14_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ta0_r14:
      break;
    case types::mcg_ptag_r14:
      break;
    case types::scg_ptag_r14:
      break;
    case types::mcg_stag_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::scg_stag_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rach_skip_r14_s::target_ta_r14_c_");
  }

  return *this;
}
void rach_skip_r14_s::target_ta_r14_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ta0_r14:
      break;
    case types::mcg_ptag_r14:
      break;
    case types::scg_ptag_r14:
      break;
    case types::mcg_stag_r14:
      j.write_int("mcg-STAG-r14", c.get<uint8_t>());
      break;
    case types::scg_stag_r14:
      j.write_int("scg-STAG-r14", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "rach_skip_r14_s::target_ta_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE rach_skip_r14_s::target_ta_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ta0_r14:
      break;
    case types::mcg_ptag_r14:
      break;
    case types::scg_ptag_r14:
      break;
    case types::mcg_stag_r14:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)3u));
      break;
    case types::scg_stag_r14:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)3u));
      break;
    default:
      log_invalid_choice_id(type_, "rach_skip_r14_s::target_ta_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rach_skip_r14_s::target_ta_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ta0_r14:
      break;
    case types::mcg_ptag_r14:
      break;
    case types::scg_ptag_r14:
      break;
    case types::mcg_stag_r14:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)3u));
      break;
    case types::scg_stag_r14:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)3u));
      break;
    default:
      log_invalid_choice_id(type_, "rach_skip_r14_s::target_ta_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RLF-TimersAndConstantsSCG-r12 ::= CHOICE
void rlf_timers_and_consts_scg_r12_c::set(types::options e)
{
  type_ = e;
}
void rlf_timers_and_consts_scg_r12_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("t313-r12", c.t313_r12.to_string());
      j.write_str("n313-r12", c.n313_r12.to_string());
      j.write_str("n314-r12", c.n314_r12.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_scg_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE rlf_timers_and_consts_scg_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(c.t313_r12.pack(bref));
      HANDLE_CODE(c.n313_r12.pack(bref));
      HANDLE_CODE(c.n314_r12.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_scg_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlf_timers_and_consts_scg_r12_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(c.t313_r12.unpack(bref));
      HANDLE_CODE(c.n313_r12.unpack(bref));
      HANDLE_CODE(c.n314_r12.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_timers_and_consts_scg_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReconfiguration-v1530-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(security_cfg_ho_v1530_present, 1));
  HANDLE_CODE(bref.pack(scell_group_to_release_list_r15_present, 1));
  HANDLE_CODE(bref.pack(scell_group_to_add_mod_list_r15_present, 1));
  HANDLE_CODE(bref.pack(ded_info_nas_list_r15_present, 1));
  HANDLE_CODE(bref.pack(p_max_ue_fr1_r15_present, 1));
  HANDLE_CODE(bref.pack(smtc_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (security_cfg_ho_v1530_present) {
    HANDLE_CODE(security_cfg_ho_v1530.pack(bref));
  }
  if (scell_group_to_release_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_group_to_release_list_r15, 1, 4, integer_packer<uint8_t>(1, 4)));
  }
  if (scell_group_to_add_mod_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_group_to_add_mod_list_r15, 1, 4));
  }
  if (ded_info_nas_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, ded_info_nas_list_r15, 1, 15));
  }
  if (p_max_ue_fr1_r15_present) {
    HANDLE_CODE(pack_integer(bref, p_max_ue_fr1_r15, (int8_t)-30, (int8_t)33));
  }
  if (smtc_r15_present) {
    HANDLE_CODE(smtc_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(security_cfg_ho_v1530_present, 1));
  HANDLE_CODE(bref.unpack(scell_group_to_release_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(scell_group_to_add_mod_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(ded_info_nas_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(p_max_ue_fr1_r15_present, 1));
  HANDLE_CODE(bref.unpack(smtc_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (security_cfg_ho_v1530_present) {
    HANDLE_CODE(security_cfg_ho_v1530.unpack(bref));
  }
  if (scell_group_to_release_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_group_to_release_list_r15, bref, 1, 4, integer_packer<uint8_t>(1, 4)));
  }
  if (scell_group_to_add_mod_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_group_to_add_mod_list_r15, bref, 1, 4));
  }
  if (ded_info_nas_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(ded_info_nas_list_r15, bref, 1, 15));
  }
  if (p_max_ue_fr1_r15_present) {
    HANDLE_CODE(unpack_integer(p_max_ue_fr1_r15, bref, (int8_t)-30, (int8_t)33));
  }
  if (smtc_r15_present) {
    HANDLE_CODE(smtc_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (security_cfg_ho_v1530_present) {
    j.write_fieldname("securityConfigHO-v1530");
    security_cfg_ho_v1530.to_json(j);
  }
  if (scell_group_to_release_list_r15_present) {
    j.start_array("sCellGroupToReleaseList-r15");
    for (const auto& e1 : scell_group_to_release_list_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (scell_group_to_add_mod_list_r15_present) {
    j.start_array("sCellGroupToAddModList-r15");
    for (const auto& e1 : scell_group_to_add_mod_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (ded_info_nas_list_r15_present) {
    j.start_array("dedicatedInfoNASList-r15");
    for (const auto& e1 : ded_info_nas_list_r15) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (p_max_ue_fr1_r15_present) {
    j.write_int("p-MaxUE-FR1-r15", p_max_ue_fr1_r15);
  }
  if (smtc_r15_present) {
    j.write_fieldname("smtc-r15");
    smtc_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RadioResourceConfigCommonPSCell-r12 ::= SEQUENCE
SRSASN_CODE rr_cfg_common_ps_cell_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(basic_fields_r12.pack(bref));
  HANDLE_CODE(pucch_cfg_common_r12.pack(bref));
  HANDLE_CODE(rach_cfg_common_r12.pack(bref));
  HANDLE_CODE(ul_pwr_ctrl_common_ps_cell_r12.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= ul_pwr_ctrl_common_ps_cell_v1310.is_present();
    group_flags[1] |= ul_pwr_ctrl_common_ps_cell_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_ps_cell_v1310.is_present(), 1));
      if (ul_pwr_ctrl_common_ps_cell_v1310.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_ps_cell_v1310->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_ps_cell_v1530.is_present(), 1));
      if (ul_pwr_ctrl_common_ps_cell_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_ps_cell_v1530->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_common_ps_cell_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(basic_fields_r12.unpack(bref));
  HANDLE_CODE(pucch_cfg_common_r12.unpack(bref));
  HANDLE_CODE(rach_cfg_common_r12.unpack(bref));
  HANDLE_CODE(ul_pwr_ctrl_common_ps_cell_r12.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 ul_pwr_ctrl_common_ps_cell_v1310_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_ps_cell_v1310_present, 1));
      ul_pwr_ctrl_common_ps_cell_v1310.set_present(ul_pwr_ctrl_common_ps_cell_v1310_present);
      if (ul_pwr_ctrl_common_ps_cell_v1310.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_ps_cell_v1310->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ul_pwr_ctrl_common_ps_cell_v1530_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_ps_cell_v1530_present, 1));
      ul_pwr_ctrl_common_ps_cell_v1530.set_present(ul_pwr_ctrl_common_ps_cell_v1530_present);
      if (ul_pwr_ctrl_common_ps_cell_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_ps_cell_v1530->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rr_cfg_common_ps_cell_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("basicFields-r12");
  basic_fields_r12.to_json(j);
  j.write_fieldname("pucch-ConfigCommon-r12");
  pucch_cfg_common_r12.to_json(j);
  j.write_fieldname("rach-ConfigCommon-r12");
  rach_cfg_common_r12.to_json(j);
  j.write_fieldname("uplinkPowerControlCommonPSCell-r12");
  ul_pwr_ctrl_common_ps_cell_r12.to_json(j);
  if (ext) {
    if (ul_pwr_ctrl_common_ps_cell_v1310.is_present()) {
      j.write_fieldname("uplinkPowerControlCommonPSCell-v1310");
      ul_pwr_ctrl_common_ps_cell_v1310->to_json(j);
    }
    if (ul_pwr_ctrl_common_ps_cell_v1530.is_present()) {
      j.write_fieldname("uplinkPowerControlCommonPSCell-v1530");
      ul_pwr_ctrl_common_ps_cell_v1530->to_json(j);
    }
  }
  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
{
  HANDLE_CODE(basic_fields_v1440.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_common_ps_cell_v1440_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(basic_fields_v1440.unpack(bref));

  return SRSASN_SUCCESS;
}
void rr_cfg_common_ps_cell_v1440_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("basicFields-v1440");
  basic_fields_v1440.to_json(j);
  j.end_obj();
}

// RadioResourceConfigDedicatedPSCell-r12 ::= SEQUENCE
SRSASN_CODE rr_cfg_ded_ps_cell_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(phys_cfg_ded_ps_cell_r12_present, 1));
  HANDLE_CODE(bref.pack(sps_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(naics_info_r12_present, 1));

  if (phys_cfg_ded_ps_cell_r12_present) {
    HANDLE_CODE(phys_cfg_ded_ps_cell_r12.pack(bref));
  }
  if (sps_cfg_r12_present) {
    HANDLE_CODE(sps_cfg_r12.pack(bref));
  }
  if (naics_info_r12_present) {
    HANDLE_CODE(naics_info_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= neigh_cells_crs_info_ps_cell_r13.is_present();
    group_flags[1] |= sps_cfg_v1430.is_present();
    group_flags[2] |= sps_cfg_v1530.is_present();
    group_flags[2] |= crs_intf_mitig_enabled_r15_present;
    group_flags[2] |= neigh_cells_crs_info_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(neigh_cells_crs_info_ps_cell_r13.is_present(), 1));
      if (neigh_cells_crs_info_ps_cell_r13.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_ps_cell_r13->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sps_cfg_v1430.is_present(), 1));
      if (sps_cfg_v1430.is_present()) {
        HANDLE_CODE(sps_cfg_v1430->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sps_cfg_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(crs_intf_mitig_enabled_r15_present, 1));
      HANDLE_CODE(bref.pack(neigh_cells_crs_info_r15.is_present(), 1));
      if (sps_cfg_v1530.is_present()) {
        HANDLE_CODE(sps_cfg_v1530->pack(bref));
      }
      if (crs_intf_mitig_enabled_r15_present) {
        HANDLE_CODE(bref.pack(crs_intf_mitig_enabled_r15, 1));
      }
      if (neigh_cells_crs_info_r15.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_ded_ps_cell_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(phys_cfg_ded_ps_cell_r12_present, 1));
  HANDLE_CODE(bref.unpack(sps_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(naics_info_r12_present, 1));

  if (phys_cfg_ded_ps_cell_r12_present) {
    HANDLE_CODE(phys_cfg_ded_ps_cell_r12.unpack(bref));
  }
  if (sps_cfg_r12_present) {
    HANDLE_CODE(sps_cfg_r12.unpack(bref));
  }
  if (naics_info_r12_present) {
    HANDLE_CODE(naics_info_r12.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool neigh_cells_crs_info_ps_cell_r13_present;
      HANDLE_CODE(bref.unpack(neigh_cells_crs_info_ps_cell_r13_present, 1));
      neigh_cells_crs_info_ps_cell_r13.set_present(neigh_cells_crs_info_ps_cell_r13_present);
      if (neigh_cells_crs_info_ps_cell_r13.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_ps_cell_r13->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool sps_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(sps_cfg_v1430_present, 1));
      sps_cfg_v1430.set_present(sps_cfg_v1430_present);
      if (sps_cfg_v1430.is_present()) {
        HANDLE_CODE(sps_cfg_v1430->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool sps_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(sps_cfg_v1530_present, 1));
      sps_cfg_v1530.set_present(sps_cfg_v1530_present);
      HANDLE_CODE(bref.unpack(crs_intf_mitig_enabled_r15_present, 1));
      bool neigh_cells_crs_info_r15_present;
      HANDLE_CODE(bref.unpack(neigh_cells_crs_info_r15_present, 1));
      neigh_cells_crs_info_r15.set_present(neigh_cells_crs_info_r15_present);
      if (sps_cfg_v1530.is_present()) {
        HANDLE_CODE(sps_cfg_v1530->unpack(bref));
      }
      if (crs_intf_mitig_enabled_r15_present) {
        HANDLE_CODE(bref.unpack(crs_intf_mitig_enabled_r15, 1));
      }
      if (neigh_cells_crs_info_r15.is_present()) {
        HANDLE_CODE(neigh_cells_crs_info_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rr_cfg_ded_ps_cell_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phys_cfg_ded_ps_cell_r12_present) {
    j.write_fieldname("physicalConfigDedicatedPSCell-r12");
    phys_cfg_ded_ps_cell_r12.to_json(j);
  }
  if (sps_cfg_r12_present) {
    j.write_fieldname("sps-Config-r12");
    sps_cfg_r12.to_json(j);
  }
  if (naics_info_r12_present) {
    j.write_fieldname("naics-Info-r12");
    naics_info_r12.to_json(j);
  }
  if (ext) {
    if (neigh_cells_crs_info_ps_cell_r13.is_present()) {
      j.write_fieldname("neighCellsCRS-InfoPSCell-r13");
      neigh_cells_crs_info_ps_cell_r13->to_json(j);
    }
    if (sps_cfg_v1430.is_present()) {
      j.write_fieldname("sps-Config-v1430");
      sps_cfg_v1430->to_json(j);
    }
    if (sps_cfg_v1530.is_present()) {
      j.write_fieldname("sps-Config-v1530");
      sps_cfg_v1530->to_json(j);
    }
    if (crs_intf_mitig_enabled_r15_present) {
      j.write_bool("crs-IntfMitigEnabled-r15", crs_intf_mitig_enabled_r15);
    }
    if (neigh_cells_crs_info_r15.is_present()) {
      j.write_fieldname("neighCellsCRS-Info-r15");
      neigh_cells_crs_info_r15->to_json(j);
    }
  }
  j.end_obj();
}

// RadioResourceConfigDedicatedPSCell-v1370 ::= SEQUENCE
SRSASN_CODE rr_cfg_ded_ps_cell_v1370_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(phys_cfg_ded_ps_cell_v1370_present, 1));

  if (phys_cfg_ded_ps_cell_v1370_present) {
    HANDLE_CODE(phys_cfg_ded_ps_cell_v1370.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_ded_ps_cell_v1370_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phys_cfg_ded_ps_cell_v1370_present, 1));

  if (phys_cfg_ded_ps_cell_v1370_present) {
    HANDLE_CODE(phys_cfg_ded_ps_cell_v1370.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rr_cfg_ded_ps_cell_v1370_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phys_cfg_ded_ps_cell_v1370_present) {
    j.write_fieldname("physicalConfigDedicatedPSCell-v1370");
    phys_cfg_ded_ps_cell_v1370.to_json(j);
  }
  j.end_obj();
}

// SCellToAddMod-r10 ::= SEQUENCE
SRSASN_CODE scell_to_add_mod_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(cell_identif_r10_present, 1));
  HANDLE_CODE(bref.pack(rr_cfg_common_scell_r10_present, 1));
  HANDLE_CODE(bref.pack(rr_cfg_ded_scell_r10_present, 1));

  HANDLE_CODE(pack_integer(bref, scell_idx_r10, (uint8_t)1u, (uint8_t)7u));
  if (cell_identif_r10_present) {
    HANDLE_CODE(pack_integer(bref, cell_identif_r10.pci_r10, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(pack_integer(bref, cell_identif_r10.dl_carrier_freq_r10, (uint32_t)0u, (uint32_t)65535u));
  }
  if (rr_cfg_common_scell_r10_present) {
    HANDLE_CODE(rr_cfg_common_scell_r10.pack(bref));
  }
  if (rr_cfg_ded_scell_r10_present) {
    HANDLE_CODE(rr_cfg_ded_scell_r10.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= dl_carrier_freq_v1090_present;
    group_flags[1] |= ant_info_ded_scell_v10i0.is_present();
    group_flags[2] |= srs_switch_from_serv_cell_idx_r14_present;
    group_flags[3] |= scell_state_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(dl_carrier_freq_v1090_present, 1));
      if (dl_carrier_freq_v1090_present) {
        HANDLE_CODE(pack_integer(bref, dl_carrier_freq_v1090, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ant_info_ded_scell_v10i0.is_present(), 1));
      if (ant_info_ded_scell_v10i0.is_present()) {
        HANDLE_CODE(ant_info_ded_scell_v10i0->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(srs_switch_from_serv_cell_idx_r14_present, 1));
      if (srs_switch_from_serv_cell_idx_r14_present) {
        HANDLE_CODE(pack_integer(bref, srs_switch_from_serv_cell_idx_r14, (uint8_t)0u, (uint8_t)31u));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(scell_state_r15_present, 1));
      if (scell_state_r15_present) {
        HANDLE_CODE(scell_state_r15.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scell_to_add_mod_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(cell_identif_r10_present, 1));
  HANDLE_CODE(bref.unpack(rr_cfg_common_scell_r10_present, 1));
  HANDLE_CODE(bref.unpack(rr_cfg_ded_scell_r10_present, 1));

  HANDLE_CODE(unpack_integer(scell_idx_r10, bref, (uint8_t)1u, (uint8_t)7u));
  if (cell_identif_r10_present) {
    HANDLE_CODE(unpack_integer(cell_identif_r10.pci_r10, bref, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(unpack_integer(cell_identif_r10.dl_carrier_freq_r10, bref, (uint32_t)0u, (uint32_t)65535u));
  }
  if (rr_cfg_common_scell_r10_present) {
    HANDLE_CODE(rr_cfg_common_scell_r10.unpack(bref));
  }
  if (rr_cfg_ded_scell_r10_present) {
    HANDLE_CODE(rr_cfg_ded_scell_r10.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(dl_carrier_freq_v1090_present, 1));
      if (dl_carrier_freq_v1090_present) {
        HANDLE_CODE(unpack_integer(dl_carrier_freq_v1090, bref, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ant_info_ded_scell_v10i0_present;
      HANDLE_CODE(bref.unpack(ant_info_ded_scell_v10i0_present, 1));
      ant_info_ded_scell_v10i0.set_present(ant_info_ded_scell_v10i0_present);
      if (ant_info_ded_scell_v10i0.is_present()) {
        HANDLE_CODE(ant_info_ded_scell_v10i0->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(srs_switch_from_serv_cell_idx_r14_present, 1));
      if (srs_switch_from_serv_cell_idx_r14_present) {
        HANDLE_CODE(unpack_integer(srs_switch_from_serv_cell_idx_r14, bref, (uint8_t)0u, (uint8_t)31u));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(scell_state_r15_present, 1));
      if (scell_state_r15_present) {
        HANDLE_CODE(scell_state_r15.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void scell_to_add_mod_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sCellIndex-r10", scell_idx_r10);
  if (cell_identif_r10_present) {
    j.write_fieldname("cellIdentification-r10");
    j.start_obj();
    j.write_int("physCellId-r10", cell_identif_r10.pci_r10);
    j.write_int("dl-CarrierFreq-r10", cell_identif_r10.dl_carrier_freq_r10);
    j.end_obj();
  }
  if (rr_cfg_common_scell_r10_present) {
    j.write_fieldname("radioResourceConfigCommonSCell-r10");
    rr_cfg_common_scell_r10.to_json(j);
  }
  if (rr_cfg_ded_scell_r10_present) {
    j.write_fieldname("radioResourceConfigDedicatedSCell-r10");
    rr_cfg_ded_scell_r10.to_json(j);
  }
  if (ext) {
    if (dl_carrier_freq_v1090_present) {
      j.write_int("dl-CarrierFreq-v1090", dl_carrier_freq_v1090);
    }
    if (ant_info_ded_scell_v10i0.is_present()) {
      j.write_fieldname("antennaInfoDedicatedSCell-v10i0");
      ant_info_ded_scell_v10i0->to_json(j);
    }
    if (srs_switch_from_serv_cell_idx_r14_present) {
      j.write_int("srs-SwitchFromServCellIndex-r14", srs_switch_from_serv_cell_idx_r14);
    }
    if (scell_state_r15_present) {
      j.write_str("sCellState-r15", scell_state_r15.to_string());
    }
  }
  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();
}

// SCellToAddModExt-v1370 ::= SEQUENCE
SRSASN_CODE scell_to_add_mod_ext_v1370_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rr_cfg_common_scell_v1370_present, 1));

  if (rr_cfg_common_scell_v1370_present) {
    HANDLE_CODE(rr_cfg_common_scell_v1370.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scell_to_add_mod_ext_v1370_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rr_cfg_common_scell_v1370_present, 1));

  if (rr_cfg_common_scell_v1370_present) {
    HANDLE_CODE(rr_cfg_common_scell_v1370.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scell_to_add_mod_ext_v1370_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rr_cfg_common_scell_v1370_present) {
    j.write_fieldname("radioResourceConfigCommonSCell-v1370");
    rr_cfg_common_scell_v1370.to_json(j);
  }
  j.end_obj();
}

// SCellToAddModExt-v1430 ::= SEQUENCE
SRSASN_CODE scell_to_add_mod_ext_v1430_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(srs_switch_from_serv_cell_idx_r14_present, 1));

  if (srs_switch_from_serv_cell_idx_r14_present) {
    HANDLE_CODE(pack_integer(bref, srs_switch_from_serv_cell_idx_r14, (uint8_t)0u, (uint8_t)31u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= scell_state_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(scell_state_r15_present, 1));
      if (scell_state_r15_present) {
        HANDLE_CODE(scell_state_r15.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scell_to_add_mod_ext_v1430_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(srs_switch_from_serv_cell_idx_r14_present, 1));

  if (srs_switch_from_serv_cell_idx_r14_present) {
    HANDLE_CODE(unpack_integer(srs_switch_from_serv_cell_idx_r14, bref, (uint8_t)0u, (uint8_t)31u));
  }

  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(scell_state_r15_present, 1));
      if (scell_state_r15_present) {
        HANDLE_CODE(scell_state_r15.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void scell_to_add_mod_ext_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (srs_switch_from_serv_cell_idx_r14_present) {
    j.write_int("srs-SwitchFromServCellIndex-r14", srs_switch_from_serv_cell_idx_r14);
  }
  if (ext) {
    if (scell_state_r15_present) {
      j.write_str("sCellState-r15", scell_state_r15.to_string());
    }
  }
  j.end_obj();
}

// SL-DiscTxRefCarrierDedicated-r13 ::= CHOICE
void sl_disc_tx_ref_carrier_ded_r13_c::set(types::options e)
{
  type_ = e;
}
void sl_disc_tx_ref_carrier_ded_r13_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::pcell:
      break;
    case types::scell:
      j.write_int("sCell", c);
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_ref_carrier_ded_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_tx_ref_carrier_ded_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::pcell:
      break;
    case types::scell:
      HANDLE_CODE(pack_integer(bref, c, (uint8_t)1u, (uint8_t)7u));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_ref_carrier_ded_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_ref_carrier_ded_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::pcell:
      break;
    case types::scell:
      HANDLE_CODE(unpack_integer(c, bref, (uint8_t)1u, (uint8_t)7u));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_ref_carrier_ded_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-DiscTxResource-r13 ::= CHOICE
void sl_disc_tx_res_r13_c::set(types::options e)
{
  type_ = e;
}
void sl_disc_tx_res_r13_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_tx_res_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_res_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_tx_res_r13_c::setup_c_::destroy_()
{
  switch (type_) {
    case types::sched_r13:
      c.destroy<sl_disc_tx_cfg_sched_r13_s>();
      break;
    case types::ue_sel_r13:
      c.destroy<sl_disc_tx_pool_ded_r13_s>();
      break;
    default:
      break;
  }
}
void sl_disc_tx_res_r13_c::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sched_r13:
      c.init<sl_disc_tx_cfg_sched_r13_s>();
      break;
    case types::ue_sel_r13:
      c.init<sl_disc_tx_pool_ded_r13_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c::setup_c_");
  }
}
sl_disc_tx_res_r13_c::setup_c_::setup_c_(const sl_disc_tx_res_r13_c::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sched_r13:
      c.init(other.c.get<sl_disc_tx_cfg_sched_r13_s>());
      break;
    case types::ue_sel_r13:
      c.init(other.c.get<sl_disc_tx_pool_ded_r13_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c::setup_c_");
  }
}
sl_disc_tx_res_r13_c::setup_c_& sl_disc_tx_res_r13_c::setup_c_::operator=(const sl_disc_tx_res_r13_c::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sched_r13:
      c.set(other.c.get<sl_disc_tx_cfg_sched_r13_s>());
      break;
    case types::ue_sel_r13:
      c.set(other.c.get<sl_disc_tx_pool_ded_r13_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c::setup_c_");
  }

  return *this;
}
void sl_disc_tx_res_r13_c::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sched_r13:
      j.write_fieldname("scheduled-r13");
      c.get<sl_disc_tx_cfg_sched_r13_s>().to_json(j);
      break;
    case types::ue_sel_r13:
      j.write_fieldname("ue-Selected-r13");
      c.get<sl_disc_tx_pool_ded_r13_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_tx_res_r13_c::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sched_r13:
      HANDLE_CODE(c.get<sl_disc_tx_cfg_sched_r13_s>().pack(bref));
      break;
    case types::ue_sel_r13:
      HANDLE_CODE(c.get<sl_disc_tx_pool_ded_r13_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_res_r13_c::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sched_r13:
      HANDLE_CODE(c.get<sl_disc_tx_cfg_sched_r13_s>().unpack(bref));
      break;
    case types::ue_sel_r13:
      HANDLE_CODE(c.get<sl_disc_tx_pool_ded_r13_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_tx_res_r13_c::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-GapPattern-r13 ::= SEQUENCE
SRSASN_CODE sl_gap_pattern_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(gap_period_r13.pack(bref));
  HANDLE_CODE(gap_offset_r12.pack(bref));
  HANDLE_CODE(gap_sf_bitmap_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_gap_pattern_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(gap_period_r13.unpack(bref));
  HANDLE_CODE(gap_offset_r12.unpack(bref));
  HANDLE_CODE(gap_sf_bitmap_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_gap_pattern_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("gapPeriod-r13", gap_period_r13.to_string());
  j.write_fieldname("gapOffset-r12");
  gap_offset_r12.to_json(j);
  j.write_str("gapSubframeBitmap-r13", gap_sf_bitmap_r13.to_string());
  j.end_obj();
}

// TunnelConfigLWIP-r13 ::= SEQUENCE
SRSASN_CODE tunnel_cfg_lwip_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(ip_address_r13.pack(bref));
  HANDLE_CODE(ike_id_r13.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= lwip_counter_r13_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(lwip_counter_r13_present, 1));
      if (lwip_counter_r13_present) {
        HANDLE_CODE(pack_integer(bref, lwip_counter_r13, (uint32_t)0u, (uint32_t)65535u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE tunnel_cfg_lwip_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(ip_address_r13.unpack(bref));
  HANDLE_CODE(ike_id_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);

      HANDLE_CODE(bref.unpack(lwip_counter_r13_present, 1));
      if (lwip_counter_r13_present) {
        HANDLE_CODE(unpack_integer(lwip_counter_r13, bref, (uint32_t)0u, (uint32_t)65535u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void tunnel_cfg_lwip_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ip-Address-r13");
  ip_address_r13.to_json(j);
  j.write_fieldname("ike-Identity-r13");
  ike_id_r13.to_json(j);
  if (ext) {
    if (lwip_counter_r13_present) {
      j.write_int("lwip-Counter-r13", lwip_counter_r13);
    }
  }
  j.end_obj();
}

// WLAN-MobilityConfig-r13 ::= SEQUENCE
SRSASN_CODE wlan_mob_cfg_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(wlan_to_release_list_r13_present, 1));
  HANDLE_CODE(bref.pack(wlan_to_add_list_r13_present, 1));
  HANDLE_CODE(bref.pack(assoc_timer_r13_present, 1));
  HANDLE_CODE(bref.pack(success_report_requested_r13_present, 1));

  if (wlan_to_release_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, wlan_to_release_list_r13, 1, 32));
  }
  if (wlan_to_add_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, wlan_to_add_list_r13, 1, 32));
  }
  if (assoc_timer_r13_present) {
    HANDLE_CODE(assoc_timer_r13.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= wlan_suspend_cfg_r14.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(wlan_suspend_cfg_r14.is_present(), 1));
      if (wlan_suspend_cfg_r14.is_present()) {
        HANDLE_CODE(wlan_suspend_cfg_r14->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_mob_cfg_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(wlan_to_release_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(wlan_to_add_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(assoc_timer_r13_present, 1));
  HANDLE_CODE(bref.unpack(success_report_requested_r13_present, 1));

  if (wlan_to_release_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(wlan_to_release_list_r13, bref, 1, 32));
  }
  if (wlan_to_add_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(wlan_to_add_list_r13, bref, 1, 32));
  }
  if (assoc_timer_r13_present) {
    HANDLE_CODE(assoc_timer_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 wlan_suspend_cfg_r14_present;
      HANDLE_CODE(bref.unpack(wlan_suspend_cfg_r14_present, 1));
      wlan_suspend_cfg_r14.set_present(wlan_suspend_cfg_r14_present);
      if (wlan_suspend_cfg_r14.is_present()) {
        HANDLE_CODE(wlan_suspend_cfg_r14->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void wlan_mob_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (wlan_to_release_list_r13_present) {
    j.start_array("wlan-ToReleaseList-r13");
    for (const auto& e1 : wlan_to_release_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (wlan_to_add_list_r13_present) {
    j.start_array("wlan-ToAddList-r13");
    for (const auto& e1 : wlan_to_add_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (assoc_timer_r13_present) {
    j.write_str("associationTimer-r13", assoc_timer_r13.to_string());
  }
  if (success_report_requested_r13_present) {
    j.write_str("successReportRequested-r13", "true");
  }
  if (ext) {
    if (wlan_suspend_cfg_r14.is_present()) {
      j.write_fieldname("wlan-SuspendConfig-r14");
      wlan_suspend_cfg_r14->to_json(j);
    }
  }
  j.end_obj();
}

// LWA-Config-r13 ::= SEQUENCE
SRSASN_CODE lwa_cfg_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(lwa_mob_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(lwa_wt_counter_r13_present, 1));

  if (lwa_mob_cfg_r13_present) {
    HANDLE_CODE(lwa_mob_cfg_r13.pack(bref));
  }
  if (lwa_wt_counter_r13_present) {
    HANDLE_CODE(pack_integer(bref, lwa_wt_counter_r13, (uint32_t)0u, (uint32_t)65535u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= wt_mac_address_r14_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(wt_mac_address_r14_present, 1));
      if (wt_mac_address_r14_present) {
        HANDLE_CODE(wt_mac_address_r14.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE lwa_cfg_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(lwa_mob_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(lwa_wt_counter_r13_present, 1));

  if (lwa_mob_cfg_r13_present) {
    HANDLE_CODE(lwa_mob_cfg_r13.unpack(bref));
  }
  if (lwa_wt_counter_r13_present) {
    HANDLE_CODE(unpack_integer(lwa_wt_counter_r13, bref, (uint32_t)0u, (uint32_t)65535u));
  }

  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(wt_mac_address_r14_present, 1));
      if (wt_mac_address_r14_present) {
        HANDLE_CODE(wt_mac_address_r14.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void lwa_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (lwa_mob_cfg_r13_present) {
    j.write_fieldname("lwa-MobilityConfig-r13");
    lwa_mob_cfg_r13.to_json(j);
  }
  if (lwa_wt_counter_r13_present) {
    j.write_int("lwa-WT-Counter-r13", lwa_wt_counter_r13);
  }
  if (ext) {
    if (wt_mac_address_r14_present) {
      j.write_str("wt-MAC-Address-r14", wt_mac_address_r14.to_string());
    }
  }
  j.end_obj();
}

// LWIP-Config-r13 ::= SEQUENCE
SRSASN_CODE lwip_cfg_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(lwip_mob_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(tunnel_cfg_lwip_r13_present, 1));

  if (lwip_mob_cfg_r13_present) {
    HANDLE_CODE(lwip_mob_cfg_r13.pack(bref));
  }
  if (tunnel_cfg_lwip_r13_present) {
    HANDLE_CODE(tunnel_cfg_lwip_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE lwip_cfg_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(lwip_mob_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(tunnel_cfg_lwip_r13_present, 1));

  if (lwip_mob_cfg_r13_present) {
    HANDLE_CODE(lwip_mob_cfg_r13.unpack(bref));
  }
  if (tunnel_cfg_lwip_r13_present) {
    HANDLE_CODE(tunnel_cfg_lwip_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void lwip_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (lwip_mob_cfg_r13_present) {
    j.write_fieldname("lwip-MobilityConfig-r13");
    lwip_mob_cfg_r13.to_json(j);
  }
  if (tunnel_cfg_lwip_r13_present) {
    j.write_fieldname("tunnelConfigLWIP-r13");
    tunnel_cfg_lwip_r13.to_json(j);
  }
  j.end_obj();
}

// MobilityControlInfoSCG-r12 ::= SEQUENCE
SRSASN_CODE mob_ctrl_info_scg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ue_id_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(rach_cfg_ded_r12_present, 1));
  HANDLE_CODE(bref.pack(ciphering_algorithm_scg_r12_present, 1));

  HANDLE_CODE(t307_r12.pack(bref));
  if (ue_id_scg_r12_present) {
    HANDLE_CODE(ue_id_scg_r12.pack(bref));
  }
  if (rach_cfg_ded_r12_present) {
    HANDLE_CODE(rach_cfg_ded_r12.pack(bref));
  }
  if (ciphering_algorithm_scg_r12_present) {
    HANDLE_CODE(ciphering_algorithm_scg_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= make_before_break_scg_r14_present;
    group_flags[0] |= rach_skip_scg_r14.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(make_before_break_scg_r14_present, 1));
      HANDLE_CODE(bref.pack(rach_skip_scg_r14.is_present(), 1));
      if (rach_skip_scg_r14.is_present()) {
        HANDLE_CODE(rach_skip_scg_r14->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_ctrl_info_scg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ue_id_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(rach_cfg_ded_r12_present, 1));
  HANDLE_CODE(bref.unpack(ciphering_algorithm_scg_r12_present, 1));

  HANDLE_CODE(t307_r12.unpack(bref));
  if (ue_id_scg_r12_present) {
    HANDLE_CODE(ue_id_scg_r12.unpack(bref));
  }
  if (rach_cfg_ded_r12_present) {
    HANDLE_CODE(rach_cfg_ded_r12.unpack(bref));
  }
  if (ciphering_algorithm_scg_r12_present) {
    HANDLE_CODE(ciphering_algorithm_scg_r12.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(make_before_break_scg_r14_present, 1));
      bool rach_skip_scg_r14_present;
      HANDLE_CODE(bref.unpack(rach_skip_scg_r14_present, 1));
      rach_skip_scg_r14.set_present(rach_skip_scg_r14_present);
      if (rach_skip_scg_r14.is_present()) {
        HANDLE_CODE(rach_skip_scg_r14->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void mob_ctrl_info_scg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t307-r12", t307_r12.to_string());
  if (ue_id_scg_r12_present) {
    j.write_str("ue-IdentitySCG-r12", ue_id_scg_r12.to_string());
  }
  if (rach_cfg_ded_r12_present) {
    j.write_fieldname("rach-ConfigDedicated-r12");
    rach_cfg_ded_r12.to_json(j);
  }
  if (ciphering_algorithm_scg_r12_present) {
    j.write_str("cipheringAlgorithmSCG-r12", ciphering_algorithm_scg_r12.to_string());
  }
  if (ext) {
    if (make_before_break_scg_r14_present) {
      j.write_str("makeBeforeBreakSCG-r14", "true");
    }
    if (rach_skip_scg_r14.is_present()) {
      j.write_fieldname("rach-SkipSCG-r14");
      rach_skip_scg_r14->to_json(j);
    }
  }
  j.end_obj();
}

// PSCellToAddMod-r12 ::= SEQUENCE
SRSASN_CODE ps_cell_to_add_mod_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(cell_identif_r12_present, 1));
  HANDLE_CODE(bref.pack(rr_cfg_common_ps_cell_r12_present, 1));
  HANDLE_CODE(bref.pack(rr_cfg_ded_ps_cell_r12_present, 1));

  HANDLE_CODE(pack_integer(bref, scell_idx_r12, (uint8_t)1u, (uint8_t)7u));
  if (cell_identif_r12_present) {
    HANDLE_CODE(pack_integer(bref, cell_identif_r12.pci_r12, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(pack_integer(bref, cell_identif_r12.dl_carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u));
  }
  if (rr_cfg_common_ps_cell_r12_present) {
    HANDLE_CODE(rr_cfg_common_ps_cell_r12.pack(bref));
  }
  if (rr_cfg_ded_ps_cell_r12_present) {
    HANDLE_CODE(rr_cfg_ded_ps_cell_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= ant_info_ded_ps_cell_v1280.is_present();
    group_flags[1] |= scell_idx_r13_present;
    group_flags[2] |= rr_cfg_ded_ps_cell_v1370.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ant_info_ded_ps_cell_v1280.is_present(), 1));
      if (ant_info_ded_ps_cell_v1280.is_present()) {
        HANDLE_CODE(ant_info_ded_ps_cell_v1280->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(scell_idx_r13_present, 1));
      if (scell_idx_r13_present) {
        HANDLE_CODE(pack_integer(bref, scell_idx_r13, (uint8_t)1u, (uint8_t)31u));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rr_cfg_ded_ps_cell_v1370.is_present(), 1));
      if (rr_cfg_ded_ps_cell_v1370.is_present()) {
        HANDLE_CODE(rr_cfg_ded_ps_cell_v1370->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ps_cell_to_add_mod_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(cell_identif_r12_present, 1));
  HANDLE_CODE(bref.unpack(rr_cfg_common_ps_cell_r12_present, 1));
  HANDLE_CODE(bref.unpack(rr_cfg_ded_ps_cell_r12_present, 1));

  HANDLE_CODE(unpack_integer(scell_idx_r12, bref, (uint8_t)1u, (uint8_t)7u));
  if (cell_identif_r12_present) {
    HANDLE_CODE(unpack_integer(cell_identif_r12.pci_r12, bref, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(unpack_integer(cell_identif_r12.dl_carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));
  }
  if (rr_cfg_common_ps_cell_r12_present) {
    HANDLE_CODE(rr_cfg_common_ps_cell_r12.unpack(bref));
  }
  if (rr_cfg_ded_ps_cell_r12_present) {
    HANDLE_CODE(rr_cfg_ded_ps_cell_r12.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ant_info_ded_ps_cell_v1280_present;
      HANDLE_CODE(bref.unpack(ant_info_ded_ps_cell_v1280_present, 1));
      ant_info_ded_ps_cell_v1280.set_present(ant_info_ded_ps_cell_v1280_present);
      if (ant_info_ded_ps_cell_v1280.is_present()) {
        HANDLE_CODE(ant_info_ded_ps_cell_v1280->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(scell_idx_r13_present, 1));
      if (scell_idx_r13_present) {
        HANDLE_CODE(unpack_integer(scell_idx_r13, bref, (uint8_t)1u, (uint8_t)31u));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool rr_cfg_ded_ps_cell_v1370_present;
      HANDLE_CODE(bref.unpack(rr_cfg_ded_ps_cell_v1370_present, 1));
      rr_cfg_ded_ps_cell_v1370.set_present(rr_cfg_ded_ps_cell_v1370_present);
      if (rr_cfg_ded_ps_cell_v1370.is_present()) {
        HANDLE_CODE(rr_cfg_ded_ps_cell_v1370->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void ps_cell_to_add_mod_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sCellIndex-r12", scell_idx_r12);
  if (cell_identif_r12_present) {
    j.write_fieldname("cellIdentification-r12");
    j.start_obj();
    j.write_int("physCellId-r12", cell_identif_r12.pci_r12);
    j.write_int("dl-CarrierFreq-r12", cell_identif_r12.dl_carrier_freq_r12);
    j.end_obj();
  }
  if (rr_cfg_common_ps_cell_r12_present) {
    j.write_fieldname("radioResourceConfigCommonPSCell-r12");
    rr_cfg_common_ps_cell_r12.to_json(j);
  }
  if (rr_cfg_ded_ps_cell_r12_present) {
    j.write_fieldname("radioResourceConfigDedicatedPSCell-r12");
    rr_cfg_ded_ps_cell_r12.to_json(j);
  }
  if (ext) {
    if (ant_info_ded_ps_cell_v1280.is_present()) {
      j.write_fieldname("antennaInfoDedicatedPSCell-v1280");
      ant_info_ded_ps_cell_v1280->to_json(j);
    }
    if (scell_idx_r13_present) {
      j.write_int("sCellIndex-r13", scell_idx_r13);
    }
    if (rr_cfg_ded_ps_cell_v1370.is_present()) {
      j.write_fieldname("radioResourceConfigDedicatedPSCell-v1370");
      rr_cfg_ded_ps_cell_v1370->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();
}

// PSCellToAddMod-v1440 ::= SEQUENCE
SRSASN_CODE ps_cell_to_add_mod_v1440_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rr_cfg_common_ps_cell_r14_present, 1));

  if (rr_cfg_common_ps_cell_r14_present) {
    HANDLE_CODE(rr_cfg_common_ps_cell_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ps_cell_to_add_mod_v1440_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rr_cfg_common_ps_cell_r14_present, 1));

  if (rr_cfg_common_ps_cell_r14_present) {
    HANDLE_CODE(rr_cfg_common_ps_cell_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ps_cell_to_add_mod_v1440_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rr_cfg_common_ps_cell_r14_present) {
    j.write_fieldname("radioResourceConfigCommonPSCell-r14");
    rr_cfg_common_ps_cell_r14.to_json(j);
  }
  j.end_obj();
}

// RCLWI-Config-r13 ::= SEQUENCE
SRSASN_CODE rclwi_cfg_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(cmd.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rclwi_cfg_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(cmd.unpack(bref));

  return SRSASN_SUCCESS;
}
void rclwi_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("command");
  cmd.to_json(j);
  j.end_obj();
}

void rclwi_cfg_r13_s::cmd_c_::set(types::options e)
{
  type_ = e;
}
void rclwi_cfg_r13_s::cmd_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::steer_to_wlan_r13:
      j.write_fieldname("steerToWLAN-r13");
      j.start_obj();
      j.start_array("mobilityConfig-r13");
      for (const auto& e1 : c.mob_cfg_r13) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    case types::steer_to_lte_r13:
      break;
    default:
      log_invalid_choice_id(type_, "rclwi_cfg_r13_s::cmd_c_");
  }
  j.end_obj();
}
SRSASN_CODE rclwi_cfg_r13_s::cmd_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::steer_to_wlan_r13:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.mob_cfg_r13, 1, 16));
      break;
    case types::steer_to_lte_r13:
      break;
    default:
      log_invalid_choice_id(type_, "rclwi_cfg_r13_s::cmd_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rclwi_cfg_r13_s::cmd_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::steer_to_wlan_r13:
      HANDLE_CODE(unpack_dyn_seq_of(c.mob_cfg_r13, bref, 1, 16));
      break;
    case types::steer_to_lte_r13:
      break;
    default:
      log_invalid_choice_id(type_, "rclwi_cfg_r13_s::cmd_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReconfiguration-v1510-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_v1510_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(nr_cfg_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(tdm_pattern_cfg_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (nr_cfg_r15_present) {
    HANDLE_CODE(nr_cfg_r15.pack(bref));
  }
  if (sk_counter_r15_present) {
    HANDLE_CODE(pack_integer(bref, sk_counter_r15, (uint32_t)0u, (uint32_t)65535u));
  }
  if (nr_radio_bearer_cfg1_r15_present) {
    HANDLE_CODE(nr_radio_bearer_cfg1_r15.pack(bref));
  }
  if (nr_radio_bearer_cfg2_r15_present) {
    HANDLE_CODE(nr_radio_bearer_cfg2_r15.pack(bref));
  }
  if (tdm_pattern_cfg_r15_present) {
    HANDLE_CODE(tdm_pattern_cfg_r15.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1510_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(nr_cfg_r15_present, 1));
  HANDLE_CODE(bref.unpack(sk_counter_r15_present, 1));
  HANDLE_CODE(bref.unpack(nr_radio_bearer_cfg1_r15_present, 1));
  HANDLE_CODE(bref.unpack(nr_radio_bearer_cfg2_r15_present, 1));
  HANDLE_CODE(bref.unpack(tdm_pattern_cfg_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (nr_cfg_r15_present) {
    HANDLE_CODE(nr_cfg_r15.unpack(bref));
  }
  if (sk_counter_r15_present) {
    HANDLE_CODE(unpack_integer(sk_counter_r15, bref, (uint32_t)0u, (uint32_t)65535u));
  }
  if (nr_radio_bearer_cfg1_r15_present) {
    HANDLE_CODE(nr_radio_bearer_cfg1_r15.unpack(bref));
  }
  if (nr_radio_bearer_cfg2_r15_present) {
    HANDLE_CODE(nr_radio_bearer_cfg2_r15.unpack(bref));
  }
  if (tdm_pattern_cfg_r15_present) {
    HANDLE_CODE(tdm_pattern_cfg_r15.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_v1510_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (nr_cfg_r15_present) {
    j.write_fieldname("nr-Config-r15");
    nr_cfg_r15.to_json(j);
  }
  if (sk_counter_r15_present) {
    j.write_int("sk-Counter-r15", sk_counter_r15);
  }
  if (nr_radio_bearer_cfg1_r15_present) {
    j.write_str("nr-RadioBearerConfig1-r15", nr_radio_bearer_cfg1_r15.to_string());
  }
  if (nr_radio_bearer_cfg2_r15_present) {
    j.write_str("nr-RadioBearerConfig2-r15", nr_radio_bearer_cfg2_r15.to_string());
  }
  if (tdm_pattern_cfg_r15_present) {
    j.write_fieldname("tdm-PatternConfig-r15");
    tdm_pattern_cfg_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void rrc_conn_recfg_v1510_ies_s::nr_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_recfg_v1510_ies_s::nr_cfg_r15_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_bool("endc-ReleaseAndAdd-r15", c.endc_release_and_add_r15);
      if (c.nr_secondary_cell_group_cfg_r15_present) {
        j.write_str("nr-SecondaryCellGroupConfig-r15", c.nr_secondary_cell_group_cfg_r15.to_string());
      }
      if (c.p_max_eutra_r15_present) {
        j.write_int("p-MaxEUTRA-r15", c.p_max_eutra_r15);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1510_ies_s::nr_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_recfg_v1510_ies_s::nr_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.nr_secondary_cell_group_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(c.p_max_eutra_r15_present, 1));
      HANDLE_CODE(bref.pack(c.endc_release_and_add_r15, 1));
      if (c.nr_secondary_cell_group_cfg_r15_present) {
        HANDLE_CODE(c.nr_secondary_cell_group_cfg_r15.pack(bref));
      }
      if (c.p_max_eutra_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.p_max_eutra_r15, (int8_t)-30, (int8_t)33));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1510_ies_s::nr_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1510_ies_s::nr_cfg_r15_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.nr_secondary_cell_group_cfg_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.p_max_eutra_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.endc_release_and_add_r15, 1));
      if (c.nr_secondary_cell_group_cfg_r15_present) {
        HANDLE_CODE(c.nr_secondary_cell_group_cfg_r15.unpack(bref));
      }
      if (c.p_max_eutra_r15_present) {
        HANDLE_CODE(unpack_integer(c.p_max_eutra_r15, bref, (int8_t)-30, (int8_t)33));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1510_ies_s::nr_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rrc_conn_recfg_v1510_ies_s::tdm_pattern_cfg_r15_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_recfg_v1510_ies_s::tdm_pattern_cfg_r15_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("subframeAssignment-r15", c.sf_assign_r15.to_string());
      j.write_int("harq-Offset-r15", c.harq_offset_r15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1510_ies_s::tdm_pattern_cfg_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_recfg_v1510_ies_s::tdm_pattern_cfg_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.sf_assign_r15.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.harq_offset_r15, (uint8_t)0u, (uint8_t)9u));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1510_ies_s::tdm_pattern_cfg_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1510_ies_s::tdm_pattern_cfg_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.sf_assign_r15.unpack(bref));
      HANDLE_CODE(unpack_integer(c.harq_offset_r15, bref, (uint8_t)0u, (uint8_t)9u));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1510_ies_s::tdm_pattern_cfg_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RadioResourceConfigDedicatedSCG-r12 ::= SEQUENCE
SRSASN_CODE rr_cfg_ded_scg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(drb_to_add_mod_list_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(mac_main_cfg_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(rlf_timers_and_consts_scg_r12_present, 1));

  if (drb_to_add_mod_list_scg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_to_add_mod_list_scg_r12, 1, 11));
  }
  if (mac_main_cfg_scg_r12_present) {
    HANDLE_CODE(mac_main_cfg_scg_r12.pack(bref));
  }
  if (rlf_timers_and_consts_scg_r12_present) {
    HANDLE_CODE(rlf_timers_and_consts_scg_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= drb_to_add_mod_list_scg_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(drb_to_add_mod_list_scg_r15.is_present(), 1));
      if (drb_to_add_mod_list_scg_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *drb_to_add_mod_list_scg_r15, 1, 15));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_ded_scg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(drb_to_add_mod_list_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(mac_main_cfg_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(rlf_timers_and_consts_scg_r12_present, 1));

  if (drb_to_add_mod_list_scg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_to_add_mod_list_scg_r12, bref, 1, 11));
  }
  if (mac_main_cfg_scg_r12_present) {
    HANDLE_CODE(mac_main_cfg_scg_r12.unpack(bref));
  }
  if (rlf_timers_and_consts_scg_r12_present) {
    HANDLE_CODE(rlf_timers_and_consts_scg_r12.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 drb_to_add_mod_list_scg_r15_present;
      HANDLE_CODE(bref.unpack(drb_to_add_mod_list_scg_r15_present, 1));
      drb_to_add_mod_list_scg_r15.set_present(drb_to_add_mod_list_scg_r15_present);
      if (drb_to_add_mod_list_scg_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*drb_to_add_mod_list_scg_r15, bref, 1, 15));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rr_cfg_ded_scg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (drb_to_add_mod_list_scg_r12_present) {
    j.start_array("drb-ToAddModListSCG-r12");
    for (const auto& e1 : drb_to_add_mod_list_scg_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (mac_main_cfg_scg_r12_present) {
    j.write_fieldname("mac-MainConfigSCG-r12");
    mac_main_cfg_scg_r12.to_json(j);
  }
  if (rlf_timers_and_consts_scg_r12_present) {
    j.write_fieldname("rlf-TimersAndConstantsSCG-r12");
    rlf_timers_and_consts_scg_r12.to_json(j);
  }
  if (ext) {
    if (drb_to_add_mod_list_scg_r15.is_present()) {
      j.start_array("drb-ToAddModListSCG-r15");
      for (const auto& e1 : *drb_to_add_mod_list_scg_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// SL-CommTxPoolToAddMod-r12 ::= SEQUENCE
SRSASN_CODE sl_comm_tx_pool_to_add_mod_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, pool_id_r12, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(pool_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_tx_pool_to_add_mod_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(pool_id_r12, bref, (uint8_t)1u, (uint8_t)4u));
  HANDLE_CODE(pool_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_comm_tx_pool_to_add_mod_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("poolIdentity-r12", pool_id_r12);
  j.write_fieldname("pool-r12");
  pool_r12.to_json(j);
  j.end_obj();
}

// SL-CommTxPoolToAddModExt-r13 ::= SEQUENCE
SRSASN_CODE sl_comm_tx_pool_to_add_mod_ext_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, pool_id_v1310, (uint8_t)5u, (uint8_t)8u));
  HANDLE_CODE(pool_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_tx_pool_to_add_mod_ext_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(pool_id_v1310, bref, (uint8_t)5u, (uint8_t)8u));
  HANDLE_CODE(pool_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_comm_tx_pool_to_add_mod_ext_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("poolIdentity-v1310", pool_id_v1310);
  j.write_fieldname("pool-r13");
  pool_r13.to_json(j);
  j.end_obj();
}

// SL-DiscTxResourceInfoPerFreq-r13 ::= SEQUENCE
SRSASN_CODE sl_disc_tx_res_info_per_freq_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(disc_tx_res_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_res_ps_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_ref_carrier_ded_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_cell_sel_info_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, disc_tx_carrier_freq_r13, (uint32_t)0u, (uint32_t)262143u));
  if (disc_tx_res_r13_present) {
    HANDLE_CODE(disc_tx_res_r13.pack(bref));
  }
  if (disc_tx_res_ps_r13_present) {
    HANDLE_CODE(disc_tx_res_ps_r13.pack(bref));
  }
  if (disc_tx_ref_carrier_ded_r13_present) {
    HANDLE_CODE(disc_tx_ref_carrier_ded_r13.pack(bref));
  }
  if (disc_cell_sel_info_r13_present) {
    HANDLE_CODE(disc_cell_sel_info_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_res_info_per_freq_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(disc_tx_res_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_res_ps_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_ref_carrier_ded_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_cell_sel_info_r13_present, 1));

  HANDLE_CODE(unpack_integer(disc_tx_carrier_freq_r13, bref, (uint32_t)0u, (uint32_t)262143u));
  if (disc_tx_res_r13_present) {
    HANDLE_CODE(disc_tx_res_r13.unpack(bref));
  }
  if (disc_tx_res_ps_r13_present) {
    HANDLE_CODE(disc_tx_res_ps_r13.unpack(bref));
  }
  if (disc_tx_ref_carrier_ded_r13_present) {
    HANDLE_CODE(disc_tx_ref_carrier_ded_r13.unpack(bref));
  }
  if (disc_cell_sel_info_r13_present) {
    HANDLE_CODE(disc_cell_sel_info_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_disc_tx_res_info_per_freq_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("discTxCarrierFreq-r13", disc_tx_carrier_freq_r13);
  if (disc_tx_res_r13_present) {
    j.write_fieldname("discTxResources-r13");
    disc_tx_res_r13.to_json(j);
  }
  if (disc_tx_res_ps_r13_present) {
    j.write_fieldname("discTxResourcesPS-r13");
    disc_tx_res_ps_r13.to_json(j);
  }
  if (disc_tx_ref_carrier_ded_r13_present) {
    j.write_fieldname("discTxRefCarrierDedicated-r13");
    disc_tx_ref_carrier_ded_r13.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();
}

// SL-TF-IndexPair-r12 ::= SEQUENCE
SRSASN_CODE sl_tf_idx_pair_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(disc_sf_idx_r12_present, 1));
  HANDLE_CODE(bref.pack(disc_prb_idx_r12_present, 1));

  if (disc_sf_idx_r12_present) {
    HANDLE_CODE(pack_integer(bref, disc_sf_idx_r12, (uint8_t)1u, (uint8_t)200u));
  }
  if (disc_prb_idx_r12_present) {
    HANDLE_CODE(pack_integer(bref, disc_prb_idx_r12, (uint8_t)1u, (uint8_t)50u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_tf_idx_pair_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(disc_sf_idx_r12_present, 1));
  HANDLE_CODE(bref.unpack(disc_prb_idx_r12_present, 1));

  if (disc_sf_idx_r12_present) {
    HANDLE_CODE(unpack_integer(disc_sf_idx_r12, bref, (uint8_t)1u, (uint8_t)200u));
  }
  if (disc_prb_idx_r12_present) {
    HANDLE_CODE(unpack_integer(disc_prb_idx_r12, bref, (uint8_t)1u, (uint8_t)50u));
  }

  return SRSASN_SUCCESS;
}
void sl_tf_idx_pair_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (disc_sf_idx_r12_present) {
    j.write_int("discSF-Index-r12", disc_sf_idx_r12);
  }
  if (disc_prb_idx_r12_present) {
    j.write_int("discPRB-Index-r12", disc_prb_idx_r12);
  }
  j.end_obj();
}

// SL-V2X-ConfigDedicated-r14 ::= SEQUENCE
SRSASN_CODE sl_v2x_cfg_ded_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(comm_tx_res_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_inter_freq_info_list_r14_present, 1));
  HANDLE_CODE(bref.pack(thres_sl_tx_prioritization_r14_present, 1));
  HANDLE_CODE(bref.pack(type_tx_sync_r14_present, 1));
  HANDLE_CODE(bref.pack(cbr_ded_tx_cfg_list_r14_present, 1));

  if (comm_tx_res_r14_present) {
    HANDLE_CODE(comm_tx_res_r14.pack(bref));
  }
  if (v2x_inter_freq_info_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_inter_freq_info_list_r14, 0, 7));
  }
  if (thres_sl_tx_prioritization_r14_present) {
    HANDLE_CODE(pack_integer(bref, thres_sl_tx_prioritization_r14, (uint8_t)1u, (uint8_t)8u));
  }
  if (type_tx_sync_r14_present) {
    HANDLE_CODE(type_tx_sync_r14.pack(bref));
  }
  if (cbr_ded_tx_cfg_list_r14_present) {
    HANDLE_CODE(cbr_ded_tx_cfg_list_r14.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= comm_tx_res_v1530.is_present();
    group_flags[0] |= v2x_packet_dupl_cfg_r15.is_present();
    group_flags[0] |= sync_freq_list_r15.is_present();
    group_flags[0] |= slss_tx_multi_freq_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(comm_tx_res_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(v2x_packet_dupl_cfg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(sync_freq_list_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(slss_tx_multi_freq_r15_present, 1));
      if (comm_tx_res_v1530.is_present()) {
        HANDLE_CODE(comm_tx_res_v1530->pack(bref));
      }
      if (v2x_packet_dupl_cfg_r15.is_present()) {
        HANDLE_CODE(v2x_packet_dupl_cfg_r15->pack(bref));
      }
      if (sync_freq_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *sync_freq_list_r15, 1, 8, integer_packer<uint32_t>(0, 262143)));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(comm_tx_res_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_inter_freq_info_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(thres_sl_tx_prioritization_r14_present, 1));
  HANDLE_CODE(bref.unpack(type_tx_sync_r14_present, 1));
  HANDLE_CODE(bref.unpack(cbr_ded_tx_cfg_list_r14_present, 1));

  if (comm_tx_res_r14_present) {
    HANDLE_CODE(comm_tx_res_r14.unpack(bref));
  }
  if (v2x_inter_freq_info_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_inter_freq_info_list_r14, bref, 0, 7));
  }
  if (thres_sl_tx_prioritization_r14_present) {
    HANDLE_CODE(unpack_integer(thres_sl_tx_prioritization_r14, bref, (uint8_t)1u, (uint8_t)8u));
  }
  if (type_tx_sync_r14_present) {
    HANDLE_CODE(type_tx_sync_r14.unpack(bref));
  }
  if (cbr_ded_tx_cfg_list_r14_present) {
    HANDLE_CODE(cbr_ded_tx_cfg_list_r14.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_res_v1530_present;
      HANDLE_CODE(bref.unpack(comm_tx_res_v1530_present, 1));
      comm_tx_res_v1530.set_present(comm_tx_res_v1530_present);
      bool v2x_packet_dupl_cfg_r15_present;
      HANDLE_CODE(bref.unpack(v2x_packet_dupl_cfg_r15_present, 1));
      v2x_packet_dupl_cfg_r15.set_present(v2x_packet_dupl_cfg_r15_present);
      bool sync_freq_list_r15_present;
      HANDLE_CODE(bref.unpack(sync_freq_list_r15_present, 1));
      sync_freq_list_r15.set_present(sync_freq_list_r15_present);
      HANDLE_CODE(bref.unpack(slss_tx_multi_freq_r15_present, 1));
      if (comm_tx_res_v1530.is_present()) {
        HANDLE_CODE(comm_tx_res_v1530->unpack(bref));
      }
      if (v2x_packet_dupl_cfg_r15.is_present()) {
        HANDLE_CODE(v2x_packet_dupl_cfg_r15->unpack(bref));
      }
      if (sync_freq_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*sync_freq_list_r15, bref, 1, 8, integer_packer<uint32_t>(0, 262143)));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_v2x_cfg_ded_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (comm_tx_res_r14_present) {
    j.write_fieldname("commTxResources-r14");
    comm_tx_res_r14.to_json(j);
  }
  if (v2x_inter_freq_info_list_r14_present) {
    j.start_array("v2x-InterFreqInfoList-r14");
    for (const auto& e1 : v2x_inter_freq_info_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (thres_sl_tx_prioritization_r14_present) {
    j.write_int("thresSL-TxPrioritization-r14", thres_sl_tx_prioritization_r14);
  }
  if (type_tx_sync_r14_present) {
    j.write_str("typeTxSync-r14", type_tx_sync_r14.to_string());
  }
  if (cbr_ded_tx_cfg_list_r14_present) {
    j.write_fieldname("cbr-DedicatedTxConfigList-r14");
    cbr_ded_tx_cfg_list_r14.to_json(j);
  }
  if (ext) {
    if (comm_tx_res_v1530.is_present()) {
      j.write_fieldname("commTxResources-v1530");
      comm_tx_res_v1530->to_json(j);
    }
    if (v2x_packet_dupl_cfg_r15.is_present()) {
      j.write_fieldname("v2x-PacketDuplicationConfig-r15");
      v2x_packet_dupl_cfg_r15->to_json(j);
    }
    if (sync_freq_list_r15.is_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");
    }
  }
  j.end_obj();
}

void sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::set(types::options e)
{
  type_ = e;
}
void sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::sched_r14:
      c.destroy<sched_r14_s_>();
      break;
    case types::ue_sel_r14:
      c.destroy<ue_sel_r14_s_>();
      break;
    default:
      break;
  }
}
void sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sched_r14:
      c.init<sched_r14_s_>();
      break;
    case types::ue_sel_r14:
      c.init<ue_sel_r14_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_");
  }
}
sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_::setup_c_(
    const sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sched_r14:
      c.init(other.c.get<sched_r14_s_>());
      break;
    case types::ue_sel_r14:
      c.init(other.c.get<ue_sel_r14_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_");
  }
}
sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_& sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_::
                                                    operator=(const sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sched_r14:
      c.set(other.c.get<sched_r14_s_>());
      break;
    case types::ue_sel_r14:
      c.set(other.c.get<ue_sel_r14_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_");
  }

  return *this;
}
void sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sched_r14:
      j.write_fieldname("scheduled-r14");
      j.start_obj();
      j.write_str("sl-V-RNTI-r14", c.get<sched_r14_s_>().sl_v_rnti_r14.to_string());
      j.write_fieldname("mac-MainConfig-r14");
      c.get<sched_r14_s_>().mac_main_cfg_r14.to_json(j);
      if (c.get<sched_r14_s_>().v2x_sched_pool_r14_present) {
        j.write_fieldname("v2x-SchedulingPool-r14");
        c.get<sched_r14_s_>().v2x_sched_pool_r14.to_json(j);
      }
      if (c.get<sched_r14_s_>().mcs_r14_present) {
        j.write_int("mcs-r14", c.get<sched_r14_s_>().mcs_r14);
      }
      j.start_array("logicalChGroupInfoList-r14");
      for (const auto& e1 : c.get<sched_r14_s_>().lc_ch_group_info_list_r14) {
        j.start_array();
        for (const auto& e2 : e1) {
          j.write_int(e2);
        }
        j.end_array();
      }
      j.end_array();
      j.end_obj();
      break;
    case types::ue_sel_r14:
      j.write_fieldname("ue-Selected-r14");
      j.start_obj();
      j.write_fieldname("v2x-CommTxPoolNormalDedicated-r14");
      j.start_obj();
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_release_list_r14_present) {
        j.start_array("poolToReleaseList-r14");
        for (const auto& e1 : c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_release_list_r14) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_add_mod_list_r14_present) {
        j.start_array("poolToAddModList-r14");
        for (const auto& e1 : c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_add_mod_list_r14) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.v2x_comm_tx_pool_sensing_cfg_r14_present) {
        j.write_fieldname("v2x-CommTxPoolSensingConfig-r14");
        c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.v2x_comm_tx_pool_sensing_cfg_r14.to_json(j);
      }
      j.end_obj();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sched_r14:
      HANDLE_CODE(bref.pack(c.get<sched_r14_s_>().v2x_sched_pool_r14_present, 1));
      HANDLE_CODE(bref.pack(c.get<sched_r14_s_>().mcs_r14_present, 1));
      HANDLE_CODE(c.get<sched_r14_s_>().sl_v_rnti_r14.pack(bref));
      HANDLE_CODE(c.get<sched_r14_s_>().mac_main_cfg_r14.pack(bref));
      if (c.get<sched_r14_s_>().v2x_sched_pool_r14_present) {
        HANDLE_CODE(c.get<sched_r14_s_>().v2x_sched_pool_r14.pack(bref));
      }
      if (c.get<sched_r14_s_>().mcs_r14_present) {
        HANDLE_CODE(pack_integer(bref, c.get<sched_r14_s_>().mcs_r14, (uint8_t)0u, (uint8_t)31u));
      }
      HANDLE_CODE(pack_dyn_seq_of(bref,
                                  c.get<sched_r14_s_>().lc_ch_group_info_list_r14,
                                  1,
                                  4,
                                  SeqOfPacker<integer_packer<uint8_t> >(1, 8, integer_packer<uint8_t>(1, 8))));
      break;
    case types::ue_sel_r14:
      HANDLE_CODE(
          bref.pack(c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_release_list_r14_present, 1));
      HANDLE_CODE(
          bref.pack(c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_add_mod_list_r14_present, 1));
      HANDLE_CODE(bref.pack(
          c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.v2x_comm_tx_pool_sensing_cfg_r14_present, 1));
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_release_list_r14_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref,
                                    c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_release_list_r14,
                                    1,
                                    8,
                                    integer_packer<uint8_t>(1, 8)));
      }
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_add_mod_list_r14_present) {
        HANDLE_CODE(pack_dyn_seq_of(
            bref, c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_add_mod_list_r14, 1, 8));
      }
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.v2x_comm_tx_pool_sensing_cfg_r14_present) {
        HANDLE_CODE(c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.v2x_comm_tx_pool_sensing_cfg_r14.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sched_r14:
      HANDLE_CODE(bref.unpack(c.get<sched_r14_s_>().v2x_sched_pool_r14_present, 1));
      HANDLE_CODE(bref.unpack(c.get<sched_r14_s_>().mcs_r14_present, 1));
      HANDLE_CODE(c.get<sched_r14_s_>().sl_v_rnti_r14.unpack(bref));
      HANDLE_CODE(c.get<sched_r14_s_>().mac_main_cfg_r14.unpack(bref));
      if (c.get<sched_r14_s_>().v2x_sched_pool_r14_present) {
        HANDLE_CODE(c.get<sched_r14_s_>().v2x_sched_pool_r14.unpack(bref));
      }
      if (c.get<sched_r14_s_>().mcs_r14_present) {
        HANDLE_CODE(unpack_integer(c.get<sched_r14_s_>().mcs_r14, bref, (uint8_t)0u, (uint8_t)31u));
      }
      HANDLE_CODE(unpack_dyn_seq_of(c.get<sched_r14_s_>().lc_ch_group_info_list_r14,
                                    bref,
                                    1,
                                    4,
                                    SeqOfPacker<integer_packer<uint8_t> >(1, 8, integer_packer<uint8_t>(1, 8))));
      break;
    case types::ue_sel_r14:
      HANDLE_CODE(
          bref.unpack(c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_release_list_r14_present, 1));
      HANDLE_CODE(
          bref.unpack(c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_add_mod_list_r14_present, 1));
      HANDLE_CODE(bref.unpack(
          c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.v2x_comm_tx_pool_sensing_cfg_r14_present, 1));
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_release_list_r14_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_release_list_r14,
                                      bref,
                                      1,
                                      8,
                                      integer_packer<uint8_t>(1, 8)));
      }
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_add_mod_list_r14_present) {
        HANDLE_CODE(unpack_dyn_seq_of(
            c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.pool_to_add_mod_list_r14, bref, 1, 8));
      }
      if (c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.v2x_comm_tx_pool_sensing_cfg_r14_present) {
        HANDLE_CODE(
            c.get<ue_sel_r14_s_>().v2x_comm_tx_pool_normal_ded_r14.v2x_comm_tx_pool_sensing_cfg_r14.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_r14_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::set(types::options e)
{
  type_ = e;
}
void sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::sched_v1530:
      c.destroy<sched_v1530_s_>();
      break;
    case types::ue_sel_v1530:
      c.destroy<ue_sel_v1530_s_>();
      break;
    default:
      break;
  }
}
void sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sched_v1530:
      c.init<sched_v1530_s_>();
      break;
    case types::ue_sel_v1530:
      c.init<ue_sel_v1530_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_");
  }
}
sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_::setup_c_(
    const sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sched_v1530:
      c.init(other.c.get<sched_v1530_s_>());
      break;
    case types::ue_sel_v1530:
      c.init(other.c.get<ue_sel_v1530_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_");
  }
}
sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_& sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_::
                                                      operator=(const sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sched_v1530:
      c.set(other.c.get<sched_v1530_s_>());
      break;
    case types::ue_sel_v1530:
      c.set(other.c.get<ue_sel_v1530_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_");
  }

  return *this;
}
void sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sched_v1530:
      j.write_fieldname("scheduled-v1530");
      j.start_obj();
      if (c.get<sched_v1530_s_>().lc_ch_group_info_list_v1530_present) {
        j.start_array("logicalChGroupInfoList-v1530");
        for (const auto& e1 : c.get<sched_v1530_s_>().lc_ch_group_info_list_v1530) {
          j.start_array();
          for (const auto& e2 : e1) {
            j.write_int(e2);
          }
          j.end_array();
        }
        j.end_array();
      }
      if (c.get<sched_v1530_s_>().mcs_r15_present) {
        j.write_int("mcs-r15", c.get<sched_v1530_s_>().mcs_r15);
      }
      j.end_obj();
      break;
    case types::ue_sel_v1530:
      j.write_fieldname("ue-Selected-v1530");
      j.start_obj();
      if (c.get<ue_sel_v1530_s_>().v2x_freq_sel_cfg_list_r15_present) {
        j.start_array("v2x-FreqSelectionConfigList-r15");
        for (const auto& e1 : c.get<ue_sel_v1530_s_>().v2x_freq_sel_cfg_list_r15) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sched_v1530:
      HANDLE_CODE(bref.pack(c.get<sched_v1530_s_>().lc_ch_group_info_list_v1530_present, 1));
      HANDLE_CODE(bref.pack(c.get<sched_v1530_s_>().mcs_r15_present, 1));
      if (c.get<sched_v1530_s_>().lc_ch_group_info_list_v1530_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref,
                                    c.get<sched_v1530_s_>().lc_ch_group_info_list_v1530,
                                    1,
                                    4,
                                    SeqOfPacker<integer_packer<uint8_t> >(1, 8, integer_packer<uint8_t>(1, 8))));
      }
      if (c.get<sched_v1530_s_>().mcs_r15_present) {
        HANDLE_CODE(pack_integer(bref, c.get<sched_v1530_s_>().mcs_r15, (uint8_t)0u, (uint8_t)31u));
      }
      break;
    case types::ue_sel_v1530:
      HANDLE_CODE(bref.pack(c.get<ue_sel_v1530_s_>().v2x_freq_sel_cfg_list_r15_present, 1));
      if (c.get<ue_sel_v1530_s_>().v2x_freq_sel_cfg_list_r15_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.get<ue_sel_v1530_s_>().v2x_freq_sel_cfg_list_r15, 1, 8));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sched_v1530:
      HANDLE_CODE(bref.unpack(c.get<sched_v1530_s_>().lc_ch_group_info_list_v1530_present, 1));
      HANDLE_CODE(bref.unpack(c.get<sched_v1530_s_>().mcs_r15_present, 1));
      if (c.get<sched_v1530_s_>().lc_ch_group_info_list_v1530_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.get<sched_v1530_s_>().lc_ch_group_info_list_v1530,
                                      bref,
                                      1,
                                      4,
                                      SeqOfPacker<integer_packer<uint8_t> >(1, 8, integer_packer<uint8_t>(1, 8))));
      }
      if (c.get<sched_v1530_s_>().mcs_r15_present) {
        HANDLE_CODE(unpack_integer(c.get<sched_v1530_s_>().mcs_r15, bref, (uint8_t)0u, (uint8_t)31u));
      }
      break;
    case types::ue_sel_v1530:
      HANDLE_CODE(bref.unpack(c.get<ue_sel_v1530_s_>().v2x_freq_sel_cfg_list_r15_present, 1));
      if (c.get<ue_sel_v1530_s_>().v2x_freq_sel_cfg_list_r15_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.get<ue_sel_v1530_s_>().v2x_freq_sel_cfg_list_r15, bref, 1, 8));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_v2x_cfg_ded_r14_s::comm_tx_res_v1530_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// BandIndication-r14 ::= SEQUENCE
SRSASN_CODE band_ind_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ca_bw_class_ul_r14_present, 1));

  HANDLE_CODE(pack_integer(bref, band_eutra_r14, (uint16_t)1u, (uint16_t)256u));
  HANDLE_CODE(ca_bw_class_dl_r14.pack(bref));
  if (ca_bw_class_ul_r14_present) {
    HANDLE_CODE(ca_bw_class_ul_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_ind_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ca_bw_class_ul_r14_present, 1));

  HANDLE_CODE(unpack_integer(band_eutra_r14, bref, (uint16_t)1u, (uint16_t)256u));
  HANDLE_CODE(ca_bw_class_dl_r14.unpack(bref));
  if (ca_bw_class_ul_r14_present) {
    HANDLE_CODE(ca_bw_class_ul_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_ind_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("bandEUTRA-r14", band_eutra_r14);
  j.write_str("ca-BandwidthClassDL-r14", ca_bw_class_dl_r14.to_string());
  if (ca_bw_class_ul_r14_present) {
    j.write_str("ca-BandwidthClassUL-r14", ca_bw_class_ul_r14.to_string());
  }
  j.end_obj();
}

// LWA-Configuration-r13 ::= CHOICE
void lwa_cfg_r13_c::set(types::options e)
{
  type_ = e;
}
void lwa_cfg_r13_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("lwa-Config-r13");
      c.lwa_cfg_r13.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "lwa_cfg_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE lwa_cfg_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.lwa_cfg_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "lwa_cfg_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE lwa_cfg_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.lwa_cfg_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "lwa_cfg_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// LWIP-Configuration-r13 ::= CHOICE
void lwip_cfg_r13_c::set(types::options e)
{
  type_ = e;
}
void lwip_cfg_r13_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("lwip-Config-r13");
      c.lwip_cfg_r13.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "lwip_cfg_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE lwip_cfg_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.lwip_cfg_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "lwip_cfg_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE lwip_cfg_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.lwip_cfg_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "lwip_cfg_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasCSI-RS-Config-r12 ::= SEQUENCE
SRSASN_CODE meas_csi_rs_cfg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, meas_csi_rs_id_r12, (uint8_t)1u, (uint8_t)96u));
  HANDLE_CODE(pack_integer(bref, pci_r12, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(pack_integer(bref, scrambling_id_r12, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(pack_integer(bref, res_cfg_r12, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(pack_integer(bref, sf_offset_r12, (uint8_t)0u, (uint8_t)4u));
  HANDLE_CODE(csi_rs_individual_offset_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_csi_rs_cfg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(meas_csi_rs_id_r12, bref, (uint8_t)1u, (uint8_t)96u));
  HANDLE_CODE(unpack_integer(pci_r12, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(unpack_integer(scrambling_id_r12, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(unpack_integer(res_cfg_r12, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(unpack_integer(sf_offset_r12, bref, (uint8_t)0u, (uint8_t)4u));
  HANDLE_CODE(csi_rs_individual_offset_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_csi_rs_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("measCSI-RS-Id-r12", meas_csi_rs_id_r12);
  j.write_int("physCellId-r12", pci_r12);
  j.write_int("scramblingIdentity-r12", scrambling_id_r12);
  j.write_int("resourceConfig-r12", res_cfg_r12);
  j.write_int("subframeOffset-r12", sf_offset_r12);
  j.write_str("csi-RS-IndividualOffset-r12", csi_rs_individual_offset_r12.to_string());
  j.end_obj();
}

// PhysCellIdRangeUTRA-FDD-r9 ::= SEQUENCE
SRSASN_CODE pci_range_utra_fdd_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(range_r9_present, 1));

  HANDLE_CODE(pack_integer(bref, start_r9, (uint16_t)0u, (uint16_t)511u));
  if (range_r9_present) {
    HANDLE_CODE(pack_integer(bref, range_r9, (uint16_t)2u, (uint16_t)512u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pci_range_utra_fdd_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(range_r9_present, 1));

  HANDLE_CODE(unpack_integer(start_r9, bref, (uint16_t)0u, (uint16_t)511u));
  if (range_r9_present) {
    HANDLE_CODE(unpack_integer(range_r9, bref, (uint16_t)2u, (uint16_t)512u));
  }

  return SRSASN_SUCCESS;
}
void pci_range_utra_fdd_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("start-r9", start_r9);
  if (range_r9_present) {
    j.write_int("range-r9", range_r9);
  }
  j.end_obj();
}

// PowerCoordinationInfo-r12 ::= SEQUENCE
SRSASN_CODE pwr_coordination_info_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, p_menb_r12, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(pack_integer(bref, p_senb_r12, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(pack_integer(bref, pwr_ctrl_mode_r12, (uint8_t)1u, (uint8_t)2u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pwr_coordination_info_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(p_menb_r12, bref, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(unpack_integer(p_senb_r12, bref, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(unpack_integer(pwr_ctrl_mode_r12, bref, (uint8_t)1u, (uint8_t)2u));

  return SRSASN_SUCCESS;
}
void pwr_coordination_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("p-MeNB-r12", p_menb_r12);
  j.write_int("p-SeNB-r12", p_senb_r12);
  j.write_int("powerControlMode-r12", pwr_ctrl_mode_r12);
  j.end_obj();
}

// RAN-NotificationAreaInfo-r15 ::= CHOICE
void ran_notif_area_info_r15_c::destroy_()
{
  switch (type_) {
    case types::cell_list_r15:
      c.destroy<plmn_ran_area_cell_list_r15_l>();
      break;
    case types::ran_area_cfg_list_r15:
      c.destroy<plmn_ran_area_cfg_list_r15_l>();
      break;
    default:
      break;
  }
}
void ran_notif_area_info_r15_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cell_list_r15:
      c.init<plmn_ran_area_cell_list_r15_l>();
      break;
    case types::ran_area_cfg_list_r15:
      c.init<plmn_ran_area_cfg_list_r15_l>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ran_notif_area_info_r15_c");
  }
}
ran_notif_area_info_r15_c::ran_notif_area_info_r15_c(const ran_notif_area_info_r15_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cell_list_r15:
      c.init(other.c.get<plmn_ran_area_cell_list_r15_l>());
      break;
    case types::ran_area_cfg_list_r15:
      c.init(other.c.get<plmn_ran_area_cfg_list_r15_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ran_notif_area_info_r15_c");
  }
}
ran_notif_area_info_r15_c& ran_notif_area_info_r15_c::operator=(const ran_notif_area_info_r15_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cell_list_r15:
      c.set(other.c.get<plmn_ran_area_cell_list_r15_l>());
      break;
    case types::ran_area_cfg_list_r15:
      c.set(other.c.get<plmn_ran_area_cfg_list_r15_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ran_notif_area_info_r15_c");
  }

  return *this;
}
void ran_notif_area_info_r15_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cell_list_r15:
      j.start_array("cellList-r15");
      for (const auto& e1 : c.get<plmn_ran_area_cell_list_r15_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::ran_area_cfg_list_r15:
      j.start_array("ran-AreaConfigList-r15");
      for (const auto& e1 : c.get<plmn_ran_area_cfg_list_r15_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "ran_notif_area_info_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE ran_notif_area_info_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cell_list_r15:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<plmn_ran_area_cell_list_r15_l>(), 1, 8));
      break;
    case types::ran_area_cfg_list_r15:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<plmn_ran_area_cfg_list_r15_l>(), 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "ran_notif_area_info_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ran_notif_area_info_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cell_list_r15:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<plmn_ran_area_cell_list_r15_l>(), bref, 1, 8));
      break;
    case types::ran_area_cfg_list_r15:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<plmn_ran_area_cfg_list_r15_l>(), bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "ran_notif_area_info_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RCLWI-Configuration-r13 ::= CHOICE
void rclwi_cfg_r13_c::set(types::options e)
{
  type_ = e;
}
void rclwi_cfg_r13_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("rclwi-Config-r13");
      c.rclwi_cfg_r13.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rclwi_cfg_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE rclwi_cfg_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.rclwi_cfg_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rclwi_cfg_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rclwi_cfg_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.rclwi_cfg_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rclwi_cfg_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReconfiguration-v1430-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(sl_v2x_cfg_ded_r14_present, 1));
  HANDLE_CODE(bref.pack(scell_to_add_mod_list_ext_v1430_present, 1));
  HANDLE_CODE(bref.pack(per_cc_gap_ind_request_r14_present, 1));
  HANDLE_CODE(bref.pack(sib_type2_ded_r14_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (sl_v2x_cfg_ded_r14_present) {
    HANDLE_CODE(sl_v2x_cfg_ded_r14.pack(bref));
  }
  if (scell_to_add_mod_list_ext_v1430_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_ext_v1430, 1, 31));
  }
  if (sib_type2_ded_r14_present) {
    HANDLE_CODE(sib_type2_ded_r14.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(sl_v2x_cfg_ded_r14_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_ext_v1430_present, 1));
  HANDLE_CODE(bref.unpack(per_cc_gap_ind_request_r14_present, 1));
  HANDLE_CODE(bref.unpack(sib_type2_ded_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (sl_v2x_cfg_ded_r14_present) {
    HANDLE_CODE(sl_v2x_cfg_ded_r14.unpack(bref));
  }
  if (scell_to_add_mod_list_ext_v1430_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_ext_v1430, bref, 1, 31));
  }
  if (sib_type2_ded_r14_present) {
    HANDLE_CODE(sib_type2_ded_r14.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sl_v2x_cfg_ded_r14_present) {
    j.write_fieldname("sl-V2X-ConfigDedicated-r14");
    sl_v2x_cfg_ded_r14.to_json(j);
  }
  if (scell_to_add_mod_list_ext_v1430_present) {
    j.start_array("sCellToAddModListExt-v1430");
    for (const auto& e1 : scell_to_add_mod_list_ext_v1430) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (per_cc_gap_ind_request_r14_present) {
    j.write_str("perCC-GapIndicationRequest-r14", "true");
  }
  if (sib_type2_ded_r14_present) {
    j.write_str("systemInformationBlockType2Dedicated-r14", sib_type2_ded_r14.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  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-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));

  if (rr_cfg_ded_scg_r12_present) {
    HANDLE_CODE(rr_cfg_ded_scg_r12.pack(bref));
  }
  if (scell_to_release_list_scg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_release_list_scg_r12, 1, 4, integer_packer<uint8_t>(1, 7)));
  }
  if (pscell_to_add_mod_r12_present) {
    HANDLE_CODE(pscell_to_add_mod_r12.pack(bref));
  }
  if (scell_to_add_mod_list_scg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_r12, 1, 4));
  }
  if (mob_ctrl_info_scg_r12_present) {
    HANDLE_CODE(mob_ctrl_info_scg_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= scell_to_release_list_scg_ext_r13.is_present();
    group_flags[0] |= scell_to_add_mod_list_scg_ext_r13.is_present();
    group_flags[1] |= scell_to_add_mod_list_scg_ext_v1370.is_present();
    group_flags[2] |= pscell_to_add_mod_v1440.is_present();
    group_flags[3] |= scell_group_to_release_list_scg_r15.is_present();
    group_flags[3] |= scell_group_to_add_mod_list_scg_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(scell_to_release_list_scg_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_ext_r13.is_present(), 1));
      if (scell_to_release_list_scg_ext_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *scell_to_release_list_scg_ext_r13, 1, 31, integer_packer<uint8_t>(1, 31)));
      }
      if (scell_to_add_mod_list_scg_ext_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *scell_to_add_mod_list_scg_ext_r13, 1, 31));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_ext_v1370.is_present(), 1));
      if (scell_to_add_mod_list_scg_ext_v1370.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *scell_to_add_mod_list_scg_ext_v1370, 1, 31));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pscell_to_add_mod_v1440.is_present(), 1));
      if (pscell_to_add_mod_v1440.is_present()) {
        HANDLE_CODE(pscell_to_add_mod_v1440->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(scell_group_to_release_list_scg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(scell_group_to_add_mod_list_scg_r15.is_present(), 1));
      if (scell_group_to_release_list_scg_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *scell_group_to_release_list_scg_r15, 1, 4, integer_packer<uint8_t>(1, 4)));
      }
      if (scell_group_to_add_mod_list_scg_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *scell_group_to_add_mod_list_scg_r15, 1, 4));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_part_scg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rr_cfg_ded_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_release_list_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(pscell_to_add_mod_r12_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(mob_ctrl_info_scg_r12_present, 1));

  if (rr_cfg_ded_scg_r12_present) {
    HANDLE_CODE(rr_cfg_ded_scg_r12.unpack(bref));
  }
  if (scell_to_release_list_scg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_release_list_scg_r12, bref, 1, 4, integer_packer<uint8_t>(1, 7)));
  }
  if (pscell_to_add_mod_r12_present) {
    HANDLE_CODE(pscell_to_add_mod_r12.unpack(bref));
  }
  if (scell_to_add_mod_list_scg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_r12, bref, 1, 4));
  }
  if (mob_ctrl_info_scg_r12_present) {
    HANDLE_CODE(mob_ctrl_info_scg_r12.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);

      bool scell_to_release_list_scg_ext_r13_present;
      HANDLE_CODE(bref.unpack(scell_to_release_list_scg_ext_r13_present, 1));
      scell_to_release_list_scg_ext_r13.set_present(scell_to_release_list_scg_ext_r13_present);
      bool scell_to_add_mod_list_scg_ext_r13_present;
      HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_ext_r13_present, 1));
      scell_to_add_mod_list_scg_ext_r13.set_present(scell_to_add_mod_list_scg_ext_r13_present);
      if (scell_to_release_list_scg_ext_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*scell_to_release_list_scg_ext_r13, bref, 1, 31, integer_packer<uint8_t>(1, 31)));
      }
      if (scell_to_add_mod_list_scg_ext_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*scell_to_add_mod_list_scg_ext_r13, bref, 1, 31));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool scell_to_add_mod_list_scg_ext_v1370_present;
      HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_ext_v1370_present, 1));
      scell_to_add_mod_list_scg_ext_v1370.set_present(scell_to_add_mod_list_scg_ext_v1370_present);
      if (scell_to_add_mod_list_scg_ext_v1370.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*scell_to_add_mod_list_scg_ext_v1370, bref, 1, 31));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool pscell_to_add_mod_v1440_present;
      HANDLE_CODE(bref.unpack(pscell_to_add_mod_v1440_present, 1));
      pscell_to_add_mod_v1440.set_present(pscell_to_add_mod_v1440_present);
      if (pscell_to_add_mod_v1440.is_present()) {
        HANDLE_CODE(pscell_to_add_mod_v1440->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool scell_group_to_release_list_scg_r15_present;
      HANDLE_CODE(bref.unpack(scell_group_to_release_list_scg_r15_present, 1));
      scell_group_to_release_list_scg_r15.set_present(scell_group_to_release_list_scg_r15_present);
      bool scell_group_to_add_mod_list_scg_r15_present;
      HANDLE_CODE(bref.unpack(scell_group_to_add_mod_list_scg_r15_present, 1));
      scell_group_to_add_mod_list_scg_r15.set_present(scell_group_to_add_mod_list_scg_r15_present);
      if (scell_group_to_release_list_scg_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*scell_group_to_release_list_scg_r15, bref, 1, 4, integer_packer<uint8_t>(1, 4)));
      }
      if (scell_group_to_add_mod_list_scg_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*scell_group_to_add_mod_list_scg_r15, bref, 1, 4));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void scg_cfg_part_scg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rr_cfg_ded_scg_r12_present) {
    j.write_fieldname("radioResourceConfigDedicatedSCG-r12");
    rr_cfg_ded_scg_r12.to_json(j);
  }
  if (scell_to_release_list_scg_r12_present) {
    j.start_array("sCellToReleaseListSCG-r12");
    for (const auto& e1 : scell_to_release_list_scg_r12) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (pscell_to_add_mod_r12_present) {
    j.write_fieldname("pSCellToAddMod-r12");
    pscell_to_add_mod_r12.to_json(j);
  }
  if (scell_to_add_mod_list_scg_r12_present) {
    j.start_array("sCellToAddModListSCG-r12");
    for (const auto& e1 : scell_to_add_mod_list_scg_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (mob_ctrl_info_scg_r12_present) {
    j.write_fieldname("mobilityControlInfoSCG-r12");
    mob_ctrl_info_scg_r12.to_json(j);
  }
  if (ext) {
    if (scell_to_release_list_scg_ext_r13.is_present()) {
      j.start_array("sCellToReleaseListSCG-Ext-r13");
      for (const auto& e1 : *scell_to_release_list_scg_ext_r13) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (scell_to_add_mod_list_scg_ext_r13.is_present()) {
      j.start_array("sCellToAddModListSCG-Ext-r13");
      for (const auto& e1 : *scell_to_add_mod_list_scg_ext_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (scell_to_add_mod_list_scg_ext_v1370.is_present()) {
      j.start_array("sCellToAddModListSCG-Ext-v1370");
      for (const auto& e1 : *scell_to_add_mod_list_scg_ext_v1370) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (pscell_to_add_mod_v1440.is_present()) {
      j.write_fieldname("pSCellToAddMod-v1440");
      pscell_to_add_mod_v1440->to_json(j);
    }
    if (scell_group_to_release_list_scg_r15.is_present()) {
      j.start_array("sCellGroupToReleaseListSCG-r15");
      for (const auto& e1 : *scell_group_to_release_list_scg_r15) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (scell_group_to_add_mod_list_scg_r15.is_present()) {
      j.start_array("sCellGroupToAddModListSCG-r15");
      for (const auto& e1 : *scell_group_to_add_mod_list_scg_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  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
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(disc_tx_freq_to_add_mod_list_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_freq_to_release_list_r13_present, 1));

  if (disc_tx_freq_to_add_mod_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_tx_freq_to_add_mod_list_r13, 1, 8));
  }
  if (disc_tx_freq_to_release_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_tx_freq_to_release_list_r13, 1, 8, integer_packer<uint32_t>(0, 262143)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_info_inter_freq_list_add_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(disc_tx_freq_to_add_mod_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_freq_to_release_list_r13_present, 1));

  if (disc_tx_freq_to_add_mod_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_tx_freq_to_add_mod_list_r13, bref, 1, 8));
  }
  if (disc_tx_freq_to_release_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_tx_freq_to_release_list_r13, bref, 1, 8, integer_packer<uint32_t>(0, 262143)));
  }

  return SRSASN_SUCCESS;
}
void sl_disc_tx_info_inter_freq_list_add_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (disc_tx_freq_to_add_mod_list_r13_present) {
    j.start_array("discTxFreqToAddModList-r13");
    for (const auto& e1 : disc_tx_freq_to_add_mod_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_tx_freq_to_release_list_r13_present) {
    j.start_array("discTxFreqToReleaseList-r13");
    for (const auto& e1 : disc_tx_freq_to_release_list_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.end_obj();
}

// SL-GapConfig-r13 ::= SEQUENCE
SRSASN_CODE sl_gap_cfg_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, gap_pattern_list_r13, 1, 8));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_gap_cfg_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(gap_pattern_list_r13, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void sl_gap_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("gapPatternList-r13");
  for (const auto& e1 : gap_pattern_list_r13) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// AltTTT-CellsToAddMod-r12 ::= SEQUENCE
SRSASN_CODE alt_ttt_cells_to_add_mod_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cell_idx_r12, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pci_range_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE alt_ttt_cells_to_add_mod_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cell_idx_r12, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pci_range_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void alt_ttt_cells_to_add_mod_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellIndex-r12", cell_idx_r12);
  j.write_fieldname("physCellIdRange-r12");
  pci_range_r12.to_json(j);
  j.end_obj();
}

// BlackCellsToAddMod ::= SEQUENCE
SRSASN_CODE black_cells_to_add_mod_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cell_idx, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pci_range.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE black_cells_to_add_mod_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cell_idx, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pci_range.unpack(bref));

  return SRSASN_SUCCESS;
}
void black_cells_to_add_mod_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellIndex", cell_idx);
  j.write_fieldname("physCellIdRange");
  pci_range.to_json(j);
  j.end_obj();
}

// CellsToAddMod ::= SEQUENCE
SRSASN_CODE cells_to_add_mod_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cell_idx, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(cell_individual_offset.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cells_to_add_mod_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cell_idx, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(cell_individual_offset.unpack(bref));

  return SRSASN_SUCCESS;
}
void cells_to_add_mod_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellIndex", cell_idx);
  j.write_int("physCellId", pci);
  j.write_str("cellIndividualOffset", cell_individual_offset.to_string());
  j.end_obj();
}

// CellsToAddModCDMA2000 ::= SEQUENCE
SRSASN_CODE cells_to_add_mod_cdma2000_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cell_idx, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)511u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cells_to_add_mod_cdma2000_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cell_idx, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)511u));

  return SRSASN_SUCCESS;
}
void cells_to_add_mod_cdma2000_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellIndex", cell_idx);
  j.write_int("physCellId", pci);
  j.end_obj();
}

// CellsToAddModNR-r15 ::= SEQUENCE
SRSASN_CODE cells_to_add_mod_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cell_idx_r15, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, pci_r15, (uint16_t)0u, (uint16_t)1007u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cells_to_add_mod_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cell_idx_r15, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(pci_r15, bref, (uint16_t)0u, (uint16_t)1007u));

  return SRSASN_SUCCESS;
}
void cells_to_add_mod_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellIndex-r15", cell_idx_r15);
  j.write_int("physCellId-r15", pci_r15);
  j.end_obj();
}

// CellsToAddModUTRA-FDD ::= SEQUENCE
SRSASN_CODE cells_to_add_mod_utra_fdd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cell_idx, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)511u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cells_to_add_mod_utra_fdd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cell_idx, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)511u));

  return SRSASN_SUCCESS;
}
void cells_to_add_mod_utra_fdd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellIndex", cell_idx);
  j.write_int("physCellId", pci);
  j.end_obj();
}

// CellsToAddModUTRA-TDD ::= SEQUENCE
SRSASN_CODE cells_to_add_mod_utra_tdd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cell_idx, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, pci, (uint8_t)0u, (uint8_t)127u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cells_to_add_mod_utra_tdd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cell_idx, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(pci, bref, (uint8_t)0u, (uint8_t)127u));

  return SRSASN_SUCCESS;
}
void cells_to_add_mod_utra_tdd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellIndex", cell_idx);
  j.write_int("physCellId", pci);
  j.end_obj();
}

// FlightPathInfoReportConfig-r15 ::= SEQUENCE
SRSASN_CODE flight_path_info_report_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(include_time_stamp_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, max_way_point_num_r15, (uint8_t)1u, (uint8_t)20u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE flight_path_info_report_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(include_time_stamp_r15_present, 1));

  HANDLE_CODE(unpack_integer(max_way_point_num_r15, bref, (uint8_t)1u, (uint8_t)20u));

  return SRSASN_SUCCESS;
}
void flight_path_info_report_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("maxWayPointNumber-r15", max_way_point_num_r15);
  if (include_time_stamp_r15_present) {
    j.write_str("includeTimeStamp-r15", "true");
  }
  j.end_obj();
}

// MeasIdleConfigDedicated-r15 ::= SEQUENCE
SRSASN_CODE meas_idle_cfg_ded_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_idle_carrier_list_eutra_r15_present, 1));

  if (meas_idle_carrier_list_eutra_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_idle_carrier_list_eutra_r15, 1, 8));
  }
  HANDLE_CODE(meas_idle_dur_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_idle_cfg_ded_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_idle_carrier_list_eutra_r15_present, 1));

  if (meas_idle_carrier_list_eutra_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_idle_carrier_list_eutra_r15, bref, 1, 8));
  }
  HANDLE_CODE(meas_idle_dur_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_idle_cfg_ded_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_idle_carrier_list_eutra_r15_present) {
    j.start_array("measIdleCarrierListEUTRA-r15");
    for (const auto& e1 : meas_idle_carrier_list_eutra_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_str("measIdleDuration-r15", meas_idle_dur_r15.to_string());
  j.end_obj();
}

// RRC-InactiveConfig-r15 ::= SEQUENCE
SRSASN_CODE rrc_inactive_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ran_paging_cycle_r15_present, 1));
  HANDLE_CODE(bref.pack(ran_notif_area_info_r15_present, 1));
  HANDLE_CODE(bref.pack(periodic_rnau_timer_r15_present, 1));
  HANDLE_CODE(bref.pack(next_hop_chaining_count_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(full_i_rnti_r15.pack(bref));
  HANDLE_CODE(short_i_rnti_r15.pack(bref));
  if (ran_paging_cycle_r15_present) {
    HANDLE_CODE(ran_paging_cycle_r15.pack(bref));
  }
  if (ran_notif_area_info_r15_present) {
    HANDLE_CODE(ran_notif_area_info_r15.pack(bref));
  }
  if (periodic_rnau_timer_r15_present) {
    HANDLE_CODE(periodic_rnau_timer_r15.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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_inactive_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ran_paging_cycle_r15_present, 1));
  HANDLE_CODE(bref.unpack(ran_notif_area_info_r15_present, 1));
  HANDLE_CODE(bref.unpack(periodic_rnau_timer_r15_present, 1));
  HANDLE_CODE(bref.unpack(next_hop_chaining_count_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(full_i_rnti_r15.unpack(bref));
  HANDLE_CODE(short_i_rnti_r15.unpack(bref));
  if (ran_paging_cycle_r15_present) {
    HANDLE_CODE(ran_paging_cycle_r15.unpack(bref));
  }
  if (ran_notif_area_info_r15_present) {
    HANDLE_CODE(ran_notif_area_info_r15.unpack(bref));
  }
  if (periodic_rnau_timer_r15_present) {
    HANDLE_CODE(periodic_rnau_timer_r15.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));
  }

  return SRSASN_SUCCESS;
}
void rrc_inactive_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("fullI-RNTI-r15", full_i_rnti_r15.to_string());
  j.write_str("shortI-RNTI-r15", short_i_rnti_r15.to_string());
  if (ran_paging_cycle_r15_present) {
    j.write_str("ran-PagingCycle-r15", ran_paging_cycle_r15.to_string());
  }
  if (ran_notif_area_info_r15_present) {
    j.write_fieldname("ran-NotificationAreaInfo-r15");
    ran_notif_area_info_r15.to_json(j);
  }
  if (periodic_rnau_timer_r15_present) {
    j.write_str("periodic-RNAU-timer-r15", periodic_rnau_timer_r15.to_string());
  }
  if (next_hop_chaining_count_r15_present) {
    j.write_int("nextHopChainingCount-r15", next_hop_chaining_count_r15);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RRCConnectionReconfiguration-v1310-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(scell_to_release_list_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(scell_to_add_mod_list_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(lwa_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(lwip_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(rclwi_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (scell_to_release_list_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_release_list_ext_r13, 1, 31, integer_packer<uint8_t>(1, 31)));
  }
  if (scell_to_add_mod_list_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_ext_r13, 1, 31));
  }
  if (lwa_cfg_r13_present) {
    HANDLE_CODE(lwa_cfg_r13.pack(bref));
  }
  if (lwip_cfg_r13_present) {
    HANDLE_CODE(lwip_cfg_r13.pack(bref));
  }
  if (rclwi_cfg_r13_present) {
    HANDLE_CODE(rclwi_cfg_r13.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(scell_to_release_list_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(lwa_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(lwip_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(rclwi_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (scell_to_release_list_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_release_list_ext_r13, bref, 1, 31, integer_packer<uint8_t>(1, 31)));
  }
  if (scell_to_add_mod_list_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_ext_r13, bref, 1, 31));
  }
  if (lwa_cfg_r13_present) {
    HANDLE_CODE(lwa_cfg_r13.unpack(bref));
  }
  if (lwip_cfg_r13_present) {
    HANDLE_CODE(lwip_cfg_r13.unpack(bref));
  }
  if (rclwi_cfg_r13_present) {
    HANDLE_CODE(rclwi_cfg_r13.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (scell_to_release_list_ext_r13_present) {
    j.start_array("sCellToReleaseListExt-r13");
    for (const auto& e1 : scell_to_release_list_ext_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (scell_to_add_mod_list_ext_r13_present) {
    j.start_array("sCellToAddModListExt-r13");
    for (const auto& e1 : scell_to_add_mod_list_ext_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (lwa_cfg_r13_present) {
    j.write_fieldname("lwa-Configuration-r13");
    lwa_cfg_r13.to_json(j);
  }
  if (lwip_cfg_r13_present) {
    j.write_fieldname("lwip-Configuration-r13");
    lwip_cfg_r13.to_json(j);
  }
  if (rclwi_cfg_r13_present) {
    j.write_fieldname("rclwi-Configuration-r13");
    rclwi_cfg_r13.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  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));
  }

  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));
  }

  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");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// SCG-Configuration-r12 ::= CHOICE
void scg_cfg_r12_c::set(types::options e)
{
  type_ = e;
}
void scg_cfg_r12_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_mcg_r12_present) {
        j.write_fieldname("scg-ConfigPartMCG-r12");
        j.start_obj();
        if (c.scg_cfg_part_mcg_r12.scg_counter_r12_present) {
          j.write_int("scg-Counter-r12", c.scg_cfg_part_mcg_r12.scg_counter_r12);
        }
        if (c.scg_cfg_part_mcg_r12.pwr_coordination_info_r12_present) {
          j.write_fieldname("powerCoordinationInfo-r12");
          c.scg_cfg_part_mcg_r12.pwr_coordination_info_r12.to_json(j);
        }
        j.end_obj();
      }
      if (c.scg_cfg_part_scg_r12_present) {
        j.write_fieldname("scg-ConfigPartSCG-r12");
        c.scg_cfg_part_scg_r12.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE scg_cfg_r12_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_mcg_r12_present, 1));
      HANDLE_CODE(bref.pack(c.scg_cfg_part_scg_r12_present, 1));
      if (c.scg_cfg_part_mcg_r12_present) {
        bref.pack(c.scg_cfg_part_mcg_r12.ext, 1);
        HANDLE_CODE(bref.pack(c.scg_cfg_part_mcg_r12.scg_counter_r12_present, 1));
        HANDLE_CODE(bref.pack(c.scg_cfg_part_mcg_r12.pwr_coordination_info_r12_present, 1));
        if (c.scg_cfg_part_mcg_r12.scg_counter_r12_present) {
          HANDLE_CODE(pack_integer(bref, c.scg_cfg_part_mcg_r12.scg_counter_r12, (uint32_t)0u, (uint32_t)65535u));
        }
        if (c.scg_cfg_part_mcg_r12.pwr_coordination_info_r12_present) {
          HANDLE_CODE(c.scg_cfg_part_mcg_r12.pwr_coordination_info_r12.pack(bref));
        }
      }
      if (c.scg_cfg_part_scg_r12_present) {
        HANDLE_CODE(c.scg_cfg_part_scg_r12.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_r12_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_mcg_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.scg_cfg_part_scg_r12_present, 1));
      if (c.scg_cfg_part_mcg_r12_present) {
        bref.unpack(c.scg_cfg_part_mcg_r12.ext, 1);
        HANDLE_CODE(bref.unpack(c.scg_cfg_part_mcg_r12.scg_counter_r12_present, 1));
        HANDLE_CODE(bref.unpack(c.scg_cfg_part_mcg_r12.pwr_coordination_info_r12_present, 1));
        if (c.scg_cfg_part_mcg_r12.scg_counter_r12_present) {
          HANDLE_CODE(unpack_integer(c.scg_cfg_part_mcg_r12.scg_counter_r12, bref, (uint32_t)0u, (uint32_t)65535u));
        }
        if (c.scg_cfg_part_mcg_r12.pwr_coordination_info_r12_present) {
          HANDLE_CODE(c.scg_cfg_part_mcg_r12.pwr_coordination_info_r12.unpack(bref));
        }
      }
      if (c.scg_cfg_part_scg_r12_present) {
        HANDLE_CODE(c.scg_cfg_part_scg_r12.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  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
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(comm_tx_res_r12_present, 1));

  if (comm_tx_res_r12_present) {
    HANDLE_CODE(comm_tx_res_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= comm_tx_res_v1310.is_present();
    group_flags[0] |= comm_tx_allow_relay_ded_r13_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(comm_tx_res_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(comm_tx_allow_relay_ded_r13_present, 1));
      if (comm_tx_res_v1310.is_present()) {
        HANDLE_CODE(comm_tx_res_v1310->pack(bref));
      }
      if (comm_tx_allow_relay_ded_r13_present) {
        HANDLE_CODE(bref.pack(comm_tx_allow_relay_ded_r13, 1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_cfg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(comm_tx_res_r12_present, 1));

  if (comm_tx_res_r12_present) {
    HANDLE_CODE(comm_tx_res_r12.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_res_v1310_present;
      HANDLE_CODE(bref.unpack(comm_tx_res_v1310_present, 1));
      comm_tx_res_v1310.set_present(comm_tx_res_v1310_present);
      HANDLE_CODE(bref.unpack(comm_tx_allow_relay_ded_r13_present, 1));
      if (comm_tx_res_v1310.is_present()) {
        HANDLE_CODE(comm_tx_res_v1310->unpack(bref));
      }
      if (comm_tx_allow_relay_ded_r13_present) {
        HANDLE_CODE(bref.unpack(comm_tx_allow_relay_ded_r13, 1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_comm_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (comm_tx_res_r12_present) {
    j.write_fieldname("commTxResources-r12");
    comm_tx_res_r12.to_json(j);
  }
  if (ext) {
    if (comm_tx_res_v1310.is_present()) {
      j.write_fieldname("commTxResources-v1310");
      comm_tx_res_v1310->to_json(j);
    }
    if (comm_tx_allow_relay_ded_r13_present) {
      j.write_bool("commTxAllowRelayDedicated-r13", comm_tx_allow_relay_ded_r13);
    }
  }
  j.end_obj();
}

void sl_comm_cfg_r12_s::comm_tx_res_r12_c_::set(types::options e)
{
  type_ = e;
}
void sl_comm_cfg_r12_s::comm_tx_res_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_comm_cfg_r12_s::comm_tx_res_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_cfg_r12_s::comm_tx_res_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::sched_r12:
      c.destroy<sched_r12_s_>();
      break;
    case types::ue_sel_r12:
      c.destroy<ue_sel_r12_s_>();
      break;
    default:
      break;
  }
}
void sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sched_r12:
      c.init<sched_r12_s_>();
      break;
    case types::ue_sel_r12:
      c.init<ue_sel_r12_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_");
  }
}
sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_::setup_c_(const sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sched_r12:
      c.init(other.c.get<sched_r12_s_>());
      break;
    case types::ue_sel_r12:
      c.init(other.c.get<ue_sel_r12_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_");
  }
}
sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_& sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_::
                                                 operator=(const sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sched_r12:
      c.set(other.c.get<sched_r12_s_>());
      break;
    case types::ue_sel_r12:
      c.set(other.c.get<ue_sel_r12_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_");
  }

  return *this;
}
void sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sched_r12:
      j.write_fieldname("scheduled-r12");
      j.start_obj();
      j.write_str("sl-RNTI-r12", c.get<sched_r12_s_>().sl_rnti_r12.to_string());
      j.write_fieldname("mac-MainConfig-r12");
      c.get<sched_r12_s_>().mac_main_cfg_r12.to_json(j);
      j.write_fieldname("sc-CommTxConfig-r12");
      c.get<sched_r12_s_>().sc_comm_tx_cfg_r12.to_json(j);
      if (c.get<sched_r12_s_>().mcs_r12_present) {
        j.write_int("mcs-r12", c.get<sched_r12_s_>().mcs_r12);
      }
      j.end_obj();
      break;
    case types::ue_sel_r12:
      j.write_fieldname("ue-Selected-r12");
      j.start_obj();
      j.write_fieldname("commTxPoolNormalDedicated-r12");
      j.start_obj();
      if (c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_release_list_r12_present) {
        j.start_array("poolToReleaseList-r12");
        for (const auto& e1 : c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_release_list_r12) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_add_mod_list_r12_present) {
        j.start_array("poolToAddModList-r12");
        for (const auto& e1 : c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_add_mod_list_r12) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sched_r12:
      HANDLE_CODE(bref.pack(c.get<sched_r12_s_>().mcs_r12_present, 1));
      HANDLE_CODE(c.get<sched_r12_s_>().sl_rnti_r12.pack(bref));
      HANDLE_CODE(c.get<sched_r12_s_>().mac_main_cfg_r12.pack(bref));
      HANDLE_CODE(c.get<sched_r12_s_>().sc_comm_tx_cfg_r12.pack(bref));
      if (c.get<sched_r12_s_>().mcs_r12_present) {
        HANDLE_CODE(pack_integer(bref, c.get<sched_r12_s_>().mcs_r12, (uint8_t)0u, (uint8_t)28u));
      }
      break;
    case types::ue_sel_r12:
      HANDLE_CODE(bref.pack(c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_release_list_r12_present, 1));
      HANDLE_CODE(bref.pack(c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_add_mod_list_r12_present, 1));
      if (c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_release_list_r12_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref,
                                    c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_release_list_r12,
                                    1,
                                    4,
                                    integer_packer<uint8_t>(1, 4)));
      }
      if (c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_add_mod_list_r12_present) {
        HANDLE_CODE(
            pack_dyn_seq_of(bref, c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_add_mod_list_r12, 1, 4));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sched_r12:
      HANDLE_CODE(bref.unpack(c.get<sched_r12_s_>().mcs_r12_present, 1));
      HANDLE_CODE(c.get<sched_r12_s_>().sl_rnti_r12.unpack(bref));
      HANDLE_CODE(c.get<sched_r12_s_>().mac_main_cfg_r12.unpack(bref));
      HANDLE_CODE(c.get<sched_r12_s_>().sc_comm_tx_cfg_r12.unpack(bref));
      if (c.get<sched_r12_s_>().mcs_r12_present) {
        HANDLE_CODE(unpack_integer(c.get<sched_r12_s_>().mcs_r12, bref, (uint8_t)0u, (uint8_t)28u));
      }
      break;
    case types::ue_sel_r12:
      HANDLE_CODE(bref.unpack(c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_release_list_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_add_mod_list_r12_present, 1));
      if (c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_release_list_r12_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_release_list_r12,
                                      bref,
                                      1,
                                      4,
                                      integer_packer<uint8_t>(1, 4)));
      }
      if (c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_add_mod_list_r12_present) {
        HANDLE_CODE(
            unpack_dyn_seq_of(c.get<ue_sel_r12_s_>().comm_tx_pool_normal_ded_r12.pool_to_add_mod_list_r12, bref, 1, 4));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_r12_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::set(types::options e)
{
  type_ = e;
}
void sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::sched_v1310:
      c.destroy<sched_v1310_s_>();
      break;
    case types::ue_sel_v1310:
      c.destroy<ue_sel_v1310_s_>();
      break;
    default:
      break;
  }
}
void sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sched_v1310:
      c.init<sched_v1310_s_>();
      break;
    case types::ue_sel_v1310:
      c.init<ue_sel_v1310_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_");
  }
}
sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_::setup_c_(
    const sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sched_v1310:
      c.init(other.c.get<sched_v1310_s_>());
      break;
    case types::ue_sel_v1310:
      c.init(other.c.get<ue_sel_v1310_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_");
  }
}
sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_& sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_::
                                                   operator=(const sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sched_v1310:
      c.set(other.c.get<sched_v1310_s_>());
      break;
    case types::ue_sel_v1310:
      c.set(other.c.get<ue_sel_v1310_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_");
  }

  return *this;
}
void sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sched_v1310:
      j.write_fieldname("scheduled-v1310");
      j.start_obj();
      j.start_array("logicalChGroupInfoList-r13");
      for (const auto& e1 : c.get<sched_v1310_s_>().lc_ch_group_info_list_r13) {
        j.start_array();
        for (const auto& e2 : e1) {
          j.write_int(e2);
        }
        j.end_array();
      }
      j.end_array();
      j.write_bool("multipleTx-r13", c.get<sched_v1310_s_>().multiple_tx_r13);
      j.end_obj();
      break;
    case types::ue_sel_v1310:
      j.write_fieldname("ue-Selected-v1310");
      j.start_obj();
      j.write_fieldname("commTxPoolNormalDedicatedExt-r13");
      j.start_obj();
      if (c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_release_list_ext_r13_present) {
        j.start_array("poolToReleaseListExt-r13");
        for (const auto& e1 : c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_release_list_ext_r13) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_add_mod_list_ext_r13_present) {
        j.start_array("poolToAddModListExt-r13");
        for (const auto& e1 : c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_add_mod_list_ext_r13) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sched_v1310:
      HANDLE_CODE(pack_dyn_seq_of(bref,
                                  c.get<sched_v1310_s_>().lc_ch_group_info_list_r13,
                                  1,
                                  4,
                                  SeqOfPacker<integer_packer<uint8_t> >(1, 8, integer_packer<uint8_t>(1, 8))));
      HANDLE_CODE(bref.pack(c.get<sched_v1310_s_>().multiple_tx_r13, 1));
      break;
    case types::ue_sel_v1310:
      HANDLE_CODE(
          bref.pack(c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_release_list_ext_r13_present, 1));
      HANDLE_CODE(
          bref.pack(c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_add_mod_list_ext_r13_present, 1));
      if (c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_release_list_ext_r13_present) {
        HANDLE_CODE(
            pack_dyn_seq_of(bref,
                            c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_release_list_ext_r13,
                            1,
                            4,
                            integer_packer<uint8_t>(5, 8)));
      }
      if (c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_add_mod_list_ext_r13_present) {
        HANDLE_CODE(pack_dyn_seq_of(
            bref, c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_add_mod_list_ext_r13, 1, 4));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sched_v1310:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<sched_v1310_s_>().lc_ch_group_info_list_r13,
                                    bref,
                                    1,
                                    4,
                                    SeqOfPacker<integer_packer<uint8_t> >(1, 8, integer_packer<uint8_t>(1, 8))));
      HANDLE_CODE(bref.unpack(c.get<sched_v1310_s_>().multiple_tx_r13, 1));
      break;
    case types::ue_sel_v1310:
      HANDLE_CODE(bref.unpack(
          c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_release_list_ext_r13_present, 1));
      HANDLE_CODE(bref.unpack(
          c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_add_mod_list_ext_r13_present, 1));
      if (c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_release_list_ext_r13_present) {
        HANDLE_CODE(
            unpack_dyn_seq_of(c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_release_list_ext_r13,
                              bref,
                              1,
                              4,
                              integer_packer<uint8_t>(5, 8)));
      }
      if (c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_add_mod_list_ext_r13_present) {
        HANDLE_CODE(unpack_dyn_seq_of(
            c.get<ue_sel_v1310_s_>().comm_tx_pool_normal_ded_ext_r13.pool_to_add_mod_list_ext_r13, bref, 1, 4));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_comm_cfg_r12_s::comm_tx_res_v1310_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-DiscConfig-r12 ::= SEQUENCE
SRSASN_CODE sl_disc_cfg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(disc_tx_res_r12_present, 1));

  if (disc_tx_res_r12_present) {
    HANDLE_CODE(disc_tx_res_r12.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= disc_tf_idx_list_v1260.is_present();
    group_flags[1] |= disc_tx_res_ps_r13.is_present();
    group_flags[1] |= disc_tx_inter_freq_info_r13.is_present();
    group_flags[1] |= gap_requests_allowed_ded_r13_present;
    group_flags[1] |= disc_rx_gap_cfg_r13.is_present();
    group_flags[1] |= disc_tx_gap_cfg_r13.is_present();
    group_flags[1] |= disc_sys_info_to_report_cfg_r13.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(disc_tf_idx_list_v1260.is_present(), 1));
      if (disc_tf_idx_list_v1260.is_present()) {
        HANDLE_CODE(disc_tf_idx_list_v1260->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(disc_tx_res_ps_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(disc_tx_inter_freq_info_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(gap_requests_allowed_ded_r13_present, 1));
      HANDLE_CODE(bref.pack(disc_rx_gap_cfg_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(disc_tx_gap_cfg_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(disc_sys_info_to_report_cfg_r13.is_present(), 1));
      if (disc_tx_res_ps_r13.is_present()) {
        HANDLE_CODE(disc_tx_res_ps_r13->pack(bref));
      }
      if (disc_tx_inter_freq_info_r13.is_present()) {
        HANDLE_CODE(disc_tx_inter_freq_info_r13->pack(bref));
      }
      if (gap_requests_allowed_ded_r13_present) {
        HANDLE_CODE(bref.pack(gap_requests_allowed_ded_r13, 1));
      }
      if (disc_rx_gap_cfg_r13.is_present()) {
        HANDLE_CODE(disc_rx_gap_cfg_r13->pack(bref));
      }
      if (disc_tx_gap_cfg_r13.is_present()) {
        HANDLE_CODE(disc_tx_gap_cfg_r13->pack(bref));
      }
      if (disc_sys_info_to_report_cfg_r13.is_present()) {
        HANDLE_CODE(disc_sys_info_to_report_cfg_r13->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(disc_tx_res_r12_present, 1));

  if (disc_tx_res_r12_present) {
    HANDLE_CODE(disc_tx_res_r12.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 disc_tf_idx_list_v1260_present;
      HANDLE_CODE(bref.unpack(disc_tf_idx_list_v1260_present, 1));
      disc_tf_idx_list_v1260.set_present(disc_tf_idx_list_v1260_present);
      if (disc_tf_idx_list_v1260.is_present()) {
        HANDLE_CODE(disc_tf_idx_list_v1260->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool disc_tx_res_ps_r13_present;
      HANDLE_CODE(bref.unpack(disc_tx_res_ps_r13_present, 1));
      disc_tx_res_ps_r13.set_present(disc_tx_res_ps_r13_present);
      bool disc_tx_inter_freq_info_r13_present;
      HANDLE_CODE(bref.unpack(disc_tx_inter_freq_info_r13_present, 1));
      disc_tx_inter_freq_info_r13.set_present(disc_tx_inter_freq_info_r13_present);
      HANDLE_CODE(bref.unpack(gap_requests_allowed_ded_r13_present, 1));
      bool disc_rx_gap_cfg_r13_present;
      HANDLE_CODE(bref.unpack(disc_rx_gap_cfg_r13_present, 1));
      disc_rx_gap_cfg_r13.set_present(disc_rx_gap_cfg_r13_present);
      bool disc_tx_gap_cfg_r13_present;
      HANDLE_CODE(bref.unpack(disc_tx_gap_cfg_r13_present, 1));
      disc_tx_gap_cfg_r13.set_present(disc_tx_gap_cfg_r13_present);
      bool disc_sys_info_to_report_cfg_r13_present;
      HANDLE_CODE(bref.unpack(disc_sys_info_to_report_cfg_r13_present, 1));
      disc_sys_info_to_report_cfg_r13.set_present(disc_sys_info_to_report_cfg_r13_present);
      if (disc_tx_res_ps_r13.is_present()) {
        HANDLE_CODE(disc_tx_res_ps_r13->unpack(bref));
      }
      if (disc_tx_inter_freq_info_r13.is_present()) {
        HANDLE_CODE(disc_tx_inter_freq_info_r13->unpack(bref));
      }
      if (gap_requests_allowed_ded_r13_present) {
        HANDLE_CODE(bref.unpack(gap_requests_allowed_ded_r13, 1));
      }
      if (disc_rx_gap_cfg_r13.is_present()) {
        HANDLE_CODE(disc_rx_gap_cfg_r13->unpack(bref));
      }
      if (disc_tx_gap_cfg_r13.is_present()) {
        HANDLE_CODE(disc_tx_gap_cfg_r13->unpack(bref));
      }
      if (disc_sys_info_to_report_cfg_r13.is_present()) {
        HANDLE_CODE(disc_sys_info_to_report_cfg_r13->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_disc_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (disc_tx_res_r12_present) {
    j.write_fieldname("discTxResources-r12");
    disc_tx_res_r12.to_json(j);
  }
  if (ext) {
    if (disc_tf_idx_list_v1260.is_present()) {
      j.write_fieldname("discTF-IndexList-v1260");
      disc_tf_idx_list_v1260->to_json(j);
    }
    if (disc_tx_res_ps_r13.is_present()) {
      j.write_fieldname("discTxResourcesPS-r13");
      disc_tx_res_ps_r13->to_json(j);
    }
    if (disc_tx_inter_freq_info_r13.is_present()) {
      j.write_fieldname("discTxInterFreqInfo-r13");
      disc_tx_inter_freq_info_r13->to_json(j);
    }
    if (gap_requests_allowed_ded_r13_present) {
      j.write_bool("gapRequestsAllowedDedicated-r13", gap_requests_allowed_ded_r13);
    }
    if (disc_rx_gap_cfg_r13.is_present()) {
      j.write_fieldname("discRxGapConfig-r13");
      disc_rx_gap_cfg_r13->to_json(j);
    }
    if (disc_tx_gap_cfg_r13.is_present()) {
      j.write_fieldname("discTxGapConfig-r13");
      disc_tx_gap_cfg_r13->to_json(j);
    }
    if (disc_sys_info_to_report_cfg_r13.is_present()) {
      j.write_fieldname("discSysInfoToReportConfig-r13");
      disc_sys_info_to_report_cfg_r13->to_json(j);
    }
  }
  j.end_obj();
}

void sl_disc_cfg_r12_s::disc_tx_res_r12_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_cfg_r12_s::disc_tx_res_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_res_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_res_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::sched_r12:
      c.destroy<sched_r12_s_>();
      break;
    case types::ue_sel_r12:
      c.destroy<ue_sel_r12_s_>();
      break;
    default:
      break;
  }
}
void sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sched_r12:
      c.init<sched_r12_s_>();
      break;
    case types::ue_sel_r12:
      c.init<ue_sel_r12_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_");
  }
}
sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_::setup_c_(const sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sched_r12:
      c.init(other.c.get<sched_r12_s_>());
      break;
    case types::ue_sel_r12:
      c.init(other.c.get<ue_sel_r12_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_");
  }
}
sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_& sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_::
                                                 operator=(const sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sched_r12:
      c.set(other.c.get<sched_r12_s_>());
      break;
    case types::ue_sel_r12:
      c.set(other.c.get<ue_sel_r12_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_");
  }

  return *this;
}
void sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sched_r12:
      j.write_fieldname("scheduled-r12");
      j.start_obj();
      if (c.get<sched_r12_s_>().disc_tx_cfg_r12_present) {
        j.write_fieldname("discTxConfig-r12");
        c.get<sched_r12_s_>().disc_tx_cfg_r12.to_json(j);
      }
      if (c.get<sched_r12_s_>().disc_tf_idx_list_r12_present) {
        j.start_array("discTF-IndexList-r12");
        for (const auto& e1 : c.get<sched_r12_s_>().disc_tf_idx_list_r12) {
          e1.to_json(j);
        }
        j.end_array();
      }
      if (c.get<sched_r12_s_>().disc_hop_cfg_r12_present) {
        j.write_fieldname("discHoppingConfig-r12");
        c.get<sched_r12_s_>().disc_hop_cfg_r12.to_json(j);
      }
      j.end_obj();
      break;
    case types::ue_sel_r12:
      j.write_fieldname("ue-Selected-r12");
      j.start_obj();
      if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12_present) {
        j.write_fieldname("discTxPoolDedicated-r12");
        j.start_obj();
        if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_release_list_r12_present) {
          j.start_array("poolToReleaseList-r12");
          for (const auto& e1 : c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_release_list_r12) {
            j.write_int(e1);
          }
          j.end_array();
        }
        if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_add_mod_list_r12_present) {
          j.start_array("poolToAddModList-r12");
          for (const auto& e1 : c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_add_mod_list_r12) {
            e1.to_json(j);
          }
          j.end_array();
        }
        j.end_obj();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sched_r12:
      HANDLE_CODE(bref.pack(c.get<sched_r12_s_>().disc_tx_cfg_r12_present, 1));
      HANDLE_CODE(bref.pack(c.get<sched_r12_s_>().disc_tf_idx_list_r12_present, 1));
      HANDLE_CODE(bref.pack(c.get<sched_r12_s_>().disc_hop_cfg_r12_present, 1));
      if (c.get<sched_r12_s_>().disc_tx_cfg_r12_present) {
        HANDLE_CODE(c.get<sched_r12_s_>().disc_tx_cfg_r12.pack(bref));
      }
      if (c.get<sched_r12_s_>().disc_tf_idx_list_r12_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.get<sched_r12_s_>().disc_tf_idx_list_r12, 1, 64));
      }
      if (c.get<sched_r12_s_>().disc_hop_cfg_r12_present) {
        HANDLE_CODE(c.get<sched_r12_s_>().disc_hop_cfg_r12.pack(bref));
      }
      break;
    case types::ue_sel_r12:
      HANDLE_CODE(bref.pack(c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12_present, 1));
      if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12_present) {
        HANDLE_CODE(bref.pack(c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_release_list_r12_present, 1));
        HANDLE_CODE(bref.pack(c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_add_mod_list_r12_present, 1));
        if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_release_list_r12_present) {
          HANDLE_CODE(pack_dyn_seq_of(bref,
                                      c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_release_list_r12,
                                      1,
                                      4,
                                      integer_packer<uint8_t>(1, 4)));
        }
        if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_add_mod_list_r12_present) {
          HANDLE_CODE(
              pack_dyn_seq_of(bref, c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_add_mod_list_r12, 1, 4));
        }
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sched_r12:
      HANDLE_CODE(bref.unpack(c.get<sched_r12_s_>().disc_tx_cfg_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.get<sched_r12_s_>().disc_tf_idx_list_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.get<sched_r12_s_>().disc_hop_cfg_r12_present, 1));
      if (c.get<sched_r12_s_>().disc_tx_cfg_r12_present) {
        HANDLE_CODE(c.get<sched_r12_s_>().disc_tx_cfg_r12.unpack(bref));
      }
      if (c.get<sched_r12_s_>().disc_tf_idx_list_r12_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.get<sched_r12_s_>().disc_tf_idx_list_r12, bref, 1, 64));
      }
      if (c.get<sched_r12_s_>().disc_hop_cfg_r12_present) {
        HANDLE_CODE(c.get<sched_r12_s_>().disc_hop_cfg_r12.unpack(bref));
      }
      break;
    case types::ue_sel_r12:
      HANDLE_CODE(bref.unpack(c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12_present, 1));
      if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12_present) {
        HANDLE_CODE(bref.unpack(c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_release_list_r12_present, 1));
        HANDLE_CODE(bref.unpack(c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_add_mod_list_r12_present, 1));
        if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_release_list_r12_present) {
          HANDLE_CODE(unpack_dyn_seq_of(c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_release_list_r12,
                                        bref,
                                        1,
                                        4,
                                        integer_packer<uint8_t>(1, 4)));
        }
        if (c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_add_mod_list_r12_present) {
          HANDLE_CODE(
              unpack_dyn_seq_of(c.get<ue_sel_r12_s_>().disc_tx_pool_ded_r12.pool_to_add_mod_list_r12, bref, 1, 4));
        }
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_r12_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_cfg_r12_s::disc_tf_idx_list_v1260_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_cfg_r12_s::disc_tf_idx_list_v1260_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("discTF-IndexList-r12b");
      for (const auto& e1 : c.disc_tf_idx_list_r12b) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tf_idx_list_v1260_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tf_idx_list_v1260_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.disc_tf_idx_list_r12b, 1, 64));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tf_idx_list_v1260_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tf_idx_list_v1260_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.disc_tf_idx_list_r12b, bref, 1, 64));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tf_idx_list_v1260_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_::destroy_()
{
  switch (type_) {
    case types::sched_r13:
      c.destroy<sl_disc_tx_cfg_sched_r13_s>();
      break;
    case types::ue_sel_r13:
      c.destroy<ue_sel_r13_s_>();
      break;
    default:
      break;
  }
}
void sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sched_r13:
      c.init<sl_disc_tx_cfg_sched_r13_s>();
      break;
    case types::ue_sel_r13:
      c.init<ue_sel_r13_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_");
  }
}
sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_::setup_c_(
    const sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sched_r13:
      c.init(other.c.get<sl_disc_tx_cfg_sched_r13_s>());
      break;
    case types::ue_sel_r13:
      c.init(other.c.get<ue_sel_r13_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_");
  }
}
sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_& sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_::
                                                    operator=(const sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sched_r13:
      c.set(other.c.get<sl_disc_tx_cfg_sched_r13_s>());
      break;
    case types::ue_sel_r13:
      c.set(other.c.get<ue_sel_r13_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_");
  }

  return *this;
}
void sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sched_r13:
      j.write_fieldname("scheduled-r13");
      c.get<sl_disc_tx_cfg_sched_r13_s>().to_json(j);
      break;
    case types::ue_sel_r13:
      j.write_fieldname("ue-Selected-r13");
      j.start_obj();
      j.write_fieldname("discTxPoolPS-Dedicated-r13");
      c.get<ue_sel_r13_s_>().disc_tx_pool_ps_ded_r13.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sched_r13:
      HANDLE_CODE(c.get<sl_disc_tx_cfg_sched_r13_s>().pack(bref));
      break;
    case types::ue_sel_r13:
      HANDLE_CODE(c.get<ue_sel_r13_s_>().disc_tx_pool_ps_ded_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sched_r13:
      HANDLE_CODE(c.get<sl_disc_tx_cfg_sched_r13_s>().unpack(bref));
      break;
    case types::ue_sel_r13:
      HANDLE_CODE(c.get<ue_sel_r13_s_>().disc_tx_pool_ps_ded_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_res_ps_r13_c_::setup_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_cfg_r12_s::disc_tx_inter_freq_info_r13_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_cfg_r12_s::disc_tx_inter_freq_info_r13_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.disc_tx_carrier_freq_r13_present) {
        j.write_int("discTxCarrierFreq-r13", c.disc_tx_carrier_freq_r13);
      }
      if (c.disc_tx_ref_carrier_ded_r13_present) {
        j.write_fieldname("discTxRefCarrierDedicated-r13");
        c.disc_tx_ref_carrier_ded_r13.to_json(j);
      }
      if (c.disc_tx_info_inter_freq_list_add_r13_present) {
        j.write_fieldname("discTxInfoInterFreqListAdd-r13");
        c.disc_tx_info_inter_freq_list_add_r13.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_inter_freq_info_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_inter_freq_info_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.disc_tx_carrier_freq_r13_present, 1));
      HANDLE_CODE(bref.pack(c.disc_tx_ref_carrier_ded_r13_present, 1));
      HANDLE_CODE(bref.pack(c.disc_tx_info_inter_freq_list_add_r13_present, 1));
      if (c.disc_tx_carrier_freq_r13_present) {
        HANDLE_CODE(pack_integer(bref, c.disc_tx_carrier_freq_r13, (uint32_t)0u, (uint32_t)262143u));
      }
      if (c.disc_tx_ref_carrier_ded_r13_present) {
        HANDLE_CODE(c.disc_tx_ref_carrier_ded_r13.pack(bref));
      }
      if (c.disc_tx_info_inter_freq_list_add_r13_present) {
        HANDLE_CODE(c.disc_tx_info_inter_freq_list_add_r13.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_inter_freq_info_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_inter_freq_info_r13_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.disc_tx_carrier_freq_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.disc_tx_ref_carrier_ded_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.disc_tx_info_inter_freq_list_add_r13_present, 1));
      if (c.disc_tx_carrier_freq_r13_present) {
        HANDLE_CODE(unpack_integer(c.disc_tx_carrier_freq_r13, bref, (uint32_t)0u, (uint32_t)262143u));
      }
      if (c.disc_tx_ref_carrier_ded_r13_present) {
        HANDLE_CODE(c.disc_tx_ref_carrier_ded_r13.unpack(bref));
      }
      if (c.disc_tx_info_inter_freq_list_add_r13_present) {
        HANDLE_CODE(c.disc_tx_info_inter_freq_list_add_r13.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_inter_freq_info_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_cfg_r12_s::disc_rx_gap_cfg_r13_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_cfg_r12_s::disc_rx_gap_cfg_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_rx_gap_cfg_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_rx_gap_cfg_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_rx_gap_cfg_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_rx_gap_cfg_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_rx_gap_cfg_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_cfg_r12_s::disc_tx_gap_cfg_r13_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_cfg_r12_s::disc_tx_gap_cfg_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_fieldname("setup");
      c.to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_gap_cfg_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_gap_cfg_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_gap_cfg_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_tx_gap_cfg_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_tx_gap_cfg_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sl_disc_cfg_r12_s::disc_sys_info_to_report_cfg_r13_c_::set(types::options e)
{
  type_ = e;
}
void sl_disc_cfg_r12_s::disc_sys_info_to_report_cfg_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        j.write_int(e1);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_sys_info_to_report_cfg_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_sys_info_to_report_cfg_r13_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, 1, 8, integer_packer<uint32_t>(0, 262143)));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_sys_info_to_report_cfg_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_cfg_r12_s::disc_sys_info_to_report_cfg_r13_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, bref, 1, 8, integer_packer<uint32_t>(0, 262143)));
      break;
    default:
      log_invalid_choice_id(type_, "sl_disc_cfg_r12_s::disc_sys_info_to_report_cfg_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-SyncTxControl-r12 ::= SEQUENCE
SRSASN_CODE sl_sync_tx_ctrl_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(network_ctrl_sync_tx_r12_present, 1));

  if (network_ctrl_sync_tx_r12_present) {
    HANDLE_CODE(network_ctrl_sync_tx_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_sync_tx_ctrl_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(network_ctrl_sync_tx_r12_present, 1));

  if (network_ctrl_sync_tx_r12_present) {
    HANDLE_CODE(network_ctrl_sync_tx_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_sync_tx_ctrl_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (network_ctrl_sync_tx_r12_present) {
    j.write_str("networkControlledSyncTx-r12", network_ctrl_sync_tx_r12.to_string());
  }
  j.end_obj();
}

// UECapabilityEnquiry-v1530-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_enquiry_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(request_stti_spt_cap_r15_present, 1));
  HANDLE_CODE(bref.pack(eutra_nr_only_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_enquiry_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(request_stti_spt_cap_r15_present, 1));
  HANDLE_CODE(bref.unpack(eutra_nr_only_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
void ue_cap_enquiry_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (request_stti_spt_cap_r15_present) {
    j.write_str("requestSTTI-SPT-Capability-r15", "true");
  }
  if (eutra_nr_only_r15_present) {
    j.write_str("eutra-nr-only-r15", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// WhiteCellsToAddMod-r13 ::= SEQUENCE
SRSASN_CODE white_cells_to_add_mod_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, cell_idx_r13, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pci_range_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE white_cells_to_add_mod_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(cell_idx_r13, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pci_range_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void white_cells_to_add_mod_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("cellIndex-r13", cell_idx_r13);
  j.write_fieldname("physCellIdRange-r13");
  pci_range_r13.to_json(j);
  j.end_obj();
}

// BT-NameListConfig-r15 ::= CHOICE
void bt_name_list_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void bt_name_list_cfg_r15_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        j.write_str(e1.to_string());
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "bt_name_list_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE bt_name_list_cfg_r15_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, 1, 4));
      break;
    default:
      log_invalid_choice_id(type_, "bt_name_list_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE bt_name_list_cfg_r15_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, bref, 1, 4));
      break;
    default:
      log_invalid_choice_id(type_, "bt_name_list_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSG-AllowedReportingCells-r9 ::= SEQUENCE
SRSASN_CODE csg_allowed_report_cells_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pci_range_utra_fdd_list_r9_present, 1));

  if (pci_range_utra_fdd_list_r9_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, pci_range_utra_fdd_list_r9, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csg_allowed_report_cells_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pci_range_utra_fdd_list_r9_present, 1));

  if (pci_range_utra_fdd_list_r9_present) {
    HANDLE_CODE(unpack_dyn_seq_of(pci_range_utra_fdd_list_r9, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void csg_allowed_report_cells_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pci_range_utra_fdd_list_r9_present) {
    j.start_array("physCellIdRangeUTRA-FDDList-r9");
    for (const auto& e1 : pci_range_utra_fdd_list_r9) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// CarrierFreqGERAN ::= SEQUENCE
SRSASN_CODE carrier_freq_geran_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, arfcn, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(band_ind.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freq_geran_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(arfcn, bref, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(band_ind.unpack(bref));

  return SRSASN_SUCCESS;
}
void carrier_freq_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("arfcn", arfcn);
  j.write_str("bandIndicator", band_ind.to_string());
  j.end_obj();
}

// MeasDS-Config-r12 ::= CHOICE
void meas_ds_cfg_r12_c::set(types::options e)
{
  type_ = e;
}
void meas_ds_cfg_r12_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("dmtc-PeriodOffset-r12");
      c.dmtc_period_offset_r12.to_json(j);
      j.write_fieldname("ds-OccasionDuration-r12");
      c.ds_occasion_dur_r12.to_json(j);
      if (c.meas_csi_rs_to_rem_list_r12_present) {
        j.start_array("measCSI-RS-ToRemoveList-r12");
        for (const auto& e1 : c.meas_csi_rs_to_rem_list_r12) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.meas_csi_rs_to_add_mod_list_r12_present) {
        j.start_array("measCSI-RS-ToAddModList-r12");
        for (const auto& e1 : c.meas_csi_rs_to_add_mod_list_r12) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE meas_ds_cfg_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.meas_csi_rs_to_rem_list_r12_present, 1));
      HANDLE_CODE(bref.pack(c.meas_csi_rs_to_add_mod_list_r12_present, 1));
      HANDLE_CODE(c.dmtc_period_offset_r12.pack(bref));
      HANDLE_CODE(c.ds_occasion_dur_r12.pack(bref));
      if (c.meas_csi_rs_to_rem_list_r12_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.meas_csi_rs_to_rem_list_r12, 1, 96, integer_packer<uint8_t>(1, 96)));
      }
      if (c.meas_csi_rs_to_add_mod_list_r12_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.meas_csi_rs_to_add_mod_list_r12, 1, 96));
      }
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_ds_cfg_r12_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.meas_csi_rs_to_rem_list_r12_present, 1));
      HANDLE_CODE(bref.unpack(c.meas_csi_rs_to_add_mod_list_r12_present, 1));
      HANDLE_CODE(c.dmtc_period_offset_r12.unpack(bref));
      HANDLE_CODE(c.ds_occasion_dur_r12.unpack(bref));
      if (c.meas_csi_rs_to_rem_list_r12_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.meas_csi_rs_to_rem_list_r12, bref, 1, 96, integer_packer<uint8_t>(1, 96)));
      }
      if (c.meas_csi_rs_to_add_mod_list_r12_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.meas_csi_rs_to_add_mod_list_r12, bref, 1, 96));
      }
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_::destroy_() {}
void meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_::dmtc_period_offset_r12_c_(
    const meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ms40_r12:
      c.init(other.c.get<uint8_t>());
      break;
    case types::ms80_r12:
      c.init(other.c.get<uint8_t>());
      break;
    case types::ms160_r12:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_");
  }
}
meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_& meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_::
                                                        operator=(const meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ms40_r12:
      c.set(other.c.get<uint8_t>());
      break;
    case types::ms80_r12:
      c.set(other.c.get<uint8_t>());
      break;
    case types::ms160_r12:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_");
  }

  return *this;
}
void meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ms40_r12:
      j.write_int("ms40-r12", c.get<uint8_t>());
      break;
    case types::ms80_r12:
      j.write_int("ms80-r12", c.get<uint8_t>());
      break;
    case types::ms160_r12:
      j.write_int("ms160-r12", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ms40_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
      break;
    case types::ms80_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::ms160_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ms40_r12:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
      break;
    case types::ms80_r12:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::ms160_r12:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::dmtc_period_offset_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_::destroy_() {}
void meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_::ds_occasion_dur_r12_c_(
    const meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::dur_fdd_r12:
      c.init(other.c.get<uint8_t>());
      break;
    case types::dur_tdd_r12:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_");
  }
}
meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_& meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_::
                                                     operator=(const meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::dur_fdd_r12:
      c.set(other.c.get<uint8_t>());
      break;
    case types::dur_tdd_r12:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_");
  }

  return *this;
}
void meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::dur_fdd_r12:
      j.write_int("durationFDD-r12", c.get<uint8_t>());
      break;
    case types::dur_tdd_r12:
      j.write_int("durationTDD-r12", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::dur_fdd_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)5u));
      break;
    case types::dur_tdd_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)2u, (uint8_t)5u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::dur_fdd_r12:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)5u));
      break;
    case types::dur_tdd_r12:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)2u, (uint8_t)5u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_ds_cfg_r12_c::setup_s_::ds_occasion_dur_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasGapConfig ::= CHOICE
void meas_gap_cfg_c::set(types::options e)
{
  type_ = e;
}
void meas_gap_cfg_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("gapOffset");
      c.gap_offset.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_c");
  }
  j.end_obj();
}
SRSASN_CODE meas_gap_cfg_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.gap_offset.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_gap_cfg_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.gap_offset.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_gap_cfg_c::setup_s_::gap_offset_c_::destroy_() {}
void meas_gap_cfg_c::setup_s_::gap_offset_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
meas_gap_cfg_c::setup_s_::gap_offset_c_::gap_offset_c_(const meas_gap_cfg_c::setup_s_::gap_offset_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::gp0:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp1:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp2_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp3_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp_ncsg0_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp_ncsg1_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp_ncsg2_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp_ncsg3_r14:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp_non_uniform1_r14:
      c.init(other.c.get<uint16_t>());
      break;
    case types::gp_non_uniform2_r14:
      c.init(other.c.get<uint16_t>());
      break;
    case types::gp_non_uniform3_r14:
      c.init(other.c.get<uint16_t>());
      break;
    case types::gp_non_uniform4_r14:
      c.init(other.c.get<uint16_t>());
      break;
    case types::gp4_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp5_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp6_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp7_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp8_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp9_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp10_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::gp11_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_c::setup_s_::gap_offset_c_");
  }
}
meas_gap_cfg_c::setup_s_::gap_offset_c_& meas_gap_cfg_c::setup_s_::gap_offset_c_::
                                         operator=(const meas_gap_cfg_c::setup_s_::gap_offset_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::gp0:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp1:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp2_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp3_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp_ncsg0_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp_ncsg1_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp_ncsg2_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp_ncsg3_r14:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp_non_uniform1_r14:
      c.set(other.c.get<uint16_t>());
      break;
    case types::gp_non_uniform2_r14:
      c.set(other.c.get<uint16_t>());
      break;
    case types::gp_non_uniform3_r14:
      c.set(other.c.get<uint16_t>());
      break;
    case types::gp_non_uniform4_r14:
      c.set(other.c.get<uint16_t>());
      break;
    case types::gp4_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp5_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp6_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp7_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp8_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp9_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp10_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::gp11_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_c::setup_s_::gap_offset_c_");
  }

  return *this;
}
void meas_gap_cfg_c::setup_s_::gap_offset_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::gp0:
      j.write_int("gp0", c.get<uint8_t>());
      break;
    case types::gp1:
      j.write_int("gp1", c.get<uint8_t>());
      break;
    case types::gp2_r14:
      j.write_int("gp2-r14", c.get<uint8_t>());
      break;
    case types::gp3_r14:
      j.write_int("gp3-r14", c.get<uint8_t>());
      break;
    case types::gp_ncsg0_r14:
      j.write_int("gp-ncsg0-r14", c.get<uint8_t>());
      break;
    case types::gp_ncsg1_r14:
      j.write_int("gp-ncsg1-r14", c.get<uint8_t>());
      break;
    case types::gp_ncsg2_r14:
      j.write_int("gp-ncsg2-r14", c.get<uint8_t>());
      break;
    case types::gp_ncsg3_r14:
      j.write_int("gp-ncsg3-r14", c.get<uint8_t>());
      break;
    case types::gp_non_uniform1_r14:
      j.write_int("gp-nonUniform1-r14", c.get<uint16_t>());
      break;
    case types::gp_non_uniform2_r14:
      j.write_int("gp-nonUniform2-r14", c.get<uint16_t>());
      break;
    case types::gp_non_uniform3_r14:
      j.write_int("gp-nonUniform3-r14", c.get<uint16_t>());
      break;
    case types::gp_non_uniform4_r14:
      j.write_int("gp-nonUniform4-r14", c.get<uint16_t>());
      break;
    case types::gp4_r15:
      j.write_int("gp4-r15", c.get<uint8_t>());
      break;
    case types::gp5_r15:
      j.write_int("gp5-r15", c.get<uint8_t>());
      break;
    case types::gp6_r15:
      j.write_int("gp6-r15", c.get<uint8_t>());
      break;
    case types::gp7_r15:
      j.write_int("gp7-r15", c.get<uint8_t>());
      break;
    case types::gp8_r15:
      j.write_int("gp8-r15", c.get<uint8_t>());
      break;
    case types::gp9_r15:
      j.write_int("gp9-r15", c.get<uint8_t>());
      break;
    case types::gp10_r15:
      j.write_int("gp10-r15", c.get<uint8_t>());
      break;
    case types::gp11_r15:
      j.write_int("gp11-r15", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_c::setup_s_::gap_offset_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_gap_cfg_c::setup_s_::gap_offset_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::gp0:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
      break;
    case types::gp1:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::gp2_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
    } break;
    case types::gp3_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
    } break;
    case types::gp_ncsg0_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
    } break;
    case types::gp_ncsg1_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
    } break;
    case types::gp_ncsg2_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
    } break;
    case types::gp_ncsg3_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
    } break;
    case types::gp_non_uniform1_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
    } break;
    case types::gp_non_uniform2_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)2559u));
    } break;
    case types::gp_non_uniform3_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)5119u));
    } break;
    case types::gp_non_uniform4_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)10239u));
    } break;
    case types::gp4_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)19u));
    } break;
    case types::gp5_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
    } break;
    case types::gp6_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)19u));
    } break;
    case types::gp7_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
    } break;
    case types::gp8_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
    } break;
    case types::gp9_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
    } break;
    case types::gp10_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)19u));
    } break;
    case types::gp11_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
    } break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_c::setup_s_::gap_offset_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_gap_cfg_c::setup_s_::gap_offset_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::gp0:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
      break;
    case types::gp1:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::gp2_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
    } break;
    case types::gp3_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
    } break;
    case types::gp_ncsg0_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
    } break;
    case types::gp_ncsg1_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
    } break;
    case types::gp_ncsg2_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
    } break;
    case types::gp_ncsg3_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
    } break;
    case types::gp_non_uniform1_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
    } break;
    case types::gp_non_uniform2_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)2559u));
    } break;
    case types::gp_non_uniform3_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)5119u));
    } break;
    case types::gp_non_uniform4_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)10239u));
    } break;
    case types::gp4_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)19u));
    } break;
    case types::gp5_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
    } break;
    case types::gp6_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)19u));
    } break;
    case types::gp7_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
    } break;
    case types::gp8_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
    } break;
    case types::gp9_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
    } break;
    case types::gp10_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)19u));
    } break;
    case types::gp11_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
    } break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_c::setup_s_::gap_offset_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasRSSI-ReportConfig-r13 ::= SEQUENCE
SRSASN_CODE meas_rssi_report_cfg_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ch_occupancy_thres_r13_present, 1));

  if (ch_occupancy_thres_r13_present) {
    HANDLE_CODE(pack_integer(bref, ch_occupancy_thres_r13, (uint8_t)0u, (uint8_t)76u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_rssi_report_cfg_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ch_occupancy_thres_r13_present, 1));

  if (ch_occupancy_thres_r13_present) {
    HANDLE_CODE(unpack_integer(ch_occupancy_thres_r13, bref, (uint8_t)0u, (uint8_t)76u));
  }

  return SRSASN_SUCCESS;
}
void meas_rssi_report_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ch_occupancy_thres_r13_present) {
    j.write_int("channelOccupancyThreshold-r13", ch_occupancy_thres_r13);
  }
  j.end_obj();
}

// MeasSensing-Config-r15 ::= SEQUENCE
SRSASN_CODE meas_sensing_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, sensing_subch_num_r15, (uint8_t)1u, (uint8_t)20u));
  HANDLE_CODE(sensing_periodicity_r15.pack(bref));
  HANDLE_CODE(pack_integer(bref, sensing_resel_counter_r15, (uint8_t)5u, (uint8_t)75u));
  HANDLE_CODE(pack_integer(bref, sensing_prio_r15, (uint8_t)1u, (uint8_t)8u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_sensing_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(sensing_subch_num_r15, bref, (uint8_t)1u, (uint8_t)20u));
  HANDLE_CODE(sensing_periodicity_r15.unpack(bref));
  HANDLE_CODE(unpack_integer(sensing_resel_counter_r15, bref, (uint8_t)5u, (uint8_t)75u));
  HANDLE_CODE(unpack_integer(sensing_prio_r15, bref, (uint8_t)1u, (uint8_t)8u));

  return SRSASN_SUCCESS;
}
void meas_sensing_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sensingSubchannelNumber-r15", sensing_subch_num_r15);
  j.write_str("sensingPeriodicity-r15", sensing_periodicity_r15.to_string());
  j.write_int("sensingReselectionCounter-r15", sensing_resel_counter_r15);
  j.write_int("sensingPriority-r15", sensing_prio_r15);
  j.end_obj();
}

// MeasSubframePatternConfigNeigh-r10 ::= CHOICE
void meas_sf_pattern_cfg_neigh_r10_c::set(types::options e)
{
  type_ = e;
}
void meas_sf_pattern_cfg_neigh_r10_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("measSubframePatternNeigh-r10");
      c.meas_sf_pattern_neigh_r10.to_json(j);
      if (c.meas_sf_cell_list_r10_present) {
        j.start_array("measSubframeCellList-r10");
        for (const auto& e1 : c.meas_sf_cell_list_r10) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_cfg_neigh_r10_c");
  }
  j.end_obj();
}
SRSASN_CODE meas_sf_pattern_cfg_neigh_r10_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.meas_sf_cell_list_r10_present, 1));
      HANDLE_CODE(c.meas_sf_pattern_neigh_r10.pack(bref));
      if (c.meas_sf_cell_list_r10_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.meas_sf_cell_list_r10, 1, 32));
      }
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_cfg_neigh_r10_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_sf_pattern_cfg_neigh_r10_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.meas_sf_cell_list_r10_present, 1));
      HANDLE_CODE(c.meas_sf_pattern_neigh_r10.unpack(bref));
      if (c.meas_sf_cell_list_r10_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.meas_sf_cell_list_r10, bref, 1, 32));
      }
      break;
    default:
      log_invalid_choice_id(type_, "meas_sf_pattern_cfg_neigh_r10_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  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();
}

// PhysCellIdGERAN ::= SEQUENCE
SRSASN_CODE pci_geran_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(network_colour_code.pack(bref));
  HANDLE_CODE(base_station_colour_code.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pci_geran_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(network_colour_code.unpack(bref));
  HANDLE_CODE(base_station_colour_code.unpack(bref));

  return SRSASN_SUCCESS;
}
void pci_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("networkColourCode", network_colour_code.to_string());
  j.write_str("baseStationColourCode", base_station_colour_code.to_string());
  j.end_obj();
}

// QuantityConfigRS-NR-r15 ::= SEQUENCE
SRSASN_CODE quant_cfg_rs_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coeff_rsrp_r15_present, 1));
  HANDLE_CODE(bref.pack(filt_coeff_rsrq_r15_present, 1));
  HANDLE_CODE(bref.pack(filt_coef_sinr_r13_present, 1));

  if (filt_coeff_rsrp_r15_present) {
    HANDLE_CODE(filt_coeff_rsrp_r15.pack(bref));
  }
  if (filt_coeff_rsrq_r15_present) {
    HANDLE_CODE(filt_coeff_rsrq_r15.pack(bref));
  }
  if (filt_coef_sinr_r13_present) {
    HANDLE_CODE(filt_coef_sinr_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_rs_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coeff_rsrp_r15_present, 1));
  HANDLE_CODE(bref.unpack(filt_coeff_rsrq_r15_present, 1));
  HANDLE_CODE(bref.unpack(filt_coef_sinr_r13_present, 1));

  if (filt_coeff_rsrp_r15_present) {
    HANDLE_CODE(filt_coeff_rsrp_r15.unpack(bref));
  }
  if (filt_coeff_rsrq_r15_present) {
    HANDLE_CODE(filt_coeff_rsrq_r15.unpack(bref));
  }
  if (filt_coef_sinr_r13_present) {
    HANDLE_CODE(filt_coef_sinr_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_rs_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (filt_coeff_rsrp_r15_present) {
    j.write_str("filterCoeff-RSRP-r15", filt_coeff_rsrp_r15.to_string());
  }
  if (filt_coeff_rsrq_r15_present) {
    j.write_str("filterCoeff-RSRQ-r15", filt_coeff_rsrq_r15.to_string());
  }
  if (filt_coef_sinr_r13_present) {
    j.write_str("filterCoefficient-SINR-r13", filt_coef_sinr_r13.to_string());
  }
  j.end_obj();
}

// RMTC-Config-r13 ::= CHOICE
void rmtc_cfg_r13_c::set(types::options e)
{
  type_ = e;
}
void rmtc_cfg_r13_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("rmtc-Period-r13", c.rmtc_period_r13.to_string());
      if (c.rmtc_sf_offset_r13_present) {
        j.write_int("rmtc-SubframeOffset-r13", c.rmtc_sf_offset_r13);
      }
      j.write_str("measDuration-r13", c.meas_dur_r13.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rmtc_cfg_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE rmtc_cfg_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.rmtc_sf_offset_r13_present, 1));
      HANDLE_CODE(c.rmtc_period_r13.pack(bref));
      if (c.rmtc_sf_offset_r13_present) {
        HANDLE_CODE(pack_integer(bref, c.rmtc_sf_offset_r13, (uint16_t)0u, (uint16_t)639u));
      }
      HANDLE_CODE(c.meas_dur_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rmtc_cfg_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rmtc_cfg_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.rmtc_sf_offset_r13_present, 1));
      HANDLE_CODE(c.rmtc_period_r13.unpack(bref));
      if (c.rmtc_sf_offset_r13_present) {
        HANDLE_CODE(unpack_integer(c.rmtc_sf_offset_r13, bref, (uint16_t)0u, (uint16_t)639u));
      }
      HANDLE_CODE(c.meas_dur_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rmtc_cfg_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReconfiguration-v1250-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(wlan_offload_info_r12_present, 1));
  HANDLE_CODE(bref.pack(scg_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(sl_sync_tx_ctrl_r12_present, 1));
  HANDLE_CODE(bref.pack(sl_disc_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(sl_comm_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (wlan_offload_info_r12_present) {
    HANDLE_CODE(wlan_offload_info_r12.pack(bref));
  }
  if (scg_cfg_r12_present) {
    HANDLE_CODE(scg_cfg_r12.pack(bref));
  }
  if (sl_sync_tx_ctrl_r12_present) {
    HANDLE_CODE(sl_sync_tx_ctrl_r12.pack(bref));
  }
  if (sl_disc_cfg_r12_present) {
    HANDLE_CODE(sl_disc_cfg_r12.pack(bref));
  }
  if (sl_comm_cfg_r12_present) {
    HANDLE_CODE(sl_comm_cfg_r12.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(wlan_offload_info_r12_present, 1));
  HANDLE_CODE(bref.unpack(scg_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(sl_sync_tx_ctrl_r12_present, 1));
  HANDLE_CODE(bref.unpack(sl_disc_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(sl_comm_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (wlan_offload_info_r12_present) {
    HANDLE_CODE(wlan_offload_info_r12.unpack(bref));
  }
  if (scg_cfg_r12_present) {
    HANDLE_CODE(scg_cfg_r12.unpack(bref));
  }
  if (sl_sync_tx_ctrl_r12_present) {
    HANDLE_CODE(sl_sync_tx_ctrl_r12.unpack(bref));
  }
  if (sl_disc_cfg_r12_present) {
    HANDLE_CODE(sl_disc_cfg_r12.unpack(bref));
  }
  if (sl_comm_cfg_r12_present) {
    HANDLE_CODE(sl_comm_cfg_r12.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (wlan_offload_info_r12_present) {
    j.write_fieldname("wlan-OffloadInfo-r12");
    wlan_offload_info_r12.to_json(j);
  }
  if (scg_cfg_r12_present) {
    j.write_fieldname("scg-Configuration-r12");
    scg_cfg_r12.to_json(j);
  }
  if (sl_sync_tx_ctrl_r12_present) {
    j.write_fieldname("sl-SyncTxControl-r12");
    sl_sync_tx_ctrl_r12.to_json(j);
  }
  if (sl_disc_cfg_r12_present) {
    j.write_fieldname("sl-DiscConfig-r12");
    sl_disc_cfg_r12.to_json(j);
  }
  if (sl_comm_cfg_r12_present) {
    j.write_fieldname("sl-CommConfig-r12");
    sl_comm_cfg_r12.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_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("wlan-OffloadConfigDedicated-r12");
      c.wlan_offload_cfg_ded_r12.to_json(j);
      if (c.t350_r12_present) {
        j.write_str("t350-r12", c.t350_r12.to_string());
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.t350_r12_present, 1));
      HANDLE_CODE(c.wlan_offload_cfg_ded_r12.pack(bref));
      if (c.t350_r12_present) {
        HANDLE_CODE(c.t350_r12.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_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.t350_r12_present, 1));
      HANDLE_CODE(c.wlan_offload_cfg_ded_r12.unpack(bref));
      if (c.t350_r12_present) {
        HANDLE_CODE(c.t350_r12.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_v1250_ies_s::wlan_offload_info_r12_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();
}

// 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));
  }

  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));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_release_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (drb_continue_rohc_r15_present) {
    j.write_str("drb-ContinueROHC-r15", "true");
  }
  if (next_hop_chaining_count_r15_present) {
    j.write_int("nextHopChainingCount-r15", next_hop_chaining_count_r15);
  }
  if (meas_idle_cfg_r15_present) {
    j.write_fieldname("measIdleConfig-r15");
    meas_idle_cfg_r15.to_json(j);
  }
  if (rrc_inactive_cfg_r15_present) {
    j.write_fieldname("rrc-InactiveConfig-r15");
    rrc_inactive_cfg_r15.to_json(j);
  }
  if (cn_type_r15_present) {
    j.write_str("cn-Type-r15", cn_type_r15.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RS-ConfigSSB-NR-r15 ::= SEQUENCE
SRSASN_CODE rs_cfg_ssb_nr_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(meas_timing_cfg_r15.pack(bref));
  HANDLE_CODE(subcarrier_spacing_ssb_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rs_cfg_ssb_nr_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(meas_timing_cfg_r15.unpack(bref));
  HANDLE_CODE(subcarrier_spacing_ssb_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void rs_cfg_ssb_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("measTimingConfig-r15");
  meas_timing_cfg_r15.to_json(j);
  j.write_str("subcarrierSpacingSSB-r15", subcarrier_spacing_ssb_r15.to_string());
  j.end_obj();
}

// RSRQ-RangeConfig-r12 ::= CHOICE
void rsrq_range_cfg_r12_c::set(types::options e)
{
  type_ = e;
}
void rsrq_range_cfg_r12_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_int("setup", c);
      break;
    default:
      log_invalid_choice_id(type_, "rsrq_range_cfg_r12_c");
  }
  j.end_obj();
}
SRSASN_CODE rsrq_range_cfg_r12_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c, (int8_t)-30, (int8_t)46));
      break;
    default:
      log_invalid_choice_id(type_, "rsrq_range_cfg_r12_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rsrq_range_cfg_r12_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c, bref, (int8_t)-30, (int8_t)46));
      break;
    default:
      log_invalid_choice_id(type_, "rsrq_range_cfg_r12_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ReportQuantityNR-r15 ::= SEQUENCE
SRSASN_CODE report_quant_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ss_rsrp, 1));
  HANDLE_CODE(bref.pack(ss_rsrq, 1));
  HANDLE_CODE(bref.pack(ss_sinr, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE report_quant_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ss_rsrp, 1));
  HANDLE_CODE(bref.unpack(ss_rsrq, 1));
  HANDLE_CODE(bref.unpack(ss_sinr, 1));

  return SRSASN_SUCCESS;
}
void report_quant_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("ss-rsrp", ss_rsrp);
  j.write_bool("ss-rsrq", ss_rsrq);
  j.write_bool("ss-sinr", ss_sinr);
  j.end_obj();
}

// ReportQuantityWLAN-r13 ::= SEQUENCE
SRSASN_CODE report_quant_wlan_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(band_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(carrier_info_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(available_admission_capacity_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(backhaul_dl_bw_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(backhaul_ul_bw_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(ch_utilization_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(station_count_request_wlan_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE report_quant_wlan_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(band_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(carrier_info_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(available_admission_capacity_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(backhaul_dl_bw_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(backhaul_ul_bw_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(ch_utilization_request_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(station_count_request_wlan_r13_present, 1));

  return SRSASN_SUCCESS;
}
void report_quant_wlan_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_request_wlan_r13_present) {
    j.write_str("bandRequestWLAN-r13", "true");
  }
  if (carrier_info_request_wlan_r13_present) {
    j.write_str("carrierInfoRequestWLAN-r13", "true");
  }
  if (available_admission_capacity_request_wlan_r13_present) {
    j.write_str("availableAdmissionCapacityRequestWLAN-r13", "true");
  }
  if (backhaul_dl_bw_request_wlan_r13_present) {
    j.write_str("backhaulDL-BandwidthRequestWLAN-r13", "true");
  }
  if (backhaul_ul_bw_request_wlan_r13_present) {
    j.write_str("backhaulUL-BandwidthRequestWLAN-r13", "true");
  }
  if (ch_utilization_request_wlan_r13_present) {
    j.write_str("channelUtilizationRequestWLAN-r13", "true");
  }
  if (station_count_request_wlan_r13_present) {
    j.write_str("stationCountRequestWLAN-r13", "true");
  }
  j.end_obj();
}

// TargetMBSFN-Area-r12 ::= SEQUENCE
SRSASN_CODE target_mbsfn_area_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(mbsfn_area_id_r12_present, 1));

  if (mbsfn_area_id_r12_present) {
    HANDLE_CODE(pack_integer(bref, mbsfn_area_id_r12, (uint16_t)0u, (uint16_t)255u));
  }
  HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE target_mbsfn_area_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(mbsfn_area_id_r12_present, 1));

  if (mbsfn_area_id_r12_present) {
    HANDLE_CODE(unpack_integer(mbsfn_area_id_r12, bref, (uint16_t)0u, (uint16_t)255u));
  }
  HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));

  return SRSASN_SUCCESS;
}
void target_mbsfn_area_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mbsfn_area_id_r12_present) {
    j.write_int("mbsfn-AreaId-r12", mbsfn_area_id_r12);
  }
  j.write_int("carrierFreq-r12", carrier_freq_r12);
  j.end_obj();
}

// ThresholdEUTRA ::= CHOICE
void thres_eutra_c::destroy_() {}
void thres_eutra_c::set(types::options e)
{
  destroy_();
  type_ = e;
}
thres_eutra_c::thres_eutra_c(const thres_eutra_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::thres_rsrp:
      c.init(other.c.get<uint8_t>());
      break;
    case types::thres_rsrq:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "thres_eutra_c");
  }
}
thres_eutra_c& thres_eutra_c::operator=(const thres_eutra_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::thres_rsrp:
      c.set(other.c.get<uint8_t>());
      break;
    case types::thres_rsrq:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "thres_eutra_c");
  }

  return *this;
}
void thres_eutra_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::thres_rsrp:
      j.write_int("threshold-RSRP", c.get<uint8_t>());
      break;
    case types::thres_rsrq:
      j.write_int("threshold-RSRQ", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "thres_eutra_c");
  }
  j.end_obj();
}
SRSASN_CODE thres_eutra_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::thres_rsrp:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)97u));
      break;
    case types::thres_rsrq:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)34u));
      break;
    default:
      log_invalid_choice_id(type_, "thres_eutra_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE thres_eutra_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::thres_rsrp:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)97u));
      break;
    case types::thres_rsrq:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)34u));
      break;
    default:
      log_invalid_choice_id(type_, "thres_eutra_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ThresholdNR-r15 ::= CHOICE
void thres_nr_r15_c::destroy_() {}
void thres_nr_r15_c::set(types::options e)
{
  destroy_();
  type_ = e;
}
thres_nr_r15_c::thres_nr_r15_c(const thres_nr_r15_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::nr_rsrp_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nr_rsrq_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nr_sinr_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "thres_nr_r15_c");
  }
}
thres_nr_r15_c& thres_nr_r15_c::operator=(const thres_nr_r15_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::nr_rsrp_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nr_rsrq_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nr_sinr_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "thres_nr_r15_c");
  }

  return *this;
}
void thres_nr_r15_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::nr_rsrp_r15:
      j.write_int("nr-RSRP-r15", c.get<uint8_t>());
      break;
    case types::nr_rsrq_r15:
      j.write_int("nr-RSRQ-r15", c.get<uint8_t>());
      break;
    case types::nr_sinr_r15:
      j.write_int("nr-SINR-r15", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "thres_nr_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE thres_nr_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::nr_rsrp_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    case types::nr_rsrq_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    case types::nr_sinr_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "thres_nr_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE thres_nr_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::nr_rsrp_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    case types::nr_rsrq_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    case types::nr_sinr_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "thres_nr_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ThresholdUTRA ::= CHOICE
void thres_utra_c::destroy_() {}
void thres_utra_c::set(types::options e)
{
  destroy_();
  type_ = e;
}
thres_utra_c::thres_utra_c(const thres_utra_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::utra_rscp:
      c.init(other.c.get<int8_t>());
      break;
    case types::utra_ec_n0:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "thres_utra_c");
  }
}
thres_utra_c& thres_utra_c::operator=(const thres_utra_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::utra_rscp:
      c.set(other.c.get<int8_t>());
      break;
    case types::utra_ec_n0:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "thres_utra_c");
  }

  return *this;
}
void thres_utra_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::utra_rscp:
      j.write_int("utra-RSCP", c.get<int8_t>());
      break;
    case types::utra_ec_n0:
      j.write_int("utra-EcN0", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "thres_utra_c");
  }
  j.end_obj();
}
SRSASN_CODE thres_utra_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::utra_rscp:
      HANDLE_CODE(pack_integer(bref, c.get<int8_t>(), (int8_t)-5, (int8_t)91));
      break;
    case types::utra_ec_n0:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)49u));
      break;
    default:
      log_invalid_choice_id(type_, "thres_utra_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE thres_utra_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::utra_rscp:
      HANDLE_CODE(unpack_integer(c.get<int8_t>(), bref, (int8_t)-5, (int8_t)91));
      break;
    case types::utra_ec_n0:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)49u));
      break;
    default:
      log_invalid_choice_id(type_, "thres_utra_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UECapabilityEnquiry-v1510-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_enquiry_v1510_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(requested_freq_bands_nr_mrdc_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (requested_freq_bands_nr_mrdc_r15_present) {
    HANDLE_CODE(requested_freq_bands_nr_mrdc_r15.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_enquiry_v1510_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(requested_freq_bands_nr_mrdc_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (requested_freq_bands_nr_mrdc_r15_present) {
    HANDLE_CODE(requested_freq_bands_nr_mrdc_r15.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_enquiry_v1510_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (requested_freq_bands_nr_mrdc_r15_present) {
    j.write_str("requestedFreqBandsNR-MRDC-r15", requested_freq_bands_nr_mrdc_r15.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UEInformationRequest-v1530-IEs ::= SEQUENCE
SRSASN_CODE ue_info_request_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(idle_mode_meas_req_r15_present, 1));
  HANDLE_CODE(bref.pack(flight_path_info_req_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (flight_path_info_req_r15_present) {
    HANDLE_CODE(flight_path_info_req_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_request_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(idle_mode_meas_req_r15_present, 1));
  HANDLE_CODE(bref.unpack(flight_path_info_req_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (flight_path_info_req_r15_present) {
    HANDLE_CODE(flight_path_info_req_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_request_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (idle_mode_meas_req_r15_present) {
    j.write_str("idleModeMeasurementReq-r15", "true");
  }
  if (flight_path_info_req_r15_present) {
    j.write_fieldname("flightPathInfoReq-r15");
    flight_path_info_req_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// UL-DelayConfig-r13 ::= CHOICE
void ul_delay_cfg_r13_c::set(types::options e)
{
  type_ = e;
}
void ul_delay_cfg_r13_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("delayThreshold-r13", c.delay_thres_r13.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "ul_delay_cfg_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE ul_delay_cfg_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.delay_thres_r13.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_delay_cfg_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_delay_cfg_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.delay_thres_r13.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_delay_cfg_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// WLAN-CarrierInfo-r13 ::= SEQUENCE
SRSASN_CODE wlan_carrier_info_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(operating_class_r13_present, 1));
  HANDLE_CODE(bref.pack(country_code_r13_present, 1));
  HANDLE_CODE(bref.pack(ch_nums_r13_present, 1));

  if (operating_class_r13_present) {
    HANDLE_CODE(pack_integer(bref, operating_class_r13, (uint16_t)0u, (uint16_t)255u));
  }
  if (country_code_r13_present) {
    HANDLE_CODE(country_code_r13.pack(bref));
  }
  if (ch_nums_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, ch_nums_r13, 1, 16, integer_packer<uint16_t>(0, 255)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_carrier_info_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(operating_class_r13_present, 1));
  HANDLE_CODE(bref.unpack(country_code_r13_present, 1));
  HANDLE_CODE(bref.unpack(ch_nums_r13_present, 1));

  if (operating_class_r13_present) {
    HANDLE_CODE(unpack_integer(operating_class_r13, bref, (uint16_t)0u, (uint16_t)255u));
  }
  if (country_code_r13_present) {
    HANDLE_CODE(country_code_r13.unpack(bref));
  }
  if (ch_nums_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(ch_nums_r13, bref, 1, 16, integer_packer<uint16_t>(0, 255)));
  }

  return SRSASN_SUCCESS;
}
void wlan_carrier_info_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (operating_class_r13_present) {
    j.write_int("operatingClass-r13", operating_class_r13);
  }
  if (country_code_r13_present) {
    j.write_str("countryCode-r13", country_code_r13.to_string());
  }
  if (ch_nums_r13_present) {
    j.start_array("channelNumbers-r13");
    for (const auto& e1 : ch_nums_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.end_obj();
}

// WLAN-NameListConfig-r15 ::= CHOICE
void wlan_name_list_cfg_r15_c::set(types::options e)
{
  type_ = e;
}
void wlan_name_list_cfg_r15_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        j.write_str(e1.to_string());
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "wlan_name_list_cfg_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE wlan_name_list_cfg_r15_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, 1, 4));
      break;
    default:
      log_invalid_choice_id(type_, "wlan_name_list_cfg_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_name_list_cfg_r15_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, bref, 1, 4));
      break;
    default:
      log_invalid_choice_id(type_, "wlan_name_list_cfg_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CellInfoGERAN-r9 ::= SEQUENCE
SRSASN_CODE cell_info_geran_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pci_r9.pack(bref));
  HANDLE_CODE(carrier_freq_r9.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, sys_info_r9, 1, 10));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_info_geran_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(pci_r9.unpack(bref));
  HANDLE_CODE(carrier_freq_r9.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(sys_info_r9, bref, 1, 10));

  return SRSASN_SUCCESS;
}
void cell_info_geran_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("physCellId-r9");
  pci_r9.to_json(j);
  j.write_fieldname("carrierFreq-r9");
  carrier_freq_r9.to_json(j);
  j.start_array("systemInformation-r9");
  for (const auto& e1 : sys_info_r9) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.end_obj();
}

// CellInfoUTRA-FDD-r9 ::= SEQUENCE
SRSASN_CODE cell_info_utra_fdd_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, pci_r9, (uint16_t)0u, (uint16_t)511u));
  HANDLE_CODE(utra_bcch_container_r9.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_info_utra_fdd_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(pci_r9, bref, (uint16_t)0u, (uint16_t)511u));
  HANDLE_CODE(utra_bcch_container_r9.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_info_utra_fdd_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r9", pci_r9);
  j.write_str("utra-BCCH-Container-r9", utra_bcch_container_r9.to_string());
  j.end_obj();
}

// CellInfoUTRA-TDD-r10 ::= SEQUENCE
SRSASN_CODE cell_info_utra_tdd_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, pci_r10, (uint8_t)0u, (uint8_t)127u));
  HANDLE_CODE(pack_integer(bref, carrier_freq_r10, (uint16_t)0u, (uint16_t)16383u));
  HANDLE_CODE(utra_bcch_container_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_info_utra_tdd_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(pci_r10, bref, (uint8_t)0u, (uint8_t)127u));
  HANDLE_CODE(unpack_integer(carrier_freq_r10, bref, (uint16_t)0u, (uint16_t)16383u));
  HANDLE_CODE(utra_bcch_container_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_info_utra_tdd_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r10", pci_r10);
  j.write_int("carrierFreq-r10", carrier_freq_r10);
  j.write_str("utra-BCCH-Container-r10", utra_bcch_container_r10.to_string());
  j.end_obj();
}

// CellInfoUTRA-TDD-r9 ::= SEQUENCE
SRSASN_CODE cell_info_utra_tdd_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, pci_r9, (uint8_t)0u, (uint8_t)127u));
  HANDLE_CODE(utra_bcch_container_r9.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_info_utra_tdd_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(pci_r9, bref, (uint8_t)0u, (uint8_t)127u));
  HANDLE_CODE(utra_bcch_container_r9.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_info_utra_tdd_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r9", pci_r9);
  j.write_str("utra-BCCH-Container-r9", utra_bcch_container_r9.to_string());
  j.end_obj();
}

// DRB-CountMSB-Info ::= SEQUENCE
SRSASN_CODE drb_count_msb_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, drb_id, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, count_msb_ul, (uint32_t)0u, (uint32_t)33554431u));
  HANDLE_CODE(pack_integer(bref, count_msb_dl, (uint32_t)0u, (uint32_t)33554431u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE drb_count_msb_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(drb_id, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(count_msb_ul, bref, (uint32_t)0u, (uint32_t)33554431u));
  HANDLE_CODE(unpack_integer(count_msb_dl, bref, (uint32_t)0u, (uint32_t)33554431u));

  return SRSASN_SUCCESS;
}
void drb_count_msb_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("drb-Identity", drb_id);
  j.write_int("countMSB-Uplink", count_msb_ul);
  j.write_int("countMSB-Downlink", count_msb_dl);
  j.end_obj();
}

// IDC-Config-r11 ::= SEQUENCE
SRSASN_CODE idc_cfg_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(idc_ind_r11_present, 1));
  HANDLE_CODE(bref.pack(autonomous_denial_params_r11_present, 1));

  if (autonomous_denial_params_r11_present) {
    HANDLE_CODE(autonomous_denial_params_r11.autonomous_denial_sfs_r11.pack(bref));
    HANDLE_CODE(autonomous_denial_params_r11.autonomous_denial_validity_r11.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= idc_ind_ul_ca_r11_present;
    group_flags[1] |= idc_hardware_sharing_ind_r13_present;
    group_flags[2] |= idc_ind_mrdc_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(idc_ind_ul_ca_r11_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(idc_hardware_sharing_ind_r13_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(idc_ind_mrdc_r15.is_present(), 1));
      if (idc_ind_mrdc_r15.is_present()) {
        HANDLE_CODE(idc_ind_mrdc_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE idc_cfg_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(idc_ind_r11_present, 1));
  HANDLE_CODE(bref.unpack(autonomous_denial_params_r11_present, 1));

  if (autonomous_denial_params_r11_present) {
    HANDLE_CODE(autonomous_denial_params_r11.autonomous_denial_sfs_r11.unpack(bref));
    HANDLE_CODE(autonomous_denial_params_r11.autonomous_denial_validity_r11.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(idc_ind_ul_ca_r11_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(idc_hardware_sharing_ind_r13_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool idc_ind_mrdc_r15_present;
      HANDLE_CODE(bref.unpack(idc_ind_mrdc_r15_present, 1));
      idc_ind_mrdc_r15.set_present(idc_ind_mrdc_r15_present);
      if (idc_ind_mrdc_r15.is_present()) {
        HANDLE_CODE(idc_ind_mrdc_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void idc_cfg_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (idc_ind_r11_present) {
    j.write_str("idc-Indication-r11", "setup");
  }
  if (autonomous_denial_params_r11_present) {
    j.write_fieldname("autonomousDenialParameters-r11");
    j.start_obj();
    j.write_str("autonomousDenialSubframes-r11", autonomous_denial_params_r11.autonomous_denial_sfs_r11.to_string());
    j.write_str("autonomousDenialValidity-r11",
                autonomous_denial_params_r11.autonomous_denial_validity_r11.to_string());
    j.end_obj();
  }
  if (ext) {
    if (idc_ind_ul_ca_r11_present) {
      j.write_str("idc-Indication-UL-CA-r11", "setup");
    }
    if (idc_hardware_sharing_ind_r13_present) {
      j.write_str("idc-HardwareSharingIndication-r13", "setup");
    }
    if (idc_ind_mrdc_r15.is_present()) {
      j.write_fieldname("idc-Indication-MRDC-r15");
      idc_ind_mrdc_r15->to_json(j);
    }
  }
  j.end_obj();
}

void idc_cfg_r11_s::idc_ind_mrdc_r15_c_::set(types::options e)
{
  type_ = e;
}
void idc_cfg_r11_s::idc_ind_mrdc_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.start_array("setup");
      for (const auto& e1 : c) {
        j.write_int(e1);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "idc_cfg_r11_s::idc_ind_mrdc_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE idc_cfg_r11_s::idc_ind_mrdc_r15_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, 1, 32, integer_packer<uint32_t>(0, 3279165)));
      break;
    default:
      log_invalid_choice_id(type_, "idc_cfg_r11_s::idc_ind_mrdc_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE idc_cfg_r11_s::idc_ind_mrdc_r15_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, bref, 1, 32, integer_packer<uint32_t>(0, 3279165)));
      break;
    default:
      log_invalid_choice_id(type_, "idc_cfg_r11_s::idc_ind_mrdc_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// LoggedMeasurementConfiguration-v1530-IEs ::= SEQUENCE
SRSASN_CODE logged_meas_cfg_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(bt_name_list_r15_present, 1));
  HANDLE_CODE(bref.pack(wlan_name_list_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (bt_name_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, bt_name_list_r15, 1, 4));
  }
  if (wlan_name_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, wlan_name_list_r15, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE logged_meas_cfg_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(bt_name_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(wlan_name_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (bt_name_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(bt_name_list_r15, bref, 1, 4));
  }
  if (wlan_name_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(wlan_name_list_r15, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void logged_meas_cfg_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (bt_name_list_r15_present) {
    j.start_array("bt-NameList-r15");
    for (const auto& e1 : bt_name_list_r15) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (wlan_name_list_r15_present) {
    j.start_array("wlan-NameList-r15");
    for (const auto& e1 : wlan_name_list_r15) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// MeasGapConfigPerCC-r14 ::= SEQUENCE
SRSASN_CODE meas_gap_cfg_per_cc_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, serv_cell_id_r14, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(meas_gap_cfg_cc_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_gap_cfg_per_cc_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(serv_cell_id_r14, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(meas_gap_cfg_cc_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_gap_cfg_per_cc_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("servCellId-r14", serv_cell_id_r14);
  j.write_fieldname("measGapConfigCC-r14");
  meas_gap_cfg_cc_r14.to_json(j);
  j.end_obj();
}

// MeasObjectCDMA2000 ::= SEQUENCE
SRSASN_CODE meas_obj_cdma2000_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(search_win_size_present, 1));
  HANDLE_CODE(bref.pack(offset_freq_present, 1));
  HANDLE_CODE(bref.pack(cells_to_rem_list_present, 1));
  HANDLE_CODE(bref.pack(cells_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(cell_for_which_to_report_cgi_present, 1));

  HANDLE_CODE(cdma2000_type.pack(bref));
  HANDLE_CODE(carrier_freq.pack(bref));
  if (search_win_size_present) {
    HANDLE_CODE(pack_integer(bref, search_win_size, (uint8_t)0u, (uint8_t)15u));
  }
  if (offset_freq_present) {
    HANDLE_CODE(pack_integer(bref, offset_freq, (int8_t)-15, (int8_t)15));
  }
  if (cells_to_rem_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cells_to_rem_list, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (cells_to_add_mod_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cells_to_add_mod_list, 1, 32));
  }
  if (cell_for_which_to_report_cgi_present) {
    HANDLE_CODE(pack_integer(bref, cell_for_which_to_report_cgi, (uint16_t)0u, (uint16_t)511u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_cdma2000_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(search_win_size_present, 1));
  HANDLE_CODE(bref.unpack(offset_freq_present, 1));
  HANDLE_CODE(bref.unpack(cells_to_rem_list_present, 1));
  HANDLE_CODE(bref.unpack(cells_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(cell_for_which_to_report_cgi_present, 1));

  HANDLE_CODE(cdma2000_type.unpack(bref));
  HANDLE_CODE(carrier_freq.unpack(bref));
  if (search_win_size_present) {
    HANDLE_CODE(unpack_integer(search_win_size, bref, (uint8_t)0u, (uint8_t)15u));
  }
  if (offset_freq_present) {
    HANDLE_CODE(unpack_integer(offset_freq, bref, (int8_t)-15, (int8_t)15));
  }
  if (cells_to_rem_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cells_to_rem_list, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (cells_to_add_mod_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cells_to_add_mod_list, bref, 1, 32));
  }
  if (cell_for_which_to_report_cgi_present) {
    HANDLE_CODE(unpack_integer(cell_for_which_to_report_cgi, bref, (uint16_t)0u, (uint16_t)511u));
  }

  return SRSASN_SUCCESS;
}
void meas_obj_cdma2000_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cdma2000-Type", cdma2000_type.to_string());
  j.write_fieldname("carrierFreq");
  carrier_freq.to_json(j);
  if (search_win_size_present) {
    j.write_int("searchWindowSize", search_win_size);
  }
  if (offset_freq_present) {
    j.write_int("offsetFreq", offset_freq);
  }
  if (cells_to_rem_list_present) {
    j.start_array("cellsToRemoveList");
    for (const auto& e1 : cells_to_rem_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (cells_to_add_mod_list_present) {
    j.start_array("cellsToAddModList");
    for (const auto& e1 : cells_to_add_mod_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (cell_for_which_to_report_cgi_present) {
    j.write_int("cellForWhichToReportCGI", cell_for_which_to_report_cgi);
  }
  j.end_obj();
}

// MeasObjectEUTRA ::= SEQUENCE
SRSASN_CODE meas_obj_eutra_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(offset_freq_present, 1));
  HANDLE_CODE(bref.pack(cells_to_rem_list_present, 1));
  HANDLE_CODE(bref.pack(cells_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(black_cells_to_rem_list_present, 1));
  HANDLE_CODE(bref.pack(black_cells_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(cell_for_which_to_report_cgi_present, 1));

  HANDLE_CODE(pack_integer(bref, carrier_freq, (uint32_t)0u, (uint32_t)65535u));
  HANDLE_CODE(allowed_meas_bw.pack(bref));
  HANDLE_CODE(bref.pack(presence_ant_port1, 1));
  HANDLE_CODE(neigh_cell_cfg.pack(bref));
  if (offset_freq_present) {
    HANDLE_CODE(offset_freq.pack(bref));
  }
  if (cells_to_rem_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cells_to_rem_list, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (cells_to_add_mod_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cells_to_add_mod_list, 1, 32));
  }
  if (black_cells_to_rem_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, black_cells_to_rem_list, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (black_cells_to_add_mod_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, black_cells_to_add_mod_list, 1, 32));
  }
  if (cell_for_which_to_report_cgi_present) {
    HANDLE_CODE(pack_integer(bref, cell_for_which_to_report_cgi, (uint16_t)0u, (uint16_t)503u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= meas_cycle_scell_r10_present;
    group_flags[0] |= meas_sf_pattern_cfg_neigh_r10.is_present();
    group_flags[1] |= wideband_rsrq_meas_r11_present;
    group_flags[2] |= alt_ttt_cells_to_rem_list_r12.is_present();
    group_flags[2] |= alt_ttt_cells_to_add_mod_list_r12.is_present();
    group_flags[2] |= t312_r12.is_present();
    group_flags[2] |= reduced_meas_performance_r12_present;
    group_flags[2] |= meas_ds_cfg_r12.is_present();
    group_flags[3] |= white_cells_to_rem_list_r13.is_present();
    group_flags[3] |= white_cells_to_add_mod_list_r13.is_present();
    group_flags[3] |= rmtc_cfg_r13.is_present();
    group_flags[3] |= carrier_freq_r13_present;
    group_flags[4] |= tx_res_pool_to_rem_list_r14.is_present();
    group_flags[4] |= tx_res_pool_to_add_list_r14.is_present();
    group_flags[4] |= fembms_mixed_carrier_r14_present;
    group_flags[5] |= meas_sensing_cfg_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_cycle_scell_r10_present, 1));
      HANDLE_CODE(bref.pack(meas_sf_pattern_cfg_neigh_r10.is_present(), 1));
      if (meas_cycle_scell_r10_present) {
        HANDLE_CODE(meas_cycle_scell_r10.pack(bref));
      }
      if (meas_sf_pattern_cfg_neigh_r10.is_present()) {
        HANDLE_CODE(meas_sf_pattern_cfg_neigh_r10->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(wideband_rsrq_meas_r11_present, 1));
      if (wideband_rsrq_meas_r11_present) {
        HANDLE_CODE(bref.pack(wideband_rsrq_meas_r11, 1));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(alt_ttt_cells_to_rem_list_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(alt_ttt_cells_to_add_mod_list_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(t312_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1));
      HANDLE_CODE(bref.pack(meas_ds_cfg_r12.is_present(), 1));
      if (alt_ttt_cells_to_rem_list_r12.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *alt_ttt_cells_to_rem_list_r12, 1, 32, integer_packer<uint8_t>(1, 32)));
      }
      if (alt_ttt_cells_to_add_mod_list_r12.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *alt_ttt_cells_to_add_mod_list_r12, 1, 32));
      }
      if (t312_r12.is_present()) {
        HANDLE_CODE(t312_r12->pack(bref));
      }
      if (reduced_meas_performance_r12_present) {
        HANDLE_CODE(bref.pack(reduced_meas_performance_r12, 1));
      }
      if (meas_ds_cfg_r12.is_present()) {
        HANDLE_CODE(meas_ds_cfg_r12->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(white_cells_to_rem_list_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(white_cells_to_add_mod_list_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(rmtc_cfg_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(carrier_freq_r13_present, 1));
      if (white_cells_to_rem_list_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *white_cells_to_rem_list_r13, 1, 32, integer_packer<uint8_t>(1, 32)));
      }
      if (white_cells_to_add_mod_list_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *white_cells_to_add_mod_list_r13, 1, 32));
      }
      if (rmtc_cfg_r13.is_present()) {
        HANDLE_CODE(rmtc_cfg_r13->pack(bref));
      }
      if (carrier_freq_r13_present) {
        HANDLE_CODE(pack_integer(bref, carrier_freq_r13, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(tx_res_pool_to_rem_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(tx_res_pool_to_add_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(fembms_mixed_carrier_r14_present, 1));
      if (tx_res_pool_to_rem_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *tx_res_pool_to_rem_list_r14, 1, 72, integer_packer<uint8_t>(1, 72)));
      }
      if (tx_res_pool_to_add_list_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *tx_res_pool_to_add_list_r14, 1, 72, integer_packer<uint8_t>(1, 72)));
      }
      if (fembms_mixed_carrier_r14_present) {
        HANDLE_CODE(bref.pack(fembms_mixed_carrier_r14, 1));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_sensing_cfg_r15.is_present(), 1));
      if (meas_sensing_cfg_r15.is_present()) {
        HANDLE_CODE(meas_sensing_cfg_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_eutra_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(offset_freq_present, 1));
  HANDLE_CODE(bref.unpack(cells_to_rem_list_present, 1));
  HANDLE_CODE(bref.unpack(cells_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(black_cells_to_rem_list_present, 1));
  HANDLE_CODE(bref.unpack(black_cells_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(cell_for_which_to_report_cgi_present, 1));

  HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u));
  HANDLE_CODE(allowed_meas_bw.unpack(bref));
  HANDLE_CODE(bref.unpack(presence_ant_port1, 1));
  HANDLE_CODE(neigh_cell_cfg.unpack(bref));
  if (offset_freq_present) {
    HANDLE_CODE(offset_freq.unpack(bref));
  }
  if (cells_to_rem_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cells_to_rem_list, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (cells_to_add_mod_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cells_to_add_mod_list, bref, 1, 32));
  }
  if (black_cells_to_rem_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(black_cells_to_rem_list, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (black_cells_to_add_mod_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(black_cells_to_add_mod_list, bref, 1, 32));
  }
  if (cell_for_which_to_report_cgi_present) {
    HANDLE_CODE(unpack_integer(cell_for_which_to_report_cgi, bref, (uint16_t)0u, (uint16_t)503u));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(6);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(meas_cycle_scell_r10_present, 1));
      bool meas_sf_pattern_cfg_neigh_r10_present;
      HANDLE_CODE(bref.unpack(meas_sf_pattern_cfg_neigh_r10_present, 1));
      meas_sf_pattern_cfg_neigh_r10.set_present(meas_sf_pattern_cfg_neigh_r10_present);
      if (meas_cycle_scell_r10_present) {
        HANDLE_CODE(meas_cycle_scell_r10.unpack(bref));
      }
      if (meas_sf_pattern_cfg_neigh_r10.is_present()) {
        HANDLE_CODE(meas_sf_pattern_cfg_neigh_r10->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(wideband_rsrq_meas_r11_present, 1));
      if (wideband_rsrq_meas_r11_present) {
        HANDLE_CODE(bref.unpack(wideband_rsrq_meas_r11, 1));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool alt_ttt_cells_to_rem_list_r12_present;
      HANDLE_CODE(bref.unpack(alt_ttt_cells_to_rem_list_r12_present, 1));
      alt_ttt_cells_to_rem_list_r12.set_present(alt_ttt_cells_to_rem_list_r12_present);
      bool alt_ttt_cells_to_add_mod_list_r12_present;
      HANDLE_CODE(bref.unpack(alt_ttt_cells_to_add_mod_list_r12_present, 1));
      alt_ttt_cells_to_add_mod_list_r12.set_present(alt_ttt_cells_to_add_mod_list_r12_present);
      bool t312_r12_present;
      HANDLE_CODE(bref.unpack(t312_r12_present, 1));
      t312_r12.set_present(t312_r12_present);
      HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1));
      bool meas_ds_cfg_r12_present;
      HANDLE_CODE(bref.unpack(meas_ds_cfg_r12_present, 1));
      meas_ds_cfg_r12.set_present(meas_ds_cfg_r12_present);
      if (alt_ttt_cells_to_rem_list_r12.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*alt_ttt_cells_to_rem_list_r12, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
      }
      if (alt_ttt_cells_to_add_mod_list_r12.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*alt_ttt_cells_to_add_mod_list_r12, bref, 1, 32));
      }
      if (t312_r12.is_present()) {
        HANDLE_CODE(t312_r12->unpack(bref));
      }
      if (reduced_meas_performance_r12_present) {
        HANDLE_CODE(bref.unpack(reduced_meas_performance_r12, 1));
      }
      if (meas_ds_cfg_r12.is_present()) {
        HANDLE_CODE(meas_ds_cfg_r12->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool white_cells_to_rem_list_r13_present;
      HANDLE_CODE(bref.unpack(white_cells_to_rem_list_r13_present, 1));
      white_cells_to_rem_list_r13.set_present(white_cells_to_rem_list_r13_present);
      bool white_cells_to_add_mod_list_r13_present;
      HANDLE_CODE(bref.unpack(white_cells_to_add_mod_list_r13_present, 1));
      white_cells_to_add_mod_list_r13.set_present(white_cells_to_add_mod_list_r13_present);
      bool rmtc_cfg_r13_present;
      HANDLE_CODE(bref.unpack(rmtc_cfg_r13_present, 1));
      rmtc_cfg_r13.set_present(rmtc_cfg_r13_present);
      HANDLE_CODE(bref.unpack(carrier_freq_r13_present, 1));
      if (white_cells_to_rem_list_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*white_cells_to_rem_list_r13, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
      }
      if (white_cells_to_add_mod_list_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*white_cells_to_add_mod_list_r13, bref, 1, 32));
      }
      if (rmtc_cfg_r13.is_present()) {
        HANDLE_CODE(rmtc_cfg_r13->unpack(bref));
      }
      if (carrier_freq_r13_present) {
        HANDLE_CODE(unpack_integer(carrier_freq_r13, bref, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool tx_res_pool_to_rem_list_r14_present;
      HANDLE_CODE(bref.unpack(tx_res_pool_to_rem_list_r14_present, 1));
      tx_res_pool_to_rem_list_r14.set_present(tx_res_pool_to_rem_list_r14_present);
      bool tx_res_pool_to_add_list_r14_present;
      HANDLE_CODE(bref.unpack(tx_res_pool_to_add_list_r14_present, 1));
      tx_res_pool_to_add_list_r14.set_present(tx_res_pool_to_add_list_r14_present);
      HANDLE_CODE(bref.unpack(fembms_mixed_carrier_r14_present, 1));
      if (tx_res_pool_to_rem_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*tx_res_pool_to_rem_list_r14, bref, 1, 72, integer_packer<uint8_t>(1, 72)));
      }
      if (tx_res_pool_to_add_list_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*tx_res_pool_to_add_list_r14, bref, 1, 72, integer_packer<uint8_t>(1, 72)));
      }
      if (fembms_mixed_carrier_r14_present) {
        HANDLE_CODE(bref.unpack(fembms_mixed_carrier_r14, 1));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_sensing_cfg_r15_present;
      HANDLE_CODE(bref.unpack(meas_sensing_cfg_r15_present, 1));
      meas_sensing_cfg_r15.set_present(meas_sensing_cfg_r15_present);
      if (meas_sensing_cfg_r15.is_present()) {
        HANDLE_CODE(meas_sensing_cfg_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_obj_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq", carrier_freq);
  j.write_str("allowedMeasBandwidth", allowed_meas_bw.to_string());
  j.write_bool("presenceAntennaPort1", presence_ant_port1);
  j.write_str("neighCellConfig", neigh_cell_cfg.to_string());
  if (offset_freq_present) {
    j.write_str("offsetFreq", offset_freq.to_string());
  }
  if (cells_to_rem_list_present) {
    j.start_array("cellsToRemoveList");
    for (const auto& e1 : cells_to_rem_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (cells_to_add_mod_list_present) {
    j.start_array("cellsToAddModList");
    for (const auto& e1 : cells_to_add_mod_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (black_cells_to_rem_list_present) {
    j.start_array("blackCellsToRemoveList");
    for (const auto& e1 : black_cells_to_rem_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (black_cells_to_add_mod_list_present) {
    j.start_array("blackCellsToAddModList");
    for (const auto& e1 : black_cells_to_add_mod_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (cell_for_which_to_report_cgi_present) {
    j.write_int("cellForWhichToReportCGI", cell_for_which_to_report_cgi);
  }
  if (ext) {
    if (meas_cycle_scell_r10_present) {
      j.write_str("measCycleSCell-r10", meas_cycle_scell_r10.to_string());
    }
    if (meas_sf_pattern_cfg_neigh_r10.is_present()) {
      j.write_fieldname("measSubframePatternConfigNeigh-r10");
      meas_sf_pattern_cfg_neigh_r10->to_json(j);
    }
    if (wideband_rsrq_meas_r11_present) {
      j.write_bool("widebandRSRQ-Meas-r11", wideband_rsrq_meas_r11);
    }
    if (alt_ttt_cells_to_rem_list_r12.is_present()) {
      j.start_array("altTTT-CellsToRemoveList-r12");
      for (const auto& e1 : *alt_ttt_cells_to_rem_list_r12) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (alt_ttt_cells_to_add_mod_list_r12.is_present()) {
      j.start_array("altTTT-CellsToAddModList-r12");
      for (const auto& e1 : *alt_ttt_cells_to_add_mod_list_r12) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (t312_r12.is_present()) {
      j.write_fieldname("t312-r12");
      t312_r12->to_json(j);
    }
    if (reduced_meas_performance_r12_present) {
      j.write_bool("reducedMeasPerformance-r12", reduced_meas_performance_r12);
    }
    if (meas_ds_cfg_r12.is_present()) {
      j.write_fieldname("measDS-Config-r12");
      meas_ds_cfg_r12->to_json(j);
    }
    if (white_cells_to_rem_list_r13.is_present()) {
      j.start_array("whiteCellsToRemoveList-r13");
      for (const auto& e1 : *white_cells_to_rem_list_r13) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (white_cells_to_add_mod_list_r13.is_present()) {
      j.start_array("whiteCellsToAddModList-r13");
      for (const auto& e1 : *white_cells_to_add_mod_list_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (rmtc_cfg_r13.is_present()) {
      j.write_fieldname("rmtc-Config-r13");
      rmtc_cfg_r13->to_json(j);
    }
    if (carrier_freq_r13_present) {
      j.write_int("carrierFreq-r13", carrier_freq_r13);
    }
    if (tx_res_pool_to_rem_list_r14.is_present()) {
      j.start_array("tx-ResourcePoolToRemoveList-r14");
      for (const auto& e1 : *tx_res_pool_to_rem_list_r14) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (tx_res_pool_to_add_list_r14.is_present()) {
      j.start_array("tx-ResourcePoolToAddList-r14");
      for (const auto& e1 : *tx_res_pool_to_add_list_r14) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (fembms_mixed_carrier_r14_present) {
      j.write_bool("fembms-MixedCarrier-r14", fembms_mixed_carrier_r14);
    }
    if (meas_sensing_cfg_r15.is_present()) {
      j.write_fieldname("measSensing-Config-r15");
      meas_sensing_cfg_r15->to_json(j);
    }
  }
  j.end_obj();
}

void meas_obj_eutra_s::t312_r12_c_::set(types::options e)
{
  type_ = e;
}
void meas_obj_eutra_s::t312_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_eutra_s::t312_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_obj_eutra_s::t312_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_eutra_s::t312_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_eutra_s::t312_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_eutra_s::t312_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasObjectEUTRA-v9e0 ::= SEQUENCE
SRSASN_CODE meas_obj_eutra_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, carrier_freq_v9e0, (uint32_t)65536u, (uint32_t)262143u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_eutra_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(carrier_freq_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u));

  return SRSASN_SUCCESS;
}
void meas_obj_eutra_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-v9e0", carrier_freq_v9e0);
  j.end_obj();
}

// MeasObjectGERAN ::= SEQUENCE
SRSASN_CODE meas_obj_geran_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(offset_freq_present, 1));
  HANDLE_CODE(bref.pack(ncc_permitted_present, 1));
  HANDLE_CODE(bref.pack(cell_for_which_to_report_cgi_present, 1));

  HANDLE_CODE(carrier_freqs.pack(bref));
  if (offset_freq_present) {
    HANDLE_CODE(pack_integer(bref, offset_freq, (int8_t)-15, (int8_t)15));
  }
  if (ncc_permitted_present) {
    HANDLE_CODE(ncc_permitted.pack(bref));
  }
  if (cell_for_which_to_report_cgi_present) {
    HANDLE_CODE(cell_for_which_to_report_cgi.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_geran_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(offset_freq_present, 1));
  HANDLE_CODE(bref.unpack(ncc_permitted_present, 1));
  HANDLE_CODE(bref.unpack(cell_for_which_to_report_cgi_present, 1));

  HANDLE_CODE(carrier_freqs.unpack(bref));
  if (offset_freq_present) {
    HANDLE_CODE(unpack_integer(offset_freq, bref, (int8_t)-15, (int8_t)15));
  }
  if (ncc_permitted_present) {
    HANDLE_CODE(ncc_permitted.unpack(bref));
  }
  if (cell_for_which_to_report_cgi_present) {
    HANDLE_CODE(cell_for_which_to_report_cgi.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_obj_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("carrierFreqs");
  carrier_freqs.to_json(j);
  if (offset_freq_present) {
    j.write_int("offsetFreq", offset_freq);
  }
  if (ncc_permitted_present) {
    j.write_str("ncc-Permitted", ncc_permitted.to_string());
  }
  if (cell_for_which_to_report_cgi_present) {
    j.write_fieldname("cellForWhichToReportCGI");
    cell_for_which_to_report_cgi.to_json(j);
  }
  j.end_obj();
}

// MeasObjectNR-r15 ::= SEQUENCE
SRSASN_CODE meas_obj_nr_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(thresh_rs_idx_r15_present, 1));
  HANDLE_CODE(bref.pack(max_rs_idx_cell_qual_r15_present, 1));
  HANDLE_CODE(bref.pack(offset_freq_r15_present, 1));
  HANDLE_CODE(bref.pack(black_cells_to_rem_list_r15_present, 1));
  HANDLE_CODE(bref.pack(black_cells_to_add_mod_list_r15_present, 1));
  HANDLE_CODE(bref.pack(cells_for_which_to_report_sftd_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)3279165u));
  HANDLE_CODE(rs_cfg_ssb_r15.pack(bref));
  if (thresh_rs_idx_r15_present) {
    HANDLE_CODE(thresh_rs_idx_r15.pack(bref));
  }
  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 (offset_freq_r15_present) {
    HANDLE_CODE(pack_integer(bref, offset_freq_r15, (int8_t)-15, (int8_t)15));
  }
  if (black_cells_to_rem_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, black_cells_to_rem_list_r15, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (black_cells_to_add_mod_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, black_cells_to_add_mod_list_r15, 1, 32));
  }
  HANDLE_CODE(pack_integer(bref, quant_cfg_set_r15, (uint8_t)1u, (uint8_t)2u));
  if (cells_for_which_to_report_sftd_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cells_for_which_to_report_sftd_r15, 1, 3, integer_packer<uint16_t>(0, 1007)));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= cell_for_which_to_report_cgi_r15_present;
    group_flags[0] |= derive_ssb_idx_from_cell_r15_present;
    group_flags[0] |= ss_rssi_meas_r15.is_present();
    group_flags[0] |= band_nr_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cell_for_which_to_report_cgi_r15_present, 1));
      HANDLE_CODE(bref.pack(derive_ssb_idx_from_cell_r15_present, 1));
      HANDLE_CODE(bref.pack(ss_rssi_meas_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(band_nr_r15.is_present(), 1));
      if (cell_for_which_to_report_cgi_r15_present) {
        HANDLE_CODE(pack_integer(bref, cell_for_which_to_report_cgi_r15, (uint16_t)0u, (uint16_t)1007u));
      }
      if (derive_ssb_idx_from_cell_r15_present) {
        HANDLE_CODE(bref.pack(derive_ssb_idx_from_cell_r15, 1));
      }
      if (ss_rssi_meas_r15.is_present()) {
        HANDLE_CODE(ss_rssi_meas_r15->pack(bref));
      }
      if (band_nr_r15.is_present()) {
        HANDLE_CODE(band_nr_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_nr_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(thresh_rs_idx_r15_present, 1));
  HANDLE_CODE(bref.unpack(max_rs_idx_cell_qual_r15_present, 1));
  HANDLE_CODE(bref.unpack(offset_freq_r15_present, 1));
  HANDLE_CODE(bref.unpack(black_cells_to_rem_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(black_cells_to_add_mod_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(cells_for_which_to_report_sftd_r15_present, 1));

  HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)3279165u));
  HANDLE_CODE(rs_cfg_ssb_r15.unpack(bref));
  if (thresh_rs_idx_r15_present) {
    HANDLE_CODE(thresh_rs_idx_r15.unpack(bref));
  }
  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 (offset_freq_r15_present) {
    HANDLE_CODE(unpack_integer(offset_freq_r15, bref, (int8_t)-15, (int8_t)15));
  }
  if (black_cells_to_rem_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(black_cells_to_rem_list_r15, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (black_cells_to_add_mod_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(black_cells_to_add_mod_list_r15, bref, 1, 32));
  }
  HANDLE_CODE(unpack_integer(quant_cfg_set_r15, bref, (uint8_t)1u, (uint8_t)2u));
  if (cells_for_which_to_report_sftd_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cells_for_which_to_report_sftd_r15, bref, 1, 3, integer_packer<uint16_t>(0, 1007)));
  }

  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(cell_for_which_to_report_cgi_r15_present, 1));
      HANDLE_CODE(bref.unpack(derive_ssb_idx_from_cell_r15_present, 1));
      bool ss_rssi_meas_r15_present;
      HANDLE_CODE(bref.unpack(ss_rssi_meas_r15_present, 1));
      ss_rssi_meas_r15.set_present(ss_rssi_meas_r15_present);
      bool band_nr_r15_present;
      HANDLE_CODE(bref.unpack(band_nr_r15_present, 1));
      band_nr_r15.set_present(band_nr_r15_present);
      if (cell_for_which_to_report_cgi_r15_present) {
        HANDLE_CODE(unpack_integer(cell_for_which_to_report_cgi_r15, bref, (uint16_t)0u, (uint16_t)1007u));
      }
      if (derive_ssb_idx_from_cell_r15_present) {
        HANDLE_CODE(bref.unpack(derive_ssb_idx_from_cell_r15, 1));
      }
      if (ss_rssi_meas_r15.is_present()) {
        HANDLE_CODE(ss_rssi_meas_r15->unpack(bref));
      }
      if (band_nr_r15.is_present()) {
        HANDLE_CODE(band_nr_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_obj_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r15", carrier_freq_r15);
  j.write_fieldname("rs-ConfigSSB-r15");
  rs_cfg_ssb_r15.to_json(j);
  if (thresh_rs_idx_r15_present) {
    j.write_fieldname("threshRS-Index-r15");
    thresh_rs_idx_r15.to_json(j);
  }
  if (max_rs_idx_cell_qual_r15_present) {
    j.write_int("maxRS-IndexCellQual-r15", max_rs_idx_cell_qual_r15);
  }
  if (offset_freq_r15_present) {
    j.write_int("offsetFreq-r15", offset_freq_r15);
  }
  if (black_cells_to_rem_list_r15_present) {
    j.start_array("blackCellsToRemoveList-r15");
    for (const auto& e1 : black_cells_to_rem_list_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (black_cells_to_add_mod_list_r15_present) {
    j.start_array("blackCellsToAddModList-r15");
    for (const auto& e1 : black_cells_to_add_mod_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_int("quantityConfigSet-r15", quant_cfg_set_r15);
  if (cells_for_which_to_report_sftd_r15_present) {
    j.start_array("cellsForWhichToReportSFTD-r15");
    for (const auto& e1 : cells_for_which_to_report_sftd_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (ext) {
    if (cell_for_which_to_report_cgi_r15_present) {
      j.write_int("cellForWhichToReportCGI-r15", cell_for_which_to_report_cgi_r15);
    }
    if (derive_ssb_idx_from_cell_r15_present) {
      j.write_bool("deriveSSB-IndexFromCell-r15", derive_ssb_idx_from_cell_r15);
    }
    if (ss_rssi_meas_r15.is_present()) {
      j.write_fieldname("ss-RSSI-Measurement-r15");
      ss_rssi_meas_r15->to_json(j);
    }
    if (band_nr_r15.is_present()) {
      j.write_fieldname("bandNR-r15");
      band_nr_r15->to_json(j);
    }
  }
  j.end_obj();
}

void meas_obj_nr_r15_s::band_nr_r15_c_::set(types::options e)
{
  type_ = e;
}
void meas_obj_nr_r15_s::band_nr_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_int("setup", c);
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_nr_r15_s::band_nr_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_obj_nr_r15_s::band_nr_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c, (uint16_t)1u, (uint16_t)1024u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_nr_r15_s::band_nr_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_nr_r15_s::band_nr_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c, bref, (uint16_t)1u, (uint16_t)1024u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_nr_r15_s::band_nr_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasObjectUTRA ::= SEQUENCE
SRSASN_CODE meas_obj_utra_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(offset_freq_present, 1));
  HANDLE_CODE(bref.pack(cells_to_rem_list_present, 1));
  HANDLE_CODE(bref.pack(cells_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(cell_for_which_to_report_cgi_present, 1));

  HANDLE_CODE(pack_integer(bref, carrier_freq, (uint16_t)0u, (uint16_t)16383u));
  if (offset_freq_present) {
    HANDLE_CODE(pack_integer(bref, offset_freq, (int8_t)-15, (int8_t)15));
  }
  if (cells_to_rem_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cells_to_rem_list, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (cells_to_add_mod_list_present) {
    HANDLE_CODE(cells_to_add_mod_list.pack(bref));
  }
  if (cell_for_which_to_report_cgi_present) {
    HANDLE_CODE(cell_for_which_to_report_cgi.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= csg_allowed_report_cells_v930.is_present();
    group_flags[1] |= reduced_meas_performance_r12_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(csg_allowed_report_cells_v930.is_present(), 1));
      if (csg_allowed_report_cells_v930.is_present()) {
        HANDLE_CODE(csg_allowed_report_cells_v930->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(reduced_meas_performance_r12_present, 1));
      if (reduced_meas_performance_r12_present) {
        HANDLE_CODE(bref.pack(reduced_meas_performance_r12, 1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_utra_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(offset_freq_present, 1));
  HANDLE_CODE(bref.unpack(cells_to_rem_list_present, 1));
  HANDLE_CODE(bref.unpack(cells_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(cell_for_which_to_report_cgi_present, 1));

  HANDLE_CODE(unpack_integer(carrier_freq, bref, (uint16_t)0u, (uint16_t)16383u));
  if (offset_freq_present) {
    HANDLE_CODE(unpack_integer(offset_freq, bref, (int8_t)-15, (int8_t)15));
  }
  if (cells_to_rem_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cells_to_rem_list, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (cells_to_add_mod_list_present) {
    HANDLE_CODE(cells_to_add_mod_list.unpack(bref));
  }
  if (cell_for_which_to_report_cgi_present) {
    HANDLE_CODE(cell_for_which_to_report_cgi.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 csg_allowed_report_cells_v930_present;
      HANDLE_CODE(bref.unpack(csg_allowed_report_cells_v930_present, 1));
      csg_allowed_report_cells_v930.set_present(csg_allowed_report_cells_v930_present);
      if (csg_allowed_report_cells_v930.is_present()) {
        HANDLE_CODE(csg_allowed_report_cells_v930->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(reduced_meas_performance_r12_present, 1));
      if (reduced_meas_performance_r12_present) {
        HANDLE_CODE(bref.unpack(reduced_meas_performance_r12, 1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_obj_utra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq", carrier_freq);
  if (offset_freq_present) {
    j.write_int("offsetFreq", offset_freq);
  }
  if (cells_to_rem_list_present) {
    j.start_array("cellsToRemoveList");
    for (const auto& e1 : cells_to_rem_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (cells_to_add_mod_list_present) {
    j.write_fieldname("cellsToAddModList");
    cells_to_add_mod_list.to_json(j);
  }
  if (cell_for_which_to_report_cgi_present) {
    j.write_fieldname("cellForWhichToReportCGI");
    cell_for_which_to_report_cgi.to_json(j);
  }
  if (ext) {
    if (csg_allowed_report_cells_v930.is_present()) {
      j.write_fieldname("csg-allowedReportingCells-v930");
      csg_allowed_report_cells_v930->to_json(j);
    }
    if (reduced_meas_performance_r12_present) {
      j.write_bool("reducedMeasPerformance-r12", reduced_meas_performance_r12);
    }
  }
  j.end_obj();
}

void meas_obj_utra_s::cells_to_add_mod_list_c_::destroy_()
{
  switch (type_) {
    case types::cells_to_add_mod_list_utra_fdd:
      c.destroy<cells_to_add_mod_list_utra_fdd_l>();
      break;
    case types::cells_to_add_mod_list_utra_tdd:
      c.destroy<cells_to_add_mod_list_utra_tdd_l>();
      break;
    default:
      break;
  }
}
void meas_obj_utra_s::cells_to_add_mod_list_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cells_to_add_mod_list_utra_fdd:
      c.init<cells_to_add_mod_list_utra_fdd_l>();
      break;
    case types::cells_to_add_mod_list_utra_tdd:
      c.init<cells_to_add_mod_list_utra_tdd_l>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cells_to_add_mod_list_c_");
  }
}
meas_obj_utra_s::cells_to_add_mod_list_c_::cells_to_add_mod_list_c_(
    const meas_obj_utra_s::cells_to_add_mod_list_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cells_to_add_mod_list_utra_fdd:
      c.init(other.c.get<cells_to_add_mod_list_utra_fdd_l>());
      break;
    case types::cells_to_add_mod_list_utra_tdd:
      c.init(other.c.get<cells_to_add_mod_list_utra_tdd_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cells_to_add_mod_list_c_");
  }
}
meas_obj_utra_s::cells_to_add_mod_list_c_& meas_obj_utra_s::cells_to_add_mod_list_c_::
                                           operator=(const meas_obj_utra_s::cells_to_add_mod_list_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cells_to_add_mod_list_utra_fdd:
      c.set(other.c.get<cells_to_add_mod_list_utra_fdd_l>());
      break;
    case types::cells_to_add_mod_list_utra_tdd:
      c.set(other.c.get<cells_to_add_mod_list_utra_tdd_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cells_to_add_mod_list_c_");
  }

  return *this;
}
void meas_obj_utra_s::cells_to_add_mod_list_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cells_to_add_mod_list_utra_fdd:
      j.start_array("cellsToAddModListUTRA-FDD");
      for (const auto& e1 : c.get<cells_to_add_mod_list_utra_fdd_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::cells_to_add_mod_list_utra_tdd:
      j.start_array("cellsToAddModListUTRA-TDD");
      for (const auto& e1 : c.get<cells_to_add_mod_list_utra_tdd_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cells_to_add_mod_list_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_obj_utra_s::cells_to_add_mod_list_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cells_to_add_mod_list_utra_fdd:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<cells_to_add_mod_list_utra_fdd_l>(), 1, 32));
      break;
    case types::cells_to_add_mod_list_utra_tdd:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<cells_to_add_mod_list_utra_tdd_l>(), 1, 32));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cells_to_add_mod_list_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_utra_s::cells_to_add_mod_list_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cells_to_add_mod_list_utra_fdd:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<cells_to_add_mod_list_utra_fdd_l>(), bref, 1, 32));
      break;
    case types::cells_to_add_mod_list_utra_tdd:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<cells_to_add_mod_list_utra_tdd_l>(), bref, 1, 32));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cells_to_add_mod_list_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_obj_utra_s::cell_for_which_to_report_cgi_c_::destroy_() {}
void meas_obj_utra_s::cell_for_which_to_report_cgi_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
meas_obj_utra_s::cell_for_which_to_report_cgi_c_::cell_for_which_to_report_cgi_c_(
    const meas_obj_utra_s::cell_for_which_to_report_cgi_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::utra_fdd:
      c.init(other.c.get<uint16_t>());
      break;
    case types::utra_tdd:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cell_for_which_to_report_cgi_c_");
  }
}
meas_obj_utra_s::cell_for_which_to_report_cgi_c_& meas_obj_utra_s::cell_for_which_to_report_cgi_c_::
                                                  operator=(const meas_obj_utra_s::cell_for_which_to_report_cgi_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::utra_fdd:
      c.set(other.c.get<uint16_t>());
      break;
    case types::utra_tdd:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cell_for_which_to_report_cgi_c_");
  }

  return *this;
}
void meas_obj_utra_s::cell_for_which_to_report_cgi_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::utra_fdd:
      j.write_int("utra-FDD", c.get<uint16_t>());
      break;
    case types::utra_tdd:
      j.write_int("utra-TDD", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cell_for_which_to_report_cgi_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_obj_utra_s::cell_for_which_to_report_cgi_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::utra_fdd:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::utra_tdd:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cell_for_which_to_report_cgi_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_utra_s::cell_for_which_to_report_cgi_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::utra_fdd:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::utra_tdd:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_utra_s::cell_for_which_to_report_cgi_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasObjectWLAN-r13 ::= SEQUENCE
SRSASN_CODE meas_obj_wlan_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(carrier_freq_r13_present, 1));
  HANDLE_CODE(bref.pack(wlan_to_add_mod_list_r13_present, 1));
  HANDLE_CODE(bref.pack(wlan_to_rem_list_r13_present, 1));

  if (carrier_freq_r13_present) {
    HANDLE_CODE(carrier_freq_r13.pack(bref));
  }
  if (wlan_to_add_mod_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, wlan_to_add_mod_list_r13, 1, 32));
  }
  if (wlan_to_rem_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, wlan_to_rem_list_r13, 1, 32));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_wlan_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(carrier_freq_r13_present, 1));
  HANDLE_CODE(bref.unpack(wlan_to_add_mod_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(wlan_to_rem_list_r13_present, 1));

  if (carrier_freq_r13_present) {
    HANDLE_CODE(carrier_freq_r13.unpack(bref));
  }
  if (wlan_to_add_mod_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(wlan_to_add_mod_list_r13, bref, 1, 32));
  }
  if (wlan_to_rem_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(wlan_to_rem_list_r13, bref, 1, 32));
  }

  return SRSASN_SUCCESS;
}
void meas_obj_wlan_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (carrier_freq_r13_present) {
    j.write_fieldname("carrierFreq-r13");
    carrier_freq_r13.to_json(j);
  }
  if (wlan_to_add_mod_list_r13_present) {
    j.start_array("wlan-ToAddModList-r13");
    for (const auto& e1 : wlan_to_add_mod_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (wlan_to_rem_list_r13_present) {
    j.start_array("wlan-ToRemoveList-r13");
    for (const auto& e1 : wlan_to_rem_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

void meas_obj_wlan_r13_s::carrier_freq_r13_c_::destroy_()
{
  switch (type_) {
    case types::band_ind_list_wlan_r13:
      c.destroy<band_ind_list_wlan_r13_l_>();
      break;
    case types::carrier_info_list_wlan_r13:
      c.destroy<carrier_info_list_wlan_r13_l_>();
      break;
    default:
      break;
  }
}
void meas_obj_wlan_r13_s::carrier_freq_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::band_ind_list_wlan_r13:
      c.init<band_ind_list_wlan_r13_l_>();
      break;
    case types::carrier_info_list_wlan_r13:
      c.init<carrier_info_list_wlan_r13_l_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_wlan_r13_s::carrier_freq_r13_c_");
  }
}
meas_obj_wlan_r13_s::carrier_freq_r13_c_::carrier_freq_r13_c_(const meas_obj_wlan_r13_s::carrier_freq_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::band_ind_list_wlan_r13:
      c.init(other.c.get<band_ind_list_wlan_r13_l_>());
      break;
    case types::carrier_info_list_wlan_r13:
      c.init(other.c.get<carrier_info_list_wlan_r13_l_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_wlan_r13_s::carrier_freq_r13_c_");
  }
}
meas_obj_wlan_r13_s::carrier_freq_r13_c_& meas_obj_wlan_r13_s::carrier_freq_r13_c_::
                                          operator=(const meas_obj_wlan_r13_s::carrier_freq_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::band_ind_list_wlan_r13:
      c.set(other.c.get<band_ind_list_wlan_r13_l_>());
      break;
    case types::carrier_info_list_wlan_r13:
      c.set(other.c.get<carrier_info_list_wlan_r13_l_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_wlan_r13_s::carrier_freq_r13_c_");
  }

  return *this;
}
void meas_obj_wlan_r13_s::carrier_freq_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::band_ind_list_wlan_r13:
      j.start_array("bandIndicatorListWLAN-r13");
      for (const auto& e1 : c.get<band_ind_list_wlan_r13_l_>()) {
        j.write_str(e1.to_string());
      }
      j.end_array();
      break;
    case types::carrier_info_list_wlan_r13:
      j.start_array("carrierInfoListWLAN-r13");
      for (const auto& e1 : c.get<carrier_info_list_wlan_r13_l_>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_wlan_r13_s::carrier_freq_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_obj_wlan_r13_s::carrier_freq_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::band_ind_list_wlan_r13:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<band_ind_list_wlan_r13_l_>(), 1, 8));
      break;
    case types::carrier_info_list_wlan_r13:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<carrier_info_list_wlan_r13_l_>(), 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_wlan_r13_s::carrier_freq_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_wlan_r13_s::carrier_freq_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::band_ind_list_wlan_r13:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<band_ind_list_wlan_r13_l_>(), bref, 1, 8));
      break;
    case types::carrier_info_list_wlan_r13:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<carrier_info_list_wlan_r13_l_>(), bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_wlan_r13_s::carrier_freq_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ObtainLocationConfig-r11 ::= SEQUENCE
SRSASN_CODE obtain_location_cfg_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(obtain_location_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE obtain_location_cfg_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(obtain_location_r11_present, 1));

  return SRSASN_SUCCESS;
}
void obtain_location_cfg_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (obtain_location_r11_present) {
    j.write_str("obtainLocation-r11", "setup");
  }
  j.end_obj();
}

// PowerPrefIndicationConfig-r11 ::= CHOICE
void pwr_pref_ind_cfg_r11_c::set(types::options e)
{
  type_ = e;
}
void pwr_pref_ind_cfg_r11_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("powerPrefIndicationTimer-r11", c.pwr_pref_ind_timer_r11.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "pwr_pref_ind_cfg_r11_c");
  }
  j.end_obj();
}
SRSASN_CODE pwr_pref_ind_cfg_r11_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pwr_pref_ind_timer_r11.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pwr_pref_ind_cfg_r11_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pwr_pref_ind_cfg_r11_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pwr_pref_ind_timer_r11.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "pwr_pref_ind_cfg_r11_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// QuantityConfigNR-r15 ::= SEQUENCE
SRSASN_CODE quant_cfg_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_quant_rs_idx_nr_r15_present, 1));

  HANDLE_CODE(meas_quant_cell_nr_r15.pack(bref));
  if (meas_quant_rs_idx_nr_r15_present) {
    HANDLE_CODE(meas_quant_rs_idx_nr_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_quant_rs_idx_nr_r15_present, 1));

  HANDLE_CODE(meas_quant_cell_nr_r15.unpack(bref));
  if (meas_quant_rs_idx_nr_r15_present) {
    HANDLE_CODE(meas_quant_rs_idx_nr_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("measQuantityCellNR-r15");
  meas_quant_cell_nr_r15.to_json(j);
  if (meas_quant_rs_idx_nr_r15_present) {
    j.write_fieldname("measQuantityRS-IndexNR-r15");
    meas_quant_rs_idx_nr_r15.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-v1130-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(sib_type1_ded_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (sib_type1_ded_r11_present) {
    HANDLE_CODE(sib_type1_ded_r11.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(sib_type1_ded_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (sib_type1_ded_r11_present) {
    HANDLE_CODE(sib_type1_ded_r11.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sib_type1_ded_r11_present) {
    j.write_str("systemInformationBlockType1Dedicated-r11", sib_type1_ded_r11.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionRelease-v1320-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_release_v1320_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(resume_id_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (resume_id_r13_present) {
    HANDLE_CODE(resume_id_r13.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_release_v1320_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(resume_id_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (resume_id_r13_present) {
    HANDLE_CODE(resume_id_r13.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_release_v1320_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (resume_id_r13_present) {
    j.write_str("resumeIdentity-r13", resume_id_r13.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

SRSASN_CODE eutra_event_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(event_id.pack(bref));
  HANDLE_CODE(pack_integer(bref, hysteresis, (uint8_t)0u, (uint8_t)30u));
  HANDLE_CODE(time_to_trigger.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE eutra_event_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(event_id.unpack(bref));
  HANDLE_CODE(unpack_integer(hysteresis, bref, (uint8_t)0u, (uint8_t)30u));
  HANDLE_CODE(time_to_trigger.unpack(bref));

  return SRSASN_SUCCESS;
}
void eutra_event_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("eventId");
  event_id.to_json(j);
  j.write_int("hysteresis", hysteresis);
  j.write_str("timeToTrigger", time_to_trigger.to_string());
  j.end_obj();
}

void eutra_event_s::event_id_c_::destroy_()
{
  switch (type_) {
    case types::event_a1:
      c.destroy<event_a1_s_>();
      break;
    case types::event_a2:
      c.destroy<event_a2_s_>();
      break;
    case types::event_a3:
      c.destroy<event_a3_s_>();
      break;
    case types::event_a4:
      c.destroy<event_a4_s_>();
      break;
    case types::event_a5:
      c.destroy<event_a5_s_>();
      break;
    case types::event_a6_r10:
      c.destroy<event_a6_r10_s_>();
      break;
    case types::event_c1_r12:
      c.destroy<event_c1_r12_s_>();
      break;
    case types::event_c2_r12:
      c.destroy<event_c2_r12_s_>();
      break;
    case types::event_v1_r14:
      c.destroy<event_v1_r14_s_>();
      break;
    case types::event_v2_r14:
      c.destroy<event_v2_r14_s_>();
      break;
    case types::event_h1_r15:
      c.destroy<event_h1_r15_s_>();
      break;
    case types::event_h2_r15:
      c.destroy<event_h2_r15_s_>();
      break;
    default:
      break;
  }
}
void eutra_event_s::event_id_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::event_a1:
      c.init<event_a1_s_>();
      break;
    case types::event_a2:
      c.init<event_a2_s_>();
      break;
    case types::event_a3:
      c.init<event_a3_s_>();
      break;
    case types::event_a4:
      c.init<event_a4_s_>();
      break;
    case types::event_a5:
      c.init<event_a5_s_>();
      break;
    case types::event_a6_r10:
      c.init<event_a6_r10_s_>();
      break;
    case types::event_c1_r12:
      c.init<event_c1_r12_s_>();
      break;
    case types::event_c2_r12:
      c.init<event_c2_r12_s_>();
      break;
    case types::event_v1_r14:
      c.init<event_v1_r14_s_>();
      break;
    case types::event_v2_r14:
      c.init<event_v2_r14_s_>();
      break;
    case types::event_h1_r15:
      c.init<event_h1_r15_s_>();
      break;
    case types::event_h2_r15:
      c.init<event_h2_r15_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "eutra_event_s::event_id_c_");
  }
}
eutra_event_s::event_id_c_::event_id_c_(const eutra_event_s::event_id_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::event_a1:
      c.init(other.c.get<event_a1_s_>());
      break;
    case types::event_a2:
      c.init(other.c.get<event_a2_s_>());
      break;
    case types::event_a3:
      c.init(other.c.get<event_a3_s_>());
      break;
    case types::event_a4:
      c.init(other.c.get<event_a4_s_>());
      break;
    case types::event_a5:
      c.init(other.c.get<event_a5_s_>());
      break;
    case types::event_a6_r10:
      c.init(other.c.get<event_a6_r10_s_>());
      break;
    case types::event_c1_r12:
      c.init(other.c.get<event_c1_r12_s_>());
      break;
    case types::event_c2_r12:
      c.init(other.c.get<event_c2_r12_s_>());
      break;
    case types::event_v1_r14:
      c.init(other.c.get<event_v1_r14_s_>());
      break;
    case types::event_v2_r14:
      c.init(other.c.get<event_v2_r14_s_>());
      break;
    case types::event_h1_r15:
      c.init(other.c.get<event_h1_r15_s_>());
      break;
    case types::event_h2_r15:
      c.init(other.c.get<event_h2_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "eutra_event_s::event_id_c_");
  }
}
eutra_event_s::event_id_c_& eutra_event_s::event_id_c_::operator=(const eutra_event_s::event_id_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::event_a1:
      c.set(other.c.get<event_a1_s_>());
      break;
    case types::event_a2:
      c.set(other.c.get<event_a2_s_>());
      break;
    case types::event_a3:
      c.set(other.c.get<event_a3_s_>());
      break;
    case types::event_a4:
      c.set(other.c.get<event_a4_s_>());
      break;
    case types::event_a5:
      c.set(other.c.get<event_a5_s_>());
      break;
    case types::event_a6_r10:
      c.set(other.c.get<event_a6_r10_s_>());
      break;
    case types::event_c1_r12:
      c.set(other.c.get<event_c1_r12_s_>());
      break;
    case types::event_c2_r12:
      c.set(other.c.get<event_c2_r12_s_>());
      break;
    case types::event_v1_r14:
      c.set(other.c.get<event_v1_r14_s_>());
      break;
    case types::event_v2_r14:
      c.set(other.c.get<event_v2_r14_s_>());
      break;
    case types::event_h1_r15:
      c.set(other.c.get<event_h1_r15_s_>());
      break;
    case types::event_h2_r15:
      c.set(other.c.get<event_h2_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "eutra_event_s::event_id_c_");
  }

  return *this;
}
void eutra_event_s::event_id_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::event_a1:
      j.write_fieldname("eventA1");
      j.start_obj();
      j.write_fieldname("a1-Threshold");
      c.get<event_a1_s_>().a1_thres.to_json(j);
      j.end_obj();
      break;
    case types::event_a2:
      j.write_fieldname("eventA2");
      j.start_obj();
      j.write_fieldname("a2-Threshold");
      c.get<event_a2_s_>().a2_thres.to_json(j);
      j.end_obj();
      break;
    case types::event_a3:
      j.write_fieldname("eventA3");
      j.start_obj();
      j.write_int("a3-Offset", c.get<event_a3_s_>().a3_offset);
      j.write_bool("reportOnLeave", c.get<event_a3_s_>().report_on_leave);
      j.end_obj();
      break;
    case types::event_a4:
      j.write_fieldname("eventA4");
      j.start_obj();
      j.write_fieldname("a4-Threshold");
      c.get<event_a4_s_>().a4_thres.to_json(j);
      j.end_obj();
      break;
    case types::event_a5:
      j.write_fieldname("eventA5");
      j.start_obj();
      j.write_fieldname("a5-Threshold1");
      c.get<event_a5_s_>().a5_thres1.to_json(j);
      j.write_fieldname("a5-Threshold2");
      c.get<event_a5_s_>().a5_thres2.to_json(j);
      j.end_obj();
      break;
    case types::event_a6_r10:
      j.write_fieldname("eventA6-r10");
      j.start_obj();
      j.write_int("a6-Offset-r10", c.get<event_a6_r10_s_>().a6_offset_r10);
      j.write_bool("a6-ReportOnLeave-r10", c.get<event_a6_r10_s_>().a6_report_on_leave_r10);
      j.end_obj();
      break;
    case types::event_c1_r12:
      j.write_fieldname("eventC1-r12");
      j.start_obj();
      j.write_int("c1-Threshold-r12", c.get<event_c1_r12_s_>().c1_thres_r12);
      j.write_bool("c1-ReportOnLeave-r12", c.get<event_c1_r12_s_>().c1_report_on_leave_r12);
      j.end_obj();
      break;
    case types::event_c2_r12:
      j.write_fieldname("eventC2-r12");
      j.start_obj();
      j.write_int("c2-RefCSI-RS-r12", c.get<event_c2_r12_s_>().c2_ref_csi_rs_r12);
      j.write_int("c2-Offset-r12", c.get<event_c2_r12_s_>().c2_offset_r12);
      j.write_bool("c2-ReportOnLeave-r12", c.get<event_c2_r12_s_>().c2_report_on_leave_r12);
      j.end_obj();
      break;
    case types::event_v1_r14:
      j.write_fieldname("eventV1-r14");
      j.start_obj();
      j.write_int("v1-Threshold-r14", c.get<event_v1_r14_s_>().v1_thres_r14);
      j.end_obj();
      break;
    case types::event_v2_r14:
      j.write_fieldname("eventV2-r14");
      j.start_obj();
      j.write_int("v2-Threshold-r14", c.get<event_v2_r14_s_>().v2_thres_r14);
      j.end_obj();
      break;
    case types::event_h1_r15:
      j.write_fieldname("eventH1-r15");
      j.start_obj();
      j.write_int("h1-ThresholdOffset-r15", c.get<event_h1_r15_s_>().h1_thres_offset_r15);
      j.write_int("h1-Hysteresis-15", c.get<event_h1_r15_s_>().h1_hysteresis_minus15);
      j.end_obj();
      break;
    case types::event_h2_r15:
      j.write_fieldname("eventH2-r15");
      j.start_obj();
      j.write_int("h2-ThresholdOffset-r15", c.get<event_h2_r15_s_>().h2_thres_offset_r15);
      j.write_int("h2-Hysteresis-15", c.get<event_h2_r15_s_>().h2_hysteresis_minus15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "eutra_event_s::event_id_c_");
  }
  j.end_obj();
}
SRSASN_CODE eutra_event_s::event_id_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::event_a1:
      HANDLE_CODE(c.get<event_a1_s_>().a1_thres.pack(bref));
      break;
    case types::event_a2:
      HANDLE_CODE(c.get<event_a2_s_>().a2_thres.pack(bref));
      break;
    case types::event_a3:
      HANDLE_CODE(pack_integer(bref, c.get<event_a3_s_>().a3_offset, (int8_t)-30, (int8_t)30));
      HANDLE_CODE(bref.pack(c.get<event_a3_s_>().report_on_leave, 1));
      break;
    case types::event_a4:
      HANDLE_CODE(c.get<event_a4_s_>().a4_thres.pack(bref));
      break;
    case types::event_a5:
      HANDLE_CODE(c.get<event_a5_s_>().a5_thres1.pack(bref));
      HANDLE_CODE(c.get<event_a5_s_>().a5_thres2.pack(bref));
      break;
    case types::event_a6_r10: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_a6_r10_s_>().a6_offset_r10, (int8_t)-30, (int8_t)30));
      HANDLE_CODE(bref.pack(c.get<event_a6_r10_s_>().a6_report_on_leave_r10, 1));
    } break;
    case types::event_c1_r12: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_c1_r12_s_>().c1_thres_r12, (uint8_t)0u, (uint8_t)97u));
      HANDLE_CODE(bref.pack(c.get<event_c1_r12_s_>().c1_report_on_leave_r12, 1));
    } break;
    case types::event_c2_r12: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_c2_r12_s_>().c2_ref_csi_rs_r12, (uint8_t)1u, (uint8_t)96u));
      HANDLE_CODE(pack_integer(bref, c.get<event_c2_r12_s_>().c2_offset_r12, (int8_t)-30, (int8_t)30));
      HANDLE_CODE(bref.pack(c.get<event_c2_r12_s_>().c2_report_on_leave_r12, 1));
    } break;
    case types::event_v1_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_v1_r14_s_>().v1_thres_r14, (uint8_t)0u, (uint8_t)100u));
    } break;
    case types::event_v2_r14: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_v2_r14_s_>().v2_thres_r14, (uint8_t)0u, (uint8_t)100u));
    } break;
    case types::event_h1_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_h1_r15_s_>().h1_thres_offset_r15, (uint16_t)0u, (uint16_t)300u));
      HANDLE_CODE(pack_integer(bref, c.get<event_h1_r15_s_>().h1_hysteresis_minus15, (uint8_t)1u, (uint8_t)16u));
    } break;
    case types::event_h2_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_h2_r15_s_>().h2_thres_offset_r15, (uint16_t)0u, (uint16_t)300u));
      HANDLE_CODE(pack_integer(bref, c.get<event_h2_r15_s_>().h2_hysteresis_minus15, (uint8_t)1u, (uint8_t)16u));
    } break;
    default:
      log_invalid_choice_id(type_, "eutra_event_s::event_id_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE eutra_event_s::event_id_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::event_a1:
      HANDLE_CODE(c.get<event_a1_s_>().a1_thres.unpack(bref));
      break;
    case types::event_a2:
      HANDLE_CODE(c.get<event_a2_s_>().a2_thres.unpack(bref));
      break;
    case types::event_a3:
      HANDLE_CODE(unpack_integer(c.get<event_a3_s_>().a3_offset, bref, (int8_t)-30, (int8_t)30));
      HANDLE_CODE(bref.unpack(c.get<event_a3_s_>().report_on_leave, 1));
      break;
    case types::event_a4:
      HANDLE_CODE(c.get<event_a4_s_>().a4_thres.unpack(bref));
      break;
    case types::event_a5:
      HANDLE_CODE(c.get<event_a5_s_>().a5_thres1.unpack(bref));
      HANDLE_CODE(c.get<event_a5_s_>().a5_thres2.unpack(bref));
      break;
    case types::event_a6_r10: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_a6_r10_s_>().a6_offset_r10, bref, (int8_t)-30, (int8_t)30));
      HANDLE_CODE(bref.unpack(c.get<event_a6_r10_s_>().a6_report_on_leave_r10, 1));
    } break;
    case types::event_c1_r12: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_c1_r12_s_>().c1_thres_r12, bref, (uint8_t)0u, (uint8_t)97u));
      HANDLE_CODE(bref.unpack(c.get<event_c1_r12_s_>().c1_report_on_leave_r12, 1));
    } break;
    case types::event_c2_r12: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_c2_r12_s_>().c2_ref_csi_rs_r12, bref, (uint8_t)1u, (uint8_t)96u));
      HANDLE_CODE(unpack_integer(c.get<event_c2_r12_s_>().c2_offset_r12, bref, (int8_t)-30, (int8_t)30));
      HANDLE_CODE(bref.unpack(c.get<event_c2_r12_s_>().c2_report_on_leave_r12, 1));
    } break;
    case types::event_v1_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_v1_r14_s_>().v1_thres_r14, bref, (uint8_t)0u, (uint8_t)100u));
    } break;
    case types::event_v2_r14: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_v2_r14_s_>().v2_thres_r14, bref, (uint8_t)0u, (uint8_t)100u));
    } break;
    case types::event_h1_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_h1_r15_s_>().h1_thres_offset_r15, bref, (uint16_t)0u, (uint16_t)300u));
      HANDLE_CODE(unpack_integer(c.get<event_h1_r15_s_>().h1_hysteresis_minus15, bref, (uint8_t)1u, (uint8_t)16u));
    } break;
    case types::event_h2_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_h2_r15_s_>().h2_thres_offset_r15, bref, (uint16_t)0u, (uint16_t)300u));
      HANDLE_CODE(unpack_integer(c.get<event_h2_r15_s_>().h2_hysteresis_minus15, bref, (uint8_t)1u, (uint8_t)16u));
    } break;
    default:
      log_invalid_choice_id(type_, "eutra_event_s::event_id_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ReportConfigEUTRA ::= SEQUENCE
SRSASN_CODE report_cfg_eutra_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(trigger_type.pack(bref));
  HANDLE_CODE(trigger_quant.pack(bref));
  HANDLE_CODE(report_quant.pack(bref));
  HANDLE_CODE(pack_integer(bref, max_report_cells, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(report_interv.pack(bref));
  HANDLE_CODE(report_amount.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= si_request_for_ho_r9_present;
    group_flags[0] |= ue_rx_tx_time_diff_periodical_r9_present;
    group_flags[1] |= include_location_info_r10_present;
    group_flags[1] |= report_add_neigh_meas_r10_present;
    group_flags[2] |= alt_time_to_trigger_r12.is_present();
    group_flags[2] |= use_t312_r12_present;
    group_flags[2] |= use_ps_cell_r12_present;
    group_flags[2] |= an_thres1_v1250.is_present();
    group_flags[2] |= a5_thres2_v1250.is_present();
    group_flags[2] |= report_strongest_csi_rss_r12_present;
    group_flags[2] |= report_crs_meas_r12_present;
    group_flags[2] |= trigger_quant_csi_rs_r12_present;
    group_flags[3] |= report_sstd_meas_r13_present;
    group_flags[3] |= rs_sinr_cfg_r13.is_present();
    group_flags[3] |= use_white_cell_list_r13_present;
    group_flags[3] |= meas_rssi_report_cfg_r13.is_present();
    group_flags[3] |= include_multi_band_info_r13_present;
    group_flags[3] |= ul_delay_cfg_r13.is_present();
    group_flags[4] |= ue_rx_tx_time_diff_periodical_tdd_r13_present;
    group_flags[5] |= purpose_v1430_present;
    group_flags[6] |= max_report_rs_idx_r15_present;
    group_flags[7] |= include_bt_meas_r15.is_present();
    group_flags[7] |= include_wlan_meas_r15.is_present();
    group_flags[7] |= purpose_r15_present;
    group_flags[7] |= nof_trigger_cells_r15_present;
    group_flags[7] |= a4_a5_report_on_leave_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(si_request_for_ho_r9_present, 1));
      HANDLE_CODE(bref.pack(ue_rx_tx_time_diff_periodical_r9_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(include_location_info_r10_present, 1));
      HANDLE_CODE(bref.pack(report_add_neigh_meas_r10_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(alt_time_to_trigger_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(use_t312_r12_present, 1));
      HANDLE_CODE(bref.pack(use_ps_cell_r12_present, 1));
      HANDLE_CODE(bref.pack(an_thres1_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(a5_thres2_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(report_strongest_csi_rss_r12_present, 1));
      HANDLE_CODE(bref.pack(report_crs_meas_r12_present, 1));
      HANDLE_CODE(bref.pack(trigger_quant_csi_rs_r12_present, 1));
      if (alt_time_to_trigger_r12.is_present()) {
        HANDLE_CODE(alt_time_to_trigger_r12->pack(bref));
      }
      if (use_t312_r12_present) {
        HANDLE_CODE(bref.pack(use_t312_r12, 1));
      }
      if (use_ps_cell_r12_present) {
        HANDLE_CODE(bref.pack(use_ps_cell_r12, 1));
      }
      if (an_thres1_v1250.is_present()) {
        HANDLE_CODE(an_thres1_v1250->pack(bref));
      }
      if (a5_thres2_v1250.is_present()) {
        HANDLE_CODE(a5_thres2_v1250->pack(bref));
      }
      if (report_strongest_csi_rss_r12_present) {
        HANDLE_CODE(bref.pack(report_strongest_csi_rss_r12, 1));
      }
      if (report_crs_meas_r12_present) {
        HANDLE_CODE(bref.pack(report_crs_meas_r12, 1));
      }
      if (trigger_quant_csi_rs_r12_present) {
        HANDLE_CODE(bref.pack(trigger_quant_csi_rs_r12, 1));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(report_sstd_meas_r13_present, 1));
      HANDLE_CODE(bref.pack(rs_sinr_cfg_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(use_white_cell_list_r13_present, 1));
      HANDLE_CODE(bref.pack(meas_rssi_report_cfg_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(include_multi_band_info_r13_present, 1));
      HANDLE_CODE(bref.pack(ul_delay_cfg_r13.is_present(), 1));
      if (report_sstd_meas_r13_present) {
        HANDLE_CODE(bref.pack(report_sstd_meas_r13, 1));
      }
      if (rs_sinr_cfg_r13.is_present()) {
        HANDLE_CODE(rs_sinr_cfg_r13->pack(bref));
      }
      if (use_white_cell_list_r13_present) {
        HANDLE_CODE(bref.pack(use_white_cell_list_r13, 1));
      }
      if (meas_rssi_report_cfg_r13.is_present()) {
        HANDLE_CODE(meas_rssi_report_cfg_r13->pack(bref));
      }
      if (ul_delay_cfg_r13.is_present()) {
        HANDLE_CODE(ul_delay_cfg_r13->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ue_rx_tx_time_diff_periodical_tdd_r13_present, 1));
      if (ue_rx_tx_time_diff_periodical_tdd_r13_present) {
        HANDLE_CODE(bref.pack(ue_rx_tx_time_diff_periodical_tdd_r13, 1));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(purpose_v1430_present, 1));
      if (purpose_v1430_present) {
        HANDLE_CODE(purpose_v1430.pack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(max_report_rs_idx_r15_present, 1));
      if (max_report_rs_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, max_report_rs_idx_r15, (uint8_t)0u, (uint8_t)32u));
      }
    }
    if (group_flags[7]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(include_bt_meas_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(include_wlan_meas_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(purpose_r15_present, 1));
      HANDLE_CODE(bref.pack(nof_trigger_cells_r15_present, 1));
      HANDLE_CODE(bref.pack(a4_a5_report_on_leave_r15_present, 1));
      if (include_bt_meas_r15.is_present()) {
        HANDLE_CODE(include_bt_meas_r15->pack(bref));
      }
      if (include_wlan_meas_r15.is_present()) {
        HANDLE_CODE(include_wlan_meas_r15->pack(bref));
      }
      if (nof_trigger_cells_r15_present) {
        HANDLE_CODE(pack_integer(bref, nof_trigger_cells_r15, (uint8_t)2u, (uint8_t)8u));
      }
      if (a4_a5_report_on_leave_r15_present) {
        HANDLE_CODE(bref.pack(a4_a5_report_on_leave_r15, 1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_eutra_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(trigger_type.unpack(bref));
  HANDLE_CODE(trigger_quant.unpack(bref));
  HANDLE_CODE(report_quant.unpack(bref));
  HANDLE_CODE(unpack_integer(max_report_cells, bref, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(report_interv.unpack(bref));
  HANDLE_CODE(report_amount.unpack(bref));

  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(si_request_for_ho_r9_present, 1));
      HANDLE_CODE(bref.unpack(ue_rx_tx_time_diff_periodical_r9_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(include_location_info_r10_present, 1));
      HANDLE_CODE(bref.unpack(report_add_neigh_meas_r10_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool alt_time_to_trigger_r12_present;
      HANDLE_CODE(bref.unpack(alt_time_to_trigger_r12_present, 1));
      alt_time_to_trigger_r12.set_present(alt_time_to_trigger_r12_present);
      HANDLE_CODE(bref.unpack(use_t312_r12_present, 1));
      HANDLE_CODE(bref.unpack(use_ps_cell_r12_present, 1));
      bool an_thres1_v1250_present;
      HANDLE_CODE(bref.unpack(an_thres1_v1250_present, 1));
      an_thres1_v1250.set_present(an_thres1_v1250_present);
      bool a5_thres2_v1250_present;
      HANDLE_CODE(bref.unpack(a5_thres2_v1250_present, 1));
      a5_thres2_v1250.set_present(a5_thres2_v1250_present);
      HANDLE_CODE(bref.unpack(report_strongest_csi_rss_r12_present, 1));
      HANDLE_CODE(bref.unpack(report_crs_meas_r12_present, 1));
      HANDLE_CODE(bref.unpack(trigger_quant_csi_rs_r12_present, 1));
      if (alt_time_to_trigger_r12.is_present()) {
        HANDLE_CODE(alt_time_to_trigger_r12->unpack(bref));
      }
      if (use_t312_r12_present) {
        HANDLE_CODE(bref.unpack(use_t312_r12, 1));
      }
      if (use_ps_cell_r12_present) {
        HANDLE_CODE(bref.unpack(use_ps_cell_r12, 1));
      }
      if (an_thres1_v1250.is_present()) {
        HANDLE_CODE(an_thres1_v1250->unpack(bref));
      }
      if (a5_thres2_v1250.is_present()) {
        HANDLE_CODE(a5_thres2_v1250->unpack(bref));
      }
      if (report_strongest_csi_rss_r12_present) {
        HANDLE_CODE(bref.unpack(report_strongest_csi_rss_r12, 1));
      }
      if (report_crs_meas_r12_present) {
        HANDLE_CODE(bref.unpack(report_crs_meas_r12, 1));
      }
      if (trigger_quant_csi_rs_r12_present) {
        HANDLE_CODE(bref.unpack(trigger_quant_csi_rs_r12, 1));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(report_sstd_meas_r13_present, 1));
      bool rs_sinr_cfg_r13_present;
      HANDLE_CODE(bref.unpack(rs_sinr_cfg_r13_present, 1));
      rs_sinr_cfg_r13.set_present(rs_sinr_cfg_r13_present);
      HANDLE_CODE(bref.unpack(use_white_cell_list_r13_present, 1));
      bool meas_rssi_report_cfg_r13_present;
      HANDLE_CODE(bref.unpack(meas_rssi_report_cfg_r13_present, 1));
      meas_rssi_report_cfg_r13.set_present(meas_rssi_report_cfg_r13_present);
      HANDLE_CODE(bref.unpack(include_multi_band_info_r13_present, 1));
      bool ul_delay_cfg_r13_present;
      HANDLE_CODE(bref.unpack(ul_delay_cfg_r13_present, 1));
      ul_delay_cfg_r13.set_present(ul_delay_cfg_r13_present);
      if (report_sstd_meas_r13_present) {
        HANDLE_CODE(bref.unpack(report_sstd_meas_r13, 1));
      }
      if (rs_sinr_cfg_r13.is_present()) {
        HANDLE_CODE(rs_sinr_cfg_r13->unpack(bref));
      }
      if (use_white_cell_list_r13_present) {
        HANDLE_CODE(bref.unpack(use_white_cell_list_r13, 1));
      }
      if (meas_rssi_report_cfg_r13.is_present()) {
        HANDLE_CODE(meas_rssi_report_cfg_r13->unpack(bref));
      }
      if (ul_delay_cfg_r13.is_present()) {
        HANDLE_CODE(ul_delay_cfg_r13->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(ue_rx_tx_time_diff_periodical_tdd_r13_present, 1));
      if (ue_rx_tx_time_diff_periodical_tdd_r13_present) {
        HANDLE_CODE(bref.unpack(ue_rx_tx_time_diff_periodical_tdd_r13, 1));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(purpose_v1430_present, 1));
      if (purpose_v1430_present) {
        HANDLE_CODE(purpose_v1430.unpack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(max_report_rs_idx_r15_present, 1));
      if (max_report_rs_idx_r15_present) {
        HANDLE_CODE(unpack_integer(max_report_rs_idx_r15, bref, (uint8_t)0u, (uint8_t)32u));
      }
    }
    if (group_flags[7]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool include_bt_meas_r15_present;
      HANDLE_CODE(bref.unpack(include_bt_meas_r15_present, 1));
      include_bt_meas_r15.set_present(include_bt_meas_r15_present);
      bool include_wlan_meas_r15_present;
      HANDLE_CODE(bref.unpack(include_wlan_meas_r15_present, 1));
      include_wlan_meas_r15.set_present(include_wlan_meas_r15_present);
      HANDLE_CODE(bref.unpack(purpose_r15_present, 1));
      HANDLE_CODE(bref.unpack(nof_trigger_cells_r15_present, 1));
      HANDLE_CODE(bref.unpack(a4_a5_report_on_leave_r15_present, 1));
      if (include_bt_meas_r15.is_present()) {
        HANDLE_CODE(include_bt_meas_r15->unpack(bref));
      }
      if (include_wlan_meas_r15.is_present()) {
        HANDLE_CODE(include_wlan_meas_r15->unpack(bref));
      }
      if (nof_trigger_cells_r15_present) {
        HANDLE_CODE(unpack_integer(nof_trigger_cells_r15, bref, (uint8_t)2u, (uint8_t)8u));
      }
      if (a4_a5_report_on_leave_r15_present) {
        HANDLE_CODE(bref.unpack(a4_a5_report_on_leave_r15, 1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void report_cfg_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("triggerType");
  trigger_type.to_json(j);
  j.write_str("triggerQuantity", trigger_quant.to_string());
  j.write_str("reportQuantity", report_quant.to_string());
  j.write_int("maxReportCells", max_report_cells);
  j.write_str("reportInterval", report_interv.to_string());
  j.write_str("reportAmount", report_amount.to_string());
  if (ext) {
    if (si_request_for_ho_r9_present) {
      j.write_str("si-RequestForHO-r9", "setup");
    }
    if (ue_rx_tx_time_diff_periodical_r9_present) {
      j.write_str("ue-RxTxTimeDiffPeriodical-r9", "setup");
    }
    if (include_location_info_r10_present) {
      j.write_str("includeLocationInfo-r10", "true");
    }
    if (report_add_neigh_meas_r10_present) {
      j.write_str("reportAddNeighMeas-r10", "setup");
    }
    if (alt_time_to_trigger_r12.is_present()) {
      j.write_fieldname("alternativeTimeToTrigger-r12");
      alt_time_to_trigger_r12->to_json(j);
    }
    if (use_t312_r12_present) {
      j.write_bool("useT312-r12", use_t312_r12);
    }
    if (use_ps_cell_r12_present) {
      j.write_bool("usePSCell-r12", use_ps_cell_r12);
    }
    if (an_thres1_v1250.is_present()) {
      j.write_fieldname("aN-Threshold1-v1250");
      an_thres1_v1250->to_json(j);
    }
    if (a5_thres2_v1250.is_present()) {
      j.write_fieldname("a5-Threshold2-v1250");
      a5_thres2_v1250->to_json(j);
    }
    if (report_strongest_csi_rss_r12_present) {
      j.write_bool("reportStrongestCSI-RSs-r12", report_strongest_csi_rss_r12);
    }
    if (report_crs_meas_r12_present) {
      j.write_bool("reportCRS-Meas-r12", report_crs_meas_r12);
    }
    if (trigger_quant_csi_rs_r12_present) {
      j.write_bool("triggerQuantityCSI-RS-r12", trigger_quant_csi_rs_r12);
    }
    if (report_sstd_meas_r13_present) {
      j.write_bool("reportSSTD-Meas-r13", report_sstd_meas_r13);
    }
    if (rs_sinr_cfg_r13.is_present()) {
      j.write_fieldname("rs-sinr-Config-r13");
      rs_sinr_cfg_r13->to_json(j);
    }
    if (use_white_cell_list_r13_present) {
      j.write_bool("useWhiteCellList-r13", use_white_cell_list_r13);
    }
    if (meas_rssi_report_cfg_r13.is_present()) {
      j.write_fieldname("measRSSI-ReportConfig-r13");
      meas_rssi_report_cfg_r13->to_json(j);
    }
    if (include_multi_band_info_r13_present) {
      j.write_str("includeMultiBandInfo-r13", "true");
    }
    if (ul_delay_cfg_r13.is_present()) {
      j.write_fieldname("ul-DelayConfig-r13");
      ul_delay_cfg_r13->to_json(j);
    }
    if (ue_rx_tx_time_diff_periodical_tdd_r13_present) {
      j.write_bool("ue-RxTxTimeDiffPeriodicalTDD-r13", ue_rx_tx_time_diff_periodical_tdd_r13);
    }
    if (purpose_v1430_present) {
      j.write_str("purpose-v1430", purpose_v1430.to_string());
    }
    if (max_report_rs_idx_r15_present) {
      j.write_int("maxReportRS-Index-r15", max_report_rs_idx_r15);
    }
    if (include_bt_meas_r15.is_present()) {
      j.write_fieldname("includeBT-Meas-r15");
      include_bt_meas_r15->to_json(j);
    }
    if (include_wlan_meas_r15.is_present()) {
      j.write_fieldname("includeWLAN-Meas-r15");
      include_wlan_meas_r15->to_json(j);
    }
    if (purpose_r15_present) {
      j.write_str("purpose-r15", "sensing");
    }
    if (nof_trigger_cells_r15_present) {
      j.write_int("numberOfTriggeringCells-r15", nof_trigger_cells_r15);
    }
    if (a4_a5_report_on_leave_r15_present) {
      j.write_bool("a4-a5-ReportOnLeave-r15", a4_a5_report_on_leave_r15);
    }
  }
  j.end_obj();
}

void report_cfg_eutra_s::trigger_type_c_::destroy_()
{
  switch (type_) {
    case types::event:
      c.destroy<event_s_>();
      break;
    case types::periodical:
      c.destroy<periodical_s_>();
      break;
    default:
      break;
  }
}
void report_cfg_eutra_s::trigger_type_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::event:
      c.init<event_s_>();
      break;
    case types::periodical:
      c.init<periodical_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::trigger_type_c_");
  }
}
report_cfg_eutra_s::trigger_type_c_::trigger_type_c_(const report_cfg_eutra_s::trigger_type_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::event:
      c.init(other.c.get<event_s_>());
      break;
    case types::periodical:
      c.init(other.c.get<periodical_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::trigger_type_c_");
  }
}
report_cfg_eutra_s::trigger_type_c_& report_cfg_eutra_s::trigger_type_c_::
                                     operator=(const report_cfg_eutra_s::trigger_type_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::event:
      c.set(other.c.get<event_s_>());
      break;
    case types::periodical:
      c.set(other.c.get<periodical_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::trigger_type_c_");
  }

  return *this;
}
void report_cfg_eutra_s::trigger_type_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::event:
      j.write_fieldname("event");
      c.get<event_s_>().to_json(j);
      break;
    case types::periodical:
      j.write_fieldname("periodical");
      j.start_obj();
      j.write_str("purpose", c.get<periodical_s_>().purpose.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::trigger_type_c_");
  }
  j.end_obj();
}
SRSASN_CODE report_cfg_eutra_s::trigger_type_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::event:
      HANDLE_CODE(c.get<event_s_>().pack(bref));
      break;
    case types::periodical:
      HANDLE_CODE(c.get<periodical_s_>().purpose.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::trigger_type_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_eutra_s::trigger_type_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::event:
      HANDLE_CODE(c.get<event_s_>().unpack(bref));
      break;
    case types::periodical:
      HANDLE_CODE(c.get<periodical_s_>().purpose.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::trigger_type_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void report_cfg_eutra_s::alt_time_to_trigger_r12_c_::set(types::options e)
{
  type_ = e;
}
void report_cfg_eutra_s::alt_time_to_trigger_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::alt_time_to_trigger_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE report_cfg_eutra_s::alt_time_to_trigger_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::alt_time_to_trigger_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_eutra_s::alt_time_to_trigger_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::alt_time_to_trigger_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void report_cfg_eutra_s::rs_sinr_cfg_r13_c_::set(types::options e)
{
  type_ = e;
}
void report_cfg_eutra_s::rs_sinr_cfg_r13_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.trigger_quant_v1310_present) {
        j.write_str("triggerQuantity-v1310", "sinr");
      }
      if (c.an_thres1_r13_present) {
        j.write_int("aN-Threshold1-r13", c.an_thres1_r13);
      }
      if (c.a5_thres2_r13_present) {
        j.write_int("a5-Threshold2-r13", c.a5_thres2_r13);
      }
      j.write_str("reportQuantity-v1310", c.report_quant_v1310.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::rs_sinr_cfg_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE report_cfg_eutra_s::rs_sinr_cfg_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.trigger_quant_v1310_present, 1));
      HANDLE_CODE(bref.pack(c.an_thres1_r13_present, 1));
      HANDLE_CODE(bref.pack(c.a5_thres2_r13_present, 1));
      if (c.an_thres1_r13_present) {
        HANDLE_CODE(pack_integer(bref, c.an_thres1_r13, (uint8_t)0u, (uint8_t)127u));
      }
      if (c.a5_thres2_r13_present) {
        HANDLE_CODE(pack_integer(bref, c.a5_thres2_r13, (uint8_t)0u, (uint8_t)127u));
      }
      HANDLE_CODE(c.report_quant_v1310.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::rs_sinr_cfg_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_eutra_s::rs_sinr_cfg_r13_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.trigger_quant_v1310_present, 1));
      HANDLE_CODE(bref.unpack(c.an_thres1_r13_present, 1));
      HANDLE_CODE(bref.unpack(c.a5_thres2_r13_present, 1));
      if (c.an_thres1_r13_present) {
        HANDLE_CODE(unpack_integer(c.an_thres1_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
      if (c.a5_thres2_r13_present) {
        HANDLE_CODE(unpack_integer(c.a5_thres2_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
      HANDLE_CODE(c.report_quant_v1310.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_eutra_s::rs_sinr_cfg_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ReportConfigInterRAT ::= SEQUENCE
SRSASN_CODE report_cfg_inter_rat_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(trigger_type.pack(bref));
  HANDLE_CODE(pack_integer(bref, max_report_cells, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(report_interv.pack(bref));
  HANDLE_CODE(report_amount.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= si_request_for_ho_r9_present;
    group_flags[1] |= report_quant_utra_fdd_r10_present;
    group_flags[2] |= include_location_info_r11_present;
    group_flags[3] |= b2_thres1_v1250.is_present();
    group_flags[4] |= report_quant_wlan_r13.is_present();
    group_flags[5] |= report_any_wlan_r14_present;
    group_flags[6] |= report_quant_cell_nr_r15.is_present();
    group_flags[6] |= max_report_rs_idx_r15_present;
    group_flags[6] |= report_quant_rs_idx_nr_r15.is_present();
    group_flags[6] |= report_rs_idx_results_nr_present;
    group_flags[6] |= report_sftd_meas_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(si_request_for_ho_r9_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(report_quant_utra_fdd_r10_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(include_location_info_r11_present, 1));
      if (include_location_info_r11_present) {
        HANDLE_CODE(bref.pack(include_location_info_r11, 1));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(b2_thres1_v1250.is_present(), 1));
      if (b2_thres1_v1250.is_present()) {
        HANDLE_CODE(b2_thres1_v1250->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(report_quant_wlan_r13.is_present(), 1));
      if (report_quant_wlan_r13.is_present()) {
        HANDLE_CODE(report_quant_wlan_r13->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(report_any_wlan_r14_present, 1));
      if (report_any_wlan_r14_present) {
        HANDLE_CODE(bref.pack(report_any_wlan_r14, 1));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(report_quant_cell_nr_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(max_report_rs_idx_r15_present, 1));
      HANDLE_CODE(bref.pack(report_quant_rs_idx_nr_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(report_rs_idx_results_nr_present, 1));
      HANDLE_CODE(bref.pack(report_sftd_meas_r15_present, 1));
      if (report_quant_cell_nr_r15.is_present()) {
        HANDLE_CODE(report_quant_cell_nr_r15->pack(bref));
      }
      if (max_report_rs_idx_r15_present) {
        HANDLE_CODE(pack_integer(bref, max_report_rs_idx_r15, (uint8_t)0u, (uint8_t)32u));
      }
      if (report_quant_rs_idx_nr_r15.is_present()) {
        HANDLE_CODE(report_quant_rs_idx_nr_r15->pack(bref));
      }
      if (report_rs_idx_results_nr_present) {
        HANDLE_CODE(bref.pack(report_rs_idx_results_nr, 1));
      }
      if (report_sftd_meas_r15_present) {
        HANDLE_CODE(report_sftd_meas_r15.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_inter_rat_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(trigger_type.unpack(bref));
  HANDLE_CODE(unpack_integer(max_report_cells, bref, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(report_interv.unpack(bref));
  HANDLE_CODE(report_amount.unpack(bref));

  if (ext) {
    ext_groups_unpacker_guard group_flags(7);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(si_request_for_ho_r9_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(report_quant_utra_fdd_r10_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(include_location_info_r11_present, 1));
      if (include_location_info_r11_present) {
        HANDLE_CODE(bref.unpack(include_location_info_r11, 1));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool b2_thres1_v1250_present;
      HANDLE_CODE(bref.unpack(b2_thres1_v1250_present, 1));
      b2_thres1_v1250.set_present(b2_thres1_v1250_present);
      if (b2_thres1_v1250.is_present()) {
        HANDLE_CODE(b2_thres1_v1250->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool report_quant_wlan_r13_present;
      HANDLE_CODE(bref.unpack(report_quant_wlan_r13_present, 1));
      report_quant_wlan_r13.set_present(report_quant_wlan_r13_present);
      if (report_quant_wlan_r13.is_present()) {
        HANDLE_CODE(report_quant_wlan_r13->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(report_any_wlan_r14_present, 1));
      if (report_any_wlan_r14_present) {
        HANDLE_CODE(bref.unpack(report_any_wlan_r14, 1));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool report_quant_cell_nr_r15_present;
      HANDLE_CODE(bref.unpack(report_quant_cell_nr_r15_present, 1));
      report_quant_cell_nr_r15.set_present(report_quant_cell_nr_r15_present);
      HANDLE_CODE(bref.unpack(max_report_rs_idx_r15_present, 1));
      bool report_quant_rs_idx_nr_r15_present;
      HANDLE_CODE(bref.unpack(report_quant_rs_idx_nr_r15_present, 1));
      report_quant_rs_idx_nr_r15.set_present(report_quant_rs_idx_nr_r15_present);
      HANDLE_CODE(bref.unpack(report_rs_idx_results_nr_present, 1));
      HANDLE_CODE(bref.unpack(report_sftd_meas_r15_present, 1));
      if (report_quant_cell_nr_r15.is_present()) {
        HANDLE_CODE(report_quant_cell_nr_r15->unpack(bref));
      }
      if (max_report_rs_idx_r15_present) {
        HANDLE_CODE(unpack_integer(max_report_rs_idx_r15, bref, (uint8_t)0u, (uint8_t)32u));
      }
      if (report_quant_rs_idx_nr_r15.is_present()) {
        HANDLE_CODE(report_quant_rs_idx_nr_r15->unpack(bref));
      }
      if (report_rs_idx_results_nr_present) {
        HANDLE_CODE(bref.unpack(report_rs_idx_results_nr, 1));
      }
      if (report_sftd_meas_r15_present) {
        HANDLE_CODE(report_sftd_meas_r15.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void report_cfg_inter_rat_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("triggerType");
  trigger_type.to_json(j);
  j.write_int("maxReportCells", max_report_cells);
  j.write_str("reportInterval", report_interv.to_string());
  j.write_str("reportAmount", report_amount.to_string());
  if (ext) {
    if (si_request_for_ho_r9_present) {
      j.write_str("si-RequestForHO-r9", "setup");
    }
    if (report_quant_utra_fdd_r10_present) {
      j.write_str("reportQuantityUTRA-FDD-r10", "both");
    }
    if (include_location_info_r11_present) {
      j.write_bool("includeLocationInfo-r11", include_location_info_r11);
    }
    if (b2_thres1_v1250.is_present()) {
      j.write_fieldname("b2-Threshold1-v1250");
      b2_thres1_v1250->to_json(j);
    }
    if (report_quant_wlan_r13.is_present()) {
      j.write_fieldname("reportQuantityWLAN-r13");
      report_quant_wlan_r13->to_json(j);
    }
    if (report_any_wlan_r14_present) {
      j.write_bool("reportAnyWLAN-r14", report_any_wlan_r14);
    }
    if (report_quant_cell_nr_r15.is_present()) {
      j.write_fieldname("reportQuantityCellNR-r15");
      report_quant_cell_nr_r15->to_json(j);
    }
    if (max_report_rs_idx_r15_present) {
      j.write_int("maxReportRS-Index-r15", max_report_rs_idx_r15);
    }
    if (report_quant_rs_idx_nr_r15.is_present()) {
      j.write_fieldname("reportQuantityRS-IndexNR-r15");
      report_quant_rs_idx_nr_r15->to_json(j);
    }
    if (report_rs_idx_results_nr_present) {
      j.write_bool("reportRS-IndexResultsNR", report_rs_idx_results_nr);
    }
    if (report_sftd_meas_r15_present) {
      j.write_str("reportSFTD-Meas-r15", report_sftd_meas_r15.to_string());
    }
  }
  j.end_obj();
}

void report_cfg_inter_rat_s::trigger_type_c_::destroy_()
{
  switch (type_) {
    case types::event:
      c.destroy<event_s_>();
      break;
    case types::periodical:
      c.destroy<periodical_s_>();
      break;
    default:
      break;
  }
}
void report_cfg_inter_rat_s::trigger_type_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::event:
      c.init<event_s_>();
      break;
    case types::periodical:
      c.init<periodical_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_");
  }
}
report_cfg_inter_rat_s::trigger_type_c_::trigger_type_c_(const report_cfg_inter_rat_s::trigger_type_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::event:
      c.init(other.c.get<event_s_>());
      break;
    case types::periodical:
      c.init(other.c.get<periodical_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_");
  }
}
report_cfg_inter_rat_s::trigger_type_c_& report_cfg_inter_rat_s::trigger_type_c_::
                                         operator=(const report_cfg_inter_rat_s::trigger_type_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::event:
      c.set(other.c.get<event_s_>());
      break;
    case types::periodical:
      c.set(other.c.get<periodical_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_");
  }

  return *this;
}
void report_cfg_inter_rat_s::trigger_type_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::event:
      j.write_fieldname("event");
      j.start_obj();
      j.write_fieldname("eventId");
      c.get<event_s_>().event_id.to_json(j);
      j.write_int("hysteresis", c.get<event_s_>().hysteresis);
      j.write_str("timeToTrigger", c.get<event_s_>().time_to_trigger.to_string());
      j.end_obj();
      break;
    case types::periodical:
      j.write_fieldname("periodical");
      j.start_obj();
      j.write_str("purpose", c.get<periodical_s_>().purpose.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_");
  }
  j.end_obj();
}
SRSASN_CODE report_cfg_inter_rat_s::trigger_type_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::event:
      HANDLE_CODE(c.get<event_s_>().event_id.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.get<event_s_>().hysteresis, (uint8_t)0u, (uint8_t)30u));
      HANDLE_CODE(c.get<event_s_>().time_to_trigger.pack(bref));
      break;
    case types::periodical:
      HANDLE_CODE(c.get<periodical_s_>().purpose.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_inter_rat_s::trigger_type_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::event:
      HANDLE_CODE(c.get<event_s_>().event_id.unpack(bref));
      HANDLE_CODE(unpack_integer(c.get<event_s_>().hysteresis, bref, (uint8_t)0u, (uint8_t)30u));
      HANDLE_CODE(c.get<event_s_>().time_to_trigger.unpack(bref));
      break;
    case types::periodical:
      HANDLE_CODE(c.get<periodical_s_>().purpose.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::destroy_()
{
  switch (type_) {
    case types::event_b1:
      c.destroy<event_b1_s_>();
      break;
    case types::event_b2:
      c.destroy<event_b2_s_>();
      break;
    case types::event_w1_r13:
      c.destroy<event_w1_r13_s_>();
      break;
    case types::event_w2_r13:
      c.destroy<event_w2_r13_s_>();
      break;
    case types::event_w3_r13:
      c.destroy<event_w3_r13_s_>();
      break;
    case types::event_b1_nr_r15:
      c.destroy<event_b1_nr_r15_s_>();
      break;
    case types::event_b2_nr_r15:
      c.destroy<event_b2_nr_r15_s_>();
      break;
    default:
      break;
  }
}
void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::event_b1:
      c.init<event_b1_s_>();
      break;
    case types::event_b2:
      c.init<event_b2_s_>();
      break;
    case types::event_w1_r13:
      c.init<event_w1_r13_s_>();
      break;
    case types::event_w2_r13:
      c.init<event_w2_r13_s_>();
      break;
    case types::event_w3_r13:
      c.init<event_w3_r13_s_>();
      break;
    case types::event_b1_nr_r15:
      c.init<event_b1_nr_r15_s_>();
      break;
    case types::event_b2_nr_r15:
      c.init<event_b2_nr_r15_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_");
  }
}
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_id_c_(
    const report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::event_b1:
      c.init(other.c.get<event_b1_s_>());
      break;
    case types::event_b2:
      c.init(other.c.get<event_b2_s_>());
      break;
    case types::event_w1_r13:
      c.init(other.c.get<event_w1_r13_s_>());
      break;
    case types::event_w2_r13:
      c.init(other.c.get<event_w2_r13_s_>());
      break;
    case types::event_w3_r13:
      c.init(other.c.get<event_w3_r13_s_>());
      break;
    case types::event_b1_nr_r15:
      c.init(other.c.get<event_b1_nr_r15_s_>());
      break;
    case types::event_b2_nr_r15:
      c.init(other.c.get<event_b2_nr_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_");
  }
}
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_&
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::
operator=(const report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::event_b1:
      c.set(other.c.get<event_b1_s_>());
      break;
    case types::event_b2:
      c.set(other.c.get<event_b2_s_>());
      break;
    case types::event_w1_r13:
      c.set(other.c.get<event_w1_r13_s_>());
      break;
    case types::event_w2_r13:
      c.set(other.c.get<event_w2_r13_s_>());
      break;
    case types::event_w3_r13:
      c.set(other.c.get<event_w3_r13_s_>());
      break;
    case types::event_b1_nr_r15:
      c.set(other.c.get<event_b1_nr_r15_s_>());
      break;
    case types::event_b2_nr_r15:
      c.set(other.c.get<event_b2_nr_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_");
  }

  return *this;
}
void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::event_b1:
      j.write_fieldname("eventB1");
      j.start_obj();
      j.write_fieldname("b1-Threshold");
      c.get<event_b1_s_>().b1_thres.to_json(j);
      j.end_obj();
      break;
    case types::event_b2:
      j.write_fieldname("eventB2");
      j.start_obj();
      j.write_fieldname("b2-Threshold1");
      c.get<event_b2_s_>().b2_thres1.to_json(j);
      j.write_fieldname("b2-Threshold2");
      c.get<event_b2_s_>().b2_thres2.to_json(j);
      j.end_obj();
      break;
    case types::event_w1_r13:
      j.write_fieldname("eventW1-r13");
      j.start_obj();
      j.write_int("w1-Threshold-r13", c.get<event_w1_r13_s_>().w1_thres_r13);
      j.end_obj();
      break;
    case types::event_w2_r13:
      j.write_fieldname("eventW2-r13");
      j.start_obj();
      j.write_int("w2-Threshold1-r13", c.get<event_w2_r13_s_>().w2_thres1_r13);
      j.write_int("w2-Threshold2-r13", c.get<event_w2_r13_s_>().w2_thres2_r13);
      j.end_obj();
      break;
    case types::event_w3_r13:
      j.write_fieldname("eventW3-r13");
      j.start_obj();
      j.write_int("w3-Threshold-r13", c.get<event_w3_r13_s_>().w3_thres_r13);
      j.end_obj();
      break;
    case types::event_b1_nr_r15:
      j.write_fieldname("eventB1-NR-r15");
      j.start_obj();
      j.write_fieldname("b1-ThresholdNR-r15");
      c.get<event_b1_nr_r15_s_>().b1_thres_nr_r15.to_json(j);
      j.write_bool("reportOnLeave-r15", c.get<event_b1_nr_r15_s_>().report_on_leave_r15);
      j.end_obj();
      break;
    case types::event_b2_nr_r15:
      j.write_fieldname("eventB2-NR-r15");
      j.start_obj();
      j.write_fieldname("b2-Threshold1-r15");
      c.get<event_b2_nr_r15_s_>().b2_thres1_r15.to_json(j);
      j.write_fieldname("b2-Threshold2NR-r15");
      c.get<event_b2_nr_r15_s_>().b2_thres2_nr_r15.to_json(j);
      j.write_bool("reportOnLeave-r15", c.get<event_b2_nr_r15_s_>().report_on_leave_r15);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_");
  }
  j.end_obj();
}
SRSASN_CODE report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::event_b1:
      HANDLE_CODE(c.get<event_b1_s_>().b1_thres.pack(bref));
      break;
    case types::event_b2:
      HANDLE_CODE(c.get<event_b2_s_>().b2_thres1.pack(bref));
      HANDLE_CODE(c.get<event_b2_s_>().b2_thres2.pack(bref));
      break;
    case types::event_w1_r13: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_w1_r13_s_>().w1_thres_r13, (uint8_t)0u, (uint8_t)141u));
    } break;
    case types::event_w2_r13: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_w2_r13_s_>().w2_thres1_r13, (uint8_t)0u, (uint8_t)141u));
      HANDLE_CODE(pack_integer(bref, c.get<event_w2_r13_s_>().w2_thres2_r13, (uint8_t)0u, (uint8_t)141u));
    } break;
    case types::event_w3_r13: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<event_w3_r13_s_>().w3_thres_r13, (uint8_t)0u, (uint8_t)141u));
    } break;
    case types::event_b1_nr_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<event_b1_nr_r15_s_>().b1_thres_nr_r15.pack(bref));
      HANDLE_CODE(bref.pack(c.get<event_b1_nr_r15_s_>().report_on_leave_r15, 1));
    } break;
    case types::event_b2_nr_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<event_b2_nr_r15_s_>().b2_thres1_r15.pack(bref));
      HANDLE_CODE(c.get<event_b2_nr_r15_s_>().b2_thres2_nr_r15.pack(bref));
      HANDLE_CODE(bref.pack(c.get<event_b2_nr_r15_s_>().report_on_leave_r15, 1));
    } break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::event_b1:
      HANDLE_CODE(c.get<event_b1_s_>().b1_thres.unpack(bref));
      break;
    case types::event_b2:
      HANDLE_CODE(c.get<event_b2_s_>().b2_thres1.unpack(bref));
      HANDLE_CODE(c.get<event_b2_s_>().b2_thres2.unpack(bref));
      break;
    case types::event_w1_r13: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_w1_r13_s_>().w1_thres_r13, bref, (uint8_t)0u, (uint8_t)141u));
    } break;
    case types::event_w2_r13: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_w2_r13_s_>().w2_thres1_r13, bref, (uint8_t)0u, (uint8_t)141u));
      HANDLE_CODE(unpack_integer(c.get<event_w2_r13_s_>().w2_thres2_r13, bref, (uint8_t)0u, (uint8_t)141u));
    } break;
    case types::event_w3_r13: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<event_w3_r13_s_>().w3_thres_r13, bref, (uint8_t)0u, (uint8_t)141u));
    } break;
    case types::event_b1_nr_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<event_b1_nr_r15_s_>().b1_thres_nr_r15.unpack(bref));
      HANDLE_CODE(bref.unpack(c.get<event_b1_nr_r15_s_>().report_on_leave_r15, 1));
    } break;
    case types::event_b2_nr_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<event_b2_nr_r15_s_>().b2_thres1_r15.unpack(bref));
      HANDLE_CODE(c.get<event_b2_nr_r15_s_>().b2_thres2_nr_r15.unpack(bref));
      HANDLE_CODE(bref.unpack(c.get<event_b2_nr_r15_s_>().report_on_leave_r15, 1));
    } break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_::destroy_()
{
  switch (type_) {
    case types::b1_thres_utra:
      c.destroy<thres_utra_c>();
      break;
    default:
      break;
  }
}
void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::b1_thres_utra:
      c.init<thres_utra_c>();
      break;
    case types::b1_thres_geran:
      break;
    case types::b1_thres_cdma2000:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_");
  }
}
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_::b1_thres_c_(
    const report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::b1_thres_utra:
      c.init(other.c.get<thres_utra_c>());
      break;
    case types::b1_thres_geran:
      c.init(other.c.get<uint8_t>());
      break;
    case types::b1_thres_cdma2000:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_");
  }
}
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_&
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_::
operator=(const report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::b1_thres_utra:
      c.set(other.c.get<thres_utra_c>());
      break;
    case types::b1_thres_geran:
      c.set(other.c.get<uint8_t>());
      break;
    case types::b1_thres_cdma2000:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_");
  }

  return *this;
}
void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_::to_json(
    json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::b1_thres_utra:
      j.write_fieldname("b1-ThresholdUTRA");
      c.get<thres_utra_c>().to_json(j);
      break;
    case types::b1_thres_geran:
      j.write_int("b1-ThresholdGERAN", c.get<uint8_t>());
      break;
    case types::b1_thres_cdma2000:
      j.write_int("b1-ThresholdCDMA2000", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_,
                            "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_");
  }
  j.end_obj();
}
SRSASN_CODE
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::b1_thres_utra:
      HANDLE_CODE(c.get<thres_utra_c>().pack(bref));
      break;
    case types::b1_thres_geran:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)63u));
      break;
    case types::b1_thres_cdma2000:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)63u));
      break;
    default:
      log_invalid_choice_id(type_,
                            "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::b1_thres_utra:
      HANDLE_CODE(c.get<thres_utra_c>().unpack(bref));
      break;
    case types::b1_thres_geran:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)63u));
      break;
    case types::b1_thres_cdma2000:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)63u));
      break;
    default:
      log_invalid_choice_id(type_,
                            "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b1_s_::b1_thres_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_::destroy_()
{
  switch (type_) {
    case types::b2_thres2_utra:
      c.destroy<thres_utra_c>();
      break;
    default:
      break;
  }
}
void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::b2_thres2_utra:
      c.init<thres_utra_c>();
      break;
    case types::b2_thres2_geran:
      break;
    case types::b2_thres2_cdma2000:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(
          type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_");
  }
}
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_::b2_thres2_c_(
    const report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::b2_thres2_utra:
      c.init(other.c.get<thres_utra_c>());
      break;
    case types::b2_thres2_geran:
      c.init(other.c.get<uint8_t>());
      break;
    case types::b2_thres2_cdma2000:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(
          type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_");
  }
}
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_&
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_::
operator=(const report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::b2_thres2_utra:
      c.set(other.c.get<thres_utra_c>());
      break;
    case types::b2_thres2_geran:
      c.set(other.c.get<uint8_t>());
      break;
    case types::b2_thres2_cdma2000:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(
          type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_");
  }

  return *this;
}
void report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_::to_json(
    json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::b2_thres2_utra:
      j.write_fieldname("b2-Threshold2UTRA");
      c.get<thres_utra_c>().to_json(j);
      break;
    case types::b2_thres2_geran:
      j.write_int("b2-Threshold2GERAN", c.get<uint8_t>());
      break;
    case types::b2_thres2_cdma2000:
      j.write_int("b2-Threshold2CDMA2000", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(
          type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_");
  }
  j.end_obj();
}
SRSASN_CODE
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::b2_thres2_utra:
      HANDLE_CODE(c.get<thres_utra_c>().pack(bref));
      break;
    case types::b2_thres2_geran:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)63u));
      break;
    case types::b2_thres2_cdma2000:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)63u));
      break;
    default:
      log_invalid_choice_id(
          type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE
report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::b2_thres2_utra:
      HANDLE_CODE(c.get<thres_utra_c>().unpack(bref));
      break;
    case types::b2_thres2_geran:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)63u));
      break;
    case types::b2_thres2_cdma2000:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)63u));
      break;
    default:
      log_invalid_choice_id(
          type_, "report_cfg_inter_rat_s::trigger_type_c_::event_s_::event_id_c_::event_b2_s_::b2_thres2_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void report_cfg_inter_rat_s::b2_thres1_v1250_c_::set(types::options e)
{
  type_ = e;
}
void report_cfg_inter_rat_s::b2_thres1_v1250_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_int("setup", c);
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::b2_thres1_v1250_c_");
  }
  j.end_obj();
}
SRSASN_CODE report_cfg_inter_rat_s::b2_thres1_v1250_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c, (int8_t)-30, (int8_t)46));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::b2_thres1_v1250_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_inter_rat_s::b2_thres1_v1250_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c, bref, (int8_t)-30, (int8_t)46));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_inter_rat_s::b2_thres1_v1250_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ReportProximityConfig-r9 ::= SEQUENCE
SRSASN_CODE report_proximity_cfg_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(proximity_ind_eutra_r9_present, 1));
  HANDLE_CODE(bref.pack(proximity_ind_utra_r9_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE report_proximity_cfg_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(proximity_ind_eutra_r9_present, 1));
  HANDLE_CODE(bref.unpack(proximity_ind_utra_r9_present, 1));

  return SRSASN_SUCCESS;
}
void report_proximity_cfg_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (proximity_ind_eutra_r9_present) {
    j.write_str("proximityIndicationEUTRA-r9", "enabled");
  }
  if (proximity_ind_utra_r9_present) {
    j.write_str("proximityIndicationUTRA-r9", "enabled");
  }
  j.end_obj();
}

// TrackingAreaCodeList-v1130 ::= SEQUENCE
SRSASN_CODE tac_list_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_per_tac_list_r11, 1, 8));

  return SRSASN_SUCCESS;
}
SRSASN_CODE tac_list_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(plmn_id_per_tac_list_r11, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void tac_list_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("plmn-Identity-perTAC-List-r11");
  for (const auto& e1 : plmn_id_per_tac_list_r11) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// UECapabilityEnquiry-v1430-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_enquiry_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(request_diff_fallback_comb_list_r14_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (request_diff_fallback_comb_list_r14_present) {
    HANDLE_CODE(
        pack_dyn_seq_of(bref, request_diff_fallback_comb_list_r14, 1, 384, SeqOfPacker<Packer>(1, 64, Packer())));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_enquiry_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(request_diff_fallback_comb_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (request_diff_fallback_comb_list_r14_present) {
    HANDLE_CODE(
        unpack_dyn_seq_of(request_diff_fallback_comb_list_r14, bref, 1, 384, SeqOfPacker<Packer>(1, 64, Packer())));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_enquiry_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (request_diff_fallback_comb_list_r14_present) {
    j.start_array("requestDiffFallbackCombList-r14");
    for (const auto& e1 : request_diff_fallback_comb_list_r14) {
      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();
}

// UEInformationRequest-v1250-IEs ::= SEQUENCE
SRSASN_CODE ue_info_request_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mob_history_report_req_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_request_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mob_history_report_req_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_request_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mob_history_report_req_r12_present) {
    j.write_str("mobilityHistoryReportReq-r12", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// AreaConfiguration-v1130 ::= SEQUENCE
SRSASN_CODE area_cfg_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(tac_list_v1130.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE area_cfg_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(tac_list_v1130.unpack(bref));

  return SRSASN_SUCCESS;
}
void area_cfg_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("trackingAreaCodeList-v1130");
  tac_list_v1130.to_json(j);
  j.end_obj();
}

// CellGlobalIdEUTRA ::= SEQUENCE
SRSASN_CODE cell_global_id_eutra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(plmn_id.pack(bref));
  HANDLE_CODE(cell_id.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_global_id_eutra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(plmn_id.unpack(bref));
  HANDLE_CODE(cell_id.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_global_id_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("plmn-Identity");
  plmn_id.to_json(j);
  j.write_str("cellIdentity", cell_id.to_string());
  j.end_obj();
}

// HandoverFromEUTRAPreparationRequest-v1020-IEs ::= SEQUENCE
SRSASN_CODE ho_from_eutra_prep_request_v1020_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dual_rx_tx_redirect_ind_r10_present, 1));
  HANDLE_CODE(bref.pack(redirect_carrier_cdma2000_minus1_xrtt_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (redirect_carrier_cdma2000_minus1_xrtt_r10_present) {
    HANDLE_CODE(redirect_carrier_cdma2000_minus1_xrtt_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_from_eutra_prep_request_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dual_rx_tx_redirect_ind_r10_present, 1));
  HANDLE_CODE(bref.unpack(redirect_carrier_cdma2000_minus1_xrtt_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (redirect_carrier_cdma2000_minus1_xrtt_r10_present) {
    HANDLE_CODE(redirect_carrier_cdma2000_minus1_xrtt_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_from_eutra_prep_request_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dual_rx_tx_redirect_ind_r10_present) {
    j.write_str("dualRxTxRedirectIndicator-r10", "true");
  }
  if (redirect_carrier_cdma2000_minus1_xrtt_r10_present) {
    j.write_fieldname("redirectCarrierCDMA2000-1XRTT-r10");
    redirect_carrier_cdma2000_minus1_xrtt_r10.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// LoggedMeasurementConfiguration-v1250-IEs ::= SEQUENCE
SRSASN_CODE logged_meas_cfg_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(target_mbsfn_area_list_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (target_mbsfn_area_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, target_mbsfn_area_list_r12, 0, 8));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE logged_meas_cfg_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(target_mbsfn_area_list_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (target_mbsfn_area_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(target_mbsfn_area_list_r12, bref, 0, 8));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void logged_meas_cfg_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (target_mbsfn_area_list_r12_present) {
    j.start_array("targetMBSFN-AreaList-r12");
    for (const auto& e1 : target_mbsfn_area_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();
}

// MeasIdToAddMod ::= SEQUENCE
SRSASN_CODE meas_id_to_add_mod_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, meas_id, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, meas_obj_id, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, report_cfg_id, (uint8_t)1u, (uint8_t)32u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_id_to_add_mod_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(meas_id, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(meas_obj_id, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(report_cfg_id, bref, (uint8_t)1u, (uint8_t)32u));

  return SRSASN_SUCCESS;
}
void meas_id_to_add_mod_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("measId", meas_id);
  j.write_int("measObjectId", meas_obj_id);
  j.write_int("reportConfigId", report_cfg_id);
  j.end_obj();
}

// MeasIdToAddMod-v1310 ::= SEQUENCE
SRSASN_CODE meas_id_to_add_mod_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_obj_id_v1310_present, 1));

  if (meas_obj_id_v1310_present) {
    HANDLE_CODE(pack_integer(bref, meas_obj_id_v1310, (uint8_t)33u, (uint8_t)64u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_id_to_add_mod_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_obj_id_v1310_present, 1));

  if (meas_obj_id_v1310_present) {
    HANDLE_CODE(unpack_integer(meas_obj_id_v1310, bref, (uint8_t)33u, (uint8_t)64u));
  }

  return SRSASN_SUCCESS;
}
void meas_id_to_add_mod_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_obj_id_v1310_present) {
    j.write_int("measObjectId-v1310", meas_obj_id_v1310);
  }
  j.end_obj();
}

// MeasIdToAddModExt-r12 ::= SEQUENCE
SRSASN_CODE meas_id_to_add_mod_ext_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, meas_id_v1250, (uint8_t)33u, (uint8_t)64u));
  HANDLE_CODE(pack_integer(bref, meas_obj_id_r12, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, report_cfg_id_r12, (uint8_t)1u, (uint8_t)32u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_id_to_add_mod_ext_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(meas_id_v1250, bref, (uint8_t)33u, (uint8_t)64u));
  HANDLE_CODE(unpack_integer(meas_obj_id_r12, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(report_cfg_id_r12, bref, (uint8_t)1u, (uint8_t)32u));

  return SRSASN_SUCCESS;
}
void meas_id_to_add_mod_ext_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("measId-v1250", meas_id_v1250);
  j.write_int("measObjectId-r12", meas_obj_id_r12);
  j.write_int("reportConfigId-r12", report_cfg_id_r12);
  j.end_obj();
}

// MeasObjectToAddMod ::= SEQUENCE
SRSASN_CODE meas_obj_to_add_mod_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, meas_obj_id, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(meas_obj.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_to_add_mod_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(meas_obj_id, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(meas_obj.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_obj_to_add_mod_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("measObjectId", meas_obj_id);
  j.write_fieldname("measObject");
  meas_obj.to_json(j);
  j.end_obj();
}

void meas_obj_to_add_mod_s::meas_obj_c_::destroy_()
{
  switch (type_) {
    case types::meas_obj_eutra:
      c.destroy<meas_obj_eutra_s>();
      break;
    case types::meas_obj_utra:
      c.destroy<meas_obj_utra_s>();
      break;
    case types::meas_obj_geran:
      c.destroy<meas_obj_geran_s>();
      break;
    case types::meas_obj_cdma2000:
      c.destroy<meas_obj_cdma2000_s>();
      break;
    case types::meas_obj_wlan_r13:
      c.destroy<meas_obj_wlan_r13_s>();
      break;
    case types::meas_obj_nr_r15:
      c.destroy<meas_obj_nr_r15_s>();
      break;
    default:
      break;
  }
}
void meas_obj_to_add_mod_s::meas_obj_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::meas_obj_eutra:
      c.init<meas_obj_eutra_s>();
      break;
    case types::meas_obj_utra:
      c.init<meas_obj_utra_s>();
      break;
    case types::meas_obj_geran:
      c.init<meas_obj_geran_s>();
      break;
    case types::meas_obj_cdma2000:
      c.init<meas_obj_cdma2000_s>();
      break;
    case types::meas_obj_wlan_r13:
      c.init<meas_obj_wlan_r13_s>();
      break;
    case types::meas_obj_nr_r15:
      c.init<meas_obj_nr_r15_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_s::meas_obj_c_");
  }
}
meas_obj_to_add_mod_s::meas_obj_c_::meas_obj_c_(const meas_obj_to_add_mod_s::meas_obj_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::meas_obj_eutra:
      c.init(other.c.get<meas_obj_eutra_s>());
      break;
    case types::meas_obj_utra:
      c.init(other.c.get<meas_obj_utra_s>());
      break;
    case types::meas_obj_geran:
      c.init(other.c.get<meas_obj_geran_s>());
      break;
    case types::meas_obj_cdma2000:
      c.init(other.c.get<meas_obj_cdma2000_s>());
      break;
    case types::meas_obj_wlan_r13:
      c.init(other.c.get<meas_obj_wlan_r13_s>());
      break;
    case types::meas_obj_nr_r15:
      c.init(other.c.get<meas_obj_nr_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_s::meas_obj_c_");
  }
}
meas_obj_to_add_mod_s::meas_obj_c_& meas_obj_to_add_mod_s::meas_obj_c_::
                                    operator=(const meas_obj_to_add_mod_s::meas_obj_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::meas_obj_eutra:
      c.set(other.c.get<meas_obj_eutra_s>());
      break;
    case types::meas_obj_utra:
      c.set(other.c.get<meas_obj_utra_s>());
      break;
    case types::meas_obj_geran:
      c.set(other.c.get<meas_obj_geran_s>());
      break;
    case types::meas_obj_cdma2000:
      c.set(other.c.get<meas_obj_cdma2000_s>());
      break;
    case types::meas_obj_wlan_r13:
      c.set(other.c.get<meas_obj_wlan_r13_s>());
      break;
    case types::meas_obj_nr_r15:
      c.set(other.c.get<meas_obj_nr_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_s::meas_obj_c_");
  }

  return *this;
}
void meas_obj_to_add_mod_s::meas_obj_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::meas_obj_eutra:
      j.write_fieldname("measObjectEUTRA");
      c.get<meas_obj_eutra_s>().to_json(j);
      break;
    case types::meas_obj_utra:
      j.write_fieldname("measObjectUTRA");
      c.get<meas_obj_utra_s>().to_json(j);
      break;
    case types::meas_obj_geran:
      j.write_fieldname("measObjectGERAN");
      c.get<meas_obj_geran_s>().to_json(j);
      break;
    case types::meas_obj_cdma2000:
      j.write_fieldname("measObjectCDMA2000");
      c.get<meas_obj_cdma2000_s>().to_json(j);
      break;
    case types::meas_obj_wlan_r13:
      j.write_fieldname("measObjectWLAN-r13");
      c.get<meas_obj_wlan_r13_s>().to_json(j);
      break;
    case types::meas_obj_nr_r15:
      j.write_fieldname("measObjectNR-r15");
      c.get<meas_obj_nr_r15_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_s::meas_obj_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_obj_to_add_mod_s::meas_obj_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::meas_obj_eutra:
      HANDLE_CODE(c.get<meas_obj_eutra_s>().pack(bref));
      break;
    case types::meas_obj_utra:
      HANDLE_CODE(c.get<meas_obj_utra_s>().pack(bref));
      break;
    case types::meas_obj_geran:
      HANDLE_CODE(c.get<meas_obj_geran_s>().pack(bref));
      break;
    case types::meas_obj_cdma2000:
      HANDLE_CODE(c.get<meas_obj_cdma2000_s>().pack(bref));
      break;
    case types::meas_obj_wlan_r13: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<meas_obj_wlan_r13_s>().pack(bref));
    } break;
    case types::meas_obj_nr_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<meas_obj_nr_r15_s>().pack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_s::meas_obj_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_to_add_mod_s::meas_obj_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::meas_obj_eutra:
      HANDLE_CODE(c.get<meas_obj_eutra_s>().unpack(bref));
      break;
    case types::meas_obj_utra:
      HANDLE_CODE(c.get<meas_obj_utra_s>().unpack(bref));
      break;
    case types::meas_obj_geran:
      HANDLE_CODE(c.get<meas_obj_geran_s>().unpack(bref));
      break;
    case types::meas_obj_cdma2000:
      HANDLE_CODE(c.get<meas_obj_cdma2000_s>().unpack(bref));
      break;
    case types::meas_obj_wlan_r13: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<meas_obj_wlan_r13_s>().unpack(bref));
    } break;
    case types::meas_obj_nr_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<meas_obj_nr_r15_s>().unpack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_s::meas_obj_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasObjectToAddMod-v9e0 ::= SEQUENCE
SRSASN_CODE meas_obj_to_add_mod_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_obj_eutra_v9e0_present, 1));

  if (meas_obj_eutra_v9e0_present) {
    HANDLE_CODE(meas_obj_eutra_v9e0.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_to_add_mod_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_obj_eutra_v9e0_present, 1));

  if (meas_obj_eutra_v9e0_present) {
    HANDLE_CODE(meas_obj_eutra_v9e0.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_obj_to_add_mod_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_obj_eutra_v9e0_present) {
    j.write_fieldname("measObjectEUTRA-v9e0");
    meas_obj_eutra_v9e0.to_json(j);
  }
  j.end_obj();
}

// MeasObjectToAddModExt-r13 ::= SEQUENCE
SRSASN_CODE meas_obj_to_add_mod_ext_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, meas_obj_id_r13, (uint8_t)33u, (uint8_t)64u));
  HANDLE_CODE(meas_obj_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_to_add_mod_ext_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(meas_obj_id_r13, bref, (uint8_t)33u, (uint8_t)64u));
  HANDLE_CODE(meas_obj_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_obj_to_add_mod_ext_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("measObjectId-r13", meas_obj_id_r13);
  j.write_fieldname("measObject-r13");
  meas_obj_r13.to_json(j);
  j.end_obj();
}

void meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_::destroy_()
{
  switch (type_) {
    case types::meas_obj_eutra_r13:
      c.destroy<meas_obj_eutra_s>();
      break;
    case types::meas_obj_utra_r13:
      c.destroy<meas_obj_utra_s>();
      break;
    case types::meas_obj_geran_r13:
      c.destroy<meas_obj_geran_s>();
      break;
    case types::meas_obj_cdma2000_r13:
      c.destroy<meas_obj_cdma2000_s>();
      break;
    case types::meas_obj_wlan_v1320:
      c.destroy<meas_obj_wlan_r13_s>();
      break;
    case types::meas_obj_nr_r15:
      c.destroy<meas_obj_nr_r15_s>();
      break;
    default:
      break;
  }
}
void meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::meas_obj_eutra_r13:
      c.init<meas_obj_eutra_s>();
      break;
    case types::meas_obj_utra_r13:
      c.init<meas_obj_utra_s>();
      break;
    case types::meas_obj_geran_r13:
      c.init<meas_obj_geran_s>();
      break;
    case types::meas_obj_cdma2000_r13:
      c.init<meas_obj_cdma2000_s>();
      break;
    case types::meas_obj_wlan_v1320:
      c.init<meas_obj_wlan_r13_s>();
      break;
    case types::meas_obj_nr_r15:
      c.init<meas_obj_nr_r15_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_");
  }
}
meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_::meas_obj_r13_c_(
    const meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::meas_obj_eutra_r13:
      c.init(other.c.get<meas_obj_eutra_s>());
      break;
    case types::meas_obj_utra_r13:
      c.init(other.c.get<meas_obj_utra_s>());
      break;
    case types::meas_obj_geran_r13:
      c.init(other.c.get<meas_obj_geran_s>());
      break;
    case types::meas_obj_cdma2000_r13:
      c.init(other.c.get<meas_obj_cdma2000_s>());
      break;
    case types::meas_obj_wlan_v1320:
      c.init(other.c.get<meas_obj_wlan_r13_s>());
      break;
    case types::meas_obj_nr_r15:
      c.init(other.c.get<meas_obj_nr_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_");
  }
}
meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_& meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_::
                                                operator=(const meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::meas_obj_eutra_r13:
      c.set(other.c.get<meas_obj_eutra_s>());
      break;
    case types::meas_obj_utra_r13:
      c.set(other.c.get<meas_obj_utra_s>());
      break;
    case types::meas_obj_geran_r13:
      c.set(other.c.get<meas_obj_geran_s>());
      break;
    case types::meas_obj_cdma2000_r13:
      c.set(other.c.get<meas_obj_cdma2000_s>());
      break;
    case types::meas_obj_wlan_v1320:
      c.set(other.c.get<meas_obj_wlan_r13_s>());
      break;
    case types::meas_obj_nr_r15:
      c.set(other.c.get<meas_obj_nr_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_");
  }

  return *this;
}
void meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::meas_obj_eutra_r13:
      j.write_fieldname("measObjectEUTRA-r13");
      c.get<meas_obj_eutra_s>().to_json(j);
      break;
    case types::meas_obj_utra_r13:
      j.write_fieldname("measObjectUTRA-r13");
      c.get<meas_obj_utra_s>().to_json(j);
      break;
    case types::meas_obj_geran_r13:
      j.write_fieldname("measObjectGERAN-r13");
      c.get<meas_obj_geran_s>().to_json(j);
      break;
    case types::meas_obj_cdma2000_r13:
      j.write_fieldname("measObjectCDMA2000-r13");
      c.get<meas_obj_cdma2000_s>().to_json(j);
      break;
    case types::meas_obj_wlan_v1320:
      j.write_fieldname("measObjectWLAN-v1320");
      c.get<meas_obj_wlan_r13_s>().to_json(j);
      break;
    case types::meas_obj_nr_r15:
      j.write_fieldname("measObjectNR-r15");
      c.get<meas_obj_nr_r15_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::meas_obj_eutra_r13:
      HANDLE_CODE(c.get<meas_obj_eutra_s>().pack(bref));
      break;
    case types::meas_obj_utra_r13:
      HANDLE_CODE(c.get<meas_obj_utra_s>().pack(bref));
      break;
    case types::meas_obj_geran_r13:
      HANDLE_CODE(c.get<meas_obj_geran_s>().pack(bref));
      break;
    case types::meas_obj_cdma2000_r13:
      HANDLE_CODE(c.get<meas_obj_cdma2000_s>().pack(bref));
      break;
    case types::meas_obj_wlan_v1320: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<meas_obj_wlan_r13_s>().pack(bref));
    } break;
    case types::meas_obj_nr_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<meas_obj_nr_r15_s>().pack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::meas_obj_eutra_r13:
      HANDLE_CODE(c.get<meas_obj_eutra_s>().unpack(bref));
      break;
    case types::meas_obj_utra_r13:
      HANDLE_CODE(c.get<meas_obj_utra_s>().unpack(bref));
      break;
    case types::meas_obj_geran_r13:
      HANDLE_CODE(c.get<meas_obj_geran_s>().unpack(bref));
      break;
    case types::meas_obj_cdma2000_r13:
      HANDLE_CODE(c.get<meas_obj_cdma2000_s>().unpack(bref));
      break;
    case types::meas_obj_wlan_v1320: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<meas_obj_wlan_r13_s>().unpack(bref));
    } break;
    case types::meas_obj_nr_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<meas_obj_nr_r15_s>().unpack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "meas_obj_to_add_mod_ext_r13_s::meas_obj_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MobilityFromEUTRACommand-v1530-IEs ::= SEQUENCE
SRSASN_CODE mob_from_eutra_cmd_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(smtc_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (smtc_r15_present) {
    HANDLE_CODE(smtc_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(smtc_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (smtc_r15_present) {
    HANDLE_CODE(smtc_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mob_from_eutra_cmd_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (smtc_r15_present) {
    j.write_fieldname("smtc-r15");
    smtc_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// OtherConfig-r9 ::= SEQUENCE
SRSASN_CODE other_cfg_r9_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(report_proximity_cfg_r9_present, 1));

  if (report_proximity_cfg_r9_present) {
    HANDLE_CODE(report_proximity_cfg_r9.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= idc_cfg_r11.is_present();
    group_flags[0] |= pwr_pref_ind_cfg_r11.is_present();
    group_flags[0] |= obtain_location_cfg_r11.is_present();
    group_flags[1] |= bw_pref_ind_timer_r14_present;
    group_flags[1] |= sps_assist_info_report_r14_present;
    group_flags[1] |= delay_budget_report_cfg_r14.is_present();
    group_flags[1] |= rlm_report_cfg_r14.is_present();
    group_flags[2] |= overheat_assist_cfg_r14.is_present();
    group_flags[3] |= meas_cfg_app_layer_r15.is_present();
    group_flags[3] |= ailc_bit_cfg_r15_present;
    group_flags[3] |= bt_name_list_cfg_r15.is_present();
    group_flags[3] |= wlan_name_list_cfg_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(idc_cfg_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(pwr_pref_ind_cfg_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(obtain_location_cfg_r11.is_present(), 1));
      if (idc_cfg_r11.is_present()) {
        HANDLE_CODE(idc_cfg_r11->pack(bref));
      }
      if (pwr_pref_ind_cfg_r11.is_present()) {
        HANDLE_CODE(pwr_pref_ind_cfg_r11->pack(bref));
      }
      if (obtain_location_cfg_r11.is_present()) {
        HANDLE_CODE(obtain_location_cfg_r11->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(bw_pref_ind_timer_r14_present, 1));
      HANDLE_CODE(bref.pack(sps_assist_info_report_r14_present, 1));
      HANDLE_CODE(bref.pack(delay_budget_report_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(rlm_report_cfg_r14.is_present(), 1));
      if (bw_pref_ind_timer_r14_present) {
        HANDLE_CODE(bw_pref_ind_timer_r14.pack(bref));
      }
      if (sps_assist_info_report_r14_present) {
        HANDLE_CODE(bref.pack(sps_assist_info_report_r14, 1));
      }
      if (delay_budget_report_cfg_r14.is_present()) {
        HANDLE_CODE(delay_budget_report_cfg_r14->pack(bref));
      }
      if (rlm_report_cfg_r14.is_present()) {
        HANDLE_CODE(rlm_report_cfg_r14->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(overheat_assist_cfg_r14.is_present(), 1));
      if (overheat_assist_cfg_r14.is_present()) {
        HANDLE_CODE(overheat_assist_cfg_r14->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_cfg_app_layer_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(ailc_bit_cfg_r15_present, 1));
      HANDLE_CODE(bref.pack(bt_name_list_cfg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(wlan_name_list_cfg_r15.is_present(), 1));
      if (meas_cfg_app_layer_r15.is_present()) {
        HANDLE_CODE(meas_cfg_app_layer_r15->pack(bref));
      }
      if (ailc_bit_cfg_r15_present) {
        HANDLE_CODE(bref.pack(ailc_bit_cfg_r15, 1));
      }
      if (bt_name_list_cfg_r15.is_present()) {
        HANDLE_CODE(bt_name_list_cfg_r15->pack(bref));
      }
      if (wlan_name_list_cfg_r15.is_present()) {
        HANDLE_CODE(wlan_name_list_cfg_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE other_cfg_r9_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(report_proximity_cfg_r9_present, 1));

  if (report_proximity_cfg_r9_present) {
    HANDLE_CODE(report_proximity_cfg_r9.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);

      bool idc_cfg_r11_present;
      HANDLE_CODE(bref.unpack(idc_cfg_r11_present, 1));
      idc_cfg_r11.set_present(idc_cfg_r11_present);
      bool pwr_pref_ind_cfg_r11_present;
      HANDLE_CODE(bref.unpack(pwr_pref_ind_cfg_r11_present, 1));
      pwr_pref_ind_cfg_r11.set_present(pwr_pref_ind_cfg_r11_present);
      bool obtain_location_cfg_r11_present;
      HANDLE_CODE(bref.unpack(obtain_location_cfg_r11_present, 1));
      obtain_location_cfg_r11.set_present(obtain_location_cfg_r11_present);
      if (idc_cfg_r11.is_present()) {
        HANDLE_CODE(idc_cfg_r11->unpack(bref));
      }
      if (pwr_pref_ind_cfg_r11.is_present()) {
        HANDLE_CODE(pwr_pref_ind_cfg_r11->unpack(bref));
      }
      if (obtain_location_cfg_r11.is_present()) {
        HANDLE_CODE(obtain_location_cfg_r11->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(bw_pref_ind_timer_r14_present, 1));
      HANDLE_CODE(bref.unpack(sps_assist_info_report_r14_present, 1));
      bool delay_budget_report_cfg_r14_present;
      HANDLE_CODE(bref.unpack(delay_budget_report_cfg_r14_present, 1));
      delay_budget_report_cfg_r14.set_present(delay_budget_report_cfg_r14_present);
      bool rlm_report_cfg_r14_present;
      HANDLE_CODE(bref.unpack(rlm_report_cfg_r14_present, 1));
      rlm_report_cfg_r14.set_present(rlm_report_cfg_r14_present);
      if (bw_pref_ind_timer_r14_present) {
        HANDLE_CODE(bw_pref_ind_timer_r14.unpack(bref));
      }
      if (sps_assist_info_report_r14_present) {
        HANDLE_CODE(bref.unpack(sps_assist_info_report_r14, 1));
      }
      if (delay_budget_report_cfg_r14.is_present()) {
        HANDLE_CODE(delay_budget_report_cfg_r14->unpack(bref));
      }
      if (rlm_report_cfg_r14.is_present()) {
        HANDLE_CODE(rlm_report_cfg_r14->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool overheat_assist_cfg_r14_present;
      HANDLE_CODE(bref.unpack(overheat_assist_cfg_r14_present, 1));
      overheat_assist_cfg_r14.set_present(overheat_assist_cfg_r14_present);
      if (overheat_assist_cfg_r14.is_present()) {
        HANDLE_CODE(overheat_assist_cfg_r14->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_cfg_app_layer_r15_present;
      HANDLE_CODE(bref.unpack(meas_cfg_app_layer_r15_present, 1));
      meas_cfg_app_layer_r15.set_present(meas_cfg_app_layer_r15_present);
      HANDLE_CODE(bref.unpack(ailc_bit_cfg_r15_present, 1));
      bool bt_name_list_cfg_r15_present;
      HANDLE_CODE(bref.unpack(bt_name_list_cfg_r15_present, 1));
      bt_name_list_cfg_r15.set_present(bt_name_list_cfg_r15_present);
      bool wlan_name_list_cfg_r15_present;
      HANDLE_CODE(bref.unpack(wlan_name_list_cfg_r15_present, 1));
      wlan_name_list_cfg_r15.set_present(wlan_name_list_cfg_r15_present);
      if (meas_cfg_app_layer_r15.is_present()) {
        HANDLE_CODE(meas_cfg_app_layer_r15->unpack(bref));
      }
      if (ailc_bit_cfg_r15_present) {
        HANDLE_CODE(bref.unpack(ailc_bit_cfg_r15, 1));
      }
      if (bt_name_list_cfg_r15.is_present()) {
        HANDLE_CODE(bt_name_list_cfg_r15->unpack(bref));
      }
      if (wlan_name_list_cfg_r15.is_present()) {
        HANDLE_CODE(wlan_name_list_cfg_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void other_cfg_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (report_proximity_cfg_r9_present) {
    j.write_fieldname("reportProximityConfig-r9");
    report_proximity_cfg_r9.to_json(j);
  }
  if (ext) {
    if (idc_cfg_r11.is_present()) {
      j.write_fieldname("idc-Config-r11");
      idc_cfg_r11->to_json(j);
    }
    if (pwr_pref_ind_cfg_r11.is_present()) {
      j.write_fieldname("powerPrefIndicationConfig-r11");
      pwr_pref_ind_cfg_r11->to_json(j);
    }
    if (obtain_location_cfg_r11.is_present()) {
      j.write_fieldname("obtainLocationConfig-r11");
      obtain_location_cfg_r11->to_json(j);
    }
    if (bw_pref_ind_timer_r14_present) {
      j.write_str("bw-PreferenceIndicationTimer-r14", bw_pref_ind_timer_r14.to_string());
    }
    if (sps_assist_info_report_r14_present) {
      j.write_bool("sps-AssistanceInfoReport-r14", sps_assist_info_report_r14);
    }
    if (delay_budget_report_cfg_r14.is_present()) {
      j.write_fieldname("delayBudgetReportingConfig-r14");
      delay_budget_report_cfg_r14->to_json(j);
    }
    if (rlm_report_cfg_r14.is_present()) {
      j.write_fieldname("rlm-ReportConfig-r14");
      rlm_report_cfg_r14->to_json(j);
    }
    if (overheat_assist_cfg_r14.is_present()) {
      j.write_fieldname("overheatingAssistanceConfig-r14");
      overheat_assist_cfg_r14->to_json(j);
    }
    if (meas_cfg_app_layer_r15.is_present()) {
      j.write_fieldname("measConfigAppLayer-r15");
      meas_cfg_app_layer_r15->to_json(j);
    }
    if (ailc_bit_cfg_r15_present) {
      j.write_bool("ailc-BitConfig-r15", ailc_bit_cfg_r15);
    }
    if (bt_name_list_cfg_r15.is_present()) {
      j.write_fieldname("bt-NameListConfig-r15");
      bt_name_list_cfg_r15->to_json(j);
    }
    if (wlan_name_list_cfg_r15.is_present()) {
      j.write_fieldname("wlan-NameListConfig-r15");
      wlan_name_list_cfg_r15->to_json(j);
    }
  }
  j.end_obj();
}

void other_cfg_r9_s::delay_budget_report_cfg_r14_c_::set(types::options e)
{
  type_ = e;
}
void other_cfg_r9_s::delay_budget_report_cfg_r14_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("delayBudgetReportingProhibitTimer-r14", c.delay_budget_report_prohibit_timer_r14.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::delay_budget_report_cfg_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE other_cfg_r9_s::delay_budget_report_cfg_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.delay_budget_report_prohibit_timer_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::delay_budget_report_cfg_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE other_cfg_r9_s::delay_budget_report_cfg_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.delay_budget_report_prohibit_timer_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::delay_budget_report_cfg_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void other_cfg_r9_s::rlm_report_cfg_r14_c_::set(types::options e)
{
  type_ = e;
}
void other_cfg_r9_s::rlm_report_cfg_r14_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("rlmReportTimer-r14", c.rlm_report_timer_r14.to_string());
      if (c.rlm_report_rep_mpdcch_r14_present) {
        j.write_str("rlmReportRep-MPDCCH-r14", "setup");
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::rlm_report_cfg_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE other_cfg_r9_s::rlm_report_cfg_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.rlm_report_rep_mpdcch_r14_present, 1));
      HANDLE_CODE(c.rlm_report_timer_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::rlm_report_cfg_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE other_cfg_r9_s::rlm_report_cfg_r14_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.rlm_report_rep_mpdcch_r14_present, 1));
      HANDLE_CODE(c.rlm_report_timer_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::rlm_report_cfg_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void other_cfg_r9_s::overheat_assist_cfg_r14_c_::set(types::options e)
{
  type_ = e;
}
void other_cfg_r9_s::overheat_assist_cfg_r14_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("overheatingIndicationProhibitTimer-r14", c.overheat_ind_prohibit_timer_r14.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::overheat_assist_cfg_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE other_cfg_r9_s::overheat_assist_cfg_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.overheat_ind_prohibit_timer_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::overheat_assist_cfg_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE other_cfg_r9_s::overheat_assist_cfg_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.overheat_ind_prohibit_timer_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::overheat_assist_cfg_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void other_cfg_r9_s::meas_cfg_app_layer_r15_c_::set(types::options e)
{
  type_ = e;
}
void other_cfg_r9_s::meas_cfg_app_layer_r15_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("measConfigAppLayerContainer-r15", c.meas_cfg_app_layer_container_r15.to_string());
      j.write_str("serviceType", c.service_type.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::meas_cfg_app_layer_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE other_cfg_r9_s::meas_cfg_app_layer_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.meas_cfg_app_layer_container_r15.pack(bref));
      HANDLE_CODE(c.service_type.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::meas_cfg_app_layer_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE other_cfg_r9_s::meas_cfg_app_layer_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.meas_cfg_app_layer_container_r15.unpack(bref));
      HANDLE_CODE(c.service_type.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "other_cfg_r9_s::meas_cfg_app_layer_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PRACH-Config-v1310 ::= SEQUENCE
SRSASN_CODE prach_cfg_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rsrp_thress_prach_info_list_r13_present, 1));
  HANDLE_CODE(bref.pack(mpdcch_start_sf_css_ra_r13_present, 1));
  HANDLE_CODE(bref.pack(prach_hop_offset_r13_present, 1));
  HANDLE_CODE(bref.pack(prach_params_list_ce_r13_present, 1));
  HANDLE_CODE(bref.pack(init_ce_level_r13_present, 1));

  if (rsrp_thress_prach_info_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, rsrp_thress_prach_info_list_r13, 1, 3, integer_packer<uint8_t>(0, 97)));
  }
  if (mpdcch_start_sf_css_ra_r13_present) {
    HANDLE_CODE(mpdcch_start_sf_css_ra_r13.pack(bref));
  }
  if (prach_hop_offset_r13_present) {
    HANDLE_CODE(pack_integer(bref, prach_hop_offset_r13, (uint8_t)0u, (uint8_t)94u));
  }
  if (prach_params_list_ce_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, prach_params_list_ce_r13, 1, 4));
  }
  if (init_ce_level_r13_present) {
    HANDLE_CODE(pack_integer(bref, init_ce_level_r13, (uint8_t)0u, (uint8_t)3u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rsrp_thress_prach_info_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(mpdcch_start_sf_css_ra_r13_present, 1));
  HANDLE_CODE(bref.unpack(prach_hop_offset_r13_present, 1));
  HANDLE_CODE(bref.unpack(prach_params_list_ce_r13_present, 1));
  HANDLE_CODE(bref.unpack(init_ce_level_r13_present, 1));

  if (rsrp_thress_prach_info_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(rsrp_thress_prach_info_list_r13, bref, 1, 3, integer_packer<uint8_t>(0, 97)));
  }
  if (mpdcch_start_sf_css_ra_r13_present) {
    HANDLE_CODE(mpdcch_start_sf_css_ra_r13.unpack(bref));
  }
  if (prach_hop_offset_r13_present) {
    HANDLE_CODE(unpack_integer(prach_hop_offset_r13, bref, (uint8_t)0u, (uint8_t)94u));
  }
  if (prach_params_list_ce_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(prach_params_list_ce_r13, bref, 1, 4));
  }
  if (init_ce_level_r13_present) {
    HANDLE_CODE(unpack_integer(init_ce_level_r13, bref, (uint8_t)0u, (uint8_t)3u));
  }

  return SRSASN_SUCCESS;
}
void prach_cfg_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rsrp_thress_prach_info_list_r13_present) {
    j.start_array("rsrp-ThresholdsPrachInfoList-r13");
    for (const auto& e1 : rsrp_thress_prach_info_list_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (mpdcch_start_sf_css_ra_r13_present) {
    j.write_fieldname("mpdcch-startSF-CSS-RA-r13");
    mpdcch_start_sf_css_ra_r13.to_json(j);
  }
  if (prach_hop_offset_r13_present) {
    j.write_int("prach-HoppingOffset-r13", prach_hop_offset_r13);
  }
  if (prach_params_list_ce_r13_present) {
    j.start_array("prach-ParametersListCE-r13");
    for (const auto& e1 : prach_params_list_ce_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (init_ce_level_r13_present) {
    j.write_int("initial-CE-level-r13", init_ce_level_r13);
  }
  j.end_obj();
}

void prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_::destroy_() {}
void prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_::mpdcch_start_sf_css_ra_r13_c_(
    const prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::fdd_r13:
      c.init(other.c.get<fdd_r13_e_>());
      break;
    case types::tdd_r13:
      c.init(other.c.get<tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
  }
}
prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_& prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_::
                                                  operator=(const prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::fdd_r13:
      c.set(other.c.get<fdd_r13_e_>());
      break;
    case types::tdd_r13:
      c.set(other.c.get<tdd_r13_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
  }

  return *this;
}
void prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::fdd_r13:
      j.write_str("fdd-r13", c.get<fdd_r13_e_>().to_string());
      break;
    case types::tdd_r13:
      j.write_str("tdd-r13", c.get<tdd_r13_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::fdd_r13:
      HANDLE_CODE(c.get<fdd_r13_e_>().pack(bref));
      break;
    case types::tdd_r13:
      HANDLE_CODE(c.get<tdd_r13_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::fdd_r13:
      HANDLE_CODE(c.get<fdd_r13_e_>().unpack(bref));
      break;
    case types::tdd_r13:
      HANDLE_CODE(c.get<tdd_r13_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "prach_cfg_v1310_s::mpdcch_start_sf_css_ra_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// QuantityConfigCDMA2000 ::= SEQUENCE
SRSASN_CODE quant_cfg_cdma2000_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(meas_quant_cdma2000.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_cdma2000_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(meas_quant_cdma2000.unpack(bref));

  return SRSASN_SUCCESS;
}
void quant_cfg_cdma2000_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("measQuantityCDMA2000", meas_quant_cdma2000.to_string());
  j.end_obj();
}

// QuantityConfigEUTRA ::= SEQUENCE
SRSASN_CODE quant_cfg_eutra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coef_rsrp_present, 1));
  HANDLE_CODE(bref.pack(filt_coef_rsrq_present, 1));

  if (filt_coef_rsrp_present) {
    HANDLE_CODE(filt_coef_rsrp.pack(bref));
  }
  if (filt_coef_rsrq_present) {
    HANDLE_CODE(filt_coef_rsrq.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_eutra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coef_rsrp_present, 1));
  HANDLE_CODE(bref.unpack(filt_coef_rsrq_present, 1));

  if (filt_coef_rsrp_present) {
    HANDLE_CODE(filt_coef_rsrp.unpack(bref));
  }
  if (filt_coef_rsrq_present) {
    HANDLE_CODE(filt_coef_rsrq.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (filt_coef_rsrp_present) {
    j.write_str("filterCoefficientRSRP", filt_coef_rsrp.to_string());
  }
  if (filt_coef_rsrq_present) {
    j.write_str("filterCoefficientRSRQ", filt_coef_rsrq.to_string());
  }
  j.end_obj();
}

// QuantityConfigEUTRA-v1250 ::= SEQUENCE
SRSASN_CODE quant_cfg_eutra_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coef_csi_rsrp_r12_present, 1));

  if (filt_coef_csi_rsrp_r12_present) {
    HANDLE_CODE(filt_coef_csi_rsrp_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_eutra_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coef_csi_rsrp_r12_present, 1));

  if (filt_coef_csi_rsrp_r12_present) {
    HANDLE_CODE(filt_coef_csi_rsrp_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_eutra_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (filt_coef_csi_rsrp_r12_present) {
    j.write_str("filterCoefficientCSI-RSRP-r12", filt_coef_csi_rsrp_r12.to_string());
  }
  j.end_obj();
}

// QuantityConfigEUTRA-v1310 ::= SEQUENCE
SRSASN_CODE quant_cfg_eutra_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coef_rs_sinr_r13_present, 1));

  if (filt_coef_rs_sinr_r13_present) {
    HANDLE_CODE(filt_coef_rs_sinr_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_eutra_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coef_rs_sinr_r13_present, 1));

  if (filt_coef_rs_sinr_r13_present) {
    HANDLE_CODE(filt_coef_rs_sinr_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_eutra_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (filt_coef_rs_sinr_r13_present) {
    j.write_str("filterCoefficientRS-SINR-r13", filt_coef_rs_sinr_r13.to_string());
  }
  j.end_obj();
}

// QuantityConfigGERAN ::= SEQUENCE
SRSASN_CODE quant_cfg_geran_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coef_present, 1));

  if (filt_coef_present) {
    HANDLE_CODE(filt_coef.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_geran_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coef_present, 1));

  if (filt_coef_present) {
    HANDLE_CODE(filt_coef.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("measQuantityGERAN", "rssi");
  if (filt_coef_present) {
    j.write_str("filterCoefficient", filt_coef.to_string());
  }
  j.end_obj();
}

// QuantityConfigUTRA ::= SEQUENCE
SRSASN_CODE quant_cfg_utra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coef_present, 1));

  HANDLE_CODE(meas_quant_utra_fdd.pack(bref));
  if (filt_coef_present) {
    HANDLE_CODE(filt_coef.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_utra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coef_present, 1));

  HANDLE_CODE(meas_quant_utra_fdd.unpack(bref));
  if (filt_coef_present) {
    HANDLE_CODE(filt_coef.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_utra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("measQuantityUTRA-FDD", meas_quant_utra_fdd.to_string());
  j.write_str("measQuantityUTRA-TDD", "pccpch-RSCP");
  if (filt_coef_present) {
    j.write_str("filterCoefficient", filt_coef.to_string());
  }
  j.end_obj();
}

// QuantityConfigUTRA-v1020 ::= SEQUENCE
SRSASN_CODE quant_cfg_utra_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coef2_fdd_r10_present, 1));

  if (filt_coef2_fdd_r10_present) {
    HANDLE_CODE(filt_coef2_fdd_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_utra_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coef2_fdd_r10_present, 1));

  if (filt_coef2_fdd_r10_present) {
    HANDLE_CODE(filt_coef2_fdd_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_utra_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (filt_coef2_fdd_r10_present) {
    j.write_str("filterCoefficient2-FDD-r10", filt_coef2_fdd_r10.to_string());
  }
  j.end_obj();
}

// QuantityConfigWLAN-r13 ::= SEQUENCE
SRSASN_CODE quant_cfg_wlan_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(filt_coef_r13_present, 1));

  if (filt_coef_r13_present) {
    HANDLE_CODE(filt_coef_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_wlan_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(filt_coef_r13_present, 1));

  if (filt_coef_r13_present) {
    HANDLE_CODE(filt_coef_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void quant_cfg_wlan_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("measQuantityWLAN-r13", "rssiWLAN");
  if (filt_coef_r13_present) {
    j.write_str("filterCoefficient-r13", filt_coef_r13.to_string());
  }
  j.end_obj();
}

// RRCConnectionReconfiguration-v1020-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_v1020_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(scell_to_release_list_r10_present, 1));
  HANDLE_CODE(bref.pack(scell_to_add_mod_list_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (scell_to_release_list_r10_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_release_list_r10, 1, 4, integer_packer<uint8_t>(1, 7)));
  }
  if (scell_to_add_mod_list_r10_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_r10, 1, 4));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(scell_to_release_list_r10_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (scell_to_release_list_r10_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_release_list_r10, bref, 1, 4, integer_packer<uint8_t>(1, 7)));
  }
  if (scell_to_add_mod_list_r10_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_r10, bref, 1, 4));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (scell_to_release_list_r10_present) {
    j.start_array("sCellToReleaseList-r10");
    for (const auto& e1 : scell_to_release_list_r10) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (scell_to_add_mod_list_r10_present) {
    j.start_array("sCellToAddModList-r10");
    for (const auto& e1 : scell_to_add_mod_list_r10) {
      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();
}

// 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
{
  HANDLE_CODE(bref.pack(extended_wait_time_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (extended_wait_time_r10_present) {
    HANDLE_CODE(pack_integer(bref, extended_wait_time_r10, (uint16_t)1u, (uint16_t)1800u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_release_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(extended_wait_time_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (extended_wait_time_r10_present) {
    HANDLE_CODE(unpack_integer(extended_wait_time_r10, bref, (uint16_t)1u, (uint16_t)1800u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_release_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (extended_wait_time_r10_present) {
    j.write_int("extendedWaitTime-r10", extended_wait_time_r10);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionResume-v1530-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(full_cfg_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(full_cfg_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
void rrc_conn_resume_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (full_cfg_r15_present) {
    j.write_str("fullConfig-r15", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  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();
}

// ReportConfigToAddMod ::= SEQUENCE
SRSASN_CODE report_cfg_to_add_mod_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, report_cfg_id, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(report_cfg.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_to_add_mod_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(report_cfg_id, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(report_cfg.unpack(bref));

  return SRSASN_SUCCESS;
}
void report_cfg_to_add_mod_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("reportConfigId", report_cfg_id);
  j.write_fieldname("reportConfig");
  report_cfg.to_json(j);
  j.end_obj();
}

void report_cfg_to_add_mod_s::report_cfg_c_::destroy_()
{
  switch (type_) {
    case types::report_cfg_eutra:
      c.destroy<report_cfg_eutra_s>();
      break;
    case types::report_cfg_inter_rat:
      c.destroy<report_cfg_inter_rat_s>();
      break;
    default:
      break;
  }
}
void report_cfg_to_add_mod_s::report_cfg_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::report_cfg_eutra:
      c.init<report_cfg_eutra_s>();
      break;
    case types::report_cfg_inter_rat:
      c.init<report_cfg_inter_rat_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_to_add_mod_s::report_cfg_c_");
  }
}
report_cfg_to_add_mod_s::report_cfg_c_::report_cfg_c_(const report_cfg_to_add_mod_s::report_cfg_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::report_cfg_eutra:
      c.init(other.c.get<report_cfg_eutra_s>());
      break;
    case types::report_cfg_inter_rat:
      c.init(other.c.get<report_cfg_inter_rat_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_to_add_mod_s::report_cfg_c_");
  }
}
report_cfg_to_add_mod_s::report_cfg_c_& report_cfg_to_add_mod_s::report_cfg_c_::
                                        operator=(const report_cfg_to_add_mod_s::report_cfg_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::report_cfg_eutra:
      c.set(other.c.get<report_cfg_eutra_s>());
      break;
    case types::report_cfg_inter_rat:
      c.set(other.c.get<report_cfg_inter_rat_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_to_add_mod_s::report_cfg_c_");
  }

  return *this;
}
void report_cfg_to_add_mod_s::report_cfg_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::report_cfg_eutra:
      j.write_fieldname("reportConfigEUTRA");
      c.get<report_cfg_eutra_s>().to_json(j);
      break;
    case types::report_cfg_inter_rat:
      j.write_fieldname("reportConfigInterRAT");
      c.get<report_cfg_inter_rat_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_to_add_mod_s::report_cfg_c_");
  }
  j.end_obj();
}
SRSASN_CODE report_cfg_to_add_mod_s::report_cfg_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::report_cfg_eutra:
      HANDLE_CODE(c.get<report_cfg_eutra_s>().pack(bref));
      break;
    case types::report_cfg_inter_rat:
      HANDLE_CODE(c.get<report_cfg_inter_rat_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_to_add_mod_s::report_cfg_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE report_cfg_to_add_mod_s::report_cfg_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::report_cfg_eutra:
      HANDLE_CODE(c.get<report_cfg_eutra_s>().unpack(bref));
      break;
    case types::report_cfg_inter_rat:
      HANDLE_CODE(c.get<report_cfg_inter_rat_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "report_cfg_to_add_mod_s::report_cfg_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UECapabilityEnquiry-v1310-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_enquiry_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(request_reduced_format_r13_present, 1));
  HANDLE_CODE(bref.pack(request_skip_fallback_comb_r13_present, 1));
  HANDLE_CODE(bref.pack(requested_max_ccs_dl_r13_present, 1));
  HANDLE_CODE(bref.pack(requested_max_ccs_ul_r13_present, 1));
  HANDLE_CODE(bref.pack(request_reduced_int_non_cont_comb_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (requested_max_ccs_dl_r13_present) {
    HANDLE_CODE(pack_integer(bref, requested_max_ccs_dl_r13, (uint8_t)2u, (uint8_t)32u));
  }
  if (requested_max_ccs_ul_r13_present) {
    HANDLE_CODE(pack_integer(bref, requested_max_ccs_ul_r13, (uint8_t)2u, (uint8_t)32u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_enquiry_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(request_reduced_format_r13_present, 1));
  HANDLE_CODE(bref.unpack(request_skip_fallback_comb_r13_present, 1));
  HANDLE_CODE(bref.unpack(requested_max_ccs_dl_r13_present, 1));
  HANDLE_CODE(bref.unpack(requested_max_ccs_ul_r13_present, 1));
  HANDLE_CODE(bref.unpack(request_reduced_int_non_cont_comb_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (requested_max_ccs_dl_r13_present) {
    HANDLE_CODE(unpack_integer(requested_max_ccs_dl_r13, bref, (uint8_t)2u, (uint8_t)32u));
  }
  if (requested_max_ccs_ul_r13_present) {
    HANDLE_CODE(unpack_integer(requested_max_ccs_ul_r13, bref, (uint8_t)2u, (uint8_t)32u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_enquiry_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (request_reduced_format_r13_present) {
    j.write_str("requestReducedFormat-r13", "true");
  }
  if (request_skip_fallback_comb_r13_present) {
    j.write_str("requestSkipFallbackComb-r13", "true");
  }
  if (requested_max_ccs_dl_r13_present) {
    j.write_int("requestedMaxCCsDL-r13", requested_max_ccs_dl_r13);
  }
  if (requested_max_ccs_ul_r13_present) {
    j.write_int("requestedMaxCCsUL-r13", requested_max_ccs_ul_r13);
  }
  if (request_reduced_int_non_cont_comb_r13_present) {
    j.write_str("requestReducedIntNonContComb-r13", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UEInformationRequest-v1130-IEs ::= SEQUENCE
SRSASN_CODE ue_info_request_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(conn_est_fail_report_req_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_request_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(conn_est_fail_report_req_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_request_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (conn_est_fail_report_req_r11_present) {
    j.write_str("connEstFailReportReq-r11", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// CarrierBandwidthEUTRA ::= SEQUENCE
SRSASN_CODE carrier_bw_eutra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_bw_present, 1));

  HANDLE_CODE(dl_bw.pack(bref));
  if (ul_bw_present) {
    HANDLE_CODE(ul_bw.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_bw_eutra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_bw_present, 1));

  HANDLE_CODE(dl_bw.unpack(bref));
  if (ul_bw_present) {
    HANDLE_CODE(ul_bw.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void carrier_bw_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("dl-Bandwidth", dl_bw.to_string());
  if (ul_bw_present) {
    j.write_str("ul-Bandwidth", ul_bw.to_string());
  }
  j.end_obj();
}

// CarrierFreqEUTRA ::= SEQUENCE
SRSASN_CODE carrier_freq_eutra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_carrier_freq_present, 1));

  HANDLE_CODE(pack_integer(bref, dl_carrier_freq, (uint32_t)0u, (uint32_t)65535u));
  if (ul_carrier_freq_present) {
    HANDLE_CODE(pack_integer(bref, ul_carrier_freq, (uint32_t)0u, (uint32_t)65535u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freq_eutra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_carrier_freq_present, 1));

  HANDLE_CODE(unpack_integer(dl_carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u));
  if (ul_carrier_freq_present) {
    HANDLE_CODE(unpack_integer(ul_carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u));
  }

  return SRSASN_SUCCESS;
}
void carrier_freq_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("dl-CarrierFreq", dl_carrier_freq);
  if (ul_carrier_freq_present) {
    j.write_int("ul-CarrierFreq", ul_carrier_freq);
  }
  j.end_obj();
}

// CarrierFreqEUTRA-v9e0 ::= SEQUENCE
SRSASN_CODE carrier_freq_eutra_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_carrier_freq_v9e0_present, 1));

  HANDLE_CODE(pack_integer(bref, dl_carrier_freq_v9e0, (uint32_t)0u, (uint32_t)262143u));
  if (ul_carrier_freq_v9e0_present) {
    HANDLE_CODE(pack_integer(bref, ul_carrier_freq_v9e0, (uint32_t)0u, (uint32_t)262143u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_freq_eutra_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_carrier_freq_v9e0_present, 1));

  HANDLE_CODE(unpack_integer(dl_carrier_freq_v9e0, bref, (uint32_t)0u, (uint32_t)262143u));
  if (ul_carrier_freq_v9e0_present) {
    HANDLE_CODE(unpack_integer(ul_carrier_freq_v9e0, bref, (uint32_t)0u, (uint32_t)262143u));
  }

  return SRSASN_SUCCESS;
}
void carrier_freq_eutra_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("dl-CarrierFreq-v9e0", dl_carrier_freq_v9e0);
  if (ul_carrier_freq_v9e0_present) {
    j.write_int("ul-CarrierFreq-v9e0", ul_carrier_freq_v9e0);
  }
  j.end_obj();
}

// CarrierInfoNR-r15 ::= SEQUENCE
SRSASN_CODE carrier_info_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(smtc_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)3279165u));
  HANDLE_CODE(subcarrier_spacing_ssb_r15.pack(bref));
  if (smtc_r15_present) {
    HANDLE_CODE(smtc_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE carrier_info_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(smtc_r15_present, 1));

  HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)3279165u));
  HANDLE_CODE(subcarrier_spacing_ssb_r15.unpack(bref));
  if (smtc_r15_present) {
    HANDLE_CODE(smtc_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void carrier_info_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r15", carrier_freq_r15);
  j.write_str("subcarrierSpacingSSB-r15", subcarrier_spacing_ssb_r15.to_string());
  if (smtc_r15_present) {
    j.write_fieldname("smtc-r15");
    smtc_r15.to_json(j);
  }
  j.end_obj();
}

// CounterCheck-v1530-IEs ::= SEQUENCE
SRSASN_CODE counter_check_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(drb_count_msb_info_list_ext_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (drb_count_msb_info_list_ext_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_count_msb_info_list_ext_r15, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE counter_check_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(drb_count_msb_info_list_ext_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (drb_count_msb_info_list_ext_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_count_msb_info_list_ext_r15, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void counter_check_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (drb_count_msb_info_list_ext_r15_present) {
    j.start_array("drb-CountMSB-InfoListExt-r15");
    for (const auto& e1 : drb_count_msb_info_list_ext_r15) {
      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();
}

// HandoverFromEUTRAPreparationRequest-v920-IEs ::= SEQUENCE
SRSASN_CODE ho_from_eutra_prep_request_v920_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(concurr_prep_cdma2000_hrpd_r9_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (concurr_prep_cdma2000_hrpd_r9_present) {
    HANDLE_CODE(bref.pack(concurr_prep_cdma2000_hrpd_r9, 1));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_from_eutra_prep_request_v920_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(concurr_prep_cdma2000_hrpd_r9_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (concurr_prep_cdma2000_hrpd_r9_present) {
    HANDLE_CODE(bref.unpack(concurr_prep_cdma2000_hrpd_r9, 1));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_from_eutra_prep_request_v920_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (concurr_prep_cdma2000_hrpd_r9_present) {
    j.write_bool("concurrPrepCDMA2000-HRPD-r9", concurr_prep_cdma2000_hrpd_r9);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// LoggedMeasurementConfiguration-v1130-IEs ::= SEQUENCE
SRSASN_CODE logged_meas_cfg_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(plmn_id_list_r11_present, 1));
  HANDLE_CODE(bref.pack(area_cfg_v1130_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (plmn_id_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r11, 1, 16));
  }
  if (area_cfg_v1130_present) {
    HANDLE_CODE(area_cfg_v1130.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE logged_meas_cfg_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(plmn_id_list_r11_present, 1));
  HANDLE_CODE(bref.unpack(area_cfg_v1130_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (plmn_id_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r11, bref, 1, 16));
  }
  if (area_cfg_v1130_present) {
    HANDLE_CODE(area_cfg_v1130.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void logged_meas_cfg_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (plmn_id_list_r11_present) {
    j.start_array("plmn-IdentityList-r11");
    for (const auto& e1 : plmn_id_list_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (area_cfg_v1130_present) {
    j.write_fieldname("areaConfiguration-v1130");
    area_cfg_v1130.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// MeasGapConfigDensePRS-r15 ::= CHOICE
void meas_gap_cfg_dense_prs_r15_c::set(types::options e)
{
  type_ = e;
}
void meas_gap_cfg_dense_prs_r15_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("gapOffsetDensePRS-r15");
      c.gap_offset_dense_prs_r15.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_dense_prs_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE meas_gap_cfg_dense_prs_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.gap_offset_dense_prs_r15.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_dense_prs_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_gap_cfg_dense_prs_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.gap_offset_dense_prs_r15.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_dense_prs_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_::destroy_() {}
void meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_::gap_offset_dense_prs_r15_c_(
    const meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::rstd0_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::rstd1_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::rstd2_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd3_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd4_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd5_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::rstd6_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd7_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd8_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd9_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd10_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd11_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd12_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd13_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd14_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd15_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd16_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd17_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd18_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd19_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd20_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_");
  }
}
meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_&
meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_::
operator=(const meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::rstd0_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::rstd1_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::rstd2_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd3_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd4_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd5_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::rstd6_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd7_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd8_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd9_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd10_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd11_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd12_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd13_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd14_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd15_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd16_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd17_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd18_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd19_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd20_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_");
  }

  return *this;
}
void meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rstd0_r15:
      j.write_int("rstd0-r15", c.get<uint8_t>());
      break;
    case types::rstd1_r15:
      j.write_int("rstd1-r15", c.get<uint8_t>());
      break;
    case types::rstd2_r15:
      j.write_int("rstd2-r15", c.get<uint16_t>());
      break;
    case types::rstd3_r15:
      j.write_int("rstd3-r15", c.get<uint16_t>());
      break;
    case types::rstd4_r15:
      j.write_int("rstd4-r15", c.get<uint16_t>());
      break;
    case types::rstd5_r15:
      j.write_int("rstd5-r15", c.get<uint8_t>());
      break;
    case types::rstd6_r15:
      j.write_int("rstd6-r15", c.get<uint16_t>());
      break;
    case types::rstd7_r15:
      j.write_int("rstd7-r15", c.get<uint16_t>());
      break;
    case types::rstd8_r15:
      j.write_int("rstd8-r15", c.get<uint16_t>());
      break;
    case types::rstd9_r15:
      j.write_int("rstd9-r15", c.get<uint16_t>());
      break;
    case types::rstd10_r15:
      j.write_int("rstd10-r15", c.get<uint16_t>());
      break;
    case types::rstd11_r15:
      j.write_int("rstd11-r15", c.get<uint16_t>());
      break;
    case types::rstd12_r15:
      j.write_int("rstd12-r15", c.get<uint16_t>());
      break;
    case types::rstd13_r15:
      j.write_int("rstd13-r15", c.get<uint16_t>());
      break;
    case types::rstd14_r15:
      j.write_int("rstd14-r15", c.get<uint16_t>());
      break;
    case types::rstd15_r15:
      j.write_int("rstd15-r15", c.get<uint16_t>());
      break;
    case types::rstd16_r15:
      j.write_int("rstd16-r15", c.get<uint16_t>());
      break;
    case types::rstd17_r15:
      j.write_int("rstd17-r15", c.get<uint16_t>());
      break;
    case types::rstd18_r15:
      j.write_int("rstd18-r15", c.get<uint16_t>());
      break;
    case types::rstd19_r15:
      j.write_int("rstd19-r15", c.get<uint16_t>());
      break;
    case types::rstd20_r15:
      j.write_int("rstd20-r15", c.get<uint16_t>());
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rstd0_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::rstd1_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    case types::rstd2_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd3_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd4_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd5_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    case types::rstd6_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd7_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd8_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd9_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd10_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd11_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd12_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd13_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd14_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd15_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd16_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd17_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd18_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd19_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd20_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rstd0_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::rstd1_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    case types::rstd2_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd3_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd4_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd5_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    case types::rstd6_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd7_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd8_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd9_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd10_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd11_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd12_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd13_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd14_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd15_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd16_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd17_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd18_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd19_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd20_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_dense_prs_r15_c::setup_s_::gap_offset_dense_prs_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasGapConfigPerCC-List-r14 ::= CHOICE
void meas_gap_cfg_per_cc_list_r14_c::set(types::options e)
{
  type_ = e;
}
void meas_gap_cfg_per_cc_list_r14_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.meas_gap_cfg_to_rem_list_r14_present) {
        j.start_array("measGapConfigToRemoveList-r14");
        for (const auto& e1 : c.meas_gap_cfg_to_rem_list_r14) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (c.meas_gap_cfg_to_add_mod_list_r14_present) {
        j.start_array("measGapConfigToAddModList-r14");
        for (const auto& e1 : c.meas_gap_cfg_to_add_mod_list_r14) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_per_cc_list_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE meas_gap_cfg_per_cc_list_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(bref.pack(c.meas_gap_cfg_to_rem_list_r14_present, 1));
      HANDLE_CODE(bref.pack(c.meas_gap_cfg_to_add_mod_list_r14_present, 1));
      if (c.meas_gap_cfg_to_rem_list_r14_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.meas_gap_cfg_to_rem_list_r14, 1, 32, integer_packer<uint8_t>(0, 31)));
      }
      if (c.meas_gap_cfg_to_add_mod_list_r14_present) {
        HANDLE_CODE(pack_dyn_seq_of(bref, c.meas_gap_cfg_to_add_mod_list_r14, 1, 32));
      }
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_per_cc_list_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_gap_cfg_per_cc_list_r14_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.meas_gap_cfg_to_rem_list_r14_present, 1));
      HANDLE_CODE(bref.unpack(c.meas_gap_cfg_to_add_mod_list_r14_present, 1));
      if (c.meas_gap_cfg_to_rem_list_r14_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.meas_gap_cfg_to_rem_list_r14, bref, 1, 32, integer_packer<uint8_t>(0, 31)));
      }
      if (c.meas_gap_cfg_to_add_mod_list_r14_present) {
        HANDLE_CODE(unpack_dyn_seq_of(c.meas_gap_cfg_to_add_mod_list_r14, bref, 1, 32));
      }
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_cfg_per_cc_list_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasGapSharingConfig-r14 ::= CHOICE
void meas_gap_sharing_cfg_r14_c::set(types::options e)
{
  type_ = e;
}
void meas_gap_sharing_cfg_r14_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("measGapSharingScheme-r14", c.meas_gap_sharing_scheme_r14.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_sharing_cfg_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE meas_gap_sharing_cfg_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.meas_gap_sharing_scheme_r14.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_sharing_cfg_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_gap_sharing_cfg_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.meas_gap_sharing_scheme_r14.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_gap_sharing_cfg_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MobilityControlInfoV2X-r14 ::= SEQUENCE
SRSASN_CODE mob_ctrl_info_v2x_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(v2x_comm_tx_pool_exceptional_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_comm_rx_pool_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_comm_sync_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(cbr_mob_tx_cfg_list_r14_present, 1));

  if (v2x_comm_tx_pool_exceptional_r14_present) {
    HANDLE_CODE(v2x_comm_tx_pool_exceptional_r14.pack(bref));
  }
  if (v2x_comm_rx_pool_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_rx_pool_r14, 1, 16));
  }
  if (v2x_comm_sync_cfg_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_sync_cfg_r14, 1, 16));
  }
  if (cbr_mob_tx_cfg_list_r14_present) {
    HANDLE_CODE(cbr_mob_tx_cfg_list_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_ctrl_info_v2x_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(v2x_comm_tx_pool_exceptional_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_comm_rx_pool_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_comm_sync_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(cbr_mob_tx_cfg_list_r14_present, 1));

  if (v2x_comm_tx_pool_exceptional_r14_present) {
    HANDLE_CODE(v2x_comm_tx_pool_exceptional_r14.unpack(bref));
  }
  if (v2x_comm_rx_pool_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_rx_pool_r14, bref, 1, 16));
  }
  if (v2x_comm_sync_cfg_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_sync_cfg_r14, bref, 1, 16));
  }
  if (cbr_mob_tx_cfg_list_r14_present) {
    HANDLE_CODE(cbr_mob_tx_cfg_list_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mob_ctrl_info_v2x_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (v2x_comm_tx_pool_exceptional_r14_present) {
    j.write_fieldname("v2x-CommTxPoolExceptional-r14");
    v2x_comm_tx_pool_exceptional_r14.to_json(j);
  }
  if (v2x_comm_rx_pool_r14_present) {
    j.start_array("v2x-CommRxPool-r14");
    for (const auto& e1 : v2x_comm_rx_pool_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_comm_sync_cfg_r14_present) {
    j.start_array("v2x-CommSyncConfig-r14");
    for (const auto& e1 : v2x_comm_sync_cfg_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (cbr_mob_tx_cfg_list_r14_present) {
    j.write_fieldname("cbr-MobilityTxConfigList-r14");
    cbr_mob_tx_cfg_list_r14.to_json(j);
  }
  j.end_obj();
}

// MobilityFromEUTRACommand-v8d0-IEs ::= SEQUENCE
SRSASN_CODE mob_from_eutra_cmd_v8d0_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_ind_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (band_ind_present) {
    HANDLE_CODE(band_ind.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_v8d0_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_ind_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (band_ind_present) {
    HANDLE_CODE(band_ind.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mob_from_eutra_cmd_v8d0_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_ind_present) {
    j.write_str("bandIndicator", band_ind.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// MobilityFromEUTRACommand-v960-IEs ::= SEQUENCE
SRSASN_CODE mob_from_eutra_cmd_v960_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_ind_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (band_ind_present) {
    HANDLE_CODE(band_ind.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_v960_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_ind_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (band_ind_present) {
    HANDLE_CODE(band_ind.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mob_from_eutra_cmd_v960_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_ind_present) {
    j.write_str("bandIndicator", band_ind.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// QuantityConfig ::= SEQUENCE
SRSASN_CODE quant_cfg_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(quant_cfg_eutra_present, 1));
  HANDLE_CODE(bref.pack(quant_cfg_utra_present, 1));
  HANDLE_CODE(bref.pack(quant_cfg_geran_present, 1));
  HANDLE_CODE(bref.pack(quant_cfg_cdma2000_present, 1));

  if (quant_cfg_eutra_present) {
    HANDLE_CODE(quant_cfg_eutra.pack(bref));
  }
  if (quant_cfg_utra_present) {
    HANDLE_CODE(quant_cfg_utra.pack(bref));
  }
  if (quant_cfg_geran_present) {
    HANDLE_CODE(quant_cfg_geran.pack(bref));
  }
  if (quant_cfg_cdma2000_present) {
    HANDLE_CODE(quant_cfg_cdma2000.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= quant_cfg_utra_v1020.is_present();
    group_flags[1] |= quant_cfg_eutra_v1250.is_present();
    group_flags[2] |= quant_cfg_eutra_v1310.is_present();
    group_flags[2] |= quant_cfg_wlan_r13.is_present();
    group_flags[3] |= quant_cfg_nr_list_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(quant_cfg_utra_v1020.is_present(), 1));
      if (quant_cfg_utra_v1020.is_present()) {
        HANDLE_CODE(quant_cfg_utra_v1020->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(quant_cfg_eutra_v1250.is_present(), 1));
      if (quant_cfg_eutra_v1250.is_present()) {
        HANDLE_CODE(quant_cfg_eutra_v1250->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(quant_cfg_eutra_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(quant_cfg_wlan_r13.is_present(), 1));
      if (quant_cfg_eutra_v1310.is_present()) {
        HANDLE_CODE(quant_cfg_eutra_v1310->pack(bref));
      }
      if (quant_cfg_wlan_r13.is_present()) {
        HANDLE_CODE(quant_cfg_wlan_r13->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(quant_cfg_nr_list_r15.is_present(), 1));
      if (quant_cfg_nr_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *quant_cfg_nr_list_r15, 1, 2));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE quant_cfg_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(quant_cfg_eutra_present, 1));
  HANDLE_CODE(bref.unpack(quant_cfg_utra_present, 1));
  HANDLE_CODE(bref.unpack(quant_cfg_geran_present, 1));
  HANDLE_CODE(bref.unpack(quant_cfg_cdma2000_present, 1));

  if (quant_cfg_eutra_present) {
    HANDLE_CODE(quant_cfg_eutra.unpack(bref));
  }
  if (quant_cfg_utra_present) {
    HANDLE_CODE(quant_cfg_utra.unpack(bref));
  }
  if (quant_cfg_geran_present) {
    HANDLE_CODE(quant_cfg_geran.unpack(bref));
  }
  if (quant_cfg_cdma2000_present) {
    HANDLE_CODE(quant_cfg_cdma2000.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);

      bool quant_cfg_utra_v1020_present;
      HANDLE_CODE(bref.unpack(quant_cfg_utra_v1020_present, 1));
      quant_cfg_utra_v1020.set_present(quant_cfg_utra_v1020_present);
      if (quant_cfg_utra_v1020.is_present()) {
        HANDLE_CODE(quant_cfg_utra_v1020->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool quant_cfg_eutra_v1250_present;
      HANDLE_CODE(bref.unpack(quant_cfg_eutra_v1250_present, 1));
      quant_cfg_eutra_v1250.set_present(quant_cfg_eutra_v1250_present);
      if (quant_cfg_eutra_v1250.is_present()) {
        HANDLE_CODE(quant_cfg_eutra_v1250->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool quant_cfg_eutra_v1310_present;
      HANDLE_CODE(bref.unpack(quant_cfg_eutra_v1310_present, 1));
      quant_cfg_eutra_v1310.set_present(quant_cfg_eutra_v1310_present);
      bool quant_cfg_wlan_r13_present;
      HANDLE_CODE(bref.unpack(quant_cfg_wlan_r13_present, 1));
      quant_cfg_wlan_r13.set_present(quant_cfg_wlan_r13_present);
      if (quant_cfg_eutra_v1310.is_present()) {
        HANDLE_CODE(quant_cfg_eutra_v1310->unpack(bref));
      }
      if (quant_cfg_wlan_r13.is_present()) {
        HANDLE_CODE(quant_cfg_wlan_r13->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool quant_cfg_nr_list_r15_present;
      HANDLE_CODE(bref.unpack(quant_cfg_nr_list_r15_present, 1));
      quant_cfg_nr_list_r15.set_present(quant_cfg_nr_list_r15_present);
      if (quant_cfg_nr_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*quant_cfg_nr_list_r15, bref, 1, 2));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void quant_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (quant_cfg_eutra_present) {
    j.write_fieldname("quantityConfigEUTRA");
    quant_cfg_eutra.to_json(j);
  }
  if (quant_cfg_utra_present) {
    j.write_fieldname("quantityConfigUTRA");
    quant_cfg_utra.to_json(j);
  }
  if (quant_cfg_geran_present) {
    j.write_fieldname("quantityConfigGERAN");
    quant_cfg_geran.to_json(j);
  }
  if (quant_cfg_cdma2000_present) {
    j.write_fieldname("quantityConfigCDMA2000");
    quant_cfg_cdma2000.to_json(j);
  }
  if (ext) {
    if (quant_cfg_utra_v1020.is_present()) {
      j.write_fieldname("quantityConfigUTRA-v1020");
      quant_cfg_utra_v1020->to_json(j);
    }
    if (quant_cfg_eutra_v1250.is_present()) {
      j.write_fieldname("quantityConfigEUTRA-v1250");
      quant_cfg_eutra_v1250->to_json(j);
    }
    if (quant_cfg_eutra_v1310.is_present()) {
      j.write_fieldname("quantityConfigEUTRA-v1310");
      quant_cfg_eutra_v1310->to_json(j);
    }
    if (quant_cfg_wlan_r13.is_present()) {
      j.write_fieldname("quantityConfigWLAN-r13");
      quant_cfg_wlan_r13->to_json(j);
    }
    if (quant_cfg_nr_list_r15.is_present()) {
      j.start_array("quantityConfigNRList-r15");
      for (const auto& e1 : *quant_cfg_nr_list_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  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
{
  HANDLE_CODE(bref.pack(other_cfg_r9_present, 1));
  HANDLE_CODE(bref.pack(full_cfg_r9_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (other_cfg_r9_present) {
    HANDLE_CODE(other_cfg_r9.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_v920_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(other_cfg_r9_present, 1));
  HANDLE_CODE(bref.unpack(full_cfg_r9_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (other_cfg_r9_present) {
    HANDLE_CODE(other_cfg_r9.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_v920_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (other_cfg_r9_present) {
    j.write_fieldname("otherConfig-r9");
    other_cfg_r9.to_json(j);
  }
  if (full_cfg_r9_present) {
    j.write_str("fullConfig-r9", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionRelease-v920-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_release_v920_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cell_info_list_r9_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (cell_info_list_r9_present) {
    HANDLE_CODE(cell_info_list_r9.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_release_v920_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cell_info_list_r9_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (cell_info_list_r9_present) {
    HANDLE_CODE(cell_info_list_r9.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_release_v920_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cell_info_list_r9_present) {
    j.write_fieldname("cellInfoList-r9");
    cell_info_list_r9.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void rrc_conn_release_v920_ies_s::cell_info_list_r9_c_::destroy_()
{
  switch (type_) {
    case types::geran_r9:
      c.destroy<cell_info_list_geran_r9_l>();
      break;
    case types::utra_fdd_r9:
      c.destroy<cell_info_list_utra_fdd_r9_l>();
      break;
    case types::utra_tdd_r9:
      c.destroy<cell_info_list_utra_tdd_r9_l>();
      break;
    case types::utra_tdd_r10:
      c.destroy<cell_info_list_utra_tdd_r10_l>();
      break;
    default:
      break;
  }
}
void rrc_conn_release_v920_ies_s::cell_info_list_r9_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::geran_r9:
      c.init<cell_info_list_geran_r9_l>();
      break;
    case types::utra_fdd_r9:
      c.init<cell_info_list_utra_fdd_r9_l>();
      break;
    case types::utra_tdd_r9:
      c.init<cell_info_list_utra_tdd_r9_l>();
      break;
    case types::utra_tdd_r10:
      c.init<cell_info_list_utra_tdd_r10_l>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_v920_ies_s::cell_info_list_r9_c_");
  }
}
rrc_conn_release_v920_ies_s::cell_info_list_r9_c_::cell_info_list_r9_c_(
    const rrc_conn_release_v920_ies_s::cell_info_list_r9_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::geran_r9:
      c.init(other.c.get<cell_info_list_geran_r9_l>());
      break;
    case types::utra_fdd_r9:
      c.init(other.c.get<cell_info_list_utra_fdd_r9_l>());
      break;
    case types::utra_tdd_r9:
      c.init(other.c.get<cell_info_list_utra_tdd_r9_l>());
      break;
    case types::utra_tdd_r10:
      c.init(other.c.get<cell_info_list_utra_tdd_r10_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_v920_ies_s::cell_info_list_r9_c_");
  }
}
rrc_conn_release_v920_ies_s::cell_info_list_r9_c_& rrc_conn_release_v920_ies_s::cell_info_list_r9_c_::
                                                   operator=(const rrc_conn_release_v920_ies_s::cell_info_list_r9_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::geran_r9:
      c.set(other.c.get<cell_info_list_geran_r9_l>());
      break;
    case types::utra_fdd_r9:
      c.set(other.c.get<cell_info_list_utra_fdd_r9_l>());
      break;
    case types::utra_tdd_r9:
      c.set(other.c.get<cell_info_list_utra_tdd_r9_l>());
      break;
    case types::utra_tdd_r10:
      c.set(other.c.get<cell_info_list_utra_tdd_r10_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_v920_ies_s::cell_info_list_r9_c_");
  }

  return *this;
}
void rrc_conn_release_v920_ies_s::cell_info_list_r9_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::geran_r9:
      j.start_array("geran-r9");
      for (const auto& e1 : c.get<cell_info_list_geran_r9_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::utra_fdd_r9:
      j.start_array("utra-FDD-r9");
      for (const auto& e1 : c.get<cell_info_list_utra_fdd_r9_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::utra_tdd_r9:
      j.start_array("utra-TDD-r9");
      for (const auto& e1 : c.get<cell_info_list_utra_tdd_r9_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::utra_tdd_r10:
      j.start_array("utra-TDD-r10");
      for (const auto& e1 : c.get<cell_info_list_utra_tdd_r10_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_v920_ies_s::cell_info_list_r9_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_release_v920_ies_s::cell_info_list_r9_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::geran_r9:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<cell_info_list_geran_r9_l>(), 1, 32));
      break;
    case types::utra_fdd_r9:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<cell_info_list_utra_fdd_r9_l>(), 1, 16));
      break;
    case types::utra_tdd_r9:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<cell_info_list_utra_tdd_r9_l>(), 1, 16));
      break;
    case types::utra_tdd_r10: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<cell_info_list_utra_tdd_r10_l>(), 1, 16));
    } break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_v920_ies_s::cell_info_list_r9_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_release_v920_ies_s::cell_info_list_r9_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::geran_r9:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<cell_info_list_geran_r9_l>(), bref, 1, 32));
      break;
    case types::utra_fdd_r9:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<cell_info_list_utra_fdd_r9_l>(), bref, 1, 16));
      break;
    case types::utra_tdd_r9:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<cell_info_list_utra_tdd_r9_l>(), bref, 1, 16));
      break;
    case types::utra_tdd_r10: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_dyn_seq_of(c.get<cell_info_list_utra_tdd_r10_l>(), bref, 1, 16));
    } break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_v920_ies_s::cell_info_list_r9_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// 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();
}

// 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(non_crit_ext_present, 1));

  if (sk_counter_r15_present) {
    HANDLE_CODE(pack_integer(bref, sk_counter_r15, (uint32_t)0u, (uint32_t)65535u));
  }
  if (nr_radio_bearer_cfg1_r15_present) {
    HANDLE_CODE(nr_radio_bearer_cfg1_r15.pack(bref));
  }
  if (nr_radio_bearer_cfg2_r15_present) {
    HANDLE_CODE(nr_radio_bearer_cfg2_r15.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_v1510_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(sk_counter_r15_present, 1));
  HANDLE_CODE(bref.unpack(nr_radio_bearer_cfg1_r15_present, 1));
  HANDLE_CODE(bref.unpack(nr_radio_bearer_cfg2_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (sk_counter_r15_present) {
    HANDLE_CODE(unpack_integer(sk_counter_r15, bref, (uint32_t)0u, (uint32_t)65535u));
  }
  if (nr_radio_bearer_cfg1_r15_present) {
    HANDLE_CODE(nr_radio_bearer_cfg1_r15.unpack(bref));
  }
  if (nr_radio_bearer_cfg2_r15_present) {
    HANDLE_CODE(nr_radio_bearer_cfg2_r15.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_resume_v1510_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sk_counter_r15_present) {
    j.write_int("sk-Counter-r15", sk_counter_r15);
  }
  if (nr_radio_bearer_cfg1_r15_present) {
    j.write_str("nr-RadioBearerConfig1-r15", nr_radio_bearer_cfg1_r15.to_string());
  }
  if (nr_radio_bearer_cfg2_r15_present) {
    j.write_str("nr-RadioBearerConfig2-r15", nr_radio_bearer_cfg2_r15.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RadioResourceConfigCommon ::= SEQUENCE
SRSASN_CODE rr_cfg_common_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rach_cfg_common_present, 1));
  HANDLE_CODE(bref.pack(pdsch_cfg_common_present, 1));
  HANDLE_CODE(bref.pack(phich_cfg_present, 1));
  HANDLE_CODE(bref.pack(pucch_cfg_common_present, 1));
  HANDLE_CODE(bref.pack(srs_ul_cfg_common_present, 1));
  HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_present, 1));
  HANDLE_CODE(bref.pack(ant_info_common_present, 1));
  HANDLE_CODE(bref.pack(p_max_present, 1));
  HANDLE_CODE(bref.pack(tdd_cfg_present, 1));

  if (rach_cfg_common_present) {
    HANDLE_CODE(rach_cfg_common.pack(bref));
  }
  HANDLE_CODE(prach_cfg.pack(bref));
  if (pdsch_cfg_common_present) {
    HANDLE_CODE(pdsch_cfg_common.pack(bref));
  }
  HANDLE_CODE(pusch_cfg_common.pack(bref));
  if (phich_cfg_present) {
    HANDLE_CODE(phich_cfg.pack(bref));
  }
  if (pucch_cfg_common_present) {
    HANDLE_CODE(pucch_cfg_common.pack(bref));
  }
  if (srs_ul_cfg_common_present) {
    HANDLE_CODE(srs_ul_cfg_common.pack(bref));
  }
  if (ul_pwr_ctrl_common_present) {
    HANDLE_CODE(ul_pwr_ctrl_common.pack(bref));
  }
  if (ant_info_common_present) {
    HANDLE_CODE(ant_info_common.pack(bref));
  }
  if (p_max_present) {
    HANDLE_CODE(pack_integer(bref, p_max, (int8_t)-30, (int8_t)33));
  }
  if (tdd_cfg_present) {
    HANDLE_CODE(tdd_cfg.pack(bref));
  }
  HANDLE_CODE(ul_cp_len.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= ul_pwr_ctrl_common_v1020.is_present();
    group_flags[1] |= tdd_cfg_v1130.is_present();
    group_flags[2] |= pusch_cfg_common_v1270.is_present();
    group_flags[3] |= prach_cfg_v1310.is_present();
    group_flags[3] |= freq_hop_params_r13.is_present();
    group_flags[3] |= pdsch_cfg_common_v1310.is_present();
    group_flags[3] |= pucch_cfg_common_v1310.is_present();
    group_flags[3] |= pusch_cfg_common_v1310.is_present();
    group_flags[3] |= ul_pwr_ctrl_common_v1310.is_present();
    group_flags[4] |= high_speed_cfg_r14.is_present();
    group_flags[4] |= prach_cfg_v1430.is_present();
    group_flags[4] |= pucch_cfg_common_v1430.is_present();
    group_flags[4] |= tdd_cfg_v1430.is_present();
    group_flags[5] |= tdd_cfg_v1450.is_present();
    group_flags[6] |= ul_pwr_ctrl_common_v1530.is_present();
    group_flags[6] |= high_speed_cfg_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_v1020.is_present(), 1));
      if (ul_pwr_ctrl_common_v1020.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_v1020->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(tdd_cfg_v1130.is_present(), 1));
      if (tdd_cfg_v1130.is_present()) {
        HANDLE_CODE(tdd_cfg_v1130->pack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(pusch_cfg_common_v1270.is_present(), 1));
      if (pusch_cfg_common_v1270.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1270->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(prach_cfg_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(freq_hop_params_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(pdsch_cfg_common_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_common_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(pusch_cfg_common_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_v1310.is_present(), 1));
      if (prach_cfg_v1310.is_present()) {
        HANDLE_CODE(prach_cfg_v1310->pack(bref));
      }
      if (freq_hop_params_r13.is_present()) {
        HANDLE_CODE(freq_hop_params_r13->pack(bref));
      }
      if (pdsch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pdsch_cfg_common_v1310->pack(bref));
      }
      if (pucch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pucch_cfg_common_v1310->pack(bref));
      }
      if (pusch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1310->pack(bref));
      }
      if (ul_pwr_ctrl_common_v1310.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_v1310->pack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(high_speed_cfg_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(prach_cfg_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(pucch_cfg_common_v1430.is_present(), 1));
      HANDLE_CODE(bref.pack(tdd_cfg_v1430.is_present(), 1));
      if (high_speed_cfg_r14.is_present()) {
        HANDLE_CODE(high_speed_cfg_r14->pack(bref));
      }
      if (prach_cfg_v1430.is_present()) {
        HANDLE_CODE(prach_cfg_v1430->pack(bref));
      }
      if (pucch_cfg_common_v1430.is_present()) {
        HANDLE_CODE(pucch_cfg_common_v1430->pack(bref));
      }
      if (tdd_cfg_v1430.is_present()) {
        HANDLE_CODE(tdd_cfg_v1430->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(tdd_cfg_v1450.is_present(), 1));
      if (tdd_cfg_v1450.is_present()) {
        HANDLE_CODE(tdd_cfg_v1450->pack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ul_pwr_ctrl_common_v1530.is_present(), 1));
      HANDLE_CODE(bref.pack(high_speed_cfg_v1530.is_present(), 1));
      if (ul_pwr_ctrl_common_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_v1530->pack(bref));
      }
      if (high_speed_cfg_v1530.is_present()) {
        HANDLE_CODE(high_speed_cfg_v1530->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rr_cfg_common_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rach_cfg_common_present, 1));
  HANDLE_CODE(bref.unpack(pdsch_cfg_common_present, 1));
  HANDLE_CODE(bref.unpack(phich_cfg_present, 1));
  HANDLE_CODE(bref.unpack(pucch_cfg_common_present, 1));
  HANDLE_CODE(bref.unpack(srs_ul_cfg_common_present, 1));
  HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_present, 1));
  HANDLE_CODE(bref.unpack(ant_info_common_present, 1));
  HANDLE_CODE(bref.unpack(p_max_present, 1));
  HANDLE_CODE(bref.unpack(tdd_cfg_present, 1));

  if (rach_cfg_common_present) {
    HANDLE_CODE(rach_cfg_common.unpack(bref));
  }
  HANDLE_CODE(prach_cfg.unpack(bref));
  if (pdsch_cfg_common_present) {
    HANDLE_CODE(pdsch_cfg_common.unpack(bref));
  }
  HANDLE_CODE(pusch_cfg_common.unpack(bref));
  if (phich_cfg_present) {
    HANDLE_CODE(phich_cfg.unpack(bref));
  }
  if (pucch_cfg_common_present) {
    HANDLE_CODE(pucch_cfg_common.unpack(bref));
  }
  if (srs_ul_cfg_common_present) {
    HANDLE_CODE(srs_ul_cfg_common.unpack(bref));
  }
  if (ul_pwr_ctrl_common_present) {
    HANDLE_CODE(ul_pwr_ctrl_common.unpack(bref));
  }
  if (ant_info_common_present) {
    HANDLE_CODE(ant_info_common.unpack(bref));
  }
  if (p_max_present) {
    HANDLE_CODE(unpack_integer(p_max, bref, (int8_t)-30, (int8_t)33));
  }
  if (tdd_cfg_present) {
    HANDLE_CODE(tdd_cfg.unpack(bref));
  }
  HANDLE_CODE(ul_cp_len.unpack(bref));

  if (ext) {
    ext_groups_unpacker_guard group_flags(7);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ul_pwr_ctrl_common_v1020_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_v1020_present, 1));
      ul_pwr_ctrl_common_v1020.set_present(ul_pwr_ctrl_common_v1020_present);
      if (ul_pwr_ctrl_common_v1020.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_v1020->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool tdd_cfg_v1130_present;
      HANDLE_CODE(bref.unpack(tdd_cfg_v1130_present, 1));
      tdd_cfg_v1130.set_present(tdd_cfg_v1130_present);
      if (tdd_cfg_v1130.is_present()) {
        HANDLE_CODE(tdd_cfg_v1130->unpack(bref));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool pusch_cfg_common_v1270_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_common_v1270_present, 1));
      pusch_cfg_common_v1270.set_present(pusch_cfg_common_v1270_present);
      if (pusch_cfg_common_v1270.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1270->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool prach_cfg_v1310_present;
      HANDLE_CODE(bref.unpack(prach_cfg_v1310_present, 1));
      prach_cfg_v1310.set_present(prach_cfg_v1310_present);
      bool freq_hop_params_r13_present;
      HANDLE_CODE(bref.unpack(freq_hop_params_r13_present, 1));
      freq_hop_params_r13.set_present(freq_hop_params_r13_present);
      bool pdsch_cfg_common_v1310_present;
      HANDLE_CODE(bref.unpack(pdsch_cfg_common_v1310_present, 1));
      pdsch_cfg_common_v1310.set_present(pdsch_cfg_common_v1310_present);
      bool pucch_cfg_common_v1310_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_common_v1310_present, 1));
      pucch_cfg_common_v1310.set_present(pucch_cfg_common_v1310_present);
      bool pusch_cfg_common_v1310_present;
      HANDLE_CODE(bref.unpack(pusch_cfg_common_v1310_present, 1));
      pusch_cfg_common_v1310.set_present(pusch_cfg_common_v1310_present);
      bool ul_pwr_ctrl_common_v1310_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_v1310_present, 1));
      ul_pwr_ctrl_common_v1310.set_present(ul_pwr_ctrl_common_v1310_present);
      if (prach_cfg_v1310.is_present()) {
        HANDLE_CODE(prach_cfg_v1310->unpack(bref));
      }
      if (freq_hop_params_r13.is_present()) {
        HANDLE_CODE(freq_hop_params_r13->unpack(bref));
      }
      if (pdsch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pdsch_cfg_common_v1310->unpack(bref));
      }
      if (pucch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pucch_cfg_common_v1310->unpack(bref));
      }
      if (pusch_cfg_common_v1310.is_present()) {
        HANDLE_CODE(pusch_cfg_common_v1310->unpack(bref));
      }
      if (ul_pwr_ctrl_common_v1310.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_v1310->unpack(bref));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool high_speed_cfg_r14_present;
      HANDLE_CODE(bref.unpack(high_speed_cfg_r14_present, 1));
      high_speed_cfg_r14.set_present(high_speed_cfg_r14_present);
      bool prach_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(prach_cfg_v1430_present, 1));
      prach_cfg_v1430.set_present(prach_cfg_v1430_present);
      bool pucch_cfg_common_v1430_present;
      HANDLE_CODE(bref.unpack(pucch_cfg_common_v1430_present, 1));
      pucch_cfg_common_v1430.set_present(pucch_cfg_common_v1430_present);
      bool tdd_cfg_v1430_present;
      HANDLE_CODE(bref.unpack(tdd_cfg_v1430_present, 1));
      tdd_cfg_v1430.set_present(tdd_cfg_v1430_present);
      if (high_speed_cfg_r14.is_present()) {
        HANDLE_CODE(high_speed_cfg_r14->unpack(bref));
      }
      if (prach_cfg_v1430.is_present()) {
        HANDLE_CODE(prach_cfg_v1430->unpack(bref));
      }
      if (pucch_cfg_common_v1430.is_present()) {
        HANDLE_CODE(pucch_cfg_common_v1430->unpack(bref));
      }
      if (tdd_cfg_v1430.is_present()) {
        HANDLE_CODE(tdd_cfg_v1430->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool tdd_cfg_v1450_present;
      HANDLE_CODE(bref.unpack(tdd_cfg_v1450_present, 1));
      tdd_cfg_v1450.set_present(tdd_cfg_v1450_present);
      if (tdd_cfg_v1450.is_present()) {
        HANDLE_CODE(tdd_cfg_v1450->unpack(bref));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool ul_pwr_ctrl_common_v1530_present;
      HANDLE_CODE(bref.unpack(ul_pwr_ctrl_common_v1530_present, 1));
      ul_pwr_ctrl_common_v1530.set_present(ul_pwr_ctrl_common_v1530_present);
      bool high_speed_cfg_v1530_present;
      HANDLE_CODE(bref.unpack(high_speed_cfg_v1530_present, 1));
      high_speed_cfg_v1530.set_present(high_speed_cfg_v1530_present);
      if (ul_pwr_ctrl_common_v1530.is_present()) {
        HANDLE_CODE(ul_pwr_ctrl_common_v1530->unpack(bref));
      }
      if (high_speed_cfg_v1530.is_present()) {
        HANDLE_CODE(high_speed_cfg_v1530->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rr_cfg_common_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rach_cfg_common_present) {
    j.write_fieldname("rach-ConfigCommon");
    rach_cfg_common.to_json(j);
  }
  j.write_fieldname("prach-Config");
  prach_cfg.to_json(j);
  if (pdsch_cfg_common_present) {
    j.write_fieldname("pdsch-ConfigCommon");
    pdsch_cfg_common.to_json(j);
  }
  j.write_fieldname("pusch-ConfigCommon");
  pusch_cfg_common.to_json(j);
  if (phich_cfg_present) {
    j.write_fieldname("phich-Config");
    phich_cfg.to_json(j);
  }
  if (pucch_cfg_common_present) {
    j.write_fieldname("pucch-ConfigCommon");
    pucch_cfg_common.to_json(j);
  }
  if (srs_ul_cfg_common_present) {
    j.write_fieldname("soundingRS-UL-ConfigCommon");
    srs_ul_cfg_common.to_json(j);
  }
  if (ul_pwr_ctrl_common_present) {
    j.write_fieldname("uplinkPowerControlCommon");
    ul_pwr_ctrl_common.to_json(j);
  }
  if (ant_info_common_present) {
    j.write_fieldname("antennaInfoCommon");
    ant_info_common.to_json(j);
  }
  if (p_max_present) {
    j.write_int("p-Max", p_max);
  }
  if (tdd_cfg_present) {
    j.write_fieldname("tdd-Config");
    tdd_cfg.to_json(j);
  }
  j.write_str("ul-CyclicPrefixLength", ul_cp_len.to_string());
  if (ext) {
    if (ul_pwr_ctrl_common_v1020.is_present()) {
      j.write_fieldname("uplinkPowerControlCommon-v1020");
      ul_pwr_ctrl_common_v1020->to_json(j);
    }
    if (tdd_cfg_v1130.is_present()) {
      j.write_fieldname("tdd-Config-v1130");
      tdd_cfg_v1130->to_json(j);
    }
    if (pusch_cfg_common_v1270.is_present()) {
      j.write_fieldname("pusch-ConfigCommon-v1270");
      pusch_cfg_common_v1270->to_json(j);
    }
    if (prach_cfg_v1310.is_present()) {
      j.write_fieldname("prach-Config-v1310");
      prach_cfg_v1310->to_json(j);
    }
    if (freq_hop_params_r13.is_present()) {
      j.write_fieldname("freqHoppingParameters-r13");
      freq_hop_params_r13->to_json(j);
    }
    if (pdsch_cfg_common_v1310.is_present()) {
      j.write_fieldname("pdsch-ConfigCommon-v1310");
      pdsch_cfg_common_v1310->to_json(j);
    }
    if (pucch_cfg_common_v1310.is_present()) {
      j.write_fieldname("pucch-ConfigCommon-v1310");
      pucch_cfg_common_v1310->to_json(j);
    }
    if (pusch_cfg_common_v1310.is_present()) {
      j.write_fieldname("pusch-ConfigCommon-v1310");
      pusch_cfg_common_v1310->to_json(j);
    }
    if (ul_pwr_ctrl_common_v1310.is_present()) {
      j.write_fieldname("uplinkPowerControlCommon-v1310");
      ul_pwr_ctrl_common_v1310->to_json(j);
    }
    if (high_speed_cfg_r14.is_present()) {
      j.write_fieldname("highSpeedConfig-r14");
      high_speed_cfg_r14->to_json(j);
    }
    if (prach_cfg_v1430.is_present()) {
      j.write_fieldname("prach-Config-v1430");
      prach_cfg_v1430->to_json(j);
    }
    if (pucch_cfg_common_v1430.is_present()) {
      j.write_fieldname("pucch-ConfigCommon-v1430");
      pucch_cfg_common_v1430->to_json(j);
    }
    if (tdd_cfg_v1430.is_present()) {
      j.write_fieldname("tdd-Config-v1430");
      tdd_cfg_v1430->to_json(j);
    }
    if (tdd_cfg_v1450.is_present()) {
      j.write_fieldname("tdd-Config-v1450");
      tdd_cfg_v1450->to_json(j);
    }
    if (ul_pwr_ctrl_common_v1530.is_present()) {
      j.write_fieldname("uplinkPowerControlCommon-v1530");
      ul_pwr_ctrl_common_v1530->to_json(j);
    }
    if (high_speed_cfg_v1530.is_present()) {
      j.write_fieldname("highSpeedConfig-v1530");
      high_speed_cfg_v1530->to_json(j);
    }
  }
  j.end_obj();
}

// SI-OrPSI-GERAN ::= CHOICE
void si_or_psi_geran_c::destroy_()
{
  switch (type_) {
    case types::si:
      c.destroy<sys_info_list_geran_l>();
      break;
    case types::psi:
      c.destroy<sys_info_list_geran_l>();
      break;
    default:
      break;
  }
}
void si_or_psi_geran_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::si:
      c.init<sys_info_list_geran_l>();
      break;
    case types::psi:
      c.init<sys_info_list_geran_l>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "si_or_psi_geran_c");
  }
}
si_or_psi_geran_c::si_or_psi_geran_c(const si_or_psi_geran_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::si:
      c.init(other.c.get<sys_info_list_geran_l>());
      break;
    case types::psi:
      c.init(other.c.get<sys_info_list_geran_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "si_or_psi_geran_c");
  }
}
si_or_psi_geran_c& si_or_psi_geran_c::operator=(const si_or_psi_geran_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::si:
      c.set(other.c.get<sys_info_list_geran_l>());
      break;
    case types::psi:
      c.set(other.c.get<sys_info_list_geran_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "si_or_psi_geran_c");
  }

  return *this;
}
void si_or_psi_geran_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::si:
      j.start_array("si");
      for (const auto& e1 : c.get<sys_info_list_geran_l>()) {
        j.write_str(e1.to_string());
      }
      j.end_array();
      break;
    case types::psi:
      j.start_array("psi");
      for (const auto& e1 : c.get<sys_info_list_geran_l>()) {
        j.write_str(e1.to_string());
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "si_or_psi_geran_c");
  }
  j.end_obj();
}
SRSASN_CODE si_or_psi_geran_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::si:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<sys_info_list_geran_l>(), 1, 10));
      break;
    case types::psi:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<sys_info_list_geran_l>(), 1, 10));
      break;
    default:
      log_invalid_choice_id(type_, "si_or_psi_geran_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE si_or_psi_geran_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::si:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<sys_info_list_geran_l>(), bref, 1, 10));
      break;
    case types::psi:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<sys_info_list_geran_l>(), bref, 1, 10));
      break;
    default:
      log_invalid_choice_id(type_, "si_or_psi_geran_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UECapabilityEnquiry-v1180-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_enquiry_v1180_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(requested_freq_bands_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (requested_freq_bands_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, requested_freq_bands_r11, 1, 16, integer_packer<uint16_t>(1, 256)));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_enquiry_v1180_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(requested_freq_bands_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (requested_freq_bands_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(requested_freq_bands_r11, bref, 1, 16, integer_packer<uint16_t>(1, 256)));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_enquiry_v1180_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (requested_freq_bands_r11_present) {
    j.start_array("requestedFrequencyBands-r11");
    for (const auto& e1 : requested_freq_bands_r11) {
      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();
}

// UEInformationRequest-v1020-IEs ::= SEQUENCE
SRSASN_CODE ue_info_request_v1020_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_report_req_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_request_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_report_req_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_request_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_report_req_r10_present) {
    j.write_str("logMeasReportReq-r10", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// AreaConfiguration-r10 ::= CHOICE
void area_cfg_r10_c::destroy_()
{
  switch (type_) {
    case types::cell_global_id_list_r10:
      c.destroy<cell_global_id_list_r10_l>();
      break;
    case types::tac_list_r10:
      c.destroy<tac_list_r10_l>();
      break;
    default:
      break;
  }
}
void area_cfg_r10_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cell_global_id_list_r10:
      c.init<cell_global_id_list_r10_l>();
      break;
    case types::tac_list_r10:
      c.init<tac_list_r10_l>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "area_cfg_r10_c");
  }
}
area_cfg_r10_c::area_cfg_r10_c(const area_cfg_r10_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cell_global_id_list_r10:
      c.init(other.c.get<cell_global_id_list_r10_l>());
      break;
    case types::tac_list_r10:
      c.init(other.c.get<tac_list_r10_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "area_cfg_r10_c");
  }
}
area_cfg_r10_c& area_cfg_r10_c::operator=(const area_cfg_r10_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cell_global_id_list_r10:
      c.set(other.c.get<cell_global_id_list_r10_l>());
      break;
    case types::tac_list_r10:
      c.set(other.c.get<tac_list_r10_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "area_cfg_r10_c");
  }

  return *this;
}
void area_cfg_r10_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cell_global_id_list_r10:
      j.start_array("cellGlobalIdList-r10");
      for (const auto& e1 : c.get<cell_global_id_list_r10_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::tac_list_r10:
      j.start_array("trackingAreaCodeList-r10");
      for (const auto& e1 : c.get<tac_list_r10_l>()) {
        j.write_str(e1.to_string());
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "area_cfg_r10_c");
  }
  j.end_obj();
}
SRSASN_CODE area_cfg_r10_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cell_global_id_list_r10:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<cell_global_id_list_r10_l>(), 1, 32));
      break;
    case types::tac_list_r10:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<tac_list_r10_l>(), 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "area_cfg_r10_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE area_cfg_r10_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cell_global_id_list_r10:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<cell_global_id_list_r10_l>(), bref, 1, 32));
      break;
    case types::tac_list_r10:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<tac_list_r10_l>(), bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "area_cfg_r10_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CSFBParametersResponseCDMA2000-v8a0-IEs ::= SEQUENCE
SRSASN_CODE csfb_params_resp_cdma2000_v8a0_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 csfb_params_resp_cdma2000_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));
  }

  return SRSASN_SUCCESS;
}
void csfb_params_resp_cdma2000_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();
}

// CellChangeOrder ::= SEQUENCE
SRSASN_CODE cell_change_order_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(t304.pack(bref));
  HANDLE_CODE(target_rat_type.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_change_order_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(t304.unpack(bref));
  HANDLE_CODE(target_rat_type.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_change_order_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("t304", t304.to_string());
  j.write_fieldname("targetRAT-Type");
  target_rat_type.to_json(j);
  j.end_obj();
}

void cell_change_order_s::target_rat_type_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("geran");
  j.start_obj();
  j.write_fieldname("physCellId");
  c.pci.to_json(j);
  j.write_fieldname("carrierFreq");
  c.carrier_freq.to_json(j);
  if (c.network_ctrl_order_present) {
    j.write_str("networkControlOrder", c.network_ctrl_order.to_string());
  }
  if (c.sys_info_present) {
    j.write_fieldname("systemInformation");
    c.sys_info.to_json(j);
  }
  j.end_obj();
  j.end_obj();
}
SRSASN_CODE cell_change_order_s::target_rat_type_c_::pack(bit_ref& bref) const
{
  pack_enum(bref, type());
  HANDLE_CODE(bref.pack(c.network_ctrl_order_present, 1));
  HANDLE_CODE(bref.pack(c.sys_info_present, 1));
  HANDLE_CODE(c.pci.pack(bref));
  HANDLE_CODE(c.carrier_freq.pack(bref));
  if (c.network_ctrl_order_present) {
    HANDLE_CODE(c.network_ctrl_order.pack(bref));
  }
  if (c.sys_info_present) {
    HANDLE_CODE(c.sys_info.pack(bref));
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_change_order_s::target_rat_type_c_::unpack(cbit_ref& bref)
{
  types e;
  unpack_enum(e, bref);
  if (e != type()) {
    log_invalid_choice_id(e, "cell_change_order_s::target_rat_type_c_");
    return SRSASN_ERROR_DECODE_FAIL;
  }
  HANDLE_CODE(bref.unpack(c.network_ctrl_order_present, 1));
  HANDLE_CODE(bref.unpack(c.sys_info_present, 1));
  HANDLE_CODE(c.pci.unpack(bref));
  HANDLE_CODE(c.carrier_freq.unpack(bref));
  if (c.network_ctrl_order_present) {
    HANDLE_CODE(c.network_ctrl_order.unpack(bref));
  }
  if (c.sys_info_present) {
    HANDLE_CODE(c.sys_info.unpack(bref));
  }
  return SRSASN_SUCCESS;
}

// CounterCheck-v8a0-IEs ::= SEQUENCE
SRSASN_CODE counter_check_v8a0_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 counter_check_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void counter_check_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// DLInformationTransfer-v8a0-IEs ::= SEQUENCE
SRSASN_CODE dl_info_transfer_v8a0_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 dl_info_transfer_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));
  }

  return SRSASN_SUCCESS;
}
void dl_info_transfer_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();
}

// E-CSFB-r9 ::= SEQUENCE
SRSASN_CODE e_csfb_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(msg_cont_cdma2000_minus1_xrtt_r9_present, 1));
  HANDLE_CODE(bref.pack(mob_cdma2000_hrpd_r9_present, 1));
  HANDLE_CODE(bref.pack(msg_cont_cdma2000_hrpd_r9_present, 1));
  HANDLE_CODE(bref.pack(redirect_carrier_cdma2000_hrpd_r9_present, 1));

  if (msg_cont_cdma2000_minus1_xrtt_r9_present) {
    HANDLE_CODE(msg_cont_cdma2000_minus1_xrtt_r9.pack(bref));
  }
  if (mob_cdma2000_hrpd_r9_present) {
    HANDLE_CODE(mob_cdma2000_hrpd_r9.pack(bref));
  }
  if (msg_cont_cdma2000_hrpd_r9_present) {
    HANDLE_CODE(msg_cont_cdma2000_hrpd_r9.pack(bref));
  }
  if (redirect_carrier_cdma2000_hrpd_r9_present) {
    HANDLE_CODE(redirect_carrier_cdma2000_hrpd_r9.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE e_csfb_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(msg_cont_cdma2000_minus1_xrtt_r9_present, 1));
  HANDLE_CODE(bref.unpack(mob_cdma2000_hrpd_r9_present, 1));
  HANDLE_CODE(bref.unpack(msg_cont_cdma2000_hrpd_r9_present, 1));
  HANDLE_CODE(bref.unpack(redirect_carrier_cdma2000_hrpd_r9_present, 1));

  if (msg_cont_cdma2000_minus1_xrtt_r9_present) {
    HANDLE_CODE(msg_cont_cdma2000_minus1_xrtt_r9.unpack(bref));
  }
  if (mob_cdma2000_hrpd_r9_present) {
    HANDLE_CODE(mob_cdma2000_hrpd_r9.unpack(bref));
  }
  if (msg_cont_cdma2000_hrpd_r9_present) {
    HANDLE_CODE(msg_cont_cdma2000_hrpd_r9.unpack(bref));
  }
  if (redirect_carrier_cdma2000_hrpd_r9_present) {
    HANDLE_CODE(redirect_carrier_cdma2000_hrpd_r9.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void e_csfb_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (msg_cont_cdma2000_minus1_xrtt_r9_present) {
    j.write_str("messageContCDMA2000-1XRTT-r9", msg_cont_cdma2000_minus1_xrtt_r9.to_string());
  }
  if (mob_cdma2000_hrpd_r9_present) {
    j.write_str("mobilityCDMA2000-HRPD-r9", mob_cdma2000_hrpd_r9.to_string());
  }
  if (msg_cont_cdma2000_hrpd_r9_present) {
    j.write_str("messageContCDMA2000-HRPD-r9", msg_cont_cdma2000_hrpd_r9.to_string());
  }
  if (redirect_carrier_cdma2000_hrpd_r9_present) {
    j.write_fieldname("redirectCarrierCDMA2000-HRPD-r9");
    redirect_carrier_cdma2000_hrpd_r9.to_json(j);
  }
  j.end_obj();
}

// Handover ::= SEQUENCE
SRSASN_CODE ho_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(nas_security_param_from_eutra_present, 1));
  HANDLE_CODE(bref.pack(sys_info_present, 1));

  HANDLE_CODE(target_rat_type.pack(bref));
  HANDLE_CODE(target_rat_msg_container.pack(bref));
  if (nas_security_param_from_eutra_present) {
    HANDLE_CODE(nas_security_param_from_eutra.pack(bref));
  }
  if (sys_info_present) {
    HANDLE_CODE(sys_info.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(nas_security_param_from_eutra_present, 1));
  HANDLE_CODE(bref.unpack(sys_info_present, 1));

  HANDLE_CODE(target_rat_type.unpack(bref));
  HANDLE_CODE(target_rat_msg_container.unpack(bref));
  if (nas_security_param_from_eutra_present) {
    HANDLE_CODE(nas_security_param_from_eutra.unpack(bref));
  }
  if (sys_info_present) {
    HANDLE_CODE(sys_info.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("targetRAT-Type", target_rat_type.to_string());
  j.write_str("targetRAT-MessageContainer", target_rat_msg_container.to_string());
  if (nas_security_param_from_eutra_present) {
    j.write_str("nas-SecurityParamFromEUTRA", nas_security_param_from_eutra.to_string());
  }
  if (sys_info_present) {
    j.write_fieldname("systemInformation");
    sys_info.to_json(j);
  }
  j.end_obj();
}

// HandoverFromEUTRAPreparationRequest-v890-IEs ::= SEQUENCE
SRSASN_CODE ho_from_eutra_prep_request_v890_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_from_eutra_prep_request_v890_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_from_eutra_prep_request_v890_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();
}

// LoggedMeasurementConfiguration-v1080-IEs ::= SEQUENCE
SRSASN_CODE logged_meas_cfg_v1080_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(late_non_crit_ext_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (late_non_crit_ext_r10_present) {
    HANDLE_CODE(late_non_crit_ext_r10.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE logged_meas_cfg_v1080_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(late_non_crit_ext_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (late_non_crit_ext_r10_present) {
    HANDLE_CODE(late_non_crit_ext_r10.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void logged_meas_cfg_v1080_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (late_non_crit_ext_r10_present) {
    j.write_str("lateNonCriticalExtension-r10", late_non_crit_ext_r10.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// MeasConfig ::= SEQUENCE
SRSASN_CODE meas_cfg_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_obj_to_rem_list_present, 1));
  HANDLE_CODE(bref.pack(meas_obj_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(report_cfg_to_rem_list_present, 1));
  HANDLE_CODE(bref.pack(report_cfg_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(meas_id_to_rem_list_present, 1));
  HANDLE_CODE(bref.pack(meas_id_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.pack(quant_cfg_present, 1));
  HANDLE_CODE(bref.pack(meas_gap_cfg_present, 1));
  HANDLE_CODE(bref.pack(s_measure_present, 1));
  HANDLE_CODE(bref.pack(pre_regist_info_hrpd_present, 1));
  HANDLE_CODE(bref.pack(speed_state_pars_present, 1));

  if (meas_obj_to_rem_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_obj_to_rem_list, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (meas_obj_to_add_mod_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_obj_to_add_mod_list, 1, 32));
  }
  if (report_cfg_to_rem_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, report_cfg_to_rem_list, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (report_cfg_to_add_mod_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, report_cfg_to_add_mod_list, 1, 32));
  }
  if (meas_id_to_rem_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_id_to_rem_list, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (meas_id_to_add_mod_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_id_to_add_mod_list, 1, 32));
  }
  if (quant_cfg_present) {
    HANDLE_CODE(quant_cfg.pack(bref));
  }
  if (meas_gap_cfg_present) {
    HANDLE_CODE(meas_gap_cfg.pack(bref));
  }
  if (s_measure_present) {
    HANDLE_CODE(pack_integer(bref, s_measure, (uint8_t)0u, (uint8_t)97u));
  }
  if (pre_regist_info_hrpd_present) {
    HANDLE_CODE(pre_regist_info_hrpd.pack(bref));
  }
  if (speed_state_pars_present) {
    HANDLE_CODE(speed_state_pars.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= meas_obj_to_add_mod_list_v9e0.is_present();
    group_flags[1] |= allow_interruptions_r11_present;
    group_flags[2] |= meas_scale_factor_r12.is_present();
    group_flags[2] |= meas_id_to_rem_list_ext_r12.is_present();
    group_flags[2] |= meas_id_to_add_mod_list_ext_r12.is_present();
    group_flags[2] |= meas_rsrq_on_all_symbols_r12_present;
    group_flags[3] |= meas_obj_to_rem_list_ext_r13.is_present();
    group_flags[3] |= meas_obj_to_add_mod_list_ext_r13.is_present();
    group_flags[3] |= meas_id_to_add_mod_list_v1310.is_present();
    group_flags[3] |= meas_id_to_add_mod_list_ext_v1310.is_present();
    group_flags[4] |= meas_gap_cfg_per_cc_list_r14.is_present();
    group_flags[4] |= meas_gap_sharing_cfg_r14.is_present();
    group_flags[5] |= fr1_gap_r15_present;
    group_flags[5] |= mgta_r15_present;
    group_flags[6] |= meas_gap_cfg_dense_prs_r15.is_present();
    group_flags[6] |= height_thresh_ref_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_obj_to_add_mod_list_v9e0.is_present(), 1));
      if (meas_obj_to_add_mod_list_v9e0.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_obj_to_add_mod_list_v9e0, 1, 32));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(allow_interruptions_r11_present, 1));
      if (allow_interruptions_r11_present) {
        HANDLE_CODE(bref.pack(allow_interruptions_r11, 1));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_scale_factor_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_id_to_rem_list_ext_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_id_to_add_mod_list_ext_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_rsrq_on_all_symbols_r12_present, 1));
      if (meas_scale_factor_r12.is_present()) {
        HANDLE_CODE(meas_scale_factor_r12->pack(bref));
      }
      if (meas_id_to_rem_list_ext_r12.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_id_to_rem_list_ext_r12, 1, 32, integer_packer<uint8_t>(33, 64)));
      }
      if (meas_id_to_add_mod_list_ext_r12.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_id_to_add_mod_list_ext_r12, 1, 32));
      }
      if (meas_rsrq_on_all_symbols_r12_present) {
        HANDLE_CODE(bref.pack(meas_rsrq_on_all_symbols_r12, 1));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_obj_to_rem_list_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_obj_to_add_mod_list_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_id_to_add_mod_list_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_id_to_add_mod_list_ext_v1310.is_present(), 1));
      if (meas_obj_to_rem_list_ext_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_obj_to_rem_list_ext_r13, 1, 32, integer_packer<uint8_t>(33, 64)));
      }
      if (meas_obj_to_add_mod_list_ext_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_obj_to_add_mod_list_ext_r13, 1, 32));
      }
      if (meas_id_to_add_mod_list_v1310.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_id_to_add_mod_list_v1310, 1, 32));
      }
      if (meas_id_to_add_mod_list_ext_v1310.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_id_to_add_mod_list_ext_v1310, 1, 32));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_gap_cfg_per_cc_list_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_gap_sharing_cfg_r14.is_present(), 1));
      if (meas_gap_cfg_per_cc_list_r14.is_present()) {
        HANDLE_CODE(meas_gap_cfg_per_cc_list_r14->pack(bref));
      }
      if (meas_gap_sharing_cfg_r14.is_present()) {
        HANDLE_CODE(meas_gap_sharing_cfg_r14->pack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(fr1_gap_r15_present, 1));
      HANDLE_CODE(bref.pack(mgta_r15_present, 1));
      if (fr1_gap_r15_present) {
        HANDLE_CODE(bref.pack(fr1_gap_r15, 1));
      }
      if (mgta_r15_present) {
        HANDLE_CODE(bref.pack(mgta_r15, 1));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_gap_cfg_dense_prs_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(height_thresh_ref_r15.is_present(), 1));
      if (meas_gap_cfg_dense_prs_r15.is_present()) {
        HANDLE_CODE(meas_gap_cfg_dense_prs_r15->pack(bref));
      }
      if (height_thresh_ref_r15.is_present()) {
        HANDLE_CODE(height_thresh_ref_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_cfg_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_obj_to_rem_list_present, 1));
  HANDLE_CODE(bref.unpack(meas_obj_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(report_cfg_to_rem_list_present, 1));
  HANDLE_CODE(bref.unpack(report_cfg_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(meas_id_to_rem_list_present, 1));
  HANDLE_CODE(bref.unpack(meas_id_to_add_mod_list_present, 1));
  HANDLE_CODE(bref.unpack(quant_cfg_present, 1));
  HANDLE_CODE(bref.unpack(meas_gap_cfg_present, 1));
  HANDLE_CODE(bref.unpack(s_measure_present, 1));
  HANDLE_CODE(bref.unpack(pre_regist_info_hrpd_present, 1));
  HANDLE_CODE(bref.unpack(speed_state_pars_present, 1));

  if (meas_obj_to_rem_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_obj_to_rem_list, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (meas_obj_to_add_mod_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_obj_to_add_mod_list, bref, 1, 32));
  }
  if (report_cfg_to_rem_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(report_cfg_to_rem_list, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (report_cfg_to_add_mod_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(report_cfg_to_add_mod_list, bref, 1, 32));
  }
  if (meas_id_to_rem_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_id_to_rem_list, bref, 1, 32, integer_packer<uint8_t>(1, 32)));
  }
  if (meas_id_to_add_mod_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_id_to_add_mod_list, bref, 1, 32));
  }
  if (quant_cfg_present) {
    HANDLE_CODE(quant_cfg.unpack(bref));
  }
  if (meas_gap_cfg_present) {
    HANDLE_CODE(meas_gap_cfg.unpack(bref));
  }
  if (s_measure_present) {
    HANDLE_CODE(unpack_integer(s_measure, bref, (uint8_t)0u, (uint8_t)97u));
  }
  if (pre_regist_info_hrpd_present) {
    HANDLE_CODE(pre_regist_info_hrpd.unpack(bref));
  }
  if (speed_state_pars_present) {
    HANDLE_CODE(speed_state_pars.unpack(bref));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(7);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_obj_to_add_mod_list_v9e0_present;
      HANDLE_CODE(bref.unpack(meas_obj_to_add_mod_list_v9e0_present, 1));
      meas_obj_to_add_mod_list_v9e0.set_present(meas_obj_to_add_mod_list_v9e0_present);
      if (meas_obj_to_add_mod_list_v9e0.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_obj_to_add_mod_list_v9e0, bref, 1, 32));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(allow_interruptions_r11_present, 1));
      if (allow_interruptions_r11_present) {
        HANDLE_CODE(bref.unpack(allow_interruptions_r11, 1));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_scale_factor_r12_present;
      HANDLE_CODE(bref.unpack(meas_scale_factor_r12_present, 1));
      meas_scale_factor_r12.set_present(meas_scale_factor_r12_present);
      bool meas_id_to_rem_list_ext_r12_present;
      HANDLE_CODE(bref.unpack(meas_id_to_rem_list_ext_r12_present, 1));
      meas_id_to_rem_list_ext_r12.set_present(meas_id_to_rem_list_ext_r12_present);
      bool meas_id_to_add_mod_list_ext_r12_present;
      HANDLE_CODE(bref.unpack(meas_id_to_add_mod_list_ext_r12_present, 1));
      meas_id_to_add_mod_list_ext_r12.set_present(meas_id_to_add_mod_list_ext_r12_present);
      HANDLE_CODE(bref.unpack(meas_rsrq_on_all_symbols_r12_present, 1));
      if (meas_scale_factor_r12.is_present()) {
        HANDLE_CODE(meas_scale_factor_r12->unpack(bref));
      }
      if (meas_id_to_rem_list_ext_r12.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_id_to_rem_list_ext_r12, bref, 1, 32, integer_packer<uint8_t>(33, 64)));
      }
      if (meas_id_to_add_mod_list_ext_r12.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_id_to_add_mod_list_ext_r12, bref, 1, 32));
      }
      if (meas_rsrq_on_all_symbols_r12_present) {
        HANDLE_CODE(bref.unpack(meas_rsrq_on_all_symbols_r12, 1));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_obj_to_rem_list_ext_r13_present;
      HANDLE_CODE(bref.unpack(meas_obj_to_rem_list_ext_r13_present, 1));
      meas_obj_to_rem_list_ext_r13.set_present(meas_obj_to_rem_list_ext_r13_present);
      bool meas_obj_to_add_mod_list_ext_r13_present;
      HANDLE_CODE(bref.unpack(meas_obj_to_add_mod_list_ext_r13_present, 1));
      meas_obj_to_add_mod_list_ext_r13.set_present(meas_obj_to_add_mod_list_ext_r13_present);
      bool meas_id_to_add_mod_list_v1310_present;
      HANDLE_CODE(bref.unpack(meas_id_to_add_mod_list_v1310_present, 1));
      meas_id_to_add_mod_list_v1310.set_present(meas_id_to_add_mod_list_v1310_present);
      bool meas_id_to_add_mod_list_ext_v1310_present;
      HANDLE_CODE(bref.unpack(meas_id_to_add_mod_list_ext_v1310_present, 1));
      meas_id_to_add_mod_list_ext_v1310.set_present(meas_id_to_add_mod_list_ext_v1310_present);
      if (meas_obj_to_rem_list_ext_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_obj_to_rem_list_ext_r13, bref, 1, 32, integer_packer<uint8_t>(33, 64)));
      }
      if (meas_obj_to_add_mod_list_ext_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_obj_to_add_mod_list_ext_r13, bref, 1, 32));
      }
      if (meas_id_to_add_mod_list_v1310.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_id_to_add_mod_list_v1310, bref, 1, 32));
      }
      if (meas_id_to_add_mod_list_ext_v1310.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_id_to_add_mod_list_ext_v1310, bref, 1, 32));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_gap_cfg_per_cc_list_r14_present;
      HANDLE_CODE(bref.unpack(meas_gap_cfg_per_cc_list_r14_present, 1));
      meas_gap_cfg_per_cc_list_r14.set_present(meas_gap_cfg_per_cc_list_r14_present);
      bool meas_gap_sharing_cfg_r14_present;
      HANDLE_CODE(bref.unpack(meas_gap_sharing_cfg_r14_present, 1));
      meas_gap_sharing_cfg_r14.set_present(meas_gap_sharing_cfg_r14_present);
      if (meas_gap_cfg_per_cc_list_r14.is_present()) {
        HANDLE_CODE(meas_gap_cfg_per_cc_list_r14->unpack(bref));
      }
      if (meas_gap_sharing_cfg_r14.is_present()) {
        HANDLE_CODE(meas_gap_sharing_cfg_r14->unpack(bref));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(fr1_gap_r15_present, 1));
      HANDLE_CODE(bref.unpack(mgta_r15_present, 1));
      if (fr1_gap_r15_present) {
        HANDLE_CODE(bref.unpack(fr1_gap_r15, 1));
      }
      if (mgta_r15_present) {
        HANDLE_CODE(bref.unpack(mgta_r15, 1));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_gap_cfg_dense_prs_r15_present;
      HANDLE_CODE(bref.unpack(meas_gap_cfg_dense_prs_r15_present, 1));
      meas_gap_cfg_dense_prs_r15.set_present(meas_gap_cfg_dense_prs_r15_present);
      bool height_thresh_ref_r15_present;
      HANDLE_CODE(bref.unpack(height_thresh_ref_r15_present, 1));
      height_thresh_ref_r15.set_present(height_thresh_ref_r15_present);
      if (meas_gap_cfg_dense_prs_r15.is_present()) {
        HANDLE_CODE(meas_gap_cfg_dense_prs_r15->unpack(bref));
      }
      if (height_thresh_ref_r15.is_present()) {
        HANDLE_CODE(height_thresh_ref_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_obj_to_rem_list_present) {
    j.start_array("measObjectToRemoveList");
    for (const auto& e1 : meas_obj_to_rem_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (meas_obj_to_add_mod_list_present) {
    j.start_array("measObjectToAddModList");
    for (const auto& e1 : meas_obj_to_add_mod_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (report_cfg_to_rem_list_present) {
    j.start_array("reportConfigToRemoveList");
    for (const auto& e1 : report_cfg_to_rem_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (report_cfg_to_add_mod_list_present) {
    j.start_array("reportConfigToAddModList");
    for (const auto& e1 : report_cfg_to_add_mod_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_id_to_rem_list_present) {
    j.start_array("measIdToRemoveList");
    for (const auto& e1 : meas_id_to_rem_list) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (meas_id_to_add_mod_list_present) {
    j.start_array("measIdToAddModList");
    for (const auto& e1 : meas_id_to_add_mod_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (quant_cfg_present) {
    j.write_fieldname("quantityConfig");
    quant_cfg.to_json(j);
  }
  if (meas_gap_cfg_present) {
    j.write_fieldname("measGapConfig");
    meas_gap_cfg.to_json(j);
  }
  if (s_measure_present) {
    j.write_int("s-Measure", s_measure);
  }
  if (pre_regist_info_hrpd_present) {
    j.write_fieldname("preRegistrationInfoHRPD");
    pre_regist_info_hrpd.to_json(j);
  }
  if (speed_state_pars_present) {
    j.write_fieldname("speedStatePars");
    speed_state_pars.to_json(j);
  }
  if (ext) {
    if (meas_obj_to_add_mod_list_v9e0.is_present()) {
      j.start_array("measObjectToAddModList-v9e0");
      for (const auto& e1 : *meas_obj_to_add_mod_list_v9e0) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (allow_interruptions_r11_present) {
      j.write_bool("allowInterruptions-r11", allow_interruptions_r11);
    }
    if (meas_scale_factor_r12.is_present()) {
      j.write_fieldname("measScaleFactor-r12");
      meas_scale_factor_r12->to_json(j);
    }
    if (meas_id_to_rem_list_ext_r12.is_present()) {
      j.start_array("measIdToRemoveListExt-r12");
      for (const auto& e1 : *meas_id_to_rem_list_ext_r12) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (meas_id_to_add_mod_list_ext_r12.is_present()) {
      j.start_array("measIdToAddModListExt-r12");
      for (const auto& e1 : *meas_id_to_add_mod_list_ext_r12) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_rsrq_on_all_symbols_r12_present) {
      j.write_bool("measRSRQ-OnAllSymbols-r12", meas_rsrq_on_all_symbols_r12);
    }
    if (meas_obj_to_rem_list_ext_r13.is_present()) {
      j.start_array("measObjectToRemoveListExt-r13");
      for (const auto& e1 : *meas_obj_to_rem_list_ext_r13) {
        j.write_int(e1);
      }
      j.end_array();
    }
    if (meas_obj_to_add_mod_list_ext_r13.is_present()) {
      j.start_array("measObjectToAddModListExt-r13");
      for (const auto& e1 : *meas_obj_to_add_mod_list_ext_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_id_to_add_mod_list_v1310.is_present()) {
      j.start_array("measIdToAddModList-v1310");
      for (const auto& e1 : *meas_id_to_add_mod_list_v1310) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_id_to_add_mod_list_ext_v1310.is_present()) {
      j.start_array("measIdToAddModListExt-v1310");
      for (const auto& e1 : *meas_id_to_add_mod_list_ext_v1310) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_gap_cfg_per_cc_list_r14.is_present()) {
      j.write_fieldname("measGapConfigPerCC-List-r14");
      meas_gap_cfg_per_cc_list_r14->to_json(j);
    }
    if (meas_gap_sharing_cfg_r14.is_present()) {
      j.write_fieldname("measGapSharingConfig-r14");
      meas_gap_sharing_cfg_r14->to_json(j);
    }
    if (fr1_gap_r15_present) {
      j.write_bool("fr1-Gap-r15", fr1_gap_r15);
    }
    if (mgta_r15_present) {
      j.write_bool("mgta-r15", mgta_r15);
    }
    if (meas_gap_cfg_dense_prs_r15.is_present()) {
      j.write_fieldname("measGapConfigDensePRS-r15");
      meas_gap_cfg_dense_prs_r15->to_json(j);
    }
    if (height_thresh_ref_r15.is_present()) {
      j.write_fieldname("heightThreshRef-r15");
      height_thresh_ref_r15->to_json(j);
    }
  }
  j.end_obj();
}

void meas_cfg_s::speed_state_pars_c_::set(types::options e)
{
  type_ = e;
}
void meas_cfg_s::speed_state_pars_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("mobilityStateParameters");
      c.mob_state_params.to_json(j);
      j.write_fieldname("timeToTrigger-SF");
      c.time_to_trigger_sf.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::speed_state_pars_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_cfg_s::speed_state_pars_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.mob_state_params.pack(bref));
      HANDLE_CODE(c.time_to_trigger_sf.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::speed_state_pars_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_cfg_s::speed_state_pars_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.mob_state_params.unpack(bref));
      HANDLE_CODE(c.time_to_trigger_sf.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::speed_state_pars_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_cfg_s::meas_scale_factor_r12_c_::set(types::options e)
{
  type_ = e;
}
void meas_cfg_s::meas_scale_factor_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_str("setup", c.to_string());
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::meas_scale_factor_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_cfg_s::meas_scale_factor_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::meas_scale_factor_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_cfg_s::meas_scale_factor_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::meas_scale_factor_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_cfg_s::height_thresh_ref_r15_c_::set(types::options e)
{
  type_ = e;
}
void meas_cfg_s::height_thresh_ref_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      j.write_int("setup", c);
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::height_thresh_ref_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_cfg_s::height_thresh_ref_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(pack_integer(bref, c, (uint8_t)0u, (uint8_t)31u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::height_thresh_ref_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_cfg_s::height_thresh_ref_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(unpack_integer(c, bref, (uint8_t)0u, (uint8_t)31u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_cfg_s::height_thresh_ref_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MobilityControlInfo ::= SEQUENCE
SRSASN_CODE mob_ctrl_info_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(carrier_freq_present, 1));
  HANDLE_CODE(bref.pack(carrier_bw_present, 1));
  HANDLE_CODE(bref.pack(add_spec_emission_present, 1));
  HANDLE_CODE(bref.pack(rach_cfg_ded_present, 1));

  HANDLE_CODE(pack_integer(bref, target_pci, (uint16_t)0u, (uint16_t)503u));
  if (carrier_freq_present) {
    HANDLE_CODE(carrier_freq.pack(bref));
  }
  if (carrier_bw_present) {
    HANDLE_CODE(carrier_bw.pack(bref));
  }
  if (add_spec_emission_present) {
    HANDLE_CODE(pack_integer(bref, add_spec_emission, (uint8_t)1u, (uint8_t)32u));
  }
  HANDLE_CODE(t304.pack(bref));
  HANDLE_CODE(new_ue_id.pack(bref));
  HANDLE_CODE(rr_cfg_common.pack(bref));
  if (rach_cfg_ded_present) {
    HANDLE_CODE(rach_cfg_ded.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= carrier_freq_v9e0.is_present();
    group_flags[1] |= drb_continue_rohc_r11_present;
    group_flags[2] |= mob_ctrl_info_v2x_r14.is_present();
    group_flags[2] |= ho_without_wt_change_r14_present;
    group_flags[2] |= make_before_break_r14_present;
    group_flags[2] |= rach_skip_r14.is_present();
    group_flags[2] |= same_sfn_ind_r14_present;
    group_flags[3] |= mib_repeat_status_r14_present;
    group_flags[3] |= sched_info_sib1_br_r14_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(carrier_freq_v9e0.is_present(), 1));
      if (carrier_freq_v9e0.is_present()) {
        HANDLE_CODE(carrier_freq_v9e0->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(drb_continue_rohc_r11_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mob_ctrl_info_v2x_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(ho_without_wt_change_r14_present, 1));
      HANDLE_CODE(bref.pack(make_before_break_r14_present, 1));
      HANDLE_CODE(bref.pack(rach_skip_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(same_sfn_ind_r14_present, 1));
      if (mob_ctrl_info_v2x_r14.is_present()) {
        HANDLE_CODE(mob_ctrl_info_v2x_r14->pack(bref));
      }
      if (ho_without_wt_change_r14_present) {
        HANDLE_CODE(ho_without_wt_change_r14.pack(bref));
      }
      if (rach_skip_r14.is_present()) {
        HANDLE_CODE(rach_skip_r14->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mib_repeat_status_r14_present, 1));
      HANDLE_CODE(bref.pack(sched_info_sib1_br_r14_present, 1));
      if (mib_repeat_status_r14_present) {
        HANDLE_CODE(bref.pack(mib_repeat_status_r14, 1));
      }
      if (sched_info_sib1_br_r14_present) {
        HANDLE_CODE(pack_integer(bref, sched_info_sib1_br_r14, (uint8_t)0u, (uint8_t)31u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_ctrl_info_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(carrier_freq_present, 1));
  HANDLE_CODE(bref.unpack(carrier_bw_present, 1));
  HANDLE_CODE(bref.unpack(add_spec_emission_present, 1));
  HANDLE_CODE(bref.unpack(rach_cfg_ded_present, 1));

  HANDLE_CODE(unpack_integer(target_pci, bref, (uint16_t)0u, (uint16_t)503u));
  if (carrier_freq_present) {
    HANDLE_CODE(carrier_freq.unpack(bref));
  }
  if (carrier_bw_present) {
    HANDLE_CODE(carrier_bw.unpack(bref));
  }
  if (add_spec_emission_present) {
    HANDLE_CODE(unpack_integer(add_spec_emission, bref, (uint8_t)1u, (uint8_t)32u));
  }
  HANDLE_CODE(t304.unpack(bref));
  HANDLE_CODE(new_ue_id.unpack(bref));
  HANDLE_CODE(rr_cfg_common.unpack(bref));
  if (rach_cfg_ded_present) {
    HANDLE_CODE(rach_cfg_ded.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);

      bool carrier_freq_v9e0_present;
      HANDLE_CODE(bref.unpack(carrier_freq_v9e0_present, 1));
      carrier_freq_v9e0.set_present(carrier_freq_v9e0_present);
      if (carrier_freq_v9e0.is_present()) {
        HANDLE_CODE(carrier_freq_v9e0->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(drb_continue_rohc_r11_present, 1));
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool mob_ctrl_info_v2x_r14_present;
      HANDLE_CODE(bref.unpack(mob_ctrl_info_v2x_r14_present, 1));
      mob_ctrl_info_v2x_r14.set_present(mob_ctrl_info_v2x_r14_present);
      HANDLE_CODE(bref.unpack(ho_without_wt_change_r14_present, 1));
      HANDLE_CODE(bref.unpack(make_before_break_r14_present, 1));
      bool rach_skip_r14_present;
      HANDLE_CODE(bref.unpack(rach_skip_r14_present, 1));
      rach_skip_r14.set_present(rach_skip_r14_present);
      HANDLE_CODE(bref.unpack(same_sfn_ind_r14_present, 1));
      if (mob_ctrl_info_v2x_r14.is_present()) {
        HANDLE_CODE(mob_ctrl_info_v2x_r14->unpack(bref));
      }
      if (ho_without_wt_change_r14_present) {
        HANDLE_CODE(ho_without_wt_change_r14.unpack(bref));
      }
      if (rach_skip_r14.is_present()) {
        HANDLE_CODE(rach_skip_r14->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(mib_repeat_status_r14_present, 1));
      HANDLE_CODE(bref.unpack(sched_info_sib1_br_r14_present, 1));
      if (mib_repeat_status_r14_present) {
        HANDLE_CODE(bref.unpack(mib_repeat_status_r14, 1));
      }
      if (sched_info_sib1_br_r14_present) {
        HANDLE_CODE(unpack_integer(sched_info_sib1_br_r14, bref, (uint8_t)0u, (uint8_t)31u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void mob_ctrl_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("targetPhysCellId", target_pci);
  if (carrier_freq_present) {
    j.write_fieldname("carrierFreq");
    carrier_freq.to_json(j);
  }
  if (carrier_bw_present) {
    j.write_fieldname("carrierBandwidth");
    carrier_bw.to_json(j);
  }
  if (add_spec_emission_present) {
    j.write_int("additionalSpectrumEmission", add_spec_emission);
  }
  j.write_str("t304", t304.to_string());
  j.write_str("newUE-Identity", new_ue_id.to_string());
  j.write_fieldname("radioResourceConfigCommon");
  rr_cfg_common.to_json(j);
  if (rach_cfg_ded_present) {
    j.write_fieldname("rach-ConfigDedicated");
    rach_cfg_ded.to_json(j);
  }
  if (ext) {
    if (carrier_freq_v9e0.is_present()) {
      j.write_fieldname("carrierFreq-v9e0");
      carrier_freq_v9e0->to_json(j);
    }
    if (drb_continue_rohc_r11_present) {
      j.write_str("drb-ContinueROHC-r11", "true");
    }
    if (mob_ctrl_info_v2x_r14.is_present()) {
      j.write_fieldname("mobilityControlInfoV2X-r14");
      mob_ctrl_info_v2x_r14->to_json(j);
    }
    if (ho_without_wt_change_r14_present) {
      j.write_str("handoverWithoutWT-Change-r14", ho_without_wt_change_r14.to_string());
    }
    if (make_before_break_r14_present) {
      j.write_str("makeBeforeBreak-r14", "true");
    }
    if (rach_skip_r14.is_present()) {
      j.write_fieldname("rach-Skip-r14");
      rach_skip_r14->to_json(j);
    }
    if (same_sfn_ind_r14_present) {
      j.write_str("sameSFN-Indication-r14", "true");
    }
    if (mib_repeat_status_r14_present) {
      j.write_bool("mib-RepetitionStatus-r14", mib_repeat_status_r14);
    }
    if (sched_info_sib1_br_r14_present) {
      j.write_int("schedulingInfoSIB1-BR-r14", sched_info_sib1_br_r14);
    }
  }
  j.end_obj();
}

// MobilityFromEUTRACommand-v8a0-IEs ::= SEQUENCE
SRSASN_CODE mob_from_eutra_cmd_v8a0_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 mob_from_eutra_cmd_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mob_from_eutra_cmd_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// MobilityFromEUTRACommand-v930-IEs ::= SEQUENCE
SRSASN_CODE mob_from_eutra_cmd_v930_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 mob_from_eutra_cmd_v930_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 mob_from_eutra_cmd_v930_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();
}

// RN-SubframeConfig-r10 ::= SEQUENCE
SRSASN_CODE rn_sf_cfg_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(sf_cfg_pattern_r10_present, 1));
  HANDLE_CODE(bref.pack(rpdcch_cfg_r10_present, 1));

  if (sf_cfg_pattern_r10_present) {
    HANDLE_CODE(sf_cfg_pattern_r10.pack(bref));
  }
  if (rpdcch_cfg_r10_present) {
    bref.pack(rpdcch_cfg_r10.ext, 1);
    HANDLE_CODE(rpdcch_cfg_r10.res_alloc_type_r10.pack(bref));
    HANDLE_CODE(rpdcch_cfg_r10.res_block_assign_r10.pack(bref));
    HANDLE_CODE(rpdcch_cfg_r10.demod_rs_r10.pack(bref));
    HANDLE_CODE(pack_integer(bref, rpdcch_cfg_r10.pdsch_start_r10, (uint8_t)1u, (uint8_t)3u));
    HANDLE_CODE(rpdcch_cfg_r10.pucch_cfg_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sf_cfg_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(sf_cfg_pattern_r10_present, 1));
  HANDLE_CODE(bref.unpack(rpdcch_cfg_r10_present, 1));

  if (sf_cfg_pattern_r10_present) {
    HANDLE_CODE(sf_cfg_pattern_r10.unpack(bref));
  }
  if (rpdcch_cfg_r10_present) {
    bref.unpack(rpdcch_cfg_r10.ext, 1);
    HANDLE_CODE(rpdcch_cfg_r10.res_alloc_type_r10.unpack(bref));
    HANDLE_CODE(rpdcch_cfg_r10.res_block_assign_r10.unpack(bref));
    HANDLE_CODE(rpdcch_cfg_r10.demod_rs_r10.unpack(bref));
    HANDLE_CODE(unpack_integer(rpdcch_cfg_r10.pdsch_start_r10, bref, (uint8_t)1u, (uint8_t)3u));
    HANDLE_CODE(rpdcch_cfg_r10.pucch_cfg_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rn_sf_cfg_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sf_cfg_pattern_r10_present) {
    j.write_fieldname("subframeConfigPattern-r10");
    sf_cfg_pattern_r10.to_json(j);
  }
  if (rpdcch_cfg_r10_present) {
    j.write_fieldname("rpdcch-Config-r10");
    j.start_obj();
    j.write_str("resourceAllocationType-r10", rpdcch_cfg_r10.res_alloc_type_r10.to_string());
    j.write_fieldname("resourceBlockAssignment-r10");
    rpdcch_cfg_r10.res_block_assign_r10.to_json(j);
    j.write_fieldname("demodulationRS-r10");
    rpdcch_cfg_r10.demod_rs_r10.to_json(j);
    j.write_int("pdsch-Start-r10", rpdcch_cfg_r10.pdsch_start_r10);
    j.write_fieldname("pucch-Config-r10");
    rpdcch_cfg_r10.pucch_cfg_r10.to_json(j);
    j.end_obj();
  }
  j.end_obj();
}

void rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_::destroy_()
{
  switch (type_) {
    case types::sf_cfg_pattern_fdd_r10:
      c.destroy<fixed_bitstring<8> >();
      break;
    default:
      break;
  }
}
void rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sf_cfg_pattern_fdd_r10:
      c.init<fixed_bitstring<8> >();
      break;
    case types::sf_cfg_pattern_tdd_r10:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_");
  }
}
rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_::sf_cfg_pattern_r10_c_(const rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf_cfg_pattern_fdd_r10:
      c.init(other.c.get<fixed_bitstring<8> >());
      break;
    case types::sf_cfg_pattern_tdd_r10:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_");
  }
}
rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_& rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_::
                                        operator=(const rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf_cfg_pattern_fdd_r10:
      c.set(other.c.get<fixed_bitstring<8> >());
      break;
    case types::sf_cfg_pattern_tdd_r10:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_");
  }

  return *this;
}
void rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf_cfg_pattern_fdd_r10:
      j.write_str("subframeConfigPatternFDD-r10", c.get<fixed_bitstring<8> >().to_string());
      break;
    case types::sf_cfg_pattern_tdd_r10:
      j.write_int("subframeConfigPatternTDD-r10", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf_cfg_pattern_fdd_r10:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().pack(bref));
      break;
    case types::sf_cfg_pattern_tdd_r10:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)31u));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf_cfg_pattern_fdd_r10:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().unpack(bref));
      break;
    case types::sf_cfg_pattern_tdd_r10:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)31u));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::sf_cfg_pattern_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::destroy_()
{
  switch (type_) {
    case types::type01_r10:
      c.destroy<type01_r10_c_>();
      break;
    case types::type2_r10:
      c.destroy<type2_r10_c_>();
      break;
    default:
      break;
  }
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::type01_r10:
      c.init<type01_r10_c_>();
      break;
    case types::type2_r10:
      c.init<type2_r10_c_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::res_block_assign_r10_c_(
    const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::type01_r10:
      c.init(other.c.get<type01_r10_c_>());
      break;
    case types::type2_r10:
      c.init(other.c.get<type2_r10_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_&
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::
operator=(const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::type01_r10:
      c.set(other.c.get<type01_r10_c_>());
      break;
    case types::type2_r10:
      c.set(other.c.get<type2_r10_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_");
  }

  return *this;
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::type01_r10:
      j.write_fieldname("type01-r10");
      c.get<type01_r10_c_>().to_json(j);
      break;
    case types::type2_r10:
      j.write_fieldname("type2-r10");
      c.get<type2_r10_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::type01_r10:
      HANDLE_CODE(c.get<type01_r10_c_>().pack(bref));
      break;
    case types::type2_r10:
      HANDLE_CODE(c.get<type2_r10_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::type01_r10:
      HANDLE_CODE(c.get<type01_r10_c_>().unpack(bref));
      break;
    case types::type2_r10:
      HANDLE_CODE(c.get<type2_r10_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_::destroy_()
{
  switch (type_) {
    case types::nrb6_r10:
      c.destroy<fixed_bitstring<6> >();
      break;
    case types::nrb15_r10:
      c.destroy<fixed_bitstring<8> >();
      break;
    case types::nrb25_r10:
      c.destroy<fixed_bitstring<13> >();
      break;
    case types::nrb50_r10:
      c.destroy<fixed_bitstring<17> >();
      break;
    case types::nrb75_r10:
      c.destroy<fixed_bitstring<19> >();
      break;
    case types::nrb100_r10:
      c.destroy<fixed_bitstring<25> >();
      break;
    default:
      break;
  }
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::nrb6_r10:
      c.init<fixed_bitstring<6> >();
      break;
    case types::nrb15_r10:
      c.init<fixed_bitstring<8> >();
      break;
    case types::nrb25_r10:
      c.init<fixed_bitstring<13> >();
      break;
    case types::nrb50_r10:
      c.init<fixed_bitstring<17> >();
      break;
    case types::nrb75_r10:
      c.init<fixed_bitstring<19> >();
      break;
    case types::nrb100_r10:
      c.init<fixed_bitstring<25> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_::type01_r10_c_(
    const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::nrb6_r10:
      c.init(other.c.get<fixed_bitstring<6> >());
      break;
    case types::nrb15_r10:
      c.init(other.c.get<fixed_bitstring<8> >());
      break;
    case types::nrb25_r10:
      c.init(other.c.get<fixed_bitstring<13> >());
      break;
    case types::nrb50_r10:
      c.init(other.c.get<fixed_bitstring<17> >());
      break;
    case types::nrb75_r10:
      c.init(other.c.get<fixed_bitstring<19> >());
      break;
    case types::nrb100_r10:
      c.init(other.c.get<fixed_bitstring<25> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_&
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_::
operator=(const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::nrb6_r10:
      c.set(other.c.get<fixed_bitstring<6> >());
      break;
    case types::nrb15_r10:
      c.set(other.c.get<fixed_bitstring<8> >());
      break;
    case types::nrb25_r10:
      c.set(other.c.get<fixed_bitstring<13> >());
      break;
    case types::nrb50_r10:
      c.set(other.c.get<fixed_bitstring<17> >());
      break;
    case types::nrb75_r10:
      c.set(other.c.get<fixed_bitstring<19> >());
      break;
    case types::nrb100_r10:
      c.set(other.c.get<fixed_bitstring<25> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_");
  }

  return *this;
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::nrb6_r10:
      j.write_str("nrb6-r10", c.get<fixed_bitstring<6> >().to_string());
      break;
    case types::nrb15_r10:
      j.write_str("nrb15-r10", c.get<fixed_bitstring<8> >().to_string());
      break;
    case types::nrb25_r10:
      j.write_str("nrb25-r10", c.get<fixed_bitstring<13> >().to_string());
      break;
    case types::nrb50_r10:
      j.write_str("nrb50-r10", c.get<fixed_bitstring<17> >().to_string());
      break;
    case types::nrb75_r10:
      j.write_str("nrb75-r10", c.get<fixed_bitstring<19> >().to_string());
      break;
    case types::nrb100_r10:
      j.write_str("nrb100-r10", c.get<fixed_bitstring<25> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::nrb6_r10:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().pack(bref));
      break;
    case types::nrb15_r10:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().pack(bref));
      break;
    case types::nrb25_r10:
      HANDLE_CODE(c.get<fixed_bitstring<13> >().pack(bref));
      break;
    case types::nrb50_r10:
      HANDLE_CODE(c.get<fixed_bitstring<17> >().pack(bref));
      break;
    case types::nrb75_r10:
      HANDLE_CODE(c.get<fixed_bitstring<19> >().pack(bref));
      break;
    case types::nrb100_r10:
      HANDLE_CODE(c.get<fixed_bitstring<25> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::nrb6_r10:
      HANDLE_CODE(c.get<fixed_bitstring<6> >().unpack(bref));
      break;
    case types::nrb15_r10:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().unpack(bref));
      break;
    case types::nrb25_r10:
      HANDLE_CODE(c.get<fixed_bitstring<13> >().unpack(bref));
      break;
    case types::nrb50_r10:
      HANDLE_CODE(c.get<fixed_bitstring<17> >().unpack(bref));
      break;
    case types::nrb75_r10:
      HANDLE_CODE(c.get<fixed_bitstring<19> >().unpack(bref));
      break;
    case types::nrb100_r10:
      HANDLE_CODE(c.get<fixed_bitstring<25> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type01_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_::destroy_()
{
  switch (type_) {
    case types::nrb6_r10:
      c.destroy<fixed_bitstring<5> >();
      break;
    case types::nrb15_r10:
      c.destroy<fixed_bitstring<7> >();
      break;
    case types::nrb25_r10:
      c.destroy<fixed_bitstring<9> >();
      break;
    case types::nrb50_r10:
      c.destroy<fixed_bitstring<11> >();
      break;
    case types::nrb75_r10:
      c.destroy<fixed_bitstring<12> >();
      break;
    case types::nrb100_r10:
      c.destroy<fixed_bitstring<13> >();
      break;
    default:
      break;
  }
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::nrb6_r10:
      c.init<fixed_bitstring<5> >();
      break;
    case types::nrb15_r10:
      c.init<fixed_bitstring<7> >();
      break;
    case types::nrb25_r10:
      c.init<fixed_bitstring<9> >();
      break;
    case types::nrb50_r10:
      c.init<fixed_bitstring<11> >();
      break;
    case types::nrb75_r10:
      c.init<fixed_bitstring<12> >();
      break;
    case types::nrb100_r10:
      c.init<fixed_bitstring<13> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_::type2_r10_c_(
    const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::nrb6_r10:
      c.init(other.c.get<fixed_bitstring<5> >());
      break;
    case types::nrb15_r10:
      c.init(other.c.get<fixed_bitstring<7> >());
      break;
    case types::nrb25_r10:
      c.init(other.c.get<fixed_bitstring<9> >());
      break;
    case types::nrb50_r10:
      c.init(other.c.get<fixed_bitstring<11> >());
      break;
    case types::nrb75_r10:
      c.init(other.c.get<fixed_bitstring<12> >());
      break;
    case types::nrb100_r10:
      c.init(other.c.get<fixed_bitstring<13> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_&
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_::
operator=(const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::nrb6_r10:
      c.set(other.c.get<fixed_bitstring<5> >());
      break;
    case types::nrb15_r10:
      c.set(other.c.get<fixed_bitstring<7> >());
      break;
    case types::nrb25_r10:
      c.set(other.c.get<fixed_bitstring<9> >());
      break;
    case types::nrb50_r10:
      c.set(other.c.get<fixed_bitstring<11> >());
      break;
    case types::nrb75_r10:
      c.set(other.c.get<fixed_bitstring<12> >());
      break;
    case types::nrb100_r10:
      c.set(other.c.get<fixed_bitstring<13> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_");
  }

  return *this;
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::nrb6_r10:
      j.write_str("nrb6-r10", c.get<fixed_bitstring<5> >().to_string());
      break;
    case types::nrb15_r10:
      j.write_str("nrb15-r10", c.get<fixed_bitstring<7> >().to_string());
      break;
    case types::nrb25_r10:
      j.write_str("nrb25-r10", c.get<fixed_bitstring<9> >().to_string());
      break;
    case types::nrb50_r10:
      j.write_str("nrb50-r10", c.get<fixed_bitstring<11> >().to_string());
      break;
    case types::nrb75_r10:
      j.write_str("nrb75-r10", c.get<fixed_bitstring<12> >().to_string());
      break;
    case types::nrb100_r10:
      j.write_str("nrb100-r10", c.get<fixed_bitstring<13> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::nrb6_r10:
      HANDLE_CODE(c.get<fixed_bitstring<5> >().pack(bref));
      break;
    case types::nrb15_r10:
      HANDLE_CODE(c.get<fixed_bitstring<7> >().pack(bref));
      break;
    case types::nrb25_r10:
      HANDLE_CODE(c.get<fixed_bitstring<9> >().pack(bref));
      break;
    case types::nrb50_r10:
      HANDLE_CODE(c.get<fixed_bitstring<11> >().pack(bref));
      break;
    case types::nrb75_r10:
      HANDLE_CODE(c.get<fixed_bitstring<12> >().pack(bref));
      break;
    case types::nrb100_r10:
      HANDLE_CODE(c.get<fixed_bitstring<13> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::nrb6_r10:
      HANDLE_CODE(c.get<fixed_bitstring<5> >().unpack(bref));
      break;
    case types::nrb15_r10:
      HANDLE_CODE(c.get<fixed_bitstring<7> >().unpack(bref));
      break;
    case types::nrb25_r10:
      HANDLE_CODE(c.get<fixed_bitstring<9> >().unpack(bref));
      break;
    case types::nrb50_r10:
      HANDLE_CODE(c.get<fixed_bitstring<11> >().unpack(bref));
      break;
    case types::nrb75_r10:
      HANDLE_CODE(c.get<fixed_bitstring<12> >().unpack(bref));
      break;
    case types::nrb100_r10:
      HANDLE_CODE(c.get<fixed_bitstring<13> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::res_block_assign_r10_c_::type2_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  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<no_interleaving_r10_e_>());
      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<no_interleaving_r10_e_>());
      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();
  switch (type_) {
    case types::interleaving_r10:
      break;
    case types::no_interleaving_r10:
      j.write_str("noInterleaving-r10", c.get<no_interleaving_r10_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interleaving_r10:
      break;
    case types::no_interleaving_r10:
      HANDLE_CODE(c.get<no_interleaving_r10_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interleaving_r10:
      break;
    case types::no_interleaving_r10:
      HANDLE_CODE(c.get<no_interleaving_r10_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::demod_rs_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::destroy_()
{
  switch (type_) {
    case types::tdd:
      c.destroy<tdd_c_>();
      break;
    case types::fdd:
      c.destroy<fdd_s_>();
      break;
    default:
      break;
  }
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::tdd:
      c.init<tdd_c_>();
      break;
    case types::fdd:
      c.init<fdd_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::pucch_cfg_r10_c_(
    const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::tdd:
      c.init(other.c.get<tdd_c_>());
      break;
    case types::fdd:
      c.init(other.c.get<fdd_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_& rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::
                                                      operator=(const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::tdd:
      c.set(other.c.get<tdd_c_>());
      break;
    case types::fdd:
      c.set(other.c.get<fdd_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_");
  }

  return *this;
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::tdd:
      j.write_fieldname("tdd");
      c.get<tdd_c_>().to_json(j);
      break;
    case types::fdd:
      j.write_fieldname("fdd");
      j.start_obj();
      j.write_int("n1PUCCH-AN-P0-r10", c.get<fdd_s_>().n1_pucch_an_p0_r10);
      if (c.get<fdd_s_>().n1_pucch_an_p1_r10_present) {
        j.write_int("n1PUCCH-AN-P1-r10", c.get<fdd_s_>().n1_pucch_an_p1_r10);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::tdd:
      HANDLE_CODE(c.get<tdd_c_>().pack(bref));
      break;
    case types::fdd:
      HANDLE_CODE(bref.pack(c.get<fdd_s_>().n1_pucch_an_p1_r10_present, 1));
      HANDLE_CODE(pack_integer(bref, c.get<fdd_s_>().n1_pucch_an_p0_r10, (uint16_t)0u, (uint16_t)2047u));
      if (c.get<fdd_s_>().n1_pucch_an_p1_r10_present) {
        HANDLE_CODE(pack_integer(bref, c.get<fdd_s_>().n1_pucch_an_p1_r10, (uint16_t)0u, (uint16_t)2047u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::tdd:
      HANDLE_CODE(c.get<tdd_c_>().unpack(bref));
      break;
    case types::fdd:
      HANDLE_CODE(bref.unpack(c.get<fdd_s_>().n1_pucch_an_p1_r10_present, 1));
      HANDLE_CODE(unpack_integer(c.get<fdd_s_>().n1_pucch_an_p0_r10, bref, (uint16_t)0u, (uint16_t)2047u));
      if (c.get<fdd_s_>().n1_pucch_an_p1_r10_present) {
        HANDLE_CODE(unpack_integer(c.get<fdd_s_>().n1_pucch_an_p1_r10, bref, (uint16_t)0u, (uint16_t)2047u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_::destroy_()
{
  switch (type_) {
    case types::ch_sel_mux_bundling:
      c.destroy<ch_sel_mux_bundling_s_>();
      break;
    case types::fallback_for_format3:
      c.destroy<fallback_for_format3_s_>();
      break;
    default:
      break;
  }
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ch_sel_mux_bundling:
      c.init<ch_sel_mux_bundling_s_>();
      break;
    case types::fallback_for_format3:
      c.init<fallback_for_format3_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_::tdd_c_(
    const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ch_sel_mux_bundling:
      c.init(other.c.get<ch_sel_mux_bundling_s_>());
      break;
    case types::fallback_for_format3:
      c.init(other.c.get<fallback_for_format3_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_");
  }
}
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_&
rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_::
operator=(const rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ch_sel_mux_bundling:
      c.set(other.c.get<ch_sel_mux_bundling_s_>());
      break;
    case types::fallback_for_format3:
      c.set(other.c.get<fallback_for_format3_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_");
  }

  return *this;
}
void rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ch_sel_mux_bundling:
      j.write_fieldname("channelSelectionMultiplexingBundling");
      j.start_obj();
      j.start_array("n1PUCCH-AN-List-r10");
      for (const auto& e1 : c.get<ch_sel_mux_bundling_s_>().n1_pucch_an_list_r10) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      break;
    case types::fallback_for_format3:
      j.write_fieldname("fallbackForFormat3");
      j.start_obj();
      j.write_int("n1PUCCH-AN-P0-r10", c.get<fallback_for_format3_s_>().n1_pucch_an_p0_r10);
      if (c.get<fallback_for_format3_s_>().n1_pucch_an_p1_r10_present) {
        j.write_int("n1PUCCH-AN-P1-r10", c.get<fallback_for_format3_s_>().n1_pucch_an_p1_r10);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ch_sel_mux_bundling:
      HANDLE_CODE(pack_dyn_seq_of(
          bref, c.get<ch_sel_mux_bundling_s_>().n1_pucch_an_list_r10, 1, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    case types::fallback_for_format3:
      HANDLE_CODE(bref.pack(c.get<fallback_for_format3_s_>().n1_pucch_an_p1_r10_present, 1));
      HANDLE_CODE(
          pack_integer(bref, c.get<fallback_for_format3_s_>().n1_pucch_an_p0_r10, (uint16_t)0u, (uint16_t)2047u));
      if (c.get<fallback_for_format3_s_>().n1_pucch_an_p1_r10_present) {
        HANDLE_CODE(
            pack_integer(bref, c.get<fallback_for_format3_s_>().n1_pucch_an_p1_r10, (uint16_t)0u, (uint16_t)2047u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ch_sel_mux_bundling:
      HANDLE_CODE(unpack_dyn_seq_of(
          c.get<ch_sel_mux_bundling_s_>().n1_pucch_an_list_r10, bref, 1, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    case types::fallback_for_format3:
      HANDLE_CODE(bref.unpack(c.get<fallback_for_format3_s_>().n1_pucch_an_p1_r10_present, 1));
      HANDLE_CODE(
          unpack_integer(c.get<fallback_for_format3_s_>().n1_pucch_an_p0_r10, bref, (uint16_t)0u, (uint16_t)2047u));
      if (c.get<fallback_for_format3_s_>().n1_pucch_an_p1_r10_present) {
        HANDLE_CODE(
            unpack_integer(c.get<fallback_for_format3_s_>().n1_pucch_an_p1_r10, bref, (uint16_t)0u, (uint16_t)2047u));
      }
      break;
    default:
      log_invalid_choice_id(type_, "rn_sf_cfg_r10_s::rpdcch_cfg_r10_s_::pucch_cfg_r10_c_::tdd_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RN-SystemInfo-r10 ::= SEQUENCE
SRSASN_CODE rn_sys_info_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(sib_type1_r10_present, 1));
  HANDLE_CODE(bref.pack(sib_type2_r10_present, 1));

  if (sib_type1_r10_present) {
    HANDLE_CODE(sib_type1_r10.pack(bref));
  }
  if (sib_type2_r10_present) {
    HANDLE_CODE(sib_type2_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_sys_info_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(sib_type1_r10_present, 1));
  HANDLE_CODE(bref.unpack(sib_type2_r10_present, 1));

  if (sib_type1_r10_present) {
    HANDLE_CODE(sib_type1_r10.unpack(bref));
  }
  if (sib_type2_r10_present) {
    HANDLE_CODE(sib_type2_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rn_sys_info_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sib_type1_r10_present) {
    j.write_str("systemInformationBlockType1-r10", sib_type1_r10.to_string());
  }
  if (sib_type2_r10_present) {
    j.write_fieldname("systemInformationBlockType2-r10");
    sib_type2_r10.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReconfiguration-v890-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_v890_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_v890_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_v890_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();
}

// RRCConnectionRelease-v890-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_release_v890_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_release_v890_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_release_v890_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();
}

// RRCConnectionResume-v1430-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(other_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(rrc_conn_resume_v1510_ies_present, 1));

  if (other_cfg_r14_present) {
    HANDLE_CODE(other_cfg_r14.pack(bref));
  }
  if (rrc_conn_resume_v1510_ies_present) {
    HANDLE_CODE(rrc_conn_resume_v1510_ies.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(other_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(rrc_conn_resume_v1510_ies_present, 1));

  if (other_cfg_r14_present) {
    HANDLE_CODE(other_cfg_r14.unpack(bref));
  }
  if (rrc_conn_resume_v1510_ies_present) {
    HANDLE_CODE(rrc_conn_resume_v1510_ies.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_resume_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (other_cfg_r14_present) {
    j.write_fieldname("otherConfig-r14");
    other_cfg_r14.to_json(j);
  }
  if (rrc_conn_resume_v1510_ies_present) {
    j.write_fieldname("rrcConnectionResume-v1510-IEs");
    rrc_conn_resume_v1510_ies.to_json(j);
  }
  j.end_obj();
}

// RedirectedCarrierInfo ::= CHOICE
void redirected_carrier_info_c::destroy_()
{
  switch (type_) {
    case types::geran:
      c.destroy<carrier_freqs_geran_s>();
      break;
    case types::cdma2000_hrpd:
      c.destroy<carrier_freq_cdma2000_s>();
      break;
    case types::cdma2000_minus1x_rtt:
      c.destroy<carrier_freq_cdma2000_s>();
      break;
    case types::utra_tdd_r10:
      c.destroy<carrier_freq_list_utra_tdd_r10_l>();
      break;
    case types::nr_r15:
      c.destroy<carrier_info_nr_r15_s>();
      break;
    default:
      break;
  }
}
void redirected_carrier_info_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::eutra:
      break;
    case types::geran:
      c.init<carrier_freqs_geran_s>();
      break;
    case types::utra_fdd:
      break;
    case types::utra_tdd:
      break;
    case types::cdma2000_hrpd:
      c.init<carrier_freq_cdma2000_s>();
      break;
    case types::cdma2000_minus1x_rtt:
      c.init<carrier_freq_cdma2000_s>();
      break;
    case types::utra_tdd_r10:
      c.init<carrier_freq_list_utra_tdd_r10_l>();
      break;
    case types::nr_r15:
      c.init<carrier_info_nr_r15_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_c");
  }
}
redirected_carrier_info_c::redirected_carrier_info_c(const redirected_carrier_info_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::eutra:
      c.init(other.c.get<uint32_t>());
      break;
    case types::geran:
      c.init(other.c.get<carrier_freqs_geran_s>());
      break;
    case types::utra_fdd:
      c.init(other.c.get<uint16_t>());
      break;
    case types::utra_tdd:
      c.init(other.c.get<uint16_t>());
      break;
    case types::cdma2000_hrpd:
      c.init(other.c.get<carrier_freq_cdma2000_s>());
      break;
    case types::cdma2000_minus1x_rtt:
      c.init(other.c.get<carrier_freq_cdma2000_s>());
      break;
    case types::utra_tdd_r10:
      c.init(other.c.get<carrier_freq_list_utra_tdd_r10_l>());
      break;
    case types::nr_r15:
      c.init(other.c.get<carrier_info_nr_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_c");
  }
}
redirected_carrier_info_c& redirected_carrier_info_c::operator=(const redirected_carrier_info_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::eutra:
      c.set(other.c.get<uint32_t>());
      break;
    case types::geran:
      c.set(other.c.get<carrier_freqs_geran_s>());
      break;
    case types::utra_fdd:
      c.set(other.c.get<uint16_t>());
      break;
    case types::utra_tdd:
      c.set(other.c.get<uint16_t>());
      break;
    case types::cdma2000_hrpd:
      c.set(other.c.get<carrier_freq_cdma2000_s>());
      break;
    case types::cdma2000_minus1x_rtt:
      c.set(other.c.get<carrier_freq_cdma2000_s>());
      break;
    case types::utra_tdd_r10:
      c.set(other.c.get<carrier_freq_list_utra_tdd_r10_l>());
      break;
    case types::nr_r15:
      c.set(other.c.get<carrier_info_nr_r15_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_c");
  }

  return *this;
}
void redirected_carrier_info_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::eutra:
      j.write_int("eutra", c.get<uint32_t>());
      break;
    case types::geran:
      j.write_fieldname("geran");
      c.get<carrier_freqs_geran_s>().to_json(j);
      break;
    case types::utra_fdd:
      j.write_int("utra-FDD", c.get<uint16_t>());
      break;
    case types::utra_tdd:
      j.write_int("utra-TDD", c.get<uint16_t>());
      break;
    case types::cdma2000_hrpd:
      j.write_fieldname("cdma2000-HRPD");
      c.get<carrier_freq_cdma2000_s>().to_json(j);
      break;
    case types::cdma2000_minus1x_rtt:
      j.write_fieldname("cdma2000-1xRTT");
      c.get<carrier_freq_cdma2000_s>().to_json(j);
      break;
    case types::utra_tdd_r10:
      j.start_array("utra-TDD-r10");
      for (const auto& e1 : c.get<carrier_freq_list_utra_tdd_r10_l>()) {
        j.write_int(e1);
      }
      j.end_array();
      break;
    case types::nr_r15:
      j.write_fieldname("nr-r15");
      c.get<carrier_info_nr_r15_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_c");
  }
  j.end_obj();
}
SRSASN_CODE redirected_carrier_info_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::eutra:
      HANDLE_CODE(pack_integer(bref, c.get<uint32_t>(), (uint32_t)0u, (uint32_t)65535u));
      break;
    case types::geran:
      HANDLE_CODE(c.get<carrier_freqs_geran_s>().pack(bref));
      break;
    case types::utra_fdd:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)16383u));
      break;
    case types::utra_tdd:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)16383u));
      break;
    case types::cdma2000_hrpd:
      HANDLE_CODE(c.get<carrier_freq_cdma2000_s>().pack(bref));
      break;
    case types::cdma2000_minus1x_rtt:
      HANDLE_CODE(c.get<carrier_freq_cdma2000_s>().pack(bref));
      break;
    case types::utra_tdd_r10: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(
          pack_dyn_seq_of(bref, c.get<carrier_freq_list_utra_tdd_r10_l>(), 1, 6, integer_packer<uint16_t>(0, 16383)));
    } break;
    case types::nr_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<carrier_info_nr_r15_s>().pack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE redirected_carrier_info_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::eutra:
      HANDLE_CODE(unpack_integer(c.get<uint32_t>(), bref, (uint32_t)0u, (uint32_t)65535u));
      break;
    case types::geran:
      HANDLE_CODE(c.get<carrier_freqs_geran_s>().unpack(bref));
      break;
    case types::utra_fdd:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)16383u));
      break;
    case types::utra_tdd:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)16383u));
      break;
    case types::cdma2000_hrpd:
      HANDLE_CODE(c.get<carrier_freq_cdma2000_s>().unpack(bref));
      break;
    case types::cdma2000_minus1x_rtt:
      HANDLE_CODE(c.get<carrier_freq_cdma2000_s>().unpack(bref));
      break;
    case types::utra_tdd_r10: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(
          unpack_dyn_seq_of(c.get<carrier_freq_list_utra_tdd_r10_l>(), bref, 1, 6, integer_packer<uint16_t>(0, 16383)));
    } break;
    case types::nr_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<carrier_info_nr_r15_s>().unpack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "redirected_carrier_info_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SecurityConfigHO ::= SEQUENCE
SRSASN_CODE security_cfg_ho_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(handov_type.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE security_cfg_ho_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(handov_type.unpack(bref));

  return SRSASN_SUCCESS;
}
void security_cfg_ho_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("handoverType");
  handov_type.to_json(j);
  j.end_obj();
}

void security_cfg_ho_s::handov_type_c_::destroy_()
{
  switch (type_) {
    case types::intra_lte:
      c.destroy<intra_lte_s_>();
      break;
    case types::inter_rat:
      c.destroy<inter_rat_s_>();
      break;
    default:
      break;
  }
}
void security_cfg_ho_s::handov_type_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::intra_lte:
      c.init<intra_lte_s_>();
      break;
    case types::inter_rat:
      c.init<inter_rat_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_s::handov_type_c_");
  }
}
security_cfg_ho_s::handov_type_c_::handov_type_c_(const security_cfg_ho_s::handov_type_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::intra_lte:
      c.init(other.c.get<intra_lte_s_>());
      break;
    case types::inter_rat:
      c.init(other.c.get<inter_rat_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_s::handov_type_c_");
  }
}
security_cfg_ho_s::handov_type_c_& security_cfg_ho_s::handov_type_c_::
                                   operator=(const security_cfg_ho_s::handov_type_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::intra_lte:
      c.set(other.c.get<intra_lte_s_>());
      break;
    case types::inter_rat:
      c.set(other.c.get<inter_rat_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_s::handov_type_c_");
  }

  return *this;
}
void security_cfg_ho_s::handov_type_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::intra_lte:
      j.write_fieldname("intraLTE");
      j.start_obj();
      if (c.get<intra_lte_s_>().security_algorithm_cfg_present) {
        j.write_fieldname("securityAlgorithmConfig");
        c.get<intra_lte_s_>().security_algorithm_cfg.to_json(j);
      }
      j.write_bool("keyChangeIndicator", c.get<intra_lte_s_>().key_change_ind);
      j.write_int("nextHopChainingCount", c.get<intra_lte_s_>().next_hop_chaining_count);
      j.end_obj();
      break;
    case types::inter_rat:
      j.write_fieldname("interRAT");
      j.start_obj();
      j.write_fieldname("securityAlgorithmConfig");
      c.get<inter_rat_s_>().security_algorithm_cfg.to_json(j);
      j.write_str("nas-SecurityParamToEUTRA", c.get<inter_rat_s_>().nas_security_param_to_eutra.to_string());
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_s::handov_type_c_");
  }
  j.end_obj();
}
SRSASN_CODE security_cfg_ho_s::handov_type_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::intra_lte:
      HANDLE_CODE(bref.pack(c.get<intra_lte_s_>().security_algorithm_cfg_present, 1));
      if (c.get<intra_lte_s_>().security_algorithm_cfg_present) {
        HANDLE_CODE(c.get<intra_lte_s_>().security_algorithm_cfg.pack(bref));
      }
      HANDLE_CODE(bref.pack(c.get<intra_lte_s_>().key_change_ind, 1));
      HANDLE_CODE(pack_integer(bref, c.get<intra_lte_s_>().next_hop_chaining_count, (uint8_t)0u, (uint8_t)7u));
      break;
    case types::inter_rat:
      HANDLE_CODE(c.get<inter_rat_s_>().security_algorithm_cfg.pack(bref));
      HANDLE_CODE(c.get<inter_rat_s_>().nas_security_param_to_eutra.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_s::handov_type_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE security_cfg_ho_s::handov_type_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::intra_lte:
      HANDLE_CODE(bref.unpack(c.get<intra_lte_s_>().security_algorithm_cfg_present, 1));
      if (c.get<intra_lte_s_>().security_algorithm_cfg_present) {
        HANDLE_CODE(c.get<intra_lte_s_>().security_algorithm_cfg.unpack(bref));
      }
      HANDLE_CODE(bref.unpack(c.get<intra_lte_s_>().key_change_ind, 1));
      HANDLE_CODE(unpack_integer(c.get<intra_lte_s_>().next_hop_chaining_count, bref, (uint8_t)0u, (uint8_t)7u));
      break;
    case types::inter_rat:
      HANDLE_CODE(c.get<inter_rat_s_>().security_algorithm_cfg.unpack(bref));
      HANDLE_CODE(c.get<inter_rat_s_>().nas_security_param_to_eutra.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "security_cfg_ho_s::handov_type_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SecurityConfigSMC ::= SEQUENCE
SRSASN_CODE security_cfg_smc_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(security_algorithm_cfg.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE security_cfg_smc_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(security_algorithm_cfg.unpack(bref));

  return SRSASN_SUCCESS;
}
void security_cfg_smc_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("securityAlgorithmConfig");
  security_algorithm_cfg.to_json(j);
  j.end_obj();
}

// SecurityModeCommand-v8a0-IEs ::= SEQUENCE
SRSASN_CODE security_mode_cmd_v8a0_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 security_mode_cmd_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));
  }

  return SRSASN_SUCCESS;
}
void security_mode_cmd_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();
}

// TraceReference-r10 ::= SEQUENCE
SRSASN_CODE trace_ref_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(plmn_id_r10.pack(bref));
  HANDLE_CODE(trace_id_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE trace_ref_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(plmn_id_r10.unpack(bref));
  HANDLE_CODE(trace_id_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void trace_ref_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("plmn-Identity-r10");
  plmn_id_r10.to_json(j);
  j.write_str("traceId-r10", trace_id_r10.to_string());
  j.end_obj();
}

// UECapabilityEnquiry-v8a0-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_enquiry_v8a0_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_cap_enquiry_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_enquiry_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UEInformationRequest-v930-IEs ::= SEQUENCE
SRSASN_CODE ue_info_request_v930_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_info_request_v930_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_info_request_v930_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();
}

// CSFBParametersResponseCDMA2000-r8-IEs ::= SEQUENCE
SRSASN_CODE csfb_params_resp_cdma2000_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(rand.pack(bref));
  HANDLE_CODE(mob_params.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csfb_params_resp_cdma2000_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(rand.unpack(bref));
  HANDLE_CODE(mob_params.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csfb_params_resp_cdma2000_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("rand", rand.to_string());
  j.write_str("mobilityParameters", mob_params.to_string());
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// CounterCheck-r8-IEs ::= SEQUENCE
SRSASN_CODE counter_check_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, drb_count_msb_info_list, 1, 11));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE counter_check_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(drb_count_msb_info_list, bref, 1, 11));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void counter_check_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("drb-CountMSB-InfoList");
  for (const auto& e1 : drb_count_msb_info_list) {
    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();
}

// DLInformationTransfer-r15-IEs ::= SEQUENCE
SRSASN_CODE dl_info_transfer_r15_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ded_info_type_r15_present, 1));
  HANDLE_CODE(bref.pack(time_ref_info_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ded_info_type_r15_present) {
    HANDLE_CODE(ded_info_type_r15.pack(bref));
  }
  if (time_ref_info_r15_present) {
    HANDLE_CODE(time_ref_info_r15.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_info_transfer_r15_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ded_info_type_r15_present, 1));
  HANDLE_CODE(bref.unpack(time_ref_info_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ded_info_type_r15_present) {
    HANDLE_CODE(ded_info_type_r15.unpack(bref));
  }
  if (time_ref_info_r15_present) {
    HANDLE_CODE(time_ref_info_r15.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void dl_info_transfer_r15_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ded_info_type_r15_present) {
    j.write_fieldname("dedicatedInfoType-r15");
    ded_info_type_r15.to_json(j);
  }
  if (time_ref_info_r15_present) {
    j.write_fieldname("timeReferenceInfo-r15");
    time_ref_info_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void dl_info_transfer_r15_ies_s::ded_info_type_r15_c_::destroy_()
{
  switch (type_) {
    case types::ded_info_nas_r15:
      c.destroy<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_minus1_xrtt_r15:
      c.destroy<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_hrpd_r15:
      c.destroy<dyn_octstring>();
      break;
    default:
      break;
  }
}
void dl_info_transfer_r15_ies_s::ded_info_type_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ded_info_nas_r15:
      c.init<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_minus1_xrtt_r15:
      c.init<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_hrpd_r15:
      c.init<dyn_octstring>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r15_ies_s::ded_info_type_r15_c_");
  }
}
dl_info_transfer_r15_ies_s::ded_info_type_r15_c_::ded_info_type_r15_c_(
    const dl_info_transfer_r15_ies_s::ded_info_type_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ded_info_nas_r15:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_minus1_xrtt_r15:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_hrpd_r15:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r15_ies_s::ded_info_type_r15_c_");
  }
}
dl_info_transfer_r15_ies_s::ded_info_type_r15_c_& dl_info_transfer_r15_ies_s::ded_info_type_r15_c_::
                                                  operator=(const dl_info_transfer_r15_ies_s::ded_info_type_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ded_info_nas_r15:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_minus1_xrtt_r15:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_hrpd_r15:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r15_ies_s::ded_info_type_r15_c_");
  }

  return *this;
}
void dl_info_transfer_r15_ies_s::ded_info_type_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ded_info_nas_r15:
      j.write_str("dedicatedInfoNAS-r15", c.get<dyn_octstring>().to_string());
      break;
    case types::ded_info_cdma2000_minus1_xrtt_r15:
      j.write_str("dedicatedInfoCDMA2000-1XRTT-r15", c.get<dyn_octstring>().to_string());
      break;
    case types::ded_info_cdma2000_hrpd_r15:
      j.write_str("dedicatedInfoCDMA2000-HRPD-r15", c.get<dyn_octstring>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r15_ies_s::ded_info_type_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE dl_info_transfer_r15_ies_s::ded_info_type_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ded_info_nas_r15:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::ded_info_cdma2000_minus1_xrtt_r15:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::ded_info_cdma2000_hrpd_r15:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r15_ies_s::ded_info_type_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_info_transfer_r15_ies_s::ded_info_type_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ded_info_nas_r15:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::ded_info_cdma2000_minus1_xrtt_r15:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::ded_info_cdma2000_hrpd_r15:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r15_ies_s::ded_info_type_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DLInformationTransfer-r8-IEs ::= SEQUENCE
SRSASN_CODE dl_info_transfer_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(ded_info_type.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_info_transfer_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(ded_info_type.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void dl_info_transfer_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("dedicatedInfoType");
  ded_info_type.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void dl_info_transfer_r8_ies_s::ded_info_type_c_::destroy_()
{
  switch (type_) {
    case types::ded_info_nas:
      c.destroy<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      c.destroy<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_hrpd:
      c.destroy<dyn_octstring>();
      break;
    default:
      break;
  }
}
void dl_info_transfer_r8_ies_s::ded_info_type_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ded_info_nas:
      c.init<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      c.init<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_hrpd:
      c.init<dyn_octstring>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r8_ies_s::ded_info_type_c_");
  }
}
dl_info_transfer_r8_ies_s::ded_info_type_c_::ded_info_type_c_(const dl_info_transfer_r8_ies_s::ded_info_type_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ded_info_nas:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_hrpd:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r8_ies_s::ded_info_type_c_");
  }
}
dl_info_transfer_r8_ies_s::ded_info_type_c_& dl_info_transfer_r8_ies_s::ded_info_type_c_::
                                             operator=(const dl_info_transfer_r8_ies_s::ded_info_type_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ded_info_nas:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_hrpd:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r8_ies_s::ded_info_type_c_");
  }

  return *this;
}
void dl_info_transfer_r8_ies_s::ded_info_type_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ded_info_nas:
      j.write_str("dedicatedInfoNAS", c.get<dyn_octstring>().to_string());
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      j.write_str("dedicatedInfoCDMA2000-1XRTT", c.get<dyn_octstring>().to_string());
      break;
    case types::ded_info_cdma2000_hrpd:
      j.write_str("dedicatedInfoCDMA2000-HRPD", c.get<dyn_octstring>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r8_ies_s::ded_info_type_c_");
  }
  j.end_obj();
}
SRSASN_CODE dl_info_transfer_r8_ies_s::ded_info_type_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ded_info_nas:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::ded_info_cdma2000_hrpd:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r8_ies_s::ded_info_type_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_info_transfer_r8_ies_s::ded_info_type_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ded_info_nas:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::ded_info_cdma2000_hrpd:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_r8_ies_s::ded_info_type_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// HandoverFromEUTRAPreparationRequest-r8-IEs ::= SEQUENCE
SRSASN_CODE ho_from_eutra_prep_request_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rand_present, 1));
  HANDLE_CODE(bref.pack(mob_params_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(cdma2000_type.pack(bref));
  if (rand_present) {
    HANDLE_CODE(rand.pack(bref));
  }
  if (mob_params_present) {
    HANDLE_CODE(mob_params.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_from_eutra_prep_request_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rand_present, 1));
  HANDLE_CODE(bref.unpack(mob_params_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(cdma2000_type.unpack(bref));
  if (rand_present) {
    HANDLE_CODE(rand.unpack(bref));
  }
  if (mob_params_present) {
    HANDLE_CODE(mob_params.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_from_eutra_prep_request_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cdma2000-Type", cdma2000_type.to_string());
  if (rand_present) {
    j.write_str("rand", rand.to_string());
  }
  if (mob_params_present) {
    j.write_str("mobilityParameters", mob_params.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// LoggedMeasurementConfiguration-r10-IEs ::= SEQUENCE
SRSASN_CODE logged_meas_cfg_r10_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(area_cfg_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(trace_ref_r10.pack(bref));
  HANDLE_CODE(trace_recording_session_ref_r10.pack(bref));
  HANDLE_CODE(tce_id_r10.pack(bref));
  HANDLE_CODE(absolute_time_info_r10.pack(bref));
  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.pack(bref));
  }
  HANDLE_CODE(logging_dur_r10.pack(bref));
  HANDLE_CODE(logging_interv_r10.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE logged_meas_cfg_r10_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(area_cfg_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(trace_ref_r10.unpack(bref));
  HANDLE_CODE(trace_recording_session_ref_r10.unpack(bref));
  HANDLE_CODE(tce_id_r10.unpack(bref));
  HANDLE_CODE(absolute_time_info_r10.unpack(bref));
  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.unpack(bref));
  }
  HANDLE_CODE(logging_dur_r10.unpack(bref));
  HANDLE_CODE(logging_interv_r10.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void logged_meas_cfg_r10_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("traceReference-r10");
  trace_ref_r10.to_json(j);
  j.write_str("traceRecordingSessionRef-r10", trace_recording_session_ref_r10.to_string());
  j.write_str("tce-Id-r10", tce_id_r10.to_string());
  j.write_str("absoluteTimeInfo-r10", absolute_time_info_r10.to_string());
  if (area_cfg_r10_present) {
    j.write_fieldname("areaConfiguration-r10");
    area_cfg_r10.to_json(j);
  }
  j.write_str("loggingDuration-r10", logging_dur_r10.to_string());
  j.write_str("loggingInterval-r10", logging_interv_r10.to_string());
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// MobilityFromEUTRACommand-r8-IEs ::= SEQUENCE
SRSASN_CODE mob_from_eutra_cmd_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.pack(cs_fallback_ind, 1));
  HANDLE_CODE(purpose.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.unpack(cs_fallback_ind, 1));
  HANDLE_CODE(purpose.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mob_from_eutra_cmd_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("cs-FallbackIndicator", cs_fallback_ind);
  j.write_fieldname("purpose");
  purpose.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void mob_from_eutra_cmd_r8_ies_s::purpose_c_::destroy_()
{
  switch (type_) {
    case types::ho:
      c.destroy<ho_s>();
      break;
    case types::cell_change_order:
      c.destroy<cell_change_order_s>();
      break;
    default:
      break;
  }
}
void mob_from_eutra_cmd_r8_ies_s::purpose_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ho:
      c.init<ho_s>();
      break;
    case types::cell_change_order:
      c.init<cell_change_order_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r8_ies_s::purpose_c_");
  }
}
mob_from_eutra_cmd_r8_ies_s::purpose_c_::purpose_c_(const mob_from_eutra_cmd_r8_ies_s::purpose_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ho:
      c.init(other.c.get<ho_s>());
      break;
    case types::cell_change_order:
      c.init(other.c.get<cell_change_order_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r8_ies_s::purpose_c_");
  }
}
mob_from_eutra_cmd_r8_ies_s::purpose_c_& mob_from_eutra_cmd_r8_ies_s::purpose_c_::
                                         operator=(const mob_from_eutra_cmd_r8_ies_s::purpose_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ho:
      c.set(other.c.get<ho_s>());
      break;
    case types::cell_change_order:
      c.set(other.c.get<cell_change_order_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r8_ies_s::purpose_c_");
  }

  return *this;
}
void mob_from_eutra_cmd_r8_ies_s::purpose_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ho:
      j.write_fieldname("handover");
      c.get<ho_s>().to_json(j);
      break;
    case types::cell_change_order:
      j.write_fieldname("cellChangeOrder");
      c.get<cell_change_order_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r8_ies_s::purpose_c_");
  }
  j.end_obj();
}
SRSASN_CODE mob_from_eutra_cmd_r8_ies_s::purpose_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ho:
      HANDLE_CODE(c.get<ho_s>().pack(bref));
      break;
    case types::cell_change_order:
      HANDLE_CODE(c.get<cell_change_order_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r8_ies_s::purpose_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_r8_ies_s::purpose_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ho:
      HANDLE_CODE(c.get<ho_s>().unpack(bref));
      break;
    case types::cell_change_order:
      HANDLE_CODE(c.get<cell_change_order_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r8_ies_s::purpose_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MobilityFromEUTRACommand-r9-IEs ::= SEQUENCE
SRSASN_CODE mob_from_eutra_cmd_r9_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.pack(cs_fallback_ind, 1));
  HANDLE_CODE(purpose.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_r9_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.unpack(cs_fallback_ind, 1));
  HANDLE_CODE(purpose.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mob_from_eutra_cmd_r9_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("cs-FallbackIndicator", cs_fallback_ind);
  j.write_fieldname("purpose");
  purpose.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void mob_from_eutra_cmd_r9_ies_s::purpose_c_::destroy_()
{
  switch (type_) {
    case types::ho:
      c.destroy<ho_s>();
      break;
    case types::cell_change_order:
      c.destroy<cell_change_order_s>();
      break;
    case types::e_csfb_r9:
      c.destroy<e_csfb_r9_s>();
      break;
    default:
      break;
  }
}
void mob_from_eutra_cmd_r9_ies_s::purpose_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ho:
      c.init<ho_s>();
      break;
    case types::cell_change_order:
      c.init<cell_change_order_s>();
      break;
    case types::e_csfb_r9:
      c.init<e_csfb_r9_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r9_ies_s::purpose_c_");
  }
}
mob_from_eutra_cmd_r9_ies_s::purpose_c_::purpose_c_(const mob_from_eutra_cmd_r9_ies_s::purpose_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ho:
      c.init(other.c.get<ho_s>());
      break;
    case types::cell_change_order:
      c.init(other.c.get<cell_change_order_s>());
      break;
    case types::e_csfb_r9:
      c.init(other.c.get<e_csfb_r9_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r9_ies_s::purpose_c_");
  }
}
mob_from_eutra_cmd_r9_ies_s::purpose_c_& mob_from_eutra_cmd_r9_ies_s::purpose_c_::
                                         operator=(const mob_from_eutra_cmd_r9_ies_s::purpose_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ho:
      c.set(other.c.get<ho_s>());
      break;
    case types::cell_change_order:
      c.set(other.c.get<cell_change_order_s>());
      break;
    case types::e_csfb_r9:
      c.set(other.c.get<e_csfb_r9_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r9_ies_s::purpose_c_");
  }

  return *this;
}
void mob_from_eutra_cmd_r9_ies_s::purpose_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ho:
      j.write_fieldname("handover");
      c.get<ho_s>().to_json(j);
      break;
    case types::cell_change_order:
      j.write_fieldname("cellChangeOrder");
      c.get<cell_change_order_s>().to_json(j);
      break;
    case types::e_csfb_r9:
      j.write_fieldname("e-CSFB-r9");
      c.get<e_csfb_r9_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r9_ies_s::purpose_c_");
  }
  j.end_obj();
}
SRSASN_CODE mob_from_eutra_cmd_r9_ies_s::purpose_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ho:
      HANDLE_CODE(c.get<ho_s>().pack(bref));
      break;
    case types::cell_change_order:
      HANDLE_CODE(c.get<cell_change_order_s>().pack(bref));
      break;
    case types::e_csfb_r9:
      HANDLE_CODE(c.get<e_csfb_r9_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r9_ies_s::purpose_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_r9_ies_s::purpose_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ho:
      HANDLE_CODE(c.get<ho_s>().unpack(bref));
      break;
    case types::cell_change_order:
      HANDLE_CODE(c.get<cell_change_order_s>().unpack(bref));
      break;
    case types::e_csfb_r9:
      HANDLE_CODE(c.get<e_csfb_r9_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_r9_ies_s::purpose_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RNReconfiguration-r10-IEs ::= SEQUENCE
SRSASN_CODE rn_recfg_r10_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rn_sys_info_r10_present, 1));
  HANDLE_CODE(bref.pack(rn_sf_cfg_r10_present, 1));
  HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (rn_sys_info_r10_present) {
    HANDLE_CODE(rn_sys_info_r10.pack(bref));
  }
  if (rn_sf_cfg_r10_present) {
    HANDLE_CODE(rn_sf_cfg_r10.pack(bref));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_recfg_r10_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rn_sys_info_r10_present, 1));
  HANDLE_CODE(bref.unpack(rn_sf_cfg_r10_present, 1));
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (rn_sys_info_r10_present) {
    HANDLE_CODE(rn_sys_info_r10.unpack(bref));
  }
  if (rn_sf_cfg_r10_present) {
    HANDLE_CODE(rn_sf_cfg_r10.unpack(bref));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rn_recfg_r10_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rn_sys_info_r10_present) {
    j.write_fieldname("rn-SystemInfo-r10");
    rn_sys_info_r10.to_json(j);
  }
  if (rn_sf_cfg_r10_present) {
    j.write_fieldname("rn-SubframeConfig-r10");
    rn_sf_cfg_r10.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();
}

// RRCConnectionReconfiguration-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_cfg_present, 1));
  HANDLE_CODE(bref.pack(mob_ctrl_info_present, 1));
  HANDLE_CODE(bref.pack(ded_info_nas_list_present, 1));
  HANDLE_CODE(bref.pack(rr_cfg_ded_present, 1));
  HANDLE_CODE(bref.pack(security_cfg_ho_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (meas_cfg_present) {
    HANDLE_CODE(meas_cfg.pack(bref));
  }
  if (mob_ctrl_info_present) {
    HANDLE_CODE(mob_ctrl_info.pack(bref));
  }
  if (ded_info_nas_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, ded_info_nas_list, 1, 11));
  }
  if (rr_cfg_ded_present) {
    HANDLE_CODE(rr_cfg_ded.pack(bref));
  }
  if (security_cfg_ho_present) {
    HANDLE_CODE(security_cfg_ho.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_cfg_present, 1));
  HANDLE_CODE(bref.unpack(mob_ctrl_info_present, 1));
  HANDLE_CODE(bref.unpack(ded_info_nas_list_present, 1));
  HANDLE_CODE(bref.unpack(rr_cfg_ded_present, 1));
  HANDLE_CODE(bref.unpack(security_cfg_ho_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (meas_cfg_present) {
    HANDLE_CODE(meas_cfg.unpack(bref));
  }
  if (mob_ctrl_info_present) {
    HANDLE_CODE(mob_ctrl_info.unpack(bref));
  }
  if (ded_info_nas_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(ded_info_nas_list, bref, 1, 11));
  }
  if (rr_cfg_ded_present) {
    HANDLE_CODE(rr_cfg_ded.unpack(bref));
  }
  if (security_cfg_ho_present) {
    HANDLE_CODE(security_cfg_ho.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_cfg_present) {
    j.write_fieldname("measConfig");
    meas_cfg.to_json(j);
  }
  if (mob_ctrl_info_present) {
    j.write_fieldname("mobilityControlInfo");
    mob_ctrl_info.to_json(j);
  }
  if (ded_info_nas_list_present) {
    j.start_array("dedicatedInfoNASList");
    for (const auto& e1 : ded_info_nas_list) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (rr_cfg_ded_present) {
    j.write_fieldname("radioResourceConfigDedicated");
    rr_cfg_ded.to_json(j);
  }
  if (security_cfg_ho_present) {
    j.write_fieldname("securityConfigHO");
    security_cfg_ho.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionRelease-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_release_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(redirected_carrier_info_present, 1));
  HANDLE_CODE(bref.pack(idle_mode_mob_ctrl_info_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(release_cause.pack(bref));
  if (redirected_carrier_info_present) {
    HANDLE_CODE(redirected_carrier_info.pack(bref));
  }
  if (idle_mode_mob_ctrl_info_present) {
    HANDLE_CODE(idle_mode_mob_ctrl_info.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_release_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(redirected_carrier_info_present, 1));
  HANDLE_CODE(bref.unpack(idle_mode_mob_ctrl_info_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(release_cause.unpack(bref));
  if (redirected_carrier_info_present) {
    HANDLE_CODE(redirected_carrier_info.unpack(bref));
  }
  if (idle_mode_mob_ctrl_info_present) {
    HANDLE_CODE(idle_mode_mob_ctrl_info.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_release_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("releaseCause", release_cause.to_string());
  if (redirected_carrier_info_present) {
    j.write_fieldname("redirectedCarrierInfo");
    redirected_carrier_info.to_json(j);
  }
  if (idle_mode_mob_ctrl_info_present) {
    j.write_fieldname("idleModeMobilityControlInfo");
    idle_mode_mob_ctrl_info.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionResume-r13-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_r13_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rr_cfg_ded_r13_present, 1));
  HANDLE_CODE(bref.pack(meas_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(ant_info_ded_pcell_r13_present, 1));
  HANDLE_CODE(bref.pack(drb_continue_rohc_r13_present, 1));
  HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.pack(rrc_conn_resume_v1430_ies_present, 1));

  if (rr_cfg_ded_r13_present) {
    HANDLE_CODE(rr_cfg_ded_r13.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, next_hop_chaining_count_r13, (uint8_t)0u, (uint8_t)7u));
  if (meas_cfg_r13_present) {
    HANDLE_CODE(meas_cfg_r13.pack(bref));
  }
  if (ant_info_ded_pcell_r13_present) {
    HANDLE_CODE(ant_info_ded_pcell_r13.pack(bref));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(bref));
  }
  if (rrc_conn_resume_v1430_ies_present) {
    HANDLE_CODE(rrc_conn_resume_v1430_ies.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_r13_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rr_cfg_ded_r13_present, 1));
  HANDLE_CODE(bref.unpack(meas_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(ant_info_ded_pcell_r13_present, 1));
  HANDLE_CODE(bref.unpack(drb_continue_rohc_r13_present, 1));
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(rrc_conn_resume_v1430_ies_present, 1));

  if (rr_cfg_ded_r13_present) {
    HANDLE_CODE(rr_cfg_ded_r13.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(next_hop_chaining_count_r13, bref, (uint8_t)0u, (uint8_t)7u));
  if (meas_cfg_r13_present) {
    HANDLE_CODE(meas_cfg_r13.unpack(bref));
  }
  if (ant_info_ded_pcell_r13_present) {
    HANDLE_CODE(ant_info_ded_pcell_r13.unpack(bref));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.unpack(bref));
  }
  if (rrc_conn_resume_v1430_ies_present) {
    HANDLE_CODE(rrc_conn_resume_v1430_ies.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_resume_r13_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rr_cfg_ded_r13_present) {
    j.write_fieldname("radioResourceConfigDedicated-r13");
    rr_cfg_ded_r13.to_json(j);
  }
  j.write_int("nextHopChainingCount-r13", next_hop_chaining_count_r13);
  if (meas_cfg_r13_present) {
    j.write_fieldname("measConfig-r13");
    meas_cfg_r13.to_json(j);
  }
  if (ant_info_ded_pcell_r13_present) {
    j.write_fieldname("antennaInfoDedicatedPCell-r13");
    ant_info_ded_pcell_r13.to_json(j);
  }
  if (drb_continue_rohc_r13_present) {
    j.write_str("drb-ContinueROHC-r13", "true");
  }
  if (late_non_crit_ext_present) {
    j.write_str("lateNonCriticalExtension", late_non_crit_ext.to_string());
  }
  if (rrc_conn_resume_v1430_ies_present) {
    j.write_fieldname("rrcConnectionResume-v1430-IEs");
    rrc_conn_resume_v1430_ies.to_json(j);
  }
  j.end_obj();
}

// SecurityModeCommand-r8-IEs ::= SEQUENCE
SRSASN_CODE security_mode_cmd_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(security_cfg_smc.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE security_mode_cmd_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(security_cfg_smc.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void security_mode_cmd_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("securityConfigSMC");
  security_cfg_smc.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UECapabilityEnquiry-r8-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_enquiry_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, ue_cap_request, 1, 8));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_enquiry_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(ue_cap_request, bref, 1, 8));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_enquiry_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("ue-CapabilityRequest");
  for (const auto& e1 : ue_cap_request) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UEInformationRequest-r9-IEs ::= SEQUENCE
SRSASN_CODE ue_info_request_r9_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.pack(rach_report_req_r9, 1));
  HANDLE_CODE(bref.pack(rlf_report_req_r9, 1));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_request_r9_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(bref.unpack(rach_report_req_r9, 1));
  HANDLE_CODE(bref.unpack(rlf_report_req_r9, 1));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_request_r9_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("rach-ReportReq-r9", rach_report_req_r9);
  j.write_bool("rlf-ReportReq-r9", rlf_report_req_r9);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// CSFBParametersResponseCDMA2000 ::= SEQUENCE
SRSASN_CODE csfb_params_resp_cdma2000_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 csfb_params_resp_cdma2000_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 csfb_params_resp_cdma2000_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 csfb_params_resp_cdma2000_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::csfb_params_resp_cdma2000_r8:
      c.destroy<csfb_params_resp_cdma2000_r8_ies_s>();
      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<csfb_params_resp_cdma2000_r8_ies_s>();
      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<csfb_params_resp_cdma2000_r8_ies_s>());
      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<csfb_params_resp_cdma2000_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::csfb_params_resp_cdma2000_r8:
      j.write_fieldname("csfbParametersResponseCDMA2000-r8");
      c.get<csfb_params_resp_cdma2000_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "csfb_params_resp_cdma2000_s::crit_exts_c_");
  }
  j.end_obj();
}
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<csfb_params_resp_cdma2000_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "csfb_params_resp_cdma2000_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csfb_params_resp_cdma2000_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::csfb_params_resp_cdma2000_r8:
      HANDLE_CODE(c.get<csfb_params_resp_cdma2000_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "csfb_params_resp_cdma2000_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CounterCheck ::= SEQUENCE
SRSASN_CODE counter_check_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 counter_check_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 counter_check_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 counter_check_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void counter_check_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE counter_check_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void counter_check_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void counter_check_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::counter_check_r8:
      j.write_fieldname("counterCheck-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE counter_check_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::counter_check_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE counter_check_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::counter_check_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DLInformationTransfer ::= SEQUENCE
SRSASN_CODE dl_info_transfer_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 dl_info_transfer_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 dl_info_transfer_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 dl_info_transfer_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_info_transfer_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void dl_info_transfer_s::crit_exts_c_::c1_c_::destroy_()
{
  switch (type_) {
    case types::dl_info_transfer_r8:
      c.destroy<dl_info_transfer_r8_ies_s>();
      break;
    case types::dl_info_transfer_r15:
      c.destroy<dl_info_transfer_r15_ies_s>();
      break;
    default:
      break;
  }
}
void dl_info_transfer_s::crit_exts_c_::c1_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::dl_info_transfer_r8:
      c.init<dl_info_transfer_r8_ies_s>();
      break;
    case types::dl_info_transfer_r15:
      c.init<dl_info_transfer_r15_ies_s>();
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_::c1_c_");
  }
}
dl_info_transfer_s::crit_exts_c_::c1_c_::c1_c_(const dl_info_transfer_s::crit_exts_c_::c1_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::dl_info_transfer_r8:
      c.init(other.c.get<dl_info_transfer_r8_ies_s>());
      break;
    case types::dl_info_transfer_r15:
      c.init(other.c.get<dl_info_transfer_r15_ies_s>());
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_::c1_c_");
  }
}
dl_info_transfer_s::crit_exts_c_::c1_c_& dl_info_transfer_s::crit_exts_c_::c1_c_::
                                         operator=(const dl_info_transfer_s::crit_exts_c_::c1_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::dl_info_transfer_r8:
      c.set(other.c.get<dl_info_transfer_r8_ies_s>());
      break;
    case types::dl_info_transfer_r15:
      c.set(other.c.get<dl_info_transfer_r15_ies_s>());
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_::c1_c_");
  }

  return *this;
}
void dl_info_transfer_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::dl_info_transfer_r8:
      j.write_fieldname("dlInformationTransfer-r8");
      c.get<dl_info_transfer_r8_ies_s>().to_json(j);
      break;
    case types::dl_info_transfer_r15:
      j.write_fieldname("dlInformationTransfer-r15");
      c.get<dl_info_transfer_r15_ies_s>().to_json(j);
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE dl_info_transfer_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::dl_info_transfer_r8:
      HANDLE_CODE(c.get<dl_info_transfer_r8_ies_s>().pack(bref));
      break;
    case types::dl_info_transfer_r15:
      HANDLE_CODE(c.get<dl_info_transfer_r15_ies_s>().pack(bref));
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_info_transfer_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::dl_info_transfer_r8:
      HANDLE_CODE(c.get<dl_info_transfer_r8_ies_s>().unpack(bref));
      break;
    case types::dl_info_transfer_r15:
      HANDLE_CODE(c.get<dl_info_transfer_r15_ies_s>().unpack(bref));
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_info_transfer_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// HandoverFromEUTRAPreparationRequest ::= SEQUENCE
SRSASN_CODE ho_from_eutra_prep_request_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_from_eutra_prep_request_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_from_eutra_prep_request_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_from_eutra_prep_request_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void ho_from_eutra_prep_request_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_from_eutra_prep_request_s::crit_exts_c_");
  }
  j.end_obj();
}
SRSASN_CODE ho_from_eutra_prep_request_s::crit_exts_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_from_eutra_prep_request_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_from_eutra_prep_request_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_from_eutra_prep_request_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ho_from_eutra_prep_request_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ho_from_eutra_prep_request_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ho_from_eutra_prep_request_r8:
      j.write_fieldname("handoverFromEUTRAPreparationRequest-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ho_from_eutra_prep_request_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ho_from_eutra_prep_request_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ho_from_eutra_prep_request_r8:
      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_from_eutra_prep_request_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_from_eutra_prep_request_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ho_from_eutra_prep_request_r8:
      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_from_eutra_prep_request_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// LoggedMeasurementConfiguration-r10 ::= SEQUENCE
SRSASN_CODE logged_meas_cfg_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE logged_meas_cfg_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void logged_meas_cfg_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void logged_meas_cfg_r10_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE logged_meas_cfg_r10_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void logged_meas_cfg_r10_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void logged_meas_cfg_r10_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::logged_meas_cfg_r10:
      j.write_fieldname("loggedMeasurementConfiguration-r10");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE logged_meas_cfg_r10_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::logged_meas_cfg_r10:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE logged_meas_cfg_r10_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::logged_meas_cfg_r10:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "logged_meas_cfg_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MobilityFromEUTRACommand ::= SEQUENCE
SRSASN_CODE mob_from_eutra_cmd_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 mob_from_eutra_cmd_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 mob_from_eutra_cmd_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 mob_from_eutra_cmd_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mob_from_eutra_cmd_s::crit_exts_c_::c1_c_::destroy_()
{
  switch (type_) {
    case types::mob_from_eutra_cmd_r8:
      c.destroy<mob_from_eutra_cmd_r8_ies_s>();
      break;
    case types::mob_from_eutra_cmd_r9:
      c.destroy<mob_from_eutra_cmd_r9_ies_s>();
      break;
    default:
      break;
  }
}
void mob_from_eutra_cmd_s::crit_exts_c_::c1_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::mob_from_eutra_cmd_r8:
      c.init<mob_from_eutra_cmd_r8_ies_s>();
      break;
    case types::mob_from_eutra_cmd_r9:
      c.init<mob_from_eutra_cmd_r9_ies_s>();
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_::c1_c_");
  }
}
mob_from_eutra_cmd_s::crit_exts_c_::c1_c_::c1_c_(const mob_from_eutra_cmd_s::crit_exts_c_::c1_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::mob_from_eutra_cmd_r8:
      c.init(other.c.get<mob_from_eutra_cmd_r8_ies_s>());
      break;
    case types::mob_from_eutra_cmd_r9:
      c.init(other.c.get<mob_from_eutra_cmd_r9_ies_s>());
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_::c1_c_");
  }
}
mob_from_eutra_cmd_s::crit_exts_c_::c1_c_& mob_from_eutra_cmd_s::crit_exts_c_::c1_c_::
                                           operator=(const mob_from_eutra_cmd_s::crit_exts_c_::c1_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::mob_from_eutra_cmd_r8:
      c.set(other.c.get<mob_from_eutra_cmd_r8_ies_s>());
      break;
    case types::mob_from_eutra_cmd_r9:
      c.set(other.c.get<mob_from_eutra_cmd_r9_ies_s>());
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_::c1_c_");
  }

  return *this;
}
void mob_from_eutra_cmd_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::mob_from_eutra_cmd_r8:
      j.write_fieldname("mobilityFromEUTRACommand-r8");
      c.get<mob_from_eutra_cmd_r8_ies_s>().to_json(j);
      break;
    case types::mob_from_eutra_cmd_r9:
      j.write_fieldname("mobilityFromEUTRACommand-r9");
      c.get<mob_from_eutra_cmd_r9_ies_s>().to_json(j);
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE mob_from_eutra_cmd_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::mob_from_eutra_cmd_r8:
      HANDLE_CODE(c.get<mob_from_eutra_cmd_r8_ies_s>().pack(bref));
      break;
    case types::mob_from_eutra_cmd_r9:
      HANDLE_CODE(c.get<mob_from_eutra_cmd_r9_ies_s>().pack(bref));
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_from_eutra_cmd_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::mob_from_eutra_cmd_r8:
      HANDLE_CODE(c.get<mob_from_eutra_cmd_r8_ies_s>().unpack(bref));
      break;
    case types::mob_from_eutra_cmd_r9:
      HANDLE_CODE(c.get<mob_from_eutra_cmd_r9_ies_s>().unpack(bref));
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mob_from_eutra_cmd_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RNReconfiguration-r10 ::= SEQUENCE
SRSASN_CODE rn_recfg_r10_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 rn_recfg_r10_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 rn_recfg_r10_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 rn_recfg_r10_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_recfg_r10_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rn_recfg_r10_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void rn_recfg_r10_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rn_recfg_r10:
      j.write_fieldname("rnReconfiguration-r10");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_recfg_r10_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rn_recfg_r10:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_recfg_r10_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rn_recfg_r10:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReconfiguration ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_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_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_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_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void rrc_conn_recfg_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      break;
    case types::crit_exts_future:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_");
  }
}
rrc_conn_recfg_s::crit_exts_c_::crit_exts_c_(const rrc_conn_recfg_s::crit_exts_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::c1:
      c.init(other.c.get<c1_c_>());
      break;
    case types::crit_exts_future:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_");
  }
}
rrc_conn_recfg_s::crit_exts_c_& rrc_conn_recfg_s::crit_exts_c_::operator=(const rrc_conn_recfg_s::crit_exts_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::c1:
      c.set(other.c.get<c1_c_>());
      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 *this;
}
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<c1_c_>().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<c1_c_>().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<c1_c_>().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
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_recfg_r8:
      j.write_fieldname("rrcConnectionReconfiguration-r8");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_recfg_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_recfg_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_recfg_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionRelease ::= SEQUENCE
SRSASN_CODE rrc_conn_release_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_release_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_release_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_release_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_release_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rrc_conn_release_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_release_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_release_r8:
      j.write_fieldname("rrcConnectionRelease-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_release_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_release_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_release_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_release_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_release_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionResume-r13 ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_r13_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_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_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_r13_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_r13_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_r13_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_r13_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_r13_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rrc_conn_resume_r13_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_resume_r13_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_resume_r13:
      j.write_fieldname("rrcConnectionResume-r13");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_r13_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_resume_r13_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_resume_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_, "rrc_conn_resume_r13_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_r13_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_resume_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_, "rrc_conn_resume_r13_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SecurityModeCommand ::= SEQUENCE
SRSASN_CODE security_mode_cmd_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 security_mode_cmd_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 security_mode_cmd_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 security_mode_cmd_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE security_mode_cmd_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void security_mode_cmd_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void security_mode_cmd_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::security_mode_cmd_r8:
      j.write_fieldname("securityModeCommand-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE security_mode_cmd_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::security_mode_cmd_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE security_mode_cmd_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::security_mode_cmd_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_cmd_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UECapabilityEnquiry ::= SEQUENCE
SRSASN_CODE ue_cap_enquiry_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 ue_cap_enquiry_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 ue_cap_enquiry_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 ue_cap_enquiry_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_enquiry_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ue_cap_enquiry_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ue_cap_enquiry_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_cap_enquiry_r8:
      j.write_fieldname("ueCapabilityEnquiry-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ue_cap_enquiry_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_cap_enquiry_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_enquiry_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_cap_enquiry_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_enquiry_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UEInformationRequest-r9 ::= SEQUENCE
SRSASN_CODE ue_info_request_r9_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 ue_info_request_r9_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 ue_info_request_r9_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 ue_info_request_r9_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_request_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<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ue_info_request_r9_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ue_info_request_r9_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_info_request_r9:
      j.write_fieldname("ueInformationRequest-r9");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ue_info_request_r9_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_info_request_r9:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_request_r9_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_info_request_r9:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_request_r9_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DL-DCCH-MessageType ::= CHOICE
void dl_dcch_msg_type_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void dl_dcch_msg_type_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().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<c1_c_>().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<c1_c_>().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<csfb_params_resp_cdma2000_s>();
      break;
    case types::dl_info_transfer:
      c.destroy<dl_info_transfer_s>();
      break;
    case types::ho_from_eutra_prep_request:
      c.destroy<ho_from_eutra_prep_request_s>();
      break;
    case types::mob_from_eutra_cmd:
      c.destroy<mob_from_eutra_cmd_s>();
      break;
    case types::rrc_conn_recfg:
      c.destroy<rrc_conn_recfg_s>();
      break;
    case types::rrc_conn_release:
      c.destroy<rrc_conn_release_s>();
      break;
    case types::security_mode_cmd:
      c.destroy<security_mode_cmd_s>();
      break;
    case types::ue_cap_enquiry:
      c.destroy<ue_cap_enquiry_s>();
      break;
    case types::counter_check:
      c.destroy<counter_check_s>();
      break;
    case types::ue_info_request_r9:
      c.destroy<ue_info_request_r9_s>();
      break;
    case types::logged_meas_cfg_r10:
      c.destroy<logged_meas_cfg_r10_s>();
      break;
    case types::rn_recfg_r10:
      c.destroy<rn_recfg_r10_s>();
      break;
    case types::rrc_conn_resume_r13:
      c.destroy<rrc_conn_resume_r13_s>();
      break;
    default:
      break;
  }
}
void dl_dcch_msg_type_c::c1_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::csfb_params_resp_cdma2000:
      c.init<csfb_params_resp_cdma2000_s>();
      break;
    case types::dl_info_transfer:
      c.init<dl_info_transfer_s>();
      break;
    case types::ho_from_eutra_prep_request:
      c.init<ho_from_eutra_prep_request_s>();
      break;
    case types::mob_from_eutra_cmd:
      c.init<mob_from_eutra_cmd_s>();
      break;
    case types::rrc_conn_recfg:
      c.init<rrc_conn_recfg_s>();
      break;
    case types::rrc_conn_release:
      c.init<rrc_conn_release_s>();
      break;
    case types::security_mode_cmd:
      c.init<security_mode_cmd_s>();
      break;
    case types::ue_cap_enquiry:
      c.init<ue_cap_enquiry_s>();
      break;
    case types::counter_check:
      c.init<counter_check_s>();
      break;
    case types::ue_info_request_r9:
      c.init<ue_info_request_r9_s>();
      break;
    case types::logged_meas_cfg_r10:
      c.init<logged_meas_cfg_r10_s>();
      break;
    case types::rn_recfg_r10:
      c.init<rn_recfg_r10_s>();
      break;
    case types::rrc_conn_resume_r13:
      c.init<rrc_conn_resume_r13_s>();
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_dcch_msg_type_c::c1_c_");
  }
}
dl_dcch_msg_type_c::c1_c_::c1_c_(const dl_dcch_msg_type_c::c1_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::csfb_params_resp_cdma2000:
      c.init(other.c.get<csfb_params_resp_cdma2000_s>());
      break;
    case types::dl_info_transfer:
      c.init(other.c.get<dl_info_transfer_s>());
      break;
    case types::ho_from_eutra_prep_request:
      c.init(other.c.get<ho_from_eutra_prep_request_s>());
      break;
    case types::mob_from_eutra_cmd:
      c.init(other.c.get<mob_from_eutra_cmd_s>());
      break;
    case types::rrc_conn_recfg:
      c.init(other.c.get<rrc_conn_recfg_s>());
      break;
    case types::rrc_conn_release:
      c.init(other.c.get<rrc_conn_release_s>());
      break;
    case types::security_mode_cmd:
      c.init(other.c.get<security_mode_cmd_s>());
      break;
    case types::ue_cap_enquiry:
      c.init(other.c.get<ue_cap_enquiry_s>());
      break;
    case types::counter_check:
      c.init(other.c.get<counter_check_s>());
      break;
    case types::ue_info_request_r9:
      c.init(other.c.get<ue_info_request_r9_s>());
      break;
    case types::logged_meas_cfg_r10:
      c.init(other.c.get<logged_meas_cfg_r10_s>());
      break;
    case types::rn_recfg_r10:
      c.init(other.c.get<rn_recfg_r10_s>());
      break;
    case types::rrc_conn_resume_r13:
      c.init(other.c.get<rrc_conn_resume_r13_s>());
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_dcch_msg_type_c::c1_c_");
  }
}
dl_dcch_msg_type_c::c1_c_& dl_dcch_msg_type_c::c1_c_::operator=(const dl_dcch_msg_type_c::c1_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::csfb_params_resp_cdma2000:
      c.set(other.c.get<csfb_params_resp_cdma2000_s>());
      break;
    case types::dl_info_transfer:
      c.set(other.c.get<dl_info_transfer_s>());
      break;
    case types::ho_from_eutra_prep_request:
      c.set(other.c.get<ho_from_eutra_prep_request_s>());
      break;
    case types::mob_from_eutra_cmd:
      c.set(other.c.get<mob_from_eutra_cmd_s>());
      break;
    case types::rrc_conn_recfg:
      c.set(other.c.get<rrc_conn_recfg_s>());
      break;
    case types::rrc_conn_release:
      c.set(other.c.get<rrc_conn_release_s>());
      break;
    case types::security_mode_cmd:
      c.set(other.c.get<security_mode_cmd_s>());
      break;
    case types::ue_cap_enquiry:
      c.set(other.c.get<ue_cap_enquiry_s>());
      break;
    case types::counter_check:
      c.set(other.c.get<counter_check_s>());
      break;
    case types::ue_info_request_r9:
      c.set(other.c.get<ue_info_request_r9_s>());
      break;
    case types::logged_meas_cfg_r10:
      c.set(other.c.get<logged_meas_cfg_r10_s>());
      break;
    case types::rn_recfg_r10:
      c.set(other.c.get<rn_recfg_r10_s>());
      break;
    case types::rrc_conn_resume_r13:
      c.set(other.c.get<rrc_conn_resume_r13_s>());
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "dl_dcch_msg_type_c::c1_c_");
  }

  return *this;
}
void dl_dcch_msg_type_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::csfb_params_resp_cdma2000:
      j.write_fieldname("csfbParametersResponseCDMA2000");
      c.get<csfb_params_resp_cdma2000_s>().to_json(j);
      break;
    case types::dl_info_transfer:
      j.write_fieldname("dlInformationTransfer");
      c.get<dl_info_transfer_s>().to_json(j);
      break;
    case types::ho_from_eutra_prep_request:
      j.write_fieldname("handoverFromEUTRAPreparationRequest");
      c.get<ho_from_eutra_prep_request_s>().to_json(j);
      break;
    case types::mob_from_eutra_cmd:
      j.write_fieldname("mobilityFromEUTRACommand");
      c.get<mob_from_eutra_cmd_s>().to_json(j);
      break;
    case types::rrc_conn_recfg:
      j.write_fieldname("rrcConnectionReconfiguration");
      c.get<rrc_conn_recfg_s>().to_json(j);
      break;
    case types::rrc_conn_release:
      j.write_fieldname("rrcConnectionRelease");
      c.get<rrc_conn_release_s>().to_json(j);
      break;
    case types::security_mode_cmd:
      j.write_fieldname("securityModeCommand");
      c.get<security_mode_cmd_s>().to_json(j);
      break;
    case types::ue_cap_enquiry:
      j.write_fieldname("ueCapabilityEnquiry");
      c.get<ue_cap_enquiry_s>().to_json(j);
      break;
    case types::counter_check:
      j.write_fieldname("counterCheck");
      c.get<counter_check_s>().to_json(j);
      break;
    case types::ue_info_request_r9:
      j.write_fieldname("ueInformationRequest-r9");
      c.get<ue_info_request_r9_s>().to_json(j);
      break;
    case types::logged_meas_cfg_r10:
      j.write_fieldname("loggedMeasurementConfiguration-r10");
      c.get<logged_meas_cfg_r10_s>().to_json(j);
      break;
    case types::rn_recfg_r10:
      j.write_fieldname("rnReconfiguration-r10");
      c.get<rn_recfg_r10_s>().to_json(j);
      break;
    case types::rrc_conn_resume_r13:
      j.write_fieldname("rrcConnectionResume-r13");
      c.get<rrc_conn_resume_r13_s>().to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_dcch_msg_type_c::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE dl_dcch_msg_type_c::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::csfb_params_resp_cdma2000:
      HANDLE_CODE(c.get<csfb_params_resp_cdma2000_s>().pack(bref));
      break;
    case types::dl_info_transfer:
      HANDLE_CODE(c.get<dl_info_transfer_s>().pack(bref));
      break;
    case types::ho_from_eutra_prep_request:
      HANDLE_CODE(c.get<ho_from_eutra_prep_request_s>().pack(bref));
      break;
    case types::mob_from_eutra_cmd:
      HANDLE_CODE(c.get<mob_from_eutra_cmd_s>().pack(bref));
      break;
    case types::rrc_conn_recfg:
      HANDLE_CODE(c.get<rrc_conn_recfg_s>().pack(bref));
      break;
    case types::rrc_conn_release:
      HANDLE_CODE(c.get<rrc_conn_release_s>().pack(bref));
      break;
    case types::security_mode_cmd:
      HANDLE_CODE(c.get<security_mode_cmd_s>().pack(bref));
      break;
    case types::ue_cap_enquiry:
      HANDLE_CODE(c.get<ue_cap_enquiry_s>().pack(bref));
      break;
    case types::counter_check:
      HANDLE_CODE(c.get<counter_check_s>().pack(bref));
      break;
    case types::ue_info_request_r9:
      HANDLE_CODE(c.get<ue_info_request_r9_s>().pack(bref));
      break;
    case types::logged_meas_cfg_r10:
      HANDLE_CODE(c.get<logged_meas_cfg_r10_s>().pack(bref));
      break;
    case types::rn_recfg_r10:
      HANDLE_CODE(c.get<rn_recfg_r10_s>().pack(bref));
      break;
    case types::rrc_conn_resume_r13:
      HANDLE_CODE(c.get<rrc_conn_resume_r13_s>().pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_dcch_msg_type_c::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_dcch_msg_type_c::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::csfb_params_resp_cdma2000:
      HANDLE_CODE(c.get<csfb_params_resp_cdma2000_s>().unpack(bref));
      break;
    case types::dl_info_transfer:
      HANDLE_CODE(c.get<dl_info_transfer_s>().unpack(bref));
      break;
    case types::ho_from_eutra_prep_request:
      HANDLE_CODE(c.get<ho_from_eutra_prep_request_s>().unpack(bref));
      break;
    case types::mob_from_eutra_cmd:
      HANDLE_CODE(c.get<mob_from_eutra_cmd_s>().unpack(bref));
      break;
    case types::rrc_conn_recfg:
      HANDLE_CODE(c.get<rrc_conn_recfg_s>().unpack(bref));
      break;
    case types::rrc_conn_release:
      HANDLE_CODE(c.get<rrc_conn_release_s>().unpack(bref));
      break;
    case types::security_mode_cmd:
      HANDLE_CODE(c.get<security_mode_cmd_s>().unpack(bref));
      break;
    case types::ue_cap_enquiry:
      HANDLE_CODE(c.get<ue_cap_enquiry_s>().unpack(bref));
      break;
    case types::counter_check:
      HANDLE_CODE(c.get<counter_check_s>().unpack(bref));
      break;
    case types::ue_info_request_r9:
      HANDLE_CODE(c.get<ue_info_request_r9_s>().unpack(bref));
      break;
    case types::logged_meas_cfg_r10:
      HANDLE_CODE(c.get<logged_meas_cfg_r10_s>().unpack(bref));
      break;
    case types::rn_recfg_r10:
      HANDLE_CODE(c.get<rn_recfg_r10_s>().unpack(bref));
      break;
    case types::rrc_conn_resume_r13:
      HANDLE_CODE(c.get<rrc_conn_resume_r13_s>().unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "dl_dcch_msg_type_c::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DL-DCCH-Message ::= SEQUENCE
SRSASN_CODE dl_dcch_msg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_dcch_msg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void dl_dcch_msg_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("DL-DCCH-Message");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// TMGI-r9 ::= SEQUENCE
SRSASN_CODE tmgi_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(plmn_id_r9.pack(bref));
  HANDLE_CODE(service_id_r9.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE tmgi_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(plmn_id_r9.unpack(bref));
  HANDLE_CODE(service_id_r9.unpack(bref));

  return SRSASN_SUCCESS;
}
void tmgi_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("plmn-Id-r9");
  plmn_id_r9.to_json(j);
  j.write_str("serviceId-r9", service_id_r9.to_string());
  j.end_obj();
}

void tmgi_r9_s::plmn_id_r9_c_::destroy_()
{
  switch (type_) {
    case types::explicit_value_r9:
      c.destroy<plmn_id_s>();
      break;
    default:
      break;
  }
}
void tmgi_r9_s::plmn_id_r9_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::plmn_idx_r9:
      break;
    case types::explicit_value_r9:
      c.init<plmn_id_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "tmgi_r9_s::plmn_id_r9_c_");
  }
}
tmgi_r9_s::plmn_id_r9_c_::plmn_id_r9_c_(const tmgi_r9_s::plmn_id_r9_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::plmn_idx_r9:
      c.init(other.c.get<uint8_t>());
      break;
    case types::explicit_value_r9:
      c.init(other.c.get<plmn_id_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "tmgi_r9_s::plmn_id_r9_c_");
  }
}
tmgi_r9_s::plmn_id_r9_c_& tmgi_r9_s::plmn_id_r9_c_::operator=(const tmgi_r9_s::plmn_id_r9_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::plmn_idx_r9:
      c.set(other.c.get<uint8_t>());
      break;
    case types::explicit_value_r9:
      c.set(other.c.get<plmn_id_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "tmgi_r9_s::plmn_id_r9_c_");
  }

  return *this;
}
void tmgi_r9_s::plmn_id_r9_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::plmn_idx_r9:
      j.write_int("plmn-Index-r9", c.get<uint8_t>());
      break;
    case types::explicit_value_r9:
      j.write_fieldname("explicitValue-r9");
      c.get<plmn_id_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "tmgi_r9_s::plmn_id_r9_c_");
  }
  j.end_obj();
}
SRSASN_CODE tmgi_r9_s::plmn_id_r9_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::plmn_idx_r9:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)1u, (uint8_t)6u));
      break;
    case types::explicit_value_r9:
      HANDLE_CODE(c.get<plmn_id_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "tmgi_r9_s::plmn_id_r9_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE tmgi_r9_s::plmn_id_r9_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::plmn_idx_r9:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)1u, (uint8_t)6u));
      break;
    case types::explicit_value_r9:
      HANDLE_CODE(c.get<plmn_id_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "tmgi_r9_s::plmn_id_r9_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MBMS-SessionInfo-r9 ::= SEQUENCE
SRSASN_CODE mbms_session_info_r9_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(session_id_r9_present, 1));

  HANDLE_CODE(tmgi_r9.pack(bref));
  if (session_id_r9_present) {
    HANDLE_CODE(session_id_r9.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, lc_ch_id_r9, (uint8_t)0u, (uint8_t)28u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_session_info_r9_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(session_id_r9_present, 1));

  HANDLE_CODE(tmgi_r9.unpack(bref));
  if (session_id_r9_present) {
    HANDLE_CODE(session_id_r9.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(lc_ch_id_r9, bref, (uint8_t)0u, (uint8_t)28u));

  return SRSASN_SUCCESS;
}
void mbms_session_info_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("tmgi-r9");
  tmgi_r9.to_json(j);
  if (session_id_r9_present) {
    j.write_str("sessionId-r9", session_id_r9.to_string());
  }
  j.write_int("logicalChannelIdentity-r9", lc_ch_id_r9);
  j.end_obj();
}

// PMCH-Config-r12 ::= SEQUENCE
SRSASN_CODE pmch_cfg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, sf_alloc_end_r12, (uint16_t)0u, (uint16_t)1535u));
  HANDLE_CODE(data_mcs_r12.pack(bref));
  HANDLE_CODE(mch_sched_period_r12.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= mch_sched_period_v1430_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(mch_sched_period_v1430_present, 1));
      if (mch_sched_period_v1430_present) {
        HANDLE_CODE(mch_sched_period_v1430.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pmch_cfg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(sf_alloc_end_r12, bref, (uint16_t)0u, (uint16_t)1535u));
  HANDLE_CODE(data_mcs_r12.unpack(bref));
  HANDLE_CODE(mch_sched_period_r12.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(mch_sched_period_v1430_present, 1));
      if (mch_sched_period_v1430_present) {
        HANDLE_CODE(mch_sched_period_v1430.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void pmch_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sf-AllocEnd-r12", sf_alloc_end_r12);
  j.write_fieldname("dataMCS-r12");
  data_mcs_r12.to_json(j);
  j.write_str("mch-SchedulingPeriod-r12", mch_sched_period_r12.to_string());
  if (ext) {
    if (mch_sched_period_v1430_present) {
      j.write_str("mch-SchedulingPeriod-v1430", mch_sched_period_v1430.to_string());
    }
  }
  j.end_obj();
}

void pmch_cfg_r12_s::data_mcs_r12_c_::destroy_() {}
void pmch_cfg_r12_s::data_mcs_r12_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
pmch_cfg_r12_s::data_mcs_r12_c_::data_mcs_r12_c_(const pmch_cfg_r12_s::data_mcs_r12_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::normal_r12:
      c.init(other.c.get<uint8_t>());
      break;
    case types::higer_order_r12:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pmch_cfg_r12_s::data_mcs_r12_c_");
  }
}
pmch_cfg_r12_s::data_mcs_r12_c_& pmch_cfg_r12_s::data_mcs_r12_c_::
                                 operator=(const pmch_cfg_r12_s::data_mcs_r12_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::normal_r12:
      c.set(other.c.get<uint8_t>());
      break;
    case types::higer_order_r12:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "pmch_cfg_r12_s::data_mcs_r12_c_");
  }

  return *this;
}
void pmch_cfg_r12_s::data_mcs_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::normal_r12:
      j.write_int("normal-r12", c.get<uint8_t>());
      break;
    case types::higer_order_r12:
      j.write_int("higerOrder-r12", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "pmch_cfg_r12_s::data_mcs_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE pmch_cfg_r12_s::data_mcs_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::normal_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)28u));
      break;
    case types::higer_order_r12:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)27u));
      break;
    default:
      log_invalid_choice_id(type_, "pmch_cfg_r12_s::data_mcs_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pmch_cfg_r12_s::data_mcs_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::normal_r12:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)28u));
      break;
    case types::higer_order_r12:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)27u));
      break;
    default:
      log_invalid_choice_id(type_, "pmch_cfg_r12_s::data_mcs_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PMCH-InfoExt-r12 ::= SEQUENCE
SRSASN_CODE pmch_info_ext_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pmch_cfg_r12.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, mbms_session_info_list_r12, 0, 29));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pmch_info_ext_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(pmch_cfg_r12.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(mbms_session_info_list_r12, bref, 0, 29));

  return SRSASN_SUCCESS;
}
void pmch_info_ext_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("pmch-Config-r12");
  pmch_cfg_r12.to_json(j);
  j.start_array("mbms-SessionInfoList-r12");
  for (const auto& e1 : mbms_session_info_list_r12) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// MBSFNAreaConfiguration-v1430-IEs ::= SEQUENCE
SRSASN_CODE mbsfn_area_cfg_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, common_sf_alloc_r14, 1, 8));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbsfn_area_cfg_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(common_sf_alloc_r14, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void mbsfn_area_cfg_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("commonSF-Alloc-r14");
  for (const auto& e1 : common_sf_alloc_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();
}

// PMCH-Config-r9 ::= SEQUENCE
SRSASN_CODE pmch_cfg_r9_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, sf_alloc_end_r9, (uint16_t)0u, (uint16_t)1535u));
  HANDLE_CODE(pack_integer(bref, data_mcs_r9, (uint8_t)0u, (uint8_t)28u));
  HANDLE_CODE(mch_sched_period_r9.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pmch_cfg_r9_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(sf_alloc_end_r9, bref, (uint16_t)0u, (uint16_t)1535u));
  HANDLE_CODE(unpack_integer(data_mcs_r9, bref, (uint8_t)0u, (uint8_t)28u));
  HANDLE_CODE(mch_sched_period_r9.unpack(bref));

  return SRSASN_SUCCESS;
}
void pmch_cfg_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sf-AllocEnd-r9", sf_alloc_end_r9);
  j.write_int("dataMCS-r9", data_mcs_r9);
  j.write_str("mch-SchedulingPeriod-r9", mch_sched_period_r9.to_string());
  j.end_obj();
}

// CountingRequestInfo-r10 ::= SEQUENCE
SRSASN_CODE count_request_info_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(tmgi_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE count_request_info_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(tmgi_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void count_request_info_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("tmgi-r10");
  tmgi_r10.to_json(j);
  j.end_obj();
}

// MBSFNAreaConfiguration-v1250-IEs ::= SEQUENCE
SRSASN_CODE mbsfn_area_cfg_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pmch_info_list_ext_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (pmch_info_list_ext_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, pmch_info_list_ext_r12, 0, 15));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbsfn_area_cfg_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pmch_info_list_ext_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (pmch_info_list_ext_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(pmch_info_list_ext_r12, bref, 0, 15));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mbsfn_area_cfg_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pmch_info_list_ext_r12_present) {
    j.start_array("pmch-InfoListExt-r12");
    for (const auto& e1 : pmch_info_list_ext_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();
}

// PMCH-Info-r9 ::= SEQUENCE
SRSASN_CODE pmch_info_r9_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pmch_cfg_r9.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, mbms_session_info_list_r9, 0, 29));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pmch_info_r9_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(pmch_cfg_r9.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(mbms_session_info_list_r9, bref, 0, 29));

  return SRSASN_SUCCESS;
}
void pmch_info_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("pmch-Config-r9");
  pmch_cfg_r9.to_json(j);
  j.start_array("mbms-SessionInfoList-r9");
  for (const auto& e1 : mbms_session_info_list_r9) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// MBSFNAreaConfiguration-v930-IEs ::= SEQUENCE
SRSASN_CODE mbsfn_area_cfg_v930_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 mbsfn_area_cfg_v930_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 mbsfn_area_cfg_v930_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();
}

// MBMSCountingRequest-r10 ::= SEQUENCE
SRSASN_CODE mbms_count_request_r10_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(pack_dyn_seq_of(bref, count_request_list_r10, 1, 16));
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_count_request_r10_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(count_request_list_r10, bref, 1, 16));
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mbms_count_request_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("countingRequestList-r10");
  for (const auto& e1 : count_request_list_r10) {
    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();
}

// MBSFNAreaConfiguration-r9 ::= SEQUENCE
SRSASN_CODE mbsfn_area_cfg_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, common_sf_alloc_r9, 1, 8));
  HANDLE_CODE(common_sf_alloc_period_r9.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, pmch_info_list_r9, 0, 15));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbsfn_area_cfg_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(common_sf_alloc_r9, bref, 1, 8));
  HANDLE_CODE(common_sf_alloc_period_r9.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(pmch_info_list_r9, bref, 0, 15));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mbsfn_area_cfg_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("commonSF-Alloc-r9");
  for (const auto& e1 : common_sf_alloc_r9) {
    e1.to_json(j);
  }
  j.end_array();
  j.write_str("commonSF-AllocPeriod-r9", common_sf_alloc_period_r9.to_string());
  j.start_array("pmch-InfoList-r9");
  for (const auto& e1 : pmch_info_list_r9) {
    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();
}

// MCCH-MessageType ::= CHOICE
void mcch_msg_type_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    case types::later:
      c.destroy<later_c_>();
      break;
    default:
      break;
  }
}
void mcch_msg_type_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      break;
    case types::later:
      c.init<later_c_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c");
  }
}
mcch_msg_type_c::mcch_msg_type_c(const mcch_msg_type_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::c1:
      c.init(other.c.get<c1_c_>());
      break;
    case types::later:
      c.init(other.c.get<later_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c");
  }
}
mcch_msg_type_c& mcch_msg_type_c::operator=(const mcch_msg_type_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::c1:
      c.set(other.c.get<c1_c_>());
      break;
    case types::later:
      c.set(other.c.get<later_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c");
  }

  return *this;
}
void mcch_msg_type_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::later:
      j.write_fieldname("later");
      c.get<later_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c");
  }
  j.end_obj();
}
SRSASN_CODE mcch_msg_type_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().pack(bref));
      break;
    case types::later:
      HANDLE_CODE(c.get<later_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mcch_msg_type_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::later:
      HANDLE_CODE(c.get<later_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mcch_msg_type_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("mbsfnAreaConfiguration-r9");
  c.to_json(j);
  j.end_obj();
}
SRSASN_CODE mcch_msg_type_c::c1_c_::pack(bit_ref& bref) const
{
  HANDLE_CODE(c.pack(bref));
  return SRSASN_SUCCESS;
}
SRSASN_CODE mcch_msg_type_c::c1_c_::unpack(cbit_ref& bref)
{
  HANDLE_CODE(c.unpack(bref));
  return SRSASN_SUCCESS;
}

void mcch_msg_type_c::later_c_::destroy_()
{
  switch (type_) {
    case types::c2:
      c.destroy<c2_c_>();
      break;
    default:
      break;
  }
}
void mcch_msg_type_c::later_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c2:
      c.init<c2_c_>();
      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<c2_c_>());
      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<c2_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c2:
      j.write_fieldname("c2");
      c.get<c2_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_");
  }
  j.end_obj();
}
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<c2_c_>().pack(bref));
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mcch_msg_type_c::later_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c2:
      HANDLE_CODE(c.get<c2_c_>().unpack(bref));
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mcch_msg_type_c::later_c_::c2_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("mbmsCountingRequest-r10");
  c.to_json(j);
  j.end_obj();
}
SRSASN_CODE mcch_msg_type_c::later_c_::c2_c_::pack(bit_ref& bref) const
{
  HANDLE_CODE(c.pack(bref));
  return SRSASN_SUCCESS;
}
SRSASN_CODE mcch_msg_type_c::later_c_::c2_c_::unpack(cbit_ref& bref)
{
  HANDLE_CODE(c.unpack(bref));
  return SRSASN_SUCCESS;
}

// MCCH-Message ::= SEQUENCE
SRSASN_CODE mcch_msg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE mcch_msg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void mcch_msg_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("MCCH-Message");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// Paging-v1530-IEs ::= SEQUENCE
SRSASN_CODE paging_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(access_type_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE paging_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(access_type_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
void paging_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (access_type_present) {
    j.write_str("accessType", "non3GPP");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// Paging-v1310-IEs ::= SEQUENCE
SRSASN_CODE paging_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(redist_ind_r13_present, 1));
  HANDLE_CODE(bref.pack(sys_info_mod_e_drx_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE paging_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(redist_ind_r13_present, 1));
  HANDLE_CODE(bref.unpack(sys_info_mod_e_drx_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void paging_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (redist_ind_r13_present) {
    j.write_str("redistributionIndication-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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// S-TMSI ::= SEQUENCE
SRSASN_CODE s_tmsi_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(mmec.pack(bref));
  HANDLE_CODE(m_tmsi.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE s_tmsi_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(mmec.unpack(bref));
  HANDLE_CODE(m_tmsi.unpack(bref));

  return SRSASN_SUCCESS;
}
void s_tmsi_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("mmec", mmec.to_string());
  j.write_str("m-TMSI", m_tmsi.to_string());
  j.end_obj();
}

// Paging-v1130-IEs ::= SEQUENCE
SRSASN_CODE paging_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(eab_param_mod_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE paging_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(eab_param_mod_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void paging_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (eab_param_mod_r11_present) {
    j.write_str("eab-ParamModification-r11", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// PagingUE-Identity ::= CHOICE
void paging_ue_id_c::destroy_()
{
  switch (type_) {
    case types::s_tmsi:
      c.destroy<s_tmsi_s>();
      break;
    case types::imsi:
      c.destroy<imsi_l>();
      break;
    case types::ng_minus5_g_s_tmsi_r15:
      c.destroy<fixed_bitstring<48> >();
      break;
    case types::i_rnti_r15:
      c.destroy<fixed_bitstring<40> >();
      break;
    default:
      break;
  }
}
void paging_ue_id_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::s_tmsi:
      c.init<s_tmsi_s>();
      break;
    case types::imsi:
      c.init<imsi_l>();
      break;
    case types::ng_minus5_g_s_tmsi_r15:
      c.init<fixed_bitstring<48> >();
      break;
    case types::i_rnti_r15:
      c.init<fixed_bitstring<40> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "paging_ue_id_c");
  }
}
paging_ue_id_c::paging_ue_id_c(const paging_ue_id_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::s_tmsi:
      c.init(other.c.get<s_tmsi_s>());
      break;
    case types::imsi:
      c.init(other.c.get<imsi_l>());
      break;
    case types::ng_minus5_g_s_tmsi_r15:
      c.init(other.c.get<fixed_bitstring<48> >());
      break;
    case types::i_rnti_r15:
      c.init(other.c.get<fixed_bitstring<40> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "paging_ue_id_c");
  }
}
paging_ue_id_c& paging_ue_id_c::operator=(const paging_ue_id_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::s_tmsi:
      c.set(other.c.get<s_tmsi_s>());
      break;
    case types::imsi:
      c.set(other.c.get<imsi_l>());
      break;
    case types::ng_minus5_g_s_tmsi_r15:
      c.set(other.c.get<fixed_bitstring<48> >());
      break;
    case types::i_rnti_r15:
      c.set(other.c.get<fixed_bitstring<40> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "paging_ue_id_c");
  }

  return *this;
}
void paging_ue_id_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::s_tmsi:
      j.write_fieldname("s-TMSI");
      c.get<s_tmsi_s>().to_json(j);
      break;
    case types::imsi:
      j.start_array("imsi");
      for (const auto& e1 : c.get<imsi_l>()) {
        j.write_int(e1);
      }
      j.end_array();
      break;
    case types::ng_minus5_g_s_tmsi_r15:
      j.write_str("ng-5G-S-TMSI-r15", c.get<fixed_bitstring<48> >().to_string());
      break;
    case types::i_rnti_r15:
      j.write_str("i-RNTI-r15", c.get<fixed_bitstring<40> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "paging_ue_id_c");
  }
  j.end_obj();
}
SRSASN_CODE paging_ue_id_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::s_tmsi:
      HANDLE_CODE(c.get<s_tmsi_s>().pack(bref));
      break;
    case types::imsi:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<imsi_l>(), 6, 21, integer_packer<uint8_t>(0, 9)));
      break;
    case types::ng_minus5_g_s_tmsi_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<fixed_bitstring<48> >().pack(bref));
    } break;
    case types::i_rnti_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<fixed_bitstring<40> >().pack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "paging_ue_id_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE paging_ue_id_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::s_tmsi:
      HANDLE_CODE(c.get<s_tmsi_s>().unpack(bref));
      break;
    case types::imsi:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<imsi_l>(), bref, 6, 21, integer_packer<uint8_t>(0, 9)));
      break;
    case types::ng_minus5_g_s_tmsi_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<fixed_bitstring<48> >().unpack(bref));
    } break;
    case types::i_rnti_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<fixed_bitstring<40> >().unpack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "paging_ue_id_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// Paging-v920-IEs ::= SEQUENCE
SRSASN_CODE paging_v920_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cmas_ind_r9_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE paging_v920_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cmas_ind_r9_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void paging_v920_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cmas_ind_r9_present) {
    j.write_str("cmas-Indication-r9", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// PagingRecord ::= SEQUENCE
SRSASN_CODE paging_record_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(ue_id.pack(bref));
  HANDLE_CODE(cn_domain.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE paging_record_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(ue_id.unpack(bref));
  HANDLE_CODE(cn_domain.unpack(bref));

  return SRSASN_SUCCESS;
}
void paging_record_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ue-Identity");
  ue_id.to_json(j);
  j.write_str("cn-Domain", cn_domain.to_string());
  j.end_obj();
}

// Paging-v890-IEs ::= SEQUENCE
SRSASN_CODE paging_v890_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 paging_v890_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 paging_v890_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();
}

// Paging ::= SEQUENCE
SRSASN_CODE paging_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(paging_record_list_present, 1));
  HANDLE_CODE(bref.pack(sys_info_mod_present, 1));
  HANDLE_CODE(bref.pack(etws_ind_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (paging_record_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, paging_record_list, 1, 16));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE paging_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(paging_record_list_present, 1));
  HANDLE_CODE(bref.unpack(sys_info_mod_present, 1));
  HANDLE_CODE(bref.unpack(etws_ind_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (paging_record_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(paging_record_list, bref, 1, 16));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void paging_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (paging_record_list_present) {
    j.start_array("pagingRecordList");
    for (const auto& e1 : paging_record_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (sys_info_mod_present) {
    j.write_str("systemInfoModification", "true");
  }
  if (etws_ind_present) {
    j.write_str("etws-Indication", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// PCCH-MessageType ::= CHOICE
void pcch_msg_type_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void pcch_msg_type_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "pcch_msg_type_c");
  }
  j.end_obj();
}
SRSASN_CODE pcch_msg_type_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().pack(bref));
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "pcch_msg_type_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE pcch_msg_type_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::msg_class_ext:
      break;
    default:
      log_invalid_choice_id(type_, "pcch_msg_type_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void pcch_msg_type_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("paging");
  c.to_json(j);
  j.end_obj();
}
SRSASN_CODE pcch_msg_type_c::c1_c_::pack(bit_ref& bref) const
{
  HANDLE_CODE(c.pack(bref));
  return SRSASN_SUCCESS;
}
SRSASN_CODE pcch_msg_type_c::c1_c_::unpack(cbit_ref& bref)
{
  HANDLE_CODE(c.unpack(bref));
  return SRSASN_SUCCESS;
}

// PCCH-Message ::= SEQUENCE
SRSASN_CODE pcch_msg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE pcch_msg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void pcch_msg_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("PCCH-Message");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// MBMSSessionInfo-r13 ::= SEQUENCE
SRSASN_CODE mbms_session_info_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(session_id_r13_present, 1));

  HANDLE_CODE(tmgi_r13.pack(bref));
  if (session_id_r13_present) {
    HANDLE_CODE(session_id_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_session_info_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(session_id_r13_present, 1));

  HANDLE_CODE(tmgi_r13.unpack(bref));
  if (session_id_r13_present) {
    HANDLE_CODE(session_id_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mbms_session_info_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("tmgi-r13");
  tmgi_r13.to_json(j);
  if (session_id_r13_present) {
    j.write_str("sessionId-r13", session_id_r13.to_string());
  }
  j.end_obj();
}

// SC-MTCH-SchedulingInfo-BR-r14 ::= SEQUENCE
SRSASN_CODE sc_mtch_sched_info_br_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_br_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_br_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();
}

void sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_::destroy_() {}
void sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_::sched_period_start_offset_scptm_r14_c_(
    const sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf10:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf20:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf32:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf40:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf64:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf80:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf128:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf160:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf256:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf320:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf512:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf640:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf1024:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf2048:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf4096:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf8192:
      c.init(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_");
  }
}
sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_&
sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_::
operator=(const sc_mtch_sched_info_br_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<uint8_t>());
      break;
    case types::sf20:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf32:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf40:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf64:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf80:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf128:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf160:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf256:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf320:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf512:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf640:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf1024:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf2048:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf4096:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf8192:
      c.set(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_");
  }

  return *this;
}
void sc_mtch_sched_info_br_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<uint8_t>());
      break;
    case types::sf20:
      j.write_int("sf20", c.get<uint8_t>());
      break;
    case types::sf32:
      j.write_int("sf32", c.get<uint8_t>());
      break;
    case types::sf40:
      j.write_int("sf40", c.get<uint8_t>());
      break;
    case types::sf64:
      j.write_int("sf64", c.get<uint8_t>());
      break;
    case types::sf80:
      j.write_int("sf80", c.get<uint8_t>());
      break;
    case types::sf128:
      j.write_int("sf128", c.get<uint8_t>());
      break;
    case types::sf160:
      j.write_int("sf160", c.get<uint8_t>());
      break;
    case types::sf256:
      j.write_int("sf256", c.get<uint16_t>());
      break;
    case types::sf320:
      j.write_int("sf320", c.get<uint16_t>());
      break;
    case types::sf512:
      j.write_int("sf512", c.get<uint16_t>());
      break;
    case types::sf640:
      j.write_int("sf640", c.get<uint16_t>());
      break;
    case types::sf1024:
      j.write_int("sf1024", c.get<uint16_t>());
      break;
    case types::sf2048:
      j.write_int("sf2048", c.get<uint16_t>());
      break;
    case types::sf4096:
      j.write_int("sf4096", c.get<uint16_t>());
      break;
    case types::sf8192:
      j.write_int("sf8192", c.get<uint16_t>());
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE sc_mtch_sched_info_br_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>(), (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf32:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)31u));
      break;
    case types::sf40:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf64:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)63u));
      break;
    case types::sf80:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf128:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    case types::sf160:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    case types::sf256:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)255u));
      break;
    case types::sf320:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::sf512:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::sf640:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::sf1024:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1023u));
      break;
    case types::sf2048:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)2047u));
      break;
    case types::sf4096:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)4095u));
      break;
    case types::sf8192:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)8191u));
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf10:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf32:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)31u));
      break;
    case types::sf40:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf64:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)63u));
      break;
    case types::sf80:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf128:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    case types::sf160:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    case types::sf256:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)255u));
      break;
    case types::sf320:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::sf512:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::sf640:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::sf1024:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1023u));
      break;
    case types::sf2048:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)2047u));
      break;
    case types::sf4096:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)4095u));
      break;
    case types::sf8192:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)8191u));
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_br_r14_s::sched_period_start_offset_scptm_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SC-MTCH-SchedulingInfo-r13 ::= SEQUENCE
SRSASN_CODE sc_mtch_sched_info_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(on_dur_timer_scptm_r13.pack(bref));
  HANDLE_CODE(drx_inactivity_timer_scptm_r13.pack(bref));
  HANDLE_CODE(sched_period_start_offset_scptm_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mtch_sched_info_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(on_dur_timer_scptm_r13.unpack(bref));
  HANDLE_CODE(drx_inactivity_timer_scptm_r13.unpack(bref));
  HANDLE_CODE(sched_period_start_offset_scptm_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void sc_mtch_sched_info_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("onDurationTimerSCPTM-r13", on_dur_timer_scptm_r13.to_string());
  j.write_str("drx-InactivityTimerSCPTM-r13", drx_inactivity_timer_scptm_r13.to_string());
  j.write_fieldname("schedulingPeriodStartOffsetSCPTM-r13");
  sched_period_start_offset_scptm_r13.to_json(j);
  j.end_obj();
}

void sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_::destroy_() {}
void sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_::sched_period_start_offset_scptm_r13_c_(
    const sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf10:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf20:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf32:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf40:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf64:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf80:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf128:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf160:
      c.init(other.c.get<uint8_t>());
      break;
    case types::sf256:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf320:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf512:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf640:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf1024:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf2048:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf4096:
      c.init(other.c.get<uint16_t>());
      break;
    case types::sf8192:
      c.init(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_");
  }
}
sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_&
sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_::
operator=(const sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf10:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf20:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf32:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf40:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf64:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf80:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf128:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf160:
      c.set(other.c.get<uint8_t>());
      break;
    case types::sf256:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf320:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf512:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf640:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf1024:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf2048:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf4096:
      c.set(other.c.get<uint16_t>());
      break;
    case types::sf8192:
      c.set(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_");
  }

  return *this;
}
void sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf10:
      j.write_int("sf10", c.get<uint8_t>());
      break;
    case types::sf20:
      j.write_int("sf20", c.get<uint8_t>());
      break;
    case types::sf32:
      j.write_int("sf32", c.get<uint8_t>());
      break;
    case types::sf40:
      j.write_int("sf40", c.get<uint8_t>());
      break;
    case types::sf64:
      j.write_int("sf64", c.get<uint8_t>());
      break;
    case types::sf80:
      j.write_int("sf80", c.get<uint8_t>());
      break;
    case types::sf128:
      j.write_int("sf128", c.get<uint8_t>());
      break;
    case types::sf160:
      j.write_int("sf160", c.get<uint8_t>());
      break;
    case types::sf256:
      j.write_int("sf256", c.get<uint16_t>());
      break;
    case types::sf320:
      j.write_int("sf320", c.get<uint16_t>());
      break;
    case types::sf512:
      j.write_int("sf512", c.get<uint16_t>());
      break;
    case types::sf640:
      j.write_int("sf640", c.get<uint16_t>());
      break;
    case types::sf1024:
      j.write_int("sf1024", c.get<uint16_t>());
      break;
    case types::sf2048:
      j.write_int("sf2048", c.get<uint16_t>());
      break;
    case types::sf4096:
      j.write_int("sf4096", c.get<uint16_t>());
      break;
    case types::sf8192:
      j.write_int("sf8192", c.get<uint16_t>());
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf10:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf32:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)31u));
      break;
    case types::sf40:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf64:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)63u));
      break;
    case types::sf80:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf128:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    case types::sf160:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    case types::sf256:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)255u));
      break;
    case types::sf320:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::sf512:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::sf640:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::sf1024:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1023u));
      break;
    case types::sf2048:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)2048u));
      break;
    case types::sf4096:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)4096u));
      break;
    case types::sf8192:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)8192u));
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf10:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)9u));
      break;
    case types::sf20:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)19u));
      break;
    case types::sf32:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)31u));
      break;
    case types::sf40:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)39u));
      break;
    case types::sf64:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)63u));
      break;
    case types::sf80:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::sf128:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    case types::sf160:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    case types::sf256:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)255u));
      break;
    case types::sf320:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::sf512:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::sf640:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::sf1024:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1023u));
      break;
    case types::sf2048:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)2048u));
      break;
    case types::sf4096:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)4096u));
      break;
    case types::sf8192:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)8192u));
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_sched_info_r13_s::sched_period_start_offset_scptm_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// PCI-ARFCN-r13 ::= SEQUENCE
SRSASN_CODE pci_arfcn_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(carrier_freq_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, pci_r13, (uint16_t)0u, (uint16_t)503u));
  if (carrier_freq_r13_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_r13, (uint32_t)0u, (uint32_t)262143u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pci_arfcn_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(carrier_freq_r13_present, 1));

  HANDLE_CODE(unpack_integer(pci_r13, bref, (uint16_t)0u, (uint16_t)503u));
  if (carrier_freq_r13_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_r13, bref, (uint32_t)0u, (uint32_t)262143u));
  }

  return SRSASN_SUCCESS;
}
void pci_arfcn_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r13", pci_r13);
  if (carrier_freq_r13_present) {
    j.write_int("carrierFreq-r13", carrier_freq_r13);
  }
  j.end_obj();
}

// SC-MTCH-Info-BR-r14 ::= SEQUENCE
SRSASN_CODE sc_mtch_info_br_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(sc_mtch_sched_info_r14_present, 1));
  HANDLE_CODE(bref.pack(sc_mtch_neighbour_cell_r14_present, 1));
  HANDLE_CODE(bref.pack(p_a_r14_present, 1));

  HANDLE_CODE(pack_integer(bref, sc_mtch_carrier_freq_r14, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(mbms_session_info_r14.pack(bref));
  HANDLE_CODE(g_rnti_r14.pack(bref));
  if (sc_mtch_sched_info_r14_present) {
    HANDLE_CODE(sc_mtch_sched_info_r14.pack(bref));
  }
  if (sc_mtch_neighbour_cell_r14_present) {
    HANDLE_CODE(sc_mtch_neighbour_cell_r14.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, mpdcch_nb_sc_mtch_r14, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(mpdcch_num_repeat_sc_mtch_r14.pack(bref));
  HANDLE_CODE(mpdcch_start_sf_sc_mtch_r14.pack(bref));
  HANDLE_CODE(mpdcch_pdsch_hop_cfg_sc_mtch_r14.pack(bref));
  HANDLE_CODE(mpdcch_pdsch_cemode_cfg_sc_mtch_r14.pack(bref));
  HANDLE_CODE(mpdcch_pdsch_max_bw_sc_mtch_r14.pack(bref));
  HANDLE_CODE(mpdcch_offset_sc_mtch_r14.pack(bref));
  if (p_a_r14_present) {
    HANDLE_CODE(p_a_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mtch_info_br_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(sc_mtch_sched_info_r14_present, 1));
  HANDLE_CODE(bref.unpack(sc_mtch_neighbour_cell_r14_present, 1));
  HANDLE_CODE(bref.unpack(p_a_r14_present, 1));

  HANDLE_CODE(unpack_integer(sc_mtch_carrier_freq_r14, bref, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(mbms_session_info_r14.unpack(bref));
  HANDLE_CODE(g_rnti_r14.unpack(bref));
  if (sc_mtch_sched_info_r14_present) {
    HANDLE_CODE(sc_mtch_sched_info_r14.unpack(bref));
  }
  if (sc_mtch_neighbour_cell_r14_present) {
    HANDLE_CODE(sc_mtch_neighbour_cell_r14.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(mpdcch_nb_sc_mtch_r14, bref, (uint8_t)1u, (uint8_t)16u));
  HANDLE_CODE(mpdcch_num_repeat_sc_mtch_r14.unpack(bref));
  HANDLE_CODE(mpdcch_start_sf_sc_mtch_r14.unpack(bref));
  HANDLE_CODE(mpdcch_pdsch_hop_cfg_sc_mtch_r14.unpack(bref));
  HANDLE_CODE(mpdcch_pdsch_cemode_cfg_sc_mtch_r14.unpack(bref));
  HANDLE_CODE(mpdcch_pdsch_max_bw_sc_mtch_r14.unpack(bref));
  HANDLE_CODE(mpdcch_offset_sc_mtch_r14.unpack(bref));
  if (p_a_r14_present) {
    HANDLE_CODE(p_a_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sc_mtch_info_br_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sc-mtch-CarrierFreq-r14", sc_mtch_carrier_freq_r14);
  j.write_fieldname("mbmsSessionInfo-r14");
  mbms_session_info_r14.to_json(j);
  j.write_str("g-RNTI-r14", g_rnti_r14.to_string());
  if (sc_mtch_sched_info_r14_present) {
    j.write_fieldname("sc-mtch-schedulingInfo-r14");
    sc_mtch_sched_info_r14.to_json(j);
  }
  if (sc_mtch_neighbour_cell_r14_present) {
    j.write_str("sc-mtch-neighbourCell-r14", sc_mtch_neighbour_cell_r14.to_string());
  }
  j.write_int("mpdcch-Narrowband-SC-MTCH-r14", mpdcch_nb_sc_mtch_r14);
  j.write_str("mpdcch-NumRepetition-SC-MTCH-r14", mpdcch_num_repeat_sc_mtch_r14.to_string());
  j.write_fieldname("mpdcch-StartSF-SC-MTCH-r14");
  mpdcch_start_sf_sc_mtch_r14.to_json(j);
  j.write_str("mpdcch-PDSCH-HoppingConfig-SC-MTCH-r14", mpdcch_pdsch_hop_cfg_sc_mtch_r14.to_string());
  j.write_str("mpdcch-PDSCH-CEmodeConfig-SC-MTCH-r14", mpdcch_pdsch_cemode_cfg_sc_mtch_r14.to_string());
  j.write_str("mpdcch-PDSCH-MaxBandwidth-SC-MTCH-r14", mpdcch_pdsch_max_bw_sc_mtch_r14.to_string());
  j.write_str("mpdcch-Offset-SC-MTCH-r14", mpdcch_offset_sc_mtch_r14.to_string());
  if (p_a_r14_present) {
    j.write_str("p-a-r14", p_a_r14.to_string());
  }
  j.end_obj();
}

void sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_::destroy_() {}
void sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_::mpdcch_start_sf_sc_mtch_r14_c_(
    const sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::fdd_r14:
      c.init(other.c.get<fdd_r14_e_>());
      break;
    case types::tdd_r14:
      c.init(other.c.get<tdd_r14_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_");
  }
}
sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_& sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_::
                                                       operator=(const sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::fdd_r14:
      c.set(other.c.get<fdd_r14_e_>());
      break;
    case types::tdd_r14:
      c.set(other.c.get<tdd_r14_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_");
  }

  return *this;
}
void sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::fdd_r14:
      j.write_str("fdd-r14", c.get<fdd_r14_e_>().to_string());
      break;
    case types::tdd_r14:
      j.write_str("tdd-r14", c.get<tdd_r14_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_");
  }
  j.end_obj();
}
SRSASN_CODE sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::fdd_r14:
      HANDLE_CODE(c.get<fdd_r14_e_>().pack(bref));
      break;
    case types::tdd_r14:
      HANDLE_CODE(c.get<tdd_r14_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::fdd_r14:
      HANDLE_CODE(c.get<fdd_r14_e_>().unpack(bref));
      break;
    case types::tdd_r14:
      HANDLE_CODE(c.get<tdd_r14_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sc_mtch_info_br_r14_s::mpdcch_start_sf_sc_mtch_r14_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SC-MTCH-Info-r13 ::= SEQUENCE
SRSASN_CODE sc_mtch_info_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(sc_mtch_sched_info_r13_present, 1));
  HANDLE_CODE(bref.pack(sc_mtch_neighbour_cell_r13_present, 1));

  HANDLE_CODE(mbms_session_info_r13.pack(bref));
  HANDLE_CODE(g_rnti_r13.pack(bref));
  if (sc_mtch_sched_info_r13_present) {
    HANDLE_CODE(sc_mtch_sched_info_r13.pack(bref));
  }
  if (sc_mtch_neighbour_cell_r13_present) {
    HANDLE_CODE(sc_mtch_neighbour_cell_r13.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= p_a_r13_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(p_a_r13_present, 1));
      if (p_a_r13_present) {
        HANDLE_CODE(p_a_r13.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mtch_info_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(sc_mtch_sched_info_r13_present, 1));
  HANDLE_CODE(bref.unpack(sc_mtch_neighbour_cell_r13_present, 1));

  HANDLE_CODE(mbms_session_info_r13.unpack(bref));
  HANDLE_CODE(g_rnti_r13.unpack(bref));
  if (sc_mtch_sched_info_r13_present) {
    HANDLE_CODE(sc_mtch_sched_info_r13.unpack(bref));
  }
  if (sc_mtch_neighbour_cell_r13_present) {
    HANDLE_CODE(sc_mtch_neighbour_cell_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);

      HANDLE_CODE(bref.unpack(p_a_r13_present, 1));
      if (p_a_r13_present) {
        HANDLE_CODE(p_a_r13.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sc_mtch_info_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("mbmsSessionInfo-r13");
  mbms_session_info_r13.to_json(j);
  j.write_str("g-RNTI-r13", g_rnti_r13.to_string());
  if (sc_mtch_sched_info_r13_present) {
    j.write_fieldname("sc-mtch-schedulingInfo-r13");
    sc_mtch_sched_info_r13.to_json(j);
  }
  if (sc_mtch_neighbour_cell_r13_present) {
    j.write_str("sc-mtch-neighbourCell-r13", sc_mtch_neighbour_cell_r13.to_string());
  }
  if (ext) {
    if (p_a_r13_present) {
      j.write_str("p-a-r13", p_a_r13.to_string());
    }
  }
  j.end_obj();
}

// SCPTMConfiguration-v1340 ::= SEQUENCE
SRSASN_CODE scptm_cfg_v1340_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(p_b_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (p_b_r13_present) {
    HANDLE_CODE(pack_integer(bref, p_b_r13, (uint8_t)0u, (uint8_t)3u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scptm_cfg_v1340_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(p_b_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (p_b_r13_present) {
    HANDLE_CODE(unpack_integer(p_b_r13, bref, (uint8_t)0u, (uint8_t)3u));
  }

  return SRSASN_SUCCESS;
}
void scptm_cfg_v1340_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (p_b_r13_present) {
    j.write_int("p-b-r13", p_b_r13);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// SCPTMConfiguration-BR-r14 ::= SEQUENCE
SRSASN_CODE scptm_cfg_br_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(scptm_neighbour_cell_list_r14_present, 1));
  HANDLE_CODE(bref.pack(p_b_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, 128));
  if (scptm_neighbour_cell_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scptm_neighbour_cell_list_r14, 1, 8));
  }
  if (p_b_r14_present) {
    HANDLE_CODE(pack_integer(bref, p_b_r14, (uint8_t)0u, (uint8_t)3u));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scptm_cfg_br_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(scptm_neighbour_cell_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(p_b_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, 128));
  if (scptm_neighbour_cell_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scptm_neighbour_cell_list_r14, bref, 1, 8));
  }
  if (p_b_r14_present) {
    HANDLE_CODE(unpack_integer(p_b_r14, bref, (uint8_t)0u, (uint8_t)3u));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scptm_cfg_br_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 (p_b_r14_present) {
    j.write_int("p-b-r14", p_b_r14);
  }
  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();
}

// SCPTMConfiguration-r13 ::= SEQUENCE
SRSASN_CODE scptm_cfg_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(scptm_neighbour_cell_list_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_dyn_seq_of(bref, sc_mtch_info_list_r13, 0, 1023));
  if (scptm_neighbour_cell_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scptm_neighbour_cell_list_r13, 1, 8));
  }
  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 scptm_cfg_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(scptm_neighbour_cell_list_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_dyn_seq_of(sc_mtch_info_list_r13, bref, 0, 1023));
  if (scptm_neighbour_cell_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scptm_neighbour_cell_list_r13, bref, 1, 8));
  }
  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 scptm_cfg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("sc-mtch-InfoList-r13");
  for (const auto& e1 : sc_mtch_info_list_r13) {
    e1.to_json(j);
  }
  j.end_array();
  if (scptm_neighbour_cell_list_r13_present) {
    j.start_array("scptm-NeighbourCellList-r13");
    for (const auto& e1 : scptm_neighbour_cell_list_r13) {
      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();
}

// SC-MCCH-MessageType-r13 ::= CHOICE
void sc_mcch_msg_type_r13_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    case types::msg_class_ext:
      c.destroy<msg_class_ext_c_>();
      break;
    default:
      break;
  }
}
void sc_mcch_msg_type_r13_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      break;
    case types::msg_class_ext:
      c.init<msg_class_ext_c_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c");
  }
}
sc_mcch_msg_type_r13_c::sc_mcch_msg_type_r13_c(const sc_mcch_msg_type_r13_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::c1:
      c.init(other.c.get<c1_c_>());
      break;
    case types::msg_class_ext:
      c.init(other.c.get<msg_class_ext_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c");
  }
}
sc_mcch_msg_type_r13_c& sc_mcch_msg_type_r13_c::operator=(const sc_mcch_msg_type_r13_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::c1:
      c.set(other.c.get<c1_c_>());
      break;
    case types::msg_class_ext:
      c.set(other.c.get<msg_class_ext_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c");
  }

  return *this;
}
void sc_mcch_msg_type_r13_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      j.write_fieldname("messageClassExtension");
      c.get<msg_class_ext_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c");
  }
  j.end_obj();
}
SRSASN_CODE sc_mcch_msg_type_r13_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().pack(bref));
      break;
    case types::msg_class_ext:
      HANDLE_CODE(c.get<msg_class_ext_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mcch_msg_type_r13_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::msg_class_ext:
      HANDLE_CODE(c.get<msg_class_ext_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sc_mcch_msg_type_r13_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("scptmConfiguration-r13");
  c.to_json(j);
  j.end_obj();
}
SRSASN_CODE sc_mcch_msg_type_r13_c::c1_c_::pack(bit_ref& bref) const
{
  HANDLE_CODE(c.pack(bref));
  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mcch_msg_type_r13_c::c1_c_::unpack(cbit_ref& bref)
{
  HANDLE_CODE(c.unpack(bref));
  return SRSASN_SUCCESS;
}

void sc_mcch_msg_type_r13_c::msg_class_ext_c_::destroy_()
{
  switch (type_) {
    case types::c2:
      c.destroy<c2_c_>();
      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<c2_c_>();
      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<c2_c_>());
      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<c2_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c2:
      j.write_fieldname("c2");
      c.get<c2_c_>().to_json(j);
      break;
    case types::msg_class_ext_future_r14:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_");
  }
  j.end_obj();
}
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<c2_c_>().pack(bref));
      break;
    case types::msg_class_ext_future_r14:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mcch_msg_type_r13_c::msg_class_ext_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c2:
      HANDLE_CODE(c.get<c2_c_>().unpack(bref));
      break;
    case types::msg_class_ext_future_r14:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sc_mcch_msg_type_r13_c::msg_class_ext_c_::c2_c_::set(types::options e)
{
  type_ = e;
}
void sc_mcch_msg_type_r13_c::msg_class_ext_c_::c2_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::scptm_cfg_br_r14:
      j.write_fieldname("scptmConfiguration-BR-r14");
      c.to_json(j);
      break;
    case types::spare:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_::c2_c_");
  }
  j.end_obj();
}
SRSASN_CODE sc_mcch_msg_type_r13_c::msg_class_ext_c_::c2_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::scptm_cfg_br_r14:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_::c2_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mcch_msg_type_r13_c::msg_class_ext_c_::c2_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::scptm_cfg_br_r14:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare:
      break;
    default:
      log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::msg_class_ext_c_::c2_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SC-MCCH-Message-r13 ::= SEQUENCE
SRSASN_CODE sc_mcch_msg_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE sc_mcch_msg_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void sc_mcch_msg_r13_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("SC-MCCH-Message-r13");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// InitialUE-Identity ::= CHOICE
void init_ue_id_c::destroy_()
{
  switch (type_) {
    case types::s_tmsi:
      c.destroy<s_tmsi_s>();
      break;
    case types::random_value:
      c.destroy<fixed_bitstring<40> >();
      break;
    default:
      break;
  }
}
void init_ue_id_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::s_tmsi:
      c.init<s_tmsi_s>();
      break;
    case types::random_value:
      c.init<fixed_bitstring<40> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "init_ue_id_c");
  }
}
init_ue_id_c::init_ue_id_c(const init_ue_id_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::s_tmsi:
      c.init(other.c.get<s_tmsi_s>());
      break;
    case types::random_value:
      c.init(other.c.get<fixed_bitstring<40> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "init_ue_id_c");
  }
}
init_ue_id_c& init_ue_id_c::operator=(const init_ue_id_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::s_tmsi:
      c.set(other.c.get<s_tmsi_s>());
      break;
    case types::random_value:
      c.set(other.c.get<fixed_bitstring<40> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "init_ue_id_c");
  }

  return *this;
}
void init_ue_id_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::s_tmsi:
      j.write_fieldname("s-TMSI");
      c.get<s_tmsi_s>().to_json(j);
      break;
    case types::random_value:
      j.write_str("randomValue", c.get<fixed_bitstring<40> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "init_ue_id_c");
  }
  j.end_obj();
}
SRSASN_CODE init_ue_id_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::s_tmsi:
      HANDLE_CODE(c.get<s_tmsi_s>().pack(bref));
      break;
    case types::random_value:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "init_ue_id_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE init_ue_id_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::s_tmsi:
      HANDLE_CODE(c.get<s_tmsi_s>().unpack(bref));
      break;
    case types::random_value:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "init_ue_id_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ReestabUE-Identity ::= SEQUENCE
SRSASN_CODE reestab_ue_id_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(c_rnti.pack(bref));
  HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(short_mac_i.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE reestab_ue_id_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(c_rnti.unpack(bref));
  HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(short_mac_i.unpack(bref));

  return SRSASN_SUCCESS;
}
void reestab_ue_id_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("c-RNTI", c_rnti.to_string());
  j.write_int("physCellId", pci);
  j.write_str("shortMAC-I", short_mac_i.to_string());
  j.end_obj();
}

// RRCConnectionReestablishmentRequest-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_request_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(ue_id.pack(bref));
  HANDLE_CODE(reest_cause.pack(bref));
  HANDLE_CODE(spare.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_request_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(ue_id.unpack(bref));
  HANDLE_CODE(reest_cause.unpack(bref));
  HANDLE_CODE(spare.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_request_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ue-Identity");
  ue_id.to_json(j);
  j.write_str("reestablishmentCause", reest_cause.to_string());
  j.write_str("spare", spare.to_string());
  j.end_obj();
}

// RRCConnectionRequest-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_request_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(ue_id.pack(bref));
  HANDLE_CODE(establishment_cause.pack(bref));
  HANDLE_CODE(spare.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_request_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(ue_id.unpack(bref));
  HANDLE_CODE(establishment_cause.unpack(bref));
  HANDLE_CODE(spare.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_request_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("ue-Identity");
  ue_id.to_json(j);
  j.write_str("establishmentCause", establishment_cause.to_string());
  j.write_str("spare", spare.to_string());
  j.end_obj();
}

// RRCConnectionResumeRequest-5GC-r15-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_request_minus5_gc_r15_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(resume_id_r15.pack(bref));
  HANDLE_CODE(short_resume_mac_i_r15.pack(bref));
  HANDLE_CODE(resume_cause_r15.pack(bref));
  HANDLE_CODE(spare.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_request_minus5_gc_r15_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(resume_id_r15.unpack(bref));
  HANDLE_CODE(short_resume_mac_i_r15.unpack(bref));
  HANDLE_CODE(resume_cause_r15.unpack(bref));
  HANDLE_CODE(spare.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_resume_request_minus5_gc_r15_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("resumeIdentity-r15");
  resume_id_r15.to_json(j);
  j.write_str("shortResumeMAC-I-r15", short_resume_mac_i_r15.to_string());
  j.write_str("resumeCause-r15", resume_cause_r15.to_string());
  j.write_str("spare", spare.to_string());
  j.end_obj();
}

void rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_::destroy_()
{
  switch (type_) {
    case types::full_i_rnti_r15:
      c.destroy<fixed_bitstring<40> >();
      break;
    case types::short_i_rnti_r15:
      c.destroy<fixed_bitstring<24> >();
      break;
    default:
      break;
  }
}
void rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::full_i_rnti_r15:
      c.init<fixed_bitstring<40> >();
      break;
    case types::short_i_rnti_r15:
      c.init<fixed_bitstring<24> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_");
  }
}
rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_::resume_id_r15_c_(
    const rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::full_i_rnti_r15:
      c.init(other.c.get<fixed_bitstring<40> >());
      break;
    case types::short_i_rnti_r15:
      c.init(other.c.get<fixed_bitstring<24> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_");
  }
}
rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_&
rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_::
operator=(const rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::full_i_rnti_r15:
      c.set(other.c.get<fixed_bitstring<40> >());
      break;
    case types::short_i_rnti_r15:
      c.set(other.c.get<fixed_bitstring<24> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_");
  }

  return *this;
}
void rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::full_i_rnti_r15:
      j.write_str("fullI-RNTI-r15", c.get<fixed_bitstring<40> >().to_string());
      break;
    case types::short_i_rnti_r15:
      j.write_str("shortI-RNTI-r15", c.get<fixed_bitstring<24> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::full_i_rnti_r15:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().pack(bref));
      break;
    case types::short_i_rnti_r15:
      HANDLE_CODE(c.get<fixed_bitstring<24> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::full_i_rnti_r15:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().unpack(bref));
      break;
    case types::short_i_rnti_r15:
      HANDLE_CODE(c.get<fixed_bitstring<24> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_minus5_gc_r15_ies_s::resume_id_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionResumeRequest-r13-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_request_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(spare.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_request_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(spare.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_resume_request_r13_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("resumeIdentity-r13");
  resume_id_r13.to_json(j);
  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_str("spare", spare.to_string());
  j.end_obj();
}

void rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_::destroy_()
{
  switch (type_) {
    case types::resume_id_r13:
      c.destroy<fixed_bitstring<40> >();
      break;
    case types::truncated_resume_id_r13:
      c.destroy<fixed_bitstring<24> >();
      break;
    default:
      break;
  }
}
void rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::resume_id_r13:
      c.init<fixed_bitstring<40> >();
      break;
    case types::truncated_resume_id_r13:
      c.init<fixed_bitstring<24> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_");
  }
}
rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_::resume_id_r13_c_(
    const rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::resume_id_r13:
      c.init(other.c.get<fixed_bitstring<40> >());
      break;
    case types::truncated_resume_id_r13:
      c.init(other.c.get<fixed_bitstring<24> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_");
  }
}
rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_& rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_::
                                                     operator=(const rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::resume_id_r13:
      c.set(other.c.get<fixed_bitstring<40> >());
      break;
    case types::truncated_resume_id_r13:
      c.set(other.c.get<fixed_bitstring<24> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_");
  }

  return *this;
}
void rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::resume_id_r13:
      j.write_str("resumeID-r13", c.get<fixed_bitstring<40> >().to_string());
      break;
    case types::truncated_resume_id_r13:
      j.write_str("truncatedResumeID-r13", c.get<fixed_bitstring<24> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::resume_id_r13:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().pack(bref));
      break;
    case types::truncated_resume_id_r13:
      HANDLE_CODE(c.get<fixed_bitstring<24> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::resume_id_r13:
      HANDLE_CODE(c.get<fixed_bitstring<40> >().unpack(bref));
      break;
    case types::truncated_resume_id_r13:
      HANDLE_CODE(c.get<fixed_bitstring<24> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_ies_s::resume_id_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCEarlyDataRequest-r15-IEs ::= SEQUENCE
SRSASN_CODE rrc_early_data_request_r15_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(s_tmsi_r15.pack(bref));
  HANDLE_CODE(establishment_cause_r15.pack(bref));
  HANDLE_CODE(ded_info_nas_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_early_data_request_r15_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(s_tmsi_r15.unpack(bref));
  HANDLE_CODE(establishment_cause_r15.unpack(bref));
  HANDLE_CODE(ded_info_nas_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_early_data_request_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());
  j.write_str("dedicatedInfoNAS-r15", ded_info_nas_r15.to_string());
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RRCConnectionReestablishmentRequest ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_request_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_request_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_request_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_reest_request_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::rrc_conn_reest_request_r8:
      c.destroy<rrc_conn_reest_request_r8_ies_s>();
      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<rrc_conn_reest_request_r8_ies_s>();
      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<rrc_conn_reest_request_r8_ies_s>());
      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<rrc_conn_reest_request_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_reest_request_r8:
      j.write_fieldname("rrcConnectionReestablishmentRequest-r8");
      c.get<rrc_conn_reest_request_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_request_s::crit_exts_c_");
  }
  j.end_obj();
}
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<rrc_conn_reest_request_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_request_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_request_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_reest_request_r8:
      HANDLE_CODE(c.get<rrc_conn_reest_request_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_request_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionRequest ::= SEQUENCE
SRSASN_CODE rrc_conn_request_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_request_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_request_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_request_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::rrc_conn_request_r8:
      c.destroy<rrc_conn_request_r8_ies_s>();
      break;
    default:
      break;
  }
}
void rrc_conn_request_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::rrc_conn_request_r8:
      c.init<rrc_conn_request_r8_ies_s>();
      break;
    case types::crit_exts_future:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_request_s::crit_exts_c_");
  }
}
rrc_conn_request_s::crit_exts_c_::crit_exts_c_(const rrc_conn_request_s::crit_exts_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::rrc_conn_request_r8:
      c.init(other.c.get<rrc_conn_request_r8_ies_s>());
      break;
    case types::crit_exts_future:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_request_s::crit_exts_c_");
  }
}
rrc_conn_request_s::crit_exts_c_& rrc_conn_request_s::crit_exts_c_::
                                  operator=(const rrc_conn_request_s::crit_exts_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::rrc_conn_request_r8:
      c.set(other.c.get<rrc_conn_request_r8_ies_s>());
      break;
    case types::crit_exts_future:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_request_s::crit_exts_c_");
  }

  return *this;
}
void rrc_conn_request_s::crit_exts_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_request_r8:
      j.write_fieldname("rrcConnectionRequest-r8");
      c.get<rrc_conn_request_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_request_s::crit_exts_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_request_s::crit_exts_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_request_r8:
      HANDLE_CODE(c.get<rrc_conn_request_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_request_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_request_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_request_r8:
      HANDLE_CODE(c.get<rrc_conn_request_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_request_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionResumeRequest-r13 ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_request_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_request_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_conn_resume_request_r13_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_r13_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::rrc_conn_resume_request_r13:
      c.destroy<rrc_conn_resume_request_r13_ies_s>();
      break;
    case types::rrc_conn_resume_request_r15:
      c.destroy<rrc_conn_resume_request_minus5_gc_r15_ies_s>();
      break;
    default:
      break;
  }
}
void rrc_conn_resume_request_r13_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::rrc_conn_resume_request_r13:
      c.init<rrc_conn_resume_request_r13_ies_s>();
      break;
    case types::rrc_conn_resume_request_r15:
      c.init<rrc_conn_resume_request_minus5_gc_r15_ies_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_s::crit_exts_c_");
  }
}
rrc_conn_resume_request_r13_s::crit_exts_c_::crit_exts_c_(const rrc_conn_resume_request_r13_s::crit_exts_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::rrc_conn_resume_request_r13:
      c.init(other.c.get<rrc_conn_resume_request_r13_ies_s>());
      break;
    case types::rrc_conn_resume_request_r15:
      c.init(other.c.get<rrc_conn_resume_request_minus5_gc_r15_ies_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_s::crit_exts_c_");
  }
}
rrc_conn_resume_request_r13_s::crit_exts_c_& rrc_conn_resume_request_r13_s::crit_exts_c_::
                                             operator=(const rrc_conn_resume_request_r13_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<rrc_conn_resume_request_r13_ies_s>());
      break;
    case types::rrc_conn_resume_request_r15:
      c.set(other.c.get<rrc_conn_resume_request_minus5_gc_r15_ies_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_s::crit_exts_c_");
  }

  return *this;
}
void rrc_conn_resume_request_r13_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<rrc_conn_resume_request_r13_ies_s>().to_json(j);
      break;
    case types::rrc_conn_resume_request_r15:
      j.write_fieldname("rrcConnectionResumeRequest-r15");
      c.get<rrc_conn_resume_request_minus5_gc_r15_ies_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_s::crit_exts_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_resume_request_r13_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<rrc_conn_resume_request_r13_ies_s>().pack(bref));
      break;
    case types::rrc_conn_resume_request_r15:
      HANDLE_CODE(c.get<rrc_conn_resume_request_minus5_gc_r15_ies_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_request_r13_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<rrc_conn_resume_request_r13_ies_s>().unpack(bref));
      break;
    case types::rrc_conn_resume_request_r15:
      HANDLE_CODE(c.get<rrc_conn_resume_request_minus5_gc_r15_ies_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_request_r13_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCEarlyDataRequest-r15 ::= SEQUENCE
SRSASN_CODE rrc_early_data_request_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_early_data_request_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void rrc_early_data_request_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_r15_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::rrc_early_data_request_r15:
      c.destroy<rrc_early_data_request_r15_ies_s>();
      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<rrc_early_data_request_r15_ies_s>();
      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<rrc_early_data_request_r15_ies_s>());
      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<rrc_early_data_request_r15_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::rrc_early_data_request_r15:
      j.write_fieldname("rrcEarlyDataRequest-r15");
      c.get<rrc_early_data_request_r15_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_early_data_request_r15_s::crit_exts_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_early_data_request_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<rrc_early_data_request_r15_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_early_data_request_r15_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_early_data_request_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<rrc_early_data_request_r15_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_early_data_request_r15_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UL-CCCH-MessageType ::= CHOICE
void ul_ccch_msg_type_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    case types::msg_class_ext:
      c.destroy<msg_class_ext_c_>();
      break;
    default:
      break;
  }
}
void ul_ccch_msg_type_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      break;
    case types::msg_class_ext:
      c.init<msg_class_ext_c_>();
      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<c1_c_>());
      break;
    case types::msg_class_ext:
      c.init(other.c.get<msg_class_ext_c_>());
      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<c1_c_>());
      break;
    case types::msg_class_ext:
      c.set(other.c.get<msg_class_ext_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      j.write_fieldname("messageClassExtension");
      c.get<msg_class_ext_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c");
  }
  j.end_obj();
}
SRSASN_CODE ul_ccch_msg_type_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().pack(bref));
      break;
    case types::msg_class_ext:
      HANDLE_CODE(c.get<msg_class_ext_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ccch_msg_type_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::msg_class_ext:
      HANDLE_CODE(c.get<msg_class_ext_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_ccch_msg_type_c::c1_c_::destroy_()
{
  switch (type_) {
    case types::rrc_conn_reest_request:
      c.destroy<rrc_conn_reest_request_s>();
      break;
    case types::rrc_conn_request:
      c.destroy<rrc_conn_request_s>();
      break;
    default:
      break;
  }
}
void ul_ccch_msg_type_c::c1_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::rrc_conn_reest_request:
      c.init<rrc_conn_reest_request_s>();
      break;
    case types::rrc_conn_request:
      c.init<rrc_conn_request_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::c1_c_");
  }
}
ul_ccch_msg_type_c::c1_c_::c1_c_(const ul_ccch_msg_type_c::c1_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::rrc_conn_reest_request:
      c.init(other.c.get<rrc_conn_reest_request_s>());
      break;
    case types::rrc_conn_request:
      c.init(other.c.get<rrc_conn_request_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::c1_c_");
  }
}
ul_ccch_msg_type_c::c1_c_& ul_ccch_msg_type_c::c1_c_::operator=(const ul_ccch_msg_type_c::c1_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::rrc_conn_reest_request:
      c.set(other.c.get<rrc_conn_reest_request_s>());
      break;
    case types::rrc_conn_request:
      c.set(other.c.get<rrc_conn_request_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::c1_c_");
  }

  return *this;
}
void ul_ccch_msg_type_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_reest_request:
      j.write_fieldname("rrcConnectionReestablishmentRequest");
      c.get<rrc_conn_reest_request_s>().to_json(j);
      break;
    case types::rrc_conn_request:
      j.write_fieldname("rrcConnectionRequest");
      c.get<rrc_conn_request_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_ccch_msg_type_c::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_reest_request:
      HANDLE_CODE(c.get<rrc_conn_reest_request_s>().pack(bref));
      break;
    case types::rrc_conn_request:
      HANDLE_CODE(c.get<rrc_conn_request_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ccch_msg_type_c::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_reest_request:
      HANDLE_CODE(c.get<rrc_conn_reest_request_s>().unpack(bref));
      break;
    case types::rrc_conn_request:
      HANDLE_CODE(c.get<rrc_conn_request_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_ccch_msg_type_c::msg_class_ext_c_::destroy_()
{
  switch (type_) {
    case types::c2:
      c.destroy<c2_c_>();
      break;
    case types::msg_class_ext_future_r13:
      c.destroy<msg_class_ext_future_r13_c_>();
      break;
    default:
      break;
  }
}
void ul_ccch_msg_type_c::msg_class_ext_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c2:
      c.init<c2_c_>();
      break;
    case types::msg_class_ext_future_r13:
      c.init<msg_class_ext_future_r13_c_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_");
  }
}
ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_c_(const ul_ccch_msg_type_c::msg_class_ext_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::c2:
      c.init(other.c.get<c2_c_>());
      break;
    case types::msg_class_ext_future_r13:
      c.init(other.c.get<msg_class_ext_future_r13_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_");
  }
}
ul_ccch_msg_type_c::msg_class_ext_c_& ul_ccch_msg_type_c::msg_class_ext_c_::
                                      operator=(const ul_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<c2_c_>());
      break;
    case types::msg_class_ext_future_r13:
      c.set(other.c.get<msg_class_ext_future_r13_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_");
  }

  return *this;
}
void ul_ccch_msg_type_c::msg_class_ext_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::c2:
      j.write_fieldname("c2");
      c.get<c2_c_>().to_json(j);
      break;
    case types::msg_class_ext_future_r13:
      j.write_fieldname("messageClassExtensionFuture-r13");
      c.get<msg_class_ext_future_r13_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_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<c2_c_>().pack(bref));
      break;
    case types::msg_class_ext_future_r13:
      HANDLE_CODE(c.get<msg_class_ext_future_r13_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c2:
      HANDLE_CODE(c.get<c2_c_>().unpack(bref));
      break;
    case types::msg_class_ext_future_r13:
      HANDLE_CODE(c.get<msg_class_ext_future_r13_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("rrcConnectionResumeRequest-r13");
  c.to_json(j);
  j.end_obj();
}
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::pack(bit_ref& bref) const
{
  HANDLE_CODE(c.pack(bref));
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::unpack(cbit_ref& bref)
{
  HANDLE_CODE(c.unpack(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<c3_c_>();
      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<c3_c_>();
      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<c3_c_>());
      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<c3_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c3:
      j.write_fieldname("c3");
      c.get<c3_c_>().to_json(j);
      break;
    case types::msg_class_ext_future_r15:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c3:
      HANDLE_CODE(c.get<c3_c_>().pack(bref));
      break;
    case types::msg_class_ext_future_r15:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c3:
      HANDLE_CODE(c.get<c3_c_>().unpack(bref));
      break;
    case types::msg_class_ext_future_r15:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::c3_c_::set(types::options e)
{
  type_ = e;
}
void ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::c3_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.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::c3_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::c3_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_early_data_request_r15:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::c3_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::c3_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_early_data_request_r15:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::msg_class_ext_future_r13_c_::c3_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UL-CCCH-Message ::= SEQUENCE
SRSASN_CODE ul_ccch_msg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ccch_msg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void ul_ccch_msg_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("UL-CCCH-Message");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// CellGlobalIdCDMA2000 ::= CHOICE
void cell_global_id_cdma2000_c::destroy_()
{
  switch (type_) {
    case types::cell_global_id1_xrtt:
      c.destroy<fixed_bitstring<47> >();
      break;
    case types::cell_global_id_hrpd:
      c.destroy<fixed_bitstring<128> >();
      break;
    default:
      break;
  }
}
void cell_global_id_cdma2000_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cell_global_id1_xrtt:
      c.init<fixed_bitstring<47> >();
      break;
    case types::cell_global_id_hrpd:
      c.init<fixed_bitstring<128> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cell_global_id_cdma2000_c");
  }
}
cell_global_id_cdma2000_c::cell_global_id_cdma2000_c(const cell_global_id_cdma2000_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cell_global_id1_xrtt:
      c.init(other.c.get<fixed_bitstring<47> >());
      break;
    case types::cell_global_id_hrpd:
      c.init(other.c.get<fixed_bitstring<128> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cell_global_id_cdma2000_c");
  }
}
cell_global_id_cdma2000_c& cell_global_id_cdma2000_c::operator=(const cell_global_id_cdma2000_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cell_global_id1_xrtt:
      c.set(other.c.get<fixed_bitstring<47> >());
      break;
    case types::cell_global_id_hrpd:
      c.set(other.c.get<fixed_bitstring<128> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cell_global_id_cdma2000_c");
  }

  return *this;
}
void cell_global_id_cdma2000_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cell_global_id1_xrtt:
      j.write_str("cellGlobalId1XRTT", c.get<fixed_bitstring<47> >().to_string());
      break;
    case types::cell_global_id_hrpd:
      j.write_str("cellGlobalIdHRPD", c.get<fixed_bitstring<128> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "cell_global_id_cdma2000_c");
  }
  j.end_obj();
}
SRSASN_CODE cell_global_id_cdma2000_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cell_global_id1_xrtt:
      HANDLE_CODE(c.get<fixed_bitstring<47> >().pack(bref));
      break;
    case types::cell_global_id_hrpd:
      HANDLE_CODE(c.get<fixed_bitstring<128> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cell_global_id_cdma2000_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_global_id_cdma2000_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cell_global_id1_xrtt:
      HANDLE_CODE(c.get<fixed_bitstring<47> >().unpack(bref));
      break;
    case types::cell_global_id_hrpd:
      HANDLE_CODE(c.get<fixed_bitstring<128> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "cell_global_id_cdma2000_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// AdditionalSI-Info-r9 ::= SEQUENCE
SRSASN_CODE add_si_info_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csg_member_status_r9_present, 1));
  HANDLE_CODE(bref.pack(csg_id_r9_present, 1));

  if (csg_id_r9_present) {
    HANDLE_CODE(csg_id_r9.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE add_si_info_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csg_member_status_r9_present, 1));
  HANDLE_CODE(bref.unpack(csg_id_r9_present, 1));

  if (csg_id_r9_present) {
    HANDLE_CODE(csg_id_r9.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void add_si_info_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csg_member_status_r9_present) {
    j.write_str("csg-MemberStatus-r9", "member");
  }
  if (csg_id_r9_present) {
    j.write_str("csg-Identity-r9", csg_id_r9.to_string());
  }
  j.end_obj();
}

// BLER-Result-r12 ::= SEQUENCE
SRSASN_CODE bler_result_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, bler_r12, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(blocks_rx_r12.n_r12.pack(bref));
  HANDLE_CODE(blocks_rx_r12.m_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE bler_result_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(bler_r12, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(blocks_rx_r12.n_r12.unpack(bref));
  HANDLE_CODE(blocks_rx_r12.m_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void bler_result_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("bler-r12", bler_r12);
  j.write_fieldname("blocksReceived-r12");
  j.start_obj();
  j.write_str("n-r12", blocks_rx_r12.n_r12.to_string());
  j.write_str("m-r12", blocks_rx_r12.m_r12.to_string());
  j.end_obj();
  j.end_obj();
}

// CellGlobalIdUTRA ::= SEQUENCE
SRSASN_CODE cell_global_id_utra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(plmn_id.pack(bref));
  HANDLE_CODE(cell_id.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_global_id_utra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(plmn_id.unpack(bref));
  HANDLE_CODE(cell_id.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_global_id_utra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("plmn-Identity");
  plmn_id.to_json(j);
  j.write_str("cellIdentity", cell_id.to_string());
  j.end_obj();
}

// MeasResultCDMA2000 ::= SEQUENCE
SRSASN_CODE meas_result_cdma2000_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cgi_info_present, 1));

  HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)511u));
  if (cgi_info_present) {
    HANDLE_CODE(cgi_info.pack(bref));
  }
  bref.pack(meas_result.ext, 1);
  HANDLE_CODE(bref.pack(meas_result.pilot_pn_phase_present, 1));
  if (meas_result.pilot_pn_phase_present) {
    HANDLE_CODE(pack_integer(bref, meas_result.pilot_pn_phase, (uint16_t)0u, (uint16_t)32767u));
  }
  HANDLE_CODE(pack_integer(bref, meas_result.pilot_strength, (uint8_t)0u, (uint8_t)63u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_cdma2000_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cgi_info_present, 1));

  HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)511u));
  if (cgi_info_present) {
    HANDLE_CODE(cgi_info.unpack(bref));
  }
  bref.unpack(meas_result.ext, 1);
  HANDLE_CODE(bref.unpack(meas_result.pilot_pn_phase_present, 1));
  if (meas_result.pilot_pn_phase_present) {
    HANDLE_CODE(unpack_integer(meas_result.pilot_pn_phase, bref, (uint16_t)0u, (uint16_t)32767u));
  }
  HANDLE_CODE(unpack_integer(meas_result.pilot_strength, bref, (uint8_t)0u, (uint8_t)63u));

  return SRSASN_SUCCESS;
}
void meas_result_cdma2000_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId", pci);
  if (cgi_info_present) {
    j.write_fieldname("cgi-Info");
    cgi_info.to_json(j);
  }
  j.write_fieldname("measResult");
  j.start_obj();
  if (meas_result.pilot_pn_phase_present) {
    j.write_int("pilotPnPhase", meas_result.pilot_pn_phase);
  }
  j.write_int("pilotStrength", meas_result.pilot_strength);
  j.end_obj();
  j.end_obj();
}

// CellGlobalIdGERAN ::= SEQUENCE
SRSASN_CODE cell_global_id_geran_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(plmn_id.pack(bref));
  HANDLE_CODE(location_area_code.pack(bref));
  HANDLE_CODE(cell_id.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_global_id_geran_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(plmn_id.unpack(bref));
  HANDLE_CODE(location_area_code.unpack(bref));
  HANDLE_CODE(cell_id.unpack(bref));

  return SRSASN_SUCCESS;
}
void cell_global_id_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("plmn-Identity");
  plmn_id.to_json(j);
  j.write_str("locationAreaCode", location_area_code.to_string());
  j.write_str("cellIdentity", cell_id.to_string());
  j.end_obj();
}

// DataBLER-MCH-Result-r12 ::= SEQUENCE
SRSASN_CODE data_bler_mch_result_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, mch_idx_r12, (uint8_t)1u, (uint8_t)15u));
  HANDLE_CODE(data_bler_result_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE data_bler_mch_result_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(mch_idx_r12, bref, (uint8_t)1u, (uint8_t)15u));
  HANDLE_CODE(data_bler_result_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void data_bler_mch_result_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("mch-Index-r12", mch_idx_r12);
  j.write_fieldname("dataBLER-Result-r12");
  data_bler_result_r12.to_json(j);
  j.end_obj();
}

// MeasResultEUTRA ::= SEQUENCE
SRSASN_CODE meas_result_eutra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cgi_info_present, 1));

  HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)503u));
  if (cgi_info_present) {
    HANDLE_CODE(bref.pack(cgi_info.plmn_id_list_present, 1));
    HANDLE_CODE(cgi_info.cell_global_id.pack(bref));
    HANDLE_CODE(cgi_info.tac.pack(bref));
    if (cgi_info.plmn_id_list_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, cgi_info.plmn_id_list, 1, 5));
    }
  }
  HANDLE_CODE(meas_result.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_eutra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cgi_info_present, 1));

  HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)503u));
  if (cgi_info_present) {
    HANDLE_CODE(bref.unpack(cgi_info.plmn_id_list_present, 1));
    HANDLE_CODE(cgi_info.cell_global_id.unpack(bref));
    HANDLE_CODE(cgi_info.tac.unpack(bref));
    if (cgi_info.plmn_id_list_present) {
      HANDLE_CODE(unpack_dyn_seq_of(cgi_info.plmn_id_list, bref, 1, 5));
    }
  }
  HANDLE_CODE(meas_result.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_result_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId", pci);
  if (cgi_info_present) {
    j.write_fieldname("cgi-Info");
    j.start_obj();
    j.write_fieldname("cellGlobalId");
    cgi_info.cell_global_id.to_json(j);
    j.write_str("trackingAreaCode", cgi_info.tac.to_string());
    if (cgi_info.plmn_id_list_present) {
      j.start_array("plmn-IdentityList");
      for (const auto& e1 : cgi_info.plmn_id_list) {
        e1.to_json(j);
      }
      j.end_array();
    }
    j.end_obj();
  }
  j.write_fieldname("measResult");
  meas_result.to_json(j);
  j.end_obj();
}

SRSASN_CODE meas_result_eutra_s::meas_result_s_::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rsrp_result_present, 1));
  HANDLE_CODE(bref.pack(rsrq_result_present, 1));

  if (rsrp_result_present) {
    HANDLE_CODE(pack_integer(bref, rsrp_result, (uint8_t)0u, (uint8_t)97u));
  }
  if (rsrq_result_present) {
    HANDLE_CODE(pack_integer(bref, rsrq_result, (uint8_t)0u, (uint8_t)34u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= add_si_info_r9.is_present();
    group_flags[1] |= primary_plmn_suitable_r12_present;
    group_flags[1] |= meas_result_v1250_present;
    group_flags[2] |= rs_sinr_result_r13_present;
    group_flags[2] |= cgi_info_v1310.is_present();
    group_flags[3] |= meas_result_v1360_present;
    group_flags[4] |= cgi_info_minus5_gc_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(add_si_info_r9.is_present(), 1));
      if (add_si_info_r9.is_present()) {
        HANDLE_CODE(add_si_info_r9->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(primary_plmn_suitable_r12_present, 1));
      HANDLE_CODE(bref.pack(meas_result_v1250_present, 1));
      if (meas_result_v1250_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_v1250, (int8_t)-30, (int8_t)46));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rs_sinr_result_r13_present, 1));
      HANDLE_CODE(bref.pack(cgi_info_v1310.is_present(), 1));
      if (rs_sinr_result_r13_present) {
        HANDLE_CODE(pack_integer(bref, rs_sinr_result_r13, (uint8_t)0u, (uint8_t)127u));
      }
      if (cgi_info_v1310.is_present()) {
        HANDLE_CODE(bref.pack(cgi_info_v1310->freq_band_ind_r13_present, 1));
        HANDLE_CODE(bref.pack(cgi_info_v1310->multi_band_info_list_r13_present, 1));
        HANDLE_CODE(bref.pack(cgi_info_v1310->freq_band_ind_prio_r13_present, 1));
        if (cgi_info_v1310->freq_band_ind_r13_present) {
          HANDLE_CODE(pack_integer(bref, cgi_info_v1310->freq_band_ind_r13, (uint16_t)1u, (uint16_t)256u));
        }
        if (cgi_info_v1310->multi_band_info_list_r13_present) {
          HANDLE_CODE(
              pack_dyn_seq_of(bref, cgi_info_v1310->multi_band_info_list_r13, 1, 8, integer_packer<uint16_t>(1, 256)));
        }
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_v1360_present, 1));
      if (meas_result_v1360_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_v1360, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cgi_info_minus5_gc_r15.is_present(), 1));
      if (cgi_info_minus5_gc_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *cgi_info_minus5_gc_r15, 1, 6));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_eutra_s::meas_result_s_::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rsrp_result_present, 1));
  HANDLE_CODE(bref.unpack(rsrq_result_present, 1));

  if (rsrp_result_present) {
    HANDLE_CODE(unpack_integer(rsrp_result, bref, (uint8_t)0u, (uint8_t)97u));
  }
  if (rsrq_result_present) {
    HANDLE_CODE(unpack_integer(rsrq_result, bref, (uint8_t)0u, (uint8_t)34u));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(5);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool add_si_info_r9_present;
      HANDLE_CODE(bref.unpack(add_si_info_r9_present, 1));
      add_si_info_r9.set_present(add_si_info_r9_present);
      if (add_si_info_r9.is_present()) {
        HANDLE_CODE(add_si_info_r9->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(primary_plmn_suitable_r12_present, 1));
      HANDLE_CODE(bref.unpack(meas_result_v1250_present, 1));
      if (meas_result_v1250_present) {
        HANDLE_CODE(unpack_integer(meas_result_v1250, bref, (int8_t)-30, (int8_t)46));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(rs_sinr_result_r13_present, 1));
      bool cgi_info_v1310_present;
      HANDLE_CODE(bref.unpack(cgi_info_v1310_present, 1));
      cgi_info_v1310.set_present(cgi_info_v1310_present);
      if (rs_sinr_result_r13_present) {
        HANDLE_CODE(unpack_integer(rs_sinr_result_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
      if (cgi_info_v1310.is_present()) {
        HANDLE_CODE(bref.unpack(cgi_info_v1310->freq_band_ind_r13_present, 1));
        HANDLE_CODE(bref.unpack(cgi_info_v1310->multi_band_info_list_r13_present, 1));
        HANDLE_CODE(bref.unpack(cgi_info_v1310->freq_band_ind_prio_r13_present, 1));
        if (cgi_info_v1310->freq_band_ind_r13_present) {
          HANDLE_CODE(unpack_integer(cgi_info_v1310->freq_band_ind_r13, bref, (uint16_t)1u, (uint16_t)256u));
        }
        if (cgi_info_v1310->multi_band_info_list_r13_present) {
          HANDLE_CODE(unpack_dyn_seq_of(
              cgi_info_v1310->multi_band_info_list_r13, bref, 1, 8, integer_packer<uint16_t>(1, 256)));
        }
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(meas_result_v1360_present, 1));
      if (meas_result_v1360_present) {
        HANDLE_CODE(unpack_integer(meas_result_v1360, bref, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool cgi_info_minus5_gc_r15_present;
      HANDLE_CODE(bref.unpack(cgi_info_minus5_gc_r15_present, 1));
      cgi_info_minus5_gc_r15.set_present(cgi_info_minus5_gc_r15_present);
      if (cgi_info_minus5_gc_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*cgi_info_minus5_gc_r15, bref, 1, 6));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_result_eutra_s::meas_result_s_::to_json(json_writer& j) const
{
  j.start_obj();
  if (rsrp_result_present) {
    j.write_int("rsrpResult", rsrp_result);
  }
  if (rsrq_result_present) {
    j.write_int("rsrqResult", rsrq_result);
  }
  if (ext) {
    if (add_si_info_r9.is_present()) {
      j.write_fieldname("additionalSI-Info-r9");
      add_si_info_r9->to_json(j);
    }
    if (primary_plmn_suitable_r12_present) {
      j.write_str("primaryPLMN-Suitable-r12", "true");
    }
    if (meas_result_v1250_present) {
      j.write_int("measResult-v1250", meas_result_v1250);
    }
    if (rs_sinr_result_r13_present) {
      j.write_int("rs-sinr-Result-r13", rs_sinr_result_r13);
    }
    if (cgi_info_v1310.is_present()) {
      j.write_fieldname("cgi-Info-v1310");
      j.start_obj();
      if (cgi_info_v1310->freq_band_ind_r13_present) {
        j.write_int("freqBandIndicator-r13", cgi_info_v1310->freq_band_ind_r13);
      }
      if (cgi_info_v1310->multi_band_info_list_r13_present) {
        j.start_array("multiBandInfoList-r13");
        for (const auto& e1 : cgi_info_v1310->multi_band_info_list_r13) {
          j.write_int(e1);
        }
        j.end_array();
      }
      if (cgi_info_v1310->freq_band_ind_prio_r13_present) {
        j.write_str("freqBandIndicatorPriority-r13", "true");
      }
      j.end_obj();
    }
    if (meas_result_v1360_present) {
      j.write_int("measResult-v1360", meas_result_v1360);
    }
    if (cgi_info_minus5_gc_r15.is_present()) {
      j.start_array("cgi-Info-5GC-r15");
      for (const auto& e1 : *cgi_info_minus5_gc_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// MeasResultIdleEUTRA-r15 ::= SEQUENCE
SRSASN_CODE meas_result_idle_eutra_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(pack_integer(bref, pci_r15, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(pack_integer(bref, meas_result_r15.rsrp_result_r15, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(pack_integer(bref, meas_result_r15.rsrq_result_r15, (int8_t)-30, (int8_t)46));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_idle_eutra_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(unpack_integer(pci_r15, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(unpack_integer(meas_result_r15.rsrp_result_r15, bref, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(unpack_integer(meas_result_r15.rsrq_result_r15, bref, (int8_t)-30, (int8_t)46));

  return SRSASN_SUCCESS;
}
void meas_result_idle_eutra_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r15", carrier_freq_r15);
  j.write_int("physCellId-r15", pci_r15);
  j.write_fieldname("measResult-r15");
  j.start_obj();
  j.write_int("rsrpResult-r15", meas_result_r15.rsrp_result_r15);
  j.write_int("rsrqResult-r15", meas_result_r15.rsrq_result_r15);
  j.end_obj();
  j.end_obj();
}

// MeasResultUTRA ::= SEQUENCE
SRSASN_CODE meas_result_utra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cgi_info_present, 1));

  HANDLE_CODE(pci.pack(bref));
  if (cgi_info_present) {
    HANDLE_CODE(bref.pack(cgi_info.location_area_code_present, 1));
    HANDLE_CODE(bref.pack(cgi_info.routing_area_code_present, 1));
    HANDLE_CODE(bref.pack(cgi_info.plmn_id_list_present, 1));
    HANDLE_CODE(cgi_info.cell_global_id.pack(bref));
    if (cgi_info.location_area_code_present) {
      HANDLE_CODE(cgi_info.location_area_code.pack(bref));
    }
    if (cgi_info.routing_area_code_present) {
      HANDLE_CODE(cgi_info.routing_area_code.pack(bref));
    }
    if (cgi_info.plmn_id_list_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, cgi_info.plmn_id_list, 1, 5));
    }
  }
  HANDLE_CODE(meas_result.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_utra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cgi_info_present, 1));

  HANDLE_CODE(pci.unpack(bref));
  if (cgi_info_present) {
    HANDLE_CODE(bref.unpack(cgi_info.location_area_code_present, 1));
    HANDLE_CODE(bref.unpack(cgi_info.routing_area_code_present, 1));
    HANDLE_CODE(bref.unpack(cgi_info.plmn_id_list_present, 1));
    HANDLE_CODE(cgi_info.cell_global_id.unpack(bref));
    if (cgi_info.location_area_code_present) {
      HANDLE_CODE(cgi_info.location_area_code.unpack(bref));
    }
    if (cgi_info.routing_area_code_present) {
      HANDLE_CODE(cgi_info.routing_area_code.unpack(bref));
    }
    if (cgi_info.plmn_id_list_present) {
      HANDLE_CODE(unpack_dyn_seq_of(cgi_info.plmn_id_list, bref, 1, 5));
    }
  }
  HANDLE_CODE(meas_result.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_result_utra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("physCellId");
  pci.to_json(j);
  if (cgi_info_present) {
    j.write_fieldname("cgi-Info");
    j.start_obj();
    j.write_fieldname("cellGlobalId");
    cgi_info.cell_global_id.to_json(j);
    if (cgi_info.location_area_code_present) {
      j.write_str("locationAreaCode", cgi_info.location_area_code.to_string());
    }
    if (cgi_info.routing_area_code_present) {
      j.write_str("routingAreaCode", cgi_info.routing_area_code.to_string());
    }
    if (cgi_info.plmn_id_list_present) {
      j.start_array("plmn-IdentityList");
      for (const auto& e1 : cgi_info.plmn_id_list) {
        e1.to_json(j);
      }
      j.end_array();
    }
    j.end_obj();
  }
  j.write_fieldname("measResult");
  meas_result.to_json(j);
  j.end_obj();
}

void meas_result_utra_s::pci_c_::destroy_() {}
void meas_result_utra_s::pci_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
meas_result_utra_s::pci_c_::pci_c_(const meas_result_utra_s::pci_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::fdd:
      c.init(other.c.get<uint16_t>());
      break;
    case types::tdd:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_result_utra_s::pci_c_");
  }
}
meas_result_utra_s::pci_c_& meas_result_utra_s::pci_c_::operator=(const meas_result_utra_s::pci_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::fdd:
      c.set(other.c.get<uint16_t>());
      break;
    case types::tdd:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_result_utra_s::pci_c_");
  }

  return *this;
}
void meas_result_utra_s::pci_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::fdd:
      j.write_int("fdd", c.get<uint16_t>());
      break;
    case types::tdd:
      j.write_int("tdd", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "meas_result_utra_s::pci_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_result_utra_s::pci_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::fdd:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::tdd:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_result_utra_s::pci_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_utra_s::pci_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::fdd:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::tdd:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "meas_result_utra_s::pci_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

SRSASN_CODE meas_result_utra_s::meas_result_s_::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(utra_rscp_present, 1));
  HANDLE_CODE(bref.pack(utra_ec_n0_present, 1));

  if (utra_rscp_present) {
    HANDLE_CODE(pack_integer(bref, utra_rscp, (int8_t)-5, (int8_t)91));
  }
  if (utra_ec_n0_present) {
    HANDLE_CODE(pack_integer(bref, utra_ec_n0, (uint8_t)0u, (uint8_t)49u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= add_si_info_r9.is_present();
    group_flags[1] |= primary_plmn_suitable_r12_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(add_si_info_r9.is_present(), 1));
      if (add_si_info_r9.is_present()) {
        HANDLE_CODE(add_si_info_r9->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(primary_plmn_suitable_r12_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_utra_s::meas_result_s_::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(utra_rscp_present, 1));
  HANDLE_CODE(bref.unpack(utra_ec_n0_present, 1));

  if (utra_rscp_present) {
    HANDLE_CODE(unpack_integer(utra_rscp, bref, (int8_t)-5, (int8_t)91));
  }
  if (utra_ec_n0_present) {
    HANDLE_CODE(unpack_integer(utra_ec_n0, bref, (uint8_t)0u, (uint8_t)49u));
  }

  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 add_si_info_r9_present;
      HANDLE_CODE(bref.unpack(add_si_info_r9_present, 1));
      add_si_info_r9.set_present(add_si_info_r9_present);
      if (add_si_info_r9.is_present()) {
        HANDLE_CODE(add_si_info_r9->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(primary_plmn_suitable_r12_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
void meas_result_utra_s::meas_result_s_::to_json(json_writer& j) const
{
  j.start_obj();
  if (utra_rscp_present) {
    j.write_int("utra-RSCP", utra_rscp);
  }
  if (utra_ec_n0_present) {
    j.write_int("utra-EcN0", utra_ec_n0);
  }
  if (ext) {
    if (add_si_info_r9.is_present()) {
      j.write_fieldname("additionalSI-Info-r9");
      add_si_info_r9->to_json(j);
    }
    if (primary_plmn_suitable_r12_present) {
      j.write_str("primaryPLMN-Suitable-r12", "true");
    }
  }
  j.end_obj();
}

// RegisteredAMF-r15 ::= SEQUENCE
SRSASN_CODE registered_amf_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(plmn_id_r15_present, 1));

  if (plmn_id_r15_present) {
    HANDLE_CODE(plmn_id_r15.pack(bref));
  }
  HANDLE_CODE(amf_id_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE registered_amf_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(plmn_id_r15_present, 1));

  if (plmn_id_r15_present) {
    HANDLE_CODE(plmn_id_r15.unpack(bref));
  }
  HANDLE_CODE(amf_id_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void registered_amf_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (plmn_id_r15_present) {
    j.write_fieldname("plmn-Identity-r15");
    plmn_id_r15.to_json(j);
  }
  j.write_str("amf-Identifier-r15", amf_id_r15.to_string());
  j.end_obj();
}

// S-NSSAI-r15 ::= CHOICE
void s_nssai_r15_c::destroy_()
{
  switch (type_) {
    case types::sst:
      c.destroy<fixed_bitstring<8> >();
      break;
    case types::sst_sd:
      c.destroy<fixed_bitstring<32> >();
      break;
    default:
      break;
  }
}
void s_nssai_r15_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sst:
      c.init<fixed_bitstring<8> >();
      break;
    case types::sst_sd:
      c.init<fixed_bitstring<32> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "s_nssai_r15_c");
  }
}
s_nssai_r15_c::s_nssai_r15_c(const s_nssai_r15_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sst:
      c.init(other.c.get<fixed_bitstring<8> >());
      break;
    case types::sst_sd:
      c.init(other.c.get<fixed_bitstring<32> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "s_nssai_r15_c");
  }
}
s_nssai_r15_c& s_nssai_r15_c::operator=(const s_nssai_r15_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sst:
      c.set(other.c.get<fixed_bitstring<8> >());
      break;
    case types::sst_sd:
      c.set(other.c.get<fixed_bitstring<32> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "s_nssai_r15_c");
  }

  return *this;
}
void s_nssai_r15_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sst:
      j.write_str("sst", c.get<fixed_bitstring<8> >().to_string());
      break;
    case types::sst_sd:
      j.write_str("sst-SD", c.get<fixed_bitstring<32> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "s_nssai_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE s_nssai_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sst:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().pack(bref));
      break;
    case types::sst_sd:
      HANDLE_CODE(c.get<fixed_bitstring<32> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "s_nssai_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE s_nssai_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sst:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().unpack(bref));
      break;
    case types::sst_sd:
      HANDLE_CODE(c.get<fixed_bitstring<32> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "s_nssai_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// LocationInfo-r10 ::= SEQUENCE
SRSASN_CODE location_info_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(horizontal_velocity_r10_present, 1));
  HANDLE_CODE(bref.pack(gnss_tod_msec_r10_present, 1));

  HANDLE_CODE(location_coordinates_r10.pack(bref));
  if (horizontal_velocity_r10_present) {
    HANDLE_CODE(horizontal_velocity_r10.pack(bref));
  }
  if (gnss_tod_msec_r10_present) {
    HANDLE_CODE(gnss_tod_msec_r10.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= vertical_velocity_info_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(vertical_velocity_info_r15.is_present(), 1));
      if (vertical_velocity_info_r15.is_present()) {
        HANDLE_CODE(vertical_velocity_info_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE location_info_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(horizontal_velocity_r10_present, 1));
  HANDLE_CODE(bref.unpack(gnss_tod_msec_r10_present, 1));

  HANDLE_CODE(location_coordinates_r10.unpack(bref));
  if (horizontal_velocity_r10_present) {
    HANDLE_CODE(horizontal_velocity_r10.unpack(bref));
  }
  if (gnss_tod_msec_r10_present) {
    HANDLE_CODE(gnss_tod_msec_r10.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 vertical_velocity_info_r15_present;
      HANDLE_CODE(bref.unpack(vertical_velocity_info_r15_present, 1));
      vertical_velocity_info_r15.set_present(vertical_velocity_info_r15_present);
      if (vertical_velocity_info_r15.is_present()) {
        HANDLE_CODE(vertical_velocity_info_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void location_info_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("locationCoordinates-r10");
  location_coordinates_r10.to_json(j);
  if (horizontal_velocity_r10_present) {
    j.write_str("horizontalVelocity-r10", horizontal_velocity_r10.to_string());
  }
  if (gnss_tod_msec_r10_present) {
    j.write_str("gnss-TOD-msec-r10", gnss_tod_msec_r10.to_string());
  }
  if (ext) {
    if (vertical_velocity_info_r15.is_present()) {
      j.write_fieldname("verticalVelocityInfo-r15");
      vertical_velocity_info_r15->to_json(j);
    }
  }
  j.end_obj();
}

void location_info_r10_s::location_coordinates_r10_c_::destroy_()
{
  switch (type_) {
    case types::ellipsoid_point_r10:
      c.destroy<dyn_octstring>();
      break;
    case types::ellipsoid_point_with_altitude_r10:
      c.destroy<dyn_octstring>();
      break;
    case types::ellipsoid_point_with_uncertainty_circle_r11:
      c.destroy<dyn_octstring>();
      break;
    case types::ellipsoid_point_with_uncertainty_ellipse_r11:
      c.destroy<dyn_octstring>();
      break;
    case types::ellipsoid_point_with_altitude_and_uncertainty_ellipsoid_r11:
      c.destroy<dyn_octstring>();
      break;
    case types::ellipsoid_arc_r11:
      c.destroy<dyn_octstring>();
      break;
    case types::polygon_r11:
      c.destroy<dyn_octstring>();
      break;
    default:
      break;
  }
}
void location_info_r10_s::location_coordinates_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ellipsoid_point_r10:
      c.init<dyn_octstring>();
      break;
    case types::ellipsoid_point_with_altitude_r10:
      c.init<dyn_octstring>();
      break;
    case types::ellipsoid_point_with_uncertainty_circle_r11:
      c.init<dyn_octstring>();
      break;
    case types::ellipsoid_point_with_uncertainty_ellipse_r11:
      c.init<dyn_octstring>();
      break;
    case types::ellipsoid_point_with_altitude_and_uncertainty_ellipsoid_r11:
      c.init<dyn_octstring>();
      break;
    case types::ellipsoid_arc_r11:
      c.init<dyn_octstring>();
      break;
    case types::polygon_r11:
      c.init<dyn_octstring>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::location_coordinates_r10_c_");
  }
}
location_info_r10_s::location_coordinates_r10_c_::location_coordinates_r10_c_(
    const location_info_r10_s::location_coordinates_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ellipsoid_point_r10:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_point_with_altitude_r10:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_point_with_uncertainty_circle_r11:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_point_with_uncertainty_ellipse_r11:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_point_with_altitude_and_uncertainty_ellipsoid_r11:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_arc_r11:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::polygon_r11:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::location_coordinates_r10_c_");
  }
}
location_info_r10_s::location_coordinates_r10_c_& location_info_r10_s::location_coordinates_r10_c_::
                                                  operator=(const location_info_r10_s::location_coordinates_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ellipsoid_point_r10:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_point_with_altitude_r10:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_point_with_uncertainty_circle_r11:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_point_with_uncertainty_ellipse_r11:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_point_with_altitude_and_uncertainty_ellipsoid_r11:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ellipsoid_arc_r11:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::polygon_r11:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::location_coordinates_r10_c_");
  }

  return *this;
}
void location_info_r10_s::location_coordinates_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ellipsoid_point_r10:
      j.write_str("ellipsoid-Point-r10", c.get<dyn_octstring>().to_string());
      break;
    case types::ellipsoid_point_with_altitude_r10:
      j.write_str("ellipsoidPointWithAltitude-r10", c.get<dyn_octstring>().to_string());
      break;
    case types::ellipsoid_point_with_uncertainty_circle_r11:
      j.write_str("ellipsoidPointWithUncertaintyCircle-r11", c.get<dyn_octstring>().to_string());
      break;
    case types::ellipsoid_point_with_uncertainty_ellipse_r11:
      j.write_str("ellipsoidPointWithUncertaintyEllipse-r11", c.get<dyn_octstring>().to_string());
      break;
    case types::ellipsoid_point_with_altitude_and_uncertainty_ellipsoid_r11:
      j.write_str("ellipsoidPointWithAltitudeAndUncertaintyEllipsoid-r11", c.get<dyn_octstring>().to_string());
      break;
    case types::ellipsoid_arc_r11:
      j.write_str("ellipsoidArc-r11", c.get<dyn_octstring>().to_string());
      break;
    case types::polygon_r11:
      j.write_str("polygon-r11", c.get<dyn_octstring>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::location_coordinates_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE location_info_r10_s::location_coordinates_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ellipsoid_point_r10:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::ellipsoid_point_with_altitude_r10:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::ellipsoid_point_with_uncertainty_circle_r11: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
    } break;
    case types::ellipsoid_point_with_uncertainty_ellipse_r11: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
    } break;
    case types::ellipsoid_point_with_altitude_and_uncertainty_ellipsoid_r11: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
    } break;
    case types::ellipsoid_arc_r11: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
    } break;
    case types::polygon_r11: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::location_coordinates_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE location_info_r10_s::location_coordinates_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ellipsoid_point_r10:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::ellipsoid_point_with_altitude_r10:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::ellipsoid_point_with_uncertainty_circle_r11: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
    } break;
    case types::ellipsoid_point_with_uncertainty_ellipse_r11: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
    } break;
    case types::ellipsoid_point_with_altitude_and_uncertainty_ellipsoid_r11: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
    } break;
    case types::ellipsoid_arc_r11: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
    } break;
    case types::polygon_r11: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
    } break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::location_coordinates_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void location_info_r10_s::vertical_velocity_info_r15_c_::destroy_()
{
  switch (type_) {
    case types::vertical_velocity_r15:
      c.destroy<dyn_octstring>();
      break;
    case types::vertical_velocity_and_uncertainty_r15:
      c.destroy<dyn_octstring>();
      break;
    default:
      break;
  }
}
void location_info_r10_s::vertical_velocity_info_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::vertical_velocity_r15:
      c.init<dyn_octstring>();
      break;
    case types::vertical_velocity_and_uncertainty_r15:
      c.init<dyn_octstring>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::vertical_velocity_info_r15_c_");
  }
}
location_info_r10_s::vertical_velocity_info_r15_c_::vertical_velocity_info_r15_c_(
    const location_info_r10_s::vertical_velocity_info_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::vertical_velocity_r15:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::vertical_velocity_and_uncertainty_r15:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::vertical_velocity_info_r15_c_");
  }
}
location_info_r10_s::vertical_velocity_info_r15_c_& location_info_r10_s::vertical_velocity_info_r15_c_::
                                                    operator=(const location_info_r10_s::vertical_velocity_info_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::vertical_velocity_r15:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::vertical_velocity_and_uncertainty_r15:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::vertical_velocity_info_r15_c_");
  }

  return *this;
}
void location_info_r10_s::vertical_velocity_info_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::vertical_velocity_r15:
      j.write_str("verticalVelocity-r15", c.get<dyn_octstring>().to_string());
      break;
    case types::vertical_velocity_and_uncertainty_r15:
      j.write_str("verticalVelocityAndUncertainty-r15", c.get<dyn_octstring>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::vertical_velocity_info_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE location_info_r10_s::vertical_velocity_info_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::vertical_velocity_r15:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::vertical_velocity_and_uncertainty_r15:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::vertical_velocity_info_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE location_info_r10_s::vertical_velocity_info_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::vertical_velocity_r15:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::vertical_velocity_and_uncertainty_r15:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "location_info_r10_s::vertical_velocity_info_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasResultGERAN ::= SEQUENCE
SRSASN_CODE meas_result_geran_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cgi_info_present, 1));

  HANDLE_CODE(carrier_freq.pack(bref));
  HANDLE_CODE(pci.pack(bref));
  if (cgi_info_present) {
    HANDLE_CODE(bref.pack(cgi_info.routing_area_code_present, 1));
    HANDLE_CODE(cgi_info.cell_global_id.pack(bref));
    if (cgi_info.routing_area_code_present) {
      HANDLE_CODE(cgi_info.routing_area_code.pack(bref));
    }
  }
  bref.pack(meas_result.ext, 1);
  HANDLE_CODE(pack_integer(bref, meas_result.rssi, (uint8_t)0u, (uint8_t)63u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_geran_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cgi_info_present, 1));

  HANDLE_CODE(carrier_freq.unpack(bref));
  HANDLE_CODE(pci.unpack(bref));
  if (cgi_info_present) {
    HANDLE_CODE(bref.unpack(cgi_info.routing_area_code_present, 1));
    HANDLE_CODE(cgi_info.cell_global_id.unpack(bref));
    if (cgi_info.routing_area_code_present) {
      HANDLE_CODE(cgi_info.routing_area_code.unpack(bref));
    }
  }
  bref.unpack(meas_result.ext, 1);
  HANDLE_CODE(unpack_integer(meas_result.rssi, bref, (uint8_t)0u, (uint8_t)63u));

  return SRSASN_SUCCESS;
}
void meas_result_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("carrierFreq");
  carrier_freq.to_json(j);
  j.write_fieldname("physCellId");
  pci.to_json(j);
  if (cgi_info_present) {
    j.write_fieldname("cgi-Info");
    j.start_obj();
    j.write_fieldname("cellGlobalId");
    cgi_info.cell_global_id.to_json(j);
    if (cgi_info.routing_area_code_present) {
      j.write_str("routingAreaCode", cgi_info.routing_area_code.to_string());
    }
    j.end_obj();
  }
  j.write_fieldname("measResult");
  j.start_obj();
  j.write_int("rssi", meas_result.rssi);
  j.end_obj();
  j.end_obj();
}

// MeasResultNR-r15 ::= SEQUENCE
SRSASN_CODE meas_result_nr_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rsrp_result_r15_present, 1));
  HANDLE_CODE(bref.pack(rsrq_result_r15_present, 1));
  HANDLE_CODE(bref.pack(rs_sinr_result_r15_present, 1));

  if (rsrp_result_r15_present) {
    HANDLE_CODE(pack_integer(bref, rsrp_result_r15, (uint8_t)0u, (uint8_t)127u));
  }
  if (rsrq_result_r15_present) {
    HANDLE_CODE(pack_integer(bref, rsrq_result_r15, (uint8_t)0u, (uint8_t)127u));
  }
  if (rs_sinr_result_r15_present) {
    HANDLE_CODE(pack_integer(bref, rs_sinr_result_r15, (uint8_t)0u, (uint8_t)127u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_nr_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rsrp_result_r15_present, 1));
  HANDLE_CODE(bref.unpack(rsrq_result_r15_present, 1));
  HANDLE_CODE(bref.unpack(rs_sinr_result_r15_present, 1));

  if (rsrp_result_r15_present) {
    HANDLE_CODE(unpack_integer(rsrp_result_r15, bref, (uint8_t)0u, (uint8_t)127u));
  }
  if (rsrq_result_r15_present) {
    HANDLE_CODE(unpack_integer(rsrq_result_r15, bref, (uint8_t)0u, (uint8_t)127u));
  }
  if (rs_sinr_result_r15_present) {
    HANDLE_CODE(unpack_integer(rs_sinr_result_r15, bref, (uint8_t)0u, (uint8_t)127u));
  }

  return SRSASN_SUCCESS;
}
void meas_result_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rsrp_result_r15_present) {
    j.write_int("rsrpResult-r15", rsrp_result_r15);
  }
  if (rsrq_result_r15_present) {
    j.write_int("rsrqResult-r15", rsrq_result_r15);
  }
  if (rs_sinr_result_r15_present) {
    j.write_int("rs-sinr-Result-r15", rs_sinr_result_r15);
  }
  j.end_obj();
}

// MeasResultsCDMA2000 ::= SEQUENCE
SRSASN_CODE meas_results_cdma2000_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pre_regist_status_hrpd, 1));
  HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_list_cdma2000, 1, 8));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_results_cdma2000_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pre_regist_status_hrpd, 1));
  HANDLE_CODE(unpack_dyn_seq_of(meas_result_list_cdma2000, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void meas_results_cdma2000_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("preRegistrationStatusHRPD", pre_regist_status_hrpd);
  j.start_array("measResultListCDMA2000");
  for (const auto& e1 : meas_result_list_cdma2000) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// PLMN-IdentityInfoNR-r15 ::= SEQUENCE
SRSASN_CODE plmn_id_info_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tac_r15_present, 1));
  HANDLE_CODE(bref.pack(ran_area_code_r15_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r15, 1, 12));
  if (tac_r15_present) {
    HANDLE_CODE(tac_r15.pack(bref));
  }
  if (ran_area_code_r15_present) {
    HANDLE_CODE(pack_integer(bref, ran_area_code_r15, (uint16_t)0u, (uint16_t)255u));
  }
  HANDLE_CODE(cell_id_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE plmn_id_info_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tac_r15_present, 1));
  HANDLE_CODE(bref.unpack(ran_area_code_r15_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r15, bref, 1, 12));
  if (tac_r15_present) {
    HANDLE_CODE(tac_r15.unpack(bref));
  }
  if (ran_area_code_r15_present) {
    HANDLE_CODE(unpack_integer(ran_area_code_r15, bref, (uint16_t)0u, (uint16_t)255u));
  }
  HANDLE_CODE(cell_id_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void plmn_id_info_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("plmn-IdentityList-r15");
  for (const auto& e1 : plmn_id_list_r15) {
    e1.to_json(j);
  }
  j.end_array();
  if (tac_r15_present) {
    j.write_str("trackingAreaCode-r15", tac_r15.to_string());
  }
  if (ran_area_code_r15_present) {
    j.write_int("ran-AreaCode-r15", ran_area_code_r15);
  }
  j.write_str("cellIdentity-r15", cell_id_r15.to_string());
  j.end_obj();
}

// RRCConnectionSetupComplete-v1530-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_available_bt_r15_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_wlan_r15_present, 1));
  HANDLE_CODE(bref.pack(idle_meas_available_r15_present, 1));
  HANDLE_CODE(bref.pack(flight_path_info_available_r15_present, 1));
  HANDLE_CODE(bref.pack(connect_to5_gc_r15_present, 1));
  HANDLE_CODE(bref.pack(registered_amf_r15_present, 1));
  HANDLE_CODE(bref.pack(s_nssai_list_r15_present, 1));
  HANDLE_CODE(bref.pack(ng_minus5_g_s_tmsi_bits_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (registered_amf_r15_present) {
    HANDLE_CODE(registered_amf_r15.pack(bref));
  }
  if (s_nssai_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, s_nssai_list_r15, 1, 8));
  }
  if (ng_minus5_g_s_tmsi_bits_r15_present) {
    HANDLE_CODE(ng_minus5_g_s_tmsi_bits_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_available_bt_r15_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_wlan_r15_present, 1));
  HANDLE_CODE(bref.unpack(idle_meas_available_r15_present, 1));
  HANDLE_CODE(bref.unpack(flight_path_info_available_r15_present, 1));
  HANDLE_CODE(bref.unpack(connect_to5_gc_r15_present, 1));
  HANDLE_CODE(bref.unpack(registered_amf_r15_present, 1));
  HANDLE_CODE(bref.unpack(s_nssai_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(ng_minus5_g_s_tmsi_bits_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (registered_amf_r15_present) {
    HANDLE_CODE(registered_amf_r15.unpack(bref));
  }
  if (s_nssai_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(s_nssai_list_r15, bref, 1, 8));
  }
  if (ng_minus5_g_s_tmsi_bits_r15_present) {
    HANDLE_CODE(ng_minus5_g_s_tmsi_bits_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_complete_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_available_bt_r15_present) {
    j.write_str("logMeasAvailableBT-r15", "true");
  }
  if (log_meas_available_wlan_r15_present) {
    j.write_str("logMeasAvailableWLAN-r15", "true");
  }
  if (idle_meas_available_r15_present) {
    j.write_str("idleMeasAvailable-r15", "true");
  }
  if (flight_path_info_available_r15_present) {
    j.write_str("flightPathInfoAvailable-r15", "true");
  }
  if (connect_to5_gc_r15_present) {
    j.write_str("connectTo5GC-r15", "true");
  }
  if (registered_amf_r15_present) {
    j.write_fieldname("registeredAMF-r15");
    registered_amf_r15.to_json(j);
  }
  if (s_nssai_list_r15_present) {
    j.start_array("s-NSSAI-list-r15");
    for (const auto& e1 : s_nssai_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (ng_minus5_g_s_tmsi_bits_r15_present) {
    j.write_fieldname("ng-5G-S-TMSI-Bits-r15");
    ng_minus5_g_s_tmsi_bits_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

void rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_::destroy_()
{
  switch (type_) {
    case types::ng_minus5_g_s_tmsi_r15:
      c.destroy<fixed_bitstring<48> >();
      break;
    case types::ng_minus5_g_s_tmsi_part2_r15:
      c.destroy<fixed_bitstring<8> >();
      break;
    default:
      break;
  }
}
void rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ng_minus5_g_s_tmsi_r15:
      c.init<fixed_bitstring<48> >();
      break;
    case types::ng_minus5_g_s_tmsi_part2_r15:
      c.init<fixed_bitstring<8> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_");
  }
}
rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_::ng_minus5_g_s_tmsi_bits_r15_c_(
    const rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ng_minus5_g_s_tmsi_r15:
      c.init(other.c.get<fixed_bitstring<48> >());
      break;
    case types::ng_minus5_g_s_tmsi_part2_r15:
      c.init(other.c.get<fixed_bitstring<8> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_");
  }
}
rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_&
rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_::
operator=(const rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ng_minus5_g_s_tmsi_r15:
      c.set(other.c.get<fixed_bitstring<48> >());
      break;
    case types::ng_minus5_g_s_tmsi_part2_r15:
      c.set(other.c.get<fixed_bitstring<8> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_");
  }

  return *this;
}
void rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ng_minus5_g_s_tmsi_r15:
      j.write_str("ng-5G-S-TMSI-r15", c.get<fixed_bitstring<48> >().to_string());
      break;
    case types::ng_minus5_g_s_tmsi_part2_r15:
      j.write_str("ng-5G-S-TMSI-Part2-r15", c.get<fixed_bitstring<8> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ng_minus5_g_s_tmsi_r15:
      HANDLE_CODE(c.get<fixed_bitstring<48> >().pack(bref));
      break;
    case types::ng_minus5_g_s_tmsi_part2_r15:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ng_minus5_g_s_tmsi_r15:
      HANDLE_CODE(c.get<fixed_bitstring<48> >().unpack(bref));
      break;
    case types::ng_minus5_g_s_tmsi_part2_r15:
      HANDLE_CODE(c.get<fixed_bitstring<8> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_v1530_ies_s::ng_minus5_g_s_tmsi_bits_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RSRQ-Type-r12 ::= SEQUENCE
SRSASN_CODE rsrq_type_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(all_symbols_r12, 1));
  HANDLE_CODE(bref.pack(wide_band_r12, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rsrq_type_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(all_symbols_r12, 1));
  HANDLE_CODE(bref.unpack(wide_band_r12, 1));

  return SRSASN_SUCCESS;
}
void rsrq_type_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("allSymbols-r12", all_symbols_r12);
  j.write_bool("wideBand-r12", wide_band_r12);
  j.end_obj();
}

// WLAN-RTT-r15 ::= SEQUENCE
SRSASN_CODE wlan_rtt_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rtt_accuracy_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, rtt_value_r15, (uint32_t)0u, (uint32_t)16777215u));
  HANDLE_CODE(rtt_units_r15.pack(bref));
  if (rtt_accuracy_r15_present) {
    HANDLE_CODE(pack_integer(bref, rtt_accuracy_r15, (uint16_t)0u, (uint16_t)255u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_rtt_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rtt_accuracy_r15_present, 1));

  HANDLE_CODE(unpack_integer(rtt_value_r15, bref, (uint32_t)0u, (uint32_t)16777215u));
  HANDLE_CODE(rtt_units_r15.unpack(bref));
  if (rtt_accuracy_r15_present) {
    HANDLE_CODE(unpack_integer(rtt_accuracy_r15, bref, (uint16_t)0u, (uint16_t)255u));
  }

  return SRSASN_SUCCESS;
}
void wlan_rtt_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("rttValue-r15", rtt_value_r15);
  j.write_str("rttUnits-r15", rtt_units_r15.to_string());
  if (rtt_accuracy_r15_present) {
    j.write_int("rttAccuracy-r15", rtt_accuracy_r15);
  }
  j.end_obj();
}

// LogMeasResultBT-r15 ::= SEQUENCE
SRSASN_CODE log_meas_result_bt_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rssi_bt_r15_present, 1));

  HANDLE_CODE(bt_addr_r15.pack(bref));
  if (rssi_bt_r15_present) {
    HANDLE_CODE(pack_integer(bref, rssi_bt_r15, (int16_t)-128, (int16_t)127));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE log_meas_result_bt_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rssi_bt_r15_present, 1));

  HANDLE_CODE(bt_addr_r15.unpack(bref));
  if (rssi_bt_r15_present) {
    HANDLE_CODE(unpack_integer(rssi_bt_r15, bref, (int16_t)-128, (int16_t)127));
  }

  return SRSASN_SUCCESS;
}
void log_meas_result_bt_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("bt-Addr-r15", bt_addr_r15.to_string());
  if (rssi_bt_r15_present) {
    j.write_int("rssi-BT-r15", rssi_bt_r15);
  }
  j.end_obj();
}

// LogMeasResultWLAN-r15 ::= SEQUENCE
SRSASN_CODE log_meas_result_wlan_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rssi_wlan_r15_present, 1));
  HANDLE_CODE(bref.pack(rtt_wlan_r15_present, 1));

  HANDLE_CODE(wlan_ids_r15.pack(bref));
  if (rssi_wlan_r15_present) {
    HANDLE_CODE(pack_integer(bref, rssi_wlan_r15, (uint8_t)0u, (uint8_t)141u));
  }
  if (rtt_wlan_r15_present) {
    HANDLE_CODE(rtt_wlan_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE log_meas_result_wlan_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rssi_wlan_r15_present, 1));
  HANDLE_CODE(bref.unpack(rtt_wlan_r15_present, 1));

  HANDLE_CODE(wlan_ids_r15.unpack(bref));
  if (rssi_wlan_r15_present) {
    HANDLE_CODE(unpack_integer(rssi_wlan_r15, bref, (uint8_t)0u, (uint8_t)141u));
  }
  if (rtt_wlan_r15_present) {
    HANDLE_CODE(rtt_wlan_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void log_meas_result_wlan_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("wlan-Identifiers-r15");
  wlan_ids_r15.to_json(j);
  if (rssi_wlan_r15_present) {
    j.write_int("rssiWLAN-r15", rssi_wlan_r15);
  }
  if (rtt_wlan_r15_present) {
    j.write_fieldname("rtt-WLAN-r15");
    rtt_wlan_r15.to_json(j);
  }
  j.end_obj();
}

// MeasResult2CDMA2000-r9 ::= SEQUENCE
SRSASN_CODE meas_result2_cdma2000_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(carrier_freq_r9.pack(bref));
  HANDLE_CODE(meas_result_list_r9.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result2_cdma2000_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(carrier_freq_r9.unpack(bref));
  HANDLE_CODE(meas_result_list_r9.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_result2_cdma2000_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("carrierFreq-r9");
  carrier_freq_r9.to_json(j);
  j.write_fieldname("measResultList-r9");
  meas_result_list_r9.to_json(j);
  j.end_obj();
}

// MeasResult2EUTRA-r9 ::= SEQUENCE
SRSASN_CODE meas_result2_eutra_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, carrier_freq_r9, (uint32_t)0u, (uint32_t)65535u));
  HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_list_r9, 1, 8));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result2_eutra_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(carrier_freq_r9, bref, (uint32_t)0u, (uint32_t)65535u));
  HANDLE_CODE(unpack_dyn_seq_of(meas_result_list_r9, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void meas_result2_eutra_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r9", carrier_freq_r9);
  j.start_array("measResultList-r9");
  for (const auto& e1 : meas_result_list_r9) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// MeasResult2EUTRA-v1250 ::= SEQUENCE
SRSASN_CODE meas_result2_eutra_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rsrq_type_r12_present, 1));

  if (rsrq_type_r12_present) {
    HANDLE_CODE(rsrq_type_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result2_eutra_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rsrq_type_r12_present, 1));

  if (rsrq_type_r12_present) {
    HANDLE_CODE(rsrq_type_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_result2_eutra_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rsrq_type_r12_present) {
    j.write_fieldname("rsrq-Type-r12");
    rsrq_type_r12.to_json(j);
  }
  j.end_obj();
}

// MeasResult2EUTRA-v9e0 ::= SEQUENCE
SRSASN_CODE meas_result2_eutra_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(carrier_freq_v9e0_present, 1));

  if (carrier_freq_v9e0_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_v9e0, (uint32_t)65536u, (uint32_t)262143u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result2_eutra_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(carrier_freq_v9e0_present, 1));

  if (carrier_freq_v9e0_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u));
  }

  return SRSASN_SUCCESS;
}
void meas_result2_eutra_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (carrier_freq_v9e0_present) {
    j.write_int("carrierFreq-v9e0", carrier_freq_v9e0);
  }
  j.end_obj();
}

// MeasResult2UTRA-r9 ::= SEQUENCE
SRSASN_CODE meas_result2_utra_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, carrier_freq_r9, (uint16_t)0u, (uint16_t)16383u));
  HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_list_r9, 1, 8));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result2_utra_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(carrier_freq_r9, bref, (uint16_t)0u, (uint16_t)16383u));
  HANDLE_CODE(unpack_dyn_seq_of(meas_result_list_r9, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void meas_result2_utra_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r9", carrier_freq_r9);
  j.start_array("measResultList-r9");
  for (const auto& e1 : meas_result_list_r9) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// MeasResultIdle-r15 ::= SEQUENCE
SRSASN_CODE meas_result_idle_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_neigh_cells_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, meas_result_serving_cell_r15.rsrp_result_r15, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(pack_integer(bref, meas_result_serving_cell_r15.rsrq_result_r15, (int8_t)-30, (int8_t)46));
  if (meas_result_neigh_cells_r15_present) {
    HANDLE_CODE(meas_result_neigh_cells_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_idle_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r15_present, 1));

  HANDLE_CODE(unpack_integer(meas_result_serving_cell_r15.rsrp_result_r15, bref, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(unpack_integer(meas_result_serving_cell_r15.rsrq_result_r15, bref, (int8_t)-30, (int8_t)46));
  if (meas_result_neigh_cells_r15_present) {
    HANDLE_CODE(meas_result_neigh_cells_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_result_idle_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("measResultServingCell-r15");
  j.start_obj();
  j.write_int("rsrpResult-r15", meas_result_serving_cell_r15.rsrp_result_r15);
  j.write_int("rsrqResult-r15", meas_result_serving_cell_r15.rsrq_result_r15);
  j.end_obj();
  if (meas_result_neigh_cells_r15_present) {
    j.write_fieldname("measResultNeighCells-r15");
    meas_result_neigh_cells_r15.to_json(j);
  }
  j.end_obj();
}

void meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("measResultIdleListEUTRA-r15");
  for (const auto& e1 : c) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}
SRSASN_CODE meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::pack(bit_ref& bref) const
{
  pack_enum(bref, type());
  HANDLE_CODE(pack_dyn_seq_of(bref, c, 1, 8));
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  unpack_enum(e, bref);
  if (e != type()) {
    log_invalid_choice_id(e, "meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_");
    return SRSASN_ERROR_DECODE_FAIL;
  }
  HANDLE_CODE(unpack_dyn_seq_of(c, bref, 1, 8));
  return SRSASN_SUCCESS;
}

// MeasResultMBSFN-r12 ::= SEQUENCE
SRSASN_CODE meas_result_mbsfn_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(sig_bler_result_r12_present, 1));
  HANDLE_CODE(bref.pack(data_bler_mch_result_list_r12_present, 1));

  HANDLE_CODE(pack_integer(bref, mbsfn_area_r12.mbsfn_area_id_r12, (uint16_t)0u, (uint16_t)255u));
  HANDLE_CODE(pack_integer(bref, mbsfn_area_r12.carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(pack_integer(bref, rsrp_result_mbsfn_r12, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(pack_integer(bref, rsrq_result_mbsfn_r12, (uint8_t)0u, (uint8_t)31u));
  if (sig_bler_result_r12_present) {
    HANDLE_CODE(sig_bler_result_r12.pack(bref));
  }
  if (data_bler_mch_result_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, data_bler_mch_result_list_r12, 1, 15));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_mbsfn_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(sig_bler_result_r12_present, 1));
  HANDLE_CODE(bref.unpack(data_bler_mch_result_list_r12_present, 1));

  HANDLE_CODE(unpack_integer(mbsfn_area_r12.mbsfn_area_id_r12, bref, (uint16_t)0u, (uint16_t)255u));
  HANDLE_CODE(unpack_integer(mbsfn_area_r12.carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(unpack_integer(rsrp_result_mbsfn_r12, bref, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(unpack_integer(rsrq_result_mbsfn_r12, bref, (uint8_t)0u, (uint8_t)31u));
  if (sig_bler_result_r12_present) {
    HANDLE_CODE(sig_bler_result_r12.unpack(bref));
  }
  if (data_bler_mch_result_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(data_bler_mch_result_list_r12, bref, 1, 15));
  }

  return SRSASN_SUCCESS;
}
void meas_result_mbsfn_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("mbsfn-Area-r12");
  j.start_obj();
  j.write_int("mbsfn-AreaId-r12", mbsfn_area_r12.mbsfn_area_id_r12);
  j.write_int("carrierFreq-r12", mbsfn_area_r12.carrier_freq_r12);
  j.end_obj();
  j.write_int("rsrpResultMBSFN-r12", rsrp_result_mbsfn_r12);
  j.write_int("rsrqResultMBSFN-r12", rsrq_result_mbsfn_r12);
  if (sig_bler_result_r12_present) {
    j.write_fieldname("signallingBLER-Result-r12");
    sig_bler_result_r12.to_json(j);
  }
  if (data_bler_mch_result_list_r12_present) {
    j.start_array("dataBLER-MCH-ResultList-r12");
    for (const auto& e1 : data_bler_mch_result_list_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// MeasResultSSB-Index-r15 ::= SEQUENCE
SRSASN_CODE meas_result_ssb_idx_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_ssb_idx_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, ssb_idx_r15, (uint8_t)0u, (uint8_t)63u));
  if (meas_result_ssb_idx_r15_present) {
    HANDLE_CODE(meas_result_ssb_idx_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_ssb_idx_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_ssb_idx_r15_present, 1));

  HANDLE_CODE(unpack_integer(ssb_idx_r15, bref, (uint8_t)0u, (uint8_t)63u));
  if (meas_result_ssb_idx_r15_present) {
    HANDLE_CODE(meas_result_ssb_idx_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_result_ssb_idx_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("ssb-Index-r15", ssb_idx_r15);
  if (meas_result_ssb_idx_r15_present) {
    j.write_fieldname("measResultSSB-Index-r15");
    meas_result_ssb_idx_r15.to_json(j);
  }
  j.end_obj();
}

// PerCC-GapIndication-r14 ::= SEQUENCE
SRSASN_CODE per_cc_gap_ind_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, serv_cell_id_r14, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(gap_ind_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE per_cc_gap_ind_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(serv_cell_id_r14, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(gap_ind_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void per_cc_gap_ind_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("servCellId-r14", serv_cell_id_r14);
  j.write_str("gapIndication-r14", gap_ind_r14.to_string());
  j.end_obj();
}

// RRCConnectionReconfigurationComplete-v1530-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_complete_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_available_bt_r15_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_wlan_r15_present, 1));
  HANDLE_CODE(bref.pack(flight_path_info_available_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_complete_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_available_bt_r15_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_wlan_r15_present, 1));
  HANDLE_CODE(bref.unpack(flight_path_info_available_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_complete_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_available_bt_r15_present) {
    j.write_str("logMeasAvailableBT-r15", "true");
  }
  if (log_meas_available_wlan_r15_present) {
    j.write_str("logMeasAvailableWLAN-r15", "true");
  }
  if (flight_path_info_available_r15_present) {
    j.write_str("flightPathInfoAvailable-r15", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RRCConnectionSetupComplete-v1430-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_v1430_ies_s::pack(bit_ref& bref) const
{
  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_v1430_ies_s::unpack(cbit_ref& bref)
{
  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_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  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();
}

// VictimSystemType-r11 ::= SEQUENCE
SRSASN_CODE victim_sys_type_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(gps_r11_present, 1));
  HANDLE_CODE(bref.pack(glonass_r11_present, 1));
  HANDLE_CODE(bref.pack(bds_r11_present, 1));
  HANDLE_CODE(bref.pack(galileo_r11_present, 1));
  HANDLE_CODE(bref.pack(wlan_r11_present, 1));
  HANDLE_CODE(bref.pack(bluetooth_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE victim_sys_type_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(gps_r11_present, 1));
  HANDLE_CODE(bref.unpack(glonass_r11_present, 1));
  HANDLE_CODE(bref.unpack(bds_r11_present, 1));
  HANDLE_CODE(bref.unpack(galileo_r11_present, 1));
  HANDLE_CODE(bref.unpack(wlan_r11_present, 1));
  HANDLE_CODE(bref.unpack(bluetooth_r11_present, 1));

  return SRSASN_SUCCESS;
}
void victim_sys_type_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (gps_r11_present) {
    j.write_str("gps-r11", "true");
  }
  if (glonass_r11_present) {
    j.write_str("glonass-r11", "true");
  }
  if (bds_r11_present) {
    j.write_str("bds-r11", "true");
  }
  if (galileo_r11_present) {
    j.write_str("galileo-r11", "true");
  }
  if (wlan_r11_present) {
    j.write_str("wlan-r11", "true");
  }
  if (bluetooth_r11_present) {
    j.write_str("bluetooth-r11", "true");
  }
  j.end_obj();
}

// VisitedCellInfo-r12 ::= SEQUENCE
SRSASN_CODE visited_cell_info_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(visited_cell_id_r12_present, 1));

  if (visited_cell_id_r12_present) {
    HANDLE_CODE(visited_cell_id_r12.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, time_spent_r12, (uint16_t)0u, (uint16_t)4095u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE visited_cell_info_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(visited_cell_id_r12_present, 1));

  if (visited_cell_id_r12_present) {
    HANDLE_CODE(visited_cell_id_r12.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(time_spent_r12, bref, (uint16_t)0u, (uint16_t)4095u));

  return SRSASN_SUCCESS;
}
void visited_cell_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (visited_cell_id_r12_present) {
    j.write_fieldname("visitedCellId-r12");
    visited_cell_id_r12.to_json(j);
  }
  j.write_int("timeSpent-r12", time_spent_r12);
  j.end_obj();
}

void visited_cell_info_r12_s::visited_cell_id_r12_c_::destroy_()
{
  switch (type_) {
    case types::cell_global_id_r12:
      c.destroy<cell_global_id_eutra_s>();
      break;
    case types::pci_arfcn_r12:
      c.destroy<pci_arfcn_r12_s_>();
      break;
    default:
      break;
  }
}
void visited_cell_info_r12_s::visited_cell_id_r12_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cell_global_id_r12:
      c.init<cell_global_id_eutra_s>();
      break;
    case types::pci_arfcn_r12:
      c.init<pci_arfcn_r12_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "visited_cell_info_r12_s::visited_cell_id_r12_c_");
  }
}
visited_cell_info_r12_s::visited_cell_id_r12_c_::visited_cell_id_r12_c_(
    const visited_cell_info_r12_s::visited_cell_id_r12_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cell_global_id_r12:
      c.init(other.c.get<cell_global_id_eutra_s>());
      break;
    case types::pci_arfcn_r12:
      c.init(other.c.get<pci_arfcn_r12_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "visited_cell_info_r12_s::visited_cell_id_r12_c_");
  }
}
visited_cell_info_r12_s::visited_cell_id_r12_c_& visited_cell_info_r12_s::visited_cell_id_r12_c_::
                                                 operator=(const visited_cell_info_r12_s::visited_cell_id_r12_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cell_global_id_r12:
      c.set(other.c.get<cell_global_id_eutra_s>());
      break;
    case types::pci_arfcn_r12:
      c.set(other.c.get<pci_arfcn_r12_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "visited_cell_info_r12_s::visited_cell_id_r12_c_");
  }

  return *this;
}
void visited_cell_info_r12_s::visited_cell_id_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cell_global_id_r12:
      j.write_fieldname("cellGlobalId-r12");
      c.get<cell_global_id_eutra_s>().to_json(j);
      break;
    case types::pci_arfcn_r12:
      j.write_fieldname("pci-arfcn-r12");
      j.start_obj();
      j.write_int("physCellId-r12", c.get<pci_arfcn_r12_s_>().pci_r12);
      j.write_int("carrierFreq-r12", c.get<pci_arfcn_r12_s_>().carrier_freq_r12);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "visited_cell_info_r12_s::visited_cell_id_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE visited_cell_info_r12_s::visited_cell_id_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cell_global_id_r12:
      HANDLE_CODE(c.get<cell_global_id_eutra_s>().pack(bref));
      break;
    case types::pci_arfcn_r12:
      HANDLE_CODE(pack_integer(bref, c.get<pci_arfcn_r12_s_>().pci_r12, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(pack_integer(bref, c.get<pci_arfcn_r12_s_>().carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u));
      break;
    default:
      log_invalid_choice_id(type_, "visited_cell_info_r12_s::visited_cell_id_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE visited_cell_info_r12_s::visited_cell_id_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cell_global_id_r12:
      HANDLE_CODE(c.get<cell_global_id_eutra_s>().unpack(bref));
      break;
    case types::pci_arfcn_r12:
      HANDLE_CODE(unpack_integer(c.get<pci_arfcn_r12_s_>().pci_r12, bref, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(unpack_integer(c.get<pci_arfcn_r12_s_>().carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));
      break;
    default:
      log_invalid_choice_id(type_, "visited_cell_info_r12_s::visited_cell_id_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// WayPointLocation-r15 ::= SEQUENCE
SRSASN_CODE way_point_location_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(time_stamp_r15_present, 1));

  HANDLE_CODE(way_point_location_r15.pack(bref));
  if (time_stamp_r15_present) {
    HANDLE_CODE(time_stamp_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE way_point_location_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(time_stamp_r15_present, 1));

  HANDLE_CODE(way_point_location_r15.unpack(bref));
  if (time_stamp_r15_present) {
    HANDLE_CODE(time_stamp_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void way_point_location_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("wayPointLocation-r15");
  way_point_location_r15.to_json(j);
  if (time_stamp_r15_present) {
    j.write_str("timeStamp-r15", time_stamp_r15.to_string());
  }
  j.end_obj();
}

// AffectedCarrierFreqCombInfoMRDC-r15 ::= SEQUENCE
SRSASN_CODE affected_carrier_freq_comb_info_mrdc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(affected_carrier_freq_comb_mrdc_r15_present, 1));

  HANDLE_CODE(victim_sys_type_r15.pack(bref));
  HANDLE_CODE(interference_direction_mrdc_r15.pack(bref));
  if (affected_carrier_freq_comb_mrdc_r15_present) {
    HANDLE_CODE(bref.pack(affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_eutra_r15_present, 1));
    if (affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_eutra_r15_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref,
                                  affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_eutra_r15,
                                  1,
                                  32,
                                  integer_packer<uint8_t>(1, 64)));
    }
    HANDLE_CODE(pack_dyn_seq_of(bref,
                                affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_nr_r15,
                                1,
                                16,
                                integer_packer<uint32_t>(0, 3279165)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE affected_carrier_freq_comb_info_mrdc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(affected_carrier_freq_comb_mrdc_r15_present, 1));

  HANDLE_CODE(victim_sys_type_r15.unpack(bref));
  HANDLE_CODE(interference_direction_mrdc_r15.unpack(bref));
  if (affected_carrier_freq_comb_mrdc_r15_present) {
    HANDLE_CODE(bref.unpack(affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_eutra_r15_present, 1));
    if (affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_eutra_r15_present) {
      HANDLE_CODE(unpack_dyn_seq_of(affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_eutra_r15,
                                    bref,
                                    1,
                                    32,
                                    integer_packer<uint8_t>(1, 64)));
    }
    HANDLE_CODE(unpack_dyn_seq_of(affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_nr_r15,
                                  bref,
                                  1,
                                  16,
                                  integer_packer<uint32_t>(0, 3279165)));
  }

  return SRSASN_SUCCESS;
}
void affected_carrier_freq_comb_info_mrdc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("victimSystemType-r15");
  victim_sys_type_r15.to_json(j);
  j.write_str("interferenceDirectionMRDC-r15", interference_direction_mrdc_r15.to_string());
  if (affected_carrier_freq_comb_mrdc_r15_present) {
    j.write_fieldname("affectedCarrierFreqCombMRDC-r15");
    j.start_obj();
    if (affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_eutra_r15_present) {
      j.start_array("affectedCarrierFreqCombEUTRA-r15");
      for (const auto& e1 : affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_eutra_r15) {
        j.write_int(e1);
      }
      j.end_array();
    }
    j.start_array("affectedCarrierFreqCombNR-r15");
    for (const auto& e1 : affected_carrier_freq_comb_mrdc_r15.affected_carrier_freq_comb_nr_r15) {
      j.write_int(e1);
    }
    j.end_array();
    j.end_obj();
  }
  j.end_obj();
}

// CGI-InfoNR-r15 ::= SEQUENCE
SRSASN_CODE cgi_info_nr_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(plmn_id_info_list_r15_present, 1));
  HANDLE_CODE(bref.pack(freq_band_list_minus15_present, 1));
  HANDLE_CODE(bref.pack(no_sib1_r15_present, 1));

  if (plmn_id_info_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_info_list_r15, 1, 12));
  }
  if (freq_band_list_minus15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_list_minus15, 1, 32, integer_packer<uint16_t>(1, 1024)));
  }
  if (no_sib1_r15_present) {
    HANDLE_CODE(pack_integer(bref, no_sib1_r15.ssb_subcarrier_offset_r15, (uint8_t)0u, (uint8_t)15u));
    HANDLE_CODE(pack_integer(bref, no_sib1_r15.pdcch_cfg_sib1_r15, (uint16_t)0u, (uint16_t)255u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE cgi_info_nr_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(plmn_id_info_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(freq_band_list_minus15_present, 1));
  HANDLE_CODE(bref.unpack(no_sib1_r15_present, 1));

  if (plmn_id_info_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(plmn_id_info_list_r15, bref, 1, 12));
  }
  if (freq_band_list_minus15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(freq_band_list_minus15, bref, 1, 32, integer_packer<uint16_t>(1, 1024)));
  }
  if (no_sib1_r15_present) {
    HANDLE_CODE(unpack_integer(no_sib1_r15.ssb_subcarrier_offset_r15, bref, (uint8_t)0u, (uint8_t)15u));
    HANDLE_CODE(unpack_integer(no_sib1_r15.pdcch_cfg_sib1_r15, bref, (uint16_t)0u, (uint16_t)255u));
  }

  return SRSASN_SUCCESS;
}
void cgi_info_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (plmn_id_info_list_r15_present) {
    j.start_array("plmn-IdentityInfoList-r15");
    for (const auto& e1 : plmn_id_info_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (freq_band_list_minus15_present) {
    j.start_array("frequencyBandList-15");
    for (const auto& e1 : freq_band_list_minus15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (no_sib1_r15_present) {
    j.write_fieldname("noSIB1-r15");
    j.start_obj();
    j.write_int("ssb-SubcarrierOffset-r15", no_sib1_r15.ssb_subcarrier_offset_r15);
    j.write_int("pdcch-ConfigSIB1-r15", no_sib1_r15.pdcch_cfg_sib1_r15);
    j.end_obj();
  }
  j.end_obj();
}

// FlightPathInfoReport-r15 ::= SEQUENCE
SRSASN_CODE flight_path_info_report_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(flight_path_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (flight_path_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, flight_path_r15, 1, 20));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE flight_path_info_report_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(flight_path_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (flight_path_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(flight_path_r15, bref, 1, 20));
  }

  return SRSASN_SUCCESS;
}
void flight_path_info_report_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (flight_path_r15_present) {
    j.start_array("flightPath-r15");
    for (const auto& e1 : flight_path_r15) {
      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();
}

// RRCConnectionReconfigurationComplete-v1510-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_complete_v1510_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(scg_cfg_resp_nr_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (scg_cfg_resp_nr_r15_present) {
    HANDLE_CODE(scg_cfg_resp_nr_r15.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_complete_v1510_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(scg_cfg_resp_nr_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (scg_cfg_resp_nr_r15_present) {
    HANDLE_CODE(scg_cfg_resp_nr_r15.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_complete_v1510_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (scg_cfg_resp_nr_r15_present) {
    j.write_str("scg-ConfigResponseNR-r15", scg_cfg_resp_nr_r15.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReestablishmentComplete-v1530-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_complete_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_available_bt_r15_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_wlan_r15_present, 1));
  HANDLE_CODE(bref.pack(flight_path_info_available_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_complete_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_available_bt_r15_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_wlan_r15_present, 1));
  HANDLE_CODE(bref.unpack(flight_path_info_available_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_complete_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_available_bt_r15_present) {
    j.write_str("logMeasAvailableBT-r15", "true");
  }
  if (log_meas_available_wlan_r15_present) {
    j.write_str("logMeasAvailableWLAN-r15", "true");
  }
  if (flight_path_info_available_r15_present) {
    j.write_str("flightPathInfoAvailable-r15", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RRCConnectionSetupComplete-v1330-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_v1330_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ue_ce_need_ul_gaps_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_v1330_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_ce_need_ul_gaps_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_complete_v1330_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_ce_need_ul_gaps_r13_present) {
    j.write_str("ue-CE-NeedULGaps-r13", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// LogMeasInfo-r10 ::= SEQUENCE
SRSASN_CODE log_meas_info_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(location_info_r10_present, 1));
  HANDLE_CODE(bref.pack(meas_result_neigh_cells_r10_present, 1));

  if (location_info_r10_present) {
    HANDLE_CODE(location_info_r10.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, relative_time_stamp_r10, (uint16_t)0u, (uint16_t)7200u));
  HANDLE_CODE(serv_cell_id_r10.pack(bref));
  HANDLE_CODE(pack_integer(bref, meas_result_serv_cell_r10.rsrp_result_r10, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(pack_integer(bref, meas_result_serv_cell_r10.rsrq_result_r10, (uint8_t)0u, (uint8_t)34u));
  if (meas_result_neigh_cells_r10_present) {
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r10.meas_result_list_eutra_r10_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r10.meas_result_list_utra_r10_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r10.meas_result_list_geran_r10_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r10.meas_result_list_cdma2000_r10_present, 1));
    if (meas_result_neigh_cells_r10.meas_result_list_eutra_r10_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r10.meas_result_list_eutra_r10, 1, 8));
    }
    if (meas_result_neigh_cells_r10.meas_result_list_utra_r10_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r10.meas_result_list_utra_r10, 1, 8));
    }
    if (meas_result_neigh_cells_r10.meas_result_list_geran_r10_present) {
      HANDLE_CODE(pack_dyn_seq_of(
          bref, meas_result_neigh_cells_r10.meas_result_list_geran_r10, 1, 3, SeqOfPacker<Packer>(1, 8, Packer())));
    }
    if (meas_result_neigh_cells_r10.meas_result_list_cdma2000_r10_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r10.meas_result_list_cdma2000_r10, 1, 8));
    }
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= meas_result_list_eutra_v1090.is_present();
    group_flags[1] |= meas_result_list_mbsfn_r12.is_present();
    group_flags[1] |= meas_result_serv_cell_v1250_present;
    group_flags[1] |= serv_cell_rsrq_type_r12.is_present();
    group_flags[1] |= meas_result_list_eutra_v1250.is_present();
    group_flags[2] |= in_dev_coex_detected_r13_present;
    group_flags[3] |= meas_result_serv_cell_v1360_present;
    group_flags[4] |= log_meas_result_list_bt_r15.is_present();
    group_flags[4] |= log_meas_result_list_wlan_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_list_eutra_v1090.is_present(), 1));
      if (meas_result_list_eutra_v1090.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_list_eutra_v1090, 1, 8));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_list_mbsfn_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_serv_cell_v1250_present, 1));
      HANDLE_CODE(bref.pack(serv_cell_rsrq_type_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_list_eutra_v1250.is_present(), 1));
      if (meas_result_list_mbsfn_r12.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_list_mbsfn_r12, 1, 8));
      }
      if (meas_result_serv_cell_v1250_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_serv_cell_v1250, (int8_t)-30, (int8_t)46));
      }
      if (serv_cell_rsrq_type_r12.is_present()) {
        HANDLE_CODE(serv_cell_rsrq_type_r12->pack(bref));
      }
      if (meas_result_list_eutra_v1250.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_list_eutra_v1250, 1, 8));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(in_dev_coex_detected_r13_present, 1));
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_serv_cell_v1360_present, 1));
      if (meas_result_serv_cell_v1360_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_serv_cell_v1360, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(log_meas_result_list_bt_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(log_meas_result_list_wlan_r15.is_present(), 1));
      if (log_meas_result_list_bt_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *log_meas_result_list_bt_r15, 1, 32));
      }
      if (log_meas_result_list_wlan_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *log_meas_result_list_wlan_r15, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE log_meas_info_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(location_info_r10_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r10_present, 1));

  if (location_info_r10_present) {
    HANDLE_CODE(location_info_r10.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(relative_time_stamp_r10, bref, (uint16_t)0u, (uint16_t)7200u));
  HANDLE_CODE(serv_cell_id_r10.unpack(bref));
  HANDLE_CODE(unpack_integer(meas_result_serv_cell_r10.rsrp_result_r10, bref, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(unpack_integer(meas_result_serv_cell_r10.rsrq_result_r10, bref, (uint8_t)0u, (uint8_t)34u));
  if (meas_result_neigh_cells_r10_present) {
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r10.meas_result_list_eutra_r10_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r10.meas_result_list_utra_r10_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r10.meas_result_list_geran_r10_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r10.meas_result_list_cdma2000_r10_present, 1));
    if (meas_result_neigh_cells_r10.meas_result_list_eutra_r10_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r10.meas_result_list_eutra_r10, bref, 1, 8));
    }
    if (meas_result_neigh_cells_r10.meas_result_list_utra_r10_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r10.meas_result_list_utra_r10, bref, 1, 8));
    }
    if (meas_result_neigh_cells_r10.meas_result_list_geran_r10_present) {
      HANDLE_CODE(unpack_dyn_seq_of(
          meas_result_neigh_cells_r10.meas_result_list_geran_r10, bref, 1, 3, SeqOfPacker<Packer>(1, 8, Packer())));
    }
    if (meas_result_neigh_cells_r10.meas_result_list_cdma2000_r10_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r10.meas_result_list_cdma2000_r10, bref, 1, 8));
    }
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(5);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_result_list_eutra_v1090_present;
      HANDLE_CODE(bref.unpack(meas_result_list_eutra_v1090_present, 1));
      meas_result_list_eutra_v1090.set_present(meas_result_list_eutra_v1090_present);
      if (meas_result_list_eutra_v1090.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_list_eutra_v1090, bref, 1, 8));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_result_list_mbsfn_r12_present;
      HANDLE_CODE(bref.unpack(meas_result_list_mbsfn_r12_present, 1));
      meas_result_list_mbsfn_r12.set_present(meas_result_list_mbsfn_r12_present);
      HANDLE_CODE(bref.unpack(meas_result_serv_cell_v1250_present, 1));
      bool serv_cell_rsrq_type_r12_present;
      HANDLE_CODE(bref.unpack(serv_cell_rsrq_type_r12_present, 1));
      serv_cell_rsrq_type_r12.set_present(serv_cell_rsrq_type_r12_present);
      bool meas_result_list_eutra_v1250_present;
      HANDLE_CODE(bref.unpack(meas_result_list_eutra_v1250_present, 1));
      meas_result_list_eutra_v1250.set_present(meas_result_list_eutra_v1250_present);
      if (meas_result_list_mbsfn_r12.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_list_mbsfn_r12, bref, 1, 8));
      }
      if (meas_result_serv_cell_v1250_present) {
        HANDLE_CODE(unpack_integer(meas_result_serv_cell_v1250, bref, (int8_t)-30, (int8_t)46));
      }
      if (serv_cell_rsrq_type_r12.is_present()) {
        HANDLE_CODE(serv_cell_rsrq_type_r12->unpack(bref));
      }
      if (meas_result_list_eutra_v1250.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_list_eutra_v1250, bref, 1, 8));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(in_dev_coex_detected_r13_present, 1));
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(meas_result_serv_cell_v1360_present, 1));
      if (meas_result_serv_cell_v1360_present) {
        HANDLE_CODE(unpack_integer(meas_result_serv_cell_v1360, bref, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool log_meas_result_list_bt_r15_present;
      HANDLE_CODE(bref.unpack(log_meas_result_list_bt_r15_present, 1));
      log_meas_result_list_bt_r15.set_present(log_meas_result_list_bt_r15_present);
      bool log_meas_result_list_wlan_r15_present;
      HANDLE_CODE(bref.unpack(log_meas_result_list_wlan_r15_present, 1));
      log_meas_result_list_wlan_r15.set_present(log_meas_result_list_wlan_r15_present);
      if (log_meas_result_list_bt_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*log_meas_result_list_bt_r15, bref, 1, 32));
      }
      if (log_meas_result_list_wlan_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*log_meas_result_list_wlan_r15, bref, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void log_meas_info_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (location_info_r10_present) {
    j.write_fieldname("locationInfo-r10");
    location_info_r10.to_json(j);
  }
  j.write_int("relativeTimeStamp-r10", relative_time_stamp_r10);
  j.write_fieldname("servCellIdentity-r10");
  serv_cell_id_r10.to_json(j);
  j.write_fieldname("measResultServCell-r10");
  j.start_obj();
  j.write_int("rsrpResult-r10", meas_result_serv_cell_r10.rsrp_result_r10);
  j.write_int("rsrqResult-r10", meas_result_serv_cell_r10.rsrq_result_r10);
  j.end_obj();
  if (meas_result_neigh_cells_r10_present) {
    j.write_fieldname("measResultNeighCells-r10");
    j.start_obj();
    if (meas_result_neigh_cells_r10.meas_result_list_eutra_r10_present) {
      j.start_array("measResultListEUTRA-r10");
      for (const auto& e1 : meas_result_neigh_cells_r10.meas_result_list_eutra_r10) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r10.meas_result_list_utra_r10_present) {
      j.start_array("measResultListUTRA-r10");
      for (const auto& e1 : meas_result_neigh_cells_r10.meas_result_list_utra_r10) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r10.meas_result_list_geran_r10_present) {
      j.start_array("measResultListGERAN-r10");
      for (const auto& e1 : meas_result_neigh_cells_r10.meas_result_list_geran_r10) {
        j.start_array();
        for (const auto& e2 : e1) {
          e2.to_json(j);
        }
        j.end_array();
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r10.meas_result_list_cdma2000_r10_present) {
      j.start_array("measResultListCDMA2000-r10");
      for (const auto& e1 : meas_result_neigh_cells_r10.meas_result_list_cdma2000_r10) {
        e1.to_json(j);
      }
      j.end_array();
    }
    j.end_obj();
  }
  if (ext) {
    if (meas_result_list_eutra_v1090.is_present()) {
      j.start_array("measResultListEUTRA-v1090");
      for (const auto& e1 : *meas_result_list_eutra_v1090) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_list_mbsfn_r12.is_present()) {
      j.start_array("measResultListMBSFN-r12");
      for (const auto& e1 : *meas_result_list_mbsfn_r12) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_serv_cell_v1250_present) {
      j.write_int("measResultServCell-v1250", meas_result_serv_cell_v1250);
    }
    if (serv_cell_rsrq_type_r12.is_present()) {
      j.write_fieldname("servCellRSRQ-Type-r12");
      serv_cell_rsrq_type_r12->to_json(j);
    }
    if (meas_result_list_eutra_v1250.is_present()) {
      j.start_array("measResultListEUTRA-v1250");
      for (const auto& e1 : *meas_result_list_eutra_v1250) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (in_dev_coex_detected_r13_present) {
      j.write_str("inDeviceCoexDetected-r13", "true");
    }
    if (meas_result_serv_cell_v1360_present) {
      j.write_int("measResultServCell-v1360", meas_result_serv_cell_v1360);
    }
    if (log_meas_result_list_bt_r15.is_present()) {
      j.start_array("logMeasResultListBT-r15");
      for (const auto& e1 : *log_meas_result_list_bt_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (log_meas_result_list_wlan_r15.is_present()) {
      j.start_array("logMeasResultListWLAN-r15");
      for (const auto& e1 : *log_meas_result_list_wlan_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// MRDC-AssistanceInfo-r15 ::= SEQUENCE
SRSASN_CODE mrdc_assist_info_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_dyn_seq_of(bref, affected_carrier_freq_comb_info_list_mrdc_r15, 1, 128));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mrdc_assist_info_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_dyn_seq_of(affected_carrier_freq_comb_info_list_mrdc_r15, bref, 1, 128));

  return SRSASN_SUCCESS;
}
void mrdc_assist_info_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("affectedCarrierFreqCombInfoListMRDC-r15");
  for (const auto& e1 : affected_carrier_freq_comb_info_list_mrdc_r15) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// MeasResultCellNR-r15 ::= SEQUENCE
SRSASN_CODE meas_result_cell_nr_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_rs_idx_list_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, pci_r15, (uint16_t)0u, (uint16_t)1007u));
  HANDLE_CODE(meas_result_cell_r15.pack(bref));
  if (meas_result_rs_idx_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_rs_idx_list_r15, 1, 32));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= cgi_info_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(cgi_info_r15.is_present(), 1));
      if (cgi_info_r15.is_present()) {
        HANDLE_CODE(cgi_info_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_cell_nr_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_rs_idx_list_r15_present, 1));

  HANDLE_CODE(unpack_integer(pci_r15, bref, (uint16_t)0u, (uint16_t)1007u));
  HANDLE_CODE(meas_result_cell_r15.unpack(bref));
  if (meas_result_rs_idx_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_rs_idx_list_r15, bref, 1, 32));
  }

  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 cgi_info_r15_present;
      HANDLE_CODE(bref.unpack(cgi_info_r15_present, 1));
      cgi_info_r15.set_present(cgi_info_r15_present);
      if (cgi_info_r15.is_present()) {
        HANDLE_CODE(cgi_info_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_result_cell_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("pci-r15", pci_r15);
  j.write_fieldname("measResultCell-r15");
  meas_result_cell_r15.to_json(j);
  if (meas_result_rs_idx_list_r15_present) {
    j.start_array("measResultRS-IndexList-r15");
    for (const auto& e1 : meas_result_rs_idx_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (ext) {
    if (cgi_info_r15.is_present()) {
      j.write_fieldname("cgi-Info-r15");
      cgi_info_r15->to_json(j);
    }
  }
  j.end_obj();
}

// RRCConnectionReconfigurationComplete-v1430-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_complete_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(per_cc_gap_ind_list_r14_present, 1));
  HANDLE_CODE(bref.pack(num_freq_effective_r14_present, 1));
  HANDLE_CODE(bref.pack(num_freq_effective_reduced_r14_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (per_cc_gap_ind_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, per_cc_gap_ind_list_r14, 1, 32));
  }
  if (num_freq_effective_r14_present) {
    HANDLE_CODE(pack_integer(bref, num_freq_effective_r14, (uint8_t)1u, (uint8_t)12u));
  }
  if (num_freq_effective_reduced_r14_present) {
    HANDLE_CODE(pack_integer(bref, num_freq_effective_reduced_r14, (uint8_t)1u, (uint8_t)12u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_complete_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(per_cc_gap_ind_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(num_freq_effective_r14_present, 1));
  HANDLE_CODE(bref.unpack(num_freq_effective_reduced_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (per_cc_gap_ind_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(per_cc_gap_ind_list_r14, bref, 1, 32));
  }
  if (num_freq_effective_r14_present) {
    HANDLE_CODE(unpack_integer(num_freq_effective_r14, bref, (uint8_t)1u, (uint8_t)12u));
  }
  if (num_freq_effective_reduced_r14_present) {
    HANDLE_CODE(unpack_integer(num_freq_effective_reduced_r14, bref, (uint8_t)1u, (uint8_t)12u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_complete_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (per_cc_gap_ind_list_r14_present) {
    j.start_array("perCC-GapIndicationList-r14");
    for (const auto& e1 : per_cc_gap_ind_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (num_freq_effective_r14_present) {
    j.write_int("numFreqEffective-r14", num_freq_effective_r14);
  }
  if (num_freq_effective_reduced_r14_present) {
    j.write_int("numFreqEffectiveReduced-r14", num_freq_effective_reduced_r14);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReestablishmentComplete-v1250-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_complete_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_available_mbsfn_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_complete_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_available_mbsfn_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_complete_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_available_mbsfn_r12_present) {
    j.write_str("logMeasAvailableMBSFN-r12", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionSetupComplete-v1320-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_v1320_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_mode_b_r13_present, 1));
  HANDLE_CODE(bref.pack(s_tmsi_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(cp_cio_t_eps_optim_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (s_tmsi_r13_present) {
    HANDLE_CODE(s_tmsi_r13.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_v1320_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_mode_b_r13_present, 1));
  HANDLE_CODE(bref.unpack(s_tmsi_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(cp_cio_t_eps_optim_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (s_tmsi_r13_present) {
    HANDLE_CODE(s_tmsi_r13.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_complete_v1320_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_mode_b_r13_present) {
    j.write_str("ce-ModeB-r13", "supported");
  }
  if (s_tmsi_r13_present) {
    j.write_fieldname("s-TMSI-r13");
    s_tmsi_r13.to_json(j);
  }
  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 (cp_cio_t_eps_optim_r13_present) {
    j.write_str("cp-CIoT-EPS-Optimisation-r13", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// TrafficPatternInfo-v1530 ::= SEQUENCE
SRSASN_CODE traffic_pattern_info_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(traffic_dest_r15_present, 1));
  HANDLE_CODE(bref.pack(reliability_info_sl_r15_present, 1));

  if (traffic_dest_r15_present) {
    HANDLE_CODE(traffic_dest_r15.pack(bref));
  }
  if (reliability_info_sl_r15_present) {
    HANDLE_CODE(pack_integer(bref, reliability_info_sl_r15, (uint8_t)1u, (uint8_t)8u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE traffic_pattern_info_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(traffic_dest_r15_present, 1));
  HANDLE_CODE(bref.unpack(reliability_info_sl_r15_present, 1));

  if (traffic_dest_r15_present) {
    HANDLE_CODE(traffic_dest_r15.unpack(bref));
  }
  if (reliability_info_sl_r15_present) {
    HANDLE_CODE(unpack_integer(reliability_info_sl_r15, bref, (uint8_t)1u, (uint8_t)8u));
  }

  return SRSASN_SUCCESS;
}
void traffic_pattern_info_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (traffic_dest_r15_present) {
    j.write_str("trafficDestination-r15", traffic_dest_r15.to_string());
  }
  if (reliability_info_sl_r15_present) {
    j.write_int("reliabilityInfoSL-r15", reliability_info_sl_r15);
  }
  j.end_obj();
}

// UEInformationResponse-v1530-IEs ::= SEQUENCE
SRSASN_CODE ue_info_resp_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_result_list_idle_r15_present, 1));
  HANDLE_CODE(bref.pack(flight_path_info_report_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (meas_result_list_idle_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_list_idle_r15, 1, 3));
  }
  if (flight_path_info_report_r15_present) {
    HANDLE_CODE(flight_path_info_report_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_resp_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_result_list_idle_r15_present, 1));
  HANDLE_CODE(bref.unpack(flight_path_info_report_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (meas_result_list_idle_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_list_idle_r15, bref, 1, 3));
  }
  if (flight_path_info_report_r15_present) {
    HANDLE_CODE(flight_path_info_report_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_resp_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_result_list_idle_r15_present) {
    j.start_array("measResultListIdle-r15");
    for (const auto& e1 : meas_result_list_idle_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (flight_path_info_report_r15_present) {
    j.write_fieldname("flightPathInfoReport-r15");
    flight_path_info_report_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// AffectedCarrierFreq-v1310 ::= SEQUENCE
SRSASN_CODE affected_carrier_freq_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(carrier_freq_v1310_present, 1));

  if (carrier_freq_v1310_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_v1310, (uint8_t)33u, (uint8_t)64u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE affected_carrier_freq_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(carrier_freq_v1310_present, 1));

  if (carrier_freq_v1310_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_v1310, bref, (uint8_t)33u, (uint8_t)64u));
  }

  return SRSASN_SUCCESS;
}
void affected_carrier_freq_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (carrier_freq_v1310_present) {
    j.write_int("carrierFreq-v1310", carrier_freq_v1310);
  }
  j.end_obj();
}

// ConnEstFailReport-r11 ::= SEQUENCE
SRSASN_CODE conn_est_fail_report_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(location_info_r11_present, 1));
  HANDLE_CODE(bref.pack(meas_result_neigh_cells_r11_present, 1));
  HANDLE_CODE(bref.pack(meas_result_list_eutra_v1130_present, 1));

  HANDLE_CODE(failed_cell_id_r11.pack(bref));
  if (location_info_r11_present) {
    HANDLE_CODE(location_info_r11.pack(bref));
  }
  HANDLE_CODE(bref.pack(meas_result_failed_cell_r11.rsrq_result_r11_present, 1));
  HANDLE_CODE(pack_integer(bref, meas_result_failed_cell_r11.rsrp_result_r11, (uint8_t)0u, (uint8_t)97u));
  if (meas_result_failed_cell_r11.rsrq_result_r11_present) {
    HANDLE_CODE(pack_integer(bref, meas_result_failed_cell_r11.rsrq_result_r11, (uint8_t)0u, (uint8_t)34u));
  }
  if (meas_result_neigh_cells_r11_present) {
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r11.meas_result_list_eutra_r11_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r11.meas_result_list_utra_r11_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r11.meas_result_list_geran_r11_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r11.meas_results_cdma2000_r11_present, 1));
    if (meas_result_neigh_cells_r11.meas_result_list_eutra_r11_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r11.meas_result_list_eutra_r11, 1, 8));
    }
    if (meas_result_neigh_cells_r11.meas_result_list_utra_r11_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r11.meas_result_list_utra_r11, 1, 8));
    }
    if (meas_result_neigh_cells_r11.meas_result_list_geran_r11_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r11.meas_result_list_geran_r11, 1, 8));
    }
    if (meas_result_neigh_cells_r11.meas_results_cdma2000_r11_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r11.meas_results_cdma2000_r11, 1, 8));
    }
  }
  HANDLE_CODE(pack_integer(bref, nof_preambs_sent_r11, (uint8_t)1u, (uint8_t)200u));
  HANDLE_CODE(bref.pack(contention_detected_r11, 1));
  HANDLE_CODE(bref.pack(max_tx_pwr_reached_r11, 1));
  HANDLE_CODE(pack_integer(bref, time_since_fail_r11, (uint32_t)0u, (uint32_t)172800u));
  if (meas_result_list_eutra_v1130_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_list_eutra_v1130, 1, 8));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= meas_result_failed_cell_v1250_present;
    group_flags[0] |= failed_cell_rsrq_type_r12.is_present();
    group_flags[0] |= meas_result_list_eutra_v1250.is_present();
    group_flags[1] |= meas_result_failed_cell_v1360_present;
    group_flags[2] |= log_meas_result_list_bt_r15.is_present();
    group_flags[2] |= log_meas_result_list_wlan_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_failed_cell_v1250_present, 1));
      HANDLE_CODE(bref.pack(failed_cell_rsrq_type_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_list_eutra_v1250.is_present(), 1));
      if (meas_result_failed_cell_v1250_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_failed_cell_v1250, (int8_t)-30, (int8_t)46));
      }
      if (failed_cell_rsrq_type_r12.is_present()) {
        HANDLE_CODE(failed_cell_rsrq_type_r12->pack(bref));
      }
      if (meas_result_list_eutra_v1250.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_list_eutra_v1250, 1, 8));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_failed_cell_v1360_present, 1));
      if (meas_result_failed_cell_v1360_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_failed_cell_v1360, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(log_meas_result_list_bt_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(log_meas_result_list_wlan_r15.is_present(), 1));
      if (log_meas_result_list_bt_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *log_meas_result_list_bt_r15, 1, 32));
      }
      if (log_meas_result_list_wlan_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *log_meas_result_list_wlan_r15, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE conn_est_fail_report_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(location_info_r11_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r11_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_list_eutra_v1130_present, 1));

  HANDLE_CODE(failed_cell_id_r11.unpack(bref));
  if (location_info_r11_present) {
    HANDLE_CODE(location_info_r11.unpack(bref));
  }
  HANDLE_CODE(bref.unpack(meas_result_failed_cell_r11.rsrq_result_r11_present, 1));
  HANDLE_CODE(unpack_integer(meas_result_failed_cell_r11.rsrp_result_r11, bref, (uint8_t)0u, (uint8_t)97u));
  if (meas_result_failed_cell_r11.rsrq_result_r11_present) {
    HANDLE_CODE(unpack_integer(meas_result_failed_cell_r11.rsrq_result_r11, bref, (uint8_t)0u, (uint8_t)34u));
  }
  if (meas_result_neigh_cells_r11_present) {
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r11.meas_result_list_eutra_r11_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r11.meas_result_list_utra_r11_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r11.meas_result_list_geran_r11_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r11.meas_results_cdma2000_r11_present, 1));
    if (meas_result_neigh_cells_r11.meas_result_list_eutra_r11_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r11.meas_result_list_eutra_r11, bref, 1, 8));
    }
    if (meas_result_neigh_cells_r11.meas_result_list_utra_r11_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r11.meas_result_list_utra_r11, bref, 1, 8));
    }
    if (meas_result_neigh_cells_r11.meas_result_list_geran_r11_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r11.meas_result_list_geran_r11, bref, 1, 8));
    }
    if (meas_result_neigh_cells_r11.meas_results_cdma2000_r11_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r11.meas_results_cdma2000_r11, bref, 1, 8));
    }
  }
  HANDLE_CODE(unpack_integer(nof_preambs_sent_r11, bref, (uint8_t)1u, (uint8_t)200u));
  HANDLE_CODE(bref.unpack(contention_detected_r11, 1));
  HANDLE_CODE(bref.unpack(max_tx_pwr_reached_r11, 1));
  HANDLE_CODE(unpack_integer(time_since_fail_r11, bref, (uint32_t)0u, (uint32_t)172800u));
  if (meas_result_list_eutra_v1130_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_list_eutra_v1130, bref, 1, 8));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(meas_result_failed_cell_v1250_present, 1));
      bool failed_cell_rsrq_type_r12_present;
      HANDLE_CODE(bref.unpack(failed_cell_rsrq_type_r12_present, 1));
      failed_cell_rsrq_type_r12.set_present(failed_cell_rsrq_type_r12_present);
      bool meas_result_list_eutra_v1250_present;
      HANDLE_CODE(bref.unpack(meas_result_list_eutra_v1250_present, 1));
      meas_result_list_eutra_v1250.set_present(meas_result_list_eutra_v1250_present);
      if (meas_result_failed_cell_v1250_present) {
        HANDLE_CODE(unpack_integer(meas_result_failed_cell_v1250, bref, (int8_t)-30, (int8_t)46));
      }
      if (failed_cell_rsrq_type_r12.is_present()) {
        HANDLE_CODE(failed_cell_rsrq_type_r12->unpack(bref));
      }
      if (meas_result_list_eutra_v1250.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_list_eutra_v1250, bref, 1, 8));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(meas_result_failed_cell_v1360_present, 1));
      if (meas_result_failed_cell_v1360_present) {
        HANDLE_CODE(unpack_integer(meas_result_failed_cell_v1360, bref, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool log_meas_result_list_bt_r15_present;
      HANDLE_CODE(bref.unpack(log_meas_result_list_bt_r15_present, 1));
      log_meas_result_list_bt_r15.set_present(log_meas_result_list_bt_r15_present);
      bool log_meas_result_list_wlan_r15_present;
      HANDLE_CODE(bref.unpack(log_meas_result_list_wlan_r15_present, 1));
      log_meas_result_list_wlan_r15.set_present(log_meas_result_list_wlan_r15_present);
      if (log_meas_result_list_bt_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*log_meas_result_list_bt_r15, bref, 1, 32));
      }
      if (log_meas_result_list_wlan_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*log_meas_result_list_wlan_r15, bref, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void conn_est_fail_report_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("failedCellId-r11");
  failed_cell_id_r11.to_json(j);
  if (location_info_r11_present) {
    j.write_fieldname("locationInfo-r11");
    location_info_r11.to_json(j);
  }
  j.write_fieldname("measResultFailedCell-r11");
  j.start_obj();
  j.write_int("rsrpResult-r11", meas_result_failed_cell_r11.rsrp_result_r11);
  if (meas_result_failed_cell_r11.rsrq_result_r11_present) {
    j.write_int("rsrqResult-r11", meas_result_failed_cell_r11.rsrq_result_r11);
  }
  j.end_obj();
  if (meas_result_neigh_cells_r11_present) {
    j.write_fieldname("measResultNeighCells-r11");
    j.start_obj();
    if (meas_result_neigh_cells_r11.meas_result_list_eutra_r11_present) {
      j.start_array("measResultListEUTRA-r11");
      for (const auto& e1 : meas_result_neigh_cells_r11.meas_result_list_eutra_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r11.meas_result_list_utra_r11_present) {
      j.start_array("measResultListUTRA-r11");
      for (const auto& e1 : meas_result_neigh_cells_r11.meas_result_list_utra_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r11.meas_result_list_geran_r11_present) {
      j.start_array("measResultListGERAN-r11");
      for (const auto& e1 : meas_result_neigh_cells_r11.meas_result_list_geran_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r11.meas_results_cdma2000_r11_present) {
      j.start_array("measResultsCDMA2000-r11");
      for (const auto& e1 : meas_result_neigh_cells_r11.meas_results_cdma2000_r11) {
        e1.to_json(j);
      }
      j.end_array();
    }
    j.end_obj();
  }
  j.write_int("numberOfPreamblesSent-r11", nof_preambs_sent_r11);
  j.write_bool("contentionDetected-r11", contention_detected_r11);
  j.write_bool("maxTxPowerReached-r11", max_tx_pwr_reached_r11);
  j.write_int("timeSinceFailure-r11", time_since_fail_r11);
  if (meas_result_list_eutra_v1130_present) {
    j.start_array("measResultListEUTRA-v1130");
    for (const auto& e1 : meas_result_list_eutra_v1130) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (ext) {
    if (meas_result_failed_cell_v1250_present) {
      j.write_int("measResultFailedCell-v1250", meas_result_failed_cell_v1250);
    }
    if (failed_cell_rsrq_type_r12.is_present()) {
      j.write_fieldname("failedCellRSRQ-Type-r12");
      failed_cell_rsrq_type_r12->to_json(j);
    }
    if (meas_result_list_eutra_v1250.is_present()) {
      j.start_array("measResultListEUTRA-v1250");
      for (const auto& e1 : *meas_result_list_eutra_v1250) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_failed_cell_v1360_present) {
      j.write_int("measResultFailedCell-v1360", meas_result_failed_cell_v1360);
    }
    if (log_meas_result_list_bt_r15.is_present()) {
      j.start_array("logMeasResultListBT-r15");
      for (const auto& e1 : *log_meas_result_list_bt_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (log_meas_result_list_wlan_r15.is_present()) {
      j.start_array("logMeasResultListWLAN-r15");
      for (const auto& e1 : *log_meas_result_list_wlan_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// DRB-CountInfo ::= SEQUENCE
SRSASN_CODE drb_count_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, drb_id, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, count_ul, (uint64_t)0u, (uint64_t)4294967295u));
  HANDLE_CODE(pack_integer(bref, count_dl, (uint64_t)0u, (uint64_t)4294967295u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE drb_count_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(drb_id, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(count_ul, bref, (uint64_t)0u, (uint64_t)4294967295u));
  HANDLE_CODE(unpack_integer(count_dl, bref, (uint64_t)0u, (uint64_t)4294967295u));

  return SRSASN_SUCCESS;
}
void drb_count_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("drb-Identity", drb_id);
  j.write_int("count-Uplink", count_ul);
  j.write_int("count-Downlink", count_dl);
  j.end_obj();
}

// InDeviceCoexIndication-v1530-IEs ::= SEQUENCE
SRSASN_CODE in_dev_coex_ind_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mrdc_assist_info_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (mrdc_assist_info_r15_present) {
    HANDLE_CODE(mrdc_assist_info_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE in_dev_coex_ind_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mrdc_assist_info_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (mrdc_assist_info_r15_present) {
    HANDLE_CODE(mrdc_assist_info_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void in_dev_coex_ind_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mrdc_assist_info_r15_present) {
    j.write_fieldname("mrdc-AssistanceInfo-r15");
    mrdc_assist_info_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RRCConnectionReconfigurationComplete-v1250-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_complete_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_available_mbsfn_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_complete_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_available_mbsfn_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_complete_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_available_mbsfn_r12_present) {
    j.write_str("logMeasAvailableMBSFN-r12", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReestablishmentComplete-v1130-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_complete_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(conn_est_fail_info_available_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_complete_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(conn_est_fail_info_available_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_complete_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (conn_est_fail_info_available_r11_present) {
    j.write_str("connEstFailInfoAvailable-r11", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionSetupComplete-v1250-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mob_state_r12_present, 1));
  HANDLE_CODE(bref.pack(mob_history_avail_r12_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_mbsfn_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (mob_state_r12_present) {
    HANDLE_CODE(mob_state_r12.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mob_state_r12_present, 1));
  HANDLE_CODE(bref.unpack(mob_history_avail_r12_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_mbsfn_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (mob_state_r12_present) {
    HANDLE_CODE(mob_state_r12.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_complete_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mob_state_r12_present) {
    j.write_str("mobilityState-r12", mob_state_r12.to_string());
  }
  if (mob_history_avail_r12_present) {
    j.write_str("mobilityHistoryAvail-r12", "true");
  }
  if (log_meas_available_mbsfn_r12_present) {
    j.write_str("logMeasAvailableMBSFN-r12", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SL-V2X-CommTxResourceReq-r14 ::= SEQUENCE
SRSASN_CODE sl_v2x_comm_tx_res_req_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(carrier_freq_comm_tx_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_type_tx_sync_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_dest_info_list_r14_present, 1));

  if (carrier_freq_comm_tx_r14_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_comm_tx_r14, (uint8_t)0u, (uint8_t)7u));
  }
  if (v2x_type_tx_sync_r14_present) {
    HANDLE_CODE(v2x_type_tx_sync_r14.pack(bref));
  }
  if (v2x_dest_info_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_dest_info_list_r14, 1, 16));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_comm_tx_res_req_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(carrier_freq_comm_tx_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_type_tx_sync_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_dest_info_list_r14_present, 1));

  if (carrier_freq_comm_tx_r14_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_comm_tx_r14, bref, (uint8_t)0u, (uint8_t)7u));
  }
  if (v2x_type_tx_sync_r14_present) {
    HANDLE_CODE(v2x_type_tx_sync_r14.unpack(bref));
  }
  if (v2x_dest_info_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_dest_info_list_r14, bref, 1, 16));
  }

  return SRSASN_SUCCESS;
}
void sl_v2x_comm_tx_res_req_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (carrier_freq_comm_tx_r14_present) {
    j.write_int("carrierFreqCommTx-r14", carrier_freq_comm_tx_r14);
  }
  if (v2x_type_tx_sync_r14_present) {
    j.write_str("v2x-TypeTxSync-r14", v2x_type_tx_sync_r14.to_string());
  }
  if (v2x_dest_info_list_r14_present) {
    j.start_array("v2x-DestinationInfoList-r14");
    for (const auto& e1 : v2x_dest_info_list_r14) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  j.end_obj();
}

// UEInformationResponse-v1250-IEs ::= SEQUENCE
SRSASN_CODE ue_info_resp_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mob_history_report_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (mob_history_report_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mob_history_report_r12, 1, 16));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_resp_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mob_history_report_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (mob_history_report_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mob_history_report_r12, bref, 1, 16));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_resp_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mob_history_report_r12_present) {
    j.start_array("mobilityHistoryReport-r12");
    for (const auto& e1 : mob_history_report_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();
}

// 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();
}

// IDC-SubframePattern-r11 ::= CHOICE
void idc_sf_pattern_r11_c::destroy_()
{
  switch (type_) {
    case types::sf_pattern_fdd_r11:
      c.destroy<fixed_bitstring<4> >();
      break;
    case types::sf_pattern_tdd_r11:
      c.destroy<sf_pattern_tdd_r11_c_>();
      break;
    default:
      break;
  }
}
void idc_sf_pattern_r11_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sf_pattern_fdd_r11:
      c.init<fixed_bitstring<4> >();
      break;
    case types::sf_pattern_tdd_r11:
      c.init<sf_pattern_tdd_r11_c_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c");
  }
}
idc_sf_pattern_r11_c::idc_sf_pattern_r11_c(const idc_sf_pattern_r11_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf_pattern_fdd_r11:
      c.init(other.c.get<fixed_bitstring<4> >());
      break;
    case types::sf_pattern_tdd_r11:
      c.init(other.c.get<sf_pattern_tdd_r11_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c");
  }
}
idc_sf_pattern_r11_c& idc_sf_pattern_r11_c::operator=(const idc_sf_pattern_r11_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf_pattern_fdd_r11:
      c.set(other.c.get<fixed_bitstring<4> >());
      break;
    case types::sf_pattern_tdd_r11:
      c.set(other.c.get<sf_pattern_tdd_r11_c_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c");
  }

  return *this;
}
void idc_sf_pattern_r11_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf_pattern_fdd_r11:
      j.write_str("subframePatternFDD-r11", c.get<fixed_bitstring<4> >().to_string());
      break;
    case types::sf_pattern_tdd_r11:
      j.write_fieldname("subframePatternTDD-r11");
      c.get<sf_pattern_tdd_r11_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c");
  }
  j.end_obj();
}
SRSASN_CODE idc_sf_pattern_r11_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf_pattern_fdd_r11:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().pack(bref));
      break;
    case types::sf_pattern_tdd_r11:
      HANDLE_CODE(c.get<sf_pattern_tdd_r11_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE idc_sf_pattern_r11_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf_pattern_fdd_r11:
      HANDLE_CODE(c.get<fixed_bitstring<4> >().unpack(bref));
      break;
    case types::sf_pattern_tdd_r11:
      HANDLE_CODE(c.get<sf_pattern_tdd_r11_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_::destroy_()
{
  switch (type_) {
    case types::sf_cfg0_r11:
      c.destroy<fixed_bitstring<70> >();
      break;
    case types::sf_cfg1_minus5_r11:
      c.destroy<fixed_bitstring<10> >();
      break;
    case types::sf_cfg6_r11:
      c.destroy<fixed_bitstring<60> >();
      break;
    default:
      break;
  }
}
void idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::sf_cfg0_r11:
      c.init<fixed_bitstring<70> >();
      break;
    case types::sf_cfg1_minus5_r11:
      c.init<fixed_bitstring<10> >();
      break;
    case types::sf_cfg6_r11:
      c.init<fixed_bitstring<60> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_");
  }
}
idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_::sf_pattern_tdd_r11_c_(
    const idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::sf_cfg0_r11:
      c.init(other.c.get<fixed_bitstring<70> >());
      break;
    case types::sf_cfg1_minus5_r11:
      c.init(other.c.get<fixed_bitstring<10> >());
      break;
    case types::sf_cfg6_r11:
      c.init(other.c.get<fixed_bitstring<60> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_");
  }
}
idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_& idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_::
                                             operator=(const idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::sf_cfg0_r11:
      c.set(other.c.get<fixed_bitstring<70> >());
      break;
    case types::sf_cfg1_minus5_r11:
      c.set(other.c.get<fixed_bitstring<10> >());
      break;
    case types::sf_cfg6_r11:
      c.set(other.c.get<fixed_bitstring<60> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_");
  }

  return *this;
}
void idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sf_cfg0_r11:
      j.write_str("subframeConfig0-r11", c.get<fixed_bitstring<70> >().to_string());
      break;
    case types::sf_cfg1_minus5_r11:
      j.write_str("subframeConfig1-5-r11", c.get<fixed_bitstring<10> >().to_string());
      break;
    case types::sf_cfg6_r11:
      j.write_str("subframeConfig6-r11", c.get<fixed_bitstring<60> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sf_cfg0_r11:
      HANDLE_CODE(c.get<fixed_bitstring<70> >().pack(bref));
      break;
    case types::sf_cfg1_minus5_r11:
      HANDLE_CODE(c.get<fixed_bitstring<10> >().pack(bref));
      break;
    case types::sf_cfg6_r11:
      HANDLE_CODE(c.get<fixed_bitstring<60> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sf_cfg0_r11:
      HANDLE_CODE(c.get<fixed_bitstring<70> >().unpack(bref));
      break;
    case types::sf_cfg1_minus5_r11:
      HANDLE_CODE(c.get<fixed_bitstring<10> >().unpack(bref));
      break;
    case types::sf_cfg6_r11:
      HANDLE_CODE(c.get<fixed_bitstring<60> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "idc_sf_pattern_r11_c::sf_pattern_tdd_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// InDeviceCoexIndication-v1360-IEs ::= SEQUENCE
SRSASN_CODE in_dev_coex_ind_v1360_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(hardware_sharing_problem_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE in_dev_coex_ind_v1360_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(hardware_sharing_problem_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void in_dev_coex_ind_v1360_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (hardware_sharing_problem_r13_present) {
    j.write_str("hardwareSharingProblem-r13", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// LogMeasReport-r10 ::= SEQUENCE
SRSASN_CODE log_meas_report_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(log_meas_available_r10_present, 1));

  HANDLE_CODE(absolute_time_stamp_r10.pack(bref));
  HANDLE_CODE(trace_ref_r10.pack(bref));
  HANDLE_CODE(trace_recording_session_ref_r10.pack(bref));
  HANDLE_CODE(tce_id_r10.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, log_meas_info_list_r10, 1, 520));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= log_meas_available_bt_r15_present;
    group_flags[0] |= log_meas_available_wlan_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(log_meas_available_bt_r15_present, 1));
      HANDLE_CODE(bref.pack(log_meas_available_wlan_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE log_meas_report_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(log_meas_available_r10_present, 1));

  HANDLE_CODE(absolute_time_stamp_r10.unpack(bref));
  HANDLE_CODE(trace_ref_r10.unpack(bref));
  HANDLE_CODE(trace_recording_session_ref_r10.unpack(bref));
  HANDLE_CODE(tce_id_r10.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(log_meas_info_list_r10, bref, 1, 520));

  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(log_meas_available_bt_r15_present, 1));
      HANDLE_CODE(bref.unpack(log_meas_available_wlan_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
void log_meas_report_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("absoluteTimeStamp-r10", absolute_time_stamp_r10.to_string());
  j.write_fieldname("traceReference-r10");
  trace_ref_r10.to_json(j);
  j.write_str("traceRecordingSessionRef-r10", trace_recording_session_ref_r10.to_string());
  j.write_str("tce-Id-r10", tce_id_r10.to_string());
  j.start_array("logMeasInfoList-r10");
  for (const auto& e1 : log_meas_info_list_r10) {
    e1.to_json(j);
  }
  j.end_array();
  if (log_meas_available_r10_present) {
    j.write_str("logMeasAvailable-r10", "true");
  }
  if (ext) {
    if (log_meas_available_bt_r15_present) {
      j.write_str("logMeasAvailableBT-r15", "true");
    }
    if (log_meas_available_wlan_r15_present) {
      j.write_str("logMeasAvailableWLAN-r15", "true");
    }
  }
  j.end_obj();
}

// MBMS-ServiceInfo-r13 ::= SEQUENCE
SRSASN_CODE mbms_service_info_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(tmgi_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_service_info_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(tmgi_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void mbms_service_info_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("tmgi-r13");
  tmgi_r13.to_json(j);
  j.end_obj();
}

// MeasResultCBR-r14 ::= SEQUENCE
SRSASN_CODE meas_result_cbr_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cbr_pscch_r14_present, 1));

  HANDLE_CODE(pack_integer(bref, pool_id_r14, (uint8_t)1u, (uint8_t)72u));
  HANDLE_CODE(pack_integer(bref, cbr_pssch_r14, (uint8_t)0u, (uint8_t)100u));
  if (cbr_pscch_r14_present) {
    HANDLE_CODE(pack_integer(bref, cbr_pscch_r14, (uint8_t)0u, (uint8_t)100u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_cbr_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cbr_pscch_r14_present, 1));

  HANDLE_CODE(unpack_integer(pool_id_r14, bref, (uint8_t)1u, (uint8_t)72u));
  HANDLE_CODE(unpack_integer(cbr_pssch_r14, bref, (uint8_t)0u, (uint8_t)100u));
  if (cbr_pscch_r14_present) {
    HANDLE_CODE(unpack_integer(cbr_pscch_r14, bref, (uint8_t)0u, (uint8_t)100u));
  }

  return SRSASN_SUCCESS;
}
void meas_result_cbr_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("poolIdentity-r14", pool_id_r14);
  j.write_int("cbr-PSSCH-r14", cbr_pssch_r14);
  if (cbr_pscch_r14_present) {
    j.write_int("cbr-PSCCH-r14", cbr_pscch_r14);
  }
  j.end_obj();
}

// MeasResultCSI-RS-r12 ::= SEQUENCE
SRSASN_CODE meas_result_csi_rs_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, meas_csi_rs_id_r12, (uint8_t)1u, (uint8_t)96u));
  HANDLE_CODE(pack_integer(bref, csi_rsrp_result_r12, (uint8_t)0u, (uint8_t)97u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_csi_rs_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(meas_csi_rs_id_r12, bref, (uint8_t)1u, (uint8_t)96u));
  HANDLE_CODE(unpack_integer(csi_rsrp_result_r12, bref, (uint8_t)0u, (uint8_t)97u));

  return SRSASN_SUCCESS;
}
void meas_result_csi_rs_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("measCSI-RS-Id-r12", meas_csi_rs_id_r12);
  j.write_int("csi-RSRP-Result-r12", csi_rsrp_result_r12);
  j.end_obj();
}

// MeasResultCellSFTD-r15 ::= SEQUENCE
SRSASN_CODE meas_result_cell_sftd_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rsrp_result_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, pci_r15, (uint16_t)0u, (uint16_t)1007u));
  HANDLE_CODE(pack_integer(bref, sfn_offset_result_r15, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(pack_integer(bref, frame_boundary_offset_result_r15, (int16_t)-30720, (int16_t)30719));
  if (rsrp_result_r15_present) {
    HANDLE_CODE(pack_integer(bref, rsrp_result_r15, (uint8_t)0u, (uint8_t)127u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_cell_sftd_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rsrp_result_r15_present, 1));

  HANDLE_CODE(unpack_integer(pci_r15, bref, (uint16_t)0u, (uint16_t)1007u));
  HANDLE_CODE(unpack_integer(sfn_offset_result_r15, bref, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(unpack_integer(frame_boundary_offset_result_r15, bref, (int16_t)-30720, (int16_t)30719));
  if (rsrp_result_r15_present) {
    HANDLE_CODE(unpack_integer(rsrp_result_r15, bref, (uint8_t)0u, (uint8_t)127u));
  }

  return SRSASN_SUCCESS;
}
void meas_result_cell_sftd_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r15", pci_r15);
  j.write_int("sfn-OffsetResult-r15", sfn_offset_result_r15);
  j.write_int("frameBoundaryOffsetResult-r15", frame_boundary_offset_result_r15);
  if (rsrp_result_r15_present) {
    j.write_int("rsrpResult-r15", rsrp_result_r15);
  }
  j.end_obj();
}

// MeasResultFreqFailNR-r15 ::= SEQUENCE
SRSASN_CODE meas_result_freq_fail_nr_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_cell_list_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)3279165u));
  if (meas_result_cell_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_cell_list_r15, 1, 8));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_freq_fail_nr_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_cell_list_r15_present, 1));

  HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)3279165u));
  if (meas_result_cell_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_cell_list_r15, bref, 1, 8));
  }

  return SRSASN_SUCCESS;
}
void meas_result_freq_fail_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r15", carrier_freq_r15);
  if (meas_result_cell_list_r15_present) {
    j.start_array("measResultCellList-r15");
    for (const auto& e1 : meas_result_cell_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// MeasResultServFreq-r10 ::= SEQUENCE
SRSASN_CODE meas_result_serv_freq_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_scell_r10_present, 1));
  HANDLE_CODE(bref.pack(meas_result_best_neigh_cell_r10_present, 1));

  HANDLE_CODE(pack_integer(bref, serv_freq_id_r10, (uint8_t)0u, (uint8_t)7u));
  if (meas_result_scell_r10_present) {
    HANDLE_CODE(pack_integer(bref, meas_result_scell_r10.rsrp_result_scell_r10, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(pack_integer(bref, meas_result_scell_r10.rsrq_result_scell_r10, (uint8_t)0u, (uint8_t)34u));
  }
  if (meas_result_best_neigh_cell_r10_present) {
    HANDLE_CODE(pack_integer(bref, meas_result_best_neigh_cell_r10.pci_r10, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(pack_integer(bref, meas_result_best_neigh_cell_r10.rsrp_result_ncell_r10, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(pack_integer(bref, meas_result_best_neigh_cell_r10.rsrq_result_ncell_r10, (uint8_t)0u, (uint8_t)34u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= meas_result_scell_v1250_present;
    group_flags[0] |= meas_result_best_neigh_cell_v1250_present;
    group_flags[1] |= meas_result_scell_v1310.is_present();
    group_flags[1] |= meas_result_best_neigh_cell_v1310.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_scell_v1250_present, 1));
      HANDLE_CODE(bref.pack(meas_result_best_neigh_cell_v1250_present, 1));
      if (meas_result_scell_v1250_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_scell_v1250, (int8_t)-30, (int8_t)46));
      }
      if (meas_result_best_neigh_cell_v1250_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_best_neigh_cell_v1250, (int8_t)-30, (int8_t)46));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_scell_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_best_neigh_cell_v1310.is_present(), 1));
      if (meas_result_scell_v1310.is_present()) {
        HANDLE_CODE(pack_integer(bref, meas_result_scell_v1310->rs_sinr_result_r13, (uint8_t)0u, (uint8_t)127u));
      }
      if (meas_result_best_neigh_cell_v1310.is_present()) {
        HANDLE_CODE(
            pack_integer(bref, meas_result_best_neigh_cell_v1310->rs_sinr_result_r13, (uint8_t)0u, (uint8_t)127u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_serv_freq_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_scell_r10_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_best_neigh_cell_r10_present, 1));

  HANDLE_CODE(unpack_integer(serv_freq_id_r10, bref, (uint8_t)0u, (uint8_t)7u));
  if (meas_result_scell_r10_present) {
    HANDLE_CODE(unpack_integer(meas_result_scell_r10.rsrp_result_scell_r10, bref, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(unpack_integer(meas_result_scell_r10.rsrq_result_scell_r10, bref, (uint8_t)0u, (uint8_t)34u));
  }
  if (meas_result_best_neigh_cell_r10_present) {
    HANDLE_CODE(unpack_integer(meas_result_best_neigh_cell_r10.pci_r10, bref, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(unpack_integer(meas_result_best_neigh_cell_r10.rsrp_result_ncell_r10, bref, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(unpack_integer(meas_result_best_neigh_cell_r10.rsrq_result_ncell_r10, bref, (uint8_t)0u, (uint8_t)34u));
  }

  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(meas_result_scell_v1250_present, 1));
      HANDLE_CODE(bref.unpack(meas_result_best_neigh_cell_v1250_present, 1));
      if (meas_result_scell_v1250_present) {
        HANDLE_CODE(unpack_integer(meas_result_scell_v1250, bref, (int8_t)-30, (int8_t)46));
      }
      if (meas_result_best_neigh_cell_v1250_present) {
        HANDLE_CODE(unpack_integer(meas_result_best_neigh_cell_v1250, bref, (int8_t)-30, (int8_t)46));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_result_scell_v1310_present;
      HANDLE_CODE(bref.unpack(meas_result_scell_v1310_present, 1));
      meas_result_scell_v1310.set_present(meas_result_scell_v1310_present);
      bool meas_result_best_neigh_cell_v1310_present;
      HANDLE_CODE(bref.unpack(meas_result_best_neigh_cell_v1310_present, 1));
      meas_result_best_neigh_cell_v1310.set_present(meas_result_best_neigh_cell_v1310_present);
      if (meas_result_scell_v1310.is_present()) {
        HANDLE_CODE(unpack_integer(meas_result_scell_v1310->rs_sinr_result_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
      if (meas_result_best_neigh_cell_v1310.is_present()) {
        HANDLE_CODE(
            unpack_integer(meas_result_best_neigh_cell_v1310->rs_sinr_result_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_result_serv_freq_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("servFreqId-r10", serv_freq_id_r10);
  if (meas_result_scell_r10_present) {
    j.write_fieldname("measResultSCell-r10");
    j.start_obj();
    j.write_int("rsrpResultSCell-r10", meas_result_scell_r10.rsrp_result_scell_r10);
    j.write_int("rsrqResultSCell-r10", meas_result_scell_r10.rsrq_result_scell_r10);
    j.end_obj();
  }
  if (meas_result_best_neigh_cell_r10_present) {
    j.write_fieldname("measResultBestNeighCell-r10");
    j.start_obj();
    j.write_int("physCellId-r10", meas_result_best_neigh_cell_r10.pci_r10);
    j.write_int("rsrpResultNCell-r10", meas_result_best_neigh_cell_r10.rsrp_result_ncell_r10);
    j.write_int("rsrqResultNCell-r10", meas_result_best_neigh_cell_r10.rsrq_result_ncell_r10);
    j.end_obj();
  }
  if (ext) {
    if (meas_result_scell_v1250_present) {
      j.write_int("measResultSCell-v1250", meas_result_scell_v1250);
    }
    if (meas_result_best_neigh_cell_v1250_present) {
      j.write_int("measResultBestNeighCell-v1250", meas_result_best_neigh_cell_v1250);
    }
    if (meas_result_scell_v1310.is_present()) {
      j.write_fieldname("measResultSCell-v1310");
      j.start_obj();
      j.write_int("rs-sinr-Result-r13", meas_result_scell_v1310->rs_sinr_result_r13);
      j.end_obj();
    }
    if (meas_result_best_neigh_cell_v1310.is_present()) {
      j.write_fieldname("measResultBestNeighCell-v1310");
      j.start_obj();
      j.write_int("rs-sinr-Result-r13", meas_result_best_neigh_cell_v1310->rs_sinr_result_r13);
      j.end_obj();
    }
  }
  j.end_obj();
}

// MeasResultServFreq-r13 ::= SEQUENCE
SRSASN_CODE meas_result_serv_freq_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_scell_r13_present, 1));
  HANDLE_CODE(bref.pack(meas_result_best_neigh_cell_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, serv_freq_id_r13, (uint8_t)0u, (uint8_t)31u));
  if (meas_result_scell_r13_present) {
    HANDLE_CODE(bref.pack(meas_result_scell_r13.rs_sinr_result_r13_present, 1));
    HANDLE_CODE(pack_integer(bref, meas_result_scell_r13.rsrp_result_scell_r13, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(pack_integer(bref, meas_result_scell_r13.rsrq_result_scell_r13, (int8_t)-30, (int8_t)46));
    if (meas_result_scell_r13.rs_sinr_result_r13_present) {
      HANDLE_CODE(pack_integer(bref, meas_result_scell_r13.rs_sinr_result_r13, (uint8_t)0u, (uint8_t)127u));
    }
  }
  if (meas_result_best_neigh_cell_r13_present) {
    HANDLE_CODE(bref.pack(meas_result_best_neigh_cell_r13.rs_sinr_result_r13_present, 1));
    HANDLE_CODE(pack_integer(bref, meas_result_best_neigh_cell_r13.pci_r13, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(pack_integer(bref, meas_result_best_neigh_cell_r13.rsrp_result_ncell_r13, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(pack_integer(bref, meas_result_best_neigh_cell_r13.rsrq_result_ncell_r13, (int8_t)-30, (int8_t)46));
    if (meas_result_best_neigh_cell_r13.rs_sinr_result_r13_present) {
      HANDLE_CODE(pack_integer(bref, meas_result_best_neigh_cell_r13.rs_sinr_result_r13, (uint8_t)0u, (uint8_t)127u));
    }
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= meas_result_best_neigh_cell_v1360.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_best_neigh_cell_v1360.is_present(), 1));
      if (meas_result_best_neigh_cell_v1360.is_present()) {
        HANDLE_CODE(
            pack_integer(bref, meas_result_best_neigh_cell_v1360->rsrp_result_ncell_v1360, (int8_t)-17, (int8_t)-1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_serv_freq_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_scell_r13_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_best_neigh_cell_r13_present, 1));

  HANDLE_CODE(unpack_integer(serv_freq_id_r13, bref, (uint8_t)0u, (uint8_t)31u));
  if (meas_result_scell_r13_present) {
    HANDLE_CODE(bref.unpack(meas_result_scell_r13.rs_sinr_result_r13_present, 1));
    HANDLE_CODE(unpack_integer(meas_result_scell_r13.rsrp_result_scell_r13, bref, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(unpack_integer(meas_result_scell_r13.rsrq_result_scell_r13, bref, (int8_t)-30, (int8_t)46));
    if (meas_result_scell_r13.rs_sinr_result_r13_present) {
      HANDLE_CODE(unpack_integer(meas_result_scell_r13.rs_sinr_result_r13, bref, (uint8_t)0u, (uint8_t)127u));
    }
  }
  if (meas_result_best_neigh_cell_r13_present) {
    HANDLE_CODE(bref.unpack(meas_result_best_neigh_cell_r13.rs_sinr_result_r13_present, 1));
    HANDLE_CODE(unpack_integer(meas_result_best_neigh_cell_r13.pci_r13, bref, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(unpack_integer(meas_result_best_neigh_cell_r13.rsrp_result_ncell_r13, bref, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(unpack_integer(meas_result_best_neigh_cell_r13.rsrq_result_ncell_r13, bref, (int8_t)-30, (int8_t)46));
    if (meas_result_best_neigh_cell_r13.rs_sinr_result_r13_present) {
      HANDLE_CODE(unpack_integer(meas_result_best_neigh_cell_r13.rs_sinr_result_r13, bref, (uint8_t)0u, (uint8_t)127u));
    }
  }

  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 meas_result_best_neigh_cell_v1360_present;
      HANDLE_CODE(bref.unpack(meas_result_best_neigh_cell_v1360_present, 1));
      meas_result_best_neigh_cell_v1360.set_present(meas_result_best_neigh_cell_v1360_present);
      if (meas_result_best_neigh_cell_v1360.is_present()) {
        HANDLE_CODE(
            unpack_integer(meas_result_best_neigh_cell_v1360->rsrp_result_ncell_v1360, bref, (int8_t)-17, (int8_t)-1));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_result_serv_freq_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("servFreqId-r13", serv_freq_id_r13);
  if (meas_result_scell_r13_present) {
    j.write_fieldname("measResultSCell-r13");
    j.start_obj();
    j.write_int("rsrpResultSCell-r13", meas_result_scell_r13.rsrp_result_scell_r13);
    j.write_int("rsrqResultSCell-r13", meas_result_scell_r13.rsrq_result_scell_r13);
    if (meas_result_scell_r13.rs_sinr_result_r13_present) {
      j.write_int("rs-sinr-Result-r13", meas_result_scell_r13.rs_sinr_result_r13);
    }
    j.end_obj();
  }
  if (meas_result_best_neigh_cell_r13_present) {
    j.write_fieldname("measResultBestNeighCell-r13");
    j.start_obj();
    j.write_int("physCellId-r13", meas_result_best_neigh_cell_r13.pci_r13);
    j.write_int("rsrpResultNCell-r13", meas_result_best_neigh_cell_r13.rsrp_result_ncell_r13);
    j.write_int("rsrqResultNCell-r13", meas_result_best_neigh_cell_r13.rsrq_result_ncell_r13);
    if (meas_result_best_neigh_cell_r13.rs_sinr_result_r13_present) {
      j.write_int("rs-sinr-Result-r13", meas_result_best_neigh_cell_r13.rs_sinr_result_r13);
    }
    j.end_obj();
  }
  if (ext) {
    if (meas_result_best_neigh_cell_v1360.is_present()) {
      j.write_fieldname("measResultBestNeighCell-v1360");
      j.start_obj();
      j.write_int("rsrpResultNCell-v1360", meas_result_best_neigh_cell_v1360->rsrp_result_ncell_v1360);
      j.end_obj();
    }
  }
  j.end_obj();
}

// MeasResultServFreqNR-r15 ::= SEQUENCE
SRSASN_CODE meas_result_serv_freq_nr_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_scell_r15_present, 1));
  HANDLE_CODE(bref.pack(meas_result_best_neigh_cell_r15_present, 1));

  HANDLE_CODE(pack_integer(bref, carrier_freq_r15, (uint32_t)0u, (uint32_t)3279165u));
  if (meas_result_scell_r15_present) {
    HANDLE_CODE(meas_result_scell_r15.pack(bref));
  }
  if (meas_result_best_neigh_cell_r15_present) {
    HANDLE_CODE(meas_result_best_neigh_cell_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_serv_freq_nr_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_scell_r15_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_best_neigh_cell_r15_present, 1));

  HANDLE_CODE(unpack_integer(carrier_freq_r15, bref, (uint32_t)0u, (uint32_t)3279165u));
  if (meas_result_scell_r15_present) {
    HANDLE_CODE(meas_result_scell_r15.unpack(bref));
  }
  if (meas_result_best_neigh_cell_r15_present) {
    HANDLE_CODE(meas_result_best_neigh_cell_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_result_serv_freq_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r15", carrier_freq_r15);
  if (meas_result_scell_r15_present) {
    j.write_fieldname("measResultSCell-r15");
    meas_result_scell_r15.to_json(j);
  }
  if (meas_result_best_neigh_cell_r15_present) {
    j.write_fieldname("measResultBestNeighCell-r15");
    meas_result_best_neigh_cell_r15.to_json(j);
  }
  j.end_obj();
}

// MeasResultWLAN-r13 ::= SEQUENCE
SRSASN_CODE meas_result_wlan_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(carrier_info_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(band_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(available_admission_capacity_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(backhaul_dl_bw_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(backhaul_ul_bw_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(ch_utilization_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(station_count_wlan_r13_present, 1));
  HANDLE_CODE(bref.pack(connected_wlan_r13_present, 1));

  HANDLE_CODE(wlan_ids_r13.pack(bref));
  if (carrier_info_wlan_r13_present) {
    HANDLE_CODE(carrier_info_wlan_r13.pack(bref));
  }
  if (band_wlan_r13_present) {
    HANDLE_CODE(band_wlan_r13.pack(bref));
  }
  HANDLE_CODE(pack_integer(bref, rssi_wlan_r13, (uint8_t)0u, (uint8_t)141u));
  if (available_admission_capacity_wlan_r13_present) {
    HANDLE_CODE(pack_integer(bref, available_admission_capacity_wlan_r13, (uint16_t)0u, (uint16_t)31250u));
  }
  if (backhaul_dl_bw_wlan_r13_present) {
    HANDLE_CODE(backhaul_dl_bw_wlan_r13.pack(bref));
  }
  if (backhaul_ul_bw_wlan_r13_present) {
    HANDLE_CODE(backhaul_ul_bw_wlan_r13.pack(bref));
  }
  if (ch_utilization_wlan_r13_present) {
    HANDLE_CODE(pack_integer(bref, ch_utilization_wlan_r13, (uint16_t)0u, (uint16_t)255u));
  }
  if (station_count_wlan_r13_present) {
    HANDLE_CODE(pack_integer(bref, station_count_wlan_r13, (uint32_t)0u, (uint32_t)65535u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_wlan_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(carrier_info_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(band_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(available_admission_capacity_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(backhaul_dl_bw_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(backhaul_ul_bw_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(ch_utilization_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(station_count_wlan_r13_present, 1));
  HANDLE_CODE(bref.unpack(connected_wlan_r13_present, 1));

  HANDLE_CODE(wlan_ids_r13.unpack(bref));
  if (carrier_info_wlan_r13_present) {
    HANDLE_CODE(carrier_info_wlan_r13.unpack(bref));
  }
  if (band_wlan_r13_present) {
    HANDLE_CODE(band_wlan_r13.unpack(bref));
  }
  HANDLE_CODE(unpack_integer(rssi_wlan_r13, bref, (uint8_t)0u, (uint8_t)141u));
  if (available_admission_capacity_wlan_r13_present) {
    HANDLE_CODE(unpack_integer(available_admission_capacity_wlan_r13, bref, (uint16_t)0u, (uint16_t)31250u));
  }
  if (backhaul_dl_bw_wlan_r13_present) {
    HANDLE_CODE(backhaul_dl_bw_wlan_r13.unpack(bref));
  }
  if (backhaul_ul_bw_wlan_r13_present) {
    HANDLE_CODE(backhaul_ul_bw_wlan_r13.unpack(bref));
  }
  if (ch_utilization_wlan_r13_present) {
    HANDLE_CODE(unpack_integer(ch_utilization_wlan_r13, bref, (uint16_t)0u, (uint16_t)255u));
  }
  if (station_count_wlan_r13_present) {
    HANDLE_CODE(unpack_integer(station_count_wlan_r13, bref, (uint32_t)0u, (uint32_t)65535u));
  }

  return SRSASN_SUCCESS;
}
void meas_result_wlan_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("wlan-Identifiers-r13");
  wlan_ids_r13.to_json(j);
  if (carrier_info_wlan_r13_present) {
    j.write_fieldname("carrierInfoWLAN-r13");
    carrier_info_wlan_r13.to_json(j);
  }
  if (band_wlan_r13_present) {
    j.write_str("bandWLAN-r13", band_wlan_r13.to_string());
  }
  j.write_int("rssiWLAN-r13", rssi_wlan_r13);
  if (available_admission_capacity_wlan_r13_present) {
    j.write_int("availableAdmissionCapacityWLAN-r13", available_admission_capacity_wlan_r13);
  }
  if (backhaul_dl_bw_wlan_r13_present) {
    j.write_str("backhaulDL-BandwidthWLAN-r13", backhaul_dl_bw_wlan_r13.to_string());
  }
  if (backhaul_ul_bw_wlan_r13_present) {
    j.write_str("backhaulUL-BandwidthWLAN-r13", backhaul_ul_bw_wlan_r13.to_string());
  }
  if (ch_utilization_wlan_r13_present) {
    j.write_int("channelUtilizationWLAN-r13", ch_utilization_wlan_r13);
  }
  if (station_count_wlan_r13_present) {
    j.write_int("stationCountWLAN-r13", station_count_wlan_r13);
  }
  if (connected_wlan_r13_present) {
    j.write_str("connectedWLAN-r13", "true");
  }
  j.end_obj();
}

// OverheatingAssistance-r14 ::= SEQUENCE
SRSASN_CODE overheat_assist_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(reduced_ue_category_present, 1));
  HANDLE_CODE(bref.pack(reduced_max_ccs_present, 1));

  if (reduced_ue_category_present) {
    HANDLE_CODE(pack_integer(bref, reduced_ue_category.reduced_ue_category_dl, (uint8_t)0u, (uint8_t)19u));
    HANDLE_CODE(pack_integer(bref, reduced_ue_category.reduced_ue_category_ul, (uint8_t)0u, (uint8_t)21u));
  }
  if (reduced_max_ccs_present) {
    HANDLE_CODE(pack_integer(bref, reduced_max_ccs.reduced_ccs_dl, (uint8_t)0u, (uint8_t)31u));
    HANDLE_CODE(pack_integer(bref, reduced_max_ccs.reduced_ccs_ul, (uint8_t)0u, (uint8_t)31u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE overheat_assist_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(reduced_ue_category_present, 1));
  HANDLE_CODE(bref.unpack(reduced_max_ccs_present, 1));

  if (reduced_ue_category_present) {
    HANDLE_CODE(unpack_integer(reduced_ue_category.reduced_ue_category_dl, bref, (uint8_t)0u, (uint8_t)19u));
    HANDLE_CODE(unpack_integer(reduced_ue_category.reduced_ue_category_ul, bref, (uint8_t)0u, (uint8_t)21u));
  }
  if (reduced_max_ccs_present) {
    HANDLE_CODE(unpack_integer(reduced_max_ccs.reduced_ccs_dl, bref, (uint8_t)0u, (uint8_t)31u));
    HANDLE_CODE(unpack_integer(reduced_max_ccs.reduced_ccs_ul, bref, (uint8_t)0u, (uint8_t)31u));
  }

  return SRSASN_SUCCESS;
}
void overheat_assist_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (reduced_ue_category_present) {
    j.write_fieldname("reducedUE-Category");
    j.start_obj();
    j.write_int("reducedUE-CategoryDL", reduced_ue_category.reduced_ue_category_dl);
    j.write_int("reducedUE-CategoryUL", reduced_ue_category.reduced_ue_category_ul);
    j.end_obj();
  }
  if (reduced_max_ccs_present) {
    j.write_fieldname("reducedMaxCCs");
    j.start_obj();
    j.write_int("reducedCCsDL", reduced_max_ccs.reduced_ccs_dl);
    j.write_int("reducedCCsUL", reduced_max_ccs.reduced_ccs_ul);
    j.end_obj();
  }
  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
{
  HANDLE_CODE(bref.pack(conn_est_fail_info_available_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_complete_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(conn_est_fail_info_available_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_complete_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (conn_est_fail_info_available_r11_present) {
    j.write_str("connEstFailInfoAvailable-r11", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReestablishmentComplete-v1020-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_complete_v1020_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_available_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_complete_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_available_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_complete_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_available_r10_present) {
    j.write_str("logMeasAvailable-r10", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionSetupComplete-v1130-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(conn_est_fail_info_available_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(conn_est_fail_info_available_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_complete_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (conn_est_fail_info_available_r11_present) {
    j.write_str("connEstFailInfoAvailable-r11", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SL-DiscSysInfoReport-r13 ::= SEQUENCE
SRSASN_CODE sl_disc_sys_info_report_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(plmn_id_list_r13_present, 1));
  HANDLE_CODE(bref.pack(cell_id_minus13_present, 1));
  HANDLE_CODE(bref.pack(carrier_freq_info_minus13_present, 1));
  HANDLE_CODE(bref.pack(disc_rx_res_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_pool_common_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_pwr_info_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_sync_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_cell_sel_info_r13_present, 1));
  HANDLE_CODE(bref.pack(cell_resel_info_r13_present, 1));
  HANDLE_CODE(bref.pack(tdd_cfg_r13_present, 1));
  HANDLE_CODE(bref.pack(freq_info_r13_present, 1));
  HANDLE_CODE(bref.pack(p_max_r13_present, 1));
  HANDLE_CODE(bref.pack(ref_sig_pwr_r13_present, 1));

  if (plmn_id_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r13, 1, 6));
  }
  if (cell_id_minus13_present) {
    HANDLE_CODE(cell_id_minus13.pack(bref));
  }
  if (carrier_freq_info_minus13_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_info_minus13, (uint32_t)0u, (uint32_t)262143u));
  }
  if (disc_rx_res_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_rx_res_r13, 1, 16));
  }
  if (disc_tx_pool_common_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_tx_pool_common_r13, 1, 4));
  }
  if (disc_tx_pwr_info_r13_present) {
    HANDLE_CODE(pack_fixed_seq_of(bref, &(disc_tx_pwr_info_r13)[0], disc_tx_pwr_info_r13.size()));
  }
  if (disc_sync_cfg_r13_present) {
    HANDLE_CODE(disc_sync_cfg_r13.pack(bref));
  }
  if (disc_cell_sel_info_r13_present) {
    HANDLE_CODE(bref.pack(disc_cell_sel_info_r13.q_rx_lev_min_offset_r13_present, 1));
    HANDLE_CODE(pack_integer(bref, disc_cell_sel_info_r13.q_rx_lev_min_r13, (int8_t)-70, (int8_t)-22));
    if (disc_cell_sel_info_r13.q_rx_lev_min_offset_r13_present) {
      HANDLE_CODE(pack_integer(bref, disc_cell_sel_info_r13.q_rx_lev_min_offset_r13, (uint8_t)1u, (uint8_t)8u));
    }
  }
  if (cell_resel_info_r13_present) {
    HANDLE_CODE(cell_resel_info_r13.q_hyst_r13.pack(bref));
    HANDLE_CODE(pack_integer(bref, cell_resel_info_r13.q_rx_lev_min_r13, (int8_t)-70, (int8_t)-22));
    HANDLE_CODE(pack_integer(bref, cell_resel_info_r13.t_resel_eutra_r13, (uint8_t)0u, (uint8_t)7u));
  }
  if (tdd_cfg_r13_present) {
    HANDLE_CODE(tdd_cfg_r13.pack(bref));
  }
  if (freq_info_r13_present) {
    HANDLE_CODE(bref.pack(freq_info_r13.ul_carrier_freq_r13_present, 1));
    HANDLE_CODE(bref.pack(freq_info_r13.ul_bw_r13_present, 1));
    HANDLE_CODE(bref.pack(freq_info_r13.add_spec_emission_r13_present, 1));
    if (freq_info_r13.ul_carrier_freq_r13_present) {
      HANDLE_CODE(pack_integer(bref, freq_info_r13.ul_carrier_freq_r13, (uint32_t)0u, (uint32_t)65535u));
    }
    if (freq_info_r13.ul_bw_r13_present) {
      HANDLE_CODE(freq_info_r13.ul_bw_r13.pack(bref));
    }
    if (freq_info_r13.add_spec_emission_r13_present) {
      HANDLE_CODE(pack_integer(bref, freq_info_r13.add_spec_emission_r13, (uint8_t)1u, (uint8_t)32u));
    }
  }
  if (p_max_r13_present) {
    HANDLE_CODE(pack_integer(bref, p_max_r13, (int8_t)-30, (int8_t)33));
  }
  if (ref_sig_pwr_r13_present) {
    HANDLE_CODE(pack_integer(bref, ref_sig_pwr_r13, (int8_t)-60, (int8_t)50));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= freq_info_v1370.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(freq_info_v1370.is_present(), 1));
      if (freq_info_v1370.is_present()) {
        HANDLE_CODE(pack_integer(bref, freq_info_v1370->add_spec_emission_v1370, (uint16_t)33u, (uint16_t)288u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_sys_info_report_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(plmn_id_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(cell_id_minus13_present, 1));
  HANDLE_CODE(bref.unpack(carrier_freq_info_minus13_present, 1));
  HANDLE_CODE(bref.unpack(disc_rx_res_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_pool_common_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_pwr_info_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_sync_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_cell_sel_info_r13_present, 1));
  HANDLE_CODE(bref.unpack(cell_resel_info_r13_present, 1));
  HANDLE_CODE(bref.unpack(tdd_cfg_r13_present, 1));
  HANDLE_CODE(bref.unpack(freq_info_r13_present, 1));
  HANDLE_CODE(bref.unpack(p_max_r13_present, 1));
  HANDLE_CODE(bref.unpack(ref_sig_pwr_r13_present, 1));

  if (plmn_id_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r13, bref, 1, 6));
  }
  if (cell_id_minus13_present) {
    HANDLE_CODE(cell_id_minus13.unpack(bref));
  }
  if (carrier_freq_info_minus13_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_info_minus13, bref, (uint32_t)0u, (uint32_t)262143u));
  }
  if (disc_rx_res_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_rx_res_r13, bref, 1, 16));
  }
  if (disc_tx_pool_common_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_tx_pool_common_r13, bref, 1, 4));
  }
  if (disc_tx_pwr_info_r13_present) {
    HANDLE_CODE(unpack_fixed_seq_of(&(disc_tx_pwr_info_r13)[0], bref, disc_tx_pwr_info_r13.size()));
  }
  if (disc_sync_cfg_r13_present) {
    HANDLE_CODE(disc_sync_cfg_r13.unpack(bref));
  }
  if (disc_cell_sel_info_r13_present) {
    HANDLE_CODE(bref.unpack(disc_cell_sel_info_r13.q_rx_lev_min_offset_r13_present, 1));
    HANDLE_CODE(unpack_integer(disc_cell_sel_info_r13.q_rx_lev_min_r13, bref, (int8_t)-70, (int8_t)-22));
    if (disc_cell_sel_info_r13.q_rx_lev_min_offset_r13_present) {
      HANDLE_CODE(unpack_integer(disc_cell_sel_info_r13.q_rx_lev_min_offset_r13, bref, (uint8_t)1u, (uint8_t)8u));
    }
  }
  if (cell_resel_info_r13_present) {
    HANDLE_CODE(cell_resel_info_r13.q_hyst_r13.unpack(bref));
    HANDLE_CODE(unpack_integer(cell_resel_info_r13.q_rx_lev_min_r13, bref, (int8_t)-70, (int8_t)-22));
    HANDLE_CODE(unpack_integer(cell_resel_info_r13.t_resel_eutra_r13, bref, (uint8_t)0u, (uint8_t)7u));
  }
  if (tdd_cfg_r13_present) {
    HANDLE_CODE(tdd_cfg_r13.unpack(bref));
  }
  if (freq_info_r13_present) {
    HANDLE_CODE(bref.unpack(freq_info_r13.ul_carrier_freq_r13_present, 1));
    HANDLE_CODE(bref.unpack(freq_info_r13.ul_bw_r13_present, 1));
    HANDLE_CODE(bref.unpack(freq_info_r13.add_spec_emission_r13_present, 1));
    if (freq_info_r13.ul_carrier_freq_r13_present) {
      HANDLE_CODE(unpack_integer(freq_info_r13.ul_carrier_freq_r13, bref, (uint32_t)0u, (uint32_t)65535u));
    }
    if (freq_info_r13.ul_bw_r13_present) {
      HANDLE_CODE(freq_info_r13.ul_bw_r13.unpack(bref));
    }
    if (freq_info_r13.add_spec_emission_r13_present) {
      HANDLE_CODE(unpack_integer(freq_info_r13.add_spec_emission_r13, bref, (uint8_t)1u, (uint8_t)32u));
    }
  }
  if (p_max_r13_present) {
    HANDLE_CODE(unpack_integer(p_max_r13, bref, (int8_t)-30, (int8_t)33));
  }
  if (ref_sig_pwr_r13_present) {
    HANDLE_CODE(unpack_integer(ref_sig_pwr_r13, bref, (int8_t)-60, (int8_t)50));
  }

  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 freq_info_v1370_present;
      HANDLE_CODE(bref.unpack(freq_info_v1370_present, 1));
      freq_info_v1370.set_present(freq_info_v1370_present);
      if (freq_info_v1370.is_present()) {
        HANDLE_CODE(unpack_integer(freq_info_v1370->add_spec_emission_v1370, bref, (uint16_t)33u, (uint16_t)288u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_disc_sys_info_report_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (plmn_id_list_r13_present) {
    j.start_array("plmn-IdentityList-r13");
    for (const auto& e1 : plmn_id_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (cell_id_minus13_present) {
    j.write_str("cellIdentity-13", cell_id_minus13.to_string());
  }
  if (carrier_freq_info_minus13_present) {
    j.write_int("carrierFreqInfo-13", carrier_freq_info_minus13);
  }
  if (disc_rx_res_r13_present) {
    j.start_array("discRxResources-r13");
    for (const auto& e1 : disc_rx_res_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_tx_pool_common_r13_present) {
    j.start_array("discTxPoolCommon-r13");
    for (const auto& e1 : disc_tx_pool_common_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_tx_pwr_info_r13_present) {
    j.start_array("discTxPowerInfo-r13");
    for (const auto& e1 : disc_tx_pwr_info_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_sync_cfg_r13_present) {
    j.write_fieldname("discSyncConfig-r13");
    disc_sync_cfg_r13.to_json(j);
  }
  if (disc_cell_sel_info_r13_present) {
    j.write_fieldname("discCellSelectionInfo-r13");
    j.start_obj();
    j.write_int("q-RxLevMin-r13", disc_cell_sel_info_r13.q_rx_lev_min_r13);
    if (disc_cell_sel_info_r13.q_rx_lev_min_offset_r13_present) {
      j.write_int("q-RxLevMinOffset-r13", disc_cell_sel_info_r13.q_rx_lev_min_offset_r13);
    }
    j.end_obj();
  }
  if (cell_resel_info_r13_present) {
    j.write_fieldname("cellReselectionInfo-r13");
    j.start_obj();
    j.write_str("q-Hyst-r13", cell_resel_info_r13.q_hyst_r13.to_string());
    j.write_int("q-RxLevMin-r13", cell_resel_info_r13.q_rx_lev_min_r13);
    j.write_int("t-ReselectionEUTRA-r13", cell_resel_info_r13.t_resel_eutra_r13);
    j.end_obj();
  }
  if (tdd_cfg_r13_present) {
    j.write_fieldname("tdd-Config-r13");
    tdd_cfg_r13.to_json(j);
  }
  if (freq_info_r13_present) {
    j.write_fieldname("freqInfo-r13");
    j.start_obj();
    if (freq_info_r13.ul_carrier_freq_r13_present) {
      j.write_int("ul-CarrierFreq-r13", freq_info_r13.ul_carrier_freq_r13);
    }
    if (freq_info_r13.ul_bw_r13_present) {
      j.write_str("ul-Bandwidth-r13", freq_info_r13.ul_bw_r13.to_string());
    }
    if (freq_info_r13.add_spec_emission_r13_present) {
      j.write_int("additionalSpectrumEmission-r13", freq_info_r13.add_spec_emission_r13);
    }
    j.end_obj();
  }
  if (p_max_r13_present) {
    j.write_int("p-Max-r13", p_max_r13);
  }
  if (ref_sig_pwr_r13_present) {
    j.write_int("referenceSignalPower-r13", ref_sig_pwr_r13);
  }
  if (ext) {
    if (freq_info_v1370.is_present()) {
      j.write_fieldname("freqInfo-v1370");
      j.start_obj();
      j.write_int("additionalSpectrumEmission-v1370", freq_info_v1370->add_spec_emission_v1370);
      j.end_obj();
    }
  }
  j.end_obj();
}

// SL-DiscTxResourceReq-r13 ::= SEQUENCE
SRSASN_CODE sl_disc_tx_res_req_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(carrier_freq_disc_tx_r13_present, 1));

  if (carrier_freq_disc_tx_r13_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_disc_tx_r13, (uint8_t)1u, (uint8_t)8u));
  }
  HANDLE_CODE(pack_integer(bref, disc_tx_res_req_r13, (uint8_t)1u, (uint8_t)63u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_disc_tx_res_req_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(carrier_freq_disc_tx_r13_present, 1));

  if (carrier_freq_disc_tx_r13_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_disc_tx_r13, bref, (uint8_t)1u, (uint8_t)8u));
  }
  HANDLE_CODE(unpack_integer(disc_tx_res_req_r13, bref, (uint8_t)1u, (uint8_t)63u));

  return SRSASN_SUCCESS;
}
void sl_disc_tx_res_req_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (carrier_freq_disc_tx_r13_present) {
    j.write_int("carrierFreqDiscTx-r13", carrier_freq_disc_tx_r13);
  }
  j.write_int("discTxResourceReq-r13", disc_tx_res_req_r13);
  j.end_obj();
}

// SL-GapFreqInfo-r13 ::= SEQUENCE
SRSASN_CODE sl_gap_freq_info_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(carrier_freq_r13_present, 1));

  if (carrier_freq_r13_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_r13, (uint32_t)0u, (uint32_t)262143u));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, gap_pattern_list_r13, 1, 8));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_gap_freq_info_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(carrier_freq_r13_present, 1));

  if (carrier_freq_r13_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_r13, bref, (uint32_t)0u, (uint32_t)262143u));
  }
  HANDLE_CODE(unpack_dyn_seq_of(gap_pattern_list_r13, bref, 1, 8));

  return SRSASN_SUCCESS;
}
void sl_gap_freq_info_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (carrier_freq_r13_present) {
    j.write_int("carrierFreq-r13", carrier_freq_r13);
  }
  j.start_array("gapPatternList-r13");
  for (const auto& e1 : gap_pattern_list_r13) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// SensingResult-r15 ::= SEQUENCE
SRSASN_CODE sensing_result_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, res_idx_r15, (uint16_t)1u, (uint16_t)2000u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sensing_result_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(res_idx_r15, bref, (uint16_t)1u, (uint16_t)2000u));

  return SRSASN_SUCCESS;
}
void sensing_result_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("resourceIndex-r15", res_idx_r15);
  j.end_obj();
}

// SidelinkUEInformation-v1530-IEs ::= SEQUENCE
SRSASN_CODE sidelink_ue_info_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(reliability_info_list_sl_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (reliability_info_list_sl_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, reliability_info_list_sl_r15, 1, 8, integer_packer<uint8_t>(1, 8)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sidelink_ue_info_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(reliability_info_list_sl_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (reliability_info_list_sl_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(reliability_info_list_sl_r15, bref, 1, 8, integer_packer<uint8_t>(1, 8)));
  }

  return SRSASN_SUCCESS;
}
void sidelink_ue_info_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (reliability_info_list_sl_r15_present) {
    j.start_array("reliabilityInfoListSL-r15");
    for (const auto& e1 : reliability_info_list_sl_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// TrafficPatternInfo-r14 ::= SEQUENCE
SRSASN_CODE traffic_pattern_info_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(prio_info_sl_r14_present, 1));
  HANDLE_CODE(bref.pack(lc_ch_id_ul_r14_present, 1));

  HANDLE_CODE(traffic_periodicity_r14.pack(bref));
  HANDLE_CODE(pack_integer(bref, timing_offset_r14, (uint16_t)0u, (uint16_t)10239u));
  if (prio_info_sl_r14_present) {
    HANDLE_CODE(pack_integer(bref, prio_info_sl_r14, (uint8_t)1u, (uint8_t)8u));
  }
  if (lc_ch_id_ul_r14_present) {
    HANDLE_CODE(pack_integer(bref, lc_ch_id_ul_r14, (uint8_t)3u, (uint8_t)10u));
  }
  HANDLE_CODE(msg_size_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE traffic_pattern_info_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(prio_info_sl_r14_present, 1));
  HANDLE_CODE(bref.unpack(lc_ch_id_ul_r14_present, 1));

  HANDLE_CODE(traffic_periodicity_r14.unpack(bref));
  HANDLE_CODE(unpack_integer(timing_offset_r14, bref, (uint16_t)0u, (uint16_t)10239u));
  if (prio_info_sl_r14_present) {
    HANDLE_CODE(unpack_integer(prio_info_sl_r14, bref, (uint8_t)1u, (uint8_t)8u));
  }
  if (lc_ch_id_ul_r14_present) {
    HANDLE_CODE(unpack_integer(lc_ch_id_ul_r14, bref, (uint8_t)3u, (uint8_t)10u));
  }
  HANDLE_CODE(msg_size_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void traffic_pattern_info_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("trafficPeriodicity-r14", traffic_periodicity_r14.to_string());
  j.write_int("timingOffset-r14", timing_offset_r14);
  if (prio_info_sl_r14_present) {
    j.write_int("priorityInfoSL-r14", prio_info_sl_r14);
  }
  if (lc_ch_id_ul_r14_present) {
    j.write_int("logicalChannelIdentityUL-r14", lc_ch_id_ul_r14);
  }
  j.write_str("messageSize-r14", msg_size_r14.to_string());
  j.end_obj();
}

// UE-RadioPagingInfo-r12 ::= SEQUENCE
SRSASN_CODE ue_radio_paging_info_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ue_category_v1250_present, 1));

  if (ue_category_v1250_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_v1250, (uint8_t)0u, (uint8_t)0u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= ue_category_dl_v1310_present;
    group_flags[0] |= ce_mode_a_r13_present;
    group_flags[0] |= ce_mode_b_r13_present;
    group_flags[1] |= wake_up_signal_r15_present;
    group_flags[1] |= wake_up_signal_tdd_r15_present;
    group_flags[1] |= wake_up_signal_min_gap_e_drx_r15_present;
    group_flags[1] |= wake_up_signal_min_gap_e_drx_tdd_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(ue_category_dl_v1310_present, 1));
      HANDLE_CODE(bref.pack(ce_mode_a_r13_present, 1));
      HANDLE_CODE(bref.pack(ce_mode_b_r13_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(wake_up_signal_r15_present, 1));
      HANDLE_CODE(bref.pack(wake_up_signal_tdd_r15_present, 1));
      HANDLE_CODE(bref.pack(wake_up_signal_min_gap_e_drx_r15_present, 1));
      HANDLE_CODE(bref.pack(wake_up_signal_min_gap_e_drx_tdd_r15_present, 1));
      if (wake_up_signal_min_gap_e_drx_r15_present) {
        HANDLE_CODE(wake_up_signal_min_gap_e_drx_r15.pack(bref));
      }
      if (wake_up_signal_min_gap_e_drx_tdd_r15_present) {
        HANDLE_CODE(wake_up_signal_min_gap_e_drx_tdd_r15.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_radio_paging_info_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ue_category_v1250_present, 1));

  if (ue_category_v1250_present) {
    HANDLE_CODE(unpack_integer(ue_category_v1250, bref, (uint8_t)0u, (uint8_t)0u));
  }

  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(ue_category_dl_v1310_present, 1));
      HANDLE_CODE(bref.unpack(ce_mode_a_r13_present, 1));
      HANDLE_CODE(bref.unpack(ce_mode_b_r13_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(wake_up_signal_r15_present, 1));
      HANDLE_CODE(bref.unpack(wake_up_signal_tdd_r15_present, 1));
      HANDLE_CODE(bref.unpack(wake_up_signal_min_gap_e_drx_r15_present, 1));
      HANDLE_CODE(bref.unpack(wake_up_signal_min_gap_e_drx_tdd_r15_present, 1));
      if (wake_up_signal_min_gap_e_drx_r15_present) {
        HANDLE_CODE(wake_up_signal_min_gap_e_drx_r15.unpack(bref));
      }
      if (wake_up_signal_min_gap_e_drx_tdd_r15_present) {
        HANDLE_CODE(wake_up_signal_min_gap_e_drx_tdd_r15.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void ue_radio_paging_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_category_v1250_present) {
    j.write_int("ue-Category-v1250", ue_category_v1250);
  }
  if (ext) {
    if (ue_category_dl_v1310_present) {
      j.write_str("ue-CategoryDL-v1310", "m1");
    }
    if (ce_mode_a_r13_present) {
      j.write_str("ce-ModeA-r13", "true");
    }
    if (ce_mode_b_r13_present) {
      j.write_str("ce-ModeB-r13", "true");
    }
    if (wake_up_signal_r15_present) {
      j.write_str("wakeUpSignal-r15", "true");
    }
    if (wake_up_signal_tdd_r15_present) {
      j.write_str("wakeUpSignal-TDD-r15", "true");
    }
    if (wake_up_signal_min_gap_e_drx_r15_present) {
      j.write_str("wakeUpSignalMinGap-eDRX-r15", wake_up_signal_min_gap_e_drx_r15.to_string());
    }
    if (wake_up_signal_min_gap_e_drx_tdd_r15_present) {
      j.write_str("wakeUpSignalMinGap-eDRX-TDD-r15", wake_up_signal_min_gap_e_drx_tdd_r15.to_string());
    }
  }
  j.end_obj();
}

// UEAssistanceInformation-v1530-IEs ::= SEQUENCE
SRSASN_CODE ueassist_info_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(sps_assist_info_v1530_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (sps_assist_info_v1530_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, sps_assist_info_v1530.traffic_pattern_info_list_sl_v1530, 1, 8));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ueassist_info_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(sps_assist_info_v1530_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (sps_assist_info_v1530_present) {
    HANDLE_CODE(unpack_dyn_seq_of(sps_assist_info_v1530.traffic_pattern_info_list_sl_v1530, bref, 1, 8));
  }

  return SRSASN_SUCCESS;
}
void ueassist_info_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sps_assist_info_v1530_present) {
    j.write_fieldname("sps-AssistanceInformation-v1530");
    j.start_obj();
    j.start_array("trafficPatternInfoListSL-v1530");
    for (const auto& e1 : sps_assist_info_v1530.traffic_pattern_info_list_sl_v1530) {
      e1.to_json(j);
    }
    j.end_array();
    j.end_obj();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// UEInformationResponse-v1130-IEs ::= SEQUENCE
SRSASN_CODE ue_info_resp_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(conn_est_fail_report_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (conn_est_fail_report_r11_present) {
    HANDLE_CODE(conn_est_fail_report_r11.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_resp_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(conn_est_fail_report_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (conn_est_fail_report_r11_present) {
    HANDLE_CODE(conn_est_fail_report_r11.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_resp_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (conn_est_fail_report_r11_present) {
    j.write_fieldname("connEstFailReport-r11");
    conn_est_fail_report_r11.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UL-PDCP-DelayResult-r13 ::= SEQUENCE
SRSASN_CODE ul_pdcp_delay_result_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(qci_id_r13.pack(bref));
  HANDLE_CODE(pack_integer(bref, excess_delay_r13, (uint8_t)0u, (uint8_t)31u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_pdcp_delay_result_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(qci_id_r13.unpack(bref));
  HANDLE_CODE(unpack_integer(excess_delay_r13, bref, (uint8_t)0u, (uint8_t)31u));

  return SRSASN_SUCCESS;
}
void ul_pdcp_delay_result_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("qci-Id-r13", qci_id_r13.to_string());
  j.write_int("excessDelay-r13", excess_delay_r13);
  j.end_obj();
}

// AffectedCarrierFreq-r11 ::= SEQUENCE
SRSASN_CODE affected_carrier_freq_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, carrier_freq_r11, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(interference_direction_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE affected_carrier_freq_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(carrier_freq_r11, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(interference_direction_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void affected_carrier_freq_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r11", carrier_freq_r11);
  j.write_str("interferenceDirection-r11", interference_direction_r11.to_string());
  j.end_obj();
}

// BW-Preference-r14 ::= SEQUENCE
SRSASN_CODE bw_pref_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dl_pref_r14_present, 1));
  HANDLE_CODE(bref.pack(ul_pref_r14_present, 1));

  if (dl_pref_r14_present) {
    HANDLE_CODE(dl_pref_r14.pack(bref));
  }
  if (ul_pref_r14_present) {
    HANDLE_CODE(ul_pref_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE bw_pref_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dl_pref_r14_present, 1));
  HANDLE_CODE(bref.unpack(ul_pref_r14_present, 1));

  if (dl_pref_r14_present) {
    HANDLE_CODE(dl_pref_r14.unpack(bref));
  }
  if (ul_pref_r14_present) {
    HANDLE_CODE(ul_pref_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void bw_pref_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dl_pref_r14_present) {
    j.write_str("dl-Preference-r14", dl_pref_r14.to_string());
  }
  if (ul_pref_r14_present) {
    j.write_str("ul-Preference-r14", ul_pref_r14.to_string());
  }
  j.end_obj();
}

// CounterCheckResponse-v1530-IEs ::= SEQUENCE
SRSASN_CODE counter_check_resp_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(drb_count_info_list_ext_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (drb_count_info_list_ext_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_count_info_list_ext_r15, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE counter_check_resp_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(drb_count_info_list_ext_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (drb_count_info_list_ext_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_count_info_list_ext_r15, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void counter_check_resp_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (drb_count_info_list_ext_r15_present) {
    j.start_array("drb-CountInfoListExt-r15");
    for (const auto& e1 : drb_count_info_list_ext_r15) {
      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();
}

// CountingResponseInfo-r10 ::= SEQUENCE
SRSASN_CODE count_resp_info_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, count_resp_service_r10, (uint8_t)0u, (uint8_t)15u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE count_resp_info_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(count_resp_service_r10, bref, (uint8_t)0u, (uint8_t)15u));

  return SRSASN_SUCCESS;
}
void count_resp_info_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("countingResponseService-r10", count_resp_service_r10);
  j.end_obj();
}

// DelayBudgetReport-r14 ::= CHOICE
void delay_budget_report_r14_c::destroy_() {}
void delay_budget_report_r14_c::set(types::options e)
{
  destroy_();
  type_ = e;
}
delay_budget_report_r14_c::delay_budget_report_r14_c(const delay_budget_report_r14_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::type1:
      c.init(other.c.get<type1_e_>());
      break;
    case types::type2:
      c.init(other.c.get<type2_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "delay_budget_report_r14_c");
  }
}
delay_budget_report_r14_c& delay_budget_report_r14_c::operator=(const delay_budget_report_r14_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::type1:
      c.set(other.c.get<type1_e_>());
      break;
    case types::type2:
      c.set(other.c.get<type2_e_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "delay_budget_report_r14_c");
  }

  return *this;
}
void delay_budget_report_r14_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::type1:
      j.write_str("type1", c.get<type1_e_>().to_string());
      break;
    case types::type2:
      j.write_str("type2", c.get<type2_e_>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "delay_budget_report_r14_c");
  }
  j.end_obj();
}
SRSASN_CODE delay_budget_report_r14_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::type1:
      HANDLE_CODE(c.get<type1_e_>().pack(bref));
      break;
    case types::type2:
      HANDLE_CODE(c.get<type2_e_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "delay_budget_report_r14_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE delay_budget_report_r14_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::type1:
      HANDLE_CODE(c.get<type1_e_>().unpack(bref));
      break;
    case types::type2:
      HANDLE_CODE(c.get<type2_e_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "delay_budget_report_r14_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// InDeviceCoexIndication-v1310-IEs ::= SEQUENCE
SRSASN_CODE in_dev_coex_ind_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(affected_carrier_freq_list_v1310_present, 1));
  HANDLE_CODE(bref.pack(affected_carrier_freq_comb_list_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (affected_carrier_freq_list_v1310_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, affected_carrier_freq_list_v1310, 1, 32));
  }
  if (affected_carrier_freq_comb_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref,
                                affected_carrier_freq_comb_list_r13,
                                1,
                                128,
                                SeqOfPacker<integer_packer<uint8_t> >(2, 32, integer_packer<uint8_t>(1, 64))));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE in_dev_coex_ind_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(affected_carrier_freq_list_v1310_present, 1));
  HANDLE_CODE(bref.unpack(affected_carrier_freq_comb_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (affected_carrier_freq_list_v1310_present) {
    HANDLE_CODE(unpack_dyn_seq_of(affected_carrier_freq_list_v1310, bref, 1, 32));
  }
  if (affected_carrier_freq_comb_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(affected_carrier_freq_comb_list_r13,
                                  bref,
                                  1,
                                  128,
                                  SeqOfPacker<integer_packer<uint8_t> >(2, 32, integer_packer<uint8_t>(1, 64))));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void in_dev_coex_ind_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (affected_carrier_freq_list_v1310_present) {
    j.start_array("affectedCarrierFreqList-v1310");
    for (const auto& e1 : affected_carrier_freq_list_v1310) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (affected_carrier_freq_comb_list_r13_present) {
    j.start_array("affectedCarrierFreqCombList-r13");
    for (const auto& e1 : affected_carrier_freq_comb_list_r13) {
      j.start_array();
      for (const auto& e2 : e1) {
        j.write_int(e2);
      }
      j.end_array();
    }
    j.end_array();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// MeasResultForECID-r9 ::= SEQUENCE
SRSASN_CODE meas_result_for_ecid_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, ue_rx_tx_time_diff_result_r9, (uint16_t)0u, (uint16_t)4095u));
  HANDLE_CODE(current_sfn_r9.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_for_ecid_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(ue_rx_tx_time_diff_result_r9, bref, (uint16_t)0u, (uint16_t)4095u));
  HANDLE_CODE(current_sfn_r9.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_result_for_ecid_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("ue-RxTxTimeDiffResult-r9", ue_rx_tx_time_diff_result_r9);
  j.write_str("currentSFN-r9", current_sfn_r9.to_string());
  j.end_obj();
}

// MeasResultForRSSI-r13 ::= SEQUENCE
SRSASN_CODE meas_result_for_rssi_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, rssi_result_r13, (uint8_t)0u, (uint8_t)76u));
  HANDLE_CODE(pack_integer(bref, ch_occupancy_r13, (uint8_t)0u, (uint8_t)100u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_for_rssi_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(rssi_result_r13, bref, (uint8_t)0u, (uint8_t)76u));
  HANDLE_CODE(unpack_integer(ch_occupancy_r13, bref, (uint8_t)0u, (uint8_t)100u));

  return SRSASN_SUCCESS;
}
void meas_result_for_rssi_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("rssi-Result-r13", rssi_result_r13);
  j.write_int("channelOccupancy-r13", ch_occupancy_r13);
  j.end_obj();
}

// MeasResultSSTD-r13 ::= SEQUENCE
SRSASN_CODE meas_result_sstd_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, sfn_offset_result_r13, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(pack_integer(bref, frame_boundary_offset_result_r13, (int8_t)-5, (int8_t)4));
  HANDLE_CODE(pack_integer(bref, sf_boundary_offset_result_r13, (uint8_t)0u, (uint8_t)127u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_sstd_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(sfn_offset_result_r13, bref, (uint16_t)0u, (uint16_t)1023u));
  HANDLE_CODE(unpack_integer(frame_boundary_offset_result_r13, bref, (int8_t)-5, (int8_t)4));
  HANDLE_CODE(unpack_integer(sf_boundary_offset_result_r13, bref, (uint8_t)0u, (uint8_t)127u));

  return SRSASN_SUCCESS;
}
void meas_result_sstd_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sfn-OffsetResult-r13", sfn_offset_result_r13);
  j.write_int("frameBoundaryOffsetResult-r13", frame_boundary_offset_result_r13);
  j.write_int("subframeBoundaryOffsetResult-r13", sf_boundary_offset_result_r13);
  j.end_obj();
}

// MeasResultSensing-r15 ::= SEQUENCE
SRSASN_CODE meas_result_sensing_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, sl_sf_ref_r15, (uint16_t)0u, (uint16_t)10239u));
  HANDLE_CODE(pack_dyn_seq_of(bref, sensing_result_r15, 0, 400));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_sensing_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(sl_sf_ref_r15, bref, (uint16_t)0u, (uint16_t)10239u));
  HANDLE_CODE(unpack_dyn_seq_of(sensing_result_r15, bref, 0, 400));

  return SRSASN_SUCCESS;
}
void meas_result_sensing_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sl-SubframeRef-r15", sl_sf_ref_r15);
  j.start_array("sensingResult-r15");
  for (const auto& e1 : sensing_result_r15) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// RRCConnectionReconfigurationComplete-v1020-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_complete_v1020_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rlf_info_available_r10_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_complete_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rlf_info_available_r10_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_complete_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rlf_info_available_r10_present) {
    j.write_str("rlf-InfoAvailable-r10", "true");
  }
  if (log_meas_available_r10_present) {
    j.write_str("logMeasAvailable-r10", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReestablishmentComplete-v8a0-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_complete_v8a0_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_reest_complete_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_complete_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionSetupComplete-v1020-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_v1020_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(gummei_type_r10_present, 1));
  HANDLE_CODE(bref.pack(rlf_info_available_r10_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_r10_present, 1));
  HANDLE_CODE(bref.pack(rn_sf_cfg_req_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (gummei_type_r10_present) {
    HANDLE_CODE(gummei_type_r10.pack(bref));
  }
  if (rn_sf_cfg_req_r10_present) {
    HANDLE_CODE(rn_sf_cfg_req_r10.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(gummei_type_r10_present, 1));
  HANDLE_CODE(bref.unpack(rlf_info_available_r10_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_r10_present, 1));
  HANDLE_CODE(bref.unpack(rn_sf_cfg_req_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (gummei_type_r10_present) {
    HANDLE_CODE(gummei_type_r10.unpack(bref));
  }
  if (rn_sf_cfg_req_r10_present) {
    HANDLE_CODE(rn_sf_cfg_req_r10.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_complete_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (gummei_type_r10_present) {
    j.write_str("gummei-Type-r10", gummei_type_r10.to_string());
  }
  if (rlf_info_available_r10_present) {
    j.write_str("rlf-InfoAvailable-r10", "true");
  }
  if (log_meas_available_r10_present) {
    j.write_str("logMeasAvailable-r10", "true");
  }
  if (rn_sf_cfg_req_r10_present) {
    j.write_str("rn-SubframeConfigReq-r10", rn_sf_cfg_req_r10.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RSTD-InterFreqInfo-r10 ::= SEQUENCE
SRSASN_CODE rstd_inter_freq_info_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, carrier_freq_r10, (uint32_t)0u, (uint32_t)65535u));
  HANDLE_CODE(pack_integer(bref, meas_prs_offset_r10, (uint8_t)0u, (uint8_t)39u));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= carrier_freq_v1090_present;
    group_flags[1] |= meas_prs_offset_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(carrier_freq_v1090_present, 1));
      if (carrier_freq_v1090_present) {
        HANDLE_CODE(pack_integer(bref, carrier_freq_v1090, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_prs_offset_r15.is_present(), 1));
      if (meas_prs_offset_r15.is_present()) {
        HANDLE_CODE(meas_prs_offset_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rstd_inter_freq_info_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(carrier_freq_r10, bref, (uint32_t)0u, (uint32_t)65535u));
  HANDLE_CODE(unpack_integer(meas_prs_offset_r10, bref, (uint8_t)0u, (uint8_t)39u));

  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(carrier_freq_v1090_present, 1));
      if (carrier_freq_v1090_present) {
        HANDLE_CODE(unpack_integer(carrier_freq_v1090, bref, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_prs_offset_r15_present;
      HANDLE_CODE(bref.unpack(meas_prs_offset_r15_present, 1));
      meas_prs_offset_r15.set_present(meas_prs_offset_r15_present);
      if (meas_prs_offset_r15.is_present()) {
        HANDLE_CODE(meas_prs_offset_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rstd_inter_freq_info_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("carrierFreq-r10", carrier_freq_r10);
  j.write_int("measPRS-Offset-r10", meas_prs_offset_r10);
  if (ext) {
    if (carrier_freq_v1090_present) {
      j.write_int("carrierFreq-v1090", carrier_freq_v1090);
    }
    if (meas_prs_offset_r15.is_present()) {
      j.write_fieldname("measPRS-Offset-r15");
      meas_prs_offset_r15->to_json(j);
    }
  }
  j.end_obj();
}

void rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::destroy_() {}
void rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::meas_prs_offset_r15_c_(
    const rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::rstd0_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::rstd1_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::rstd2_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd3_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd4_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd5_r15:
      c.init(other.c.get<uint8_t>());
      break;
    case types::rstd6_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd7_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd8_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd9_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd10_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd11_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd12_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd13_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd14_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd15_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd16_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd17_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd18_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd19_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::rstd20_r15:
      c.init(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_");
  }
}
rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_& rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::
                                                    operator=(const rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::rstd0_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::rstd1_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::rstd2_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd3_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd4_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd5_r15:
      c.set(other.c.get<uint8_t>());
      break;
    case types::rstd6_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd7_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd8_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd9_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd10_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd11_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd12_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd13_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd14_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd15_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd16_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd17_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd18_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd19_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::rstd20_r15:
      c.set(other.c.get<uint16_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_");
  }

  return *this;
}
void rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rstd0_r15:
      j.write_int("rstd0-r15", c.get<uint8_t>());
      break;
    case types::rstd1_r15:
      j.write_int("rstd1-r15", c.get<uint8_t>());
      break;
    case types::rstd2_r15:
      j.write_int("rstd2-r15", c.get<uint16_t>());
      break;
    case types::rstd3_r15:
      j.write_int("rstd3-r15", c.get<uint16_t>());
      break;
    case types::rstd4_r15:
      j.write_int("rstd4-r15", c.get<uint16_t>());
      break;
    case types::rstd5_r15:
      j.write_int("rstd5-r15", c.get<uint8_t>());
      break;
    case types::rstd6_r15:
      j.write_int("rstd6-r15", c.get<uint16_t>());
      break;
    case types::rstd7_r15:
      j.write_int("rstd7-r15", c.get<uint16_t>());
      break;
    case types::rstd8_r15:
      j.write_int("rstd8-r15", c.get<uint16_t>());
      break;
    case types::rstd9_r15:
      j.write_int("rstd9-r15", c.get<uint16_t>());
      break;
    case types::rstd10_r15:
      j.write_int("rstd10-r15", c.get<uint16_t>());
      break;
    case types::rstd11_r15:
      j.write_int("rstd11-r15", c.get<uint16_t>());
      break;
    case types::rstd12_r15:
      j.write_int("rstd12-r15", c.get<uint16_t>());
      break;
    case types::rstd13_r15:
      j.write_int("rstd13-r15", c.get<uint16_t>());
      break;
    case types::rstd14_r15:
      j.write_int("rstd14-r15", c.get<uint16_t>());
      break;
    case types::rstd15_r15:
      j.write_int("rstd15-r15", c.get<uint16_t>());
      break;
    case types::rstd16_r15:
      j.write_int("rstd16-r15", c.get<uint16_t>());
      break;
    case types::rstd17_r15:
      j.write_int("rstd17-r15", c.get<uint16_t>());
      break;
    case types::rstd18_r15:
      j.write_int("rstd18-r15", c.get<uint16_t>());
      break;
    case types::rstd19_r15:
      j.write_int("rstd19-r15", c.get<uint16_t>());
      break;
    case types::rstd20_r15:
      j.write_int("rstd20-r15", c.get<uint16_t>());
      break;
    default:
      log_invalid_choice_id(type_, "rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rstd0_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)79u));
      break;
    case types::rstd1_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    case types::rstd2_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd3_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd4_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd5_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)159u));
      break;
    case types::rstd6_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd7_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd8_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd9_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd10_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd11_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd12_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd13_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd14_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd15_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd16_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd17_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd18_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd19_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd20_r15:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)1279u));
      break;
    default:
      log_invalid_choice_id(type_, "rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rstd0_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)79u));
      break;
    case types::rstd1_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    case types::rstd2_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd3_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd4_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd5_r15:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)159u));
      break;
    case types::rstd6_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd7_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd8_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd9_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd10_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd11_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd12_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)319u));
      break;
    case types::rstd13_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd14_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd15_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd16_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd17_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd18_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    case types::rstd19_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)639u));
      break;
    case types::rstd20_r15:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)1279u));
      break;
    default:
      log_invalid_choice_id(type_, "rstd_inter_freq_info_r10_s::meas_prs_offset_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SCGFailureInformation-v12d0-IEs ::= SEQUENCE
SRSASN_CODE scg_fail_info_v12d0_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_v12d0_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_v12d0_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();
}

// SL-CommTxResourceReq-r12 ::= SEQUENCE
SRSASN_CODE sl_comm_tx_res_req_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(carrier_freq_r12_present, 1));

  if (carrier_freq_r12_present) {
    HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, dest_info_list_r12, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_comm_tx_res_req_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(carrier_freq_r12_present, 1));

  if (carrier_freq_r12_present) {
    HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));
  }
  HANDLE_CODE(unpack_dyn_seq_of(dest_info_list_r12, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void sl_comm_tx_res_req_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (carrier_freq_r12_present) {
    j.write_int("carrierFreq-r12", carrier_freq_r12);
  }
  j.start_array("destinationInfoList-r12");
  for (const auto& e1 : dest_info_list_r12) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.end_obj();
}

// SidelinkUEInformation-v1430-IEs ::= SEQUENCE
SRSASN_CODE sidelink_ue_info_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(v2x_comm_rx_interested_freq_list_r14_present, 1));
  HANDLE_CODE(bref.pack(p2x_comm_tx_type_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_comm_tx_res_req_r14_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (v2x_comm_rx_interested_freq_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_rx_interested_freq_list_r14, 1, 8, integer_packer<uint8_t>(0, 7)));
  }
  if (v2x_comm_tx_res_req_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_tx_res_req_r14, 1, 8));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sidelink_ue_info_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(v2x_comm_rx_interested_freq_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(p2x_comm_tx_type_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_comm_tx_res_req_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (v2x_comm_rx_interested_freq_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_rx_interested_freq_list_r14, bref, 1, 8, integer_packer<uint8_t>(0, 7)));
  }
  if (v2x_comm_tx_res_req_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_tx_res_req_r14, bref, 1, 8));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sidelink_ue_info_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (v2x_comm_rx_interested_freq_list_r14_present) {
    j.start_array("v2x-CommRxInterestedFreqList-r14");
    for (const auto& e1 : v2x_comm_rx_interested_freq_list_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (p2x_comm_tx_type_r14_present) {
    j.write_str("p2x-CommTxType-r14", "true");
  }
  if (v2x_comm_tx_res_req_r14_present) {
    j.start_array("v2x-CommTxResourceReq-r14");
    for (const auto& e1 : v2x_comm_tx_res_req_r14) {
      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();
}

// UE-CapabilityRAT-Container ::= SEQUENCE
SRSASN_CODE ue_cap_rat_container_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(rat_type.pack(bref));
  HANDLE_CODE(ue_cap_rat_container.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_rat_container_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(rat_type.unpack(bref));
  HANDLE_CODE(ue_cap_rat_container.unpack(bref));

  return SRSASN_SUCCESS;
}
void ue_cap_rat_container_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("rat-Type", rat_type.to_string());
  j.write_str("ueCapabilityRAT-Container", ue_cap_rat_container.to_string());
  j.end_obj();
}

// UEAssistanceInformation-v1450-IEs ::= SEQUENCE
SRSASN_CODE ueassist_info_v1450_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(overheat_assist_r14_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (overheat_assist_r14_present) {
    HANDLE_CODE(overheat_assist_r14.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ueassist_info_v1450_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(overheat_assist_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (overheat_assist_r14_present) {
    HANDLE_CODE(overheat_assist_r14.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ueassist_info_v1450_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (overheat_assist_r14_present) {
    j.write_fieldname("overheatingAssistance-r14");
    overheat_assist_r14.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UECapabilityInformation-v1250-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_info_v1250_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ue_radio_paging_info_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ue_radio_paging_info_r12_present) {
    HANDLE_CODE(ue_radio_paging_info_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_info_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_radio_paging_info_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_radio_paging_info_r12_present) {
    HANDLE_CODE(ue_radio_paging_info_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_info_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_radio_paging_info_r12_present) {
    j.write_fieldname("ue-RadioPagingInfo-r12");
    ue_radio_paging_info_r12.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// UEInformationResponse-v1020-IEs ::= SEQUENCE
SRSASN_CODE ue_info_resp_v1020_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_report_r10_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (log_meas_report_r10_present) {
    HANDLE_CODE(log_meas_report_r10.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_resp_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_report_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (log_meas_report_r10_present) {
    HANDLE_CODE(log_meas_report_r10.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_resp_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_report_r10_present) {
    j.write_fieldname("logMeasReport-r10");
    log_meas_report_r10.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  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();
}

// CSFBParametersRequestCDMA2000-v8a0-IEs ::= SEQUENCE
SRSASN_CODE csfb_params_request_cdma2000_v8a0_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 csfb_params_request_cdma2000_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));
  }

  return SRSASN_SUCCESS;
}
void csfb_params_request_cdma2000_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();
}

// CounterCheckResponse-v8a0-IEs ::= SEQUENCE
SRSASN_CODE counter_check_resp_v8a0_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 counter_check_resp_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void counter_check_resp_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// FailureReportSCG-NR-r15 ::= SEQUENCE
SRSASN_CODE fail_report_scg_nr_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_freq_list_nr_r15_present, 1));
  HANDLE_CODE(bref.pack(meas_result_scg_r15_present, 1));

  HANDLE_CODE(fail_type_r15.pack(bref));
  if (meas_result_freq_list_nr_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_freq_list_nr_r15, 1, 5));
  }
  if (meas_result_scg_r15_present) {
    HANDLE_CODE(meas_result_scg_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE fail_report_scg_nr_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_freq_list_nr_r15_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_scg_r15_present, 1));

  HANDLE_CODE(fail_type_r15.unpack(bref));
  if (meas_result_freq_list_nr_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_freq_list_nr_r15, bref, 1, 5));
  }
  if (meas_result_scg_r15_present) {
    HANDLE_CODE(meas_result_scg_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void fail_report_scg_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("failureType-r15", fail_type_r15.to_string());
  if (meas_result_freq_list_nr_r15_present) {
    j.start_array("measResultFreqListNR-r15");
    for (const auto& e1 : meas_result_freq_list_nr_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_result_scg_r15_present) {
    j.write_str("measResultSCG-r15", meas_result_scg_r15.to_string());
  }
  j.end_obj();
}

// FailureReportSCG-r12 ::= SEQUENCE
SRSASN_CODE fail_report_scg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_serv_freq_list_r12_present, 1));
  HANDLE_CODE(bref.pack(meas_result_neigh_cells_r12_present, 1));

  HANDLE_CODE(fail_type_r12.pack(bref));
  if (meas_result_serv_freq_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_serv_freq_list_r12, 1, 5));
  }
  if (meas_result_neigh_cells_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r12, 1, 8));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= fail_type_v1290_present;
    group_flags[1] |= meas_result_serv_freq_list_ext_r13.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(fail_type_v1290_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_serv_freq_list_ext_r13.is_present(), 1));
      if (meas_result_serv_freq_list_ext_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_serv_freq_list_ext_r13, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE fail_report_scg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_serv_freq_list_r12_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r12_present, 1));

  HANDLE_CODE(fail_type_r12.unpack(bref));
  if (meas_result_serv_freq_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_serv_freq_list_r12, bref, 1, 5));
  }
  if (meas_result_neigh_cells_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r12, bref, 1, 8));
  }

  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(fail_type_v1290_present, 1));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_result_serv_freq_list_ext_r13_present;
      HANDLE_CODE(bref.unpack(meas_result_serv_freq_list_ext_r13_present, 1));
      meas_result_serv_freq_list_ext_r13.set_present(meas_result_serv_freq_list_ext_r13_present);
      if (meas_result_serv_freq_list_ext_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_serv_freq_list_ext_r13, bref, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void fail_report_scg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("failureType-r12", fail_type_r12.to_string());
  if (meas_result_serv_freq_list_r12_present) {
    j.start_array("measResultServFreqList-r12");
    for (const auto& e1 : meas_result_serv_freq_list_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_result_neigh_cells_r12_present) {
    j.start_array("measResultNeighCells-r12");
    for (const auto& e1 : meas_result_neigh_cells_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (ext) {
    if (fail_type_v1290_present) {
      j.write_str("failureType-v1290", "maxUL-TimingDiff-v1290");
    }
    if (meas_result_serv_freq_list_ext_r13.is_present()) {
      j.start_array("measResultServFreqListExt-r13");
      for (const auto& e1 : *meas_result_serv_freq_list_ext_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// InDeviceCoexIndication-v11d0-IEs ::= SEQUENCE
SRSASN_CODE in_dev_coex_ind_v11d0_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_ca_assist_info_r11_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ul_ca_assist_info_r11_present) {
    HANDLE_CODE(bref.pack(ul_ca_assist_info_r11.affected_carrier_freq_comb_list_r11_present, 1));
    if (ul_ca_assist_info_r11.affected_carrier_freq_comb_list_r11_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref,
                                  ul_ca_assist_info_r11.affected_carrier_freq_comb_list_r11,
                                  1,
                                  128,
                                  SeqOfPacker<integer_packer<uint8_t> >(2, 5, integer_packer<uint8_t>(1, 32))));
    }
    HANDLE_CODE(ul_ca_assist_info_r11.victim_sys_type_r11.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE in_dev_coex_ind_v11d0_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_ca_assist_info_r11_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ul_ca_assist_info_r11_present) {
    HANDLE_CODE(bref.unpack(ul_ca_assist_info_r11.affected_carrier_freq_comb_list_r11_present, 1));
    if (ul_ca_assist_info_r11.affected_carrier_freq_comb_list_r11_present) {
      HANDLE_CODE(unpack_dyn_seq_of(ul_ca_assist_info_r11.affected_carrier_freq_comb_list_r11,
                                    bref,
                                    1,
                                    128,
                                    SeqOfPacker<integer_packer<uint8_t> >(2, 5, integer_packer<uint8_t>(1, 32))));
    }
    HANDLE_CODE(ul_ca_assist_info_r11.victim_sys_type_r11.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void in_dev_coex_ind_v11d0_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ul_ca_assist_info_r11_present) {
    j.write_fieldname("ul-CA-AssistanceInfo-r11");
    j.start_obj();
    if (ul_ca_assist_info_r11.affected_carrier_freq_comb_list_r11_present) {
      j.start_array("affectedCarrierFreqCombList-r11");
      for (const auto& e1 : ul_ca_assist_info_r11.affected_carrier_freq_comb_list_r11) {
        j.start_array();
        for (const auto& e2 : e1) {
          j.write_int(e2);
        }
        j.end_array();
      }
      j.end_array();
    }
    j.write_fieldname("victimSystemType-r11");
    ul_ca_assist_info_r11.victim_sys_type_r11.to_json(j);
    j.end_obj();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// MBMSInterestIndication-v1310-IEs ::= SEQUENCE
SRSASN_CODE mbms_interest_ind_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mbms_services_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (mbms_services_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mbms_services_r13, 0, 15));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_interest_ind_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mbms_services_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (mbms_services_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mbms_services_r13, bref, 0, 15));
  }

  return SRSASN_SUCCESS;
}
void mbms_interest_ind_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mbms_services_r13_present) {
    j.start_array("mbms-Services-r13");
    for (const auto& e1 : mbms_services_r13) {
      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();
}

// MeasResults ::= SEQUENCE
SRSASN_CODE meas_results_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_neigh_cells_present, 1));

  HANDLE_CODE(pack_integer(bref, meas_id, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(pack_integer(bref, meas_result_pcell.rsrp_result, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(pack_integer(bref, meas_result_pcell.rsrq_result, (uint8_t)0u, (uint8_t)34u));
  if (meas_result_neigh_cells_present) {
    HANDLE_CODE(meas_result_neigh_cells.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= meas_result_for_ecid_r9.is_present();
    group_flags[1] |= location_info_r10.is_present();
    group_flags[1] |= meas_result_serv_freq_list_r10.is_present();
    group_flags[2] |= meas_id_v1250_present;
    group_flags[2] |= meas_result_pcell_v1250_present;
    group_flags[2] |= meas_result_csi_rs_list_r12.is_present();
    group_flags[3] |= meas_result_for_rssi_r13.is_present();
    group_flags[3] |= meas_result_serv_freq_list_ext_r13.is_present();
    group_flags[3] |= meas_result_sstd_r13.is_present();
    group_flags[3] |= meas_result_pcell_v1310.is_present();
    group_flags[3] |= ul_pdcp_delay_result_list_r13.is_present();
    group_flags[3] |= meas_result_list_wlan_r13.is_present();
    group_flags[4] |= meas_result_pcell_v1360_present;
    group_flags[5] |= meas_result_list_cbr_r14.is_present();
    group_flags[5] |= meas_result_list_wlan_r14.is_present();
    group_flags[6] |= meas_result_serv_freq_list_nr_r15.is_present();
    group_flags[6] |= meas_result_cell_list_sftd_r15.is_present();
    group_flags[7] |= log_meas_result_list_bt_r15.is_present();
    group_flags[7] |= log_meas_result_list_wlan_r15.is_present();
    group_flags[7] |= meas_result_sensing_r15.is_present();
    group_flags[7] |= height_ue_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_for_ecid_r9.is_present(), 1));
      if (meas_result_for_ecid_r9.is_present()) {
        HANDLE_CODE(meas_result_for_ecid_r9->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(location_info_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_serv_freq_list_r10.is_present(), 1));
      if (location_info_r10.is_present()) {
        HANDLE_CODE(location_info_r10->pack(bref));
      }
      if (meas_result_serv_freq_list_r10.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_serv_freq_list_r10, 1, 5));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_id_v1250_present, 1));
      HANDLE_CODE(bref.pack(meas_result_pcell_v1250_present, 1));
      HANDLE_CODE(bref.pack(meas_result_csi_rs_list_r12.is_present(), 1));
      if (meas_id_v1250_present) {
        HANDLE_CODE(pack_integer(bref, meas_id_v1250, (uint8_t)33u, (uint8_t)64u));
      }
      if (meas_result_pcell_v1250_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_pcell_v1250, (int8_t)-30, (int8_t)46));
      }
      if (meas_result_csi_rs_list_r12.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_csi_rs_list_r12, 1, 8));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_for_rssi_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_serv_freq_list_ext_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_sstd_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_pcell_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(ul_pdcp_delay_result_list_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_list_wlan_r13.is_present(), 1));
      if (meas_result_for_rssi_r13.is_present()) {
        HANDLE_CODE(meas_result_for_rssi_r13->pack(bref));
      }
      if (meas_result_serv_freq_list_ext_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_serv_freq_list_ext_r13, 1, 32));
      }
      if (meas_result_sstd_r13.is_present()) {
        HANDLE_CODE(meas_result_sstd_r13->pack(bref));
      }
      if (meas_result_pcell_v1310.is_present()) {
        HANDLE_CODE(pack_integer(bref, meas_result_pcell_v1310->rs_sinr_result_r13, (uint8_t)0u, (uint8_t)127u));
      }
      if (ul_pdcp_delay_result_list_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *ul_pdcp_delay_result_list_r13, 1, 6));
      }
      if (meas_result_list_wlan_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_list_wlan_r13, 1, 8));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_pcell_v1360_present, 1));
      if (meas_result_pcell_v1360_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_pcell_v1360, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_list_cbr_r14.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_list_wlan_r14.is_present(), 1));
      if (meas_result_list_cbr_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_list_cbr_r14, 1, 72));
      }
      if (meas_result_list_wlan_r14.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_list_wlan_r14, 1, 32));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_serv_freq_list_nr_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_cell_list_sftd_r15.is_present(), 1));
      if (meas_result_serv_freq_list_nr_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_serv_freq_list_nr_r15, 1, 32));
      }
      if (meas_result_cell_list_sftd_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_cell_list_sftd_r15, 1, 3));
      }
    }
    if (group_flags[7]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(log_meas_result_list_bt_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(log_meas_result_list_wlan_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_sensing_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(height_ue_r15_present, 1));
      if (log_meas_result_list_bt_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *log_meas_result_list_bt_r15, 1, 32));
      }
      if (log_meas_result_list_wlan_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *log_meas_result_list_wlan_r15, 1, 32));
      }
      if (meas_result_sensing_r15.is_present()) {
        HANDLE_CODE(meas_result_sensing_r15->pack(bref));
      }
      if (height_ue_r15_present) {
        HANDLE_CODE(pack_integer(bref, height_ue_r15, (int16_t)-400, (int16_t)8880));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_results_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_neigh_cells_present, 1));

  HANDLE_CODE(unpack_integer(meas_id, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(unpack_integer(meas_result_pcell.rsrp_result, bref, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(unpack_integer(meas_result_pcell.rsrq_result, bref, (uint8_t)0u, (uint8_t)34u));
  if (meas_result_neigh_cells_present) {
    HANDLE_CODE(meas_result_neigh_cells.unpack(bref));
  }

  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);

      bool meas_result_for_ecid_r9_present;
      HANDLE_CODE(bref.unpack(meas_result_for_ecid_r9_present, 1));
      meas_result_for_ecid_r9.set_present(meas_result_for_ecid_r9_present);
      if (meas_result_for_ecid_r9.is_present()) {
        HANDLE_CODE(meas_result_for_ecid_r9->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool location_info_r10_present;
      HANDLE_CODE(bref.unpack(location_info_r10_present, 1));
      location_info_r10.set_present(location_info_r10_present);
      bool meas_result_serv_freq_list_r10_present;
      HANDLE_CODE(bref.unpack(meas_result_serv_freq_list_r10_present, 1));
      meas_result_serv_freq_list_r10.set_present(meas_result_serv_freq_list_r10_present);
      if (location_info_r10.is_present()) {
        HANDLE_CODE(location_info_r10->unpack(bref));
      }
      if (meas_result_serv_freq_list_r10.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_serv_freq_list_r10, bref, 1, 5));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(meas_id_v1250_present, 1));
      HANDLE_CODE(bref.unpack(meas_result_pcell_v1250_present, 1));
      bool meas_result_csi_rs_list_r12_present;
      HANDLE_CODE(bref.unpack(meas_result_csi_rs_list_r12_present, 1));
      meas_result_csi_rs_list_r12.set_present(meas_result_csi_rs_list_r12_present);
      if (meas_id_v1250_present) {
        HANDLE_CODE(unpack_integer(meas_id_v1250, bref, (uint8_t)33u, (uint8_t)64u));
      }
      if (meas_result_pcell_v1250_present) {
        HANDLE_CODE(unpack_integer(meas_result_pcell_v1250, bref, (int8_t)-30, (int8_t)46));
      }
      if (meas_result_csi_rs_list_r12.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_csi_rs_list_r12, bref, 1, 8));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_result_for_rssi_r13_present;
      HANDLE_CODE(bref.unpack(meas_result_for_rssi_r13_present, 1));
      meas_result_for_rssi_r13.set_present(meas_result_for_rssi_r13_present);
      bool meas_result_serv_freq_list_ext_r13_present;
      HANDLE_CODE(bref.unpack(meas_result_serv_freq_list_ext_r13_present, 1));
      meas_result_serv_freq_list_ext_r13.set_present(meas_result_serv_freq_list_ext_r13_present);
      bool meas_result_sstd_r13_present;
      HANDLE_CODE(bref.unpack(meas_result_sstd_r13_present, 1));
      meas_result_sstd_r13.set_present(meas_result_sstd_r13_present);
      bool meas_result_pcell_v1310_present;
      HANDLE_CODE(bref.unpack(meas_result_pcell_v1310_present, 1));
      meas_result_pcell_v1310.set_present(meas_result_pcell_v1310_present);
      bool ul_pdcp_delay_result_list_r13_present;
      HANDLE_CODE(bref.unpack(ul_pdcp_delay_result_list_r13_present, 1));
      ul_pdcp_delay_result_list_r13.set_present(ul_pdcp_delay_result_list_r13_present);
      bool meas_result_list_wlan_r13_present;
      HANDLE_CODE(bref.unpack(meas_result_list_wlan_r13_present, 1));
      meas_result_list_wlan_r13.set_present(meas_result_list_wlan_r13_present);
      if (meas_result_for_rssi_r13.is_present()) {
        HANDLE_CODE(meas_result_for_rssi_r13->unpack(bref));
      }
      if (meas_result_serv_freq_list_ext_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_serv_freq_list_ext_r13, bref, 1, 32));
      }
      if (meas_result_sstd_r13.is_present()) {
        HANDLE_CODE(meas_result_sstd_r13->unpack(bref));
      }
      if (meas_result_pcell_v1310.is_present()) {
        HANDLE_CODE(unpack_integer(meas_result_pcell_v1310->rs_sinr_result_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
      if (ul_pdcp_delay_result_list_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*ul_pdcp_delay_result_list_r13, bref, 1, 6));
      }
      if (meas_result_list_wlan_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_list_wlan_r13, bref, 1, 8));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(meas_result_pcell_v1360_present, 1));
      if (meas_result_pcell_v1360_present) {
        HANDLE_CODE(unpack_integer(meas_result_pcell_v1360, bref, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_result_list_cbr_r14_present;
      HANDLE_CODE(bref.unpack(meas_result_list_cbr_r14_present, 1));
      meas_result_list_cbr_r14.set_present(meas_result_list_cbr_r14_present);
      bool meas_result_list_wlan_r14_present;
      HANDLE_CODE(bref.unpack(meas_result_list_wlan_r14_present, 1));
      meas_result_list_wlan_r14.set_present(meas_result_list_wlan_r14_present);
      if (meas_result_list_cbr_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_list_cbr_r14, bref, 1, 72));
      }
      if (meas_result_list_wlan_r14.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_list_wlan_r14, bref, 1, 32));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool meas_result_serv_freq_list_nr_r15_present;
      HANDLE_CODE(bref.unpack(meas_result_serv_freq_list_nr_r15_present, 1));
      meas_result_serv_freq_list_nr_r15.set_present(meas_result_serv_freq_list_nr_r15_present);
      bool meas_result_cell_list_sftd_r15_present;
      HANDLE_CODE(bref.unpack(meas_result_cell_list_sftd_r15_present, 1));
      meas_result_cell_list_sftd_r15.set_present(meas_result_cell_list_sftd_r15_present);
      if (meas_result_serv_freq_list_nr_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_serv_freq_list_nr_r15, bref, 1, 32));
      }
      if (meas_result_cell_list_sftd_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_cell_list_sftd_r15, bref, 1, 3));
      }
    }
    if (group_flags[7]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool log_meas_result_list_bt_r15_present;
      HANDLE_CODE(bref.unpack(log_meas_result_list_bt_r15_present, 1));
      log_meas_result_list_bt_r15.set_present(log_meas_result_list_bt_r15_present);
      bool log_meas_result_list_wlan_r15_present;
      HANDLE_CODE(bref.unpack(log_meas_result_list_wlan_r15_present, 1));
      log_meas_result_list_wlan_r15.set_present(log_meas_result_list_wlan_r15_present);
      bool meas_result_sensing_r15_present;
      HANDLE_CODE(bref.unpack(meas_result_sensing_r15_present, 1));
      meas_result_sensing_r15.set_present(meas_result_sensing_r15_present);
      HANDLE_CODE(bref.unpack(height_ue_r15_present, 1));
      if (log_meas_result_list_bt_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*log_meas_result_list_bt_r15, bref, 1, 32));
      }
      if (log_meas_result_list_wlan_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*log_meas_result_list_wlan_r15, bref, 1, 32));
      }
      if (meas_result_sensing_r15.is_present()) {
        HANDLE_CODE(meas_result_sensing_r15->unpack(bref));
      }
      if (height_ue_r15_present) {
        HANDLE_CODE(unpack_integer(height_ue_r15, bref, (int16_t)-400, (int16_t)8880));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_results_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("measId", meas_id);
  j.write_fieldname("measResultPCell");
  j.start_obj();
  j.write_int("rsrpResult", meas_result_pcell.rsrp_result);
  j.write_int("rsrqResult", meas_result_pcell.rsrq_result);
  j.end_obj();
  if (meas_result_neigh_cells_present) {
    j.write_fieldname("measResultNeighCells");
    meas_result_neigh_cells.to_json(j);
  }
  if (ext) {
    if (meas_result_for_ecid_r9.is_present()) {
      j.write_fieldname("measResultForECID-r9");
      meas_result_for_ecid_r9->to_json(j);
    }
    if (location_info_r10.is_present()) {
      j.write_fieldname("locationInfo-r10");
      location_info_r10->to_json(j);
    }
    if (meas_result_serv_freq_list_r10.is_present()) {
      j.start_array("measResultServFreqList-r10");
      for (const auto& e1 : *meas_result_serv_freq_list_r10) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_id_v1250_present) {
      j.write_int("measId-v1250", meas_id_v1250);
    }
    if (meas_result_pcell_v1250_present) {
      j.write_int("measResultPCell-v1250", meas_result_pcell_v1250);
    }
    if (meas_result_csi_rs_list_r12.is_present()) {
      j.start_array("measResultCSI-RS-List-r12");
      for (const auto& e1 : *meas_result_csi_rs_list_r12) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_for_rssi_r13.is_present()) {
      j.write_fieldname("measResultForRSSI-r13");
      meas_result_for_rssi_r13->to_json(j);
    }
    if (meas_result_serv_freq_list_ext_r13.is_present()) {
      j.start_array("measResultServFreqListExt-r13");
      for (const auto& e1 : *meas_result_serv_freq_list_ext_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_sstd_r13.is_present()) {
      j.write_fieldname("measResultSSTD-r13");
      meas_result_sstd_r13->to_json(j);
    }
    if (meas_result_pcell_v1310.is_present()) {
      j.write_fieldname("measResultPCell-v1310");
      j.start_obj();
      j.write_int("rs-sinr-Result-r13", meas_result_pcell_v1310->rs_sinr_result_r13);
      j.end_obj();
    }
    if (ul_pdcp_delay_result_list_r13.is_present()) {
      j.start_array("ul-PDCP-DelayResultList-r13");
      for (const auto& e1 : *ul_pdcp_delay_result_list_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_list_wlan_r13.is_present()) {
      j.start_array("measResultListWLAN-r13");
      for (const auto& e1 : *meas_result_list_wlan_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_pcell_v1360_present) {
      j.write_int("measResultPCell-v1360", meas_result_pcell_v1360);
    }
    if (meas_result_list_cbr_r14.is_present()) {
      j.start_array("measResultListCBR-r14");
      for (const auto& e1 : *meas_result_list_cbr_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_list_wlan_r14.is_present()) {
      j.start_array("measResultListWLAN-r14");
      for (const auto& e1 : *meas_result_list_wlan_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_serv_freq_list_nr_r15.is_present()) {
      j.start_array("measResultServFreqListNR-r15");
      for (const auto& e1 : *meas_result_serv_freq_list_nr_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_cell_list_sftd_r15.is_present()) {
      j.start_array("measResultCellListSFTD-r15");
      for (const auto& e1 : *meas_result_cell_list_sftd_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (log_meas_result_list_bt_r15.is_present()) {
      j.start_array("logMeasResultListBT-r15");
      for (const auto& e1 : *log_meas_result_list_bt_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (log_meas_result_list_wlan_r15.is_present()) {
      j.start_array("logMeasResultListWLAN-r15");
      for (const auto& e1 : *log_meas_result_list_wlan_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_sensing_r15.is_present()) {
      j.write_fieldname("measResultSensing-r15");
      meas_result_sensing_r15->to_json(j);
    }
    if (height_ue_r15_present) {
      j.write_int("heightUE-r15", height_ue_r15);
    }
  }
  j.end_obj();
}

void meas_results_s::meas_result_neigh_cells_c_::destroy_()
{
  switch (type_) {
    case types::meas_result_list_eutra:
      c.destroy<meas_result_list_eutra_l>();
      break;
    case types::meas_result_list_utra:
      c.destroy<meas_result_list_utra_l>();
      break;
    case types::meas_result_list_geran:
      c.destroy<meas_result_list_geran_l>();
      break;
    case types::meas_results_cdma2000:
      c.destroy<meas_results_cdma2000_s>();
      break;
    case types::meas_result_neigh_cell_list_nr_r15:
      c.destroy<meas_result_cell_list_nr_r15_l>();
      break;
    default:
      break;
  }
}
void meas_results_s::meas_result_neigh_cells_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::meas_result_list_eutra:
      c.init<meas_result_list_eutra_l>();
      break;
    case types::meas_result_list_utra:
      c.init<meas_result_list_utra_l>();
      break;
    case types::meas_result_list_geran:
      c.init<meas_result_list_geran_l>();
      break;
    case types::meas_results_cdma2000:
      c.init<meas_results_cdma2000_s>();
      break;
    case types::meas_result_neigh_cell_list_nr_r15:
      c.init<meas_result_cell_list_nr_r15_l>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_results_s::meas_result_neigh_cells_c_");
  }
}
meas_results_s::meas_result_neigh_cells_c_::meas_result_neigh_cells_c_(
    const meas_results_s::meas_result_neigh_cells_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::meas_result_list_eutra:
      c.init(other.c.get<meas_result_list_eutra_l>());
      break;
    case types::meas_result_list_utra:
      c.init(other.c.get<meas_result_list_utra_l>());
      break;
    case types::meas_result_list_geran:
      c.init(other.c.get<meas_result_list_geran_l>());
      break;
    case types::meas_results_cdma2000:
      c.init(other.c.get<meas_results_cdma2000_s>());
      break;
    case types::meas_result_neigh_cell_list_nr_r15:
      c.init(other.c.get<meas_result_cell_list_nr_r15_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_results_s::meas_result_neigh_cells_c_");
  }
}
meas_results_s::meas_result_neigh_cells_c_& meas_results_s::meas_result_neigh_cells_c_::
                                            operator=(const meas_results_s::meas_result_neigh_cells_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::meas_result_list_eutra:
      c.set(other.c.get<meas_result_list_eutra_l>());
      break;
    case types::meas_result_list_utra:
      c.set(other.c.get<meas_result_list_utra_l>());
      break;
    case types::meas_result_list_geran:
      c.set(other.c.get<meas_result_list_geran_l>());
      break;
    case types::meas_results_cdma2000:
      c.set(other.c.get<meas_results_cdma2000_s>());
      break;
    case types::meas_result_neigh_cell_list_nr_r15:
      c.set(other.c.get<meas_result_cell_list_nr_r15_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "meas_results_s::meas_result_neigh_cells_c_");
  }

  return *this;
}
void meas_results_s::meas_result_neigh_cells_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::meas_result_list_eutra:
      j.start_array("measResultListEUTRA");
      for (const auto& e1 : c.get<meas_result_list_eutra_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::meas_result_list_utra:
      j.start_array("measResultListUTRA");
      for (const auto& e1 : c.get<meas_result_list_utra_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::meas_result_list_geran:
      j.start_array("measResultListGERAN");
      for (const auto& e1 : c.get<meas_result_list_geran_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    case types::meas_results_cdma2000:
      j.write_fieldname("measResultsCDMA2000");
      c.get<meas_results_cdma2000_s>().to_json(j);
      break;
    case types::meas_result_neigh_cell_list_nr_r15:
      j.start_array("measResultNeighCellListNR-r15");
      for (const auto& e1 : c.get<meas_result_cell_list_nr_r15_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "meas_results_s::meas_result_neigh_cells_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_results_s::meas_result_neigh_cells_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::meas_result_list_eutra:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<meas_result_list_eutra_l>(), 1, 8));
      break;
    case types::meas_result_list_utra:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<meas_result_list_utra_l>(), 1, 8));
      break;
    case types::meas_result_list_geran:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<meas_result_list_geran_l>(), 1, 8));
      break;
    case types::meas_results_cdma2000:
      HANDLE_CODE(c.get<meas_results_cdma2000_s>().pack(bref));
      break;
    case types::meas_result_neigh_cell_list_nr_r15: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<meas_result_cell_list_nr_r15_l>(), 1, 8));
    } break;
    default:
      log_invalid_choice_id(type_, "meas_results_s::meas_result_neigh_cells_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_results_s::meas_result_neigh_cells_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::meas_result_list_eutra:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<meas_result_list_eutra_l>(), bref, 1, 8));
      break;
    case types::meas_result_list_utra:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<meas_result_list_utra_l>(), bref, 1, 8));
      break;
    case types::meas_result_list_geran:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<meas_result_list_geran_l>(), bref, 1, 8));
      break;
    case types::meas_results_cdma2000:
      HANDLE_CODE(c.get<meas_results_cdma2000_s>().unpack(bref));
      break;
    case types::meas_result_neigh_cell_list_nr_r15: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_dyn_seq_of(c.get<meas_result_cell_list_nr_r15_l>(), bref, 1, 8));
    } break;
    default:
      log_invalid_choice_id(type_, "meas_results_s::meas_result_neigh_cells_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasurementReport-v8a0-IEs ::= SEQUENCE
SRSASN_CODE meas_report_v8a0_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 meas_report_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));
  }

  return SRSASN_SUCCESS;
}
void meas_report_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();
}

// ProximityIndication-v930-IEs ::= SEQUENCE
SRSASN_CODE proximity_ind_v930_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 proximity_ind_v930_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 proximity_ind_v930_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();
}

// RLF-Report-r9 ::= SEQUENCE
SRSASN_CODE rlf_report_r9_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(meas_result_neigh_cells_r9_present, 1));

  HANDLE_CODE(bref.pack(meas_result_last_serv_cell_r9.rsrq_result_r9_present, 1));
  HANDLE_CODE(pack_integer(bref, meas_result_last_serv_cell_r9.rsrp_result_r9, (uint8_t)0u, (uint8_t)97u));
  if (meas_result_last_serv_cell_r9.rsrq_result_r9_present) {
    HANDLE_CODE(pack_integer(bref, meas_result_last_serv_cell_r9.rsrq_result_r9, (uint8_t)0u, (uint8_t)34u));
  }
  if (meas_result_neigh_cells_r9_present) {
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r9.meas_result_list_eutra_r9_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r9.meas_result_list_utra_r9_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r9.meas_result_list_geran_r9_present, 1));
    HANDLE_CODE(bref.pack(meas_result_neigh_cells_r9.meas_results_cdma2000_r9_present, 1));
    if (meas_result_neigh_cells_r9.meas_result_list_eutra_r9_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r9.meas_result_list_eutra_r9, 1, 8));
    }
    if (meas_result_neigh_cells_r9.meas_result_list_utra_r9_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r9.meas_result_list_utra_r9, 1, 8));
    }
    if (meas_result_neigh_cells_r9.meas_result_list_geran_r9_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r9.meas_result_list_geran_r9, 1, 8));
    }
    if (meas_result_neigh_cells_r9.meas_results_cdma2000_r9_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_neigh_cells_r9.meas_results_cdma2000_r9, 1, 8));
    }
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= location_info_r10.is_present();
    group_flags[0] |= failed_pcell_id_r10.is_present();
    group_flags[0] |= reest_cell_id_r10.is_present();
    group_flags[0] |= time_conn_fail_r10_present;
    group_flags[0] |= conn_fail_type_r10_present;
    group_flags[0] |= prev_pcell_id_r10.is_present();
    group_flags[1] |= failed_pcell_id_v1090.is_present();
    group_flags[2] |= basic_fields_r11.is_present();
    group_flags[2] |= prev_utra_cell_id_r11.is_present();
    group_flags[2] |= sel_utra_cell_id_r11.is_present();
    group_flags[3] |= failed_pcell_id_v1250.is_present();
    group_flags[3] |= meas_result_last_serv_cell_v1250_present;
    group_flags[3] |= last_serv_cell_rsrq_type_r12.is_present();
    group_flags[3] |= meas_result_list_eutra_v1250.is_present();
    group_flags[4] |= drb_established_with_qci_minus1_r13_present;
    group_flags[5] |= meas_result_last_serv_cell_v1360_present;
    group_flags[6] |= log_meas_result_list_bt_r15.is_present();
    group_flags[6] |= log_meas_result_list_wlan_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(location_info_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(failed_pcell_id_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(reest_cell_id_r10.is_present(), 1));
      HANDLE_CODE(bref.pack(time_conn_fail_r10_present, 1));
      HANDLE_CODE(bref.pack(conn_fail_type_r10_present, 1));
      HANDLE_CODE(bref.pack(prev_pcell_id_r10.is_present(), 1));
      if (location_info_r10.is_present()) {
        HANDLE_CODE(location_info_r10->pack(bref));
      }
      if (failed_pcell_id_r10.is_present()) {
        HANDLE_CODE(failed_pcell_id_r10->pack(bref));
      }
      if (reest_cell_id_r10.is_present()) {
        HANDLE_CODE(reest_cell_id_r10->pack(bref));
      }
      if (time_conn_fail_r10_present) {
        HANDLE_CODE(pack_integer(bref, time_conn_fail_r10, (uint16_t)0u, (uint16_t)1023u));
      }
      if (conn_fail_type_r10_present) {
        HANDLE_CODE(conn_fail_type_r10.pack(bref));
      }
      if (prev_pcell_id_r10.is_present()) {
        HANDLE_CODE(prev_pcell_id_r10->pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(failed_pcell_id_v1090.is_present(), 1));
      if (failed_pcell_id_v1090.is_present()) {
        HANDLE_CODE(pack_integer(bref, failed_pcell_id_v1090->carrier_freq_v1090, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(basic_fields_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(prev_utra_cell_id_r11.is_present(), 1));
      HANDLE_CODE(bref.pack(sel_utra_cell_id_r11.is_present(), 1));
      if (basic_fields_r11.is_present()) {
        HANDLE_CODE(basic_fields_r11->c_rnti_r11.pack(bref));
        HANDLE_CODE(basic_fields_r11->rlf_cause_r11.pack(bref));
        HANDLE_CODE(pack_integer(bref, basic_fields_r11->time_since_fail_r11, (uint32_t)0u, (uint32_t)172800u));
      }
      if (prev_utra_cell_id_r11.is_present()) {
        HANDLE_CODE(bref.pack(prev_utra_cell_id_r11->cell_global_id_r11_present, 1));
        HANDLE_CODE(pack_integer(bref, prev_utra_cell_id_r11->carrier_freq_r11, (uint16_t)0u, (uint16_t)16383u));
        HANDLE_CODE(prev_utra_cell_id_r11->pci_r11.pack(bref));
        if (prev_utra_cell_id_r11->cell_global_id_r11_present) {
          HANDLE_CODE(prev_utra_cell_id_r11->cell_global_id_r11.pack(bref));
        }
      }
      if (sel_utra_cell_id_r11.is_present()) {
        HANDLE_CODE(pack_integer(bref, sel_utra_cell_id_r11->carrier_freq_r11, (uint16_t)0u, (uint16_t)16383u));
        HANDLE_CODE(sel_utra_cell_id_r11->pci_r11.pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(failed_pcell_id_v1250.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_last_serv_cell_v1250_present, 1));
      HANDLE_CODE(bref.pack(last_serv_cell_rsrq_type_r12.is_present(), 1));
      HANDLE_CODE(bref.pack(meas_result_list_eutra_v1250.is_present(), 1));
      if (failed_pcell_id_v1250.is_present()) {
        HANDLE_CODE(failed_pcell_id_v1250->tac_failed_pcell_r12.pack(bref));
      }
      if (meas_result_last_serv_cell_v1250_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_last_serv_cell_v1250, (int8_t)-30, (int8_t)46));
      }
      if (last_serv_cell_rsrq_type_r12.is_present()) {
        HANDLE_CODE(last_serv_cell_rsrq_type_r12->pack(bref));
      }
      if (meas_result_list_eutra_v1250.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *meas_result_list_eutra_v1250, 1, 8));
      }
    }
    if (group_flags[4]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(drb_established_with_qci_minus1_r13_present, 1));
    }
    if (group_flags[5]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(meas_result_last_serv_cell_v1360_present, 1));
      if (meas_result_last_serv_cell_v1360_present) {
        HANDLE_CODE(pack_integer(bref, meas_result_last_serv_cell_v1360, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[6]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(log_meas_result_list_bt_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(log_meas_result_list_wlan_r15.is_present(), 1));
      if (log_meas_result_list_bt_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *log_meas_result_list_bt_r15, 1, 32));
      }
      if (log_meas_result_list_wlan_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *log_meas_result_list_wlan_r15, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlf_report_r9_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r9_present, 1));

  HANDLE_CODE(bref.unpack(meas_result_last_serv_cell_r9.rsrq_result_r9_present, 1));
  HANDLE_CODE(unpack_integer(meas_result_last_serv_cell_r9.rsrp_result_r9, bref, (uint8_t)0u, (uint8_t)97u));
  if (meas_result_last_serv_cell_r9.rsrq_result_r9_present) {
    HANDLE_CODE(unpack_integer(meas_result_last_serv_cell_r9.rsrq_result_r9, bref, (uint8_t)0u, (uint8_t)34u));
  }
  if (meas_result_neigh_cells_r9_present) {
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r9.meas_result_list_eutra_r9_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r9.meas_result_list_utra_r9_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r9.meas_result_list_geran_r9_present, 1));
    HANDLE_CODE(bref.unpack(meas_result_neigh_cells_r9.meas_results_cdma2000_r9_present, 1));
    if (meas_result_neigh_cells_r9.meas_result_list_eutra_r9_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r9.meas_result_list_eutra_r9, bref, 1, 8));
    }
    if (meas_result_neigh_cells_r9.meas_result_list_utra_r9_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r9.meas_result_list_utra_r9, bref, 1, 8));
    }
    if (meas_result_neigh_cells_r9.meas_result_list_geran_r9_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r9.meas_result_list_geran_r9, bref, 1, 8));
    }
    if (meas_result_neigh_cells_r9.meas_results_cdma2000_r9_present) {
      HANDLE_CODE(unpack_dyn_seq_of(meas_result_neigh_cells_r9.meas_results_cdma2000_r9, bref, 1, 8));
    }
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(7);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool location_info_r10_present;
      HANDLE_CODE(bref.unpack(location_info_r10_present, 1));
      location_info_r10.set_present(location_info_r10_present);
      bool failed_pcell_id_r10_present;
      HANDLE_CODE(bref.unpack(failed_pcell_id_r10_present, 1));
      failed_pcell_id_r10.set_present(failed_pcell_id_r10_present);
      bool reest_cell_id_r10_present;
      HANDLE_CODE(bref.unpack(reest_cell_id_r10_present, 1));
      reest_cell_id_r10.set_present(reest_cell_id_r10_present);
      HANDLE_CODE(bref.unpack(time_conn_fail_r10_present, 1));
      HANDLE_CODE(bref.unpack(conn_fail_type_r10_present, 1));
      bool prev_pcell_id_r10_present;
      HANDLE_CODE(bref.unpack(prev_pcell_id_r10_present, 1));
      prev_pcell_id_r10.set_present(prev_pcell_id_r10_present);
      if (location_info_r10.is_present()) {
        HANDLE_CODE(location_info_r10->unpack(bref));
      }
      if (failed_pcell_id_r10.is_present()) {
        HANDLE_CODE(failed_pcell_id_r10->unpack(bref));
      }
      if (reest_cell_id_r10.is_present()) {
        HANDLE_CODE(reest_cell_id_r10->unpack(bref));
      }
      if (time_conn_fail_r10_present) {
        HANDLE_CODE(unpack_integer(time_conn_fail_r10, bref, (uint16_t)0u, (uint16_t)1023u));
      }
      if (conn_fail_type_r10_present) {
        HANDLE_CODE(conn_fail_type_r10.unpack(bref));
      }
      if (prev_pcell_id_r10.is_present()) {
        HANDLE_CODE(prev_pcell_id_r10->unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool failed_pcell_id_v1090_present;
      HANDLE_CODE(bref.unpack(failed_pcell_id_v1090_present, 1));
      failed_pcell_id_v1090.set_present(failed_pcell_id_v1090_present);
      if (failed_pcell_id_v1090.is_present()) {
        HANDLE_CODE(
            unpack_integer(failed_pcell_id_v1090->carrier_freq_v1090, bref, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool basic_fields_r11_present;
      HANDLE_CODE(bref.unpack(basic_fields_r11_present, 1));
      basic_fields_r11.set_present(basic_fields_r11_present);
      bool prev_utra_cell_id_r11_present;
      HANDLE_CODE(bref.unpack(prev_utra_cell_id_r11_present, 1));
      prev_utra_cell_id_r11.set_present(prev_utra_cell_id_r11_present);
      bool sel_utra_cell_id_r11_present;
      HANDLE_CODE(bref.unpack(sel_utra_cell_id_r11_present, 1));
      sel_utra_cell_id_r11.set_present(sel_utra_cell_id_r11_present);
      if (basic_fields_r11.is_present()) {
        HANDLE_CODE(basic_fields_r11->c_rnti_r11.unpack(bref));
        HANDLE_CODE(basic_fields_r11->rlf_cause_r11.unpack(bref));
        HANDLE_CODE(unpack_integer(basic_fields_r11->time_since_fail_r11, bref, (uint32_t)0u, (uint32_t)172800u));
      }
      if (prev_utra_cell_id_r11.is_present()) {
        HANDLE_CODE(bref.unpack(prev_utra_cell_id_r11->cell_global_id_r11_present, 1));
        HANDLE_CODE(unpack_integer(prev_utra_cell_id_r11->carrier_freq_r11, bref, (uint16_t)0u, (uint16_t)16383u));
        HANDLE_CODE(prev_utra_cell_id_r11->pci_r11.unpack(bref));
        if (prev_utra_cell_id_r11->cell_global_id_r11_present) {
          HANDLE_CODE(prev_utra_cell_id_r11->cell_global_id_r11.unpack(bref));
        }
      }
      if (sel_utra_cell_id_r11.is_present()) {
        HANDLE_CODE(unpack_integer(sel_utra_cell_id_r11->carrier_freq_r11, bref, (uint16_t)0u, (uint16_t)16383u));
        HANDLE_CODE(sel_utra_cell_id_r11->pci_r11.unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool failed_pcell_id_v1250_present;
      HANDLE_CODE(bref.unpack(failed_pcell_id_v1250_present, 1));
      failed_pcell_id_v1250.set_present(failed_pcell_id_v1250_present);
      HANDLE_CODE(bref.unpack(meas_result_last_serv_cell_v1250_present, 1));
      bool last_serv_cell_rsrq_type_r12_present;
      HANDLE_CODE(bref.unpack(last_serv_cell_rsrq_type_r12_present, 1));
      last_serv_cell_rsrq_type_r12.set_present(last_serv_cell_rsrq_type_r12_present);
      bool meas_result_list_eutra_v1250_present;
      HANDLE_CODE(bref.unpack(meas_result_list_eutra_v1250_present, 1));
      meas_result_list_eutra_v1250.set_present(meas_result_list_eutra_v1250_present);
      if (failed_pcell_id_v1250.is_present()) {
        HANDLE_CODE(failed_pcell_id_v1250->tac_failed_pcell_r12.unpack(bref));
      }
      if (meas_result_last_serv_cell_v1250_present) {
        HANDLE_CODE(unpack_integer(meas_result_last_serv_cell_v1250, bref, (int8_t)-30, (int8_t)46));
      }
      if (last_serv_cell_rsrq_type_r12.is_present()) {
        HANDLE_CODE(last_serv_cell_rsrq_type_r12->unpack(bref));
      }
      if (meas_result_list_eutra_v1250.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*meas_result_list_eutra_v1250, bref, 1, 8));
      }
    }
    if (group_flags[4]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(drb_established_with_qci_minus1_r13_present, 1));
    }
    if (group_flags[5]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(meas_result_last_serv_cell_v1360_present, 1));
      if (meas_result_last_serv_cell_v1360_present) {
        HANDLE_CODE(unpack_integer(meas_result_last_serv_cell_v1360, bref, (int8_t)-17, (int8_t)-1));
      }
    }
    if (group_flags[6]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool log_meas_result_list_bt_r15_present;
      HANDLE_CODE(bref.unpack(log_meas_result_list_bt_r15_present, 1));
      log_meas_result_list_bt_r15.set_present(log_meas_result_list_bt_r15_present);
      bool log_meas_result_list_wlan_r15_present;
      HANDLE_CODE(bref.unpack(log_meas_result_list_wlan_r15_present, 1));
      log_meas_result_list_wlan_r15.set_present(log_meas_result_list_wlan_r15_present);
      if (log_meas_result_list_bt_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*log_meas_result_list_bt_r15, bref, 1, 32));
      }
      if (log_meas_result_list_wlan_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*log_meas_result_list_wlan_r15, bref, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rlf_report_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("measResultLastServCell-r9");
  j.start_obj();
  j.write_int("rsrpResult-r9", meas_result_last_serv_cell_r9.rsrp_result_r9);
  if (meas_result_last_serv_cell_r9.rsrq_result_r9_present) {
    j.write_int("rsrqResult-r9", meas_result_last_serv_cell_r9.rsrq_result_r9);
  }
  j.end_obj();
  if (meas_result_neigh_cells_r9_present) {
    j.write_fieldname("measResultNeighCells-r9");
    j.start_obj();
    if (meas_result_neigh_cells_r9.meas_result_list_eutra_r9_present) {
      j.start_array("measResultListEUTRA-r9");
      for (const auto& e1 : meas_result_neigh_cells_r9.meas_result_list_eutra_r9) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r9.meas_result_list_utra_r9_present) {
      j.start_array("measResultListUTRA-r9");
      for (const auto& e1 : meas_result_neigh_cells_r9.meas_result_list_utra_r9) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r9.meas_result_list_geran_r9_present) {
      j.start_array("measResultListGERAN-r9");
      for (const auto& e1 : meas_result_neigh_cells_r9.meas_result_list_geran_r9) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (meas_result_neigh_cells_r9.meas_results_cdma2000_r9_present) {
      j.start_array("measResultsCDMA2000-r9");
      for (const auto& e1 : meas_result_neigh_cells_r9.meas_results_cdma2000_r9) {
        e1.to_json(j);
      }
      j.end_array();
    }
    j.end_obj();
  }
  if (ext) {
    if (location_info_r10.is_present()) {
      j.write_fieldname("locationInfo-r10");
      location_info_r10->to_json(j);
    }
    if (failed_pcell_id_r10.is_present()) {
      j.write_fieldname("failedPCellId-r10");
      failed_pcell_id_r10->to_json(j);
    }
    if (reest_cell_id_r10.is_present()) {
      j.write_fieldname("reestablishmentCellId-r10");
      reest_cell_id_r10->to_json(j);
    }
    if (time_conn_fail_r10_present) {
      j.write_int("timeConnFailure-r10", time_conn_fail_r10);
    }
    if (conn_fail_type_r10_present) {
      j.write_str("connectionFailureType-r10", conn_fail_type_r10.to_string());
    }
    if (prev_pcell_id_r10.is_present()) {
      j.write_fieldname("previousPCellId-r10");
      prev_pcell_id_r10->to_json(j);
    }
    if (failed_pcell_id_v1090.is_present()) {
      j.write_fieldname("failedPCellId-v1090");
      j.start_obj();
      j.write_int("carrierFreq-v1090", failed_pcell_id_v1090->carrier_freq_v1090);
      j.end_obj();
    }
    if (basic_fields_r11.is_present()) {
      j.write_fieldname("basicFields-r11");
      j.start_obj();
      j.write_str("c-RNTI-r11", basic_fields_r11->c_rnti_r11.to_string());
      j.write_str("rlf-Cause-r11", basic_fields_r11->rlf_cause_r11.to_string());
      j.write_int("timeSinceFailure-r11", basic_fields_r11->time_since_fail_r11);
      j.end_obj();
    }
    if (prev_utra_cell_id_r11.is_present()) {
      j.write_fieldname("previousUTRA-CellId-r11");
      j.start_obj();
      j.write_int("carrierFreq-r11", prev_utra_cell_id_r11->carrier_freq_r11);
      j.write_fieldname("physCellId-r11");
      prev_utra_cell_id_r11->pci_r11.to_json(j);
      if (prev_utra_cell_id_r11->cell_global_id_r11_present) {
        j.write_fieldname("cellGlobalId-r11");
        prev_utra_cell_id_r11->cell_global_id_r11.to_json(j);
      }
      j.end_obj();
    }
    if (sel_utra_cell_id_r11.is_present()) {
      j.write_fieldname("selectedUTRA-CellId-r11");
      j.start_obj();
      j.write_int("carrierFreq-r11", sel_utra_cell_id_r11->carrier_freq_r11);
      j.write_fieldname("physCellId-r11");
      sel_utra_cell_id_r11->pci_r11.to_json(j);
      j.end_obj();
    }
    if (failed_pcell_id_v1250.is_present()) {
      j.write_fieldname("failedPCellId-v1250");
      j.start_obj();
      j.write_str("tac-FailedPCell-r12", failed_pcell_id_v1250->tac_failed_pcell_r12.to_string());
      j.end_obj();
    }
    if (meas_result_last_serv_cell_v1250_present) {
      j.write_int("measResultLastServCell-v1250", meas_result_last_serv_cell_v1250);
    }
    if (last_serv_cell_rsrq_type_r12.is_present()) {
      j.write_fieldname("lastServCellRSRQ-Type-r12");
      last_serv_cell_rsrq_type_r12->to_json(j);
    }
    if (meas_result_list_eutra_v1250.is_present()) {
      j.start_array("measResultListEUTRA-v1250");
      for (const auto& e1 : *meas_result_list_eutra_v1250) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (drb_established_with_qci_minus1_r13_present) {
      j.write_str("drb-EstablishedWithQCI-1-r13", "qci1");
    }
    if (meas_result_last_serv_cell_v1360_present) {
      j.write_int("measResultLastServCell-v1360", meas_result_last_serv_cell_v1360);
    }
    if (log_meas_result_list_bt_r15.is_present()) {
      j.start_array("logMeasResultListBT-r15");
      for (const auto& e1 : *log_meas_result_list_bt_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (log_meas_result_list_wlan_r15.is_present()) {
      j.start_array("logMeasResultListWLAN-r15");
      for (const auto& e1 : *log_meas_result_list_wlan_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

void rlf_report_r9_s::failed_pcell_id_r10_c_::destroy_()
{
  switch (type_) {
    case types::cell_global_id_r10:
      c.destroy<cell_global_id_eutra_s>();
      break;
    case types::pci_arfcn_r10:
      c.destroy<pci_arfcn_r10_s_>();
      break;
    default:
      break;
  }
}
void rlf_report_r9_s::failed_pcell_id_r10_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::cell_global_id_r10:
      c.init<cell_global_id_eutra_s>();
      break;
    case types::pci_arfcn_r10:
      c.init<pci_arfcn_r10_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::failed_pcell_id_r10_c_");
  }
}
rlf_report_r9_s::failed_pcell_id_r10_c_::failed_pcell_id_r10_c_(const rlf_report_r9_s::failed_pcell_id_r10_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::cell_global_id_r10:
      c.init(other.c.get<cell_global_id_eutra_s>());
      break;
    case types::pci_arfcn_r10:
      c.init(other.c.get<pci_arfcn_r10_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::failed_pcell_id_r10_c_");
  }
}
rlf_report_r9_s::failed_pcell_id_r10_c_& rlf_report_r9_s::failed_pcell_id_r10_c_::
                                         operator=(const rlf_report_r9_s::failed_pcell_id_r10_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::cell_global_id_r10:
      c.set(other.c.get<cell_global_id_eutra_s>());
      break;
    case types::pci_arfcn_r10:
      c.set(other.c.get<pci_arfcn_r10_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::failed_pcell_id_r10_c_");
  }

  return *this;
}
void rlf_report_r9_s::failed_pcell_id_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::cell_global_id_r10:
      j.write_fieldname("cellGlobalId-r10");
      c.get<cell_global_id_eutra_s>().to_json(j);
      break;
    case types::pci_arfcn_r10:
      j.write_fieldname("pci-arfcn-r10");
      j.start_obj();
      j.write_int("physCellId-r10", c.get<pci_arfcn_r10_s_>().pci_r10);
      j.write_int("carrierFreq-r10", c.get<pci_arfcn_r10_s_>().carrier_freq_r10);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::failed_pcell_id_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE rlf_report_r9_s::failed_pcell_id_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::cell_global_id_r10:
      HANDLE_CODE(c.get<cell_global_id_eutra_s>().pack(bref));
      break;
    case types::pci_arfcn_r10:
      HANDLE_CODE(pack_integer(bref, c.get<pci_arfcn_r10_s_>().pci_r10, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(pack_integer(bref, c.get<pci_arfcn_r10_s_>().carrier_freq_r10, (uint32_t)0u, (uint32_t)65535u));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::failed_pcell_id_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlf_report_r9_s::failed_pcell_id_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::cell_global_id_r10:
      HANDLE_CODE(c.get<cell_global_id_eutra_s>().unpack(bref));
      break;
    case types::pci_arfcn_r10:
      HANDLE_CODE(unpack_integer(c.get<pci_arfcn_r10_s_>().pci_r10, bref, (uint16_t)0u, (uint16_t)503u));
      HANDLE_CODE(unpack_integer(c.get<pci_arfcn_r10_s_>().carrier_freq_r10, bref, (uint32_t)0u, (uint32_t)65535u));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::failed_pcell_id_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_::destroy_() {}
void rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_::pci_r11_c_(
    const rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::fdd_r11:
      c.init(other.c.get<uint16_t>());
      break;
    case types::tdd_r11:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_");
  }
}
rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_& rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_::
                                                       operator=(const rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::fdd_r11:
      c.set(other.c.get<uint16_t>());
      break;
    case types::tdd_r11:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_");
  }

  return *this;
}
void rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::fdd_r11:
      j.write_int("fdd-r11", c.get<uint16_t>());
      break;
    case types::tdd_r11:
      j.write_int("tdd-r11", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::fdd_r11:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::tdd_r11:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::fdd_r11:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::tdd_r11:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::prev_utra_cell_id_r11_s_::pci_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_::destroy_() {}
void rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_::pci_r11_c_(
    const rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::fdd_r11:
      c.init(other.c.get<uint16_t>());
      break;
    case types::tdd_r11:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_");
  }
}
rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_& rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_::
                                                      operator=(const rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::fdd_r11:
      c.set(other.c.get<uint16_t>());
      break;
    case types::tdd_r11:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_");
  }

  return *this;
}
void rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::fdd_r11:
      j.write_int("fdd-r11", c.get<uint16_t>());
      break;
    case types::tdd_r11:
      j.write_int("tdd-r11", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_");
  }
  j.end_obj();
}
SRSASN_CODE rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::fdd_r11:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::tdd_r11:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::fdd_r11:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::tdd_r11:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "rlf_report_r9_s::sel_utra_cell_id_r11_s_::pci_r11_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReconfigurationComplete-v8a0-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_complete_v8a0_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_complete_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_complete_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReestablishmentComplete-v920-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_complete_v920_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rlf_info_available_r9_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_complete_v920_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rlf_info_available_r9_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_complete_v920_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rlf_info_available_r9_present) {
    j.write_str("rlf-InfoAvailable-r9", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionResumeComplete-v1530-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_complete_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(log_meas_available_bt_r15_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_wlan_r15_present, 1));
  HANDLE_CODE(bref.pack(idle_meas_available_r15_present, 1));
  HANDLE_CODE(bref.pack(flight_path_info_available_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_complete_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(log_meas_available_bt_r15_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_wlan_r15_present, 1));
  HANDLE_CODE(bref.unpack(idle_meas_available_r15_present, 1));
  HANDLE_CODE(bref.unpack(flight_path_info_available_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  return SRSASN_SUCCESS;
}
void rrc_conn_resume_complete_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (log_meas_available_bt_r15_present) {
    j.write_str("logMeasAvailableBT-r15", "true");
  }
  if (log_meas_available_wlan_r15_present) {
    j.write_str("logMeasAvailableWLAN-r15", "true");
  }
  if (idle_meas_available_r15_present) {
    j.write_str("idleMeasAvailable-r15", "true");
  }
  if (flight_path_info_available_r15_present) {
    j.write_str("flightPathInfoAvailable-r15", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// RRCConnectionSetupComplete-v8a0-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_v8a0_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_setup_complete_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_complete_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RegisteredMME ::= SEQUENCE
SRSASN_CODE registered_mme_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(plmn_id_present, 1));

  if (plmn_id_present) {
    HANDLE_CODE(plmn_id.pack(bref));
  }
  HANDLE_CODE(mmegi.pack(bref));
  HANDLE_CODE(mmec.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE registered_mme_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(plmn_id_present, 1));

  if (plmn_id_present) {
    HANDLE_CODE(plmn_id.unpack(bref));
  }
  HANDLE_CODE(mmegi.unpack(bref));
  HANDLE_CODE(mmec.unpack(bref));

  return SRSASN_SUCCESS;
}
void registered_mme_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (plmn_id_present) {
    j.write_fieldname("plmn-Identity");
    plmn_id.to_json(j);
  }
  j.write_str("mmegi", mmegi.to_string());
  j.write_str("mmec", mmec.to_string());
  j.end_obj();
}

// SCGFailureInformation-v1310-IEs ::= SEQUENCE
SRSASN_CODE scg_fail_info_v1310_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 scg_fail_info_v1310_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 scg_fail_info_v1310_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();
}

// SecurityModeComplete-v8a0-IEs ::= SEQUENCE
SRSASN_CODE security_mode_complete_v8a0_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 security_mode_complete_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));
  }

  return SRSASN_SUCCESS;
}
void security_mode_complete_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();
}

// SecurityModeFailure-v8a0-IEs ::= SEQUENCE
SRSASN_CODE security_mode_fail_v8a0_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 security_mode_fail_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));
  }

  return SRSASN_SUCCESS;
}
void security_mode_fail_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();
}

// SidelinkUEInformation-v1310-IEs ::= SEQUENCE
SRSASN_CODE sidelink_ue_info_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(comm_tx_res_req_uc_r13_present, 1));
  HANDLE_CODE(bref.pack(comm_tx_res_info_req_relay_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_res_req_v1310_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_res_req_ps_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_rx_gap_req_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_gap_req_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_sys_info_report_freq_list_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (comm_tx_res_req_uc_r13_present) {
    HANDLE_CODE(comm_tx_res_req_uc_r13.pack(bref));
  }
  if (comm_tx_res_info_req_relay_r13_present) {
    HANDLE_CODE(bref.pack(comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_r13_present, 1));
    HANDLE_CODE(bref.pack(comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_uc_r13_present, 1));
    if (comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_r13_present) {
      HANDLE_CODE(comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_r13.pack(bref));
    }
    if (comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_uc_r13_present) {
      HANDLE_CODE(comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_uc_r13.pack(bref));
    }
    HANDLE_CODE(comm_tx_res_info_req_relay_r13.ue_type_r13.pack(bref));
  }
  if (disc_tx_res_req_v1310_present) {
    HANDLE_CODE(bref.pack(disc_tx_res_req_v1310.carrier_freq_disc_tx_r13_present, 1));
    HANDLE_CODE(bref.pack(disc_tx_res_req_v1310.disc_tx_res_req_add_freq_r13_present, 1));
    if (disc_tx_res_req_v1310.carrier_freq_disc_tx_r13_present) {
      HANDLE_CODE(pack_integer(bref, disc_tx_res_req_v1310.carrier_freq_disc_tx_r13, (uint8_t)1u, (uint8_t)8u));
    }
    if (disc_tx_res_req_v1310.disc_tx_res_req_add_freq_r13_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, disc_tx_res_req_v1310.disc_tx_res_req_add_freq_r13, 1, 8));
    }
  }
  if (disc_tx_res_req_ps_r13_present) {
    HANDLE_CODE(disc_tx_res_req_ps_r13.pack(bref));
  }
  if (disc_rx_gap_req_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_rx_gap_req_r13, 1, 8));
  }
  if (disc_tx_gap_req_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_tx_gap_req_r13, 1, 8));
  }
  if (disc_sys_info_report_freq_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_sys_info_report_freq_list_r13, 1, 8));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sidelink_ue_info_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(comm_tx_res_req_uc_r13_present, 1));
  HANDLE_CODE(bref.unpack(comm_tx_res_info_req_relay_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_res_req_v1310_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_res_req_ps_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_rx_gap_req_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_gap_req_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_sys_info_report_freq_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (comm_tx_res_req_uc_r13_present) {
    HANDLE_CODE(comm_tx_res_req_uc_r13.unpack(bref));
  }
  if (comm_tx_res_info_req_relay_r13_present) {
    HANDLE_CODE(bref.unpack(comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_r13_present, 1));
    HANDLE_CODE(bref.unpack(comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_uc_r13_present, 1));
    if (comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_r13_present) {
      HANDLE_CODE(comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_r13.unpack(bref));
    }
    if (comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_uc_r13_present) {
      HANDLE_CODE(comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_uc_r13.unpack(bref));
    }
    HANDLE_CODE(comm_tx_res_info_req_relay_r13.ue_type_r13.unpack(bref));
  }
  if (disc_tx_res_req_v1310_present) {
    HANDLE_CODE(bref.unpack(disc_tx_res_req_v1310.carrier_freq_disc_tx_r13_present, 1));
    HANDLE_CODE(bref.unpack(disc_tx_res_req_v1310.disc_tx_res_req_add_freq_r13_present, 1));
    if (disc_tx_res_req_v1310.carrier_freq_disc_tx_r13_present) {
      HANDLE_CODE(unpack_integer(disc_tx_res_req_v1310.carrier_freq_disc_tx_r13, bref, (uint8_t)1u, (uint8_t)8u));
    }
    if (disc_tx_res_req_v1310.disc_tx_res_req_add_freq_r13_present) {
      HANDLE_CODE(unpack_dyn_seq_of(disc_tx_res_req_v1310.disc_tx_res_req_add_freq_r13, bref, 1, 8));
    }
  }
  if (disc_tx_res_req_ps_r13_present) {
    HANDLE_CODE(disc_tx_res_req_ps_r13.unpack(bref));
  }
  if (disc_rx_gap_req_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_rx_gap_req_r13, bref, 1, 8));
  }
  if (disc_tx_gap_req_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_tx_gap_req_r13, bref, 1, 8));
  }
  if (disc_sys_info_report_freq_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_sys_info_report_freq_list_r13, bref, 1, 8));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sidelink_ue_info_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (comm_tx_res_req_uc_r13_present) {
    j.write_fieldname("commTxResourceReqUC-r13");
    comm_tx_res_req_uc_r13.to_json(j);
  }
  if (comm_tx_res_info_req_relay_r13_present) {
    j.write_fieldname("commTxResourceInfoReqRelay-r13");
    j.start_obj();
    if (comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_r13_present) {
      j.write_fieldname("commTxResourceReqRelay-r13");
      comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_r13.to_json(j);
    }
    if (comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_uc_r13_present) {
      j.write_fieldname("commTxResourceReqRelayUC-r13");
      comm_tx_res_info_req_relay_r13.comm_tx_res_req_relay_uc_r13.to_json(j);
    }
    j.write_str("ue-Type-r13", comm_tx_res_info_req_relay_r13.ue_type_r13.to_string());
    j.end_obj();
  }
  if (disc_tx_res_req_v1310_present) {
    j.write_fieldname("discTxResourceReq-v1310");
    j.start_obj();
    if (disc_tx_res_req_v1310.carrier_freq_disc_tx_r13_present) {
      j.write_int("carrierFreqDiscTx-r13", disc_tx_res_req_v1310.carrier_freq_disc_tx_r13);
    }
    if (disc_tx_res_req_v1310.disc_tx_res_req_add_freq_r13_present) {
      j.start_array("discTxResourceReqAddFreq-r13");
      for (const auto& e1 : disc_tx_res_req_v1310.disc_tx_res_req_add_freq_r13) {
        e1.to_json(j);
      }
      j.end_array();
    }
    j.end_obj();
  }
  if (disc_tx_res_req_ps_r13_present) {
    j.write_fieldname("discTxResourceReqPS-r13");
    disc_tx_res_req_ps_r13.to_json(j);
  }
  if (disc_rx_gap_req_r13_present) {
    j.start_array("discRxGapReq-r13");
    for (const auto& e1 : disc_rx_gap_req_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_tx_gap_req_r13_present) {
    j.start_array("discTxGapReq-r13");
    for (const auto& e1 : disc_tx_gap_req_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_sys_info_report_freq_list_r13_present) {
    j.start_array("discSysInfoReportFreqList-r13");
    for (const auto& e1 : disc_sys_info_report_freq_list_r13) {
      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();
}

// TDM-AssistanceInfo-r11 ::= CHOICE
void tdm_assist_info_r11_c::destroy_()
{
  switch (type_) {
    case types::drx_assist_info_r11:
      c.destroy<drx_assist_info_r11_s_>();
      break;
    case types::idc_sf_pattern_list_r11:
      c.destroy<idc_sf_pattern_list_r11_l>();
      break;
    default:
      break;
  }
}
void tdm_assist_info_r11_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::drx_assist_info_r11:
      c.init<drx_assist_info_r11_s_>();
      break;
    case types::idc_sf_pattern_list_r11:
      c.init<idc_sf_pattern_list_r11_l>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "tdm_assist_info_r11_c");
  }
}
tdm_assist_info_r11_c::tdm_assist_info_r11_c(const tdm_assist_info_r11_c& other)
{
  type_ = other.type();
  switch (type_) {
    case types::drx_assist_info_r11:
      c.init(other.c.get<drx_assist_info_r11_s_>());
      break;
    case types::idc_sf_pattern_list_r11:
      c.init(other.c.get<idc_sf_pattern_list_r11_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "tdm_assist_info_r11_c");
  }
}
tdm_assist_info_r11_c& tdm_assist_info_r11_c::operator=(const tdm_assist_info_r11_c& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::drx_assist_info_r11:
      c.set(other.c.get<drx_assist_info_r11_s_>());
      break;
    case types::idc_sf_pattern_list_r11:
      c.set(other.c.get<idc_sf_pattern_list_r11_l>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "tdm_assist_info_r11_c");
  }

  return *this;
}
void tdm_assist_info_r11_c::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::drx_assist_info_r11:
      j.write_fieldname("drx-AssistanceInfo-r11");
      j.start_obj();
      j.write_str("drx-CycleLength-r11", c.get<drx_assist_info_r11_s_>().drx_cycle_len_r11.to_string());
      if (c.get<drx_assist_info_r11_s_>().drx_offset_r11_present) {
        j.write_int("drx-Offset-r11", c.get<drx_assist_info_r11_s_>().drx_offset_r11);
      }
      j.write_str("drx-ActiveTime-r11", c.get<drx_assist_info_r11_s_>().drx_active_time_r11.to_string());
      j.end_obj();
      break;
    case types::idc_sf_pattern_list_r11:
      j.start_array("idc-SubframePatternList-r11");
      for (const auto& e1 : c.get<idc_sf_pattern_list_r11_l>()) {
        e1.to_json(j);
      }
      j.end_array();
      break;
    default:
      log_invalid_choice_id(type_, "tdm_assist_info_r11_c");
  }
  j.end_obj();
}
SRSASN_CODE tdm_assist_info_r11_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::drx_assist_info_r11:
      HANDLE_CODE(bref.pack(c.get<drx_assist_info_r11_s_>().drx_offset_r11_present, 1));
      HANDLE_CODE(c.get<drx_assist_info_r11_s_>().drx_cycle_len_r11.pack(bref));
      if (c.get<drx_assist_info_r11_s_>().drx_offset_r11_present) {
        HANDLE_CODE(pack_integer(bref, c.get<drx_assist_info_r11_s_>().drx_offset_r11, (uint16_t)0u, (uint16_t)255u));
      }
      HANDLE_CODE(c.get<drx_assist_info_r11_s_>().drx_active_time_r11.pack(bref));
      break;
    case types::idc_sf_pattern_list_r11:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.get<idc_sf_pattern_list_r11_l>(), 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "tdm_assist_info_r11_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE tdm_assist_info_r11_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::drx_assist_info_r11:
      HANDLE_CODE(bref.unpack(c.get<drx_assist_info_r11_s_>().drx_offset_r11_present, 1));
      HANDLE_CODE(c.get<drx_assist_info_r11_s_>().drx_cycle_len_r11.unpack(bref));
      if (c.get<drx_assist_info_r11_s_>().drx_offset_r11_present) {
        HANDLE_CODE(unpack_integer(c.get<drx_assist_info_r11_s_>().drx_offset_r11, bref, (uint16_t)0u, (uint16_t)255u));
      }
      HANDLE_CODE(c.get<drx_assist_info_r11_s_>().drx_active_time_r11.unpack(bref));
      break;
    case types::idc_sf_pattern_list_r11:
      HANDLE_CODE(unpack_dyn_seq_of(c.get<idc_sf_pattern_list_r11_l>(), bref, 1, 8));
      break;
    default:
      log_invalid_choice_id(type_, "tdm_assist_info_r11_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UEAssistanceInformation-v1430-IEs ::= SEQUENCE
SRSASN_CODE ueassist_info_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(bw_pref_r14_present, 1));
  HANDLE_CODE(bref.pack(sps_assist_info_r14_present, 1));
  HANDLE_CODE(bref.pack(rlm_report_r14_present, 1));
  HANDLE_CODE(bref.pack(delay_budget_report_r14_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (bw_pref_r14_present) {
    HANDLE_CODE(bw_pref_r14.pack(bref));
  }
  if (sps_assist_info_r14_present) {
    HANDLE_CODE(bref.pack(sps_assist_info_r14.traffic_pattern_info_list_sl_r14_present, 1));
    HANDLE_CODE(bref.pack(sps_assist_info_r14.traffic_pattern_info_list_ul_r14_present, 1));
    if (sps_assist_info_r14.traffic_pattern_info_list_sl_r14_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, sps_assist_info_r14.traffic_pattern_info_list_sl_r14, 1, 8));
    }
    if (sps_assist_info_r14.traffic_pattern_info_list_ul_r14_present) {
      HANDLE_CODE(pack_dyn_seq_of(bref, sps_assist_info_r14.traffic_pattern_info_list_ul_r14, 1, 8));
    }
  }
  if (rlm_report_r14_present) {
    HANDLE_CODE(bref.pack(rlm_report_r14.excess_rep_mpdcch_r14_present, 1));
    HANDLE_CODE(rlm_report_r14.rlm_event_r14.pack(bref));
    if (rlm_report_r14.excess_rep_mpdcch_r14_present) {
      HANDLE_CODE(rlm_report_r14.excess_rep_mpdcch_r14.pack(bref));
    }
  }
  if (delay_budget_report_r14_present) {
    HANDLE_CODE(delay_budget_report_r14.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ueassist_info_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(bw_pref_r14_present, 1));
  HANDLE_CODE(bref.unpack(sps_assist_info_r14_present, 1));
  HANDLE_CODE(bref.unpack(rlm_report_r14_present, 1));
  HANDLE_CODE(bref.unpack(delay_budget_report_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (bw_pref_r14_present) {
    HANDLE_CODE(bw_pref_r14.unpack(bref));
  }
  if (sps_assist_info_r14_present) {
    HANDLE_CODE(bref.unpack(sps_assist_info_r14.traffic_pattern_info_list_sl_r14_present, 1));
    HANDLE_CODE(bref.unpack(sps_assist_info_r14.traffic_pattern_info_list_ul_r14_present, 1));
    if (sps_assist_info_r14.traffic_pattern_info_list_sl_r14_present) {
      HANDLE_CODE(unpack_dyn_seq_of(sps_assist_info_r14.traffic_pattern_info_list_sl_r14, bref, 1, 8));
    }
    if (sps_assist_info_r14.traffic_pattern_info_list_ul_r14_present) {
      HANDLE_CODE(unpack_dyn_seq_of(sps_assist_info_r14.traffic_pattern_info_list_ul_r14, bref, 1, 8));
    }
  }
  if (rlm_report_r14_present) {
    HANDLE_CODE(bref.unpack(rlm_report_r14.excess_rep_mpdcch_r14_present, 1));
    HANDLE_CODE(rlm_report_r14.rlm_event_r14.unpack(bref));
    if (rlm_report_r14.excess_rep_mpdcch_r14_present) {
      HANDLE_CODE(rlm_report_r14.excess_rep_mpdcch_r14.unpack(bref));
    }
  }
  if (delay_budget_report_r14_present) {
    HANDLE_CODE(delay_budget_report_r14.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ueassist_info_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (bw_pref_r14_present) {
    j.write_fieldname("bw-Preference-r14");
    bw_pref_r14.to_json(j);
  }
  if (sps_assist_info_r14_present) {
    j.write_fieldname("sps-AssistanceInformation-r14");
    j.start_obj();
    if (sps_assist_info_r14.traffic_pattern_info_list_sl_r14_present) {
      j.start_array("trafficPatternInfoListSL-r14");
      for (const auto& e1 : sps_assist_info_r14.traffic_pattern_info_list_sl_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (sps_assist_info_r14.traffic_pattern_info_list_ul_r14_present) {
      j.start_array("trafficPatternInfoListUL-r14");
      for (const auto& e1 : sps_assist_info_r14.traffic_pattern_info_list_ul_r14) {
        e1.to_json(j);
      }
      j.end_array();
    }
    j.end_obj();
  }
  if (rlm_report_r14_present) {
    j.write_fieldname("rlm-Report-r14");
    j.start_obj();
    j.write_str("rlm-Event-r14", rlm_report_r14.rlm_event_r14.to_string());
    if (rlm_report_r14.excess_rep_mpdcch_r14_present) {
      j.write_str("excessRep-MPDCCH-r14", rlm_report_r14.excess_rep_mpdcch_r14.to_string());
    }
    j.end_obj();
  }
  if (delay_budget_report_r14_present) {
    j.write_fieldname("delayBudgetReport-r14");
    delay_budget_report_r14.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UECapabilityInformation-v8a0-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_info_v8a0_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_cap_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 (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UEInformationResponse-v930-IEs ::= SEQUENCE
SRSASN_CODE ue_info_resp_v930_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_info_resp_v930_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_info_resp_v930_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();
}

// ULHandoverPreparationTransfer-v8a0-IEs ::= SEQUENCE
SRSASN_CODE ul_ho_prep_transfer_v8a0_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 ul_ho_prep_transfer_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));
  }

  return SRSASN_SUCCESS;
}
void ul_ho_prep_transfer_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();
}

// ULInformationTransfer-v8a0-IEs ::= SEQUENCE
SRSASN_CODE ul_info_transfer_v8a0_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 ul_info_transfer_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));
  }

  return SRSASN_SUCCESS;
}
void ul_info_transfer_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();
}

// WLANConnectionStatusReport-v1430-IEs ::= SEQUENCE
SRSASN_CODE wlan_conn_status_report_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(wlan_status_v1430.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_conn_status_report_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(wlan_status_v1430.unpack(bref));

  return SRSASN_SUCCESS;
}
void wlan_conn_status_report_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("wlan-Status-v1430", wlan_status_v1430.to_string());
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// CSFBParametersRequestCDMA2000-r8-IEs ::= SEQUENCE
SRSASN_CODE csfb_params_request_cdma2000_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE csfb_params_request_cdma2000_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void csfb_params_request_cdma2000_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// CounterCheckResponse-r8-IEs ::= SEQUENCE
SRSASN_CODE counter_check_resp_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, drb_count_info_list, 0, 11));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE counter_check_resp_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(drb_count_info_list, bref, 0, 11));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void counter_check_resp_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("drb-CountInfoList");
  for (const auto& e1 : drb_count_info_list) {
    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();
}

// FailedLogicalChannelInfo-r15 ::= SEQUENCE
SRSASN_CODE failed_lc_ch_info_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(failed_lc_ch_id_r15.lc_ch_id_r15_present, 1));
  HANDLE_CODE(bref.pack(failed_lc_ch_id_r15.lc_ch_id_ext_r15_present, 1));
  HANDLE_CODE(failed_lc_ch_id_r15.cell_group_ind_r15.pack(bref));
  if (failed_lc_ch_id_r15.lc_ch_id_r15_present) {
    HANDLE_CODE(pack_integer(bref, failed_lc_ch_id_r15.lc_ch_id_r15, (uint8_t)1u, (uint8_t)10u));
  }
  if (failed_lc_ch_id_r15.lc_ch_id_ext_r15_present) {
    HANDLE_CODE(pack_integer(bref, failed_lc_ch_id_r15.lc_ch_id_ext_r15, (uint8_t)32u, (uint8_t)38u));
  }
  HANDLE_CODE(fail_type.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE failed_lc_ch_info_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(failed_lc_ch_id_r15.lc_ch_id_r15_present, 1));
  HANDLE_CODE(bref.unpack(failed_lc_ch_id_r15.lc_ch_id_ext_r15_present, 1));
  HANDLE_CODE(failed_lc_ch_id_r15.cell_group_ind_r15.unpack(bref));
  if (failed_lc_ch_id_r15.lc_ch_id_r15_present) {
    HANDLE_CODE(unpack_integer(failed_lc_ch_id_r15.lc_ch_id_r15, bref, (uint8_t)1u, (uint8_t)10u));
  }
  if (failed_lc_ch_id_r15.lc_ch_id_ext_r15_present) {
    HANDLE_CODE(unpack_integer(failed_lc_ch_id_r15.lc_ch_id_ext_r15, bref, (uint8_t)32u, (uint8_t)38u));
  }
  HANDLE_CODE(fail_type.unpack(bref));

  return SRSASN_SUCCESS;
}
void failed_lc_ch_info_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("failedLogicalChannelIdentity-r15");
  j.start_obj();
  j.write_str("cellGroupIndication-r15", failed_lc_ch_id_r15.cell_group_ind_r15.to_string());
  if (failed_lc_ch_id_r15.lc_ch_id_r15_present) {
    j.write_int("logicalChannelIdentity-r15", failed_lc_ch_id_r15.lc_ch_id_r15);
  }
  if (failed_lc_ch_id_r15.lc_ch_id_ext_r15_present) {
    j.write_int("logicalChannelIdentityExt-r15", failed_lc_ch_id_r15.lc_ch_id_ext_r15);
  }
  j.end_obj();
  j.write_str("failureType", fail_type.to_string());
  j.end_obj();
}

// InDeviceCoexIndication-r11-IEs ::= SEQUENCE
SRSASN_CODE in_dev_coex_ind_r11_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(affected_carrier_freq_list_r11_present, 1));
  HANDLE_CODE(bref.pack(tdm_assist_info_r11_present, 1));
  HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (affected_carrier_freq_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, affected_carrier_freq_list_r11, 1, 32));
  }
  if (tdm_assist_info_r11_present) {
    HANDLE_CODE(tdm_assist_info_r11.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 in_dev_coex_ind_r11_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(affected_carrier_freq_list_r11_present, 1));
  HANDLE_CODE(bref.unpack(tdm_assist_info_r11_present, 1));
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (affected_carrier_freq_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(affected_carrier_freq_list_r11, bref, 1, 32));
  }
  if (tdm_assist_info_r11_present) {
    HANDLE_CODE(tdm_assist_info_r11.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 in_dev_coex_ind_r11_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (affected_carrier_freq_list_r11_present) {
    j.start_array("affectedCarrierFreqList-r11");
    for (const auto& e1 : affected_carrier_freq_list_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (tdm_assist_info_r11_present) {
    j.write_fieldname("tdm-AssistanceInfo-r11");
    tdm_assist_info_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");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// InterFreqRSTDMeasurementIndication-r10-IEs ::= SEQUENCE
SRSASN_CODE inter_freq_rstd_meas_ind_r10_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(rstd_inter_freq_ind_r10.pack(bref));
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_rstd_meas_ind_r10_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(rstd_inter_freq_ind_r10.unpack(bref));
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void inter_freq_rstd_meas_ind_r10_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("rstd-InterFreqIndication-r10");
  rstd_inter_freq_ind_r10.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();
}

void inter_freq_rstd_meas_ind_r10_ies_s::rstd_inter_freq_ind_r10_c_::set(types::options e)
{
  type_ = e;
}
void inter_freq_rstd_meas_ind_r10_ies_s::rstd_inter_freq_ind_r10_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::start:
      j.write_fieldname("start");
      j.start_obj();
      j.start_array("rstd-InterFreqInfoList-r10");
      for (const auto& e1 : c.rstd_inter_freq_info_list_r10) {
        e1.to_json(j);
      }
      j.end_array();
      j.end_obj();
      break;
    case types::stop:
      break;
    default:
      log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_ies_s::rstd_inter_freq_ind_r10_c_");
  }
  j.end_obj();
}
SRSASN_CODE inter_freq_rstd_meas_ind_r10_ies_s::rstd_inter_freq_ind_r10_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::start:
      HANDLE_CODE(pack_dyn_seq_of(bref, c.rstd_inter_freq_info_list_r10, 1, 3));
      break;
    case types::stop:
      break;
    default:
      log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_ies_s::rstd_inter_freq_ind_r10_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_rstd_meas_ind_r10_ies_s::rstd_inter_freq_ind_r10_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::start:
      HANDLE_CODE(unpack_dyn_seq_of(c.rstd_inter_freq_info_list_r10, bref, 1, 3));
      break;
    case types::stop:
      break;
    default:
      log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_ies_s::rstd_inter_freq_ind_r10_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MBMSCountingResponse-r10-IEs ::= SEQUENCE
SRSASN_CODE mbms_count_resp_r10_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mbsfn_area_idx_r10_present, 1));
  HANDLE_CODE(bref.pack(count_resp_list_r10_present, 1));
  HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (mbsfn_area_idx_r10_present) {
    HANDLE_CODE(pack_integer(bref, mbsfn_area_idx_r10, (uint8_t)0u, (uint8_t)7u));
  }
  if (count_resp_list_r10_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, count_resp_list_r10, 1, 16));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_count_resp_r10_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mbsfn_area_idx_r10_present, 1));
  HANDLE_CODE(bref.unpack(count_resp_list_r10_present, 1));
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (mbsfn_area_idx_r10_present) {
    HANDLE_CODE(unpack_integer(mbsfn_area_idx_r10, bref, (uint8_t)0u, (uint8_t)7u));
  }
  if (count_resp_list_r10_present) {
    HANDLE_CODE(unpack_dyn_seq_of(count_resp_list_r10, bref, 1, 16));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mbms_count_resp_r10_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mbsfn_area_idx_r10_present) {
    j.write_int("mbsfn-AreaIndex-r10", mbsfn_area_idx_r10);
  }
  if (count_resp_list_r10_present) {
    j.start_array("countingResponseList-r10");
    for (const auto& e1 : count_resp_list_r10) {
      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();
}

// MBMSInterestIndication-r11-IEs ::= SEQUENCE
SRSASN_CODE mbms_interest_ind_r11_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mbms_freq_list_r11_present, 1));
  HANDLE_CODE(bref.pack(mbms_prio_r11_present, 1));
  HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (mbms_freq_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mbms_freq_list_r11, 1, 5, integer_packer<uint32_t>(0, 262143)));
  }
  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 mbms_interest_ind_r11_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mbms_freq_list_r11_present, 1));
  HANDLE_CODE(bref.unpack(mbms_prio_r11_present, 1));
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (mbms_freq_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mbms_freq_list_r11, bref, 1, 5, integer_packer<uint32_t>(0, 262143)));
  }
  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 mbms_interest_ind_r11_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mbms_freq_list_r11_present) {
    j.start_array("mbms-FreqList-r11");
    for (const auto& e1 : mbms_freq_list_r11) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (mbms_prio_r11_present) {
    j.write_str("mbms-Priority-r11", "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();
}

// MeasReportAppLayer-r15-IEs ::= SEQUENCE
SRSASN_CODE meas_report_app_layer_r15_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_report_app_layer_container_r15_present, 1));
  HANDLE_CODE(bref.pack(service_type_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (meas_report_app_layer_container_r15_present) {
    HANDLE_CODE(meas_report_app_layer_container_r15.pack(bref));
  }
  if (service_type_present) {
    HANDLE_CODE(service_type.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_report_app_layer_r15_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_report_app_layer_container_r15_present, 1));
  HANDLE_CODE(bref.unpack(service_type_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (meas_report_app_layer_container_r15_present) {
    HANDLE_CODE(meas_report_app_layer_container_r15.unpack(bref));
  }
  if (service_type_present) {
    HANDLE_CODE(service_type.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_report_app_layer_r15_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_report_app_layer_container_r15_present) {
    j.write_str("measReportAppLayerContainer-r15", meas_report_app_layer_container_r15.to_string());
  }
  if (service_type_present) {
    j.write_str("serviceType", service_type.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// MeasurementReport-r8-IEs ::= SEQUENCE
SRSASN_CODE meas_report_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(meas_results.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_report_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(meas_results.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_report_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("measResults");
  meas_results.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// ProximityIndication-r9-IEs ::= SEQUENCE
SRSASN_CODE proximity_ind_r9_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(type_r9.pack(bref));
  HANDLE_CODE(carrier_freq_r9.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE proximity_ind_r9_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(type_r9.unpack(bref));
  HANDLE_CODE(carrier_freq_r9.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void proximity_ind_r9_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("type-r9", type_r9.to_string());
  j.write_fieldname("carrierFreq-r9");
  carrier_freq_r9.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void proximity_ind_r9_ies_s::carrier_freq_r9_c_::destroy_() {}
void proximity_ind_r9_ies_s::carrier_freq_r9_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
proximity_ind_r9_ies_s::carrier_freq_r9_c_::carrier_freq_r9_c_(const proximity_ind_r9_ies_s::carrier_freq_r9_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::eutra_r9:
      c.init(other.c.get<uint32_t>());
      break;
    case types::utra_r9:
      c.init(other.c.get<uint16_t>());
      break;
    case types::eutra2_v9e0:
      c.init(other.c.get<uint32_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_ies_s::carrier_freq_r9_c_");
  }
}
proximity_ind_r9_ies_s::carrier_freq_r9_c_& proximity_ind_r9_ies_s::carrier_freq_r9_c_::
                                            operator=(const proximity_ind_r9_ies_s::carrier_freq_r9_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::eutra_r9:
      c.set(other.c.get<uint32_t>());
      break;
    case types::utra_r9:
      c.set(other.c.get<uint16_t>());
      break;
    case types::eutra2_v9e0:
      c.set(other.c.get<uint32_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_ies_s::carrier_freq_r9_c_");
  }

  return *this;
}
void proximity_ind_r9_ies_s::carrier_freq_r9_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::eutra_r9:
      j.write_int("eutra-r9", c.get<uint32_t>());
      break;
    case types::utra_r9:
      j.write_int("utra-r9", c.get<uint16_t>());
      break;
    case types::eutra2_v9e0:
      j.write_int("eutra2-v9e0", c.get<uint32_t>());
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_ies_s::carrier_freq_r9_c_");
  }
  j.end_obj();
}
SRSASN_CODE proximity_ind_r9_ies_s::carrier_freq_r9_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::eutra_r9:
      HANDLE_CODE(pack_integer(bref, c.get<uint32_t>(), (uint32_t)0u, (uint32_t)65535u));
      break;
    case types::utra_r9:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)16383u));
      break;
    case types::eutra2_v9e0: {
      varlength_field_pack_guard varlen_scope(bref, false);
      HANDLE_CODE(pack_integer(bref, c.get<uint32_t>(), (uint32_t)65536u, (uint32_t)262143u));
    } break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_ies_s::carrier_freq_r9_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE proximity_ind_r9_ies_s::carrier_freq_r9_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::eutra_r9:
      HANDLE_CODE(unpack_integer(c.get<uint32_t>(), bref, (uint32_t)0u, (uint32_t)65535u));
      break;
    case types::utra_r9:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)16383u));
      break;
    case types::eutra2_v9e0: {
      varlength_field_unpack_guard varlen_scope(bref, false);
      HANDLE_CODE(unpack_integer(c.get<uint32_t>(), bref, (uint32_t)65536u, (uint32_t)262143u));
    } break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_ies_s::carrier_freq_r9_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RNReconfigurationComplete-r10-IEs ::= SEQUENCE
SRSASN_CODE rn_recfg_complete_r10_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 rn_recfg_complete_r10_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 rn_recfg_complete_r10_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();
}

// RRCConnectionReconfigurationComplete-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_complete_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_complete_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_recfg_complete_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionReestablishmentComplete-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_complete_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_complete_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_reest_complete_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRCConnectionResumeComplete-r13-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_complete_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(rlf_info_available_r13_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_r13_present, 1));
  HANDLE_CODE(bref.pack(conn_est_fail_info_available_r13_present, 1));
  HANDLE_CODE(bref.pack(mob_state_r13_present, 1));
  HANDLE_CODE(bref.pack(mob_history_avail_r13_present, 1));
  HANDLE_CODE(bref.pack(log_meas_available_mbsfn_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 (mob_state_r13_present) {
    HANDLE_CODE(mob_state_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_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(rlf_info_available_r13_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_r13_present, 1));
  HANDLE_CODE(bref.unpack(conn_est_fail_info_available_r13_present, 1));
  HANDLE_CODE(bref.unpack(mob_state_r13_present, 1));
  HANDLE_CODE(bref.unpack(mob_history_avail_r13_present, 1));
  HANDLE_CODE(bref.unpack(log_meas_available_mbsfn_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 (mob_state_r13_present) {
    HANDLE_CODE(mob_state_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_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 (rlf_info_available_r13_present) {
    j.write_str("rlf-InfoAvailable-r13", "true");
  }
  if (log_meas_available_r13_present) {
    j.write_str("logMeasAvailable-r13", "true");
  }
  if (conn_est_fail_info_available_r13_present) {
    j.write_str("connEstFailInfoAvailable-r13", "true");
  }
  if (mob_state_r13_present) {
    j.write_str("mobilityState-r13", mob_state_r13.to_string());
  }
  if (mob_history_avail_r13_present) {
    j.write_str("mobilityHistoryAvail-r13", "true");
  }
  if (log_meas_available_mbsfn_r13_present) {
    j.write_str("logMeasAvailableMBSFN-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-r8-IEs ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(registered_mme_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pack_integer(bref, sel_plmn_id, (uint8_t)1u, (uint8_t)6u));
  if (registered_mme_present) {
    HANDLE_CODE(registered_mme.pack(bref));
  }
  HANDLE_CODE(ded_info_nas.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(registered_mme_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_integer(sel_plmn_id, bref, (uint8_t)1u, (uint8_t)6u));
  if (registered_mme_present) {
    HANDLE_CODE(registered_mme.unpack(bref));
  }
  HANDLE_CODE(ded_info_nas.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void rrc_conn_setup_complete_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("selectedPLMN-Identity", sel_plmn_id);
  if (registered_mme_present) {
    j.write_fieldname("registeredMME");
    registered_mme.to_json(j);
  }
  j.write_str("dedicatedInfoNAS", ded_info_nas.to_string());
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SCGFailureInformation-r12-IEs ::= SEQUENCE
SRSASN_CODE scg_fail_info_r12_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(fail_report_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (fail_report_scg_r12_present) {
    HANDLE_CODE(fail_report_scg_r12.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_fail_info_r12_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(fail_report_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (fail_report_scg_r12_present) {
    HANDLE_CODE(fail_report_scg_r12.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scg_fail_info_r12_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (fail_report_scg_r12_present) {
    j.write_fieldname("failureReportSCG-r12");
    fail_report_scg_r12.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SCGFailureInformationNR-r15-IEs ::= SEQUENCE
SRSASN_CODE scg_fail_info_nr_r15_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(fail_report_scg_nr_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (fail_report_scg_nr_r15_present) {
    HANDLE_CODE(fail_report_scg_nr_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_fail_info_nr_r15_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(fail_report_scg_nr_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (fail_report_scg_nr_r15_present) {
    HANDLE_CODE(fail_report_scg_nr_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scg_fail_info_nr_r15_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (fail_report_scg_nr_r15_present) {
    j.write_fieldname("failureReportSCG-NR-r15");
    fail_report_scg_nr_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// SecurityModeComplete-r8-IEs ::= SEQUENCE
SRSASN_CODE security_mode_complete_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE security_mode_complete_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void security_mode_complete_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SecurityModeFailure-r8-IEs ::= SEQUENCE
SRSASN_CODE security_mode_fail_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE security_mode_fail_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void security_mode_fail_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SidelinkUEInformation-r12-IEs ::= SEQUENCE
SRSASN_CODE sidelink_ue_info_r12_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(comm_rx_interested_freq_r12_present, 1));
  HANDLE_CODE(bref.pack(comm_tx_res_req_r12_present, 1));
  HANDLE_CODE(bref.pack(disc_rx_interest_r12_present, 1));
  HANDLE_CODE(bref.pack(disc_tx_res_req_r12_present, 1));
  HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (comm_rx_interested_freq_r12_present) {
    HANDLE_CODE(pack_integer(bref, comm_rx_interested_freq_r12, (uint32_t)0u, (uint32_t)262143u));
  }
  if (comm_tx_res_req_r12_present) {
    HANDLE_CODE(comm_tx_res_req_r12.pack(bref));
  }
  if (disc_tx_res_req_r12_present) {
    HANDLE_CODE(pack_integer(bref, disc_tx_res_req_r12, (uint8_t)1u, (uint8_t)63u));
  }
  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 sidelink_ue_info_r12_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(comm_rx_interested_freq_r12_present, 1));
  HANDLE_CODE(bref.unpack(comm_tx_res_req_r12_present, 1));
  HANDLE_CODE(bref.unpack(disc_rx_interest_r12_present, 1));
  HANDLE_CODE(bref.unpack(disc_tx_res_req_r12_present, 1));
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (comm_rx_interested_freq_r12_present) {
    HANDLE_CODE(unpack_integer(comm_rx_interested_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));
  }
  if (comm_tx_res_req_r12_present) {
    HANDLE_CODE(comm_tx_res_req_r12.unpack(bref));
  }
  if (disc_tx_res_req_r12_present) {
    HANDLE_CODE(unpack_integer(disc_tx_res_req_r12, bref, (uint8_t)1u, (uint8_t)63u));
  }
  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 sidelink_ue_info_r12_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (comm_rx_interested_freq_r12_present) {
    j.write_int("commRxInterestedFreq-r12", comm_rx_interested_freq_r12);
  }
  if (comm_tx_res_req_r12_present) {
    j.write_fieldname("commTxResourceReq-r12");
    comm_tx_res_req_r12.to_json(j);
  }
  if (disc_rx_interest_r12_present) {
    j.write_str("discRxInterest-r12", "true");
  }
  if (disc_tx_res_req_r12_present) {
    j.write_int("discTxResourceReq-r12", disc_tx_res_req_r12);
  }
  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();
}

// UEAssistanceInformation-r11-IEs ::= SEQUENCE
SRSASN_CODE ueassist_info_r11_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pwr_pref_ind_r11_present, 1));
  HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (pwr_pref_ind_r11_present) {
    HANDLE_CODE(pwr_pref_ind_r11.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 ueassist_info_r11_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pwr_pref_ind_r11_present, 1));
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (pwr_pref_ind_r11_present) {
    HANDLE_CODE(pwr_pref_ind_r11.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 ueassist_info_r11_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pwr_pref_ind_r11_present) {
    j.write_str("powerPrefIndication-r11", pwr_pref_ind_r11.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();
}

// UECapabilityInformation-r8-IEs ::= SEQUENCE
SRSASN_CODE ue_cap_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, ue_cap_rat_container_list, 0, 8));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_info_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(ue_cap_rat_container_list, bref, 0, 8));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_cap_info_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("ue-CapabilityRAT-ContainerList");
  for (const auto& e1 : ue_cap_rat_container_list) {
    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();
}

// UEInformationResponse-r9-IEs ::= SEQUENCE
SRSASN_CODE ue_info_resp_r9_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rach_report_r9_present, 1));
  HANDLE_CODE(bref.pack(rlf_report_r9_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (rach_report_r9_present) {
    HANDLE_CODE(pack_integer(bref, rach_report_r9.nof_preambs_sent_r9, (uint8_t)1u, (uint8_t)200u));
    HANDLE_CODE(bref.pack(rach_report_r9.contention_detected_r9, 1));
  }
  if (rlf_report_r9_present) {
    HANDLE_CODE(rlf_report_r9.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_resp_r9_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rach_report_r9_present, 1));
  HANDLE_CODE(bref.unpack(rlf_report_r9_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (rach_report_r9_present) {
    HANDLE_CODE(unpack_integer(rach_report_r9.nof_preambs_sent_r9, bref, (uint8_t)1u, (uint8_t)200u));
    HANDLE_CODE(bref.unpack(rach_report_r9.contention_detected_r9, 1));
  }
  if (rlf_report_r9_present) {
    HANDLE_CODE(rlf_report_r9.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_info_resp_r9_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rach_report_r9_present) {
    j.write_fieldname("rach-Report-r9");
    j.start_obj();
    j.write_int("numberOfPreamblesSent-r9", rach_report_r9.nof_preambs_sent_r9);
    j.write_bool("contentionDetected-r9", rach_report_r9.contention_detected_r9);
    j.end_obj();
  }
  if (rlf_report_r9_present) {
    j.write_fieldname("rlf-Report-r9");
    rlf_report_r9.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// ULHandoverPreparationTransfer-r8-IEs ::= SEQUENCE
SRSASN_CODE ul_ho_prep_transfer_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meid_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(cdma2000_type.pack(bref));
  if (meid_present) {
    HANDLE_CODE(meid.pack(bref));
  }
  HANDLE_CODE(ded_info.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ho_prep_transfer_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meid_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(cdma2000_type.unpack(bref));
  if (meid_present) {
    HANDLE_CODE(meid.unpack(bref));
  }
  HANDLE_CODE(ded_info.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ul_ho_prep_transfer_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cdma2000-Type", cdma2000_type.to_string());
  if (meid_present) {
    j.write_str("meid", meid.to_string());
  }
  j.write_str("dedicatedInfo", ded_info.to_string());
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// ULInformationTransfer-r8-IEs ::= SEQUENCE
SRSASN_CODE ul_info_transfer_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(ded_info_type.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_info_transfer_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(ded_info_type.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ul_info_transfer_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("dedicatedInfoType");
  ded_info_type.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

void ul_info_transfer_r8_ies_s::ded_info_type_c_::destroy_()
{
  switch (type_) {
    case types::ded_info_nas:
      c.destroy<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      c.destroy<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_hrpd:
      c.destroy<dyn_octstring>();
      break;
    default:
      break;
  }
}
void ul_info_transfer_r8_ies_s::ded_info_type_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ded_info_nas:
      c.init<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      c.init<dyn_octstring>();
      break;
    case types::ded_info_cdma2000_hrpd:
      c.init<dyn_octstring>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_r8_ies_s::ded_info_type_c_");
  }
}
ul_info_transfer_r8_ies_s::ded_info_type_c_::ded_info_type_c_(const ul_info_transfer_r8_ies_s::ded_info_type_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ded_info_nas:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_hrpd:
      c.init(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_r8_ies_s::ded_info_type_c_");
  }
}
ul_info_transfer_r8_ies_s::ded_info_type_c_& ul_info_transfer_r8_ies_s::ded_info_type_c_::
                                             operator=(const ul_info_transfer_r8_ies_s::ded_info_type_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ded_info_nas:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::ded_info_cdma2000_hrpd:
      c.set(other.c.get<dyn_octstring>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_r8_ies_s::ded_info_type_c_");
  }

  return *this;
}
void ul_info_transfer_r8_ies_s::ded_info_type_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ded_info_nas:
      j.write_str("dedicatedInfoNAS", c.get<dyn_octstring>().to_string());
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      j.write_str("dedicatedInfoCDMA2000-1XRTT", c.get<dyn_octstring>().to_string());
      break;
    case types::ded_info_cdma2000_hrpd:
      j.write_str("dedicatedInfoCDMA2000-HRPD", c.get<dyn_octstring>().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_r8_ies_s::ded_info_type_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_info_transfer_r8_ies_s::ded_info_type_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ded_info_nas:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    case types::ded_info_cdma2000_hrpd:
      HANDLE_CODE(c.get<dyn_octstring>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_r8_ies_s::ded_info_type_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_info_transfer_r8_ies_s::ded_info_type_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ded_info_nas:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::ded_info_cdma2000_minus1_xrtt:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    case types::ded_info_cdma2000_hrpd:
      HANDLE_CODE(c.get<dyn_octstring>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_r8_ies_s::ded_info_type_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ULInformationTransferMRDC-r15-IEs ::= SEQUENCE
SRSASN_CODE ul_info_transfer_mrdc_r15_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_dcch_msg_nr_r15_present, 1));
  HANDLE_CODE(bref.pack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ul_dcch_msg_nr_r15_present) {
    HANDLE_CODE(ul_dcch_msg_nr_r15.pack(bref));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_info_transfer_mrdc_r15_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_dcch_msg_nr_r15_present, 1));
  HANDLE_CODE(bref.unpack(late_non_crit_ext_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ul_dcch_msg_nr_r15_present) {
    HANDLE_CODE(ul_dcch_msg_nr_r15.unpack(bref));
  }
  if (late_non_crit_ext_present) {
    HANDLE_CODE(late_non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ul_info_transfer_mrdc_r15_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ul_dcch_msg_nr_r15_present) {
    j.write_str("ul-DCCH-MessageNR-r15", ul_dcch_msg_nr_r15.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");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// WLANConnectionStatusReport-r13-IEs ::= SEQUENCE
SRSASN_CODE wlan_conn_status_report_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(wlan_status_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 wlan_conn_status_report_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(wlan_status_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 wlan_conn_status_report_r13_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("wlan-Status-r13", wlan_status_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();
}

// CSFBParametersRequestCDMA2000 ::= SEQUENCE
SRSASN_CODE csfb_params_request_cdma2000_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE csfb_params_request_cdma2000_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void csfb_params_request_cdma2000_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void csfb_params_request_cdma2000_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::csfb_params_request_cdma2000_r8:
      c.destroy<csfb_params_request_cdma2000_r8_ies_s>();
      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<csfb_params_request_cdma2000_r8_ies_s>();
      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<csfb_params_request_cdma2000_r8_ies_s>());
      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<csfb_params_request_cdma2000_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::csfb_params_request_cdma2000_r8:
      j.write_fieldname("csfbParametersRequestCDMA2000-r8");
      c.get<csfb_params_request_cdma2000_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "csfb_params_request_cdma2000_s::crit_exts_c_");
  }
  j.end_obj();
}
SRSASN_CODE csfb_params_request_cdma2000_s::crit_exts_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::csfb_params_request_cdma2000_r8:
      HANDLE_CODE(c.get<csfb_params_request_cdma2000_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "csfb_params_request_cdma2000_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE csfb_params_request_cdma2000_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::csfb_params_request_cdma2000_r8:
      HANDLE_CODE(c.get<csfb_params_request_cdma2000_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "csfb_params_request_cdma2000_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CounterCheckResponse ::= SEQUENCE
SRSASN_CODE counter_check_resp_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 counter_check_resp_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 counter_check_resp_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 counter_check_resp_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::counter_check_resp_r8:
      c.destroy<counter_check_resp_r8_ies_s>();
      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<counter_check_resp_r8_ies_s>();
      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<counter_check_resp_r8_ies_s>());
      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<counter_check_resp_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::counter_check_resp_r8:
      j.write_fieldname("counterCheckResponse-r8");
      c.get<counter_check_resp_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_");
  }
  j.end_obj();
}
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<counter_check_resp_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE counter_check_resp_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::counter_check_resp_r8:
      HANDLE_CODE(c.get<counter_check_resp_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "counter_check_resp_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// FailureInformation-r15 ::= SEQUENCE
SRSASN_CODE fail_info_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(failed_lc_ch_info_r15_present, 1));

  if (failed_lc_ch_info_r15_present) {
    HANDLE_CODE(failed_lc_ch_info_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE fail_info_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(failed_lc_ch_info_r15_present, 1));

  if (failed_lc_ch_info_r15_present) {
    HANDLE_CODE(failed_lc_ch_info_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void fail_info_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (failed_lc_ch_info_r15_present) {
    j.write_fieldname("failedLogicalChannelInfo-r15");
    failed_lc_ch_info_r15.to_json(j);
  }
  j.write_fieldname("nonCriticalExtension");
  j.start_obj();
  j.end_obj();
  j.end_obj();
}

// InDeviceCoexIndication-r11 ::= SEQUENCE
SRSASN_CODE in_dev_coex_ind_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE in_dev_coex_ind_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void in_dev_coex_ind_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void in_dev_coex_ind_r11_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE in_dev_coex_ind_r11_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void in_dev_coex_ind_r11_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void in_dev_coex_ind_r11_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::in_dev_coex_ind_r11:
      j.write_fieldname("inDeviceCoexIndication-r11");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE in_dev_coex_ind_r11_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::in_dev_coex_ind_r11:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE in_dev_coex_ind_r11_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::in_dev_coex_ind_r11:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "in_dev_coex_ind_r11_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// InterFreqRSTDMeasurementIndication-r10 ::= SEQUENCE
SRSASN_CODE inter_freq_rstd_meas_ind_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_rstd_meas_ind_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void inter_freq_rstd_meas_ind_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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_::crit_exts_c_(const inter_freq_rstd_meas_ind_r10_s::crit_exts_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::c1:
      c.init(other.c.get<c1_c_>());
      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<c1_c_>());
      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<c1_c_>().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<c1_c_>().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_SUCCESS;
}
SRSASN_CODE inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(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_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::inter_freq_rstd_meas_ind_r10:
      j.write_fieldname("interFreqRSTDMeasurementIndication-r10");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::inter_freq_rstd_meas_ind_r10:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::inter_freq_rstd_meas_ind_r10:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "inter_freq_rstd_meas_ind_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MBMSCountingResponse-r10 ::= SEQUENCE
SRSASN_CODE mbms_count_resp_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_count_resp_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void mbms_count_resp_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void mbms_count_resp_r10_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_count_resp_r10_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mbms_count_resp_r10_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void mbms_count_resp_r10_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::count_resp_r10:
      j.write_fieldname("countingResponse-r10");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE mbms_count_resp_r10_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::count_resp_r10:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_count_resp_r10_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::count_resp_r10:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_count_resp_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MBMSInterestIndication-r11 ::= SEQUENCE
SRSASN_CODE mbms_interest_ind_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_interest_ind_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void mbms_interest_ind_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void mbms_interest_ind_r11_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_interest_ind_r11_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void mbms_interest_ind_r11_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void mbms_interest_ind_r11_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::interest_ind_r11:
      j.write_fieldname("interestIndication-r11");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE mbms_interest_ind_r11_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::interest_ind_r11:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_interest_ind_r11_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::interest_ind_r11:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "mbms_interest_ind_r11_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasReportAppLayer-r15 ::= SEQUENCE
SRSASN_CODE meas_report_app_layer_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_report_app_layer_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_report_app_layer_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  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<meas_report_app_layer_r15_ies_s>();
      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<meas_report_app_layer_r15_ies_s>();
      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<meas_report_app_layer_r15_ies_s>());
      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<meas_report_app_layer_r15_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::meas_report_app_layer_r15:
      j.write_fieldname("measReportAppLayer-r15");
      c.get<meas_report_app_layer_r15_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_app_layer_r15_s::crit_exts_c_");
  }
  j.end_obj();
}
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<meas_report_app_layer_r15_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_app_layer_r15_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_report_app_layer_r15_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::meas_report_app_layer_r15:
      HANDLE_CODE(c.get<meas_report_app_layer_r15_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_app_layer_r15_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// MeasurementReport ::= SEQUENCE
SRSASN_CODE meas_report_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_report_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_report_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void meas_report_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void meas_report_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_report_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void meas_report_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void meas_report_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::meas_report_r8:
      j.write_fieldname("measurementReport-r8");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE meas_report_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::meas_report_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_report_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::meas_report_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "meas_report_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ProximityIndication-r9 ::= SEQUENCE
SRSASN_CODE proximity_ind_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE proximity_ind_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void proximity_ind_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void proximity_ind_r9_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void proximity_ind_r9_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      break;
    case types::crit_exts_future:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_");
  }
}
proximity_ind_r9_s::crit_exts_c_::crit_exts_c_(const proximity_ind_r9_s::crit_exts_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::c1:
      c.init(other.c.get<c1_c_>());
      break;
    case types::crit_exts_future:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_");
  }
}
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<c1_c_>());
      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<c1_c_>().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<c1_c_>().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)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void proximity_ind_r9_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void proximity_ind_r9_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::proximity_ind_r9:
      j.write_fieldname("proximityIndication-r9");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE proximity_ind_r9_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::proximity_ind_r9:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE proximity_ind_r9_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::proximity_ind_r9:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "proximity_ind_r9_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RNReconfigurationComplete-r10 ::= SEQUENCE
SRSASN_CODE rn_recfg_complete_r10_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 rn_recfg_complete_r10_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 rn_recfg_complete_r10_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 rn_recfg_complete_r10_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_recfg_complete_r10_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rn_recfg_complete_r10_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void rn_recfg_complete_r10_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rn_recfg_complete_r10:
      j.write_fieldname("rnReconfigurationComplete-r10");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rn_recfg_complete_r10_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rn_recfg_complete_r10:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rn_recfg_complete_r10_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rn_recfg_complete_r10:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rn_recfg_complete_r10_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReconfigurationComplete ::= SEQUENCE
SRSASN_CODE rrc_conn_recfg_complete_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_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_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_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::rrc_conn_recfg_complete_r8:
      c.destroy<rrc_conn_recfg_complete_r8_ies_s>();
      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<rrc_conn_recfg_complete_r8_ies_s>();
      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<rrc_conn_recfg_complete_r8_ies_s>());
      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<rrc_conn_recfg_complete_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_recfg_complete_r8:
      j.write_fieldname("rrcConnectionReconfigurationComplete-r8");
      c.get<rrc_conn_recfg_complete_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_complete_s::crit_exts_c_");
  }
  j.end_obj();
}
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<rrc_conn_recfg_complete_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_complete_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_recfg_complete_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_recfg_complete_r8:
      HANDLE_CODE(c.get<rrc_conn_recfg_complete_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_recfg_complete_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionReestablishmentComplete ::= SEQUENCE
SRSASN_CODE rrc_conn_reest_complete_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_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_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_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::rrc_conn_reest_complete_r8:
      c.destroy<rrc_conn_reest_complete_r8_ies_s>();
      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<rrc_conn_reest_complete_r8_ies_s>();
      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<rrc_conn_reest_complete_r8_ies_s>());
      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<rrc_conn_reest_complete_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_reest_complete_r8:
      j.write_fieldname("rrcConnectionReestablishmentComplete-r8");
      c.get<rrc_conn_reest_complete_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_complete_s::crit_exts_c_");
  }
  j.end_obj();
}
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<rrc_conn_reest_complete_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_complete_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_reest_complete_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_reest_complete_r8:
      HANDLE_CODE(c.get<rrc_conn_reest_complete_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_reest_complete_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionResumeComplete-r13 ::= SEQUENCE
SRSASN_CODE rrc_conn_resume_complete_r13_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_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<rrc_conn_resume_complete_r13_ies_s>();
      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<rrc_conn_resume_complete_r13_ies_s>();
      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<rrc_conn_resume_complete_r13_ies_s>());
      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<rrc_conn_resume_complete_r13_ies_s>());
      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_");
  }

  return *this;
}
void rrc_conn_resume_complete_r13_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<rrc_conn_resume_complete_r13_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_complete_r13_s::crit_exts_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_resume_complete_r13_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<rrc_conn_resume_complete_r13_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_complete_r13_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_resume_complete_r13_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<rrc_conn_resume_complete_r13_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_resume_complete_r13_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// RRCConnectionSetupComplete ::= SEQUENCE
SRSASN_CODE rrc_conn_setup_complete_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_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_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_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void rrc_conn_setup_complete_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void rrc_conn_setup_complete_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::rrc_conn_setup_complete_r8:
      j.write_fieldname("rrcConnectionSetupComplete-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE rrc_conn_setup_complete_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::rrc_conn_setup_complete_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrc_conn_setup_complete_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::rrc_conn_setup_complete_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "rrc_conn_setup_complete_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SCGFailureInformation-r12 ::= SEQUENCE
SRSASN_CODE scg_fail_info_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_fail_info_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void scg_fail_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void scg_fail_info_r12_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_fail_info_r12_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void scg_fail_info_r12_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void scg_fail_info_r12_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::scg_fail_info_r12:
      j.write_fieldname("scgFailureInformation-r12");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE scg_fail_info_r12_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::scg_fail_info_r12:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_fail_info_r12_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::scg_fail_info_r12:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_r12_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SCGFailureInformationNR-r15 ::= SEQUENCE
SRSASN_CODE scg_fail_info_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_fail_info_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void scg_fail_info_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void scg_fail_info_nr_r15_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_fail_info_nr_r15_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void scg_fail_info_nr_r15_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void scg_fail_info_nr_r15_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::scg_fail_info_nr_r15:
      j.write_fieldname("scgFailureInformationNR-r15");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE scg_fail_info_nr_r15_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::scg_fail_info_nr_r15:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_fail_info_nr_r15_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::scg_fail_info_nr_r15:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_fail_info_nr_r15_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SecurityModeComplete ::= SEQUENCE
SRSASN_CODE security_mode_complete_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 security_mode_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 security_mode_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 security_mode_complete_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::security_mode_complete_r8:
      c.destroy<security_mode_complete_r8_ies_s>();
      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<security_mode_complete_r8_ies_s>();
      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<security_mode_complete_r8_ies_s>());
      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<security_mode_complete_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::security_mode_complete_r8:
      j.write_fieldname("securityModeComplete-r8");
      c.get<security_mode_complete_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_");
  }
  j.end_obj();
}
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<security_mode_complete_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE security_mode_complete_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::security_mode_complete_r8:
      HANDLE_CODE(c.get<security_mode_complete_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_complete_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SecurityModeFailure ::= SEQUENCE
SRSASN_CODE security_mode_fail_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 security_mode_fail_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 security_mode_fail_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 security_mode_fail_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::security_mode_fail_r8:
      c.destroy<security_mode_fail_r8_ies_s>();
      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<security_mode_fail_r8_ies_s>();
      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<security_mode_fail_r8_ies_s>());
      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<security_mode_fail_r8_ies_s>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::security_mode_fail_r8:
      j.write_fieldname("securityModeFailure-r8");
      c.get<security_mode_fail_r8_ies_s>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_");
  }
  j.end_obj();
}
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<security_mode_fail_r8_ies_s>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE security_mode_fail_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::security_mode_fail_r8:
      HANDLE_CODE(c.get<security_mode_fail_r8_ies_s>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "security_mode_fail_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SidelinkUEInformation-r12 ::= SEQUENCE
SRSASN_CODE sidelink_ue_info_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sidelink_ue_info_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void sidelink_ue_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void sidelink_ue_info_r12_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sidelink_ue_info_r12_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sidelink_ue_info_r12_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void sidelink_ue_info_r12_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::sidelink_ue_info_r12:
      j.write_fieldname("sidelinkUEInformation-r12");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE sidelink_ue_info_r12_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::sidelink_ue_info_r12:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sidelink_ue_info_r12_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::sidelink_ue_info_r12:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "sidelink_ue_info_r12_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UEAssistanceInformation-r11 ::= SEQUENCE
SRSASN_CODE ueassist_info_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ueassist_info_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void ueassist_info_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void ueassist_info_r11_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ueassist_info_r11_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ueassist_info_r11_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ueassist_info_r11_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_assist_info_r11:
      j.write_fieldname("ueAssistanceInformation-r11");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ueassist_info_r11_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_assist_info_r11:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ueassist_info_r11_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_assist_info_r11:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ueassist_info_r11_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UECapabilityInformation ::= SEQUENCE
SRSASN_CODE ue_cap_info_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 ue_cap_info_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 ue_cap_info_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 ue_cap_info_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_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.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ue_cap_info_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ue_cap_info_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_cap_info_r8:
      j.write_fieldname("ueCapabilityInformation-r8");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ue_cap_info_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_cap_info_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_cap_info_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_cap_info_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_cap_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UEInformationResponse-r9 ::= SEQUENCE
SRSASN_CODE ue_info_resp_r9_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 ue_info_resp_r9_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 ue_info_resp_r9_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 ue_info_resp_r9_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_resp_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<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ue_info_resp_r9_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ue_info_resp_r9_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_info_resp_r9:
      j.write_fieldname("ueInformationResponse-r9");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ue_info_resp_r9_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_info_resp_r9:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_info_resp_r9_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_info_resp_r9:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_info_resp_r9_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ULHandoverPreparationTransfer ::= SEQUENCE
SRSASN_CODE ul_ho_prep_transfer_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ho_prep_transfer_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_ho_prep_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_ho_prep_transfer_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ho_prep_transfer_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_ho_prep_transfer_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ul_ho_prep_transfer_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ul_ho_prep_transfer_r8:
      j.write_fieldname("ulHandoverPreparationTransfer-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_ho_prep_transfer_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ul_ho_prep_transfer_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_ho_prep_transfer_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ul_ho_prep_transfer_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_ho_prep_transfer_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ULInformationTransfer ::= SEQUENCE
SRSASN_CODE ul_info_transfer_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
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<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_info_transfer_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_info_transfer_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ul_info_transfer_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ul_info_transfer_r8:
      j.write_fieldname("ulInformationTransfer-r8");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_info_transfer_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ul_info_transfer_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_info_transfer_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ul_info_transfer_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// ULInformationTransferMRDC-r15 ::= SEQUENCE
SRSASN_CODE ul_info_transfer_mrdc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_info_transfer_mrdc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void ul_info_transfer_mrdc_r15_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_mrdc_r15_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_info_transfer_mrdc_r15_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_info_transfer_mrdc_r15_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ul_info_transfer_mrdc_r15_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ul_info_transfer_mrdc_r15:
      j.write_fieldname("ulInformationTransferMRDC-r15");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_info_transfer_mrdc_r15_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ul_info_transfer_mrdc_r15:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_info_transfer_mrdc_r15_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ul_info_transfer_mrdc_r15:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_info_transfer_mrdc_r15_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// WLANConnectionStatusReport-r13 ::= SEQUENCE
SRSASN_CODE wlan_conn_status_report_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_conn_status_report_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void wlan_conn_status_report_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void wlan_conn_status_report_r13_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "wlan_conn_status_report_r13_s::crit_exts_c_");
  }
  j.end_obj();
}
SRSASN_CODE wlan_conn_status_report_r13_s::crit_exts_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "wlan_conn_status_report_r13_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_conn_status_report_r13_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "wlan_conn_status_report_r13_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void wlan_conn_status_report_r13_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void wlan_conn_status_report_r13_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::wlan_conn_status_report_r13:
      j.write_fieldname("wlanConnectionStatusReport-r13");
      c.to_json(j);
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "wlan_conn_status_report_r13_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE wlan_conn_status_report_r13_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::wlan_conn_status_report_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_, "wlan_conn_status_report_r13_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_conn_status_report_r13_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::wlan_conn_status_report_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_, "wlan_conn_status_report_r13_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UL-DCCH-MessageType ::= CHOICE
void ul_dcch_msg_type_c::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    case types::msg_class_ext:
      c.destroy<msg_class_ext_c_>();
      break;
    default:
      break;
  }
}
void ul_dcch_msg_type_c::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      break;
    case types::msg_class_ext:
      c.init<msg_class_ext_c_>();
      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<c1_c_>());
      break;
    case types::msg_class_ext:
      c.init(other.c.get<msg_class_ext_c_>());
      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<c1_c_>());
      break;
    case types::msg_class_ext:
      c.set(other.c.get<msg_class_ext_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::msg_class_ext:
      j.write_fieldname("messageClassExtension");
      c.get<msg_class_ext_c_>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c");
  }
  j.end_obj();
}
SRSASN_CODE ul_dcch_msg_type_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().pack(bref));
      break;
    case types::msg_class_ext:
      HANDLE_CODE(c.get<msg_class_ext_c_>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_dcch_msg_type_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::msg_class_ext:
      HANDLE_CODE(c.get<msg_class_ext_c_>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_dcch_msg_type_c::c1_c_::destroy_()
{
  switch (type_) {
    case types::csfb_params_request_cdma2000:
      c.destroy<csfb_params_request_cdma2000_s>();
      break;
    case types::meas_report:
      c.destroy<meas_report_s>();
      break;
    case types::rrc_conn_recfg_complete:
      c.destroy<rrc_conn_recfg_complete_s>();
      break;
    case types::rrc_conn_reest_complete:
      c.destroy<rrc_conn_reest_complete_s>();
      break;
    case types::rrc_conn_setup_complete:
      c.destroy<rrc_conn_setup_complete_s>();
      break;
    case types::security_mode_complete:
      c.destroy<security_mode_complete_s>();
      break;
    case types::security_mode_fail:
      c.destroy<security_mode_fail_s>();
      break;
    case types::ue_cap_info:
      c.destroy<ue_cap_info_s>();
      break;
    case types::ul_ho_prep_transfer:
      c.destroy<ul_ho_prep_transfer_s>();
      break;
    case types::ul_info_transfer:
      c.destroy<ul_info_transfer_s>();
      break;
    case types::counter_check_resp:
      c.destroy<counter_check_resp_s>();
      break;
    case types::ue_info_resp_r9:
      c.destroy<ue_info_resp_r9_s>();
      break;
    case types::proximity_ind_r9:
      c.destroy<proximity_ind_r9_s>();
      break;
    case types::rn_recfg_complete_r10:
      c.destroy<rn_recfg_complete_r10_s>();
      break;
    case types::mbms_count_resp_r10:
      c.destroy<mbms_count_resp_r10_s>();
      break;
    case types::inter_freq_rstd_meas_ind_r10:
      c.destroy<inter_freq_rstd_meas_ind_r10_s>();
      break;
    default:
      break;
  }
}
void ul_dcch_msg_type_c::c1_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::csfb_params_request_cdma2000:
      c.init<csfb_params_request_cdma2000_s>();
      break;
    case types::meas_report:
      c.init<meas_report_s>();
      break;
    case types::rrc_conn_recfg_complete:
      c.init<rrc_conn_recfg_complete_s>();
      break;
    case types::rrc_conn_reest_complete:
      c.init<rrc_conn_reest_complete_s>();
      break;
    case types::rrc_conn_setup_complete:
      c.init<rrc_conn_setup_complete_s>();
      break;
    case types::security_mode_complete:
      c.init<security_mode_complete_s>();
      break;
    case types::security_mode_fail:
      c.init<security_mode_fail_s>();
      break;
    case types::ue_cap_info:
      c.init<ue_cap_info_s>();
      break;
    case types::ul_ho_prep_transfer:
      c.init<ul_ho_prep_transfer_s>();
      break;
    case types::ul_info_transfer:
      c.init<ul_info_transfer_s>();
      break;
    case types::counter_check_resp:
      c.init<counter_check_resp_s>();
      break;
    case types::ue_info_resp_r9:
      c.init<ue_info_resp_r9_s>();
      break;
    case types::proximity_ind_r9:
      c.init<proximity_ind_r9_s>();
      break;
    case types::rn_recfg_complete_r10:
      c.init<rn_recfg_complete_r10_s>();
      break;
    case types::mbms_count_resp_r10:
      c.init<mbms_count_resp_r10_s>();
      break;
    case types::inter_freq_rstd_meas_ind_r10:
      c.init<inter_freq_rstd_meas_ind_r10_s>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::c1_c_");
  }
}
ul_dcch_msg_type_c::c1_c_::c1_c_(const ul_dcch_msg_type_c::c1_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::csfb_params_request_cdma2000:
      c.init(other.c.get<csfb_params_request_cdma2000_s>());
      break;
    case types::meas_report:
      c.init(other.c.get<meas_report_s>());
      break;
    case types::rrc_conn_recfg_complete:
      c.init(other.c.get<rrc_conn_recfg_complete_s>());
      break;
    case types::rrc_conn_reest_complete:
      c.init(other.c.get<rrc_conn_reest_complete_s>());
      break;
    case types::rrc_conn_setup_complete:
      c.init(other.c.get<rrc_conn_setup_complete_s>());
      break;
    case types::security_mode_complete:
      c.init(other.c.get<security_mode_complete_s>());
      break;
    case types::security_mode_fail:
      c.init(other.c.get<security_mode_fail_s>());
      break;
    case types::ue_cap_info:
      c.init(other.c.get<ue_cap_info_s>());
      break;
    case types::ul_ho_prep_transfer:
      c.init(other.c.get<ul_ho_prep_transfer_s>());
      break;
    case types::ul_info_transfer:
      c.init(other.c.get<ul_info_transfer_s>());
      break;
    case types::counter_check_resp:
      c.init(other.c.get<counter_check_resp_s>());
      break;
    case types::ue_info_resp_r9:
      c.init(other.c.get<ue_info_resp_r9_s>());
      break;
    case types::proximity_ind_r9:
      c.init(other.c.get<proximity_ind_r9_s>());
      break;
    case types::rn_recfg_complete_r10:
      c.init(other.c.get<rn_recfg_complete_r10_s>());
      break;
    case types::mbms_count_resp_r10:
      c.init(other.c.get<mbms_count_resp_r10_s>());
      break;
    case types::inter_freq_rstd_meas_ind_r10:
      c.init(other.c.get<inter_freq_rstd_meas_ind_r10_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::c1_c_");
  }
}
ul_dcch_msg_type_c::c1_c_& ul_dcch_msg_type_c::c1_c_::operator=(const ul_dcch_msg_type_c::c1_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::csfb_params_request_cdma2000:
      c.set(other.c.get<csfb_params_request_cdma2000_s>());
      break;
    case types::meas_report:
      c.set(other.c.get<meas_report_s>());
      break;
    case types::rrc_conn_recfg_complete:
      c.set(other.c.get<rrc_conn_recfg_complete_s>());
      break;
    case types::rrc_conn_reest_complete:
      c.set(other.c.get<rrc_conn_reest_complete_s>());
      break;
    case types::rrc_conn_setup_complete:
      c.set(other.c.get<rrc_conn_setup_complete_s>());
      break;
    case types::security_mode_complete:
      c.set(other.c.get<security_mode_complete_s>());
      break;
    case types::security_mode_fail:
      c.set(other.c.get<security_mode_fail_s>());
      break;
    case types::ue_cap_info:
      c.set(other.c.get<ue_cap_info_s>());
      break;
    case types::ul_ho_prep_transfer:
      c.set(other.c.get<ul_ho_prep_transfer_s>());
      break;
    case types::ul_info_transfer:
      c.set(other.c.get<ul_info_transfer_s>());
      break;
    case types::counter_check_resp:
      c.set(other.c.get<counter_check_resp_s>());
      break;
    case types::ue_info_resp_r9:
      c.set(other.c.get<ue_info_resp_r9_s>());
      break;
    case types::proximity_ind_r9:
      c.set(other.c.get<proximity_ind_r9_s>());
      break;
    case types::rn_recfg_complete_r10:
      c.set(other.c.get<rn_recfg_complete_r10_s>());
      break;
    case types::mbms_count_resp_r10:
      c.set(other.c.get<mbms_count_resp_r10_s>());
      break;
    case types::inter_freq_rstd_meas_ind_r10:
      c.set(other.c.get<inter_freq_rstd_meas_ind_r10_s>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::c1_c_");
  }

  return *this;
}
void ul_dcch_msg_type_c::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::csfb_params_request_cdma2000:
      j.write_fieldname("csfbParametersRequestCDMA2000");
      c.get<csfb_params_request_cdma2000_s>().to_json(j);
      break;
    case types::meas_report:
      j.write_fieldname("measurementReport");
      c.get<meas_report_s>().to_json(j);
      break;
    case types::rrc_conn_recfg_complete:
      j.write_fieldname("rrcConnectionReconfigurationComplete");
      c.get<rrc_conn_recfg_complete_s>().to_json(j);
      break;
    case types::rrc_conn_reest_complete:
      j.write_fieldname("rrcConnectionReestablishmentComplete");
      c.get<rrc_conn_reest_complete_s>().to_json(j);
      break;
    case types::rrc_conn_setup_complete:
      j.write_fieldname("rrcConnectionSetupComplete");
      c.get<rrc_conn_setup_complete_s>().to_json(j);
      break;
    case types::security_mode_complete:
      j.write_fieldname("securityModeComplete");
      c.get<security_mode_complete_s>().to_json(j);
      break;
    case types::security_mode_fail:
      j.write_fieldname("securityModeFailure");
      c.get<security_mode_fail_s>().to_json(j);
      break;
    case types::ue_cap_info:
      j.write_fieldname("ueCapabilityInformation");
      c.get<ue_cap_info_s>().to_json(j);
      break;
    case types::ul_ho_prep_transfer:
      j.write_fieldname("ulHandoverPreparationTransfer");
      c.get<ul_ho_prep_transfer_s>().to_json(j);
      break;
    case types::ul_info_transfer:
      j.write_fieldname("ulInformationTransfer");
      c.get<ul_info_transfer_s>().to_json(j);
      break;
    case types::counter_check_resp:
      j.write_fieldname("counterCheckResponse");
      c.get<counter_check_resp_s>().to_json(j);
      break;
    case types::ue_info_resp_r9:
      j.write_fieldname("ueInformationResponse-r9");
      c.get<ue_info_resp_r9_s>().to_json(j);
      break;
    case types::proximity_ind_r9:
      j.write_fieldname("proximityIndication-r9");
      c.get<proximity_ind_r9_s>().to_json(j);
      break;
    case types::rn_recfg_complete_r10:
      j.write_fieldname("rnReconfigurationComplete-r10");
      c.get<rn_recfg_complete_r10_s>().to_json(j);
      break;
    case types::mbms_count_resp_r10:
      j.write_fieldname("mbmsCountingResponse-r10");
      c.get<mbms_count_resp_r10_s>().to_json(j);
      break;
    case types::inter_freq_rstd_meas_ind_r10:
      j.write_fieldname("interFreqRSTDMeasurementIndication-r10");
      c.get<inter_freq_rstd_meas_ind_r10_s>().to_json(j);
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_dcch_msg_type_c::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::csfb_params_request_cdma2000:
      HANDLE_CODE(c.get<csfb_params_request_cdma2000_s>().pack(bref));
      break;
    case types::meas_report:
      HANDLE_CODE(c.get<meas_report_s>().pack(bref));
      break;
    case types::rrc_conn_recfg_complete:
      HANDLE_CODE(c.get<rrc_conn_recfg_complete_s>().pack(bref));
      break;
    case types::rrc_conn_reest_complete:
      HANDLE_CODE(c.get<rrc_conn_reest_complete_s>().pack(bref));
      break;
    case types::rrc_conn_setup_complete:
      HANDLE_CODE(c.get<rrc_conn_setup_complete_s>().pack(bref));
      break;
    case types::security_mode_complete:
      HANDLE_CODE(c.get<security_mode_complete_s>().pack(bref));
      break;
    case types::security_mode_fail:
      HANDLE_CODE(c.get<security_mode_fail_s>().pack(bref));
      break;
    case types::ue_cap_info:
      HANDLE_CODE(c.get<ue_cap_info_s>().pack(bref));
      break;
    case types::ul_ho_prep_transfer:
      HANDLE_CODE(c.get<ul_ho_prep_transfer_s>().pack(bref));
      break;
    case types::ul_info_transfer:
      HANDLE_CODE(c.get<ul_info_transfer_s>().pack(bref));
      break;
    case types::counter_check_resp:
      HANDLE_CODE(c.get<counter_check_resp_s>().pack(bref));
      break;
    case types::ue_info_resp_r9:
      HANDLE_CODE(c.get<ue_info_resp_r9_s>().pack(bref));
      break;
    case types::proximity_ind_r9:
      HANDLE_CODE(c.get<proximity_ind_r9_s>().pack(bref));
      break;
    case types::rn_recfg_complete_r10:
      HANDLE_CODE(c.get<rn_recfg_complete_r10_s>().pack(bref));
      break;
    case types::mbms_count_resp_r10:
      HANDLE_CODE(c.get<mbms_count_resp_r10_s>().pack(bref));
      break;
    case types::inter_freq_rstd_meas_ind_r10:
      HANDLE_CODE(c.get<inter_freq_rstd_meas_ind_r10_s>().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_dcch_msg_type_c::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::csfb_params_request_cdma2000:
      HANDLE_CODE(c.get<csfb_params_request_cdma2000_s>().unpack(bref));
      break;
    case types::meas_report:
      HANDLE_CODE(c.get<meas_report_s>().unpack(bref));
      break;
    case types::rrc_conn_recfg_complete:
      HANDLE_CODE(c.get<rrc_conn_recfg_complete_s>().unpack(bref));
      break;
    case types::rrc_conn_reest_complete:
      HANDLE_CODE(c.get<rrc_conn_reest_complete_s>().unpack(bref));
      break;
    case types::rrc_conn_setup_complete:
      HANDLE_CODE(c.get<rrc_conn_setup_complete_s>().unpack(bref));
      break;
    case types::security_mode_complete:
      HANDLE_CODE(c.get<security_mode_complete_s>().unpack(bref));
      break;
    case types::security_mode_fail:
      HANDLE_CODE(c.get<security_mode_fail_s>().unpack(bref));
      break;
    case types::ue_cap_info:
      HANDLE_CODE(c.get<ue_cap_info_s>().unpack(bref));
      break;
    case types::ul_ho_prep_transfer:
      HANDLE_CODE(c.get<ul_ho_prep_transfer_s>().unpack(bref));
      break;
    case types::ul_info_transfer:
      HANDLE_CODE(c.get<ul_info_transfer_s>().unpack(bref));
      break;
    case types::counter_check_resp:
      HANDLE_CODE(c.get<counter_check_resp_s>().unpack(bref));
      break;
    case types::ue_info_resp_r9:
      HANDLE_CODE(c.get<ue_info_resp_r9_s>().unpack(bref));
      break;
    case types::proximity_ind_r9:
      HANDLE_CODE(c.get<proximity_ind_r9_s>().unpack(bref));
      break;
    case types::rn_recfg_complete_r10:
      HANDLE_CODE(c.get<rn_recfg_complete_r10_s>().unpack(bref));
      break;
    case types::mbms_count_resp_r10:
      HANDLE_CODE(c.get<mbms_count_resp_r10_s>().unpack(bref));
      break;
    case types::inter_freq_rstd_meas_ind_r10:
      HANDLE_CODE(c.get<inter_freq_rstd_meas_ind_r10_s>().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_dcch_msg_type_c::msg_class_ext_c_::destroy_()
{
  switch (type_) {
    case types::c2:
      c.destroy<c2_c_>();
      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<c2_c_>();
      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<c2_c_>());
      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<c2_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c2:
      j.write_fieldname("c2");
      c.get<c2_c_>().to_json(j);
      break;
    case types::msg_class_ext_future_r11:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_");
  }
  j.end_obj();
}
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<c2_c_>().pack(bref));
      break;
    case types::msg_class_ext_future_r11:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_dcch_msg_type_c::msg_class_ext_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c2:
      HANDLE_CODE(c.get<c2_c_>().unpack(bref));
      break;
    case types::msg_class_ext_future_r11:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_::destroy_()
{
  switch (type_) {
    case types::ue_assist_info_r11:
      c.destroy<ueassist_info_r11_s>();
      break;
    case types::in_dev_coex_ind_r11:
      c.destroy<in_dev_coex_ind_r11_s>();
      break;
    case types::mbms_interest_ind_r11:
      c.destroy<mbms_interest_ind_r11_s>();
      break;
    case types::scg_fail_info_r12:
      c.destroy<scg_fail_info_r12_s>();
      break;
    case types::sidelink_ue_info_r12:
      c.destroy<sidelink_ue_info_r12_s>();
      break;
    case types::wlan_conn_status_report_r13:
      c.destroy<wlan_conn_status_report_r13_s>();
      break;
    case types::rrc_conn_resume_complete_r13:
      c.destroy<rrc_conn_resume_complete_r13_s>();
      break;
    case types::ul_info_transfer_mrdc_r15:
      c.destroy<ul_info_transfer_mrdc_r15_s>();
      break;
    case types::scg_fail_info_nr_r15:
      c.destroy<scg_fail_info_nr_r15_s>();
      break;
    case types::meas_report_app_layer_r15:
      c.destroy<meas_report_app_layer_r15_s>();
      break;
    case types::fail_info_r15:
      c.destroy<fail_info_r15_s>();
      break;
    default:
      break;
  }
}
void ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::ue_assist_info_r11:
      c.init<ueassist_info_r11_s>();
      break;
    case types::in_dev_coex_ind_r11:
      c.init<in_dev_coex_ind_r11_s>();
      break;
    case types::mbms_interest_ind_r11:
      c.init<mbms_interest_ind_r11_s>();
      break;
    case types::scg_fail_info_r12:
      c.init<scg_fail_info_r12_s>();
      break;
    case types::sidelink_ue_info_r12:
      c.init<sidelink_ue_info_r12_s>();
      break;
    case types::wlan_conn_status_report_r13:
      c.init<wlan_conn_status_report_r13_s>();
      break;
    case types::rrc_conn_resume_complete_r13:
      c.init<rrc_conn_resume_complete_r13_s>();
      break;
    case types::ul_info_transfer_mrdc_r15:
      c.init<ul_info_transfer_mrdc_r15_s>();
      break;
    case types::scg_fail_info_nr_r15:
      c.init<scg_fail_info_nr_r15_s>();
      break;
    case types::meas_report_app_layer_r15:
      c.init<meas_report_app_layer_r15_s>();
      break;
    case types::fail_info_r15:
      c.init<fail_info_r15_s>();
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_");
  }
}
ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_::c2_c_(const ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::ue_assist_info_r11:
      c.init(other.c.get<ueassist_info_r11_s>());
      break;
    case types::in_dev_coex_ind_r11:
      c.init(other.c.get<in_dev_coex_ind_r11_s>());
      break;
    case types::mbms_interest_ind_r11:
      c.init(other.c.get<mbms_interest_ind_r11_s>());
      break;
    case types::scg_fail_info_r12:
      c.init(other.c.get<scg_fail_info_r12_s>());
      break;
    case types::sidelink_ue_info_r12:
      c.init(other.c.get<sidelink_ue_info_r12_s>());
      break;
    case types::wlan_conn_status_report_r13:
      c.init(other.c.get<wlan_conn_status_report_r13_s>());
      break;
    case types::rrc_conn_resume_complete_r13:
      c.init(other.c.get<rrc_conn_resume_complete_r13_s>());
      break;
    case types::ul_info_transfer_mrdc_r15:
      c.init(other.c.get<ul_info_transfer_mrdc_r15_s>());
      break;
    case types::scg_fail_info_nr_r15:
      c.init(other.c.get<scg_fail_info_nr_r15_s>());
      break;
    case types::meas_report_app_layer_r15:
      c.init(other.c.get<meas_report_app_layer_r15_s>());
      break;
    case types::fail_info_r15:
      c.init(other.c.get<fail_info_r15_s>());
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_");
  }
}
ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_& ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_::
                                             operator=(const ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::ue_assist_info_r11:
      c.set(other.c.get<ueassist_info_r11_s>());
      break;
    case types::in_dev_coex_ind_r11:
      c.set(other.c.get<in_dev_coex_ind_r11_s>());
      break;
    case types::mbms_interest_ind_r11:
      c.set(other.c.get<mbms_interest_ind_r11_s>());
      break;
    case types::scg_fail_info_r12:
      c.set(other.c.get<scg_fail_info_r12_s>());
      break;
    case types::sidelink_ue_info_r12:
      c.set(other.c.get<sidelink_ue_info_r12_s>());
      break;
    case types::wlan_conn_status_report_r13:
      c.set(other.c.get<wlan_conn_status_report_r13_s>());
      break;
    case types::rrc_conn_resume_complete_r13:
      c.set(other.c.get<rrc_conn_resume_complete_r13_s>());
      break;
    case types::ul_info_transfer_mrdc_r15:
      c.set(other.c.get<ul_info_transfer_mrdc_r15_s>());
      break;
    case types::scg_fail_info_nr_r15:
      c.set(other.c.get<scg_fail_info_nr_r15_s>());
      break;
    case types::meas_report_app_layer_r15:
      c.set(other.c.get<meas_report_app_layer_r15_s>());
      break;
    case types::fail_info_r15:
      c.set(other.c.get<fail_info_r15_s>());
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_");
  }

  return *this;
}
void ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_assist_info_r11:
      j.write_fieldname("ueAssistanceInformation-r11");
      c.get<ueassist_info_r11_s>().to_json(j);
      break;
    case types::in_dev_coex_ind_r11:
      j.write_fieldname("inDeviceCoexIndication-r11");
      c.get<in_dev_coex_ind_r11_s>().to_json(j);
      break;
    case types::mbms_interest_ind_r11:
      j.write_fieldname("mbmsInterestIndication-r11");
      c.get<mbms_interest_ind_r11_s>().to_json(j);
      break;
    case types::scg_fail_info_r12:
      j.write_fieldname("scgFailureInformation-r12");
      c.get<scg_fail_info_r12_s>().to_json(j);
      break;
    case types::sidelink_ue_info_r12:
      j.write_fieldname("sidelinkUEInformation-r12");
      c.get<sidelink_ue_info_r12_s>().to_json(j);
      break;
    case types::wlan_conn_status_report_r13:
      j.write_fieldname("wlanConnectionStatusReport-r13");
      c.get<wlan_conn_status_report_r13_s>().to_json(j);
      break;
    case types::rrc_conn_resume_complete_r13:
      j.write_fieldname("rrcConnectionResumeComplete-r13");
      c.get<rrc_conn_resume_complete_r13_s>().to_json(j);
      break;
    case types::ul_info_transfer_mrdc_r15:
      j.write_fieldname("ulInformationTransferMRDC-r15");
      c.get<ul_info_transfer_mrdc_r15_s>().to_json(j);
      break;
    case types::scg_fail_info_nr_r15:
      j.write_fieldname("scgFailureInformationNR-r15");
      c.get<scg_fail_info_nr_r15_s>().to_json(j);
      break;
    case types::meas_report_app_layer_r15:
      j.write_fieldname("measReportAppLayer-r15");
      c.get<meas_report_app_layer_r15_s>().to_json(j);
      break;
    case types::fail_info_r15:
      j.write_fieldname("failureInformation-r15");
      c.get<fail_info_r15_s>().to_json(j);
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_");
  }
  j.end_obj();
}
SRSASN_CODE ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_assist_info_r11:
      HANDLE_CODE(c.get<ueassist_info_r11_s>().pack(bref));
      break;
    case types::in_dev_coex_ind_r11:
      HANDLE_CODE(c.get<in_dev_coex_ind_r11_s>().pack(bref));
      break;
    case types::mbms_interest_ind_r11:
      HANDLE_CODE(c.get<mbms_interest_ind_r11_s>().pack(bref));
      break;
    case types::scg_fail_info_r12:
      HANDLE_CODE(c.get<scg_fail_info_r12_s>().pack(bref));
      break;
    case types::sidelink_ue_info_r12:
      HANDLE_CODE(c.get<sidelink_ue_info_r12_s>().pack(bref));
      break;
    case types::wlan_conn_status_report_r13:
      HANDLE_CODE(c.get<wlan_conn_status_report_r13_s>().pack(bref));
      break;
    case types::rrc_conn_resume_complete_r13:
      HANDLE_CODE(c.get<rrc_conn_resume_complete_r13_s>().pack(bref));
      break;
    case types::ul_info_transfer_mrdc_r15:
      HANDLE_CODE(c.get<ul_info_transfer_mrdc_r15_s>().pack(bref));
      break;
    case types::scg_fail_info_nr_r15:
      HANDLE_CODE(c.get<scg_fail_info_nr_r15_s>().pack(bref));
      break;
    case types::meas_report_app_layer_r15:
      HANDLE_CODE(c.get<meas_report_app_layer_r15_s>().pack(bref));
      break;
    case types::fail_info_r15:
      HANDLE_CODE(c.get<fail_info_r15_s>().pack(bref));
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_assist_info_r11:
      HANDLE_CODE(c.get<ueassist_info_r11_s>().unpack(bref));
      break;
    case types::in_dev_coex_ind_r11:
      HANDLE_CODE(c.get<in_dev_coex_ind_r11_s>().unpack(bref));
      break;
    case types::mbms_interest_ind_r11:
      HANDLE_CODE(c.get<mbms_interest_ind_r11_s>().unpack(bref));
      break;
    case types::scg_fail_info_r12:
      HANDLE_CODE(c.get<scg_fail_info_r12_s>().unpack(bref));
      break;
    case types::sidelink_ue_info_r12:
      HANDLE_CODE(c.get<sidelink_ue_info_r12_s>().unpack(bref));
      break;
    case types::wlan_conn_status_report_r13:
      HANDLE_CODE(c.get<wlan_conn_status_report_r13_s>().unpack(bref));
      break;
    case types::rrc_conn_resume_complete_r13:
      HANDLE_CODE(c.get<rrc_conn_resume_complete_r13_s>().unpack(bref));
      break;
    case types::ul_info_transfer_mrdc_r15:
      HANDLE_CODE(c.get<ul_info_transfer_mrdc_r15_s>().unpack(bref));
      break;
    case types::scg_fail_info_nr_r15:
      HANDLE_CODE(c.get<scg_fail_info_nr_r15_s>().unpack(bref));
      break;
    case types::meas_report_app_layer_r15:
      HANDLE_CODE(c.get<meas_report_app_layer_r15_s>().unpack(bref));
      break;
    case types::fail_info_r15:
      HANDLE_CODE(c.get<fail_info_r15_s>().unpack(bref));
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ul_dcch_msg_type_c::msg_class_ext_c_::c2_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UL-DCCH-Message ::= SEQUENCE
SRSASN_CODE ul_dcch_msg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_dcch_msg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void ul_dcch_msg_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("UL-DCCH-Message");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// InterFreqBandInfo ::= SEQUENCE
SRSASN_CODE inter_freq_band_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(inter_freq_need_for_gaps, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_freq_band_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(inter_freq_need_for_gaps, 1));

  return SRSASN_SUCCESS;
}
void inter_freq_band_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("interFreqNeedForGaps", inter_freq_need_for_gaps);
  j.end_obj();
}

// InterRAT-BandInfo ::= SEQUENCE
SRSASN_CODE inter_rat_band_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(inter_rat_need_for_gaps, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE inter_rat_band_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(inter_rat_need_for_gaps, 1));

  return SRSASN_SUCCESS;
}
void inter_rat_band_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("interRAT-NeedForGaps", inter_rat_need_for_gaps);
  j.end_obj();
}

// BandInfoEUTRA ::= SEQUENCE
SRSASN_CODE band_info_eutra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(inter_rat_band_list_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, inter_freq_band_list, 1, 64));
  if (inter_rat_band_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, inter_rat_band_list, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_info_eutra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(inter_rat_band_list_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(inter_freq_band_list, bref, 1, 64));
  if (inter_rat_band_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(inter_rat_band_list, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void band_info_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("interFreqBandList");
  for (const auto& e1 : inter_freq_band_list) {
    e1.to_json(j);
  }
  j.end_array();
  if (inter_rat_band_list_present) {
    j.start_array("interRAT-BandList");
    for (const auto& e1 : inter_rat_band_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// CA-MIMO-ParametersDL-r10 ::= SEQUENCE
SRSASN_CODE ca_mimo_params_dl_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_mimo_cap_dl_r10_present, 1));

  HANDLE_CODE(ca_bw_class_dl_r10.pack(bref));
  if (supported_mimo_cap_dl_r10_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ca_mimo_params_dl_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_mimo_cap_dl_r10_present, 1));

  HANDLE_CODE(ca_bw_class_dl_r10.unpack(bref));
  if (supported_mimo_cap_dl_r10_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ca_mimo_params_dl_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("ca-BandwidthClassDL-r10", ca_bw_class_dl_r10.to_string());
  if (supported_mimo_cap_dl_r10_present) {
    j.write_str("supportedMIMO-CapabilityDL-r10", supported_mimo_cap_dl_r10.to_string());
  }
  j.end_obj();
}

// CA-MIMO-ParametersUL-r10 ::= SEQUENCE
SRSASN_CODE ca_mimo_params_ul_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_mimo_cap_ul_r10_present, 1));

  HANDLE_CODE(ca_bw_class_ul_r10.pack(bref));
  if (supported_mimo_cap_ul_r10_present) {
    HANDLE_CODE(supported_mimo_cap_ul_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ca_mimo_params_ul_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_mimo_cap_ul_r10_present, 1));

  HANDLE_CODE(ca_bw_class_ul_r10.unpack(bref));
  if (supported_mimo_cap_ul_r10_present) {
    HANDLE_CODE(supported_mimo_cap_ul_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ca_mimo_params_ul_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("ca-BandwidthClassUL-r10", ca_bw_class_ul_r10.to_string());
  if (supported_mimo_cap_ul_r10_present) {
    j.write_str("supportedMIMO-CapabilityUL-r10", supported_mimo_cap_ul_r10.to_string());
  }
  j.end_obj();
}

// BandParameters-r10 ::= SEQUENCE
SRSASN_CODE band_params_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_params_ul_r10_present, 1));
  HANDLE_CODE(bref.pack(band_params_dl_r10_present, 1));

  HANDLE_CODE(pack_integer(bref, band_eutra_r10, (uint8_t)1u, (uint8_t)64u));
  if (band_params_ul_r10_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_params_ul_r10, 1, 16));
  }
  if (band_params_dl_r10_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_params_dl_r10, 1, 16));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_params_ul_r10_present, 1));
  HANDLE_CODE(bref.unpack(band_params_dl_r10_present, 1));

  HANDLE_CODE(unpack_integer(band_eutra_r10, bref, (uint8_t)1u, (uint8_t)64u));
  if (band_params_ul_r10_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_params_ul_r10, bref, 1, 16));
  }
  if (band_params_dl_r10_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_params_dl_r10, bref, 1, 16));
  }

  return SRSASN_SUCCESS;
}
void band_params_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("bandEUTRA-r10", band_eutra_r10);
  if (band_params_ul_r10_present) {
    j.start_array("bandParametersUL-r10");
    for (const auto& e1 : band_params_ul_r10) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (band_params_dl_r10_present) {
    j.start_array("bandParametersDL-r10");
    for (const auto& e1 : band_params_dl_r10) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// BandParameters-r11 ::= SEQUENCE
SRSASN_CODE band_params_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_params_ul_r11_present, 1));
  HANDLE_CODE(bref.pack(band_params_dl_r11_present, 1));
  HANDLE_CODE(bref.pack(supported_csi_proc_r11_present, 1));

  HANDLE_CODE(pack_integer(bref, band_eutra_r11, (uint16_t)1u, (uint16_t)256u));
  if (band_params_ul_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_params_ul_r11, 1, 16));
  }
  if (band_params_dl_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_params_dl_r11, 1, 16));
  }
  if (supported_csi_proc_r11_present) {
    HANDLE_CODE(supported_csi_proc_r11.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_params_ul_r11_present, 1));
  HANDLE_CODE(bref.unpack(band_params_dl_r11_present, 1));
  HANDLE_CODE(bref.unpack(supported_csi_proc_r11_present, 1));

  HANDLE_CODE(unpack_integer(band_eutra_r11, bref, (uint16_t)1u, (uint16_t)256u));
  if (band_params_ul_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_params_ul_r11, bref, 1, 16));
  }
  if (band_params_dl_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_params_dl_r11, bref, 1, 16));
  }
  if (supported_csi_proc_r11_present) {
    HANDLE_CODE(supported_csi_proc_r11.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_params_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("bandEUTRA-r11", band_eutra_r11);
  if (band_params_ul_r11_present) {
    j.start_array("bandParametersUL-r11");
    for (const auto& e1 : band_params_ul_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (band_params_dl_r11_present) {
    j.start_array("bandParametersDL-r11");
    for (const auto& e1 : band_params_dl_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_csi_proc_r11_present) {
    j.write_str("supportedCSI-Proc-r11", supported_csi_proc_r11.to_string());
  }
  j.end_obj();
}

// BandCombinationParameters-r11 ::= SEQUENCE
SRSASN_CODE band_combination_params_r11_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(supported_bw_combination_set_r11_present, 1));
  HANDLE_CODE(bref.pack(multiple_timing_advance_r11_present, 1));
  HANDLE_CODE(bref.pack(simul_rx_tx_r11_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_r11, 1, 64));
  if (supported_bw_combination_set_r11_present) {
    HANDLE_CODE(supported_bw_combination_set_r11.pack(bref));
  }
  HANDLE_CODE(band_info_eutra_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_r11_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(supported_bw_combination_set_r11_present, 1));
  HANDLE_CODE(bref.unpack(multiple_timing_advance_r11_present, 1));
  HANDLE_CODE(bref.unpack(simul_rx_tx_r11_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(band_param_list_r11, bref, 1, 64));
  if (supported_bw_combination_set_r11_present) {
    HANDLE_CODE(supported_bw_combination_set_r11.unpack(bref));
  }
  HANDLE_CODE(band_info_eutra_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void band_combination_params_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("bandParameterList-r11");
  for (const auto& e1 : band_param_list_r11) {
    e1.to_json(j);
  }
  j.end_array();
  if (supported_bw_combination_set_r11_present) {
    j.write_str("supportedBandwidthCombinationSet-r11", supported_bw_combination_set_r11.to_string());
  }
  if (multiple_timing_advance_r11_present) {
    j.write_str("multipleTimingAdvance-r11", "supported");
  }
  if (simul_rx_tx_r11_present) {
    j.write_str("simultaneousRx-Tx-r11", "supported");
  }
  j.write_fieldname("bandInfoEUTRA-r11");
  band_info_eutra_r11.to_json(j);
  j.end_obj();
}

// IntraBandContiguousCC-Info-r12 ::= SEQUENCE
SRSASN_CODE intra_band_contiguous_cc_info_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(four_layer_tm3_tm4_per_cc_r12_present, 1));
  HANDLE_CODE(bref.pack(supported_mimo_cap_dl_r12_present, 1));
  HANDLE_CODE(bref.pack(supported_csi_proc_r12_present, 1));

  if (supported_mimo_cap_dl_r12_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r12.pack(bref));
  }
  if (supported_csi_proc_r12_present) {
    HANDLE_CODE(supported_csi_proc_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE intra_band_contiguous_cc_info_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(four_layer_tm3_tm4_per_cc_r12_present, 1));
  HANDLE_CODE(bref.unpack(supported_mimo_cap_dl_r12_present, 1));
  HANDLE_CODE(bref.unpack(supported_csi_proc_r12_present, 1));

  if (supported_mimo_cap_dl_r12_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r12.unpack(bref));
  }
  if (supported_csi_proc_r12_present) {
    HANDLE_CODE(supported_csi_proc_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void intra_band_contiguous_cc_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (four_layer_tm3_tm4_per_cc_r12_present) {
    j.write_str("fourLayerTM3-TM4-perCC-r12", "supported");
  }
  if (supported_mimo_cap_dl_r12_present) {
    j.write_str("supportedMIMO-CapabilityDL-r12", supported_mimo_cap_dl_r12.to_string());
  }
  if (supported_csi_proc_r12_present) {
    j.write_str("supportedCSI-Proc-r12", supported_csi_proc_r12.to_string());
  }
  j.end_obj();
}

// CA-MIMO-ParametersDL-r13 ::= SEQUENCE
SRSASN_CODE ca_mimo_params_dl_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_mimo_cap_dl_r13_present, 1));
  HANDLE_CODE(bref.pack(four_layer_tm3_tm4_r13_present, 1));

  HANDLE_CODE(ca_bw_class_dl_r13.pack(bref));
  if (supported_mimo_cap_dl_r13_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r13.pack(bref));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, intra_band_contiguous_cc_info_list_r13, 1, 32));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ca_mimo_params_dl_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_mimo_cap_dl_r13_present, 1));
  HANDLE_CODE(bref.unpack(four_layer_tm3_tm4_r13_present, 1));

  HANDLE_CODE(ca_bw_class_dl_r13.unpack(bref));
  if (supported_mimo_cap_dl_r13_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r13.unpack(bref));
  }
  HANDLE_CODE(unpack_dyn_seq_of(intra_band_contiguous_cc_info_list_r13, bref, 1, 32));

  return SRSASN_SUCCESS;
}
void ca_mimo_params_dl_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("ca-BandwidthClassDL-r13", ca_bw_class_dl_r13.to_string());
  if (supported_mimo_cap_dl_r13_present) {
    j.write_str("supportedMIMO-CapabilityDL-r13", supported_mimo_cap_dl_r13.to_string());
  }
  if (four_layer_tm3_tm4_r13_present) {
    j.write_str("fourLayerTM3-TM4-r13", "supported");
  }
  j.start_array("intraBandContiguousCC-InfoList-r13");
  for (const auto& e1 : intra_band_contiguous_cc_info_list_r13) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// BandParameters-r13 ::= SEQUENCE
SRSASN_CODE band_params_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_params_ul_r13_present, 1));
  HANDLE_CODE(bref.pack(band_params_dl_r13_present, 1));
  HANDLE_CODE(bref.pack(supported_csi_proc_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, band_eutra_r13, (uint16_t)1u, (uint16_t)256u));
  if (band_params_ul_r13_present) {
    HANDLE_CODE(band_params_ul_r13.pack(bref));
  }
  if (band_params_dl_r13_present) {
    HANDLE_CODE(band_params_dl_r13.pack(bref));
  }
  if (supported_csi_proc_r13_present) {
    HANDLE_CODE(supported_csi_proc_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_params_ul_r13_present, 1));
  HANDLE_CODE(bref.unpack(band_params_dl_r13_present, 1));
  HANDLE_CODE(bref.unpack(supported_csi_proc_r13_present, 1));

  HANDLE_CODE(unpack_integer(band_eutra_r13, bref, (uint16_t)1u, (uint16_t)256u));
  if (band_params_ul_r13_present) {
    HANDLE_CODE(band_params_ul_r13.unpack(bref));
  }
  if (band_params_dl_r13_present) {
    HANDLE_CODE(band_params_dl_r13.unpack(bref));
  }
  if (supported_csi_proc_r13_present) {
    HANDLE_CODE(supported_csi_proc_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_params_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("bandEUTRA-r13", band_eutra_r13);
  if (band_params_ul_r13_present) {
    j.write_fieldname("bandParametersUL-r13");
    band_params_ul_r13.to_json(j);
  }
  if (band_params_dl_r13_present) {
    j.write_fieldname("bandParametersDL-r13");
    band_params_dl_r13.to_json(j);
  }
  if (supported_csi_proc_r13_present) {
    j.write_str("supportedCSI-Proc-r13", supported_csi_proc_r13.to_string());
  }
  j.end_obj();
}

// BandCombinationParameters-r13 ::= SEQUENCE
SRSASN_CODE band_combination_params_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(different_fallback_supported_r13_present, 1));
  HANDLE_CODE(bref.pack(supported_bw_combination_set_r13_present, 1));
  HANDLE_CODE(bref.pack(multiple_timing_advance_r13_present, 1));
  HANDLE_CODE(bref.pack(simul_rx_tx_r13_present, 1));
  HANDLE_CODE(bref.pack(dc_support_r13_present, 1));
  HANDLE_CODE(bref.pack(supported_naics_minus2_crs_ap_r13_present, 1));
  HANDLE_CODE(bref.pack(comm_supported_bands_per_bc_r13_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_r13, 1, 64));
  if (supported_bw_combination_set_r13_present) {
    HANDLE_CODE(supported_bw_combination_set_r13.pack(bref));
  }
  HANDLE_CODE(band_info_eutra_r13.pack(bref));
  if (dc_support_r13_present) {
    HANDLE_CODE(bref.pack(dc_support_r13.async_r13_present, 1));
    HANDLE_CODE(bref.pack(dc_support_r13.supported_cell_grouping_r13_present, 1));
    if (dc_support_r13.supported_cell_grouping_r13_present) {
      HANDLE_CODE(dc_support_r13.supported_cell_grouping_r13.pack(bref));
    }
  }
  if (supported_naics_minus2_crs_ap_r13_present) {
    HANDLE_CODE(supported_naics_minus2_crs_ap_r13.pack(bref));
  }
  if (comm_supported_bands_per_bc_r13_present) {
    HANDLE_CODE(comm_supported_bands_per_bc_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(different_fallback_supported_r13_present, 1));
  HANDLE_CODE(bref.unpack(supported_bw_combination_set_r13_present, 1));
  HANDLE_CODE(bref.unpack(multiple_timing_advance_r13_present, 1));
  HANDLE_CODE(bref.unpack(simul_rx_tx_r13_present, 1));
  HANDLE_CODE(bref.unpack(dc_support_r13_present, 1));
  HANDLE_CODE(bref.unpack(supported_naics_minus2_crs_ap_r13_present, 1));
  HANDLE_CODE(bref.unpack(comm_supported_bands_per_bc_r13_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(band_param_list_r13, bref, 1, 64));
  if (supported_bw_combination_set_r13_present) {
    HANDLE_CODE(supported_bw_combination_set_r13.unpack(bref));
  }
  HANDLE_CODE(band_info_eutra_r13.unpack(bref));
  if (dc_support_r13_present) {
    HANDLE_CODE(bref.unpack(dc_support_r13.async_r13_present, 1));
    HANDLE_CODE(bref.unpack(dc_support_r13.supported_cell_grouping_r13_present, 1));
    if (dc_support_r13.supported_cell_grouping_r13_present) {
      HANDLE_CODE(dc_support_r13.supported_cell_grouping_r13.unpack(bref));
    }
  }
  if (supported_naics_minus2_crs_ap_r13_present) {
    HANDLE_CODE(supported_naics_minus2_crs_ap_r13.unpack(bref));
  }
  if (comm_supported_bands_per_bc_r13_present) {
    HANDLE_CODE(comm_supported_bands_per_bc_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (different_fallback_supported_r13_present) {
    j.write_str("differentFallbackSupported-r13", "true");
  }
  j.start_array("bandParameterList-r13");
  for (const auto& e1 : band_param_list_r13) {
    e1.to_json(j);
  }
  j.end_array();
  if (supported_bw_combination_set_r13_present) {
    j.write_str("supportedBandwidthCombinationSet-r13", supported_bw_combination_set_r13.to_string());
  }
  if (multiple_timing_advance_r13_present) {
    j.write_str("multipleTimingAdvance-r13", "supported");
  }
  if (simul_rx_tx_r13_present) {
    j.write_str("simultaneousRx-Tx-r13", "supported");
  }
  j.write_fieldname("bandInfoEUTRA-r13");
  band_info_eutra_r13.to_json(j);
  if (dc_support_r13_present) {
    j.write_fieldname("dc-Support-r13");
    j.start_obj();
    if (dc_support_r13.async_r13_present) {
      j.write_str("asynchronous-r13", "supported");
    }
    if (dc_support_r13.supported_cell_grouping_r13_present) {
      j.write_fieldname("supportedCellGrouping-r13");
      dc_support_r13.supported_cell_grouping_r13.to_json(j);
    }
    j.end_obj();
  }
  if (supported_naics_minus2_crs_ap_r13_present) {
    j.write_str("supportedNAICS-2CRS-AP-r13", supported_naics_minus2_crs_ap_r13.to_string());
  }
  if (comm_supported_bands_per_bc_r13_present) {
    j.write_str("commSupportedBandsPerBC-r13", comm_supported_bands_per_bc_r13.to_string());
  }
  j.end_obj();
}

void band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_::destroy_()
{
  switch (type_) {
    case types::three_entries_r13:
      c.destroy<fixed_bitstring<3> >();
      break;
    case types::four_entries_r13:
      c.destroy<fixed_bitstring<7> >();
      break;
    case types::five_entries_r13:
      c.destroy<fixed_bitstring<15> >();
      break;
    default:
      break;
  }
}
void band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::three_entries_r13:
      c.init<fixed_bitstring<3> >();
      break;
    case types::four_entries_r13:
      c.init<fixed_bitstring<7> >();
      break;
    case types::five_entries_r13:
      c.init<fixed_bitstring<15> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_");
  }
}
band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_::supported_cell_grouping_r13_c_(
    const band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::three_entries_r13:
      c.init(other.c.get<fixed_bitstring<3> >());
      break;
    case types::four_entries_r13:
      c.init(other.c.get<fixed_bitstring<7> >());
      break;
    case types::five_entries_r13:
      c.init(other.c.get<fixed_bitstring<15> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_");
  }
}
band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_&
band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_::
operator=(const band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::three_entries_r13:
      c.set(other.c.get<fixed_bitstring<3> >());
      break;
    case types::four_entries_r13:
      c.set(other.c.get<fixed_bitstring<7> >());
      break;
    case types::five_entries_r13:
      c.set(other.c.get<fixed_bitstring<15> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_");
  }

  return *this;
}
void band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::three_entries_r13:
      j.write_str("threeEntries-r13", c.get<fixed_bitstring<3> >().to_string());
      break;
    case types::four_entries_r13:
      j.write_str("fourEntries-r13", c.get<fixed_bitstring<7> >().to_string());
      break;
    case types::five_entries_r13:
      j.write_str("fiveEntries-r13", c.get<fixed_bitstring<15> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_, "band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_");
  }
  j.end_obj();
}
SRSASN_CODE band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::three_entries_r13:
      HANDLE_CODE(c.get<fixed_bitstring<3> >().pack(bref));
      break;
    case types::four_entries_r13:
      HANDLE_CODE(c.get<fixed_bitstring<7> >().pack(bref));
      break;
    case types::five_entries_r13:
      HANDLE_CODE(c.get<fixed_bitstring<15> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::three_entries_r13:
      HANDLE_CODE(c.get<fixed_bitstring<3> >().unpack(bref));
      break;
    case types::four_entries_r13:
      HANDLE_CODE(c.get<fixed_bitstring<7> >().unpack(bref));
      break;
    case types::five_entries_r13:
      HANDLE_CODE(c.get<fixed_bitstring<15> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "band_combination_params_r13_s::dc_support_r13_s_::supported_cell_grouping_r13_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// BandParameters-v1090 ::= SEQUENCE
SRSASN_CODE band_params_v1090_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(band_eutra_v1090_present, 1));

  if (band_eutra_v1090_present) {
    HANDLE_CODE(pack_integer(bref, band_eutra_v1090, (uint16_t)65u, (uint16_t)256u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1090_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(band_eutra_v1090_present, 1));

  if (band_eutra_v1090_present) {
    HANDLE_CODE(unpack_integer(band_eutra_v1090, bref, (uint16_t)65u, (uint16_t)256u));
  }

  return SRSASN_SUCCESS;
}
void band_params_v1090_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_eutra_v1090_present) {
    j.write_int("bandEUTRA-v1090", band_eutra_v1090);
  }
  j.end_obj();
}

// CA-MIMO-ParametersDL-v10i0 ::= SEQUENCE
SRSASN_CODE ca_mimo_params_dl_v10i0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(four_layer_tm3_tm4_r10_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ca_mimo_params_dl_v10i0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(four_layer_tm3_tm4_r10_present, 1));

  return SRSASN_SUCCESS;
}
void ca_mimo_params_dl_v10i0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (four_layer_tm3_tm4_r10_present) {
    j.write_str("fourLayerTM3-TM4-r10", "supported");
  }
  j.end_obj();
}

// BandParameters-v10i0 ::= SEQUENCE
SRSASN_CODE band_params_v10i0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, band_params_dl_v10i0, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v10i0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(band_params_dl_v10i0, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void band_params_v10i0_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("bandParametersDL-v10i0");
  for (const auto& e1 : band_params_dl_v10i0) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// BandCombinationParameters-v10i0 ::= SEQUENCE
SRSASN_CODE band_combination_params_v10i0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_param_list_v10i0_present, 1));

  if (band_param_list_v10i0_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_v10i0, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v10i0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_param_list_v10i0_present, 1));

  if (band_param_list_v10i0_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_v10i0, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v10i0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_param_list_v10i0_present) {
    j.start_array("bandParameterList-v10i0");
    for (const auto& e1 : band_param_list_v10i0) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// BandParameters-v1130 ::= SEQUENCE
SRSASN_CODE band_params_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(supported_csi_proc_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(supported_csi_proc_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void band_params_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("supportedCSI-Proc-r11", supported_csi_proc_r11.to_string());
  j.end_obj();
}

// BandCombinationParameters-v1130 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1130_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(multiple_timing_advance_r11_present, 1));
  HANDLE_CODE(bref.pack(simul_rx_tx_r11_present, 1));
  HANDLE_CODE(bref.pack(band_param_list_r11_present, 1));

  if (band_param_list_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_r11, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1130_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(multiple_timing_advance_r11_present, 1));
  HANDLE_CODE(bref.unpack(simul_rx_tx_r11_present, 1));
  HANDLE_CODE(bref.unpack(band_param_list_r11_present, 1));

  if (band_param_list_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_r11, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (multiple_timing_advance_r11_present) {
    j.write_str("multipleTimingAdvance-r11", "supported");
  }
  if (simul_rx_tx_r11_present) {
    j.write_str("simultaneousRx-Tx-r11", "supported");
  }
  if (band_param_list_r11_present) {
    j.start_array("bandParameterList-r11");
    for (const auto& e1 : band_param_list_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// BandCombinationParameters-v1250 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1250_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(dc_support_r12_present, 1));
  HANDLE_CODE(bref.pack(supported_naics_minus2_crs_ap_r12_present, 1));
  HANDLE_CODE(bref.pack(comm_supported_bands_per_bc_r12_present, 1));

  if (dc_support_r12_present) {
    HANDLE_CODE(bref.pack(dc_support_r12.async_r12_present, 1));
    HANDLE_CODE(bref.pack(dc_support_r12.supported_cell_grouping_r12_present, 1));
    if (dc_support_r12.supported_cell_grouping_r12_present) {
      HANDLE_CODE(dc_support_r12.supported_cell_grouping_r12.pack(bref));
    }
  }
  if (supported_naics_minus2_crs_ap_r12_present) {
    HANDLE_CODE(supported_naics_minus2_crs_ap_r12.pack(bref));
  }
  if (comm_supported_bands_per_bc_r12_present) {
    HANDLE_CODE(comm_supported_bands_per_bc_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1250_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(dc_support_r12_present, 1));
  HANDLE_CODE(bref.unpack(supported_naics_minus2_crs_ap_r12_present, 1));
  HANDLE_CODE(bref.unpack(comm_supported_bands_per_bc_r12_present, 1));

  if (dc_support_r12_present) {
    HANDLE_CODE(bref.unpack(dc_support_r12.async_r12_present, 1));
    HANDLE_CODE(bref.unpack(dc_support_r12.supported_cell_grouping_r12_present, 1));
    if (dc_support_r12.supported_cell_grouping_r12_present) {
      HANDLE_CODE(dc_support_r12.supported_cell_grouping_r12.unpack(bref));
    }
  }
  if (supported_naics_minus2_crs_ap_r12_present) {
    HANDLE_CODE(supported_naics_minus2_crs_ap_r12.unpack(bref));
  }
  if (comm_supported_bands_per_bc_r12_present) {
    HANDLE_CODE(comm_supported_bands_per_bc_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dc_support_r12_present) {
    j.write_fieldname("dc-Support-r12");
    j.start_obj();
    if (dc_support_r12.async_r12_present) {
      j.write_str("asynchronous-r12", "supported");
    }
    if (dc_support_r12.supported_cell_grouping_r12_present) {
      j.write_fieldname("supportedCellGrouping-r12");
      dc_support_r12.supported_cell_grouping_r12.to_json(j);
    }
    j.end_obj();
  }
  if (supported_naics_minus2_crs_ap_r12_present) {
    j.write_str("supportedNAICS-2CRS-AP-r12", supported_naics_minus2_crs_ap_r12.to_string());
  }
  if (comm_supported_bands_per_bc_r12_present) {
    j.write_str("commSupportedBandsPerBC-r12", comm_supported_bands_per_bc_r12.to_string());
  }
  j.end_obj();
}

void band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_::destroy_()
{
  switch (type_) {
    case types::three_entries_r12:
      c.destroy<fixed_bitstring<3> >();
      break;
    case types::four_entries_r12:
      c.destroy<fixed_bitstring<7> >();
      break;
    case types::five_entries_r12:
      c.destroy<fixed_bitstring<15> >();
      break;
    default:
      break;
  }
}
void band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::three_entries_r12:
      c.init<fixed_bitstring<3> >();
      break;
    case types::four_entries_r12:
      c.init<fixed_bitstring<7> >();
      break;
    case types::five_entries_r12:
      c.init<fixed_bitstring<15> >();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_");
  }
}
band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_::supported_cell_grouping_r12_c_(
    const band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::three_entries_r12:
      c.init(other.c.get<fixed_bitstring<3> >());
      break;
    case types::four_entries_r12:
      c.init(other.c.get<fixed_bitstring<7> >());
      break;
    case types::five_entries_r12:
      c.init(other.c.get<fixed_bitstring<15> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_");
  }
}
band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_&
band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_::
operator=(const band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::three_entries_r12:
      c.set(other.c.get<fixed_bitstring<3> >());
      break;
    case types::four_entries_r12:
      c.set(other.c.get<fixed_bitstring<7> >());
      break;
    case types::five_entries_r12:
      c.set(other.c.get<fixed_bitstring<15> >());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_,
                            "band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_");
  }

  return *this;
}
void band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::three_entries_r12:
      j.write_str("threeEntries-r12", c.get<fixed_bitstring<3> >().to_string());
      break;
    case types::four_entries_r12:
      j.write_str("fourEntries-r12", c.get<fixed_bitstring<7> >().to_string());
      break;
    case types::five_entries_r12:
      j.write_str("fiveEntries-r12", c.get<fixed_bitstring<15> >().to_string());
      break;
    default:
      log_invalid_choice_id(type_,
                            "band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_");
  }
  j.end_obj();
}
SRSASN_CODE
band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::three_entries_r12:
      HANDLE_CODE(c.get<fixed_bitstring<3> >().pack(bref));
      break;
    case types::four_entries_r12:
      HANDLE_CODE(c.get<fixed_bitstring<7> >().pack(bref));
      break;
    case types::five_entries_r12:
      HANDLE_CODE(c.get<fixed_bitstring<15> >().pack(bref));
      break;
    default:
      log_invalid_choice_id(type_,
                            "band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::three_entries_r12:
      HANDLE_CODE(c.get<fixed_bitstring<3> >().unpack(bref));
      break;
    case types::four_entries_r12:
      HANDLE_CODE(c.get<fixed_bitstring<7> >().unpack(bref));
      break;
    case types::five_entries_r12:
      HANDLE_CODE(c.get<fixed_bitstring<15> >().unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_,
                            "band_combination_params_v1250_s::dc_support_r12_s_::supported_cell_grouping_r12_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// CA-MIMO-ParametersDL-v1270 ::= SEQUENCE
SRSASN_CODE ca_mimo_params_dl_v1270_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, intra_band_contiguous_cc_info_list_r12, 1, 5));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ca_mimo_params_dl_v1270_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(intra_band_contiguous_cc_info_list_r12, bref, 1, 5));

  return SRSASN_SUCCESS;
}
void ca_mimo_params_dl_v1270_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("intraBandContiguousCC-InfoList-r12");
  for (const auto& e1 : intra_band_contiguous_cc_info_list_r12) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// BandParameters-v1270 ::= SEQUENCE
SRSASN_CODE band_params_v1270_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, band_params_dl_v1270, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1270_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(band_params_dl_v1270, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void band_params_v1270_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("bandParametersDL-v1270");
  for (const auto& e1 : band_params_dl_v1270) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// BandCombinationParameters-v1270 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1270_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_param_list_v1270_present, 1));

  if (band_param_list_v1270_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_v1270, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1270_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_param_list_v1270_present, 1));

  if (band_param_list_v1270_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_v1270, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1270_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_param_list_v1270_present) {
    j.start_array("bandParameterList-v1270");
    for (const auto& e1 : band_param_list_v1270) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// MIMO-BeamformedCapabilities-r13 ::= SEQUENCE
SRSASN_CODE mimo_bf_cap_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(n_max_list_r13_present, 1));

  HANDLE_CODE(pack_integer(bref, k_max_r13, (uint8_t)1u, (uint8_t)8u));
  if (n_max_list_r13_present) {
    HANDLE_CODE(n_max_list_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_bf_cap_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(n_max_list_r13_present, 1));

  HANDLE_CODE(unpack_integer(k_max_r13, bref, (uint8_t)1u, (uint8_t)8u));
  if (n_max_list_r13_present) {
    HANDLE_CODE(n_max_list_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_bf_cap_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("k-Max-r13", k_max_r13);
  if (n_max_list_r13_present) {
    j.write_str("n-MaxList-r13", n_max_list_r13.to_string());
  }
  j.end_obj();
}

// MIMO-NonPrecodedCapabilities-r13 ::= SEQUENCE
SRSASN_CODE mimo_non_precoded_cap_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cfg1_r13_present, 1));
  HANDLE_CODE(bref.pack(cfg2_r13_present, 1));
  HANDLE_CODE(bref.pack(cfg3_r13_present, 1));
  HANDLE_CODE(bref.pack(cfg4_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_non_precoded_cap_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cfg1_r13_present, 1));
  HANDLE_CODE(bref.unpack(cfg2_r13_present, 1));
  HANDLE_CODE(bref.unpack(cfg3_r13_present, 1));
  HANDLE_CODE(bref.unpack(cfg4_r13_present, 1));

  return SRSASN_SUCCESS;
}
void mimo_non_precoded_cap_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cfg1_r13_present) {
    j.write_str("config1-r13", "supported");
  }
  if (cfg2_r13_present) {
    j.write_str("config2-r13", "supported");
  }
  if (cfg3_r13_present) {
    j.write_str("config3-r13", "supported");
  }
  if (cfg4_r13_present) {
    j.write_str("config4-r13", "supported");
  }
  j.end_obj();
}

// MIMO-CA-ParametersPerBoBCPerTM-r13 ::= SEQUENCE
SRSASN_CODE mimo_ca_params_per_bo_bc_per_tm_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_precoded_r13_present, 1));
  HANDLE_CODE(bref.pack(bf_r13_present, 1));
  HANDLE_CODE(bref.pack(dmrs_enhance_r13_present, 1));

  if (non_precoded_r13_present) {
    HANDLE_CODE(non_precoded_r13.pack(bref));
  }
  if (bf_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, bf_r13, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ca_params_per_bo_bc_per_tm_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_precoded_r13_present, 1));
  HANDLE_CODE(bref.unpack(bf_r13_present, 1));
  HANDLE_CODE(bref.unpack(dmrs_enhance_r13_present, 1));

  if (non_precoded_r13_present) {
    HANDLE_CODE(non_precoded_r13.unpack(bref));
  }
  if (bf_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(bf_r13, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void mimo_ca_params_per_bo_bc_per_tm_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_precoded_r13_present) {
    j.write_fieldname("nonPrecoded-r13");
    non_precoded_r13.to_json(j);
  }
  if (bf_r13_present) {
    j.start_array("beamformed-r13");
    for (const auto& e1 : bf_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (dmrs_enhance_r13_present) {
    j.write_str("dmrs-Enhancements-r13", "different");
  }
  j.end_obj();
}

// MIMO-CA-ParametersPerBoBC-r13 ::= SEQUENCE
SRSASN_CODE mimo_ca_params_per_bo_bc_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(params_tm9_r13_present, 1));
  HANDLE_CODE(bref.pack(params_tm10_r13_present, 1));

  if (params_tm9_r13_present) {
    HANDLE_CODE(params_tm9_r13.pack(bref));
  }
  if (params_tm10_r13_present) {
    HANDLE_CODE(params_tm10_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ca_params_per_bo_bc_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(params_tm9_r13_present, 1));
  HANDLE_CODE(bref.unpack(params_tm10_r13_present, 1));

  if (params_tm9_r13_present) {
    HANDLE_CODE(params_tm9_r13.unpack(bref));
  }
  if (params_tm10_r13_present) {
    HANDLE_CODE(params_tm10_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ca_params_per_bo_bc_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (params_tm9_r13_present) {
    j.write_fieldname("parametersTM9-r13");
    params_tm9_r13.to_json(j);
  }
  if (params_tm10_r13_present) {
    j.write_fieldname("parametersTM10-r13");
    params_tm10_r13.to_json(j);
  }
  j.end_obj();
}

// BandParameters-v1320 ::= SEQUENCE
SRSASN_CODE band_params_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(band_params_dl_v1320.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(band_params_dl_v1320.unpack(bref));

  return SRSASN_SUCCESS;
}
void band_params_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("bandParametersDL-v1320");
  band_params_dl_v1320.to_json(j);
  j.end_obj();
}

// BandCombinationParameters-v1320 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_param_list_v1320_present, 1));
  HANDLE_CODE(bref.pack(add_rx_tx_performance_req_r13_present, 1));

  if (band_param_list_v1320_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_v1320, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_param_list_v1320_present, 1));
  HANDLE_CODE(bref.unpack(add_rx_tx_performance_req_r13_present, 1));

  if (band_param_list_v1320_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_v1320, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_param_list_v1320_present) {
    j.start_array("bandParameterList-v1320");
    for (const auto& e1 : band_param_list_v1320) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (add_rx_tx_performance_req_r13_present) {
    j.write_str("additionalRx-Tx-PerformanceReq-r13", "supported");
  }
  j.end_obj();
}

// BandParameters-v1380 ::= SEQUENCE
SRSASN_CODE band_params_v1380_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(tx_ant_switch_dl_r13_present, 1));
  HANDLE_CODE(bref.pack(tx_ant_switch_ul_r13_present, 1));

  if (tx_ant_switch_dl_r13_present) {
    HANDLE_CODE(pack_integer(bref, tx_ant_switch_dl_r13, (uint8_t)1u, (uint8_t)32u));
  }
  if (tx_ant_switch_ul_r13_present) {
    HANDLE_CODE(pack_integer(bref, tx_ant_switch_ul_r13, (uint8_t)1u, (uint8_t)32u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1380_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(tx_ant_switch_dl_r13_present, 1));
  HANDLE_CODE(bref.unpack(tx_ant_switch_ul_r13_present, 1));

  if (tx_ant_switch_dl_r13_present) {
    HANDLE_CODE(unpack_integer(tx_ant_switch_dl_r13, bref, (uint8_t)1u, (uint8_t)32u));
  }
  if (tx_ant_switch_ul_r13_present) {
    HANDLE_CODE(unpack_integer(tx_ant_switch_ul_r13, bref, (uint8_t)1u, (uint8_t)32u));
  }

  return SRSASN_SUCCESS;
}
void band_params_v1380_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (tx_ant_switch_dl_r13_present) {
    j.write_int("txAntennaSwitchDL-r13", tx_ant_switch_dl_r13);
  }
  if (tx_ant_switch_ul_r13_present) {
    j.write_int("txAntennaSwitchUL-r13", tx_ant_switch_ul_r13);
  }
  j.end_obj();
}

// BandCombinationParameters-v1380 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1380_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_param_list_v1380_present, 1));

  if (band_param_list_v1380_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_v1380, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1380_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_param_list_v1380_present, 1));

  if (band_param_list_v1380_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_v1380, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1380_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_param_list_v1380_present) {
    j.start_array("bandParameterList-v1380");
    for (const auto& e1 : band_param_list_v1380) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// MIMO-CA-ParametersPerBoBCPerTM-v1430 ::= SEQUENCE
SRSASN_CODE mimo_ca_params_per_bo_bc_per_tm_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_report_np_r14_present, 1));
  HANDLE_CODE(bref.pack(csi_report_advanced_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ca_params_per_bo_bc_per_tm_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_report_np_r14_present, 1));
  HANDLE_CODE(bref.unpack(csi_report_advanced_r14_present, 1));

  return SRSASN_SUCCESS;
}
void mimo_ca_params_per_bo_bc_per_tm_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_report_np_r14_present) {
    j.write_str("csi-ReportingNP-r14", "different");
  }
  if (csi_report_advanced_r14_present) {
    j.write_str("csi-ReportingAdvanced-r14", "different");
  }
  j.end_obj();
}

// MIMO-CA-ParametersPerBoBC-v1430 ::= SEQUENCE
SRSASN_CODE mimo_ca_params_per_bo_bc_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(params_tm9_v1430_present, 1));
  HANDLE_CODE(bref.pack(params_tm10_v1430_present, 1));

  if (params_tm9_v1430_present) {
    HANDLE_CODE(params_tm9_v1430.pack(bref));
  }
  if (params_tm10_v1430_present) {
    HANDLE_CODE(params_tm10_v1430.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ca_params_per_bo_bc_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(params_tm9_v1430_present, 1));
  HANDLE_CODE(bref.unpack(params_tm10_v1430_present, 1));

  if (params_tm9_v1430_present) {
    HANDLE_CODE(params_tm9_v1430.unpack(bref));
  }
  if (params_tm10_v1430_present) {
    HANDLE_CODE(params_tm10_v1430.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ca_params_per_bo_bc_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (params_tm9_v1430_present) {
    j.write_fieldname("parametersTM9-v1430");
    params_tm9_v1430.to_json(j);
  }
  if (params_tm10_v1430_present) {
    j.write_fieldname("parametersTM10-v1430");
    params_tm10_v1430.to_json(j);
  }
  j.end_obj();
}

// RetuningTimeInfo-r14 ::= SEQUENCE
SRSASN_CODE retuning_time_info_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(retuning_info.rf_retuning_time_dl_r14_present, 1));
  HANDLE_CODE(bref.pack(retuning_info.rf_retuning_time_ul_r14_present, 1));
  if (retuning_info.rf_retuning_time_dl_r14_present) {
    HANDLE_CODE(retuning_info.rf_retuning_time_dl_r14.pack(bref));
  }
  if (retuning_info.rf_retuning_time_ul_r14_present) {
    HANDLE_CODE(retuning_info.rf_retuning_time_ul_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE retuning_time_info_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(retuning_info.rf_retuning_time_dl_r14_present, 1));
  HANDLE_CODE(bref.unpack(retuning_info.rf_retuning_time_ul_r14_present, 1));
  if (retuning_info.rf_retuning_time_dl_r14_present) {
    HANDLE_CODE(retuning_info.rf_retuning_time_dl_r14.unpack(bref));
  }
  if (retuning_info.rf_retuning_time_ul_r14_present) {
    HANDLE_CODE(retuning_info.rf_retuning_time_ul_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void retuning_time_info_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("retuningInfo");
  j.start_obj();
  if (retuning_info.rf_retuning_time_dl_r14_present) {
    j.write_str("rf-RetuningTimeDL-r14", retuning_info.rf_retuning_time_dl_r14.to_string());
  }
  if (retuning_info.rf_retuning_time_ul_r14_present) {
    j.write_str("rf-RetuningTimeUL-r14", retuning_info.rf_retuning_time_ul_r14.to_string());
  }
  j.end_obj();
  j.end_obj();
}

// UL-256QAM-perCC-Info-r14 ::= SEQUENCE
SRSASN_CODE ul_minus256_qam_per_cc_info_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ul_minus256_qam_per_cc_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ul_minus256_qam_per_cc_info_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ul_minus256_qam_per_cc_r14_present, 1));

  return SRSASN_SUCCESS;
}
void ul_minus256_qam_per_cc_info_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ul_minus256_qam_per_cc_r14_present) {
    j.write_str("ul-256QAM-perCC-r14", "supported");
  }
  j.end_obj();
}

// BandParameters-v1430 ::= SEQUENCE
SRSASN_CODE band_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_params_dl_v1430_present, 1));
  HANDLE_CODE(bref.pack(ul_minus256_qam_r14_present, 1));
  HANDLE_CODE(bref.pack(ul_minus256_qam_per_cc_info_list_r14_present, 1));
  HANDLE_CODE(bref.pack(retuning_time_info_band_list_r14_present, 1));

  if (band_params_dl_v1430_present) {
    HANDLE_CODE(band_params_dl_v1430.pack(bref));
  }
  if (ul_minus256_qam_per_cc_info_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, ul_minus256_qam_per_cc_info_list_r14, 2, 32));
  }
  if (retuning_time_info_band_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, retuning_time_info_band_list_r14, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_params_dl_v1430_present, 1));
  HANDLE_CODE(bref.unpack(ul_minus256_qam_r14_present, 1));
  HANDLE_CODE(bref.unpack(ul_minus256_qam_per_cc_info_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(retuning_time_info_band_list_r14_present, 1));

  if (band_params_dl_v1430_present) {
    HANDLE_CODE(band_params_dl_v1430.unpack(bref));
  }
  if (ul_minus256_qam_per_cc_info_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(ul_minus256_qam_per_cc_info_list_r14, bref, 2, 32));
  }
  if (retuning_time_info_band_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(retuning_time_info_band_list_r14, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void band_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_params_dl_v1430_present) {
    j.write_fieldname("bandParametersDL-v1430");
    band_params_dl_v1430.to_json(j);
  }
  if (ul_minus256_qam_r14_present) {
    j.write_str("ul-256QAM-r14", "supported");
  }
  if (ul_minus256_qam_per_cc_info_list_r14_present) {
    j.start_array("ul-256QAM-perCC-InfoList-r14");
    for (const auto& e1 : ul_minus256_qam_per_cc_info_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (retuning_time_info_band_list_r14_present) {
    j.start_array("retuningTimeInfoBandList-r14");
    for (const auto& e1 : retuning_time_info_band_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// BandCombinationParameters-v1430 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_param_list_v1430_present, 1));
  HANDLE_CODE(bref.pack(v2x_supported_tx_band_comb_list_per_bc_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_supported_rx_band_comb_list_per_bc_r14_present, 1));

  if (band_param_list_v1430_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_v1430, 1, 64));
  }
  if (v2x_supported_tx_band_comb_list_per_bc_r14_present) {
    HANDLE_CODE(v2x_supported_tx_band_comb_list_per_bc_r14.pack(bref));
  }
  if (v2x_supported_rx_band_comb_list_per_bc_r14_present) {
    HANDLE_CODE(v2x_supported_rx_band_comb_list_per_bc_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_param_list_v1430_present, 1));
  HANDLE_CODE(bref.unpack(v2x_supported_tx_band_comb_list_per_bc_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_supported_rx_band_comb_list_per_bc_r14_present, 1));

  if (band_param_list_v1430_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_v1430, bref, 1, 64));
  }
  if (v2x_supported_tx_band_comb_list_per_bc_r14_present) {
    HANDLE_CODE(v2x_supported_tx_band_comb_list_per_bc_r14.unpack(bref));
  }
  if (v2x_supported_rx_band_comb_list_per_bc_r14_present) {
    HANDLE_CODE(v2x_supported_rx_band_comb_list_per_bc_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_param_list_v1430_present) {
    j.start_array("bandParameterList-v1430");
    for (const auto& e1 : band_param_list_v1430) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (v2x_supported_tx_band_comb_list_per_bc_r14_present) {
    j.write_str("v2x-SupportedTxBandCombListPerBC-r14", v2x_supported_tx_band_comb_list_per_bc_r14.to_string());
  }
  if (v2x_supported_rx_band_comb_list_per_bc_r14_present) {
    j.write_str("v2x-SupportedRxBandCombListPerBC-r14", v2x_supported_rx_band_comb_list_per_bc_r14.to_string());
  }
  j.end_obj();
}

// MUST-Parameters-r14 ::= SEQUENCE
SRSASN_CODE must_params_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(must_tm234_up_to2_tx_r14_present, 1));
  HANDLE_CODE(bref.pack(must_tm89_up_to_one_interfering_layer_r14_present, 1));
  HANDLE_CODE(bref.pack(must_tm10_up_to_one_interfering_layer_r14_present, 1));
  HANDLE_CODE(bref.pack(must_tm89_up_to_three_interfering_layers_r14_present, 1));
  HANDLE_CODE(bref.pack(must_tm10_up_to_three_interfering_layers_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE must_params_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(must_tm234_up_to2_tx_r14_present, 1));
  HANDLE_CODE(bref.unpack(must_tm89_up_to_one_interfering_layer_r14_present, 1));
  HANDLE_CODE(bref.unpack(must_tm10_up_to_one_interfering_layer_r14_present, 1));
  HANDLE_CODE(bref.unpack(must_tm89_up_to_three_interfering_layers_r14_present, 1));
  HANDLE_CODE(bref.unpack(must_tm10_up_to_three_interfering_layers_r14_present, 1));

  return SRSASN_SUCCESS;
}
void must_params_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (must_tm234_up_to2_tx_r14_present) {
    j.write_str("must-TM234-UpTo2Tx-r14", "supported");
  }
  if (must_tm89_up_to_one_interfering_layer_r14_present) {
    j.write_str("must-TM89-UpToOneInterferingLayer-r14", "supported");
  }
  if (must_tm10_up_to_one_interfering_layer_r14_present) {
    j.write_str("must-TM10-UpToOneInterferingLayer-r14", "supported");
  }
  if (must_tm89_up_to_three_interfering_layers_r14_present) {
    j.write_str("must-TM89-UpToThreeInterferingLayers-r14", "supported");
  }
  if (must_tm10_up_to_three_interfering_layers_r14_present) {
    j.write_str("must-TM10-UpToThreeInterferingLayers-r14", "supported");
  }
  j.end_obj();
}

// BandParameters-v1450 ::= SEQUENCE
SRSASN_CODE band_params_v1450_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(must_cap_per_band_r14_present, 1));

  if (must_cap_per_band_r14_present) {
    HANDLE_CODE(must_cap_per_band_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1450_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(must_cap_per_band_r14_present, 1));

  if (must_cap_per_band_r14_present) {
    HANDLE_CODE(must_cap_per_band_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_params_v1450_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (must_cap_per_band_r14_present) {
    j.write_fieldname("must-CapabilityPerBand-r14");
    must_cap_per_band_r14.to_json(j);
  }
  j.end_obj();
}

// BandCombinationParameters-v1450 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1450_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_param_list_v1450_present, 1));

  if (band_param_list_v1450_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_v1450, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1450_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_param_list_v1450_present, 1));

  if (band_param_list_v1450_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_v1450, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1450_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_param_list_v1450_present) {
    j.start_array("bandParameterList-v1450");
    for (const auto& e1 : band_param_list_v1450) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// MIMO-CA-ParametersPerBoBCPerTM-v1470 ::= SEQUENCE
SRSASN_CODE mimo_ca_params_per_bo_bc_per_tm_v1470_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_report_advanced_max_ports_r14_present, 1));

  if (csi_report_advanced_max_ports_r14_present) {
    HANDLE_CODE(csi_report_advanced_max_ports_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ca_params_per_bo_bc_per_tm_v1470_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_report_advanced_max_ports_r14_present, 1));

  if (csi_report_advanced_max_ports_r14_present) {
    HANDLE_CODE(csi_report_advanced_max_ports_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ca_params_per_bo_bc_per_tm_v1470_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_report_advanced_max_ports_r14_present) {
    j.write_str("csi-ReportingAdvancedMaxPorts-r14", csi_report_advanced_max_ports_r14.to_string());
  }
  j.end_obj();
}

// MIMO-CA-ParametersPerBoBC-v1470 ::= SEQUENCE
SRSASN_CODE mimo_ca_params_per_bo_bc_v1470_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(params_tm9_v1470.pack(bref));
  HANDLE_CODE(params_tm10_v1470.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ca_params_per_bo_bc_v1470_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(params_tm9_v1470.unpack(bref));
  HANDLE_CODE(params_tm10_v1470.unpack(bref));

  return SRSASN_SUCCESS;
}
void mimo_ca_params_per_bo_bc_v1470_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("parametersTM9-v1470");
  params_tm9_v1470.to_json(j);
  j.write_fieldname("parametersTM10-v1470");
  params_tm10_v1470.to_json(j);
  j.end_obj();
}

// BandParameters-v1470 ::= SEQUENCE
SRSASN_CODE band_params_v1470_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_params_dl_v1470_present, 1));

  if (band_params_dl_v1470_present) {
    HANDLE_CODE(band_params_dl_v1470.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1470_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_params_dl_v1470_present, 1));

  if (band_params_dl_v1470_present) {
    HANDLE_CODE(band_params_dl_v1470.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_params_v1470_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_params_dl_v1470_present) {
    j.write_fieldname("bandParametersDL-v1470");
    band_params_dl_v1470.to_json(j);
  }
  j.end_obj();
}

// BandCombinationParameters-v1470 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1470_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_param_list_v1470_present, 1));
  HANDLE_CODE(bref.pack(srs_max_simul_ccs_r14_present, 1));

  if (band_param_list_v1470_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_v1470, 1, 64));
  }
  if (srs_max_simul_ccs_r14_present) {
    HANDLE_CODE(pack_integer(bref, srs_max_simul_ccs_r14, (uint8_t)1u, (uint8_t)31u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1470_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_param_list_v1470_present, 1));
  HANDLE_CODE(bref.unpack(srs_max_simul_ccs_r14_present, 1));

  if (band_param_list_v1470_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_v1470, bref, 1, 64));
  }
  if (srs_max_simul_ccs_r14_present) {
    HANDLE_CODE(unpack_integer(srs_max_simul_ccs_r14, bref, (uint8_t)1u, (uint8_t)31u));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1470_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_param_list_v1470_present) {
    j.start_array("bandParameterList-v1470");
    for (const auto& e1 : band_param_list_v1470) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (srs_max_simul_ccs_r14_present) {
    j.write_int("srs-MaxSimultaneousCCs-r14", srs_max_simul_ccs_r14);
  }
  j.end_obj();
}

// DL-UL-CCs-r15 ::= SEQUENCE
SRSASN_CODE dl_ul_ccs_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(max_num_dl_ccs_r15_present, 1));
  HANDLE_CODE(bref.pack(max_num_ul_ccs_r15_present, 1));

  if (max_num_dl_ccs_r15_present) {
    HANDLE_CODE(pack_integer(bref, max_num_dl_ccs_r15, (uint8_t)1u, (uint8_t)32u));
  }
  if (max_num_ul_ccs_r15_present) {
    HANDLE_CODE(pack_integer(bref, max_num_ul_ccs_r15, (uint8_t)1u, (uint8_t)32u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE dl_ul_ccs_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(max_num_dl_ccs_r15_present, 1));
  HANDLE_CODE(bref.unpack(max_num_ul_ccs_r15_present, 1));

  if (max_num_dl_ccs_r15_present) {
    HANDLE_CODE(unpack_integer(max_num_dl_ccs_r15, bref, (uint8_t)1u, (uint8_t)32u));
  }
  if (max_num_ul_ccs_r15_present) {
    HANDLE_CODE(unpack_integer(max_num_ul_ccs_r15, bref, (uint8_t)1u, (uint8_t)32u));
  }

  return SRSASN_SUCCESS;
}
void dl_ul_ccs_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (max_num_dl_ccs_r15_present) {
    j.write_int("maxNumberDL-CCs-r15", max_num_dl_ccs_r15);
  }
  if (max_num_ul_ccs_r15_present) {
    j.write_int("maxNumberUL-CCs-r15", max_num_ul_ccs_r15);
  }
  j.end_obj();
}

// CA-MIMO-ParametersDL-r15 ::= SEQUENCE
SRSASN_CODE ca_mimo_params_dl_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_mimo_cap_dl_r15_present, 1));
  HANDLE_CODE(bref.pack(four_layer_tm3_tm4_r15_present, 1));
  HANDLE_CODE(bref.pack(intra_band_contiguous_cc_info_list_r15_present, 1));

  if (supported_mimo_cap_dl_r15_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r15.pack(bref));
  }
  if (intra_band_contiguous_cc_info_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, intra_band_contiguous_cc_info_list_r15, 1, 32));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ca_mimo_params_dl_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_mimo_cap_dl_r15_present, 1));
  HANDLE_CODE(bref.unpack(four_layer_tm3_tm4_r15_present, 1));
  HANDLE_CODE(bref.unpack(intra_band_contiguous_cc_info_list_r15_present, 1));

  if (supported_mimo_cap_dl_r15_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r15.unpack(bref));
  }
  if (intra_band_contiguous_cc_info_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(intra_band_contiguous_cc_info_list_r15, bref, 1, 32));
  }

  return SRSASN_SUCCESS;
}
void ca_mimo_params_dl_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_mimo_cap_dl_r15_present) {
    j.write_str("supportedMIMO-CapabilityDL-r15", supported_mimo_cap_dl_r15.to_string());
  }
  if (four_layer_tm3_tm4_r15_present) {
    j.write_str("fourLayerTM3-TM4-r15", "supported");
  }
  if (intra_band_contiguous_cc_info_list_r15_present) {
    j.start_array("intraBandContiguousCC-InfoList-r15");
    for (const auto& e1 : intra_band_contiguous_cc_info_list_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// CA-MIMO-ParametersUL-r15 ::= SEQUENCE
SRSASN_CODE ca_mimo_params_ul_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_mimo_cap_ul_r15_present, 1));

  if (supported_mimo_cap_ul_r15_present) {
    HANDLE_CODE(supported_mimo_cap_ul_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ca_mimo_params_ul_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_mimo_cap_ul_r15_present, 1));

  if (supported_mimo_cap_ul_r15_present) {
    HANDLE_CODE(supported_mimo_cap_ul_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ca_mimo_params_ul_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_mimo_cap_ul_r15_present) {
    j.write_str("supportedMIMO-CapabilityUL-r15", supported_mimo_cap_ul_r15.to_string());
  }
  j.end_obj();
}

// STTI-SupportedCombinations-r15 ::= SEQUENCE
SRSASN_CODE stti_supported_combinations_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(combination_minus22_r15_present, 1));
  HANDLE_CODE(bref.pack(combination_minus77_r15_present, 1));
  HANDLE_CODE(bref.pack(combination_minus27_r15_present, 1));
  HANDLE_CODE(bref.pack(combination_minus22_minus27_r15_present, 1));
  HANDLE_CODE(bref.pack(combination_minus77_minus22_r15_present, 1));
  HANDLE_CODE(bref.pack(combination_minus77_minus27_r15_present, 1));

  if (combination_minus22_r15_present) {
    HANDLE_CODE(combination_minus22_r15.pack(bref));
  }
  if (combination_minus77_r15_present) {
    HANDLE_CODE(combination_minus77_r15.pack(bref));
  }
  if (combination_minus27_r15_present) {
    HANDLE_CODE(combination_minus27_r15.pack(bref));
  }
  if (combination_minus22_minus27_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, combination_minus22_minus27_r15, 1, 2));
  }
  if (combination_minus77_minus22_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, combination_minus77_minus22_r15, 1, 2));
  }
  if (combination_minus77_minus27_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, combination_minus77_minus27_r15, 1, 2));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE stti_supported_combinations_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(combination_minus22_r15_present, 1));
  HANDLE_CODE(bref.unpack(combination_minus77_r15_present, 1));
  HANDLE_CODE(bref.unpack(combination_minus27_r15_present, 1));
  HANDLE_CODE(bref.unpack(combination_minus22_minus27_r15_present, 1));
  HANDLE_CODE(bref.unpack(combination_minus77_minus22_r15_present, 1));
  HANDLE_CODE(bref.unpack(combination_minus77_minus27_r15_present, 1));

  if (combination_minus22_r15_present) {
    HANDLE_CODE(combination_minus22_r15.unpack(bref));
  }
  if (combination_minus77_r15_present) {
    HANDLE_CODE(combination_minus77_r15.unpack(bref));
  }
  if (combination_minus27_r15_present) {
    HANDLE_CODE(combination_minus27_r15.unpack(bref));
  }
  if (combination_minus22_minus27_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(combination_minus22_minus27_r15, bref, 1, 2));
  }
  if (combination_minus77_minus22_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(combination_minus77_minus22_r15, bref, 1, 2));
  }
  if (combination_minus77_minus27_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(combination_minus77_minus27_r15, bref, 1, 2));
  }

  return SRSASN_SUCCESS;
}
void stti_supported_combinations_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (combination_minus22_r15_present) {
    j.write_fieldname("combination-22-r15");
    combination_minus22_r15.to_json(j);
  }
  if (combination_minus77_r15_present) {
    j.write_fieldname("combination-77-r15");
    combination_minus77_r15.to_json(j);
  }
  if (combination_minus27_r15_present) {
    j.write_fieldname("combination-27-r15");
    combination_minus27_r15.to_json(j);
  }
  if (combination_minus22_minus27_r15_present) {
    j.start_array("combination-22-27-r15");
    for (const auto& e1 : combination_minus22_minus27_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (combination_minus77_minus22_r15_present) {
    j.start_array("combination-77-22-r15");
    for (const auto& e1 : combination_minus77_minus22_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (combination_minus77_minus27_r15_present) {
    j.start_array("combination-77-27-r15");
    for (const auto& e1 : combination_minus77_minus27_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// STTI-SPT-BandParameters-r15 ::= SEQUENCE
SRSASN_CODE stti_spt_band_params_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(dl_minus1024_qam_slot_r15_present, 1));
  HANDLE_CODE(bref.pack(dl_minus1024_qam_subslot_ta_minus1_r15_present, 1));
  HANDLE_CODE(bref.pack(dl_minus1024_qam_subslot_ta_minus2_r15_present, 1));
  HANDLE_CODE(bref.pack(simul_tx_different_tx_dur_r15_present, 1));
  HANDLE_CODE(bref.pack(stti_ca_mimo_params_dl_r15_present, 1));
  HANDLE_CODE(bref.pack(stti_fd_mimo_coexistence_present, 1));
  HANDLE_CODE(bref.pack(stti_mimo_ca_params_per_bo_bcs_r15_present, 1));
  HANDLE_CODE(bref.pack(stti_mimo_ca_params_per_bo_bcs_v1530_present, 1));
  HANDLE_CODE(bref.pack(stti_supported_combinations_r15_present, 1));
  HANDLE_CODE(bref.pack(stti_supported_csi_proc_r15_present, 1));
  HANDLE_CODE(bref.pack(ul_minus256_qam_slot_r15_present, 1));
  HANDLE_CODE(bref.pack(ul_minus256_qam_subslot_r15_present, 1));

  if (stti_ca_mimo_params_dl_r15_present) {
    HANDLE_CODE(stti_ca_mimo_params_dl_r15.pack(bref));
  }
  HANDLE_CODE(stti_ca_mimo_params_ul_r15.pack(bref));
  if (stti_mimo_ca_params_per_bo_bcs_r15_present) {
    HANDLE_CODE(stti_mimo_ca_params_per_bo_bcs_r15.pack(bref));
  }
  if (stti_mimo_ca_params_per_bo_bcs_v1530_present) {
    HANDLE_CODE(stti_mimo_ca_params_per_bo_bcs_v1530.pack(bref));
  }
  if (stti_supported_combinations_r15_present) {
    HANDLE_CODE(stti_supported_combinations_r15.pack(bref));
  }
  if (stti_supported_csi_proc_r15_present) {
    HANDLE_CODE(stti_supported_csi_proc_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE stti_spt_band_params_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(dl_minus1024_qam_slot_r15_present, 1));
  HANDLE_CODE(bref.unpack(dl_minus1024_qam_subslot_ta_minus1_r15_present, 1));
  HANDLE_CODE(bref.unpack(dl_minus1024_qam_subslot_ta_minus2_r15_present, 1));
  HANDLE_CODE(bref.unpack(simul_tx_different_tx_dur_r15_present, 1));
  HANDLE_CODE(bref.unpack(stti_ca_mimo_params_dl_r15_present, 1));
  HANDLE_CODE(bref.unpack(stti_fd_mimo_coexistence_present, 1));
  HANDLE_CODE(bref.unpack(stti_mimo_ca_params_per_bo_bcs_r15_present, 1));
  HANDLE_CODE(bref.unpack(stti_mimo_ca_params_per_bo_bcs_v1530_present, 1));
  HANDLE_CODE(bref.unpack(stti_supported_combinations_r15_present, 1));
  HANDLE_CODE(bref.unpack(stti_supported_csi_proc_r15_present, 1));
  HANDLE_CODE(bref.unpack(ul_minus256_qam_slot_r15_present, 1));
  HANDLE_CODE(bref.unpack(ul_minus256_qam_subslot_r15_present, 1));

  if (stti_ca_mimo_params_dl_r15_present) {
    HANDLE_CODE(stti_ca_mimo_params_dl_r15.unpack(bref));
  }
  HANDLE_CODE(stti_ca_mimo_params_ul_r15.unpack(bref));
  if (stti_mimo_ca_params_per_bo_bcs_r15_present) {
    HANDLE_CODE(stti_mimo_ca_params_per_bo_bcs_r15.unpack(bref));
  }
  if (stti_mimo_ca_params_per_bo_bcs_v1530_present) {
    HANDLE_CODE(stti_mimo_ca_params_per_bo_bcs_v1530.unpack(bref));
  }
  if (stti_supported_combinations_r15_present) {
    HANDLE_CODE(stti_supported_combinations_r15.unpack(bref));
  }
  if (stti_supported_csi_proc_r15_present) {
    HANDLE_CODE(stti_supported_csi_proc_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void stti_spt_band_params_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dl_minus1024_qam_slot_r15_present) {
    j.write_str("dl-1024QAM-Slot-r15", "supported");
  }
  if (dl_minus1024_qam_subslot_ta_minus1_r15_present) {
    j.write_str("dl-1024QAM-SubslotTA-1-r15", "supported");
  }
  if (dl_minus1024_qam_subslot_ta_minus2_r15_present) {
    j.write_str("dl-1024QAM-SubslotTA-2-r15", "supported");
  }
  if (simul_tx_different_tx_dur_r15_present) {
    j.write_str("simultaneousTx-differentTx-duration-r15", "supported");
  }
  if (stti_ca_mimo_params_dl_r15_present) {
    j.write_fieldname("sTTI-CA-MIMO-ParametersDL-r15");
    stti_ca_mimo_params_dl_r15.to_json(j);
  }
  j.write_fieldname("sTTI-CA-MIMO-ParametersUL-r15");
  stti_ca_mimo_params_ul_r15.to_json(j);
  if (stti_fd_mimo_coexistence_present) {
    j.write_str("sTTI-FD-MIMO-Coexistence", "supported");
  }
  if (stti_mimo_ca_params_per_bo_bcs_r15_present) {
    j.write_fieldname("sTTI-MIMO-CA-ParametersPerBoBCs-r15");
    stti_mimo_ca_params_per_bo_bcs_r15.to_json(j);
  }
  if (stti_mimo_ca_params_per_bo_bcs_v1530_present) {
    j.write_fieldname("sTTI-MIMO-CA-ParametersPerBoBCs-v1530");
    stti_mimo_ca_params_per_bo_bcs_v1530.to_json(j);
  }
  if (stti_supported_combinations_r15_present) {
    j.write_fieldname("sTTI-SupportedCombinations-r15");
    stti_supported_combinations_r15.to_json(j);
  }
  if (stti_supported_csi_proc_r15_present) {
    j.write_str("sTTI-SupportedCSI-Proc-r15", stti_supported_csi_proc_r15.to_string());
  }
  if (ul_minus256_qam_slot_r15_present) {
    j.write_str("ul-256QAM-Slot-r15", "supported");
  }
  if (ul_minus256_qam_subslot_r15_present) {
    j.write_str("ul-256QAM-Subslot-r15", "supported");
  }
  j.end_obj();
}

// BandParameters-v1530 ::= SEQUENCE
SRSASN_CODE band_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ue_tx_ant_sel_srs_minus1_t4_r_r15_present, 1));
  HANDLE_CODE(bref.pack(ue_tx_ant_sel_srs_minus2_t4_r_minus2_pairs_r15_present, 1));
  HANDLE_CODE(bref.pack(ue_tx_ant_sel_srs_minus2_t4_r_minus3_pairs_r15_present, 1));
  HANDLE_CODE(bref.pack(dl_minus1024_qam_r15_present, 1));
  HANDLE_CODE(bref.pack(qcl_type_c_operation_r15_present, 1));
  HANDLE_CODE(bref.pack(qcl_cri_based_csi_report_r15_present, 1));
  HANDLE_CODE(bref.pack(stti_spt_band_params_r15_present, 1));

  if (stti_spt_band_params_r15_present) {
    HANDLE_CODE(stti_spt_band_params_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_tx_ant_sel_srs_minus1_t4_r_r15_present, 1));
  HANDLE_CODE(bref.unpack(ue_tx_ant_sel_srs_minus2_t4_r_minus2_pairs_r15_present, 1));
  HANDLE_CODE(bref.unpack(ue_tx_ant_sel_srs_minus2_t4_r_minus3_pairs_r15_present, 1));
  HANDLE_CODE(bref.unpack(dl_minus1024_qam_r15_present, 1));
  HANDLE_CODE(bref.unpack(qcl_type_c_operation_r15_present, 1));
  HANDLE_CODE(bref.unpack(qcl_cri_based_csi_report_r15_present, 1));
  HANDLE_CODE(bref.unpack(stti_spt_band_params_r15_present, 1));

  if (stti_spt_band_params_r15_present) {
    HANDLE_CODE(stti_spt_band_params_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_tx_ant_sel_srs_minus1_t4_r_r15_present) {
    j.write_str("ue-TxAntennaSelection-SRS-1T4R-r15", "supported");
  }
  if (ue_tx_ant_sel_srs_minus2_t4_r_minus2_pairs_r15_present) {
    j.write_str("ue-TxAntennaSelection-SRS-2T4R-2Pairs-r15", "supported");
  }
  if (ue_tx_ant_sel_srs_minus2_t4_r_minus3_pairs_r15_present) {
    j.write_str("ue-TxAntennaSelection-SRS-2T4R-3Pairs-r15", "supported");
  }
  if (dl_minus1024_qam_r15_present) {
    j.write_str("dl-1024QAM-r15", "supported");
  }
  if (qcl_type_c_operation_r15_present) {
    j.write_str("qcl-TypeC-Operation-r15", "supported");
  }
  if (qcl_cri_based_csi_report_r15_present) {
    j.write_str("qcl-CRI-BasedCSI-Reporting-r15", "supported");
  }
  if (stti_spt_band_params_r15_present) {
    j.write_fieldname("stti-SPT-BandParameters-r15");
    stti_spt_band_params_r15.to_json(j);
  }
  j.end_obj();
}

// SPT-Parameters-r15 ::= SEQUENCE
SRSASN_CODE spt_params_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(frame_structure_type_spt_r15_present, 1));
  HANDLE_CODE(bref.pack(max_num_ccs_spt_r15_present, 1));

  if (frame_structure_type_spt_r15_present) {
    HANDLE_CODE(frame_structure_type_spt_r15.pack(bref));
  }
  if (max_num_ccs_spt_r15_present) {
    HANDLE_CODE(pack_integer(bref, max_num_ccs_spt_r15, (uint8_t)1u, (uint8_t)32u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE spt_params_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(frame_structure_type_spt_r15_present, 1));
  HANDLE_CODE(bref.unpack(max_num_ccs_spt_r15_present, 1));

  if (frame_structure_type_spt_r15_present) {
    HANDLE_CODE(frame_structure_type_spt_r15.unpack(bref));
  }
  if (max_num_ccs_spt_r15_present) {
    HANDLE_CODE(unpack_integer(max_num_ccs_spt_r15, bref, (uint8_t)1u, (uint8_t)32u));
  }

  return SRSASN_SUCCESS;
}
void spt_params_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (frame_structure_type_spt_r15_present) {
    j.write_str("frameStructureType-SPT-r15", frame_structure_type_spt_r15.to_string());
  }
  if (max_num_ccs_spt_r15_present) {
    j.write_int("maxNumberCCs-SPT-r15", max_num_ccs_spt_r15);
  }
  j.end_obj();
}

// BandCombinationParameters-v1530 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_param_list_v1530_present, 1));
  HANDLE_CODE(bref.pack(spt_params_r15_present, 1));

  if (band_param_list_v1530_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, band_param_list_v1530, 1, 64));
  }
  if (spt_params_r15_present) {
    HANDLE_CODE(spt_params_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_param_list_v1530_present, 1));
  HANDLE_CODE(bref.unpack(spt_params_r15_present, 1));

  if (band_param_list_v1530_present) {
    HANDLE_CODE(unpack_dyn_seq_of(band_param_list_v1530, bref, 1, 64));
  }
  if (spt_params_r15_present) {
    HANDLE_CODE(spt_params_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_param_list_v1530_present) {
    j.start_array("bandParameterList-v1530");
    for (const auto& e1 : band_param_list_v1530) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (spt_params_r15_present) {
    j.write_fieldname("spt-Parameters-r15");
    spt_params_r15.to_json(j);
  }
  j.end_obj();
}

// BandCombinationParametersExt-r10 ::= SEQUENCE
SRSASN_CODE band_combination_params_ext_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_bw_combination_set_r10_present, 1));

  if (supported_bw_combination_set_r10_present) {
    HANDLE_CODE(supported_bw_combination_set_r10.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_ext_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_bw_combination_set_r10_present, 1));

  if (supported_bw_combination_set_r10_present) {
    HANDLE_CODE(supported_bw_combination_set_r10.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void band_combination_params_ext_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_bw_combination_set_r10_present) {
    j.write_str("supportedBandwidthCombinationSet-r10", supported_bw_combination_set_r10.to_string());
  }
  j.end_obj();
}

// BandParametersRxSL-r14 ::= SEQUENCE
SRSASN_CODE band_params_rx_sl_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(v2x_high_reception_r14_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, v2x_bw_class_rx_sl_r14, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_rx_sl_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(v2x_high_reception_r14_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(v2x_bw_class_rx_sl_r14, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void band_params_rx_sl_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("v2x-BandwidthClassRxSL-r14");
  for (const auto& e1 : v2x_bw_class_rx_sl_r14) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  if (v2x_high_reception_r14_present) {
    j.write_str("v2x-HighReception-r14", "supported");
  }
  j.end_obj();
}

// BandParametersTxSL-r14 ::= SEQUENCE
SRSASN_CODE band_params_tx_sl_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(v2x_enb_sched_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_high_pwr_r14_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, v2x_bw_class_tx_sl_r14, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_params_tx_sl_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(v2x_enb_sched_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_high_pwr_r14_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(v2x_bw_class_tx_sl_r14, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void band_params_tx_sl_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("v2x-BandwidthClassTxSL-r14");
  for (const auto& e1 : v2x_bw_class_tx_sl_r14) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  if (v2x_enb_sched_r14_present) {
    j.write_str("v2x-eNB-Scheduled-r14", "supported");
  }
  if (v2x_high_pwr_r14_present) {
    j.write_str("v2x-HighPower-r14", "supported");
  }
  j.end_obj();
}

// FeatureSetDL-PerCC-r15 ::= SEQUENCE
SRSASN_CODE feature_set_dl_per_cc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(four_layer_tm3_tm4_r15_present, 1));
  HANDLE_CODE(bref.pack(supported_mimo_cap_dl_r15_present, 1));
  HANDLE_CODE(bref.pack(supported_csi_proc_r15_present, 1));

  if (supported_mimo_cap_dl_r15_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r15.pack(bref));
  }
  if (supported_csi_proc_r15_present) {
    HANDLE_CODE(supported_csi_proc_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE feature_set_dl_per_cc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(four_layer_tm3_tm4_r15_present, 1));
  HANDLE_CODE(bref.unpack(supported_mimo_cap_dl_r15_present, 1));
  HANDLE_CODE(bref.unpack(supported_csi_proc_r15_present, 1));

  if (supported_mimo_cap_dl_r15_present) {
    HANDLE_CODE(supported_mimo_cap_dl_r15.unpack(bref));
  }
  if (supported_csi_proc_r15_present) {
    HANDLE_CODE(supported_csi_proc_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void feature_set_dl_per_cc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (four_layer_tm3_tm4_r15_present) {
    j.write_str("fourLayerTM3-TM4-r15", "supported");
  }
  if (supported_mimo_cap_dl_r15_present) {
    j.write_str("supportedMIMO-CapabilityDL-r15", supported_mimo_cap_dl_r15.to_string());
  }
  if (supported_csi_proc_r15_present) {
    j.write_str("supportedCSI-Proc-r15", supported_csi_proc_r15.to_string());
  }
  j.end_obj();
}

// MIMO-CA-ParametersPerBoBCPerTM-r15 ::= SEQUENCE
SRSASN_CODE mimo_ca_params_per_bo_bc_per_tm_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_precoded_r13_present, 1));
  HANDLE_CODE(bref.pack(bf_r13_present, 1));
  HANDLE_CODE(bref.pack(dmrs_enhance_r13_present, 1));
  HANDLE_CODE(bref.pack(csi_report_np_r14_present, 1));
  HANDLE_CODE(bref.pack(csi_report_advanced_r14_present, 1));

  if (non_precoded_r13_present) {
    HANDLE_CODE(non_precoded_r13.pack(bref));
  }
  if (bf_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, bf_r13, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ca_params_per_bo_bc_per_tm_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_precoded_r13_present, 1));
  HANDLE_CODE(bref.unpack(bf_r13_present, 1));
  HANDLE_CODE(bref.unpack(dmrs_enhance_r13_present, 1));
  HANDLE_CODE(bref.unpack(csi_report_np_r14_present, 1));
  HANDLE_CODE(bref.unpack(csi_report_advanced_r14_present, 1));

  if (non_precoded_r13_present) {
    HANDLE_CODE(non_precoded_r13.unpack(bref));
  }
  if (bf_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(bf_r13, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void mimo_ca_params_per_bo_bc_per_tm_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_precoded_r13_present) {
    j.write_fieldname("nonPrecoded-r13");
    non_precoded_r13.to_json(j);
  }
  if (bf_r13_present) {
    j.start_array("beamformed-r13");
    for (const auto& e1 : bf_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (dmrs_enhance_r13_present) {
    j.write_str("dmrs-Enhancements-r13", "different");
  }
  if (csi_report_np_r14_present) {
    j.write_str("csi-ReportingNP-r14", "different");
  }
  if (csi_report_advanced_r14_present) {
    j.write_str("csi-ReportingAdvanced-r14", "different");
  }
  j.end_obj();
}

// MIMO-CA-ParametersPerBoBC-r15 ::= SEQUENCE
SRSASN_CODE mimo_ca_params_per_bo_bc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(params_tm9_r15_present, 1));
  HANDLE_CODE(bref.pack(params_tm10_r15_present, 1));

  if (params_tm9_r15_present) {
    HANDLE_CODE(params_tm9_r15.pack(bref));
  }
  if (params_tm10_r15_present) {
    HANDLE_CODE(params_tm10_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ca_params_per_bo_bc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(params_tm9_r15_present, 1));
  HANDLE_CODE(bref.unpack(params_tm10_r15_present, 1));

  if (params_tm9_r15_present) {
    HANDLE_CODE(params_tm9_r15.unpack(bref));
  }
  if (params_tm10_r15_present) {
    HANDLE_CODE(params_tm10_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ca_params_per_bo_bc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (params_tm9_r15_present) {
    j.write_fieldname("parametersTM9-r15");
    params_tm9_r15.to_json(j);
  }
  if (params_tm10_r15_present) {
    j.write_fieldname("parametersTM10-r15");
    params_tm10_r15.to_json(j);
  }
  j.end_obj();
}

// FeatureSetDL-r15 ::= SEQUENCE
SRSASN_CODE feature_set_dl_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mimo_ca_params_per_bo_bc_r15_present, 1));

  if (mimo_ca_params_per_bo_bc_r15_present) {
    HANDLE_CODE(mimo_ca_params_per_bo_bc_r15.pack(bref));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, feature_set_per_cc_list_dl_r15, 1, 32, integer_packer<uint8_t>(0, 32)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE feature_set_dl_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mimo_ca_params_per_bo_bc_r15_present, 1));

  if (mimo_ca_params_per_bo_bc_r15_present) {
    HANDLE_CODE(mimo_ca_params_per_bo_bc_r15.unpack(bref));
  }
  HANDLE_CODE(unpack_dyn_seq_of(feature_set_per_cc_list_dl_r15, bref, 1, 32, integer_packer<uint8_t>(0, 32)));

  return SRSASN_SUCCESS;
}
void feature_set_dl_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mimo_ca_params_per_bo_bc_r15_present) {
    j.write_fieldname("mimo-CA-ParametersPerBoBC-r15");
    mimo_ca_params_per_bo_bc_r15.to_json(j);
  }
  j.start_array("featureSetPerCC-ListDL-r15");
  for (const auto& e1 : feature_set_per_cc_list_dl_r15) {
    j.write_int(e1);
  }
  j.end_array();
  j.end_obj();
}

// FeatureSetUL-PerCC-r15 ::= SEQUENCE
SRSASN_CODE feature_set_ul_per_cc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_mimo_cap_ul_r15_present, 1));
  HANDLE_CODE(bref.pack(ul_minus256_qam_r15_present, 1));

  if (supported_mimo_cap_ul_r15_present) {
    HANDLE_CODE(supported_mimo_cap_ul_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE feature_set_ul_per_cc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_mimo_cap_ul_r15_present, 1));
  HANDLE_CODE(bref.unpack(ul_minus256_qam_r15_present, 1));

  if (supported_mimo_cap_ul_r15_present) {
    HANDLE_CODE(supported_mimo_cap_ul_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void feature_set_ul_per_cc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_mimo_cap_ul_r15_present) {
    j.write_str("supportedMIMO-CapabilityUL-r15", supported_mimo_cap_ul_r15.to_string());
  }
  if (ul_minus256_qam_r15_present) {
    j.write_str("ul-256QAM-r15", "supported");
  }
  j.end_obj();
}

// FeatureSetUL-r15 ::= SEQUENCE
SRSASN_CODE feature_set_ul_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, feature_set_per_cc_list_ul_r15, 1, 32, integer_packer<uint8_t>(0, 32)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE feature_set_ul_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(feature_set_per_cc_list_ul_r15, bref, 1, 32, integer_packer<uint8_t>(0, 32)));

  return SRSASN_SUCCESS;
}
void feature_set_ul_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("featureSetPerCC-ListUL-r15");
  for (const auto& e1 : feature_set_per_cc_list_ul_r15) {
    j.write_int(e1);
  }
  j.end_array();
  j.end_obj();
}

// FeatureSetsEUTRA-r15 ::= SEQUENCE
SRSASN_CODE feature_sets_eutra_r15_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(feature_sets_dl_r15_present, 1));
  HANDLE_CODE(bref.pack(feature_sets_dl_per_cc_r15_present, 1));
  HANDLE_CODE(bref.pack(feature_sets_ul_r15_present, 1));
  HANDLE_CODE(bref.pack(feature_sets_ul_per_cc_r15_present, 1));

  if (feature_sets_dl_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, feature_sets_dl_r15, 1, 256));
  }
  if (feature_sets_dl_per_cc_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, feature_sets_dl_per_cc_r15, 1, 32));
  }
  if (feature_sets_ul_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, feature_sets_ul_r15, 1, 256));
  }
  if (feature_sets_ul_per_cc_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, feature_sets_ul_per_cc_r15, 1, 32));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE feature_sets_eutra_r15_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(feature_sets_dl_r15_present, 1));
  HANDLE_CODE(bref.unpack(feature_sets_dl_per_cc_r15_present, 1));
  HANDLE_CODE(bref.unpack(feature_sets_ul_r15_present, 1));
  HANDLE_CODE(bref.unpack(feature_sets_ul_per_cc_r15_present, 1));

  if (feature_sets_dl_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(feature_sets_dl_r15, bref, 1, 256));
  }
  if (feature_sets_dl_per_cc_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(feature_sets_dl_per_cc_r15, bref, 1, 32));
  }
  if (feature_sets_ul_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(feature_sets_ul_r15, bref, 1, 256));
  }
  if (feature_sets_ul_per_cc_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(feature_sets_ul_per_cc_r15, bref, 1, 32));
  }

  return SRSASN_SUCCESS;
}
void feature_sets_eutra_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (feature_sets_dl_r15_present) {
    j.start_array("featureSetsDL-r15");
    for (const auto& e1 : feature_sets_dl_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (feature_sets_dl_per_cc_r15_present) {
    j.start_array("featureSetsDL-PerCC-r15");
    for (const auto& e1 : feature_sets_dl_per_cc_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (feature_sets_ul_r15_present) {
    j.start_array("featureSetsUL-r15");
    for (const auto& e1 : feature_sets_ul_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (feature_sets_ul_per_cc_r15_present) {
    j.start_array("featureSetsUL-PerCC-r15");
    for (const auto& e1 : feature_sets_ul_per_cc_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// IRAT-ParametersCDMA2000-1XRTT ::= SEQUENCE
SRSASN_CODE irat_params_cdma2000_minus1_xrtt_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list1_xrtt, 1, 32));
  HANDLE_CODE(tx_cfg1_xrtt.pack(bref));
  HANDLE_CODE(rx_cfg1_xrtt.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_cdma2000_minus1_xrtt_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_list1_xrtt, bref, 1, 32));
  HANDLE_CODE(tx_cfg1_xrtt.unpack(bref));
  HANDLE_CODE(rx_cfg1_xrtt.unpack(bref));

  return SRSASN_SUCCESS;
}
void irat_params_cdma2000_minus1_xrtt_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandList1XRTT");
  for (const auto& e1 : supported_band_list1_xrtt) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.write_str("tx-Config1XRTT", tx_cfg1_xrtt.to_string());
  j.write_str("rx-Config1XRTT", rx_cfg1_xrtt.to_string());
  j.end_obj();
}

// IRAT-ParametersCDMA2000-HRPD ::= SEQUENCE
SRSASN_CODE irat_params_cdma2000_hrpd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_hrpd, 1, 32));
  HANDLE_CODE(tx_cfg_hrpd.pack(bref));
  HANDLE_CODE(rx_cfg_hrpd.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_cdma2000_hrpd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_hrpd, bref, 1, 32));
  HANDLE_CODE(tx_cfg_hrpd.unpack(bref));
  HANDLE_CODE(rx_cfg_hrpd.unpack(bref));

  return SRSASN_SUCCESS;
}
void irat_params_cdma2000_hrpd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandListHRPD");
  for (const auto& e1 : supported_band_list_hrpd) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.write_str("tx-ConfigHRPD", tx_cfg_hrpd.to_string());
  j.write_str("rx-ConfigHRPD", rx_cfg_hrpd.to_string());
  j.end_obj();
}

// IRAT-ParametersGERAN ::= SEQUENCE
SRSASN_CODE irat_params_geran_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_geran, 1, 64));
  HANDLE_CODE(bref.pack(inter_rat_ps_ho_to_geran, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_geran_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_geran, bref, 1, 64));
  HANDLE_CODE(bref.unpack(inter_rat_ps_ho_to_geran, 1));

  return SRSASN_SUCCESS;
}
void irat_params_geran_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandListGERAN");
  for (const auto& e1 : supported_band_list_geran) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.write_bool("interRAT-PS-HO-ToGERAN", inter_rat_ps_ho_to_geran);
  j.end_obj();
}

// SupportedBandNR-r15 ::= SEQUENCE
SRSASN_CODE supported_band_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, band_nr_r15, (uint16_t)1u, (uint16_t)1024u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_band_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(band_nr_r15, bref, (uint16_t)1u, (uint16_t)1024u));

  return SRSASN_SUCCESS;
}
void supported_band_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("bandNR-r15", band_nr_r15);
  j.end_obj();
}

// IRAT-ParametersNR-r15 ::= SEQUENCE
SRSASN_CODE irat_params_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(en_dc_r15_present, 1));
  HANDLE_CODE(bref.pack(event_b2_r15_present, 1));
  HANDLE_CODE(bref.pack(supported_band_list_nr_r15_present, 1));

  if (supported_band_list_nr_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_nr_r15, 1, 1024));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(en_dc_r15_present, 1));
  HANDLE_CODE(bref.unpack(event_b2_r15_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_list_nr_r15_present, 1));

  if (supported_band_list_nr_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_nr_r15, bref, 1, 1024));
  }

  return SRSASN_SUCCESS;
}
void irat_params_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (en_dc_r15_present) {
    j.write_str("en-DC-r15", "supported");
  }
  if (event_b2_r15_present) {
    j.write_str("eventB2-r15", "supported");
  }
  if (supported_band_list_nr_r15_present) {
    j.start_array("supportedBandListNR-r15");
    for (const auto& e1 : supported_band_list_nr_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// IRAT-ParametersUTRA-FDD ::= SEQUENCE
SRSASN_CODE irat_params_utra_fdd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_utra_fdd, 1, 64));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_utra_fdd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_utra_fdd, bref, 1, 64));

  return SRSASN_SUCCESS;
}
void irat_params_utra_fdd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandListUTRA-FDD");
  for (const auto& e1 : supported_band_list_utra_fdd) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.end_obj();
}

// IRAT-ParametersUTRA-TDD128 ::= SEQUENCE
SRSASN_CODE irat_params_utra_tdd128_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_utra_tdd128, 1, 64));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_utra_tdd128_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_utra_tdd128, bref, 1, 64));

  return SRSASN_SUCCESS;
}
void irat_params_utra_tdd128_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandListUTRA-TDD128");
  for (const auto& e1 : supported_band_list_utra_tdd128) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.end_obj();
}

// IRAT-ParametersUTRA-TDD384 ::= SEQUENCE
SRSASN_CODE irat_params_utra_tdd384_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_utra_tdd384, 1, 64));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_utra_tdd384_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_utra_tdd384, bref, 1, 64));

  return SRSASN_SUCCESS;
}
void irat_params_utra_tdd384_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandListUTRA-TDD384");
  for (const auto& e1 : supported_band_list_utra_tdd384) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.end_obj();
}

// IRAT-ParametersUTRA-TDD768 ::= SEQUENCE
SRSASN_CODE irat_params_utra_tdd768_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_utra_tdd768, 1, 64));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_utra_tdd768_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_utra_tdd768, bref, 1, 64));

  return SRSASN_SUCCESS;
}
void irat_params_utra_tdd768_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandListUTRA-TDD768");
  for (const auto& e1 : supported_band_list_utra_tdd768) {
    j.write_str(e1.to_string());
  }
  j.end_array();
  j.end_obj();
}

// IRAT-ParametersWLAN-r13 ::= SEQUENCE
SRSASN_CODE irat_params_wlan_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_list_wlan_r13_present, 1));

  if (supported_band_list_wlan_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_wlan_r13, 1, 8));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_wlan_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_list_wlan_r13_present, 1));

  if (supported_band_list_wlan_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_wlan_r13, bref, 1, 8));
  }

  return SRSASN_SUCCESS;
}
void irat_params_wlan_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_list_wlan_r13_present) {
    j.start_array("supportedBandListWLAN-r13");
    for (const auto& e1 : supported_band_list_wlan_r13) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  j.end_obj();
}

// SkipSubframeProcessing-r15 ::= SEQUENCE
SRSASN_CODE skip_sf_processing_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(skip_processing_dl_slot_r15_present, 1));
  HANDLE_CODE(bref.pack(skip_processing_dl_sub_slot_r15_present, 1));
  HANDLE_CODE(bref.pack(skip_processing_ul_slot_r15_present, 1));
  HANDLE_CODE(bref.pack(skip_processing_ul_sub_slot_r15_present, 1));

  if (skip_processing_dl_slot_r15_present) {
    HANDLE_CODE(pack_integer(bref, skip_processing_dl_slot_r15, (uint8_t)0u, (uint8_t)3u));
  }
  if (skip_processing_dl_sub_slot_r15_present) {
    HANDLE_CODE(pack_integer(bref, skip_processing_dl_sub_slot_r15, (uint8_t)0u, (uint8_t)3u));
  }
  if (skip_processing_ul_slot_r15_present) {
    HANDLE_CODE(pack_integer(bref, skip_processing_ul_slot_r15, (uint8_t)0u, (uint8_t)3u));
  }
  if (skip_processing_ul_sub_slot_r15_present) {
    HANDLE_CODE(pack_integer(bref, skip_processing_ul_sub_slot_r15, (uint8_t)0u, (uint8_t)3u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE skip_sf_processing_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(skip_processing_dl_slot_r15_present, 1));
  HANDLE_CODE(bref.unpack(skip_processing_dl_sub_slot_r15_present, 1));
  HANDLE_CODE(bref.unpack(skip_processing_ul_slot_r15_present, 1));
  HANDLE_CODE(bref.unpack(skip_processing_ul_sub_slot_r15_present, 1));

  if (skip_processing_dl_slot_r15_present) {
    HANDLE_CODE(unpack_integer(skip_processing_dl_slot_r15, bref, (uint8_t)0u, (uint8_t)3u));
  }
  if (skip_processing_dl_sub_slot_r15_present) {
    HANDLE_CODE(unpack_integer(skip_processing_dl_sub_slot_r15, bref, (uint8_t)0u, (uint8_t)3u));
  }
  if (skip_processing_ul_slot_r15_present) {
    HANDLE_CODE(unpack_integer(skip_processing_ul_slot_r15, bref, (uint8_t)0u, (uint8_t)3u));
  }
  if (skip_processing_ul_sub_slot_r15_present) {
    HANDLE_CODE(unpack_integer(skip_processing_ul_sub_slot_r15, bref, (uint8_t)0u, (uint8_t)3u));
  }

  return SRSASN_SUCCESS;
}
void skip_sf_processing_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (skip_processing_dl_slot_r15_present) {
    j.write_int("skipProcessingDL-Slot-r15", skip_processing_dl_slot_r15);
  }
  if (skip_processing_dl_sub_slot_r15_present) {
    j.write_int("skipProcessingDL-SubSlot-r15", skip_processing_dl_sub_slot_r15);
  }
  if (skip_processing_ul_slot_r15_present) {
    j.write_int("skipProcessingUL-Slot-r15", skip_processing_ul_slot_r15);
  }
  if (skip_processing_ul_sub_slot_r15_present) {
    j.write_int("skipProcessingUL-SubSlot-r15", skip_processing_ul_sub_slot_r15);
  }
  j.end_obj();
}

// MAC-Parameters-v1530 ::= SEQUENCE
SRSASN_CODE mac_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(min_proc_timeline_subslot_r15_present, 1));
  HANDLE_CODE(bref.pack(skip_sf_processing_r15_present, 1));
  HANDLE_CODE(bref.pack(early_data_up_r15_present, 1));
  HANDLE_CODE(bref.pack(dormant_scell_state_r15_present, 1));
  HANDLE_CODE(bref.pack(direct_scell_activation_r15_present, 1));
  HANDLE_CODE(bref.pack(direct_scell_hibernation_r15_present, 1));
  HANDLE_CODE(bref.pack(extended_lcid_dupl_r15_present, 1));
  HANDLE_CODE(bref.pack(sps_serving_cell_r15_present, 1));

  if (min_proc_timeline_subslot_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, min_proc_timeline_subslot_r15, 1, 3));
  }
  if (skip_sf_processing_r15_present) {
    HANDLE_CODE(skip_sf_processing_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(min_proc_timeline_subslot_r15_present, 1));
  HANDLE_CODE(bref.unpack(skip_sf_processing_r15_present, 1));
  HANDLE_CODE(bref.unpack(early_data_up_r15_present, 1));
  HANDLE_CODE(bref.unpack(dormant_scell_state_r15_present, 1));
  HANDLE_CODE(bref.unpack(direct_scell_activation_r15_present, 1));
  HANDLE_CODE(bref.unpack(direct_scell_hibernation_r15_present, 1));
  HANDLE_CODE(bref.unpack(extended_lcid_dupl_r15_present, 1));
  HANDLE_CODE(bref.unpack(sps_serving_cell_r15_present, 1));

  if (min_proc_timeline_subslot_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(min_proc_timeline_subslot_r15, bref, 1, 3));
  }
  if (skip_sf_processing_r15_present) {
    HANDLE_CODE(skip_sf_processing_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mac_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (min_proc_timeline_subslot_r15_present) {
    j.start_array("min-Proc-TimelineSubslot-r15");
    for (const auto& e1 : min_proc_timeline_subslot_r15) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (skip_sf_processing_r15_present) {
    j.write_fieldname("skipSubframeProcessing-r15");
    skip_sf_processing_r15.to_json(j);
  }
  if (early_data_up_r15_present) {
    j.write_str("earlyData-UP-r15", "supported");
  }
  if (dormant_scell_state_r15_present) {
    j.write_str("dormantSCellState-r15", "supported");
  }
  if (direct_scell_activation_r15_present) {
    j.write_str("directSCellActivation-r15", "supported");
  }
  if (direct_scell_hibernation_r15_present) {
    j.write_str("directSCellHibernation-r15", "supported");
  }
  if (extended_lcid_dupl_r15_present) {
    j.write_str("extendedLCID-Duplication-r15", "supported");
  }
  if (sps_serving_cell_r15_present) {
    j.write_str("sps-ServingCell-r15", "supported");
  }
  j.end_obj();
}

// MIMO-UE-BeamformedCapabilities-r13 ::= SEQUENCE
SRSASN_CODE mimo_ue_bf_cap_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(alt_codebook_r13_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, mimo_bf_cap_r13, 1, 4));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ue_bf_cap_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(alt_codebook_r13_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(mimo_bf_cap_r13, bref, 1, 4));

  return SRSASN_SUCCESS;
}
void mimo_ue_bf_cap_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (alt_codebook_r13_present) {
    j.write_str("altCodebook-r13", "supported");
  }
  j.start_array("mimo-BeamformedCapabilities-r13");
  for (const auto& e1 : mimo_bf_cap_r13) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// MIMO-UE-ParametersPerTM-r13 ::= SEQUENCE
SRSASN_CODE mimo_ue_params_per_tm_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_precoded_r13_present, 1));
  HANDLE_CODE(bref.pack(bf_r13_present, 1));
  HANDLE_CODE(bref.pack(ch_meas_restrict_r13_present, 1));
  HANDLE_CODE(bref.pack(dmrs_enhance_r13_present, 1));
  HANDLE_CODE(bref.pack(csi_rs_enhance_tdd_r13_present, 1));

  if (non_precoded_r13_present) {
    HANDLE_CODE(non_precoded_r13.pack(bref));
  }
  if (bf_r13_present) {
    HANDLE_CODE(bf_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ue_params_per_tm_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_precoded_r13_present, 1));
  HANDLE_CODE(bref.unpack(bf_r13_present, 1));
  HANDLE_CODE(bref.unpack(ch_meas_restrict_r13_present, 1));
  HANDLE_CODE(bref.unpack(dmrs_enhance_r13_present, 1));
  HANDLE_CODE(bref.unpack(csi_rs_enhance_tdd_r13_present, 1));

  if (non_precoded_r13_present) {
    HANDLE_CODE(non_precoded_r13.unpack(bref));
  }
  if (bf_r13_present) {
    HANDLE_CODE(bf_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ue_params_per_tm_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_precoded_r13_present) {
    j.write_fieldname("nonPrecoded-r13");
    non_precoded_r13.to_json(j);
  }
  if (bf_r13_present) {
    j.write_fieldname("beamformed-r13");
    bf_r13.to_json(j);
  }
  if (ch_meas_restrict_r13_present) {
    j.write_str("channelMeasRestriction-r13", "supported");
  }
  if (dmrs_enhance_r13_present) {
    j.write_str("dmrs-Enhancements-r13", "supported");
  }
  if (csi_rs_enhance_tdd_r13_present) {
    j.write_str("csi-RS-EnhancementsTDD-r13", "supported");
  }
  j.end_obj();
}

// MIMO-UE-Parameters-r13 ::= SEQUENCE
SRSASN_CODE mimo_ue_params_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(params_tm9_r13_present, 1));
  HANDLE_CODE(bref.pack(params_tm10_r13_present, 1));
  HANDLE_CODE(bref.pack(srs_enhance_tdd_r13_present, 1));
  HANDLE_CODE(bref.pack(srs_enhance_r13_present, 1));
  HANDLE_CODE(bref.pack(interference_meas_restrict_r13_present, 1));

  if (params_tm9_r13_present) {
    HANDLE_CODE(params_tm9_r13.pack(bref));
  }
  if (params_tm10_r13_present) {
    HANDLE_CODE(params_tm10_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ue_params_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(params_tm9_r13_present, 1));
  HANDLE_CODE(bref.unpack(params_tm10_r13_present, 1));
  HANDLE_CODE(bref.unpack(srs_enhance_tdd_r13_present, 1));
  HANDLE_CODE(bref.unpack(srs_enhance_r13_present, 1));
  HANDLE_CODE(bref.unpack(interference_meas_restrict_r13_present, 1));

  if (params_tm9_r13_present) {
    HANDLE_CODE(params_tm9_r13.unpack(bref));
  }
  if (params_tm10_r13_present) {
    HANDLE_CODE(params_tm10_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ue_params_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (params_tm9_r13_present) {
    j.write_fieldname("parametersTM9-r13");
    params_tm9_r13.to_json(j);
  }
  if (params_tm10_r13_present) {
    j.write_fieldname("parametersTM10-r13");
    params_tm10_r13.to_json(j);
  }
  if (srs_enhance_tdd_r13_present) {
    j.write_str("srs-EnhancementsTDD-r13", "supported");
  }
  if (srs_enhance_r13_present) {
    j.write_str("srs-Enhancements-r13", "supported");
  }
  if (interference_meas_restrict_r13_present) {
    j.write_str("interferenceMeasRestriction-r13", "supported");
  }
  j.end_obj();
}

// MIMO-UE-ParametersPerTM-v1430 ::= SEQUENCE
SRSASN_CODE mimo_ue_params_per_tm_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(nzp_csi_rs_aperiodic_info_r14_present, 1));
  HANDLE_CODE(bref.pack(nzp_csi_rs_periodic_info_r14_present, 1));
  HANDLE_CODE(bref.pack(zp_csi_rs_aperiodic_info_r14_present, 1));
  HANDLE_CODE(bref.pack(ul_dmrs_enhance_r14_present, 1));
  HANDLE_CODE(bref.pack(density_reduction_np_r14_present, 1));
  HANDLE_CODE(bref.pack(density_reduction_bf_r14_present, 1));
  HANDLE_CODE(bref.pack(hybrid_csi_r14_present, 1));
  HANDLE_CODE(bref.pack(semi_ol_r14_present, 1));
  HANDLE_CODE(bref.pack(csi_report_np_r14_present, 1));
  HANDLE_CODE(bref.pack(csi_report_advanced_r14_present, 1));

  if (nzp_csi_rs_aperiodic_info_r14_present) {
    HANDLE_CODE(pack_integer(bref, nzp_csi_rs_aperiodic_info_r14.nmax_proc_r14, (uint8_t)5u, (uint8_t)32u));
    HANDLE_CODE(nzp_csi_rs_aperiodic_info_r14.nmax_res_r14.pack(bref));
  }
  if (nzp_csi_rs_periodic_info_r14_present) {
    HANDLE_CODE(nzp_csi_rs_periodic_info_r14.nmax_res_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ue_params_per_tm_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(nzp_csi_rs_aperiodic_info_r14_present, 1));
  HANDLE_CODE(bref.unpack(nzp_csi_rs_periodic_info_r14_present, 1));
  HANDLE_CODE(bref.unpack(zp_csi_rs_aperiodic_info_r14_present, 1));
  HANDLE_CODE(bref.unpack(ul_dmrs_enhance_r14_present, 1));
  HANDLE_CODE(bref.unpack(density_reduction_np_r14_present, 1));
  HANDLE_CODE(bref.unpack(density_reduction_bf_r14_present, 1));
  HANDLE_CODE(bref.unpack(hybrid_csi_r14_present, 1));
  HANDLE_CODE(bref.unpack(semi_ol_r14_present, 1));
  HANDLE_CODE(bref.unpack(csi_report_np_r14_present, 1));
  HANDLE_CODE(bref.unpack(csi_report_advanced_r14_present, 1));

  if (nzp_csi_rs_aperiodic_info_r14_present) {
    HANDLE_CODE(unpack_integer(nzp_csi_rs_aperiodic_info_r14.nmax_proc_r14, bref, (uint8_t)5u, (uint8_t)32u));
    HANDLE_CODE(nzp_csi_rs_aperiodic_info_r14.nmax_res_r14.unpack(bref));
  }
  if (nzp_csi_rs_periodic_info_r14_present) {
    HANDLE_CODE(nzp_csi_rs_periodic_info_r14.nmax_res_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ue_params_per_tm_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (nzp_csi_rs_aperiodic_info_r14_present) {
    j.write_fieldname("nzp-CSI-RS-AperiodicInfo-r14");
    j.start_obj();
    j.write_int("nMaxProc-r14", nzp_csi_rs_aperiodic_info_r14.nmax_proc_r14);
    j.write_str("nMaxResource-r14", nzp_csi_rs_aperiodic_info_r14.nmax_res_r14.to_string());
    j.end_obj();
  }
  if (nzp_csi_rs_periodic_info_r14_present) {
    j.write_fieldname("nzp-CSI-RS-PeriodicInfo-r14");
    j.start_obj();
    j.write_str("nMaxResource-r14", nzp_csi_rs_periodic_info_r14.nmax_res_r14.to_string());
    j.end_obj();
  }
  if (zp_csi_rs_aperiodic_info_r14_present) {
    j.write_str("zp-CSI-RS-AperiodicInfo-r14", "supported");
  }
  if (ul_dmrs_enhance_r14_present) {
    j.write_str("ul-dmrs-Enhancements-r14", "supported");
  }
  if (density_reduction_np_r14_present) {
    j.write_str("densityReductionNP-r14", "supported");
  }
  if (density_reduction_bf_r14_present) {
    j.write_str("densityReductionBF-r14", "supported");
  }
  if (hybrid_csi_r14_present) {
    j.write_str("hybridCSI-r14", "supported");
  }
  if (semi_ol_r14_present) {
    j.write_str("semiOL-r14", "supported");
  }
  if (csi_report_np_r14_present) {
    j.write_str("csi-ReportingNP-r14", "supported");
  }
  if (csi_report_advanced_r14_present) {
    j.write_str("csi-ReportingAdvanced-r14", "supported");
  }
  j.end_obj();
}

// MIMO-UE-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE mimo_ue_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(params_tm9_v1430_present, 1));
  HANDLE_CODE(bref.pack(params_tm10_v1430_present, 1));

  if (params_tm9_v1430_present) {
    HANDLE_CODE(params_tm9_v1430.pack(bref));
  }
  if (params_tm10_v1430_present) {
    HANDLE_CODE(params_tm10_v1430.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ue_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(params_tm9_v1430_present, 1));
  HANDLE_CODE(bref.unpack(params_tm10_v1430_present, 1));

  if (params_tm9_v1430_present) {
    HANDLE_CODE(params_tm9_v1430.unpack(bref));
  }
  if (params_tm10_v1430_present) {
    HANDLE_CODE(params_tm10_v1430.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ue_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (params_tm9_v1430_present) {
    j.write_fieldname("parametersTM9-v1430");
    params_tm9_v1430.to_json(j);
  }
  if (params_tm10_v1430_present) {
    j.write_fieldname("parametersTM10-v1430");
    params_tm10_v1430.to_json(j);
  }
  j.end_obj();
}

// MIMO-UE-ParametersPerTM-v1470 ::= SEQUENCE
SRSASN_CODE mimo_ue_params_per_tm_v1470_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(csi_report_advanced_max_ports_r14_present, 1));

  if (csi_report_advanced_max_ports_r14_present) {
    HANDLE_CODE(csi_report_advanced_max_ports_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ue_params_per_tm_v1470_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(csi_report_advanced_max_ports_r14_present, 1));

  if (csi_report_advanced_max_ports_r14_present) {
    HANDLE_CODE(csi_report_advanced_max_ports_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void mimo_ue_params_per_tm_v1470_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (csi_report_advanced_max_ports_r14_present) {
    j.write_str("csi-ReportingAdvancedMaxPorts-r14", csi_report_advanced_max_ports_r14.to_string());
  }
  j.end_obj();
}

// MIMO-UE-Parameters-v1470 ::= SEQUENCE
SRSASN_CODE mimo_ue_params_v1470_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(params_tm9_v1470.pack(bref));
  HANDLE_CODE(params_tm10_v1470.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mimo_ue_params_v1470_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(params_tm9_v1470.unpack(bref));
  HANDLE_CODE(params_tm10_v1470.unpack(bref));

  return SRSASN_SUCCESS;
}
void mimo_ue_params_v1470_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("parametersTM9-v1470");
  params_tm9_v1470.to_json(j);
  j.write_fieldname("parametersTM10-v1470");
  params_tm10_v1470.to_json(j);
  j.end_obj();
}

// MeasParameters ::= SEQUENCE
SRSASN_CODE meas_params_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, band_list_eutra, 1, 64));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(band_list_eutra, bref, 1, 64));

  return SRSASN_SUCCESS;
}
void meas_params_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("bandListEUTRA");
  for (const auto& e1 : band_list_eutra) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// MeasParameters-v1020 ::= SEQUENCE
SRSASN_CODE meas_params_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, band_combination_list_eutra_r10, 1, 128));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(band_combination_list_eutra_r10, bref, 1, 128));

  return SRSASN_SUCCESS;
}
void meas_params_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("bandCombinationListEUTRA-r10");
  for (const auto& e1 : band_combination_list_eutra_r10) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// NAICS-Capability-Entry-r12 ::= SEQUENCE
SRSASN_CODE naics_cap_entry_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, nof_naics_capable_cc_r12, (uint8_t)1u, (uint8_t)5u));
  HANDLE_CODE(nof_aggregated_prb_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE naics_cap_entry_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(nof_naics_capable_cc_r12, bref, (uint8_t)1u, (uint8_t)5u));
  HANDLE_CODE(nof_aggregated_prb_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void naics_cap_entry_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("numberOfNAICS-CapableCC-r12", nof_naics_capable_cc_r12);
  j.write_str("numberOfAggregatedPRB-r12", nof_aggregated_prb_r12.to_string());
  j.end_obj();
}

// NonContiguousUL-RA-WithinCC-r10 ::= SEQUENCE
SRSASN_CODE non_contiguous_ul_ra_within_cc_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_contiguous_ul_ra_within_cc_info_r10_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE non_contiguous_ul_ra_within_cc_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_contiguous_ul_ra_within_cc_info_r10_present, 1));

  return SRSASN_SUCCESS;
}
void non_contiguous_ul_ra_within_cc_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_contiguous_ul_ra_within_cc_info_r10_present) {
    j.write_str("nonContiguousUL-RA-WithinCC-Info-r10", "supported");
  }
  j.end_obj();
}

// ROHC-ProfileSupportList-r15 ::= SEQUENCE
SRSASN_CODE rohc_profile_support_list_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(profile0x0001_r15, 1));
  HANDLE_CODE(bref.pack(profile0x0002_r15, 1));
  HANDLE_CODE(bref.pack(profile0x0003_r15, 1));
  HANDLE_CODE(bref.pack(profile0x0004_r15, 1));
  HANDLE_CODE(bref.pack(profile0x0006_r15, 1));
  HANDLE_CODE(bref.pack(profile0x0101_r15, 1));
  HANDLE_CODE(bref.pack(profile0x0102_r15, 1));
  HANDLE_CODE(bref.pack(profile0x0103_r15, 1));
  HANDLE_CODE(bref.pack(profile0x0104_r15, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rohc_profile_support_list_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(profile0x0001_r15, 1));
  HANDLE_CODE(bref.unpack(profile0x0002_r15, 1));
  HANDLE_CODE(bref.unpack(profile0x0003_r15, 1));
  HANDLE_CODE(bref.unpack(profile0x0004_r15, 1));
  HANDLE_CODE(bref.unpack(profile0x0006_r15, 1));
  HANDLE_CODE(bref.unpack(profile0x0101_r15, 1));
  HANDLE_CODE(bref.unpack(profile0x0102_r15, 1));
  HANDLE_CODE(bref.unpack(profile0x0103_r15, 1));
  HANDLE_CODE(bref.unpack(profile0x0104_r15, 1));

  return SRSASN_SUCCESS;
}
void rohc_profile_support_list_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_bool("profile0x0001-r15", profile0x0001_r15);
  j.write_bool("profile0x0002-r15", profile0x0002_r15);
  j.write_bool("profile0x0003-r15", profile0x0003_r15);
  j.write_bool("profile0x0004-r15", profile0x0004_r15);
  j.write_bool("profile0x0006-r15", profile0x0006_r15);
  j.write_bool("profile0x0101-r15", profile0x0101_r15);
  j.write_bool("profile0x0102-r15", profile0x0102_r15);
  j.write_bool("profile0x0103-r15", profile0x0103_r15);
  j.write_bool("profile0x0104-r15", profile0x0104_r15);
  j.end_obj();
}

// PDCP-Parameters ::= SEQUENCE
SRSASN_CODE pdcp_params_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(max_num_rohc_context_sessions_present, 1));

  HANDLE_CODE(supported_rohc_profiles.pack(bref));
  if (max_num_rohc_context_sessions_present) {
    HANDLE_CODE(max_num_rohc_context_sessions.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_params_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(max_num_rohc_context_sessions_present, 1));

  HANDLE_CODE(supported_rohc_profiles.unpack(bref));
  if (max_num_rohc_context_sessions_present) {
    HANDLE_CODE(max_num_rohc_context_sessions.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdcp_params_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("supportedROHC-Profiles");
  supported_rohc_profiles.to_json(j);
  if (max_num_rohc_context_sessions_present) {
    j.write_str("maxNumberROHC-ContextSessions", max_num_rohc_context_sessions.to_string());
  }
  j.end_obj();
}

// SupportedOperatorDic-r15 ::= SEQUENCE
SRSASN_CODE supported_operator_dic_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, version_of_dictionary_r15, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(associated_plmn_id_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_operator_dic_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(version_of_dictionary_r15, bref, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(associated_plmn_id_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void supported_operator_dic_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("versionOfDictionary-r15", version_of_dictionary_r15);
  j.write_fieldname("associatedPLMN-ID-r15");
  associated_plmn_id_r15.to_json(j);
  j.end_obj();
}

// SupportedUDC-r15 ::= SEQUENCE
SRSASN_CODE supported_udc_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_standard_dic_r15_present, 1));
  HANDLE_CODE(bref.pack(supported_operator_dic_r15_present, 1));

  if (supported_operator_dic_r15_present) {
    HANDLE_CODE(supported_operator_dic_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_udc_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_standard_dic_r15_present, 1));
  HANDLE_CODE(bref.unpack(supported_operator_dic_r15_present, 1));

  if (supported_operator_dic_r15_present) {
    HANDLE_CODE(supported_operator_dic_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void supported_udc_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_standard_dic_r15_present) {
    j.write_str("supportedStandardDic-r15", "supported");
  }
  if (supported_operator_dic_r15_present) {
    j.write_fieldname("supportedOperatorDic-r15");
    supported_operator_dic_r15.to_json(j);
  }
  j.end_obj();
}

// PDCP-Parameters-v1530 ::= SEQUENCE
SRSASN_CODE pdcp_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_udc_r15_present, 1));
  HANDLE_CODE(bref.pack(pdcp_dupl_r15_present, 1));

  if (supported_udc_r15_present) {
    HANDLE_CODE(supported_udc_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_udc_r15_present, 1));
  HANDLE_CODE(bref.unpack(pdcp_dupl_r15_present, 1));

  if (supported_udc_r15_present) {
    HANDLE_CODE(supported_udc_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdcp_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_udc_r15_present) {
    j.write_fieldname("supportedUDC-r15");
    supported_udc_r15.to_json(j);
  }
  if (pdcp_dupl_r15_present) {
    j.write_str("pdcp-Duplication-r15", "supported");
  }
  j.end_obj();
}

// PDCP-ParametersNR-r15 ::= SEQUENCE
SRSASN_CODE pdcp_params_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rohc_context_max_sessions_r15_present, 1));
  HANDLE_CODE(bref.pack(rohc_context_continue_r15_present, 1));
  HANDLE_CODE(bref.pack(out_of_order_delivery_r15_present, 1));
  HANDLE_CODE(bref.pack(sn_size_lo_r15_present, 1));
  HANDLE_CODE(bref.pack(ims_voice_over_nr_pdcp_mcg_bearer_r15_present, 1));
  HANDLE_CODE(bref.pack(ims_voice_over_nr_pdcp_scg_bearer_r15_present, 1));

  HANDLE_CODE(rohc_profiles_r15.pack(bref));
  if (rohc_context_max_sessions_r15_present) {
    HANDLE_CODE(rohc_context_max_sessions_r15.pack(bref));
  }
  HANDLE_CODE(bref.pack(rohc_profiles_ul_only_r15.profile0x0006_r15, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_params_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rohc_context_max_sessions_r15_present, 1));
  HANDLE_CODE(bref.unpack(rohc_context_continue_r15_present, 1));
  HANDLE_CODE(bref.unpack(out_of_order_delivery_r15_present, 1));
  HANDLE_CODE(bref.unpack(sn_size_lo_r15_present, 1));
  HANDLE_CODE(bref.unpack(ims_voice_over_nr_pdcp_mcg_bearer_r15_present, 1));
  HANDLE_CODE(bref.unpack(ims_voice_over_nr_pdcp_scg_bearer_r15_present, 1));

  HANDLE_CODE(rohc_profiles_r15.unpack(bref));
  if (rohc_context_max_sessions_r15_present) {
    HANDLE_CODE(rohc_context_max_sessions_r15.unpack(bref));
  }
  HANDLE_CODE(bref.unpack(rohc_profiles_ul_only_r15.profile0x0006_r15, 1));

  return SRSASN_SUCCESS;
}
void pdcp_params_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("rohc-Profiles-r15");
  rohc_profiles_r15.to_json(j);
  if (rohc_context_max_sessions_r15_present) {
    j.write_str("rohc-ContextMaxSessions-r15", rohc_context_max_sessions_r15.to_string());
  }
  j.write_fieldname("rohc-ProfilesUL-Only-r15");
  j.start_obj();
  j.write_bool("profile0x0006-r15", rohc_profiles_ul_only_r15.profile0x0006_r15);
  j.end_obj();
  if (rohc_context_continue_r15_present) {
    j.write_str("rohc-ContextContinue-r15", "supported");
  }
  if (out_of_order_delivery_r15_present) {
    j.write_str("outOfOrderDelivery-r15", "supported");
  }
  if (sn_size_lo_r15_present) {
    j.write_str("sn-SizeLo-r15", "supported");
  }
  if (ims_voice_over_nr_pdcp_mcg_bearer_r15_present) {
    j.write_str("ims-VoiceOverNR-PDCP-MCG-Bearer-r15", "supported");
  }
  if (ims_voice_over_nr_pdcp_scg_bearer_r15_present) {
    j.write_str("ims-VoiceOverNR-PDCP-SCG-Bearer-r15", "supported");
  }
  j.end_obj();
}

// PhyLayerParameters-v1020 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(two_ant_ports_for_pucch_r10_present, 1));
  HANDLE_CODE(bref.pack(tm9_with_minus8_tx_fdd_r10_present, 1));
  HANDLE_CODE(bref.pack(pmi_disabling_r10_present, 1));
  HANDLE_CODE(bref.pack(cross_carrier_sched_r10_present, 1));
  HANDLE_CODE(bref.pack(simul_pucch_pusch_r10_present, 1));
  HANDLE_CODE(bref.pack(multi_cluster_pusch_within_cc_r10_present, 1));
  HANDLE_CODE(bref.pack(non_contiguous_ul_ra_within_cc_list_r10_present, 1));

  if (non_contiguous_ul_ra_within_cc_list_r10_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, non_contiguous_ul_ra_within_cc_list_r10, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(two_ant_ports_for_pucch_r10_present, 1));
  HANDLE_CODE(bref.unpack(tm9_with_minus8_tx_fdd_r10_present, 1));
  HANDLE_CODE(bref.unpack(pmi_disabling_r10_present, 1));
  HANDLE_CODE(bref.unpack(cross_carrier_sched_r10_present, 1));
  HANDLE_CODE(bref.unpack(simul_pucch_pusch_r10_present, 1));
  HANDLE_CODE(bref.unpack(multi_cluster_pusch_within_cc_r10_present, 1));
  HANDLE_CODE(bref.unpack(non_contiguous_ul_ra_within_cc_list_r10_present, 1));

  if (non_contiguous_ul_ra_within_cc_list_r10_present) {
    HANDLE_CODE(unpack_dyn_seq_of(non_contiguous_ul_ra_within_cc_list_r10, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (two_ant_ports_for_pucch_r10_present) {
    j.write_str("twoAntennaPortsForPUCCH-r10", "supported");
  }
  if (tm9_with_minus8_tx_fdd_r10_present) {
    j.write_str("tm9-With-8Tx-FDD-r10", "supported");
  }
  if (pmi_disabling_r10_present) {
    j.write_str("pmi-Disabling-r10", "supported");
  }
  if (cross_carrier_sched_r10_present) {
    j.write_str("crossCarrierScheduling-r10", "supported");
  }
  if (simul_pucch_pusch_r10_present) {
    j.write_str("simultaneousPUCCH-PUSCH-r10", "supported");
  }
  if (multi_cluster_pusch_within_cc_r10_present) {
    j.write_str("multiClusterPUSCH-WithinCC-r10", "supported");
  }
  if (non_contiguous_ul_ra_within_cc_list_r10_present) {
    j.start_array("nonContiguousUL-RA-WithinCC-List-r10");
    for (const auto& e1 : non_contiguous_ul_ra_within_cc_list_r10) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// PhyLayerParameters-v1250 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(e_harq_pattern_fdd_r12_present, 1));
  HANDLE_CODE(bref.pack(enhanced_minus4_tx_codebook_r12_present, 1));
  HANDLE_CODE(bref.pack(tdd_fdd_ca_pcell_duplex_r12_present, 1));
  HANDLE_CODE(bref.pack(phy_tdd_re_cfg_tdd_pcell_r12_present, 1));
  HANDLE_CODE(bref.pack(phy_tdd_re_cfg_fdd_pcell_r12_present, 1));
  HANDLE_CODE(bref.pack(pusch_feedback_mode_r12_present, 1));
  HANDLE_CODE(bref.pack(pusch_srs_pwr_ctrl_sf_set_r12_present, 1));
  HANDLE_CODE(bref.pack(csi_sf_set_r12_present, 1));
  HANDLE_CODE(bref.pack(no_res_restrict_for_tti_bundling_r12_present, 1));
  HANDLE_CODE(bref.pack(discovery_signals_in_deact_scell_r12_present, 1));
  HANDLE_CODE(bref.pack(naics_cap_list_r12_present, 1));

  if (tdd_fdd_ca_pcell_duplex_r12_present) {
    HANDLE_CODE(tdd_fdd_ca_pcell_duplex_r12.pack(bref));
  }
  if (naics_cap_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, naics_cap_list_r12, 1, 8));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(e_harq_pattern_fdd_r12_present, 1));
  HANDLE_CODE(bref.unpack(enhanced_minus4_tx_codebook_r12_present, 1));
  HANDLE_CODE(bref.unpack(tdd_fdd_ca_pcell_duplex_r12_present, 1));
  HANDLE_CODE(bref.unpack(phy_tdd_re_cfg_tdd_pcell_r12_present, 1));
  HANDLE_CODE(bref.unpack(phy_tdd_re_cfg_fdd_pcell_r12_present, 1));
  HANDLE_CODE(bref.unpack(pusch_feedback_mode_r12_present, 1));
  HANDLE_CODE(bref.unpack(pusch_srs_pwr_ctrl_sf_set_r12_present, 1));
  HANDLE_CODE(bref.unpack(csi_sf_set_r12_present, 1));
  HANDLE_CODE(bref.unpack(no_res_restrict_for_tti_bundling_r12_present, 1));
  HANDLE_CODE(bref.unpack(discovery_signals_in_deact_scell_r12_present, 1));
  HANDLE_CODE(bref.unpack(naics_cap_list_r12_present, 1));

  if (tdd_fdd_ca_pcell_duplex_r12_present) {
    HANDLE_CODE(tdd_fdd_ca_pcell_duplex_r12.unpack(bref));
  }
  if (naics_cap_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(naics_cap_list_r12, bref, 1, 8));
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (e_harq_pattern_fdd_r12_present) {
    j.write_str("e-HARQ-Pattern-FDD-r12", "supported");
  }
  if (enhanced_minus4_tx_codebook_r12_present) {
    j.write_str("enhanced-4TxCodebook-r12", "supported");
  }
  if (tdd_fdd_ca_pcell_duplex_r12_present) {
    j.write_str("tdd-FDD-CA-PCellDuplex-r12", tdd_fdd_ca_pcell_duplex_r12.to_string());
  }
  if (phy_tdd_re_cfg_tdd_pcell_r12_present) {
    j.write_str("phy-TDD-ReConfig-TDD-PCell-r12", "supported");
  }
  if (phy_tdd_re_cfg_fdd_pcell_r12_present) {
    j.write_str("phy-TDD-ReConfig-FDD-PCell-r12", "supported");
  }
  if (pusch_feedback_mode_r12_present) {
    j.write_str("pusch-FeedbackMode-r12", "supported");
  }
  if (pusch_srs_pwr_ctrl_sf_set_r12_present) {
    j.write_str("pusch-SRS-PowerControl-SubframeSet-r12", "supported");
  }
  if (csi_sf_set_r12_present) {
    j.write_str("csi-SubframeSet-r12", "supported");
  }
  if (no_res_restrict_for_tti_bundling_r12_present) {
    j.write_str("noResourceRestrictionForTTIBundling-r12", "supported");
  }
  if (discovery_signals_in_deact_scell_r12_present) {
    j.write_str("discoverySignalsInDeactSCell-r12", "supported");
  }
  if (naics_cap_list_r12_present) {
    j.start_array("naics-Capability-List-r12");
    for (const auto& e1 : naics_cap_list_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// PhyLayerParameters-v1320 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mimo_ue_params_r13_present, 1));

  if (mimo_ue_params_r13_present) {
    HANDLE_CODE(mimo_ue_params_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mimo_ue_params_r13_present, 1));

  if (mimo_ue_params_r13_present) {
    HANDLE_CODE(mimo_ue_params_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mimo_ue_params_r13_present) {
    j.write_fieldname("mimo-UE-Parameters-r13");
    mimo_ue_params_r13.to_json(j);
  }
  j.end_obj();
}

// PhyLayerParameters-v1330 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1330_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cch_interf_mitigation_ref_rec_type_a_r13_present, 1));
  HANDLE_CODE(bref.pack(cch_interf_mitigation_ref_rec_type_b_r13_present, 1));
  HANDLE_CODE(bref.pack(cch_interf_mitigation_max_num_ccs_r13_present, 1));
  HANDLE_CODE(bref.pack(crs_interf_mitigation_tm1to_tm9_r13_present, 1));

  if (cch_interf_mitigation_max_num_ccs_r13_present) {
    HANDLE_CODE(pack_integer(bref, cch_interf_mitigation_max_num_ccs_r13, (uint8_t)1u, (uint8_t)32u));
  }
  if (crs_interf_mitigation_tm1to_tm9_r13_present) {
    HANDLE_CODE(pack_integer(bref, crs_interf_mitigation_tm1to_tm9_r13, (uint8_t)1u, (uint8_t)32u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1330_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cch_interf_mitigation_ref_rec_type_a_r13_present, 1));
  HANDLE_CODE(bref.unpack(cch_interf_mitigation_ref_rec_type_b_r13_present, 1));
  HANDLE_CODE(bref.unpack(cch_interf_mitigation_max_num_ccs_r13_present, 1));
  HANDLE_CODE(bref.unpack(crs_interf_mitigation_tm1to_tm9_r13_present, 1));

  if (cch_interf_mitigation_max_num_ccs_r13_present) {
    HANDLE_CODE(unpack_integer(cch_interf_mitigation_max_num_ccs_r13, bref, (uint8_t)1u, (uint8_t)32u));
  }
  if (crs_interf_mitigation_tm1to_tm9_r13_present) {
    HANDLE_CODE(unpack_integer(crs_interf_mitigation_tm1to_tm9_r13, bref, (uint8_t)1u, (uint8_t)32u));
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1330_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cch_interf_mitigation_ref_rec_type_a_r13_present) {
    j.write_str("cch-InterfMitigation-RefRecTypeA-r13", "supported");
  }
  if (cch_interf_mitigation_ref_rec_type_b_r13_present) {
    j.write_str("cch-InterfMitigation-RefRecTypeB-r13", "supported");
  }
  if (cch_interf_mitigation_max_num_ccs_r13_present) {
    j.write_int("cch-InterfMitigation-MaxNumCCs-r13", cch_interf_mitigation_max_num_ccs_r13);
  }
  if (crs_interf_mitigation_tm1to_tm9_r13_present) {
    j.write_int("crs-InterfMitigationTM1toTM9-r13", crs_interf_mitigation_tm1to_tm9_r13);
  }
  j.end_obj();
}

// FeMBMS-Unicast-Parameters-r14 ::= SEQUENCE
SRSASN_CODE fe_mbms_unicast_params_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(unicast_fembms_mixed_scell_r14_present, 1));
  HANDLE_CODE(bref.pack(empty_unicast_region_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE fe_mbms_unicast_params_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(unicast_fembms_mixed_scell_r14_present, 1));
  HANDLE_CODE(bref.unpack(empty_unicast_region_r14_present, 1));

  return SRSASN_SUCCESS;
}
void fe_mbms_unicast_params_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (unicast_fembms_mixed_scell_r14_present) {
    j.write_str("unicast-fembmsMixedSCell-r14", "supported");
  }
  if (empty_unicast_region_r14_present) {
    j.write_str("emptyUnicastRegion-r14", "supported");
  }
  j.end_obj();
}

// PhyLayerParameters-v1430 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_pusch_nb_max_tbs_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_pdsch_pusch_max_bw_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_harq_ack_bundling_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_pdsch_ten_processes_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_retuning_symbols_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_pdsch_pusch_enhancement_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_sched_enhancement_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_srs_enhancement_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_pucch_enhancement_r14_present, 1));
  HANDLE_CODE(bref.pack(ce_closed_loop_tx_ant_sel_r14_present, 1));
  HANDLE_CODE(bref.pack(tdd_special_sf_r14_present, 1));
  HANDLE_CODE(bref.pack(tdd_tti_bundling_r14_present, 1));
  HANDLE_CODE(bref.pack(dmrs_less_up_pts_r14_present, 1));
  HANDLE_CODE(bref.pack(mimo_ue_params_v1430_present, 1));
  HANDLE_CODE(bref.pack(alt_tbs_idx_r14_present, 1));
  HANDLE_CODE(bref.pack(fe_mbms_unicast_params_r14_present, 1));

  if (ce_pdsch_pusch_max_bw_r14_present) {
    HANDLE_CODE(ce_pdsch_pusch_max_bw_r14.pack(bref));
  }
  if (ce_retuning_symbols_r14_present) {
    HANDLE_CODE(ce_retuning_symbols_r14.pack(bref));
  }
  if (mimo_ue_params_v1430_present) {
    HANDLE_CODE(mimo_ue_params_v1430.pack(bref));
  }
  if (fe_mbms_unicast_params_r14_present) {
    HANDLE_CODE(fe_mbms_unicast_params_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_pusch_nb_max_tbs_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_pdsch_pusch_max_bw_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_harq_ack_bundling_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_pdsch_ten_processes_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_retuning_symbols_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_pdsch_pusch_enhancement_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_sched_enhancement_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_srs_enhancement_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_pucch_enhancement_r14_present, 1));
  HANDLE_CODE(bref.unpack(ce_closed_loop_tx_ant_sel_r14_present, 1));
  HANDLE_CODE(bref.unpack(tdd_special_sf_r14_present, 1));
  HANDLE_CODE(bref.unpack(tdd_tti_bundling_r14_present, 1));
  HANDLE_CODE(bref.unpack(dmrs_less_up_pts_r14_present, 1));
  HANDLE_CODE(bref.unpack(mimo_ue_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(alt_tbs_idx_r14_present, 1));
  HANDLE_CODE(bref.unpack(fe_mbms_unicast_params_r14_present, 1));

  if (ce_pdsch_pusch_max_bw_r14_present) {
    HANDLE_CODE(ce_pdsch_pusch_max_bw_r14.unpack(bref));
  }
  if (ce_retuning_symbols_r14_present) {
    HANDLE_CODE(ce_retuning_symbols_r14.unpack(bref));
  }
  if (mimo_ue_params_v1430_present) {
    HANDLE_CODE(mimo_ue_params_v1430.unpack(bref));
  }
  if (fe_mbms_unicast_params_r14_present) {
    HANDLE_CODE(fe_mbms_unicast_params_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_pusch_nb_max_tbs_r14_present) {
    j.write_str("ce-PUSCH-NB-MaxTBS-r14", "supported");
  }
  if (ce_pdsch_pusch_max_bw_r14_present) {
    j.write_str("ce-PDSCH-PUSCH-MaxBandwidth-r14", ce_pdsch_pusch_max_bw_r14.to_string());
  }
  if (ce_harq_ack_bundling_r14_present) {
    j.write_str("ce-HARQ-AckBundling-r14", "supported");
  }
  if (ce_pdsch_ten_processes_r14_present) {
    j.write_str("ce-PDSCH-TenProcesses-r14", "supported");
  }
  if (ce_retuning_symbols_r14_present) {
    j.write_str("ce-RetuningSymbols-r14", ce_retuning_symbols_r14.to_string());
  }
  if (ce_pdsch_pusch_enhancement_r14_present) {
    j.write_str("ce-PDSCH-PUSCH-Enhancement-r14", "supported");
  }
  if (ce_sched_enhancement_r14_present) {
    j.write_str("ce-SchedulingEnhancement-r14", "supported");
  }
  if (ce_srs_enhancement_r14_present) {
    j.write_str("ce-SRS-Enhancement-r14", "supported");
  }
  if (ce_pucch_enhancement_r14_present) {
    j.write_str("ce-PUCCH-Enhancement-r14", "supported");
  }
  if (ce_closed_loop_tx_ant_sel_r14_present) {
    j.write_str("ce-ClosedLoopTxAntennaSelection-r14", "supported");
  }
  if (tdd_special_sf_r14_present) {
    j.write_str("tdd-SpecialSubframe-r14", "supported");
  }
  if (tdd_tti_bundling_r14_present) {
    j.write_str("tdd-TTI-Bundling-r14", "supported");
  }
  if (dmrs_less_up_pts_r14_present) {
    j.write_str("dmrs-LessUpPTS-r14", "supported");
  }
  if (mimo_ue_params_v1430_present) {
    j.write_fieldname("mimo-UE-Parameters-v1430");
    mimo_ue_params_v1430.to_json(j);
  }
  if (alt_tbs_idx_r14_present) {
    j.write_str("alternativeTBS-Index-r14", "supported");
  }
  if (fe_mbms_unicast_params_r14_present) {
    j.write_fieldname("feMBMS-Unicast-Parameters-r14");
    fe_mbms_unicast_params_r14.to_json(j);
  }
  j.end_obj();
}

// PhyLayerParameters-v1470 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1470_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mimo_ue_params_v1470_present, 1));
  HANDLE_CODE(bref.pack(srs_up_pts_minus6sym_r14_present, 1));

  if (mimo_ue_params_v1470_present) {
    HANDLE_CODE(mimo_ue_params_v1470.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1470_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mimo_ue_params_v1470_present, 1));
  HANDLE_CODE(bref.unpack(srs_up_pts_minus6sym_r14_present, 1));

  if (mimo_ue_params_v1470_present) {
    HANDLE_CODE(mimo_ue_params_v1470.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1470_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mimo_ue_params_v1470_present) {
    j.write_fieldname("mimo-UE-Parameters-v1470");
    mimo_ue_params_v1470.to_json(j);
  }
  if (srs_up_pts_minus6sym_r14_present) {
    j.write_str("srs-UpPTS-6sym-r14", "supported");
  }
  j.end_obj();
}

// PhyLayerParameters-v1530 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(stti_spt_cap_r15_present, 1));
  HANDLE_CODE(bref.pack(ce_cap_r15_present, 1));
  HANDLE_CODE(bref.pack(short_cqi_for_scell_activation_r15_present, 1));
  HANDLE_CODE(bref.pack(mimo_cbsr_advanced_csi_r15_present, 1));
  HANDLE_CODE(bref.pack(crs_intf_mitig_r15_present, 1));
  HANDLE_CODE(bref.pack(ul_pwr_ctrl_enhance_r15_present, 1));
  HANDLE_CODE(bref.pack(urllc_cap_r15_present, 1));
  HANDLE_CODE(bref.pack(alt_mcs_table_r15_present, 1));

  if (stti_spt_cap_r15_present) {
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.aperiodic_csi_report_stti_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.dmrs_based_spdcch_mbsfn_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.dmrs_based_spdcch_non_mbsfn_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.dmrs_position_pattern_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.dmrs_sharing_subslot_pdsch_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.dmrs_repeat_subslot_pdsch_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.epdcch_spt_different_cells_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.epdcch_stti_different_cells_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.max_layers_slot_or_subslot_pusch_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.max_num_upd_csi_proc_spt_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb77_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb27_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set1_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set2_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.mimo_ue_params_stti_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.mimo_ue_params_stti_v1530_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.nof_blind_decodes_uss_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.pdsch_slot_subslot_pdsch_decoding_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.pwr_uci_slot_pusch_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.pwr_uci_subslot_pusch_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.slot_pdsch_tx_div_tm9and10_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.subslot_pdsch_tx_div_tm9and10_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.spdcch_different_rs_types_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.srs_dci7_trigger_fs2_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.sps_cyclic_shift_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.spdcch_reuse_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.sps_stti_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.tm8_slot_pdsch_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.tm9_slot_subslot_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.tm9_slot_subslot_mbsfn_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.tm10_slot_subslot_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.tm10_slot_subslot_mbsfn_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.tx_div_spucch_r15_present, 1));
    HANDLE_CODE(bref.pack(stti_spt_cap_r15.ul_async_harq_sharing_diff_tti_lens_r15_present, 1));
    if (stti_spt_cap_r15.max_layers_slot_or_subslot_pusch_r15_present) {
      HANDLE_CODE(stti_spt_cap_r15.max_layers_slot_or_subslot_pusch_r15.pack(bref));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_spt_r15_present) {
      HANDLE_CODE(pack_integer(bref, stti_spt_cap_r15.max_num_upd_csi_proc_spt_r15, (uint8_t)5u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb77_r15_present) {
      HANDLE_CODE(pack_integer(bref, stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb77_r15, (uint8_t)1u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb27_r15_present) {
      HANDLE_CODE(pack_integer(bref, stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb27_r15, (uint8_t)1u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set1_r15_present) {
      HANDLE_CODE(
          pack_integer(bref, stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set1_r15, (uint8_t)1u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set2_r15_present) {
      HANDLE_CODE(
          pack_integer(bref, stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set2_r15, (uint8_t)1u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.mimo_ue_params_stti_r15_present) {
      HANDLE_CODE(stti_spt_cap_r15.mimo_ue_params_stti_r15.pack(bref));
    }
    if (stti_spt_cap_r15.mimo_ue_params_stti_v1530_present) {
      HANDLE_CODE(stti_spt_cap_r15.mimo_ue_params_stti_v1530.pack(bref));
    }
    if (stti_spt_cap_r15.nof_blind_decodes_uss_r15_present) {
      HANDLE_CODE(pack_integer(bref, stti_spt_cap_r15.nof_blind_decodes_uss_r15, (uint8_t)4u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.sps_stti_r15_present) {
      HANDLE_CODE(stti_spt_cap_r15.sps_stti_r15.pack(bref));
    }
  }
  if (ce_cap_r15_present) {
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_crs_intf_mitig_r15_present, 1));
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_cqi_alt_table_r15_present, 1));
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_pdsch_flex_start_prb_ce_mode_a_r15_present, 1));
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_pdsch_flex_start_prb_ce_mode_b_r15_present, 1));
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_pdsch_minus64_qam_r15_present, 1));
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_pusch_flex_start_prb_ce_mode_a_r15_present, 1));
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_pusch_flex_start_prb_ce_mode_b_r15_present, 1));
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_pusch_sub_prb_alloc_r15_present, 1));
    HANDLE_CODE(bref.pack(ce_cap_r15.ce_ul_harq_ack_feedback_r15_present, 1));
  }
  if (urllc_cap_r15_present) {
    HANDLE_CODE(bref.pack(urllc_cap_r15.pdsch_rep_sf_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pdsch_rep_slot_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pdsch_rep_subslot_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_multi_cfg_sf_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_max_cfg_sf_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_multi_cfg_slot_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_max_cfg_slot_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_multi_cfg_subslot_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_max_cfg_subslot_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_slot_rep_pcell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_slot_rep_ps_cell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_slot_rep_scell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_sf_rep_pcell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_sf_rep_ps_cell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_sf_rep_scell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_subslot_rep_pcell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_subslot_rep_ps_cell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.pusch_sps_subslot_rep_scell_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.semi_static_cfi_r15_present, 1));
    HANDLE_CODE(bref.pack(urllc_cap_r15.semi_static_cfi_pattern_r15_present, 1));
    if (urllc_cap_r15.pusch_sps_multi_cfg_sf_r15_present) {
      HANDLE_CODE(pack_integer(bref, urllc_cap_r15.pusch_sps_multi_cfg_sf_r15, (uint8_t)0u, (uint8_t)6u));
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_sf_r15_present) {
      HANDLE_CODE(pack_integer(bref, urllc_cap_r15.pusch_sps_max_cfg_sf_r15, (uint8_t)0u, (uint8_t)31u));
    }
    if (urllc_cap_r15.pusch_sps_multi_cfg_slot_r15_present) {
      HANDLE_CODE(pack_integer(bref, urllc_cap_r15.pusch_sps_multi_cfg_slot_r15, (uint8_t)0u, (uint8_t)6u));
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_slot_r15_present) {
      HANDLE_CODE(pack_integer(bref, urllc_cap_r15.pusch_sps_max_cfg_slot_r15, (uint8_t)0u, (uint8_t)31u));
    }
    if (urllc_cap_r15.pusch_sps_multi_cfg_subslot_r15_present) {
      HANDLE_CODE(pack_integer(bref, urllc_cap_r15.pusch_sps_multi_cfg_subslot_r15, (uint8_t)0u, (uint8_t)6u));
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_subslot_r15_present) {
      HANDLE_CODE(pack_integer(bref, urllc_cap_r15.pusch_sps_max_cfg_subslot_r15, (uint8_t)0u, (uint8_t)31u));
    }
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(stti_spt_cap_r15_present, 1));
  HANDLE_CODE(bref.unpack(ce_cap_r15_present, 1));
  HANDLE_CODE(bref.unpack(short_cqi_for_scell_activation_r15_present, 1));
  HANDLE_CODE(bref.unpack(mimo_cbsr_advanced_csi_r15_present, 1));
  HANDLE_CODE(bref.unpack(crs_intf_mitig_r15_present, 1));
  HANDLE_CODE(bref.unpack(ul_pwr_ctrl_enhance_r15_present, 1));
  HANDLE_CODE(bref.unpack(urllc_cap_r15_present, 1));
  HANDLE_CODE(bref.unpack(alt_mcs_table_r15_present, 1));

  if (stti_spt_cap_r15_present) {
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.aperiodic_csi_report_stti_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.dmrs_based_spdcch_mbsfn_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.dmrs_based_spdcch_non_mbsfn_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.dmrs_position_pattern_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.dmrs_sharing_subslot_pdsch_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.dmrs_repeat_subslot_pdsch_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.epdcch_spt_different_cells_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.epdcch_stti_different_cells_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.max_layers_slot_or_subslot_pusch_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.max_num_upd_csi_proc_spt_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb77_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb27_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set1_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set2_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.mimo_ue_params_stti_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.mimo_ue_params_stti_v1530_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.nof_blind_decodes_uss_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.pdsch_slot_subslot_pdsch_decoding_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.pwr_uci_slot_pusch_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.pwr_uci_subslot_pusch_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.slot_pdsch_tx_div_tm9and10_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.subslot_pdsch_tx_div_tm9and10_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.spdcch_different_rs_types_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.srs_dci7_trigger_fs2_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.sps_cyclic_shift_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.spdcch_reuse_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.sps_stti_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.tm8_slot_pdsch_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.tm9_slot_subslot_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.tm9_slot_subslot_mbsfn_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.tm10_slot_subslot_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.tm10_slot_subslot_mbsfn_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.tx_div_spucch_r15_present, 1));
    HANDLE_CODE(bref.unpack(stti_spt_cap_r15.ul_async_harq_sharing_diff_tti_lens_r15_present, 1));
    if (stti_spt_cap_r15.max_layers_slot_or_subslot_pusch_r15_present) {
      HANDLE_CODE(stti_spt_cap_r15.max_layers_slot_or_subslot_pusch_r15.unpack(bref));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_spt_r15_present) {
      HANDLE_CODE(unpack_integer(stti_spt_cap_r15.max_num_upd_csi_proc_spt_r15, bref, (uint8_t)5u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb77_r15_present) {
      HANDLE_CODE(
          unpack_integer(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb77_r15, bref, (uint8_t)1u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb27_r15_present) {
      HANDLE_CODE(
          unpack_integer(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb27_r15, bref, (uint8_t)1u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set1_r15_present) {
      HANDLE_CODE(
          unpack_integer(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set1_r15, bref, (uint8_t)1u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set2_r15_present) {
      HANDLE_CODE(
          unpack_integer(stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set2_r15, bref, (uint8_t)1u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.mimo_ue_params_stti_r15_present) {
      HANDLE_CODE(stti_spt_cap_r15.mimo_ue_params_stti_r15.unpack(bref));
    }
    if (stti_spt_cap_r15.mimo_ue_params_stti_v1530_present) {
      HANDLE_CODE(stti_spt_cap_r15.mimo_ue_params_stti_v1530.unpack(bref));
    }
    if (stti_spt_cap_r15.nof_blind_decodes_uss_r15_present) {
      HANDLE_CODE(unpack_integer(stti_spt_cap_r15.nof_blind_decodes_uss_r15, bref, (uint8_t)4u, (uint8_t)32u));
    }
    if (stti_spt_cap_r15.sps_stti_r15_present) {
      HANDLE_CODE(stti_spt_cap_r15.sps_stti_r15.unpack(bref));
    }
  }
  if (ce_cap_r15_present) {
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_crs_intf_mitig_r15_present, 1));
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_cqi_alt_table_r15_present, 1));
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_pdsch_flex_start_prb_ce_mode_a_r15_present, 1));
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_pdsch_flex_start_prb_ce_mode_b_r15_present, 1));
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_pdsch_minus64_qam_r15_present, 1));
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_pusch_flex_start_prb_ce_mode_a_r15_present, 1));
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_pusch_flex_start_prb_ce_mode_b_r15_present, 1));
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_pusch_sub_prb_alloc_r15_present, 1));
    HANDLE_CODE(bref.unpack(ce_cap_r15.ce_ul_harq_ack_feedback_r15_present, 1));
  }
  if (urllc_cap_r15_present) {
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pdsch_rep_sf_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pdsch_rep_slot_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pdsch_rep_subslot_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_multi_cfg_sf_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_max_cfg_sf_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_multi_cfg_slot_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_max_cfg_slot_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_multi_cfg_subslot_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_max_cfg_subslot_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_slot_rep_pcell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_slot_rep_ps_cell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_slot_rep_scell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_sf_rep_pcell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_sf_rep_ps_cell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_sf_rep_scell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_subslot_rep_pcell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_subslot_rep_ps_cell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.pusch_sps_subslot_rep_scell_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.semi_static_cfi_r15_present, 1));
    HANDLE_CODE(bref.unpack(urllc_cap_r15.semi_static_cfi_pattern_r15_present, 1));
    if (urllc_cap_r15.pusch_sps_multi_cfg_sf_r15_present) {
      HANDLE_CODE(unpack_integer(urllc_cap_r15.pusch_sps_multi_cfg_sf_r15, bref, (uint8_t)0u, (uint8_t)6u));
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_sf_r15_present) {
      HANDLE_CODE(unpack_integer(urllc_cap_r15.pusch_sps_max_cfg_sf_r15, bref, (uint8_t)0u, (uint8_t)31u));
    }
    if (urllc_cap_r15.pusch_sps_multi_cfg_slot_r15_present) {
      HANDLE_CODE(unpack_integer(urllc_cap_r15.pusch_sps_multi_cfg_slot_r15, bref, (uint8_t)0u, (uint8_t)6u));
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_slot_r15_present) {
      HANDLE_CODE(unpack_integer(urllc_cap_r15.pusch_sps_max_cfg_slot_r15, bref, (uint8_t)0u, (uint8_t)31u));
    }
    if (urllc_cap_r15.pusch_sps_multi_cfg_subslot_r15_present) {
      HANDLE_CODE(unpack_integer(urllc_cap_r15.pusch_sps_multi_cfg_subslot_r15, bref, (uint8_t)0u, (uint8_t)6u));
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_subslot_r15_present) {
      HANDLE_CODE(unpack_integer(urllc_cap_r15.pusch_sps_max_cfg_subslot_r15, bref, (uint8_t)0u, (uint8_t)31u));
    }
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (stti_spt_cap_r15_present) {
    j.write_fieldname("stti-SPT-Capabilities-r15");
    j.start_obj();
    if (stti_spt_cap_r15.aperiodic_csi_report_stti_r15_present) {
      j.write_str("aperiodicCsi-ReportingSTTI-r15", "supported");
    }
    if (stti_spt_cap_r15.dmrs_based_spdcch_mbsfn_r15_present) {
      j.write_str("dmrs-BasedSPDCCH-MBSFN-r15", "supported");
    }
    if (stti_spt_cap_r15.dmrs_based_spdcch_non_mbsfn_r15_present) {
      j.write_str("dmrs-BasedSPDCCH-nonMBSFN-r15", "supported");
    }
    if (stti_spt_cap_r15.dmrs_position_pattern_r15_present) {
      j.write_str("dmrs-PositionPattern-r15", "supported");
    }
    if (stti_spt_cap_r15.dmrs_sharing_subslot_pdsch_r15_present) {
      j.write_str("dmrs-SharingSubslotPDSCH-r15", "supported");
    }
    if (stti_spt_cap_r15.dmrs_repeat_subslot_pdsch_r15_present) {
      j.write_str("dmrs-RepetitionSubslotPDSCH-r15", "supported");
    }
    if (stti_spt_cap_r15.epdcch_spt_different_cells_r15_present) {
      j.write_str("epdcch-SPT-differentCells-r15", "supported");
    }
    if (stti_spt_cap_r15.epdcch_stti_different_cells_r15_present) {
      j.write_str("epdcch-STTI-differentCells-r15", "supported");
    }
    if (stti_spt_cap_r15.max_layers_slot_or_subslot_pusch_r15_present) {
      j.write_str("maxLayersSlotOrSubslotPUSCH-r15", stti_spt_cap_r15.max_layers_slot_or_subslot_pusch_r15.to_string());
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_spt_r15_present) {
      j.write_int("maxNumberUpdatedCSI-Proc-SPT-r15", stti_spt_cap_r15.max_num_upd_csi_proc_spt_r15);
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb77_r15_present) {
      j.write_int("maxNumberUpdatedCSI-Proc-STTI-Comb77-r15", stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb77_r15);
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb27_r15_present) {
      j.write_int("maxNumberUpdatedCSI-Proc-STTI-Comb27-r15", stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb27_r15);
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set1_r15_present) {
      j.write_int("maxNumberUpdatedCSI-Proc-STTI-Comb22-Set1-r15",
                  stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set1_r15);
    }
    if (stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set2_r15_present) {
      j.write_int("maxNumberUpdatedCSI-Proc-STTI-Comb22-Set2-r15",
                  stti_spt_cap_r15.max_num_upd_csi_proc_stti_comb22_set2_r15);
    }
    if (stti_spt_cap_r15.mimo_ue_params_stti_r15_present) {
      j.write_fieldname("mimo-UE-ParametersSTTI-r15");
      stti_spt_cap_r15.mimo_ue_params_stti_r15.to_json(j);
    }
    if (stti_spt_cap_r15.mimo_ue_params_stti_v1530_present) {
      j.write_fieldname("mimo-UE-ParametersSTTI-v1530");
      stti_spt_cap_r15.mimo_ue_params_stti_v1530.to_json(j);
    }
    if (stti_spt_cap_r15.nof_blind_decodes_uss_r15_present) {
      j.write_int("numberOfBlindDecodesUSS-r15", stti_spt_cap_r15.nof_blind_decodes_uss_r15);
    }
    if (stti_spt_cap_r15.pdsch_slot_subslot_pdsch_decoding_r15_present) {
      j.write_str("pdsch-SlotSubslotPDSCH-Decoding-r15", "supported");
    }
    if (stti_spt_cap_r15.pwr_uci_slot_pusch_present) {
      j.write_str("powerUCI-SlotPUSCH", "supported");
    }
    if (stti_spt_cap_r15.pwr_uci_subslot_pusch_present) {
      j.write_str("powerUCI-SubslotPUSCH", "supported");
    }
    if (stti_spt_cap_r15.slot_pdsch_tx_div_tm9and10_present) {
      j.write_str("slotPDSCH-TxDiv-TM9and10", "supported");
    }
    if (stti_spt_cap_r15.subslot_pdsch_tx_div_tm9and10_present) {
      j.write_str("subslotPDSCH-TxDiv-TM9and10", "supported");
    }
    if (stti_spt_cap_r15.spdcch_different_rs_types_r15_present) {
      j.write_str("spdcch-differentRS-types-r15", "supported");
    }
    if (stti_spt_cap_r15.srs_dci7_trigger_fs2_r15_present) {
      j.write_str("srs-DCI7-TriggeringFS2-r15", "supported");
    }
    if (stti_spt_cap_r15.sps_cyclic_shift_r15_present) {
      j.write_str("sps-cyclicShift-r15", "supported");
    }
    if (stti_spt_cap_r15.spdcch_reuse_r15_present) {
      j.write_str("spdcch-Reuse-r15", "supported");
    }
    if (stti_spt_cap_r15.sps_stti_r15_present) {
      j.write_str("sps-STTI-r15", stti_spt_cap_r15.sps_stti_r15.to_string());
    }
    if (stti_spt_cap_r15.tm8_slot_pdsch_r15_present) {
      j.write_str("tm8-slotPDSCH-r15", "supported");
    }
    if (stti_spt_cap_r15.tm9_slot_subslot_r15_present) {
      j.write_str("tm9-slotSubslot-r15", "supported");
    }
    if (stti_spt_cap_r15.tm9_slot_subslot_mbsfn_r15_present) {
      j.write_str("tm9-slotSubslotMBSFN-r15", "supported");
    }
    if (stti_spt_cap_r15.tm10_slot_subslot_r15_present) {
      j.write_str("tm10-slotSubslot-r15", "supported");
    }
    if (stti_spt_cap_r15.tm10_slot_subslot_mbsfn_r15_present) {
      j.write_str("tm10-slotSubslotMBSFN-r15", "supported");
    }
    if (stti_spt_cap_r15.tx_div_spucch_r15_present) {
      j.write_str("txDiv-SPUCCH-r15", "supported");
    }
    if (stti_spt_cap_r15.ul_async_harq_sharing_diff_tti_lens_r15_present) {
      j.write_str("ul-AsyncHarqSharingDiff-TTI-Lengths-r15", "supported");
    }
    j.end_obj();
  }
  if (ce_cap_r15_present) {
    j.write_fieldname("ce-Capabilities-r15");
    j.start_obj();
    if (ce_cap_r15.ce_crs_intf_mitig_r15_present) {
      j.write_str("ce-CRS-IntfMitig-r15", "supported");
    }
    if (ce_cap_r15.ce_cqi_alt_table_r15_present) {
      j.write_str("ce-CQI-AlternativeTable-r15", "supported");
    }
    if (ce_cap_r15.ce_pdsch_flex_start_prb_ce_mode_a_r15_present) {
      j.write_str("ce-PDSCH-FlexibleStartPRB-CE-ModeA-r15", "supported");
    }
    if (ce_cap_r15.ce_pdsch_flex_start_prb_ce_mode_b_r15_present) {
      j.write_str("ce-PDSCH-FlexibleStartPRB-CE-ModeB-r15", "supported");
    }
    if (ce_cap_r15.ce_pdsch_minus64_qam_r15_present) {
      j.write_str("ce-PDSCH-64QAM-r15", "supported");
    }
    if (ce_cap_r15.ce_pusch_flex_start_prb_ce_mode_a_r15_present) {
      j.write_str("ce-PUSCH-FlexibleStartPRB-CE-ModeA-r15", "supported");
    }
    if (ce_cap_r15.ce_pusch_flex_start_prb_ce_mode_b_r15_present) {
      j.write_str("ce-PUSCH-FlexibleStartPRB-CE-ModeB-r15", "supported");
    }
    if (ce_cap_r15.ce_pusch_sub_prb_alloc_r15_present) {
      j.write_str("ce-PUSCH-SubPRB-Allocation-r15", "supported");
    }
    if (ce_cap_r15.ce_ul_harq_ack_feedback_r15_present) {
      j.write_str("ce-UL-HARQ-ACK-Feedback-r15", "supported");
    }
    j.end_obj();
  }
  if (short_cqi_for_scell_activation_r15_present) {
    j.write_str("shortCQI-ForSCellActivation-r15", "supported");
  }
  if (mimo_cbsr_advanced_csi_r15_present) {
    j.write_str("mimo-CBSR-AdvancedCSI-r15", "supported");
  }
  if (crs_intf_mitig_r15_present) {
    j.write_str("crs-IntfMitig-r15", "supported");
  }
  if (ul_pwr_ctrl_enhance_r15_present) {
    j.write_str("ul-PowerControlEnhancements-r15", "supported");
  }
  if (urllc_cap_r15_present) {
    j.write_fieldname("urllc-Capabilities-r15");
    j.start_obj();
    if (urllc_cap_r15.pdsch_rep_sf_r15_present) {
      j.write_str("pdsch-RepSubframe-r15", "supported");
    }
    if (urllc_cap_r15.pdsch_rep_slot_r15_present) {
      j.write_str("pdsch-RepSlot-r15", "supported");
    }
    if (urllc_cap_r15.pdsch_rep_subslot_r15_present) {
      j.write_str("pdsch-RepSubslot-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_multi_cfg_sf_r15_present) {
      j.write_int("pusch-SPS-MultiConfigSubframe-r15", urllc_cap_r15.pusch_sps_multi_cfg_sf_r15);
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_sf_r15_present) {
      j.write_int("pusch-SPS-MaxConfigSubframe-r15", urllc_cap_r15.pusch_sps_max_cfg_sf_r15);
    }
    if (urllc_cap_r15.pusch_sps_multi_cfg_slot_r15_present) {
      j.write_int("pusch-SPS-MultiConfigSlot-r15", urllc_cap_r15.pusch_sps_multi_cfg_slot_r15);
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_slot_r15_present) {
      j.write_int("pusch-SPS-MaxConfigSlot-r15", urllc_cap_r15.pusch_sps_max_cfg_slot_r15);
    }
    if (urllc_cap_r15.pusch_sps_multi_cfg_subslot_r15_present) {
      j.write_int("pusch-SPS-MultiConfigSubslot-r15", urllc_cap_r15.pusch_sps_multi_cfg_subslot_r15);
    }
    if (urllc_cap_r15.pusch_sps_max_cfg_subslot_r15_present) {
      j.write_int("pusch-SPS-MaxConfigSubslot-r15", urllc_cap_r15.pusch_sps_max_cfg_subslot_r15);
    }
    if (urllc_cap_r15.pusch_sps_slot_rep_pcell_r15_present) {
      j.write_str("pusch-SPS-SlotRepPCell-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_slot_rep_ps_cell_r15_present) {
      j.write_str("pusch-SPS-SlotRepPSCell-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_slot_rep_scell_r15_present) {
      j.write_str("pusch-SPS-SlotRepSCell-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_sf_rep_pcell_r15_present) {
      j.write_str("pusch-SPS-SubframeRepPCell-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_sf_rep_ps_cell_r15_present) {
      j.write_str("pusch-SPS-SubframeRepPSCell-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_sf_rep_scell_r15_present) {
      j.write_str("pusch-SPS-SubframeRepSCell-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_subslot_rep_pcell_r15_present) {
      j.write_str("pusch-SPS-SubslotRepPCell-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_subslot_rep_ps_cell_r15_present) {
      j.write_str("pusch-SPS-SubslotRepPSCell-r15", "supported");
    }
    if (urllc_cap_r15.pusch_sps_subslot_rep_scell_r15_present) {
      j.write_str("pusch-SPS-SubslotRepSCell-r15", "supported");
    }
    if (urllc_cap_r15.semi_static_cfi_r15_present) {
      j.write_str("semiStaticCFI-r15", "supported");
    }
    if (urllc_cap_r15.semi_static_cfi_pattern_r15_present) {
      j.write_str("semiStaticCFI-Pattern-r15", "supported");
    }
    j.end_obj();
  }
  if (alt_mcs_table_r15_present) {
    j.write_str("altMCS-Table-r15", "supported");
  }
  j.end_obj();
}

// SupportedBandEUTRA ::= SEQUENCE
SRSASN_CODE supported_band_eutra_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, band_eutra, (uint8_t)1u, (uint8_t)64u));
  HANDLE_CODE(bref.pack(half_duplex, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_band_eutra_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(band_eutra, bref, (uint8_t)1u, (uint8_t)64u));
  HANDLE_CODE(bref.unpack(half_duplex, 1));

  return SRSASN_SUCCESS;
}
void supported_band_eutra_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("bandEUTRA", band_eutra);
  j.write_bool("halfDuplex", half_duplex);
  j.end_obj();
}

// RF-Parameters ::= SEQUENCE
SRSASN_CODE rf_params_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_eutra, 1, 64));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_eutra, bref, 1, 64));

  return SRSASN_SUCCESS;
}
void rf_params_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandListEUTRA");
  for (const auto& e1 : supported_band_list_eutra) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// RF-Parameters-v1020 ::= SEQUENCE
SRSASN_CODE rf_params_v1020_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_r10, 1, 128, SeqOfPacker<Packer>(1, 64, Packer())));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1020_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_r10, bref, 1, 128, SeqOfPacker<Packer>(1, 64, Packer())));

  return SRSASN_SUCCESS;
}
void rf_params_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandCombination-r10");
  for (const auto& e1 : supported_band_combination_r10) {
    j.start_array();
    for (const auto& e2 : e1) {
      e2.to_json(j);
    }
    j.end_array();
  }
  j.end_array();
  j.end_obj();
}

// RF-Parameters-v1060 ::= SEQUENCE
SRSASN_CODE rf_params_v1060_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_ext_r10, 1, 128));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1060_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_ext_r10, bref, 1, 128));

  return SRSASN_SUCCESS;
}
void rf_params_v1060_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("supportedBandCombinationExt-r10");
  for (const auto& e1 : supported_band_combination_ext_r10) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// RF-Parameters-v1090 ::= SEQUENCE
SRSASN_CODE rf_params_v1090_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v1090_present, 1));

  if (supported_band_combination_v1090_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1090, 1, 128, SeqOfPacker<Packer>(1, 64, Packer())));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1090_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v1090_present, 1));

  if (supported_band_combination_v1090_present) {
    HANDLE_CODE(
        unpack_dyn_seq_of(supported_band_combination_v1090, bref, 1, 128, SeqOfPacker<Packer>(1, 64, Packer())));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1090_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v1090_present) {
    j.start_array("supportedBandCombination-v1090");
    for (const auto& e1 : supported_band_combination_v1090) {
      j.start_array();
      for (const auto& e2 : e1) {
        e2.to_json(j);
      }
      j.end_array();
    }
    j.end_array();
  }
  j.end_obj();
}

// RF-Parameters-v10i0 ::= SEQUENCE
SRSASN_CODE rf_params_v10i0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v10i0_present, 1));

  if (supported_band_combination_v10i0_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v10i0, 1, 128));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v10i0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v10i0_present, 1));

  if (supported_band_combination_v10i0_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v10i0, bref, 1, 128));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v10i0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v10i0_present) {
    j.start_array("supportedBandCombination-v10i0");
    for (const auto& e1 : supported_band_combination_v10i0) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// RF-Parameters-v1130 ::= SEQUENCE
SRSASN_CODE rf_params_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v1130_present, 1));

  if (supported_band_combination_v1130_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1130, 1, 128));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v1130_present, 1));

  if (supported_band_combination_v1130_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1130, bref, 1, 128));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v1130_present) {
    j.start_array("supportedBandCombination-v1130");
    for (const auto& e1 : supported_band_combination_v1130) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// RF-Parameters-v1180 ::= SEQUENCE
SRSASN_CODE rf_params_v1180_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(freq_band_retrieval_r11_present, 1));
  HANDLE_CODE(bref.pack(requested_bands_r11_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_r11_present, 1));

  if (requested_bands_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, requested_bands_r11, 1, 64, integer_packer<uint16_t>(1, 256)));
  }
  if (supported_band_combination_add_r11_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_r11, 1, 256));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1180_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(freq_band_retrieval_r11_present, 1));
  HANDLE_CODE(bref.unpack(requested_bands_r11_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_r11_present, 1));

  if (requested_bands_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(requested_bands_r11, bref, 1, 64, integer_packer<uint16_t>(1, 256)));
  }
  if (supported_band_combination_add_r11_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_r11, bref, 1, 256));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1180_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (freq_band_retrieval_r11_present) {
    j.write_str("freqBandRetrieval-r11", "supported");
  }
  if (requested_bands_r11_present) {
    j.start_array("requestedBands-r11");
    for (const auto& e1 : requested_bands_r11) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (supported_band_combination_add_r11_present) {
    j.start_array("supportedBandCombinationAdd-r11");
    for (const auto& e1 : supported_band_combination_add_r11) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// RF-Parameters-v11d0 ::= SEQUENCE
SRSASN_CODE rf_params_v11d0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_add_v11d0_present, 1));

  if (supported_band_combination_add_v11d0_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v11d0, 1, 256));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v11d0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v11d0_present, 1));

  if (supported_band_combination_add_v11d0_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v11d0, bref, 1, 256));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v11d0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_add_v11d0_present) {
    j.start_array("supportedBandCombinationAdd-v11d0");
    for (const auto& e1 : supported_band_combination_add_v11d0) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SupportedBandEUTRA-v1250 ::= SEQUENCE
SRSASN_CODE supported_band_eutra_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dl_minus256_qam_r12_present, 1));
  HANDLE_CODE(bref.pack(ul_minus64_qam_r12_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_band_eutra_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dl_minus256_qam_r12_present, 1));
  HANDLE_CODE(bref.unpack(ul_minus64_qam_r12_present, 1));

  return SRSASN_SUCCESS;
}
void supported_band_eutra_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dl_minus256_qam_r12_present) {
    j.write_str("dl-256QAM-r12", "supported");
  }
  if (ul_minus64_qam_r12_present) {
    j.write_str("ul-64QAM-r12", "supported");
  }
  j.end_obj();
}

// RF-Parameters-v1250 ::= SEQUENCE
SRSASN_CODE rf_params_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_list_eutra_v1250_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_v1250_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1250_present, 1));
  HANDLE_CODE(bref.pack(freq_band_prio_adjustment_r12_present, 1));

  if (supported_band_list_eutra_v1250_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_eutra_v1250, 1, 64));
  }
  if (supported_band_combination_v1250_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1250, 1, 128));
  }
  if (supported_band_combination_add_v1250_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1250, 1, 256));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_list_eutra_v1250_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_v1250_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1250_present, 1));
  HANDLE_CODE(bref.unpack(freq_band_prio_adjustment_r12_present, 1));

  if (supported_band_list_eutra_v1250_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_eutra_v1250, bref, 1, 64));
  }
  if (supported_band_combination_v1250_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1250, bref, 1, 128));
  }
  if (supported_band_combination_add_v1250_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1250, bref, 1, 256));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_list_eutra_v1250_present) {
    j.start_array("supportedBandListEUTRA-v1250");
    for (const auto& e1 : supported_band_list_eutra_v1250) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_v1250_present) {
    j.start_array("supportedBandCombination-v1250");
    for (const auto& e1 : supported_band_combination_v1250) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1250_present) {
    j.start_array("supportedBandCombinationAdd-v1250");
    for (const auto& e1 : supported_band_combination_add_v1250) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (freq_band_prio_adjustment_r12_present) {
    j.write_str("freqBandPriorityAdjustment-r12", "supported");
  }
  j.end_obj();
}

// RF-Parameters-v1270 ::= SEQUENCE
SRSASN_CODE rf_params_v1270_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v1270_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1270_present, 1));

  if (supported_band_combination_v1270_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1270, 1, 128));
  }
  if (supported_band_combination_add_v1270_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1270, 1, 256));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1270_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v1270_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1270_present, 1));

  if (supported_band_combination_v1270_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1270, bref, 1, 128));
  }
  if (supported_band_combination_add_v1270_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1270, bref, 1, 256));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1270_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v1270_present) {
    j.start_array("supportedBandCombination-v1270");
    for (const auto& e1 : supported_band_combination_v1270) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1270_present) {
    j.start_array("supportedBandCombinationAdd-v1270");
    for (const auto& e1 : supported_band_combination_add_v1270) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SupportedBandEUTRA-v1310 ::= SEQUENCE
SRSASN_CODE supported_band_eutra_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ue_pwr_class_minus5_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_band_eutra_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_pwr_class_minus5_r13_present, 1));

  return SRSASN_SUCCESS;
}
void supported_band_eutra_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_pwr_class_minus5_r13_present) {
    j.write_str("ue-PowerClass-5-r13", "supported");
  }
  j.end_obj();
}

// RF-Parameters-v1310 ::= SEQUENCE
SRSASN_CODE rf_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(enb_requested_params_r13_present, 1));
  HANDLE_CODE(bref.pack(maximum_ccs_retrieval_r13_present, 1));
  HANDLE_CODE(bref.pack(skip_fallback_combinations_r13_present, 1));
  HANDLE_CODE(bref.pack(reduced_int_non_cont_comb_r13_present, 1));
  HANDLE_CODE(bref.pack(supported_band_list_eutra_v1310_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_reduced_r13_present, 1));

  if (enb_requested_params_r13_present) {
    HANDLE_CODE(bref.pack(enb_requested_params_r13.reduced_int_non_cont_comb_requested_r13_present, 1));
    HANDLE_CODE(bref.pack(enb_requested_params_r13.requested_ccs_dl_r13_present, 1));
    HANDLE_CODE(bref.pack(enb_requested_params_r13.requested_ccs_ul_r13_present, 1));
    HANDLE_CODE(bref.pack(enb_requested_params_r13.skip_fallback_comb_requested_r13_present, 1));
    if (enb_requested_params_r13.requested_ccs_dl_r13_present) {
      HANDLE_CODE(pack_integer(bref, enb_requested_params_r13.requested_ccs_dl_r13, (uint8_t)2u, (uint8_t)32u));
    }
    if (enb_requested_params_r13.requested_ccs_ul_r13_present) {
      HANDLE_CODE(pack_integer(bref, enb_requested_params_r13.requested_ccs_ul_r13, (uint8_t)2u, (uint8_t)32u));
    }
  }
  if (supported_band_list_eutra_v1310_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_eutra_v1310, 1, 64));
  }
  if (supported_band_combination_reduced_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_reduced_r13, 1, 384));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(enb_requested_params_r13_present, 1));
  HANDLE_CODE(bref.unpack(maximum_ccs_retrieval_r13_present, 1));
  HANDLE_CODE(bref.unpack(skip_fallback_combinations_r13_present, 1));
  HANDLE_CODE(bref.unpack(reduced_int_non_cont_comb_r13_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_list_eutra_v1310_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_reduced_r13_present, 1));

  if (enb_requested_params_r13_present) {
    HANDLE_CODE(bref.unpack(enb_requested_params_r13.reduced_int_non_cont_comb_requested_r13_present, 1));
    HANDLE_CODE(bref.unpack(enb_requested_params_r13.requested_ccs_dl_r13_present, 1));
    HANDLE_CODE(bref.unpack(enb_requested_params_r13.requested_ccs_ul_r13_present, 1));
    HANDLE_CODE(bref.unpack(enb_requested_params_r13.skip_fallback_comb_requested_r13_present, 1));
    if (enb_requested_params_r13.requested_ccs_dl_r13_present) {
      HANDLE_CODE(unpack_integer(enb_requested_params_r13.requested_ccs_dl_r13, bref, (uint8_t)2u, (uint8_t)32u));
    }
    if (enb_requested_params_r13.requested_ccs_ul_r13_present) {
      HANDLE_CODE(unpack_integer(enb_requested_params_r13.requested_ccs_ul_r13, bref, (uint8_t)2u, (uint8_t)32u));
    }
  }
  if (supported_band_list_eutra_v1310_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_eutra_v1310, bref, 1, 64));
  }
  if (supported_band_combination_reduced_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_reduced_r13, bref, 1, 384));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (enb_requested_params_r13_present) {
    j.write_fieldname("eNB-RequestedParameters-r13");
    j.start_obj();
    if (enb_requested_params_r13.reduced_int_non_cont_comb_requested_r13_present) {
      j.write_str("reducedIntNonContCombRequested-r13", "true");
    }
    if (enb_requested_params_r13.requested_ccs_dl_r13_present) {
      j.write_int("requestedCCsDL-r13", enb_requested_params_r13.requested_ccs_dl_r13);
    }
    if (enb_requested_params_r13.requested_ccs_ul_r13_present) {
      j.write_int("requestedCCsUL-r13", enb_requested_params_r13.requested_ccs_ul_r13);
    }
    if (enb_requested_params_r13.skip_fallback_comb_requested_r13_present) {
      j.write_str("skipFallbackCombRequested-r13", "true");
    }
    j.end_obj();
  }
  if (maximum_ccs_retrieval_r13_present) {
    j.write_str("maximumCCsRetrieval-r13", "supported");
  }
  if (skip_fallback_combinations_r13_present) {
    j.write_str("skipFallbackCombinations-r13", "supported");
  }
  if (reduced_int_non_cont_comb_r13_present) {
    j.write_str("reducedIntNonContComb-r13", "supported");
  }
  if (supported_band_list_eutra_v1310_present) {
    j.start_array("supportedBandListEUTRA-v1310");
    for (const auto& e1 : supported_band_list_eutra_v1310) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_reduced_r13_present) {
    j.start_array("supportedBandCombinationReduced-r13");
    for (const auto& e1 : supported_band_combination_reduced_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SupportedBandEUTRA-v1320 ::= SEQUENCE
SRSASN_CODE supported_band_eutra_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(intra_freq_ce_need_for_gaps_r13_present, 1));
  HANDLE_CODE(bref.pack(ue_pwr_class_n_r13_present, 1));

  if (ue_pwr_class_n_r13_present) {
    HANDLE_CODE(ue_pwr_class_n_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_band_eutra_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(intra_freq_ce_need_for_gaps_r13_present, 1));
  HANDLE_CODE(bref.unpack(ue_pwr_class_n_r13_present, 1));

  if (ue_pwr_class_n_r13_present) {
    HANDLE_CODE(ue_pwr_class_n_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void supported_band_eutra_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (intra_freq_ce_need_for_gaps_r13_present) {
    j.write_str("intraFreq-CE-NeedForGaps-r13", "supported");
  }
  if (ue_pwr_class_n_r13_present) {
    j.write_str("ue-PowerClass-N-r13", ue_pwr_class_n_r13.to_string());
  }
  j.end_obj();
}

// RF-Parameters-v1320 ::= SEQUENCE
SRSASN_CODE rf_params_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_list_eutra_v1320_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_v1320_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1320_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_reduced_v1320_present, 1));

  if (supported_band_list_eutra_v1320_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_eutra_v1320, 1, 64));
  }
  if (supported_band_combination_v1320_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1320, 1, 128));
  }
  if (supported_band_combination_add_v1320_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1320, 1, 256));
  }
  if (supported_band_combination_reduced_v1320_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_reduced_v1320, 1, 384));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_list_eutra_v1320_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_v1320_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1320_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_reduced_v1320_present, 1));

  if (supported_band_list_eutra_v1320_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_eutra_v1320, bref, 1, 64));
  }
  if (supported_band_combination_v1320_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1320, bref, 1, 128));
  }
  if (supported_band_combination_add_v1320_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1320, bref, 1, 256));
  }
  if (supported_band_combination_reduced_v1320_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_reduced_v1320, bref, 1, 384));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_list_eutra_v1320_present) {
    j.start_array("supportedBandListEUTRA-v1320");
    for (const auto& e1 : supported_band_list_eutra_v1320) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_v1320_present) {
    j.start_array("supportedBandCombination-v1320");
    for (const auto& e1 : supported_band_combination_v1320) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1320_present) {
    j.start_array("supportedBandCombinationAdd-v1320");
    for (const auto& e1 : supported_band_combination_add_v1320) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_reduced_v1320_present) {
    j.start_array("supportedBandCombinationReduced-v1320");
    for (const auto& e1 : supported_band_combination_reduced_v1320) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// RF-Parameters-v1380 ::= SEQUENCE
SRSASN_CODE rf_params_v1380_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v1380_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1380_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_reduced_v1380_present, 1));

  if (supported_band_combination_v1380_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1380, 1, 128));
  }
  if (supported_band_combination_add_v1380_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1380, 1, 256));
  }
  if (supported_band_combination_reduced_v1380_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_reduced_v1380, 1, 384));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1380_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v1380_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1380_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_reduced_v1380_present, 1));

  if (supported_band_combination_v1380_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1380, bref, 1, 128));
  }
  if (supported_band_combination_add_v1380_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1380, bref, 1, 256));
  }
  if (supported_band_combination_reduced_v1380_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_reduced_v1380, bref, 1, 384));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1380_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v1380_present) {
    j.start_array("supportedBandCombination-v1380");
    for (const auto& e1 : supported_band_combination_v1380) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1380_present) {
    j.start_array("supportedBandCombinationAdd-v1380");
    for (const auto& e1 : supported_band_combination_add_v1380) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_reduced_v1380_present) {
    j.start_array("supportedBandCombinationReduced-v1380");
    for (const auto& e1 : supported_band_combination_reduced_v1380) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// BandCombinationParameters-v1390 ::= SEQUENCE
SRSASN_CODE band_combination_params_v1390_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ue_ca_pwr_class_n_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE band_combination_params_v1390_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_ca_pwr_class_n_r13_present, 1));

  return SRSASN_SUCCESS;
}
void band_combination_params_v1390_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_ca_pwr_class_n_r13_present) {
    j.write_str("ue-CA-PowerClass-N-r13", "class2");
  }
  j.end_obj();
}

// RF-Parameters-v1390 ::= SEQUENCE
SRSASN_CODE rf_params_v1390_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v1390_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1390_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_reduced_v1390_present, 1));

  if (supported_band_combination_v1390_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1390, 1, 128));
  }
  if (supported_band_combination_add_v1390_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1390, 1, 256));
  }
  if (supported_band_combination_reduced_v1390_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_reduced_v1390, 1, 384));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1390_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v1390_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1390_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_reduced_v1390_present, 1));

  if (supported_band_combination_v1390_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1390, bref, 1, 128));
  }
  if (supported_band_combination_add_v1390_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1390, bref, 1, 256));
  }
  if (supported_band_combination_reduced_v1390_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_reduced_v1390, bref, 1, 384));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1390_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v1390_present) {
    j.start_array("supportedBandCombination-v1390");
    for (const auto& e1 : supported_band_combination_v1390) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1390_present) {
    j.start_array("supportedBandCombinationAdd-v1390");
    for (const auto& e1 : supported_band_combination_add_v1390) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_reduced_v1390_present) {
    j.start_array("supportedBandCombinationReduced-v1390");
    for (const auto& e1 : supported_band_combination_reduced_v1390) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// RF-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE rf_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v1430_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1430_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_reduced_v1430_present, 1));
  HANDLE_CODE(bref.pack(enb_requested_params_v1430_present, 1));
  HANDLE_CODE(bref.pack(diff_fallback_comb_report_r14_present, 1));

  if (supported_band_combination_v1430_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1430, 1, 128));
  }
  if (supported_band_combination_add_v1430_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1430, 1, 256));
  }
  if (supported_band_combination_reduced_v1430_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_reduced_v1430, 1, 384));
  }
  if (enb_requested_params_v1430_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref,
                                enb_requested_params_v1430.requested_diff_fallback_comb_list_r14,
                                1,
                                384,
                                SeqOfPacker<Packer>(1, 64, Packer())));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v1430_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1430_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_reduced_v1430_present, 1));
  HANDLE_CODE(bref.unpack(enb_requested_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(diff_fallback_comb_report_r14_present, 1));

  if (supported_band_combination_v1430_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1430, bref, 1, 128));
  }
  if (supported_band_combination_add_v1430_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1430, bref, 1, 256));
  }
  if (supported_band_combination_reduced_v1430_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_reduced_v1430, bref, 1, 384));
  }
  if (enb_requested_params_v1430_present) {
    HANDLE_CODE(unpack_dyn_seq_of(enb_requested_params_v1430.requested_diff_fallback_comb_list_r14,
                                  bref,
                                  1,
                                  384,
                                  SeqOfPacker<Packer>(1, 64, Packer())));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v1430_present) {
    j.start_array("supportedBandCombination-v1430");
    for (const auto& e1 : supported_band_combination_v1430) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1430_present) {
    j.start_array("supportedBandCombinationAdd-v1430");
    for (const auto& e1 : supported_band_combination_add_v1430) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_reduced_v1430_present) {
    j.start_array("supportedBandCombinationReduced-v1430");
    for (const auto& e1 : supported_band_combination_reduced_v1430) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (enb_requested_params_v1430_present) {
    j.write_fieldname("eNB-RequestedParameters-v1430");
    j.start_obj();
    j.start_array("requestedDiffFallbackCombList-r14");
    for (const auto& e1 : enb_requested_params_v1430.requested_diff_fallback_comb_list_r14) {
      j.start_array();
      for (const auto& e2 : e1) {
        e2.to_json(j);
      }
      j.end_array();
    }
    j.end_array();
    j.end_obj();
  }
  if (diff_fallback_comb_report_r14_present) {
    j.write_str("diffFallbackCombReport-r14", "supported");
  }
  j.end_obj();
}

// RF-Parameters-v1450 ::= SEQUENCE
SRSASN_CODE rf_params_v1450_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v1450_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1450_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_reduced_v1450_present, 1));

  if (supported_band_combination_v1450_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1450, 1, 128));
  }
  if (supported_band_combination_add_v1450_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1450, 1, 256));
  }
  if (supported_band_combination_reduced_v1450_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_reduced_v1450, 1, 384));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1450_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v1450_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1450_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_reduced_v1450_present, 1));

  if (supported_band_combination_v1450_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1450, bref, 1, 128));
  }
  if (supported_band_combination_add_v1450_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1450, bref, 1, 256));
  }
  if (supported_band_combination_reduced_v1450_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_reduced_v1450, bref, 1, 384));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1450_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v1450_present) {
    j.start_array("supportedBandCombination-v1450");
    for (const auto& e1 : supported_band_combination_v1450) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1450_present) {
    j.start_array("supportedBandCombinationAdd-v1450");
    for (const auto& e1 : supported_band_combination_add_v1450) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_reduced_v1450_present) {
    j.start_array("supportedBandCombinationReduced-v1450");
    for (const auto& e1 : supported_band_combination_reduced_v1450) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// RF-Parameters-v1470 ::= SEQUENCE
SRSASN_CODE rf_params_v1470_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_combination_v1470_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1470_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_reduced_v1470_present, 1));

  if (supported_band_combination_v1470_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1470, 1, 128));
  }
  if (supported_band_combination_add_v1470_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1470, 1, 256));
  }
  if (supported_band_combination_reduced_v1470_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_reduced_v1470, 1, 384));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1470_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_combination_v1470_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1470_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_reduced_v1470_present, 1));

  if (supported_band_combination_v1470_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1470, bref, 1, 128));
  }
  if (supported_band_combination_add_v1470_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1470, bref, 1, 256));
  }
  if (supported_band_combination_reduced_v1470_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_reduced_v1470, bref, 1, 384));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1470_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_combination_v1470_present) {
    j.start_array("supportedBandCombination-v1470");
    for (const auto& e1 : supported_band_combination_v1470) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1470_present) {
    j.start_array("supportedBandCombinationAdd-v1470");
    for (const auto& e1 : supported_band_combination_add_v1470) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_reduced_v1470_present) {
    j.start_array("supportedBandCombinationReduced-v1470");
    for (const auto& e1 : supported_band_combination_reduced_v1470) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// RF-Parameters-v1530 ::= SEQUENCE
SRSASN_CODE rf_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(stti_spt_supported_r15_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_v1530_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_add_v1530_present, 1));
  HANDLE_CODE(bref.pack(supported_band_combination_reduced_v1530_present, 1));
  HANDLE_CODE(bref.pack(pwr_class_minus14dbm_r15_present, 1));

  if (supported_band_combination_v1530_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_v1530, 1, 128));
  }
  if (supported_band_combination_add_v1530_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_add_v1530, 1, 256));
  }
  if (supported_band_combination_reduced_v1530_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_combination_reduced_v1530, 1, 384));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(stti_spt_supported_r15_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_v1530_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_add_v1530_present, 1));
  HANDLE_CODE(bref.unpack(supported_band_combination_reduced_v1530_present, 1));
  HANDLE_CODE(bref.unpack(pwr_class_minus14dbm_r15_present, 1));

  if (supported_band_combination_v1530_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_v1530, bref, 1, 128));
  }
  if (supported_band_combination_add_v1530_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_add_v1530, bref, 1, 256));
  }
  if (supported_band_combination_reduced_v1530_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_combination_reduced_v1530, bref, 1, 384));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (stti_spt_supported_r15_present) {
    j.write_str("sTTI-SPT-Supported-r15", "supported");
  }
  if (supported_band_combination_v1530_present) {
    j.start_array("supportedBandCombination-v1530");
    for (const auto& e1 : supported_band_combination_v1530) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_add_v1530_present) {
    j.start_array("supportedBandCombinationAdd-v1530");
    for (const auto& e1 : supported_band_combination_add_v1530) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (supported_band_combination_reduced_v1530_present) {
    j.start_array("supportedBandCombinationReduced-v1530");
    for (const auto& e1 : supported_band_combination_reduced_v1530) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (pwr_class_minus14dbm_r15_present) {
    j.write_str("powerClass-14dBm-r15", "supported");
  }
  j.end_obj();
}

// SupportedBandEUTRA-v9e0 ::= SEQUENCE
SRSASN_CODE supported_band_eutra_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_eutra_v9e0_present, 1));

  if (band_eutra_v9e0_present) {
    HANDLE_CODE(pack_integer(bref, band_eutra_v9e0, (uint16_t)65u, (uint16_t)256u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_band_eutra_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_eutra_v9e0_present, 1));

  if (band_eutra_v9e0_present) {
    HANDLE_CODE(unpack_integer(band_eutra_v9e0, bref, (uint16_t)65u, (uint16_t)256u));
  }

  return SRSASN_SUCCESS;
}
void supported_band_eutra_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (band_eutra_v9e0_present) {
    j.write_int("bandEUTRA-v9e0", band_eutra_v9e0);
  }
  j.end_obj();
}

// RF-Parameters-v9e0 ::= SEQUENCE
SRSASN_CODE rf_params_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_list_eutra_v9e0_present, 1));

  if (supported_band_list_eutra_v9e0_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, supported_band_list_eutra_v9e0, 1, 64));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE rf_params_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_list_eutra_v9e0_present, 1));

  if (supported_band_list_eutra_v9e0_present) {
    HANDLE_CODE(unpack_dyn_seq_of(supported_band_list_eutra_v9e0, bref, 1, 64));
  }

  return SRSASN_SUCCESS;
}
void rf_params_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_list_eutra_v9e0_present) {
    j.start_array("supportedBandListEUTRA-v9e0");
    for (const auto& e1 : supported_band_list_eutra_v9e0) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SupportedBandInfo-r12 ::= SEQUENCE
SRSASN_CODE supported_band_info_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(support_r12_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE supported_band_info_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(support_r12_present, 1));

  return SRSASN_SUCCESS;
}
void supported_band_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (support_r12_present) {
    j.write_str("support-r12", "supported");
  }
  j.end_obj();
}

// SL-Parameters-r12 ::= SEQUENCE
SRSASN_CODE sl_params_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(comm_simul_tx_r12_present, 1));
  HANDLE_CODE(bref.pack(comm_supported_bands_r12_present, 1));
  HANDLE_CODE(bref.pack(disc_supported_bands_r12_present, 1));
  HANDLE_CODE(bref.pack(disc_sched_res_alloc_r12_present, 1));
  HANDLE_CODE(bref.pack(disc_ue_sel_res_alloc_r12_present, 1));
  HANDLE_CODE(bref.pack(disc_slss_r12_present, 1));
  HANDLE_CODE(bref.pack(disc_supported_proc_r12_present, 1));

  if (comm_supported_bands_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, comm_supported_bands_r12, 1, 64, integer_packer<uint16_t>(1, 256)));
  }
  if (disc_supported_bands_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, disc_supported_bands_r12, 1, 64));
  }
  if (disc_supported_proc_r12_present) {
    HANDLE_CODE(disc_supported_proc_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_params_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(comm_simul_tx_r12_present, 1));
  HANDLE_CODE(bref.unpack(comm_supported_bands_r12_present, 1));
  HANDLE_CODE(bref.unpack(disc_supported_bands_r12_present, 1));
  HANDLE_CODE(bref.unpack(disc_sched_res_alloc_r12_present, 1));
  HANDLE_CODE(bref.unpack(disc_ue_sel_res_alloc_r12_present, 1));
  HANDLE_CODE(bref.unpack(disc_slss_r12_present, 1));
  HANDLE_CODE(bref.unpack(disc_supported_proc_r12_present, 1));

  if (comm_supported_bands_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(comm_supported_bands_r12, bref, 1, 64, integer_packer<uint16_t>(1, 256)));
  }
  if (disc_supported_bands_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(disc_supported_bands_r12, bref, 1, 64));
  }
  if (disc_supported_proc_r12_present) {
    HANDLE_CODE(disc_supported_proc_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_params_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (comm_simul_tx_r12_present) {
    j.write_str("commSimultaneousTx-r12", "supported");
  }
  if (comm_supported_bands_r12_present) {
    j.start_array("commSupportedBands-r12");
    for (const auto& e1 : comm_supported_bands_r12) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (disc_supported_bands_r12_present) {
    j.start_array("discSupportedBands-r12");
    for (const auto& e1 : disc_supported_bands_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (disc_sched_res_alloc_r12_present) {
    j.write_str("discScheduledResourceAlloc-r12", "supported");
  }
  if (disc_ue_sel_res_alloc_r12_present) {
    j.write_str("disc-UE-SelectedResourceAlloc-r12", "supported");
  }
  if (disc_slss_r12_present) {
    j.write_str("disc-SLSS-r12", "supported");
  }
  if (disc_supported_proc_r12_present) {
    j.write_str("discSupportedProc-r12", disc_supported_proc_r12.to_string());
  }
  j.end_obj();
}

// V2X-BandParameters-r14 ::= SEQUENCE
SRSASN_CODE v2x_band_params_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(band_params_tx_sl_r14_present, 1));
  HANDLE_CODE(bref.pack(band_params_rx_sl_r14_present, 1));

  HANDLE_CODE(pack_integer(bref, v2x_freq_band_eutra_r14, (uint16_t)1u, (uint16_t)256u));
  if (band_params_tx_sl_r14_present) {
    HANDLE_CODE(band_params_tx_sl_r14.pack(bref));
  }
  if (band_params_rx_sl_r14_present) {
    HANDLE_CODE(band_params_rx_sl_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE v2x_band_params_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(band_params_tx_sl_r14_present, 1));
  HANDLE_CODE(bref.unpack(band_params_rx_sl_r14_present, 1));

  HANDLE_CODE(unpack_integer(v2x_freq_band_eutra_r14, bref, (uint16_t)1u, (uint16_t)256u));
  if (band_params_tx_sl_r14_present) {
    HANDLE_CODE(band_params_tx_sl_r14.unpack(bref));
  }
  if (band_params_rx_sl_r14_present) {
    HANDLE_CODE(band_params_rx_sl_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void v2x_band_params_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("v2x-FreqBandEUTRA-r14", v2x_freq_band_eutra_r14);
  if (band_params_tx_sl_r14_present) {
    j.write_fieldname("bandParametersTxSL-r14");
    band_params_tx_sl_r14.to_json(j);
  }
  if (band_params_rx_sl_r14_present) {
    j.write_fieldname("bandParametersRxSL-r14");
    band_params_rx_sl_r14.to_json(j);
  }
  j.end_obj();
}

// SL-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE sl_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(zone_based_pool_sel_r14_present, 1));
  HANDLE_CODE(bref.pack(ue_autonomous_with_full_sensing_r14_present, 1));
  HANDLE_CODE(bref.pack(ue_autonomous_with_partial_sensing_r14_present, 1));
  HANDLE_CODE(bref.pack(sl_congestion_ctrl_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_tx_with_short_resv_interv_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_num_tx_rx_timing_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_non_adjacent_pscch_pssch_r14_present, 1));
  HANDLE_CODE(bref.pack(slss_tx_rx_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_supported_band_combination_list_r14_present, 1));

  if (v2x_num_tx_rx_timing_r14_present) {
    HANDLE_CODE(pack_integer(bref, v2x_num_tx_rx_timing_r14, (uint8_t)1u, (uint8_t)16u));
  }
  if (v2x_supported_band_combination_list_r14_present) {
    HANDLE_CODE(
        pack_dyn_seq_of(bref, v2x_supported_band_combination_list_r14, 1, 384, SeqOfPacker<Packer>(1, 64, Packer())));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(zone_based_pool_sel_r14_present, 1));
  HANDLE_CODE(bref.unpack(ue_autonomous_with_full_sensing_r14_present, 1));
  HANDLE_CODE(bref.unpack(ue_autonomous_with_partial_sensing_r14_present, 1));
  HANDLE_CODE(bref.unpack(sl_congestion_ctrl_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_tx_with_short_resv_interv_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_num_tx_rx_timing_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_non_adjacent_pscch_pssch_r14_present, 1));
  HANDLE_CODE(bref.unpack(slss_tx_rx_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_supported_band_combination_list_r14_present, 1));

  if (v2x_num_tx_rx_timing_r14_present) {
    HANDLE_CODE(unpack_integer(v2x_num_tx_rx_timing_r14, bref, (uint8_t)1u, (uint8_t)16u));
  }
  if (v2x_supported_band_combination_list_r14_present) {
    HANDLE_CODE(
        unpack_dyn_seq_of(v2x_supported_band_combination_list_r14, bref, 1, 384, SeqOfPacker<Packer>(1, 64, Packer())));
  }

  return SRSASN_SUCCESS;
}
void sl_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (zone_based_pool_sel_r14_present) {
    j.write_str("zoneBasedPoolSelection-r14", "supported");
  }
  if (ue_autonomous_with_full_sensing_r14_present) {
    j.write_str("ue-AutonomousWithFullSensing-r14", "supported");
  }
  if (ue_autonomous_with_partial_sensing_r14_present) {
    j.write_str("ue-AutonomousWithPartialSensing-r14", "supported");
  }
  if (sl_congestion_ctrl_r14_present) {
    j.write_str("sl-CongestionControl-r14", "supported");
  }
  if (v2x_tx_with_short_resv_interv_r14_present) {
    j.write_str("v2x-TxWithShortResvInterval-r14", "supported");
  }
  if (v2x_num_tx_rx_timing_r14_present) {
    j.write_int("v2x-numberTxRxTiming-r14", v2x_num_tx_rx_timing_r14);
  }
  if (v2x_non_adjacent_pscch_pssch_r14_present) {
    j.write_str("v2x-nonAdjacentPSCCH-PSSCH-r14", "supported");
  }
  if (slss_tx_rx_r14_present) {
    j.write_str("slss-TxRx-r14", "supported");
  }
  if (v2x_supported_band_combination_list_r14_present) {
    j.start_array("v2x-SupportedBandCombinationList-r14");
    for (const auto& e1 : v2x_supported_band_combination_list_r14) {
      j.start_array();
      for (const auto& e2 : e1) {
        e2.to_json(j);
      }
      j.end_array();
    }
    j.end_array();
  }
  j.end_obj();
}

// V2X-BandParameters-v1530 ::= SEQUENCE
SRSASN_CODE v2x_band_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(v2x_enhanced_high_reception_r15_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE v2x_band_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(v2x_enhanced_high_reception_r15_present, 1));

  return SRSASN_SUCCESS;
}
void v2x_band_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (v2x_enhanced_high_reception_r15_present) {
    j.write_str("v2x-EnhancedHighReception-r15", "supported");
  }
  j.end_obj();
}

// UE-CategorySL-r15 ::= SEQUENCE
SRSASN_CODE ue_category_sl_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, ue_category_sl_c_tx_r15, (uint8_t)1u, (uint8_t)5u));
  HANDLE_CODE(pack_integer(bref, ue_category_sl_c_rx_r15, (uint8_t)1u, (uint8_t)4u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_category_sl_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(ue_category_sl_c_tx_r15, bref, (uint8_t)1u, (uint8_t)5u));
  HANDLE_CODE(unpack_integer(ue_category_sl_c_rx_r15, bref, (uint8_t)1u, (uint8_t)4u));

  return SRSASN_SUCCESS;
}
void ue_category_sl_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("ue-CategorySL-C-TX-r15", ue_category_sl_c_tx_r15);
  j.write_int("ue-CategorySL-C-RX-r15", ue_category_sl_c_rx_r15);
  j.end_obj();
}

// SL-Parameters-v1530 ::= SEQUENCE
SRSASN_CODE sl_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(slss_supported_tx_freq_r15_present, 1));
  HANDLE_CODE(bref.pack(sl_minus64_qam_tx_r15_present, 1));
  HANDLE_CODE(bref.pack(sl_tx_diversity_r15_present, 1));
  HANDLE_CODE(bref.pack(ue_category_sl_r15_present, 1));
  HANDLE_CODE(bref.pack(v2x_supported_band_combination_list_v1530_present, 1));

  if (slss_supported_tx_freq_r15_present) {
    HANDLE_CODE(slss_supported_tx_freq_r15.pack(bref));
  }
  if (ue_category_sl_r15_present) {
    HANDLE_CODE(ue_category_sl_r15.pack(bref));
  }
  if (v2x_supported_band_combination_list_v1530_present) {
    HANDLE_CODE(
        pack_dyn_seq_of(bref, v2x_supported_band_combination_list_v1530, 1, 384, SeqOfPacker<Packer>(1, 64, Packer())));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(slss_supported_tx_freq_r15_present, 1));
  HANDLE_CODE(bref.unpack(sl_minus64_qam_tx_r15_present, 1));
  HANDLE_CODE(bref.unpack(sl_tx_diversity_r15_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_sl_r15_present, 1));
  HANDLE_CODE(bref.unpack(v2x_supported_band_combination_list_v1530_present, 1));

  if (slss_supported_tx_freq_r15_present) {
    HANDLE_CODE(slss_supported_tx_freq_r15.unpack(bref));
  }
  if (ue_category_sl_r15_present) {
    HANDLE_CODE(ue_category_sl_r15.unpack(bref));
  }
  if (v2x_supported_band_combination_list_v1530_present) {
    HANDLE_CODE(unpack_dyn_seq_of(
        v2x_supported_band_combination_list_v1530, bref, 1, 384, SeqOfPacker<Packer>(1, 64, Packer())));
  }

  return SRSASN_SUCCESS;
}
void sl_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (slss_supported_tx_freq_r15_present) {
    j.write_str("slss-SupportedTxFreq-r15", slss_supported_tx_freq_r15.to_string());
  }
  if (sl_minus64_qam_tx_r15_present) {
    j.write_str("sl-64QAM-Tx-r15", "supported");
  }
  if (sl_tx_diversity_r15_present) {
    j.write_str("sl-TxDiversity-r15", "supported");
  }
  if (ue_category_sl_r15_present) {
    j.write_fieldname("ue-CategorySL-r15");
    ue_category_sl_r15.to_json(j);
  }
  if (v2x_supported_band_combination_list_v1530_present) {
    j.start_array("v2x-SupportedBandCombinationList-v1530");
    for (const auto& e1 : v2x_supported_band_combination_list_v1530) {
      j.start_array();
      for (const auto& e2 : e1) {
        e2.to_json(j);
      }
      j.end_array();
    }
    j.end_array();
  }
  j.end_obj();
}

// SPS-ConfigDL-STTI-r15 ::= CHOICE
void sps_cfg_dl_stti_r15_c::set(types::options e)
{
  type_ = e;
}
void sps_cfg_dl_stti_r15_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("semiPersistSchedIntervalDL-STTI-r15", c.semi_persist_sched_interv_dl_stti_r15.to_string());
      j.write_int("numberOfConfSPS-Processes-STTI-r15", c.nof_conf_sps_processes_stti_r15);
      if (c.two_ant_port_activ_r15_present) {
        j.write_fieldname("twoAntennaPortActivated-r15");
        c.two_ant_port_activ_r15.to_json(j);
      }
      j.write_int("sTTI-StartTimeDL-r15", c.stti_start_time_dl_r15);
      if (c.tpc_pdcch_cfg_pucch_sps_r15_present) {
        j.write_fieldname("tpc-PDCCH-ConfigPUCCH-SPS-r15");
        c.tpc_pdcch_cfg_pucch_sps_r15.to_json(j);
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_stti_r15_c");
  }
  j.end_obj();
}
SRSASN_CODE sps_cfg_dl_stti_r15_c::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.pack(c.ext, 1);
      HANDLE_CODE(bref.pack(c.two_ant_port_activ_r15_present, 1));
      HANDLE_CODE(bref.pack(c.tpc_pdcch_cfg_pucch_sps_r15_present, 1));
      HANDLE_CODE(c.semi_persist_sched_interv_dl_stti_r15.pack(bref));
      HANDLE_CODE(pack_integer(bref, c.nof_conf_sps_processes_stti_r15, (uint8_t)1u, (uint8_t)12u));
      if (c.two_ant_port_activ_r15_present) {
        HANDLE_CODE(c.two_ant_port_activ_r15.pack(bref));
      }
      HANDLE_CODE(pack_integer(bref, c.stti_start_time_dl_r15, (uint8_t)0u, (uint8_t)5u));
      if (c.tpc_pdcch_cfg_pucch_sps_r15_present) {
        HANDLE_CODE(c.tpc_pdcch_cfg_pucch_sps_r15.pack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_stti_r15_c");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_dl_stti_r15_c::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      bref.unpack(c.ext, 1);
      HANDLE_CODE(bref.unpack(c.two_ant_port_activ_r15_present, 1));
      HANDLE_CODE(bref.unpack(c.tpc_pdcch_cfg_pucch_sps_r15_present, 1));
      HANDLE_CODE(c.semi_persist_sched_interv_dl_stti_r15.unpack(bref));
      HANDLE_CODE(unpack_integer(c.nof_conf_sps_processes_stti_r15, bref, (uint8_t)1u, (uint8_t)12u));
      if (c.two_ant_port_activ_r15_present) {
        HANDLE_CODE(c.two_ant_port_activ_r15.unpack(bref));
      }
      HANDLE_CODE(unpack_integer(c.stti_start_time_dl_r15, bref, (uint8_t)0u, (uint8_t)5u));
      if (c.tpc_pdcch_cfg_pucch_sps_r15_present) {
        HANDLE_CODE(c.tpc_pdcch_cfg_pucch_sps_r15.unpack(bref));
      }
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_stti_r15_c");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void sps_cfg_dl_stti_r15_c::setup_s_::two_ant_port_activ_r15_c_::set(types::options e)
{
  type_ = e;
}
void sps_cfg_dl_stti_r15_c::setup_s_::two_ant_port_activ_r15_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("n1SPUCCH-AN-PersistentListP1-r15");
      for (const auto& e1 : c.n1_spucch_an_persistent_list_p1_r15) {
        j.write_int(e1);
      }
      j.end_array();
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_stti_r15_c::setup_s_::two_ant_port_activ_r15_c_");
  }
  j.end_obj();
}
SRSASN_CODE sps_cfg_dl_stti_r15_c::setup_s_::two_ant_port_activ_r15_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_spucch_an_persistent_list_p1_r15, 1, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_stti_r15_c::setup_s_::two_ant_port_activ_r15_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sps_cfg_dl_stti_r15_c::setup_s_::two_ant_port_activ_r15_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_spucch_an_persistent_list_p1_r15, bref, 1, 4, integer_packer<uint16_t>(0, 2047)));
      break;
    default:
      log_invalid_choice_id(type_, "sps_cfg_dl_stti_r15_c::setup_s_::two_ant_port_activ_r15_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// NeighCellSI-AcquisitionParameters-v1530 ::= SEQUENCE
SRSASN_CODE neigh_cell_si_acquisition_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(report_cgi_nr_en_dc_r15_present, 1));
  HANDLE_CODE(bref.pack(report_cgi_nr_no_en_dc_r15_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE neigh_cell_si_acquisition_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(report_cgi_nr_en_dc_r15_present, 1));
  HANDLE_CODE(bref.unpack(report_cgi_nr_no_en_dc_r15_present, 1));

  return SRSASN_SUCCESS;
}
void neigh_cell_si_acquisition_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (report_cgi_nr_en_dc_r15_present) {
    j.write_str("reportCGI-NR-EN-DC-r15", "supported");
  }
  if (report_cgi_nr_no_en_dc_r15_present) {
    j.write_str("reportCGI-NR-NoEN-DC-r15", "supported");
  }
  j.end_obj();
}

// LAA-Parameters-v1530 ::= SEQUENCE
SRSASN_CODE laa_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(aul_r15_present, 1));
  HANDLE_CODE(bref.pack(laa_pusch_mode1_r15_present, 1));
  HANDLE_CODE(bref.pack(laa_pusch_mode2_r15_present, 1));
  HANDLE_CODE(bref.pack(laa_pusch_mode3_r15_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE laa_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(aul_r15_present, 1));
  HANDLE_CODE(bref.unpack(laa_pusch_mode1_r15_present, 1));
  HANDLE_CODE(bref.unpack(laa_pusch_mode2_r15_present, 1));
  HANDLE_CODE(bref.unpack(laa_pusch_mode3_r15_present, 1));

  return SRSASN_SUCCESS;
}
void laa_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (aul_r15_present) {
    j.write_str("aul-r15", "supported");
  }
  if (laa_pusch_mode1_r15_present) {
    j.write_str("laa-PUSCH-Mode1-r15", "supported");
  }
  if (laa_pusch_mode2_r15_present) {
    j.write_str("laa-PUSCH-Mode2-r15", "supported");
  }
  if (laa_pusch_mode3_r15_present) {
    j.write_str("laa-PUSCH-Mode3-r15", "supported");
  }
  j.end_obj();
}

// MeasParameters-v1530 ::= SEQUENCE
SRSASN_CODE meas_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(qoe_meas_report_r15_present, 1));
  HANDLE_CODE(bref.pack(qoe_mtsi_meas_report_r15_present, 1));
  HANDLE_CODE(bref.pack(ca_idle_mode_meass_r15_present, 1));
  HANDLE_CODE(bref.pack(ca_idle_mode_validity_area_r15_present, 1));
  HANDLE_CODE(bref.pack(height_meas_r15_present, 1));
  HANDLE_CODE(bref.pack(multiple_cells_meas_ext_r15_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(qoe_meas_report_r15_present, 1));
  HANDLE_CODE(bref.unpack(qoe_mtsi_meas_report_r15_present, 1));
  HANDLE_CODE(bref.unpack(ca_idle_mode_meass_r15_present, 1));
  HANDLE_CODE(bref.unpack(ca_idle_mode_validity_area_r15_present, 1));
  HANDLE_CODE(bref.unpack(height_meas_r15_present, 1));
  HANDLE_CODE(bref.unpack(multiple_cells_meas_ext_r15_present, 1));

  return SRSASN_SUCCESS;
}
void meas_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (qoe_meas_report_r15_present) {
    j.write_str("qoe-MeasReport-r15", "supported");
  }
  if (qoe_mtsi_meas_report_r15_present) {
    j.write_str("qoe-MTSI-MeasReport-r15", "supported");
  }
  if (ca_idle_mode_meass_r15_present) {
    j.write_str("ca-IdleModeMeasurements-r15", "supported");
  }
  if (ca_idle_mode_validity_area_r15_present) {
    j.write_str("ca-IdleModeValidityArea-r15", "supported");
  }
  if (height_meas_r15_present) {
    j.write_str("heightMeas-r15", "supported");
  }
  if (multiple_cells_meas_ext_r15_present) {
    j.write_str("multipleCellsMeasExtension-r15", "supported");
  }
  j.end_obj();
}

// Other-Parameters-v1530 ::= SEQUENCE
SRSASN_CODE other_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(assist_info_bit_for_lc_r15_present, 1));
  HANDLE_CODE(bref.pack(time_ref_provision_r15_present, 1));
  HANDLE_CODE(bref.pack(flight_path_plan_r15_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE other_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(assist_info_bit_for_lc_r15_present, 1));
  HANDLE_CODE(bref.unpack(time_ref_provision_r15_present, 1));
  HANDLE_CODE(bref.unpack(flight_path_plan_r15_present, 1));

  return SRSASN_SUCCESS;
}
void other_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (assist_info_bit_for_lc_r15_present) {
    j.write_str("assistInfoBitForLC-r15", "supported");
  }
  if (time_ref_provision_r15_present) {
    j.write_str("timeReferenceProvision-r15", "supported");
  }
  if (flight_path_plan_r15_present) {
    j.write_str("flightPathPlan-r15", "supported");
  }
  j.end_obj();
}

// RLC-Parameters-v1530 ::= SEQUENCE
SRSASN_CODE rlc_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(flex_um_am_combinations_r15_present, 1));
  HANDLE_CODE(bref.pack(rlc_am_ooo_delivery_r15_present, 1));
  HANDLE_CODE(bref.pack(rlc_um_ooo_delivery_r15_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(flex_um_am_combinations_r15_present, 1));
  HANDLE_CODE(bref.unpack(rlc_am_ooo_delivery_r15_present, 1));
  HANDLE_CODE(bref.unpack(rlc_um_ooo_delivery_r15_present, 1));

  return SRSASN_SUCCESS;
}
void rlc_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (flex_um_am_combinations_r15_present) {
    j.write_str("flexibleUM-AM-Combinations-r15", "supported");
  }
  if (rlc_am_ooo_delivery_r15_present) {
    j.write_str("rlc-AM-Ooo-Delivery-r15", "supported");
  }
  if (rlc_um_ooo_delivery_r15_present) {
    j.write_str("rlc-UM-Ooo-Delivery-r15", "supported");
  }
  j.end_obj();
}

// UE-BasedNetwPerfMeasParameters-v1530 ::= SEQUENCE
SRSASN_CODE ue_based_netw_perf_meas_params_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(logged_meas_bt_r15_present, 1));
  HANDLE_CODE(bref.pack(logged_meas_wlan_r15_present, 1));
  HANDLE_CODE(bref.pack(imm_meas_bt_r15_present, 1));
  HANDLE_CODE(bref.pack(imm_meas_wlan_r15_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_based_netw_perf_meas_params_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(logged_meas_bt_r15_present, 1));
  HANDLE_CODE(bref.unpack(logged_meas_wlan_r15_present, 1));
  HANDLE_CODE(bref.unpack(imm_meas_bt_r15_present, 1));
  HANDLE_CODE(bref.unpack(imm_meas_wlan_r15_present, 1));

  return SRSASN_SUCCESS;
}
void ue_based_netw_perf_meas_params_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (logged_meas_bt_r15_present) {
    j.write_str("loggedMeasBT-r15", "supported");
  }
  if (logged_meas_wlan_r15_present) {
    j.write_str("loggedMeasWLAN-r15", "supported");
  }
  if (imm_meas_bt_r15_present) {
    j.write_str("immMeasBT-r15", "supported");
  }
  if (imm_meas_wlan_r15_present) {
    j.write_str("immMeasWLAN-r15", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-CapabilityAddXDD-Mode-v1530 ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(neigh_cell_si_acquisition_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(reduced_cp_latency_r15_present, 1));

  if (neigh_cell_si_acquisition_params_v1530_present) {
    HANDLE_CODE(neigh_cell_si_acquisition_params_v1530.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(neigh_cell_si_acquisition_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(reduced_cp_latency_r15_present, 1));

  if (neigh_cell_si_acquisition_params_v1530_present) {
    HANDLE_CODE(neigh_cell_si_acquisition_params_v1530.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_add_xdd_mode_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (neigh_cell_si_acquisition_params_v1530_present) {
    j.write_fieldname("neighCellSI-AcquisitionParameters-v1530");
    neigh_cell_si_acquisition_params_v1530.to_json(j);
  }
  if (reduced_cp_latency_r15_present) {
    j.write_str("reducedCP-Latency-r15", "supported");
  }
  j.end_obj();
}

// MeasParameters-v1520 ::= SEQUENCE
SRSASN_CODE meas_params_v1520_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_gap_patterns_v1520_present, 1));

  if (meas_gap_patterns_v1520_present) {
    HANDLE_CODE(meas_gap_patterns_v1520.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_v1520_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_gap_patterns_v1520_present, 1));

  if (meas_gap_patterns_v1520_present) {
    HANDLE_CODE(meas_gap_patterns_v1520.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void meas_params_v1520_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_gap_patterns_v1520_present) {
    j.write_str("measGapPatterns-v1520", meas_gap_patterns_v1520.to_string());
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1530-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(other_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(neigh_cell_si_acquisition_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(mac_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(phy_layer_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(rf_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(pdcp_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(ue_category_dl_v1530_present, 1));
  HANDLE_CODE(bref.pack(ue_based_netw_perf_meas_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(rlc_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(sl_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(extended_nof_drbs_r15_present, 1));
  HANDLE_CODE(bref.pack(reduced_cp_latency_r15_present, 1));
  HANDLE_CODE(bref.pack(laa_params_v1530_present, 1));
  HANDLE_CODE(bref.pack(ue_category_ul_v1530_present, 1));
  HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1530_present, 1));
  HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1530_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (meas_params_v1530_present) {
    HANDLE_CODE(meas_params_v1530.pack(bref));
  }
  if (other_params_v1530_present) {
    HANDLE_CODE(other_params_v1530.pack(bref));
  }
  if (neigh_cell_si_acquisition_params_v1530_present) {
    HANDLE_CODE(neigh_cell_si_acquisition_params_v1530.pack(bref));
  }
  if (mac_params_v1530_present) {
    HANDLE_CODE(mac_params_v1530.pack(bref));
  }
  if (phy_layer_params_v1530_present) {
    HANDLE_CODE(phy_layer_params_v1530.pack(bref));
  }
  if (rf_params_v1530_present) {
    HANDLE_CODE(rf_params_v1530.pack(bref));
  }
  if (pdcp_params_v1530_present) {
    HANDLE_CODE(pdcp_params_v1530.pack(bref));
  }
  if (ue_category_dl_v1530_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_dl_v1530, (uint8_t)22u, (uint8_t)26u));
  }
  if (ue_based_netw_perf_meas_params_v1530_present) {
    HANDLE_CODE(ue_based_netw_perf_meas_params_v1530.pack(bref));
  }
  if (rlc_params_v1530_present) {
    HANDLE_CODE(rlc_params_v1530.pack(bref));
  }
  if (sl_params_v1530_present) {
    HANDLE_CODE(sl_params_v1530.pack(bref));
  }
  if (laa_params_v1530_present) {
    HANDLE_CODE(laa_params_v1530.pack(bref));
  }
  if (ue_category_ul_v1530_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_ul_v1530, (uint8_t)22u, (uint8_t)26u));
  }
  if (fdd_add_ue_eutra_cap_v1530_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1530.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1530_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1530.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(other_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(neigh_cell_si_acquisition_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(mac_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(phy_layer_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(rf_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(pdcp_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_dl_v1530_present, 1));
  HANDLE_CODE(bref.unpack(ue_based_netw_perf_meas_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(rlc_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(sl_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(extended_nof_drbs_r15_present, 1));
  HANDLE_CODE(bref.unpack(reduced_cp_latency_r15_present, 1));
  HANDLE_CODE(bref.unpack(laa_params_v1530_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_ul_v1530_present, 1));
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1530_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1530_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (meas_params_v1530_present) {
    HANDLE_CODE(meas_params_v1530.unpack(bref));
  }
  if (other_params_v1530_present) {
    HANDLE_CODE(other_params_v1530.unpack(bref));
  }
  if (neigh_cell_si_acquisition_params_v1530_present) {
    HANDLE_CODE(neigh_cell_si_acquisition_params_v1530.unpack(bref));
  }
  if (mac_params_v1530_present) {
    HANDLE_CODE(mac_params_v1530.unpack(bref));
  }
  if (phy_layer_params_v1530_present) {
    HANDLE_CODE(phy_layer_params_v1530.unpack(bref));
  }
  if (rf_params_v1530_present) {
    HANDLE_CODE(rf_params_v1530.unpack(bref));
  }
  if (pdcp_params_v1530_present) {
    HANDLE_CODE(pdcp_params_v1530.unpack(bref));
  }
  if (ue_category_dl_v1530_present) {
    HANDLE_CODE(unpack_integer(ue_category_dl_v1530, bref, (uint8_t)22u, (uint8_t)26u));
  }
  if (ue_based_netw_perf_meas_params_v1530_present) {
    HANDLE_CODE(ue_based_netw_perf_meas_params_v1530.unpack(bref));
  }
  if (rlc_params_v1530_present) {
    HANDLE_CODE(rlc_params_v1530.unpack(bref));
  }
  if (sl_params_v1530_present) {
    HANDLE_CODE(sl_params_v1530.unpack(bref));
  }
  if (laa_params_v1530_present) {
    HANDLE_CODE(laa_params_v1530.unpack(bref));
  }
  if (ue_category_ul_v1530_present) {
    HANDLE_CODE(unpack_integer(ue_category_ul_v1530, bref, (uint8_t)22u, (uint8_t)26u));
  }
  if (fdd_add_ue_eutra_cap_v1530_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1530.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1530_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1530.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_params_v1530_present) {
    j.write_fieldname("measParameters-v1530");
    meas_params_v1530.to_json(j);
  }
  if (other_params_v1530_present) {
    j.write_fieldname("otherParameters-v1530");
    other_params_v1530.to_json(j);
  }
  if (neigh_cell_si_acquisition_params_v1530_present) {
    j.write_fieldname("neighCellSI-AcquisitionParameters-v1530");
    neigh_cell_si_acquisition_params_v1530.to_json(j);
  }
  if (mac_params_v1530_present) {
    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 (rf_params_v1530_present) {
    j.write_fieldname("rf-Parameters-v1530");
    rf_params_v1530.to_json(j);
  }
  if (pdcp_params_v1530_present) {
    j.write_fieldname("pdcp-Parameters-v1530");
    pdcp_params_v1530.to_json(j);
  }
  if (ue_category_dl_v1530_present) {
    j.write_int("ue-CategoryDL-v1530", ue_category_dl_v1530);
  }
  if (ue_based_netw_perf_meas_params_v1530_present) {
    j.write_fieldname("ue-BasedNetwPerfMeasParameters-v1530");
    ue_based_netw_perf_meas_params_v1530.to_json(j);
  }
  if (rlc_params_v1530_present) {
    j.write_fieldname("rlc-Parameters-v1530");
    rlc_params_v1530.to_json(j);
  }
  if (sl_params_v1530_present) {
    j.write_fieldname("sl-Parameters-v1530");
    sl_params_v1530.to_json(j);
  }
  if (extended_nof_drbs_r15_present) {
    j.write_str("extendedNumberOfDRBs-r15", "supported");
  }
  if (reduced_cp_latency_r15_present) {
    j.write_str("reducedCP-Latency-r15", "supported");
  }
  if (laa_params_v1530_present) {
    j.write_fieldname("laa-Parameters-v1530");
    laa_params_v1530.to_json(j);
  }
  if (ue_category_ul_v1530_present) {
    j.write_int("ue-CategoryUL-v1530", ue_category_ul_v1530);
  }
  if (fdd_add_ue_eutra_cap_v1530_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1530");
    fdd_add_ue_eutra_cap_v1530.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1530_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1530");
    tdd_add_ue_eutra_cap_v1530.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1520-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1520_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(meas_params_v1520.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1520_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(meas_params_v1520.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1520_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("measParameters-v1520");
  meas_params_v1520.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-v1510 ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1510_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pdcp_params_nr_r15_present, 1));

  if (pdcp_params_nr_r15_present) {
    HANDLE_CODE(pdcp_params_nr_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1510_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pdcp_params_nr_r15_present, 1));

  if (pdcp_params_nr_r15_present) {
    HANDLE_CODE(pdcp_params_nr_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_add_xdd_mode_v1510_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pdcp_params_nr_r15_present) {
    j.write_fieldname("pdcp-ParametersNR-r15");
    pdcp_params_nr_r15.to_json(j);
  }
  j.end_obj();
}

// Other-Parameters-v1460 ::= SEQUENCE
SRSASN_CODE other_params_v1460_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_csg_si_report_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE other_params_v1460_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_csg_si_report_r14_present, 1));

  return SRSASN_SUCCESS;
}
void other_params_v1460_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (non_csg_si_report_r14_present) {
    j.write_str("nonCSG-SI-Reporting-r14", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1510-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1510_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(irat_params_nr_r15_present, 1));
  HANDLE_CODE(bref.pack(feature_sets_eutra_r15_present, 1));
  HANDLE_CODE(bref.pack(pdcp_params_nr_r15_present, 1));
  HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1510_present, 1));
  HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1510_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (irat_params_nr_r15_present) {
    HANDLE_CODE(irat_params_nr_r15.pack(bref));
  }
  if (feature_sets_eutra_r15_present) {
    HANDLE_CODE(feature_sets_eutra_r15.pack(bref));
  }
  if (pdcp_params_nr_r15_present) {
    HANDLE_CODE(pdcp_params_nr_r15.pack(bref));
  }
  if (fdd_add_ue_eutra_cap_v1510_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1510.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1510_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1510.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1510_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(irat_params_nr_r15_present, 1));
  HANDLE_CODE(bref.unpack(feature_sets_eutra_r15_present, 1));
  HANDLE_CODE(bref.unpack(pdcp_params_nr_r15_present, 1));
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1510_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1510_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (irat_params_nr_r15_present) {
    HANDLE_CODE(irat_params_nr_r15.unpack(bref));
  }
  if (feature_sets_eutra_r15_present) {
    HANDLE_CODE(feature_sets_eutra_r15.unpack(bref));
  }
  if (pdcp_params_nr_r15_present) {
    HANDLE_CODE(pdcp_params_nr_r15.unpack(bref));
  }
  if (fdd_add_ue_eutra_cap_v1510_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1510.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1510_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1510.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1510_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (irat_params_nr_r15_present) {
    j.write_fieldname("irat-ParametersNR-r15");
    irat_params_nr_r15.to_json(j);
  }
  if (feature_sets_eutra_r15_present) {
    j.write_fieldname("featureSetsEUTRA-r15");
    feature_sets_eutra_r15.to_json(j);
  }
  if (pdcp_params_nr_r15_present) {
    j.write_fieldname("pdcp-ParametersNR-r15");
    pdcp_params_nr_r15.to_json(j);
  }
  if (fdd_add_ue_eutra_cap_v1510_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1510");
    fdd_add_ue_eutra_cap_v1510.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1510_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1510");
    tdd_add_ue_eutra_cap_v1510.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// OtherParameters-v1450 ::= SEQUENCE
SRSASN_CODE other_params_v1450_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(overheat_ind_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE other_params_v1450_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(overheat_ind_r14_present, 1));

  return SRSASN_SUCCESS;
}
void other_params_v1450_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (overheat_ind_r14_present) {
    j.write_str("overheatingInd-r14", "supported");
  }
  j.end_obj();
}

// PhyLayerParameters-v1450 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1450_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_srs_enhancement_without_comb4_r14_present, 1));
  HANDLE_CODE(bref.pack(crs_less_dw_pts_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1450_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_srs_enhancement_without_comb4_r14_present, 1));
  HANDLE_CODE(bref.unpack(crs_less_dw_pts_r14_present, 1));

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1450_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_srs_enhancement_without_comb4_r14_present) {
    j.write_str("ce-SRS-EnhancementWithoutComb4-r14", "supported");
  }
  if (crs_less_dw_pts_r14_present) {
    j.write_str("crs-LessDwPTS-r14", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1460-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1460_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ue_category_dl_v1460_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ue_category_dl_v1460_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_dl_v1460, (uint8_t)21u, (uint8_t)21u));
  }
  HANDLE_CODE(other_params_v1460.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1460_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_category_dl_v1460_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_category_dl_v1460_present) {
    HANDLE_CODE(unpack_integer(ue_category_dl_v1460, bref, (uint8_t)21u, (uint8_t)21u));
  }
  HANDLE_CODE(other_params_v1460.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1460_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_category_dl_v1460_present) {
    j.write_int("ue-CategoryDL-v1460", ue_category_dl_v1460);
  }
  j.write_fieldname("otherParameters-v1460");
  other_params_v1460.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// LWA-Parameters-v1440 ::= SEQUENCE
SRSASN_CODE lwa_params_v1440_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(lwa_rlc_um_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE lwa_params_v1440_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(lwa_rlc_um_r14_present, 1));

  return SRSASN_SUCCESS;
}
void lwa_params_v1440_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (lwa_rlc_um_r14_present) {
    j.write_str("lwa-RLC-UM-r14", "supported");
  }
  j.end_obj();
}

// MAC-Parameters-v1440 ::= SEQUENCE
SRSASN_CODE mac_params_v1440_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rai_support_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_params_v1440_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rai_support_r14_present, 1));

  return SRSASN_SUCCESS;
}
void mac_params_v1440_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rai_support_r14_present) {
    j.write_str("rai-Support-r14", "supported");
  }
  j.end_obj();
}

// MMTEL-Parameters-r14 ::= SEQUENCE
SRSASN_CODE mmtel_params_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(delay_budget_report_r14_present, 1));
  HANDLE_CODE(bref.pack(pusch_enhance_r14_present, 1));
  HANDLE_CODE(bref.pack(recommended_bit_rate_r14_present, 1));
  HANDLE_CODE(bref.pack(recommended_bit_rate_query_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mmtel_params_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(delay_budget_report_r14_present, 1));
  HANDLE_CODE(bref.unpack(pusch_enhance_r14_present, 1));
  HANDLE_CODE(bref.unpack(recommended_bit_rate_r14_present, 1));
  HANDLE_CODE(bref.unpack(recommended_bit_rate_query_r14_present, 1));

  return SRSASN_SUCCESS;
}
void mmtel_params_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (delay_budget_report_r14_present) {
    j.write_str("delayBudgetReporting-r14", "supported");
  }
  if (pusch_enhance_r14_present) {
    j.write_str("pusch-Enhancements-r14", "supported");
  }
  if (recommended_bit_rate_r14_present) {
    j.write_str("recommendedBitRate-r14", "supported");
  }
  if (recommended_bit_rate_query_r14_present) {
    j.write_str("recommendedBitRateQuery-r14", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1450-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1450_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(phy_layer_params_v1450_present, 1));
  HANDLE_CODE(bref.pack(rf_params_v1450_present, 1));
  HANDLE_CODE(bref.pack(ue_category_dl_v1450_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (phy_layer_params_v1450_present) {
    HANDLE_CODE(phy_layer_params_v1450.pack(bref));
  }
  if (rf_params_v1450_present) {
    HANDLE_CODE(rf_params_v1450.pack(bref));
  }
  HANDLE_CODE(other_params_v1450.pack(bref));
  if (ue_category_dl_v1450_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_dl_v1450, (uint8_t)20u, (uint8_t)20u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1450_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phy_layer_params_v1450_present, 1));
  HANDLE_CODE(bref.unpack(rf_params_v1450_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_dl_v1450_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (phy_layer_params_v1450_present) {
    HANDLE_CODE(phy_layer_params_v1450.unpack(bref));
  }
  if (rf_params_v1450_present) {
    HANDLE_CODE(rf_params_v1450.unpack(bref));
  }
  HANDLE_CODE(other_params_v1450.unpack(bref));
  if (ue_category_dl_v1450_present) {
    HANDLE_CODE(unpack_integer(ue_category_dl_v1450, bref, (uint8_t)20u, (uint8_t)20u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1450_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1450_present) {
    j.write_fieldname("phyLayerParameters-v1450");
    phy_layer_params_v1450.to_json(j);
  }
  if (rf_params_v1450_present) {
    j.write_fieldname("rf-Parameters-v1450");
    rf_params_v1450.to_json(j);
  }
  j.write_fieldname("otherParameters-v1450");
  other_params_v1450.to_json(j);
  if (ue_category_dl_v1450_present) {
    j.write_int("ue-CategoryDL-v1450", ue_category_dl_v1450);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// CE-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE ce_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_switch_without_ho_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ce_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_switch_without_ho_r14_present, 1));

  return SRSASN_SUCCESS;
}
void ce_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_switch_without_ho_r14_present) {
    j.write_str("ce-SwitchWithoutHO-r14", "supported");
  }
  j.end_obj();
}

// HighSpeedEnhParameters-r14 ::= SEQUENCE
SRSASN_CODE high_speed_enh_params_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_enhance_r14_present, 1));
  HANDLE_CODE(bref.pack(demod_enhance_r14_present, 1));
  HANDLE_CODE(bref.pack(prach_enhance_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE high_speed_enh_params_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_enhance_r14_present, 1));
  HANDLE_CODE(bref.unpack(demod_enhance_r14_present, 1));
  HANDLE_CODE(bref.unpack(prach_enhance_r14_present, 1));

  return SRSASN_SUCCESS;
}
void high_speed_enh_params_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_enhance_r14_present) {
    j.write_str("measurementEnhancements-r14", "supported");
  }
  if (demod_enhance_r14_present) {
    j.write_str("demodulationEnhancements-r14", "supported");
  }
  if (prach_enhance_r14_present) {
    j.write_str("prach-Enhancements-r14", "supported");
  }
  j.end_obj();
}

// LAA-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE laa_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cross_carrier_sched_laa_ul_r14_present, 1));
  HANDLE_CODE(bref.pack(ul_laa_r14_present, 1));
  HANDLE_CODE(bref.pack(two_step_sched_timing_info_r14_present, 1));
  HANDLE_CODE(bref.pack(uss_blind_decoding_adjustment_r14_present, 1));
  HANDLE_CODE(bref.pack(uss_blind_decoding_reduction_r14_present, 1));
  HANDLE_CODE(bref.pack(out_of_seq_grant_handling_r14_present, 1));

  if (two_step_sched_timing_info_r14_present) {
    HANDLE_CODE(two_step_sched_timing_info_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE laa_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cross_carrier_sched_laa_ul_r14_present, 1));
  HANDLE_CODE(bref.unpack(ul_laa_r14_present, 1));
  HANDLE_CODE(bref.unpack(two_step_sched_timing_info_r14_present, 1));
  HANDLE_CODE(bref.unpack(uss_blind_decoding_adjustment_r14_present, 1));
  HANDLE_CODE(bref.unpack(uss_blind_decoding_reduction_r14_present, 1));
  HANDLE_CODE(bref.unpack(out_of_seq_grant_handling_r14_present, 1));

  if (two_step_sched_timing_info_r14_present) {
    HANDLE_CODE(two_step_sched_timing_info_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void laa_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cross_carrier_sched_laa_ul_r14_present) {
    j.write_str("crossCarrierSchedulingLAA-UL-r14", "supported");
  }
  if (ul_laa_r14_present) {
    j.write_str("uplinkLAA-r14", "supported");
  }
  if (two_step_sched_timing_info_r14_present) {
    j.write_str("twoStepSchedulingTimingInfo-r14", two_step_sched_timing_info_r14.to_string());
  }
  if (uss_blind_decoding_adjustment_r14_present) {
    j.write_str("uss-BlindDecodingAdjustment-r14", "supported");
  }
  if (uss_blind_decoding_reduction_r14_present) {
    j.write_str("uss-BlindDecodingReduction-r14", "supported");
  }
  if (out_of_seq_grant_handling_r14_present) {
    j.write_str("outOfSequenceGrantHandling-r14", "supported");
  }
  j.end_obj();
}

// LWA-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE lwa_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(lwa_ho_without_wt_change_r14_present, 1));
  HANDLE_CODE(bref.pack(lwa_ul_r14_present, 1));
  HANDLE_CODE(bref.pack(wlan_periodic_meas_r14_present, 1));
  HANDLE_CODE(bref.pack(wlan_report_any_wlan_r14_present, 1));
  HANDLE_CODE(bref.pack(wlan_supported_data_rate_r14_present, 1));

  if (wlan_supported_data_rate_r14_present) {
    HANDLE_CODE(pack_integer(bref, wlan_supported_data_rate_r14, (uint16_t)1u, (uint16_t)2048u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE lwa_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(lwa_ho_without_wt_change_r14_present, 1));
  HANDLE_CODE(bref.unpack(lwa_ul_r14_present, 1));
  HANDLE_CODE(bref.unpack(wlan_periodic_meas_r14_present, 1));
  HANDLE_CODE(bref.unpack(wlan_report_any_wlan_r14_present, 1));
  HANDLE_CODE(bref.unpack(wlan_supported_data_rate_r14_present, 1));

  if (wlan_supported_data_rate_r14_present) {
    HANDLE_CODE(unpack_integer(wlan_supported_data_rate_r14, bref, (uint16_t)1u, (uint16_t)2048u));
  }

  return SRSASN_SUCCESS;
}
void lwa_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (lwa_ho_without_wt_change_r14_present) {
    j.write_str("lwa-HO-WithoutWT-Change-r14", "supported");
  }
  if (lwa_ul_r14_present) {
    j.write_str("lwa-UL-r14", "supported");
  }
  if (wlan_periodic_meas_r14_present) {
    j.write_str("wlan-PeriodicMeas-r14", "supported");
  }
  if (wlan_report_any_wlan_r14_present) {
    j.write_str("wlan-ReportAnyWLAN-r14", "supported");
  }
  if (wlan_supported_data_rate_r14_present) {
    j.write_int("wlan-SupportedDataRate-r14", wlan_supported_data_rate_r14);
  }
  j.end_obj();
}

// LWIP-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE lwip_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(lwip_aggregation_dl_r14_present, 1));
  HANDLE_CODE(bref.pack(lwip_aggregation_ul_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE lwip_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(lwip_aggregation_dl_r14_present, 1));
  HANDLE_CODE(bref.unpack(lwip_aggregation_ul_r14_present, 1));

  return SRSASN_SUCCESS;
}
void lwip_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (lwip_aggregation_dl_r14_present) {
    j.write_str("lwip-Aggregation-DL-r14", "supported");
  }
  if (lwip_aggregation_ul_r14_present) {
    j.write_str("lwip-Aggregation-UL-r14", "supported");
  }
  j.end_obj();
}

// MAC-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE mac_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(short_sps_interv_fdd_r14_present, 1));
  HANDLE_CODE(bref.pack(short_sps_interv_tdd_r14_present, 1));
  HANDLE_CODE(bref.pack(skip_ul_dynamic_r14_present, 1));
  HANDLE_CODE(bref.pack(skip_ul_sps_r14_present, 1));
  HANDLE_CODE(bref.pack(multiple_ul_sps_r14_present, 1));
  HANDLE_CODE(bref.pack(data_inact_mon_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(short_sps_interv_fdd_r14_present, 1));
  HANDLE_CODE(bref.unpack(short_sps_interv_tdd_r14_present, 1));
  HANDLE_CODE(bref.unpack(skip_ul_dynamic_r14_present, 1));
  HANDLE_CODE(bref.unpack(skip_ul_sps_r14_present, 1));
  HANDLE_CODE(bref.unpack(multiple_ul_sps_r14_present, 1));
  HANDLE_CODE(bref.unpack(data_inact_mon_r14_present, 1));

  return SRSASN_SUCCESS;
}
void mac_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (short_sps_interv_fdd_r14_present) {
    j.write_str("shortSPS-IntervalFDD-r14", "supported");
  }
  if (short_sps_interv_tdd_r14_present) {
    j.write_str("shortSPS-IntervalTDD-r14", "supported");
  }
  if (skip_ul_dynamic_r14_present) {
    j.write_str("skipUplinkDynamic-r14", "supported");
  }
  if (skip_ul_sps_r14_present) {
    j.write_str("skipUplinkSPS-r14", "supported");
  }
  if (multiple_ul_sps_r14_present) {
    j.write_str("multipleUplinkSPS-r14", "supported");
  }
  if (data_inact_mon_r14_present) {
    j.write_str("dataInactMon-r14", "supported");
  }
  j.end_obj();
}

// MBMS-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE mbms_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(fembms_ded_cell_r14_present, 1));
  HANDLE_CODE(bref.pack(fembms_mixed_cell_r14_present, 1));
  HANDLE_CODE(bref.pack(subcarrier_spacing_mbms_khz7dot5_r14_present, 1));
  HANDLE_CODE(bref.pack(subcarrier_spacing_mbms_khz1dot25_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(fembms_ded_cell_r14_present, 1));
  HANDLE_CODE(bref.unpack(fembms_mixed_cell_r14_present, 1));
  HANDLE_CODE(bref.unpack(subcarrier_spacing_mbms_khz7dot5_r14_present, 1));
  HANDLE_CODE(bref.unpack(subcarrier_spacing_mbms_khz1dot25_r14_present, 1));

  return SRSASN_SUCCESS;
}
void mbms_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (fembms_ded_cell_r14_present) {
    j.write_str("fembmsDedicatedCell-r14", "supported");
  }
  if (fembms_mixed_cell_r14_present) {
    j.write_str("fembmsMixedCell-r14", "supported");
  }
  if (subcarrier_spacing_mbms_khz7dot5_r14_present) {
    j.write_str("subcarrierSpacingMBMS-khz7dot5-r14", "supported");
  }
  if (subcarrier_spacing_mbms_khz1dot25_r14_present) {
    j.write_str("subcarrierSpacingMBMS-khz1dot25-r14", "supported");
  }
  j.end_obj();
}

// MeasParameters-v1430 ::= SEQUENCE
SRSASN_CODE meas_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_meass_r14_present, 1));
  HANDLE_CODE(bref.pack(ncsg_r14_present, 1));
  HANDLE_CODE(bref.pack(short_meas_gap_r14_present, 1));
  HANDLE_CODE(bref.pack(per_serving_cell_meas_gap_r14_present, 1));
  HANDLE_CODE(bref.pack(non_uniform_gap_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_meass_r14_present, 1));
  HANDLE_CODE(bref.unpack(ncsg_r14_present, 1));
  HANDLE_CODE(bref.unpack(short_meas_gap_r14_present, 1));
  HANDLE_CODE(bref.unpack(per_serving_cell_meas_gap_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_uniform_gap_r14_present, 1));

  return SRSASN_SUCCESS;
}
void meas_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_meass_r14_present) {
    j.write_str("ceMeasurements-r14", "supported");
  }
  if (ncsg_r14_present) {
    j.write_str("ncsg-r14", "supported");
  }
  if (short_meas_gap_r14_present) {
    j.write_str("shortMeasurementGap-r14", "supported");
  }
  if (per_serving_cell_meas_gap_r14_present) {
    j.write_str("perServingCellMeasurementGap-r14", "supported");
  }
  if (non_uniform_gap_r14_present) {
    j.write_str("nonUniformGap-r14", "supported");
  }
  j.end_obj();
}

// MobilityParameters-r14 ::= SEQUENCE
SRSASN_CODE mob_params_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(make_before_break_r14_present, 1));
  HANDLE_CODE(bref.pack(rach_less_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mob_params_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(make_before_break_r14_present, 1));
  HANDLE_CODE(bref.unpack(rach_less_r14_present, 1));

  return SRSASN_SUCCESS;
}
void mob_params_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (make_before_break_r14_present) {
    j.write_str("makeBeforeBreak-r14", "supported");
  }
  if (rach_less_r14_present) {
    j.write_str("rach-Less-r14", "supported");
  }
  j.end_obj();
}

// Other-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE other_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(bw_pref_ind_r14_present, 1));
  HANDLE_CODE(bref.pack(rlm_report_support_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE other_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(bw_pref_ind_r14_present, 1));
  HANDLE_CODE(bref.unpack(rlm_report_support_r14_present, 1));

  return SRSASN_SUCCESS;
}
void other_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (bw_pref_ind_r14_present) {
    j.write_str("bwPrefInd-r14", "supported");
  }
  if (rlm_report_support_r14_present) {
    j.write_str("rlm-ReportSupport-r14", "supported");
  }
  j.end_obj();
}

// PDCP-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE pdcp_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(max_num_rohc_context_sessions_r14_present, 1));

  HANDLE_CODE(bref.pack(supported_ul_only_rohc_profiles_r14.profile0x0006_r14, 1));
  if (max_num_rohc_context_sessions_r14_present) {
    HANDLE_CODE(max_num_rohc_context_sessions_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(max_num_rohc_context_sessions_r14_present, 1));

  HANDLE_CODE(bref.unpack(supported_ul_only_rohc_profiles_r14.profile0x0006_r14, 1));
  if (max_num_rohc_context_sessions_r14_present) {
    HANDLE_CODE(max_num_rohc_context_sessions_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void pdcp_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("supportedUplinkOnlyROHC-Profiles-r14");
  j.start_obj();
  j.write_bool("profile0x0006-r14", supported_ul_only_rohc_profiles_r14.profile0x0006_r14);
  j.end_obj();
  if (max_num_rohc_context_sessions_r14_present) {
    j.write_str("maxNumberROHC-ContextSessions-r14", max_num_rohc_context_sessions_r14.to_string());
  }
  j.end_obj();
}

// RLC-Parameters-v1430 ::= SEQUENCE
SRSASN_CODE rlc_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(extended_poll_byte_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(extended_poll_byte_r14_present, 1));

  return SRSASN_SUCCESS;
}
void rlc_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (extended_poll_byte_r14_present) {
    j.write_str("extendedPollByte-r14", "supported");
  }
  j.end_obj();
}

// UE-BasedNetwPerfMeasParameters-v1430 ::= SEQUENCE
SRSASN_CODE ue_based_netw_perf_meas_params_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(location_report_r14_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_based_netw_perf_meas_params_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(location_report_r14_present, 1));

  return SRSASN_SUCCESS;
}
void ue_based_netw_perf_meas_params_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (location_report_r14_present) {
    j.write_str("locationReport-r14", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1440-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1440_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(lwa_params_v1440.pack(bref));
  HANDLE_CODE(mac_params_v1440.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1440_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(lwa_params_v1440.unpack(bref));
  HANDLE_CODE(mac_params_v1440.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1440_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("lwa-Parameters-v1440");
  lwa_params_v1440.to_json(j);
  j.write_fieldname("mac-Parameters-v1440");
  mac_params_v1440.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-v1430 ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(phy_layer_params_v1430_present, 1));
  HANDLE_CODE(bref.pack(mmtel_params_r14_present, 1));

  if (phy_layer_params_v1430_present) {
    HANDLE_CODE(phy_layer_params_v1430.pack(bref));
  }
  if (mmtel_params_r14_present) {
    HANDLE_CODE(mmtel_params_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phy_layer_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(mmtel_params_r14_present, 1));

  if (phy_layer_params_v1430_present) {
    HANDLE_CODE(phy_layer_params_v1430.unpack(bref));
  }
  if (mmtel_params_r14_present) {
    HANDLE_CODE(mmtel_params_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_add_xdd_mode_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1430_present) {
    j.write_fieldname("phyLayerParameters-v1430");
    phy_layer_params_v1430.to_json(j);
  }
  if (mmtel_params_r14_present) {
    j.write_fieldname("mmtel-Parameters-r14");
    mmtel_params_r14.to_json(j);
  }
  j.end_obj();
}

// MBMS-Parameters-v1470 ::= SEQUENCE
SRSASN_CODE mbms_params_v1470_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));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_params_v1470_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));
  }

  return SRSASN_SUCCESS;
}
void mbms_params_v1470_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());
  }
  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
{
  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;
}

// 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));
  }
  if (mac_params_v1430_present) {
    HANDLE_CODE(mac_params_v1430.pack(bref));
  }
  if (meas_params_v1430_present) {
    HANDLE_CODE(meas_params_v1430.pack(bref));
  }
  if (pdcp_params_v1430_present) {
    HANDLE_CODE(pdcp_params_v1430.pack(bref));
  }
  HANDLE_CODE(rlc_params_v1430.pack(bref));
  if (rf_params_v1430_present) {
    HANDLE_CODE(rf_params_v1430.pack(bref));
  }
  if (laa_params_v1430_present) {
    HANDLE_CODE(laa_params_v1430.pack(bref));
  }
  if (lwa_params_v1430_present) {
    HANDLE_CODE(lwa_params_v1430.pack(bref));
  }
  if (lwip_params_v1430_present) {
    HANDLE_CODE(lwip_params_v1430.pack(bref));
  }
  HANDLE_CODE(other_params_v1430.pack(bref));
  if (mmtel_params_r14_present) {
    HANDLE_CODE(mmtel_params_r14.pack(bref));
  }
  if (mob_params_r14_present) {
    HANDLE_CODE(mob_params_r14.pack(bref));
  }
  HANDLE_CODE(ce_params_v1430.pack(bref));
  if (fdd_add_ue_eutra_cap_v1430_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1430.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1430_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1430.pack(bref));
  }
  if (mbms_params_v1430_present) {
    HANDLE_CODE(mbms_params_v1430.pack(bref));
  }
  if (sl_params_v1430_present) {
    HANDLE_CODE(sl_params_v1430.pack(bref));
  }
  if (ue_based_netw_perf_meas_params_v1430_present) {
    HANDLE_CODE(ue_based_netw_perf_meas_params_v1430.pack(bref));
  }
  if (high_speed_enh_params_r14_present) {
    HANDLE_CODE(high_speed_enh_params_r14.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_category_dl_v1430_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_ul_v1430_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_ul_v1430b_present, 1));
  HANDLE_CODE(bref.unpack(mac_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(meas_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(pdcp_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(rf_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(laa_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(lwa_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(lwip_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(mmtel_params_r14_present, 1));
  HANDLE_CODE(bref.unpack(mob_params_r14_present, 1));
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1430_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1430_present, 1));
  HANDLE_CODE(bref.unpack(mbms_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(sl_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(ue_based_netw_perf_meas_params_v1430_present, 1));
  HANDLE_CODE(bref.unpack(high_speed_enh_params_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(phy_layer_params_v1430.unpack(bref));
  if (ue_category_ul_v1430_present) {
    HANDLE_CODE(ue_category_ul_v1430.unpack(bref));
  }
  if (mac_params_v1430_present) {
    HANDLE_CODE(mac_params_v1430.unpack(bref));
  }
  if (meas_params_v1430_present) {
    HANDLE_CODE(meas_params_v1430.unpack(bref));
  }
  if (pdcp_params_v1430_present) {
    HANDLE_CODE(pdcp_params_v1430.unpack(bref));
  }
  HANDLE_CODE(rlc_params_v1430.unpack(bref));
  if (rf_params_v1430_present) {
    HANDLE_CODE(rf_params_v1430.unpack(bref));
  }
  if (laa_params_v1430_present) {
    HANDLE_CODE(laa_params_v1430.unpack(bref));
  }
  if (lwa_params_v1430_present) {
    HANDLE_CODE(lwa_params_v1430.unpack(bref));
  }
  if (lwip_params_v1430_present) {
    HANDLE_CODE(lwip_params_v1430.unpack(bref));
  }
  HANDLE_CODE(other_params_v1430.unpack(bref));
  if (mmtel_params_r14_present) {
    HANDLE_CODE(mmtel_params_r14.unpack(bref));
  }
  if (mob_params_r14_present) {
    HANDLE_CODE(mob_params_r14.unpack(bref));
  }
  HANDLE_CODE(ce_params_v1430.unpack(bref));
  if (fdd_add_ue_eutra_cap_v1430_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1430.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1430_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1430.unpack(bref));
  }
  if (mbms_params_v1430_present) {
    HANDLE_CODE(mbms_params_v1430.unpack(bref));
  }
  if (sl_params_v1430_present) {
    HANDLE_CODE(sl_params_v1430.unpack(bref));
  }
  if (ue_based_netw_perf_meas_params_v1430_present) {
    HANDLE_CODE(ue_based_netw_perf_meas_params_v1430.unpack(bref));
  }
  if (high_speed_enh_params_r14_present) {
    HANDLE_CODE(high_speed_enh_params_r14.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("phyLayerParameters-v1430");
  phy_layer_params_v1430.to_json(j);
  if (ue_category_dl_v1430_present) {
    j.write_str("ue-CategoryDL-v1430", "m2");
  }
  if (ue_category_ul_v1430_present) {
    j.write_str("ue-CategoryUL-v1430", ue_category_ul_v1430.to_string());
  }
  if (ue_category_ul_v1430b_present) {
    j.write_str("ue-CategoryUL-v1430b", "n21");
  }
  if (mac_params_v1430_present) {
    j.write_fieldname("mac-Parameters-v1430");
    mac_params_v1430.to_json(j);
  }
  if (meas_params_v1430_present) {
    j.write_fieldname("measParameters-v1430");
    meas_params_v1430.to_json(j);
  }
  if (pdcp_params_v1430_present) {
    j.write_fieldname("pdcp-Parameters-v1430");
    pdcp_params_v1430.to_json(j);
  }
  j.write_fieldname("rlc-Parameters-v1430");
  rlc_params_v1430.to_json(j);
  if (rf_params_v1430_present) {
    j.write_fieldname("rf-Parameters-v1430");
    rf_params_v1430.to_json(j);
  }
  if (laa_params_v1430_present) {
    j.write_fieldname("laa-Parameters-v1430");
    laa_params_v1430.to_json(j);
  }
  if (lwa_params_v1430_present) {
    j.write_fieldname("lwa-Parameters-v1430");
    lwa_params_v1430.to_json(j);
  }
  if (lwip_params_v1430_present) {
    j.write_fieldname("lwip-Parameters-v1430");
    lwip_params_v1430.to_json(j);
  }
  j.write_fieldname("otherParameters-v1430");
  other_params_v1430.to_json(j);
  if (mmtel_params_r14_present) {
    j.write_fieldname("mmtel-Parameters-r14");
    mmtel_params_r14.to_json(j);
  }
  if (mob_params_r14_present) {
    j.write_fieldname("mobilityParameters-r14");
    mob_params_r14.to_json(j);
  }
  j.write_fieldname("ce-Parameters-v1430");
  ce_params_v1430.to_json(j);
  if (fdd_add_ue_eutra_cap_v1430_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1430");
    fdd_add_ue_eutra_cap_v1430.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1430_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1430");
    tdd_add_ue_eutra_cap_v1430.to_json(j);
  }
  if (mbms_params_v1430_present) {
    j.write_fieldname("mbms-Parameters-v1430");
    mbms_params_v1430.to_json(j);
  }
  if (sl_params_v1430_present) {
    j.write_fieldname("sl-Parameters-v1430");
    sl_params_v1430.to_json(j);
  }
  if (ue_based_netw_perf_meas_params_v1430_present) {
    j.write_fieldname("ue-BasedNetwPerfMeasParameters-v1430");
    ue_based_netw_perf_meas_params_v1430.to_json(j);
  }
  if (high_speed_enh_params_r14_present) {
    j.write_fieldname("highSpeedEnhParameters-r14");
    high_speed_enh_params_r14.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
{
  HANDLE_CODE(bref.pack(unicast_freq_hop_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ce_params_v1350_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(unicast_freq_hop_r13_present, 1));

  return SRSASN_SUCCESS;
}
void ce_params_v1350_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (unicast_freq_hop_r13_present) {
    j.write_str("unicastFrequencyHopping-r13", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1360-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1360_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(other_params_v1360_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (other_params_v1360_present) {
    HANDLE_CODE(other_params_v1360.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1360_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(other_params_v1360_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (other_params_v1360_present) {
    HANDLE_CODE(other_params_v1360.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1360_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (other_params_v1360_present) {
    j.write_fieldname("other-Parameters-v1360");
    other_params_v1360.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));
  }

  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));
  }

  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");
    j.start_obj();
    j.end_obj();
  }
  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-v1350-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1350_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(non_crit_ext_present, 1));

  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_v1350_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(non_crit_ext_present, 1));

  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_v1350_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");
  }
  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);
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v13x0-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v13x0_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_v13x0_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_v13x0_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
{
  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));
  HANDLE_CODE(bref.pack(intra_freq_ho_ce_mode_a_r13_present, 1));
  HANDLE_CODE(bref.pack(intra_freq_ho_ce_mode_b_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ce_params_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(intra_freq_a3_ce_mode_a_r13_present, 1));
  HANDLE_CODE(bref.unpack(intra_freq_a3_ce_mode_b_r13_present, 1));
  HANDLE_CODE(bref.unpack(intra_freq_ho_ce_mode_a_r13_present, 1));
  HANDLE_CODE(bref.unpack(intra_freq_ho_ce_mode_b_r13_present, 1));

  return SRSASN_SUCCESS;
}
void ce_params_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (intra_freq_a3_ce_mode_a_r13_present) {
    j.write_str("intraFreqA3-CE-ModeA-r13", "supported");
  }
  if (intra_freq_a3_ce_mode_b_r13_present) {
    j.write_str("intraFreqA3-CE-ModeB-r13", "supported");
  }
  if (intra_freq_ho_ce_mode_a_r13_present) {
    j.write_str("intraFreqHO-CE-ModeA-r13", "supported");
  }
  if (intra_freq_ho_ce_mode_b_r13_present) {
    j.write_str("intraFreqHO-CE-ModeB-r13", "supported");
  }
  j.end_obj();
}

// PhyLayerParameters-v1310 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(aperiodic_csi_report_r13_present, 1));
  HANDLE_CODE(bref.pack(codebook_harq_ack_r13_present, 1));
  HANDLE_CODE(bref.pack(cross_carrier_sched_b5_c_r13_present, 1));
  HANDLE_CODE(bref.pack(fdd_harq_timing_tdd_r13_present, 1));
  HANDLE_CODE(bref.pack(max_num_upd_csi_proc_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_format4_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_format5_r13_present, 1));
  HANDLE_CODE(bref.pack(pucch_scell_r13_present, 1));
  HANDLE_CODE(bref.pack(spatial_bundling_harq_ack_r13_present, 1));
  HANDLE_CODE(bref.pack(supported_blind_decoding_r13_present, 1));
  HANDLE_CODE(bref.pack(uci_pusch_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(crs_interf_mitigation_tm10_r13_present, 1));
  HANDLE_CODE(bref.pack(pdsch_collision_handling_r13_present, 1));

  if (aperiodic_csi_report_r13_present) {
    HANDLE_CODE(aperiodic_csi_report_r13.pack(bref));
  }
  if (codebook_harq_ack_r13_present) {
    HANDLE_CODE(codebook_harq_ack_r13.pack(bref));
  }
  if (max_num_upd_csi_proc_r13_present) {
    HANDLE_CODE(pack_integer(bref, max_num_upd_csi_proc_r13, (uint8_t)5u, (uint8_t)32u));
  }
  if (supported_blind_decoding_r13_present) {
    HANDLE_CODE(bref.pack(supported_blind_decoding_r13.max_num_decoding_r13_present, 1));
    HANDLE_CODE(bref.pack(supported_blind_decoding_r13.pdcch_candidate_reductions_r13_present, 1));
    HANDLE_CODE(bref.pack(supported_blind_decoding_r13.skip_monitoring_dci_format0_minus1_a_r13_present, 1));
    if (supported_blind_decoding_r13.max_num_decoding_r13_present) {
      HANDLE_CODE(pack_integer(bref, supported_blind_decoding_r13.max_num_decoding_r13, (uint8_t)1u, (uint8_t)32u));
    }
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(aperiodic_csi_report_r13_present, 1));
  HANDLE_CODE(bref.unpack(codebook_harq_ack_r13_present, 1));
  HANDLE_CODE(bref.unpack(cross_carrier_sched_b5_c_r13_present, 1));
  HANDLE_CODE(bref.unpack(fdd_harq_timing_tdd_r13_present, 1));
  HANDLE_CODE(bref.unpack(max_num_upd_csi_proc_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_format4_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_format5_r13_present, 1));
  HANDLE_CODE(bref.unpack(pucch_scell_r13_present, 1));
  HANDLE_CODE(bref.unpack(spatial_bundling_harq_ack_r13_present, 1));
  HANDLE_CODE(bref.unpack(supported_blind_decoding_r13_present, 1));
  HANDLE_CODE(bref.unpack(uci_pusch_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(crs_interf_mitigation_tm10_r13_present, 1));
  HANDLE_CODE(bref.unpack(pdsch_collision_handling_r13_present, 1));

  if (aperiodic_csi_report_r13_present) {
    HANDLE_CODE(aperiodic_csi_report_r13.unpack(bref));
  }
  if (codebook_harq_ack_r13_present) {
    HANDLE_CODE(codebook_harq_ack_r13.unpack(bref));
  }
  if (max_num_upd_csi_proc_r13_present) {
    HANDLE_CODE(unpack_integer(max_num_upd_csi_proc_r13, bref, (uint8_t)5u, (uint8_t)32u));
  }
  if (supported_blind_decoding_r13_present) {
    HANDLE_CODE(bref.unpack(supported_blind_decoding_r13.max_num_decoding_r13_present, 1));
    HANDLE_CODE(bref.unpack(supported_blind_decoding_r13.pdcch_candidate_reductions_r13_present, 1));
    HANDLE_CODE(bref.unpack(supported_blind_decoding_r13.skip_monitoring_dci_format0_minus1_a_r13_present, 1));
    if (supported_blind_decoding_r13.max_num_decoding_r13_present) {
      HANDLE_CODE(unpack_integer(supported_blind_decoding_r13.max_num_decoding_r13, bref, (uint8_t)1u, (uint8_t)32u));
    }
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (aperiodic_csi_report_r13_present) {
    j.write_str("aperiodicCSI-Reporting-r13", aperiodic_csi_report_r13.to_string());
  }
  if (codebook_harq_ack_r13_present) {
    j.write_str("codebook-HARQ-ACK-r13", codebook_harq_ack_r13.to_string());
  }
  if (cross_carrier_sched_b5_c_r13_present) {
    j.write_str("crossCarrierScheduling-B5C-r13", "supported");
  }
  if (fdd_harq_timing_tdd_r13_present) {
    j.write_str("fdd-HARQ-TimingTDD-r13", "supported");
  }
  if (max_num_upd_csi_proc_r13_present) {
    j.write_int("maxNumberUpdatedCSI-Proc-r13", max_num_upd_csi_proc_r13);
  }
  if (pucch_format4_r13_present) {
    j.write_str("pucch-Format4-r13", "supported");
  }
  if (pucch_format5_r13_present) {
    j.write_str("pucch-Format5-r13", "supported");
  }
  if (pucch_scell_r13_present) {
    j.write_str("pucch-SCell-r13", "supported");
  }
  if (spatial_bundling_harq_ack_r13_present) {
    j.write_str("spatialBundling-HARQ-ACK-r13", "supported");
  }
  if (supported_blind_decoding_r13_present) {
    j.write_fieldname("supportedBlindDecoding-r13");
    j.start_obj();
    if (supported_blind_decoding_r13.max_num_decoding_r13_present) {
      j.write_int("maxNumberDecoding-r13", supported_blind_decoding_r13.max_num_decoding_r13);
    }
    if (supported_blind_decoding_r13.pdcch_candidate_reductions_r13_present) {
      j.write_str("pdcch-CandidateReductions-r13", "supported");
    }
    if (supported_blind_decoding_r13.skip_monitoring_dci_format0_minus1_a_r13_present) {
      j.write_str("skipMonitoringDCI-Format0-1A-r13", "supported");
    }
    j.end_obj();
  }
  if (uci_pusch_ext_r13_present) {
    j.write_str("uci-PUSCH-Ext-r13", "supported");
  }
  if (crs_interf_mitigation_tm10_r13_present) {
    j.write_str("crs-InterfMitigationTM10-r13", "supported");
  }
  if (pdsch_collision_handling_r13_present) {
    j.write_str("pdsch-CollisionHandling-r13", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1330-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1330_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ue_category_dl_v1330_present, 1));
  HANDLE_CODE(bref.pack(phy_layer_params_v1330_present, 1));
  HANDLE_CODE(bref.pack(ue_ce_need_ul_gaps_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ue_category_dl_v1330_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_dl_v1330, (uint8_t)18u, (uint8_t)19u));
  }
  if (phy_layer_params_v1330_present) {
    HANDLE_CODE(phy_layer_params_v1330.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1330_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_category_dl_v1330_present, 1));
  HANDLE_CODE(bref.unpack(phy_layer_params_v1330_present, 1));
  HANDLE_CODE(bref.unpack(ue_ce_need_ul_gaps_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_category_dl_v1330_present) {
    HANDLE_CODE(unpack_integer(ue_category_dl_v1330, bref, (uint8_t)18u, (uint8_t)19u));
  }
  if (phy_layer_params_v1330_present) {
    HANDLE_CODE(phy_layer_params_v1330.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1330_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_category_dl_v1330_present) {
    j.write_int("ue-CategoryDL-v1330", ue_category_dl_v1330);
  }
  if (phy_layer_params_v1330_present) {
    j.write_fieldname("phyLayerParameters-v1330");
    phy_layer_params_v1330.to_json(j);
  }
  if (ue_ce_need_ul_gaps_r13_present) {
    j.write_str("ue-CE-NeedULGaps-r13", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.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-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 (scptm_params_r13_present) {
    j.write_fieldname("scptm-Parameters-r13");
    scptm_params_r13.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();
}

// CE-Parameters-r13 ::= SEQUENCE
SRSASN_CODE ce_params_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_mode_a_r13_present, 1));
  HANDLE_CODE(bref.pack(ce_mode_b_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ce_params_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_mode_a_r13_present, 1));
  HANDLE_CODE(bref.unpack(ce_mode_b_r13_present, 1));

  return SRSASN_SUCCESS;
}
void ce_params_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_mode_a_r13_present) {
    j.write_str("ce-ModeA-r13", "supported");
  }
  if (ce_mode_b_r13_present) {
    j.write_str("ce-ModeB-r13", "supported");
  }
  j.end_obj();
}

// DC-Parameters-v1310 ::= SEQUENCE
SRSASN_CODE dc_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pdcp_transfer_split_ul_r13_present, 1));
  HANDLE_CODE(bref.pack(ue_sstd_meas_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE dc_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pdcp_transfer_split_ul_r13_present, 1));
  HANDLE_CODE(bref.unpack(ue_sstd_meas_r13_present, 1));

  return SRSASN_SUCCESS;
}
void dc_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pdcp_transfer_split_ul_r13_present) {
    j.write_str("pdcp-TransferSplitUL-r13", "supported");
  }
  if (ue_sstd_meas_r13_present) {
    j.write_str("ue-SSTD-Meas-r13", "supported");
  }
  j.end_obj();
}

// LAA-Parameters-r13 ::= SEQUENCE
SRSASN_CODE laa_params_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cross_carrier_sched_laa_dl_r13_present, 1));
  HANDLE_CODE(bref.pack(csi_rs_drs_rrm_meass_laa_r13_present, 1));
  HANDLE_CODE(bref.pack(dl_laa_r13_present, 1));
  HANDLE_CODE(bref.pack(ending_dw_pts_r13_present, 1));
  HANDLE_CODE(bref.pack(second_slot_start_position_r13_present, 1));
  HANDLE_CODE(bref.pack(tm9_laa_r13_present, 1));
  HANDLE_CODE(bref.pack(tm10_laa_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE laa_params_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cross_carrier_sched_laa_dl_r13_present, 1));
  HANDLE_CODE(bref.unpack(csi_rs_drs_rrm_meass_laa_r13_present, 1));
  HANDLE_CODE(bref.unpack(dl_laa_r13_present, 1));
  HANDLE_CODE(bref.unpack(ending_dw_pts_r13_present, 1));
  HANDLE_CODE(bref.unpack(second_slot_start_position_r13_present, 1));
  HANDLE_CODE(bref.unpack(tm9_laa_r13_present, 1));
  HANDLE_CODE(bref.unpack(tm10_laa_r13_present, 1));

  return SRSASN_SUCCESS;
}
void laa_params_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cross_carrier_sched_laa_dl_r13_present) {
    j.write_str("crossCarrierSchedulingLAA-DL-r13", "supported");
  }
  if (csi_rs_drs_rrm_meass_laa_r13_present) {
    j.write_str("csi-RS-DRS-RRM-MeasurementsLAA-r13", "supported");
  }
  if (dl_laa_r13_present) {
    j.write_str("downlinkLAA-r13", "supported");
  }
  if (ending_dw_pts_r13_present) {
    j.write_str("endingDwPTS-r13", "supported");
  }
  if (second_slot_start_position_r13_present) {
    j.write_str("secondSlotStartingPosition-r13", "supported");
  }
  if (tm9_laa_r13_present) {
    j.write_str("tm9-LAA-r13", "supported");
  }
  if (tm10_laa_r13_present) {
    j.write_str("tm10-LAA-r13", "supported");
  }
  j.end_obj();
}

// LWA-Parameters-r13 ::= SEQUENCE
SRSASN_CODE lwa_params_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(lwa_r13_present, 1));
  HANDLE_CODE(bref.pack(lwa_split_bearer_r13_present, 1));
  HANDLE_CODE(bref.pack(wlan_mac_address_r13_present, 1));
  HANDLE_CODE(bref.pack(lwa_buffer_size_r13_present, 1));

  if (wlan_mac_address_r13_present) {
    HANDLE_CODE(wlan_mac_address_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE lwa_params_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(lwa_r13_present, 1));
  HANDLE_CODE(bref.unpack(lwa_split_bearer_r13_present, 1));
  HANDLE_CODE(bref.unpack(wlan_mac_address_r13_present, 1));
  HANDLE_CODE(bref.unpack(lwa_buffer_size_r13_present, 1));

  if (wlan_mac_address_r13_present) {
    HANDLE_CODE(wlan_mac_address_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void lwa_params_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (lwa_r13_present) {
    j.write_str("lwa-r13", "supported");
  }
  if (lwa_split_bearer_r13_present) {
    j.write_str("lwa-SplitBearer-r13", "supported");
  }
  if (wlan_mac_address_r13_present) {
    j.write_str("wlan-MAC-Address-r13", wlan_mac_address_r13.to_string());
  }
  if (lwa_buffer_size_r13_present) {
    j.write_str("lwa-BufferSize-r13", "supported");
  }
  j.end_obj();
}

// LWIP-Parameters-r13 ::= SEQUENCE
SRSASN_CODE lwip_params_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(lwip_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE lwip_params_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(lwip_r13_present, 1));

  return SRSASN_SUCCESS;
}
void lwip_params_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (lwip_r13_present) {
    j.write_str("lwip-r13", "supported");
  }
  j.end_obj();
}

// MAC-Parameters-v1310 ::= SEQUENCE
SRSASN_CODE mac_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(extended_mac_len_field_r13_present, 1));
  HANDLE_CODE(bref.pack(extended_long_drx_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(extended_mac_len_field_r13_present, 1));
  HANDLE_CODE(bref.unpack(extended_long_drx_r13_present, 1));

  return SRSASN_SUCCESS;
}
void mac_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (extended_mac_len_field_r13_present) {
    j.write_str("extendedMAC-LengthField-r13", "supported");
  }
  if (extended_long_drx_r13_present) {
    j.write_str("extendedLongDRX-r13", "supported");
  }
  j.end_obj();
}

// MeasParameters-v1310 ::= SEQUENCE
SRSASN_CODE meas_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rs_sinr_meas_r13_present, 1));
  HANDLE_CODE(bref.pack(white_cell_list_r13_present, 1));
  HANDLE_CODE(bref.pack(extended_max_obj_id_r13_present, 1));
  HANDLE_CODE(bref.pack(ul_pdcp_delay_r13_present, 1));
  HANDLE_CODE(bref.pack(extended_freq_priorities_r13_present, 1));
  HANDLE_CODE(bref.pack(multi_band_info_report_r13_present, 1));
  HANDLE_CODE(bref.pack(rssi_and_ch_occupancy_report_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rs_sinr_meas_r13_present, 1));
  HANDLE_CODE(bref.unpack(white_cell_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(extended_max_obj_id_r13_present, 1));
  HANDLE_CODE(bref.unpack(ul_pdcp_delay_r13_present, 1));
  HANDLE_CODE(bref.unpack(extended_freq_priorities_r13_present, 1));
  HANDLE_CODE(bref.unpack(multi_band_info_report_r13_present, 1));
  HANDLE_CODE(bref.unpack(rssi_and_ch_occupancy_report_r13_present, 1));

  return SRSASN_SUCCESS;
}
void meas_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rs_sinr_meas_r13_present) {
    j.write_str("rs-SINR-Meas-r13", "supported");
  }
  if (white_cell_list_r13_present) {
    j.write_str("whiteCellList-r13", "supported");
  }
  if (extended_max_obj_id_r13_present) {
    j.write_str("extendedMaxObjectId-r13", "supported");
  }
  if (ul_pdcp_delay_r13_present) {
    j.write_str("ul-PDCP-Delay-r13", "supported");
  }
  if (extended_freq_priorities_r13_present) {
    j.write_str("extendedFreqPriorities-r13", "supported");
  }
  if (multi_band_info_report_r13_present) {
    j.write_str("multiBandInfoReport-r13", "supported");
  }
  if (rssi_and_ch_occupancy_report_r13_present) {
    j.write_str("rssi-AndChannelOccupancyReporting-r13", "supported");
  }
  j.end_obj();
}

// PDCP-Parameters-v1310 ::= SEQUENCE
SRSASN_CODE pdcp_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pdcp_sn_ext_minus18bits_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pdcp_sn_ext_minus18bits_r13_present, 1));

  return SRSASN_SUCCESS;
}
void pdcp_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pdcp_sn_ext_minus18bits_r13_present) {
    j.write_str("pdcp-SN-Extension-18bits-r13", "supported");
  }
  j.end_obj();
}

// RLC-Parameters-v1310 ::= SEQUENCE
SRSASN_CODE rlc_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(extended_rlc_sn_so_field_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(extended_rlc_sn_so_field_r13_present, 1));

  return SRSASN_SUCCESS;
}
void rlc_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (extended_rlc_sn_so_field_r13_present) {
    j.write_str("extendedRLC-SN-SO-Field-r13", "supported");
  }
  j.end_obj();
}

// SL-Parameters-v1310 ::= SEQUENCE
SRSASN_CODE sl_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(disc_sys_info_report_r13_present, 1));
  HANDLE_CODE(bref.pack(comm_multiple_tx_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_inter_freq_tx_r13_present, 1));
  HANDLE_CODE(bref.pack(disc_periodic_slss_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(disc_sys_info_report_r13_present, 1));
  HANDLE_CODE(bref.unpack(comm_multiple_tx_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_inter_freq_tx_r13_present, 1));
  HANDLE_CODE(bref.unpack(disc_periodic_slss_r13_present, 1));

  return SRSASN_SUCCESS;
}
void sl_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (disc_sys_info_report_r13_present) {
    j.write_str("discSysInfoReporting-r13", "supported");
  }
  if (comm_multiple_tx_r13_present) {
    j.write_str("commMultipleTx-r13", "supported");
  }
  if (disc_inter_freq_tx_r13_present) {
    j.write_str("discInterFreqTx-r13", "supported");
  }
  if (disc_periodic_slss_r13_present) {
    j.write_str("discPeriodicSLSS-r13", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1320-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1320_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ce_params_v1320_present, 1));
  HANDLE_CODE(bref.pack(phy_layer_params_v1320_present, 1));
  HANDLE_CODE(bref.pack(rf_params_v1320_present, 1));
  HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1320_present, 1));
  HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1320_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ce_params_v1320_present) {
    HANDLE_CODE(ce_params_v1320.pack(bref));
  }
  if (phy_layer_params_v1320_present) {
    HANDLE_CODE(phy_layer_params_v1320.pack(bref));
  }
  if (rf_params_v1320_present) {
    HANDLE_CODE(rf_params_v1320.pack(bref));
  }
  if (fdd_add_ue_eutra_cap_v1320_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1320.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1320_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1320.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1320_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ce_params_v1320_present, 1));
  HANDLE_CODE(bref.unpack(phy_layer_params_v1320_present, 1));
  HANDLE_CODE(bref.unpack(rf_params_v1320_present, 1));
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1320_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1320_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ce_params_v1320_present) {
    HANDLE_CODE(ce_params_v1320.unpack(bref));
  }
  if (phy_layer_params_v1320_present) {
    HANDLE_CODE(phy_layer_params_v1320.unpack(bref));
  }
  if (rf_params_v1320_present) {
    HANDLE_CODE(rf_params_v1320.unpack(bref));
  }
  if (fdd_add_ue_eutra_cap_v1320_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1320.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1320_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1320.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1320_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ce_params_v1320_present) {
    j.write_fieldname("ce-Parameters-v1320");
    ce_params_v1320.to_json(j);
  }
  if (phy_layer_params_v1320_present) {
    j.write_fieldname("phyLayerParameters-v1320");
    phy_layer_params_v1320.to_json(j);
  }
  if (rf_params_v1320_present) {
    j.write_fieldname("rf-Parameters-v1320");
    rf_params_v1320.to_json(j);
  }
  if (fdd_add_ue_eutra_cap_v1320_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1320");
    fdd_add_ue_eutra_cap_v1320.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1320_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1320");
    tdd_add_ue_eutra_cap_v1320.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.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();
}

// UE-EUTRA-CapabilityAddXDD-Mode-v1310 ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(phy_layer_params_v1310_present, 1));

  if (phy_layer_params_v1310_present) {
    HANDLE_CODE(phy_layer_params_v1310.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phy_layer_params_v1310_present, 1));

  if (phy_layer_params_v1310_present) {
    HANDLE_CODE(phy_layer_params_v1310.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_add_xdd_mode_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1310_present) {
    j.write_fieldname("phyLayerParameters-v1310");
    phy_layer_params_v1310.to_json(j);
  }
  j.end_obj();
}

// WLAN-IW-Parameters-v1310 ::= SEQUENCE
SRSASN_CODE wlan_iw_params_v1310_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rclwi_r13_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_iw_params_v1310_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rclwi_r13_present, 1));

  return SRSASN_SUCCESS;
}
void wlan_iw_params_v1310_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rclwi_r13_present) {
    j.write_str("rclwi-r13", "supported");
  }
  j.end_obj();
}

// PhyLayerParameters-v1280 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1280_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(alt_tbs_indices_r12_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1280_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(alt_tbs_indices_r12_present, 1));

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1280_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (alt_tbs_indices_r12_present) {
    j.write_str("alternativeTBS-Indices-r12", "supported");
  }
  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
{
  HANDLE_CODE(bref.pack(ue_category_dl_v1310_present, 1));
  HANDLE_CODE(bref.pack(ue_category_ul_v1310_present, 1));
  HANDLE_CODE(bref.pack(mac_params_v1310_present, 1));
  HANDLE_CODE(bref.pack(phy_layer_params_v1310_present, 1));
  HANDLE_CODE(bref.pack(rf_params_v1310_present, 1));
  HANDLE_CODE(bref.pack(meas_params_v1310_present, 1));
  HANDLE_CODE(bref.pack(dc_params_v1310_present, 1));
  HANDLE_CODE(bref.pack(sl_params_v1310_present, 1));
  HANDLE_CODE(bref.pack(scptm_params_r13_present, 1));
  HANDLE_CODE(bref.pack(ce_params_r13_present, 1));
  HANDLE_CODE(bref.pack(laa_params_r13_present, 1));
  HANDLE_CODE(bref.pack(lwa_params_r13_present, 1));
  HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1310_present, 1));
  HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1310_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ue_category_dl_v1310_present) {
    HANDLE_CODE(ue_category_dl_v1310.pack(bref));
  }
  if (ue_category_ul_v1310_present) {
    HANDLE_CODE(ue_category_ul_v1310.pack(bref));
  }
  HANDLE_CODE(pdcp_params_v1310.pack(bref));
  HANDLE_CODE(rlc_params_v1310.pack(bref));
  if (mac_params_v1310_present) {
    HANDLE_CODE(mac_params_v1310.pack(bref));
  }
  if (phy_layer_params_v1310_present) {
    HANDLE_CODE(phy_layer_params_v1310.pack(bref));
  }
  if (rf_params_v1310_present) {
    HANDLE_CODE(rf_params_v1310.pack(bref));
  }
  if (meas_params_v1310_present) {
    HANDLE_CODE(meas_params_v1310.pack(bref));
  }
  if (dc_params_v1310_present) {
    HANDLE_CODE(dc_params_v1310.pack(bref));
  }
  if (sl_params_v1310_present) {
    HANDLE_CODE(sl_params_v1310.pack(bref));
  }
  if (scptm_params_r13_present) {
    HANDLE_CODE(scptm_params_r13.pack(bref));
  }
  if (ce_params_r13_present) {
    HANDLE_CODE(ce_params_r13.pack(bref));
  }
  HANDLE_CODE(inter_rat_params_wlan_r13.pack(bref));
  if (laa_params_r13_present) {
    HANDLE_CODE(laa_params_r13.pack(bref));
  }
  if (lwa_params_r13_present) {
    HANDLE_CODE(lwa_params_r13.pack(bref));
  }
  HANDLE_CODE(wlan_iw_params_v1310.pack(bref));
  HANDLE_CODE(lwip_params_r13.pack(bref));
  if (fdd_add_ue_eutra_cap_v1310_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1310.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1310_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1310.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_category_dl_v1310_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_ul_v1310_present, 1));
  HANDLE_CODE(bref.unpack(mac_params_v1310_present, 1));
  HANDLE_CODE(bref.unpack(phy_layer_params_v1310_present, 1));
  HANDLE_CODE(bref.unpack(rf_params_v1310_present, 1));
  HANDLE_CODE(bref.unpack(meas_params_v1310_present, 1));
  HANDLE_CODE(bref.unpack(dc_params_v1310_present, 1));
  HANDLE_CODE(bref.unpack(sl_params_v1310_present, 1));
  HANDLE_CODE(bref.unpack(scptm_params_r13_present, 1));
  HANDLE_CODE(bref.unpack(ce_params_r13_present, 1));
  HANDLE_CODE(bref.unpack(laa_params_r13_present, 1));
  HANDLE_CODE(bref.unpack(lwa_params_r13_present, 1));
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1310_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1310_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_category_dl_v1310_present) {
    HANDLE_CODE(ue_category_dl_v1310.unpack(bref));
  }
  if (ue_category_ul_v1310_present) {
    HANDLE_CODE(ue_category_ul_v1310.unpack(bref));
  }
  HANDLE_CODE(pdcp_params_v1310.unpack(bref));
  HANDLE_CODE(rlc_params_v1310.unpack(bref));
  if (mac_params_v1310_present) {
    HANDLE_CODE(mac_params_v1310.unpack(bref));
  }
  if (phy_layer_params_v1310_present) {
    HANDLE_CODE(phy_layer_params_v1310.unpack(bref));
  }
  if (rf_params_v1310_present) {
    HANDLE_CODE(rf_params_v1310.unpack(bref));
  }
  if (meas_params_v1310_present) {
    HANDLE_CODE(meas_params_v1310.unpack(bref));
  }
  if (dc_params_v1310_present) {
    HANDLE_CODE(dc_params_v1310.unpack(bref));
  }
  if (sl_params_v1310_present) {
    HANDLE_CODE(sl_params_v1310.unpack(bref));
  }
  if (scptm_params_r13_present) {
    HANDLE_CODE(scptm_params_r13.unpack(bref));
  }
  if (ce_params_r13_present) {
    HANDLE_CODE(ce_params_r13.unpack(bref));
  }
  HANDLE_CODE(inter_rat_params_wlan_r13.unpack(bref));
  if (laa_params_r13_present) {
    HANDLE_CODE(laa_params_r13.unpack(bref));
  }
  if (lwa_params_r13_present) {
    HANDLE_CODE(lwa_params_r13.unpack(bref));
  }
  HANDLE_CODE(wlan_iw_params_v1310.unpack(bref));
  HANDLE_CODE(lwip_params_r13.unpack(bref));
  if (fdd_add_ue_eutra_cap_v1310_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1310.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1310_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1310.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_category_dl_v1310_present) {
    j.write_str("ue-CategoryDL-v1310", ue_category_dl_v1310.to_string());
  }
  if (ue_category_ul_v1310_present) {
    j.write_str("ue-CategoryUL-v1310", ue_category_ul_v1310.to_string());
  }
  j.write_fieldname("pdcp-Parameters-v1310");
  pdcp_params_v1310.to_json(j);
  j.write_fieldname("rlc-Parameters-v1310");
  rlc_params_v1310.to_json(j);
  if (mac_params_v1310_present) {
    j.write_fieldname("mac-Parameters-v1310");
    mac_params_v1310.to_json(j);
  }
  if (phy_layer_params_v1310_present) {
    j.write_fieldname("phyLayerParameters-v1310");
    phy_layer_params_v1310.to_json(j);
  }
  if (rf_params_v1310_present) {
    j.write_fieldname("rf-Parameters-v1310");
    rf_params_v1310.to_json(j);
  }
  if (meas_params_v1310_present) {
    j.write_fieldname("measParameters-v1310");
    meas_params_v1310.to_json(j);
  }
  if (dc_params_v1310_present) {
    j.write_fieldname("dc-Parameters-v1310");
    dc_params_v1310.to_json(j);
  }
  if (sl_params_v1310_present) {
    j.write_fieldname("sl-Parameters-v1310");
    sl_params_v1310.to_json(j);
  }
  if (scptm_params_r13_present) {
    j.write_fieldname("scptm-Parameters-r13");
    scptm_params_r13.to_json(j);
  }
  if (ce_params_r13_present) {
    j.write_fieldname("ce-Parameters-r13");
    ce_params_r13.to_json(j);
  }
  j.write_fieldname("interRAT-ParametersWLAN-r13");
  inter_rat_params_wlan_r13.to_json(j);
  if (laa_params_r13_present) {
    j.write_fieldname("laa-Parameters-r13");
    laa_params_r13.to_json(j);
  }
  if (lwa_params_r13_present) {
    j.write_fieldname("lwa-Parameters-r13");
    lwa_params_r13.to_json(j);
  }
  j.write_fieldname("wlan-IW-Parameters-v1310");
  wlan_iw_params_v1310.to_json(j);
  j.write_fieldname("lwip-Parameters-r13");
  lwip_params_r13.to_json(j);
  if (fdd_add_ue_eutra_cap_v1310_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1310");
    fdd_add_ue_eutra_cap_v1310.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1310_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1310");
    tdd_add_ue_eutra_cap_v1310.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1280-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1280_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(phy_layer_params_v1280_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (phy_layer_params_v1280_present) {
    HANDLE_CODE(phy_layer_params_v1280.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1280_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phy_layer_params_v1280_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (phy_layer_params_v1280_present) {
    HANDLE_CODE(phy_layer_params_v1280.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1280_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1280_present) {
    j.write_fieldname("phyLayerParameters-v1280");
    phy_layer_params_v1280.to_json(j);
  }
  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();
}

// MeasParameters-v1250 ::= SEQUENCE
SRSASN_CODE meas_params_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(timer_t312_r12_present, 1));
  HANDLE_CODE(bref.pack(alt_time_to_trigger_r12_present, 1));
  HANDLE_CODE(bref.pack(inc_mon_eutra_r12_present, 1));
  HANDLE_CODE(bref.pack(inc_mon_utra_r12_present, 1));
  HANDLE_CODE(bref.pack(extended_max_meas_id_r12_present, 1));
  HANDLE_CODE(bref.pack(extended_rsrq_lower_range_r12_present, 1));
  HANDLE_CODE(bref.pack(rsrq_on_all_symbols_r12_present, 1));
  HANDLE_CODE(bref.pack(crs_discovery_signals_meas_r12_present, 1));
  HANDLE_CODE(bref.pack(csi_rs_discovery_signals_meas_r12_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(timer_t312_r12_present, 1));
  HANDLE_CODE(bref.unpack(alt_time_to_trigger_r12_present, 1));
  HANDLE_CODE(bref.unpack(inc_mon_eutra_r12_present, 1));
  HANDLE_CODE(bref.unpack(inc_mon_utra_r12_present, 1));
  HANDLE_CODE(bref.unpack(extended_max_meas_id_r12_present, 1));
  HANDLE_CODE(bref.unpack(extended_rsrq_lower_range_r12_present, 1));
  HANDLE_CODE(bref.unpack(rsrq_on_all_symbols_r12_present, 1));
  HANDLE_CODE(bref.unpack(crs_discovery_signals_meas_r12_present, 1));
  HANDLE_CODE(bref.unpack(csi_rs_discovery_signals_meas_r12_present, 1));

  return SRSASN_SUCCESS;
}
void meas_params_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (timer_t312_r12_present) {
    j.write_str("timerT312-r12", "supported");
  }
  if (alt_time_to_trigger_r12_present) {
    j.write_str("alternativeTimeToTrigger-r12", "supported");
  }
  if (inc_mon_eutra_r12_present) {
    j.write_str("incMonEUTRA-r12", "supported");
  }
  if (inc_mon_utra_r12_present) {
    j.write_str("incMonUTRA-r12", "supported");
  }
  if (extended_max_meas_id_r12_present) {
    j.write_str("extendedMaxMeasId-r12", "supported");
  }
  if (extended_rsrq_lower_range_r12_present) {
    j.write_str("extendedRSRQ-LowerRange-r12", "supported");
  }
  if (rsrq_on_all_symbols_r12_present) {
    j.write_str("rsrq-OnAllSymbols-r12", "supported");
  }
  if (crs_discovery_signals_meas_r12_present) {
    j.write_str("crs-DiscoverySignalsMeas-r12", "supported");
  }
  if (csi_rs_discovery_signals_meas_r12_present) {
    j.write_str("csi-RS-DiscoverySignalsMeas-r12", "supported");
  }
  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
{
  HANDLE_CODE(bref.pack(rf_params_v1270_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (rf_params_v1270_present) {
    HANDLE_CODE(rf_params_v1270.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1270_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rf_params_v1270_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (rf_params_v1270_present) {
    HANDLE_CODE(rf_params_v1270.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1270_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rf_params_v1270_present) {
    j.write_fieldname("rf-Parameters-v1270");
    rf_params_v1270.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// DC-Parameters-r12 ::= SEQUENCE
SRSASN_CODE dc_params_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(drb_type_split_r12_present, 1));
  HANDLE_CODE(bref.pack(drb_type_scg_r12_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE dc_params_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(drb_type_split_r12_present, 1));
  HANDLE_CODE(bref.unpack(drb_type_scg_r12_present, 1));

  return SRSASN_SUCCESS;
}
void dc_params_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (drb_type_split_r12_present) {
    j.write_str("drb-TypeSplit-r12", "supported");
  }
  if (drb_type_scg_r12_present) {
    j.write_str("drb-TypeSCG-r12", "supported");
  }
  j.end_obj();
}

// MAC-Parameters-r12 ::= SEQUENCE
SRSASN_CODE mac_params_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(lc_ch_sr_prohibit_timer_r12_present, 1));
  HANDLE_CODE(bref.pack(long_drx_cmd_r12_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mac_params_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(lc_ch_sr_prohibit_timer_r12_present, 1));
  HANDLE_CODE(bref.unpack(long_drx_cmd_r12_present, 1));

  return SRSASN_SUCCESS;
}
void mac_params_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (lc_ch_sr_prohibit_timer_r12_present) {
    j.write_str("logicalChannelSR-ProhibitTimer-r12", "supported");
  }
  if (long_drx_cmd_r12_present) {
    j.write_str("longDRX-Command-r12", "supported");
  }
  j.end_obj();
}

// MBMS-Parameters-v1250 ::= SEQUENCE
SRSASN_CODE mbms_params_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mbms_async_dc_r12_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_params_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mbms_async_dc_r12_present, 1));

  return SRSASN_SUCCESS;
}
void mbms_params_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mbms_async_dc_r12_present) {
    j.write_str("mbms-AsyncDC-r12", "supported");
  }
  j.end_obj();
}

// RLC-Parameters-r12 ::= SEQUENCE
SRSASN_CODE rlc_params_r12_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE rlc_params_r12_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void rlc_params_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("extended-RLC-LI-Field-r12", "supported");
  j.end_obj();
}

// UE-BasedNetwPerfMeasParameters-v1250 ::= SEQUENCE
SRSASN_CODE ue_based_netw_perf_meas_params_v1250_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_based_netw_perf_meas_params_v1250_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void ue_based_netw_perf_meas_params_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("loggedMBSFNMeasurements-r12", "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();
}

// 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
{
  HANDLE_CODE(bref.pack(ue_category_dl_v1260_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ue_category_dl_v1260_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_dl_v1260, (uint8_t)15u, (uint8_t)16u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1260_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_category_dl_v1260_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_category_dl_v1260_present) {
    HANDLE_CODE(unpack_integer(ue_category_dl_v1260, bref, (uint8_t)15u, (uint8_t)16u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1260_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_category_dl_v1260_present) {
    j.write_int("ue-CategoryDL-v1260", ue_category_dl_v1260);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UE-EUTRA-CapabilityAddXDD-Mode-v1250 ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(phy_layer_params_v1250_present, 1));
  HANDLE_CODE(bref.pack(meas_params_v1250_present, 1));

  if (phy_layer_params_v1250_present) {
    HANDLE_CODE(phy_layer_params_v1250.pack(bref));
  }
  if (meas_params_v1250_present) {
    HANDLE_CODE(meas_params_v1250.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phy_layer_params_v1250_present, 1));
  HANDLE_CODE(bref.unpack(meas_params_v1250_present, 1));

  if (phy_layer_params_v1250_present) {
    HANDLE_CODE(phy_layer_params_v1250.unpack(bref));
  }
  if (meas_params_v1250_present) {
    HANDLE_CODE(meas_params_v1250.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_add_xdd_mode_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1250_present) {
    j.write_fieldname("phyLayerParameters-v1250");
    phy_layer_params_v1250.to_json(j);
  }
  if (meas_params_v1250_present) {
    j.write_fieldname("measParameters-v1250");
    meas_params_v1250.to_json(j);
  }
  j.end_obj();
}

// WLAN-IW-Parameters-r12 ::= SEQUENCE
SRSASN_CODE wlan_iw_params_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(wlan_iw_ran_rules_r12_present, 1));
  HANDLE_CODE(bref.pack(wlan_iw_andsf_policies_r12_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE wlan_iw_params_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(wlan_iw_ran_rules_r12_present, 1));
  HANDLE_CODE(bref.unpack(wlan_iw_andsf_policies_r12_present, 1));

  return SRSASN_SUCCESS;
}
void wlan_iw_params_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (wlan_iw_ran_rules_r12_present) {
    j.write_str("wlan-IW-RAN-Rules-r12", "supported");
  }
  if (wlan_iw_andsf_policies_r12_present) {
    j.write_str("wlan-IW-ANDSF-Policies-r12", "supported");
  }
  j.end_obj();
}

// MBMS-Parameters-r11 ::= SEQUENCE
SRSASN_CODE mbms_params_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mbms_scell_r11_present, 1));
  HANDLE_CODE(bref.pack(mbms_non_serving_cell_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mbms_params_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mbms_scell_r11_present, 1));
  HANDLE_CODE(bref.unpack(mbms_non_serving_cell_r11_present, 1));

  return SRSASN_SUCCESS;
}
void mbms_params_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mbms_scell_r11_present) {
    j.write_str("mbms-SCell-r11", "supported");
  }
  if (mbms_non_serving_cell_r11_present) {
    j.write_str("mbms-NonServingCell-r11", "supported");
  }
  j.end_obj();
}

// MeasParameters-v11a0 ::= SEQUENCE
SRSASN_CODE meas_params_v11a0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(benefits_from_interruption_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_v11a0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(benefits_from_interruption_r11_present, 1));

  return SRSASN_SUCCESS;
}
void meas_params_v11a0_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (benefits_from_interruption_r11_present) {
    j.write_str("benefitsFromInterruption-r11", "true");
  }
  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-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 (meas_params_v1250_present) {
    HANDLE_CODE(meas_params_v1250.pack(bref));
  }
  if (dc_params_r12_present) {
    HANDLE_CODE(dc_params_r12.pack(bref));
  }
  if (mbms_params_v1250_present) {
    HANDLE_CODE(mbms_params_v1250.pack(bref));
  }
  if (mac_params_r12_present) {
    HANDLE_CODE(mac_params_r12.pack(bref));
  }
  if (fdd_add_ue_eutra_cap_v1250_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1250.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1250_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1250.pack(bref));
  }
  if (sl_params_r12_present) {
    HANDLE_CODE(sl_params_r12.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phy_layer_params_v1250_present, 1));
  HANDLE_CODE(bref.unpack(rf_params_v1250_present, 1));
  HANDLE_CODE(bref.unpack(rlc_params_r12_present, 1));
  HANDLE_CODE(bref.unpack(ue_based_netw_perf_meas_params_v1250_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_dl_r12_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_ul_r12_present, 1));
  HANDLE_CODE(bref.unpack(wlan_iw_params_r12_present, 1));
  HANDLE_CODE(bref.unpack(meas_params_v1250_present, 1));
  HANDLE_CODE(bref.unpack(dc_params_r12_present, 1));
  HANDLE_CODE(bref.unpack(mbms_params_v1250_present, 1));
  HANDLE_CODE(bref.unpack(mac_params_r12_present, 1));
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1250_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1250_present, 1));
  HANDLE_CODE(bref.unpack(sl_params_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (phy_layer_params_v1250_present) {
    HANDLE_CODE(phy_layer_params_v1250.unpack(bref));
  }
  if (rf_params_v1250_present) {
    HANDLE_CODE(rf_params_v1250.unpack(bref));
  }
  if (rlc_params_r12_present) {
    HANDLE_CODE(rlc_params_r12.unpack(bref));
  }
  if (ue_based_netw_perf_meas_params_v1250_present) {
    HANDLE_CODE(ue_based_netw_perf_meas_params_v1250.unpack(bref));
  }
  if (ue_category_dl_r12_present) {
    HANDLE_CODE(unpack_integer(ue_category_dl_r12, bref, (uint8_t)0u, (uint8_t)14u));
  }
  if (ue_category_ul_r12_present) {
    HANDLE_CODE(unpack_integer(ue_category_ul_r12, bref, (uint8_t)0u, (uint8_t)13u));
  }
  if (wlan_iw_params_r12_present) {
    HANDLE_CODE(wlan_iw_params_r12.unpack(bref));
  }
  if (meas_params_v1250_present) {
    HANDLE_CODE(meas_params_v1250.unpack(bref));
  }
  if (dc_params_r12_present) {
    HANDLE_CODE(dc_params_r12.unpack(bref));
  }
  if (mbms_params_v1250_present) {
    HANDLE_CODE(mbms_params_v1250.unpack(bref));
  }
  if (mac_params_r12_present) {
    HANDLE_CODE(mac_params_r12.unpack(bref));
  }
  if (fdd_add_ue_eutra_cap_v1250_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1250.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1250_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1250.unpack(bref));
  }
  if (sl_params_r12_present) {
    HANDLE_CODE(sl_params_r12.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1250_present) {
    j.write_fieldname("phyLayerParameters-v1250");
    phy_layer_params_v1250.to_json(j);
  }
  if (rf_params_v1250_present) {
    j.write_fieldname("rf-Parameters-v1250");
    rf_params_v1250.to_json(j);
  }
  if (rlc_params_r12_present) {
    j.write_fieldname("rlc-Parameters-r12");
    rlc_params_r12.to_json(j);
  }
  if (ue_based_netw_perf_meas_params_v1250_present) {
    j.write_fieldname("ue-BasedNetwPerfMeasParameters-v1250");
    ue_based_netw_perf_meas_params_v1250.to_json(j);
  }
  if (ue_category_dl_r12_present) {
    j.write_int("ue-CategoryDL-r12", ue_category_dl_r12);
  }
  if (ue_category_ul_r12_present) {
    j.write_int("ue-CategoryUL-r12", ue_category_ul_r12);
  }
  if (wlan_iw_params_r12_present) {
    j.write_fieldname("wlan-IW-Parameters-r12");
    wlan_iw_params_r12.to_json(j);
  }
  if (meas_params_v1250_present) {
    j.write_fieldname("measParameters-v1250");
    meas_params_v1250.to_json(j);
  }
  if (dc_params_r12_present) {
    j.write_fieldname("dc-Parameters-r12");
    dc_params_r12.to_json(j);
  }
  if (mbms_params_v1250_present) {
    j.write_fieldname("mbms-Parameters-v1250");
    mbms_params_v1250.to_json(j);
  }
  if (mac_params_r12_present) {
    j.write_fieldname("mac-Parameters-r12");
    mac_params_r12.to_json(j);
  }
  if (fdd_add_ue_eutra_cap_v1250_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1250");
    fdd_add_ue_eutra_cap_v1250.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1250_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1250");
    tdd_add_ue_eutra_cap_v1250.to_json(j);
  }
  if (sl_params_r12_present) {
    j.write_fieldname("sl-Parameters-r12");
    sl_params_r12.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  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
{
  HANDLE_CODE(bref.pack(ue_category_v11a0_present, 1));
  HANDLE_CODE(bref.pack(meas_params_v11a0_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ue_category_v11a0_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_v11a0, (uint8_t)11u, (uint8_t)12u));
  }
  if (meas_params_v11a0_present) {
    HANDLE_CODE(meas_params_v11a0.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v11a0_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_category_v11a0_present, 1));
  HANDLE_CODE(bref.unpack(meas_params_v11a0_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_category_v11a0_present) {
    HANDLE_CODE(unpack_integer(ue_category_v11a0, bref, (uint8_t)11u, (uint8_t)12u));
  }
  if (meas_params_v11a0_present) {
    HANDLE_CODE(meas_params_v11a0.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v11a0_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_category_v11a0_present) {
    j.write_int("ue-Category-v11a0", ue_category_v11a0);
  }
  if (meas_params_v11a0_present) {
    j.write_fieldname("measParameters-v11a0");
    meas_params_v11a0.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-v1180 ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1180_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(mbms_params_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1180_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(mbms_params_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_add_xdd_mode_v1180_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("mbms-Parameters-r11");
  mbms_params_r11.to_json(j);
  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
{
  HANDLE_CODE(bref.pack(rsrq_meas_wideband_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_params_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rsrq_meas_wideband_r11_present, 1));

  return SRSASN_SUCCESS;
}
void meas_params_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rsrq_meas_wideband_r11_present) {
    j.write_str("rsrqMeasWideband-r11", "supported");
  }
  j.end_obj();
}

// Other-Parameters-r11 ::= SEQUENCE
SRSASN_CODE other_params_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(in_dev_coex_ind_r11_present, 1));
  HANDLE_CODE(bref.pack(pwr_pref_ind_r11_present, 1));
  HANDLE_CODE(bref.pack(ue_rx_tx_time_diff_meass_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE other_params_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(in_dev_coex_ind_r11_present, 1));
  HANDLE_CODE(bref.unpack(pwr_pref_ind_r11_present, 1));
  HANDLE_CODE(bref.unpack(ue_rx_tx_time_diff_meass_r11_present, 1));

  return SRSASN_SUCCESS;
}
void other_params_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (in_dev_coex_ind_r11_present) {
    j.write_str("inDeviceCoexInd-r11", "supported");
  }
  if (pwr_pref_ind_r11_present) {
    j.write_str("powerPrefInd-r11", "supported");
  }
  if (ue_rx_tx_time_diff_meass_r11_present) {
    j.write_str("ue-Rx-TxTimeDiffMeasurements-r11", "supported");
  }
  j.end_obj();
}

// PhyLayerParameters-v1130 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(crs_interf_handl_r11_present, 1));
  HANDLE_CODE(bref.pack(epdcch_r11_present, 1));
  HANDLE_CODE(bref.pack(multi_ack_csi_report_r11_present, 1));
  HANDLE_CODE(bref.pack(ss_cch_interf_handl_r11_present, 1));
  HANDLE_CODE(bref.pack(tdd_special_sf_r11_present, 1));
  HANDLE_CODE(bref.pack(tx_div_pucch1b_ch_select_r11_present, 1));
  HANDLE_CODE(bref.pack(ul_co_mp_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(crs_interf_handl_r11_present, 1));
  HANDLE_CODE(bref.unpack(epdcch_r11_present, 1));
  HANDLE_CODE(bref.unpack(multi_ack_csi_report_r11_present, 1));
  HANDLE_CODE(bref.unpack(ss_cch_interf_handl_r11_present, 1));
  HANDLE_CODE(bref.unpack(tdd_special_sf_r11_present, 1));
  HANDLE_CODE(bref.unpack(tx_div_pucch1b_ch_select_r11_present, 1));
  HANDLE_CODE(bref.unpack(ul_co_mp_r11_present, 1));

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (crs_interf_handl_r11_present) {
    j.write_str("crs-InterfHandl-r11", "supported");
  }
  if (epdcch_r11_present) {
    j.write_str("ePDCCH-r11", "supported");
  }
  if (multi_ack_csi_report_r11_present) {
    j.write_str("multiACK-CSI-Reporting-r11", "supported");
  }
  if (ss_cch_interf_handl_r11_present) {
    j.write_str("ss-CCH-InterfHandl-r11", "supported");
  }
  if (tdd_special_sf_r11_present) {
    j.write_str("tdd-SpecialSubframe-r11", "supported");
  }
  if (tx_div_pucch1b_ch_select_r11_present) {
    j.write_str("txDiv-PUCCH1b-ChSelect-r11", "supported");
  }
  if (ul_co_mp_r11_present) {
    j.write_str("ul-CoMP-r11", "supported");
  }
  j.end_obj();
}

// PhyLayerParameters-v1170 ::= SEQUENCE
SRSASN_CODE phy_layer_params_v1170_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(inter_band_tdd_ca_with_different_cfg_r11_present, 1));

  if (inter_band_tdd_ca_with_different_cfg_r11_present) {
    HANDLE_CODE(inter_band_tdd_ca_with_different_cfg_r11.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE phy_layer_params_v1170_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(inter_band_tdd_ca_with_different_cfg_r11_present, 1));

  if (inter_band_tdd_ca_with_different_cfg_r11_present) {
    HANDLE_CODE(inter_band_tdd_ca_with_different_cfg_r11.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void phy_layer_params_v1170_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (inter_band_tdd_ca_with_different_cfg_r11_present) {
    j.write_str("interBandTDD-CA-WithDifferentConfig-r11", inter_band_tdd_ca_with_different_cfg_r11.to_string());
  }
  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
{
  HANDLE_CODE(bref.pack(rf_params_v1180_present, 1));
  HANDLE_CODE(bref.pack(mbms_params_r11_present, 1));
  HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1180_present, 1));
  HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1180_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (rf_params_v1180_present) {
    HANDLE_CODE(rf_params_v1180.pack(bref));
  }
  if (mbms_params_r11_present) {
    HANDLE_CODE(mbms_params_r11.pack(bref));
  }
  if (fdd_add_ue_eutra_cap_v1180_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1180.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1180_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1180.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1180_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rf_params_v1180_present, 1));
  HANDLE_CODE(bref.unpack(mbms_params_r11_present, 1));
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1180_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1180_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (rf_params_v1180_present) {
    HANDLE_CODE(rf_params_v1180.unpack(bref));
  }
  if (mbms_params_r11_present) {
    HANDLE_CODE(mbms_params_r11.unpack(bref));
  }
  if (fdd_add_ue_eutra_cap_v1180_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1180.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1180_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1180.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1180_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rf_params_v1180_present) {
    j.write_fieldname("rf-Parameters-v1180");
    rf_params_v1180.to_json(j);
  }
  if (mbms_params_r11_present) {
    j.write_fieldname("mbms-Parameters-r11");
    mbms_params_r11.to_json(j);
  }
  if (fdd_add_ue_eutra_cap_v1180_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1180");
    fdd_add_ue_eutra_cap_v1180.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1180_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1180");
    tdd_add_ue_eutra_cap_v1180.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// IRAT-ParametersCDMA2000-v1130 ::= SEQUENCE
SRSASN_CODE irat_params_cdma2000_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(cdma2000_nw_sharing_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_cdma2000_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(cdma2000_nw_sharing_r11_present, 1));

  return SRSASN_SUCCESS;
}
void irat_params_cdma2000_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (cdma2000_nw_sharing_r11_present) {
    j.write_str("cdma2000-NW-Sharing-r11", "supported");
  }
  j.end_obj();
}

// PDCP-Parameters-v1130 ::= SEQUENCE
SRSASN_CODE pdcp_params_v1130_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(pdcp_sn_ext_r11_present, 1));
  HANDLE_CODE(bref.pack(support_rohc_context_continue_r11_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE pdcp_params_v1130_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(pdcp_sn_ext_r11_present, 1));
  HANDLE_CODE(bref.unpack(support_rohc_context_continue_r11_present, 1));

  return SRSASN_SUCCESS;
}
void pdcp_params_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (pdcp_sn_ext_r11_present) {
    j.write_str("pdcp-SN-Extension-r11", "supported");
  }
  if (support_rohc_context_continue_r11_present) {
    j.write_str("supportRohcContextContinue-r11", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1170-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1170_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(phy_layer_params_v1170_present, 1));
  HANDLE_CODE(bref.pack(ue_category_v1170_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (phy_layer_params_v1170_present) {
    HANDLE_CODE(phy_layer_params_v1170.pack(bref));
  }
  if (ue_category_v1170_present) {
    HANDLE_CODE(pack_integer(bref, ue_category_v1170, (uint8_t)9u, (uint8_t)10u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1170_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phy_layer_params_v1170_present, 1));
  HANDLE_CODE(bref.unpack(ue_category_v1170_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (phy_layer_params_v1170_present) {
    HANDLE_CODE(phy_layer_params_v1170.unpack(bref));
  }
  if (ue_category_v1170_present) {
    HANDLE_CODE(unpack_integer(ue_category_v1170, bref, (uint8_t)9u, (uint8_t)10u));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1170_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1170_present) {
    j.write_fieldname("phyLayerParameters-v1170");
    phy_layer_params_v1170.to_json(j);
  }
  if (ue_category_v1170_present) {
    j.write_int("ue-Category-v1170", ue_category_v1170);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  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
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(phy_layer_params_v1130_present, 1));
  HANDLE_CODE(bref.pack(meas_params_v1130_present, 1));
  HANDLE_CODE(bref.pack(other_params_r11_present, 1));

  if (phy_layer_params_v1130_present) {
    HANDLE_CODE(phy_layer_params_v1130.pack(bref));
  }
  if (meas_params_v1130_present) {
    HANDLE_CODE(meas_params_v1130.pack(bref));
  }
  if (other_params_r11_present) {
    HANDLE_CODE(other_params_r11.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1130_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(phy_layer_params_v1130_present, 1));
  HANDLE_CODE(bref.unpack(meas_params_v1130_present, 1));
  HANDLE_CODE(bref.unpack(other_params_r11_present, 1));

  if (phy_layer_params_v1130_present) {
    HANDLE_CODE(phy_layer_params_v1130.unpack(bref));
  }
  if (meas_params_v1130_present) {
    HANDLE_CODE(meas_params_v1130.unpack(bref));
  }
  if (other_params_r11_present) {
    HANDLE_CODE(other_params_r11.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_add_xdd_mode_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1130_present) {
    j.write_fieldname("phyLayerParameters-v1130");
    phy_layer_params_v1130.to_json(j);
  }
  if (meas_params_v1130_present) {
    j.write_fieldname("measParameters-v1130");
    meas_params_v1130.to_json(j);
  }
  if (other_params_r11_present) {
    j.write_fieldname("otherParameters-r11");
    other_params_r11.to_json(j);
  }
  j.end_obj();
}

// IRAT-ParametersCDMA2000-1XRTT-v1020 ::= SEQUENCE
SRSASN_CODE irat_params_cdma2000_minus1_xrtt_v1020_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_cdma2000_minus1_xrtt_v1020_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void irat_params_cdma2000_minus1_xrtt_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("e-CSFB-dual-1XRTT-r10", "supported");
  j.end_obj();
}

// IRAT-ParametersUTRA-TDD-v1020 ::= SEQUENCE
SRSASN_CODE irat_params_utra_tdd_v1020_s::pack(bit_ref& bref) const
{
  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_utra_tdd_v1020_s::unpack(cbit_ref& bref)
{
  return SRSASN_SUCCESS;
}
void irat_params_utra_tdd_v1020_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("e-RedirectionUTRA-TDD-r10", "supported");
  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-v1130-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(phy_layer_params_v1130_present, 1));
  HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1130_present, 1));
  HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1130_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pdcp_params_v1130.pack(bref));
  if (phy_layer_params_v1130_present) {
    HANDLE_CODE(phy_layer_params_v1130.pack(bref));
  }
  HANDLE_CODE(rf_params_v1130.pack(bref));
  HANDLE_CODE(meas_params_v1130.pack(bref));
  HANDLE_CODE(inter_rat_params_cdma2000_v1130.pack(bref));
  HANDLE_CODE(other_params_r11.pack(bref));
  if (fdd_add_ue_eutra_cap_v1130_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1130.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1130_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1130.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(phy_layer_params_v1130_present, 1));
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1130_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1130_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(pdcp_params_v1130.unpack(bref));
  if (phy_layer_params_v1130_present) {
    HANDLE_CODE(phy_layer_params_v1130.unpack(bref));
  }
  HANDLE_CODE(rf_params_v1130.unpack(bref));
  HANDLE_CODE(meas_params_v1130.unpack(bref));
  HANDLE_CODE(inter_rat_params_cdma2000_v1130.unpack(bref));
  HANDLE_CODE(other_params_r11.unpack(bref));
  if (fdd_add_ue_eutra_cap_v1130_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1130.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1130_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1130.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("pdcp-Parameters-v1130");
  pdcp_params_v1130.to_json(j);
  if (phy_layer_params_v1130_present) {
    j.write_fieldname("phyLayerParameters-v1130");
    phy_layer_params_v1130.to_json(j);
  }
  j.write_fieldname("rf-Parameters-v1130");
  rf_params_v1130.to_json(j);
  j.write_fieldname("measParameters-v1130");
  meas_params_v1130.to_json(j);
  j.write_fieldname("interRAT-ParametersCDMA2000-v1130");
  inter_rat_params_cdma2000_v1130.to_json(j);
  j.write_fieldname("otherParameters-r11");
  other_params_r11.to_json(j);
  if (fdd_add_ue_eutra_cap_v1130_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1130");
    fdd_add_ue_eutra_cap_v1130.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1130_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1130");
    tdd_add_ue_eutra_cap_v1130.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  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
{
  HANDLE_CODE(bref.pack(rf_params_v1090_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (rf_params_v1090_present) {
    HANDLE_CODE(rf_params_v1090.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1090_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rf_params_v1090_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (rf_params_v1090_present) {
    HANDLE_CODE(rf_params_v1090.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1090_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rf_params_v1090_present) {
    j.write_fieldname("rf-Parameters-v1090");
    rf_params_v1090.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  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
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(phy_layer_params_v1060_present, 1));
  HANDLE_CODE(bref.pack(feature_group_ind_rel10_v1060_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params_cdma2000_v1060_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params_utra_tdd_v1060_present, 1));

  if (phy_layer_params_v1060_present) {
    HANDLE_CODE(phy_layer_params_v1060.pack(bref));
  }
  if (feature_group_ind_rel10_v1060_present) {
    HANDLE_CODE(feature_group_ind_rel10_v1060.pack(bref));
  }
  if (inter_rat_params_cdma2000_v1060_present) {
    HANDLE_CODE(inter_rat_params_cdma2000_v1060.pack(bref));
  }
  if (inter_rat_params_utra_tdd_v1060_present) {
    HANDLE_CODE(inter_rat_params_utra_tdd_v1060.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= otdoa_positioning_cap_r10.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(otdoa_positioning_cap_r10.is_present(), 1));
      if (otdoa_positioning_cap_r10.is_present()) {
        HANDLE_CODE(otdoa_positioning_cap_r10->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_add_xdd_mode_v1060_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(phy_layer_params_v1060_present, 1));
  HANDLE_CODE(bref.unpack(feature_group_ind_rel10_v1060_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params_cdma2000_v1060_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params_utra_tdd_v1060_present, 1));

  if (phy_layer_params_v1060_present) {
    HANDLE_CODE(phy_layer_params_v1060.unpack(bref));
  }
  if (feature_group_ind_rel10_v1060_present) {
    HANDLE_CODE(feature_group_ind_rel10_v1060.unpack(bref));
  }
  if (inter_rat_params_cdma2000_v1060_present) {
    HANDLE_CODE(inter_rat_params_cdma2000_v1060.unpack(bref));
  }
  if (inter_rat_params_utra_tdd_v1060_present) {
    HANDLE_CODE(inter_rat_params_utra_tdd_v1060.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 otdoa_positioning_cap_r10_present;
      HANDLE_CODE(bref.unpack(otdoa_positioning_cap_r10_present, 1));
      otdoa_positioning_cap_r10.set_present(otdoa_positioning_cap_r10_present);
      if (otdoa_positioning_cap_r10.is_present()) {
        HANDLE_CODE(otdoa_positioning_cap_r10->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void ue_eutra_cap_add_xdd_mode_v1060_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (phy_layer_params_v1060_present) {
    j.write_fieldname("phyLayerParameters-v1060");
    phy_layer_params_v1060.to_json(j);
  }
  if (feature_group_ind_rel10_v1060_present) {
    j.write_str("featureGroupIndRel10-v1060", feature_group_ind_rel10_v1060.to_string());
  }
  if (inter_rat_params_cdma2000_v1060_present) {
    j.write_fieldname("interRAT-ParametersCDMA2000-v1060");
    inter_rat_params_cdma2000_v1060.to_json(j);
  }
  if (inter_rat_params_utra_tdd_v1060_present) {
    j.write_fieldname("interRAT-ParametersUTRA-TDD-v1060");
    inter_rat_params_utra_tdd_v1060.to_json(j);
  }
  if (ext) {
    if (otdoa_positioning_cap_r10.is_present()) {
      j.write_fieldname("otdoa-PositioningCapabilities-r10");
      otdoa_positioning_cap_r10->to_json(j);
    }
  }
  j.end_obj();
}

// UE-BasedNetwPerfMeasParameters-r10 ::= SEQUENCE
SRSASN_CODE ue_based_netw_perf_meas_params_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(logged_meass_idle_r10_present, 1));
  HANDLE_CODE(bref.pack(standalone_gnss_location_r10_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_based_netw_perf_meas_params_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(logged_meass_idle_r10_present, 1));
  HANDLE_CODE(bref.unpack(standalone_gnss_location_r10_present, 1));

  return SRSASN_SUCCESS;
}
void ue_based_netw_perf_meas_params_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (logged_meass_idle_r10_present) {
    j.write_str("loggedMeasurementsIdle-r10", "supported");
  }
  if (standalone_gnss_location_r10_present) {
    j.write_str("standaloneGNSS-Location-r10", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v1060-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v1060_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(fdd_add_ue_eutra_cap_v1060_present, 1));
  HANDLE_CODE(bref.pack(tdd_add_ue_eutra_cap_v1060_present, 1));
  HANDLE_CODE(bref.pack(rf_params_v1060_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (fdd_add_ue_eutra_cap_v1060_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1060.pack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1060_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1060.pack(bref));
  }
  if (rf_params_v1060_present) {
    HANDLE_CODE(rf_params_v1060.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1060_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(fdd_add_ue_eutra_cap_v1060_present, 1));
  HANDLE_CODE(bref.unpack(tdd_add_ue_eutra_cap_v1060_present, 1));
  HANDLE_CODE(bref.unpack(rf_params_v1060_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (fdd_add_ue_eutra_cap_v1060_present) {
    HANDLE_CODE(fdd_add_ue_eutra_cap_v1060.unpack(bref));
  }
  if (tdd_add_ue_eutra_cap_v1060_present) {
    HANDLE_CODE(tdd_add_ue_eutra_cap_v1060.unpack(bref));
  }
  if (rf_params_v1060_present) {
    HANDLE_CODE(rf_params_v1060.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1060_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (fdd_add_ue_eutra_cap_v1060_present) {
    j.write_fieldname("fdd-Add-UE-EUTRA-Capabilities-v1060");
    fdd_add_ue_eutra_cap_v1060.to_json(j);
  }
  if (tdd_add_ue_eutra_cap_v1060_present) {
    j.write_fieldname("tdd-Add-UE-EUTRA-Capabilities-v1060");
    tdd_add_ue_eutra_cap_v1060.to_json(j);
  }
  if (rf_params_v1060_present) {
    j.write_fieldname("rf-Parameters-v1060");
    rf_params_v1060.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-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 (phy_layer_params_v1020_present) {
    HANDLE_CODE(phy_layer_params_v1020.pack(bref));
  }
  if (rf_params_v1020_present) {
    HANDLE_CODE(rf_params_v1020.pack(bref));
  }
  if (meas_params_v1020_present) {
    HANDLE_CODE(meas_params_v1020.pack(bref));
  }
  if (feature_group_ind_rel10_r10_present) {
    HANDLE_CODE(feature_group_ind_rel10_r10.pack(bref));
  }
  if (inter_rat_params_cdma2000_v1020_present) {
    HANDLE_CODE(inter_rat_params_cdma2000_v1020.pack(bref));
  }
  if (ue_based_netw_perf_meas_params_r10_present) {
    HANDLE_CODE(ue_based_netw_perf_meas_params_r10.pack(bref));
  }
  if (inter_rat_params_utra_tdd_v1020_present) {
    HANDLE_CODE(inter_rat_params_utra_tdd_v1020.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v1020_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_category_v1020_present, 1));
  HANDLE_CODE(bref.unpack(phy_layer_params_v1020_present, 1));
  HANDLE_CODE(bref.unpack(rf_params_v1020_present, 1));
  HANDLE_CODE(bref.unpack(meas_params_v1020_present, 1));
  HANDLE_CODE(bref.unpack(feature_group_ind_rel10_r10_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params_cdma2000_v1020_present, 1));
  HANDLE_CODE(bref.unpack(ue_based_netw_perf_meas_params_r10_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params_utra_tdd_v1020_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_category_v1020_present) {
    HANDLE_CODE(unpack_integer(ue_category_v1020, bref, (uint8_t)6u, (uint8_t)8u));
  }
  if (phy_layer_params_v1020_present) {
    HANDLE_CODE(phy_layer_params_v1020.unpack(bref));
  }
  if (rf_params_v1020_present) {
    HANDLE_CODE(rf_params_v1020.unpack(bref));
  }
  if (meas_params_v1020_present) {
    HANDLE_CODE(meas_params_v1020.unpack(bref));
  }
  if (feature_group_ind_rel10_r10_present) {
    HANDLE_CODE(feature_group_ind_rel10_r10.unpack(bref));
  }
  if (inter_rat_params_cdma2000_v1020_present) {
    HANDLE_CODE(inter_rat_params_cdma2000_v1020.unpack(bref));
  }
  if (ue_based_netw_perf_meas_params_r10_present) {
    HANDLE_CODE(ue_based_netw_perf_meas_params_r10.unpack(bref));
  }
  if (inter_rat_params_utra_tdd_v1020_present) {
    HANDLE_CODE(inter_rat_params_utra_tdd_v1020.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v1020_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_category_v1020_present) {
    j.write_int("ue-Category-v1020", ue_category_v1020);
  }
  if (phy_layer_params_v1020_present) {
    j.write_fieldname("phyLayerParameters-v1020");
    phy_layer_params_v1020.to_json(j);
  }
  if (rf_params_v1020_present) {
    j.write_fieldname("rf-Parameters-v1020");
    rf_params_v1020.to_json(j);
  }
  if (meas_params_v1020_present) {
    j.write_fieldname("measParameters-v1020");
    meas_params_v1020.to_json(j);
  }
  if (feature_group_ind_rel10_r10_present) {
    j.write_str("featureGroupIndRel10-r10", feature_group_ind_rel10_r10.to_string());
  }
  if (inter_rat_params_cdma2000_v1020_present) {
    j.write_fieldname("interRAT-ParametersCDMA2000-v1020");
    inter_rat_params_cdma2000_v1020.to_json(j);
  }
  if (ue_based_netw_perf_meas_params_r10_present) {
    j.write_fieldname("ue-BasedNetwPerfMeasParameters-r10");
    ue_based_netw_perf_meas_params_r10.to_json(j);
  }
  if (inter_rat_params_utra_tdd_v1020_present) {
    j.write_fieldname("interRAT-ParametersUTRA-TDD-v1020");
    inter_rat_params_utra_tdd_v1020.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.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();
}

// CSG-ProximityIndicationParameters-r9 ::= SEQUENCE
SRSASN_CODE csg_proximity_ind_params_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(intra_freq_proximity_ind_r9_present, 1));
  HANDLE_CODE(bref.pack(inter_freq_proximity_ind_r9_present, 1));
  HANDLE_CODE(bref.pack(utran_proximity_ind_r9_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE csg_proximity_ind_params_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(intra_freq_proximity_ind_r9_present, 1));
  HANDLE_CODE(bref.unpack(inter_freq_proximity_ind_r9_present, 1));
  HANDLE_CODE(bref.unpack(utran_proximity_ind_r9_present, 1));

  return SRSASN_SUCCESS;
}
void csg_proximity_ind_params_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (intra_freq_proximity_ind_r9_present) {
    j.write_str("intraFreqProximityIndication-r9", "supported");
  }
  if (inter_freq_proximity_ind_r9_present) {
    j.write_str("interFreqProximityIndication-r9", "supported");
  }
  if (utran_proximity_ind_r9_present) {
    j.write_str("utran-ProximityIndication-r9", "supported");
  }
  j.end_obj();
}

// IRAT-ParametersGERAN-v920 ::= SEQUENCE
SRSASN_CODE irat_params_geran_v920_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(dtm_r9_present, 1));
  HANDLE_CODE(bref.pack(e_redirection_geran_r9_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE irat_params_geran_v920_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(dtm_r9_present, 1));
  HANDLE_CODE(bref.unpack(e_redirection_geran_r9_present, 1));

  return SRSASN_SUCCESS;
}
void irat_params_geran_v920_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (dtm_r9_present) {
    j.write_str("dtm-r9", "supported");
  }
  if (e_redirection_geran_r9_present) {
    j.write_str("e-RedirectionGERAN-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) {
    j.write_str("enhancedDualLayerTDD-r9", "supported");
  }
  j.end_obj();
}

// SON-Parameters-r9 ::= SEQUENCE
SRSASN_CODE son_params_r9_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rach_report_r9_present, 1));

  return SRSASN_SUCCESS;
}
SRSASN_CODE son_params_r9_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rach_report_r9_present, 1));

  return SRSASN_SUCCESS;
}
void son_params_r9_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rach_report_r9_present) {
    j.write_str("rach-Report-r9", "supported");
  }
  j.end_obj();
}

// UE-EUTRA-Capability-v940-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v940_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_v940_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_v940_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-v920-IEs ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_v920_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(inter_rat_params_utra_v920_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params_cdma2000_v920_present, 1));
  HANDLE_CODE(bref.pack(dev_type_r9_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(phy_layer_params_v920.pack(bref));
  HANDLE_CODE(inter_rat_params_geran_v920.pack(bref));
  if (inter_rat_params_utra_v920_present) {
    HANDLE_CODE(inter_rat_params_utra_v920.pack(bref));
  }
  if (inter_rat_params_cdma2000_v920_present) {
    HANDLE_CODE(inter_rat_params_cdma2000_v920.pack(bref));
  }
  HANDLE_CODE(csg_proximity_ind_params_r9.pack(bref));
  HANDLE_CODE(neigh_cell_si_acquisition_params_r9.pack(bref));
  HANDLE_CODE(son_params_r9.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_v920_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(inter_rat_params_utra_v920_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params_cdma2000_v920_present, 1));
  HANDLE_CODE(bref.unpack(dev_type_r9_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(phy_layer_params_v920.unpack(bref));
  HANDLE_CODE(inter_rat_params_geran_v920.unpack(bref));
  if (inter_rat_params_utra_v920_present) {
    HANDLE_CODE(inter_rat_params_utra_v920.unpack(bref));
  }
  if (inter_rat_params_cdma2000_v920_present) {
    HANDLE_CODE(inter_rat_params_cdma2000_v920.unpack(bref));
  }
  HANDLE_CODE(csg_proximity_ind_params_r9.unpack(bref));
  HANDLE_CODE(neigh_cell_si_acquisition_params_r9.unpack(bref));
  HANDLE_CODE(son_params_r9.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_v920_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("phyLayerParameters-v920");
  phy_layer_params_v920.to_json(j);
  j.write_fieldname("interRAT-ParametersGERAN-v920");
  inter_rat_params_geran_v920.to_json(j);
  if (inter_rat_params_utra_v920_present) {
    j.write_fieldname("interRAT-ParametersUTRA-v920");
    inter_rat_params_utra_v920.to_json(j);
  }
  if (inter_rat_params_cdma2000_v920_present) {
    j.write_fieldname("interRAT-ParametersCDMA2000-v920");
    inter_rat_params_cdma2000_v920.to_json(j);
  }
  if (dev_type_r9_present) {
    j.write_str("deviceType-r9", "noBenFromBatConsumpOpt");
  }
  j.write_fieldname("csg-ProximityIndicationParameters-r9");
  csg_proximity_ind_params_r9.to_json(j);
  j.write_fieldname("neighCellSI-AcquisitionParameters-r9");
  neigh_cell_si_acquisition_params_r9.to_json(j);
  j.write_fieldname("son-Parameters-r9");
  son_params_r9.to_json(j);
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UE-EUTRA-Capability ::= SEQUENCE
SRSASN_CODE ue_eutra_cap_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(feature_group_inds_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(access_stratum_release.pack(bref));
  HANDLE_CODE(pack_integer(bref, ue_category, (uint8_t)1u, (uint8_t)5u));
  HANDLE_CODE(pdcp_params.pack(bref));
  HANDLE_CODE(phy_layer_params.pack(bref));
  HANDLE_CODE(rf_params.pack(bref));
  HANDLE_CODE(meas_params.pack(bref));
  if (feature_group_inds_present) {
    HANDLE_CODE(feature_group_inds.pack(bref));
  }
  HANDLE_CODE(bref.pack(inter_rat_params.utra_fdd_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params.utra_tdd128_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params.utra_tdd384_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params.utra_tdd768_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params.geran_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params.cdma2000_hrpd_present, 1));
  HANDLE_CODE(bref.pack(inter_rat_params.cdma2000_minus1x_rtt_present, 1));
  if (inter_rat_params.utra_fdd_present) {
    HANDLE_CODE(inter_rat_params.utra_fdd.pack(bref));
  }
  if (inter_rat_params.utra_tdd128_present) {
    HANDLE_CODE(inter_rat_params.utra_tdd128.pack(bref));
  }
  if (inter_rat_params.utra_tdd384_present) {
    HANDLE_CODE(inter_rat_params.utra_tdd384.pack(bref));
  }
  if (inter_rat_params.utra_tdd768_present) {
    HANDLE_CODE(inter_rat_params.utra_tdd768.pack(bref));
  }
  if (inter_rat_params.geran_present) {
    HANDLE_CODE(inter_rat_params.geran.pack(bref));
  }
  if (inter_rat_params.cdma2000_hrpd_present) {
    HANDLE_CODE(inter_rat_params.cdma2000_hrpd.pack(bref));
  }
  if (inter_rat_params.cdma2000_minus1x_rtt_present) {
    HANDLE_CODE(inter_rat_params.cdma2000_minus1x_rtt.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_eutra_cap_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(feature_group_inds_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(access_stratum_release.unpack(bref));
  HANDLE_CODE(unpack_integer(ue_category, bref, (uint8_t)1u, (uint8_t)5u));
  HANDLE_CODE(pdcp_params.unpack(bref));
  HANDLE_CODE(phy_layer_params.unpack(bref));
  HANDLE_CODE(rf_params.unpack(bref));
  HANDLE_CODE(meas_params.unpack(bref));
  if (feature_group_inds_present) {
    HANDLE_CODE(feature_group_inds.unpack(bref));
  }
  HANDLE_CODE(bref.unpack(inter_rat_params.utra_fdd_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params.utra_tdd128_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params.utra_tdd384_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params.utra_tdd768_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params.geran_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params.cdma2000_hrpd_present, 1));
  HANDLE_CODE(bref.unpack(inter_rat_params.cdma2000_minus1x_rtt_present, 1));
  if (inter_rat_params.utra_fdd_present) {
    HANDLE_CODE(inter_rat_params.utra_fdd.unpack(bref));
  }
  if (inter_rat_params.utra_tdd128_present) {
    HANDLE_CODE(inter_rat_params.utra_tdd128.unpack(bref));
  }
  if (inter_rat_params.utra_tdd384_present) {
    HANDLE_CODE(inter_rat_params.utra_tdd384.unpack(bref));
  }
  if (inter_rat_params.utra_tdd768_present) {
    HANDLE_CODE(inter_rat_params.utra_tdd768.unpack(bref));
  }
  if (inter_rat_params.geran_present) {
    HANDLE_CODE(inter_rat_params.geran.unpack(bref));
  }
  if (inter_rat_params.cdma2000_hrpd_present) {
    HANDLE_CODE(inter_rat_params.cdma2000_hrpd.unpack(bref));
  }
  if (inter_rat_params.cdma2000_minus1x_rtt_present) {
    HANDLE_CODE(inter_rat_params.cdma2000_minus1x_rtt.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_eutra_cap_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("accessStratumRelease", access_stratum_release.to_string());
  j.write_int("ue-Category", ue_category);
  j.write_fieldname("pdcp-Parameters");
  pdcp_params.to_json(j);
  j.write_fieldname("phyLayerParameters");
  phy_layer_params.to_json(j);
  j.write_fieldname("rf-Parameters");
  rf_params.to_json(j);
  j.write_fieldname("measParameters");
  meas_params.to_json(j);
  if (feature_group_inds_present) {
    j.write_str("featureGroupIndicators", feature_group_inds.to_string());
  }
  j.write_fieldname("interRAT-Parameters");
  j.start_obj();
  if (inter_rat_params.utra_fdd_present) {
    j.write_fieldname("utraFDD");
    inter_rat_params.utra_fdd.to_json(j);
  }
  if (inter_rat_params.utra_tdd128_present) {
    j.write_fieldname("utraTDD128");
    inter_rat_params.utra_tdd128.to_json(j);
  }
  if (inter_rat_params.utra_tdd384_present) {
    j.write_fieldname("utraTDD384");
    inter_rat_params.utra_tdd384.to_json(j);
  }
  if (inter_rat_params.utra_tdd768_present) {
    j.write_fieldname("utraTDD768");
    inter_rat_params.utra_tdd768.to_json(j);
  }
  if (inter_rat_params.geran_present) {
    j.write_fieldname("geran");
    inter_rat_params.geran.to_json(j);
  }
  if (inter_rat_params.cdma2000_hrpd_present) {
    j.write_fieldname("cdma2000-HRPD");
    inter_rat_params.cdma2000_hrpd.to_json(j);
  }
  if (inter_rat_params.cdma2000_minus1x_rtt_present) {
    j.write_fieldname("cdma2000-1xRTT");
    inter_rat_params.cdma2000_minus1x_rtt.to_json(j);
  }
  j.end_obj();
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SCG-Config-r12-IEs ::= SEQUENCE
SRSASN_CODE scg_cfg_r12_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(scg_radio_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (scg_radio_cfg_r12_present) {
    HANDLE_CODE(scg_radio_cfg_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_r12_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(scg_radio_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (scg_radio_cfg_r12_present) {
    HANDLE_CODE(scg_radio_cfg_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scg_cfg_r12_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (scg_radio_cfg_r12_present) {
    j.write_fieldname("scg-RadioConfig-r12");
    scg_radio_cfg_r12.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// AS-ConfigNR-r15 ::= SEQUENCE
SRSASN_CODE as_cfg_nr_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(source_rb_cfg_nr_r15_present, 1));
  HANDLE_CODE(bref.pack(source_rb_cfg_sn_nr_r15_present, 1));
  HANDLE_CODE(bref.pack(source_other_cfg_sn_nr_r15_present, 1));

  if (source_rb_cfg_nr_r15_present) {
    HANDLE_CODE(source_rb_cfg_nr_r15.pack(bref));
  }
  if (source_rb_cfg_sn_nr_r15_present) {
    HANDLE_CODE(source_rb_cfg_sn_nr_r15.pack(bref));
  }
  if (source_other_cfg_sn_nr_r15_present) {
    HANDLE_CODE(source_other_cfg_sn_nr_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE as_cfg_nr_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(source_rb_cfg_nr_r15_present, 1));
  HANDLE_CODE(bref.unpack(source_rb_cfg_sn_nr_r15_present, 1));
  HANDLE_CODE(bref.unpack(source_other_cfg_sn_nr_r15_present, 1));

  if (source_rb_cfg_nr_r15_present) {
    HANDLE_CODE(source_rb_cfg_nr_r15.unpack(bref));
  }
  if (source_rb_cfg_sn_nr_r15_present) {
    HANDLE_CODE(source_rb_cfg_sn_nr_r15.unpack(bref));
  }
  if (source_other_cfg_sn_nr_r15_present) {
    HANDLE_CODE(source_other_cfg_sn_nr_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void as_cfg_nr_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (source_rb_cfg_nr_r15_present) {
    j.write_str("sourceRB-ConfigNR-r15", source_rb_cfg_nr_r15.to_string());
  }
  if (source_rb_cfg_sn_nr_r15_present) {
    j.write_str("sourceRB-ConfigSN-NR-r15", source_rb_cfg_sn_nr_r15.to_string());
  }
  if (source_other_cfg_sn_nr_r15_present) {
    j.write_str("sourceOtherConfigSN-NR-r15", source_other_cfg_sn_nr_r15.to_string());
  }
  j.end_obj();
}

// SCG-Config-r12 ::= SEQUENCE
SRSASN_CODE scg_cfg_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void scg_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void scg_cfg_r12_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_r12_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void scg_cfg_r12_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void scg_cfg_r12_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::scg_cfg_r12:
      j.write_fieldname("scg-Config-r12");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE scg_cfg_r12_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::scg_cfg_r12:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_r12_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::scg_cfg_r12:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_r12_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// AS-Config ::= SEQUENCE
SRSASN_CODE as_cfg_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(source_meas_cfg.pack(bref));
  HANDLE_CODE(source_rr_cfg.pack(bref));
  HANDLE_CODE(source_security_algorithm_cfg.pack(bref));
  HANDLE_CODE(source_ue_id.pack(bref));
  HANDLE_CODE(source_mib.pack(bref));
  HANDLE_CODE(source_sib_type1.pack(bref));
  HANDLE_CODE(source_sib_type2.pack(bref));
  HANDLE_CODE(ant_info_common.pack(bref));
  HANDLE_CODE(pack_integer(bref, source_dl_carrier_freq, (uint32_t)0u, (uint32_t)65535u));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= source_sib_type1_ext_present;
    group_flags[0] |= source_other_cfg_r9.is_present();
    group_flags[1] |= source_scell_cfg_list_r10.is_present();
    group_flags[2] |= source_cfg_scg_r12.is_present();
    group_flags[3] |= as_cfg_nr_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(source_sib_type1_ext_present, 1));
      if (source_sib_type1_ext_present) {
        HANDLE_CODE(source_sib_type1_ext.pack(bref));
      }
      HANDLE_CODE(source_other_cfg_r9->pack(bref));
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(source_scell_cfg_list_r10.is_present(), 1));
      if (source_scell_cfg_list_r10.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *source_scell_cfg_list_r10, 1, 4));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(source_cfg_scg_r12.is_present(), 1));
      if (source_cfg_scg_r12.is_present()) {
        HANDLE_CODE(source_cfg_scg_r12->pack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(as_cfg_nr_r15.is_present(), 1));
      if (as_cfg_nr_r15.is_present()) {
        HANDLE_CODE(as_cfg_nr_r15->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE as_cfg_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(source_meas_cfg.unpack(bref));
  HANDLE_CODE(source_rr_cfg.unpack(bref));
  HANDLE_CODE(source_security_algorithm_cfg.unpack(bref));
  HANDLE_CODE(source_ue_id.unpack(bref));
  HANDLE_CODE(source_mib.unpack(bref));
  HANDLE_CODE(source_sib_type1.unpack(bref));
  HANDLE_CODE(source_sib_type2.unpack(bref));
  HANDLE_CODE(ant_info_common.unpack(bref));
  HANDLE_CODE(unpack_integer(source_dl_carrier_freq, bref, (uint32_t)0u, (uint32_t)65535u));

  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(source_sib_type1_ext_present, 1));
      if (source_sib_type1_ext_present) {
        HANDLE_CODE(source_sib_type1_ext.unpack(bref));
      }
      HANDLE_CODE(source_other_cfg_r9->unpack(bref));
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool source_scell_cfg_list_r10_present;
      HANDLE_CODE(bref.unpack(source_scell_cfg_list_r10_present, 1));
      source_scell_cfg_list_r10.set_present(source_scell_cfg_list_r10_present);
      if (source_scell_cfg_list_r10.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*source_scell_cfg_list_r10, bref, 1, 4));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool source_cfg_scg_r12_present;
      HANDLE_CODE(bref.unpack(source_cfg_scg_r12_present, 1));
      source_cfg_scg_r12.set_present(source_cfg_scg_r12_present);
      if (source_cfg_scg_r12.is_present()) {
        HANDLE_CODE(source_cfg_scg_r12->unpack(bref));
      }
    }
    if (group_flags[3]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool as_cfg_nr_r15_present;
      HANDLE_CODE(bref.unpack(as_cfg_nr_r15_present, 1));
      as_cfg_nr_r15.set_present(as_cfg_nr_r15_present);
      if (as_cfg_nr_r15.is_present()) {
        HANDLE_CODE(as_cfg_nr_r15->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void as_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("sourceMeasConfig");
  source_meas_cfg.to_json(j);
  j.write_fieldname("sourceRadioResourceConfig");
  source_rr_cfg.to_json(j);
  j.write_fieldname("sourceSecurityAlgorithmConfig");
  source_security_algorithm_cfg.to_json(j);
  j.write_str("sourceUE-Identity", source_ue_id.to_string());
  j.write_fieldname("sourceMasterInformationBlock");
  source_mib.to_json(j);
  j.write_fieldname("sourceSystemInformationBlockType1");
  source_sib_type1.to_json(j);
  j.write_fieldname("sourceSystemInformationBlockType2");
  source_sib_type2.to_json(j);
  j.write_fieldname("antennaInfoCommon");
  ant_info_common.to_json(j);
  j.write_int("sourceDl-CarrierFreq", source_dl_carrier_freq);
  if (ext) {
    if (source_sib_type1_ext_present) {
      j.write_str("sourceSystemInformationBlockType1Ext", source_sib_type1_ext.to_string());
    }
    j.write_fieldname("sourceOtherConfig-r9");
    source_other_cfg_r9->to_json(j);
    if (source_scell_cfg_list_r10.is_present()) {
      j.start_array("sourceSCellConfigList-r10");
      for (const auto& e1 : *source_scell_cfg_list_r10) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (source_cfg_scg_r12.is_present()) {
      j.write_fieldname("sourceConfigSCG-r12");
      source_cfg_scg_r12->to_json(j);
    }
    if (as_cfg_nr_r15.is_present()) {
      j.write_fieldname("as-ConfigNR-r15");
      as_cfg_nr_r15->to_json(j);
    }
  }
  j.end_obj();
}

// AS-Config-v10j0 ::= SEQUENCE
SRSASN_CODE as_cfg_v10j0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ant_info_ded_pcell_v10i0_present, 1));

  if (ant_info_ded_pcell_v10i0_present) {
    HANDLE_CODE(ant_info_ded_pcell_v10i0.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE as_cfg_v10j0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ant_info_ded_pcell_v10i0_present, 1));

  if (ant_info_ded_pcell_v10i0_present) {
    HANDLE_CODE(ant_info_ded_pcell_v10i0.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void as_cfg_v10j0_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);
  }
  j.end_obj();
}

// AS-Config-v1250 ::= SEQUENCE
SRSASN_CODE as_cfg_v1250_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(source_wlan_offload_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(source_sl_comm_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(source_sl_disc_cfg_r12_present, 1));

  if (source_wlan_offload_cfg_r12_present) {
    HANDLE_CODE(source_wlan_offload_cfg_r12.pack(bref));
  }
  if (source_sl_comm_cfg_r12_present) {
    HANDLE_CODE(source_sl_comm_cfg_r12.pack(bref));
  }
  if (source_sl_disc_cfg_r12_present) {
    HANDLE_CODE(source_sl_disc_cfg_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE as_cfg_v1250_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(source_wlan_offload_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(source_sl_comm_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(source_sl_disc_cfg_r12_present, 1));

  if (source_wlan_offload_cfg_r12_present) {
    HANDLE_CODE(source_wlan_offload_cfg_r12.unpack(bref));
  }
  if (source_sl_comm_cfg_r12_present) {
    HANDLE_CODE(source_sl_comm_cfg_r12.unpack(bref));
  }
  if (source_sl_disc_cfg_r12_present) {
    HANDLE_CODE(source_sl_disc_cfg_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void as_cfg_v1250_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (source_wlan_offload_cfg_r12_present) {
    j.write_fieldname("sourceWlan-OffloadConfig-r12");
    source_wlan_offload_cfg_r12.to_json(j);
  }
  if (source_sl_comm_cfg_r12_present) {
    j.write_fieldname("sourceSL-CommConfig-r12");
    source_sl_comm_cfg_r12.to_json(j);
  }
  if (source_sl_disc_cfg_r12_present) {
    j.write_fieldname("sourceSL-DiscConfig-r12");
    source_sl_disc_cfg_r12.to_json(j);
  }
  j.end_obj();
}

// AS-Config-v1320 ::= SEQUENCE
SRSASN_CODE as_cfg_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(source_scell_cfg_list_r13_present, 1));
  HANDLE_CODE(bref.pack(source_rclwi_cfg_r13_present, 1));

  if (source_scell_cfg_list_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, source_scell_cfg_list_r13, 1, 31));
  }
  if (source_rclwi_cfg_r13_present) {
    HANDLE_CODE(source_rclwi_cfg_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE as_cfg_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(source_scell_cfg_list_r13_present, 1));
  HANDLE_CODE(bref.unpack(source_rclwi_cfg_r13_present, 1));

  if (source_scell_cfg_list_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(source_scell_cfg_list_r13, bref, 1, 31));
  }
  if (source_rclwi_cfg_r13_present) {
    HANDLE_CODE(source_rclwi_cfg_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void as_cfg_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (source_scell_cfg_list_r13_present) {
    j.start_array("sourceSCellConfigList-r13");
    for (const auto& e1 : source_scell_cfg_list_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (source_rclwi_cfg_r13_present) {
    j.write_fieldname("sourceRCLWI-Configuration-r13");
    source_rclwi_cfg_r13.to_json(j);
  }
  j.end_obj();
}

// AS-Config-v1430 ::= SEQUENCE
SRSASN_CODE as_cfg_v1430_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(source_sl_v2x_comm_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(source_lwa_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(source_wlan_meas_result_r14_present, 1));

  if (source_sl_v2x_comm_cfg_r14_present) {
    HANDLE_CODE(source_sl_v2x_comm_cfg_r14.pack(bref));
  }
  if (source_lwa_cfg_r14_present) {
    HANDLE_CODE(source_lwa_cfg_r14.pack(bref));
  }
  if (source_wlan_meas_result_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, source_wlan_meas_result_r14, 1, 8));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE as_cfg_v1430_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(source_sl_v2x_comm_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(source_lwa_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(source_wlan_meas_result_r14_present, 1));

  if (source_sl_v2x_comm_cfg_r14_present) {
    HANDLE_CODE(source_sl_v2x_comm_cfg_r14.unpack(bref));
  }
  if (source_lwa_cfg_r14_present) {
    HANDLE_CODE(source_lwa_cfg_r14.unpack(bref));
  }
  if (source_wlan_meas_result_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(source_wlan_meas_result_r14, bref, 1, 8));
  }

  return SRSASN_SUCCESS;
}
void as_cfg_v1430_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (source_sl_v2x_comm_cfg_r14_present) {
    j.write_fieldname("sourceSL-V2X-CommConfig-r14");
    source_sl_v2x_comm_cfg_r14.to_json(j);
  }
  if (source_lwa_cfg_r14_present) {
    j.write_fieldname("sourceLWA-Config-r14");
    source_lwa_cfg_r14.to_json(j);
  }
  if (source_wlan_meas_result_r14_present) {
    j.start_array("sourceWLAN-MeasResult-r14");
    for (const auto& e1 : source_wlan_meas_result_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// AS-Config-v9e0 ::= SEQUENCE
SRSASN_CODE as_cfg_v9e0_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, source_dl_carrier_freq_v9e0, (uint32_t)65536u, (uint32_t)262143u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE as_cfg_v9e0_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(source_dl_carrier_freq_v9e0, bref, (uint32_t)65536u, (uint32_t)262143u));

  return SRSASN_SUCCESS;
}
void as_cfg_v9e0_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sourceDl-CarrierFreq-v9e0", source_dl_carrier_freq_v9e0);
  j.end_obj();
}

// AdditionalReestabInfo ::= SEQUENCE
SRSASN_CODE add_reestab_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cell_id.pack(bref));
  HANDLE_CODE(key_e_node_b_star.pack(bref));
  HANDLE_CODE(short_mac_i.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE add_reestab_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(cell_id.unpack(bref));
  HANDLE_CODE(key_e_node_b_star.unpack(bref));
  HANDLE_CODE(short_mac_i.unpack(bref));

  return SRSASN_SUCCESS;
}
void add_reestab_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cellIdentity", cell_id.to_string());
  j.write_str("key-eNodeB-Star", key_e_node_b_star.to_string());
  j.write_str("shortMAC-I", short_mac_i.to_string());
  j.end_obj();
}

// ReestablishmentInfo ::= SEQUENCE
SRSASN_CODE reest_info_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(add_reestab_info_list_present, 1));

  HANDLE_CODE(pack_integer(bref, source_pci, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(target_cell_short_mac_i.pack(bref));
  if (add_reestab_info_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, add_reestab_info_list, 1, 32));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE reest_info_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(add_reestab_info_list_present, 1));

  HANDLE_CODE(unpack_integer(source_pci, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(target_cell_short_mac_i.unpack(bref));
  if (add_reestab_info_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(add_reestab_info_list, bref, 1, 32));
  }

  return SRSASN_SUCCESS;
}
void reest_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sourcePhysCellId", source_pci);
  j.write_str("targetCellShortMAC-I", target_cell_short_mac_i.to_string());
  if (add_reestab_info_list_present) {
    j.start_array("additionalReestabInfoList");
    for (const auto& e1 : add_reestab_info_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// AS-Context ::= SEQUENCE
SRSASN_CODE as_context_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(reest_info_present, 1));

  if (reest_info_present) {
    HANDLE_CODE(reest_info.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE as_context_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(reest_info_present, 1));

  if (reest_info_present) {
    HANDLE_CODE(reest_info.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void as_context_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (reest_info_present) {
    j.write_fieldname("reestablishmentInfo");
    reest_info.to_json(j);
  }
  j.end_obj();
}

// AS-Context-v1130 ::= SEQUENCE
SRSASN_CODE as_context_v1130_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(idc_ind_r11_present, 1));
  HANDLE_CODE(bref.pack(mbms_interest_ind_r11_present, 1));
  HANDLE_CODE(bref.pack(pwr_pref_ind_r11_present, 1));

  if (idc_ind_r11_present) {
    HANDLE_CODE(idc_ind_r11.pack(bref));
  }
  if (mbms_interest_ind_r11_present) {
    HANDLE_CODE(mbms_interest_ind_r11.pack(bref));
  }
  if (pwr_pref_ind_r11_present) {
    HANDLE_CODE(pwr_pref_ind_r11.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= sidelink_ue_info_r12_present;
    group_flags[1] |= source_context_en_dc_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sidelink_ue_info_r12_present, 1));
      if (sidelink_ue_info_r12_present) {
        HANDLE_CODE(sidelink_ue_info_r12.pack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(source_context_en_dc_r15_present, 1));
      if (source_context_en_dc_r15_present) {
        HANDLE_CODE(source_context_en_dc_r15.pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE as_context_v1130_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(idc_ind_r11_present, 1));
  HANDLE_CODE(bref.unpack(mbms_interest_ind_r11_present, 1));
  HANDLE_CODE(bref.unpack(pwr_pref_ind_r11_present, 1));

  if (idc_ind_r11_present) {
    HANDLE_CODE(idc_ind_r11.unpack(bref));
  }
  if (mbms_interest_ind_r11_present) {
    HANDLE_CODE(mbms_interest_ind_r11.unpack(bref));
  }
  if (pwr_pref_ind_r11_present) {
    HANDLE_CODE(pwr_pref_ind_r11.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(sidelink_ue_info_r12_present, 1));
      if (sidelink_ue_info_r12_present) {
        HANDLE_CODE(sidelink_ue_info_r12.unpack(bref));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(source_context_en_dc_r15_present, 1));
      if (source_context_en_dc_r15_present) {
        HANDLE_CODE(source_context_en_dc_r15.unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void as_context_v1130_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (idc_ind_r11_present) {
    j.write_str("idc-Indication-r11", idc_ind_r11.to_string());
  }
  if (mbms_interest_ind_r11_present) {
    j.write_str("mbmsInterestIndication-r11", mbms_interest_ind_r11.to_string());
  }
  if (pwr_pref_ind_r11_present) {
    j.write_str("powerPrefIndication-r11", pwr_pref_ind_r11.to_string());
  }
  if (ext) {
    if (sidelink_ue_info_r12_present) {
      j.write_str("sidelinkUEInformation-r12", sidelink_ue_info_r12.to_string());
    }
    if (source_context_en_dc_r15_present) {
      j.write_str("sourceContextEN-DC-r15", source_context_en_dc_r15.to_string());
    }
  }
  j.end_obj();
}

// AS-Context-v1320 ::= SEQUENCE
SRSASN_CODE as_context_v1320_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(wlan_conn_status_report_r13_present, 1));

  if (wlan_conn_status_report_r13_present) {
    HANDLE_CODE(wlan_conn_status_report_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE as_context_v1320_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(wlan_conn_status_report_r13_present, 1));

  if (wlan_conn_status_report_r13_present) {
    HANDLE_CODE(wlan_conn_status_report_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void as_context_v1320_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (wlan_conn_status_report_r13_present) {
    j.write_str("wlanConnectionStatusReport-r13", wlan_conn_status_report_r13.to_string());
  }
  j.end_obj();
}

// CandidateCellInfo-r10 ::= SEQUENCE
SRSASN_CODE candidate_cell_info_r10_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rsrp_result_r10_present, 1));
  HANDLE_CODE(bref.pack(rsrq_result_r10_present, 1));

  HANDLE_CODE(pack_integer(bref, pci_r10, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(pack_integer(bref, dl_carrier_freq_r10, (uint32_t)0u, (uint32_t)65535u));
  if (rsrp_result_r10_present) {
    HANDLE_CODE(pack_integer(bref, rsrp_result_r10, (uint8_t)0u, (uint8_t)97u));
  }
  if (rsrq_result_r10_present) {
    HANDLE_CODE(pack_integer(bref, rsrq_result_r10, (uint8_t)0u, (uint8_t)34u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= dl_carrier_freq_v1090_present;
    group_flags[1] |= rsrq_result_v1250_present;
    group_flags[2] |= rs_sinr_result_r13_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(dl_carrier_freq_v1090_present, 1));
      if (dl_carrier_freq_v1090_present) {
        HANDLE_CODE(pack_integer(bref, dl_carrier_freq_v1090, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rsrq_result_v1250_present, 1));
      if (rsrq_result_v1250_present) {
        HANDLE_CODE(pack_integer(bref, rsrq_result_v1250, (int8_t)-30, (int8_t)46));
      }
    }
    if (group_flags[2]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(rs_sinr_result_r13_present, 1));
      if (rs_sinr_result_r13_present) {
        HANDLE_CODE(pack_integer(bref, rs_sinr_result_r13, (uint8_t)0u, (uint8_t)127u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE candidate_cell_info_r10_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rsrp_result_r10_present, 1));
  HANDLE_CODE(bref.unpack(rsrq_result_r10_present, 1));

  HANDLE_CODE(unpack_integer(pci_r10, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(unpack_integer(dl_carrier_freq_r10, bref, (uint32_t)0u, (uint32_t)65535u));
  if (rsrp_result_r10_present) {
    HANDLE_CODE(unpack_integer(rsrp_result_r10, bref, (uint8_t)0u, (uint8_t)97u));
  }
  if (rsrq_result_r10_present) {
    HANDLE_CODE(unpack_integer(rsrq_result_r10, bref, (uint8_t)0u, (uint8_t)34u));
  }

  if (ext) {
    ext_groups_unpacker_guard group_flags(3);
    group_flags.unpack(bref);

    if (group_flags[0]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(dl_carrier_freq_v1090_present, 1));
      if (dl_carrier_freq_v1090_present) {
        HANDLE_CODE(unpack_integer(dl_carrier_freq_v1090, bref, (uint32_t)65536u, (uint32_t)262143u));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(rsrq_result_v1250_present, 1));
      if (rsrq_result_v1250_present) {
        HANDLE_CODE(unpack_integer(rsrq_result_v1250, bref, (int8_t)-30, (int8_t)46));
      }
    }
    if (group_flags[2]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.unpack(rs_sinr_result_r13_present, 1));
      if (rs_sinr_result_r13_present) {
        HANDLE_CODE(unpack_integer(rs_sinr_result_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void candidate_cell_info_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("physCellId-r10", pci_r10);
  j.write_int("dl-CarrierFreq-r10", dl_carrier_freq_r10);
  if (rsrp_result_r10_present) {
    j.write_int("rsrpResult-r10", rsrp_result_r10);
  }
  if (rsrq_result_r10_present) {
    j.write_int("rsrqResult-r10", rsrq_result_r10);
  }
  if (ext) {
    if (dl_carrier_freq_v1090_present) {
      j.write_int("dl-CarrierFreq-v1090", dl_carrier_freq_v1090);
    }
    if (rsrq_result_v1250_present) {
      j.write_int("rsrqResult-v1250", rsrq_result_v1250);
    }
    if (rs_sinr_result_r13_present) {
      j.write_int("rs-sinr-Result-r13", rs_sinr_result_r13);
    }
  }
  j.end_obj();
}

// Cell-ToAddMod-r12 ::= SEQUENCE
SRSASN_CODE cell_to_add_mod_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(cell_identif_r12_present, 1));
  HANDLE_CODE(bref.pack(meas_result_cell_to_add_r12_present, 1));

  HANDLE_CODE(pack_integer(bref, scell_idx_r12, (uint8_t)1u, (uint8_t)7u));
  if (cell_identif_r12_present) {
    HANDLE_CODE(pack_integer(bref, cell_identif_r12.pci_r12, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(pack_integer(bref, cell_identif_r12.dl_carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u));
  }
  if (meas_result_cell_to_add_r12_present) {
    HANDLE_CODE(pack_integer(bref, meas_result_cell_to_add_r12.rsrp_result_r12, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(pack_integer(bref, meas_result_cell_to_add_r12.rsrq_result_r12, (uint8_t)0u, (uint8_t)34u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= scell_idx_r13_present;
    group_flags[0] |= meas_result_cell_to_add_v1310.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(scell_idx_r13_present, 1));
      HANDLE_CODE(bref.pack(meas_result_cell_to_add_v1310.is_present(), 1));
      if (scell_idx_r13_present) {
        HANDLE_CODE(pack_integer(bref, scell_idx_r13, (uint8_t)1u, (uint8_t)31u));
      }
      if (meas_result_cell_to_add_v1310.is_present()) {
        HANDLE_CODE(pack_integer(bref, meas_result_cell_to_add_v1310->rs_sinr_result_r13, (uint8_t)0u, (uint8_t)127u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cell_to_add_mod_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(cell_identif_r12_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_cell_to_add_r12_present, 1));

  HANDLE_CODE(unpack_integer(scell_idx_r12, bref, (uint8_t)1u, (uint8_t)7u));
  if (cell_identif_r12_present) {
    HANDLE_CODE(unpack_integer(cell_identif_r12.pci_r12, bref, (uint16_t)0u, (uint16_t)503u));
    HANDLE_CODE(unpack_integer(cell_identif_r12.dl_carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));
  }
  if (meas_result_cell_to_add_r12_present) {
    HANDLE_CODE(unpack_integer(meas_result_cell_to_add_r12.rsrp_result_r12, bref, (uint8_t)0u, (uint8_t)97u));
    HANDLE_CODE(unpack_integer(meas_result_cell_to_add_r12.rsrq_result_r12, bref, (uint8_t)0u, (uint8_t)34u));
  }

  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(scell_idx_r13_present, 1));
      bool meas_result_cell_to_add_v1310_present;
      HANDLE_CODE(bref.unpack(meas_result_cell_to_add_v1310_present, 1));
      meas_result_cell_to_add_v1310.set_present(meas_result_cell_to_add_v1310_present);
      if (scell_idx_r13_present) {
        HANDLE_CODE(unpack_integer(scell_idx_r13, bref, (uint8_t)1u, (uint8_t)31u));
      }
      if (meas_result_cell_to_add_v1310.is_present()) {
        HANDLE_CODE(
            unpack_integer(meas_result_cell_to_add_v1310->rs_sinr_result_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void cell_to_add_mod_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("sCellIndex-r12", scell_idx_r12);
  if (cell_identif_r12_present) {
    j.write_fieldname("cellIdentification-r12");
    j.start_obj();
    j.write_int("physCellId-r12", cell_identif_r12.pci_r12);
    j.write_int("dl-CarrierFreq-r12", cell_identif_r12.dl_carrier_freq_r12);
    j.end_obj();
  }
  if (meas_result_cell_to_add_r12_present) {
    j.write_fieldname("measResultCellToAdd-r12");
    j.start_obj();
    j.write_int("rsrpResult-r12", meas_result_cell_to_add_r12.rsrp_result_r12);
    j.write_int("rsrqResult-r12", meas_result_cell_to_add_r12.rsrq_result_r12);
    j.end_obj();
  }
  if (ext) {
    if (scell_idx_r13_present) {
      j.write_int("sCellIndex-r13", scell_idx_r13);
    }
    if (meas_result_cell_to_add_v1310.is_present()) {
      j.write_fieldname("measResultCellToAdd-v1310");
      j.start_obj();
      j.write_int("rs-sinr-Result-r13", meas_result_cell_to_add_v1310->rs_sinr_result_r13);
      j.end_obj();
    }
  }
  j.end_obj();
}

void cells_triggered_list_item_c_::destroy_()
{
  switch (type_) {
    case types::pci_utra:
      c.destroy<pci_utra_c_>();
      break;
    case types::pci_geran:
      c.destroy<pci_geran_s_>();
      break;
    case types::wlan_ids_r13:
      c.destroy<wlan_ids_r12_s>();
      break;
    case types::pci_nr_r15:
      c.destroy<pci_nr_r15_s_>();
      break;
    default:
      break;
  }
}
void cells_triggered_list_item_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::pci_eutra:
      break;
    case types::pci_utra:
      c.init<pci_utra_c_>();
      break;
    case types::pci_geran:
      c.init<pci_geran_s_>();
      break;
    case types::pci_cdma2000:
      break;
    case types::wlan_ids_r13:
      c.init<wlan_ids_r12_s>();
      break;
    case types::pci_nr_r15:
      c.init<pci_nr_r15_s_>();
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_");
  }
}
cells_triggered_list_item_c_::cells_triggered_list_item_c_(const cells_triggered_list_item_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::pci_eutra:
      c.init(other.c.get<uint16_t>());
      break;
    case types::pci_utra:
      c.init(other.c.get<pci_utra_c_>());
      break;
    case types::pci_geran:
      c.init(other.c.get<pci_geran_s_>());
      break;
    case types::pci_cdma2000:
      c.init(other.c.get<uint16_t>());
      break;
    case types::wlan_ids_r13:
      c.init(other.c.get<wlan_ids_r12_s>());
      break;
    case types::pci_nr_r15:
      c.init(other.c.get<pci_nr_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_");
  }
}
cells_triggered_list_item_c_& cells_triggered_list_item_c_::operator=(const cells_triggered_list_item_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::pci_eutra:
      c.set(other.c.get<uint16_t>());
      break;
    case types::pci_utra:
      c.set(other.c.get<pci_utra_c_>());
      break;
    case types::pci_geran:
      c.set(other.c.get<pci_geran_s_>());
      break;
    case types::pci_cdma2000:
      c.set(other.c.get<uint16_t>());
      break;
    case types::wlan_ids_r13:
      c.set(other.c.get<wlan_ids_r12_s>());
      break;
    case types::pci_nr_r15:
      c.set(other.c.get<pci_nr_r15_s_>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_");
  }

  return *this;
}
void cells_triggered_list_item_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::pci_eutra:
      j.write_int("physCellIdEUTRA", c.get<uint16_t>());
      break;
    case types::pci_utra:
      j.write_fieldname("physCellIdUTRA");
      c.get<pci_utra_c_>().to_json(j);
      break;
    case types::pci_geran:
      j.write_fieldname("physCellIdGERAN");
      j.start_obj();
      j.write_fieldname("carrierFreq");
      c.get<pci_geran_s_>().carrier_freq.to_json(j);
      j.write_fieldname("physCellId");
      c.get<pci_geran_s_>().pci.to_json(j);
      j.end_obj();
      break;
    case types::pci_cdma2000:
      j.write_int("physCellIdCDMA2000", c.get<uint16_t>());
      break;
    case types::wlan_ids_r13:
      j.write_fieldname("wlan-Identifiers-r13");
      c.get<wlan_ids_r12_s>().to_json(j);
      break;
    case types::pci_nr_r15:
      j.write_fieldname("physCellIdNR-r15");
      j.start_obj();
      j.write_int("carrierFreq", c.get<pci_nr_r15_s_>().carrier_freq);
      j.write_int("physCellId", c.get<pci_nr_r15_s_>().pci);
      if (c.get<pci_nr_r15_s_>().rs_idx_list_r15_present) {
        j.start_array("rs-IndexList-r15");
        for (const auto& e1 : c.get<pci_nr_r15_s_>().rs_idx_list_r15) {
          j.write_int(e1);
        }
        j.end_array();
      }
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_");
  }
  j.end_obj();
}
SRSASN_CODE cells_triggered_list_item_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::pci_eutra:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)503u));
      break;
    case types::pci_utra:
      HANDLE_CODE(c.get<pci_utra_c_>().pack(bref));
      break;
    case types::pci_geran:
      HANDLE_CODE(c.get<pci_geran_s_>().carrier_freq.pack(bref));
      HANDLE_CODE(c.get<pci_geran_s_>().pci.pack(bref));
      break;
    case types::pci_cdma2000:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::wlan_ids_r13:
      HANDLE_CODE(c.get<wlan_ids_r12_s>().pack(bref));
      break;
    case types::pci_nr_r15:
      HANDLE_CODE(bref.pack(c.get<pci_nr_r15_s_>().rs_idx_list_r15_present, 1));
      HANDLE_CODE(pack_integer(bref, c.get<pci_nr_r15_s_>().carrier_freq, (uint32_t)0u, (uint32_t)3279165u));
      HANDLE_CODE(pack_integer(bref, c.get<pci_nr_r15_s_>().pci, (uint16_t)0u, (uint16_t)1007u));
      if (c.get<pci_nr_r15_s_>().rs_idx_list_r15_present) {
        HANDLE_CODE(
            pack_dyn_seq_of(bref, c.get<pci_nr_r15_s_>().rs_idx_list_r15, 1, 64, integer_packer<uint8_t>(0, 63)));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cells_triggered_list_item_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::pci_eutra:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)503u));
      break;
    case types::pci_utra:
      HANDLE_CODE(c.get<pci_utra_c_>().unpack(bref));
      break;
    case types::pci_geran:
      HANDLE_CODE(c.get<pci_geran_s_>().carrier_freq.unpack(bref));
      HANDLE_CODE(c.get<pci_geran_s_>().pci.unpack(bref));
      break;
    case types::pci_cdma2000:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::wlan_ids_r13:
      HANDLE_CODE(c.get<wlan_ids_r12_s>().unpack(bref));
      break;
    case types::pci_nr_r15:
      HANDLE_CODE(bref.unpack(c.get<pci_nr_r15_s_>().rs_idx_list_r15_present, 1));
      HANDLE_CODE(unpack_integer(c.get<pci_nr_r15_s_>().carrier_freq, bref, (uint32_t)0u, (uint32_t)3279165u));
      HANDLE_CODE(unpack_integer(c.get<pci_nr_r15_s_>().pci, bref, (uint16_t)0u, (uint16_t)1007u));
      if (c.get<pci_nr_r15_s_>().rs_idx_list_r15_present) {
        HANDLE_CODE(
            unpack_dyn_seq_of(c.get<pci_nr_r15_s_>().rs_idx_list_r15, bref, 1, 64, integer_packer<uint8_t>(0, 63)));
      }
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void cells_triggered_list_item_c_::pci_utra_c_::destroy_() {}
void cells_triggered_list_item_c_::pci_utra_c_::set(types::options e)
{
  destroy_();
  type_ = e;
}
cells_triggered_list_item_c_::pci_utra_c_::pci_utra_c_(const cells_triggered_list_item_c_::pci_utra_c_& other)
{
  type_ = other.type();
  switch (type_) {
    case types::fdd:
      c.init(other.c.get<uint16_t>());
      break;
    case types::tdd:
      c.init(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_::pci_utra_c_");
  }
}
cells_triggered_list_item_c_::pci_utra_c_& cells_triggered_list_item_c_::pci_utra_c_::
                                           operator=(const cells_triggered_list_item_c_::pci_utra_c_& other)
{
  if (this == &other) {
    return *this;
  }
  set(other.type());
  switch (type_) {
    case types::fdd:
      c.set(other.c.get<uint16_t>());
      break;
    case types::tdd:
      c.set(other.c.get<uint8_t>());
      break;
    case types::nulltype:
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_::pci_utra_c_");
  }

  return *this;
}
void cells_triggered_list_item_c_::pci_utra_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::fdd:
      j.write_int("fdd", c.get<uint16_t>());
      break;
    case types::tdd:
      j.write_int("tdd", c.get<uint8_t>());
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_::pci_utra_c_");
  }
  j.end_obj();
}
SRSASN_CODE cells_triggered_list_item_c_::pci_utra_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::fdd:
      HANDLE_CODE(pack_integer(bref, c.get<uint16_t>(), (uint16_t)0u, (uint16_t)511u));
      break;
    case types::tdd:
      HANDLE_CODE(pack_integer(bref, c.get<uint8_t>(), (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_::pci_utra_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE cells_triggered_list_item_c_::pci_utra_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::fdd:
      HANDLE_CODE(unpack_integer(c.get<uint16_t>(), bref, (uint16_t)0u, (uint16_t)511u));
      break;
    case types::tdd:
      HANDLE_CODE(unpack_integer(c.get<uint8_t>(), bref, (uint8_t)0u, (uint8_t)127u));
      break;
    default:
      log_invalid_choice_id(type_, "cells_triggered_list_item_c_::pci_utra_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// DRB-InfoSCG-r12 ::= SEQUENCE
SRSASN_CODE drb_info_scg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(eps_bearer_id_r12_present, 1));
  HANDLE_CODE(bref.pack(drb_type_r12_present, 1));

  if (eps_bearer_id_r12_present) {
    HANDLE_CODE(pack_integer(bref, eps_bearer_id_r12, (uint8_t)0u, (uint8_t)15u));
  }
  HANDLE_CODE(pack_integer(bref, drb_id_r12, (uint8_t)1u, (uint8_t)32u));
  if (drb_type_r12_present) {
    HANDLE_CODE(drb_type_r12.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE drb_info_scg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(eps_bearer_id_r12_present, 1));
  HANDLE_CODE(bref.unpack(drb_type_r12_present, 1));

  if (eps_bearer_id_r12_present) {
    HANDLE_CODE(unpack_integer(eps_bearer_id_r12, bref, (uint8_t)0u, (uint8_t)15u));
  }
  HANDLE_CODE(unpack_integer(drb_id_r12, bref, (uint8_t)1u, (uint8_t)32u));
  if (drb_type_r12_present) {
    HANDLE_CODE(drb_type_r12.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void drb_info_scg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (eps_bearer_id_r12_present) {
    j.write_int("eps-BearerIdentity-r12", eps_bearer_id_r12);
  }
  j.write_int("drb-Identity-r12", drb_id_r12);
  if (drb_type_r12_present) {
    j.write_str("drb-Type-r12", drb_type_r12.to_string());
  }
  j.end_obj();
}

// HandoverCommand-r8-IEs ::= SEQUENCE
SRSASN_CODE ho_cmd_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(ho_cmd_msg.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_cmd_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(ho_cmd_msg.unpack(bref));

  return SRSASN_SUCCESS;
}
void ho_cmd_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("handoverCommandMessage", ho_cmd_msg.to_string());
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// HandoverCommand ::= SEQUENCE
SRSASN_CODE ho_cmd_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_cmd_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void ho_cmd_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void ho_cmd_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      break;
    default:
      break;
  }
}
void ho_cmd_s::crit_exts_c_::set(types::options e)
{
  destroy_();
  type_ = e;
  switch (type_) {
    case types::c1:
      c.init<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_cmd_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ho_cmd_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ho_cmd_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ho_cmd_r8:
      j.write_fieldname("handoverCommand-r8");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ho_cmd_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ho_cmd_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_cmd_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ho_cmd_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ho_cmd_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// HandoverPreparationInformation-v1430-IEs ::= SEQUENCE
SRSASN_CODE ho_prep_info_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(as_cfg_v1430_present, 1));
  HANDLE_CODE(bref.pack(make_before_break_req_r14_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (as_cfg_v1430_present) {
    HANDLE_CODE(as_cfg_v1430.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(as_cfg_v1430_present, 1));
  HANDLE_CODE(bref.unpack(make_before_break_req_r14_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (as_cfg_v1430_present) {
    HANDLE_CODE(as_cfg_v1430.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_prep_info_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (as_cfg_v1430_present) {
    j.write_fieldname("as-Config-v1430");
    as_cfg_v1430.to_json(j);
  }
  if (make_before_break_req_r14_present) {
    j.write_str("makeBeforeBreakReq-r14", "true");
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// HandoverPreparationInformation-v1320-IEs ::= SEQUENCE
SRSASN_CODE ho_prep_info_v1320_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(as_cfg_v1320_present, 1));
  HANDLE_CODE(bref.pack(as_context_v1320_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (as_cfg_v1320_present) {
    HANDLE_CODE(as_cfg_v1320.pack(bref));
  }
  if (as_context_v1320_present) {
    HANDLE_CODE(as_context_v1320.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_v1320_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(as_cfg_v1320_present, 1));
  HANDLE_CODE(bref.unpack(as_context_v1320_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (as_cfg_v1320_present) {
    HANDLE_CODE(as_cfg_v1320.unpack(bref));
  }
  if (as_context_v1320_present) {
    HANDLE_CODE(as_context_v1320.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_prep_info_v1320_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (as_cfg_v1320_present) {
    j.write_fieldname("as-Config-v1320");
    as_cfg_v1320.to_json(j);
  }
  if (as_context_v1320_present) {
    j.write_fieldname("as-Context-v1320");
    as_context_v1320.to_json(j);
  }
  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
{
  HANDLE_CODE(bref.pack(ue_supported_earfcn_r12_present, 1));
  HANDLE_CODE(bref.pack(as_cfg_v1250_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ue_supported_earfcn_r12_present) {
    HANDLE_CODE(pack_integer(bref, ue_supported_earfcn_r12, (uint32_t)0u, (uint32_t)262143u));
  }
  if (as_cfg_v1250_present) {
    HANDLE_CODE(as_cfg_v1250.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_v1250_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_supported_earfcn_r12_present, 1));
  HANDLE_CODE(bref.unpack(as_cfg_v1250_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_supported_earfcn_r12_present) {
    HANDLE_CODE(unpack_integer(ue_supported_earfcn_r12, bref, (uint32_t)0u, (uint32_t)262143u));
  }
  if (as_cfg_v1250_present) {
    HANDLE_CODE(as_cfg_v1250.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_prep_info_v1250_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_supported_earfcn_r12_present) {
    j.write_int("ue-SupportedEARFCN-r12", ue_supported_earfcn_r12);
  }
  if (as_cfg_v1250_present) {
    j.write_fieldname("as-Config-v1250");
    as_cfg_v1250.to_json(j);
  }
  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));
  }

  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));
  }

  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");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// HandoverPreparationInformation-v1130-IEs ::= SEQUENCE
SRSASN_CODE ho_prep_info_v1130_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(as_context_v1130_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (as_context_v1130_present) {
    HANDLE_CODE(as_context_v1130.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_v1130_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(as_context_v1130_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (as_context_v1130_present) {
    HANDLE_CODE(as_context_v1130.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_prep_info_v1130_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (as_context_v1130_present) {
    j.write_fieldname("as-Context-v1130");
    as_context_v1130.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// HandoverPreparationInformation-v9e0-IEs ::= SEQUENCE
SRSASN_CODE ho_prep_info_v9e0_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(as_cfg_v9e0_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (as_cfg_v9e0_present) {
    HANDLE_CODE(as_cfg_v9e0.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_v9e0_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(as_cfg_v9e0_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (as_cfg_v9e0_present) {
    HANDLE_CODE(as_cfg_v9e0.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_prep_info_v9e0_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (as_cfg_v9e0_present) {
    j.write_fieldname("as-Config-v9e0");
    as_cfg_v9e0.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();
}

// HandoverPreparationInformation-v9d0-IEs ::= SEQUENCE
SRSASN_CODE ho_prep_info_v9d0_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_v9d0_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_v9d0_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-v920-IEs ::= SEQUENCE
SRSASN_CODE ho_prep_info_v920_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ue_cfg_release_r9_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ue_cfg_release_r9_present) {
    HANDLE_CODE(ue_cfg_release_r9.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_v920_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ue_cfg_release_r9_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ue_cfg_release_r9_present) {
    HANDLE_CODE(ue_cfg_release_r9.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_prep_info_v920_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_cfg_release_r9_present) {
    j.write_str("ue-ConfigRelease-r9", ue_cfg_release_r9.to_string());
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// RRM-Config ::= SEQUENCE
SRSASN_CODE rrm_cfg_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(ue_inactive_time_present, 1));

  if (ue_inactive_time_present) {
    HANDLE_CODE(ue_inactive_time.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= candidate_cell_info_list_r10.is_present();
    group_flags[1] |= candidate_cell_info_list_nr_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(candidate_cell_info_list_r10.is_present(), 1));
      if (candidate_cell_info_list_r10.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *candidate_cell_info_list_r10, 1, 8));
      }
    }
    if (group_flags[1]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(candidate_cell_info_list_nr_r15.is_present(), 1));
      if (candidate_cell_info_list_nr_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *candidate_cell_info_list_nr_r15, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE rrm_cfg_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(ue_inactive_time_present, 1));

  if (ue_inactive_time_present) {
    HANDLE_CODE(ue_inactive_time.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 candidate_cell_info_list_r10_present;
      HANDLE_CODE(bref.unpack(candidate_cell_info_list_r10_present, 1));
      candidate_cell_info_list_r10.set_present(candidate_cell_info_list_r10_present);
      if (candidate_cell_info_list_r10.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*candidate_cell_info_list_r10, bref, 1, 8));
      }
    }
    if (group_flags[1]) {
      varlength_field_unpack_guard varlen_scope(bref, false);

      bool candidate_cell_info_list_nr_r15_present;
      HANDLE_CODE(bref.unpack(candidate_cell_info_list_nr_r15_present, 1));
      candidate_cell_info_list_nr_r15.set_present(candidate_cell_info_list_nr_r15_present);
      if (candidate_cell_info_list_nr_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*candidate_cell_info_list_nr_r15, bref, 1, 32));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void rrm_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ue_inactive_time_present) {
    j.write_str("ue-InactiveTime", ue_inactive_time.to_string());
  }
  if (ext) {
    if (candidate_cell_info_list_r10.is_present()) {
      j.start_array("candidateCellInfoList-r10");
      for (const auto& e1 : *candidate_cell_info_list_r10) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (candidate_cell_info_list_nr_r15.is_present()) {
      j.start_array("candidateCellInfoListNR-r15");
      for (const auto& e1 : *candidate_cell_info_list_nr_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// HandoverPreparationInformation-r8-IEs ::= SEQUENCE
SRSASN_CODE ho_prep_info_r8_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(as_cfg_present, 1));
  HANDLE_CODE(bref.pack(rrm_cfg_present, 1));
  HANDLE_CODE(bref.pack(as_context_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, ue_radio_access_cap_info, 0, 8));
  if (as_cfg_present) {
    HANDLE_CODE(as_cfg.pack(bref));
  }
  if (rrm_cfg_present) {
    HANDLE_CODE(rrm_cfg.pack(bref));
  }
  if (as_context_present) {
    HANDLE_CODE(as_context.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_r8_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(as_cfg_present, 1));
  HANDLE_CODE(bref.unpack(rrm_cfg_present, 1));
  HANDLE_CODE(bref.unpack(as_context_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(ue_radio_access_cap_info, bref, 0, 8));
  if (as_cfg_present) {
    HANDLE_CODE(as_cfg.unpack(bref));
  }
  if (rrm_cfg_present) {
    HANDLE_CODE(rrm_cfg.unpack(bref));
  }
  if (as_context_present) {
    HANDLE_CODE(as_context.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_prep_info_r8_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("ue-RadioAccessCapabilityInfo");
  for (const auto& e1 : ue_radio_access_cap_info) {
    e1.to_json(j);
  }
  j.end_array();
  if (as_cfg_present) {
    j.write_fieldname("as-Config");
    as_cfg.to_json(j);
  }
  if (rrm_cfg_present) {
    j.write_fieldname("rrm-Config");
    rrm_cfg.to_json(j);
  }
  if (as_context_present) {
    j.write_fieldname("as-Context");
    as_context.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// HandoverPreparationInformation ::= SEQUENCE
SRSASN_CODE ho_prep_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void ho_prep_info_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void ho_prep_info_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ho_prep_info_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ho_prep_info_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ho_prep_info_r8:
      j.write_fieldname("handoverPreparationInformation-r8");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ho_prep_info_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ho_prep_info_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ho_prep_info_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ho_prep_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// HandoverPreparationInformation-v1530-IEs ::= SEQUENCE
SRSASN_CODE ho_prep_info_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(ran_notif_area_info_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (ran_notif_area_info_r15_present) {
    HANDLE_CODE(ran_notif_area_info_r15.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ho_prep_info_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(ran_notif_area_info_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (ran_notif_area_info_r15_present) {
    HANDLE_CODE(ran_notif_area_info_r15.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ho_prep_info_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (ran_notif_area_info_r15_present) {
    j.write_fieldname("ran-NotificationAreaInfo-r15");
    ran_notif_area_info_r15.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// TDD-ConfigSL-r12 ::= SEQUENCE
SRSASN_CODE tdd_cfg_sl_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sf_assign_sl_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE tdd_cfg_sl_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sf_assign_sl_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void tdd_cfg_sl_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("subframeAssignmentSL-r12", sf_assign_sl_r12.to_string());
  j.end_obj();
}

// MasterInformationBlock-SL ::= SEQUENCE
SRSASN_CODE mib_sl_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sl_bw_r12.pack(bref));
  HANDLE_CODE(tdd_cfg_sl_r12.pack(bref));
  HANDLE_CODE(direct_frame_num_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, direct_sf_num_r12, (uint8_t)0u, (uint8_t)9u));
  HANDLE_CODE(bref.pack(in_coverage_r12, 1));
  HANDLE_CODE(reserved_r12.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mib_sl_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sl_bw_r12.unpack(bref));
  HANDLE_CODE(tdd_cfg_sl_r12.unpack(bref));
  HANDLE_CODE(direct_frame_num_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(direct_sf_num_r12, bref, (uint8_t)0u, (uint8_t)9u));
  HANDLE_CODE(bref.unpack(in_coverage_r12, 1));
  HANDLE_CODE(reserved_r12.unpack(bref));

  return SRSASN_SUCCESS;
}
void mib_sl_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sl-Bandwidth-r12", sl_bw_r12.to_string());
  j.write_fieldname("tdd-ConfigSL-r12");
  tdd_cfg_sl_r12.to_json(j);
  j.write_str("directFrameNumber-r12", direct_frame_num_r12.to_string());
  j.write_int("directSubframeNumber-r12", direct_sf_num_r12);
  j.write_bool("inCoverage-r12", in_coverage_r12);
  j.write_str("reserved-r12", reserved_r12.to_string());
  j.end_obj();
}

// MasterInformationBlock-SL-V2X-r14 ::= SEQUENCE
SRSASN_CODE mib_sl_v2x_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(sl_bw_r14.pack(bref));
  HANDLE_CODE(tdd_cfg_sl_r14.pack(bref));
  HANDLE_CODE(direct_frame_num_r14.pack(bref));
  HANDLE_CODE(pack_integer(bref, direct_sf_num_r14, (uint8_t)0u, (uint8_t)9u));
  HANDLE_CODE(bref.pack(in_coverage_r14, 1));
  HANDLE_CODE(reserved_r14.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE mib_sl_v2x_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(sl_bw_r14.unpack(bref));
  HANDLE_CODE(tdd_cfg_sl_r14.unpack(bref));
  HANDLE_CODE(direct_frame_num_r14.unpack(bref));
  HANDLE_CODE(unpack_integer(direct_sf_num_r14, bref, (uint8_t)0u, (uint8_t)9u));
  HANDLE_CODE(bref.unpack(in_coverage_r14, 1));
  HANDLE_CODE(reserved_r14.unpack(bref));

  return SRSASN_SUCCESS;
}
void mib_sl_v2x_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sl-Bandwidth-r14", sl_bw_r14.to_string());
  j.write_fieldname("tdd-ConfigSL-r14");
  tdd_cfg_sl_r14.to_json(j);
  j.write_str("directFrameNumber-r14", direct_frame_num_r14.to_string());
  j.write_int("directSubframeNumber-r14", direct_sf_num_r14);
  j.write_bool("inCoverage-r14", in_coverage_r14);
  j.write_str("reserved-r14", reserved_r14.to_string());
  j.end_obj();
}

// MeasResultRSSI-SCG-r13 ::= SEQUENCE
SRSASN_CODE meas_result_rssi_scg_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, serv_cell_id_r13, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(meas_result_for_rssi_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_rssi_scg_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(serv_cell_id_r13, bref, (uint8_t)0u, (uint8_t)31u));
  HANDLE_CODE(meas_result_for_rssi_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void meas_result_rssi_scg_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("servCellId-r13", serv_cell_id_r13);
  j.write_fieldname("measResultForRSSI-r13");
  meas_result_for_rssi_r13.to_json(j);
  j.end_obj();
}

// MeasResultServCellSCG-r12 ::= SEQUENCE
SRSASN_CODE meas_result_serv_cell_scg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(pack_integer(bref, serv_cell_id_r12, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(pack_integer(bref, meas_result_scell_r12.rsrp_result_scell_r12, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(pack_integer(bref, meas_result_scell_r12.rsrq_result_scell_r12, (uint8_t)0u, (uint8_t)34u));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= serv_cell_id_r13_present;
    group_flags[0] |= meas_result_scell_v1310.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(serv_cell_id_r13_present, 1));
      HANDLE_CODE(bref.pack(meas_result_scell_v1310.is_present(), 1));
      if (serv_cell_id_r13_present) {
        HANDLE_CODE(pack_integer(bref, serv_cell_id_r13, (uint8_t)0u, (uint8_t)31u));
      }
      if (meas_result_scell_v1310.is_present()) {
        HANDLE_CODE(pack_integer(bref, meas_result_scell_v1310->rs_sinr_result_scell_r13, (uint8_t)0u, (uint8_t)127u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE meas_result_serv_cell_scg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(unpack_integer(serv_cell_id_r12, bref, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(unpack_integer(meas_result_scell_r12.rsrp_result_scell_r12, bref, (uint8_t)0u, (uint8_t)97u));
  HANDLE_CODE(unpack_integer(meas_result_scell_r12.rsrq_result_scell_r12, bref, (uint8_t)0u, (uint8_t)34u));

  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(serv_cell_id_r13_present, 1));
      bool meas_result_scell_v1310_present;
      HANDLE_CODE(bref.unpack(meas_result_scell_v1310_present, 1));
      meas_result_scell_v1310.set_present(meas_result_scell_v1310_present);
      if (serv_cell_id_r13_present) {
        HANDLE_CODE(unpack_integer(serv_cell_id_r13, bref, (uint8_t)0u, (uint8_t)31u));
      }
      if (meas_result_scell_v1310.is_present()) {
        HANDLE_CODE(
            unpack_integer(meas_result_scell_v1310->rs_sinr_result_scell_r13, bref, (uint8_t)0u, (uint8_t)127u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void meas_result_serv_cell_scg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("servCellId-r12", serv_cell_id_r12);
  j.write_fieldname("measResultSCell-r12");
  j.start_obj();
  j.write_int("rsrpResultSCell-r12", meas_result_scell_r12.rsrp_result_scell_r12);
  j.write_int("rsrqResultSCell-r12", meas_result_scell_r12.rsrq_result_scell_r12);
  j.end_obj();
  if (ext) {
    if (serv_cell_id_r13_present) {
      j.write_int("servCellId-r13", serv_cell_id_r13);
    }
    if (meas_result_scell_v1310.is_present()) {
      j.write_fieldname("measResultSCell-v1310");
      j.start_obj();
      j.write_int("rs-sinr-ResultSCell-r13", meas_result_scell_v1310->rs_sinr_result_scell_r13);
      j.end_obj();
    }
  }
  j.end_obj();
}

// SBCCH-SL-BCH-Message ::= SEQUENCE
SRSASN_CODE sbcch_sl_bch_msg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE sbcch_sl_bch_msg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void sbcch_sl_bch_msg_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("SBCCH-SL-BCH-Message");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// SBCCH-SL-BCH-Message-V2X-r14 ::= SEQUENCE
SRSASN_CODE sbcch_sl_bch_msg_v2x_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(msg.pack(bref));

  bref.align_bytes_zero();

  return SRSASN_SUCCESS;
}
SRSASN_CODE sbcch_sl_bch_msg_v2x_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(msg.unpack(bref));

  bref.align_bytes();

  return SRSASN_SUCCESS;
}
void sbcch_sl_bch_msg_v2x_r14_s::to_json(json_writer& j) const
{
  j.start_array();
  j.start_obj();
  j.start_obj("SBCCH-SL-BCH-Message-V2X-r14");
  j.write_fieldname("message");
  msg.to_json(j);
  j.end_obj();
  j.end_obj();
  j.end_array();
}

// SCG-ConfigInfo-v1530-IEs ::= SEQUENCE
SRSASN_CODE scg_cfg_info_v1530_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(drb_to_add_mod_list_scg_r15_present, 1));
  HANDLE_CODE(bref.pack(drb_to_release_list_scg_r15_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (drb_to_add_mod_list_scg_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_to_add_mod_list_scg_r15, 1, 15));
  }
  if (drb_to_release_list_scg_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_to_release_list_scg_r15, 1, 15, integer_packer<uint8_t>(1, 32)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_info_v1530_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(drb_to_add_mod_list_scg_r15_present, 1));
  HANDLE_CODE(bref.unpack(drb_to_release_list_scg_r15_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (drb_to_add_mod_list_scg_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_to_add_mod_list_scg_r15, bref, 1, 15));
  }
  if (drb_to_release_list_scg_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_to_release_list_scg_r15, bref, 1, 15, integer_packer<uint8_t>(1, 32)));
  }

  return SRSASN_SUCCESS;
}
void scg_cfg_info_v1530_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (drb_to_add_mod_list_scg_r15_present) {
    j.start_array("drb-ToAddModListSCG-r15");
    for (const auto& e1 : drb_to_add_mod_list_scg_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (drb_to_release_list_scg_r15_present) {
    j.start_array("drb-ToReleaseListSCG-r15");
    for (const auto& e1 : drb_to_release_list_scg_r15) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// SCG-ConfigInfo-v1430-IEs ::= SEQUENCE
SRSASN_CODE scg_cfg_info_v1430_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(make_before_break_scg_req_r14_present, 1));
  HANDLE_CODE(bref.pack(meas_gap_cfg_per_cc_list_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (meas_gap_cfg_per_cc_list_present) {
    HANDLE_CODE(meas_gap_cfg_per_cc_list.pack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_info_v1430_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(make_before_break_scg_req_r14_present, 1));
  HANDLE_CODE(bref.unpack(meas_gap_cfg_per_cc_list_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (meas_gap_cfg_per_cc_list_present) {
    HANDLE_CODE(meas_gap_cfg_per_cc_list.unpack(bref));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scg_cfg_info_v1430_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (make_before_break_scg_req_r14_present) {
    j.write_str("makeBeforeBreakSCG-Req-r14", "true");
  }
  if (meas_gap_cfg_per_cc_list_present) {
    j.write_fieldname("measGapConfigPerCC-List");
    meas_gap_cfg_per_cc_list.to_json(j);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SCG-ConfigInfo-v1330-IEs ::= SEQUENCE
SRSASN_CODE scg_cfg_info_v1330_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_result_list_rssi_scg_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (meas_result_list_rssi_scg_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_list_rssi_scg_r13, 1, 32));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_info_v1330_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_result_list_rssi_scg_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (meas_result_list_rssi_scg_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_list_rssi_scg_r13, bref, 1, 32));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scg_cfg_info_v1330_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_result_list_rssi_scg_r13_present) {
    j.start_array("measResultListRSSI-SCG-r13");
    for (const auto& e1 : meas_result_list_rssi_scg_r13) {
      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-ConfigInfo-v1310-IEs ::= SEQUENCE
SRSASN_CODE scg_cfg_info_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_result_sstd_r13_present, 1));
  HANDLE_CODE(bref.pack(scell_to_add_mod_list_mcg_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(meas_result_serv_cell_list_scg_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(scell_to_release_list_scg_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (meas_result_sstd_r13_present) {
    HANDLE_CODE(meas_result_sstd_r13.pack(bref));
  }
  if (scell_to_add_mod_list_mcg_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_mcg_ext_r13, 1, 31));
  }
  if (meas_result_serv_cell_list_scg_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_serv_cell_list_scg_ext_r13, 1, 32));
  }
  if (scell_to_add_mod_list_scg_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_ext_r13, 1, 31));
  }
  if (scell_to_release_list_scg_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_release_list_scg_ext_r13, 1, 31, integer_packer<uint8_t>(1, 31)));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_info_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_result_sstd_r13_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_mcg_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_serv_cell_list_scg_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_release_list_scg_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (meas_result_sstd_r13_present) {
    HANDLE_CODE(meas_result_sstd_r13.unpack(bref));
  }
  if (scell_to_add_mod_list_mcg_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_mcg_ext_r13, bref, 1, 31));
  }
  if (meas_result_serv_cell_list_scg_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_serv_cell_list_scg_ext_r13, bref, 1, 32));
  }
  if (scell_to_add_mod_list_scg_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_ext_r13, bref, 1, 31));
  }
  if (scell_to_release_list_scg_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_release_list_scg_ext_r13, bref, 1, 31, integer_packer<uint8_t>(1, 31)));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scg_cfg_info_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_result_sstd_r13_present) {
    j.write_fieldname("measResultSSTD-r13");
    meas_result_sstd_r13.to_json(j);
  }
  if (scell_to_add_mod_list_mcg_ext_r13_present) {
    j.start_array("sCellToAddModListMCG-Ext-r13");
    for (const auto& e1 : scell_to_add_mod_list_mcg_ext_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_result_serv_cell_list_scg_ext_r13_present) {
    j.start_array("measResultServCellListSCG-Ext-r13");
    for (const auto& e1 : meas_result_serv_cell_list_scg_ext_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (scell_to_add_mod_list_scg_ext_r13_present) {
    j.start_array("sCellToAddModListSCG-Ext-r13");
    for (const auto& e1 : scell_to_add_mod_list_scg_ext_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (scell_to_release_list_scg_ext_r13_present) {
    j.start_array("sCellToReleaseListSCG-Ext-r13");
    for (const auto& e1 : scell_to_release_list_scg_ext_r13) {
      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();
}

// SCG-ConfigRestrictInfo-r12 ::= SEQUENCE
SRSASN_CODE scg_cfg_restrict_info_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, max_sch_tb_bits_dl_r12, (uint8_t)1u, (uint8_t)100u));
  HANDLE_CODE(pack_integer(bref, max_sch_tb_bits_ul_r12, (uint8_t)1u, (uint8_t)100u));

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_restrict_info_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(max_sch_tb_bits_dl_r12, bref, (uint8_t)1u, (uint8_t)100u));
  HANDLE_CODE(unpack_integer(max_sch_tb_bits_ul_r12, bref, (uint8_t)1u, (uint8_t)100u));

  return SRSASN_SUCCESS;
}
void scg_cfg_restrict_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("maxSCH-TB-BitsDL-r12", max_sch_tb_bits_dl_r12);
  j.write_int("maxSCH-TB-BitsUL-r12", max_sch_tb_bits_ul_r12);
  j.end_obj();
}

// SCG-ConfigInfo-r12-IEs ::= SEQUENCE
SRSASN_CODE scg_cfg_info_r12_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(rr_cfg_ded_mcg_r12_present, 1));
  HANDLE_CODE(bref.pack(scell_to_add_mod_list_mcg_r12_present, 1));
  HANDLE_CODE(bref.pack(meas_gap_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(pwr_coordination_info_r12_present, 1));
  HANDLE_CODE(bref.pack(scg_radio_cfg_r12_present, 1));
  HANDLE_CODE(bref.pack(eutra_cap_info_r12_present, 1));
  HANDLE_CODE(bref.pack(scg_cfg_restrict_info_r12_present, 1));
  HANDLE_CODE(bref.pack(mbms_interest_ind_r12_present, 1));
  HANDLE_CODE(bref.pack(meas_result_serv_cell_list_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(drb_to_add_mod_list_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(drb_to_release_list_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(scell_to_add_mod_list_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(scell_to_release_list_scg_r12_present, 1));
  HANDLE_CODE(bref.pack(p_max_r12_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (rr_cfg_ded_mcg_r12_present) {
    HANDLE_CODE(rr_cfg_ded_mcg_r12.pack(bref));
  }
  if (scell_to_add_mod_list_mcg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_mcg_r12, 1, 4));
  }
  if (meas_gap_cfg_r12_present) {
    HANDLE_CODE(meas_gap_cfg_r12.pack(bref));
  }
  if (pwr_coordination_info_r12_present) {
    HANDLE_CODE(pwr_coordination_info_r12.pack(bref));
  }
  if (scg_radio_cfg_r12_present) {
    HANDLE_CODE(scg_radio_cfg_r12.pack(bref));
  }
  if (eutra_cap_info_r12_present) {
    HANDLE_CODE(eutra_cap_info_r12.pack(bref));
  }
  if (scg_cfg_restrict_info_r12_present) {
    HANDLE_CODE(scg_cfg_restrict_info_r12.pack(bref));
  }
  if (mbms_interest_ind_r12_present) {
    HANDLE_CODE(mbms_interest_ind_r12.pack(bref));
  }
  if (meas_result_serv_cell_list_scg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_result_serv_cell_list_scg_r12, 1, 5));
  }
  if (drb_to_add_mod_list_scg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_to_add_mod_list_scg_r12, 1, 11));
  }
  if (drb_to_release_list_scg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, drb_to_release_list_scg_r12, 1, 11, integer_packer<uint8_t>(1, 32)));
  }
  if (scell_to_add_mod_list_scg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_add_mod_list_scg_r12, 1, 4));
  }
  if (scell_to_release_list_scg_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, scell_to_release_list_scg_r12, 1, 4, integer_packer<uint8_t>(1, 7)));
  }
  if (p_max_r12_present) {
    HANDLE_CODE(pack_integer(bref, p_max_r12, (int8_t)-30, (int8_t)33));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_info_r12_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(rr_cfg_ded_mcg_r12_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_mcg_r12_present, 1));
  HANDLE_CODE(bref.unpack(meas_gap_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(pwr_coordination_info_r12_present, 1));
  HANDLE_CODE(bref.unpack(scg_radio_cfg_r12_present, 1));
  HANDLE_CODE(bref.unpack(eutra_cap_info_r12_present, 1));
  HANDLE_CODE(bref.unpack(scg_cfg_restrict_info_r12_present, 1));
  HANDLE_CODE(bref.unpack(mbms_interest_ind_r12_present, 1));
  HANDLE_CODE(bref.unpack(meas_result_serv_cell_list_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(drb_to_add_mod_list_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(drb_to_release_list_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_add_mod_list_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(scell_to_release_list_scg_r12_present, 1));
  HANDLE_CODE(bref.unpack(p_max_r12_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (rr_cfg_ded_mcg_r12_present) {
    HANDLE_CODE(rr_cfg_ded_mcg_r12.unpack(bref));
  }
  if (scell_to_add_mod_list_mcg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_mcg_r12, bref, 1, 4));
  }
  if (meas_gap_cfg_r12_present) {
    HANDLE_CODE(meas_gap_cfg_r12.unpack(bref));
  }
  if (pwr_coordination_info_r12_present) {
    HANDLE_CODE(pwr_coordination_info_r12.unpack(bref));
  }
  if (scg_radio_cfg_r12_present) {
    HANDLE_CODE(scg_radio_cfg_r12.unpack(bref));
  }
  if (eutra_cap_info_r12_present) {
    HANDLE_CODE(eutra_cap_info_r12.unpack(bref));
  }
  if (scg_cfg_restrict_info_r12_present) {
    HANDLE_CODE(scg_cfg_restrict_info_r12.unpack(bref));
  }
  if (mbms_interest_ind_r12_present) {
    HANDLE_CODE(mbms_interest_ind_r12.unpack(bref));
  }
  if (meas_result_serv_cell_list_scg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_result_serv_cell_list_scg_r12, bref, 1, 5));
  }
  if (drb_to_add_mod_list_scg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_to_add_mod_list_scg_r12, bref, 1, 11));
  }
  if (drb_to_release_list_scg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(drb_to_release_list_scg_r12, bref, 1, 11, integer_packer<uint8_t>(1, 32)));
  }
  if (scell_to_add_mod_list_scg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_add_mod_list_scg_r12, bref, 1, 4));
  }
  if (scell_to_release_list_scg_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(scell_to_release_list_scg_r12, bref, 1, 4, integer_packer<uint8_t>(1, 7)));
  }
  if (p_max_r12_present) {
    HANDLE_CODE(unpack_integer(p_max_r12, bref, (int8_t)-30, (int8_t)33));
  }
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void scg_cfg_info_r12_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (rr_cfg_ded_mcg_r12_present) {
    j.write_fieldname("radioResourceConfigDedMCG-r12");
    rr_cfg_ded_mcg_r12.to_json(j);
  }
  if (scell_to_add_mod_list_mcg_r12_present) {
    j.start_array("sCellToAddModListMCG-r12");
    for (const auto& e1 : scell_to_add_mod_list_mcg_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_gap_cfg_r12_present) {
    j.write_fieldname("measGapConfig-r12");
    meas_gap_cfg_r12.to_json(j);
  }
  if (pwr_coordination_info_r12_present) {
    j.write_fieldname("powerCoordinationInfo-r12");
    pwr_coordination_info_r12.to_json(j);
  }
  if (scg_radio_cfg_r12_present) {
    j.write_fieldname("scg-RadioConfig-r12");
    scg_radio_cfg_r12.to_json(j);
  }
  if (eutra_cap_info_r12_present) {
    j.write_str("eutra-CapabilityInfo-r12", eutra_cap_info_r12.to_string());
  }
  if (scg_cfg_restrict_info_r12_present) {
    j.write_fieldname("scg-ConfigRestrictInfo-r12");
    scg_cfg_restrict_info_r12.to_json(j);
  }
  if (mbms_interest_ind_r12_present) {
    j.write_str("mbmsInterestIndication-r12", mbms_interest_ind_r12.to_string());
  }
  if (meas_result_serv_cell_list_scg_r12_present) {
    j.start_array("measResultServCellListSCG-r12");
    for (const auto& e1 : meas_result_serv_cell_list_scg_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (drb_to_add_mod_list_scg_r12_present) {
    j.start_array("drb-ToAddModListSCG-r12");
    for (const auto& e1 : drb_to_add_mod_list_scg_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (drb_to_release_list_scg_r12_present) {
    j.start_array("drb-ToReleaseListSCG-r12");
    for (const auto& e1 : drb_to_release_list_scg_r12) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (scell_to_add_mod_list_scg_r12_present) {
    j.start_array("sCellToAddModListSCG-r12");
    for (const auto& e1 : scell_to_add_mod_list_scg_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (scell_to_release_list_scg_r12_present) {
    j.start_array("sCellToReleaseListSCG-r12");
    for (const auto& e1 : scell_to_release_list_scg_r12) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (p_max_r12_present) {
    j.write_int("p-Max-r12", p_max_r12);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// SCG-ConfigInfo-r12 ::= SEQUENCE
SRSASN_CODE scg_cfg_info_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_info_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void scg_cfg_info_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("criticalExtensions");
  crit_exts.to_json(j);
  j.end_obj();
}

void scg_cfg_info_r12_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_info_r12_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void scg_cfg_info_r12_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void scg_cfg_info_r12_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::scg_cfg_info_r12:
      j.write_fieldname("scg-ConfigInfo-r12");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE scg_cfg_info_r12_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::scg_cfg_info_r12:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE scg_cfg_info_r12_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::scg_cfg_info_r12:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "scg_cfg_info_r12_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// SL-PPPP-TxPreconfigIndex-r14 ::= SEQUENCE
SRSASN_CODE sl_pppp_tx_precfg_idx_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_integer(bref, prio_thres_r14, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(pack_integer(bref, default_tx_cfg_idx_r14, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(pack_integer(bref, cbr_cfg_idx_r14, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(pack_dyn_seq_of(bref, tx_cfg_idx_list_r14, 1, 16, integer_packer<uint8_t>(0, 127)));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pppp_tx_precfg_idx_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_integer(prio_thres_r14, bref, (uint8_t)1u, (uint8_t)8u));
  HANDLE_CODE(unpack_integer(default_tx_cfg_idx_r14, bref, (uint8_t)0u, (uint8_t)15u));
  HANDLE_CODE(unpack_integer(cbr_cfg_idx_r14, bref, (uint8_t)0u, (uint8_t)7u));
  HANDLE_CODE(unpack_dyn_seq_of(tx_cfg_idx_list_r14, bref, 1, 16, integer_packer<uint8_t>(0, 127)));

  return SRSASN_SUCCESS;
}
void sl_pppp_tx_precfg_idx_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("priorityThreshold-r14", prio_thres_r14);
  j.write_int("defaultTxConfigIndex-r14", default_tx_cfg_idx_r14);
  j.write_int("cbr-ConfigIndex-r14", cbr_cfg_idx_r14);
  j.start_array("tx-ConfigIndexList-r14");
  for (const auto& e1 : tx_cfg_idx_list_r14) {
    j.write_int(e1);
  }
  j.end_array();
  j.end_obj();
}

// SL-PPPP-TxPreconfigIndex-v1530 ::= SEQUENCE
SRSASN_CODE sl_pppp_tx_precfg_idx_v1530_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mcs_pssch_range_r15_present, 1));

  if (mcs_pssch_range_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, mcs_pssch_range_r15, 1, 16));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_pppp_tx_precfg_idx_v1530_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mcs_pssch_range_r15_present, 1));

  if (mcs_pssch_range_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(mcs_pssch_range_r15, bref, 1, 16));
  }

  return SRSASN_SUCCESS;
}
void sl_pppp_tx_precfg_idx_v1530_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mcs_pssch_range_r15_present) {
    j.start_array("mcs-PSSCH-Range-r15");
    for (const auto& e1 : mcs_pssch_range_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// SL-CBR-PreconfigTxConfigList-r14 ::= SEQUENCE
SRSASN_CODE sl_cbr_precfg_tx_cfg_list_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref,
                              cbr_range_common_cfg_list_r14,
                              1,
                              8,
                              SeqOfPacker<integer_packer<uint8_t> >(1, 16, integer_packer<uint8_t>(0, 100))));
  HANDLE_CODE(pack_dyn_seq_of(bref, sl_cbr_pssch_tx_cfg_list_r14, 1, 128));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_cbr_precfg_tx_cfg_list_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(cbr_range_common_cfg_list_r14,
                                bref,
                                1,
                                8,
                                SeqOfPacker<integer_packer<uint8_t> >(1, 16, integer_packer<uint8_t>(0, 100))));
  HANDLE_CODE(unpack_dyn_seq_of(sl_cbr_pssch_tx_cfg_list_r14, bref, 1, 128));

  return SRSASN_SUCCESS;
}
void sl_cbr_precfg_tx_cfg_list_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("cbr-RangeCommonConfigList-r14");
  for (const auto& e1 : cbr_range_common_cfg_list_r14) {
    j.start_array();
    for (const auto& e2 : e1) {
      j.write_int(e2);
    }
    j.end_array();
  }
  j.end_array();
  j.start_array("sl-CBR-PSSCH-TxConfigList-r14");
  for (const auto& e1 : sl_cbr_pssch_tx_cfg_list_r14) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// SL-PreconfigCommPool-r12 ::= SEQUENCE
SRSASN_CODE sl_precfg_comm_pool_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(sc_cp_len_r12.pack(bref));
  HANDLE_CODE(sc_period_r12.pack(bref));
  HANDLE_CODE(sc_tf_res_cfg_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, sc_tx_params_r12, (int8_t)-126, (int8_t)31));
  HANDLE_CODE(data_cp_len_r12.pack(bref));
  HANDLE_CODE(data_tf_res_cfg_r12.pack(bref));
  HANDLE_CODE(data_hop_cfg_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, data_tx_params_r12, (int8_t)-126, (int8_t)31));
  HANDLE_CODE(trpt_subset_r12.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= prio_list_r13.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(prio_list_r13.is_present(), 1));
      if (prio_list_r13.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *prio_list_r13, 1, 8, integer_packer<uint8_t>(1, 8)));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_precfg_comm_pool_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(sc_cp_len_r12.unpack(bref));
  HANDLE_CODE(sc_period_r12.unpack(bref));
  HANDLE_CODE(sc_tf_res_cfg_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(sc_tx_params_r12, bref, (int8_t)-126, (int8_t)31));
  HANDLE_CODE(data_cp_len_r12.unpack(bref));
  HANDLE_CODE(data_tf_res_cfg_r12.unpack(bref));
  HANDLE_CODE(data_hop_cfg_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(data_tx_params_r12, bref, (int8_t)-126, (int8_t)31));
  HANDLE_CODE(trpt_subset_r12.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 prio_list_r13_present;
      HANDLE_CODE(bref.unpack(prio_list_r13_present, 1));
      prio_list_r13.set_present(prio_list_r13_present);
      if (prio_list_r13.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*prio_list_r13, bref, 1, 8, integer_packer<uint8_t>(1, 8)));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_precfg_comm_pool_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("sc-CP-Len-r12", sc_cp_len_r12.to_string());
  j.write_str("sc-Period-r12", sc_period_r12.to_string());
  j.write_fieldname("sc-TF-ResourceConfig-r12");
  sc_tf_res_cfg_r12.to_json(j);
  j.write_int("sc-TxParameters-r12", sc_tx_params_r12);
  j.write_str("data-CP-Len-r12", data_cp_len_r12.to_string());
  j.write_fieldname("data-TF-ResourceConfig-r12");
  data_tf_res_cfg_r12.to_json(j);
  j.write_fieldname("dataHoppingConfig-r12");
  data_hop_cfg_r12.to_json(j);
  j.write_int("dataTxParameters-r12", data_tx_params_r12);
  j.write_str("trpt-Subset-r12", trpt_subset_r12.to_string());
  if (ext) {
    if (prio_list_r13.is_present()) {
      j.start_array("priorityList-r13");
      for (const auto& e1 : *prio_list_r13) {
        j.write_int(e1);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// SL-PreconfigDiscPool-r13 ::= SEQUENCE
SRSASN_CODE sl_precfg_disc_pool_r13_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(tx_params_r13_present, 1));

  HANDLE_CODE(cp_len_r13.pack(bref));
  HANDLE_CODE(disc_period_r13.pack(bref));
  HANDLE_CODE(pack_integer(bref, num_retx_r13, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(pack_integer(bref, num_repeat_r13, (uint8_t)1u, (uint8_t)50u));
  HANDLE_CODE(tf_res_cfg_r13.pack(bref));
  if (tx_params_r13_present) {
    HANDLE_CODE(pack_integer(bref, tx_params_r13.tx_params_general_r13, (int8_t)-126, (int8_t)31));
    HANDLE_CODE(tx_params_r13.tx_probability_r13.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_precfg_disc_pool_r13_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(tx_params_r13_present, 1));

  HANDLE_CODE(cp_len_r13.unpack(bref));
  HANDLE_CODE(disc_period_r13.unpack(bref));
  HANDLE_CODE(unpack_integer(num_retx_r13, bref, (uint8_t)0u, (uint8_t)3u));
  HANDLE_CODE(unpack_integer(num_repeat_r13, bref, (uint8_t)1u, (uint8_t)50u));
  HANDLE_CODE(tf_res_cfg_r13.unpack(bref));
  if (tx_params_r13_present) {
    HANDLE_CODE(unpack_integer(tx_params_r13.tx_params_general_r13, bref, (int8_t)-126, (int8_t)31));
    HANDLE_CODE(tx_params_r13.tx_probability_r13.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void sl_precfg_disc_pool_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cp-Len-r13", cp_len_r13.to_string());
  j.write_str("discPeriod-r13", disc_period_r13.to_string());
  j.write_int("numRetx-r13", num_retx_r13);
  j.write_int("numRepetition-r13", num_repeat_r13);
  j.write_fieldname("tf-ResourceConfig-r13");
  tf_res_cfg_r13.to_json(j);
  if (tx_params_r13_present) {
    j.write_fieldname("txParameters-r13");
    j.start_obj();
    j.write_int("txParametersGeneral-r13", tx_params_r13.tx_params_general_r13);
    j.write_str("txProbability-r13", tx_params_r13.tx_probability_r13.to_string());
    j.end_obj();
  }
  j.end_obj();
}

// SL-PreconfigGeneral-r12 ::= SEQUENCE
SRSASN_CODE sl_precfg_general_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(rohc_profiles_r12.profile0x0001_r12, 1));
  HANDLE_CODE(bref.pack(rohc_profiles_r12.profile0x0002_r12, 1));
  HANDLE_CODE(bref.pack(rohc_profiles_r12.profile0x0004_r12, 1));
  HANDLE_CODE(bref.pack(rohc_profiles_r12.profile0x0006_r12, 1));
  HANDLE_CODE(bref.pack(rohc_profiles_r12.profile0x0101_r12, 1));
  HANDLE_CODE(bref.pack(rohc_profiles_r12.profile0x0102_r12, 1));
  HANDLE_CODE(bref.pack(rohc_profiles_r12.profile0x0104_r12, 1));
  HANDLE_CODE(pack_integer(bref, carrier_freq_r12, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(pack_integer(bref, max_tx_pwr_r12, (int8_t)-30, (int8_t)33));
  HANDLE_CODE(pack_integer(bref, add_spec_emission_r12, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(sl_bw_r12.pack(bref));
  HANDLE_CODE(tdd_cfg_sl_r12.pack(bref));
  HANDLE_CODE(reserved_r12.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= add_spec_emission_v1440_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(add_spec_emission_v1440_present, 1));
      if (add_spec_emission_v1440_present) {
        HANDLE_CODE(pack_integer(bref, add_spec_emission_v1440, (uint16_t)33u, (uint16_t)288u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_precfg_general_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(rohc_profiles_r12.profile0x0001_r12, 1));
  HANDLE_CODE(bref.unpack(rohc_profiles_r12.profile0x0002_r12, 1));
  HANDLE_CODE(bref.unpack(rohc_profiles_r12.profile0x0004_r12, 1));
  HANDLE_CODE(bref.unpack(rohc_profiles_r12.profile0x0006_r12, 1));
  HANDLE_CODE(bref.unpack(rohc_profiles_r12.profile0x0101_r12, 1));
  HANDLE_CODE(bref.unpack(rohc_profiles_r12.profile0x0102_r12, 1));
  HANDLE_CODE(bref.unpack(rohc_profiles_r12.profile0x0104_r12, 1));
  HANDLE_CODE(unpack_integer(carrier_freq_r12, bref, (uint32_t)0u, (uint32_t)262143u));
  HANDLE_CODE(unpack_integer(max_tx_pwr_r12, bref, (int8_t)-30, (int8_t)33));
  HANDLE_CODE(unpack_integer(add_spec_emission_r12, bref, (uint8_t)1u, (uint8_t)32u));
  HANDLE_CODE(sl_bw_r12.unpack(bref));
  HANDLE_CODE(tdd_cfg_sl_r12.unpack(bref));
  HANDLE_CODE(reserved_r12.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(add_spec_emission_v1440_present, 1));
      if (add_spec_emission_v1440_present) {
        HANDLE_CODE(unpack_integer(add_spec_emission_v1440, bref, (uint16_t)33u, (uint16_t)288u));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_precfg_general_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("rohc-Profiles-r12");
  j.start_obj();
  j.write_bool("profile0x0001-r12", rohc_profiles_r12.profile0x0001_r12);
  j.write_bool("profile0x0002-r12", rohc_profiles_r12.profile0x0002_r12);
  j.write_bool("profile0x0004-r12", rohc_profiles_r12.profile0x0004_r12);
  j.write_bool("profile0x0006-r12", rohc_profiles_r12.profile0x0006_r12);
  j.write_bool("profile0x0101-r12", rohc_profiles_r12.profile0x0101_r12);
  j.write_bool("profile0x0102-r12", rohc_profiles_r12.profile0x0102_r12);
  j.write_bool("profile0x0104-r12", rohc_profiles_r12.profile0x0104_r12);
  j.end_obj();
  j.write_int("carrierFreq-r12", carrier_freq_r12);
  j.write_int("maxTxPower-r12", max_tx_pwr_r12);
  j.write_int("additionalSpectrumEmission-r12", add_spec_emission_r12);
  j.write_str("sl-bandwidth-r12", sl_bw_r12.to_string());
  j.write_fieldname("tdd-ConfigSL-r12");
  tdd_cfg_sl_r12.to_json(j);
  j.write_str("reserved-r12", reserved_r12.to_string());
  if (ext) {
    if (add_spec_emission_v1440_present) {
      j.write_int("additionalSpectrumEmission-v1440", add_spec_emission_v1440);
    }
  }
  j.end_obj();
}

// SL-PreconfigRelay-r13 ::= SEQUENCE
SRSASN_CODE sl_precfg_relay_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(resel_info_oo_c_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_precfg_relay_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(resel_info_oo_c_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void sl_precfg_relay_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("reselectionInfoOoC-r13");
  resel_info_oo_c_r13.to_json(j);
  j.end_obj();
}

// SL-PreconfigSync-r12 ::= SEQUENCE
SRSASN_CODE sl_precfg_sync_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(sync_cp_len_r12.pack(bref));
  HANDLE_CODE(pack_integer(bref, sync_offset_ind1_r12, (uint8_t)0u, (uint8_t)39u));
  HANDLE_CODE(pack_integer(bref, sync_offset_ind2_r12, (uint8_t)0u, (uint8_t)39u));
  HANDLE_CODE(pack_integer(bref, sync_tx_params_r12, (int8_t)-126, (int8_t)31));
  HANDLE_CODE(pack_integer(bref, sync_tx_thresh_oo_c_r12, (uint8_t)0u, (uint8_t)11u));
  HANDLE_CODE(filt_coef_r12.pack(bref));
  HANDLE_CODE(sync_ref_min_hyst_r12.pack(bref));
  HANDLE_CODE(sync_ref_diff_hyst_r12.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= sync_tx_periodic_r13_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sync_tx_periodic_r13_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_precfg_sync_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(sync_cp_len_r12.unpack(bref));
  HANDLE_CODE(unpack_integer(sync_offset_ind1_r12, bref, (uint8_t)0u, (uint8_t)39u));
  HANDLE_CODE(unpack_integer(sync_offset_ind2_r12, bref, (uint8_t)0u, (uint8_t)39u));
  HANDLE_CODE(unpack_integer(sync_tx_params_r12, bref, (int8_t)-126, (int8_t)31));
  HANDLE_CODE(unpack_integer(sync_tx_thresh_oo_c_r12, bref, (uint8_t)0u, (uint8_t)11u));
  HANDLE_CODE(filt_coef_r12.unpack(bref));
  HANDLE_CODE(sync_ref_min_hyst_r12.unpack(bref));
  HANDLE_CODE(sync_ref_diff_hyst_r12.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(sync_tx_periodic_r13_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
void sl_precfg_sync_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("syncCP-Len-r12", sync_cp_len_r12.to_string());
  j.write_int("syncOffsetIndicator1-r12", sync_offset_ind1_r12);
  j.write_int("syncOffsetIndicator2-r12", sync_offset_ind2_r12);
  j.write_int("syncTxParameters-r12", sync_tx_params_r12);
  j.write_int("syncTxThreshOoC-r12", sync_tx_thresh_oo_c_r12);
  j.write_str("filterCoefficient-r12", filt_coef_r12.to_string());
  j.write_str("syncRefMinHyst-r12", sync_ref_min_hyst_r12.to_string());
  j.write_str("syncRefDiffHyst-r12", sync_ref_diff_hyst_r12.to_string());
  if (ext) {
    if (sync_tx_periodic_r13_present) {
      j.write_str("syncTxPeriodic-r13", "true");
    }
  }
  j.end_obj();
}

// SL-V2X-PreconfigCommPool-r14 ::= SEQUENCE
SRSASN_CODE sl_v2x_precfg_comm_pool_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(sl_offset_ind_r14_present, 1));
  HANDLE_CODE(bref.pack(start_rb_pscch_pool_r14_present, 1));
  HANDLE_CODE(bref.pack(zone_id_r14_present, 1));
  HANDLE_CODE(bref.pack(thresh_s_rssi_cbr_r14_present, 1));
  HANDLE_CODE(bref.pack(cbr_pssch_tx_cfg_list_r14_present, 1));
  HANDLE_CODE(bref.pack(res_sel_cfg_p2_x_r14_present, 1));
  HANDLE_CODE(bref.pack(sync_allowed_r14_present, 1));
  HANDLE_CODE(bref.pack(restrict_res_reserv_period_r14_present, 1));

  if (sl_offset_ind_r14_present) {
    HANDLE_CODE(sl_offset_ind_r14.pack(bref));
  }
  HANDLE_CODE(sl_sf_r14.pack(bref));
  HANDLE_CODE(bref.pack(adjacency_pscch_pssch_r14, 1));
  HANDLE_CODE(size_subch_r14.pack(bref));
  HANDLE_CODE(num_subch_r14.pack(bref));
  HANDLE_CODE(pack_integer(bref, start_rb_subch_r14, (uint8_t)0u, (uint8_t)99u));
  if (start_rb_pscch_pool_r14_present) {
    HANDLE_CODE(pack_integer(bref, start_rb_pscch_pool_r14, (uint8_t)0u, (uint8_t)99u));
  }
  HANDLE_CODE(pack_integer(bref, data_tx_params_r14, (int8_t)-126, (int8_t)31));
  if (zone_id_r14_present) {
    HANDLE_CODE(pack_integer(bref, zone_id_r14, (uint8_t)0u, (uint8_t)7u));
  }
  if (thresh_s_rssi_cbr_r14_present) {
    HANDLE_CODE(pack_integer(bref, thresh_s_rssi_cbr_r14, (uint8_t)0u, (uint8_t)45u));
  }
  if (cbr_pssch_tx_cfg_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cbr_pssch_tx_cfg_list_r14, 1, 8));
  }
  if (res_sel_cfg_p2_x_r14_present) {
    HANDLE_CODE(res_sel_cfg_p2_x_r14.pack(bref));
  }
  if (sync_allowed_r14_present) {
    HANDLE_CODE(sync_allowed_r14.pack(bref));
  }
  if (restrict_res_reserv_period_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, restrict_res_reserv_period_r14, 1, 16));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= sl_min_t2_value_list_r15.is_present();
    group_flags[0] |= cbr_pssch_tx_cfg_list_v1530.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(sl_min_t2_value_list_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(cbr_pssch_tx_cfg_list_v1530.is_present(), 1));
      if (sl_min_t2_value_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *sl_min_t2_value_list_r15, 1, 8));
      }
      if (cbr_pssch_tx_cfg_list_v1530.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *cbr_pssch_tx_cfg_list_v1530, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_precfg_comm_pool_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(sl_offset_ind_r14_present, 1));
  HANDLE_CODE(bref.unpack(start_rb_pscch_pool_r14_present, 1));
  HANDLE_CODE(bref.unpack(zone_id_r14_present, 1));
  HANDLE_CODE(bref.unpack(thresh_s_rssi_cbr_r14_present, 1));
  HANDLE_CODE(bref.unpack(cbr_pssch_tx_cfg_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(res_sel_cfg_p2_x_r14_present, 1));
  HANDLE_CODE(bref.unpack(sync_allowed_r14_present, 1));
  HANDLE_CODE(bref.unpack(restrict_res_reserv_period_r14_present, 1));

  if (sl_offset_ind_r14_present) {
    HANDLE_CODE(sl_offset_ind_r14.unpack(bref));
  }
  HANDLE_CODE(sl_sf_r14.unpack(bref));
  HANDLE_CODE(bref.unpack(adjacency_pscch_pssch_r14, 1));
  HANDLE_CODE(size_subch_r14.unpack(bref));
  HANDLE_CODE(num_subch_r14.unpack(bref));
  HANDLE_CODE(unpack_integer(start_rb_subch_r14, bref, (uint8_t)0u, (uint8_t)99u));
  if (start_rb_pscch_pool_r14_present) {
    HANDLE_CODE(unpack_integer(start_rb_pscch_pool_r14, bref, (uint8_t)0u, (uint8_t)99u));
  }
  HANDLE_CODE(unpack_integer(data_tx_params_r14, bref, (int8_t)-126, (int8_t)31));
  if (zone_id_r14_present) {
    HANDLE_CODE(unpack_integer(zone_id_r14, bref, (uint8_t)0u, (uint8_t)7u));
  }
  if (thresh_s_rssi_cbr_r14_present) {
    HANDLE_CODE(unpack_integer(thresh_s_rssi_cbr_r14, bref, (uint8_t)0u, (uint8_t)45u));
  }
  if (cbr_pssch_tx_cfg_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cbr_pssch_tx_cfg_list_r14, bref, 1, 8));
  }
  if (res_sel_cfg_p2_x_r14_present) {
    HANDLE_CODE(res_sel_cfg_p2_x_r14.unpack(bref));
  }
  if (sync_allowed_r14_present) {
    HANDLE_CODE(sync_allowed_r14.unpack(bref));
  }
  if (restrict_res_reserv_period_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(restrict_res_reserv_period_r14, bref, 1, 16));
  }

  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 sl_min_t2_value_list_r15_present;
      HANDLE_CODE(bref.unpack(sl_min_t2_value_list_r15_present, 1));
      sl_min_t2_value_list_r15.set_present(sl_min_t2_value_list_r15_present);
      bool cbr_pssch_tx_cfg_list_v1530_present;
      HANDLE_CODE(bref.unpack(cbr_pssch_tx_cfg_list_v1530_present, 1));
      cbr_pssch_tx_cfg_list_v1530.set_present(cbr_pssch_tx_cfg_list_v1530_present);
      if (sl_min_t2_value_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*sl_min_t2_value_list_r15, bref, 1, 8));
      }
      if (cbr_pssch_tx_cfg_list_v1530.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*cbr_pssch_tx_cfg_list_v1530, bref, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_v2x_precfg_comm_pool_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (sl_offset_ind_r14_present) {
    j.write_fieldname("sl-OffsetIndicator-r14");
    sl_offset_ind_r14.to_json(j);
  }
  j.write_fieldname("sl-Subframe-r14");
  sl_sf_r14.to_json(j);
  j.write_bool("adjacencyPSCCH-PSSCH-r14", adjacency_pscch_pssch_r14);
  j.write_str("sizeSubchannel-r14", size_subch_r14.to_string());
  j.write_str("numSubchannel-r14", num_subch_r14.to_string());
  j.write_int("startRB-Subchannel-r14", start_rb_subch_r14);
  if (start_rb_pscch_pool_r14_present) {
    j.write_int("startRB-PSCCH-Pool-r14", start_rb_pscch_pool_r14);
  }
  j.write_int("dataTxParameters-r14", data_tx_params_r14);
  if (zone_id_r14_present) {
    j.write_int("zoneID-r14", zone_id_r14);
  }
  if (thresh_s_rssi_cbr_r14_present) {
    j.write_int("threshS-RSSI-CBR-r14", thresh_s_rssi_cbr_r14);
  }
  if (cbr_pssch_tx_cfg_list_r14_present) {
    j.start_array("cbr-pssch-TxConfigList-r14");
    for (const auto& e1 : cbr_pssch_tx_cfg_list_r14) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (res_sel_cfg_p2_x_r14_present) {
    j.write_fieldname("resourceSelectionConfigP2X-r14");
    res_sel_cfg_p2_x_r14.to_json(j);
  }
  if (sync_allowed_r14_present) {
    j.write_fieldname("syncAllowed-r14");
    sync_allowed_r14.to_json(j);
  }
  if (restrict_res_reserv_period_r14_present) {
    j.start_array("restrictResourceReservationPeriod-r14");
    for (const auto& e1 : restrict_res_reserv_period_r14) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (ext) {
    if (sl_min_t2_value_list_r15.is_present()) {
      j.start_array("sl-MinT2ValueList-r15");
      for (const auto& e1 : *sl_min_t2_value_list_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
    if (cbr_pssch_tx_cfg_list_v1530.is_present()) {
      j.start_array("cbr-pssch-TxConfigList-v1530");
      for (const auto& e1 : *cbr_pssch_tx_cfg_list_v1530) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// SL-V2X-SyncOffsetIndicators-r14 ::= SEQUENCE
SRSASN_CODE sl_v2x_sync_offset_inds_r14_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(sync_offset_ind3_r14_present, 1));

  HANDLE_CODE(pack_integer(bref, sync_offset_ind1_r14, (uint8_t)0u, (uint8_t)159u));
  HANDLE_CODE(pack_integer(bref, sync_offset_ind2_r14, (uint8_t)0u, (uint8_t)159u));
  if (sync_offset_ind3_r14_present) {
    HANDLE_CODE(pack_integer(bref, sync_offset_ind3_r14, (uint8_t)0u, (uint8_t)159u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_sync_offset_inds_r14_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(sync_offset_ind3_r14_present, 1));

  HANDLE_CODE(unpack_integer(sync_offset_ind1_r14, bref, (uint8_t)0u, (uint8_t)159u));
  HANDLE_CODE(unpack_integer(sync_offset_ind2_r14, bref, (uint8_t)0u, (uint8_t)159u));
  if (sync_offset_ind3_r14_present) {
    HANDLE_CODE(unpack_integer(sync_offset_ind3_r14, bref, (uint8_t)0u, (uint8_t)159u));
  }

  return SRSASN_SUCCESS;
}
void sl_v2x_sync_offset_inds_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("syncOffsetIndicator1-r14", sync_offset_ind1_r14);
  j.write_int("syncOffsetIndicator2-r14", sync_offset_ind2_r14);
  if (sync_offset_ind3_r14_present) {
    j.write_int("syncOffsetIndicator3-r14", sync_offset_ind3_r14);
  }
  j.end_obj();
}

// SL-PreconfigV2X-Sync-r14 ::= SEQUENCE
SRSASN_CODE sl_precfg_v2x_sync_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(sync_offset_inds_r14.pack(bref));
  HANDLE_CODE(pack_integer(bref, sync_tx_params_r14, (int8_t)-126, (int8_t)31));
  HANDLE_CODE(pack_integer(bref, sync_tx_thresh_oo_c_r14, (uint8_t)0u, (uint8_t)11u));
  HANDLE_CODE(filt_coef_r14.pack(bref));
  HANDLE_CODE(sync_ref_min_hyst_r14.pack(bref));
  HANDLE_CODE(sync_ref_diff_hyst_r14.pack(bref));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= slss_tx_disabled_r15_present;
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(slss_tx_disabled_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_precfg_v2x_sync_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(sync_offset_inds_r14.unpack(bref));
  HANDLE_CODE(unpack_integer(sync_tx_params_r14, bref, (int8_t)-126, (int8_t)31));
  HANDLE_CODE(unpack_integer(sync_tx_thresh_oo_c_r14, bref, (uint8_t)0u, (uint8_t)11u));
  HANDLE_CODE(filt_coef_r14.unpack(bref));
  HANDLE_CODE(sync_ref_min_hyst_r14.unpack(bref));
  HANDLE_CODE(sync_ref_diff_hyst_r14.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(slss_tx_disabled_r15_present, 1));
    }
  }
  return SRSASN_SUCCESS;
}
void sl_precfg_v2x_sync_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("syncOffsetIndicators-r14");
  sync_offset_inds_r14.to_json(j);
  j.write_int("syncTxParameters-r14", sync_tx_params_r14);
  j.write_int("syncTxThreshOoC-r14", sync_tx_thresh_oo_c_r14);
  j.write_str("filterCoefficient-r14", filt_coef_r14.to_string());
  j.write_str("syncRefMinHyst-r14", sync_ref_min_hyst_r14.to_string());
  j.write_str("syncRefDiffHyst-r14", sync_ref_diff_hyst_r14.to_string());
  if (ext) {
    if (slss_tx_disabled_r15_present) {
      j.write_str("slss-TxDisabled-r15", "true");
    }
  }
  j.end_obj();
}

// SL-Preconfiguration-r12 ::= SEQUENCE
SRSASN_CODE sl_precfg_r12_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(precfg_general_r12.pack(bref));
  HANDLE_CODE(precfg_sync_r12.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, precfg_comm_r12, 1, 4));

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= precfg_comm_v1310.is_present();
    group_flags[0] |= precfg_disc_r13.is_present();
    group_flags[0] |= precfg_relay_r13.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(precfg_comm_v1310.is_present(), 1));
      HANDLE_CODE(bref.pack(precfg_disc_r13.is_present(), 1));
      HANDLE_CODE(bref.pack(precfg_relay_r13.is_present(), 1));
      if (precfg_comm_v1310.is_present()) {
        HANDLE_CODE(bref.pack(precfg_comm_v1310->comm_tx_pool_list_r13_present, 1));
        HANDLE_CODE(pack_dyn_seq_of(bref, precfg_comm_v1310->comm_rx_pool_list_r13, 1, 12));
        if (precfg_comm_v1310->comm_tx_pool_list_r13_present) {
          HANDLE_CODE(pack_dyn_seq_of(bref, precfg_comm_v1310->comm_tx_pool_list_r13, 1, 7));
        }
      }
      if (precfg_disc_r13.is_present()) {
        HANDLE_CODE(bref.pack(precfg_disc_r13->disc_tx_pool_list_r13_present, 1));
        HANDLE_CODE(pack_dyn_seq_of(bref, precfg_disc_r13->disc_rx_pool_list_r13, 1, 16));
        if (precfg_disc_r13->disc_tx_pool_list_r13_present) {
          HANDLE_CODE(pack_dyn_seq_of(bref, precfg_disc_r13->disc_tx_pool_list_r13, 1, 4));
        }
      }
      if (precfg_relay_r13.is_present()) {
        HANDLE_CODE(precfg_relay_r13->pack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_precfg_r12_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(precfg_general_r12.unpack(bref));
  HANDLE_CODE(precfg_sync_r12.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(precfg_comm_r12, bref, 1, 4));

  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 precfg_comm_v1310_present;
      HANDLE_CODE(bref.unpack(precfg_comm_v1310_present, 1));
      precfg_comm_v1310.set_present(precfg_comm_v1310_present);
      bool precfg_disc_r13_present;
      HANDLE_CODE(bref.unpack(precfg_disc_r13_present, 1));
      precfg_disc_r13.set_present(precfg_disc_r13_present);
      bool precfg_relay_r13_present;
      HANDLE_CODE(bref.unpack(precfg_relay_r13_present, 1));
      precfg_relay_r13.set_present(precfg_relay_r13_present);
      if (precfg_comm_v1310.is_present()) {
        HANDLE_CODE(bref.unpack(precfg_comm_v1310->comm_tx_pool_list_r13_present, 1));
        HANDLE_CODE(unpack_dyn_seq_of(precfg_comm_v1310->comm_rx_pool_list_r13, bref, 1, 12));
        if (precfg_comm_v1310->comm_tx_pool_list_r13_present) {
          HANDLE_CODE(unpack_dyn_seq_of(precfg_comm_v1310->comm_tx_pool_list_r13, bref, 1, 7));
        }
      }
      if (precfg_disc_r13.is_present()) {
        HANDLE_CODE(bref.unpack(precfg_disc_r13->disc_tx_pool_list_r13_present, 1));
        HANDLE_CODE(unpack_dyn_seq_of(precfg_disc_r13->disc_rx_pool_list_r13, bref, 1, 16));
        if (precfg_disc_r13->disc_tx_pool_list_r13_present) {
          HANDLE_CODE(unpack_dyn_seq_of(precfg_disc_r13->disc_tx_pool_list_r13, bref, 1, 4));
        }
      }
      if (precfg_relay_r13.is_present()) {
        HANDLE_CODE(precfg_relay_r13->unpack(bref));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_precfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("preconfigGeneral-r12");
  precfg_general_r12.to_json(j);
  j.write_fieldname("preconfigSync-r12");
  precfg_sync_r12.to_json(j);
  j.start_array("preconfigComm-r12");
  for (const auto& e1 : precfg_comm_r12) {
    e1.to_json(j);
  }
  j.end_array();
  if (ext) {
    if (precfg_comm_v1310.is_present()) {
      j.write_fieldname("preconfigComm-v1310");
      j.start_obj();
      j.start_array("commRxPoolList-r13");
      for (const auto& e1 : precfg_comm_v1310->comm_rx_pool_list_r13) {
        e1.to_json(j);
      }
      j.end_array();
      if (precfg_comm_v1310->comm_tx_pool_list_r13_present) {
        j.start_array("commTxPoolList-r13");
        for (const auto& e1 : precfg_comm_v1310->comm_tx_pool_list_r13) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
    }
    if (precfg_disc_r13.is_present()) {
      j.write_fieldname("preconfigDisc-r13");
      j.start_obj();
      j.start_array("discRxPoolList-r13");
      for (const auto& e1 : precfg_disc_r13->disc_rx_pool_list_r13) {
        e1.to_json(j);
      }
      j.end_array();
      if (precfg_disc_r13->disc_tx_pool_list_r13_present) {
        j.start_array("discTxPoolList-r13");
        for (const auto& e1 : precfg_disc_r13->disc_tx_pool_list_r13) {
          e1.to_json(j);
        }
        j.end_array();
      }
      j.end_obj();
    }
    if (precfg_relay_r13.is_present()) {
      j.write_fieldname("preconfigRelay-r13");
      precfg_relay_r13->to_json(j);
    }
  }
  j.end_obj();
}

// SL-V2X-PreconfigFreqInfo-r14 ::= SEQUENCE
SRSASN_CODE sl_v2x_precfg_freq_info_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(v2x_comm_precfg_sync_r14_present, 1));
  HANDLE_CODE(bref.pack(v2x_res_sel_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(zone_cfg_r14_present, 1));
  HANDLE_CODE(bref.pack(thres_sl_tx_prioritization_r14_present, 1));
  HANDLE_CODE(bref.pack(offset_dfn_r14_present, 1));

  HANDLE_CODE(v2x_comm_precfg_general_r14.pack(bref));
  if (v2x_comm_precfg_sync_r14_present) {
    HANDLE_CODE(v2x_comm_precfg_sync_r14.pack(bref));
  }
  HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_rx_pool_list_r14, 1, 16));
  HANDLE_CODE(pack_dyn_seq_of(bref, v2x_comm_tx_pool_list_r14, 1, 8));
  HANDLE_CODE(pack_dyn_seq_of(bref, p2x_comm_tx_pool_list_r14, 1, 8));
  if (v2x_res_sel_cfg_r14_present) {
    HANDLE_CODE(v2x_res_sel_cfg_r14.pack(bref));
  }
  if (zone_cfg_r14_present) {
    HANDLE_CODE(zone_cfg_r14.pack(bref));
  }
  HANDLE_CODE(sync_prio_r14.pack(bref));
  if (thres_sl_tx_prioritization_r14_present) {
    HANDLE_CODE(pack_integer(bref, thres_sl_tx_prioritization_r14, (uint8_t)1u, (uint8_t)8u));
  }
  if (offset_dfn_r14_present) {
    HANDLE_CODE(pack_integer(bref, offset_dfn_r14, (uint16_t)0u, (uint16_t)1000u));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= v2x_freq_sel_cfg_list_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(v2x_freq_sel_cfg_list_r15.is_present(), 1));
      if (v2x_freq_sel_cfg_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *v2x_freq_sel_cfg_list_r15, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_precfg_freq_info_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(v2x_comm_precfg_sync_r14_present, 1));
  HANDLE_CODE(bref.unpack(v2x_res_sel_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(zone_cfg_r14_present, 1));
  HANDLE_CODE(bref.unpack(thres_sl_tx_prioritization_r14_present, 1));
  HANDLE_CODE(bref.unpack(offset_dfn_r14_present, 1));

  HANDLE_CODE(v2x_comm_precfg_general_r14.unpack(bref));
  if (v2x_comm_precfg_sync_r14_present) {
    HANDLE_CODE(v2x_comm_precfg_sync_r14.unpack(bref));
  }
  HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_rx_pool_list_r14, bref, 1, 16));
  HANDLE_CODE(unpack_dyn_seq_of(v2x_comm_tx_pool_list_r14, bref, 1, 8));
  HANDLE_CODE(unpack_dyn_seq_of(p2x_comm_tx_pool_list_r14, bref, 1, 8));
  if (v2x_res_sel_cfg_r14_present) {
    HANDLE_CODE(v2x_res_sel_cfg_r14.unpack(bref));
  }
  if (zone_cfg_r14_present) {
    HANDLE_CODE(zone_cfg_r14.unpack(bref));
  }
  HANDLE_CODE(sync_prio_r14.unpack(bref));
  if (thres_sl_tx_prioritization_r14_present) {
    HANDLE_CODE(unpack_integer(thres_sl_tx_prioritization_r14, bref, (uint8_t)1u, (uint8_t)8u));
  }
  if (offset_dfn_r14_present) {
    HANDLE_CODE(unpack_integer(offset_dfn_r14, bref, (uint16_t)0u, (uint16_t)1000u));
  }

  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 v2x_freq_sel_cfg_list_r15_present;
      HANDLE_CODE(bref.unpack(v2x_freq_sel_cfg_list_r15_present, 1));
      v2x_freq_sel_cfg_list_r15.set_present(v2x_freq_sel_cfg_list_r15_present);
      if (v2x_freq_sel_cfg_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*v2x_freq_sel_cfg_list_r15, bref, 1, 8));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_v2x_precfg_freq_info_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("v2x-CommPreconfigGeneral-r14");
  v2x_comm_precfg_general_r14.to_json(j);
  if (v2x_comm_precfg_sync_r14_present) {
    j.write_fieldname("v2x-CommPreconfigSync-r14");
    v2x_comm_precfg_sync_r14.to_json(j);
  }
  j.start_array("v2x-CommRxPoolList-r14");
  for (const auto& e1 : v2x_comm_rx_pool_list_r14) {
    e1.to_json(j);
  }
  j.end_array();
  j.start_array("v2x-CommTxPoolList-r14");
  for (const auto& e1 : v2x_comm_tx_pool_list_r14) {
    e1.to_json(j);
  }
  j.end_array();
  j.start_array("p2x-CommTxPoolList-r14");
  for (const auto& e1 : p2x_comm_tx_pool_list_r14) {
    e1.to_json(j);
  }
  j.end_array();
  if (v2x_res_sel_cfg_r14_present) {
    j.write_fieldname("v2x-ResourceSelectionConfig-r14");
    v2x_res_sel_cfg_r14.to_json(j);
  }
  if (zone_cfg_r14_present) {
    j.write_fieldname("zoneConfig-r14");
    zone_cfg_r14.to_json(j);
  }
  j.write_str("syncPriority-r14", sync_prio_r14.to_string());
  if (thres_sl_tx_prioritization_r14_present) {
    j.write_int("thresSL-TxPrioritization-r14", thres_sl_tx_prioritization_r14);
  }
  if (offset_dfn_r14_present) {
    j.write_int("offsetDFN-r14", offset_dfn_r14);
  }
  if (ext) {
    if (v2x_freq_sel_cfg_list_r15.is_present()) {
      j.start_array("v2x-FreqSelectionConfigList-r15");
      for (const auto& e1 : *v2x_freq_sel_cfg_list_r15) {
        e1.to_json(j);
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// SL-V2X-Preconfiguration-r14 ::= SEQUENCE
SRSASN_CODE sl_v2x_precfg_r14_s::pack(bit_ref& bref) const
{
  bref.pack(ext, 1);
  HANDLE_CODE(bref.pack(anchor_carrier_freq_list_r14_present, 1));
  HANDLE_CODE(bref.pack(cbr_precfg_list_r14_present, 1));

  HANDLE_CODE(pack_dyn_seq_of(bref, v2x_precfg_freq_list_r14, 1, 8));
  if (anchor_carrier_freq_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, anchor_carrier_freq_list_r14, 1, 8, integer_packer<uint32_t>(0, 262143)));
  }
  if (cbr_precfg_list_r14_present) {
    HANDLE_CODE(cbr_precfg_list_r14.pack(bref));
  }

  if (ext) {
    ext_groups_packer_guard group_flags;
    group_flags[0] |= v2x_packet_dupl_cfg_r15.is_present();
    group_flags[0] |= sync_freq_list_r15.is_present();
    group_flags[0] |= slss_tx_multi_freq_r15_present;
    group_flags[0] |= v2x_tx_profile_list_r15.is_present();
    group_flags.pack(bref);

    if (group_flags[0]) {
      varlength_field_pack_guard varlen_scope(bref, false);

      HANDLE_CODE(bref.pack(v2x_packet_dupl_cfg_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(sync_freq_list_r15.is_present(), 1));
      HANDLE_CODE(bref.pack(slss_tx_multi_freq_r15_present, 1));
      HANDLE_CODE(bref.pack(v2x_tx_profile_list_r15.is_present(), 1));
      if (v2x_packet_dupl_cfg_r15.is_present()) {
        HANDLE_CODE(v2x_packet_dupl_cfg_r15->pack(bref));
      }
      if (sync_freq_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *sync_freq_list_r15, 1, 8, integer_packer<uint32_t>(0, 262143)));
      }
      if (v2x_tx_profile_list_r15.is_present()) {
        HANDLE_CODE(pack_dyn_seq_of(bref, *v2x_tx_profile_list_r15, 1, 256));
      }
    }
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE sl_v2x_precfg_r14_s::unpack(cbit_ref& bref)
{
  bref.unpack(ext, 1);
  HANDLE_CODE(bref.unpack(anchor_carrier_freq_list_r14_present, 1));
  HANDLE_CODE(bref.unpack(cbr_precfg_list_r14_present, 1));

  HANDLE_CODE(unpack_dyn_seq_of(v2x_precfg_freq_list_r14, bref, 1, 8));
  if (anchor_carrier_freq_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(anchor_carrier_freq_list_r14, bref, 1, 8, integer_packer<uint32_t>(0, 262143)));
  }
  if (cbr_precfg_list_r14_present) {
    HANDLE_CODE(cbr_precfg_list_r14.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 v2x_packet_dupl_cfg_r15_present;
      HANDLE_CODE(bref.unpack(v2x_packet_dupl_cfg_r15_present, 1));
      v2x_packet_dupl_cfg_r15.set_present(v2x_packet_dupl_cfg_r15_present);
      bool sync_freq_list_r15_present;
      HANDLE_CODE(bref.unpack(sync_freq_list_r15_present, 1));
      sync_freq_list_r15.set_present(sync_freq_list_r15_present);
      HANDLE_CODE(bref.unpack(slss_tx_multi_freq_r15_present, 1));
      bool v2x_tx_profile_list_r15_present;
      HANDLE_CODE(bref.unpack(v2x_tx_profile_list_r15_present, 1));
      v2x_tx_profile_list_r15.set_present(v2x_tx_profile_list_r15_present);
      if (v2x_packet_dupl_cfg_r15.is_present()) {
        HANDLE_CODE(v2x_packet_dupl_cfg_r15->unpack(bref));
      }
      if (sync_freq_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*sync_freq_list_r15, bref, 1, 8, integer_packer<uint32_t>(0, 262143)));
      }
      if (v2x_tx_profile_list_r15.is_present()) {
        HANDLE_CODE(unpack_dyn_seq_of(*v2x_tx_profile_list_r15, bref, 1, 256));
      }
    }
  }
  return SRSASN_SUCCESS;
}
void sl_v2x_precfg_r14_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("v2x-PreconfigFreqList-r14");
  for (const auto& e1 : v2x_precfg_freq_list_r14) {
    e1.to_json(j);
  }
  j.end_array();
  if (anchor_carrier_freq_list_r14_present) {
    j.start_array("anchorCarrierFreqList-r14");
    for (const auto& e1 : anchor_carrier_freq_list_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (cbr_precfg_list_r14_present) {
    j.write_fieldname("cbr-PreconfigList-r14");
    cbr_precfg_list_r14.to_json(j);
  }
  if (ext) {
    if (v2x_packet_dupl_cfg_r15.is_present()) {
      j.write_fieldname("v2x-PacketDuplicationConfig-r15");
      v2x_packet_dupl_cfg_r15->to_json(j);
    }
    if (sync_freq_list_r15.is_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_tx_profile_list_r15.is_present()) {
      j.start_array("v2x-TxProfileList-r15");
      for (const auto& e1 : *v2x_tx_profile_list_r15) {
        j.write_str(e1.to_string());
      }
      j.end_array();
    }
  }
  j.end_obj();
}

// UEPagingCoverageInformation-r13-IEs ::= SEQUENCE
SRSASN_CODE ue_paging_coverage_info_r13_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(mpdcch_num_repeat_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (mpdcch_num_repeat_r13_present) {
    HANDLE_CODE(pack_integer(bref, mpdcch_num_repeat_r13, (uint16_t)1u, (uint16_t)256u));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_paging_coverage_info_r13_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(mpdcch_num_repeat_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (mpdcch_num_repeat_r13_present) {
    HANDLE_CODE(unpack_integer(mpdcch_num_repeat_r13, bref, (uint16_t)1u, (uint16_t)256u));
  }

  return SRSASN_SUCCESS;
}
void ue_paging_coverage_info_r13_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (mpdcch_num_repeat_r13_present) {
    j.write_int("mpdcch-NumRepetition-r13", mpdcch_num_repeat_r13);
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// UEPagingCoverageInformation ::= SEQUENCE
SRSASN_CODE ue_paging_coverage_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_paging_coverage_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void ue_paging_coverage_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_paging_coverage_info_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_paging_coverage_info_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ue_paging_coverage_info_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ue_paging_coverage_info_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_paging_coverage_info_r13:
      j.write_fieldname("uePagingCoverageInformation-r13");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ue_paging_coverage_info_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_paging_coverage_info_r13:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_paging_coverage_info_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_paging_coverage_info_r13:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_paging_coverage_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// 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_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<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.get<c1_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.get<c1_c_>().unpack(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_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ue_radio_access_cap_info_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ue_radio_access_cap_info_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_radio_access_cap_info_r8:
      j.write_fieldname("ueRadioAccessCapabilityInformation-r8");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ue_radio_access_cap_info_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_radio_access_cap_info_r8:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_radio_access_cap_info_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_radio_access_cap_info_r8:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_access_cap_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// UERadioPagingInformation-v1310-IEs ::= SEQUENCE
SRSASN_CODE ue_radio_paging_info_v1310_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(supported_band_list_eutra_for_paging_r13_present, 1));
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  if (supported_band_list_eutra_for_paging_r13_present) {
    HANDLE_CODE(
        pack_dyn_seq_of(bref, supported_band_list_eutra_for_paging_r13, 1, 64, integer_packer<uint16_t>(1, 256)));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_radio_paging_info_v1310_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(supported_band_list_eutra_for_paging_r13_present, 1));
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  if (supported_band_list_eutra_for_paging_r13_present) {
    HANDLE_CODE(
        unpack_dyn_seq_of(supported_band_list_eutra_for_paging_r13, bref, 1, 64, integer_packer<uint16_t>(1, 256)));
  }

  return SRSASN_SUCCESS;
}
void ue_radio_paging_info_v1310_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (supported_band_list_eutra_for_paging_r13_present) {
    j.start_array("supportedBandListEUTRAForPaging-r13");
    for (const auto& e1 : supported_band_list_eutra_for_paging_r13) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    j.start_obj();
    j.end_obj();
  }
  j.end_obj();
}

// UERadioPagingInformation-r12-IEs ::= SEQUENCE
SRSASN_CODE ue_radio_paging_info_r12_ies_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(non_crit_ext_present, 1));

  HANDLE_CODE(ue_radio_paging_info_r12.pack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_radio_paging_info_r12_ies_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(non_crit_ext_present, 1));

  HANDLE_CODE(ue_radio_paging_info_r12.unpack(bref));
  if (non_crit_ext_present) {
    HANDLE_CODE(non_crit_ext.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void ue_radio_paging_info_r12_ies_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("ue-RadioPagingInfo-r12", ue_radio_paging_info_r12.to_string());
  if (non_crit_ext_present) {
    j.write_fieldname("nonCriticalExtension");
    non_crit_ext.to_json(j);
  }
  j.end_obj();
}

// UERadioPagingInformation ::= SEQUENCE
SRSASN_CODE ue_radio_paging_info_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(crit_exts.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_radio_paging_info_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(crit_exts.unpack(bref));

  return SRSASN_SUCCESS;
}
void ue_radio_paging_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_paging_info_s::crit_exts_c_::destroy_()
{
  switch (type_) {
    case types::c1:
      c.destroy<c1_c_>();
      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<c1_c_>();
      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<c1_c_>());
      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<c1_c_>());
      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
{
  j.start_obj();
  switch (type_) {
    case types::c1:
      j.write_fieldname("c1");
      c.get<c1_c_>().to_json(j);
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_");
  }
  j.end_obj();
}
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<c1_c_>().pack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_radio_paging_info_s::crit_exts_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::c1:
      HANDLE_CODE(c.get<c1_c_>().unpack(bref));
      break;
    case types::crit_exts_future:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

void ue_radio_paging_info_s::crit_exts_c_::c1_c_::set(types::options e)
{
  type_ = e;
}
void ue_radio_paging_info_s::crit_exts_c_::c1_c_::to_json(json_writer& j) const
{
  j.start_obj();
  switch (type_) {
    case types::ue_radio_paging_info_r12:
      j.write_fieldname("ueRadioPagingInformation-r12");
      c.to_json(j);
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_::c1_c_");
  }
  j.end_obj();
}
SRSASN_CODE ue_radio_paging_info_s::crit_exts_c_::c1_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::ue_radio_paging_info_r12:
      HANDLE_CODE(c.pack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE ue_radio_paging_info_s::crit_exts_c_::c1_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::ue_radio_paging_info_r12:
      HANDLE_CODE(c.unpack(bref));
      break;
    case types::spare7:
      break;
    case types::spare6:
      break;
    case types::spare5:
      break;
    case types::spare4:
      break;
    case types::spare3:
      break;
    case types::spare2:
      break;
    case types::spare1:
      break;
    default:
      log_invalid_choice_id(type_, "ue_radio_paging_info_s::crit_exts_c_::c1_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// VarConnEstFailReport-r11 ::= SEQUENCE
SRSASN_CODE var_conn_est_fail_report_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(conn_est_fail_report_r11.pack(bref));
  HANDLE_CODE(plmn_id_r11.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_conn_est_fail_report_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(conn_est_fail_report_r11.unpack(bref));
  HANDLE_CODE(plmn_id_r11.unpack(bref));

  return SRSASN_SUCCESS;
}
void var_conn_est_fail_report_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("connEstFailReport-r11");
  conn_est_fail_report_r11.to_json(j);
  j.write_fieldname("plmn-Identity-r11");
  plmn_id_r11.to_json(j);
  j.end_obj();
}

// VarLogMeasConfig-r10 ::= SEQUENCE
SRSASN_CODE var_log_meas_cfg_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(area_cfg_r10_present, 1));

  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.pack(bref));
  }
  HANDLE_CODE(logging_dur_r10.pack(bref));
  HANDLE_CODE(logging_interv_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_log_meas_cfg_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(area_cfg_r10_present, 1));

  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.unpack(bref));
  }
  HANDLE_CODE(logging_dur_r10.unpack(bref));
  HANDLE_CODE(logging_interv_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void var_log_meas_cfg_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (area_cfg_r10_present) {
    j.write_fieldname("areaConfiguration-r10");
    area_cfg_r10.to_json(j);
  }
  j.write_str("loggingDuration-r10", logging_dur_r10.to_string());
  j.write_str("loggingInterval-r10", logging_interv_r10.to_string());
  j.end_obj();
}

// VarLogMeasConfig-r11 ::= SEQUENCE
SRSASN_CODE var_log_meas_cfg_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(area_cfg_r10_present, 1));
  HANDLE_CODE(bref.pack(area_cfg_v1130_present, 1));

  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.pack(bref));
  }
  if (area_cfg_v1130_present) {
    HANDLE_CODE(area_cfg_v1130.pack(bref));
  }
  HANDLE_CODE(logging_dur_r10.pack(bref));
  HANDLE_CODE(logging_interv_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_log_meas_cfg_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(area_cfg_r10_present, 1));
  HANDLE_CODE(bref.unpack(area_cfg_v1130_present, 1));

  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.unpack(bref));
  }
  if (area_cfg_v1130_present) {
    HANDLE_CODE(area_cfg_v1130.unpack(bref));
  }
  HANDLE_CODE(logging_dur_r10.unpack(bref));
  HANDLE_CODE(logging_interv_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void var_log_meas_cfg_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (area_cfg_r10_present) {
    j.write_fieldname("areaConfiguration-r10");
    area_cfg_r10.to_json(j);
  }
  if (area_cfg_v1130_present) {
    j.write_fieldname("areaConfiguration-v1130");
    area_cfg_v1130.to_json(j);
  }
  j.write_str("loggingDuration-r10", logging_dur_r10.to_string());
  j.write_str("loggingInterval-r10", logging_interv_r10.to_string());
  j.end_obj();
}

// VarLogMeasConfig-r12 ::= SEQUENCE
SRSASN_CODE var_log_meas_cfg_r12_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(area_cfg_r10_present, 1));
  HANDLE_CODE(bref.pack(area_cfg_v1130_present, 1));
  HANDLE_CODE(bref.pack(target_mbsfn_area_list_r12_present, 1));

  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.pack(bref));
  }
  if (area_cfg_v1130_present) {
    HANDLE_CODE(area_cfg_v1130.pack(bref));
  }
  HANDLE_CODE(logging_dur_r10.pack(bref));
  HANDLE_CODE(logging_interv_r10.pack(bref));
  if (target_mbsfn_area_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, target_mbsfn_area_list_r12, 0, 8));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_log_meas_cfg_r12_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(area_cfg_r10_present, 1));
  HANDLE_CODE(bref.unpack(area_cfg_v1130_present, 1));
  HANDLE_CODE(bref.unpack(target_mbsfn_area_list_r12_present, 1));

  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.unpack(bref));
  }
  if (area_cfg_v1130_present) {
    HANDLE_CODE(area_cfg_v1130.unpack(bref));
  }
  HANDLE_CODE(logging_dur_r10.unpack(bref));
  HANDLE_CODE(logging_interv_r10.unpack(bref));
  if (target_mbsfn_area_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(target_mbsfn_area_list_r12, bref, 0, 8));
  }

  return SRSASN_SUCCESS;
}
void var_log_meas_cfg_r12_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (area_cfg_r10_present) {
    j.write_fieldname("areaConfiguration-r10");
    area_cfg_r10.to_json(j);
  }
  if (area_cfg_v1130_present) {
    j.write_fieldname("areaConfiguration-v1130");
    area_cfg_v1130.to_json(j);
  }
  j.write_str("loggingDuration-r10", logging_dur_r10.to_string());
  j.write_str("loggingInterval-r10", logging_interv_r10.to_string());
  if (target_mbsfn_area_list_r12_present) {
    j.start_array("targetMBSFN-AreaList-r12");
    for (const auto& e1 : target_mbsfn_area_list_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.end_obj();
}

// VarLogMeasConfig-r15 ::= SEQUENCE
SRSASN_CODE var_log_meas_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(area_cfg_r10_present, 1));
  HANDLE_CODE(bref.pack(area_cfg_v1130_present, 1));
  HANDLE_CODE(bref.pack(target_mbsfn_area_list_r12_present, 1));
  HANDLE_CODE(bref.pack(bt_name_list_r15_present, 1));
  HANDLE_CODE(bref.pack(wlan_name_list_r15_present, 1));

  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.pack(bref));
  }
  if (area_cfg_v1130_present) {
    HANDLE_CODE(area_cfg_v1130.pack(bref));
  }
  HANDLE_CODE(logging_dur_r10.pack(bref));
  HANDLE_CODE(logging_interv_r10.pack(bref));
  if (target_mbsfn_area_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, target_mbsfn_area_list_r12, 0, 8));
  }
  if (bt_name_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, bt_name_list_r15, 1, 4));
  }
  if (wlan_name_list_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, wlan_name_list_r15, 1, 4));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_log_meas_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(area_cfg_r10_present, 1));
  HANDLE_CODE(bref.unpack(area_cfg_v1130_present, 1));
  HANDLE_CODE(bref.unpack(target_mbsfn_area_list_r12_present, 1));
  HANDLE_CODE(bref.unpack(bt_name_list_r15_present, 1));
  HANDLE_CODE(bref.unpack(wlan_name_list_r15_present, 1));

  if (area_cfg_r10_present) {
    HANDLE_CODE(area_cfg_r10.unpack(bref));
  }
  if (area_cfg_v1130_present) {
    HANDLE_CODE(area_cfg_v1130.unpack(bref));
  }
  HANDLE_CODE(logging_dur_r10.unpack(bref));
  HANDLE_CODE(logging_interv_r10.unpack(bref));
  if (target_mbsfn_area_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(target_mbsfn_area_list_r12, bref, 0, 8));
  }
  if (bt_name_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(bt_name_list_r15, bref, 1, 4));
  }
  if (wlan_name_list_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(wlan_name_list_r15, bref, 1, 4));
  }

  return SRSASN_SUCCESS;
}
void var_log_meas_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (area_cfg_r10_present) {
    j.write_fieldname("areaConfiguration-r10");
    area_cfg_r10.to_json(j);
  }
  if (area_cfg_v1130_present) {
    j.write_fieldname("areaConfiguration-v1130");
    area_cfg_v1130.to_json(j);
  }
  j.write_str("loggingDuration-r10", logging_dur_r10.to_string());
  j.write_str("loggingInterval-r10", logging_interv_r10.to_string());
  if (target_mbsfn_area_list_r12_present) {
    j.start_array("targetMBSFN-AreaList-r12");
    for (const auto& e1 : target_mbsfn_area_list_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (bt_name_list_r15_present) {
    j.start_array("bt-NameList-r15");
    for (const auto& e1 : bt_name_list_r15) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  if (wlan_name_list_r15_present) {
    j.start_array("wlan-NameList-r15");
    for (const auto& e1 : wlan_name_list_r15) {
      j.write_str(e1.to_string());
    }
    j.end_array();
  }
  j.end_obj();
}

// VarLogMeasReport-r10 ::= SEQUENCE
SRSASN_CODE var_log_meas_report_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(trace_ref_r10.pack(bref));
  HANDLE_CODE(trace_recording_session_ref_r10.pack(bref));
  HANDLE_CODE(tce_id_r10.pack(bref));
  HANDLE_CODE(plmn_id_r10.pack(bref));
  HANDLE_CODE(absolute_time_info_r10.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, log_meas_info_list_r10, 1, 4060));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_log_meas_report_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(trace_ref_r10.unpack(bref));
  HANDLE_CODE(trace_recording_session_ref_r10.unpack(bref));
  HANDLE_CODE(tce_id_r10.unpack(bref));
  HANDLE_CODE(plmn_id_r10.unpack(bref));
  HANDLE_CODE(absolute_time_info_r10.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(log_meas_info_list_r10, bref, 1, 4060));

  return SRSASN_SUCCESS;
}
void var_log_meas_report_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("traceReference-r10");
  trace_ref_r10.to_json(j);
  j.write_str("traceRecordingSessionRef-r10", trace_recording_session_ref_r10.to_string());
  j.write_str("tce-Id-r10", tce_id_r10.to_string());
  j.write_fieldname("plmn-Identity-r10");
  plmn_id_r10.to_json(j);
  j.write_str("absoluteTimeInfo-r10", absolute_time_info_r10.to_string());
  j.start_array("logMeasInfoList-r10");
  for (const auto& e1 : log_meas_info_list_r10) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// VarLogMeasReport-r11 ::= SEQUENCE
SRSASN_CODE var_log_meas_report_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(trace_ref_r10.pack(bref));
  HANDLE_CODE(trace_recording_session_ref_r10.pack(bref));
  HANDLE_CODE(tce_id_r10.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r11, 1, 16));
  HANDLE_CODE(absolute_time_info_r10.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, log_meas_info_list_r10, 1, 4060));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_log_meas_report_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(trace_ref_r10.unpack(bref));
  HANDLE_CODE(trace_recording_session_ref_r10.unpack(bref));
  HANDLE_CODE(tce_id_r10.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r11, bref, 1, 16));
  HANDLE_CODE(absolute_time_info_r10.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(log_meas_info_list_r10, bref, 1, 4060));

  return SRSASN_SUCCESS;
}
void var_log_meas_report_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("traceReference-r10");
  trace_ref_r10.to_json(j);
  j.write_str("traceRecordingSessionRef-r10", trace_recording_session_ref_r10.to_string());
  j.write_str("tce-Id-r10", tce_id_r10.to_string());
  j.start_array("plmn-IdentityList-r11");
  for (const auto& e1 : plmn_id_list_r11) {
    e1.to_json(j);
  }
  j.end_array();
  j.write_str("absoluteTimeInfo-r10", absolute_time_info_r10.to_string());
  j.start_array("logMeasInfoList-r10");
  for (const auto& e1 : log_meas_info_list_r10) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// VarMeasConfig ::= SEQUENCE
SRSASN_CODE var_meas_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_id_list_present, 1));
  HANDLE_CODE(bref.pack(meas_id_list_ext_r12_present, 1));
  HANDLE_CODE(bref.pack(meas_id_list_v1310_present, 1));
  HANDLE_CODE(bref.pack(meas_id_list_ext_v1310_present, 1));
  HANDLE_CODE(bref.pack(meas_obj_list_present, 1));
  HANDLE_CODE(bref.pack(meas_obj_list_ext_r13_present, 1));
  HANDLE_CODE(bref.pack(meas_obj_list_v9i0_present, 1));
  HANDLE_CODE(bref.pack(report_cfg_list_present, 1));
  HANDLE_CODE(bref.pack(quant_cfg_present, 1));
  HANDLE_CODE(bref.pack(meas_scale_factor_r12_present, 1));
  HANDLE_CODE(bref.pack(s_measure_present, 1));
  HANDLE_CODE(bref.pack(speed_state_pars_present, 1));
  HANDLE_CODE(bref.pack(allow_interruptions_r11_present, 1));

  if (meas_id_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_id_list, 1, 32));
  }
  if (meas_id_list_ext_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_id_list_ext_r12, 1, 32));
  }
  if (meas_id_list_v1310_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_id_list_v1310, 1, 32));
  }
  if (meas_id_list_ext_v1310_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_id_list_ext_v1310, 1, 32));
  }
  if (meas_obj_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_obj_list, 1, 32));
  }
  if (meas_obj_list_ext_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_obj_list_ext_r13, 1, 32));
  }
  if (meas_obj_list_v9i0_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_obj_list_v9i0, 1, 32));
  }
  if (report_cfg_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, report_cfg_list, 1, 32));
  }
  if (quant_cfg_present) {
    HANDLE_CODE(quant_cfg.pack(bref));
  }
  if (meas_scale_factor_r12_present) {
    HANDLE_CODE(meas_scale_factor_r12.pack(bref));
  }
  if (s_measure_present) {
    HANDLE_CODE(pack_integer(bref, s_measure, (int16_t)-140, (int16_t)-44));
  }
  if (speed_state_pars_present) {
    HANDLE_CODE(speed_state_pars.pack(bref));
  }
  if (allow_interruptions_r11_present) {
    HANDLE_CODE(bref.pack(allow_interruptions_r11, 1));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_meas_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_id_list_present, 1));
  HANDLE_CODE(bref.unpack(meas_id_list_ext_r12_present, 1));
  HANDLE_CODE(bref.unpack(meas_id_list_v1310_present, 1));
  HANDLE_CODE(bref.unpack(meas_id_list_ext_v1310_present, 1));
  HANDLE_CODE(bref.unpack(meas_obj_list_present, 1));
  HANDLE_CODE(bref.unpack(meas_obj_list_ext_r13_present, 1));
  HANDLE_CODE(bref.unpack(meas_obj_list_v9i0_present, 1));
  HANDLE_CODE(bref.unpack(report_cfg_list_present, 1));
  HANDLE_CODE(bref.unpack(quant_cfg_present, 1));
  HANDLE_CODE(bref.unpack(meas_scale_factor_r12_present, 1));
  HANDLE_CODE(bref.unpack(s_measure_present, 1));
  HANDLE_CODE(bref.unpack(speed_state_pars_present, 1));
  HANDLE_CODE(bref.unpack(allow_interruptions_r11_present, 1));

  if (meas_id_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_id_list, bref, 1, 32));
  }
  if (meas_id_list_ext_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_id_list_ext_r12, bref, 1, 32));
  }
  if (meas_id_list_v1310_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_id_list_v1310, bref, 1, 32));
  }
  if (meas_id_list_ext_v1310_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_id_list_ext_v1310, bref, 1, 32));
  }
  if (meas_obj_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_obj_list, bref, 1, 32));
  }
  if (meas_obj_list_ext_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_obj_list_ext_r13, bref, 1, 32));
  }
  if (meas_obj_list_v9i0_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_obj_list_v9i0, bref, 1, 32));
  }
  if (report_cfg_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(report_cfg_list, bref, 1, 32));
  }
  if (quant_cfg_present) {
    HANDLE_CODE(quant_cfg.unpack(bref));
  }
  if (meas_scale_factor_r12_present) {
    HANDLE_CODE(meas_scale_factor_r12.unpack(bref));
  }
  if (s_measure_present) {
    HANDLE_CODE(unpack_integer(s_measure, bref, (int16_t)-140, (int16_t)-44));
  }
  if (speed_state_pars_present) {
    HANDLE_CODE(speed_state_pars.unpack(bref));
  }
  if (allow_interruptions_r11_present) {
    HANDLE_CODE(bref.unpack(allow_interruptions_r11, 1));
  }

  return SRSASN_SUCCESS;
}
void var_meas_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_id_list_present) {
    j.start_array("measIdList");
    for (const auto& e1 : meas_id_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_id_list_ext_r12_present) {
    j.start_array("measIdListExt-r12");
    for (const auto& e1 : meas_id_list_ext_r12) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_id_list_v1310_present) {
    j.start_array("measIdList-v1310");
    for (const auto& e1 : meas_id_list_v1310) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_id_list_ext_v1310_present) {
    j.start_array("measIdListExt-v1310");
    for (const auto& e1 : meas_id_list_ext_v1310) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_obj_list_present) {
    j.start_array("measObjectList");
    for (const auto& e1 : meas_obj_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_obj_list_ext_r13_present) {
    j.start_array("measObjectListExt-r13");
    for (const auto& e1 : meas_obj_list_ext_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (meas_obj_list_v9i0_present) {
    j.start_array("measObjectList-v9i0");
    for (const auto& e1 : meas_obj_list_v9i0) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (report_cfg_list_present) {
    j.start_array("reportConfigList");
    for (const auto& e1 : report_cfg_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (quant_cfg_present) {
    j.write_fieldname("quantityConfig");
    quant_cfg.to_json(j);
  }
  if (meas_scale_factor_r12_present) {
    j.write_str("measScaleFactor-r12", meas_scale_factor_r12.to_string());
  }
  if (s_measure_present) {
    j.write_int("s-Measure", s_measure);
  }
  if (speed_state_pars_present) {
    j.write_fieldname("speedStatePars");
    speed_state_pars.to_json(j);
  }
  if (allow_interruptions_r11_present) {
    j.write_bool("allowInterruptions-r11", allow_interruptions_r11);
  }
  j.end_obj();
}

void var_meas_cfg_s::speed_state_pars_c_::set(types::options e)
{
  type_ = e;
}
void var_meas_cfg_s::speed_state_pars_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("mobilityStateParameters");
      c.mob_state_params.to_json(j);
      j.write_fieldname("timeToTrigger-SF");
      c.time_to_trigger_sf.to_json(j);
      j.end_obj();
      break;
    default:
      log_invalid_choice_id(type_, "var_meas_cfg_s::speed_state_pars_c_");
  }
  j.end_obj();
}
SRSASN_CODE var_meas_cfg_s::speed_state_pars_c_::pack(bit_ref& bref) const
{
  type_.pack(bref);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.mob_state_params.pack(bref));
      HANDLE_CODE(c.time_to_trigger_sf.pack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "var_meas_cfg_s::speed_state_pars_c_");
      return SRSASN_ERROR_ENCODE_FAIL;
  }
  return SRSASN_SUCCESS;
}
SRSASN_CODE var_meas_cfg_s::speed_state_pars_c_::unpack(cbit_ref& bref)
{
  types e;
  e.unpack(bref);
  set(e);
  switch (type_) {
    case types::release:
      break;
    case types::setup:
      HANDLE_CODE(c.mob_state_params.unpack(bref));
      HANDLE_CODE(c.time_to_trigger_sf.unpack(bref));
      break;
    default:
      log_invalid_choice_id(type_, "var_meas_cfg_s::speed_state_pars_c_");
      return SRSASN_ERROR_DECODE_FAIL;
  }
  return SRSASN_SUCCESS;
}

// VarMeasIdleConfig-r15 ::= SEQUENCE
SRSASN_CODE var_meas_idle_cfg_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_idle_carrier_list_eutra_r15_present, 1));

  if (meas_idle_carrier_list_eutra_r15_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, meas_idle_carrier_list_eutra_r15, 1, 8));
  }
  HANDLE_CODE(meas_idle_dur_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_meas_idle_cfg_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_idle_carrier_list_eutra_r15_present, 1));

  if (meas_idle_carrier_list_eutra_r15_present) {
    HANDLE_CODE(unpack_dyn_seq_of(meas_idle_carrier_list_eutra_r15, bref, 1, 8));
  }
  HANDLE_CODE(meas_idle_dur_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void var_meas_idle_cfg_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (meas_idle_carrier_list_eutra_r15_present) {
    j.start_array("measIdleCarrierListEUTRA-r15");
    for (const auto& e1 : meas_idle_carrier_list_eutra_r15) {
      e1.to_json(j);
    }
    j.end_array();
  }
  j.write_str("measIdleDuration-r15", meas_idle_dur_r15.to_string());
  j.end_obj();
}

// VarMeasIdleReport-r15 ::= SEQUENCE
SRSASN_CODE var_meas_idle_report_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(pack_dyn_seq_of(bref, meas_report_idle_r15, 1, 3));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_meas_idle_report_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(unpack_dyn_seq_of(meas_report_idle_r15, bref, 1, 3));

  return SRSASN_SUCCESS;
}
void var_meas_idle_report_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.start_array("measReportIdle-r15");
  for (const auto& e1 : meas_report_idle_r15) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// VarMeasReport ::= SEQUENCE
SRSASN_CODE var_meas_report_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(meas_id_v1250_present, 1));
  HANDLE_CODE(bref.pack(cells_triggered_list_present, 1));
  HANDLE_CODE(bref.pack(csi_rs_triggered_list_r12_present, 1));
  HANDLE_CODE(bref.pack(pools_triggered_list_r14_present, 1));

  HANDLE_CODE(pack_integer(bref, meas_id, (uint8_t)1u, (uint8_t)32u));
  if (meas_id_v1250_present) {
    HANDLE_CODE(pack_integer(bref, meas_id_v1250, (uint8_t)33u, (uint8_t)64u));
  }
  if (cells_triggered_list_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, cells_triggered_list, 1, 32));
  }
  if (csi_rs_triggered_list_r12_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, csi_rs_triggered_list_r12, 1, 96, integer_packer<uint8_t>(1, 96)));
  }
  if (pools_triggered_list_r14_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, pools_triggered_list_r14, 1, 72, integer_packer<uint8_t>(1, 72)));
  }
  HANDLE_CODE(pack_unconstrained_integer(bref, nof_reports_sent));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_meas_report_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(meas_id_v1250_present, 1));
  HANDLE_CODE(bref.unpack(cells_triggered_list_present, 1));
  HANDLE_CODE(bref.unpack(csi_rs_triggered_list_r12_present, 1));
  HANDLE_CODE(bref.unpack(pools_triggered_list_r14_present, 1));

  HANDLE_CODE(unpack_integer(meas_id, bref, (uint8_t)1u, (uint8_t)32u));
  if (meas_id_v1250_present) {
    HANDLE_CODE(unpack_integer(meas_id_v1250, bref, (uint8_t)33u, (uint8_t)64u));
  }
  if (cells_triggered_list_present) {
    HANDLE_CODE(unpack_dyn_seq_of(cells_triggered_list, bref, 1, 32));
  }
  if (csi_rs_triggered_list_r12_present) {
    HANDLE_CODE(unpack_dyn_seq_of(csi_rs_triggered_list_r12, bref, 1, 96, integer_packer<uint8_t>(1, 96)));
  }
  if (pools_triggered_list_r14_present) {
    HANDLE_CODE(unpack_dyn_seq_of(pools_triggered_list_r14, bref, 1, 72, integer_packer<uint8_t>(1, 72)));
  }
  HANDLE_CODE(unpack_unconstrained_integer(nof_reports_sent, bref));

  return SRSASN_SUCCESS;
}
void var_meas_report_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_int("measId", meas_id);
  if (meas_id_v1250_present) {
    j.write_int("measId-v1250", meas_id_v1250);
  }
  if (cells_triggered_list_present) {
    j.start_array("cellsTriggeredList");
    for (const auto& e1 : cells_triggered_list) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (csi_rs_triggered_list_r12_present) {
    j.start_array("csi-RS-TriggeredList-r12");
    for (const auto& e1 : csi_rs_triggered_list_r12) {
      j.write_int(e1);
    }
    j.end_array();
  }
  if (pools_triggered_list_r14_present) {
    j.start_array("poolsTriggeredList-r14");
    for (const auto& e1 : pools_triggered_list_r14) {
      j.write_int(e1);
    }
    j.end_array();
  }
  j.write_int("numberOfReportsSent", nof_reports_sent);
  j.end_obj();
}

// VarRLF-Report-r10 ::= SEQUENCE
SRSASN_CODE var_rlf_report_r10_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(rlf_report_r10.pack(bref));
  HANDLE_CODE(plmn_id_r10.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_rlf_report_r10_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(rlf_report_r10.unpack(bref));
  HANDLE_CODE(plmn_id_r10.unpack(bref));

  return SRSASN_SUCCESS;
}
void var_rlf_report_r10_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("rlf-Report-r10");
  rlf_report_r10.to_json(j);
  j.write_fieldname("plmn-Identity-r10");
  plmn_id_r10.to_json(j);
  j.end_obj();
}

// VarRLF-Report-r11 ::= SEQUENCE
SRSASN_CODE var_rlf_report_r11_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(rlf_report_r10.pack(bref));
  HANDLE_CODE(pack_dyn_seq_of(bref, plmn_id_list_r11, 1, 16));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_rlf_report_r11_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(rlf_report_r10.unpack(bref));
  HANDLE_CODE(unpack_dyn_seq_of(plmn_id_list_r11, bref, 1, 16));

  return SRSASN_SUCCESS;
}
void var_rlf_report_r11_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_fieldname("rlf-Report-r10");
  rlf_report_r10.to_json(j);
  j.start_array("plmn-IdentityList-r11");
  for (const auto& e1 : plmn_id_list_r11) {
    e1.to_json(j);
  }
  j.end_array();
  j.end_obj();
}

// VarShortINACTIVE-MAC-Input-r15 ::= SEQUENCE
SRSASN_CODE var_short_inactive_mac_input_r15_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cell_id_r15.pack(bref));
  HANDLE_CODE(pack_integer(bref, pci_r15, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(c_rnti_r15.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_short_inactive_mac_input_r15_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(cell_id_r15.unpack(bref));
  HANDLE_CODE(unpack_integer(pci_r15, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(c_rnti_r15.unpack(bref));

  return SRSASN_SUCCESS;
}
void var_short_inactive_mac_input_r15_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cellIdentity-r15", cell_id_r15.to_string());
  j.write_int("physCellId-r15", pci_r15);
  j.write_str("c-RNTI-r15", c_rnti_r15.to_string());
  j.end_obj();
}

// VarShortMAC-Input ::= SEQUENCE
SRSASN_CODE var_short_mac_input_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cell_id.pack(bref));
  HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(c_rnti.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_short_mac_input_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(cell_id.unpack(bref));
  HANDLE_CODE(unpack_integer(pci, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(c_rnti.unpack(bref));

  return SRSASN_SUCCESS;
}
void var_short_mac_input_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cellIdentity", cell_id.to_string());
  j.write_int("physCellId", pci);
  j.write_str("c-RNTI", c_rnti.to_string());
  j.end_obj();
}

// VarShortResumeMAC-Input-r13 ::= SEQUENCE
SRSASN_CODE var_short_resume_mac_input_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(cell_id_r13.pack(bref));
  HANDLE_CODE(pack_integer(bref, pci_r13, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(c_rnti_r13.pack(bref));
  HANDLE_CODE(resume_discriminator_r13.pack(bref));

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_short_resume_mac_input_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(cell_id_r13.unpack(bref));
  HANDLE_CODE(unpack_integer(pci_r13, bref, (uint16_t)0u, (uint16_t)503u));
  HANDLE_CODE(c_rnti_r13.unpack(bref));
  HANDLE_CODE(resume_discriminator_r13.unpack(bref));

  return SRSASN_SUCCESS;
}
void var_short_resume_mac_input_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("cellIdentity-r13", cell_id_r13.to_string());
  j.write_int("physCellId-r13", pci_r13);
  j.write_str("c-RNTI-r13", c_rnti_r13.to_string());
  j.write_str("resumeDiscriminator-r13", resume_discriminator_r13.to_string());
  j.end_obj();
}

// VarWLAN-MobilityConfig ::= SEQUENCE
SRSASN_CODE var_wlan_mob_cfg_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(wlan_mob_set_r13_present, 1));
  HANDLE_CODE(bref.pack(success_report_requested_present, 1));
  HANDLE_CODE(bref.pack(wlan_suspend_cfg_r14_present, 1));

  if (wlan_mob_set_r13_present) {
    HANDLE_CODE(pack_dyn_seq_of(bref, wlan_mob_set_r13, 1, 32));
  }
  if (wlan_suspend_cfg_r14_present) {
    HANDLE_CODE(wlan_suspend_cfg_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_wlan_mob_cfg_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(wlan_mob_set_r13_present, 1));
  HANDLE_CODE(bref.unpack(success_report_requested_present, 1));
  HANDLE_CODE(bref.unpack(wlan_suspend_cfg_r14_present, 1));

  if (wlan_mob_set_r13_present) {
    HANDLE_CODE(unpack_dyn_seq_of(wlan_mob_set_r13, bref, 1, 32));
  }
  if (wlan_suspend_cfg_r14_present) {
    HANDLE_CODE(wlan_suspend_cfg_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void var_wlan_mob_cfg_s::to_json(json_writer& j) const
{
  j.start_obj();
  if (wlan_mob_set_r13_present) {
    j.start_array("wlan-MobilitySet-r13");
    for (const auto& e1 : wlan_mob_set_r13) {
      e1.to_json(j);
    }
    j.end_array();
  }
  if (success_report_requested_present) {
    j.write_str("successReportRequested", "true");
  }
  if (wlan_suspend_cfg_r14_present) {
    j.write_fieldname("wlan-SuspendConfig-r14");
    wlan_suspend_cfg_r14.to_json(j);
  }
  j.end_obj();
}

// VarWLAN-Status-r13 ::= SEQUENCE
SRSASN_CODE var_wlan_status_r13_s::pack(bit_ref& bref) const
{
  HANDLE_CODE(bref.pack(status_r14_present, 1));

  HANDLE_CODE(status_r13.pack(bref));
  if (status_r14_present) {
    HANDLE_CODE(status_r14.pack(bref));
  }

  return SRSASN_SUCCESS;
}
SRSASN_CODE var_wlan_status_r13_s::unpack(cbit_ref& bref)
{
  HANDLE_CODE(bref.unpack(status_r14_present, 1));

  HANDLE_CODE(status_r13.unpack(bref));
  if (status_r14_present) {
    HANDLE_CODE(status_r14.unpack(bref));
  }

  return SRSASN_SUCCESS;
}
void var_wlan_status_r13_s::to_json(json_writer& j) const
{
  j.start_obj();
  j.write_str("status-r13", status_r13.to_string());
  if (status_r14_present) {
    j.write_str("status-r14", status_r14.to_string());
  }
  j.end_obj();
}
