Commit 1b90c4a0 authored by Konstantinos Alexandris's avatar Konstantinos Alexandris Committed by Robert Schmidt

Create RRC setters for Periodic, A1-A5 event and offsets related to RRC Measurement Report

parent 1de4b740
......@@ -887,6 +887,7 @@ add_library(FLEXRAN_AGENT
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PHY/flexran_agent_phy.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc_internal.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PDCP/flexran_agent_pdcp.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_task_manager.c
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "flexran_agent_rrc_internal.h"
#include "flexran_agent_ran_api.h"
int update_rrc_reconfig(mid_t mod_id, rnti_t rnti, Protocol__FlexRrcTriggering *trigg) {
// Measurement info reconfiguration
if (trigg->meas_info) {
/* Set serving cell frequency offset */
if (trigg->meas_info->has_offset_freq_serving) {
if (flexran_set_rrc_ofp(mod_id, rnti, trigg->meas_info->offset_freq_serving) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Serving cell frequency offset\n");
return -1;
}
}
/* Set neighbouring cell frequency offset */
if (trigg->meas_info->has_offset_freq_neighbouring) {
if (flexran_set_rrc_ofn(mod_id, rnti, trigg->meas_info->offset_freq_neighbouring) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell frequency offset\n");
return -1;
}
}
if (trigg->meas_info->n_cell_individual_offset > 0) {
/* Set the serving cell offset */
if (flexran_set_rrc_ocp(mod_id, rnti, trigg->meas_info->cell_individual_offset[0]) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Serving cell offset\n");
return -1;
}
/* Set the neighbouring cell offset */
for (int i=0; i<(trigg->meas_info->n_cell_individual_offset-1); i++) {
if (flexran_set_rrc_ocn(mod_id, rnti, i, trigg->meas_info->cell_individual_offset[i+1]) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell offset\n");
return -1;
}
}
}
if (trigg->meas_info->has_offset_freq_neighbouring) {
if (flexran_set_rrc_ofn(mod_id, rnti, trigg->meas_info->offset_freq_neighbouring) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell frequency offset\n");
return -1;
}
}
/* Set rsrp filter coefficient */
if (trigg->meas_info->has_filter_coefficient_rsrp) {
if (flexran_set_filter_coeff_rsrp(mod_id, rnti, trigg->meas_info->filter_coefficient_rsrp) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set RSRP filter coefficient\n");
return -1;
}
}
/* Set rsrq filter coefficient */
if (trigg->meas_info->has_filter_coefficient_rsrq) {
if (flexran_set_filter_coeff_rsrq(mod_id, rnti, trigg->meas_info->filter_coefficient_rsrq) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set RSRQ filter coefficient\n");
return -1;
}
}
if (trigg->meas_info->event) {
/* Set Periodic event parameters */
if (trigg->meas_info->event->periodical) {
/* Set Periodic event maximum number of reported cells */
if (trigg->meas_info->event->periodical->has_max_report_cells) {
if (flexran_set_rrc_per_event_maxReportCells(mod_id, rnti, trigg->meas_info->event->periodical->max_report_cells) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Periodic event max\n");
return -1;
}
}
}
/* Set A3 event parameters */
if (trigg->meas_info->event->a3) {
/* Set A3 event a3 offset */
if (trigg->meas_info->event->a3->has_a3_offset) {
if (flexran_set_rrc_a3_event_a3_offset(mod_id, rnti, trigg->meas_info->event->a3->a3_offset) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event offset\n");
return -1;
}
}
/* Set A3 event report on leave */
if (trigg->meas_info->event->a3->has_report_on_leave) {
if (flexran_set_rrc_a3_event_reportOnLeave(mod_id, rnti, trigg->meas_info->event->a3->report_on_leave) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event report on leave\n");
return -1;
}
}
/* Set A3 event hysteresis */
if (trigg->meas_info->event->a3->has_hysteresis) {
if (flexran_set_rrc_a3_event_hysteresis(mod_id, rnti, trigg->meas_info->event->a3->hysteresis) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event hysteresis\n");
return -1;
}
}
/* Set A3 event time to trigger */
if (trigg->meas_info->event->a3->has_time_to_trigger) {
if (flexran_set_rrc_a3_event_timeToTrigger(mod_id, rnti, trigg->meas_info->event->a3->time_to_trigger) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event time to trigger\n");
return -1;
}
}
/* Set A3 event maximum number of reported cells */
if (trigg->meas_info->event->a3->has_max_report_cells) {
if (flexran_set_rrc_a3_event_maxReportCells(mod_id, rnti, trigg->meas_info->event->a3->max_report_cells) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event max report cells\n");
return -1;
}
}
}
}
}
return 0;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef FLEXRAN_AGENT_RRC_INTERNAL_H_
#define FLEXRAN_AGENT_RRC_INTERNAL_H_
#include "flexran_agent_rrc_internal.h"
#include "flexran_agent_ran_api.h"
int update_rrc_reconfig(mid_t mod_id, rnti_t rnti, Protocol__FlexRrcTriggering *trigg);
#endif /*FLEXRAN_AGENT_RRC_INTERNAL_H_*/
......@@ -7,7 +7,7 @@ import "time_common.proto";
import "config_messages.proto";
import "controller_commands.proto";
import "control_delegation.proto";
import "config_common.proto";
message flexran_message {
optional flexran_direction msg_dir = 100;
......@@ -188,7 +188,8 @@ message flex_ul_mac_config {
message flex_rrc_triggering {
optional flex_header header = 1;
optional string rrc_trigger = 2;
optional string rrc_trigger = 2;
optional flex_measurement_info meas_info = 3;
}
//
......
......@@ -41,6 +41,7 @@
//#include "PHY/extern.h"
#include "common/utils/LOG/log.h"
#include "flexran_agent_mac_internal.h"
#include "flexran_agent_rrc_internal.h"
//#include "SCHED/defs.h"
#include "RRC/LTE/rrc_extern.h"
......@@ -805,10 +806,12 @@ error:
int flexran_agent_rrc_measurement(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
protocol_ctxt_t ctxt;
//protocol_ctxt_t ctxt;
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexRrcTriggering *triggering = input->rrc_triggering;
agent_reconf_rrc *reconf_param = malloc(sizeof(agent_reconf_rrc));
//agent_reconf_rrc *rrc_reconf = malloc(sizeof(agent_reconf_rrc));
#if 0
reconf_param->trigger_policy = triggering->rrc_trigger;
reconf_param->report_interval = 0;
reconf_param->report_amount = 0;
......@@ -817,9 +820,51 @@ int flexran_agent_rrc_measurement(mid_t mod_id, const void *params, Protocol__Fl
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, ue_context_p->ue_context.rnti, flexran_get_current_frame(mod_id), flexran_get_current_subframe (mod_id), mod_id);
flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(&ctxt, ue_context_p, 0, reconf_param);
}
#endif
// TODO: Step 1 - Verification process
// Step 2 - Set the proper values using FlexRAN API (protected with mutex ?)
int num_ue = 0;
if (flexran_agent_get_rrc_xface(mod_id))
num_ue = flexran_get_rrc_num_ues(mod_id);
else if (flexran_agent_get_mac_xface(mod_id))
num_ue = flexran_get_mac_num_ues(mod_id);
if (flexran_agent_get_rrc_xface(mod_id) && flexran_agent_get_mac_xface(mod_id)
&& flexran_get_rrc_num_ues(mod_id) != flexran_get_mac_num_ues(mod_id)) {
const int nrrc = flexran_get_rrc_num_ues(mod_id);
const int nmac = flexran_get_mac_num_ues(mod_id);
num_ue = nrrc < nmac ? nrrc : nmac;
LOG_E(FLEXRAN_AGENT, "%s(): different numbers of UEs in RRC (%d) and MAC (%d), reporting for %d UEs\n",
__func__, nrrc, nmac, num_ue);
}
if (num_ue == 0)
return 0;
int error = 0;
rnti_t rntis[num_ue];
flexran_get_rrc_rnti_list(mod_id, rntis, num_ue);
for (int i = 0; i < num_ue; i++) {
const rnti_t rnti = rntis[i];
if (flexran_agent_get_rrc_xface(mod_id))
error = update_rrc_reconfig(mod_id, rnti, triggering);
if (error < 0) {
LOG_E(FLEXRAN_AGENT, "Error in updating user %d\n", i);
}
else {
// Step 3 - Call the proper wrapper in FlexRAN API
if (flexran_call_rrc_reconfiguration (mod_id, rnti) <0) {
LOG_E(FLEXRAN_AGENT, "Error in reconfiguring user %d\n", i);
}
}
}
*msg = NULL;
free(reconf_param);
reconf_param = NULL;
//free(reconf_param);
//reconf_param = NULL;
return 0;
}
......
This diff is collapsed.
......@@ -498,6 +498,9 @@ uint32_t flexran_get_pdcp_rx_aiat_w(mid_t mod_id, uint16_t uid, lcid_t lcid);
uint32_t flexran_get_pdcp_rx_oo(mid_t mod_id, uint16_t uid, lcid_t lcid);
/*********************RRC**********************/
/* Call RRC Reconfiguration wrapper function */
int flexran_call_rrc_reconfiguration (mid_t mod_id, rnti_t rnti);
/*Get primary cell measuremeant id flexRAN*/
LTE_MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, rnti_t rnti);
......@@ -576,6 +579,42 @@ long flexran_get_filter_coeff_rsrp(mid_t mod_id, rnti_t rnti);
/* Get filter coefficient for rsrq */
long flexran_get_filter_coeff_rsrq(mid_t mod_id, rnti_t rnti);
/* Set ofp offset */
int flexran_set_rrc_ofp(mid_t mod_id, rnti_t rnti, long offsetFreq);
/* Set ofn offset */
int flexran_set_rrc_ofn(mid_t mod_id, rnti_t rnti, long offsetFreq);
/* Set ocp offset */
int flexran_set_rrc_ocp(mid_t mod_id, rnti_t rnti, long cellIndividualOffset);
/* Set ocn offset */
int flexran_set_rrc_ocn(mid_t mod_id, rnti_t rnti, long cell_id, long cellIndividualOffset);
/* Set Periodic Event max reported cells */
int flexran_set_rrc_per_event_maxReportCells(mid_t mod_id, rnti_t rnti, long maxReportCells);
/* Set A3 Event hysteresis */
int flexran_set_rrc_a3_event_hysteresis(mid_t mod_id, rnti_t rnti, long hysteresis);
/* Set A3 Event time to trigger */
int flexran_set_rrc_a3_event_timeToTrigger(mid_t mod_id, rnti_t rnti, long timeToTrigger);
/* Set A3 Event max reported cells */
int flexran_set_rrc_a3_event_maxReportCells(mid_t mod_id, rnti_t rnti, long maxReportCells);
/* Set A3 Event a3 offset */
int flexran_set_rrc_a3_event_a3_offset(mid_t mod_id, rnti_t rnti, long a3_offset);
/* Set A3 Event report on leave */
int flexran_set_rrc_a3_event_reportOnLeave(mid_t mod_id, rnti_t rnti, int reportOnLeave);
/* Set filter coefficient for rsrp */
int flexran_set_filter_coeff_rsrp(mid_t mod_id, rnti_t rnti, long filterCoefficientRSRP);
/* Set filter coefficient for rsrq */
int flexran_set_filter_coeff_rsrq(mid_t mod_id, rnti_t rnti, long filterCoefficientRSRQ);
/* Get number of PLMNs that is broadcasted in SIB1 */
uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id);
......
This diff is collapsed.
......@@ -306,8 +306,7 @@ void
flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *const ue_context_pP,
const uint8_t ho_state,
agent_reconf_rrc *trig_param
const uint8_t ho_state
);
void
rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
......
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