Commit e5afdcdd authored by batuhan duyuler's avatar batuhan duyuler Committed by Robert Schmidt

Move cell-value lookup functions (SSB ARFCN, ...) to rrc_gNB_du.c

The functions are needed in a later commit in both rrc_gNB_du.c and
rrc_gNB.c, so move to the rrc_gNB_du.c file concerned with DUs (cells).
parent 76f06a93
......@@ -176,24 +176,6 @@ void nr_rrc_transfer_protected_rrc_message(const gNB_RRC_INST *rrc,
&data);
}
static int get_dl_band(const f1ap_served_cell_info_t *cell_info)
{
return cell_info->mode == F1AP_MODE_TDD ? cell_info->tdd.freqinfo.band : cell_info->fdd.dl_freqinfo.band;
}
static int get_ssb_scs(const f1ap_served_cell_info_t *cell_info)
{
return cell_info->mode == F1AP_MODE_TDD ? cell_info->tdd.tbw.scs : cell_info->fdd.dl_tbw.scs;
}
static int get_ssb_arfcn(const nr_rrc_du_container_t *du)
{
DevAssert(du != NULL && du->mtc != NULL);
/* format has been verified when accepting MeasurementTimingConfiguration */
NR_MeasTimingList_t *mtlist = du->mtc->criticalExtensions.choice.c1->choice.measTimingConf->measTiming;
return mtlist->list.array[0]->frequencyAndTiming->carrierFreq;
}
///---------------------------------------------------------------------------------------------------------------///
///---------------------------------------------------------------------------------------------------------------///
......
......@@ -28,6 +28,23 @@
#include "openair2/F1AP/f1ap_ids.h"
#include "executables/softmodem-common.h"
int get_dl_band(const struct f1ap_served_cell_info_t *cell_info)
{
return cell_info->mode == F1AP_MODE_TDD ? cell_info->tdd.freqinfo.band : cell_info->fdd.dl_freqinfo.band;
}
int get_ssb_scs(const struct f1ap_served_cell_info_t *cell_info)
{
return cell_info->mode == F1AP_MODE_TDD ? cell_info->tdd.tbw.scs : cell_info->fdd.dl_tbw.scs;
}
int get_ssb_arfcn(const struct nr_rrc_du_container_t *du)
{
DevAssert(du != NULL && du->mtc != NULL);
/* format has been verified when accepting MeasurementTimingConfiguration */
NR_MeasTimingList_t *mtlist = du->mtc->criticalExtensions.choice.c1->choice.measTimingConf->measTiming;
return mtlist->list.array[0]->frequencyAndTiming->carrierFreq;
}
static int du_compare(const nr_rrc_du_container_t *a, const nr_rrc_du_container_t *b)
{
......
......@@ -42,4 +42,8 @@ struct nr_rrc_du_container_t *get_du_by_assoc_id(struct gNB_RRC_INST_s *rrc, sct
void dump_du_info(const struct gNB_RRC_INST_s *rrc, FILE *f);
int get_dl_band(const struct f1ap_served_cell_info_t *cell_info);
int get_ssb_scs(const struct f1ap_served_cell_info_t *cell_info);
int get_ssb_arfcn(const struct nr_rrc_du_container_t *du);
#endif /* RRC_GNB_DU_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment