Commit 9ec157d9 authored by Konstantinos Alexandris's avatar Konstantinos Alexandris Committed by Robert Schmidt

Add neighbouring cells (cgi,plmn), clean-up a bit current RRC CM

parent 67293964
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file flexran_agent_mac.c /*! \file flexran_agent_rrc.c
* \brief FlexRAN agent Control Module RRC * \brief FlexRAN agent Control Module RRC
* \author shahab SHARIAT BAGHERI * \author shahab SHARIAT BAGHERI
* \date 2017 * \date 2017
...@@ -381,7 +381,7 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -381,7 +381,7 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
/* Check flag for creation of buffer status report */ /* Check flag for creation of buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RRC_MEASUREMENTS) { if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RRC_MEASUREMENTS) {
/*Source Cell*/ /*Source cell EUTRA Measurements*/
Protocol__FlexRrcMeasurements *rrc_measurements; Protocol__FlexRrcMeasurements *rrc_measurements;
rrc_measurements = malloc(sizeof(Protocol__FlexRrcMeasurements)); rrc_measurements = malloc(sizeof(Protocol__FlexRrcMeasurements));
if (rrc_measurements == NULL) if (rrc_measurements == NULL)
...@@ -397,7 +397,7 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -397,7 +397,7 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
rrc_measurements->pcell_rsrq = flexran_get_rrc_pcell_rsrq(mod_id, rnti); rrc_measurements->pcell_rsrq = flexran_get_rrc_pcell_rsrq(mod_id, rnti);
rrc_measurements->has_pcell_rsrq = 1 ; rrc_measurements->has_pcell_rsrq = 1 ;
/* Target Cell, Neghibouring*/ /* Neighbouring cells EUTRA Measurements*/
Protocol__FlexNeighCellsMeasurements *neigh_meas; Protocol__FlexNeighCellsMeasurements *neigh_meas;
neigh_meas = malloc(sizeof(Protocol__FlexNeighCellsMeasurements)); neigh_meas = malloc(sizeof(Protocol__FlexNeighCellsMeasurements));
if (neigh_meas == NULL) { if (neigh_meas == NULL) {
...@@ -406,13 +406,12 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -406,13 +406,12 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
goto error; goto error;
} }
protocol__flex_neigh_cells_measurements__init(neigh_meas); protocol__flex_neigh_cells_measurements__init(neigh_meas);
neigh_meas->n_eutra_meas = flexran_get_rrc_num_ncell(mod_id, rnti); neigh_meas->n_eutra_meas = flexran_get_rrc_num_ncell(mod_id, rnti);
Protocol__FlexEutraMeasurements **eutra_meas = NULL; Protocol__FlexEutraMeasurements **eutra_meas = NULL;
if (neigh_meas->n_eutra_meas > 0){ if (neigh_meas->n_eutra_meas > 0) {
eutra_meas = malloc(sizeof(Protocol__FlexEutraMeasurements) * neigh_meas->n_eutra_meas); eutra_meas = malloc(sizeof(Protocol__FlexEutraMeasurements) * neigh_meas->n_eutra_meas);
if (eutra_meas == NULL) { if (eutra_meas == NULL) {
...@@ -422,117 +421,103 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -422,117 +421,103 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
goto error; goto error;
} }
for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ){ for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ) {
eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements));
if (eutra_meas[j] == NULL) {
for (int k = 0 ; k < j ; k++)
free(eutra_meas[k]);
free(eutra_meas);
free(neigh_meas);
free(rrc_measurements);
rrc_measurements = NULL;
goto error;
}
protocol__flex_eutra_measurements__init(eutra_meas[j]);
eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements)); /* Fill in the physical cell identifier. */
if (eutra_meas[j] == NULL) { eutra_meas[j]->phys_cell_id = flexran_get_rrc_neigh_phy_cell_id(mod_id, rnti, j);
for (int k = 0 ; k < j ; k++) { eutra_meas[j]->has_phys_cell_id = 1;
free(eutra_meas[k]);
}
free(eutra_meas);
free(neigh_meas);
free(rrc_measurements);
rrc_measurements = NULL;
goto error;
}
protocol__flex_eutra_measurements__init(eutra_meas[j]); /* Initialize CGI measurements. */
Protocol__FlexEutraCgiMeasurements *cgi_meas;
cgi_meas = malloc(sizeof(Protocol__FlexEutraCgiMeasurements));
eutra_meas[j]->phys_cell_id = flexran_get_rrc_neigh_phy_cell_id(mod_id, rnti, j); protocol__flex_eutra_cgi_measurements__init(cgi_meas);
eutra_meas[j]->has_phys_cell_id = 1;
/* EUTRA Cell Global Identity (CGI) */
Protocol__FlexCellGlobalEutraId *cgi;
cgi = malloc(sizeof(Protocol__FlexCellGlobalEutraId));
/*TODO: Extend for CGI and PLMNID*/ protocol__flex_cell_global_eutra_id__init(cgi);
Protocol__FlexEutraRefSignalMeas *meas_result; cgi->cell_id = flexran_get_rrc_neigh_cgi_cell_id(mod_id, rnti, eutra_meas[j]->phys_cell_id);
meas_result = malloc(sizeof(Protocol__FlexEutraRefSignalMeas)); cgi->has_cell_id = 1;
protocol__flex_eutra_ref_signal_meas__init(meas_result); cgi_meas->tracking_area_code = flexran_get_rrc_neigh_cgi_tac(mod_id, rnti, eutra_meas[j]->phys_cell_id);
cgi_meas->has_tracking_area_code = 1;
meas_result->rsrp = flexran_get_rrc_neigh_rsrp(mod_id, rnti, eutra_meas[j]->phys_cell_id); /* PLMN for neighbouring cell */
meas_result->has_rsrp = 1; Protocol__FlexPlmnIdentity *plmn_id;
plmn_id = malloc(sizeof(Protocol__FlexPlmnIdentity));
meas_result->rsrq = flexran_get_rrc_neigh_rsrq(mod_id, rnti, eutra_meas[j]->phys_cell_id); protocol__flex_plmn_identity__init(plmn_id);
meas_result->has_rsrq = 1;
eutra_meas[j]->meas_result = meas_result; plmn_id->mcc = 0;
for (int m = 0; m < flexran_get_rrc_neigh_cgi_num_mcc(mod_id, rnti, eutra_meas[j]->phys_cell_id); m++) {
} plmn_id->mcc += flexran_get_rrc_neigh_cgi_mcc(mod_id, rnti, eutra_meas[j]->phys_cell_id, m);
}
neigh_meas->eutra_meas = eutra_meas; plmn_id->mnc = 0;
for (int m = 0; m < flexran_get_rrc_neigh_cgi_num_mnc(mod_id, rnti, eutra_meas[j]->phys_cell_id); m++) {
plmn_id->mnc += flexran_get_rrc_neigh_cgi_mnc(mod_id, rnti, eutra_meas[j]->phys_cell_id, m);
}
rrc_measurements->neigh_meas = neigh_meas; /*RSRP/RSRQ of the neighbouring cell */
Protocol__FlexEutraRefSignalMeas *meas_result;
meas_result = malloc(sizeof(Protocol__FlexEutraRefSignalMeas));
protocol__flex_eutra_ref_signal_meas__init(meas_result);
meas_result->rsrp = flexran_get_rrc_neigh_rsrp(mod_id, rnti, eutra_meas[j]->phys_cell_id);
meas_result->has_rsrp = 1;
meas_result->rsrq = flexran_get_rrc_neigh_rsrq(mod_id, rnti, eutra_meas[j]->phys_cell_id);
meas_result->has_rsrq = 1;
eutra_meas[j]->cgi_meas = cgi_meas;
eutra_meas[j]->meas_result = meas_result;
}
neigh_meas->eutra_meas = eutra_meas;
rrc_measurements->neigh_meas = neigh_meas;
} else { } else {
free(neigh_meas); free(neigh_meas);
} }
ue_report[i]->rrc_measurements = rrc_measurements; ue_report[i]->rrc_measurements = rrc_measurements;
ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RRC_MEASUREMENTS; ue_report[i]->flags |= PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RRC_MEASUREMENTS;
} }
}
}
} }
/* To be considered for RRC signaling of cell*/
// if (report_config->nr_cc > 0) {
// // Fill in the Cell reports
// for (i = 0; i < report_config->nr_cc; i++) {
// /* Check flag for creation of noise and interference report */
// if(report_config->cc_report_type[i].cc_report_flags & PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE) {
// // TODO: Fill in the actual noise and interference report for this cell
// Protocol__FlexNoiseInterferenceReport *ni_report;
// ni_report = malloc(sizeof(Protocol__FlexNoiseInterferenceReport));
// if(ni_report == NULL)
// goto error;
// protocol__flex_noise_interference_report__init(ni_report);
// // Current frame and subframe number
// ni_report->sfn_sf = flexran_get_sfn_sf(enb_id);
// ni_report->has_sfn_sf = 1;
// //TODO:Received interference power in dbm
// ni_report->rip = 0;
// ni_report->has_rip = 1;
// //TODO:Thermal noise power in dbm
// ni_report->tnp = 0;
// ni_report->has_tnp = 1;
// ni_report->p0_nominal_pucch = flexran_get_p0_nominal_pucch(enb_id, 0);
// ni_report->has_p0_nominal_pucch = 1;
// cell_report[i]->noise_inter_report = ni_report;
// cell_report[i]->flags |= PROTOCOL__FLEX_CELL_STATS_TYPE__FLCST_NOISE_INTERFERENCE;
// }
// }
// }
return 0; return 0;
error: error:
for (int i = 0; i < report_config->nr_ue; i++){ for (int i = 0; i < report_config->nr_ue; i++) {
if (ue_report[i]->rrc_measurements && ue_report[i]->rrc_measurements->neigh_meas != NULL) {
if (ue_report[i]->rrc_measurements && ue_report[i]->rrc_measurements->neigh_meas != NULL){ for (int j = 0; j < ue_report[i]->rrc_measurements->neigh_meas->n_eutra_meas; j++) {
for (int j = 0; j < ue_report[i]->rrc_measurements->neigh_meas->n_eutra_meas; j++){ free(ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]);
free(ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]);
}
free(ue_report[i]->rrc_measurements->neigh_meas);
} }
free(ue_report[i]->rrc_measurements->neigh_meas);
}
} }
if (cell_report != NULL) if (cell_report != NULL)
free(cell_report); free(cell_report);
if (ue_report != NULL) if (ue_report != NULL)
free(ue_report); free(ue_report);
return -1; return -1;
} }
...@@ -540,8 +525,9 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -540,8 +525,9 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexStatsReply *reply) int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexStatsReply *reply)
{ {
for (int i = 0; i < reply->n_ue_report; i++){ for (int i = 0; i < reply->n_ue_report; i++){
if (reply->ue_report[i]->rrc_measurements && reply->ue_report[i]->rrc_measurements->neigh_meas){ if (reply->ue_report[i]->rrc_measurements && reply->ue_report[i]->rrc_measurements->neigh_meas) {
for (int j = 0; j < reply->ue_report[i]->rrc_measurements->neigh_meas->n_eutra_meas; j++){ for (int j = 0; j < reply->ue_report[i]->rrc_measurements->neigh_meas->n_eutra_meas; j++) {
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->cgi_meas);
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->meas_result); free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]->meas_result);
free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]); free(reply->ue_report[i]->rrc_measurements->neigh_meas->eutra_meas[j]);
} }
......
...@@ -1435,8 +1435,7 @@ uint32_t flexran_get_pdcp_rx_oo(mid_t mod_id, uint16_t uid, lcid_t lcid) ...@@ -1435,8 +1435,7 @@ uint32_t flexran_get_pdcp_rx_oo(mid_t mod_id, uint16_t uid, lcid_t lcid)
/******************** RRC *****************************/ /******************** RRC *****************************/
LTE_MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, rnti_t rnti) LTE_MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, rnti_t rnti) {
{
if (!rrc_is_present(mod_id)) return -1; if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1; if (!ue_context_p) return -1;
...@@ -1444,27 +1443,32 @@ LTE_MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, rnti_t rnti) ...@@ -1444,27 +1443,32 @@ LTE_MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, rnti_t rnti)
return ue_context_p->ue_context.measResults->measId; return ue_context_p->ue_context.measResults->measId;
} }
float flexran_get_rrc_pcell_rsrp(mid_t mod_id, rnti_t rnti) float flexran_get_rrc_pcell_rsrp(mid_t mod_id, rnti_t rnti) {
{
if (!rrc_is_present(mod_id)) return -1; if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1; if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1; if (!ue_context_p->ue_context.measResults) return -1;
return RSRP_meas_mapping[ue_context_p->ue_context.measResults->measResultPCell.rsrpResult]; #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
return RSRP_meas_mapping[ue_context_p->ue_context.measResults->measResultPCell.rsrpResult];
#else
return RSRP_meas_mapping[ue_context_p->ue_context.measResults->measResultServCell.rsrpResult];
#endif
} }
float flexran_get_rrc_pcell_rsrq(mid_t mod_id, rnti_t rnti) float flexran_get_rrc_pcell_rsrq(mid_t mod_id, rnti_t rnti) {
{
if (!rrc_is_present(mod_id)) return -1; if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1; if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1; if (!ue_context_p->ue_context.measResults) return -1;
return RSRQ_meas_mapping[ue_context_p->ue_context.measResults->measResultPCell.rsrqResult]; #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
return RSRQ_meas_mapping[ue_context_p->ue_context.measResults->measResultPCell.rsrqResult];
#else
return RSRQ_meas_mapping[ue_context_p->ue_context.measResults->measResultServCell.rsrqResult];
#endif
} }
/*Number of neighbouring cells for specific UE*/ /*Number of neighbouring cells for specific UE*/
int flexran_get_rrc_num_ncell(mid_t mod_id, rnti_t rnti) int flexran_get_rrc_num_ncell(mid_t mod_id, rnti_t rnti) {
{
if (!rrc_is_present(mod_id)) return 0; if (!rrc_is_present(mod_id)) return 0;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return 0; if (!ue_context_p) return 0;
...@@ -1474,8 +1478,7 @@ int flexran_get_rrc_num_ncell(mid_t mod_id, rnti_t rnti) ...@@ -1474,8 +1478,7 @@ int flexran_get_rrc_num_ncell(mid_t mod_id, rnti_t rnti)
return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.count; return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.count;
} }
long flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, rnti_t rnti, long cell_id) long flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, rnti_t rnti, long cell_id) {
{
if (!rrc_is_present(mod_id)) return -1; if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1; if (!ue_context_p) return -1;
...@@ -1486,8 +1489,80 @@ long flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, rnti_t rnti, long cell_id) ...@@ -1486,8 +1489,80 @@ long flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, rnti_t rnti, long cell_id)
return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->physCellId; return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->physCellId;
} }
float flexran_get_rrc_neigh_rsrp(mid_t mod_id, rnti_t rnti, long cell_id) uint32_t flexran_get_rrc_neigh_cgi_cell_id(mid_t mod_id, rnti_t rnti, long cell_id) {
{ if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != LTE_MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]) return -1;
uint8_t *cId = ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->cgi_Info->cellGlobalId.cellIdentity.buf;
return ((cId[0] << 20) + (cId[1] << 12) + (cId[2] << 4) + (cId[3] >> 4));
}
uint32_t flexran_get_rrc_neigh_cgi_tac(mid_t mod_id, rnti_t rnti, long cell_id) {
if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != LTE_MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]) return -1;
uint8_t *tac = ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->cgi_Info->trackingAreaCode.buf;
return (tac[0] << 8) + (tac[1]);
}
uint32_t flexran_get_rrc_neigh_cgi_num_mnc(mid_t mod_id, rnti_t rnti, long cell_id) {
if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != LTE_MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]) return -1;
return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->cgi_Info->cellGlobalId.plmn_Identity.mnc.list.count;
}
uint32_t flexran_get_rrc_neigh_cgi_num_mcc(mid_t mod_id, rnti_t rnti, long cell_id) {
if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != LTE_MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]) return -1;
return ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->cgi_Info->cellGlobalId.plmn_Identity.mcc->list.count;
}
uint32_t flexran_get_rrc_neigh_cgi_mnc(mid_t mod_id, rnti_t rnti, long cell_id, int mnc_id) {
if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != LTE_MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]) return -1;
int num_mnc = ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->cgi_Info->cellGlobalId.plmn_Identity.mnc.list.count;
return *(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->cgi_Info->cellGlobalId.plmn_Identity.mnc.list.array[mnc_id]) *
((uint32_t) pow(10, num_mnc - mnc_id - 1));
}
uint32_t flexran_get_rrc_neigh_cgi_mcc(mid_t mod_id, rnti_t rnti, long cell_id, int mcc_id) {
if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1;
if (!ue_context_p->ue_context.measResults) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells) return -1;
if (ue_context_p->ue_context.measResults->measResultNeighCells->present != LTE_MeasResults__measResultNeighCells_PR_measResultListEUTRA) return -1;
if (!ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]) return -1;
int num_mcc = ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->cgi_Info->cellGlobalId.plmn_Identity.mcc->list.count;
return *(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->cgi_Info->cellGlobalId.plmn_Identity.mcc->list.array[mcc_id]) *
((uint32_t) pow(10, num_mcc - mcc_id - 1));
}
float flexran_get_rrc_neigh_rsrp(mid_t mod_id, rnti_t rnti, long cell_id) {
if (!rrc_is_present(mod_id)) return -1; if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1; if (!ue_context_p) return -1;
...@@ -1499,8 +1574,7 @@ float flexran_get_rrc_neigh_rsrp(mid_t mod_id, rnti_t rnti, long cell_id) ...@@ -1499,8 +1574,7 @@ float flexran_get_rrc_neigh_rsrp(mid_t mod_id, rnti_t rnti, long cell_id)
return RSRP_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrpResult)]; return RSRP_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrpResult)];
} }
float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id) float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id) {
{
if (!rrc_is_present(mod_id)) return -1; if (!rrc_is_present(mod_id)) return -1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti); struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[mod_id], rnti);
if (!ue_context_p) return -1; if (!ue_context_p) return -1;
...@@ -1511,26 +1585,22 @@ float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id) ...@@ -1511,26 +1585,22 @@ float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id)
return RSRQ_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrqResult)]; return RSRQ_meas_mapping[*(ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[cell_id]->measResult.rsrqResult)];
} }
uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id) uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id) {
{
if (!rrc_is_present(mod_id)) return 0; if (!rrc_is_present(mod_id)) return 0;
return RC.rrc[mod_id]->configuration.num_plmn; return RC.rrc[mod_id]->configuration.num_plmn;
} }
uint16_t flexran_get_rrc_mcc(mid_t mod_id, uint8_t index) uint16_t flexran_get_rrc_mcc(mid_t mod_id, uint8_t index) {
{
if (!rrc_is_present(mod_id)) return 0; if (!rrc_is_present(mod_id)) return 0;
return RC.rrc[mod_id]->configuration.mcc[index]; return RC.rrc[mod_id]->configuration.mcc[index];
} }
uint16_t flexran_get_rrc_mnc(mid_t mod_id, uint8_t index) uint16_t flexran_get_rrc_mnc(mid_t mod_id, uint8_t index) {
{
if (!rrc_is_present(mod_id)) return 0; if (!rrc_is_present(mod_id)) return 0;
return RC.rrc[mod_id]->configuration.mnc[index]; return RC.rrc[mod_id]->configuration.mnc[index];
} }
uint8_t flexran_get_rrc_mnc_digit_length(mid_t mod_id, uint8_t index) uint8_t flexran_get_rrc_mnc_digit_length(mid_t mod_id, uint8_t index) {
{
if (!rrc_is_present(mod_id)) return 0; if (!rrc_is_present(mod_id)) return 0;
return RC.rrc[mod_id]->configuration.mnc_digit_length[index]; return RC.rrc[mod_id]->configuration.mnc_digit_length[index];
} }
......
...@@ -510,23 +510,33 @@ float flexran_get_rrc_pcell_rsrq(mid_t mod_id, rnti_t rnti); ...@@ -510,23 +510,33 @@ float flexran_get_rrc_pcell_rsrq(mid_t mod_id, rnti_t rnti);
/* Get RRC neighbouring measurement */ /* Get RRC neighbouring measurement */
int flexran_get_rrc_num_ncell(mid_t mod_id, rnti_t rnti); int flexran_get_rrc_num_ncell(mid_t mod_id, rnti_t rnti);
/* Get physical cell id */ /* Get neighbouring physical cell id */
long flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, rnti_t rnti, long cell_id); long flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get neighbouring cgi info cell id */
uint32_t flexran_get_rrc_neigh_cgi_cell_id(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get neighbouring cgi info tac */
uint32_t flexran_get_rrc_neigh_cgi_tac(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get the number of neighbouring cgi mnc */
uint32_t flexran_get_rrc_neigh_cgi_num_mnc(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get the number of neighbouring cgi mcc */
uint32_t flexran_get_rrc_neigh_cgi_num_mcc(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get neighbouring cgi mnc */
uint32_t flexran_get_rrc_neigh_cgi_mnc(mid_t mod_id, rnti_t rnti, long cell_id, int mnc_id);
/* Get neighbouring cgi mcc */
uint32_t flexran_get_rrc_neigh_cgi_mcc(mid_t mod_id, rnti_t rnti, long cell_id, int mcc_id);
/* Get RSRP of neighbouring Cell */ /* Get RSRP of neighbouring Cell */
float flexran_get_rrc_neigh_rsrp(mid_t mod_id, rnti_t rnti, long cell_id); float flexran_get_rrc_neigh_rsrp(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get RSRQ of neighbouring Cell */ /* Get RSRQ of neighbouring Cell */
float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id); float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id);
/*Get MCC PLMN identity neighbouring Cell*/
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mcc(mid_t mod_id, rnti_t rnti, int cell_id); */
/*Get MNC PLMN identity neighbouring Cell*/
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mnc(mid_t mod_id, mid_t ue_id, int cell_id); */
/* Get number of PLMNs that is broadcasted in SIB1 */ /* Get number of PLMNs that is broadcasted in SIB1 */
uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id); uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id);
......
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