Commit 92fda18a authored by Xenofon Foukas's avatar Xenofon Foukas

Added brief documentation of agent API functions

parent b6c7909d
......@@ -138,16 +138,12 @@ void *receive_thread(void *args) {
Protocol__FlexranMessage *msg;
while (1) {
//if (enb_agent_msg_recv(d->enb_id, ENB_AGENT_DEFAULT, &data, &size, &priority)) {
// err_code = PROTOCOL__FLEXRAN_ERR__MSG_DEQUEUING;
// goto error;
//}
while (enb_agent_msg_recv(d->enb_id, ENB_AGENT_DEFAULT, &data, &size, &priority) == 0) {
LOG_D(ENB_AGENT,"received message with size %d\n", size);
// Invoke the message handler
msg=enb_agent_handle_message(d->enb_id, data, size);
free(data);
......@@ -317,26 +313,6 @@ error:
}
/* int enb_agent_stop(mid_t mod_id){ */
/* int i=0; */
/* enb_agent_destroy_timers(); */
/* for ( i =0; i < enb_agent_info.nb_modules; i++) { */
/* destroy_link_manager(enb_agent[i].manager); */
/* destroy_message_queue(enb_agent[i].send_queue); */
/* destroy_message_queue(enb_agent[i].receive_queue); */
/* close_link(enb_agent[i].link); */
/* } */
/* } */
Protocol__FlexranMessage *enb_agent_timeout(void* args){
// enb_agent_timer_args_t *timer_args = calloc(1, sizeof(*timer_args));
......
......@@ -41,10 +41,15 @@
#include "enb_config.h" // for enb properties
#include "enb_agent_common.h"
int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties);
/* Initiation and termination of the eNodeB agent */
int enb_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properties);
int enb_agent_stop(mid_t mod_id);
/*
* enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller
* and can interact with other itti tasks
*/
void *enb_agent_task(void *args);
#endif
......@@ -47,12 +47,16 @@ typedef struct {
link_manager_t *manager;
} enb_agent_async_channel_t;
/* Create a new channel for a given destination ip and destination port */
enb_agent_async_channel_t * enb_agent_async_channel_info(mid_t mod_id, char *dst_ip, uint16_t dst_port);
/* Send a message to the given channel */
int enb_agent_async_msg_send(void *data, int size, int priority, void *channel_info);
/* Receive a message from a given channel */
int enb_agent_async_msg_recv(void **data, int *size, int *priority, void *channel_info);
/* Release a channel */
void enb_agent_async_release(enb_agent_channel_t *channel);
......
......@@ -51,6 +51,7 @@
void * enb[NUM_MAX_ENB];
void * enb_ue[NUM_MAX_ENB];
void * enb_rrc[NUM_MAX_ENB];
/*
* message primitives
*/
......@@ -446,6 +447,7 @@ int enb_agent_destroy_agent_reconfiguration(Protocol__FlexranMessage *msg) {
/*TODO: Dealocate memory for a dynamically allocated agent reconfiguration message*/
}
/*
* get generic info from RAN
*/
......@@ -541,7 +543,7 @@ int get_num_ues (mid_t mod_id){
return ((UE_list_t *)enb_ue[mod_id])->num_UEs;
}
int get_ue_crnti (mid_t mod_id, mid_t ue_id){
int get_ue_crnti (mid_t mod_id, mid_t ue_id) {
return UE_RNTI(mod_id, ue_id);
}
......@@ -608,13 +610,12 @@ int get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id,int CC_id)
else
return 0;
}
int get_active_CC(mid_t mod_id, mid_t ue_id)
{
int get_active_CC(mid_t mod_id, mid_t ue_id) {
return ((UE_list_t *)enb_ue[mod_id])->numactiveCCs[ue_id];
}
int get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id)
{
int get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id) {
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
int pCCid = UE_PCCID(mod_id,ue_id);
......@@ -629,8 +630,7 @@ int get_current_RI(mid_t mod_id, mid_t ue_id, int CC_id)
return eNB_UE_stats[CC_id].rank;
}
int get_tpc(mid_t mod_id, mid_t ue_id)
{
int get_tpc(mid_t mod_id, mid_t ue_id) {
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
int32_t normalized_rx_power, target_rx_power;
int tpc = 1;
......@@ -660,8 +660,7 @@ int get_tpc(mid_t mod_id, mid_t ue_id)
return tpc;
}
int get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, const int frame, const uint8_t subframe, int *id, int *status) //flag_id_status = 0 then id, else status
{
int get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, const int frame, const uint8_t subframe, int *id, int *status) { //flag_id_status = 0 then id, else status
/*TODO: Add int TB in function parameters to get the status of the second TB. This can be done to by editing in
* get_ue_active_harq_pid function in line 272 file: phy_procedures_lte_eNB.c to add
* DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/
......@@ -684,8 +683,7 @@ int get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, const i
return 0;
}
int get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id)
{
int get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id) {
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
uint32_t rnti = get_ue_crnti(mod_id,ue_id);
......@@ -703,8 +701,7 @@ int get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id)
return -1;
}
int get_p0_nominal_pucch(mid_t mod_id, int CC_id)
{
int get_p0_nominal_pucch(mid_t mod_id, int CC_id) {
int32_t pucch_rx_received = mac_xface->get_target_pucch_rx_power(mod_id, CC_id);
return pucch_rx_received;
}
......@@ -716,43 +713,42 @@ int get_p0_nominal_pucch(mid_t mod_id, int CC_id)
* ************************************
*/
int get_hopping_offset(mid_t mod_id, int CC_id)
{
int get_hopping_offset(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->pusch_config_common.pusch_HoppingOffset;
}
int get_hopping_mode(mid_t mod_id, int CC_id)
{
int get_hopping_mode(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->pusch_config_common.hoppingMode;
}
int get_n_SB(mid_t mod_id, int CC_id)
{
int get_n_SB(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->pusch_config_common.n_SB;
}
int get_enable64QAM(mid_t mod_id, int CC_id)
{
int get_enable64QAM(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->pusch_config_common.enable64QAM;
}
int get_phich_duration(mid_t mod_id, int CC_id)
{
int get_phich_duration(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->phich_config_common.phich_duration;
}
int get_phich_resource(mid_t mod_id, int CC_id)
{
int get_phich_resource(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
......@@ -767,132 +763,132 @@ int get_phich_resource(mid_t mod_id, int CC_id)
return -1;
}
int get_n1pucch_an(mid_t mod_id, int CC_id)
{
int get_n1pucch_an(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->pucch_config_common.n1PUCCH_AN;
}
int get_nRB_CQI(mid_t mod_id, int CC_id)
{
int get_nRB_CQI(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->pucch_config_common.nRB_CQI;
}
int get_deltaPUCCH_Shift(mid_t mod_id, int CC_id)
{
int get_deltaPUCCH_Shift(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->pucch_config_common.deltaPUCCH_Shift;
}
int get_prach_ConfigIndex(mid_t mod_id, int CC_id)
{
int get_prach_ConfigIndex(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
}
int get_prach_FreqOffset(mid_t mod_id, int CC_id)
{
int get_prach_FreqOffset(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset;
}
int get_maxHARQ_Msg3Tx(mid_t mod_id, int CC_id)
{
int get_maxHARQ_Msg3Tx(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->maxHARQ_Msg3Tx;
}
int get_ul_cyclic_prefix_length(mid_t mod_id, int CC_id)
{
int get_ul_cyclic_prefix_length(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->Ncp_UL;
}
int get_dl_cyclic_prefix_length(mid_t mod_id, int CC_id)
{
int get_dl_cyclic_prefix_length(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->Ncp;
}
int get_cell_id(mid_t mod_id, int CC_id)
{
int get_cell_id(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->Nid_cell;
}
int get_srs_BandwidthConfig(mid_t mod_id, int CC_id)
{
int get_srs_BandwidthConfig(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig;
}
int get_srs_SubframeConfig(mid_t mod_id, int CC_id)
{
int get_srs_SubframeConfig(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->soundingrs_ul_config_common.srs_SubframeConfig;
}
int get_srs_MaxUpPts(mid_t mod_id, int CC_id)
{
int get_srs_MaxUpPts(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->soundingrs_ul_config_common.srs_MaxUpPts;
}
int get_N_RB_DL(mid_t mod_id, int CC_id)
{
int get_N_RB_DL(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->N_RB_DL;
}
int get_N_RB_UL(mid_t mod_id, int CC_id)
{
int get_N_RB_UL(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->N_RB_UL;
}
int get_subframe_assignment(mid_t mod_id, int CC_id)
{
int get_subframe_assignment(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->tdd_config;
}
int get_special_subframe_assignment(mid_t mod_id, int CC_id)
{
int get_special_subframe_assignment(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
return frame_parms->tdd_config_S;
}
int get_ra_ResponseWindowSize(mid_t mod_id, int CC_id)
{
int get_ra_ResponseWindowSize(mid_t mod_id, int CC_id) {
Enb_properties_array_t *enb_properties;
enb_properties = enb_config_get();
return enb_properties->properties[mod_id]->rach_raResponseWindowSize[CC_id];
}
int get_mac_ContentionResolutionTimer(mid_t mod_id, int CC_id)
{
int get_mac_ContentionResolutionTimer(mid_t mod_id, int CC_id) {
Enb_properties_array_t *enb_properties;
enb_properties = enb_config_get();
return enb_properties->properties[mod_id]->rach_macContentionResolutionTimer[CC_id];
}
int get_duplex_mode(mid_t mod_id, int CC_id)
{
int get_duplex_mode(mid_t mod_id, int CC_id) {
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(mod_id, CC_id);
......@@ -903,21 +899,23 @@ int get_duplex_mode(mid_t mod_id, int CC_id)
return -1;
}
long get_si_window_length(mid_t mod_id, int CC_id)
{
long get_si_window_length(mid_t mod_id, int CC_id) {
return ((eNB_RRC_INST *)enb_rrc[mod_id])->carrier[CC_id].sib1->si_WindowLength;
}
int get_sib1_length(mid_t mod_id, int CC_id)
{
int get_sib1_length(mid_t mod_id, int CC_id) {
return ((eNB_RRC_INST *)enb_rrc[mod_id])->carrier[CC_id].sizeof_SIB1;
}
int get_num_pdcch_symb(mid_t mod_id, int CC_id)
{
int get_num_pdcch_symb(mid_t mod_id, int CC_id) {
/* TODO: This should return the number of PDCCH symbols initially used by the cell CC_id */
return 0;
//(PHY_vars_UE_g[mod_id][CC_id]->lte_ue_pdcch_vars[mod_id]->num_pdcch_symbols);
}
/*
* ************************************
* Get Messages for UE Configuration Reply
......@@ -925,8 +923,7 @@ int get_num_pdcch_symb(mid_t mod_id, int CC_id)
*/
int get_time_alignment_timer(mid_t mod_id, mid_t ue_id)
{
int get_time_alignment_timer(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);
......@@ -982,18 +979,16 @@ int get_meas_gap_config_offset(mid_t mod_id, mid_t ue_id) {
return -1;
}
int get_ue_aggregated_max_bitrate_dl (mid_t mod_id, mid_t ue_id)
{
int get_ue_aggregated_max_bitrate_dl (mid_t mod_id, mid_t ue_id) {
return ((UE_list_t *)enb_ue[mod_id])->UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateDL;
}
int get_ue_aggregated_max_bitrate_ul (mid_t mod_id, mid_t ue_id)
{
int get_ue_aggregated_max_bitrate_ul (mid_t mod_id, mid_t ue_id) {
return ((UE_list_t *)enb_ue[mod_id])->UE_sched_ctrl[ue_id].ue_AggregatedMaximumBitrateUL;
}
int get_half_duplex(mid_t ue_id)
{
int get_half_duplex(mid_t ue_id) {
// TODO
//int halfduplex = 0;
//int bands_to_scan = ((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.count;
//for (int i =0; i < bands_to_scan; i++){
......@@ -1003,37 +998,32 @@ int get_half_duplex(mid_t ue_id)
//return halfduplex;
}
int get_intra_sf_hopping(mid_t ue_id)
{
int get_intra_sf_hopping(mid_t ue_id) {
//TODO:Get proper value
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
//return (0 & ( 1 << (31)));
}
int get_type2_sb_1(mid_t ue_id)
{
int get_type2_sb_1(mid_t ue_id) {
//TODO:Get proper value
//uint8_t temp = 0;
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
//return (temp & ( 1 << (11)));
}
int get_ue_category(mid_t ue_id)
{
int get_ue_category(mid_t ue_id) {
//TODO:Get proper value
//return (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->ue_Category);
}
int get_res_alloc_type1(mid_t ue_id)
{
int get_res_alloc_type1(mid_t ue_id) {
//TODO:Get proper value
//uint8_t temp = 0;
//temp = (((UE_RRC_INST *)enb_ue_rrc[ue_id])->UECap->UE_EUTRA_Capability->featureGroupIndicators->buf);
//return (temp & ( 1 << (30)));
}
int get_ue_transmission_mode(mid_t mod_id, mid_t ue_id)
{
int get_ue_transmission_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);
......@@ -1049,8 +1039,7 @@ int get_ue_transmission_mode(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_tti_bundling(mid_t mod_id, mid_t ue_id)
{
int get_tti_bundling(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);
......@@ -1078,8 +1067,7 @@ int get_maxHARQ_TX(mid_t mod_id, mid_t ue_id) {
return -1;
}
int get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id)
{
int get_beta_offset_ack_index(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);
......@@ -1094,8 +1082,7 @@ int get_beta_offset_ack_index(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id)
{
int get_beta_offset_ri_index(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);
......@@ -1110,8 +1097,7 @@ int get_beta_offset_ri_index(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id)
{
int get_beta_offset_cqi_index(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);
......@@ -1126,8 +1112,7 @@ int get_beta_offset_cqi_index(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id)
{
int get_simultaneous_ack_nack_cqi(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);
......@@ -1142,8 +1127,7 @@ int get_simultaneous_ack_nack_cqi(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_ack_nack_simultaneous_trans(mid_t mod_id,mid_t ue_id)
{
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;
}
......@@ -1161,8 +1145,7 @@ int get_aperiodic_cqi_rep_mode(mid_t mod_id,mid_t ue_id) {
return -1;
}
int get_tdd_ack_nack_feedback(mid_t mod_id, mid_t ue_id)
{
int get_tdd_ack_nack_feedback(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);
......@@ -1178,8 +1161,7 @@ int get_tdd_ack_nack_feedback(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_ack_nack_repetition_factor(mid_t mod_id, mid_t ue_id)
{
int get_ack_nack_repetition_factor(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);
......@@ -1213,8 +1195,7 @@ int get_extended_bsr_size(mid_t mod_id, mid_t ue_id) {
return -1;
}
int get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id)
{
int get_ue_transmission_antenna(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);
......@@ -1235,8 +1216,7 @@ int get_ue_transmission_antenna(mid_t mod_id, mid_t ue_id)
return -1;
}
int get_lcg(mid_t ue_id, mid_t lc_id)
{
int get_lcg(mid_t ue_id, mid_t lc_id) {
if (UE_mac_inst == NULL) {
return -1;
}
......@@ -1247,8 +1227,7 @@ int get_lcg(mid_t ue_id, mid_t lc_id)
}
}
int get_direction(mid_t ue_id, mid_t lc_id)
{
int get_direction(mid_t ue_id, mid_t lc_id) {
/*TODO: fill with the value for the rest of LCID*/
if(lc_id == DCCH | lc_id == DCCH1)
return 2;
......@@ -1293,43 +1272,37 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
int i =find_UE_id(mod_id,rnti);
config->has_rnti = 1;
config->rnti = rnti;
//TODO: Set the time_alignment_timer
if(get_time_alignment_timer(mod_id,i) != -1){
config->time_alignment_timer = get_time_alignment_timer(mod_id,i);
config->has_time_alignment_timer = 1;
}
//TODO: Set the measurement gap configuration pattern
if(get_meas_gap_config(mod_id,i) != -1){
config->meas_gap_config_pattern = get_meas_gap_config(mod_id,i);
config->has_meas_gap_config_pattern = 1;
}
//TODO: Set the measurement gap offset if applicable
if(config->has_meas_gap_config_pattern == 1 &&
config->meas_gap_config_pattern != PROTOCOL__FLEX_MEAS_GAP_CONFIG_PATTERN__FLMGCP_OFF) {
config->meas_gap_config_sf_offset = get_meas_gap_config_offset(mod_id,i);
config->has_meas_gap_config_sf_offset = 1;
}
//TODO: Set the SPS configuration (Optional)
//Not supported for noe, so we do not set it
//Not supported for now, so we do not set it
//TODO: Set the SR configuration (Optional)
//We do not set it for now
//TODO: Set the CQI configuration (Optional)
//We do not set it for now
//TODO: Set the transmission mode
if(get_ue_transmission_mode(mod_id,i) != -1){
if(get_ue_transmission_mode(mod_id,i) != -1){
config->transmission_mode = get_ue_transmission_mode(mod_id,i);
config->has_transmission_mode = 1;
}
//TODO: Set the aggregated bit-rate of the non-gbr bearer (UL)
config->ue_aggregated_max_bitrate_ul = get_ue_aggregated_max_bitrate_ul(mod_id,i);
config->ue_aggregated_max_bitrate_ul = get_ue_aggregated_max_bitrate_ul(mod_id,i);
config->has_ue_aggregated_max_bitrate_ul = 1;
//TODO: Set the aggregated bit-rate of the non-gbr bearer (DL)
config->ue_aggregated_max_bitrate_dl = get_ue_aggregated_max_bitrate_dl(mod_id,i);
config->ue_aggregated_max_bitrate_dl = get_ue_aggregated_max_bitrate_dl(mod_id,i);
config->has_ue_aggregated_max_bitrate_dl = 1;
//TODO: Set the UE capabilities
......@@ -1337,63 +1310,63 @@ int enb_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change)
c_capabilities = malloc(sizeof(Protocol__FlexUeCapabilities));
protocol__flex_ue_capabilities__init(c_capabilities);
//TODO: Set half duplex (FDD operation)
c_capabilities->has_half_duplex = 1;
c_capabilities->has_half_duplex = 0;
c_capabilities->half_duplex = 1;//get_half_duplex(i);
//TODO: Set intra-frame hopping flag
c_capabilities->has_intra_sf_hopping = 1;
c_capabilities->has_intra_sf_hopping = 0;
c_capabilities->intra_sf_hopping = 1;//get_intra_sf_hopping(i);
//TODO: Set support for type 2 hopping with n_sb > 1
c_capabilities->has_type2_sb_1 = 1;
c_capabilities->has_type2_sb_1 = 0;
c_capabilities->type2_sb_1 = 1;//get_type2_sb_1(i);
//TODO: Set ue category
c_capabilities->has_ue_category = 1;
c_capabilities->has_ue_category = 0;
c_capabilities->ue_category = 1;//get_ue_category(i);
//TODO: Set UE support for resource allocation type 1
c_capabilities->has_res_alloc_type1 = 1;
c_capabilities->has_res_alloc_type1 = 0;
c_capabilities->res_alloc_type1 = 1;//get_res_alloc_type1(i);
//Set the capabilites to the message
config->capabilities = c_capabilities;
//TODO: Set UE transmission antenna. One of the FLUTA_* values
if(get_ue_transmission_antenna(mod_id,i) != -1){
config->has_ue_transmission_antenna = 1;
config->ue_transmission_antenna = get_ue_transmission_antenna(mod_id,i);
}
//TODO: Set tti bundling flag (See ts 36.321)
if(get_tti_bundling(mod_id,i) != -1){
config->has_tti_bundling = 1;
config->tti_bundling = get_tti_bundling(mod_id,i);
}
//TODO: Set the max HARQ retransmission for the UL
if(get_maxHARQ_TX(mod_id,i) != -1){
config->has_max_harq_tx = 1;
config->max_harq_tx = get_maxHARQ_TX(mod_id,i);
}
//TODO: Fill beta_offset_ack_index (TS 36.213)
if(get_beta_offset_ack_index(mod_id,i) != -1){
config->has_beta_offset_ack_index = 1;
config->beta_offset_ack_index = get_beta_offset_ack_index(mod_id,i);
}
//TODO: Fill beta_offset_ri_index (TS 36.213)
if(get_beta_offset_ri_index(mod_id,i) != -1){
config->has_beta_offset_ri_index = 1;
config->beta_offset_ri_index = get_beta_offset_ri_index(mod_id,i);
}
//TODO: Fill beta_offset_cqi_index (TS 36.213)
if(get_beta_offset_cqi_index(mod_id,i) != -1){
config->has_beta_offset_cqi_index = 1;
config->beta_offset_cqi_index = get_beta_offset_cqi_index(mod_id,i);
}
//TODO: Fill ack_nack_simultaneous_trans (TS 36.213)
if(get_ack_nack_simultaneous_trans(mod_id,i) != -1){
config->has_ack_nack_simultaneous_trans = 1;
config->ack_nack_simultaneous_trans = get_ack_nack_simultaneous_trans(mod_id,i);
}
//TODO: Fill simultaneous_ack_nack_cqi (TS 36.213)
if(get_simultaneous_ack_nack_cqi(mod_id,i) != -1){
config->has_simultaneous_ack_nack_cqi = 1;
config->simultaneous_ack_nack_cqi = get_simultaneous_ack_nack_cqi(mod_id,i);
}
//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;