From c8cb1283179d892651f7fd548f508b227a05cd84 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 13 May 2021 17:31:42 +0200 Subject: [PATCH] Declare band helper methods as constant --- lib/include/srsran/common/band_helper.h | 6 +++--- lib/src/common/band_helper.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/include/srsran/common/band_helper.h b/lib/include/srsran/common/band_helper.h index 575d3ea53..22a255773 100644 --- a/lib/include/srsran/common/band_helper.h +++ b/lib/include/srsran/common/band_helper.h @@ -50,7 +50,7 @@ public: * @param dl_freq_Hz Given frequency in Hz * @return The band number if the frequency is bounded in a band, UINT16_MAX otherwise */ - uint16_t get_band_from_dl_freq_Hz(double dl_freq_Hz); + uint16_t get_band_from_dl_freq_Hz(double dl_freq_Hz) const; /** * @brief Selects the SSB pattern case according to the band number and subcarrier spacing @@ -59,14 +59,14 @@ public: * @param scs SSB Subcarrier spacing * @return The SSB pattern case if band and subcarrier spacing match, SRSRAN_SSB_PATTERN_INVALID otherwise */ - srsran_ssb_patern_t get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs); + srsran_ssb_patern_t get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs) const; /** * @brief gets the NR band duplex mode * @param band Given band * @return A valid SRSRAN_DUPLEX_MODE if the band is valid, SRSRAN_DUPLEX_MODE_INVALID otherwise */ - srsran_duplex_mode_t get_duplex_mode(uint16_t band); + srsran_duplex_mode_t get_duplex_mode(uint16_t band) const; private: // Elements of TS 38.101-1 Table 5.2-1: NR operating bands in FR1 diff --git a/lib/src/common/band_helper.cc b/lib/src/common/band_helper.cc index 70a51f4c3..4b91890b5 100644 --- a/lib/src/common/band_helper.cc +++ b/lib/src/common/band_helper.cc @@ -55,7 +55,7 @@ std::vector srsran_band_helper::get_bands_nr(uint32_t return bands; } -uint16_t srsran_band_helper::get_band_from_dl_freq_Hz(double freq) +uint16_t srsran_band_helper::get_band_from_dl_freq_Hz(double freq) const { uint32_t freq_MHz = (uint32_t)round(freq / 1e6); for (const nr_operating_band& band : nr_operating_bands_fr1) { @@ -66,7 +66,7 @@ uint16_t srsran_band_helper::get_band_from_dl_freq_Hz(double freq) return UINT16_MAX; } -srsran_ssb_patern_t srsran_band_helper::get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs) +srsran_ssb_patern_t srsran_band_helper::get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs) const { // Look for the given band and SCS for (const nr_band_ss_raster& ss_raster : nr_band_ss_raster_table) { @@ -85,7 +85,7 @@ srsran_ssb_patern_t srsran_band_helper::get_ssb_pattern(uint16_t band, srsran_su return SRSRAN_SSB_PATTERN_INVALID; } -srsran_duplex_mode_t srsran_band_helper::get_duplex_mode(uint16_t band) +srsran_duplex_mode_t srsran_band_helper::get_duplex_mode(uint16_t band) const { // Look for the given band for (const nr_operating_band& b : nr_operating_bands_fr1) {