Commit 24785b3a authored by Xenofon Foukas's avatar Xenofon Foukas

Fixed bugs in API function calls for UE config

parent 9bbc22f4
......@@ -852,42 +852,45 @@ int get_time_alignment_timer(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_meas_gap_config(mid_t mod_id, mid_t ue_id)
{
int get_meas_gap_config(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = get_ue_crnti(mod_id,ue_id);
LOG_I(ENB_APP,"The value of rntiP is %d\n",rntiP);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL)
{
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measGapConfig != NULL){
if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_NOTHING)
return 2;
else if (ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_release)
return 0;
else if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_setup)
return 1;
if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_setup) {
if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp0) {
return PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_GP1;
} else if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp1) {
return PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_GP2;
} else {
return PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_OFF;
}
}
}
}
else
return -1;
}
int get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id)
{
int get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = get_ue_crnti(mod_id,ue_id);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL)
{
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measGapConfig != NULL){
return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present;
if(ue_context_p->ue_context.measGapConfig->present == MeasGapConfig_PR_setup) {
if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp0) {
return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.choice.gp0;
} else if (ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.present == MeasGapConfig__setup__gapOffset_PR_gp1) {
return ue_context_p->ue_context.measGapConfig->choice.setup.gapOffset.choice.gp0;
}
}
}
}
else
return -1;
}
......@@ -974,19 +977,16 @@ int get_tti_bundling(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_maxHARQ_TX(mid_t mod_id, mid_t ue_id)
{
int get_maxHARQ_TX(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = get_ue_crnti(mod_id,ue_id);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL)
{
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.mac_MainConfig != NULL){
return ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
return *ue_context_p->ue_context.mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
}
}
else
return -1;
}
......@@ -1059,20 +1059,17 @@ int get_ack_nack_simultaneous_trans(mid_t mod_id,mid_t ue_id)
return (&eNB_rrc_inst[mod_id])->carrier[0].sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
}
int get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id)
{
int get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = get_ue_crnti(mod_id,ue_id);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL)
{
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.physicalConfigDedicated != NULL){
return ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
return *ue_context_p->ue_context.physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
}
}
else
return -1;
}
......@@ -1109,18 +1106,19 @@ int get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_extended_bsr_size(mid_t mod_id, mid_t ue_id)
{
int get_extended_bsr_size(mid_t mod_id, mid_t ue_id) {
//TODO: need to double check
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = get_ue_crnti(mod_id,ue_id);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL)
{
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.mac_MainConfig != NULL){
if(ue_context_p->ue_context.mac_MainConfig->ext2 != NULL){
return ue_context_p->ue_context.mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10;
long val = (*(ue_context_p->ue_context.mac_MainConfig->ext2->mac_MainConfig_v1020->extendedBSR_Sizes_r10));
if (val > 0) {
return 1;
}
}
}
}
......@@ -1217,7 +1215,8 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
config->has_meas_gap_config_pattern = 1;
}
//TODO: Set the measurement gap offset if applicable
if(get_meas_gap_config_offset(mod_id,i) != -1){
if(config->has_meas_gap_config_pattern == 1 &&
config->meas_gap_config_pattern != PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_OFF) {
config->meas_gap_config_sf_offset = get_meas_gap_config_offset(mod_id,i);
config->has_meas_gap_config_sf_offset = 1;
}
......@@ -1308,20 +1307,25 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
//TODO: Set PRACRM_* value regarding aperiodic cqi report mode
if(get_aperiodic_cqi_rep_mode(mod_id,i) != -1){
config->has_aperiodic_cqi_rep_mode = 1;
config->aperiodic_cqi_rep_mode = get_aperiodic_cqi_rep_mode(mod_id,i);
int mode = get_aperiodic_cqi_rep_mode(mod_id,i);
if (mode > 4) {
config->aperiodic_cqi_rep_mode = PROTOCOL__PRP_APERIODIC_CQI_REPORT_MODE__PRACRM_NONE;
} else {
config->aperiodic_cqi_rep_mode = mode;
}
}
//TODO: Set tdd_ack_nack_feedback
if(get_tdd_ack_nack_feedback != -1){
if(get_tdd_ack_nack_feedback(mod_id, i) != -1){
config->has_tdd_ack_nack_feedback = 1;
config->tdd_ack_nack_feedback = get_tdd_ack_nack_feedback(mod_id,i);
}
//TODO: Set ack_nack_repetition factor
if(get_ack_nack_repetition_factor != -1){
if(get_ack_nack_repetition_factor(mod_id, i) != -1){
config->has_ack_nack_repetition_factor = 1;
config->ack_nack_repetition_factor = get_ack_nack_repetition_factor(mod_id,i);
}
//TODO: Set extended BSR size
if(get_extended_bsr_size != -1){
if(get_extended_bsr_size(mod_id, i) != -1){
config->has_extended_bsr_size = 1;
config->extended_bsr_size = get_extended_bsr_size(mod_id,i);
}
......@@ -1544,7 +1548,8 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
ue_config[i]->has_meas_gap_config_pattern = 1;
}
//TODO: Set the measurement gap offset if applicable
if(get_meas_gap_config_offset(mod_id,i) != -1){
if(ue_config[i]->has_meas_gap_config_pattern == 1 &&
ue_config[i]->meas_gap_config_pattern != PROTOCOL__PRP_MEAS_GAP_CONFIG_PATTERN__PRMGCP_OFF) {
ue_config[i]->meas_gap_config_sf_offset = get_meas_gap_config_offset(mod_id,i);
ue_config[i]->has_meas_gap_config_sf_offset = 1;
}
......@@ -1635,20 +1640,25 @@ int enb_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Progra
//TODO: Set PRACRM_* value regarding aperiodic cqi report mode
if(get_aperiodic_cqi_rep_mode(mod_id,i) != -1){
ue_config[i]->has_aperiodic_cqi_rep_mode = 1;
ue_config[i]->aperiodic_cqi_rep_mode = get_aperiodic_cqi_rep_mode(mod_id,i);
int mode = get_aperiodic_cqi_rep_mode(mod_id,i);
if (mode > 4) {
ue_config[i]->aperiodic_cqi_rep_mode = PROTOCOL__PRP_APERIODIC_CQI_REPORT_MODE__PRACRM_NONE;
} else {
ue_config[i]->aperiodic_cqi_rep_mode = mode;
}
}
//TODO: Set tdd_ack_nack_feedback
if(get_tdd_ack_nack_feedback != -1){
if(get_tdd_ack_nack_feedback(mod_id, i) != -1){
ue_config[i]->has_tdd_ack_nack_feedback = 1;
ue_config[i]->tdd_ack_nack_feedback = get_tdd_ack_nack_feedback(mod_id,i);
}
//TODO: Set ack_nack_repetition factor
if(get_ack_nack_repetition_factor != -1){
if(get_ack_nack_repetition_factor(mod_id, i) != -1){
ue_config[i]->has_ack_nack_repetition_factor = 1;
ue_config[i]->ack_nack_repetition_factor = get_ack_nack_repetition_factor(mod_id,i);
}
//TODO: Set extended BSR size
if(get_extended_bsr_size != -1){
if(get_extended_bsr_size(mod_id, i) != -1){
ue_config[i]->has_extended_bsr_size = 1;
ue_config[i]->extended_bsr_size = get_extended_bsr_size(mod_id,i);
}
......
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