added default enum inits

master
Francisco Paisana 6 years ago committed by Andre Puschmann
parent 5f7b6ba79e
commit dc0b903130

@ -29,10 +29,6 @@ and at http://www.gnu.org/licenses/.
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
// TODOS/FIXME:
// - ext flag as an template arg?
// - custom allocators?
namespace asn1 { namespace asn1 {
#define ASN_16K 16383 #define ASN_16K 16383
@ -314,14 +310,14 @@ bool number_string_to_enum(EnumType& e, const std::string& val)
return false; return false;
} }
template <class EnumType, uint32_t N, uint32_t M, bool E> template <class EnumType, bool E = false, uint32_t M = 0>
class enumerated : public EnumType class enumerated : public EnumType
{ {
public: public:
static const uint32_t nof_types = N, nof_exts = M; static const uint32_t nof_types = EnumType::nulltype, nof_exts = M;
static const bool has_ext = E; static const bool has_ext = E;
enumerated() {} enumerated() { EnumType::value = EnumType::nulltype; }
enumerated(typename EnumType::options o) { EnumType::value = o; } enumerated(typename EnumType::options o) { EnumType::value = o; }
SRSASN_CODE pack(bit_ref& bref) const { return pack_enum(bref, EnumType::value); } SRSASN_CODE pack(bit_ref& bref) const { return pack_enum(bref, EnumType::value); }
SRSASN_CODE unpack(bit_ref& bref) { return unpack_enum(EnumType::value, bref); } SRSASN_CODE unpack(bit_ref& bref) { return unpack_enum(EnumType::value, bref); }
@ -347,8 +343,8 @@ struct UnalignedIntegerPacker {
UnalignedIntegerPacker(IntType, IntType); UnalignedIntegerPacker(IntType, IntType);
IntType lb; IntType lb;
IntType ub; IntType ub;
SRSASN_CODE pack(bit_ref& bref, IntType n); SRSASN_CODE pack(bit_ref& bref, IntType n) const;
SRSASN_CODE unpack(IntType& n, bit_ref& bref); SRSASN_CODE unpack(IntType& n, bit_ref& bref) const;
}; };
template <class IntType> template <class IntType>
@ -763,7 +759,7 @@ template <class InnerPacker>
struct SeqOfPacker { struct SeqOfPacker {
SeqOfPacker(uint32_t lb_, uint32_t ub_, InnerPacker packer_) : lb(lb_), ub(ub_), packer(packer_) {} SeqOfPacker(uint32_t lb_, uint32_t ub_, InnerPacker packer_) : lb(lb_), ub(ub_), packer(packer_) {}
template <typename T> template <typename T>
SRSASN_CODE pack(bit_ref& bref, const T& topack) SRSASN_CODE pack(bit_ref& bref, const T& topack) const
{ {
return pack_dyn_seq_of(bref, topack, lb, ub, packer); return pack_dyn_seq_of(bref, topack, lb, ub, packer);
} }
@ -791,15 +787,15 @@ union alignment_t {
uint32_t* ptr; uint32_t* ptr;
}; };
#define MAX2(a, b) ((a) > (b)) ? (a) : (b) #define MAX2(a, b) ((a) > (b)) ? (a) : (b)
#define MAX4(a, b, c, d) MAX2((MAX2(a, b)), MAX2(c, d)) template <class It>
#define MAX8(a, b, c, d, e, f, g, h) MAX2((MAX4(a, b, c, d)), (MAX4(e, f, g, h))) constexpr size_t max_size(It b, It e)
#define MAX12(a, b, c, d, e, f, g, h, i, j, k, l) MAX2((MAX8(a, b, c, d, e, f, g, h)), (MAX4(i, j, k, l))) {
#define MAX16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \ return (b != e) ? MAX2(max_size((b + 1), e), *b) : 0;
MAX2((MAX8(a, b, c, d, e, f, g, h)), (MAX8(i, j, k, l, m, n, o, p))) }
#define MAX32(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, \ constexpr size_t max_sizeof(const std::initializer_list<size_t>& l)
o1, p1) \ {
MAX2((MAX16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)), \ return max_size(l.begin(), l.end());
(MAX16(a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1))) }
template <size_t SIZE> template <size_t SIZE>
class choice_buffer_t class choice_buffer_t

File diff suppressed because it is too large Load Diff

@ -18,7 +18,7 @@
# and at http://www.gnu.org/licenses/. # and at http://www.gnu.org/licenses/.
# #
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-unused-but-set-variable -Wno-unused-variable -Wno-return-type -Wno-sign-compare -Wno-reorder -Wno-parantheses") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-unused-but-set-variable -Wno-unused-variable -Wno-return-type -Wno-sign-compare -Wno-reorder -Wno-parantheses -fno-exceptions")
add_library(srslte_asn1 STATIC add_library(srslte_asn1 STATIC
liblte_common.cc liblte_common.cc
liblte_mme.cc liblte_mme.cc

@ -375,12 +375,12 @@ UnalignedIntegerPacker<IntType>::UnalignedIntegerPacker(IntType lb_, IntType ub_
{ {
} }
template <class IntType> template <class IntType>
SRSASN_CODE UnalignedIntegerPacker<IntType>::pack(bit_ref& bref, IntType n) SRSASN_CODE UnalignedIntegerPacker<IntType>::pack(bit_ref& bref, IntType n) const
{ {
return pack_unalign_integer(bref, n, lb, ub); return pack_unalign_integer(bref, n, lb, ub);
} }
template <class IntType> template <class IntType>
SRSASN_CODE UnalignedIntegerPacker<IntType>::unpack(IntType& n, bit_ref& bref) SRSASN_CODE UnalignedIntegerPacker<IntType>::unpack(IntType& n, bit_ref& bref) const
{ {
return unpack_unalign_integer(n, bref, lb, ub); return unpack_unalign_integer(n, bref, lb, ub);
} }

@ -24550,49 +24550,21 @@ SRSASN_CODE csi_rs_cfg_emimo_v1530_c::unpack(bit_ref& bref)
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
void csi_rs_cfg_emimo_v1530_c::setup_c_::set(types::options e)
{
type_ = e;
}
void csi_rs_cfg_emimo_v1530_c::setup_c_::to_json(json_writer& j) const void csi_rs_cfg_emimo_v1530_c::setup_c_::to_json(json_writer& j) const
{ {
j.start_obj(); j.start_obj();
switch (type_) { j.write_fieldname("nonPrecoded-v1530");
case types::non_precoded_v1530: c.to_json(j);
j.write_fieldname("nonPrecoded-v1530");
c.to_json(j);
break;
default:
log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1530_c::setup_c_");
}
j.end_obj(); j.end_obj();
} }
SRSASN_CODE csi_rs_cfg_emimo_v1530_c::setup_c_::pack(bit_ref& bref) const SRSASN_CODE csi_rs_cfg_emimo_v1530_c::setup_c_::pack(bit_ref& bref) const
{ {
pack_enum(bref, type_); HANDLE_CODE(c.pack(bref));
switch (type_) {
case types::non_precoded_v1530:
HANDLE_CODE(c.pack(bref));
break;
default:
log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1530_c::setup_c_");
return SRSASN_ERROR_ENCODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
SRSASN_CODE csi_rs_cfg_emimo_v1530_c::setup_c_::unpack(bit_ref& bref) SRSASN_CODE csi_rs_cfg_emimo_v1530_c::setup_c_::unpack(bit_ref& bref)
{ {
types e; HANDLE_CODE(c.unpack(bref));
unpack_enum(e, bref);
set(e);
switch (type_) {
case types::non_precoded_v1530:
HANDLE_CODE(c.unpack(bref));
break;
default:
log_invalid_choice_id(type_, "csi_rs_cfg_emimo_v1530_c::setup_c_");
return SRSASN_ERROR_DECODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
@ -74747,54 +74719,37 @@ void cell_change_order_s::to_json(json_writer& j) const
j.end_obj(); j.end_obj();
} }
void cell_change_order_s::target_rat_type_c_::set(types::options e)
{
type_ = e;
}
void cell_change_order_s::target_rat_type_c_::to_json(json_writer& j) const void cell_change_order_s::target_rat_type_c_::to_json(json_writer& j) const
{ {
j.start_obj(); j.start_obj();
switch (type_) { j.write_fieldname("geran");
case types::geran: j.start_obj();
j.write_fieldname("geran"); j.write_fieldname("physCellId");
j.start_obj(); c.pci.to_json(j);
j.write_fieldname("physCellId"); j.write_fieldname("carrierFreq");
c.pci.to_json(j); c.carrier_freq.to_json(j);
j.write_fieldname("carrierFreq"); if (c.network_ctrl_order_present) {
c.carrier_freq.to_json(j); j.write_str("networkControlOrder", c.network_ctrl_order.to_string());
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");
if (c.sys_info_present) { c.sys_info.to_json(j);
j.write_fieldname("systemInformation");
c.sys_info.to_json(j);
}
j.end_obj();
break;
default:
log_invalid_choice_id(type_, "cell_change_order_s::target_rat_type_c_");
} }
j.end_obj(); j.end_obj();
j.end_obj();
} }
SRSASN_CODE cell_change_order_s::target_rat_type_c_::pack(bit_ref& bref) const SRSASN_CODE cell_change_order_s::target_rat_type_c_::pack(bit_ref& bref) const
{ {
pack_enum(bref, type_); pack_enum(bref, type());
switch (type_) { HANDLE_CODE(bref.pack(c.network_ctrl_order_present, 1));
case types::geran: HANDLE_CODE(bref.pack(c.sys_info_present, 1));
HANDLE_CODE(bref.pack(c.network_ctrl_order_present, 1)); HANDLE_CODE(c.pci.pack(bref));
HANDLE_CODE(bref.pack(c.sys_info_present, 1)); HANDLE_CODE(c.carrier_freq.pack(bref));
HANDLE_CODE(c.pci.pack(bref)); if (c.network_ctrl_order_present) {
HANDLE_CODE(c.carrier_freq.pack(bref)); HANDLE_CODE(c.network_ctrl_order.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));
if (c.sys_info_present) {
HANDLE_CODE(c.sys_info.pack(bref));
}
break;
default:
log_invalid_choice_id(type_, "cell_change_order_s::target_rat_type_c_");
return SRSASN_ERROR_ENCODE_FAIL;
} }
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
@ -74802,23 +74757,19 @@ SRSASN_CODE cell_change_order_s::target_rat_type_c_::unpack(bit_ref& bref)
{ {
types e; types e;
unpack_enum(e, bref); unpack_enum(e, bref);
set(e); if (e != type()) {
switch (type_) { log_invalid_choice_id(e, "cell_change_order_s::target_rat_type_c_");
case types::geran: 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(bref.unpack(c.network_ctrl_order_present, 1));
HANDLE_CODE(c.pci.unpack(bref)); HANDLE_CODE(bref.unpack(c.sys_info_present, 1));
HANDLE_CODE(c.carrier_freq.unpack(bref)); HANDLE_CODE(c.pci.unpack(bref));
if (c.network_ctrl_order_present) { HANDLE_CODE(c.carrier_freq.unpack(bref));
HANDLE_CODE(c.network_ctrl_order.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)); if (c.sys_info_present) {
} HANDLE_CODE(c.sys_info.unpack(bref));
break;
default:
log_invalid_choice_id(type_, "cell_change_order_s::target_rat_type_c_");
return SRSASN_ERROR_DECODE_FAIL;
} }
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
@ -83525,49 +83476,21 @@ SRSASN_CODE mcch_msg_type_c::unpack(bit_ref& bref)
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
void mcch_msg_type_c::c1_c_::set(types::options e)
{
type_ = e;
}
void mcch_msg_type_c::c1_c_::to_json(json_writer& j) const void mcch_msg_type_c::c1_c_::to_json(json_writer& j) const
{ {
j.start_obj(); j.start_obj();
switch (type_) { j.write_fieldname("mbsfnAreaConfiguration-r9");
case types::mbsfn_area_cfg_r9: c.to_json(j);
j.write_fieldname("mbsfnAreaConfiguration-r9");
c.to_json(j);
break;
default:
log_invalid_choice_id(type_, "mcch_msg_type_c::c1_c_");
}
j.end_obj(); j.end_obj();
} }
SRSASN_CODE mcch_msg_type_c::c1_c_::pack(bit_ref& bref) const SRSASN_CODE mcch_msg_type_c::c1_c_::pack(bit_ref& bref) const
{ {
pack_enum(bref, type_); HANDLE_CODE(c.pack(bref));
switch (type_) {
case types::mbsfn_area_cfg_r9:
HANDLE_CODE(c.pack(bref));
break;
default:
log_invalid_choice_id(type_, "mcch_msg_type_c::c1_c_");
return SRSASN_ERROR_ENCODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
SRSASN_CODE mcch_msg_type_c::c1_c_::unpack(bit_ref& bref) SRSASN_CODE mcch_msg_type_c::c1_c_::unpack(bit_ref& bref)
{ {
types e; HANDLE_CODE(c.unpack(bref));
unpack_enum(e, bref);
set(e);
switch (type_) {
case types::mbsfn_area_cfg_r9:
HANDLE_CODE(c.unpack(bref));
break;
default:
log_invalid_choice_id(type_, "mcch_msg_type_c::c1_c_");
return SRSASN_ERROR_DECODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
@ -83680,49 +83603,21 @@ SRSASN_CODE mcch_msg_type_c::later_c_::unpack(bit_ref& bref)
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
void mcch_msg_type_c::later_c_::c2_c_::set(types::options e)
{
type_ = e;
}
void mcch_msg_type_c::later_c_::c2_c_::to_json(json_writer& j) const void mcch_msg_type_c::later_c_::c2_c_::to_json(json_writer& j) const
{ {
j.start_obj(); j.start_obj();
switch (type_) { j.write_fieldname("mbmsCountingRequest-r10");
case types::mbms_count_request_r10: c.to_json(j);
j.write_fieldname("mbmsCountingRequest-r10");
c.to_json(j);
break;
default:
log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_::c2_c_");
}
j.end_obj(); j.end_obj();
} }
SRSASN_CODE mcch_msg_type_c::later_c_::c2_c_::pack(bit_ref& bref) const SRSASN_CODE mcch_msg_type_c::later_c_::c2_c_::pack(bit_ref& bref) const
{ {
pack_enum(bref, type_); HANDLE_CODE(c.pack(bref));
switch (type_) {
case types::mbms_count_request_r10:
HANDLE_CODE(c.pack(bref));
break;
default:
log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_::c2_c_");
return SRSASN_ERROR_ENCODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
SRSASN_CODE mcch_msg_type_c::later_c_::c2_c_::unpack(bit_ref& bref) SRSASN_CODE mcch_msg_type_c::later_c_::c2_c_::unpack(bit_ref& bref)
{ {
types e; HANDLE_CODE(c.unpack(bref));
unpack_enum(e, bref);
set(e);
switch (type_) {
case types::mbms_count_request_r10:
HANDLE_CODE(c.unpack(bref));
break;
default:
log_invalid_choice_id(type_, "mcch_msg_type_c::later_c_::c2_c_");
return SRSASN_ERROR_DECODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
@ -84360,49 +84255,21 @@ SRSASN_CODE pcch_msg_type_c::unpack(bit_ref& bref)
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
void pcch_msg_type_c::c1_c_::set(types::options e)
{
type_ = e;
}
void pcch_msg_type_c::c1_c_::to_json(json_writer& j) const void pcch_msg_type_c::c1_c_::to_json(json_writer& j) const
{ {
j.start_obj(); j.start_obj();
switch (type_) { j.write_fieldname("paging");
case types::paging: c.to_json(j);
j.write_fieldname("paging");
c.to_json(j);
break;
default:
log_invalid_choice_id(type_, "pcch_msg_type_c::c1_c_");
}
j.end_obj(); j.end_obj();
} }
SRSASN_CODE pcch_msg_type_c::c1_c_::pack(bit_ref& bref) const SRSASN_CODE pcch_msg_type_c::c1_c_::pack(bit_ref& bref) const
{ {
pack_enum(bref, type_); HANDLE_CODE(c.pack(bref));
switch (type_) {
case types::paging:
HANDLE_CODE(c.pack(bref));
break;
default:
log_invalid_choice_id(type_, "pcch_msg_type_c::c1_c_");
return SRSASN_ERROR_ENCODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
SRSASN_CODE pcch_msg_type_c::c1_c_::unpack(bit_ref& bref) SRSASN_CODE pcch_msg_type_c::c1_c_::unpack(bit_ref& bref)
{ {
types e; HANDLE_CODE(c.unpack(bref));
unpack_enum(e, bref);
set(e);
switch (type_) {
case types::paging:
HANDLE_CODE(c.unpack(bref));
break;
default:
log_invalid_choice_id(type_, "pcch_msg_type_c::c1_c_");
return SRSASN_ERROR_DECODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
@ -85776,49 +85643,21 @@ SRSASN_CODE sc_mcch_msg_type_r13_c::unpack(bit_ref& bref)
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
void sc_mcch_msg_type_r13_c::c1_c_::set(types::options e)
{
type_ = e;
}
void sc_mcch_msg_type_r13_c::c1_c_::to_json(json_writer& j) const void sc_mcch_msg_type_r13_c::c1_c_::to_json(json_writer& j) const
{ {
j.start_obj(); j.start_obj();
switch (type_) { j.write_fieldname("scptmConfiguration-r13");
case types::scptm_cfg_r13: c.to_json(j);
j.write_fieldname("scptmConfiguration-r13");
c.to_json(j);
break;
default:
log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::c1_c_");
}
j.end_obj(); j.end_obj();
} }
SRSASN_CODE sc_mcch_msg_type_r13_c::c1_c_::pack(bit_ref& bref) const SRSASN_CODE sc_mcch_msg_type_r13_c::c1_c_::pack(bit_ref& bref) const
{ {
pack_enum(bref, type_); HANDLE_CODE(c.pack(bref));
switch (type_) {
case types::scptm_cfg_r13:
HANDLE_CODE(c.pack(bref));
break;
default:
log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::c1_c_");
return SRSASN_ERROR_ENCODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
SRSASN_CODE sc_mcch_msg_type_r13_c::c1_c_::unpack(bit_ref& bref) SRSASN_CODE sc_mcch_msg_type_r13_c::c1_c_::unpack(bit_ref& bref)
{ {
types e; HANDLE_CODE(c.unpack(bref));
unpack_enum(e, bref);
set(e);
switch (type_) {
case types::scptm_cfg_r13:
HANDLE_CODE(c.unpack(bref));
break;
default:
log_invalid_choice_id(type_, "sc_mcch_msg_type_r13_c::c1_c_");
return SRSASN_ERROR_DECODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
@ -87444,49 +87283,21 @@ SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::unpack(bit_ref& bref)
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
void ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::set(types::options e)
{
type_ = e;
}
void ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::to_json(json_writer& j) const void ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::to_json(json_writer& j) const
{ {
j.start_obj(); j.start_obj();
switch (type_) { j.write_fieldname("rrcConnectionResumeRequest-r13");
case types::rrc_conn_resume_request_r13: c.to_json(j);
j.write_fieldname("rrcConnectionResumeRequest-r13");
c.to_json(j);
break;
default:
log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_");
}
j.end_obj(); j.end_obj();
} }
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::pack(bit_ref& bref) const SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::pack(bit_ref& bref) const
{ {
pack_enum(bref, type_); HANDLE_CODE(c.pack(bref));
switch (type_) {
case types::rrc_conn_resume_request_r13:
HANDLE_CODE(c.pack(bref));
break;
default:
log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_");
return SRSASN_ERROR_ENCODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::unpack(bit_ref& bref) SRSASN_CODE ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_::unpack(bit_ref& bref)
{ {
types e; HANDLE_CODE(c.unpack(bref));
unpack_enum(e, bref);
set(e);
switch (type_) {
case types::rrc_conn_resume_request_r13:
HANDLE_CODE(c.unpack(bref));
break;
default:
log_invalid_choice_id(type_, "ul_ccch_msg_type_c::msg_class_ext_c_::c2_c_");
return SRSASN_ERROR_DECODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
@ -90045,52 +89856,31 @@ void meas_result_idle_r15_s::to_json(json_writer& j) const
j.end_obj(); j.end_obj();
} }
void meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::set(types::options e)
{
type_ = e;
}
void meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::to_json(json_writer& j) const void meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::to_json(json_writer& j) const
{ {
j.start_obj(); j.start_obj();
switch (type_) { j.start_array("measResultIdleListEUTRA-r15");
case types::meas_result_idle_list_eutra_r15: for (uint32_t i1 = 0; i1 < c.size(); ++i1) {
j.start_array("measResultIdleListEUTRA-r15"); c[i1].to_json(j);
for (uint32_t i1 = 0; i1 < c.size(); ++i1) {
c[i1].to_json(j);
}
j.end_array();
break;
default:
log_invalid_choice_id(type_, "meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_");
} }
j.end_array();
j.end_obj(); j.end_obj();
} }
SRSASN_CODE meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::pack(bit_ref& bref) const SRSASN_CODE meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::pack(bit_ref& bref) const
{ {
pack_enum(bref, type_); pack_enum(bref, type());
switch (type_) { HANDLE_CODE(pack_dyn_seq_of(bref, c, 1, 8));
case types::meas_result_idle_list_eutra_r15:
HANDLE_CODE(pack_dyn_seq_of(bref, c, 1, 8));
break;
default:
log_invalid_choice_id(type_, "meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_");
return SRSASN_ERROR_ENCODE_FAIL;
}
return SRSASN_SUCCESS; return SRSASN_SUCCESS;
} }
SRSASN_CODE meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::unpack(bit_ref& bref) SRSASN_CODE meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_::unpack(bit_ref& bref)
{ {
types e; types e;
unpack_enum(e, bref); unpack_enum(e, bref);
set(e); if (e != type()) {
switch (type_) { log_invalid_choice_id(e, "meas_result_idle_r15_s::meas_result_neigh_cells_r15_c_");
case types::meas_result_idle_list_eutra_r15: return SRSASN_ERROR_DECODE_FAIL;
HANDLE_CODE(unpack_dyn_seq_of(c, bref, 1, 8));
break;
default:
log_invalid_choice_id(type_, "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; return SRSASN_SUCCESS;
} }

File diff suppressed because it is too large Load Diff

@ -432,7 +432,6 @@ bool rrc::is_paging_opportunity(uint32_t tti, uint32_t *payload_len)
asn1::rrc::pcch_msg_s pcch_msg; asn1::rrc::pcch_msg_s pcch_msg;
pcch_msg.msg.set(pcch_msg_type_c::types::c1); pcch_msg.msg.set(pcch_msg_type_c::types::c1);
pcch_msg.msg.c1().set(pcch_msg_type_c::c1_c_::types::paging);
paging_s* paging_rec = &pcch_msg.msg.c1().paging(); paging_s* paging_rec = &pcch_msg.msg.c1().paging();
// Default paging cycle, should get DRX from user // Default paging cycle, should get DRX from user
@ -755,7 +754,6 @@ void rrc::configure_mbsfn_sibs(sib_type2_s* sib2, sib_type13_r9_s* sib13)
{ {
// Temp assignment of MCCH, this will eventually come from a cfg file // Temp assignment of MCCH, this will eventually come from a cfg file
mcch.msg.set(mcch_msg_type_c::types::c1); mcch.msg.set(mcch_msg_type_c::types::c1);
mcch.msg.c1().set(mcch_msg_type_c::c1_c_::types::mbsfn_area_cfg_r9);
mbsfn_area_cfg_r9_s& area_cfg_r9 = mcch.msg.c1().mbsfn_area_cfg_r9(); mbsfn_area_cfg_r9_s& area_cfg_r9 = mcch.msg.c1().mbsfn_area_cfg_r9();
area_cfg_r9.common_sf_alloc_period_r9 = mbsfn_area_cfg_r9_s::common_sf_alloc_period_r9_e_::rf64; area_cfg_r9.common_sf_alloc_period_r9 = mbsfn_area_cfg_r9_s::common_sf_alloc_period_r9_e_::rf64;
area_cfg_r9.common_sf_alloc_r9.resize(1); area_cfg_r9.common_sf_alloc_r9.resize(1);

Loading…
Cancel
Save