From 32b3046d0ff58e4f0ecb9c7843b3dd589bab4275 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 24 Jul 2017 18:10:31 +0200 Subject: [PATCH] fix segfault in UE PHY tests - added dummy rrc class to UE phy tests --- srsue/test/phy/ue_itf_test_prach.cc | 13 +++++++++++-- srsue/test/phy/ue_itf_test_sib1.cc | 11 +++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/srsue/test/phy/ue_itf_test_prach.cc b/srsue/test/phy/ue_itf_test_prach.cc index 91df6a2fc..d3b4d39df 100644 --- a/srsue/test/phy/ue_itf_test_prach.cc +++ b/srsue/test/phy/ue_itf_test_prach.cc @@ -199,6 +199,14 @@ srslte_softbuffer_tx_t softbuffer_tx; uint16_t temp_c_rnti; + +class rrc_dummy : public srsue::rrc_interface_phy +{ +public: + void in_sync() {}; + void out_of_sync() {}; +}; + /******** MAC Interface implementation */ class testmac : public srsue::mac_interface_phy { @@ -326,7 +334,8 @@ private: testmac my_mac; -srslte::radio_multi radio; +srslte::radio_multi radio; +rrc_dummy rrc_dummy; int main(int argc, char *argv[]) { @@ -336,7 +345,7 @@ int main(int argc, char *argv[]) // Init Radio and PHY radio.init(); - my_phy.init(&radio, &my_mac, NULL, &log); + my_phy.init(&radio, &my_mac, &rrc_dummy, &log); if (prog_args.rf_rx_gain > 0 && prog_args.rf_tx_gain > 0) { radio.set_rx_gain(prog_args.rf_rx_gain); radio.set_tx_gain(prog_args.rf_tx_gain); diff --git a/srsue/test/phy/ue_itf_test_sib1.cc b/srsue/test/phy/ue_itf_test_sib1.cc index 08116b22c..310ecfc18 100644 --- a/srsue/test/phy/ue_itf_test_sib1.cc +++ b/srsue/test/phy/ue_itf_test_sib1.cc @@ -90,6 +90,13 @@ uint32_t total_oks=0; uint8_t payload[1024]; srslte_softbuffer_rx_t softbuffer; +class rrc_dummy : public srsue::rrc_interface_phy +{ +public: + void in_sync() {}; + void out_of_sync() {}; +}; + /******** MAC Interface implementation */ class testmac : public srsue::mac_interface_phy { @@ -147,7 +154,7 @@ public: testmac my_mac; srslte::radio_multi radio; - +rrc_dummy rrc_dummy; @@ -159,7 +166,7 @@ int main(int argc, char *argv[]) // Init Radio and PHY radio.init(); - my_phy.init(&radio, &my_mac, NULL, &log); + my_phy.init(&radio, &my_mac, &rrc_dummy, &log); if (prog_args.rf_gain > 0) { radio.set_rx_gain(prog_args.rf_gain); } else {