From e3509f041bd1297230bdc63f7ec5ba47ad56eb84 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 24 Apr 2023 10:13:26 +0200 Subject: [PATCH] asn1_test: add JSON plot of UE cap container --- lib/test/asn1/srsran_asn1_rrc_ul_dcch_test.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/test/asn1/srsran_asn1_rrc_ul_dcch_test.cc b/lib/test/asn1/srsran_asn1_rrc_ul_dcch_test.cc index d18436256..8688aecca 100644 --- a/lib/test/asn1/srsran_asn1_rrc_ul_dcch_test.cc +++ b/lib/test/asn1/srsran_asn1_rrc_ul_dcch_test.cc @@ -19,6 +19,7 @@ using namespace asn1; using namespace asn1::rrc; #define PCAP 0 +#define JSON_OUTPUT 1 #define TESTASSERT(cond) \ { \ @@ -651,6 +652,19 @@ int rrc_ue_cap_information_test() TESTASSERT(ue_cap.crit_exts.c1().ue_cap_info_r8().ue_cap_rat_container_list[0].rat_type == asn1::rrc::rat_type_e::eutra); + asn1::rrc::ue_eutra_cap_s eutra_capabilities; + asn1::cbit_ref bref2(ue_cap.crit_exts.c1().ue_cap_info_r8().ue_cap_rat_container_list[0].ue_cap_rat_container.data(), + ue_cap.crit_exts.c1().ue_cap_info_r8().ue_cap_rat_container_list[0].ue_cap_rat_container.size()); + TESTASSERT(eutra_capabilities.unpack(bref2) == asn1::SRSASN_SUCCESS); + +#if JSON_OUTPUT + int unpacked_len = bref2.distance_bytes(); + asn1::json_writer json_writer1; + eutra_capabilities.to_json(json_writer1); + srslog::fetch_basic_logger("ASN1").info( + rrc_msg, sizeof(rrc_msg), "UE cap info unpacked (%d B): \n %s", unpacked_len, json_writer1.to_string().c_str()); +#endif + return 0; }