Commit 240560a6 authored by alexandr's avatar alexandr

CLI for HO parametirization (extra parameters added)

parent c0dabdbf
...@@ -828,6 +828,12 @@ typedef struct { ...@@ -828,6 +828,12 @@ typedef struct {
long hys; long hys;
long ttt_ms; long ttt_ms;
long ofn; long ofn;
long ocn;
long ofs;
long ocs;
long off;
float rsrp_filter_coeff;
float rsrq_filter_coeff;
}Handover_eNB_info; }Handover_eNB_info;
/*! \brief eNB common channels */ /*! \brief eNB common channels */
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "PHY/TOOLS/dB_routines.h" #include "PHY/TOOLS/dB_routines.h"
#include "extern.h" #include "extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "RRC/LITE/rrc_eNB_primitives.h"
#include "LAYER2/RLC/rlc.h" #include "LAYER2/RLC/rlc.h"
#include "COMMON/mac_rrc_primitives.h" #include "COMMON/mac_rrc_primitives.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
...@@ -3438,11 +3439,17 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in ...@@ -3438,11 +3439,17 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void ue_meas_filtering( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index ) void ue_meas_filtering( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
{ {
float a = UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrp; // 'a' in 36.331 Sec. 5.5.3.2 float a;
float a1 = UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrq; float a1;
//float rsrp_db, rsrq_db; //float rsrp_db, rsrq_db;
uint8_t eNB_offset; uint8_t eNB_offset;
if(!((a=get_rsrp_filter_coeff(ctxt_pP->module_id))>=0))
a = UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrp; // 'a' in 36.331 Sec. 5.5.3.2
if(!((a1=get_rsrq_filter_coeff(ctxt_pP->module_id))>=0))
a1 = UE_rrc_inst[ctxt_pP->module_id].filter_coeff_rsrq;
if(UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0] != NULL) { // Only consider 1 serving cell (index: 0) if(UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0] != NULL) { // Only consider 1 serving cell (index: 0)
if (UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0]->quantityConfigEUTRA != NULL) { if (UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0]->quantityConfigEUTRA != NULL) {
if(UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRP != NULL) { if(UE_rrc_inst[ctxt_pP->module_id].QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRP != NULL) {
...@@ -3602,8 +3609,8 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con ...@@ -3602,8 +3609,8 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con
TimeToTrigger_t ttt_ms; TimeToTrigger_t ttt_ms;
Q_OffsetRange_t ofn; Q_OffsetRange_t ofn;
Q_OffsetRange_t ocn; Q_OffsetRange_t ocn;
Q_OffsetRange_t ofs = 0; Q_OffsetRange_t ofs;
Q_OffsetRange_t ocs = 0; Q_OffsetRange_t ocs;
long a3_offset; long a3_offset;
MeasObjectId_t measObjId; MeasObjectId_t measObjId;
ReportConfigId_t reportConfigId; ReportConfigId_t reportConfigId;
...@@ -3639,9 +3646,14 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con ...@@ -3639,9 +3646,14 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con
// *UE_rrc_inst[ctxt_pP->module_id].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq : 15); // /* 15 is the Default */ // *UE_rrc_inst[ctxt_pP->module_id].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq : 15); // /* 15 is the Default */
// cellIndividualOffset of neighbor cell - not defined yet // cellIndividualOffset of neighbor cell - not defined yet
ocn = 0; if(!((ocn=get_ocn(ctxt_pP->module_id))>=0))
a3_offset = UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId ocn = 0;
-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.choice.eventA3.a3_Offset; if(!((ofs=get_ofs(ctxt_pP->module_id))>=0))
ofs = 0;
if(!((ocs=get_ocs(ctxt_pP->module_id))>=0))
ocs = 0;
if(!((a3_offset=get_off(ctxt_pP->module_id))>=0))
a3_offset = UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.choice.eventA3.a3_Offset;
switch (UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.present) { switch (UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.present) {
case ReportConfigEUTRA__triggerType__event__eventId_PR_eventA1: case ReportConfigEUTRA__triggerType__event__eventId_PR_eventA1:
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "LAYER2/MAC/proto.h" #include "LAYER2/MAC/proto.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "COMMON/mac_rrc_primitives.h" #include "COMMON/mac_rrc_primitives.h"
#include "RRC/LITE/rrc_eNB_primitives.h"
#include "RRC/LITE/MESSAGES/asn1_msg.h" #include "RRC/LITE/MESSAGES/asn1_msg.h"
#include "RRCConnectionRequest.h" #include "RRCConnectionRequest.h"
#include "RRCConnectionReestablishmentRequest.h" #include "RRCConnectionReestablishmentRequest.h"
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "rrc_eNB_primitives.h" #include "rrc_eNB_primitives.h"
#include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG.h"
// HO parameters initialization
void init_HO(Handover_info* ho_info) void init_HO(Handover_info* ho_info)
{ {
int enb_module_id=0; int enb_module_id=0;
...@@ -48,6 +49,12 @@ void init_HO(Handover_info* ho_info) ...@@ -48,6 +49,12 @@ void init_HO(Handover_info* ho_info)
set_hys(enb_module_id,ho_info->hys); set_hys(enb_module_id,ho_info->hys);
set_ttt_ms(enb_module_id,ho_info->ttt_ms); set_ttt_ms(enb_module_id,ho_info->ttt_ms);
set_ofn(enb_module_id,ho_info->ofn); set_ofn(enb_module_id,ho_info->ofn);
set_ocn(enb_module_id,ho_info->ocn);
set_ofs(enb_module_id,ho_info->ofs);
set_ocs(enb_module_id,ho_info->ocs);
set_off(enb_module_id,ho_info->off);
set_rsrp_filter_coeff(enb_module_id,ho_info->rsrp_filter_coeff);
set_rsrq_filter_coeff(enb_module_id,ho_info->rsrq_filter_coeff);
} }
} }
...@@ -89,5 +96,74 @@ long get_ofn(int enb_module_id){ ...@@ -89,5 +96,74 @@ long get_ofn(int enb_module_id){
return eNB_mac_inst->ho_info.ofn; return eNB_mac_inst->ho_info.ofn;
} }
// OCN
void set_ocn(int enb_module_id,long ocn){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ocn=ocn;
printf("OCN for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ocn);
}
long get_ocn(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ocn;
}
// OFS
void set_ofs(int enb_module_id,long ofs){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ofs=ofs;
printf("OFS for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ofs);
}
long get_ofs(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ofs;
}
// OCS
void set_ocs(int enb_module_id,long ocs){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ocs=ocs;
printf("OCS for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ocs);
}
long get_ocs(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ocs;
}
// OFF (a3_offset)
void set_off(int enb_module_id,long off){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.off=off;
printf("OFF for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.off);
}
long get_off(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.off;
}
// L3 filtering coefficient RSRP
void set_rsrp_filter_coeff(int enb_module_id,float rsrp_filter_coeff){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.rsrp_filter_coeff=rsrp_filter_coeff;
printf("L3 RSRP filtering coefficient for eNB %d is set to %f\n",enb_module_id,eNB_mac_inst->ho_info.rsrp_filter_coeff);
}
float get_rsrp_filter_coeff(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.rsrp_filter_coeff;
}
// L3 filtering coefficient RSRP
void set_rsrq_filter_coeff(int enb_module_id,float rsrq_filter_coeff){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.rsrq_filter_coeff=rsrq_filter_coeff;
printf("L3 RSRQ filtering coefficient for eNB %d is set to %f\n",enb_module_id,eNB_mac_inst->ho_info.rsrq_filter_coeff);
}
float get_rsrq_filter_coeff(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.rsrq_filter_coeff;
}
...@@ -37,8 +37,10 @@ ...@@ -37,8 +37,10 @@
#include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG.h"
// HO parameters initialization
void init_HO(Handover_info* ho_info); void init_HO(Handover_info* ho_info);
// Getters/setters for HO parameters
void set_hys(int enb_module_id,long hys); void set_hys(int enb_module_id,long hys);
long get_hys(int enb_module_id); long get_hys(int enb_module_id);
...@@ -50,3 +52,27 @@ long get_ttt_ms(int enb_module_id); ...@@ -50,3 +52,27 @@ long get_ttt_ms(int enb_module_id);
void set_ofn(int enb_module_id,long ofn); void set_ofn(int enb_module_id,long ofn);
long get_ofn(int enb_module_id); long get_ofn(int enb_module_id);
void set_ocn(int enb_module_id,long ocn);
long get_ocn(int enb_module_id);
void set_ofs(int enb_module_id,long ofs);
long get_ofs(int enb_module_id);
void set_ocs(int enb_module_id,long ocs);
long get_ocs(int enb_module_id);
void set_off(int enb_module_id,long off);
long get_off(int enb_module_id);
void set_rsrp_filter_coeff(int enb_module_id,float rsrp_filter_coeff);
float get_rsrp_filter_coeff(int enb_module_id);
void set_rsrq_filter_coeff(int enb_module_id,float rsrq_filter_coeff);
float get_rsrq_filter_coeff(int enb_module_id);
...@@ -224,7 +224,8 @@ int process_argument(int optc, char* optv[]) ...@@ -224,7 +224,8 @@ int process_argument(int optc, char* optv[])
int index; int index;
int state; int state;
int value; long value;
float value1;
int comp=0, level=0, flag=0x34, interval=0; int comp=0, level=0, flag=0x34, interval=0;
while (optc > 0) { while (optc > 0) {
...@@ -264,6 +265,40 @@ int process_argument(int optc, char* optv[]) ...@@ -264,6 +265,40 @@ int process_argument(int optc, char* optv[])
// Handover CLI // Handover CLI
// Set hysteresis value
if ((strcmp(*optv, "hys") == 0) || (strcmp(*optv, "HYS") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] Hysteresis is set to %ld for eNB %d\n",value,index);
set_hys(index,value);
} else
return ERR;
}
// Set time to trigger value
if ((strcmp(*optv, "ttt_ms") == 0) || (strcmp(*optv, "TTT_ms") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] Time to trigger is set to %ld for eNB %d\n",value,index);
set_ttt_ms(index,value);
} else
return ERR;
}
// Set ofn value // Set ofn value
if ((strcmp(*optv, "ofn") == 0) || (strcmp(*optv, "OFN") == 0) ) { if ((strcmp(*optv, "ofn") == 0) || (strcmp(*optv, "OFN") == 0) ) {
...@@ -275,11 +310,112 @@ int process_argument(int optc, char* optv[]) ...@@ -275,11 +310,112 @@ int process_argument(int optc, char* optv[])
NEXT_OPT; NEXT_OPT;
CHECK_OPTC; CHECK_OPTC;
value = atoi (*optv); value = atoi (*optv);
printf("[CLI] OFN is set to %d for eNB %d\n",value,index); printf("[CLI] OFN is set to %ld for eNB %d\n",value,index);
set_ofn(index,value); set_ofn(index,value);
} else } else
return ERR; return ERR;
} }
// Set ocn value
if ((strcmp(*optv, "ocn") == 0) || (strcmp(*optv, "OCN") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OCN is set to %ld for eNB %d\n",value,index);
set_ocn(index,value);
} else
return ERR;
}
// Set ofs value
if ((strcmp(*optv, "ofs") == 0) || (strcmp(*optv, "OFS") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OFS is set to %ld for eNB %d\n",value,index);
set_ofs(index,value);
} else
return ERR;
}
// Set ocs value
if ((strcmp(*optv, "ocs") == 0) || (strcmp(*optv, "OCS") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OCS is set to %ld for eNB %d\n",value,index);
set_ocs(index,value);
} else
return ERR;
}
// Set off value
if ((strcmp(*optv, "off") == 0) || (strcmp(*optv, "OFF") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OFF is set to %ld for eNB %d\n",value,index);
set_off(index,value);
} else
return ERR;
}
// Set L3 filtering coefficient RSRP value
if ((strcmp(*optv, "rsrp_filter_coeff") == 0) || (strcmp(*optv, "RSRP_FILTER_COEFF") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value1 = atoi (*optv);
printf("[CLI] L3 RSRP filtering coefficient is set to %f for eNB %d\n",value1,index);
set_rsrp_filter_coeff(index,value);
} else
return ERR;
}
// Set L3 filtering coefficient RSRQ value
if ((strcmp(*optv, "rsrq_filter_coeff") == 0) || (strcmp(*optv, "RSRQ_FILTER_COEFF") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value1 = atoi (*optv);
printf("[CLI] L3 RSRQ filtering coefficient is set to %f for eNB %d\n",value1,index);
set_rsrq_filter_coeff(index,value);
} else
return ERR;
}
// fixme // fixme
if ((strcmp(*optv, "log") == 0) || (strcmp(*optv, "LOG") == 0) ) { if ((strcmp(*optv, "log") == 0) || (strcmp(*optv, "LOG") == 0) ) {
......
...@@ -739,6 +739,12 @@ typedef struct { ...@@ -739,6 +739,12 @@ typedef struct {
long hys; long hys;
long ttt_ms; long ttt_ms;
long ofn; long ofn;
long ocn;
long ofs;
long ocs;
long off;
float rsrp_filter_coeff;
float rsrq_filter_coeff;
}Handover_info; }Handover_info;
/** @defgroup _OSD_basic Basic OpenAirInterface Scenario Descriptor /** @defgroup _OSD_basic Basic OpenAirInterface Scenario Descriptor
......
...@@ -1362,4 +1362,10 @@ void oai_emu_ho_init(Handover_info* ho_info){ ...@@ -1362,4 +1362,10 @@ void oai_emu_ho_init(Handover_info* ho_info){
ho_info->hys=-1; ho_info->hys=-1;
ho_info->ttt_ms=-1; ho_info->ttt_ms=-1;
ho_info->ofn=-1; ho_info->ofn=-1;
ho_info->ocn=-1;
ho_info->ofs=-1;
ho_info->ocs=-1;
ho_info->off=-1;
ho_info->rsrp_filter_coeff=-1;
ho_info->rsrq_filter_coeff=-1;
} }
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