Commit 8a4b2462 authored by alexandr's avatar alexandr

Measurement report message (source<->target) bugs fixed

parent 9ca54779
......@@ -206,6 +206,7 @@ int16_t get_PL(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint32_t get_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint32_t get_RSRQ(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint8_t get_n_adj_cells(module_id_t Mod_id,uint8_t CC_id);
uint16_t get_nid_cell(uint8_t Mod_id,uint8_t CC_id);
uint32_t get_rx_total_gain_dB(module_id_t Mod_id,uint8_t CC_id);
uint32_t get_RSSI(module_id_t Mod_id,uint8_t CC_id);
int8_t set_RSRP_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
......
......@@ -171,6 +171,11 @@ int8_t set_RSRQ_filtered(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rs
}
uint16_t get_nid_cell(uint8_t Mod_id,uint8_t CC_id){
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms;
return lte_frame_parms->Nid_cell;
}
void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
uint8_t slot,
uint8_t abstraction_flag)
......
......@@ -499,6 +499,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
mac_xface->get_RSRQ = get_RSRQ;
mac_xface->get_RSSI = get_RSSI;
mac_xface->get_n_adj_cells = get_n_adj_cells;
mac_xface->get_nid_cell = get_nid_cell;
mac_xface->get_rx_total_gain_dB = get_rx_total_gain_dB;
mac_xface->get_Po_NOMINAL_PUSCH = get_Po_NOMINAL_PUSCH;
mac_xface->get_num_prach_tdd = get_num_prach_tdd;
......
......@@ -279,6 +279,9 @@ typedef struct {
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
uint8_t (*set_RSRQ_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
// Function to get the Nid cell
uint16_t (*get_nid_cell) (uint8_t Mod_id,uint8_t CC_id);
/// Function for UE/eNB MAC to retrieve number of PRACH in TDD
uint8_t (*get_num_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms);
......
......@@ -751,6 +751,6 @@ void rrc_lite_ue_update_ho_status(module_id_t Mod_idP){
// Handover is done
LOG_D(RRC,"Reset HO timer in RRC\n");
UE_rrc_inst[Mod_idP].Info[0].T304_active = 0; // Stop the timer (MAC procedure was successful)
UE_rrc_inst[Mod_idP].HandoverInfoUe.measFlag = 0; // Stop the measurements
//UE_rrc_inst[Mod_idP].Info[1].State = RRC_RECONFIGURED;
//UE_rrc_inst[Mod_idP].HandoverInfoUe.measFlag = 0; // Stop the measurements
UE_rrc_inst[Mod_idP].Info[0].State = RRC_RECONFIGURED;
}
......@@ -120,7 +120,7 @@ extern unsigned char NB_eNB_INST;
uint16_t two_tier_hexagonal_cellIds[7] = {0,1,2,4,5,7,8};
uint16_t two_tier_hexagonal_adjacent_cellIds[7][6] = {{1,2,4,5,7,8}, // CellId 0
{11,18,2,0,8,15}, // CellId 1
{11,0,2,18,8,15}, // CellId 1
{18,13,3,4,0,1}, // CellId 2
{2,3,14,6,5,0}, // CellId 4
{0,4,6,16,9,7}, // CellId 5
......
......@@ -947,7 +947,7 @@ rrc_ue_process_measConfig(
LOG_I(RRC,"[UE %d] Configuring mobility optimization params for UE %d \n",
ctxt_pP->module_id,UE_rrc_inst[ctxt_pP->module_id].Info[0].UE_index);
}
}
}
//-----------------------------------------------------------------------------
void
......@@ -1967,6 +1967,7 @@ rrc_ue_decode_dcch(
eNB_indexP);
if (target_eNB_index != 0xFF) {
init_meas_timers(ctxt_pP); // Initialize handover measurement timers
rrc_ue_generate_RRCConnectionReconfigurationComplete(
ctxt_pP,
target_eNB_index,
......@@ -3636,10 +3637,10 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con
//LOG_N(RRC,"[UE%d] Frame %d Check below lines for segfault :), Fix me \n",ctxt_pP->module_id, frameP);
if(!((ttt_ms=get_ttt_ms(ctxt_pP->module_id))>=0))
ttt_ms = timeToTrigger_ms[UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger];
//LOG_D(RRC,"Time to trigger for eNB %d is set to %d\n",ctxt_pP->module_id,ttt_ms);
//LOG_D(RRC,"i: %d, j= %d, reportConfigId: %d:Time to trigger for eNB %d is set to %d-index: %d\n",i,j,reportConfigId,ctxt_pP->module_id,ttt_ms,UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger);
// Freq specific offset of neighbor cell freq
if(!((ofn=get_ofn(ctxt_pP->module_id))>=0))
ofn=5;
ofn=2;
//LOG_D(RRC,"OFN for eNB %d is set to %d\n",ctxt_pP->module_id,ofn);
//((UE_rrc_inst[ctxt_pP->module_id].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq != NULL) ?
......@@ -3739,9 +3740,11 @@ static uint8_t check_trigger_meas_event(
TimeToTrigger_t ttt )
{
uint8_t eNB_offset;
uint8_t currentCellIndex = mac_xface->lte_frame_parms->Nid_cell;
uint8_t currentCellIndex = mac_xface->get_nid_cell(ue_mod_idP,0);
uint8_t tmp_offset;
//LOG_I(RRC,"Frame: %d-Currentcell-debug: %d-Num_Cells: %d\n",frameP,currentCellIndex,mac_xface->get_n_adj_cells(ue_mod_idP,0));
LOG_I(RRC,"[UE %d] ofn(%d) ocn(%d) hys(%d) ofs(%d) ocs(%d) a3_offset(%d) ttt(%d) rssi %3.1f\n",
ue_mod_idP,
ofn,ocn,hys,ofs,ocs,a3_offset,ttt,
......@@ -3750,7 +3753,7 @@ static uint8_t check_trigger_meas_event(
for (eNB_offset = 0; eNB_offset<1+mac_xface->get_n_adj_cells(ue_mod_idP,0); eNB_offset++) {
//for (eNB_offset = 1;(eNB_offset<1+mac_xface->get_n_adj_cells(ue_mod_idP,0));eNB_offset++) {
/* RHS: Verify that idx 0 corresponds to currentCellIndex in rsrp array */
if((eNB_offset!=eNB_index)&&(eNB_offset<NB_eNB_INST)) {
if(eNB_offset!=eNB_index){//NB_eNB_INST
if(eNB_offset<eNB_index) {
tmp_offset = eNB_offset;
} else {
......@@ -3768,10 +3771,10 @@ static uint8_t check_trigger_meas_event(
}
if (UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset] >= ttt) {
UE_rrc_inst->HandoverInfoUe.targetCellId = get_adjacent_cell_id(ue_mod_idP,tmp_offset); //WARNING!!!...check this!
UE_rrc_inst->HandoverInfoUe.targetCellId = get_adjacent_cell_id(currentCellIndex,tmp_offset); //WARNING!!!...check this!
LOG_D(RRC,"[UE %d] Frame %d eNB %d: Handover triggered: targetCellId: %d currentCellId: %d eNB_offset: %d rsrp source: %3.1f rsrp target: %3.1f\n", \
ue_mod_idP, frameP, eNB_index,
UE_rrc_inst->HandoverInfoUe.targetCellId,ue_cnx_index,eNB_offset,
UE_rrc_inst->HandoverInfoUe.targetCellId,currentCellIndex,eNB_offset,
(dB_fixed_times10(UE_rrc_inst[ue_mod_idP].rsrp_db[0])/10.0)-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0)-dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12),
(dB_fixed_times10(UE_rrc_inst[ue_mod_idP].rsrp_db[eNB_offset])/10.0)-mac_xface->get_rx_total_gain_dB(ue_mod_idP,
0)-dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12));
......@@ -3789,6 +3792,18 @@ static uint8_t check_trigger_meas_event(
return 0;
}
// Initialize the handover measurement timers
void init_meas_timers(const protocol_ctxt_t* const ctxt_pP){
uint8_t i,j,eNB_offset;
for(i=0 ; i<NB_CNX_UE ; i++) {
for(j=0 ; j<MAX_MEAS_ID ; j++) {
for (eNB_offset = 0; eNB_offset<1+mac_xface->get_n_adj_cells(ctxt_pP->module_id,0); eNB_offset++) {
UE_rrc_inst->measTimer[i][j][eNB_offset]=0;
}
}
}
}
#ifdef Rel10
//-----------------------------------------------------------------------------
int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t* const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area )
......
......@@ -2336,6 +2336,10 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList;
protocol_ctxt_t ctxt;
// HO parameters
Hysteresis_t hys;
TimeToTrigger_t ttt_ms;
LOG_D(RRC, "[eNB %d] Frame %d: handover preparation: get the newSourceUEIdentity (C-RNTI): ",
ctxt_pP->module_id, ctxt_pP->frame);
......@@ -2875,6 +2879,24 @@ rv[1] = (global_rnti>>8) & 255;
ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.reportInterval = ReportInterval_ms120;
ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.reportAmount = ReportConfigEUTRA__reportAmount_infinity;
if((hys=get_hys(ctxt_pP->module_id))>=0){
ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis = hys;
LOG_D(RRC,"Hysteresis for eNB %d is set to %ld\n",ctxt_pP->module_id,hys);
}
else{
ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis = 0.5; // FIXME ...hysteresis is of type long!
//LOG_D(RRC,"Hysteresis for eNB %d is set to %d\n",ctxt_pP->module_id,0);
}
if((ttt_ms=get_ttt_ms(ctxt_pP->module_id))>=0){
ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger = ttt_ms;
LOG_D(RRC,"Time to trigger for eNB %d is set to %d\n",ctxt_pP->module_id,ttt_ms);
}
else{
ReportConfig_A3->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger =
TimeToTrigger_ms40;
//LOG_D(RRC,"Time to trigger for eNB %d is set to %d\n",ctxt_pP->module_id,TimeToTrigger_ms40);
}
ASN_SEQUENCE_ADD(&ReportConfig_list->list, ReportConfig_A3);
ReportConfig_A4->reportConfigId = 5;
......
0 0 1800 4800 1000
1 0 4700 4840 1000
2 0 6500 4880 1000
2 0 1800 4800 1000
......@@ -130,7 +130,7 @@
</APPLICATION_CONFIG>
<EMULATION_CONFIG>
<EMULATION_TIME_ms>2500</EMULATION_TIME_ms>
<EMULATION_TIME_ms>10000</EMULATION_TIME_ms>
<CURVE>disable</CURVE> <!-- option: enabled, disabled. If CURVE is enabled, graphes
are ploted in real time (UL and DL) of WOD and throughput measurement for each packet -->
......
......@@ -1647,6 +1647,7 @@ int user_control_interface(int sfn) {
printf("RSRP 3 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[2],10*log10(1+UE->PHY_measurements.rsrp[3])-UE->rx_total_gain_dB);
printf("RSRP 4 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[3],10*log10(1+UE->PHY_measurements.rsrp[4])-UE->rx_total_gain_dB);
printf("RSRP 5 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[4],10*log10(1+UE->PHY_measurements.rsrp[5])-UE->rx_total_gain_dB);
printf("RSRP 6 (%d) %f dBm/RE\t",UE->PHY_measurements.adj_cell_id[5],10*log10(1+UE->PHY_measurements.rsrp[6])-UE->rx_total_gain_dB);
printf("\n");
}
else {
......
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