Commit d26fe82c authored by vettel's avatar vettel

Merge branch 'x2-ka-test' of https://gitlab.eurecom.fr/oai/openairinterface5g into x2-ka-test

parents d4f01572 eda6f864
...@@ -2384,19 +2384,27 @@ rrc_eNB_process_MeasurementReport( ...@@ -2384,19 +2384,27 @@ rrc_eNB_process_MeasurementReport(
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
int target_rsrp, source_rsrp;
int offset_db = 4;
T(T_ENB_RRC_MEASUREMENT_REPORT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), T(T_ENB_RRC_MEASUREMENT_REPORT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
#if 0
LOG_I(RRC, "[eNB %d] Frame %d: Process Measurement Report From UE %x (Measurement Id %d)\n", LOG_I(RRC, "[eNB %d] Frame %d: Process Measurement Report From UE %x (Measurement Id %d)\n",
ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, (int)measResults2->measId); ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, (int)measResults2->measId);
#endif
if (measResults2->measResultNeighCells==NULL) { if (measResults2->measResultNeighCells==NULL) {
#if 0
LOG_I(RRC, "Cells are not discovered\n"); LOG_I(RRC, "Cells are not discovered\n");
#endif
return; return;
} }
else { else {
if(measResults2->measId == 1){ if(measResults2->measId == 1){
#if 0
LOG_I(RRC, "Cells are discovered\n"); LOG_I(RRC, "Cells are discovered\n");
if (measResults2->measResultNeighCells->choice.measResultListEUTRA.list.count > 0) { if (measResults2->measResultNeighCells->choice.measResultListEUTRA.list.count > 0) {
LOG_I(RRC, "Physical Cell Id %d\n", LOG_I(RRC, "Physical Cell Id %d\n",
...@@ -2408,10 +2416,12 @@ rrc_eNB_process_MeasurementReport( ...@@ -2408,10 +2416,12 @@ rrc_eNB_process_MeasurementReport(
(int)*(measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[0]-> (int)*(measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->
measResult.rsrqResult)); measResult.rsrqResult));
} }
#endif
} }
else if (measResults2->measId == 4) { else if (measResults2->measId == 4) {
LOG_I(RRC, "A3 event happened...\n"); LOG_I(RRC, "A3 event happened...\n");
if (measResults2->measResultNeighCells->choice.measResultListEUTRA.list.count > 0) { if (measResults2->measResultNeighCells->choice.measResultListEUTRA.list.count > 0) {
/* TODO: handle all values of the array, not just the first */
LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult); LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult);
LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult); LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult);
LOG_I(RRC, "Physical Cell Id %d\n", LOG_I(RRC, "Physical Cell Id %d\n",
...@@ -2422,23 +2432,30 @@ rrc_eNB_process_MeasurementReport( ...@@ -2422,23 +2432,30 @@ rrc_eNB_process_MeasurementReport(
LOG_I(RRC, "RSRQ of Target %d\n", LOG_I(RRC, "RSRQ of Target %d\n",
(int)*(measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[0]-> (int)*(measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->
measResult.rsrqResult)); measResult.rsrqResult));
source_rsrp = measResults2->measResultPCell.rsrpResult;
target_rsrp = (int)*(measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->
measResult.rsrpResult);
} }
exit(0);
} }
else { else {
#if 0
LOG_I(RRC, "Other events happened...\n"); LOG_I(RRC, "Other events happened...\n");
#endif
} }
} }
#if 0
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult); LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult);
LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult); LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult);
#else #else
LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultServCell.rsrpResult); LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultServCell.rsrpResult);
LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultServCell.rsrqResult); LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultServCell.rsrqResult);
#endif
#endif #endif
/* algorithm to decide whether to trigger HO or not */ /* algorithm to decide whether to trigger HO or not */
if (!(measResults2->measId == 4 && target_rsrp - source_rsrp >= offset_db))
return;
/* if the UE is not in handover mode, start handover procedure */ /* if the UE is not in handover mode, start handover procedure */
if (ue_context_pP->ue_context.Status != RRC_HO_EXECUTION) { if (ue_context_pP->ue_context.Status != RRC_HO_EXECUTION) {
......
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