From fd4b368f71dc9c2ff4eafb46f7592736a63fc81a Mon Sep 17 00:00:00 2001 From: Carlo Galiotto Date: Thu, 30 Sep 2021 12:18:51 +0200 Subject: [PATCH] sched,nr: handle case of ssb_periodicity not given If the parameter ssb_periodicity is not given by higher layers, the function needs to handle this case. The parameters could be passed with 0 value, which makes the function crash. For the time being, if ssb_periodicity is not given, the std value 5 ms will be used. Signed-off-by: Carlo Galiotto --- srsenb/src/stack/mac/nr/sched_nr_signalling.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/srsenb/src/stack/mac/nr/sched_nr_signalling.cc b/srsenb/src/stack/mac/nr/sched_nr_signalling.cc index 6d26db280..a50bf8f76 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_signalling.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_signalling.cc @@ -17,6 +17,8 @@ #define POS_IN_BURST_THIRD_BIT_IDX 2 #define POS_IN_BURST_FOURTH_BIT_IDX 3 +#define DEFAULT_SSB_PERIODICITY 5 + namespace srsenb { namespace sched_nr_impl { @@ -47,6 +49,9 @@ void sched_ssb_basic(const slot_point& sl_point, uint32_t ssb_periodicity, ssb_ * 3) Position in Burst 1000 * */ + if (ssb_periodicity == 0) + ssb_periodicity = DEFAULT_SSB_PERIODICITY; + uint32_t sl_idx = sl_point.to_uint(); uint32_t ssb_sf_idx = sl_point.to_uint() % ssb_periodicity;