asn1_test: add JSON plot of UE cap container

master
Andre Puschmann 2 years ago committed by Justin Tallon
parent 965d1b423f
commit e3509f041b

@ -19,6 +19,7 @@ using namespace asn1;
using namespace asn1::rrc; using namespace asn1::rrc;
#define PCAP 0 #define PCAP 0
#define JSON_OUTPUT 1
#define TESTASSERT(cond) \ #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 == 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::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; return 0;
} }

Loading…
Cancel
Save