diff --git a/srsenb/hdr/enb.h b/srsenb/hdr/enb.h index fe99f16de..831e1be96 100644 --- a/srsenb/hdr/enb.h +++ b/srsenb/hdr/enb.h @@ -222,7 +222,11 @@ private: int parse_rr(all_args_t *args, rrc_cfg_t *rrc_cfg); int parse_drb(all_args_t *args, rrc_cfg_t *rrc_cfg); bool sib_is_present(LIBLTE_RRC_SCHEDULING_INFO_STRUCT *sched_info, uint32_t nof_sched_info, LIBLTE_RRC_SIB_TYPE_ENUM sib_num); - int parse_cell_cfg(all_args_t *args, srslte_cell_t *cell); + int parse_cell_cfg(all_args_t *args, srslte_cell_t *cell); + + std::string get_build_mode(); + std::string get_build_info(); + std::string get_build_string(); }; } // namespace srsenb diff --git a/srsenb/src/enb.cc b/srsenb/src/enb.cc index 911fb1d48..3d0e2da10 100644 --- a/srsenb/src/enb.cc +++ b/srsenb/src/enb.cc @@ -26,6 +26,9 @@ #include #include "srsenb/hdr/enb.h" +#include "srslte/build_info.h" +#include +#include namespace srsenb { @@ -54,6 +57,9 @@ void enb::cleanup(void) } enb::enb() : started(false) { + // print build info + std::cout << std::endl << get_build_string() << std::endl; + srslte_dft_load(); pool = srslte::byte_buffer_pool::get_instance(ENB_POOL_SIZE); @@ -342,4 +348,24 @@ srslte::LOG_LEVEL_ENUM enb::level(std::string l) } } +std::string enb::get_build_mode() +{ + return std::string(srslte_get_build_mode()); +} + +std::string enb::get_build_info() +{ + if (std::string(srslte_get_build_info()) == "") { + return std::string(srslte_get_version()); + } + return std::string(srslte_get_build_info()); +} + +std::string enb::get_build_string() +{ + std::stringstream ss; + ss << "Built in " << get_build_mode() << " mode using " << get_build_info() << "." << std::endl; + return ss.str(); +} + } // namespace srsenb