Commit c0dabdbf authored by alexandr's avatar alexandr

CLI for HO parameters

parent 205ae6e9
......@@ -827,6 +827,7 @@ typedef struct {
typedef struct {
long hys;
long ttt_ms;
long ofn;
}Handover_eNB_info;
/*! \brief eNB common channels */
......
......@@ -3624,12 +3624,19 @@ void ue_measurement_report_triggering( const protocol_ctxt_t* const ctxt_pP, con
(UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.present==ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA) &&
(UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.present ==
ReportConfigEUTRA__triggerType_PR_event)) {
hys = UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis;
if(!((hys=get_hys(ctxt_pP->module_id))>=0))
hys = UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.hysteresis;
//LOG_D(RRC,"Hysteresis for eNB %d is set to %ld\n",ctxt_pP->module_id,hys);
//LOG_N(RRC,"[UE%d] Frame %d Check below lines for segfault :), Fix me \n",ctxt_pP->module_id, frameP);
ttt_ms = timeToTrigger_ms[UE_rrc_inst[ctxt_pP->module_id].ReportConfig[i][reportConfigId
-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger];
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);
// Freq specific offset of neighbor cell freq
ofn = 5;//((UE_rrc_inst[ctxt_pP->module_id].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq != NULL) ?
if(!((ofn=get_ofn(ctxt_pP->module_id))>=0))
ofn=5;
//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) ?
// *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
ocn = 0;
......
......@@ -46,9 +46,8 @@ void init_HO(Handover_info* ho_info)
for(enb_module_id=0; enb_module_id<NUMBER_OF_eNB_MAX; enb_module_id++) {
// Set ofn parameter
set_hys(enb_module_id,ho_info->hys);
printf("Hysteresis for eNB %d is set to %ld\n",enb_module_id,get_hys(enb_module_id));
set_ttt_ms(enb_module_id,ho_info->ttt_ms);
printf("Time to trigger for eNB %d is set to %ld\n",enb_module_id,get_ttt_ms(enb_module_id));
set_ofn(enb_module_id,ho_info->ofn);
}
}
......@@ -58,6 +57,7 @@ void init_HO(Handover_info* ho_info)
void set_hys(int enb_module_id,long hys){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.hys=hys;
printf("Hysteresis for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.hys);
}
long get_hys(int enb_module_id){
......@@ -69,6 +69,7 @@ long get_hys(int enb_module_id){
void set_ttt_ms(int enb_module_id,long ttt_ms){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ttt_ms=ttt_ms;
printf("Time to trigger for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ttt_ms);
}
long get_ttt_ms(int enb_module_id){
......@@ -76,8 +77,17 @@ long get_ttt_ms(int enb_module_id){
return eNB_mac_inst->ho_info.ttt_ms;
}
// OFN
void set_ofn(int enb_module_id,long ofn){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
eNB_mac_inst->ho_info.ofn=ofn;
printf("OFN for eNB %d is set to %ld\n",enb_module_id,eNB_mac_inst->ho_info.ofn);
}
long get_ofn(int enb_module_id){
eNB_MAC_INST *eNB_mac_inst = get_eNB_mac_inst(enb_module_id);
return eNB_mac_inst->ho_info.ofn;
}
......@@ -46,3 +46,7 @@ long get_hys(int enb_module_id);
void set_ttt_ms(int enb_module_id,long ttt_ms);
long get_ttt_ms(int enb_module_id);
void set_ofn(int enb_module_id,long ofn);
long get_ofn(int enb_module_id);
......@@ -43,6 +43,7 @@
#include "OCG_extern.h"
#include "log.h"
#include "log_extern.h"
#include "rrc_eNB_primitives.h"
extern cli_config *cli_cfg;
......@@ -223,6 +224,7 @@ int process_argument(int optc, char* optv[])
int index;
int state;
int value;
int comp=0, level=0, flag=0x34, interval=0;
while (optc > 0) {
......@@ -260,6 +262,25 @@ int process_argument(int optc, char* optv[])
return ERR;
}
// Handover CLI
// Set ofn value
if ((strcmp(*optv, "ofn") == 0) || (strcmp(*optv, "OFN") == 0) ) {
NEXT_OPT;
CHECK_OPTC;
index = atoi (*optv);
if (optc > 0) {
NEXT_OPT;
CHECK_OPTC;
value = atoi (*optv);
printf("[CLI] OFN is set to %d for eNB %d\n",value,index);
set_ofn(index,value);
} else
return ERR;
}
// fixme
if ((strcmp(*optv, "log") == 0) || (strcmp(*optv, "LOG") == 0) ) {
......
......@@ -738,6 +738,7 @@ typedef struct {
typedef struct {
long hys;
long ttt_ms;
long ofn;
}Handover_info;
/** @defgroup _OSD_basic Basic OpenAirInterface Scenario Descriptor
......
......@@ -322,6 +322,9 @@ void init_oai_emulation(void)
oai_emulation.info.transmission_mode[CC_id]=2;
}
// Handover initialization parameters
oai_emu_ho_init(&oai_emulation.ho_info);
oai_emulation.profile = "EURECOM";
}
......@@ -1354,3 +1357,9 @@ void ocg_config_proto(void)
}
void oai_emu_ho_init(Handover_info* ho_info){
ho_info->hys=-1;
ho_info->ttt_ms=-1;
ho_info->ofn=-1;
}
......@@ -253,8 +253,6 @@ void get_simulation_options(int argc, char *argv[])
{NULL, 0, NULL, 0}
};
oai_emu_ho_init(&oai_emulation.ho_info);
while ((option = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:K:l:L:m:M:n:N:oO:p:P:qQ:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) {
switch (option) {
......@@ -1580,12 +1578,6 @@ void init_time()
sleep_time_us = SLEEP_STEP_US;
td_avg = TARGET_SF_TIME_NS;
}
void oai_emu_ho_init(Handover_info* ho_info){
ho_info->hys=-1;
ho_info->ttt_ms=-1;
}
int user_control_interface(int sfn) {
......
......@@ -67,8 +67,6 @@ void exit_fun(const char* s);
void init_time(void);
void oai_emu_ho_init(Handover_info* ho_info);
void init_pad(void);
void help(void);
......
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