From fa461f01291bd4bee4a1c20e0e914d651450e967 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 2 Jul 2021 13:15:23 +0200 Subject: [PATCH] rrc_nr: fix linker error in setup_release_c move implementation to cc file to avoid [build] /bin/ld: CMakeFiles/rrc_nr_asn1_test.dir/rrc_nr_test.cc.o: in function `asn1::rrc_nr::setup_release_c::set_setup()': [build] /home/anpu/src/srsLTE/lib/include/srsran/asn1/rrc_nr.h:2276: undefined reference to `asn1::rrc_nr::setup_release_c::set(asn1::rrc_nr::setup_release_c::types_opts::options)' [build] clang: error: linker command failed with exit code 1 (use -v to see invocation) --- lib/include/srsran/asn1/rrc_nr.h | 56 +++++++++++++++++++++++++++++--- lib/src/asn1/rrc_nr.cc | 55 ------------------------------- 2 files changed, 52 insertions(+), 59 deletions(-) diff --git a/lib/include/srsran/asn1/rrc_nr.h b/lib/include/srsran/asn1/rrc_nr.h index 4638045ab..8e1362f56 100644 --- a/lib/include/srsran/asn1/rrc_nr.h +++ b/lib/include/srsran/asn1/rrc_nr.h @@ -2254,11 +2254,8 @@ struct setup_release_c { // choice methods setup_release_c() = default; - void set(typename types::options e = types::nulltype); types type() const { return type_; } - SRSASN_CODE pack(bit_ref& bref) const; - SRSASN_CODE unpack(cbit_ref& bref); - void to_json(json_writer& j) const; + // getters elem_type_paramT_& setup() { @@ -2271,6 +2268,57 @@ struct setup_release_c { return c; } void set_release() { set(types::release); } + + void set(typename types::options e) { type_ = e; } + + void to_json(json_writer& j) const + { + j.start_obj(); + switch (type_) { + case types::release: + break; + case types::setup: + break; + default: + log_invalid_choice_id(type_, "setup_release_c"); + } + j.end_obj(); + } + + SRSASN_CODE 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_, "setup_release_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; + } + + SRSASN_CODE 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_, "setup_release_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; + } + elem_type_paramT_& set_setup() { set(types::setup); diff --git a/lib/src/asn1/rrc_nr.cc b/lib/src/asn1/rrc_nr.cc index 4ceb86fe7..f940f3375 100644 --- a/lib/src/asn1/rrc_nr.cc +++ b/lib/src/asn1/rrc_nr.cc @@ -4484,61 +4484,6 @@ uint8_t sib_type_info_s::type_opts::to_number() const return map_enum_number(options, 8, value, "sib_type_info_s::type_e_"); } -// SetupRelease{ElementTypeParam} ::= CHOICE -template -void setup_release_c::set(typename types::options e) -{ - type_ = e; -} -template -void setup_release_c::to_json(json_writer& j) const -{ - j.start_obj(); - switch (type_) { - case types::release: - break; - case types::setup: - break; - default: - log_invalid_choice_id(type_, "setup_release_c"); - } - j.end_obj(); -} -template -SRSASN_CODE setup_release_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_, "setup_release_c"); - return SRSASN_ERROR_ENCODE_FAIL; - } - return SRSASN_SUCCESS; -} -template -SRSASN_CODE setup_release_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_, "setup_release_c"); - return SRSASN_ERROR_DECODE_FAIL; - } - return SRSASN_SUCCESS; -} - // UAC-BarringPerCat ::= SEQUENCE SRSASN_CODE uac_barr_per_cat_s::pack(bit_ref& bref) const {