diff --git a/lib/src/radio/test/CMakeLists.txt b/lib/src/radio/test/CMakeLists.txt index 0888c1f09..dcfd04507 100644 --- a/lib/src/radio/test/CMakeLists.txt +++ b/lib/src/radio/test/CMakeLists.txt @@ -20,8 +20,11 @@ if(RF_FOUND) add_executable(benchmark_radio benchmark_radio.cc) - target_link_libraries(benchmark_radio srsue_phy srslte_common srslte_phy srslte_radio ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) - + target_link_libraries(benchmark_radio srslte_common srslte_phy srslte_radio) + if(SRSGUI_FOUND) + include_directories(${SRSGUI_INCLUDE_DIRS}) + target_link_libraries(benchmark_radio ${SRSGUI_LIBRARIES}) + endif(SRSGUI_FOUND) endif(RF_FOUND) diff --git a/lib/test/asn1/srslte_asn1_rrc_dl_ccch_test.cc b/lib/test/asn1/srslte_asn1_rrc_dl_ccch_test.cc index 96526ef28..d67eb5ae2 100644 --- a/lib/test/asn1/srslte_asn1_rrc_dl_ccch_test.cc +++ b/lib/test/asn1/srslte_asn1_rrc_dl_ccch_test.cc @@ -19,7 +19,7 @@ * */ -#include "../../../srsue/hdr/upper/rrc.h" +#include "../../../srsue/hdr/rrc/rrc.h" #include "srslte/asn1/rrc_asn1.h" #include "srslte/common/bcd_helpers.h" #include "srslte/common/log_filter.h" diff --git a/lib/test/asn1/srslte_asn1_rrc_dl_dcch_test.cc b/lib/test/asn1/srslte_asn1_rrc_dl_dcch_test.cc index 9fd144e5f..e1cb67faa 100644 --- a/lib/test/asn1/srslte_asn1_rrc_dl_dcch_test.cc +++ b/lib/test/asn1/srslte_asn1_rrc_dl_dcch_test.cc @@ -19,7 +19,7 @@ * */ -#include "../../../srsue/hdr/upper/rrc.h" +#include "../../../srsue/hdr/rrc/rrc.h" #include "srslte/asn1/rrc_asn1.h" #include "srslte/common/bcd_helpers.h" #include "srslte/common/log_filter.h" diff --git a/lib/test/asn1/srslte_asn1_rrc_ul_dcch_test.cc b/lib/test/asn1/srslte_asn1_rrc_ul_dcch_test.cc index a977eb5dc..ebf62fd15 100644 --- a/lib/test/asn1/srslte_asn1_rrc_ul_dcch_test.cc +++ b/lib/test/asn1/srslte_asn1_rrc_ul_dcch_test.cc @@ -19,7 +19,7 @@ * */ -#include "../../../srsue/hdr/upper/rrc.h" +#include "../../../srsue/hdr/rrc/rrc.h" #include "srslte/asn1/rrc_asn1.h" #include "srslte/common/bcd_helpers.h" #include "srslte/common/log_filter.h" diff --git a/srsue/hdr/upper/rrc.h b/srsue/hdr/rrc/rrc.h similarity index 100% rename from srsue/hdr/upper/rrc.h rename to srsue/hdr/rrc/rrc.h diff --git a/srsue/hdr/upper/rrc_common.h b/srsue/hdr/rrc/rrc_common.h similarity index 100% rename from srsue/hdr/upper/rrc_common.h rename to srsue/hdr/rrc/rrc_common.h diff --git a/srsue/hdr/ue.h b/srsue/hdr/ue.h index d473842b5..c8ce9cb45 100644 --- a/srsue/hdr/ue.h +++ b/srsue/hdr/ue.h @@ -32,14 +32,15 @@ #include #include -#include "ue_base.h" -#include "phy/phy.h" #include "mac/mac.h" -#include "srslte/upper/rlc.h" +#include "phy/phy.h" +#include "rrc/rrc.h" +#include "srslte/radio/radio_multi.h" #include "srslte/upper/pdcp.h" -#include "upper/rrc.h" -#include "upper/nas.h" +#include "srslte/upper/rlc.h" +#include "ue_base.h" #include "upper/gw.h" +#include "upper/nas.h" #include "upper/usim.h" #include "srslte/common/buffer_pool.h" diff --git a/srsue/hdr/ue_base.h b/srsue/hdr/ue_base.h index 9a190430c..55c6bec1c 100644 --- a/srsue/hdr/ue_base.h +++ b/srsue/hdr/ue_base.h @@ -27,14 +27,15 @@ #ifndef SRSUE_UE_BASE_H #define SRSUE_UE_BASE_H -#include -#include -#include #include "phy/phy.h" -#include "upper/usim.h" -#include "upper/rrc.h" -#include "upper/nas.h" +#include "rrc/rrc.h" #include "srslte/interfaces/ue_interfaces.h" +#include "srslte/radio/radio_multi.h" +#include "upper/nas.h" +#include "upper/usim.h" +#include +#include +#include #include "srslte/common/logger.h" #include "srslte/common/log_filter.h" diff --git a/srsue/src/CMakeLists.txt b/srsue/src/CMakeLists.txt index 2749e9768..7f73d88e1 100644 --- a/srsue/src/CMakeLists.txt +++ b/srsue/src/CMakeLists.txt @@ -20,6 +20,7 @@ add_subdirectory(phy) add_subdirectory(mac) +add_subdirectory(rrc) add_subdirectory(upper) # Link libstdc++ and libgcc @@ -34,6 +35,7 @@ endif (RPATH) add_executable(srsue main.cc ue_base.cc ue.cc metrics_stdout.cc metrics_csv.cc) target_link_libraries(srsue srsue_mac srsue_phy + srsue_rrc srsue_upper srslte_common srslte_phy diff --git a/srsue/src/main.cc b/srsue/src/main.cc index 084d77089..a19f79deb 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -86,21 +86,23 @@ void parse_args(all_args_t* args, int argc, char* argv[]) ("rrc.feature_group", bpo::value(&args->rrc.feature_group)->default_value(0xe6041000), "Hex value of the featureGroupIndicators field in the" "UECapabilityInformation message. Default 0xe6041000") - ("rrc.ue_category", bpo::value(&args->rrc.ue_category_str)->default_value(SRSLTE_UE_CATEGORY_DEFAULT), "UE Category (1 to 10)") - ("rrc.release", bpo::value(&args->rrc.release)->default_value(8), "UE Release (8 to 10)") - - ("nas.apn", bpo::value(&args->nas.apn_name)->default_value(""), "Set Access Point Name (APN) for data services") - ("nas.apn_protocol", bpo::value(&args->nas.apn_protocol)->default_value(""), "Set Access Point Name (APN) protocol for data services") - ("nas.user", bpo::value(&args->nas.apn_user)->default_value(""), "Username for CHAP authentication") - ("nas.pass", bpo::value(&args->nas.apn_pass)->default_value(""), "Password for CHAP authentication") - ("nas.force_imsi_attach", bpo::value(&args->nas.force_imsi_attach)->default_value(false), "Whether to always perform an IMSI attach") - ("nas.eia", bpo::value(&args->nas.eia)->default_value("1,2"), "List of integrity algorithms included in UE capabilities") - ("nas.eea", bpo::value(&args->nas.eea)->default_value("0,1,2"), "List of ciphering algorithms included in UE capabilities") - - ("pcap.enable", bpo::value(&args->pcap.enable)->default_value(false), "Enable MAC packet captures for wireshark") - ("pcap.filename", bpo::value(&args->pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename") - ("pcap.nas_enable", bpo::value(&args->pcap.nas_enable)->default_value(false), "Enable NAS packet captures for wireshark") - ("pcap.nas_filename", bpo::value(&args->pcap.nas_filename)->default_value("ue_nas.pcap"), "NAS layer capture filename (useful when NAS encryption is enabled)") + ("rrc.ue_category", bpo::value(&args->stack.rrc.ue_category_str)->default_value(SRSLTE_UE_CATEGORY_DEFAULT), "UE Category (1 to 10)") + ("rrc.release", bpo::value(&args->stack.rrc.release)->default_value(SRSLTE_RELEASE_DEFAULT), "UE Release (8 to 10)") + ("rrc.mbms_service_id", bpo::value(&args->stack.rrc.mbms_service_id)->default_value(-1), "MBMS service id for autostart (-1 means disabled)") + ("rrc.mbms_service_port", bpo::value(&args->stack.rrc.mbms_service_port)->default_value(4321), "Port of the MBMS service") + + ("nas.apn", bpo::value(&args->stack.nas.apn_name)->default_value(""), "Set Access Point Name (APN) for data services") + ("nas.apn_protocol", bpo::value(&args->stack.nas.apn_protocol)->default_value(""), "Set Access Point Name (APN) protocol for data services") + ("nas.user", bpo::value(&args->stack.nas.apn_user)->default_value(""), "Username for CHAP authentication") + ("nas.pass", bpo::value(&args->stack.nas.apn_pass)->default_value(""), "Password for CHAP authentication") + ("nas.force_imsi_attach", bpo::value(&args->stack.nas.force_imsi_attach)->default_value(false), "Whether to always perform an IMSI attach") + ("nas.eia", bpo::value(&args->stack.nas.eia)->default_value("1,2"), "List of integrity algorithms included in UE capabilities") + ("nas.eea", bpo::value(&args->stack.nas.eea)->default_value("0,1,2"), "List of ciphering algorithms included in UE capabilities") + + ("pcap.enable", bpo::value(&args->stack.pcap.enable)->default_value(false), "Enable MAC packet captures for wireshark") + ("pcap.filename", bpo::value(&args->stack.pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename") + ("pcap.nas_enable", bpo::value(&args->stack.pcap.nas_enable)->default_value(false), "Enable NAS packet captures for wireshark") + ("pcap.nas_filename", bpo::value(&args->stack.pcap.nas_filename)->default_value("ue_nas.pcap"), "NAS layer capture filename (useful when NAS encryption is enabled)") ("gui.enable", bpo::value(&args->gui.enable)->default_value(false), "Enable GUI plots") @@ -281,8 +283,8 @@ void parse_args(all_args_t* args, int argc, char* argv[]) bpo::value(&args->expert.phy.sic_pss_enabled)->default_value(false), "Applies Successive Interference Cancellation to PSS signals when searching for neighbour cells. Must be disabled if cells have identical channel and timing.") - ("expert.interpolate_subframe_enabled", - bpo::value(&args->expert.phy.interpolate_subframe_enabled)->default_value(false), + ("phy.interpolate_subframe_enabled", + bpo::value(&args->phy.interpolate_subframe_enabled)->default_value(false), "Interpolates in the time domain the channel estimates within 1 subframe.") ("expert.estimator_fil_auto", diff --git a/srsue/src/rrc/CMakeLists.txt b/srsue/src/rrc/CMakeLists.txt new file mode 100644 index 000000000..94e98a4a8 --- /dev/null +++ b/srsue/src/rrc/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# Copyright 2013-2019 Software Radio Systems Limited +# +# This file is part of srsLTE +# +# srsLTE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# srsLTE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# A copy of the GNU Affero General Public License can be found in +# the LICENSE file in the top-level directory of this distribution +# and at http://www.gnu.org/licenses/. +# + +set(SOURCES rrc.cc) + +add_library(srsue_rrc STATIC ${SOURCES}) + +install(TARGETS srsue_rrc DESTINATION ${LIBRARY_DIR}) \ No newline at end of file diff --git a/srsue/src/upper/rrc.cc b/srsue/src/rrc/rrc.cc similarity index 99% rename from srsue/src/upper/rrc.cc rename to srsue/src/rrc/rrc.cc index 0fc2a461a..233dfdd6e 100644 --- a/srsue/src/upper/rrc.cc +++ b/srsue/src/rrc/rrc.cc @@ -19,7 +19,7 @@ * */ -#include "srsue/hdr/upper/rrc.h" +#include "srsue/hdr/rrc/rrc.h" #include "srslte/asn1/rrc_asn1.h" #include "srslte/common/bcd_helpers.h" #include "srslte/common/security.h" @@ -2002,6 +2002,11 @@ void rrc::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) serving_cell->has_mcch = true; phy->set_config_mbsfn_mcch(&serving_cell->mcch); log_rrc_message("MCH", Rx, pdu.get(), serving_cell->mcch); + + if (args.mbms_service_id >= 0) { + rrc_log->info("Attempting to auto-start MBMS service %d\n", args.mbms_service_id); + mbms_service_start(args.mbms_service_id, args.mbms_service_port); + } } } } diff --git a/srsue/src/upper/CMakeLists.txt b/srsue/src/upper/CMakeLists.txt index 65975146c..ef7e8e190 100644 --- a/srsue/src/upper/CMakeLists.txt +++ b/srsue/src/upper/CMakeLists.txt @@ -18,7 +18,7 @@ # and at http://www.gnu.org/licenses/. # -set(SOURCES gw.cc nas.cc rrc.cc usim_base.cc usim.cc) +set(SOURCES gw.cc nas.cc usim_base.cc usim.cc) if(HAVE_PCSC) list(APPEND SOURCES "pcsc_usim.cc") diff --git a/srsue/test/upper/nas_test.cc b/srsue/test/upper/nas_test.cc index 9e6b53b0d..628a11bcb 100644 --- a/srsue/test/upper/nas_test.cc +++ b/srsue/test/upper/nas_test.cc @@ -19,21 +19,20 @@ * */ -#include -#include -#include "srsue/hdr/upper/usim_base.h" -#include "srsue/hdr/upper/usim.h" -#include "srsue/hdr/upper/nas.h" -#include "srsue/hdr/upper/gw.h" -#include "srslte/upper/rlc.h" -#include "srsue/hdr/upper/rrc.h" -#include "srsue/hdr/mac/mac.h" +#include "srslte/common/bcd_helpers.h" #include "srslte/common/log_filter.h" -#include "srslte/upper/pdcp_entity.h" -#include "srslte/upper/pdcp.h" #include "srslte/interfaces/ue_interfaces.h" -#include "srslte/common/bcd_helpers.h" - +#include "srslte/upper/pdcp.h" +#include "srslte/upper/pdcp_entity.h" +#include "srslte/upper/rlc.h" +#include "srsue/hdr/mac/mac.h" +#include "srsue/hdr/rrc/rrc.h" +#include "srsue/hdr/upper/gw.h" +#include "srsue/hdr/upper/nas.h" +#include "srsue/hdr/upper/usim.h" +#include "srsue/hdr/upper/usim_base.h" +#include +#include using namespace srsue; using namespace asn1::rrc; diff --git a/srsue/ue.conf.example b/srsue/ue.conf.example index 553d95220..1fd5319dd 100644 --- a/srsue/ue.conf.example +++ b/srsue/ue.conf.example @@ -116,15 +116,20 @@ imei = 353490069873319 ##################################################################### # RRC configuration # -# ue_category: Sets UE category (range 1-5). Default: 4 -# release: UE Release (8 to 10) -# feature_group: Hex value of the featureGroupIndicators field in the -# UECapabilityInformation message. Default 0xe6041000 +# ue_category: Sets UE category (range 1-5). Default: 4 +# release: UE Release (8 to 10) +# feature_group: Hex value of the featureGroupIndicators field in the +# UECapabilityInformation message. Default 0xe6041000 +# mbms_service_id: MBMS service id for autostarting MBMS reception +# (default -1 means disabled) +# mbms_service_port: Port of the MBMS service ##################################################################### [rrc] -#ue_category = 4 -#release = 8 -#feature_group = 0xe6041000 +#ue_category = 4 +#release = 8 +#feature_group = 0xe6041000 +#mbms_service_id = -1 +#mbms_service_port = 4321 ##################################################################### # NAS configuration @@ -222,10 +227,6 @@ enable = false # ##################################################################### [expert] -#ip_netmask = 255.255.255.0 -#ip_devname = tun_srsue -#mbms_service = -1 -#rssi_sensor_enabled = false #rx_gain_offset = 62 #prach_gain = 30 #cqi_max = 15